SayMing / jsyntaxpane

Automatically exported from code.google.com/p/jsyntaxpane
0 stars 0 forks source link

Allow to load combo completions from locations other than META-INF/services/... #77

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What version of the product are you using?
0.9.5b11

Suggested patch:

Index: src/main/java/jsyntaxpane/util/JarServiceProvider.java
===================================================================
--- src/main/java/jsyntaxpane/util/JarServiceProvider.java  (revision 99)
+++ src/main/java/jsyntaxpane/util/JarServiceProvider.java  (working copy)
@@ -173,8 +173,11 @@
         List<String> lines = new ArrayList<String>();
         ClassLoader cl = JarServiceProvider.class.getClassLoader();
         cl = cl == null ? ClassLoader.getSystemClassLoader() : cl;
-        URL loc = cl.getResource(SERVICES_ROOT + url);
+        URL loc = cl.getResource(url);
         if (loc == null) {
+            loc = cl.getResource(SERVICES_ROOT + url);
+        }
+        if (loc == null) {
             return Collections.EMPTY_LIST;
         }
         try {

Original issue reported on code.google.com by peter.arrenbrecht on 12 Mar 2009 at 10:23

GoogleCodeExporter commented 9 years ago
Good suggestion.  will be added shortly.

Original comment by ayman.al...@gmail.com on 12 Mar 2009 at 11:33

GoogleCodeExporter commented 9 years ago
fixed in r101.  I also did a ClassLoader.getSystemResource(url) as another step.

Original comment by ayman.al...@gmail.com on 12 Mar 2009 at 11:44