jep511: add the star-import clash demo, java.base export count and a java.time jshell check
TwoStarImports.java, the java.base export count in output/04, the extra LocalDate line in src/imports.jsh and regenerated transcripts. Additive commit. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TF9JWFvJSNm6HVzswzZU5a
This commit is contained in:
@@ -34,6 +34,28 @@ broken/AmbiguousList.java:6: error: reference to List is ambiguous
|
||||
both class java.awt.List in java.awt and interface java.util.List in java.util match
|
||||
1 error
|
||||
|
||||
$ javac broken/TwoStarImports.java (25.0.4.1+1-LTS)
|
||||
broken/TwoStarImports.java:6: error: reference to Date is ambiguous
|
||||
Date d = new Date(0L); // the same clash, with the old on-demand imports
|
||||
^
|
||||
both class java.sql.Date in java.sql and class java.util.Date in java.util match
|
||||
broken/TwoStarImports.java:6: error: reference to Date is ambiguous
|
||||
Date d = new Date(0L); // the same clash, with the old on-demand imports
|
||||
^
|
||||
both class java.sql.Date in java.sql and class java.util.Date in java.util match
|
||||
2 errors
|
||||
|
||||
$ javac broken/TwoStarImports.java (27+35)
|
||||
broken/TwoStarImports.java:6: error: reference to Date is ambiguous
|
||||
Date d = new Date(0L); // the same clash, with the old on-demand imports
|
||||
^
|
||||
both class java.sql.Date in java.sql and class java.util.Date in java.util match
|
||||
broken/TwoStarImports.java:6: error: reference to Date is ambiguous
|
||||
Date d = new Date(0L); // the same clash, with the old on-demand imports
|
||||
^
|
||||
both class java.sql.Date in java.sql and class java.util.Date in java.util match
|
||||
2 errors
|
||||
|
||||
$ javac src/FixedDate.java && java FixedDate (25.0.4.1+1-LTS)
|
||||
java.util.Date
|
||||
java.sql.Date
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
$ java --describe-module java.base | grep -c '^exports' (25.0.4.1+1-LTS)
|
||||
58
|
||||
|
||||
$ java --describe-module java.sql (25.0.4.1+1-LTS)
|
||||
[email protected]
|
||||
exports java.sql
|
||||
exports javax.sql
|
||||
requires java.xml transitive
|
||||
requires java.logging transitive
|
||||
requires java.transaction.xa transitive
|
||||
requires java.base mandated
|
||||
requires java.xml transitive
|
||||
requires java.logging transitive
|
||||
uses java.sql.Driver
|
||||
|
||||
$ java --describe-module java.se | grep -c 'requires' (25.0.4.1+1-LTS)
|
||||
|
||||
@@ -10,12 +10,19 @@ $ jshell --feedback concise src/imports.jsh (21.0.10+7-Ubuntu-124.04)
|
||||
import java.util.regex.*
|
||||
import java.util.stream.*
|
||||
[2, 4]
|
||||
Error:
|
||||
cannot find symbol
|
||||
symbol: variable LocalDate
|
||||
System.out.println(LocalDate.of(2026, 9, 15))
|
||||
^-------^
|
||||
|
||||
$ jshell --feedback concise src/imports.jsh (25.0.4.1+1-LTS)
|
||||
import java.base
|
||||
[2, 4]
|
||||
2026-09-15
|
||||
|
||||
$ jshell --feedback concise src/imports.jsh (27+35)
|
||||
import java.base
|
||||
[2, 4]
|
||||
2026-09-15
|
||||
|
||||
|
||||
Reference in New Issue
Block a user