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
7accc6e5
Commit
7accc6e5
authored
Mar 07, 2015
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: fix synchronized block processing (fix #46)
parent
fa8f9ccf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
1 deletion
+61
-1
RegionMaker.java
...main/java/jadx/core/dex/visitors/regions/RegionMaker.java
+1
-1
TestTryCatch8.java
...t/java/jadx/tests/integration/trycatch/TestTryCatch8.java
+60
-0
No files found.
jadx-core/src/main/java/jadx/core/dex/visitors/regions/RegionMaker.java
View file @
7accc6e5
...
...
@@ -548,7 +548,7 @@ public class RegionMaker {
return
;
}
}
for
(
BlockNode
node
:
block
.
get
Clean
Successors
())
{
for
(
BlockNode
node
:
block
.
getSuccessors
())
{
if
(!
visited
.
contains
(
node
))
{
traverseMonitorExits
(
region
,
arg
,
node
,
exits
,
visited
);
}
...
...
jadx-core/src/test/java/jadx/tests/integration/trycatch/TestTryCatch8.java
0 → 100644
View file @
7accc6e5
package
jadx
.
tests
.
integration
.
trycatch
;
import
jadx.core.dex.nodes.ClassNode
;
import
jadx.tests.api.IntegrationTest
;
import
org.junit.Test
;
import
static
jadx
.
tests
.
api
.
utils
.
JadxMatchers
.
containsOne
;
import
static
org
.
hamcrest
.
Matchers
.*;
import
static
org
.
junit
.
Assert
.
assertThat
;
public
class
TestTryCatch8
extends
IntegrationTest
{
public
static
class
TestCls
{
static
class
MyException
extends
Exception
{
private
static
final
long
serialVersionUID
=
7963400419047287279L
;
MyException
()
{
}
MyException
(
String
msg
,
Throwable
cause
)
{
super
(
msg
,
cause
);
}
}
MyException
e
=
null
;
public
void
test
()
{
synchronized
(
this
)
{
try
{
throw
new
MyException
();
}
catch
(
MyException
e
)
{
this
.
e
=
e
;
}
catch
(
Exception
x
)
{
this
.
e
=
new
MyException
(
"MyExc"
,
x
);
}
}
}
public
void
check
()
{
test
();
assertThat
(
e
,
notNullValue
());
assertThat
(
e
,
isA
(
MyException
.
class
));
assertThat
(
e
.
getMessage
(),
nullValue
());
}
}
@Test
public
void
test
()
{
ClassNode
cls
=
getClassNode
(
TestCls
.
class
);
String
code
=
cls
.
getCode
().
toString
();
assertThat
(
code
,
containsOne
(
"synchronized (this) {"
));
assertThat
(
code
,
containsOne
(
"throw new MyException();"
));
assertThat
(
code
,
containsOne
(
"} catch (MyException e) {"
));
assertThat
(
code
,
containsOne
(
"this.e = e;"
));
assertThat
(
code
,
containsOne
(
"} catch (Exception x) {"
));
assertThat
(
code
,
containsOne
(
"this.e = new MyException(\"MyExc\", x);"
));
}
}
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