Program: 172184
Project: 172184
Buggy source:
/** 
 * Checks that large collections can be persisted
 */
@SuppressWarnings("String_Node_Str") public void testBigCollections() throws Exception {
  NodeRef nodeRef=nodeService.createNode(rootNodeRef,ASSOC_TYPE_QNAME_TEST_CHILDREN,QName.createQName("String_Node_Str"),TYPE_QNAME_TEST_MANY_PROPERTIES).getChildRef();
  for (int inc=0; inc < 3; inc++) {
    System.out.println("String_Node_Str");
    int collectionSize=(int)Math.pow(10,inc);
    List<String> largeCollection=new ArrayList<String>(collectionSize);
    for (int i=0; i < collectionSize; i++) {
      largeCollection.add(String.format("String_Node_Str",i));
    }
    List<String> emptyCollection=Collections.emptyList();
    long t1=System.nanoTime();
    nodeService.setProperty(nodeRef,PROP_QNAME_MULTI_VALUE,(Serializable)largeCollection);
    double tDelta=(double)(System.nanoTime() - t1) / 1E6;
    System.out.println("String_Node_Str" + collectionSize + "String_Node_Str"+ tDelta+ "String_Node_Str");
    t1=System.nanoTime();
    List<String> checkLargeCollection=(List<String>)nodeService.getProperty(nodeRef,PROP_QNAME_MULTI_VALUE);
    tDelta=(double)(System.nanoTime() - t1) / 1E6;
    System.out.println("String_Node_Str" + collectionSize + "String_Node_Str"+ tDelta+ "String_Node_Str");
    assertEquals("String_Node_Str",largeCollection,checkLargeCollection);
    t1=System.nanoTime();
    checkLargeCollection=(List<String>)nodeService.getProperty(nodeRef,PROP_QNAME_MULTI_VALUE);
    tDelta=(double)(System.nanoTime() - t1) / 1E6;
    System.out.println("String_Node_Str" + collectionSize + "String_Node_Str"+ tDelta+ "String_Node_Str");
    largeCollection.add("String_Node_Str");
    t1=System.nanoTime();
    nodeService.setProperty(nodeRef,PROP_QNAME_MULTI_VALUE,(Serializable)largeCollection);
    tDelta=(double)(System.nanoTime() - t1) / 1E6;
    System.out.println("String_Node_Str" + largeCollection.size() + "String_Node_Str"+ tDelta+ "String_Node_Str");
    largeCollection.add("String_Node_Str");
    t1=System.nanoTime();
    nodeService.setProperty(nodeRef,PROP_QNAME_MULTI_VALUE,(Serializable)largeCollection);
    tDelta=(double)(System.nanoTime() - t1) / 1E6;
    System.out.println("String_Node_Str" + largeCollection.size() + "String_Node_Str"+ tDelta+ "String_Node_Str");
    nodeService.setProperty(nodeRef,PROP_QNAME_MULTI_VALUE,(Serializable)emptyCollection);
    List<String> checkEmptyCollection=(List<String>)nodeService.getProperty(nodeRef,PROP_QNAME_MULTI_VALUE);
    assertEquals("String_Node_Str",emptyCollection,checkEmptyCollection);
    nodeService.setProperty(nodeRef,PROP_QNAME_MULTI_VALUE,null);
    List<String> checkNullCollection=(List<String>)nodeService.getProperty(nodeRef,PROP_QNAME_MULTI_VALUE);
    assertNull("String_Node_Str",checkNullCollection);
  }
}

Fixed version (ground truth):
/** 
 * Checks that large collections can be persisted
 */
@SuppressWarnings("String_Node_Str") public void testBigCollections() throws Exception {
  NodeRef nodeRef=nodeService.createNode(rootNodeRef,ASSOC_TYPE_QNAME_TEST_CHILDREN,QName.createQName("String_Node_Str"),TYPE_QNAME_TEST_MANY_PROPERTIES).getChildRef();
  for (int inc=0; inc < 5; inc++) {
    System.out.println("String_Node_Str");
    int collectionSize=(int)Math.pow(10,inc);
    List<String> largeCollection=new ArrayList<String>(collectionSize);
    for (int i=0; i < collectionSize; i++) {
      largeCollection.add(String.format("String_Node_Str",i));
    }
    List<String> emptyCollection=Collections.emptyList();
    long t1=System.nanoTime();
    nodeService.setProperty(nodeRef,PROP_QNAME_MULTI_VALUE,(Serializable)largeCollection);
    double tDelta=(double)(System.nanoTime() - t1) / 1E6;
    System.out.println("String_Node_Str" + collectionSize + "String_Node_Str"+ tDelta+ "String_Node_Str");
    t1=System.nanoTime();
    List<String> checkLargeCollection=(List<String>)nodeService.getProperty(nodeRef,PROP_QNAME_MULTI_VALUE);
    tDelta=(double)(System.nanoTime() - t1) / 1E6;
    System.out.println("String_Node_Str" + collectionSize + "String_Node_Str"+ tDelta+ "String_Node_Str");
    assertEquals("String_Node_Str",largeCollection,checkLargeCollection);
    t1=System.nanoTime();
    checkLargeCollection=(List<String>)nodeService.getProperty(nodeRef,PROP_QNAME_MULTI_VALUE);
    tDelta=(double)(System.nanoTime() - t1) / 1E6;
    System.out.println("String_Node_Str" + collectionSize + "String_Node_Str"+ tDelta+ "String_Node_Str");
    largeCollection.add("String_Node_Str");
    t1=System.nanoTime();
    nodeService.setProperty(nodeRef,PROP_QNAME_MULTI_VALUE,(Serializable)largeCollection);
    tDelta=(double)(System.nanoTime() - t1) / 1E6;
    System.out.println("String_Node_Str" + largeCollection.size() + "String_Node_Str"+ tDelta+ "String_Node_Str");
    largeCollection.add("String_Node_Str");
    t1=System.nanoTime();
    nodeService.setProperty(nodeRef,PROP_QNAME_MULTI_VALUE,(Serializable)largeCollection);
    tDelta=(double)(System.nanoTime() - t1) / 1E6;
    System.out.println("String_Node_Str" + largeCollection.size() + "String_Node_Str"+ tDelta+ "String_Node_Str");
    nodeService.setProperty(nodeRef,PROP_QNAME_MULTI_VALUE,(Serializable)emptyCollection);
    List<String> checkEmptyCollection=(List<String>)nodeService.getProperty(nodeRef,PROP_QNAME_MULTI_VALUE);
    assertEquals("String_Node_Str",emptyCollection,checkEmptyCollection);
    nodeService.setProperty(nodeRef,PROP_QNAME_MULTI_VALUE,null);
    List<String> checkNullCollection=(List<String>)nodeService.getProperty(nodeRef,PROP_QNAME_MULTI_VALUE);
    assertNull("String_Node_Str",checkNullCollection);
  }
}