[
https://issues.jboss.org/browse/SEAMFORGE-189?page=com.atlassian.jira.plu...
]
Lincoln Baxter III commented on SEAMFORGE-189:
----------------------------------------------
{code}
@Test
public void testIsTypeChecksImportsIgnoresJavaLang() throws Exception
{
Field<JavaClass> field = javaClass.addField("private Boolean
bar;").setPublic().setName("test");
assertTrue(field.isType(Boolean.class));
assertTrue(field.isType("Boolean"));
assertTrue(field.isType(Boolean.class.getName()));
assertFalse(javaClass.hasImport(Boolean.class));
}
{code}
Field#isType(Class<?> type) method should check if class is
part of java.lang package
-------------------------------------------------------------------------------------
Key: SEAMFORGE-189
URL:
https://issues.jboss.org/browse/SEAMFORGE-189
Project: Seam Forge
Issue Type: Bug
Components: Parsers / File Manipulation
Affects Versions: 1.0.0.Alpha3
Reporter: Kevin Pollet
Assignee: Lincoln Baxter III
Priority: Critical
Fix For: 1.0.0.Alpha4
Currently, {{Field#isType(Class<?> type)}} method checks if there is an import for
the given type (only in some case). If the given class represents a wrapper type like
{{Boolean}} this will cause the following test to fail (the java.lang import is not
needed):
{code}
JavaClass fooClass = create(JavaClass.class)
.setPackage("com.test")
.setName("Foo");
Field<JavaClass> property = fooClass.addField("private Boolean bar;");
assertTrue(property.isType(Boolean.class));
{code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira