Details
-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
2.3.2.Final
-
None
Description
This bug is a bit complicated, best explained by example:
1)
class Disk extends Device {}
2)
class DeviceResource<D extends Device> { //notice: implementation of get() is with generic return type
public D get(String id)
}
3)
class DiskResource extends DeviceResource<Disk> implements DiskResourceIfc{}
4)
interface DiskResourceIfc
When I try to GET a Disk I get 405 - method not allowed. I believe the reason for this is that rest-easy, using reflection, looks for implementation of: "public Disk get()" and doesn't find it, because the implementation is in the generic: "public D get()". The work-around that I found for the problem is overriding the generic method and calling super():
class DiskResource extends DeviceResource<Disk> implements DiskResourceIfc{
@Override
public Disk get()
}
Then it works.
I believe that the behavior should be: if rest-easy doesn't find the exact method (i.e: "public Disk get()", it should search for possible generic signatures (i.e: "public D get()" ,D extends Device)