Skip to content

Commit 37f8391

Browse files
authored
Merge pull request #4068 from eregon/fix-ecj-warnings
Fix Java warnings from the Eclipse Compiler for Java (ECJ)
2 parents 1e20625 + cbd776d commit 37f8391

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

java/api/src/main/java/org/ruby_lang/prism/ParsingOptions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public byte getValue() {
3636
*
3737
* NOTE: positions should match PM_OPTIONS_COMMAND_LINE_* constants values
3838
*/
39-
public enum CommandLine { A, E, L, N, P, X };
39+
public enum CommandLine { A, E, L, N, P, X }
4040

4141
/**
4242
* The forwarding options for a given scope in the parser.
@@ -57,7 +57,7 @@ public enum Forwarding {
5757
public byte getValue() {
5858
return (byte) value;
5959
}
60-
};
60+
}
6161

6262
/**
6363
* Represents a scope in the parser.

templates/java/api/src/main/java-templates/org/ruby_lang/prism/Loader.java.erb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import java.lang.Short;
55
import java.math.BigInteger;
66
import java.nio.ByteBuffer;
77
import java.nio.ByteOrder;
8-
import java.nio.charset.Charset;
98
import java.nio.charset.StandardCharsets;
10-
import java.util.Locale;
119

1210
// GENERATED BY <%= File.basename(__FILE__) %>
1311
// @formatter:off

templates/java/api/src/main/java-templates/org/ruby_lang/prism/Nodes.java.erb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import java.lang.annotation.ElementType;
88
import java.lang.annotation.Retention;
99
import java.lang.annotation.RetentionPolicy;
1010
import java.lang.annotation.Target;
11-
import java.nio.charset.StandardCharsets;
1211
import java.util.ArrayList;
1312
import java.util.Arrays;
1413

@@ -321,6 +320,7 @@ public abstract class Nodes {
321320
}
322321
<%- end -%>
323322
323+
@Override
324324
public <T> void visitChildNodes(AbstractNodeVisitor<T> visitor) {
325325
<%- node.semantic_fields.each do |field| -%>
326326
<%- case field -%>
@@ -338,6 +338,7 @@ public abstract class Nodes {
338338
<%- end -%>
339339
}
340340
341+
@Override
341342
public Node[] childNodes() {
342343
<%- if node.semantic_fields.none?(Prism::Template::NodeListField) and node.semantic_fields.none?(Prism::Template::NodeKindField) -%>
343344
return EMPTY_ARRAY;
@@ -359,6 +360,7 @@ public abstract class Nodes {
359360
<%- end -%>
360361
}
361362
363+
@Override
362364
public <T> T accept(AbstractNodeVisitor<T> visitor) {
363365
return visitor.visit<%= node.name -%>(this);
364366
}
@@ -371,11 +373,13 @@ public abstract class Nodes {
371373
builder.append("[Li]");
372374
}
373375
builder.append('\n');
376+
<%- unless [*node.flags, *node.semantic_fields].empty? -%>
374377
String nextIndent = indent + " ";
378+
<%- end -%>
375379
<%- if node.fields.any?(Prism::Template::NodeListField) or node.fields.any?(Prism::Template::ConstantListField) -%>
376380
String nextNextIndent = nextIndent + " ";
377381
<%- end -%>
378-
<%- [*node.flags, *node.fields.grep_v(Prism::Template::LocationField).grep_v(Prism::Template::OptionalLocationField)].each do |field| -%>
382+
<%- [*node.flags, *node.semantic_fields].each do |field| -%>
379383
builder.append(nextIndent);
380384
builder.append("<%= field.name %>: ");
381385
<%- case field -%>

0 commit comments

Comments
 (0)