Skip to content

Commit

Permalink
Add ability to open class files even when they don't have a package
Browse files Browse the repository at this point in the history
  • Loading branch information
Bl3nd committed Oct 5, 2024
1 parent 336d60b commit 29d29e1
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ else if (method)
if (packagePath.startsWith("java") || packagePath.startsWith("javax") || packagePath.startsWith("com.sun"))
return null;

String resourceName = packagePath + "/" + classMethodLocation.owner;
String resourceName = classMethodLocation.owner;
if (!packagePath.isEmpty())
resourceName = packagePath + "/" + classMethodLocation.owner;

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

String resourceName = packagePath + "/" + lexeme;
String resourceName = lexeme;
if (!packagePath.isEmpty())
{
resourceName = packagePath + "/" + lexeme;
}

if (resourceContainer.resourceClasses.containsKey(resourceName))
{
Expand Down

0 comments on commit 29d29e1

Please sign in to comment.