-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: additional checks for class signature (#2272)
- Loading branch information
Showing
4 changed files
with
118 additions
and
20 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
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
32 changes: 32 additions & 0 deletions
32
jadx-core/src/test/java/jadx/tests/integration/others/TestClassImplementsSignature.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,32 @@ | ||
package jadx.tests.integration.others; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import jadx.tests.api.RaungTest; | ||
|
||
import static jadx.tests.api.utils.assertj.JadxAssertions.assertThat; | ||
|
||
public class TestClassImplementsSignature extends RaungTest { | ||
|
||
public static class TestCls { | ||
public abstract static class A<T> implements Comparable<A<T>> { | ||
T value; | ||
} | ||
} | ||
|
||
@Test | ||
public void test() { | ||
assertThat(getClassNode(TestCls.class)) | ||
.code() | ||
.containsOne("public static abstract class A<T> implements Comparable<A<T>> {"); | ||
} | ||
|
||
@Test | ||
public void testRaung() { | ||
allowWarnInCode(); | ||
assertThat(getClassNodeFromRaung()) | ||
.code() | ||
.containsOne("public class TestClassImplementsSignature<T> {") | ||
.containsOne("Unexpected interfaces in signature"); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
jadx-core/src/test/raung/others/TestClassImplementsSignature.raung
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,16 @@ | ||
.version 52 # Java 8 | ||
.class public super others/TestClassImplementsSignature | ||
.signature <T:Ljava/lang/Object;>Ljava/lang/Object;Ljava/lang/Comparable<Lothers/TestClassImplementsSignature<LT;>;>; | ||
|
||
.field value Ljava/lang/Object; | ||
.signature TT; | ||
.end field | ||
|
||
.method public <init>()V | ||
.max stack 1 | ||
.max locals 1 | ||
|
||
aload 0 | ||
invokespecial java/lang/Object <init> ()V | ||
return | ||
.end method |