private static boolean isNewComment(IDocument document,int commandOffset,String partitioning){
  try {
    int lineIndex=document.getLineOfOffset(commandOffset) + 1;
    if (lineIndex >= document.getNumberOfLines()) {
      return true;
    }
    IRegion line=document.getLineInformation(lineIndex);
    ITypedRegion partition=TextUtilities.getPartition(document,partitioning,commandOffset,false);
    int partitionEnd=partition.getOffset() + partition.getLength();
    if (line.getOffset() >= partitionEnd) {
      return false;
    }
    if (document.getLength() == partitionEnd) {
      return true;
    }
    String comment=document.get(partition.getOffset(),partition.getLength());
    if (comment.indexOf("/*",2) != -1) {
      return true;
    }
    return false;
  }
 catch (  BadLocationException e) {
    return false;
  }
}

private static boolean isNewComment ( IDocument document , int commandOffset , String partitioning ) { try { int lineIndex = document . getLineOfOffset ( commandOffset ) + 1 ; if ( lineIndex >= document . getNumberOfLines ( ) ) { return true ; } IRegion line = document . getLineInformation ( lineIndex ) ; ITypedRegion partition = TextUtilities . getPartition ( document , partitioning , commandOffset , false ) ; int partitionEnd = partition . getOffset ( ) + partition . getLength ( ) ; if ( line . getOffset ( ) >= partitionEnd ) { return false ; } if ( document . getLength ( ) == partitionEnd ) { return true ; } String comment = document . get ( partition . getOffset ( ) , partition . getLength ( ) ) ; if ( comment . indexOf ( "/*" , 2 ) != - 1 ) { return true ; } return false ; } catch ( BadLocationException e ) { return false ; } }
guesses if the command operates within a newly created sql multi - line comment or not . if in doubt , it will assume that the sql multi - line comment is new .
