Skip to content

Commit 399b61e

Browse files
committed
Bug: warning "The value of the local variable details is not used"
removed unused code.
1 parent bc64252 commit 399b61e

1 file changed

Lines changed: 6 additions & 31 deletions

File tree

  • sources/net.sf.j2s.core/src/net/sf/j2s/core/astvisitors

sources/net.sf.j2s.core/src/net/sf/j2s/core/astvisitors/Bindings.java

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,12 @@ private Bindings() {
5050
// No instance
5151
}
5252

53-
private static final boolean CHECK_CORE_BINDING_IS_EQUAL_TO;
54-
static {
55-
String value= Platform.getDebugOption("org.eclipse.jdt.ui/debug/checkCoreBindingIsEqualTo"); //$NON-NLS-1$
56-
CHECK_CORE_BINDING_IS_EQUAL_TO= value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
57-
}
53+
// FIXME: commented-out code. To be removed after St. Olaf merge.
54+
// private static final boolean CHECK_CORE_BINDING_IS_EQUAL_TO;
55+
// static {
56+
// String value= Platform.getDebugOption("org.eclipse.jdt.ui/debug/checkCoreBindingIsEqualTo"); //$NON-NLS-1$
57+
// CHECK_CORE_BINDING_IS_EQUAL_TO= value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
58+
// }
5859
// private static final boolean CHECK_CORE_BINDING_GET_JAVA_ELEMENT;
5960
// static {
6061
// String value= Platform.getDebugOption("org.eclipse.jdt.ui/debug/checkCoreBindingGetJavaElement"); //$NON-NLS-1$
@@ -86,35 +87,9 @@ public static boolean equals(IBinding b1, IBinding b2) {
8687
isEqualTo = bb1Name.equals(bb2.getBinaryName());
8788
}
8889
}
89-
if (CHECK_CORE_BINDING_IS_EQUAL_TO) {
90-
boolean originalEquals= originalEquals(b1, b2);
91-
if (originalEquals != isEqualTo) {
92-
//String message= "Unexpected difference between Bindings.equals(..) and IBinding#isEqualTo(..)"; //$NON-NLS-1$
93-
String detail= "\nb1 == " + b1.getKey() + ",\nb2 == " + (b2 == null ? "null binding" : b2.getKey()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
94-
try {
95-
detail+= "\nb1.getJavaElement() == " + b1.getJavaElement() + ",\nb2.getJavaElement() == " + (b2 == null ? "null binding" : b2.getJavaElement().toString()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
96-
} catch (Exception e) {
97-
detail += "\nException in getJavaElement():\n" + e; //$NON-NLS-1$
98-
}
99-
//JavaPlugin.logRepeatedMessage(message, detail);
100-
}
101-
}
10290
return isEqualTo;
10391
}
10492

105-
private static boolean originalEquals(IBinding b1, IBinding b2) {
106-
Assert.isNotNull(b1);
107-
if (b1 == b2)
108-
return true;
109-
if (b2 == null)
110-
return false;
111-
String k1= b1.getKey();
112-
String k2= b2.getKey();
113-
if (k1 == null || k2 == null)
114-
return false;
115-
return k1.equals(k2);
116-
}
117-
11893
/**
11994
* Checks if the two arrays of bindings have the same length and
12095
* their elements are equal. Uses

0 commit comments

Comments
 (0)