Skip to content

Commit 4ee50f5

Browse files
committed
Update comments
1 parent 33812d0 commit 4ee50f5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/main/java/io/papermc/asm/rules/rename/EnumValueOfRewriteRule.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void generateMethod(final GeneratorAdapterFactory factory, final MethodCa
6666
methodGenerator.visitLookupSwitchInsn(lookupSwitchEndLabel, lookupSwitchKeys, labels);
6767
for (int i = 0; i < labels.length; i++) {
6868
methodGenerator.mark(labels[i]);
69-
// LocalVariableSorter inserts trailing int local for i == 0
69+
// LocalVariableSorter will insert the trailing int local for this and all following visitFrame calls; adding it manually would cause duplicate locals in the frame
7070
methodGenerator.visitFrame(Opcodes.F_NEW, 1, new Object[]{"java/lang/String"}, 1, new Object[]{"java/lang/String"});
7171
// generate case
7272
final List<String> matchingStrings = hashToField.get(lookupSwitchKeys[i]);
@@ -120,7 +120,6 @@ public void generateMethod(final GeneratorAdapterFactory factory, final MethodCa
120120
methodGenerator.visitFrame(Opcodes.F_NEW, 1, new Object[]{"java/lang/String"}, 1, new Object[]{"java/lang/String"});
121121
methodGenerator.loadArg(0); // default to the passed in value
122122
methodGenerator.mark(tableSwitchEndLabel);
123-
// LocalVariableSorter inserts trailing int local
124123
methodGenerator.visitFrame(Opcodes.F_NEW, 1, new Object[]{"java/lang/String"}, 2, new Object[]{"java/lang/String", "java/lang/String"});
125124
methodGenerator.invokeStatic(Type.getType(original.owner().descriptorString()), new Method(original.name(), original.descriptor().descriptorString()));
126125
methodGenerator.returnValue();

0 commit comments

Comments
 (0)