Bug 72859 - NPE in ASTConverter
Summary: NPE in ASTConverter
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-30 04:20 EDT by mspringm CLA
Modified: 2004-09-23 12:46 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mspringm CLA 2004-08-30 04:20:53 EDT
Eclipse Platform:
-----------------
Version: 3.1.0
Build id: 200408122000

JDK:
----
java version "1.5.0-beta3"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta3-b60)
Java HotSpot(TM) Client VM (build 1.5.0-beta3-b60, mixed mode, sharing)

Action:
-------
press 'F4' on java.util.concurrent.TimeUnit in this code:

    public void run() {
        TimeUnit tunit;
    }


Result:
-------

!ENTRY org.eclipse.core.runtime 4 2 Aug 30, 2004 09:58:31.163
!MESSAGE An internal error occurred during: "Override indicator installation 
job".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.jdt.core.dom.ASTConverter.lookupScope
(ASTConverter.java:3350)
	at org.eclipse.jdt.core.dom.ASTConverter.lookupForScopes
(ASTConverter.java:3313)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1295)
	at org.eclipse.jdt.core.dom.ASTParser.convert(ASTParser.java:711)
	at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST
(ASTParser.java:682)
	at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:574)
	at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST
(ASTProvider.java:441)
	at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST
(ASTProvider.java:393)
	at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor$8.run
(JavaEditor.java:3857)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)

!ENTRY org.eclipse.core.runtime 4 2 Aug 30, 2004 09:58:31.233
!MESSAGE An internal error occurred during: "Java AST creation".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.jdt.core.dom.ASTConverter.lookupScope
(ASTConverter.java:3350)
	at org.eclipse.jdt.core.dom.ASTConverter.lookupForScopes
(ASTConverter.java:3313)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1295)
	at org.eclipse.jdt.core.dom.ASTParser.convert(ASTParser.java:711)
	at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST
(ASTParser.java:682)
	at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:574)
	at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST
(ASTProvider.java:441)
	at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST
(ASTProvider.java:393)
	at 
org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartList
enerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:159)
	at 
org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$3.run
(SelectionListenerWithASTManager.java:136)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)

!ENTRY org.eclipse.core.runtime 4 2 Aug 30, 2004 09:58:31.383
!MESSAGE An internal error occurred during: "Semantic Highlighting Job".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.jdt.core.dom.ASTConverter.lookupScope
(ASTConverter.java:3350)
	at org.eclipse.jdt.core.dom.ASTConverter.lookupForScopes
(ASTConverter.java:3313)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1295)
	at org.eclipse.jdt.core.dom.ASTParser.convert(ASTParser.java:711)
	at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST
(ASTParser.java:682)
	at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:574)
	at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST
(ASTProvider.java:441)
	at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST
(ASTProvider.java:393)
	at 
org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightingReconciler$1.run
(SemanticHighlightingReconciler.java:356)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)

!ENTRY org.eclipse.core.runtime 4 2 Aug 30, 2004 09:58:31.863
!MESSAGE An internal error occurred during: "Java AST creation".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.jdt.core.dom.ASTConverter.lookupScope
(ASTConverter.java:3350)
	at org.eclipse.jdt.core.dom.ASTConverter.lookupForScopes
(ASTConverter.java:3313)
...

this exception repeats several/many times ...
Comment 1 mspringm CLA 2004-08-30 04:24:49 EDT
sorry, it's NOT 'F4' but 'F3' 
Comment 2 Olivier Thomann CLA 2004-09-07 17:45:13 EDT
I cannot reproduce with latest.
Could you please provide the whole source of the class in which you have the
problem?
Ideally it would be good if you could extract a small test case that reproduces
the problem. You can also try to move to the latest integration build.
Comment 3 mspringm CLA 2004-09-08 03:54:33 EDT
The class is:

--- start of source ---
import java.util.concurrent.TimeUnit;

public class TstTimeUnitF3 {
    
    public void run() {
        TimeUnit tunit;
    }
}
--- end of source ---

try with 
eclipse.buildId=N200409070010

result:
!ENTRY org.eclipse.core.runtime 4 2 Sep 08, 2004 09:36:02.777
!MESSAGE An internal error occurred during: "Override indicator installation 
job".
!STACK 0
java.lang.NullPointerException
at org.eclipse.jdt.core.dom.ASTConverter.lookupScope(ASTConverter.java:3357)
at org.eclipse.jdt.core.dom.ASTConverter.lookupForScopes(ASTConverter.java:3320)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1295)
at org.eclipse.jdt.core.dom.ASTParser.convert(ASTParser.java:705)
at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:682)
at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:574)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST
(ASTProvider.java:441)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST
(ASTProvider.java:393)
at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor$8.run(JavaEditor.java:3864)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)

comment:
Set the compiler compliance level to "1.4" and it works fine.
Set it to "1.5" an get the exception.
Comment 4 Olivier Thomann CLA 2004-09-08 10:27:44 EDT
I am investigating.
Comment 5 Olivier Thomann CLA 2004-09-08 10:49:46 EDT
Fixed and released in HEAD.
Comment 6 Olivier Thomann CLA 2004-09-08 11:00:03 EDT
Regression test added.
Comment 7 David Audel CLA 2004-09-23 12:46:56 EDT
Verified in I200409230100.