diff options
Diffstat (limited to 'plugins/IntentionPowerPak/test/com/siyeh/ipp/equality')
14 files changed, 102 insertions, 0 deletions
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/EnumComparison.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/EnumComparison.java new file mode 100644 index 000000000000..bf1f08c198c5 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/EnumComparison.java @@ -0,0 +1,8 @@ +public class EnumComparison { + + enum E { A, B } + + boolean a(E a, E b) { + return a ==<caret> b; + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/NegatedObjectComparison.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/NegatedObjectComparison.java new file mode 100644 index 000000000000..863fa48d0c78 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/NegatedObjectComparison.java @@ -0,0 +1,6 @@ +public class NegatedObjectComparison { + + boolean a(Object a, Object b) { + return a !=<caret> b; + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/NegatedObjectComparison_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/NegatedObjectComparison_after.java new file mode 100644 index 000000000000..72eda7377647 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/NegatedObjectComparison_after.java @@ -0,0 +1,6 @@ +public class NegatedObjectComparison { + + boolean a(Object a, Object b) { + return !a.equals(b); + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/NullComparison.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/NullComparison.java new file mode 100644 index 000000000000..559ec3aec144 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/NullComparison.java @@ -0,0 +1,6 @@ +public class NullComparison { + + boolean a(Object a) { + return a ==<caret> null; + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/PrimitiveComparison.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/PrimitiveComparison.java new file mode 100644 index 000000000000..0f25977323ab --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/PrimitiveComparison.java @@ -0,0 +1,6 @@ +public class PrimitiveComparison { + + boolean a(int i, int j) { + return i <caret>== j; + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/SimpleObjectComparison.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/SimpleObjectComparison.java new file mode 100644 index 000000000000..baccea789e04 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/SimpleObjectComparison.java @@ -0,0 +1,6 @@ +public class SimpleObjectComparison { + + boolean a(Object a, Object b) { + return a == b<caret>; + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/SimpleObjectComparison_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/SimpleObjectComparison_after.java new file mode 100644 index 000000000000..ab1bcce4c87b --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/SimpleObjectComparison_after.java @@ -0,0 +1,6 @@ +public class SimpleObjectComparison { + + boolean a(Object a, Object b) { + return a.equals(b); + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/EnumComparison.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/EnumComparison.java new file mode 100644 index 000000000000..43b16a421c25 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/EnumComparison.java @@ -0,0 +1,10 @@ +package com.siyeh.ipp.equality.replace_equality_with_safe_equals; + +public class EnumComparison { + + enum E { A, B } + + boolean a(E a, E b) { + return a ==<caret> b; + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/NegatedObjectComparison.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/NegatedObjectComparison.java new file mode 100644 index 000000000000..018def909d05 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/NegatedObjectComparison.java @@ -0,0 +1,8 @@ +package com.siyeh.ipp.equality.replace_equality_with_safe_equals; + +public class NegatedObjectComparison { + + boolean a(Object a, Object b) { + return a !=<caret> b; + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/NegatedObjectComparison_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/NegatedObjectComparison_after.java new file mode 100644 index 000000000000..b7f48289a4b8 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/NegatedObjectComparison_after.java @@ -0,0 +1,8 @@ +package com.siyeh.ipp.equality.replace_equality_with_safe_equals; + +public class NegatedObjectComparison { + + boolean a(Object a, Object b) { + return a == null ? b != null : !a.equals(b); + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/NullComparison.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/NullComparison.java new file mode 100644 index 000000000000..10aeb19f6fed --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/NullComparison.java @@ -0,0 +1,8 @@ +package com.siyeh.ipp.equality.replace_equality_with_safe_equals; + +public class NullComparison { + + boolean a(Object a) { + return a ==<caret> null; + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/PrimitiveComparison.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/PrimitiveComparison.java new file mode 100644 index 000000000000..8ae058592d0a --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/PrimitiveComparison.java @@ -0,0 +1,8 @@ +package com.siyeh.ipp.equality.replace_equality_with_safe_equals; + +public class PrimitiveComparison { + + boolean a(int i, int j) { + return i <caret>== j; + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/SimpleObjectComparison.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/SimpleObjectComparison.java new file mode 100644 index 000000000000..304b06ff67a1 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/SimpleObjectComparison.java @@ -0,0 +1,8 @@ +package com.siyeh.ipp.equality.replace_equality_with_safe_equals; + +public class SimpleObjectComparison { + + boolean a(Object a, Object b) { + return a == b<caret>; + } +}
\ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/SimpleObjectComparison_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/SimpleObjectComparison_after.java new file mode 100644 index 000000000000..5ee0ddf5d6df --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/SimpleObjectComparison_after.java @@ -0,0 +1,8 @@ +package com.siyeh.ipp.equality.replace_equality_with_safe_equals; + +public class SimpleObjectComparison { + + boolean a(Object a, Object b) { + return a == null ? b == null : a.equals(b); + } +}
\ No newline at end of file |