Project: JDT
Bug 191349 [change method signature] error with nodeType=8;
Reported: 2007-06-06 16:00:51 | Status: verified fixed

Build ID: eclipse.buildId=I20070517-1700 Steps To Reproduce: While refactoring method signature (I changed type of the only parameter), I got the following error (in the beginning of pasted description there is my own code): java.lang.Exception: Cannot update found node: nodeType=8; { } [5685, 2825]: { int type; IASTAttributesNode attributesNode = null; ASTCommandLineNode lineNode = null; ASTTextNode textNode = null; int state = 3; ASTInlineFileNode inlineFileNode = new ASTInlineFileNode(); inlineFileNode.setParentComponent(((IASTNode)fComponentStack.peek()); try { IToken token = consume(IToken.tLBRACE); inlineFileNode.setOffset(token.getOffset()); while(state < 4) { if(state == 2) // For command line parameters don't break on ;, :, - ... occurrence token = LASymplified(1); else token = LA(1); type = token.getType(); if(state == 3) { state = 0; if(null != lineNode) inlineFileNode.addSubNode(lineNode); lineNode = new ASTCommandLineNode(); lineNode.setOffset(token.getOffset()); lineNode.setParent(inlineFileNode); // lineNode.setParentComponent((IASTComponentNode)(fNodeStack.peek())); } switch(type) { case IToken.tCOMMENT: IASTNode comment = comment(token); if(state == 0) { // Full line comment inlineFileNode.addSubNode(comment); } else { // Comment at the end of the line lineNode.addSubNode(comment); state = 3; } consume(); break; case IToken.tRBRACE: lineNode.addSubNode(newSimpleNode(token)); consume(); state = 4; break; case IToken.tEOL: consume(); state = 3; break; case IToken.tTEXT: case IToken.tFILE: // TODO: should be TEXT but not tFILE if((state < 2) && (LT(2) == IToken.tEQUAL_SIGN)) { lineNode.addEnvironmentSetting(envSetting(':')); // Inline file always on target state = 1; break; } state = 2; textNode = new ASTTextNode(); textNode.setOffset(token.getOffset()); textNode.setText(((ImagedToken)token).getCharImage()); lineNode.addSubNode(textNode); consume(); break; case IToken.tLBRACKET: if(0 == state) { attributesNode = attributes(); lineNode.setAttributes(attributesNode); state = 1; break; } default: case IToken.tERROR: ASTBadNode badNode = new ASTBadNode(); reportProblem("Line in inline file is invalid", SEVERITY_ERROR, token); // badNode.setParent((IASTNode)fNodeStack.peek()); int eol = skipToNewLine(); badNode.setOffsetAndLength(lineNode.getOffset(), eol - lineNode.getOffset() + 1); badNode.setText(fScanner.getData(badNode.getOffset(), badNode.getLength())); inlineFileNode.addSubNode(badNode); lineNode = null; state = 3; break; } } return inlineFileNode; } catch (EndOfFileException eof) { // TODO: add processing throw eof; } } at org.eclipse.jdt.internal.corext.refactoring.structure.ChangeSignatureRefactoring$NullOccurrenceUpdate.updateNode(ChangeSignatureRefactoring.java:2483) at org.eclipse.jdt.internal.corext.refactoring.structure.ChangeSignatureRefactoring.createChangeManager(ChangeSignatureRefactoring.java:1310) at org.eclipse.jdt.internal.corext.refactoring.structure.ChangeSignatureRefactoring.checkFinalConditions(ChangeSignatureRefactoring.java:815) at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:83) at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:118) at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:209) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1797) at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113) More information:

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/ChangeSignature/canModify/A_testAddSyntaxError01_Ref_in.java org.eclipse.jdt.ui.tests.refactoring/resources/ChangeSignature/canModify/A_testAddSyntaxError01_Ref_out.java org.eclipse.jdt.ui.tests.refactoring/resources/ChangeSignature/canModify/A_testAddSyntaxError01_in.java org.eclipse.jdt.ui.tests.refactoring/resources/ChangeSignature/canModify/A_testAddSyntaxError01_out.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ChangeSignatureTests.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ChangeSignatureRefactoring.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/CompilationUnitRewrite.java