Program: 112892
Project: 112892
Buggy source:
public void run() throws IOException {
  initContext();
  if (inputDataStore == null) {
    LOGGER.error("String_Node_Str");
    throw new IOException("String_Node_Str");
  }
  if (isUseTime()) {
    ByteArrayId adapterByte=null;
    if (adapterId != null) {
      adapterByte=new ByteArrayId(adapterId);
    }
    scaledRange=KMeansUtils.setRunnerTimeParams(this,inputDataStore,adapterByte);
    if (scaledRange == null) {
      LOGGER.error("String_Node_Str");
      throw new ParameterException("String_Node_Str");
    }
  }
  List<ByteArrayId> featureAdapterIds;
  if (adapterId != null) {
    featureAdapterIds=new ArrayList<>();
    featureAdapterIds.add(new ByteArrayId(adapterId));
  }
 else {
    featureAdapterIds=FeatureDataUtils.getFeatureAdapterIds(inputDataStore);
  }
  final QueryOptions queryOptions=new QueryOptions();
  queryOptions.setAdapterIds(featureAdapterIds);
  final AdapterStore adapterStore=inputDataStore.createAdapterStore();
  queryOptions.getAdaptersArray(adapterStore);
  DistributableQuery query=null;
  try {
    if (cqlFilter != null) {
      Geometry bbox=null;
      ByteArrayId cqlAdapterId;
      if (adapterId == null) {
        cqlAdapterId=featureAdapterIds.get(0);
      }
 else {
        cqlAdapterId=new ByteArrayId(adapterId);
      }
      final DataAdapter adapter=adapterStore.getAdapter(cqlAdapterId);
      if (adapter instanceof FeatureDataAdapter) {
        final String geometryAttribute=((FeatureDataAdapter)adapter).getFeatureType().getGeometryDescriptor().getLocalName();
        Filter filter;
        filter=ECQL.toFilter(cqlFilter);
        final ExtractGeometryFilterVisitorResult geoAndCompareOpData=(ExtractGeometryFilterVisitorResult)filter.accept(new ExtractGeometryFilterVisitor(GeometryUtils.DEFAULT_CRS,geometryAttribute),null);
        bbox=geoAndCompareOpData.getGeometry();
      }
      if ((bbox != null) && !bbox.equals(GeometryUtils.infinity())) {
        query=new SpatialQuery(bbox);
      }
    }
  }
 catch (  final CQLException e) {
    LOGGER.error("String_Node_Str" + cqlFilter);
  }
  RDDOptions kmeansOpts=new RDDOptions();
  kmeansOpts.setMinSplits(minSplits);
  kmeansOpts.setMaxSplits(maxSplits);
  kmeansOpts.setQuery(query);
  kmeansOpts.setQueryOptions(queryOptions);
  GeoWaveRDD kmeansRDD=GeoWaveRDDLoader.loadRDD(jsc.sc(),inputDataStore,kmeansOpts);
  centroidVectors=RDDUtils.rddFeatureVectors(kmeansRDD,timeField,scaledTimeRange);
  centroidVectors.cache();
  final KMeans kmeans=new KMeans();
  kmeans.setInitializationMode("String_Node_Str");
  kmeans.setK(numClusters);
  kmeans.setMaxIterations(numIterations);
  if (epsilon > -1.0) {
    kmeans.setEpsilon(epsilon);
  }
  outputModel=kmeans.run(centroidVectors.rdd());
  writeToOutputStore();
}

Fixed version (ground truth):
public void run() throws IOException {
  initContext();
  if (inputDataStore == null) {
    LOGGER.error("String_Node_Str");
    throw new IOException("String_Node_Str");
  }
  if (isUseTime()) {
    ByteArrayId adapterByte=null;
    if (adapterId != null) {
      adapterByte=new ByteArrayId(adapterId);
    }
    scaledRange=KMeansUtils.setRunnerTimeParams(this,inputDataStore,adapterByte);
    if (scaledRange == null) {
      LOGGER.error("String_Node_Str");
      throw new ParameterException("String_Node_Str");
    }
  }
  List<ByteArrayId> featureAdapterIds;
  if (adapterId != null) {
    featureAdapterIds=new ArrayList<>();
    featureAdapterIds.add(new ByteArrayId(adapterId));
  }
 else {
    featureAdapterIds=FeatureDataUtils.getFeatureAdapterIds(inputDataStore);
  }
  final QueryOptions queryOptions=new QueryOptions();
  queryOptions.setAdapterIds(featureAdapterIds);
  final AdapterStore adapterStore=inputDataStore.createAdapterStore();
  queryOptions.getAdaptersArray(adapterStore);
  DistributableQuery query=null;
  try {
    if (cqlFilter != null) {
      Geometry bbox=null;
      ByteArrayId cqlAdapterId;
      if (adapterId == null) {
        cqlAdapterId=featureAdapterIds.get(0);
      }
 else {
        cqlAdapterId=new ByteArrayId(adapterId);
      }
      final DataAdapter adapter=adapterStore.getAdapter(cqlAdapterId);
      if (adapter instanceof FeatureDataAdapter) {
        final String geometryAttribute=((FeatureDataAdapter)adapter).getFeatureType().getGeometryDescriptor().getLocalName();
        Filter filter;
        filter=ECQL.toFilter(cqlFilter);
        final ExtractGeometryFilterVisitorResult geoAndCompareOpData=(ExtractGeometryFilterVisitorResult)filter.accept(new ExtractGeometryFilterVisitor(GeometryUtils.getDefaultCRS(),geometryAttribute),null);
        bbox=geoAndCompareOpData.getGeometry();
      }
      if ((bbox != null) && !bbox.equals(GeometryUtils.infinity())) {
        query=new SpatialQuery(bbox);
      }
    }
  }
 catch (  final CQLException e) {
    LOGGER.error("String_Node_Str" + cqlFilter);
  }
  RDDOptions kmeansOpts=new RDDOptions();
  kmeansOpts.setMinSplits(minSplits);
  kmeansOpts.setMaxSplits(maxSplits);
  kmeansOpts.setQuery(query);
  kmeansOpts.setQueryOptions(queryOptions);
  GeoWaveRDD kmeansRDD=GeoWaveRDDLoader.loadRDD(jsc.sc(),inputDataStore,kmeansOpts);
  centroidVectors=RDDUtils.rddFeatureVectors(kmeansRDD,timeField,scaledTimeRange);
  centroidVectors.cache();
  final KMeans kmeans=new KMeans();
  kmeans.setInitializationMode("String_Node_Str");
  kmeans.setK(numClusters);
  kmeans.setMaxIterations(numIterations);
  if (epsilon > -1.0) {
    kmeans.setEpsilon(epsilon);
  }
  outputModel=kmeans.run(centroidVectors.rdd());
  writeToOutputStore();
}