Bug 104486

Summary: newNotPresentException when reconciling CU in a non-java project
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, devel
Version: 3.1   
Target Milestone: 3.2 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Markus Keller CLA 2005-07-20 09:35:46 EDT
I20050627-1435 (3.1)

- create a new simple (non-java) project 'zzSimple'
- create a file 'CU.java' in 'zzSimple'
- the exception below is logged when the editor opens and after modifications of
the editor contents

Error 2005-07-20 14:55:47.698 Error in JDT Core during reconcile
Java Model Exception: Java Model Status [zzSimple does not exist]
at
org.eclipse.jdt.internal.core.JavaElement.newNotPresentException(JavaElement.java:468)
at
org.eclipse.jdt.internal.core.JavaModelManager.getPerProjectInfoCheckExistence(JavaModelManager.java:1223)
at
org.eclipse.jdt.internal.core.JavaProject.getPerProjectInfo(JavaProject.java:1785)
at
org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath(JavaProject.java:1923)
at org.eclipse.jdt.internal.core.JavaProject.buildStructure(JavaProject.java:332)
at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:233)
at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:488)
at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:232)
at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:218)
at
org.eclipse.jdt.internal.core.JavaProject.getJavaProjectElementInfo(JavaProject.java:1513)
at org.eclipse.jdt.internal.core.JavaProject.newNameLookup(JavaProject.java:2419)
at
org.eclipse.jdt.internal.core.SearchableEnvironment.<init>(SearchableEnvironment.java:60)
at
org.eclipse.jdt.internal.core.SearchableEnvironment.<init>(SearchableEnvironment.java:74)
at
org.eclipse.jdt.internal.core.CancelableNameEnvironment.<init>(CancelableNameEnvironment.java:26)
at
org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:148)
at
org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:214)
at
org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:79)
at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:718)
at
org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:777)
at
org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1081)
at
org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:98)
at
org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
at org.eclipse.core.runtime.Platform.run(Platform.java:783)
at
org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:82)
at
org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.initialReconcile(JavaReconcilingStrategy.java:174)
at
org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.initialReconcile(CompositeReconcilingStrategy.java:114)
at
org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.initialReconcile(JavaCompositeReconcilingStrategy.java:120)
at
org.eclipse.jface.text.reconciler.MonoReconciler.initialProcess(MonoReconciler.java:103)
at
org.eclipse.jdt.internal.ui.text.JavaReconciler.initialProcess(JavaReconciler.java:328)
at
org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:170)
Comment 1 Jerome Lanneluc CLA 2005-08-11 05:04:26 EDT
Java model operations inside non-Java projects are not supported.
Moving to JDT Text for comment
Comment 2 Jerome Lanneluc CLA 2005-08-12 09:07:57 EDT
*** Bug 106828 has been marked as a duplicate of this bug. ***
Comment 3 Dani Megert CLA 2005-08-16 10:28:04 EDT
reconcile(...) works during typing but when the file is opened the JME is
thrown. This is the same behavior as in 3.0 but in 3.1 we made the editor's
reconciler more stable so that it does not crash but logs the exception.

Since the reconciler works during typing I suggest to handle save and open as well.
Comment 4 Jerome Lanneluc CLA 2005-08-25 10:57:50 EDT
Problem happened when the working copy was consistent and force problem
detection was on.

Changed ReconcileWorkingCopyOperation to not compute problems if the project
doesn't have the Java nature in this case.

Added regression test WorkingCopyNoInClasspathTests#testReconcileSimpleProject2()
Comment 5 Olivier Thomann CLA 2005-09-20 11:53:42 EDT
Verified in I20050920-0010 for 3.2M2