r1708 - in trunk: jaxx-compiler/src/main/java/jaxx/compiler/tags maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug184Test
Author: tchemit Date: 2010-01-04 18:25:05 +0100 (Mon, 04 Jan 2010) New Revision: 1708 Added: trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug184Test.java trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug184Test/ trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug184Test/Bug_184.xml trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug184Test/MyPanel.jaxx Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultObjectHandler.java Log: Anomalie #184: Bug dans constructorParams Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultObjectHandler.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultObjectHandler.java 2010-01-04 16:11:17 UTC (rev 1707) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultObjectHandler.java 2010-01-04 17:25:05 UTC (rev 1708) @@ -674,9 +674,13 @@ // adds dependencies as a side effect compiler.preprocessScript(value); } else if (name.equals(CONSTRUCTOR_PARAMS_ATTRIBUTE)) { - for (String param : value.split("\\s*,\\s*")) { - compiler.preprocessScript(param); - } + //fix bug 178 : if a constructor parameter contains a comma + // the split will not works. + // using this hack will always works :) (but still a hack) + compiler.preprocessScript("java.util.Arrays.toString(" + value + ")"); +// for (String param : value.split("\\s*,\\s*")) { +// compiler.preprocessScript(param); +// } } else if (value.startsWith("{") && value.endsWith("}")) { compiler.preprocessScript(value.substring(1, value.length() - 1)); } Added: trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug184Test.java =================================================================== --- trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug184Test.java (rev 0) +++ trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug184Test.java 2010-01-04 17:25:05 UTC (rev 1708) @@ -0,0 +1,23 @@ +package org.nuiton.jaxx.plugin; + +import org.junit.Test; + +/** + * Created: 4 janv. 2010 + * + * @author Tony Chemit <chemit@codelutin.com> Copyright Code Lutin + * @version $Revision$ + * <p/> + * Mise a jour: $Date$ par : + * $Author: tchemit $ + */ +public class Bug184Test extends JaxxBaseTest { + + @Test + public void Bug_184() throws Exception { + getMojo().execute(); + assertNumberJaxxFiles(1); + } + + +} \ No newline at end of file Property changes on: trunk/maven-jaxx-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug184Test.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug184Test/Bug_184.xml =================================================================== --- trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug184Test/Bug_184.xml (rev 0) +++ trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug184Test/Bug_184.xml 2010-01-04 17:25:05 UTC (rev 1708) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.nuiton.jaxx.test</groupId> + <artifactId>test</artifactId> + <version>0</version> + <build> + <plugins> + <plugin> + <groupId>org.nuiton</groupId> + <artifactId>maven-jaxx-plugin</artifactId> + <configuration> + <src>${basedir}/target/test-classes</src> + <outJava>${basedir}/target/generated-sources/test-java</outJava> + <force>true</force> + <verbose>true</verbose> + <includes> + <value>**/bug184Test/*.jaxx</value> + </includes> + </configuration> + </plugin> + </plugins> + </build> +</project> \ No newline at end of file Added: trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug184Test/MyPanel.jaxx =================================================================== --- trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug184Test/MyPanel.jaxx (rev 0) +++ trunk/maven-jaxx-plugin/src/test/resources/org/nuiton/jaxx/plugin/bug184Test/MyPanel.jaxx 2010-01-04 17:25:05 UTC (rev 1708) @@ -0,0 +1,13 @@ +<JPanel> + +<script> + +private static final int[] yo = new int[]{65,66,67}; + +protected String myMethod(String a, String b, String c) { + return ""; +} + +</script> + <JButton constructorParams='myMethod("a", new String(yo, 1, 2), "c")'/> +</JPanel> \ No newline at end of file
participants (1)
-
tchemit@users.nuiton.org