Skip to content

Commit 29d29e1

Browse files
committed
Add ability to open class files even when they don't have a package
1 parent 336d60b commit 29d29e1

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

  • src/main/java/the/bytecode/club/bytecodeviewer/gui/components/actions

src/main/java/the/bytecode/club/bytecodeviewer/gui/components/actions/GoToAction.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ else if (method)
211211
if (packagePath.startsWith("java") || packagePath.startsWith("javax") || packagePath.startsWith("com.sun"))
212212
return null;
213213

214-
String resourceName = packagePath + "/" + classMethodLocation.owner;
214+
String resourceName = classMethodLocation.owner;
215+
if (!packagePath.isEmpty())
216+
resourceName = packagePath + "/" + classMethodLocation.owner;
215217

216218
if (resourceContainer.resourceClasses.containsKey(resourceName))
217219
{
@@ -229,7 +231,11 @@ else if (method)
229231
if (packagePath.startsWith("java") || packagePath.startsWith("javax") || packagePath.startsWith("com.sun"))
230232
return null;
231233

232-
String resourceName = packagePath + "/" + lexeme;
234+
String resourceName = lexeme;
235+
if (!packagePath.isEmpty())
236+
{
237+
resourceName = packagePath + "/" + lexeme;
238+
}
233239

234240
if (resourceContainer.resourceClasses.containsKey(resourceName))
235241
{

0 commit comments

Comments
 (0)