Program: 122315
Project: 122315
Buggy source:
/** 
 * DOC xtan Comment method "createRoutine".
 * @param path
 */
private RoutineItem createRoutine(IPath path,String label,File initFile,String name){
  Property property=PropertiesFactory.eINSTANCE.createProperty();
  property.setAuthor(((RepositoryContext)CorePlugin.getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY)).getUser());
  property.setVersion(VersionUtils.DEFAULT_VERSION);
  property.setStatusCode("String_Node_Str");
  property.setLabel(label);
  RoutineItem routineItem=PropertiesFactory.eINSTANCE.createRoutineItem();
  routineItem.setProperty(property);
  ByteArray byteArray=PropertiesFactory.eINSTANCE.createByteArray();
  InputStream stream=null;
  try {
    stream=initFile.toURL().openStream();
    byte[] innerContent=new byte[stream.available()];
    stream.read(innerContent);
    byteArray.setInnerContent(innerContent);
  }
 catch (  IOException e) {
    ExceptionHandler.process(e);
  }
 finally {
    if (stream != null) {
      try {
        stream.close();
      }
 catch (      IOException e) {
      }
    }
  }
  String routineContent=new String(byteArray.getInnerContent());
  routineContent=chanageRoutinesPackage(routineContent,name);
  byteArray.setInnerContent(routineContent.getBytes());
  routineItem.setContent(byteArray);
  IProxyRepositoryFactory repositoryFactory=ProxyRepositoryFactory.getInstance();
  try {
    property.setId(repositoryFactory.getNextId());
    repositoryFactory.createParentFoldersRecursively(ERepositoryObjectType.getItemType(routineItem),path);
    repositoryFactory.create(routineItem,path);
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
  if (routineItem.eResource() != null)   addWsdlNeedLib(routineItem);
  return routineItem;
}

Fixed version (ground truth):
/** 
 * DOC xtan Comment method "createRoutine".
 * @param path
 */
private RoutineItem createRoutine(final IPath path,String label,File initFile,String name){
  Property property=PropertiesFactory.eINSTANCE.createProperty();
  property.setAuthor(((RepositoryContext)CorePlugin.getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY)).getUser());
  property.setVersion(VersionUtils.DEFAULT_VERSION);
  property.setStatusCode("String_Node_Str");
  property.setLabel(label);
  final RoutineItem routineItem=PropertiesFactory.eINSTANCE.createRoutineItem();
  routineItem.setProperty(property);
  ByteArray byteArray=PropertiesFactory.eINSTANCE.createByteArray();
  InputStream stream=null;
  try {
    stream=initFile.toURL().openStream();
    byte[] innerContent=new byte[stream.available()];
    stream.read(innerContent);
    byteArray.setInnerContent(innerContent);
  }
 catch (  IOException e) {
    ExceptionHandler.process(e);
  }
 finally {
    if (stream != null) {
      try {
        stream.close();
      }
 catch (      IOException e) {
      }
    }
  }
  String routineContent=new String(byteArray.getInnerContent());
  routineContent=chanageRoutinesPackage(routineContent,name);
  byteArray.setInnerContent(routineContent.getBytes());
  routineItem.setContent(byteArray);
  final IProxyRepositoryFactory repositoryFactory=ProxyRepositoryFactory.getInstance();
  try {
    property.setId(repositoryFactory.getNextId());
    repositoryFactory.createParentFoldersRecursively(ERepositoryObjectType.getItemType(routineItem),path);
    Display.getDefault().syncExec(new Runnable(){
      @Override public void run(){
        try {
          repositoryFactory.create(routineItem,path);
        }
 catch (        PersistenceException e) {
          ExceptionHandler.process(e);
        }
      }
    }
);
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
  if (routineItem.eResource() != null)   addWsdlNeedLib(routineItem);
  return routineItem;
}