Commits

petermr committed f0b8ca6

bugfixing continues

Comments (0)

Files changed (9)

jc-top-all/.settings/org.eclipse.core.resources.prefs

-#Wed Feb 08 10:44:35 GMT 2012
+#Wed Feb 15 22:04:05 GMT 2012
 eclipse.preferences.version=1
 encoding/<project>=UTF-8

jc-top-core/.settings/org.eclipse.core.resources.prefs

-#Wed Feb 08 10:44:35 GMT 2012
+#Wed Feb 15 22:04:05 GMT 2012
 eclipse.preferences.version=1
 encoding//src/main/java=UTF-8
 encoding//src/main/resources=UTF-8

jc-top-core/src/main/java/org/xmlcml/cml/converters/registry/ConverterRegistry.java

 package org.xmlcml.cml.converters.registry;
 
 import java.io.InputStream;
+
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collections;
  */
 public class ConverterRegistry {
 
-    public static final String CONVERTER_FILE = "META-INF/jumbo-converters";
+    public static final String META_INF_JUMBO = "META-INF/jumbo-converters";
 
     /** create singleton registry
      */
     }
 
 	private void createConvertersList() {
-        converterList = new ArrayList<Converter>();
-		try {
-        	ClassLoader ldr = ConverterRegistry.class.getClassLoader();
-
-            Enumeration<URL> e = ldr.getResources(CONVERTER_FILE);
-            for (URL url : Collections.list(e)) {
-                InputStream is = url.openStream();
-                try {
-                    for (String line : IOUtils.readLines(is)) {
-                        line = stripComments(line);
-                        String convertersName = line.trim();
-                        if (convertersName.length() > 0) {
-                            try {
-                            	System.out.println("Name: "+convertersName);
-                                Class<?> clazz = Class.forName(convertersName);
-                                AbstractConverterModule converterAndTypeLists = (AbstractConverterModule) clazz.newInstance();
-                                converterList.addAll(converterAndTypeLists.getConverterList());
-                            } catch (Exception ex) {
-                                System.err.println("Error loading converter: "+ex);
-                                ex.printStackTrace();
-                            }
-                        }
-                    }
-                } finally {
-                    IOUtils.closeQuietly(is);
-                }
-            }
-        } catch (Exception e) {
-            System.err.println("Error loading converter files");
-            e.printStackTrace();
-        }
+		if (converterList == null) {
+	        converterList = new ArrayList<Converter>();
+			try {
+	        	ClassLoader ldr = ConverterRegistry.class.getClassLoader();
+	            Enumeration<URL> e = ldr.getResources(META_INF_JUMBO);
+	            for (URL url : Collections.list(e)) {
+	                InputStream is = url.openStream();
+	                try {
+	                    for (String line : IOUtils.readLines(is)) {
+	                        line = stripComments(line);
+	                        String convertersName = line.trim();
+	                        if (convertersName.length() > 0) {
+	                            try {
+	                            	System.out.println("Meta-inf Name: "+convertersName);
+	                                Class<?> clazz = Class.forName(convertersName);
+	                                AbstractConverterModule converterAndTypeLists = (AbstractConverterModule) clazz.newInstance();
+	                                converterList.addAll(converterAndTypeLists.getConverterList());
+	                            } catch (Exception ex) {
+	                                System.err.println("Error loading converter: "+ex);
+	                                ex.printStackTrace();
+	                            }
+	                        }
+	                    }
+	                } finally {
+	                    IOUtils.closeQuietly(is);
+	                }
+	            }
+	        } catch (Exception e) {
+	            System.err.println("Error loading converter files");
+	            e.printStackTrace();
+	        }
+		}
 	}
 	
 	private void registerConverters() {

jc-top-templates/.settings/org.eclipse.core.resources.prefs

-#Wed Feb 08 10:44:35 GMT 2012
+#Wed Feb 15 22:04:05 GMT 2012
 eclipse.preferences.version=1
 encoding//src/main/java=UTF-8
 encoding//src/main/resources=UTF-8

jc-top-testutils/.classpath

 	<classpathentry kind="src" output="target/classes" path="src/main/java"/>
 	<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
 	<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
 	<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
 	<classpathentry kind="output" path="target/classes"/>
 </classpath>

jc-top-testutils/.settings/org.eclipse.core.resources.prefs

-#Wed Feb 08 10:44:35 GMT 2012
+#Wed Feb 15 22:04:05 GMT 2012
 eclipse.preferences.version=1
 encoding//src/main/java=UTF-8
 encoding//src/test/java=UTF-8

jc-top-testutils/.settings/org.eclipse.jdt.core.prefs

-#Wed Jan 04 18:22:29 GMT 2012
+#Wed Feb 15 19:39:28 GMT 2012
 eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
 org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.6

jc-top-testutils/src/test/java/org/xmlcml/cml/converters/testutils/RegressionSuiteTest.java

 package org.xmlcml.cml.converters.testutils;
 
 import static org.mockito.Matchers.eq;
+
 import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 
     <parent>
         <groupId>cml</groupId>
-        <artifactId>jumboconverters2-parent</artifactId>
+        <artifactId>jc-parent</artifactId>
         <version>0.3-SNAPSHOT</version>
     </parent>