| Summary: | ASTRewrite throws IAE in CU with syntax error (missing type declaration body) | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | maninred | ||||||
| Component: | Core | Assignee: | Ayushman Jain <amj87.iitr> | ||||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | amj87.iitr, markus.kell.r, remy.suen, satyam.kandula, srikanth_sankaran | ||||||
| Version: | 3.6.2 | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | stalebug | ||||||||
| Attachments: |
|
||||||||
|
Description
maninred
Created attachment 196890 [details]
I´ve used the quickfix Add unimplemented methods
Created attachment 196891 [details]
the error log-stacktracke
To reproduce, paste this to Package Explorer and then apply the
"Add unimplemented methods" quick fix on Test2:
//------------------------------------------------------------------
public interface ITest {
// public void write(int wert);
// public int read();
public void foo();
}
public class Test implements ITest {
@Override
public void write(int wert) {
// TODO Auto-generated method stub
}
@Override
public int read() {
// TODO Auto-generated method stub
return 0;
}
}
class Test2 implements ITest
//------------------------------------------------------------------
Moving to JDT/Core to add more protection (similar to bug 272711).
If you plan to include a fix for this in 3.8 M7, please adjust the target suitably, so it becomes easier to track. Will not be able to contain this in 3.8. Relevant stack trace: java.lang.IllegalArgumentException: Document does not match the AST at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.handleException(ASTRewriteAnalyzer.java:3583) at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.getPosAfterLeftBrace(ASTRewriteAnalyzer.java:1159) at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:1605) at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:467) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480) at org.eclipse.jdt.core.dom.rewrite.ASTRewrite.internalRewriteAST(ASTRewrite.java:271) at org.eclipse.jdt.core.dom.rewrite.ASTRewrite.rewriteAST(ASTRewrite.java:260) at org.eclipse.jdt.internal.corext.refactoring.structure.CompilationUnitRewrite.attachChange(CompilationUnitRewrite.java:271) ... Caused by: org.eclipse.core.runtime.CoreException: End Of File at org.eclipse.jdt.internal.core.dom.rewrite.TokenScanner.readNext(TokenScanner.java:92) at org.eclipse.jdt.internal.core.dom.rewrite.TokenScanner.readNext(TokenScanner.java:111) at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.getPosAfterLeftBrace(ASTRewriteAnalyzer.java:1154) ... 45 more This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |