Skip to content

Commit 1343759

Browse files
committed
fix findbugs problem / change String comparison for key
1 parent 5d01d6f commit 1343759

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/attributes/LookupAttributeInMRONode.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ public static LookupAttributeInMRONode.Dynamic create() {
5757

5858
public abstract Object execute(Object klass, Object key);
5959

60-
@Specialization(guards = "key == cachedKey", limit = "2")
60+
protected static boolean compareStrings(String key, String cachedKey) {
61+
return cachedKey.equals(key);
62+
}
63+
64+
@Specialization(guards = "compareStrings(key, cachedKey)", limit = "2")
6165
@ExplodeLoop
6266
protected Object lookupConstantMRO(PythonClass klass, @SuppressWarnings("unused") String key,
6367
@Cached("key") @SuppressWarnings("unused") String cachedKey,

0 commit comments

Comments
 (0)