Changeset 4016
- Timestamp:
- 09/11/08 22:32:19 (3 years ago)
- Files:
-
- trunk/src/main/java/org/sarugo/xtc/compiler/Compiler.java (modified) (2 diffs)
- trunk/src/main/java/org/sarugo/xtc/compiler/TagLibraryConfig.java (modified) (2 diffs)
- trunk/src/main/java/org/sarugo/xtc/tag/ui/InsertHandler.java (modified) (1 diff)
- trunk/src/main/java/org/sarugo/xtc/util/Classpath.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/java/org/sarugo/xtc/compiler/Compiler.java
r3966 r4016 49 49 public abstract class Compiler { 50 50 51 private static ThreadLocal<Compiler> instance = new ThreadLocal<Compiler>();52 53 51 private static final String PROVIDER_RESOURCE = "META-INF/services/org.sarugo.xtc.compiler.Compiler"; 54 52 … … 203 201 204 202 public static Compiler getInstance() { 205 206 Compiler result = instance.get(); 207 if (result == null) { 208 try { 209 instance.set((Compiler) Classpath 210 .instanceFromConfig(PROVIDER_RESOURCE)); 211 } catch (Exception e) { 212 throw new RuntimeException( 213 "Unable to register the Compiler implementation", e); 214 } 215 result = instance.get(); 216 } 217 if (result == null) { 203 try { 204 return (Compiler) Classpath.instanceFromConfig(PROVIDER_RESOURCE); 205 } catch (Exception e) { 218 206 throw new RuntimeException( 219 "Unable to register the Compiler implementation"); 220 } 221 return result; 207 "Unable to register the Compiler implementation", e); 208 } 222 209 } 223 210 } trunk/src/main/java/org/sarugo/xtc/compiler/TagLibraryConfig.java
r3966 r4016 31 31 import org.sarugo.xtc.tag.TagHandler; 32 32 import org.sarugo.xtc.tag.TagLibrary; 33 import org.sarugo.xtc.util.Classpath;34 33 import org.sarugo.xtc.util.ParameterCheck; 35 34 import org.xml.sax.Attributes; … … 199 198 throw new Exception("Must Provide Return Type: "+s); 200 199 } else { 201 String rt = s.substring(0, pos).trim();202 200 int pos2 = s.indexOf('(', pos+1); 203 201 if (pos2 == -1) { trunk/src/main/java/org/sarugo/xtc/tag/ui/InsertHandler.java
r2915 r4016 69 69 public boolean render(TemplateContext ctx, String name) throws IOException, 70 70 TemplateException, ELException { 71 if (this.name == name || this.name!= null && this.name.equals(name)) {71 if (this.name != null && this.name.equals(name)) { 72 72 this.nextHandler.render(ctx); 73 73 return true; trunk/src/main/java/org/sarugo/xtc/util/Classpath.java
r3966 r4016 16 16 17 17 import java.io.BufferedReader; 18 import java.io.File;19 18 import java.io.IOException; 20 19 import java.io.InputStreamReader; 21 import java.net.JarURLConnection;22 20 import java.net.URL; 23 import java.net.URLConnection;24 import java.util.Enumeration;25 import java.util.HashSet;26 import java.util.Set;27 import java.util.jar.JarEntry;28 import java.util.jar.JarFile;29 21 30 22 import org.sarugo.xtc.TemplateFactory; … … 57 49 providerClassName = providerName.substring(0, 58 50 providerName.indexOf('#')).trim(); 59 } else {51 } else if (providerName != null) { 60 52 providerClassName = providerName.trim(); 61 53 }
