Skip to content

Commit b12a4b6

Browse files
committed
1 parent 298e4be commit b12a4b6

File tree

2,106 files changed

+1259322
-70
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,106 files changed

+1259322
-70
lines changed

base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/EnumerationTests.java

+24-1
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ public void testEnum13() {
658658
"}\n" +
659659
"\n" +
660660
"class A {\n" +
661-
" public enum C2{\n" +
661+
" enum C2{\n" +
662662
" TEST_C2\n" +
663663
" }\n" +
664664
"}\n",
@@ -699,6 +699,26 @@ public void testEnum13() {
699699
//@formatter:on
700700

701701
runConformTest(sources);
702+
703+
checkGCUDeclaration("A.groovy",
704+
"package be.flow;\n" +
705+
"public enum C1 {\n" +
706+
" TEST_C1,\n" +
707+
" private @groovy.transform.Generated C1() {\n" +
708+
" }\n" +
709+
"}\n" +
710+
"public class A {\n" +
711+
" public static enum C2 {\n" +
712+
" TEST_C2,\n" +
713+
" private @groovy.transform.Generated C2() {\n" +
714+
" }\n" +
715+
" }\n" +
716+
" public @groovy.transform.Generated A() {\n" +
717+
" }\n" +
718+
"}");
719+
720+
checkDisassemblyFor("be/flow/A$C2.class",
721+
"public static final enum be.flow.A$C2 implements ");
702722
}
703723

704724
@Test
@@ -914,6 +934,9 @@ public void testAbstractMethodWithinEnum1() {
914934
" }\n" +
915935
" public abstract int foo();\n" +
916936
"}");
937+
938+
checkDisassemblyFor("Good.class", "public abstract enum Good ");
939+
checkDisassemblyFor("Good$1.class", "\nfinal enum Good$1 {\n ");
917940
}
918941

919942
@Test

