Hi, could you inherit from ResouceManager_impl?
If not, why not? What would you suggest to do? Cheers, -- Richard > On 22. Nov 2023, at 17:59, Andre Gillet <[email protected]> > wrote: > > Hello, > > Found in 3.4.1 but issue still seems to exist. We have a custom > ResourceManager which implements the ResourceManager interface. Following > code assumes that aResourceManager will always be a ResourceManager_impl. > > Method signature defines ResourceManager aResourceManager: > > https://github.com/apache/uima-uimaj/blob/81587d2e6894655af3b07b347a976fd92d8f7bf0/uimaj-core/src/main/java/org/apache/uima/resource/metadata/impl/ImportResolver.java#L142-L144 > > private void resolveImports(DescriptorAdapter<DESCRIPTOR, COLLECTIBLE> > aWrapper, > Set<String> aAlreadyVisited, Map<Key, COLLECTIBLE> > aAllCollectedObjects, > Deque<String> aStack, ResourceManager aResourceManager) throws > InvalidXMLException { > > Casting aResourceManager to ResourceManager_impl causes ClassCastException: > > https://github.com/apache/uima-uimaj/blob/81587d2e6894655af3b07b347a976fd92d8f7bf0/uimaj-core/src/main/java/org/apache/uima/resource/metadata/impl/ImportResolver.java#L160 > > Map<String, XMLizable> importCache = ((ResourceManager_impl) > aResourceManager).getImportCache(); > > Thanks, > > Andre >
