[~twwwt] Thanks for debugging!
bq. 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|http://docs.jboss.org/cdi/spec/2.0/cdi-spec.html#producer_method_types] and [Client proxies|http://docs . jboss.org/cdi/spec/2.0/cdi-spec.html#client_proxies].
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|http://docs.jboss.org/weld/reference/latest/en-US/html/scopescontexts.html#_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. |
|