Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[23] JEP 476: Module Import Declarations (Preview) #2383

Closed
Tracked by #2212
jarthana opened this issue Apr 25, 2024 · 4 comments
Closed
Tracked by #2212

[23] JEP 476: Module Import Declarations (Preview) #2383

jarthana opened this issue Apr 25, 2024 · 4 comments
Assignees
Milestone

Comments

@jarthana
Copy link
Member

From the JEP - "Enhance the Java programming language with the ability to succinctly import all of the packages exported by a module."

More details here - https://openjdk.org/jeps/476

@mpalat
Copy link
Contributor

mpalat commented May 2, 2024

JLS changes captured here :https://cr.openjdk.org/~gbierman/jep476/latest/

@mpalat mpalat added this to the BETA_JAVA23 milestone May 2, 2024
@stephan-herrmann stephan-herrmann self-assigned this May 25, 2024
stephan-herrmann added a commit to stephan-herrmann/eclipse.jdt.core that referenced this issue May 25, 2024
fixes eclipse-jdt#2383

First batch of changes
+ grammar & scanner
+ resolving
+ basic errors

Tests:
+ pull up reusable methods to new AbstractModuleCompilationTest

Also:
+ stop suggesting string-concatenation as cut-n-paste test results
@stephan-herrmann
Copy link
Contributor

stephan-herrmann added a commit to stephan-herrmann/eclipse.jdt.core that referenced this issue Jun 11, 2024
+ grammar & scanner
  - distinguish "import module.foo;" vs. "import module foo;"
    - even within module-info.java
+ resolving
+ errors reporting
+ implement reads() as reflexive property

general test work:
+ pull up reusable methods to new AbstractModuleCompilationTest
+ for tests using writeFilesCollecting
  + ensure testFileNames!=null implies shouldFlush*=false
+ run.javac improved for runConformModuleTest()
+ adjust ModuleCompilationTests.testReleaseOption15: new javac warn
specific tests regarding:
+ shadowing
+ ambiguity
+ accessibility
+ packages from requires transitive
+ redundant imports (flag as unused)
+ module import in CU in unnamed module
+ ambiguity from just one module import

fixes eclipse-jdt#2383

squashed version of
eclipse-jdt#2496
stephan-herrmann added a commit that referenced this issue Jun 11, 2024
+ grammar & scanner
  - distinguish "import module.foo;" vs. "import module foo;"
    - even within module-info.java
+ resolving
+ errors reporting
+ implement reads() as reflexive property

general test work:
+ pull up reusable methods to new AbstractModuleCompilationTest
+ for tests using writeFilesCollecting
  + ensure testFileNames!=null implies shouldFlush*=false
+ run.javac improved for runConformModuleTest()
+ adjust ModuleCompilationTests.testReleaseOption15: new javac warn
specific tests regarding:
+ shadowing
+ ambiguity
+ accessibility
+ packages from requires transitive
+ redundant imports (flag as unused)
+ module import in CU in unnamed module
+ ambiguity from just one module import

fixes #2383

squashed version of
#2496
jarthana pushed a commit to jarthana/eclipse.jdt.core that referenced this issue Jun 12, 2024
fixes eclipse-jdt#2383

First batch of changes
+ grammar & scanner
+ resolving
+ basic errors

Tests:
+ pull up reusable methods to new AbstractModuleCompilationTest

Also:
+ stop suggesting string-concatenation as cut-n-paste test results
[23] JEP 476: Module Import Declarations (Preview)

Implement reads() as reflexive property

Tests:
+ switch style to using writeFilesCollecting
  + ensure testFileNames!=null implies shouldFlush*=false
+ run.javac improved for runConformModuleTest()
+ excuse for javac not considering reflexive 'reads'
+ adjust ModuleCompilationTests.testReleaseOption15: new javac warn
[23] JEP 476: Module Import Declarations (Preview)

Implement: scanner should accept 'import module m' in module-info.java

[23] JEP 476: Module Import Declarations (Preview)

Fix Scanner: "import module." does not start a module import!

[23] JEP 476: Module Import Declarations (Preview)

more tests regarding:
+ shadowing
+ ambiguity
+ accessibility (incl. fix)
+ packages from requires transitive (incl. fix)
+ redundant imports (flag as unused)
+ module import in CU in unnamed module
[23] JEP 476: Module Import Declarations (Preview)

more tests regarding:
+ ambiguity from just one module import (incl. fix)
# Conflicts:
#	org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/impl/JavaFeature.java
#	org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/messages.properties
#	org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/util/Messages.java

Change-Id: Ibccfda78981ada1b07411bc9ac8c3a42cb248bb9
@stephan-herrmann
Copy link
Contributor

I once more scanned the spec which is now in PR Draft state: https://cr.openjdk.org/~iris/se/23/spec/draft/java-se-23-draft-spec-30/specs/module-import-declarations-jls.html

I also successfully ran ModuleImportTests with -Drun.javac=enabled -Djdk.root=path_to_jdk-23-ea-30.

I believe we are done here, indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants