Bug 38853 - Error trying to open a type on selection from a java file in a simple project
Summary: Error trying to open a type on selection from a java file in a simple project
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Dirk Baeumer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 38873
Blocks:
  Show dependency tree
 
Reported: 2003-06-12 15:54 EDT by Olivier Thomann CLA
Modified: 2004-05-18 09:34 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2003-06-12 15:54:14 EDT
Using 0611 build, I got this error:
Java Model Exception: Java Model Status [jdt-core-home does not exist.]
	at java.lang.Throwable.<init>(Throwable.java)
	at java.lang.Throwable.<init>(Throwable.java)
	at org.eclipse.core.runtime.CoreException.<init>(CoreException.java)
	at org.eclipse.jdt.core.JavaModelException.<init>(JavaModelException.java)
	at
org.eclipse.jdt.internal.core.JavaElement.newNotPresentException(JavaElement.java)
	at
org.eclipse.jdt.internal.core.JavaModelManager.getPerProjectInfoCheckExistence(JavaModelManager.java)
	at org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath(JavaProject.java)
	at org.eclipse.jdt.internal.core.JavaProject.generateInfos(JavaProject.java)
	at org.eclipse.jdt.internal.core.Openable.buildStructure(Openable.java)
	at org.eclipse.jdt.internal.core.Openable.openWhenClosed(Openable.java)
	at org.eclipse.jdt.internal.core.JavaProject.openWhenClosed(JavaProject.java:1872)
	at org.eclipse.jdt.internal.core.JavaElement.openHierarchy(JavaElement.java)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java)
	at
org.eclipse.jdt.internal.core.JavaProject.getJavaProjectElementInfo(JavaProject.java:1117)
	at org.eclipse.jdt.internal.core.JavaProject.getNameLookup(JavaProject.java:1125)
	at org.eclipse.jdt.internal.core.Openable.codeSelect(Openable.java:132)
	at
org.eclipse.jdt.internal.core.CompilationUnit.codeSelect(CompilationUnit.java:98)
	at
org.eclipse.jdt.internal.ui.actions.SelectionConverter.codeResolve(SelectionConverter.java:213)
	at
org.eclipse.jdt.internal.ui.actions.SelectionConverter.codeResolve(SelectionConverter.java:150)
	at
org.eclipse.jdt.internal.ui.actions.SelectionConverter.codeResolve(SelectionConverter.java:159)
	at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:122)
	at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:193)
	at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:169)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:842)
	at
org.eclipse.ui.internal.WWinKeyBindingService.pressed(WWinKeyBindingService.java:214)
	at
org.eclipse.ui.internal.WWinKeyBindingService$5.widgetSelected(WWinKeyBindingService.java:332)
	at org.eclipse.ui.internal.AcceleratorMenu$2.handleEvent(AcceleratorMenu.java:68)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1399)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:1382)

When I tried to open on selection inside a java editor located in a simple project.

STEPS TO REPRODUCE:
1) Load the HEAD of the project jdt-core-home from dev.eclipse.org.
2) Go to howto/generate parser
3) Open UpdateParserFiles.java
4) Select Parser in Parser.buildFilesFromLPG(args[0]); and press F3.
You should get the same error. I would expect either the code not to do anything
, because this is not a java project.
Comment 1 Olivier Thomann CLA 2003-06-13 09:24:04 EDT
I think the bug comes from the fact that the file is considered as a 
compilation unit and it should not. The project in which the file is located is 
NOT a  Java project. How can this file be seen as a compilation unit?
Comment 2 Dirk Baeumer CLA 2003-06-13 09:28:37 EDT
See bug 38873 for the discussion. 
Comment 3 Dirk Baeumer CLA 2004-05-18 09:34:34 EDT
Fixed for M9.