Bug 101228 - JME on code assist
Summary: JME on code assist
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1.1   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-22 07:11 EDT by Martin Aeschlimann CLA
Modified: 2005-09-26 10:19 EDT (History)
2 users (show)

See Also:


Attachments
Fix (1.89 KB, patch)
2005-08-19 11:52 EDT, Jerome Lanneluc CLA
no flags Details | Diff
Regression test (2.06 KB, patch)
2005-08-19 11:52 EDT, Jerome Lanneluc CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2005-06-22 07:11:43 EDT
RC3

- new workspace, 5.0 is default compliance and 5.0 JRE is default
- enable 'fill argument names'
- do code assist and select ArrayList
- breakpoint in GenericJavaTypeProposal, linme 308: Type parameters are returned
but do not exist.

package test;

import java.util.ArrayList;

public class E {

	Object o= new ArrayL|code assist

}



!ENTRY org.eclipse.jdt.ui 4 10001 2005-06-22 13:04:21.03
!MESSAGE Internal Error
!STACK 1
Java Model Exception: Java Model Status [<E> [in ArrayList [in ArrayList.class
[in java.util [in C:\devel\jdk1.5.0_03\jre\lib\rt.jar [in Test]]]]] does not exist]
	at
org.eclipse.jdt.internal.core.JavaElement.newNotPresentException(JavaElement.java:468)
	at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:499)
	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.TypeParameter.getBounds(TypeParameter.java:36)
	at
org.eclipse.jdt.internal.ui.text.java.GenericJavaTypeProposal.computeTypeProposal(GenericJavaTypeProposal.java:367)
	at
org.eclipse.jdt.internal.ui.text.java.GenericJavaTypeProposal.computeTypeArgumentProposals(GenericJavaTypeProposal.java:349)
	at
org.eclipse.jdt.internal.ui.text.java.GenericJavaTypeProposal.apply(GenericJavaTypeProposal.java:225)
	at
org.eclipse.jdt.internal.ui.text.java.LazyJavaCompletionProposal.apply(LazyJavaCompletionProposal.java:320)
	at
org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertProposal(CompletionProposalPopup.java:447)
	at
org.eclipse.jface.text.contentassist.CompletionProposalPopup.selectProposalWithMask(CompletionProposalPopup.java:398)
	at
org.eclipse.jface.text.contentassist.CompletionProposalPopup.verifyKey(CompletionProposalPopup.java:777)
	at
org.eclipse.jface.text.contentassist.ContentAssistant$InternalListener.verifyKey(ContentAssistant.java:630)
	at
org.eclipse.jface.text.TextViewer$VerifyKeyListenersManager.verifyKey(TextViewer.java:415)
	at
org.eclipse.swt.custom.StyledTextListener.handleEvent(StyledTextListener.java:55)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:844)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:868)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:853)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:661)
	at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5133)
	at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:4868)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:844)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:868)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:853)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:881)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:877)
	at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1189)
	at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3134)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:3037)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:3694)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1656)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2701)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
	at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
	at org.eclipse.core.launcher.Main.run(Main.java:973)
	at org.eclipse.core.launcher.Main.main(Main.java:948)
!SUBENTRY 1 org.eclipse.jdt.core 4 969 2005-06-22 13:04:21.03
!MESSAGE <E> [in ArrayList [in ArrayList.class [in java.util [in
C:\devel\jdk1.5.0_03\jre\lib\rt.jar [in Test]]]]] does not exist
Comment 1 Martin Aeschlimann CLA 2005-06-22 08:12:26 EDT
this bug is not always reproducable. It seem that the Java model is in a certain
state, where the element infos can't be found.

I had it working on a new workspace, but after changing to
	Object o= new ArrayList();

	Object t= new List
The problem was there again.
Comment 2 Martin Aeschlimann CLA 2005-06-22 08:34:00 EDT
To get it again, I also removed the import for java.util.List
Comment 3 Jerome Lanneluc CLA 2005-06-22 11:33:14 EDT
I cannot reproduce with N20050622 + latest JDT Core
Comment 4 Martin Aeschlimann CLA 2005-06-23 06:54:03 EDT
still reproducable in 20050623-0010

- start with new workspace (runs on JRE 1.5.0_03)
- open preference page: (JRE 1.5.0_03) was detected
    - set the workspace compiler compliance to 5.0
    - enable 'fill argument names..' on Java > Editor > Code Assist
- ok (full build yes (of course useless)

- create project 'Test'
- create type 'E' in test
- paste code from comment 0
- code assist, works (<E> added), complete to new ArrayList<E>();
- type Object x= new Li
   code assist, select java.util.List

- no <E>, Exception in log

!SESSION 2005-06-23 12:50:49.962 -----------------------------------------------
eclipse.buildId=N20050623-0010
java.version=1.5.0_03
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_CH
Framework arguments:  -application org.eclipse.ui.ide.workbench -update
-showlocation
Command-line arguments:  -ws win32 -application org.eclipse.ui.ide.workbench
-update -debug -showlocation -data d:\eclipse-testpass3

!ENTRY org.eclipse.jdt.ui 4 10001 2005-06-23 12:52:20.791
!MESSAGE Internal Error
!STACK 1
Java Model Exception: Java Model Status [<E> [in List [in List.class [in
java.util [in C:\devel\jdk1.5.0_03\jre\lib\rt.jar [in Test]]]]] does not exist]
	at
org.eclipse.jdt.internal.core.JavaElement.newNotPresentException(JavaElement.java:468)
	at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:499)
	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.TypeParameter.getBounds(TypeParameter.java:36)
	at
org.eclipse.jdt.internal.ui.text.java.GenericJavaTypeProposal.computeTypeProposal(GenericJavaTypeProposal.java:367)
Comment 5 Jerome Lanneluc CLA 2005-06-24 09:48:10 EDT
Reproduced. This happens when a binary type parameter is opened but its parent
has not been opened yet.
Comment 6 Jerome Lanneluc CLA 2005-08-19 11:52:08 EDT
Created attachment 26308 [details]
Fix
Comment 7 Jerome Lanneluc CLA 2005-08-19 11:52:27 EDT
Created attachment 26309 [details]
Regression test
Comment 8 Philipe Mulet CLA 2005-09-01 06:09:47 EDT
+1 for 3.1.1
Comment 9 Jerome Lanneluc CLA 2005-09-01 08:42:16 EDT
Released fix and regression test in both HEAD and R3_1_maintenance branch.
Comment 10 David Audel CLA 2005-09-21 07:47:48 EDT
Verified in I20050920-0010 for 3.2M2
Comment 11 Olivier Thomann CLA 2005-09-26 10:19:44 EDT
Verified for 3.1.1 using M20050923-1430.