Bug 280134 - [1.5][compiler] Requesting Java AST from selection has encountered a problem
Summary: [1.5][compiler] Requesting Java AST from selection has encountered a problem
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4.2   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 3.6 M1   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2009-06-12 15:41 EDT by Jonathan Camilleri CLA
Modified: 2009-08-04 00:57 EDT (History)
4 users (show)

See Also:


Attachments
Screendump (18.08 KB, image/png)
2009-06-12 15:41 EDT, Jonathan Camilleri CLA
no flags Details
log file (109.56 KB, text/plain)
2009-06-15 14:11 EDT, Jonathan Camilleri CLA
no flags Details
Another log file (1006.62 KB, text/plain)
2009-06-15 14:13 EDT, Jonathan Camilleri CLA
no flags Details
Proposed patch (1.09 KB, patch)
2009-06-24 14:17 EDT, Kent Johnson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Camilleri CLA 2009-06-12 15:41:22 EDT
Created attachment 139065 [details]
Screendump

Build ID: Build id: I20090430-2300

Steps To Reproduce:
I was (happily) typing some code when an error appeared...see attachment.

More information:

Microsoft Windows [Version 6.0.6001]
Copyright (c) 2006 Microsoft Corporation.  All rights reserved.

C:\Users\Administrator>java -version
java version "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) 64-Bit Server VM (build 14.0-b16, mixed mode)
Comment 1 Markus Keller CLA 2009-06-15 12:10:57 EDT
Please attach the .log (or the relevant entry copied from the Error Log view).
Comment 2 Jonathan Camilleri CLA 2009-06-15 12:40:53 EDT
I have attached the screenshot of the error, and, said what I was doing.  That's all I know.
Comment 3 Markus Keller CLA 2009-06-15 14:02:14 EDT
As you can imagine, the screenshot does not help much if we cannot reproduce the problem and have no additional info on the circumstances. That's why I asked you to attach your log file. The log file is at <workspace location>/.metadata/.log

If you don't want to attach the whole log, you can also select Window > Show View > Error Log and then copy the entry with the same title as given in the screendump (including the stack trace, of course).
Comment 4 Jonathan Camilleri CLA 2009-06-15 14:11:34 EDT
Created attachment 139194 [details]
log file

Attached log file.
Comment 5 Jonathan Camilleri CLA 2009-06-15 14:13:11 EDT
Created attachment 139196 [details]
Another log file
Comment 6 Dani Megert CLA 2009-06-16 01:56:40 EDT
There are two JDT related entries in the .log:

>java.lang.ClassCastException: org.eclipse.jdt.core.dom.EnumDeclaration cannot be >cast to org.eclipse.jdt.core.dom.TypeDeclaration
This is fixed, see bug  239887.

!ENTRY org.eclipse.core.jobs 4 2 2009-06-12 21:40:12.984
!MESSAGE An internal error occurred during: "Requesting Java AST from selection".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.jdt.internal.compiler.lookup.WildcardBinding.erasure(WildcardBinding.java:389)

Jonathan, it would be good to have a test case. Moving to JDT Core for investigation.
Comment 7 Olivier Thomann CLA 2009-06-16 10:18:04 EDT
Could you please provide the compilation unit that caused the problem?
Thanks.
Comment 8 Jonathan Camilleri CLA 2009-06-16 15:56:56 EDT
I don't remember sorry.
Comment 9 Olivier Thomann CLA 2009-06-24 12:12:38 EDT
Kent, it looks like typeVariable() can return null, but this is not handled everywhere.
Comment 10 Kent Johnson CLA 2009-06-24 14:17:44 EDT
Created attachment 140015 [details]
Proposed patch
Comment 11 Kent Johnson CLA 2009-06-24 14:20:10 EDT
No reproduceable case to verify - just check code

Released in HEAD for 3.6M1
Comment 12 Olivier Thomann CLA 2009-06-24 14:30:21 EDT
Without a reproducable test case and/or steps to reproduce to assess how serious this problem is, this won't be backported to 3.5.1.
Comment 13 Srikanth Sankaran CLA 2009-08-04 00:57:22 EDT
Verfied for 3.6M1 (by code inspection)