-
Bug
-
Resolution: Fixed
-
P3
-
None
-
b149
-
Not verified
Class.isAnonymousClass is implemented as:
public boolean isAnonymousClass() {
return "".equals(getSimpleName());
}
However, getSimpleName generates quite a few superfluous objects that could be avoided if isAnonymousClass was implemented to check the conditions that will lead it to return "" more directly:
public boolean isAnonymousClass() {
return !isArray() && getEnclosingMethodInfo() != null &&
getSimpleBinaryName0() == null;
}
This reduces the average cost of isAnonymousClass by around 65%, which should be worthwhile since this is both a public API and a component of other internal methods in wide internal use.
public boolean isAnonymousClass() {
return "".equals(getSimpleName());
}
However, getSimpleName generates quite a few superfluous objects that could be avoided if isAnonymousClass was implemented to check the conditions that will lead it to return "" more directly:
public boolean isAnonymousClass() {
return !isArray() && getEnclosingMethodInfo() != null &&
getSimpleBinaryName0() == null;
}
This reduces the average cost of isAnonymousClass by around 65%, which should be worthwhile since this is both a public API and a component of other internal methods in wide internal use.