RFR: 8325324: Implement Implicitly Declared Classes and Instance Main Methods (Third Preview) [v5]
Jan Lahoda
jlahoda at openjdk.org
Mon May 6 14:02:24 UTC 2024
> This is an implementation of a change for JEP draft: Implicitly Declared Classes and Instance Main Methods (Third Preview)[1]. The primary change here is that implicitly declared classes have two new implicit imports:
>
> import module java.base;
> import static java.io.IO.*;
>
>
> Both of these depend on other changes, the first one on https://github.com/openjdk/jdk/pull/18614, and the second one on https://bugs.openjdk.org/browse/JDK-8305457. This PR depends on 18614, and the patch here can should be able to work both in the presence and absence of `java.io.IO`, including testing. But, overall the patch should be fairly straightforward - the imports are injected at the same time the long-existing import for `java.lang` is added.
>
> The JEP number if `jdk.internal.javac.PreviewFeature` will be adjusted once the JEP is moved to Candidate.
>
> [1] https://openjdk.org/jeps/8323335
Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision:
Simplifying check for type existence, fixing bug with explicit imports.
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/18633/files
- new: https://git.openjdk.org/jdk/pull/18633/files/58017874..39561764
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=18633&range=04
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=18633&range=03-04
Stats: 52 lines in 2 files changed: 42 ins; 2 del; 8 mod
Patch: https://git.openjdk.org/jdk/pull/18633.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18633/head:pull/18633
PR: https://git.openjdk.org/jdk/pull/18633
More information about the compiler-dev
mailing list