Commit d533f59c authored by Adam Blank's avatar Adam Blank
Browse files

Misc. ErrorProne Fixes

parent 2b7bc29d
No related merge requests found
Pipeline #7796 failed with stage
in 0 seconds
Showing with 14 additions and 8 deletions
+14 -8
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
<entry file="file://$PROJECT_DIR$/src/edu/caltech/cs2/datastructures/MinFourHeap.java"> <entry file="file://$PROJECT_DIR$/src/edu/caltech/cs2/datastructures/MinFourHeap.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="192"> <state relative-caret-position="192">
<caret line="8" lean-forward="true" selection-start-line="8" selection-end-line="8" /> <caret line="8" selection-start-line="8" selection-end-line="8" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
<element signature="e#829#830#0" expanded="true" /> <element signature="e#829#830#0" expanded="true" />
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</dirStrings> </dirStrings>
</component> </component>
<component name="Git.Settings"> <component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/../../.." /> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component> </component>
<component name="IdeDocumentHistory"> <component name="IdeDocumentHistory">
<option name="CHANGED_PATHS"> <option name="CHANGED_PATHS">
...@@ -1348,7 +1348,7 @@ ...@@ -1348,7 +1348,7 @@
<entry file="file://$PROJECT_DIR$/src/edu/caltech/cs2/datastructures/MinFourHeap.java"> <entry file="file://$PROJECT_DIR$/src/edu/caltech/cs2/datastructures/MinFourHeap.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="192"> <state relative-caret-position="192">
<caret line="8" lean-forward="true" selection-start-line="8" selection-end-line="8" /> <caret line="8" selection-start-line="8" selection-end-line="8" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
<element signature="e#829#830#0" expanded="true" /> <element signature="e#829#830#0" expanded="true" />
......
...@@ -100,6 +100,7 @@ public class NGramMap { ...@@ -100,6 +100,7 @@ public class NGramMap {
return null; return null;
} }
@Override
public String toString() { public String toString() {
return map.toString(); return map.toString();
} }
......
...@@ -15,10 +15,12 @@ public interface IPriorityQueue<E> extends IQueue<IPriorityQueue.PQElement<E>> { ...@@ -15,10 +15,12 @@ public interface IPriorityQueue<E> extends IQueue<IPriorityQueue.PQElement<E>> {
this.priority = priority; this.priority = priority;
} }
@Override
public int hashCode() { public int hashCode() {
return this.data.hashCode(); return this.data.hashCode();
} }
@Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (!(o instanceof PQElement)) { if (!(o instanceof PQElement)) {
return false; return false;
...@@ -26,7 +28,7 @@ public interface IPriorityQueue<E> extends IQueue<IPriorityQueue.PQElement<E>> { ...@@ -26,7 +28,7 @@ public interface IPriorityQueue<E> extends IQueue<IPriorityQueue.PQElement<E>> {
return this.data.equals(((PQElement)o).data); return this.data.equals(((PQElement)o).data);
} }
@Override
public String toString() { public String toString() {
return "(" + this.data + ", " + this.priority + ")"; return "(" + this.data + ", " + this.priority + ")";
} }
......
...@@ -3,6 +3,7 @@ package edu.caltech.cs2.misc; ...@@ -3,6 +3,7 @@ package edu.caltech.cs2.misc;
import java.util.Comparator; import java.util.Comparator;
public class IntegerComparator implements Comparator<Integer> { public class IntegerComparator implements Comparator<Integer> {
@Override
public int compare(Integer a, Integer b) { public int compare(Integer a, Integer b) {
if (a < b) { if (a < b) {
return -1; return -1;
...@@ -13,6 +14,7 @@ public class IntegerComparator implements Comparator<Integer> { ...@@ -13,6 +14,7 @@ public class IntegerComparator implements Comparator<Integer> {
return 1; return 1;
} }
@Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
return (this == obj); return (this == obj);
} }
......
...@@ -48,6 +48,7 @@ public class NGram implements Iterable<String>, Comparable<NGram> { ...@@ -48,6 +48,7 @@ public class NGram implements Iterable<String>, Comparable<NGram> {
return new NGram(data); return new NGram(data);
} }
@Override
public String toString() { public String toString() {
String result = ""; String result = "";
String prev = ""; String prev = "";
......
...@@ -41,7 +41,7 @@ public final class ParseFBMessages { ...@@ -41,7 +41,7 @@ public final class ParseFBMessages {
String archive = args[1]; String archive = args[1];
IQueue<String> messages = new ArrayDeque<String>(); IQueue<String> messages = new ArrayDeque<String>();
File[] listOfFiles = (new File(archive + File.separator + "messages")).listFiles(); File[] listOfFiles = new File(archive + File.separator + "messages").listFiles();
for (int i = 0; i < listOfFiles.length; i++) { for (int i = 0; i < listOfFiles.length; i++) {
if (listOfFiles[i].isFile()) { if (listOfFiles[i].isFile()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment