public void endLine(){
  if (coordList == null) {
    return;
  }
  if (ignoreInvalidLines && coordList.size() < 2) {
    coordList=null;
    return;
  }
  Coordinate[] rawPts=coordList.toCoordinateArray();
  Coordinate[] pts=rawPts;
  if (fixInvalidLines)   pts=validCoordinateSequence(rawPts);
  coordList=null;
  LineString line=null;
  try {
    line=geomFact.createLineString(pts);
  }
 catch (  IllegalArgumentException ex) {
    if (!ignoreInvalidLines)     throw ex;
  }
  if (line != null)   lines.add(line);
}

public void endLine ( ) { if ( coordList == null ) { return ; } if ( ignoreInvalidLines && coordList . size ( ) < 2 ) { coordList = null ; return ; } Coordinate [ ] rawPts = coordList . toCoordinateArray ( ) ; Coordinate [ ] pts = rawPts ; if ( fixInvalidLines ) pts = validCoordinateSequence ( rawPts ) ; coordList = null ; LineString line = null ; try { line = geomFact . createLineString ( pts ) ; } catch ( IllegalArgumentException ex ) { if ( ! ignoreInvalidLines ) throw ex ; } if ( line != null ) lines . add ( line ) ; }
terminate the current linestring .
