I have project where are used @Resource(name = "xxx/XXX"). I am not able create @Injectable for this resource (Missing @Injectable for field). This is the same problem like #359 .
I think the solution for this problem is update method
The "/" character is supported in the lookup attribute of @Resource, but not in name. I am not sure if it's valid for name to have slashes in the Java EE spec, but it seems wrong since "abc/Xyz" is actually a hierarchy with two names, while "abc-Xyz" or "abc.Xyz" is still a single name.
Any reason why your Resources are using name instead of lookup, for such composite names?
I think "/" is valid for name. For examle EJB 3.0 and EJB 3.1 application bindings overview from IBM contains examples where slash is used in @EJB name (@EJB(name="ejb/FacadeRemoteRef") ). I agree with hierarchy and two names and I think it is the right reason why we use slash in names.
Solution should be use only the last name after slash. For example:
@Resource(name="abc/XYZ")
Resource resource;
and
@Injectable
Resource XYZ
I don't want change name to lookup I don't see any reason to change it.
Ok. I settled on what's probably a better solution: to fall back on matching the annotated field name, when no injectable is found which matches the name or lookup attributes.
jmockit version 1.40
I have project where are used
@Resource(name = "xxx/XXX")
. I am not able create@Injectable
for this resource (Missing@Injectable
for field). This is the same problem like #359 .I think the solution for this problem is update method
jmockit1/main/src/mockit/internal/injection/InjectionPoint.java
Line 76 in f4d60f3
and add conversion for "/" as delimiter.
The text was updated successfully, but these errors were encountered: