[
https://issues.jboss.org/browse/ROASTER-116?page=com.atlassian.jira.plugi...
]
Jagadeesh Jayavelu updated ROASTER-116:
---------------------------------------
Description:
Roaster is not correctly reading the interfaces that extends with generic type
//Interface definition
import org.springframework.data.repository.CrudRepository;
public interface AccountRespository extends CrudRepository<Account, Integer>
{
}
//Parsing code
JavaInterfaceSource javaInterface = Roaster.parse(JavaInterfaceSource.class, new
File(file));
javaInterface.getInterfaces();
getInterfaces method is returning
["org.springframework.data.repository.CrudRepository"]
Unable to get the generic types in declaration. In this case <Account,Integer>
was:
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)
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
Roaster is not correctly reading the interfaces that extends with generic type
//Interface definition
import org.springframework.data.repository.CrudRepository;
public interface AccountRespository extends CrudRepository<Account, Integer>
{
}
//Parsing code
JavaInterfaceSource javaInterface = Roaster.parse(JavaInterfaceSource.class, new
File(file));
javaInterface.getInterfaces();
getInterfaces method is returning
["org.springframework.data.repository.CrudRepository"]
Unable to get the generic types in declaration. In this case <Account,Integer>
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)