[
https://issues.jboss.org/browse/FORGE-704?page=com.atlassian.jira.plugin....
]
Max Schwaab edited comment on FORGE-704 at 11/19/12 1:29 PM:
-------------------------------------------------------------
Hi George,
here is my test:
{code}
import org.jboss.forge.parser.JavaParser;
import org.jboss.forge.parser.java.Field;
import org.jboss.forge.parser.java.JavaClass;
import org.junit.Test;
public class ForgeBuildJavaClassTest {
@Test
public void fieldTypeByteArrayTest() {
final JavaClass javaClass = JavaParser.create(JavaClass.class);
final Field<JavaClass> field = javaClass.addField();
field.setType(byte[].class);
}
}
{code}
It fails with an IllegalArgumentException.
Regards
Max
was (Author: mxsb):
Hi George,
here is my test:
{code}
import org.jboss.forge.parser.JavaParser;
import org.jboss.forge.parser.java.Field;
import org.jboss.forge.parser.java.JavaClass;
import org.junit.Test;
public class ForgeBuildJavaClassTest {
@Test
public void fieldTypeByteArrayTest() {
final JavaClass javaClass = JavaParser.create(JavaClass.class);
javaClass.setPublic();
final Field<JavaClass> field = javaClass.addField();
final Class<?> associatedType = byte[].class;
field.setName("byteArray");
field.setType(associatedType);
}
}
{code}
It fails with an IllegalArgumentException.
Regards
Max
org.jboss.forge.parser.java.impl.FieldImpl<O> do not handle
byte[] class
------------------------------------------------------------------------
Key: FORGE-704
URL:
https://issues.jboss.org/browse/FORGE-704
Project: Forge
Issue Type: Bug
Components: Builtin Plugins
Affects Versions: 1.1.0.Final
Environment: Windows 7 x64, Java 7
Reporter: Max Schwaab
org.jboss.forge.parser.java.impl.FieldImpl<O> can not handle byte[] class.
When trying to generate a byte[] field
*org.jboss.forge.parser.java.impl.FieldImpl.setType(Class<?>)* fails, because at the
end it depends on Class.getName, which does not start with "java.lang" (checked
in org.jboss.forge.parser.java.impl.AbstractJavaSource<O>).
Forge tries to generate an import for the name byte[], which fails in
org.jboss.forge.parser.java.impl.AbstractJavaSource.addImport(String)
I discovered this while using the hibersap-plugin.
Best regards
Max
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira