Program: 113040
Project: 113040
Buggy source:
@Test public void testInferredRange() throws SchemaException {
  final SimpleFeatureType schema=DataUtilities.createType("String_Node_Str","String_Node_Str");
  final List<AttributeDescriptor> descriptors=schema.getAttributeDescriptors();
  final Object[] defaults=new Object[descriptors.size()];
  int p=0;
  for (  final AttributeDescriptor descriptor : descriptors) {
    defaults[p++]=descriptor.getDefaultValue();
  }
  final SimpleFeature newFeature=SimpleFeatureBuilder.build(schema,defaults,UUID.randomUUID().toString());
  newFeature.setAttribute("String_Node_Str",Long.valueOf(100));
  newFeature.setAttribute("String_Node_Str",UUID.randomUUID().toString());
  newFeature.setAttribute("String_Node_Str",time1);
  newFeature.setAttribute("String_Node_Str",time2);
  newFeature.setAttribute("String_Node_Str",factory.createPoint(new Coordinate(27.25,41.25)));
  final FeatureDataAdapter dataAdapter=new FeatureDataAdapter(schema,new GlobalVisibilityHandler<SimpleFeature,Object>("String_Node_Str"));
  final byte[] binary=dataAdapter.toBinary();
  final FeatureDataAdapter dataAdapterCopy=new FeatureDataAdapter();
  dataAdapterCopy.fromBinary(binary);
  assertEquals(dataAdapterCopy.getAdapterId(),dataAdapter.getAdapterId());
  assertEquals(dataAdapterCopy.getType(),dataAdapter.getType());
  assertEquals(Boolean.TRUE,dataAdapterCopy.getType().getDescriptor("String_Node_Str").getUserData().get("String_Node_Str"));
  assertEquals(Boolean.TRUE,dataAdapterCopy.getType().getDescriptor("String_Node_Str").getUserData().get("String_Node_Str"));
  final List<IndexFieldHandler<SimpleFeature,? extends CommonIndexValue,Object>> handlers=dataAdapterCopy.getDefaultTypeMatchingHandlers(schema);
  boolean found=false;
  for (  final IndexFieldHandler<SimpleFeature,? extends CommonIndexValue,Object> handler : handlers) {
    found|=((handler instanceof FeatureTimeRangeHandler) && ((((FeatureTimeRangeHandler)handler).toIndexValue(newFeature).toNumericData().getMin() - time1.getTime()) < 0.001) && ((((FeatureTimeRangeHandler)handler).toIndexValue(newFeature).toNumericData().getMax() - time2.getTime()) < 0.001));
  }
  assertTrue(found);
}

Fixed version (ground truth):
@Test public void testInferredRange() throws SchemaException {
  final SimpleFeatureType schema=DataUtilities.createType("String_Node_Str","String_Node_Str","String_Node_Str");
  final List<AttributeDescriptor> descriptors=schema.getAttributeDescriptors();
  final Object[] defaults=new Object[descriptors.size()];
  int p=0;
  for (  final AttributeDescriptor descriptor : descriptors) {
    defaults[p++]=descriptor.getDefaultValue();
  }
  final SimpleFeature newFeature=SimpleFeatureBuilder.build(schema,defaults,UUID.randomUUID().toString());
  newFeature.setAttribute("String_Node_Str",Long.valueOf(100));
  newFeature.setAttribute("String_Node_Str",UUID.randomUUID().toString());
  newFeature.setAttribute("String_Node_Str",time1);
  newFeature.setAttribute("String_Node_Str",time2);
  newFeature.setAttribute("String_Node_Str",factory.createPoint(new Coordinate(27.25,41.25)));
  final FeatureDataAdapter dataAdapter=new FeatureDataAdapter(schema,new GlobalVisibilityHandler<SimpleFeature,Object>("String_Node_Str"));
  final byte[] binary=dataAdapter.toBinary();
  final FeatureDataAdapter dataAdapterCopy=new FeatureDataAdapter();
  dataAdapterCopy.fromBinary(binary);
  assertEquals("String_Node_Str",dataAdapterCopy.getType().getName().getNamespaceURI());
  assertEquals(dataAdapterCopy.getAdapterId(),dataAdapter.getAdapterId());
  assertEquals(dataAdapterCopy.getType(),dataAdapter.getType());
  assertEquals(Boolean.TRUE,dataAdapterCopy.getType().getDescriptor("String_Node_Str").getUserData().get("String_Node_Str"));
  assertEquals(Boolean.TRUE,dataAdapterCopy.getType().getDescriptor("String_Node_Str").getUserData().get("String_Node_Str"));
  final List<IndexFieldHandler<SimpleFeature,? extends CommonIndexValue,Object>> handlers=dataAdapterCopy.getDefaultTypeMatchingHandlers(schema);
  boolean found=false;
  for (  final IndexFieldHandler<SimpleFeature,? extends CommonIndexValue,Object> handler : handlers) {
    found|=((handler instanceof FeatureTimeRangeHandler) && ((((FeatureTimeRangeHandler)handler).toIndexValue(newFeature).toNumericData().getMin() - time1.getTime()) < 0.001) && ((((FeatureTimeRangeHandler)handler).toIndexValue(newFeature).toNumericData().getMax() - time2.getTime()) < 0.001));
  }
  assertTrue(found);
}