Bug 83520 - Error while cast in string concat
Summary: Error while cast in string concat
Status: RESOLVED DUPLICATE of bug 83346
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-24 04:21 EST by Tomaszewski Przemek CLA
Modified: 2005-01-24 04:23 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomaszewski Przemek CLA 2005-01-24 04:21:25 EST
Code which causes this error:
 public class CompilerCastTest
{
    public static void main(String[] args)
    {
        CompilerCastTest obj = new CompilerCastTest();
        System.out.println("example: " + (Object) obj);
    }
}


"Java AST creation" error dialog appears and exception in error log appears:

java.lang.NullPointerException
at
org.eclipse.jdt.internal.compiler.problem.ProblemReporter.unnecessaryCastForArgument(ProblemReporter.java:4715)
at
org.eclipse.jdt.internal.compiler.ast.CastExpression.checkNeedForArgumentCasts(CastExpression.java:215)
at
org.eclipse.jdt.internal.compiler.ast.BinaryExpression.resolveType(BinaryExpression.java:1762)
at
org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:285)
at org.eclipse.jdt.internal.compiler.ast.Expression.resolve(Expression.java:757)
at org.eclipse.jdt.internal.compiler.ast.Block.resolve(Block.java:101)
at org.eclipse.jdt.internal.compiler.ast.IfStatement.resolve(IfStatement.java:225)
at org.eclipse.jdt.internal.compiler.ast.Block.resolve(Block.java:101)
at org.eclipse.jdt.internal.compiler.ast.IfStatement.resolve(IfStatement.java:225)
at
org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:411)
at
org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:160)
at
org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:389)
at
org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1014)
at
org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1063)
at
org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:280)
at
org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:651)
at
org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:443)
at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:708)
at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:574)
at
org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST(ASTProvider.java:563)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:494)
at
org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:165)
at
org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$3.run(SelectionListenerWithASTManager.java:142)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)
Comment 1 Tomaszewski Przemek CLA 2005-01-24 04:23:02 EST

*** This bug has been marked as a duplicate of 83346 ***