Skip to content

Commit

Permalink
Switch order of literals to prevent NullPointerException
Browse files Browse the repository at this point in the history
  • Loading branch information
pixeebot committed Feb 13, 2024
1 parent a4d687b commit 365d7b6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/openolly/MethodLocator.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public String methodName() {
}

public boolean isConstructor() {
return method.equals( "<init>" );
return "<init>".equals (method );
}

public boolean isNegative() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/openolly/config/ConfigReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static void load( File yaml ) throws IOException {
logger.atWarning().log("[JOT] WARNING: " + entry.name + " from " + yaml + " already loaded. Skipping." );
}

else if ( entry.name.equals("example")) {
else if ( "example".equals(entry.name)) {
//System.err.println( "[JOT] WARNING: Found 'example' JOT in " + yaml + ". Skipping." );
logger.atWarning().log("[JOT] WARNING: Found 'example' JOT in " + yaml + ". Skipping." );
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/openolly/reporting/Report.java
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public synchronized void dump() {
//System.err.print( " " );
out += " ";
for ( String col : table.columnKeySet() ) {
if ( !col.equals("|||" ) ) {
if ( !"|||".equals(col ) ) {
int colWidth = getMaxWidth( col );
String under2 = StringUtils.repeat( "-", colWidth );
//System.err.print( under2 );
Expand All @@ -258,7 +258,7 @@ public synchronized void dump() {

// print data
for ( String row : table.rowKeySet() ) {
if ( !row.equals( "|||" ) ) {
if ( !"|||".equals (row ) ) {
//System.err.print( StringUtils.rightPad(row,rowNameColWidth," " ).substring(0,rowNameColWidth));
out += StringUtils.rightPad(row,rowNameColWidth," " ).substring(0,rowNameColWidth);
//System.err.print( " " );
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/openolly/reporting/RouteGraph.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ public static void update(Trace t) {

Event tail = route;
for ( Event event : t.getEvents() ) {
if ( !event.getRule().equals( "route" ) ) {
if ( !"route".equals (event.getRule() ) ) {
event = findExistingEventInRoute( route, event );
graph.putEdge( tail, event );
tail = event;
if ( event.getRule().equals( "forward" ) ) {
if ( "forward".equals (event.getRule() ) ) {
route = event;
}
}
Expand Down

0 comments on commit 365d7b6

Please sign in to comment.