Skip to content

Commit b03ff24

Browse files
committed
minor fix-ups
1 parent 22f59db commit b03ff24

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

base/org.codehaus.groovy25/src/org/codehaus/groovy/control/CompilerConfiguration.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public Set<String> getDisabledGlobalASTTransformations() {
135135

136136
@Override
137137
public Map<String, Object> getJointCompilationOptions() {
138-
return null;
138+
return Collections.unmodifiableMap(super.getJointCompilationOptions());
139139
}
140140

141141
@Override
@@ -213,6 +213,11 @@ public void setPluginFactory(ParserPluginFactory pluginFactory) {
213213
throw new UnsupportedOperationException();
214214
}
215215

216+
@Override
217+
public void setPreviewFeatures(boolean previewFeatures) {
218+
throw new UnsupportedOperationException();
219+
}
220+
216221
@Override
217222
public void setRecompileGroovySource(boolean recompile) {
218223
throw new UnsupportedOperationException();
@@ -264,7 +269,6 @@ public void setWarningLevel(int level) {
264269
}
265270
};
266271

267-
268272
/**
269273
* See {@link WarningMessage} for levels.
270274
*/
@@ -918,7 +922,7 @@ public void setTargetBytecode(String version) {
918922
}
919923

920924
private void setTargetBytecodeIfValid(String version) {
921-
if (JDK_TO_BYTECODE_VERSION_MAP.keySet().contains(version)) {
925+
if (JDK_TO_BYTECODE_VERSION_MAP.containsKey(version)) {
922926
this.targetBytecode = version;
923927
}
924928
}
@@ -1052,7 +1056,7 @@ public void setBytecodePostprocessor(final BytecodeProcessor bytecodePostprocess
10521056
* Checks if invoke dynamic is enabled.
10531057
*/
10541058
public boolean isIndyEnabled() {
1055-
Boolean indyEnabled = this.getOptimizationOptions().get(INVOKEDYNAMIC);
1059+
Boolean indyEnabled = getOptimizationOptions().get(INVOKEDYNAMIC);
10561060
return Optional.ofNullable(indyEnabled).orElse(Boolean.FALSE).booleanValue();
10571061
}
10581062
}

base/org.codehaus.groovy30/src/org/codehaus/groovy/control/CompilerConfiguration.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public class CompilerConfiguration {
133133
* A convenience for getting a default configuration. Do not modify it!
134134
* See {@link #CompilerConfiguration(Properties)} for an example on how to
135135
* make a suitable copy to modify. But if you're really starting from a
136-
* default context, then you probably just want <code>new CompilerConfiguration()</code>.
136+
* default context, then you probably just want <code>new CompilerConfiguration()</code>.
137137
*/
138138
public static final CompilerConfiguration DEFAULT = new CompilerConfiguration() {
139139
@Override
@@ -231,6 +231,11 @@ public void setPluginFactory(ParserPluginFactory pluginFactory) {
231231
throw new UnsupportedOperationException();
232232
}
233233

234+
@Override
235+
public void setPreviewFeatures(boolean previewFeatures) {
236+
throw new UnsupportedOperationException();
237+
}
238+
234239
@Override
235240
public void setRecompileGroovySource(boolean recompile) {
236241
throw new UnsupportedOperationException();
@@ -282,7 +287,6 @@ public void setWarningLevel(int level) {
282287
}
283288
};
284289

285-
286290
/**
287291
* See {@link WarningMessage} for levels.
288292
*/
@@ -407,7 +411,7 @@ public void setWarningLevel(int level) {
407411
* <blockquote>
408412
* <table summary="Groovy Compiler Configuration Properties">
409413
* <tr><th>Property Key</th><th>Related Property Getter</th></tr>
410-
* <tr><td><code>groovy.antlr4</code></td><td>{@link #getParserVersion}</td></tr>
414+
* <tr><td><code>groovy.antlr4</code></td><td>{@link #getPluginFactory}</td></tr>
411415
* <tr><td><code>groovy.source.encoding</code> (defaulting to <code>file.encoding</code>)</td><td>{@link #getSourceEncoding}</td></tr>
412416
* <tr><td><code>groovy.target.bytecode</code></td><td>{@link #getTargetBytecode}</td></tr>
413417
* <tr><td><code>groovy.target.directory</code></td><td>{@link #getTargetDirectory}</td></tr>

0 commit comments

Comments
 (0)