Skip to content

Commit

Permalink
Merge pull request #17766 from hangshao0/master
Browse files Browse the repository at this point in the history
Modify the implementation of isUnnamedClass()
  • Loading branch information
tajila authored Jul 12, 2023
2 parents f7d246a + 0e3e1bc commit b036616
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions jcl/src/java.base/share/classes/java/lang/Class.java
Original file line number Diff line number Diff line change
Expand Up @@ -5782,12 +5782,13 @@ public Set<AccessFlag> accessFlags() {
*/
public boolean isUnnamedClass() {
boolean rc = false;
if ((null == getEnclosingObjectClass())
&& (null == getDeclaringClass())
&& isSynthetic()
&& (Modifier.FINAL == (getModifiers() & Modifier.FINAL))
) {
rc = true;
if (!isArray()) {
int rawModifiers = getModifiersImpl();
if ((Modifier.FINAL | SYNTHETIC) == (rawModifiers & (Modifier.FINAL | SYNTHETIC))) {
if ((null == getEnclosingObjectClass()) && (null == getDeclaringClass())) {
rc = true;
}
}
}
return rc;
}
Expand Down

0 comments on commit b036616

Please sign in to comment.