Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
J
jadx
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
jadx
Commits
f57dfb3f
Commit
f57dfb3f
authored
Jul 09, 2019
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: check method override with generic arguments (#701)
parent
c3f7a049
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
0 deletions
+57
-0
TestGenericsMthOverride.java
...x/tests/integration/generics/TestGenericsMthOverride.java
+57
-0
No files found.
jadx-core/src/test/java/jadx/tests/integration/generics/TestGenericsMthOverride.java
0 → 100644
View file @
f57dfb3f
package
jadx
.
tests
.
integration
.
generics
;
import
org.junit.jupiter.api.Test
;
import
jadx.core.dex.nodes.ClassNode
;
import
jadx.tests.api.IntegrationTest
;
import
static
jadx
.
tests
.
api
.
utils
.
JadxMatchers
.
containsOne
;
import
static
org
.
hamcrest
.
MatcherAssert
.
assertThat
;
public
class
TestGenericsMthOverride
extends
IntegrationTest
{
public
static
class
TestCls
{
public
interface
I
<
X
,
Y
>
{
Y
method
(
X
x
);
}
public
static
class
A
<
X
,
Y
>
implements
I
<
X
,
Y
>
{
@Override
public
Y
method
(
X
x
)
{
return
null
;
}
}
public
static
class
B
<
X
,
Y
>
implements
I
<
X
,
Y
>
{
@Override
public
Y
method
(
Object
x
)
{
return
null
;
}
}
public
static
class
C
<
X
extends
Exception
,
Y
>
implements
I
<
X
,
Y
>
{
@Override
public
Y
method
(
Exception
x
)
{
return
null
;
}
}
public
static
class
D
<
X
,
Y
>
implements
I
<
X
,
Y
>
{
@Override
public
Object
method
(
Object
x
)
{
return
null
;
}
}
}
@Test
public
void
test
()
{
ClassNode
cls
=
getClassNode
(
TestCls
.
class
);
String
code
=
cls
.
getCode
().
toString
();
assertThat
(
code
,
containsOne
(
"public Y method(X x) {"
));
assertThat
(
code
,
containsOne
(
"public Y method(Object x) {"
));
assertThat
(
code
,
containsOne
(
"public Y method(Exception x) {"
));
assertThat
(
code
,
containsOne
(
"public Object method(Object x) {"
));
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment