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
ee56610f
Commit
ee56610f
authored
Aug 18, 2014
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: allow method name be same as class name (issue #15)
parent
fb9ff774
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
6 deletions
+39
-6
MethodNode.java
jadx-core/src/main/java/jadx/core/dex/nodes/MethodNode.java
+1
-6
TestSameMethodsNames.java
.../java/jadx/tests/internal/names/TestSameMethodsNames.java
+38
-0
No files found.
jadx-core/src/main/java/jadx/core/dex/nodes/MethodNode.java
View file @
ee56610f
...
...
@@ -339,12 +339,7 @@ public class MethodNode extends LineAttrNode implements ILoadable {
}
public
String
getName
()
{
String
name
=
mthInfo
.
getName
();
if
(
name
.
equals
(
parentClass
.
getShortName
()))
{
return
name
+
"_"
;
}
else
{
return
name
;
}
return
mthInfo
.
getName
();
}
public
ClassNode
getParentClass
()
{
...
...
jadx-core/src/test/java/jadx/tests/internal/names/TestSameMethodsNames.java
0 → 100644
View file @
ee56610f
package
jadx
.
tests
.
internal
.
names
;
import
jadx.api.InternalJadxTest
;
import
jadx.core.dex.nodes.ClassNode
;
import
org.junit.Test
;
import
static
jadx
.
tests
.
utils
.
JadxMatchers
.
containsOne
;
import
static
org
.
junit
.
Assert
.
assertThat
;
public
class
TestSameMethodsNames
extends
InternalJadxTest
{
public
static
class
TestCls
<
V
>
{
public
static
void
test
()
{
new
Bug
().
Bug
();
}
public
static
class
Bug
{
public
Bug
()
{
System
.
out
.
println
(
"constructor"
);
}
void
Bug
()
{
System
.
out
.
println
(
"Bug"
);
}
}
}
@Test
public
void
test
()
{
ClassNode
cls
=
getClassNode
(
TestCls
.
class
);
String
code
=
cls
.
getCode
().
toString
();
System
.
out
.
println
(
code
);
assertThat
(
code
,
containsOne
(
"new Bug().Bug();"
));
}
}
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