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
0bc37e5d
Commit
0bc37e5d
authored
Sep 20, 2014
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gui: fix jump manager
parent
46c85728
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
JumpManager.java
jadx-gui/src/main/java/jadx/gui/utils/JumpManager.java
+8
-3
TestJumpManager.groovy
...gui/src/test/groovy/jadx/gui/tests/TestJumpManager.groovy
+9
-0
No files found.
jadx-gui/src/main/java/jadx/gui/utils/JumpManager.java
View file @
0bc37e5d
...
...
@@ -26,7 +26,7 @@ public class JumpManager {
}
private
Position
getCurrent
()
{
if
(
currentPos
<
list
.
size
())
{
if
(
currentPos
>=
0
&&
currentPos
<
list
.
size
())
{
return
list
.
get
(
currentPos
);
}
return
null
;
...
...
@@ -41,9 +41,14 @@ public class JumpManager {
}
public
Position
getNext
()
{
int
size
=
list
.
size
();
if
(
size
==
0
)
{
currentPos
=
0
;
return
null
;
}
int
newPos
=
currentPos
+
1
;
if
(
newPos
>=
list
.
size
()
)
{
currentPos
=
list
.
size
()
-
1
;
if
(
newPos
>=
size
)
{
currentPos
=
size
-
1
;
return
null
;
}
Position
position
=
list
.
get
(
newPos
);
...
...
jadx-gui/src/test/groovy/jadx/gui/tests/TestJumpManager.groovy
View file @
0bc37e5d
...
...
@@ -18,6 +18,15 @@ class TestJumpManager extends Specification {
jm
.
getNext
()
==
null
}
def
"empty history 2"
()
{
expect:
jm
.
getPrev
()
==
null
jm
.
getNext
()
==
null
jm
.
getPrev
()
==
null
jm
.
getNext
()
==
null
jm
.
getPrev
()
==
null
}
def
"1 element"
()
{
when:
jm
.
addPosition
(
Mock
(
Position
))
...
...
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