Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[photran] What is the difference between ast.toString() and ast.getRoot().toString() in a refactoring class

I am currently implementing a refactoring class, which extends FortranEditorRefactoring. In doCreateChange, I call addChangeFromModifiedAST(fileInEditor, pm), but the last character of the code is missing. I check the code by calling ast.getRoot().toString(), and it is correct. I further check addChangeFromModifiedAST() in VPGRefactoring.java. The problem is that ast.toString() misses the last character of the code. In short, in the refactoring class, ast.getRoot().toString() shows the correct code. However, in the addChangeFromModifiedAST() of VPGRefactoring.java, ast.toString() misses the last character. Following is a code segment in doCreateChange().

@Override
protected void doCreateChange(IProgressMonitor pm) throws CoreException,
        OperationCanceledException
{


// remove the subprogram
for (ScopingNode node : subprogramList){            
            node.removeFromTree();
}
System.out.println(ast.getRoot().toString); // correct
addChangeFromModifiedAST(fileInEditor, pm); // missing the last character
vpg.releaseAllASTs();
}

Thanks.

Back to the top