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
128fe8a8
Commit
128fe8a8
authored
Sep 02, 2014
by
Anton Dyachenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: fix resolving the instance field in the 2nd and more nested inner class
parent
2478fc3a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
96 additions
and
2 deletions
+96
-2
InsnGen.java
jadx-core/src/main/java/jadx/core/codegen/InsnGen.java
+10
-2
TestInner3.java
jadx-samples/src/main/java/jadx/samples/TestInner3.java
+86
-0
No files found.
jadx-core/src/main/java/jadx/core/codegen/InsnGen.java
View file @
128fe8a8
...
...
@@ -129,8 +129,16 @@ public class InsnGen {
}
private
void
instanceField
(
CodeWriter
code
,
FieldInfo
field
,
InsnArg
arg
)
throws
CodegenException
{
FieldNode
fieldNode
=
mth
.
getParentClass
().
searchField
(
field
);
if
(
fieldNode
!=
null
)
{
ClassNode
pCls
=
mth
.
getParentClass
();
FieldNode
fieldNode
=
pCls
.
searchField
(
field
);
while
((
fieldNode
==
null
)
&&
(
pCls
.
getParentClass
()
!=
pCls
)
&&
(
pCls
.
getParentClass
()
!=
null
))
{
pCls
=
pCls
.
getParentClass
();
fieldNode
=
pCls
.
searchField
(
field
);
}
if
(
fieldNode
!=
null
)
{
FieldReplaceAttr
replace
=
fieldNode
.
get
(
AType
.
FIELD_REPLACE
);
if
(
replace
!=
null
)
{
FieldInfo
info
=
replace
.
getFieldInfo
();
...
...
jadx-samples/src/main/java/jadx/samples/TestInner3.java
0 → 100644
View file @
128fe8a8
package
jadx
.
samples
;
public
class
TestInner3
extends
AbstractTest
{
private
String
i0
;
public
class
A
{
protected
String
a
;
public
A
()
{
a
=
""
;
}
public
String
a
()
{
return
""
;
}
}
public
class
I0
{
private
String
i0
;
private
String
i1
;
public
class
I1
{
private
String
i0
;
private
String
i1
;
private
String
i2
;
public
I1
()
{
TestInner3
.
this
.
i0
=
"i0"
;
I0
.
this
.
i0
=
"i1"
;
I0
.
this
.
i1
=
"i2"
;
i0
=
"i0"
;
i1
=
"i1"
;
i2
=
"i2"
;
}
public
String
i
()
{
String
result
=
TestInner3
.
this
.
i0
+
I0
.
this
.
i0
+
I0
.
this
.
i1
+
i0
+
i1
+
i2
;
A
a
=
new
A
()
{
public
String
a
()
{
TestInner3
.
this
.
i0
=
"i1"
;
I0
.
this
.
i0
=
"i2"
;
I0
.
this
.
i1
=
"i3"
;
I1
.
this
.
i0
=
"i1"
;
I1
.
this
.
i1
=
"i2"
;
I1
.
this
.
i2
=
"i3"
;
a
=
"a"
;
return
TestInner3
.
this
.
i0
+
I0
.
this
.
i0
+
I0
.
this
.
i1
+
I1
.
this
.
i0
+
I1
.
this
.
i1
+
I1
.
this
.
i2
+
a
;
}
};
return
result
+
a
.
a
();
}
}
public
I0
()
{
TestInner3
.
this
.
i0
=
"i-"
;
i0
=
"i0"
;
i1
=
"i1"
;
}
public
String
i
()
{
String
result
=
TestInner3
.
this
.
i0
+
i0
+
i1
;
return
result
+
(
new
I1
()).
i
();
}
}
@Override
public
boolean
testRun
()
throws
Exception
{
assertTrue
((
new
I0
()).
i
().
equals
(
"i-i0i1i0i1i2i0i1i2i1i2i3i1i2i3a"
));
assertTrue
(
i0
.
equals
(
"i1"
));
return
true
;
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
new
TestInner2
().
testRun
();
}
}
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