Skip to content

Commit d6959c5

Browse files
committed
Fixed overoptimistic isPackage when the classpath contains a folder.
Related to issue #53.
1 parent e3ddbe3 commit d6959c5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

SublimeJava.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,12 +243,12 @@ private static boolean isPackage(String packageName)
243243
if (p != null)
244244
return true;
245245

246-
packageName = packageName.replace(".", "/");
246+
packageName = packageName.replace(".", File.pathSeparator);
247247

248248
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
249249
for (String s : getClasspathEntries())
250250
{
251-
URL url = classLoader.getResource(s + "/" + packageName);
251+
URL url = classLoader.getResource(s + File.pathSeparator + packageName);
252252
if (url != null)
253253
return true;
254254
else
@@ -275,8 +275,9 @@ private static boolean isPackage(String packageName)
275275
}
276276
else
277277
{
278-
File folder = new File(filename);
279-
return folder.exists();
278+
File folder = new File(filename + File.pathSeparator + packageName);
279+
if (folder.exists())
280+
return true;
280281
}
281282
}
282283
return false;

0 commit comments

Comments
 (0)