Jeremie Bresson created ROASTER-32:
--------------------------------------
Summary: MethodSource.addParameter(Class<?>, String) should support
primitive types
Key: ROASTER-32
URL:
https://issues.jboss.org/browse/ROASTER-32
Project: Roaster
Issue Type: Bug
Reporter: Jeremie Bresson
In my opinion passing {{Integer.TYPE}} as first argument in
{{MethodSource.addParameter(Class<?>, String)}} should be valid:
Example:
{code:java}
source.addMethod().setPublic().setName("doSomething").setReturnType(Integer.TYPE).setBody("return
0;").addParameter(Integer.TYPE, "initValue");
{code}
For the moment (version 2.7.1.Final) I get this stacktrace:
{quote}
Exception in thread "main" java.lang.IllegalArgumentException: Cannot import
class without a package [int]
at
org.jboss.forge.roaster.model.impl.AbstractJavaSource.addImport(AbstractJavaSource.java:171)
at org.jboss.forge.roaster.model.impl.MethodImpl.addParameter(MethodImpl.java:671)
at org.jboss.forge.roaster.model.impl.MethodImpl.addParameter(MethodImpl.java:658)
{quote}
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)