Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JiBX 1.2.1
-
Fix Version/s: JiBX 1.2.2
-
Component/s: BindGen
-
Labels:None
-
Environment:Win XP
Maven
JiBX 1.2.1
-
Number of attachments :
Description
BindGen tool throws an exception and fails if classes contain generics like <? extends Event>.
Signature +Lcom/company/prj/Event; is recognized as invalid
Complete exception:
bindgen:
[echo] Running BindGen tool
[echo] C:\Documents and Settings\user\workspace\prj\src\main\java\
[java] Exception in thread "main" org.apache.bcel.classfile.ClassFormatExce
ption: Invalid method signature: +Lcom/company/prj/Event;
[java] at org.apache.bcel.classfile.Utility.typeOfSignature(Utility.jav
a:1024)
[java] at org.apache.bcel.generic.Type.getType(Type.java:158)
[java] at org.jibx.custom.classes.ValueCustom.fillDetails(ValueCustom.j
ava:592)
[java] at org.jibx.custom.classes.ClassCustom.apply(ClassCustom.java:80
0)
[java] at org.jibx.custom.classes.GlobalCustom.addClassCustomization(Gl
obalCustom.java:386)
[java] at org.jibx.binding.generator.BindGen.checkInclude(BindGen.java:
160)
[java] at org.jibx.binding.generator.BindGen.expandReferences(BindGen.j
ava:205)
[java] at org.jibx.binding.generator.BindGen.findReferences(BindGen.jav
a:986)
[java] at org.jibx.binding.generator.BindGen.generate(BindGen.java:1100
)
[java] at org.jibx.binding.generator.BindGen.main(BindGen.java:1274)
Sample classes:
(Events.java)
public class Events
{
private List<? extends Event> events;
public List<? extends Event> getEvents()
{ return events; }public void setEvents(List<? extends Event> events)
{ this.events = events; }}
(Event.java)
abstract class Event implements EventInt, Serializable {
protected String id;
public String getId()
{ return id; }public void setId(String id)
{ this.id = id; }}
Fixed this, at least in that it no longer throws an exception. You'll still need to set the type of items in the collection using a customization, though, since the actual processing of "generic" signatures is still limited to simple type names.