Skip to content

Commit

Permalink
Fix LenientRuntimeEnumExtender finalizing fields
Browse files Browse the repository at this point in the history
Fixes #571
  • Loading branch information
Su5eD committed Dec 3, 2023
1 parent ca2e4ed commit 05ef067
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=true

# Versions
versionConnector=1.0.0-beta.28
versionConnector=1.0.0-beta.29
versionAdapter=1.8.16-1.20.1-20231120.221506
versionAdapterDefinition=1.8.21

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ public int processClassWithFlags(Phase phase, ClassNode classNode, Type classTyp
FieldNode node = values.get(0);
if ((node.access & Opcodes.ACC_FINAL) == 0) {
// It is likely a mixin already made the field mutable
// Make it final before it is processed and de-finalized again by super
// Make it final before it is processed
node.access |= Opcodes.ACC_FINAL;
return super.processClassWithFlags(phase, classNode, classType, reason);
int result = super.processClassWithFlags(phase, classNode, classType, reason);
// Return to original state
node.access &= ~Opcodes.ACC_FINAL;
return result;
}
}
// Let super deal with this
Expand Down

0 comments on commit 05ef067

Please sign in to comment.