Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 500054 - JavaModelException below CompletionContextFunctions$InternalCompletionContextFunction.compute (thrown in JavaElement.newJavaModelException)
Summary: JavaModelException below CompletionContextFunctions$InternalCompletionContext...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Recommenders (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Andreas Sewe CLA
QA Contact:
URL:
Whiteboard: Fixed in Code Recommenders v2.4.3. Pl...
Keywords:
: 450598 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-08-22 07:18 EDT by EPP Error Reports CLA
Modified: 2019-07-24 14:35 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 EPP Error Reports CLA 2016-08-22 07:18:35 EDT
The following problem was reported via the automated error reporting:

Message: Exception during code completion.
org.eclipse.jdt.core.JavaModelException: tangram does not exist
    at org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:566)
    at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:247)
    at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:579)
    at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:316)
    at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:302)
    at org.eclipse.jdt.internal.core.JavaProject.getJavaProjectElementInfo(JavaProject.java:1642)
    at org.eclipse.jdt.internal.core.JavaProject.newNameLookup(JavaProject.java:2329)
    at org.eclipse.jdt.internal.core.SearchableEnvironment.<init>(SearchableEnvironment.java:61)
    at org.eclipse.jdt.internal.core.SearchableEnvironment.<init>(SearchableEnvironment.java:68)
    at org.eclipse.jdt.internal.core.JavaProject.newSearchableNameEnvironment(JavaProject.java:2354)
    at org.eclipse.jdt.internal.core.Openable.codeComplete(Openable.java:124)
    at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:357)
    at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:345)
    at org.eclipse.recommenders.completion.rcp.CompletionContextFunctions$InternalCompletionContextFunction.compute(CompletionContextFunctions.java:403)
    at org.eclipse.recommenders.completion.rcp.RecommendersCompletionContext.get(RecommendersCompletionContext.java:325)
    at org.eclipse.recommenders.completion.rcp.RecommendersCompletionContext.get(RecommendersCompletionContext.java:333)
    at org.eclipse.recommenders.completion.rcp.RecommendersCompletionContext.getProposals(RecommendersCompletionContext.java:241)
    at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:145)
    at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333)
    at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337)
    at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:331)
    at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:288)
    at org.eclipse.jface.text.contentassist.ContentAssistant$3.run(ContentAssistant.java:1931)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1928)
    at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:565)
    at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:560)
    at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:494)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:487)
    at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1747)
    at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:184)
    at org.eclipse.ui.texteditor.ContentAssistAction$1.run(ContentAssistAction.java:84)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.texteditor.ContentAssistAction.run(ContentAssistAction.java:81)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
    at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:118)
    at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
    at sun.reflect.GeneratedMethodAccessor.invoke(null:-1)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(null:-1)
    at java.lang.reflect.Method.invoke(null:-1)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:54)



Bundles:
| org.eclipse.core.runtime | 3.11.1.v20150903-1804 | 3.12.0.v20160606-1342 |
| org.eclipse.e4.core.di | 1.5.0.v20150421-2214 | 1.6.0.v20160319-0612 |
| org.eclipse.jdt.core | 3.11.2.v20160128-0629 | 3.12.0.v20160516-2131 |
| org.eclipse.jdt.ui | 3.11.2.v20151123-1510 | 3.12.0.v20160525-1829 |
| org.eclipse.jface | 3.11.1.v20160128-1644 | 3.12.0.v20160518-1929 |
| org.eclipse.jface.text | 3.10.0.v20150603-1752 | 3.11.0.v20160505-1301 |
| org.eclipse.recommenders.completion.rcp | 2.3.0.v20160216-1255 | 2.4.0.v20160607-1609 |
| org.eclipse.swt | 3.104.2.v20160212-1350 | 3.105.0.v20160603-0902 |
| org.eclipse.ui | 3.107.0.v20150507-1945 | 3.108.0.v20160518-1929 |

Operating Systems:
| Linux | 4.6.0.3-liquorix-amd64 | 4.6.0.3-liquorix-amd64 |
| Windows | 10.0.0 | 10.0.0 |


The above information is a snapshot of the collected data. Visit https://dev.eclipse.org/recommenders/committers/aeri/v2/#!/problems/57bab451e4b0a1bfdaef0ca8 for the latest data.

Thank you for your assistance.
 Your friendly error-reports-inbox.


Created on behalf of andreas.sewe@xxxxxx.xxx
Comment 1 Andreas Sewe CLA 2016-08-22 07:27:07 EDT
To reproduce:

- Create a new Java Project called "TestJava"
  - Therein, create a new Class Test
- Create a new Project (not Java Project) called "Test"
- Therein, create a new File "Test.java" with the following content:

  class Test {
  }

Trigger content assist in the "body" of the Test "class".

Interestingly, the presence of the Java Project with a class of the same name is crucial; without it, I cannot reproduce this.
Comment 2 Andreas Sewe CLA 2016-08-25 10:52:00 EDT
*** Bug 450598 has been marked as a duplicate of this bug. ***
Comment 3 Andreas Sewe CLA 2016-08-25 10:55:49 EDT
(In reply to Andreas Sewe from comment #1)
> Interestingly, the presence of the Java Project with a class of the same
> name is crucial; without it, I cannot reproduce this.

OK, it seems I was mislead by the fact that Code Recommenders has to be *activiated* first by triggering Content Assist in a "real" .java file, i.e., one in a Java project.
Comment 4 Eclipse Genie CLA 2016-08-25 11:33:09 EDT
New Gerrit change created: https://git.eclipse.org/r/79751
Comment 6 Andreas Sewe CLA 2016-08-26 14:42:16 EDT
(In reply to Eclipse Genie from comment #5)
> Gerrit change https://git.eclipse.org/r/79751 was merged to [maintenance].
> Commit:
> http://git.eclipse.org/c/recommenders/org.eclipse.recommenders.git/commit/
> ?id=172f66aca5412322f8add38b86c556e749367047

We now exhibit exactly the same behavior as JDT, i.e., show a dialog when triggered in a .java file outside of a Java project. Thus, I consider this issue to be fixed.