Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 338787 - [Java] VariableDeclarationFragmentImpl cannot be cast to Type
Summary: [Java] VariableDeclarationFragmentImpl cannot be cast to Type
Status: NEW
Alias: None
Product: MoDisco
Classification: Modeling
Component: Technologies (show other bugs)
Version: 0.9.0   Edit
Hardware: PC Windows 7
: P5 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-03 06:23 EST by Nicolas Bros CLA
Modified: 2011-09-28 10:50 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Bros CLA 2011-03-03 06:23:30 EST
While testing the discovery framework dialogs (Java discoverer, on empty project with some randomly selected JRE jars), I got the following exception.

!ENTRY org.eclipse.modisco.java.discoverer 4 0 2011-03-03 12:20:27.747
!MESSAGE org.eclipse.gmt.modisco.java.emf.impl.VariableDeclarationFragmentImpl cannot be cast to org.eclipse.gmt.modisco.java.Type (org.eclipse.modisco.java.discoverer_0.9.0.qualifier)
!STACK 0
java.lang.ClassCastException: org.eclipse.gmt.modisco.java.emf.impl.VariableDeclarationFragmentImpl cannot be cast to org.eclipse.gmt.modisco.java.Type
	at org.eclipse.modisco.java.discoverer.io.library.ClassFileParserUtils.manageBindingRef(ClassFileParserUtils.java:67)
	at org.eclipse.modisco.java.discoverer.io.library.ClassFileParser.getRefOnType(ClassFileParser.java:922)
	at org.eclipse.modisco.java.discoverer.io.library.ClassFileParser.visitMethod(ClassFileParser.java:548)
	at org.eclipse.modisco.java.discoverer.io.library.ClassFileParser.parse2(ClassFileParser.java:258)
	at org.eclipse.modisco.java.discoverer.io.library.ClassFileParser.parse(ClassFileParser.java:196)
	at org.eclipse.modisco.java.discoverer.io.library.LibraryReader.visitClassFile(LibraryReader.java:226)
	at org.eclipse.modisco.java.discoverer.io.library.LibraryReader.parseClassFile(LibraryReader.java:197)
	at org.eclipse.modisco.java.discoverer.io.library.LibraryReader.parsePackage(LibraryReader.java:183)
	at org.eclipse.modisco.java.discoverer.io.library.LibraryReader.readModel(LibraryReader.java:156)
	at org.eclipse.modisco.java.discoverer.AbstractDiscoverJavaModelFromProject.analyzeJavaProject(AbstractDiscoverJavaModelFromProject.java:150)
	at org.eclipse.modisco.java.discoverer.DiscoverJavaModelFromProject.basicDiscoverElement(DiscoverJavaModelFromProject.java:48)
	at org.eclipse.modisco.java.discoverer.DiscoverJavaModelFromProject.basicDiscoverElement(DiscoverJavaModelFromProject.java:1)
	at org.eclipse.modisco.infra.discovery.core.AbstractDiscoverer.discoverElement(AbstractDiscoverer.java:93)
	at org.eclipse.modisco.infra.discovery.core.AbstractModelDiscoverer.discoverElement(AbstractModelDiscoverer.java:180)
	at org.eclipse.modisco.infra.discovery.ui.internal.actions.MoDiscoMenuSelectionListener.discovererElement(MoDiscoMenuSelectionListener.java:350)
	at org.eclipse.modisco.infra.discovery.ui.internal.actions.MoDiscoMenuSelectionListener$1.run(MoDiscoMenuSelectionListener.java:115)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 1 Nicolas Bros CLA 2011-03-03 08:28:38 EST
That happens each time I try to analyze jce.jar from my JRE 6.
Comment 2 Romain Dervaux CLA 2011-03-20 15:50:18 EDT
This problem is caused by the class javax.crypto.Cipher which has a static inner class called 'r' and a static field also named 'r'.

Thay both have the qualified name javax.crypto.Cipher.r

As the binding manager map each named element with its qualified name, we have a conflict here (same qualified name for two different named elements).

This special case is not handled by the Java discoverer.
Comment 3 Gregoire Dupe CLA 2011-09-28 10:50:12 EDT
Hello,

I'm really sorry, but the year we have to focus on the move to EMF Facet. We
may not be able to work on this bug. That's why cannot plan this bug for the
Juno release.

Regards,
Gregoire Dupe