Bug 434315 - [content assist] Invoking content assist inside Java file that isn't in the workspace throws exception
Summary: [content assist] Invoking content assist inside Java file that isn't in the w...
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: bugday
Depends on:
Blocks:
 
Reported: 2014-05-07 07:56 EDT by Martin Mathew CLA
Modified: 2020-05-14 03:37 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Mathew CLA 2014-05-07 07:56:22 EDT
Create the below file in C:/temp

public class A{
	m2 // Invoke content assist after m2 to complete the method creation
}

Open Eclipse and drag and drop the file inside Eclipse. Now as mentioned in the file invoke content assist after 'm2', JME and Core Exceptions are thrown:

Java Model Exception: Java Model Status [A.java [in <default> [in <project root> [in  ]]] does not exist]
	at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException(JavaElement.java:534)
	at org.eclipse.jdt.internal.core.CompilationUnit.openBuffer(CompilationUnit.java:1156)
	at org.eclipse.jdt.internal.core.Openable.getBuffer(Openable.java:289)
	at org.eclipse.jdt.internal.core.Openable.findRecommendedLineSeparator(Openable.java:210)
	at org.eclipse.jdt.internal.core.dom.rewrite.ImportRewriteAnalyzer.getResultingEdits(ImportRewriteAnalyzer.java:798)
	at org.eclipse.jdt.core.dom.rewrite.ImportRewrite.rewriteImports(ImportRewrite.java:1079)
	at org.eclipse.jdt.internal.ui.text.java.JavaTypeCompletionProposal.apply(JavaTypeCompletionProposal.java:116)
	at org.eclipse.jdt.internal.ui.text.java.AbstractJavaCompletionProposal.apply(AbstractJavaCompletionProposal.java:497)
	




org.eclipse.core.runtime.CoreException: File not found: '/ /A.java'
	at org.eclipse.jdt.internal.core.util.Util.getResourceContentsAsCharArray(Util.java:1175)
	at org.eclipse.jdt.internal.core.CompilationUnit.getContents(CompilationUnit.java:649)
	at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:1118)
	at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:809)
	at org.eclipse.jdt.core.dom.rewrite.ImportRewrite.rewriteImports(ImportRewrite.java:1051)
	at org.eclipse.jdt.internal.ui.text.java.JavaTypeCompletionProposal.apply(JavaTypeCompletionProposal.java:116)
	at org.eclipse.jdt.internal.ui.text.java.AbstractJavaCompletionProposal.apply(AbstractJavaCompletionProposal.java:497)
Comment 1 Eclipse Genie CLA 2020-05-14 03:37:00 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.