[
https://issues.jboss.org/browse/ROASTER-116?page=com.atlassian.jira.plugi...
]
Jagadeesh Jayavelu updated ROASTER-116:
---------------------------------------
Description:
a) Roaster is not correctly reading the interfaces that extends generic type
//Interface definition
public interface AccountRespository extends CrudRepository<Account, int>
{
}
//Parsing code
JavaInterfaceSource javaInterface = Roaster.parse(JavaInterfaceSource.class, new
File(file));
javaInterface.getInterfaces();
getInterfaces method is returning empty.
b) Exception when generating java code with interfaces that extends generic type
JavaInterfaceSource cu =Roaster.parse(JavaInterfaceSource.class, "public interface
SomeInterface {}");
cu.addInterface("com.test.CrudRepository<Account, int>")
This throws exception
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size:
0
at java.util.ArrayList.rangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at
org.jboss.forge.roaster._shade.org.eclipse.jdt.core.dom.ASTNode$NodeList.get(ASTNode.java:1369)
at
org.jboss.forge.roaster.model.impl.AbstractJavaSourceMemberHolder.addInterface(AbstractJavaSourceMemberHolder.java:422)
was:
a) Roaster is not correctly reading the interfaces that extends generic type
public interface AccountRespository extends CrudRepository<Account, int>
{
}
JavaInterfaceSource javaInterface = Roaster.parse(JavaInterfaceSource.class, new
File(file));
javaInterface.getInterfaces();
getInterfaces method is returning empty.
b) Exception when generating java code with interfaces that extends generic type
JavaInterfaceSource cu =Roaster.parse(JavaInterfaceSource.class, "public interface
SomeInterface {}");
cu.addInterface("com.test.CrudRepository<Account, int>")
This throws exception
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size:
0
at java.util.ArrayList.rangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at
org.jboss.forge.roaster._shade.org.eclipse.jdt.core.dom.ASTNode$NodeList.get(ASTNode.java:1369)
at
org.jboss.forge.roaster.model.impl.AbstractJavaSourceMemberHolder.addInterface(AbstractJavaSourceMemberHolder.java:422)
Roaster - Issues with handling interfaces extending generic types
-----------------------------------------------------------------
Key: ROASTER-116
URL:
https://issues.jboss.org/browse/ROASTER-116
Project: Roaster
Issue Type: Bug
Components: API
Affects Versions: 2.19.4.Final
Reporter: Jagadeesh Jayavelu
a) Roaster is not correctly reading the interfaces that extends generic type
//Interface definition
public interface AccountRespository extends CrudRepository<Account, int>
{
}
//Parsing code
JavaInterfaceSource javaInterface = Roaster.parse(JavaInterfaceSource.class, new
File(file));
javaInterface.getInterfaces();
getInterfaces method is returning empty.
b) Exception when generating java code with interfaces that extends generic type
JavaInterfaceSource cu =Roaster.parse(JavaInterfaceSource.class, "public interface
SomeInterface {}");
cu.addInterface("com.test.CrudRepository<Account, int>")
This throws exception
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size:
0
at java.util.ArrayList.rangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at
org.jboss.forge.roaster._shade.org.eclipse.jdt.core.dom.ASTNode$NodeList.get(ASTNode.java:1369)
at
org.jboss.forge.roaster.model.impl.AbstractJavaSourceMemberHolder.addInterface(AbstractJavaSourceMemberHolder.java:422)
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)