diff --git a/java/java.source.base/src/org/netbeans/api/java/source/ElementUtilities.java b/java/java.source.base/src/org/netbeans/api/java/source/ElementUtilities.java index 2a178ca9507e..86d9144cf363 100644 --- a/java/java.source.base/src/org/netbeans/api/java/source/ElementUtilities.java +++ b/java/java.source.base/src/org/netbeans/api/java/source/ElementUtilities.java @@ -61,6 +61,8 @@ import java.util.Map; import java.util.Set; import java.util.function.Supplier; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; @@ -489,7 +491,7 @@ public Iterable getGlobalTypes(ElementAcceptor acceptor) for (CompilationUnitTree unit : Collections.singletonList(info.getCompilationUnit())) { TreePath path = new TreePath(unit); Scope scope = trees.getScope(path); - while (scope instanceof JavacScope && !((JavacScope)scope).isStarImportScope()) { + while (scope instanceof JavacScope && ((JavacScope)scope).getScopeType() == ORDINARY_SCOPE_TYPE) { for (Element local : scope.getLocalElements()) { if (local.getKind().isClass() || local.getKind().isInterface()) { if (acceptor.accept(local, null)) { @@ -521,6 +523,21 @@ public Iterable getGlobalTypes(ElementAcceptor acceptor) return membersList; } + private static final Object ORDINARY_SCOPE_TYPE; + private static final Logger LOG = Logger.getLogger(ElementUtilities.class.getName()); + + static { + Object ordinary = null; + + try { + ordinary = Enum.valueOf((Class) Class.forName("com.sun.tools.javac.api.JavacScope$ScopeType"), "ORDINARY"); + } catch (ClassNotFoundException ex) { + LOG.log(Level.FINE, null, ex); + } + + ORDINARY_SCOPE_TYPE = ordinary; + } + /**Filter {@link Element}s */ public static interface ElementAcceptor { diff --git a/java/java.source.base/src/org/netbeans/api/java/source/TypeMirrorHandle.java b/java/java.source.base/src/org/netbeans/api/java/source/TypeMirrorHandle.java index 458bed174abc..992bba8102ee 100644 --- a/java/java.source.base/src/org/netbeans/api/java/source/TypeMirrorHandle.java +++ b/java/java.source.base/src/org/netbeans/api/java/source/TypeMirrorHandle.java @@ -426,7 +426,7 @@ public PlaceholderType(com.sun.tools.javac.util.List md) { @Override public TypeTag getTag() { - return TypeTag.UNKNOWN; + return TypeTag.NONE; } @Override diff --git a/java/java.source.base/src/org/netbeans/modules/java/source/NoJavacHelper.java b/java/java.source.base/src/org/netbeans/modules/java/source/NoJavacHelper.java index 836872d20f01..9937ab1bb7e0 100644 --- a/java/java.source.base/src/org/netbeans/modules/java/source/NoJavacHelper.java +++ b/java/java.source.base/src/org/netbeans/modules/java/source/NoJavacHelper.java @@ -34,7 +34,7 @@ */ public class NoJavacHelper { - public static final int REQUIRED_JAVAC_VERSION = 23; // <- TODO: increment on every release + public static final int REQUIRED_JAVAC_VERSION = 24; // <- TODO: increment on every release private static final boolean HAS_WORKING_JAVAC; static { diff --git a/java/libs.javacapi/external/binaries-list b/java/libs.javacapi/external/binaries-list index e60394b73b4c..10face1b7624 100644 --- a/java/libs.javacapi/external/binaries-list +++ b/java/libs.javacapi/external/binaries-list @@ -14,5 +14,5 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -1B70EC8A5230901C0EEE6EDF9829B43EAFAE9CC9 com.dukescript.nbjavac:nb-javac:jdk-23+35 -B3CB7A425EC7AAADA60754E6DF2E5E2D990E91AE com.dukescript.nbjavac:nb-javac:jdk-23+35:api +CA1EECAD0EC7B10D5F44450A9BAFA798F7B318CA https://mbien.dev/tmp/nb-javac-jdk-24-27.jar nb-javac-jdk-24+27.jar +EDD93074722B82A35A770CB4EDC14592C56246B6 https://mbien.dev/tmp/nb-javac-jdk-24-27-api.jar nb-javac-jdk-24+27-api.jar diff --git a/java/libs.javacapi/external/nb-javac-jdk-23+35-license.txt b/java/libs.javacapi/external/nb-javac-jdk-24+27-license.txt similarity index 99% rename from java/libs.javacapi/external/nb-javac-jdk-23+35-license.txt rename to java/libs.javacapi/external/nb-javac-jdk-24+27-license.txt index e1852eaac70c..7edf120eb164 100644 --- a/java/libs.javacapi/external/nb-javac-jdk-23+35-license.txt +++ b/java/libs.javacapi/external/nb-javac-jdk-24+27-license.txt @@ -1,7 +1,7 @@ Name: Javac Compiler Implementation Description: Javac Compiler Implementation -Version: 23+35 -Files: nb-javac-jdk-23+35-api.jar nb-javac-jdk-23+35.jar +Version: 24+27 +Files: nb-javac-jdk-24+27-api.jar nb-javac-jdk-24+27.jar License: GPL-2-CP Origin: OpenJDK (https://github.com/openjdk/jdk) Source: https://github.com/openjdk/jdk diff --git a/java/libs.javacapi/nbproject/project.xml b/java/libs.javacapi/nbproject/project.xml index cc24468a24ea..55f6203f6395 100644 --- a/java/libs.javacapi/nbproject/project.xml +++ b/java/libs.javacapi/nbproject/project.xml @@ -40,11 +40,11 @@ - external/nb-javac-jdk-23+35-api.jar + external/nb-javac-jdk-24+27-api.jar - external/nb-javac-jdk-23+35.jar + external/nb-javac-jdk-24+27.jar diff --git a/java/libs.nbjavacapi/external/binaries-list b/java/libs.nbjavacapi/external/binaries-list index e60394b73b4c..10face1b7624 100644 --- a/java/libs.nbjavacapi/external/binaries-list +++ b/java/libs.nbjavacapi/external/binaries-list @@ -14,5 +14,5 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -1B70EC8A5230901C0EEE6EDF9829B43EAFAE9CC9 com.dukescript.nbjavac:nb-javac:jdk-23+35 -B3CB7A425EC7AAADA60754E6DF2E5E2D990E91AE com.dukescript.nbjavac:nb-javac:jdk-23+35:api +CA1EECAD0EC7B10D5F44450A9BAFA798F7B318CA https://mbien.dev/tmp/nb-javac-jdk-24-27.jar nb-javac-jdk-24+27.jar +EDD93074722B82A35A770CB4EDC14592C56246B6 https://mbien.dev/tmp/nb-javac-jdk-24-27-api.jar nb-javac-jdk-24+27-api.jar diff --git a/java/libs.nbjavacapi/external/nb-javac-jdk-23+35-license.txt b/java/libs.nbjavacapi/external/nb-javac-jdk-24+27-license.txt similarity index 99% rename from java/libs.nbjavacapi/external/nb-javac-jdk-23+35-license.txt rename to java/libs.nbjavacapi/external/nb-javac-jdk-24+27-license.txt index e1852eaac70c..7edf120eb164 100644 --- a/java/libs.nbjavacapi/external/nb-javac-jdk-23+35-license.txt +++ b/java/libs.nbjavacapi/external/nb-javac-jdk-24+27-license.txt @@ -1,7 +1,7 @@ Name: Javac Compiler Implementation Description: Javac Compiler Implementation -Version: 23+35 -Files: nb-javac-jdk-23+35-api.jar nb-javac-jdk-23+35.jar +Version: 24+27 +Files: nb-javac-jdk-24+27-api.jar nb-javac-jdk-24+27.jar License: GPL-2-CP Origin: OpenJDK (https://github.com/openjdk/jdk) Source: https://github.com/openjdk/jdk diff --git a/java/libs.nbjavacapi/nbproject/project.properties b/java/libs.nbjavacapi/nbproject/project.properties index 0f160110e608..cb7a6ba0c41a 100644 --- a/java/libs.nbjavacapi/nbproject/project.properties +++ b/java/libs.nbjavacapi/nbproject/project.properties @@ -18,8 +18,8 @@ javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial license.file.override=${nb_all}/nbbuild/licenses/GPL-2-CP -release.external/nb-javac-jdk-23+35-api.jar=modules/ext/nb-javac-jdk-23-30-api.jar -release.external/nb-javac-jdk-23+35.jar=modules/ext/nb-javac-jdk-23-30.jar +release.external/nb-javac-jdk-24+27-api.jar=modules/ext/nb-javac-jdk-24-27-api.jar +release.external/nb-javac-jdk-24+27.jar=modules/ext/nb-javac-jdk-24-27.jar # for tests requires.nb.javac=true diff --git a/java/libs.nbjavacapi/nbproject/project.xml b/java/libs.nbjavacapi/nbproject/project.xml index 580a3eaf8e5a..3424c2a0167c 100644 --- a/java/libs.nbjavacapi/nbproject/project.xml +++ b/java/libs.nbjavacapi/nbproject/project.xml @@ -45,12 +45,12 @@ - ext/nb-javac-jdk-23-30-api.jar - external/nb-javac-jdk-23+35-api.jar + ext/nb-javac-jdk-24-27-api.jar + external/nb-javac-jdk-24+27-api.jar - ext/nb-javac-jdk-23-30.jar - external/nb-javac-jdk-23+35.jar + ext/nb-javac-jdk-24-27.jar + external/nb-javac-jdk-24+27.jar diff --git a/java/libs.nbjavacapi/src/org/netbeans/modules/nbjavac/api/Bundle.properties b/java/libs.nbjavacapi/src/org/netbeans/modules/nbjavac/api/Bundle.properties index 6ebee3d11081..ddcafb1615ad 100644 --- a/java/libs.nbjavacapi/src/org/netbeans/modules/nbjavac/api/Bundle.properties +++ b/java/libs.nbjavacapi/src/org/netbeans/modules/nbjavac/api/Bundle.properties @@ -18,6 +18,6 @@ OpenIDE-Module-Display-Category=Java OpenIDE-Module-Long-Description=\ This library provides a Java language parser for the IDE. \ - Supports JDK-23 features. + Supports JDK-24 features. OpenIDE-Module-Name=The nb-javac Java editing support library OpenIDE-Module-Short-Description=The nb-javac Java editing support library diff --git a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ignored-overlaps b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ignored-overlaps index db8d69b733cf..80833b44478f 100644 --- a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ignored-overlaps +++ b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ignored-overlaps @@ -96,8 +96,8 @@ nb/ide.launcher/external/launcher-external-binaries-1-94a19f0.zip platform/o.n.b nb/ide.launcher/external/launcher-external-binaries-1-94a19f0.zip harness/apisupport.harness/external/launcher-external-binaries-1-94a19f0.zip # only one is part of the product: -java/libs.javacapi/external/nb-javac-jdk-23+35-api.jar java/libs.nbjavacapi/external/nb-javac-jdk-23+35-api.jar -java/libs.javacapi/external/nb-javac-jdk-23+35.jar java/libs.nbjavacapi/external/nb-javac-jdk-23+35.jar +java/libs.javacapi/external/nb-javac-jdk-24+27-api.jar java/libs.nbjavacapi/external/nb-javac-jdk-24+27-api.jar +java/libs.javacapi/external/nb-javac-jdk-24+27.jar java/libs.nbjavacapi/external/nb-javac-jdk-24+27.jar # Used only in unittests for mysql db specific tests ide/db.metadata.model/external/mysql-connector-j-8.0.31.jar ide/db.mysql/external/mysql-connector-j-8.0.31.jar