Skip to content

Commit

Permalink
ClassAliasPool.forName inefficent on Java 9+ #629
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-lawrey committed Feb 26, 2024
1 parent df696b6 commit b3fcea8
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,13 @@ public boolean equals(Object obj) {
return false;

CharSequence cs = (CharSequence) obj;
if (cs instanceof CAPKey)
cs = ((CAPKey) cs).value;
if (length() != cs.length())
return false;
if (value instanceof String && obj instanceof String)
return value.equals(obj);

for (int i = 0; i < length(); i++)
if (charAt(i) != cs.charAt(i))
return false;
Expand Down

0 comments on commit b3fcea8

Please sign in to comment.