<s> package org . eclipse . jdt . internal . core . dom . rewrite ; import org . eclipse . text . edits . TextEdit ; import org . eclipse . text . edits . TextEditGroup ; import org . eclipse . jdt . core . dom . ASTNode ; import org . eclipse . jdt . core . dom . rewrite . ITrackedNodePosition ; import org . eclipse . jface . text . IRegion ; public class TrackedNodePosition implements ITrackedNodePosition { private final TextEditGroup group ; private final ASTNode node ; public TrackedNodePosition ( TextEditGroup group , ASTNode node ) { this . group = group ; this . node = node ; } public int getStartPosition ( ) { if ( this . group . isEmpty ( ) ) { return this . node . getStartPosition ( ) ; } IRegion coverage = TextEdit . getCoverage ( this . group . getTextEdits ( ) ) ; if ( coverage == null ) { return this . node . getStartPosition ( ) ; } return coverage . getOffset ( ) ; } public int getLength ( ) { if ( this . group . isEmpty ( ) ) { return this . node . getLength ( ) ; } IRegion coverage = TextEdit . getCoverage ( this . group . getTextEdits ( ) ) ; if ( coverage == null ) { return this . node . getLength ( ) ; } return coverage . getLength ( ) ; } } </s>