Skip to content

Commit 34d4a34

Browse files
committed
Jan's PR 8037 + tmp nb-javac staging
1 parent a2ca72a commit 34d4a34

File tree

12 files changed

+39
-22
lines changed

12 files changed

+39
-22
lines changed

java/java.source.base/src/org/netbeans/api/java/source/ElementUtilities.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@
6161
import java.util.Map;
6262
import java.util.Set;
6363
import java.util.function.Supplier;
64+
import java.util.logging.Level;
65+
import java.util.logging.Logger;
6466

6567
import javax.lang.model.element.Element;
6668
import javax.lang.model.element.ElementKind;
@@ -489,7 +491,7 @@ public Iterable<? extends TypeElement> getGlobalTypes(ElementAcceptor acceptor)
489491
for (CompilationUnitTree unit : Collections.singletonList(info.getCompilationUnit())) {
490492
TreePath path = new TreePath(unit);
491493
Scope scope = trees.getScope(path);
492-
while (scope instanceof JavacScope && !((JavacScope)scope).isStarImportScope()) {
494+
while (scope instanceof JavacScope && ((JavacScope)scope).getScopeType() == ORDINARY_SCOPE_TYPE) {
493495
for (Element local : scope.getLocalElements()) {
494496
if (local.getKind().isClass() || local.getKind().isInterface()) {
495497
if (acceptor.accept(local, null)) {
@@ -521,6 +523,21 @@ public Iterable<? extends TypeElement> getGlobalTypes(ElementAcceptor acceptor)
521523
return membersList;
522524
}
523525

526+
private static final Object ORDINARY_SCOPE_TYPE;
527+
private static final Logger LOG = Logger.getLogger(ElementUtilities.class.getName());
528+
529+
static {
530+
Object ordinary = null;
531+
532+
try {
533+
ordinary = Enum.valueOf((Class<Enum>) Class.forName("com.sun.tools.javac.api.JavacScope$ScopeType"), "ORDINARY");
534+
} catch (ClassNotFoundException ex) {
535+
LOG.log(Level.FINE, null, ex);
536+
}
537+
538+
ORDINARY_SCOPE_TYPE = ordinary;
539+
}
540+
524541
/**Filter {@link Element}s
525542
*/
526543
public static interface ElementAcceptor {

java/java.source.base/src/org/netbeans/api/java/source/TypeMirrorHandle.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ public PlaceholderType(com.sun.tools.javac.util.List<TypeMetadata> md) {
426426

427427
@Override
428428
public TypeTag getTag() {
429-
return TypeTag.UNKNOWN;
429+
return TypeTag.NONE;
430430
}
431431

432432
@Override

java/java.source.base/src/org/netbeans/modules/java/source/NoJavacHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*/
3535
public class NoJavacHelper {
3636

37-
public static final int REQUIRED_JAVAC_VERSION = 23; // <- TODO: increment on every release
37+
public static final int REQUIRED_JAVAC_VERSION = 24; // <- TODO: increment on every release
3838
private static final boolean HAS_WORKING_JAVAC;
3939

4040
static {

java/libs.javacapi/external/binaries-list

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
1B70EC8A5230901C0EEE6EDF9829B43EAFAE9CC9 com.dukescript.nbjavac:nb-javac:jdk-23+35
18-
B3CB7A425EC7AAADA60754E6DF2E5E2D990E91AE com.dukescript.nbjavac:nb-javac:jdk-23+35:api
17+
CA1EECAD0EC7B10D5F44450A9BAFA798F7B318CA https://mbien.dev/tmp/nb-javac-jdk-24-27.jar nb-javac-jdk-24+27.jar
18+
EDD93074722B82A35A770CB4EDC14592C56246B6 https://mbien.dev/tmp/nb-javac-jdk-24-27-api.jar nb-javac-jdk-24+27-api.jar

java/libs.javacapi/external/nb-javac-jdk-23+35-license.txt renamed to java/libs.javacapi/external/nb-javac-jdk-24+27-license.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Name: Javac Compiler Implementation
22
Description: Javac Compiler Implementation
3-
Version: 23+35
4-
Files: nb-javac-jdk-23+35-api.jar nb-javac-jdk-23+35.jar
3+
Version: 24+27
4+
Files: nb-javac-jdk-24+27-api.jar nb-javac-jdk-24+27.jar
55
License: GPL-2-CP
66
Origin: OpenJDK (https://github.com/openjdk/jdk)
77
Source: https://github.com/openjdk/jdk

java/libs.javacapi/nbproject/project.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@
4040
</public-packages>
4141
<class-path-extension>
4242
<runtime-relative-path />
43-
<binary-origin>external/nb-javac-jdk-23+35-api.jar</binary-origin>
43+
<binary-origin>external/nb-javac-jdk-24+27-api.jar</binary-origin>
4444
</class-path-extension>
4545
<class-path-extension>
4646
<runtime-relative-path />
47-
<binary-origin>external/nb-javac-jdk-23+35.jar</binary-origin>
47+
<binary-origin>external/nb-javac-jdk-24+27.jar</binary-origin>
4848
</class-path-extension>
4949
</data>
5050
</configuration>

java/libs.nbjavacapi/external/binaries-list

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
1B70EC8A5230901C0EEE6EDF9829B43EAFAE9CC9 com.dukescript.nbjavac:nb-javac:jdk-23+35
18-
B3CB7A425EC7AAADA60754E6DF2E5E2D990E91AE com.dukescript.nbjavac:nb-javac:jdk-23+35:api
17+
CA1EECAD0EC7B10D5F44450A9BAFA798F7B318CA https://mbien.dev/tmp/nb-javac-jdk-24-27.jar nb-javac-jdk-24+27.jar
18+
EDD93074722B82A35A770CB4EDC14592C56246B6 https://mbien.dev/tmp/nb-javac-jdk-24-27-api.jar nb-javac-jdk-24+27-api.jar

java/libs.nbjavacapi/external/nb-javac-jdk-23+35-license.txt renamed to java/libs.nbjavacapi/external/nb-javac-jdk-24+27-license.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Name: Javac Compiler Implementation
22
Description: Javac Compiler Implementation
3-
Version: 23+35
4-
Files: nb-javac-jdk-23+35-api.jar nb-javac-jdk-23+35.jar
3+
Version: 24+27
4+
Files: nb-javac-jdk-24+27-api.jar nb-javac-jdk-24+27.jar
55
License: GPL-2-CP
66
Origin: OpenJDK (https://github.com/openjdk/jdk)
77
Source: https://github.com/openjdk/jdk

java/libs.nbjavacapi/nbproject/project.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
javac.source=1.8
1919
javac.compilerargs=-Xlint -Xlint:-serial
2020
license.file.override=${nb_all}/nbbuild/licenses/GPL-2-CP
21-
release.external/nb-javac-jdk-23+35-api.jar=modules/ext/nb-javac-jdk-23-30-api.jar
22-
release.external/nb-javac-jdk-23+35.jar=modules/ext/nb-javac-jdk-23-30.jar
21+
release.external/nb-javac-jdk-24+27-api.jar=modules/ext/nb-javac-jdk-24-27-api.jar
22+
release.external/nb-javac-jdk-24+27.jar=modules/ext/nb-javac-jdk-24-27.jar
2323

2424
# for tests
2525
requires.nb.javac=true

java/libs.nbjavacapi/nbproject/project.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@
4545
</test-dependencies>
4646
<public-packages/>
4747
<class-path-extension>
48-
<runtime-relative-path>ext/nb-javac-jdk-23-30-api.jar</runtime-relative-path>
49-
<binary-origin>external/nb-javac-jdk-23+35-api.jar</binary-origin>
48+
<runtime-relative-path>ext/nb-javac-jdk-24-27-api.jar</runtime-relative-path>
49+
<binary-origin>external/nb-javac-jdk-24+27-api.jar</binary-origin>
5050
</class-path-extension>
5151
<class-path-extension>
52-
<runtime-relative-path>ext/nb-javac-jdk-23-30.jar</runtime-relative-path>
53-
<binary-origin>external/nb-javac-jdk-23+35.jar</binary-origin>
52+
<runtime-relative-path>ext/nb-javac-jdk-24-27.jar</runtime-relative-path>
53+
<binary-origin>external/nb-javac-jdk-24+27.jar</binary-origin>
5454
</class-path-extension>
5555
</data>
5656
</configuration>

0 commit comments

Comments
 (0)