base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/GroovyCompilerTestSuite.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public abstract class GroovyCompilerTestSuite {
7777
protected static final long JDK14 = (58L << 16) + ClassFileConstants.MINOR_VERSION_0;
7878
protected static final long JDK15 = (59L << 16) + ClassFileConstants.MINOR_VERSION_0;
7979
protected static final long JDK16 = (60L << 16) + ClassFileConstants.MINOR_VERSION_0;
80-
protected static final long JDK17 = (60L << 17) + ClassFileConstants.MINOR_VERSION_0;
80+
protected static final long JDK17 = (61L << 16) + ClassFileConstants.MINOR_VERSION_0;
8181

8282
@Parameters(name = "Java {1}")
8383
public static Iterable<Object[]> params() {
@@ -170,8 +170,12 @@ public String getName() {
170170

171171
@Override
172172
protected INameEnvironment getNameEnvironment(final String[] testFiles, final String[] classPaths) {
173-
this.classpaths = (classPaths == null ? getDefaultClassPaths() : classPaths);
174-
return new InMemoryNameEnvironment(testFiles, getClassLibs(false));
173+
return getNameEnvironment(testFiles, classPaths, null);
174+
}
175+
176+
protected INameEnvironment getNameEnvironment(final String[] testFiles, final String[] classPaths, final Map<String, String> options) {
177+
this.classpaths = (classPaths != null ? classPaths : getDefaultClassPaths());
178+
return new InMemoryNameEnvironment(testFiles, getClassLibs(false, options));
175179
}
176180

177181
private String resolve(final URL jarRef) throws IOException {

base/org.codehaus.groovy25/src/org/codehaus/groovy/antlr/AntlrParserPlugin.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -795,8 +795,8 @@ protected Expression anonymousInnerClassDef(AST node) {
795795
ClassNode outerClass = getClassOrScript(oldNode);
796796
String innerClassName = outerClass.getName() + "$" + (anonymousClassCount(outerClass) + 1);
797797
if (enumConstantBeingDef) {
798-
classNode = new EnumConstantClassNode(outerClass, innerClassName, Opcodes.ACC_PUBLIC, ClassHelper.OBJECT_TYPE);
799-
} else {
798+
classNode = new EnumConstantClassNode(outerClass, innerClassName, Opcodes.ACC_ENUM | Opcodes.ACC_FINAL, ClassHelper.OBJECT_TYPE);
799+
} else { // GRECLIPSE edit ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
800800
classNode = new InnerClassNode(outerClass, innerClassName, Opcodes.ACC_PUBLIC, ClassHelper.OBJECT_TYPE);
801801
}
802802
((InnerClassNode) classNode).setAnonymous(true);
@@ -1035,8 +1035,9 @@ protected void enumConstantDef(AST node) {
10351035
// we have to handle an enum constant with a class overriding
10361036
// a method in which case we need to configure the inner class
10371037
innerClass.setSuperClass(classNode.getPlainNodeReference());
1038+
/* GRECLIPSE edit
10381039
innerClass.setModifiers(classNode.getModifiers() | Opcodes.ACC_FINAL);
1039-
// GRECLIPSE add
1040+
*/
10401041
innerClass.setNameStart(nameStart);
10411042
innerClass.setNameEnd(nameEnd - 1);
10421043
// GRECLIPSE end

base/org.codehaus.groovy30/src/org/apache/groovy/parser/antlr4/AstBuilder.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1451,7 +1451,9 @@ public ClassNode visitClassDeclaration(ClassDeclarationContext ctx) {
14511451
this.hackMixins(classNode);
14521452

14531453
} else if (isEnum) {
1454+
/* GRECLIPSE edit -- EnumHelper#makeEnumNode does this
14541455
classNode.setModifiers(classNode.getModifiers() | Opcodes.ACC_ENUM | Opcodes.ACC_FINAL);
1456+
*/
14551457
classNode.setInterfaces(this.visitTypeList(ctx.is));
14561458
this.initUsingGenerics(classNode);
14571459

@@ -3657,7 +3659,7 @@ public InnerClassNode visitAnonymousInnerClassDeclaration(AnonymousInnerClassDec
36573659

36583660
InnerClassNode anonymousInnerClass;
36593661
if (1 == ctx.t) { // anonymous enum
3660-
anonymousInnerClass = new EnumConstantClassNode(outerClass, innerClassName, superClass.getModifiers() | Opcodes.ACC_FINAL, superClass.getPlainNodeReference());
3662+
anonymousInnerClass = new EnumConstantClassNode(outerClass, innerClassName, Opcodes.ACC_ENUM | Opcodes.ACC_FINAL, superClass.getPlainNodeReference());
36613663
// and remove the final modifier from classNode to allow the sub class
36623664
superClass.setModifiers(superClass.getModifiers() & ~Opcodes.ACC_FINAL);
36633665
} else { // anonymous inner class

base/org.codehaus.groovy30/src/org/codehaus/groovy/antlr/AntlrParserPlugin.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -882,8 +882,8 @@ protected Expression anonymousInnerClassDef(AST node) {
882882
ClassNode outerClass = getClassOrScript(oldNode);
883883
String innerClassName = outerClass.getName() + "$" + (anonymousClassCount(outerClass) + 1);
884884
if (enumConstantBeingDef) {
885-
classNode = new EnumConstantClassNode(outerClass, innerClassName, Opcodes.ACC_PUBLIC, ClassHelper.OBJECT_TYPE);
886-
} else {
885+
classNode = new EnumConstantClassNode(outerClass, innerClassName, Opcodes.ACC_ENUM | Opcodes.ACC_FINAL, ClassHelper.OBJECT_TYPE);
886+
} else { // GRECLIPSE edit ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
887887
classNode = new InnerClassNode(outerClass, innerClassName, Opcodes.ACC_PUBLIC, ClassHelper.OBJECT_TYPE);
888888
}
889889
((InnerClassNode) classNode).setAnonymous(true);
@@ -1123,8 +1123,9 @@ protected void enumConstantDef(AST node) {
11231123
// we have to handle an enum constant with a class overriding
11241124
// a method in which case we need to configure the inner class
11251125
innerClass.setSuperClass(classNode.getPlainNodeReference());
1126+
/* GRECLIPSE edit
11261127
innerClass.setModifiers(classNode.getModifiers() | Opcodes.ACC_FINAL);
1127-
// GRECLIPSE add
1128+
*/
11281129
innerClass.setNameStart(nameStart);
11291130
innerClass.setNameEnd(nameEnd - 1);
11301131
// GRECLIPSE end
-2.32 KB
Binary file not shown.

base/org.codehaus.groovy40/src/org/apache/groovy/parser/antlr4/AstBuilder.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -1515,8 +1515,7 @@ public ClassNode visitClassDeclaration(final ClassDeclarationContext ctx) {
15151515

15161516
if ((isAnnotation || isEnum) && (isSealed || isNonSealed)) {
15171517
ModifierNode mn = isSealed ? sealedModifierNodeOptional.get() : nonSealedModifierNodeOptional.get();
1518-
throw createParsingFailedException("modifier `" + mn.getText() + "` is not allowed for " +
1519-
(isEnum ? "enum" : "annotation definition"), mn);
1518+
throw createParsingFailedException("modifier `" + mn.getText() + "` is not allowed for " + (isEnum ? "enum" : "annotation definition"), mn);
15201519
}
15211520

15221521
boolean hasPermits = asBoolean(ctx.PERMITS());
@@ -1613,7 +1612,9 @@ public ClassNode visitClassDeclaration(final ClassDeclarationContext ctx) {
16131612
this.hackMixins(classNode);
16141613

16151614
} else if (isEnum) {
1615+
/* GRECLIPSE edit -- EnumHelper#makeEnumNode does this
16161616
classNode.setModifiers(classNode.getModifiers() | Opcodes.ACC_ENUM | Opcodes.ACC_FINAL);
1617+
*/
16171618
classNode.setInterfaces(this.visitTypeList(ctx.is));
16181619
this.initUsingGenerics(classNode);
16191620

@@ -3829,7 +3830,7 @@ public InnerClassNode visitAnonymousInnerClassDeclaration(final AnonymousInnerCl
38293830

38303831
InnerClassNode anonymousInnerClass;
38313832
if (1 == ctx.t) { // anonymous enum
3832-
anonymousInnerClass = new EnumConstantClassNode(outerClass, innerClassName, superClass.getModifiers() | Opcodes.ACC_FINAL, superClass.getPlainNodeReference());
3833+
anonymousInnerClass = new EnumConstantClassNode(outerClass, innerClassName, Opcodes.ACC_ENUM | Opcodes.ACC_FINAL, superClass.getPlainNodeReference());
38333834
// and remove the final modifier from classNode to allow the sub class
38343835
superClass.setModifiers(superClass.getModifiers() & ~Opcodes.ACC_FINAL);
38353836
} else { // anonymous inner class

base/org.codehaus.groovy40/src/org/codehaus/groovy/antlr/AntlrParserPlugin.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -882,8 +882,8 @@ protected Expression anonymousInnerClassDef(AST node) {
882882
ClassNode outerClass = getClassOrScript(oldNode);
883883
String innerClassName = outerClass.getName() + "$" + (anonymousClassCount(outerClass) + 1);
884884
if (enumConstantBeingDef) {
885-
classNode = new EnumConstantClassNode(outerClass, innerClassName, Opcodes.ACC_PUBLIC, ClassHelper.OBJECT_TYPE);
886-
} else {
885+
classNode = new EnumConstantClassNode(outerClass, innerClassName, Opcodes.ACC_ENUM | Opcodes.ACC_FINAL, ClassHelper.OBJECT_TYPE);
886+
} else { // GRECLIPSE edit ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
887887
classNode = new InnerClassNode(outerClass, innerClassName, Opcodes.ACC_PUBLIC, ClassHelper.OBJECT_TYPE);
888888
}
889889
((InnerClassNode) classNode).setAnonymous(true);
@@ -1123,8 +1123,9 @@ protected void enumConstantDef(AST node) {
11231123
// we have to handle an enum constant with a class overriding
11241124
// a method in which case we need to configure the inner class
11251125
innerClass.setSuperClass(classNode.getPlainNodeReference());
1126+
/* GRECLIPSE edit
11261127
innerClass.setModifiers(classNode.getModifiers() | Opcodes.ACC_FINAL);
1127-
// GRECLIPSE add
1128+
*/
11281129
innerClass.setNameStart(nameStart);
11291130
innerClass.setNameEnd(nameEnd - 1);
11301131
// GRECLIPSE end

base/org.eclipse.jdt.groovy.core/src/org/codehaus/jdt/groovy/internal/compiler/ast/GroovyCompilationUnitDeclaration.java

+4-10
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ private void createTypeDeclarations(ModuleNode moduleNode) {
11431143
}
11441144

11451145
boolean isEnum = classNode.isEnum();
1146-
configureSuperClass(typeDeclaration, classNode.getSuperClass(), isEnum, isTrait(classNode));
1146+
if (!isEnum && !isTrait(classNode)) configureSuperClass(typeDeclaration, classNode.getSuperClass());
11471147
configureSuperInterfaces(typeDeclaration, classNode);
11481148
typeDeclaration.fields = createFieldDeclarations(classNode, isEnum);
11491149
typeDeclaration.methods = createConstructorAndMethodDeclarations(classNode, isEnum, typeDeclaration);
@@ -1546,15 +1546,9 @@ private AbstractMethodDeclaration createMethodDeclaration(ClassNode classNode, M
15461546

15471547
//----------------------------------------------------------------------
15481548

1549-
private void configureSuperClass(TypeDeclaration typeDeclaration, ClassNode superclass, boolean isEnum, boolean isTrait) {
1550-
if ((isEnum && superclass.getName().equals("java.lang.Enum")) || isTrait) {
1551-
// Don't wire it in, JDT will do it
1552-
typeDeclaration.superclass = null;
1553-
} else {
1554-
// If the start position is 0 the superclass wasn't actually declared, it was added by Groovy
1555-
if (!(superclass.getStart() == 0 && superclass.equals(ClassHelper.OBJECT_TYPE))) {
1556-
typeDeclaration.superclass = createTypeReferenceForClassNode(superclass);
1557-
}
1549+
private void configureSuperClass(TypeDeclaration typeDeclaration, ClassNode superclass) {
1550+
if (!(superclass.getStart() == 0 && superclass.equals(ClassHelper.OBJECT_TYPE))) {
1551+
typeDeclaration.superclass = createTypeReferenceForClassNode(superclass);
15581552
}
15591553
}
15601554

docs/Getting-Started-with-Groovy-Eclipse-Source-Code.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ This minimal project set should be open in your workspace:
167167
* org.eclipse.jdt.groovy.core.tests.builder
168168
* org.eclipse.jdt.groovy.core.tests.compiler
169169

170-
Note: Only one JDT patch should be imported (`org.eclipse.jdt.core`, `org.eclipse.jdt.core.tests.builder`, `org.eclipse.jdt.core.tests.compiler`) and it should be matched to the target platform of your workspace. For example, the patch in the `/e421` folder is for Eclipse 4.21 (2021-09).
170+
Note: Only one JDT patch should be imported (`org.eclipse.jdt.core`, `org.eclipse.jdt.core.tests.builder`, `org.eclipse.jdt.core.tests.compiler`) and it should be matched to the target platform of your workspace. For example, the patch in the `/e422` folder is for Eclipse 4.22 (2021-12).
171171

172172

173173
## Test with Eclipse
@@ -185,14 +185,15 @@ For manual testing and debugging, right-click on the org.codehaus.groovy.eclipse
185185

186186
[Download and install Maven](https://maven.apache.org/).
187187

188-
From the root directory of the repository, execute the following command to build Groovy-Eclipse for Eclipse 4.21 (2021-09).
188+
From the root directory of the repository, execute the following command to build Groovy-Eclipse for Eclipse 4.22 (2021-12).
189189

190190
```
191-
mvn -Pe4.21 clean install
191+
mvn -Pe4.22 clean install
192192
```
193193

194-
Replace e4.21 with a different option to build it for another Eclipse version:
194+
Replace e4.22 with a different option to build it for another Eclipse version:
195195

196+
* e4.21
196197
* e4.20
197198
* e4.19
198199
* e4.18

groovy-eclipse.setup

+28-26
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@
7272
defaultValue="2020-06"
7373
storageURI="scope://Workspace"
7474
label="Target Platform">
75+
<choice
76+
value="2021-12"
77+
label="Eclipse 4.22 (2021-12)"/>
7578
<choice
7679
value="2021-09"
7780
label="Eclipse 4.21 (2021-09)"/>
@@ -87,9 +90,6 @@
8790
<choice
8891
value="2020-09"
8992
label="Eclipse 4.17 (2020-09)"/>
90-
<choice
91-
value="2020-06"
92-
label="Eclipse 4.16 (2020-06)"/>
9393
<description>Choose the compatibility level of the target platform</description>
9494
</setupTask>
9595
<setupTask
@@ -126,7 +126,15 @@
126126
</setupTask>
127127
<setupTask
128128
xsi:type="setup.p2:P2Task"
129-
filter="(| (scope.product.version.name=2021-09) (scope.product.version.name=latest) (scope.product.version.name=latest.released))">
129+
filter="(| (scope.product.version.name=2021-12) (scope.product.version.name=latest))">
130+
<requirement
131+
name="org.codehaus.groovy.m2eclipse.feature.feature.group"/>
132+
<repository
133+
url="https://dist.springsource.org/snapshot/GRECLIPSE/e4.22"/>
134+
</setupTask>
135+
<setupTask
136+
xsi:type="setup.p2:P2Task"
137+
filter="(| (scope.product.version.name=2021-09) (scope.product.version.name=latest.released))">
130138
<requirement
131139
name="org.codehaus.groovy.m2eclipse.feature.feature.group"/>
132140
<repository
@@ -164,14 +172,6 @@
164172
<repository
165173
url="https://dist.springsource.org/snapshot/GRECLIPSE/e4.17"/>
166174
</setupTask>
167-
<setupTask
168-
xsi:type="setup.p2:P2Task"
169-
filter="(scope.product.version.name=2020-06)">
170-
<requirement
171-
name="org.codehaus.groovy.m2eclipse.feature.feature.group"/>
172-
<repository
173-
url="https://dist.springsource.org/snapshot/GRECLIPSE/e4.16"/>
174-
</setupTask>
175175
<setupTask
176176
xsi:type="git:GitCloneTask"
177177
id="git.clone.Groovy-Eclipse"
@@ -225,6 +225,13 @@
225225
<sourceLocator
226226
rootFolder="${git.clone.Groovy-Eclipse.location}/Site-org.codehaus.groovy.eclipse"/>
227227
</setupTask>
228+
<setupTask
229+
xsi:type="projects:ProjectsImportTask"
230+
filter="(eclipse.target.platform=2021-12)">
231+
<sourceLocator
232+
rootFolder="${git.clone.Groovy-Eclipse.location}/jdt-patch/e422"
233+
locateNestedProjects="true"/>
234+
</setupTask>
228235
<setupTask
229236
xsi:type="projects:ProjectsImportTask"
230237
filter="(eclipse.target.platform=2021-09)">
@@ -260,13 +267,6 @@
260267
rootFolder="${git.clone.Groovy-Eclipse.location}/jdt-patch/e417"
261268
locateNestedProjects="true"/>
262269
</setupTask>
263-
<setupTask
264-
xsi:type="projects:ProjectsImportTask"
265-
filter="(eclipse.target.platform=2020-06)">
266-
<sourceLocator
267-
rootFolder="${git.clone.Groovy-Eclipse.location}/jdt-patch/e416"
268-
locateNestedProjects="true"/>
269-
</setupTask>
270270
<setupTask
271271
xsi:type="setup.targlets:TargletTask">
272272
<targlet
@@ -286,6 +286,15 @@
286286
name="org.eclipse.buildship.feature.group"/>
287287
<requirement
288288
name="org.eclipse.test.feature.group"/>
289+
<repositoryList
290+
name="2020-06">
291+
<repository
292+
url="https://download.eclipse.org/releases/2021-12"/>
293+
<repository
294+
url="https://download.eclipse.org/eclipse/updates/4.22"/>
295+
<repository
296+
url="https://download.eclipse.org/eclipse/updates/4.22-I-builds/I20210929-1800"/>
297+
</repositoryList>
289298
<repositoryList
290299
name="2021-09">
291300
<repository
@@ -321,13 +330,6 @@
321330
<repository
322331
url="https://download.eclipse.org/eclipse/updates/4.17"/>
323332
</repositoryList>
324-
<repositoryList
325-
name="2020-06">
326-
<repository
327-
url="https://download.eclipse.org/releases/2020-06"/>
328-
<repository
329-
url="https://download.eclipse.org/eclipse/updates/4.16"/>
330-
</repositoryList>
331333
</targlet>
332334
</setupTask>
333335
<setupTask

jdt-patch/e410/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -1417,7 +1417,10 @@ protected ClassFileReader getClassFileReader(String fileName, String className)
14171417
}
14181418

14191419
protected INameEnvironment[] getClassLibs(boolean useDefaultClasspaths) {
1420-
String encoding = getCompilerOptions().get(CompilerOptions.OPTION_Encoding);
1420+
return getClassLibs(useDefaultClasspaths, null);
1421+
}
1422+
protected INameEnvironment[] getClassLibs(boolean useDefaultClasspaths, Map<String, String> options) {
1423+
String encoding = (options != null ? options : getCompilerOptions()).get(CompilerOptions.OPTION_Encoding);
14211424
if ("".equals(encoding))
14221425
encoding = null;
14231426
if (useDefaultClasspaths && encoding == null)

jdt-patch/e411/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -1420,7 +1420,10 @@ protected ClassFileReader getClassFileReader(String fileName, String className)
14201420
}
14211421

14221422
protected INameEnvironment[] getClassLibs(boolean useDefaultClasspaths) {
1423-
String encoding = getCompilerOptions().get(CompilerOptions.OPTION_Encoding);
1423+
return getClassLibs(useDefaultClasspaths, null);
1424+
}
1425+
protected INameEnvironment[] getClassLibs(boolean useDefaultClasspaths, Map<String, String> options) {
1426+
String encoding = (options != null ? options : getCompilerOptions()).get(CompilerOptions.OPTION_Encoding);
14241427
if ("".equals(encoding))
14251428
encoding = null;
14261429
if (useDefaultClasspaths && encoding == null)

jdt-patch/e412/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,10 @@ protected ClassFileReader getClassFileReader(String fileName, String className)
14351435
}
14361436

14371437
protected INameEnvironment[] getClassLibs(boolean useDefaultClasspaths) {
1438-
String encoding = getCompilerOptions().get(CompilerOptions.OPTION_Encoding);
1438+
return getClassLibs(useDefaultClasspaths, null);
1439+
}
1440+
protected INameEnvironment[] getClassLibs(boolean useDefaultClasspaths, Map<String, String> options) {
1441+
String encoding = (options != null ? options : getCompilerOptions()).get(CompilerOptions.OPTION_Encoding);
14391442
if ("".equals(encoding))
14401443
encoding = null;
14411444
if (useDefaultClasspaths && encoding == null)

jdt-patch/e413/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -1483,7 +1483,10 @@ protected ClassFileReader getClassFileReader(String fileName, String className)
14831483
}
14841484

14851485
protected INameEnvironment[] getClassLibs(boolean useDefaultClasspaths) {
1486-
String encoding = getCompilerOptions().get(CompilerOptions.OPTION_Encoding);
1486+
return getClassLibs(useDefaultClasspaths, null);
1487+
}
1488+
protected INameEnvironment[] getClassLibs(boolean useDefaultClasspaths, Map<String, String> options) {
1489+
String encoding = (options != null ? options : getCompilerOptions()).get(CompilerOptions.OPTION_Encoding);
14871490
if ("".equals(encoding))
14881491
encoding = null;
14891492
if (useDefaultClasspaths && encoding == null)

0 commit comments

Comments
 (0)