JuditKnoll commented on code in PR #221:
URL: https://github.com/apache/commons-bcel/pull/221#discussion_r1287197695
##########
src/main/java/org/apache/bcel/generic/Type.java:
##########
@@ -365,6 +366,24 @@ public int hashCode() {
return type ^ signature.hashCode();
}
+ static String internalTypeNameToSignature(final String internalTypeName) {
+ if (StringUtils.isEmpty(internalTypeName) ||
StringUtils.equalsAny(internalTypeName, "B", "C", "D", "F", "I", "J", "S",
"Z")) {
+ return internalTypeName;
Review Comment:
I couldn't find any array containing these exact short names. The mentioned
[SHORT_NAMES](https://github.com/apache/commons-bcel/blob/d256a461b40e91569961ae02ad3f33dd51814024/src/main/java/org/apache/bcel/generic/InstructionFactory.java#L55)
misses `Z`, and `J`, but contains `L` additionally. The `SHORT_TYPE_NAMES` in
[Consts](https://github.com/apache/commons-bcel/blob/master/src/main/java/org/apache/bcel/Const.java#L2851)
and
[Constants](https://github.com/apache/commons-bcel/blob/master/src/main/java/org/apache/bcel/Constants.java#L2364)
both contain `V` and `ILLEGAL_TYPE` unnecessarily. There are constants for the
short names individually in
[ElementValue](https://github.com/apache/commons-bcel/blob/master/src/main/java/org/apache/bcel/classfile/ElementValue.java#L65),
but I'm not sure using those would help a lot.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]