|AbstractViewProvider.getCreationMethod getting the wrong method when creating a Diagram [message #667235]
||Wed, 27 April 2011 14:54
| Erik Englund
Registered: July 2009
This seems like a bug to me but here goes.|
I have a View Factory class that extends the default Generated view provider class and implement ViewFactory. All works fine with this in terms of creating views and connections.
However, I then tried to override the creation of the root Diagram. So I added this same class to the getDiagramViewClass of my View Provider. That seems to work up until it calculates what method to call to create the Diagram. The method AbstractViewProvider.getCreationMethod first checks its cache of methods and if it fails it looks for the first method that matches the name of either "createView" OR "createDiagram". It doesn't even attempt to check if the arguments match.
The problem I'm running into is I have both a createView AND a createDiagram method in my ViewFactory, however, the View provider is incorrectly grabbing the createView method since that is the first one it encounters. Then when it goes to invoke the method I get a runtime exception because the arguments are invalid.
I have had to go the the extreme of creating another dummy class that only contains a createDiagram method to ensure that the correct method is called. This works but it still seems like something is wrong.
Powered by FUDForum
. Page generated in 0.02340 seconds