[forge-issues] [JBoss JIRA] (ROASTER-116) Roaster - Issues with handling interfaces extending generic types

Jagadeesh Jayavelu (JIRA) issues at jboss.org
Sat Jan 7 19:01:00 EST 2017


Jagadeesh Jayavelu created ROASTER-116:
------------------------------------------

             Summary: 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

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)





--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the forge-issues mailing list