Skip to content

Commit 75a2d75

Browse files
authored
Merge pull request #411 from win32kbase/master
Fix #364
2 parents 11aa8b2 + 255bedb commit 75a2d75

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<groupId>me.coley</groupId>
44
<artifactId>recaf</artifactId>
55
<url>https://github.com/Col-E/Recaf/</url>
6-
<version>2.21.2</version>
6+
<version>2.21.3</version>
77
<name>Recaf</name>
88
<description>A modern java bytecode editor</description>
99
<!-- Variables -->

src/main/java/me/coley/recaf/Recaf.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* @author Matt
3232
*/
3333
public class Recaf {
34-
public static final String VERSION = "2.21.2";
34+
public static final String VERSION = "2.21.3";
3535
public static final String DOC_URL = "https://col-e.github.io/Recaf-documentation/";
3636
public static final int ASM_VERSION = Opcodes.ASM9;
3737
private static Controller currentController;

src/main/java/me/coley/recaf/ui/controls/text/JavaEditorPane.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public void setText(String text) {
104104
public Map<String, byte[]> save(String name) {
105105
if (!canCompile())
106106
throw new UnsupportedOperationException("Recompilation not supported in read-only mode");
107-
List<String> path = null;
107+
List<String> path;
108108
try {
109109
path = getClassPath();
110110
} catch(IOException e) {
@@ -135,12 +135,17 @@ public Map<String, byte[]> save(String name) {
135135
@Override
136136
public void selectMember(String name, String desc) {
137137
// Delay until analysis has run
138-
while(code == null || (code.getUnit() == null && hasNoErrors()))
138+
if (code == null) {
139+
// Reschedule the check
139140
try {
140141
Thread.sleep(50);
141-
} catch(InterruptedException ex) { /* ignored */ }
142+
} catch (Exception e) { /* ignored */ }
143+
ThreadUtil.run(() -> selectMember(name, desc));
144+
return;
145+
}
146+
142147
// Select member if unit analysis was a success
143-
if (code != null && code.getUnit() != null) {
148+
if (code.getUnit() != null) {
144149
// Jump to range if found
145150
Optional<Range> range = JavaParserUtil.getMemberRange(code.getUnit(), name, desc);
146151
if(range.isPresent()) {

0 commit comments

Comments
 (0)