Skip to content

Commit

Permalink
#237: Resolved MissingOverride warnings from error-prone.
Browse files Browse the repository at this point in the history
  • Loading branch information
jvdb committed May 22, 2018
1 parent ac48c89 commit ef57c49
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
4 changes: 4 additions & 0 deletions core/src/main/java/io/parsingdata/metal/Trampoline.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ static <T> Trampoline<T> complete(final CompletedTrampoline<T> completedTrampoli
@FunctionalInterface
interface CompletedTrampoline<T> extends Trampoline<T> {

@Override
default boolean hasNext() {
return false;
}

@Override
default Trampoline<T> next() {
throw new UnsupportedOperationException("A CompletedTrampoline does not have a next computation.");
}
Expand All @@ -61,10 +63,12 @@ static <T> Trampoline<T> intermediate(final IntermediateTrampoline<T> intermedia
@FunctionalInterface
interface IntermediateTrampoline<T> extends Trampoline<T> {

@Override
default T result() {
throw new UnsupportedOperationException("An IntermediateTrampoline does not have a result.");
}

@Override
default boolean hasNext() {
return true;
}
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/java/io/parsingdata/metal/data/ParseGraph.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ private Trampoline<Optional<ParseValue>> current(final ImmutableList<ParseItem>
return intermediate(() -> current(items.tail));
}

public boolean isGraph() { return true; }
public ParseGraph asGraph() { return this; }
public Token getDefinition() { return definition; }
@Override public boolean isGraph() { return true; }
@Override public ParseGraph asGraph() { return this; }
@Override public Token getDefinition() { return definition; }

@Override
public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public Optional<ParseItem> resolve(final ParseGraph root) {
return findItemAtOffset(getAllRoots(root, definition), location, source).computeResult();
}

public boolean isReference() { return true; }
public ParseReference asReference() { return this; }
public Token getDefinition() { return definition; }
@Override public boolean isReference() { return true; }
@Override public ParseReference asReference() { return this; }
@Override public Token getDefinition() { return definition; }

@Override
public String toString() {
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/java/io/parsingdata/metal/data/ParseValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ public boolean matches(final String name) {
return this.name.equals(name) || this.name.endsWith(Token.SEPARATOR + name);
}

public boolean isValue() { return true; }
public ParseValue asValue() { return this; }
public Token getDefinition() { return definition; }
@Override public boolean isValue() { return true; }
@Override public ParseValue asValue() { return this; }
@Override public Token getDefinition() { return definition; }

@Override
public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

public enum ByteOrder {

BIG_ENDIAN { public byte[] apply(final byte[] bytes) {
BIG_ENDIAN { @Override public byte[] apply(final byte[] bytes) {
return bytes.clone();
} },
LITTLE_ENDIAN { public byte[] apply(final byte[] bytes) {
LITTLE_ENDIAN { @Override public byte[] apply(final byte[] bytes) {
final byte[] output = bytes.clone();
for (int i = 0; i < bytes.length; i++) {
output[i] = bytes[(bytes.length-1)-i];
Expand Down

0 comments on commit ef57c49

Please sign in to comment.