Skip to content

Commit

Permalink
Fix bytecode tokens on array descriptors
Browse files Browse the repository at this point in the history
  • Loading branch information
IotaBread committed Dec 29, 2023
1 parent 6986457 commit 305e6b3
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,9 @@ private void addToken(List<PartialToken> tokens, String text, int tokenStart, Qu
} else if (queuedToken instanceof QueuedToken.Reference r) {
tokens.add(new PartialToken(tokenStart, text, r.entry, r.context));
} else if (queuedToken instanceof QueuedToken.Descriptor d) {
var clazz = d.descriptor.substring(d.descriptor.indexOf('L') + 1, d.descriptor.length() - 1);
tokens.add(new PartialToken(tokenStart + 1, clazz, new BytecodeClassEntry(clazz), null));
int clazzStart = d.descriptor.indexOf('L') + 1;
var clazz = d.descriptor.substring(clazzStart, d.descriptor.length() - 1);
tokens.add(new PartialToken(tokenStart + clazzStart, clazz, new BytecodeClassEntry(clazz), null));
} else if (queuedToken instanceof QueuedToken.MethodDescriptor d) {
for (int i = 1; i < d.descriptor.length(); i++) {
char c = d.descriptor.charAt(i);
Expand Down

0 comments on commit 305e6b3

Please sign in to comment.