Bug 60687

Summary: NPE in JavaCore.getEncoding
Product: [Eclipse Project] JDT Reporter: Wassim Melhem <wassim.melhem>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.0 M9   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Wassim Melhem CLA 2004-05-01 13:46:40 EDT
Build: I-20040428

Found this in my log.  Not sure when it was thrown.

Error Apr 30, 2004 13:42:09.455 An internal error occurred during: "Java AST 
creation".
java.lang.NullPointerException
at org.eclipse.jdt.core.JavaCore.getEncoding(JavaCore.java:2148)
at org.eclipse.jdt.core.JavaCore.getOptions(JavaCore.java:2231)
at org.eclipse.jdt.core.dom.ASTParser.initializeDefaults(ASTParser.java:225)
at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:576)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST
(ASTProvider.java:437)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST
(ASTProvider.java:389)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST
(ASTProvider.java:383)
at 
org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartLis
tenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:123)
at 
org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$1.run
(SelectionListenerWithASTManager.java:101)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)
Comment 1 Frederic Fusier CLA 2004-05-04 09:59:02 EDT
Fixed.

This exception should not occur except perhaps when workspace is shutting down.
As at this moment, the encoding does not really matter, catch all exception
silently and return JavaCore.getEncoding()...

No test case added.
Comment 2 Olivier Thomann CLA 2004-05-18 12:30:00 EDT
Verified in 200405180816