mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Cosmetics.
This commit is contained in:
parent
67cb94a163
commit
a5a8d0ed20
1 changed files with 9 additions and 11 deletions
|
@ -9,7 +9,6 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Institute for Software - initial API and implementation
|
* Institute for Software - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.ui.refactoring;
|
package org.eclipse.cdt.internal.ui.refactoring;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -29,18 +28,18 @@ import org.eclipse.cdt.core.dom.rewrite.ASTRewrite;
|
||||||
* @author Mirko Stocker
|
* @author Mirko Stocker
|
||||||
*/
|
*/
|
||||||
public class ModificationCollector {
|
public class ModificationCollector {
|
||||||
|
// Each translation unit can have only one ASTRewrite
|
||||||
// Each Translationunit can have only one ASTRewrite
|
private final Map<IASTTranslationUnit, ASTRewrite> rewriters =
|
||||||
private final Map<IASTTranslationUnit, ASTRewrite> rewriters = new HashMap<IASTTranslationUnit, ASTRewrite>();
|
new HashMap<IASTTranslationUnit, ASTRewrite>();
|
||||||
|
|
||||||
private Collection<CreateFileChange> changes;
|
private Collection<CreateFileChange> changes;
|
||||||
|
|
||||||
public ASTRewrite rewriterForTranslationUnit(IASTTranslationUnit unit) {
|
public ASTRewrite rewriterForTranslationUnit(IASTTranslationUnit ast) {
|
||||||
if(! rewriters.containsKey(unit)) {
|
if (!rewriters.containsKey(ast)) {
|
||||||
rewriters.put(unit, ASTRewrite.create(unit));
|
rewriters.put(ast, ASTRewrite.create(ast));
|
||||||
}
|
}
|
||||||
|
|
||||||
return rewriters.get(unit);
|
return rewriters.get(ast);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Creating new files doesn't concern the rewriter, the refactorings can add them here as needed.
|
// Creating new files doesn't concern the rewriter, the refactorings can add them here as needed.
|
||||||
|
@ -60,7 +59,6 @@ public class ModificationCollector {
|
||||||
result.addAll(changes.toArray(new Change[changes.size()]));
|
result.addAll(changes.toArray(new Change[changes.size()]));
|
||||||
|
|
||||||
for (ASTRewrite each : rewriters.values()) {
|
for (ASTRewrite each : rewriters.values()) {
|
||||||
|
|
||||||
result.add(each.rewriteAST());
|
result.add(each.rewriteAST());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue