Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jarthana committed Nov 6, 2023
1 parent b938177 commit b22e502
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Expand Up @@ -768,6 +768,8 @@ ImportBinding[] getDefaultImports() {
ReferenceBinding templateSTR;
ImportBinding[] allImports = null;
if (this.environment.globalOptions.complianceLevel >= ClassFileConstants.JDK21) {
boolean old = this.environment.globalOptions.isAnnotationBasedNullAnalysisEnabled;
this.environment.globalOptions.isAnnotationBasedNullAnalysisEnabled = false;
templateSTR = (ReferenceBinding) ((PackageBinding) importBinding).getTypeOrPackage(TypeConstants.JAVA_LANG_STRING_TEMPLATE_STR[2], module(), false);
if (templateSTR != null) {
FieldBinding str = templateSTR.getField("STR".toCharArray(), true); //$NON-NLS-1$
Expand All @@ -780,6 +782,7 @@ public boolean isStatic() {
allImports = new ImportBinding[] {
new ImportBinding(TypeConstants.JAVA_LANG, true, importBinding, null), ibinding};
}
this.environment.globalOptions.isAnnotationBasedNullAnalysisEnabled = old;
}
if (allImports == null){
allImports = new ImportBinding[] {new ImportBinding(TypeConstants.JAVA_LANG, true, importBinding, null)};
Expand Down
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2020 IBM Corporation and others.
* Copyright (c) 2000, 2023 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -8183,7 +8183,7 @@ public void test405778a() {
" void m(String[] names) {\n" +
" for (String string : names) \n" +
" {\n" +
" System.out.println(string.class);\n" +
" System.out.println(string.\"\");\n" +
" }\n" +
" }\n" +
"}\n";
Expand Down

0 comments on commit b22e502

Please sign in to comment.