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
03da35b2
Commit
03da35b2
authored
Mar 09, 2014
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: fix wildcard signature processing
parent
3ccab60f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
4 deletions
+47
-4
ArgType.java
...rc/main/java/jadx/core/dex/instructions/args/ArgType.java
+4
-3
SignatureParser.java
...main/java/jadx/core/dex/nodes/parser/SignatureParser.java
+1
-1
InternalJadxTest.java
jadx-core/src/test/java/jadx/api/InternalJadxTest.java
+1
-0
TestGenerics3.java
...test/java/jadx/tests/internal/generics/TestGenerics3.java
+41
-0
No files found.
jadx-core/src/main/java/jadx/core/dex/instructions/args/ArgType.java
View file @
03da35b2
...
...
@@ -174,7 +174,7 @@ public abstract class ArgType {
private
final
int
bounds
;
public
WildcardType
(
ArgType
obj
,
int
bound
)
{
super
(
obj
.
getObject
());
super
(
ArgType
.
OBJECT
.
getObject
());
this
.
type
=
obj
;
this
.
bounds
=
bound
;
}
...
...
@@ -205,7 +205,8 @@ public abstract class ArgType {
@Override
boolean
internalEquals
(
Object
obj
)
{
return
super
.
internalEquals
(
obj
)
&&
bounds
==
((
WildcardType
)
obj
).
bounds
;
&&
bounds
==
((
WildcardType
)
obj
).
bounds
&&
type
.
equals
(((
WildcardType
)
obj
).
type
);
}
@Override
...
...
@@ -213,7 +214,7 @@ public abstract class ArgType {
if
(
bounds
==
0
)
{
return
"?"
;
}
return
"? "
+
(
bounds
==
-
1
?
"super"
:
"extends"
)
+
" "
+
super
.
toString
();
return
"? "
+
(
bounds
==
-
1
?
"super"
:
"extends"
)
+
" "
+
type
.
toString
();
}
}
...
...
jadx-core/src/main/java/jadx/core/dex/nodes/parser/SignatureParser.java
View file @
03da35b2
...
...
@@ -23,9 +23,9 @@ public class SignatureParser {
public
SignatureParser
(
String
signature
)
{
sign
=
signature
;
end
=
sign
.
length
();
pos
=
-
1
;
mark
=
0
;
end
=
sign
.
length
();
}
@SuppressWarnings
(
"unchecked"
)
...
...
jadx-core/src/test/java/jadx/api/InternalJadxTest.java
View file @
03da35b2
...
...
@@ -71,6 +71,7 @@ public abstract class InternalJadxTest {
assertFalse
(
cls
.
getAttributes
().
contains
(
AttributeFlag
.
INCONSISTENT_CODE
));
return
cls
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
fail
(
e
.
getMessage
());
return
null
;
}
...
...
jadx-core/src/test/java/jadx/tests/internal/generics/TestGenerics3.java
0 → 100644
View file @
03da35b2
package
jadx
.
tests
.
internal
.
generics
;
import
jadx.api.InternalJadxTest
;
import
jadx.core.dex.nodes.ClassNode
;
import
java.util.List
;
import
org.junit.Test
;
import
static
org
.
hamcrest
.
CoreMatchers
.
containsString
;
import
static
org
.
junit
.
Assert
.
assertThat
;
public
class
TestGenerics3
extends
InternalJadxTest
{
public
static
class
TestCls
{
public
static
void
mthExtendsArray
(
List
<?
extends
byte
[]>
list
)
{
}
public
static
void
mthSuperArray
(
List
<?
super
int
[]>
list
)
{
}
public
static
void
mthSuperInteger
(
List
<?
super
Integer
>
list
)
{
}
public
static
void
mthExtendsString
(
List
<?
super
String
>
list
)
{
}
}
@Test
public
void
test
()
{
ClassNode
cls
=
getClassNode
(
TestCls
.
class
);
String
code
=
cls
.
getCode
().
toString
();
System
.
out
.
println
(
code
);
assertThat
(
code
,
containsString
(
"mthExtendsArray(List<? extends byte[]> list)"
));
assertThat
(
code
,
containsString
(
"mthSuperArray(List<? super int[]> list)"
));
assertThat
(
code
,
containsString
(
"mthSuperInteger(List<? super Integer> list)"
));
assertThat
(
code
,
containsString
(
"mthExtendsString(List<? super String> list)"
));
}
}
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