<s> package org . eclipse . jdt . core . dom ; import org . eclipse . jdt . core . compiler . InvalidInputException ; import org . eclipse . jdt . internal . compiler . parser . Scanner ; import org . eclipse . jdt . internal . compiler . parser . TerminalTokens ; public abstract class Statement extends ASTNode { private String optionalLeadingComment = null ; Statement ( AST ast ) { super ( ast ) ; } public String getLeadingComment ( ) { return this . optionalLeadingComment ; } public void setLeadingComment ( String comment ) { if ( comment != null ) { char [ ] source = comment . toCharArray ( ) ; Scanner scanner = this . ast . scanner ; scanner . resetTo ( 0 , source . length ) ; scanner . setSource ( source ) ; try { int token ; boolean onlyOneComment = false ; while ( ( token = scanner . getNextToken ( ) ) != TerminalTokens . TokenNameEOF ) { switch ( token ) { case TerminalTokens . TokenNameCOMMENT_BLOCK : case TerminalTokens . TokenNameCOMMENT_JAVADOC : case TerminalTokens . TokenNameCOMMENT_LINE : if ( onlyOneComment ) { throw new IllegalArgumentException ( ) ; } onlyOneComment = true ; break ; default : onlyOneComment = false ; } } if ( ! onlyOneComment ) { throw new IllegalArgumentException ( ) ; } } catch ( InvalidInputException e ) { throw new IllegalArgumentException ( ) ; } } checkModifiable ( ) ; this . optionalLeadingComment = comment ; } void copyLeadingComment ( Statement source ) { setLeadingComment ( source . getLeadingComment ( ) ) ; } int memSize ( ) { int size = BASE_NODE_SIZE + 1 * 4 + stringSize ( getLeadingComment ( ) ) ; return size ; } } </s>