Author: tchemit Date: 2008-07-23 15:40:45 +0000 (Wed, 23 Jul 2008) New Revision: 769 Modified: trunk/lutinjaxx/core/src/main/java/jaxx/tags/TagManager.java trunk/lutinjaxx/core/src/test/java/jaxx/junit/TagManagerTest.java trunk/lutinjaxx/maven/src/main/java/org/codelutin/jaxx/JaxxGeneratorMojo.java Log: reset TagManager at each launch of JaxxGenerator goal Modified: trunk/lutinjaxx/core/src/main/java/jaxx/tags/TagManager.java =================================================================== --- trunk/lutinjaxx/core/src/main/java/jaxx/tags/TagManager.java 2008-07-23 15:30:43 UTC (rev 768) +++ trunk/lutinjaxx/core/src/main/java/jaxx/tags/TagManager.java 2008-07-23 15:40:45 UTC (rev 769) @@ -82,11 +82,11 @@ private TagManager() { /* not instantiable */ } - public static void reset() throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException { + public static void reset(boolean verbose) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException { registeredBeans.clear(); registeredTags.clear(); defaultNamespaces.clear(); - JAXXCompiler.loadLibraries(); + JAXXCompiler.loadLibraries(verbose); } @@ -123,14 +123,13 @@ * and <JButton xmlns="javax.swing.*"/> are equivalent), so tags with package names are considered * to have namespaces specified. * - * @param tag tag name + * @param tag tag name * @param namespace namespace */ public static void registerDefaultNamespace(String tag, String namespace) { if (defaultNamespaces.containsKey(tag) && !defaultNamespaces.get(tag).equals(namespace)) { defaultNamespaces.put(tag, null); // tag name is now ambiguous - } - else { + } else { defaultNamespaces.put(tag, namespace); } } @@ -194,11 +193,11 @@ /** * @param beanClass the tag class * @return the <code>TagHandler</code> that should be used to process the specified class. - * Only <code>TagHandlers</code> previously registered with <code>registerBean</code> - * are considered. + * Only <code>TagHandlers</code> previously registered with <code>registerBean</code> + * are considered. * @throws jaxx.CompilerException ? */ - public static DefaultObjectHandler getTagHandler(ClassDescriptor beanClass) throws CompilerException { + public static DefaultObjectHandler getTagHandler(ClassDescriptor beanClass) throws CompilerException { try { if (beanClass == null) { throw new NullPointerException(); Modified: trunk/lutinjaxx/core/src/test/java/jaxx/junit/TagManagerTest.java =================================================================== --- trunk/lutinjaxx/core/src/test/java/jaxx/junit/TagManagerTest.java 2008-07-23 15:30:43 UTC (rev 768) +++ trunk/lutinjaxx/core/src/test/java/jaxx/junit/TagManagerTest.java 2008-07-23 15:40:45 UTC (rev 769) @@ -91,7 +91,7 @@ ByteArrayOutputStream buffer = new ByteArrayOutputStream(); System.setErr(new PrintStream(buffer)); compiler.addImport("java.util.*"); - TagManager.reset(); + TagManager.reset(false); assertNull("Still found a handler for Date with an ambiguous import", TagManager.getTagHandler(null, "Date", compiler)); System.setErr(oldErr); assertTrue("No errors were produced with an ambiguous import", buffer.size() > 0); Modified: trunk/lutinjaxx/maven/src/main/java/org/codelutin/jaxx/JaxxGeneratorMojo.java =================================================================== --- trunk/lutinjaxx/maven/src/main/java/org/codelutin/jaxx/JaxxGeneratorMojo.java 2008-07-23 15:30:43 UTC (rev 768) +++ trunk/lutinjaxx/maven/src/main/java/org/codelutin/jaxx/JaxxGeneratorMojo.java 2008-07-23 15:40:45 UTC (rev 769) @@ -21,6 +21,7 @@ import jaxx.compiler.CompilerOptions; import jaxx.compiler.JAXXCompiler; +import jaxx.tags.TagManager; import org.apache.maven.plugin.MojoFailureException; import org.codehaus.plexus.util.DirectoryScanner; @@ -90,7 +91,7 @@ protected void doExecute() throws Exception { // force compiler init from here, not in a static block - JAXXCompiler.loadLibraries(verbose); + TagManager.reset(verbose); if (!JAXXCompiler.compile(src, files, options)) { throw new MojoFailureException("Aborting due to errors reported by jaxxc");