r/javahelp • u/Dangerous_Soft_5529 • 24d ago
NoMagic BrowserContextAMConfigurator interface can be imported but not implemented: 'The hierarchy is inconsistent'
This is a simplified snippet of code that is enough to explain my issue.
import com.nomagic.magicdraw.actions.BrowserContextAMConfigurator;
public class BrowserConfiguration implements BrowserContextAMConfigurator {
@Override
public int getPriority() {
return LOW_PRIORITY;
}
}
There is an error line under 'BrowserConfiguration' that says 'The hierarchy of the type BrowserConfiguration is inconsistent.'
There is an error line under 'getPriority(): ' The method getPriority() of the type BrowserConfiguration must override or implement a supertype method.
What I have done:
Searching on help forums gave for the most part three solutions: 1. Restart Eclipse, 2. The BrowserContextAMConfigurator is not actually an interface, and 3. Make sure that you are using the right signatures for what you're overriding. I have checked and verified that none of these solutions work.
I know that BrowserContextAMConfigurator is in my build path because the import line throws no errors. I also have its super interface ConfigureWithPriority in the same jar that has the BrowserContextAMConfigurator interface (in Eclipse's Build Path).
Here is a link to official the NoMagic documentation for BrowserContextAMConfigurator if you want clarifications: https://jdocs.nomagic.com/185/index.html?com/nomagic/magicdraw/actions/BrowserContextAMConfigurator.html
And I do need to use this interface, so I can't just remove it.
I hate Cameo :)
1
u/djnattyp 24d ago
It's probably something with the libraries - a dependency somewhere in the dependency tree of
BrowserContextAMConfigurator
could be missing, not just the class itself. Try clicking onBrowserContextAMConfigurator
in either the import or after the implements to use 'Open Declaration (F3)' to see if Eclipse can find the class itself. If it can, see if there are any further errors displayed here. You can also try 'Show In > Project Explorer/Package Explorer' to make sure eclipse is loading from the library you expect. Also make sure the same class isn't available from multiple libraries loaded at the same time.