Skip to content

Commit

Permalink
Dropped legacy impl of null-safe equals in favour of Java standard impl
Browse files Browse the repository at this point in the history
  • Loading branch information
jshiell committed Jan 11, 2020
1 parent bbedfb2 commit e62d22e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import org.infernus.idea.checkstyle.CheckStyleBundle;
import org.infernus.idea.checkstyle.model.ConfigurationLocation;
import org.infernus.idea.checkstyle.util.Icons;
import org.infernus.idea.checkstyle.util.Objects;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
Expand All @@ -15,6 +14,7 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;

import static com.intellij.util.ui.JBUI.*;

Expand Down
13 changes: 0 additions & 13 deletions src/main/java/org/infernus/idea/checkstyle/util/Objects.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,6 @@ public final class Objects {
private Objects() {
}

// ideally we'd use commons-lang here, but I've learnt my lesson on relying on the IDEA CP

public static boolean equals(final Object obj1, final Object obj2) {
if (obj1 == obj2) {
return true;
} else if (obj1 == null || obj2 == null) {
return false;
}

return obj1.equals(obj2);
}


public static <T extends Comparable<T>> int compare(final T obj1, final T obj2) {
if (obj1 == null && obj2 == null) {
return 0;
Expand Down

0 comments on commit e62d22e

Please sign in to comment.