Repository navigation
Commit 2d4c696
authored
Add Java 21 library contracts and external effect summaries (#36)
## Description
Library calls previously lost local ownership and refinement facts when
their mutation effects or returned aliases were unknown. Add `@Modifies`
footprints and `@ReturnsView` relationships shared through Spoon's AST,
and use them in Latte and LiquidTypeChecking. Local array copies,
borrowed constructor inputs and ArrayList views retain the information
needed by later checks.
Target Java 21 in the build and CI. Add an opt-in, package-selectable
Java SE 21 catalog covering all 178 packages, 4,055 API types and 47,030
member entries: 501 stronger declarations across 190 types, including
443 mutation footprints, with explicit conservative policies elsewhere.
Generated inventories and audit reports are marked for GitHub's
generated-file handling.
Also fix the array-constructor metadata null dereference and deep
solver-translation stack overflow. Include checked examples, catalog
generation/validation tools, runtime witnesses, documentation and a
replay of the original 1,481 OpenJDK test sources.
The follow-up in
[docs/jdk21-effects-followup.md](docs/jdk21-effects-followup.md) records
specific improvements and remaining limitations. Branch-dependent
aliases and repeated allocation summaries remain imprecise. Read-only
calls still reject overlapping borrowed arguments such as
`Arrays.equals(values, values)`; this PR documents that gap rather than
claiming it is fixed.
## Example
With `--jdk all`, this now verifies because the local view captures its
backing list without making it shared:
```java
var root = new java.util.ArrayList<Integer>();
var view = root.subList(0, 0);
root.add(42);
```
The backing-list mutation invalidates the view for subsequent checked
operations. Footprints do not imply freshness; ownership and return-view
guarantees remain separate annotations.
## Related Issue
Stacked on #35, targeting `feat/external-library-refinements`. The diff
contains the Java 21 catalog, effect/view support and follow-up fixes
and audits. CI is enabled for this PR base.
## Type of change
- [x] Bug fix
- [x] New feature
- [x] Documentation update
- [x] Code refactoring
## How Has This Been Tested?
- Java 21 Maven verification and compatibility profile: **616 tests,
zero failures/errors/skips**, Spotless passes, **180/311 exact upstream
compatibility matches**. The remaining mismatches are documented, not
counted as successes.
- The tested source/catalog files are unchanged since the verified
build; subsequent edits are documentation and the CI branch trigger.
- Replayed exactly **1,481 unchanged OpenJDK sources**, with and without
the catalog: **1,460 completed pairs**, 20 catalog timeouts and one
existing Spoon type-erasure failure. These are source analyses, not
execution or proof of the complete jtreg suite.
- On the same **1,389 previously completed files**, after reviewed
expected-exception exclusions, ownership/state diagnostics increase from
**1,052 to 1,168** as additional calls are checked.
`Arrays/FloatDoubleOrder.java` becomes diagnostic-free; 14 previous
diagnostics disappear from now-clear lines. The report does not claim an
overall reduction.
- Recorded **17 focused reproductions**, including four controlled
comparisons with only the effect/view annotations removed.
- Validated audit hashes/counts, documentation links, Java 21 workflow
configuration and staged whitespace.1 parent 89ded1e commit 2d4c696
447 files changed
Lines changed: 656819 additions & 66 deletions
File tree
- .github/workflows
- audits/jdk21-upstream
- docs
- examples
- jdk21-audit
- jdk21
- refinements
- latte
- .github/workflows
- src
- main/java
- latte
- analysis
- api
- refinement
- specification
- test/java/latte
- analysis
- jdk
- refinement
- scripts
- specifications/jdk21
- api
- javax
- accessibility
- crypto/spec
- imageio/stream
- lang/model
- element
- type
- util
- management
- relation
- timer
- naming
- directory
- net/ssl
- print/attribute/standard
- security/auth/callback
- smartcardio
- sql/rowset/serial
- swing
- event
- plaf/nimbus
- table
- text
- html
- tools
- xml
- catalog
- datatype
- stream
- xpath
- java
- awt
- desktop
- event
- font
- image
- print
- io
- lang
- annotation
- constant
- invoke
- management
- module
- reflect
- math
- net
- http
- nio
- channels
- charset
- file
- attribute
- security
- cert
- sql
- text
- time
- chrono
- format
- temporal
- zone
- util
- concurrent
- locks
- random
- regex
- stream
- zip
- org
- w3c/dom
- ranges
- xml/sax
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
| |||
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
| 92 | + | |
| 93 | + | |
88 | 94 | | |
89 | 95 | | |
90 | 96 | | |
| |||
93 | 99 | | |
94 | 100 | | |
95 | 101 | | |
| 102 | + | |
| 103 | + | |
96 | 104 | | |
97 | 105 | | |
98 | 106 | | |
| |||
0 commit comments