-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix anonymous and local class indices (#35)
The previous code would consider type parameters an indexed class
- Loading branch information
1 parent
f166031
commit 64a0cd7
Showing
5 changed files
with
69 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
tests/data/parchment/anonymous_classes/expected/FormattedText.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import java.util.concurrent.atomic.AtomicReference; | ||
import java.util.Optional; | ||
|
||
public interface FormattedText { | ||
FormattedText EMPTY = new FormattedText() { | ||
@Override | ||
public <T> Optional<T> visit(AtomicReference<T> named_inner1) { | ||
return Optional.empty(); | ||
} | ||
}; | ||
|
||
<T> Optional<T> visit(AtomicReference<T> p_ref); | ||
|
||
static FormattedText of(final String p_txt) { | ||
class Local { | ||
void run(int named_local1) {} | ||
} | ||
return new FormattedText() { | ||
@Override | ||
public <T> Optional<T> visit(AtomicReference<T> named_inner2) { | ||
return Optional.empty(); | ||
} | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
tsrg2 left right | ||
obfuscated_c$1 FormattedText$1 | ||
obfuscated_m (Ljava/util/concurrent/atomic/AtomicReference;)Ljava/util/Optional; visit | ||
0 o named_inner1 | ||
obfuscated_c$2 FormattedText$2Local | ||
obfuscated_m (I)V run | ||
0 o named_local1 | ||
obfuscated_c$3 FormattedText$3 | ||
obfuscated_m (Ljava/util/concurrent/atomic/AtomicReference;)Ljava/util/Optional; visit | ||
0 o named_inner2 |
25 changes: 25 additions & 0 deletions
25
tests/data/parchment/anonymous_classes/source/FormattedText.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import java.util.concurrent.atomic.AtomicReference; | ||
import java.util.Optional; | ||
|
||
public interface FormattedText { | ||
FormattedText EMPTY = new FormattedText() { | ||
@Override | ||
public <T> Optional<T> visit(AtomicReference<T> p_130797_) { | ||
return Optional.empty(); | ||
} | ||
}; | ||
|
||
<T> Optional<T> visit(AtomicReference<T> p_ref); | ||
|
||
static FormattedText of(final String p_txt) { | ||
class Local { | ||
void run(int p_127434_) {} | ||
} | ||
return new FormattedText() { | ||
@Override | ||
public <T> Optional<T> visit(AtomicReference<T> p_130787_) { | ||
return Optional.empty(); | ||
} | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters