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
008216d5
Commit
008216d5
authored
Mar 30, 2019
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: don't cast overloaded methods with generics from other class (#448)
parent
4a92275a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
0 deletions
+49
-0
InsnGen.java
jadx-core/src/main/java/jadx/core/codegen/InsnGen.java
+4
-0
TestSuperInvokeWithGenerics.java
...tests/integration/invoke/TestSuperInvokeWithGenerics.java
+45
-0
No files found.
jadx-core/src/main/java/jadx/core/codegen/InsnGen.java
View file @
008216d5
...
@@ -733,6 +733,10 @@ public class InsnGen {
...
@@ -733,6 +733,10 @@ public class InsnGen {
origType
=
callMth
.
getMethodInfo
().
getArgumentsTypes
().
get
(
origPos
);
origType
=
callMth
.
getMethodInfo
().
getArgumentsTypes
().
get
(
origPos
);
}
else
{
}
else
{
origType
=
arguments
.
get
(
origPos
).
getInitType
();
origType
=
arguments
.
get
(
origPos
).
getInitType
();
if
(
origType
.
isGenericType
()
&&
!
callMth
.
getParentClass
().
equals
(
mth
.
getParentClass
()))
{
// cancel cast
return
false
;
}
}
}
if
(!
arg
.
getType
().
equals
(
origType
))
{
if
(!
arg
.
getType
().
equals
(
origType
))
{
code
.
add
(
'('
);
code
.
add
(
'('
);
...
...
jadx-core/src/test/java/jadx/tests/integration/invoke/TestSuperInvokeWithGenerics.java
0 → 100644
View file @
008216d5
package
jadx
.
tests
.
integration
.
invoke
;
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
;
import
static
org
.
hamcrest
.
Matchers
.
anyOf
;
public
class
TestSuperInvokeWithGenerics
extends
IntegrationTest
{
public
static
class
TestCls
{
public
class
A
<
T
extends
Exception
,
V
>
{
public
A
(
T
t
)
{
System
.
out
.
println
(
"t"
+
t
);
}
public
A
(
V
v
)
{
System
.
out
.
println
(
"v"
+
v
);
}
}
public
class
B
extends
A
<
Exception
,
String
>
{
public
B
(
String
s
)
{
super
(
s
);
}
public
B
(
Exception
e
)
{
super
(
e
);
}
}
}
@Test
public
void
test
()
{
ClassNode
cls
=
getClassNode
(
TestCls
.
class
);
String
code
=
cls
.
getCode
().
toString
();
assertThat
(
code
,
containsOne
(
"super(e);"
));
assertThat
(
code
,
containsOne
(
"super(s);"
));
}
}
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