Thorsten Moeller Thanks for debugging!
Which means that there are situations where a WELD proxy for a Path object on Unix-like platforms is not an instance of a UnixPath.
Yes, a normal-scoped producer of type java.nio.file.Path will never produce a proxy which extends UnixPath. This is how bean types and proxies work. See for example Bean types of a producer method. I'm afraid there's not much we can do. In Weld 3 API there's a way to "unwrap" the underlying instance: https://github.com/weld/api/blob/master/weld/src/main/java/org/jboss/weld/proxy/WeldClientProxy.java#L51. But it's not that easy for older versions of Weld. You can also use the singleton pseudo-scope for which client proxies are not used but there are few drawbacks, e.g. @Singleton is not a bean defining annotation. |