private void trimWhiteSpacesAndComments(org.eclipse.che.ide.ext.java.jdt.internal.compiler.ast.Expression expression){
  int start=expression.sourceStart;
  int end=expression.sourceEnd;
  int token;
  int trimLeftPosition=expression.sourceStart;
  int trimRightPosition=expression.sourceEnd;
  boolean first=true;
  Scanner removeBlankScanner=this.ast.scanner;
  try {
    removeBlankScanner.setSource(this.compilationUnitSource);
    removeBlankScanner.resetTo(start,end);
    while (true) {
      token=removeBlankScanner.getNextToken();
switch (token) {
case TerminalTokens.TokenNameCOMMENT_JAVADOC:
case TerminalTokens.TokenNameCOMMENT_LINE:
case TerminalTokens.TokenNameCOMMENT_BLOCK:
        if (first) {
          trimLeftPosition=removeBlankScanner.currentPosition;
        }
      break;
case TerminalTokens.TokenNameWHITESPACE:
    if (first) {
      trimLeftPosition=removeBlankScanner.currentPosition;
    }
  break;
case TerminalTokens.TokenNameEOF:
expression.sourceStart=trimLeftPosition;
expression.sourceEnd=trimRightPosition;
return;
default :
trimRightPosition=removeBlankScanner.currentPosition - 1;
first=false;
}
}
}
 catch (InvalidInputException e) {
}
}

private void trimWhiteSpacesAndComments ( org . eclipse . che . ide . ext . java . jdt . internal . compiler . ast . Expression expression ) { int start = expression . sourceStart ; int end = expression . sourceEnd ; int token ; int trimLeftPosition = expression . sourceStart ; int trimRightPosition = expression . sourceEnd ; boolean first = true ; Scanner removeBlankScanner = this . ast . scanner ; try { removeBlankScanner . setSource ( this . compilationUnitSource ) ; removeBlankScanner . resetTo ( start , end ) ; while ( true ) { token = removeBlankScanner . getNextToken ( ) ; switch ( token ) { case TerminalTokens . TokenNameCOMMENT_JAVADOC : case TerminalTokens . TokenNameCOMMENT_LINE : case TerminalTokens . TokenNameCOMMENT_BLOCK : if ( first ) { trimLeftPosition = removeBlankScanner . currentPosition ; } break ; case TerminalTokens . TokenNameWHITESPACE : if ( first ) { trimLeftPosition = removeBlankScanner . currentPosition ; } break ; case TerminalTokens . TokenNameEOF : expression . sourceStart = trimLeftPosition ; expression . sourceEnd = trimRightPosition ; return ; default : trimRightPosition = removeBlankScanner . currentPosition - 1 ; first = false ; } } } catch ( InvalidInputException e ) { } }
remove whitespaces and comments before and after the expression .
