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
e4fc6774
Commit
e4fc6774
authored
Jul 10, 2019
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: make correct hash calculation for GenericObject type (#705)
parent
f57dfb3f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
4 deletions
+23
-4
ArgType.java
...rc/main/java/jadx/core/dex/instructions/args/ArgType.java
+7
-4
ArgTypeTest.java
...est/java/jadx/core/dex/instructions/args/ArgTypeTest.java
+16
-0
No files found.
jadx-core/src/main/java/jadx/core/dex/instructions/args/ArgType.java
View file @
e4fc6774
...
...
@@ -156,7 +156,7 @@ public abstract class ArgType {
}
private
static
class
ObjectType
extends
KnownType
{
pr
ivate
final
String
objName
;
pr
otected
final
String
objName
;
public
ObjectType
(
String
obj
)
{
this
.
objName
=
Utils
.
cleanObjectName
(
obj
);
...
...
@@ -269,15 +269,18 @@ public abstract class ArgType {
super
(
obj
);
this
.
outerType
=
null
;
this
.
generics
=
generics
;
this
.
hash
=
obj
.
hashCode
()
+
31
*
Arrays
.
hashCode
(
generics
);
this
.
hash
=
calcHash
(
);
}
public
GenericObject
(
GenericObject
outerType
,
String
innerName
,
ArgType
[]
generics
)
{
super
(
outerType
.
getObject
()
+
'$'
+
innerName
);
this
.
outerType
=
outerType
;
this
.
generics
=
generics
;
this
.
hash
=
outerType
.
hashCode
()
+
31
*
innerName
.
hashCode
()
+
31
*
31
*
Arrays
.
hashCode
(
generics
);
this
.
hash
=
calcHash
();
}
private
int
calcHash
()
{
return
objName
.
hashCode
()
+
31
*
Arrays
.
hashCode
(
generics
);
}
@Override
...
...
jadx-core/src/test/java/jadx/core/dex/instructions/args/ArgTypeTest.java
0 → 100644
View file @
e4fc6774
package
jadx
.
core
.
dex
.
instructions
.
args
;
import
org.junit.jupiter.api.Test
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.*;
class
ArgTypeTest
{
@Test
void
testEqualsOfGenericTypes
()
{
ArgType
first
=
ArgType
.
generic
(
"java.lang.List"
,
ArgType
.
STRING
);
ArgType
second
=
ArgType
.
generic
(
"Ljava/lang/List;"
,
ArgType
.
STRING
);
assertEquals
(
first
,
second
);
}
}
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