Program: 128528
Project: 128528
Buggy source:
/** 
 * DOC smallet Comment method "createRoutine".
 * @param url
 * @throws PersistenceException
 */
private void createRoutine(URL url,IPath path,String label,List<String> neededJars) throws PersistenceException {
  if (url == null) {
    throw new IllegalArgumentException();
  }
  InputStream stream=null;
  try {
    Property property=PropertiesFactory.eINSTANCE.createProperty();
    property.setId(getNextId());
    property.setLabel(label);
    ByteArray byteArray=PropertiesFactory.eINSTANCE.createByteArray();
    stream=url.openStream();
    byte[] innerContent=new byte[stream.available()];
    stream.read(innerContent);
    stream.close();
    byteArray.setInnerContent(innerContent);
    RoutineItem routineItem=PropertiesFactory.eINSTANCE.createRoutineItem();
    routineItem.setProperty(property);
    routineItem.setContent(byteArray);
    routineItem.setBuiltIn(true);
    if (neededJars != null) {
      for (      String jar : neededJars) {
        IMPORTType type=ComponentFactory.eINSTANCE.createIMPORTType();
        type.setMESSAGE("String_Node_Str");
        type.setNAME(label);
        type.setREQUIRED(true);
        type.setMODULE(jar);
        routineItem.getImports().add(type);
      }
    }
    if (!routineItem.getProperty().getLabel().equals(coreSerivce.getTemplateString())) {
      create(getRepositoryContext().getProject(),routineItem,path,true);
    }
  }
 catch (  IOException ioe) {
    if (stream != null) {
      try {
        stream.close();
      }
 catch (      IOException e) {
        throw new PersistenceException(ioe);
      }
    }
    throw new PersistenceException(ioe);
  }
}

Fixed version (ground truth):
/** 
 * DOC smallet Comment method "createRoutine".
 * @param url
 * @throws PersistenceException
 */
private void createRoutine(URL url,IPath path,String label,List<LibraryInfo> neededJars) throws PersistenceException {
  if (url == null) {
    throw new IllegalArgumentException();
  }
  InputStream stream=null;
  try {
    Property property=PropertiesFactory.eINSTANCE.createProperty();
    property.setId(getNextId());
    property.setLabel(label);
    ByteArray byteArray=PropertiesFactory.eINSTANCE.createByteArray();
    stream=url.openStream();
    byte[] innerContent=new byte[stream.available()];
    stream.read(innerContent);
    stream.close();
    byteArray.setInnerContent(innerContent);
    RoutineItem routineItem=PropertiesFactory.eINSTANCE.createRoutineItem();
    routineItem.setProperty(property);
    routineItem.setContent(byteArray);
    routineItem.setBuiltIn(true);
    if (neededJars != null) {
      for (      LibraryInfo jar : neededJars) {
        IMPORTType type=ComponentFactory.eINSTANCE.createIMPORTType();
        type.setMESSAGE("String_Node_Str");
        type.setNAME(label);
        type.setREQUIRED(true);
        type.setMODULE(jar.getLibName());
        type.setBundleID(jar.getBundleId());
        routineItem.getImports().add(type);
      }
    }
    if (!routineItem.getProperty().getLabel().equals(coreSerivce.getTemplateString())) {
      create(getRepositoryContext().getProject(),routineItem,path,true);
    }
  }
 catch (  IOException ioe) {
    if (stream != null) {
      try {
        stream.close();
      }
 catch (      IOException e) {
        throw new PersistenceException(ioe);
      }
    }
    throw new PersistenceException(ioe);
  }
}