nus-yam/ex-repair huggingface dataset:
Program: 160478
Project: 160478
Buggy source:
private boolean processLine(String line) throws DeserializeException, MetaDataException {
switch (mode) {
case HEADER:
    if (line.length() > 0) {
      if (line.endsWith("String_Node_Str")) {
        processHeader(line);
      }
 else {
        return false;
      }
    }
  if (line.equals("String_Node_Str")) {
    mode=Mode.DATA;
  }
break;
case DATA:
if (line.equals("String_Node_Str")) {
mode=Mode.FOOTER;
}
 else {
if (line.length() > 0 && line.charAt(0) == '#') {
  while (line.endsWith("String_Node_Str")) {
    line=line.substring(0,line.lastIndexOf("String_Node_Str")).trim();
  }
  if (line.endsWith("String_Node_Str")) {
    processRecord(line);
  }
 else {
    return false;
  }
}
}
break;
case FOOTER:
if (line.equals("String_Node_Str")) {
mode=Mode.DONE;
}
break;
case DONE:
}
return true;
}

Fixed version (ground truth):
private boolean processLine(String line) throws DeserializeException, MetaDataException {
switch (mode) {
case HEADER:
    if (line.length() > 0) {
      if (line.endsWith("String_Node_Str")) {
        processHeader(line);
      }
 else {
        return false;
      }
    }
  if (line.equals("String_Node_Str")) {
    mode=Mode.DATA;
  }
break;
case DATA:
if (line.equals("String_Node_Str")) {
mode=Mode.FOOTER;
}
 else {
if (line.length() > 0 && line.charAt(0) == '#') {
  while (line.endsWith("String_Node_Str")) {
    line=line.substring(0,line.lastIndexOf("String_Node_Str")).trim();
  }
  if (line.endsWith("String_Node_Str")) {
    processRecord(line);
  }
 else {
    return false;
  }
}
}
break;
case FOOTER:
for (IdEObject idEObject : getModel().getValues()) {
if (idEObject.getOid() != -1) {
System.out.println(idEObject);
}
}
if (line.equals("String_Node_Str")) {
mode=Mode.DONE;
}
break;
case DONE:
}
return true;
}
Program: 160481
Project: 160481
Buggy source:
public static void main(String[] args){
  generateIfc4();
}

Fixed version (ground truth):
public static void main(String[] args){
  generateIfc2x3tc1();
  generateIfc4();
}
Program: 160482
Project: 160482
Buggy source:
public <T extends IdEObject>Map<Long,T> query(IfcModelInterface model,Condition condition,Class<T> clazz,QueryInterface query) throws BimserverDatabaseException {
  Map<Long,T> map=new HashMap<Long,T>();
  Set<EClass> eClasses=new HashSet<EClass>();
  condition.getEClassRequirements(eClasses);
  TodoList todoList=new TodoList();
  for (  EClass eClass : eClasses) {
    getMap(eClass,model,query,todoList);
    for (    Long oid : model.keySet()) {
      IdEObject object=model.get(oid);
      if (clazz.isInstance(object)) {
        if (condition.matches(object)) {
          map.put(oid,clazz.cast(object));
        }
      }
    }
  }
  processTodoList(model,todoList,query);
  return map;
}

Fixed version (ground truth):
public <T extends IdEObject>Map<Long,T> query(IfcModelInterface model,Condition condition,Class<T> clazz,QueryInterface query) throws BimserverDatabaseException {
  Map<Long,T> map=new HashMap<Long,T>();
  Set<EClass> eClasses=new HashSet<EClass>();
  condition.getEClassRequirements(eClasses);
  for (  EClass eClass : eClasses) {
    TodoList todoList=new TodoList();
    getMap(eClass,model,query,todoList);
    processTodoList(model,todoList,query);
    List<IdEObject> list=new ArrayList<IdEObject>(model.getValues());
    for (    IdEObject object : list) {
      if (clazz.isInstance(object)) {
        if (condition.matches(object)) {
          map.put(object.getOid(),clazz.cast(object));
        }
      }
    }
  }
  return map;
}
Program: 160483
Project: 160483
Buggy source:
private int getPrimitiveSize(EDataType eDataType,Object val){
  if (eDataType == ECORE_PACKAGE.getEInt() || eDataType == ECORE_PACKAGE.getEIntegerObject()) {
    return 4;
  }
 else   if (eDataType == ECORE_PACKAGE.getEFloat() || eDataType == ECORE_PACKAGE.getEFloatObject()) {
    return 4;
  }
 else   if (eDataType == ECORE_PACKAGE.getEBoolean() || eDataType == ECORE_PACKAGE.getEBooleanObject()) {
    return 1;
  }
 else   if (eDataType == ECORE_PACKAGE.getEDate()) {
    return 8;
  }
 else   if (eDataType == ECORE_PACKAGE.getELong() || eDataType == ECORE_PACKAGE.getELongObject()) {
    return 8;
  }
 else   if (eDataType == ECORE_PACKAGE.getEDouble() || eDataType == ECORE_PACKAGE.getEDoubleObject()) {
    return 8;
  }
 else   if (eDataType == ECORE_PACKAGE.getEString()) {
    if (val != null) {
      return 4 + ((String)val).getBytes(Charsets.UTF_8).length;
    }
    return 4;
  }
 else   if (eDataType == ECORE_PACKAGE.getEByteArray()) {
    if (val != null) {
      return 4 + ((byte[])val).length;
    }
    return 4;
  }
 else   if (eDataType instanceof EEnum) {
    return 4;
  }
  throw new RuntimeException("String_Node_Str" + eDataType);
}

Fixed version (ground truth):
private int getPrimitiveSize(EDataType eDataType,Object val){
  if (eDataType == EcorePackage.eINSTANCE.getEInt() || eDataType == EcorePackage.eINSTANCE.getEIntegerObject()) {
    return 4;
  }
 else   if (eDataType == EcorePackage.eINSTANCE.getEFloat() || eDataType == EcorePackage.eINSTANCE.getEFloatObject()) {
    return 4;
  }
 else   if (eDataType == EcorePackage.eINSTANCE.getEBoolean() || eDataType == EcorePackage.eINSTANCE.getEBooleanObject()) {
    return 1;
  }
 else   if (eDataType == EcorePackage.eINSTANCE.getEDate()) {
    return 8;
  }
 else   if (eDataType == EcorePackage.eINSTANCE.getELong() || eDataType == EcorePackage.eINSTANCE.getELongObject()) {
    return 8;
  }
 else   if (eDataType == EcorePackage.eINSTANCE.getEDouble() || eDataType == EcorePackage.eINSTANCE.getEDoubleObject()) {
    return 8;
  }
 else   if (eDataType == EcorePackage.eINSTANCE.getEString()) {
    if (val != null) {
      return 4 + ((String)val).getBytes(Charsets.UTF_8).length;
    }
    return 4;
  }
 else   if (eDataType == EcorePackage.eINSTANCE.getEByteArray()) {
    if (val != null) {
      return 4 + ((byte[])val).length;
    }
    return 4;
  }
 else   if (eDataType instanceof EEnum) {
    return 4;
  }
  throw new RuntimeException("String_Node_Str" + eDataType);
}
Program: 160489
Project: 160489
Buggy source:
public SRemoteServiceCalled convertToSObject(RemoteServiceCalled input){
  if (input == null) {
    return null;
  }
  SRemoteServiceCalled result=new SRemoteServiceCalled();
  result.setOid(input.getOid());
  result.setRid(input.getRid());
  result.setDate(input.getDate());
  result.setAccessMethod(SAccessMethod.values()[input.getAccessMethod().ordinal()]);
  result.setState(SNotifictionResultEnum.values()[input.getState().ordinal()]);
  result.setPercentage(input.getPercentage());
  result.getInfos().addAll(input.getInfos());
  result.getWarnings().addAll(input.getWarnings());
  result.getErrors().addAll(input.getErrors());
  User executorVal=input.getExecutor();
  result.setExecutorId(executorVal == null ? -1 : executorVal.getOid());
  Service serviceVal=input.getService();
  result.setServiceId(serviceVal == null ? -1 : serviceVal.getOid());
  return result;
}

Fixed version (ground truth):
public SMessagingSerializerPluginConfiguration convertToSObject(MessagingSerializerPluginConfiguration input){
  if (input == null) {
    return null;
  }
  SMessagingSerializerPluginConfiguration result=new SMessagingSerializerPluginConfiguration();
  result.setOid(input.getOid());
  result.setRid(input.getRid());
  result.setName(input.getName());
  result.setEnabled(input.getEnabled());
  result.setDescription(input.getDescription());
  PluginDescriptor pluginDescriptorVal=input.getPluginDescriptor();
  result.setPluginDescriptorId(pluginDescriptorVal == null ? -1 : pluginDescriptorVal.getOid());
  ObjectType settingsVal=input.getSettings();
  result.setSettingsId(settingsVal == null ? -1 : settingsVal.getOid());
  UserSettings userSettingsVal=input.getUserSettings();
  result.setUserSettingsId(userSettingsVal == null ? -1 : userSettingsVal.getOid());
  return result;
}
Program: 160490
Project: 160490
Buggy source:
public RemoteServiceCalled convertFromSObject(SRemoteServiceCalled input,RemoteServiceCalled result,DatabaseSession session) throws BimserverDatabaseException {
  if (input == null) {
    return null;
  }
  result.setDate(input.getDate());
  result.setAccessMethod(AccessMethod.values()[input.getAccessMethod().ordinal()]);
  result.setState(NotifictionResultEnum.values()[input.getState().ordinal()]);
  result.setPercentage(input.getPercentage());
  result.getInfos().addAll(input.getInfos());
  result.getWarnings().addAll(input.getWarnings());
  result.getErrors().addAll(input.getErrors());
  result.setExecutor((User)session.get(StorePackage.eINSTANCE.getUser(),input.getExecutorId(),Query.getDefault()));
  result.setService((Service)session.get(StorePackage.eINSTANCE.getService(),input.getServiceId(),Query.getDefault()));
  return result;
}

Fixed version (ground truth):
public MessagingSerializerPluginConfiguration convertFromSObject(SMessagingSerializerPluginConfiguration input,MessagingSerializerPluginConfiguration result,DatabaseSession session) throws BimserverDatabaseException {
  if (input == null) {
    return null;
  }
  result.setName(input.getName());
  result.setEnabled(input.getEnabled());
  result.setDescription(input.getDescription());
  result.setPluginDescriptor((PluginDescriptor)session.get(StorePackage.eINSTANCE.getPluginDescriptor(),input.getPluginDescriptorId(),Query.getDefault()));
  result.setSettings((ObjectType)session.get(StorePackage.eINSTANCE.getObjectType(),input.getSettingsId(),Query.getDefault()));
  result.setUserSettings((UserSettings)session.get(StorePackage.eINSTANCE.getUserSettings(),input.getUserSettingsId(),Query.getDefault()));
  return result;
}
Program: 160491
Project: 160491
Buggy source:
public static void main(String[] args){
  generateIfc2x3tc1();
  generateIfc4();
}

Fixed version (ground truth):
public static void main(String[] args){
  generateIfc4();
}
Program: 160493
Project: 160493
Buggy source:
@Override public void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  if (request.getHeader("String_Node_Str") != null && (getBimServer().getServerInfo().getServerState() != ServerState.MIGRATION_REQUIRED && !getBimServer().getServerSettingsCache().isHostAllowed(request.getHeader("String_Node_Str")))) {
    response.setStatus(403);
    return;
  }
  response.setHeader("String_Node_Str",request.getHeader("String_Node_Str"));
  response.setHeader("String_Node_Str","String_Node_Str");
  if ("String_Node_Str".equalsIgnoreCase(request.getMethod())) {
    return;
  }
  response.setCharacterEncoding("String_Node_Str");
  try {
    ServletInputStream inputStream=request.getInputStream();
    byte[] bytes=IOUtils.toByteArray(inputStream);
    JsonReader jsonReader=new JsonReader(new InputStreamReader(new ByteArrayInputStream(bytes)));
    JsonParser parser=new JsonParser();
    JsonElement parse=parser.parse(jsonReader);
    if (parse instanceof JsonObject) {
      JsonObject jsonRequest=(JsonObject)parse;
      response.setHeader("String_Node_Str","String_Node_Str");
      getBimServer().getJsonHandler().execute(jsonRequest,request,response.getWriter());
    }
 else {
      LOGGER.error("String_Node_Str" + new String(bytes,Charsets.UTF_8));
      response.setStatus(500);
    }
  }
 catch (  IOException e) {
    LOGGER.error("String_Node_Str",e);
    response.setStatus(500);
  }
}

Fixed version (ground truth):
@Override public void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  if (request.getHeader("String_Node_Str") != null && (getBimServer().getServerInfo().getServerState() != ServerState.MIGRATION_REQUIRED && !getBimServer().getServerSettingsCache().isHostAllowed(request.getHeader("String_Node_Str")))) {
    response.setStatus(403);
    return;
  }
  response.setHeader("String_Node_Str",request.getHeader("String_Node_Str"));
  response.setHeader("String_Node_Str","String_Node_Str");
  if ("String_Node_Str".equalsIgnoreCase(request.getMethod())) {
    return;
  }
  response.setCharacterEncoding("String_Node_Str");
  try {
    ServletInputStream inputStream=request.getInputStream();
    byte[] bytes=IOUtils.toByteArray(inputStream);
    JsonReader jsonReader=new JsonReader(new InputStreamReader(new ByteArrayInputStream(bytes),Charsets.UTF_8));
    JsonParser parser=new JsonParser();
    JsonElement parse=parser.parse(jsonReader);
    if (parse instanceof JsonObject) {
      JsonObject jsonRequest=(JsonObject)parse;
      response.setHeader("String_Node_Str","String_Node_Str");
      getBimServer().getJsonHandler().execute(jsonRequest,request,response.getWriter());
    }
 else {
      LOGGER.error("String_Node_Str" + new String(bytes,Charsets.UTF_8));
      response.setStatus(500);
    }
  }
 catch (  IOException e) {
    LOGGER.error("String_Node_Str",e);
    response.setStatus(500);
  }
}
Program: 160494
Project: 160494
Buggy source:
private void setContentType(HttpServletResponse response,String requestUri){
  if (requestUri.endsWith("String_Node_Str")) {
    response.setContentType("String_Node_Str");
  }
 else   if (requestUri.endsWith("String_Node_Str")) {
    response.setContentType("String_Node_Str");
  }
 else   if (requestUri.endsWith("String_Node_Str")) {
    response.setContentType("String_Node_Str");
  }
 else   if (requestUri.endsWith("String_Node_Str")) {
    response.setContentType("String_Node_Str");
  }
}

Fixed version (ground truth):
private void setContentType(HttpServletResponse response,String requestUri){
  if (requestUri.endsWith("String_Node_Str")) {
    response.setContentType("String_Node_Str");
  }
 else   if (requestUri.endsWith("String_Node_Str")) {
    response.setContentType("String_Node_Str");
  }
 else   if (requestUri.endsWith("String_Node_Str")) {
    response.setContentType("String_Node_Str");
  }
 else   if (requestUri.endsWith("String_Node_Str")) {
    response.setContentType("String_Node_Str");
  }
 else {
    response.setContentType("String_Node_Str");
  }
}
Program: 160496
Project: 160496
Buggy source:
public SRemoteServiceCalled convertToSObject(RemoteServiceCalled input){
  if (input == null) {
    return null;
  }
  SRemoteServiceCalled result=new SRemoteServiceCalled();
  result.setOid(input.getOid());
  result.setRid(input.getRid());
  result.setDate(input.getDate());
  result.setAccessMethod(SAccessMethod.values()[input.getAccessMethod().ordinal()]);
  result.setState(SNotifictionResultEnum.values()[input.getState().ordinal()]);
  result.setPercentage(input.getPercentage());
  result.getInfos().addAll(input.getInfos());
  result.getWarnings().addAll(input.getWarnings());
  result.getErrors().addAll(input.getErrors());
  User executorVal=input.getExecutor();
  result.setExecutorId(executorVal == null ? -1 : executorVal.getOid());
  Service serviceVal=input.getService();
  result.setServiceId(serviceVal == null ? -1 : serviceVal.getOid());
  return result;
}

Fixed version (ground truth):
public SSmtpProtocol convertToSObject(SmtpProtocol input){
  return SSmtpProtocol.values()[input.ordinal()];
}
Program: 160497
Project: 160497
Buggy source:
public RemoteServiceCalled convertFromSObject(SRemoteServiceCalled input,RemoteServiceCalled result,DatabaseSession session) throws BimserverDatabaseException {
  if (input == null) {
    return null;
  }
  result.setDate(input.getDate());
  result.setAccessMethod(AccessMethod.values()[input.getAccessMethod().ordinal()]);
  result.setState(NotifictionResultEnum.values()[input.getState().ordinal()]);
  result.setPercentage(input.getPercentage());
  result.getInfos().addAll(input.getInfos());
  result.getWarnings().addAll(input.getWarnings());
  result.getErrors().addAll(input.getErrors());
  result.setExecutor((User)session.get(StorePackage.eINSTANCE.getUser(),input.getExecutorId(),Query.getDefault()));
  result.setService((Service)session.get(StorePackage.eINSTANCE.getService(),input.getServiceId(),Query.getDefault()));
  return result;
}

Fixed version (ground truth):
public SmtpProtocol convertFromSObject(SSmtpProtocol input){
  return SmtpProtocol.values()[input.ordinal()];
}
Program: 160499
Project: 160499
Buggy source:
public SummaryMap(){
}

Fixed version (ground truth):
public SummaryMap(PackageMetaData packageMetaData,RevisionSummary revisionSummary){
  this.packageMetaData=packageMetaData;
  for (  RevisionSummaryContainer revisionSummaryContainer : revisionSummary.getList()) {
    for (    RevisionSummaryType revisionSummaryType : revisionSummaryContainer.getTypes()) {
      summaryMap.put((EClass)packageMetaData.getEPackage().getEClassifier(revisionSummaryType.getName()),revisionSummaryType.getCount());
    }
  }
}
Program: 160501
Project: 160501
Buggy source:
@Override public void execute(IfcModelInterface model,Project project,ConcreteRevision concreteRevision,DatabaseSession databaseSession,Map<Long,IdEObject> created,Map<Long,IdEObject> deleted) throws UserException, BimserverLockConflictException, BimserverDatabaseException {
  EClass eClass=databaseSession.getEClassForName(type);
  if (eClass == null) {
    throw new UserException("String_Node_Str" + type + "String_Node_Str");
  }
  eObject=(IdEObjectImpl)eClass.getEPackage().getEFactoryInstance().create(eClass);
  eObject.setOid(oid);
  eObject.setPid(project.getId());
  eObject.setRid(concreteRevision.getId());
  eObject.setLoaded();
  databaseSession.store(eObject,project.getId(),concreteRevision.getId());
  created.put(oid,eObject);
}

Fixed version (ground truth):
@Override public void execute(IfcModelInterface model,Project project,ConcreteRevision concreteRevision,DatabaseSession databaseSession,Map<Long,IdEObject> created,Map<Long,IdEObject> deleted) throws UserException, BimserverLockConflictException, BimserverDatabaseException {
  EClass eClass=databaseSession.getEClass(project.getSchema(),type);
  if (eClass == null) {
    throw new UserException("String_Node_Str" + type + "String_Node_Str");
  }
  eObject=(IdEObjectImpl)eClass.getEPackage().getEFactoryInstance().create(eClass);
  eObject.setOid(oid);
  eObject.setPid(project.getId());
  eObject.setRid(concreteRevision.getId());
  eObject.setLoaded();
  databaseSession.store(eObject,project.getId(),concreteRevision.getId());
  created.put(oid,eObject);
}
Program: 160502
Project: 160502
Buggy source:
public EClass getEClassForName(String className){
  for (  EPackage ePackage : emfPackages.values()) {
    if (ePackage.getEClassifier(className) != null) {
      return (EClass)ePackage.getEClassifier(className);
    }
  }
  return null;
}

Fixed version (ground truth):
public EClass getEClassForName(String packageName,String className){
  EPackage ePackage=emfPackages.get(packageName);
  if (ePackage.getEClassifier(className) != null) {
    return (EClass)ePackage.getEClassifier(className);
  }
  return null;
}
Program: 160503
Project: 160503
Buggy source:
public EClass getEClassForName(String className){
  return database.getEClassForName(className);
}

Fixed version (ground truth):
public EClass getEClassForName(String packageName,String className){
  return database.getEClassForName(packageName,className);
}
Program: 160504
Project: 160504
Buggy source:
protected void checkGeometry(SerializerPluginConfiguration serializerPluginConfiguration,PluginManager pluginManager,IfcModelInterface model,Project project,ConcreteRevision concreteRevision,Revision revision) throws BimserverDatabaseException, GeometryGeneratingException {
  SerializerPlugin serializerPlugin=(SerializerPlugin)pluginManager.getPlugin(serializerPluginConfiguration.getPluginDescriptor().getPluginClassName(),true);
  if (serializerPlugin.needsGeometry()) {
    if (!revision.isHasGeometry()) {
      setProgress("String_Node_Str",-1);
      new GeometryGenerator(bimServer).generateGeometry(authorization.getUoid(),pluginManager,getDatabaseSession(),model,project.getId(),concreteRevision.getId(),false,null);
    }
 else {
      List<IfcProduct> allWithSubTypes=model.getAllWithSubTypes(IfcProduct.class);
      int lastSize=-1;
      while (lastSize != allWithSubTypes.size()) {
        lastSize=allWithSubTypes.size();
        for (        IfcProduct ifcProduct : new ArrayList<>(allWithSubTypes)) {
          GeometryInfo geometryInfo=ifcProduct.getGeometry();
          if (geometryInfo != null) {
            geometryInfo.load();
            geometryInfo.getData().load();
            geometryInfo.getTransformation();
            geometryInfo.getMinBounds().load();
            geometryInfo.getMaxBounds().load();
          }
        }
        allWithSubTypes=model.getAllWithSubTypes(IfcProduct.class);
      }
    }
  }
}

Fixed version (ground truth):
protected void checkGeometry(SerializerPluginConfiguration serializerPluginConfiguration,PluginManager pluginManager,IfcModelInterface model,Project project,ConcreteRevision concreteRevision,Revision revision) throws BimserverDatabaseException, GeometryGeneratingException {
  SerializerPlugin serializerPlugin=(SerializerPlugin)pluginManager.getPlugin(serializerPluginConfiguration.getPluginDescriptor().getPluginClassName(),true);
  if (serializerPlugin.needsGeometry()) {
    if (!revision.isHasGeometry()) {
      setProgress("String_Node_Str",-1);
      new GeometryGenerator(bimServer).generateGeometry(authorization.getUoid(),pluginManager,getDatabaseSession(),model,project.getId(),concreteRevision.getId(),false,null);
    }
 else {
      EClass productClass=model.getPackageMetaData().getEClass("String_Node_Str");
      List<IdEObject> allWithSubTypes=new ArrayList<>(model.getAllWithSubTypes(productClass));
      for (      IdEObject ifcProduct : allWithSubTypes) {
        ifcProduct.load();
        GeometryInfo geometryInfo=(GeometryInfo)ifcProduct.eGet(productClass.getEStructuralFeature("String_Node_Str"));
        if (geometryInfo != null) {
          geometryInfo.load();
          geometryInfo.getData().load();
          geometryInfo.getTransformation();
          geometryInfo.getMinBounds().load();
          geometryInfo.getMaxBounds().load();
        }
      }
    }
  }
}
Program: 160507
Project: 160507
Buggy source:
@Override public void run(){
  try {
    final ProgressTopic progressTopic=bimServer.getNotificationsManager().getProgressTopic(topicId);
    LongDownloadOrCheckoutAction longAction=(LongDownloadOrCheckoutAction)bimServer.getLongActionManager().getLongAction(downloadId);
    MessagingSerializer messagingSerializer=longAction.getMessagingSerializer();
    long s=System.nanoTime();
    int messages=0;
    boolean writeMessage=true;
    do {
      ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream();
      DataOutputStream dataOutputStream=new DataOutputStream(byteArrayOutputStream);
      dataOutputStream.writeInt(topicId);
      writeMessage=messagingSerializer.writeMessage(byteArrayOutputStream,null);
      if (byteArrayOutputStream.size() > 4) {
        messages++;
        streamingSocketInterface.send(byteArrayOutputStream.toByteArray(),0,byteArrayOutputStream.size());
      }
    }
 while (writeMessage);
    long e=System.nanoTime();
    System.out.println(((e - s) / 1000000) + "String_Node_Str" + messages);
  }
 catch (  IOException e) {
    LOGGER.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    final ProgressTopic progressTopic=bimServer.getNotificationsManager().getProgressTopic(topicId);
    LongDownloadOrCheckoutAction longAction=(LongDownloadOrCheckoutAction)bimServer.getLongActionManager().getLongAction(downloadId);
    MessagingSerializer messagingSerializer=longAction.getMessagingSerializer();
    boolean writeMessage=true;
    do {
      ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream();
      DataOutputStream dataOutputStream=new DataOutputStream(byteArrayOutputStream);
      dataOutputStream.writeInt(topicId);
      dataOutputStream.writeInt(0);
      writeMessage=messagingSerializer.writeMessage(byteArrayOutputStream,null);
      int messages=1;
      while (byteArrayOutputStream.size() < BUFFER_SIZE && writeMessage) {
        messages++;
        writeMessage=messagingSerializer.writeMessage(byteArrayOutputStream,null);
      }
      byte[] byteArray=byteArrayOutputStream.toByteArray();
      ByteBuffer byteBuffer=ByteBuffer.wrap(byteArray);
      byteBuffer.order(ByteOrder.LITTLE_ENDIAN);
      byteBuffer.putInt(4,messages);
      if (byteArrayOutputStream.size() > 8) {
        streamingSocketInterface.sendBlocking(byteArray,0,byteArray.length);
      }
    }
 while (writeMessage);
  }
 catch (  IOException e) {
    LOGGER.error("String_Node_Str",e);
  }
}
Program: 160508
Project: 160508
Buggy source:
@Override public void send(byte[] data,int start,int length){
  try {
    outbound.writeBinaryMessage(ByteBuffer.wrap(data,start,length));
    outbound.flush();
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
@Override public void send(byte[] data,int start,int length){
  try {
    outbound.writeBinaryMessage(ByteBuffer.wrap(data,start,length));
  }
 catch (  IOException e) {
  }
}
Program: 160509
Project: 160509
Buggy source:
@Override public void send(byte[] data,int start,int length){
  try {
    websocketSession.getAsyncRemote().sendBinary(ByteBuffer.wrap(data,start,length));
    websocketSession.getAsyncRemote().flushBatch();
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
@Override public void send(byte[] data,int start,int length){
  websocketSession.getAsyncRemote().sendBinary(ByteBuffer.wrap(data,start,length));
}
Program: 160523
Project: 160523
Buggy source:
private void writeEmbedded(EObject eObject) throws SerializerException, IOException {
  EClass class1=eObject.eClass();
  print(upperCases.get(class1));
  print(OPEN_PAREN);
  EStructuralFeature structuralFeature=class1.getEStructuralFeature(WRAPPED_VALUE);
  if (structuralFeature != null) {
    Object realVal=eObject.eGet(structuralFeature);
    if (structuralFeature.getEType() == ECORE_PACKAGE_INSTANCE.getEDouble()) {
      Object stringVal=eObject.eGet(class1.getEStructuralFeature(structuralFeature.getName() + "String_Node_Str"));
      if (stringVal != null && model.isUseDoubleStrings()) {
        print((String)stringVal);
      }
 else {
        if (((Double)realVal).isInfinite() || (((Double)realVal).isNaN())) {
          LOGGER.info("String_Node_Str");
          print("String_Node_Str");
        }
 else {
          print((String)realVal);
        }
      }
    }
 else {
      writePrimitive(realVal);
    }
  }
  print(CLOSE_PAREN);
}

Fixed version (ground truth):
private void writeEmbedded(EObject eObject) throws SerializerException, IOException {
  EClass class1=eObject.eClass();
  print(upperCases.get(class1));
  print(OPEN_PAREN);
  EStructuralFeature structuralFeature=class1.getEStructuralFeature(WRAPPED_VALUE);
  if (structuralFeature != null) {
    Object realVal=eObject.eGet(structuralFeature);
    if (structuralFeature.getEType() == ECORE_PACKAGE_INSTANCE.getEDouble()) {
      Object stringVal=eObject.eGet(class1.getEStructuralFeature(structuralFeature.getName() + "String_Node_Str"));
      if (stringVal != null && model.isUseDoubleStrings()) {
        print((String)stringVal);
      }
 else {
        if (((Double)realVal).isInfinite() || (((Double)realVal).isNaN())) {
          LOGGER.info("String_Node_Str");
          print("String_Node_Str");
        }
 else {
          print(((Double)realVal).toString());
        }
      }
    }
 else {
      writePrimitive(realVal);
    }
  }
  print(CLOSE_PAREN);
}
Program: 160524
Project: 160524
Buggy source:
public static void main(String[] args) throws ParseException {
  try {
    readFileName("String_Node_Str");
    readFileName("String_Node_Str");
    readFileName("String_Node_Str");
    readFileName("String_Node_Str");
    readDescription("String_Node_Str");
    readDescription("String_Node_Str");
    readDescription("String_Node_Str");
    readDescription("String_Node_Str");
    readFileName("String_Node_Str");
    readFileName("String_Node_Str");
    readFileName("String_Node_Str");
    readFileName("String_Node_Str");
    readDescription("String_Node_Str");
    readFileName("String_Node_Str");
  }
 catch (  TokenizeException e) {
    e.printStackTrace();
  }
  try {
    readFileName("String_Node_Str");
  }
 catch (  TokenizeException e) {
  }
}

Fixed version (ground truth):
public static void main(String[] args) throws ParseException {
  try {
    readFileName("String_Node_Str");
    readFileName("String_Node_Str");
    readFileName("String_Node_Str");
    readFileName("String_Node_Str");
    readDescription("String_Node_Str");
    readDescription("String_Node_Str");
    readDescription("String_Node_Str");
    readDescription("String_Node_Str");
    readFileName("String_Node_Str");
    readFileName("String_Node_Str");
    readFileName("String_Node_Str");
    readFileName("String_Node_Str");
    readDescription("String_Node_Str");
    readFileName("String_Node_Str");
    readFileName("String_Node_Str");
  }
 catch (  TokenizeException e) {
    e.printStackTrace();
  }
  try {
    readFileName("String_Node_Str");
  }
 catch (  TokenizeException e) {
  }
}
Program: 160525
Project: 160525
Buggy source:
public Tokenizer zoomIn(String startChar,String endChar) throws TokenizeException {
  String trimmed=toString().trim();
  if (!trimmed.startsWith(startChar)) {
    throw new TokenizeException("String_Node_Str" + startChar + "String_Node_Str"+ input.substring(leftPositionInclude,rightPositionInclude));
  }
  int leftIndex=input.indexOf(startChar,leftPositionInclude);
  int rightIndex=-1;
  int depth=0;
  for (int i=leftIndex + 1; i <= rightPositionInclude; i++) {
    String c=input.substring(i,i + endChar.length());
    if (c.equals(endChar)) {
      if (depth == 0) {
        rightIndex=i;
        break;
      }
 else {
        depth--;
      }
    }
 else     if (c.equals(startChar)) {
      depth++;
    }
  }
  if (rightIndex == -1 || rightIndex < leftPositionInclude) {
    throw new TokenizeException("String_Node_Str" + endChar + "String_Node_Str"+ input.substring(leftPositionInclude,rightPositionInclude));
  }
  zoomStack.push(new Pair(endChar,this.rightPositionInclude));
  this.leftPositionInclude=leftIndex + startChar.length();
  this.rightPositionInclude=rightIndex - endChar.length();
  return this;
}

Fixed version (ground truth):
public Tokenizer zoomIn(String startChar,String endChar) throws TokenizeException {
  String trimmed=toString().trim();
  if (!trimmed.startsWith(startChar)) {
    throw new TokenizeException("String_Node_Str" + startChar + "String_Node_Str"+ input.substring(leftPositionInclude,rightPositionInclude));
  }
  String specialChar="String_Node_Str";
  int leftIndex=input.indexOf(startChar,leftPositionInclude);
  int rightIndex=-1;
  int depth=0;
  int altDepth=0;
  for (int i=leftIndex + 1; i <= rightPositionInclude; i++) {
    String c=input.substring(i,i + endChar.length());
    if (c.equals(endChar)) {
      if (depth == 0 && altDepth == 0) {
        rightIndex=i;
        break;
      }
 else {
        if (altDepth == 0) {
          depth--;
        }
      }
    }
 else     if (c.equals(specialChar)) {
      altDepth=1 - altDepth;
    }
 else     if (c.equals(startChar) && altDepth == 0) {
      depth++;
    }
  }
  if (rightIndex == -1 || rightIndex < leftPositionInclude) {
    throw new TokenizeException("String_Node_Str" + endChar + "String_Node_Str"+ input.substring(leftPositionInclude,rightPositionInclude));
  }
  zoomStack.push(new Pair(endChar,this.rightPositionInclude));
  this.leftPositionInclude=leftIndex + startChar.length();
  this.rightPositionInclude=rightIndex - endChar.length();
  return this;
}
Program: 160526
Project: 160526
Buggy source:
public String readSingleQuoted() throws TokenizeException {
  String toString=toString();
  String trimmed=toString.trim();
  if (!trimmed.startsWith("String_Node_Str")) {
    throw new TokenizeException("String_Node_Str" + trimmed);
  }
  int add=toString.indexOf("String_Node_Str");
  int endIndex=trimmed.indexOf("String_Node_Str",1);
  while (trimmed.length() > endIndex + 1 && trimmed.charAt(endIndex + 1) == '\'') {
    endIndex=trimmed.indexOf("String_Node_Str",endIndex + 2);
  }
  if (endIndex == -1) {
    throw new TokenizeException("String_Node_Str" + trimmed);
  }
  this.leftPositionInclude+=endIndex + add + 1;
  return trimmed.substring(1,endIndex);
}

Fixed version (ground truth):
public String readSingleQuoted() throws TokenizeException {
  String toString=toString();
  String trimmed=toString.trim();
  if (!trimmed.startsWith("String_Node_Str")) {
    throw new TokenizeException("String_Node_Str" + trimmed);
  }
  int add=toString.indexOf("String_Node_Str");
  int endIndex=trimmed.indexOf("String_Node_Str",1);
  int lastEndIndex=-2;
  while (trimmed.length() > endIndex + 1 && trimmed.charAt(endIndex + 1) == '\'') {
    endIndex=trimmed.indexOf("String_Node_Str",endIndex + 2);
    if (lastEndIndex != -2 && lastEndIndex == endIndex) {
      throw new TokenizeException("String_Node_Str" + trimmed);
    }
    lastEndIndex=endIndex;
  }
  if (endIndex == -1) {
    throw new TokenizeException("String_Node_Str" + trimmed);
  }
  this.leftPositionInclude+=endIndex + add + 1;
  return trimmed.substring(1,endIndex);
}
Program: 160532
Project: 160532
Buggy source:
@Override public void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  if (request.getHeader("String_Node_Str") != null && (getBimServer().getServerInfo().getServerState() != ServerState.MIGRATION_REQUIRED && !getBimServer().getServerSettingsCache().isHostAllowed(request.getHeader("String_Node_Str")))) {
    response.setStatus(403);
    return;
  }
  response.setHeader("String_Node_Str",request.getHeader("String_Node_Str"));
  response.setHeader("String_Node_Str","String_Node_Str");
  if ("String_Node_Str".equalsIgnoreCase(request.getMethod())) {
    return;
  }
  handleRequest(request,response,getBimServer());
}

Fixed version (ground truth):
@Override public void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  if (request.getHeader("String_Node_Str") != null && (getBimServer().getServerInfo().getServerState() != ServerState.MIGRATION_REQUIRED && !getBimServer().getServerSettingsCache().isHostAllowed(request.getHeader("String_Node_Str")))) {
    response.setStatus(403);
    return;
  }
  response.setHeader("String_Node_Str",request.getHeader("String_Node_Str"));
  response.setHeader("String_Node_Str","String_Node_Str");
  if ("String_Node_Str".equalsIgnoreCase(request.getMethod())) {
    return;
  }
  response.setCharacterEncoding("String_Node_Str");
  try {
    ServletInputStream inputStream=request.getInputStream();
    byte[] bytes=IOUtils.toByteArray(inputStream);
    JsonReader jsonReader=new JsonReader(new InputStreamReader(new ByteArrayInputStream(bytes)));
    JsonParser parser=new JsonParser();
    JsonElement parse=parser.parse(jsonReader);
    if (parse instanceof JsonObject) {
      JsonObject jsonRequest=(JsonObject)parse;
      response.setHeader("String_Node_Str","String_Node_Str");
      getBimServer().getJsonHandler().execute(jsonRequest,request,response.getWriter());
    }
 else {
      LOGGER.error("String_Node_Str" + new String(bytes,Charsets.UTF_8));
      response.setStatus(500);
    }
  }
 catch (  IOException e) {
    LOGGER.error("String_Node_Str",e);
    response.setStatus(500);
  }
}
Program: 160533
Project: 160533
Buggy source:
@Override public int compare(SPluginConfiguration o1,SPluginConfiguration o2){
  return o1.getName().compareTo(o2.getName());
}

Fixed version (ground truth):
@Override public int compare(SPluginConfiguration o1,SPluginConfiguration o2){
  if (o1.getName() == null && o2.getName() != null) {
    return 1;
  }
 else   if (o1.getName() != null && o2.getName() == null) {
    return -1;
  }
 else   if (o1.getName() == null && o2.getName() == null) {
    return 0;
  }
 else {
    return o1.getName().compareTo(o2.getName());
  }
}
Program: 160535
Project: 160535
Buggy source:
public void loadExplicit(long oid){
  try {
    IdEObjectImpl idEObjectImpl=(IdEObjectImpl)super.get(oid);
    if (!idEObjectImpl.isLoadedOrLoading()) {
      LOGGER.info("String_Node_Str" + oid);
      modelState=ModelState.LOADING;
      Long downloadByOids=bimServerClient.getBimsie1ServiceInterface().downloadByOids(Collections.singleton(roid),Collections.singleton(oid),getIfcSerializerOid(),true,false);
      processDownload(downloadByOids);
      modelState=ModelState.NONE;
    }
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void loadExplicit(long oid){
  try {
    IdEObjectImpl idEObjectImpl=(IdEObjectImpl)super.get(oid);
    if (idEObjectImpl != null && !idEObjectImpl.isLoadedOrLoading()) {
      LOGGER.info("String_Node_Str" + oid);
      modelState=ModelState.LOADING;
      Long downloadByOids=bimServerClient.getBimsie1ServiceInterface().downloadByOids(Collections.singleton(roid),Collections.singleton(oid),getIfcSerializerOid(),true,false);
      processDownload(downloadByOids);
      modelState=ModelState.NONE;
    }
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
  }
}
Program: 160536
Project: 160536
Buggy source:
private void start(){
  JsonBimServerClientFactory factory=new JsonBimServerClientFactory("String_Node_Str");
  try {
    BimServerClient client=factory.create(new UsernamePasswordAuthenticationInfo("String_Node_Str","String_Node_Str"));
    long poid=131073;
    long roid=131075;
    ClientIfcModel model=client.getModel(poid,roid,true);
    for (    IfcPropertySingleValue prop : model.getAll(IfcPropertySingleValue.class)) {
      IfcValue value=((IfcPropertySingleValue)prop).getNominalValue();
      if (value instanceof IfcLabel) {
        System.out.println(prop.getOid() + "String_Node_Str" + ((IfcLabel)value).getWrappedValue());
        ((IfcLabel)value).setWrappedValue(((IfcLabel)value).getWrappedValue() + "String_Node_Str");
      }
    }
    model.commit("String_Node_Str");
  }
 catch (  ServiceException|ChannelConnectionException e) {
    e.printStackTrace();
  }
catch (  BimServerClientException e) {
    e.printStackTrace();
  }
catch (  PublicInterfaceNotFoundException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void start(){
  JsonBimServerClientFactory factory=new JsonBimServerClientFactory("String_Node_Str");
  try {
    BimServerClient client=factory.create(new UsernamePasswordAuthenticationInfo("String_Node_Str","String_Node_Str"));
    long poid=2686977;
    long roid=720899;
    ClientIfcModel model=client.getModel(poid,roid,true);
    for (    IfcPropertySingleValue prop : model.getAll(IfcPropertySingleValue.class)) {
      IfcLabel label=model.create(IfcLabel.class);
      label.setWrappedValue("String_Node_Str");
      prop.setNominalValue(label);
    }
    model.commit("String_Node_Str");
  }
 catch (  ServiceException|ChannelConnectionException e) {
    e.printStackTrace();
  }
catch (  BimServerClientException e) {
    e.printStackTrace();
  }
catch (  PublicInterfaceNotFoundException e) {
    e.printStackTrace();
  }
catch (  IfcModelInterfaceException e) {
    e.printStackTrace();
  }
}
Program: 160537
Project: 160537
Buggy source:
@Override public List<SProjectSmall> execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {
  List<SProjectSmall> list=new ArrayList<SProjectSmall>();
  User user=getUserByUoid(authorization.getUoid());
  IfcModelInterface model=getDatabaseSession().getAllOfType(StorePackage.eINSTANCE.getProject(),Query.getDefault());
  List<Project> projects=model.getAll(Project.class);
  for (  Project project : projects) {
    if (project.getParent() == null) {
      Project rootProject=getRootProject(project);
      addProjects(list,rootProject,user);
    }
  }
  return list;
}

Fixed version (ground truth):
@Override public List<SProjectSmall> execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {
  List<SProjectSmall> list=new ArrayList<SProjectSmall>();
  User user=getUserByUoid(authorization.getUoid());
  IfcModelInterface model=getDatabaseSession().getAllOfType(StorePackage.eINSTANCE.getProject(),Query.getDefault());
  List<Project> projects=model.getAll(Project.class);
  for (  Project project : projects) {
    if (project.getParent() == null && !project.getName().equals(Database.STORE_PROJECT_NAME)) {
      Project rootProject=getRootProject(project);
      addProjects(list,rootProject,user);
    }
  }
  return list;
}
Program: 160538
Project: 160538
Buggy source:
private void loadDeep() throws ServerException, UserException, BimServerClientException, PublicInterfaceNotFoundException {
  if (modelState != ModelState.FULLY_LOADED) {
    modelState=ModelState.LOADING;
    Long download=bimServerClient.getBimsie1ServiceInterface().download(roid,getIfcSerializerOid(),true,true);
    processDownload(download);
    modelState=ModelState.FULLY_LOADED;
  }
}

Fixed version (ground truth):
private void loadDeep() throws ServerException, UserException, BimServerClientException, PublicInterfaceNotFoundException {
  if (modelState != ModelState.FULLY_LOADED) {
    modelState=ModelState.LOADING;
    Long download=bimServerClient.getBimsie1ServiceInterface().download(roid,getIfcSerializerOid(),true,true);
    try {
      processDownload(download);
      modelState=ModelState.FULLY_LOADED;
    }
 catch (    IfcModelInterfaceException|IOException e) {
      LOGGER.error("String_Node_Str",e);
    }
  }
}
Program: 160541
Project: 160541
Buggy source:
public void dumpIfNotEmpty() throws BimServerClientException {
  if (size() > 0) {
    for (    Entry<T,List<WaitingObject>> entry : waitingObjects.entrySet()) {
      StringBuilder sb=new StringBuilder("String_Node_Str" + entry.getKey());
      for (      WaitingObject waitingObject : entry.getValue()) {
        sb.append(waitingObject.toString() + "String_Node_Str");
      }
      LOGGER.info(sb.toString());
    }
    throw new BimServerClientException("String_Node_Str");
  }
}

Fixed version (ground truth):
public void dumpIfNotEmpty() throws BimServerClientException {
  if (size() > 0) {
    for (    Entry<T,List<WaitingObject>> entry : waitingObjects.entrySet()) {
      StringBuilder sb=new StringBuilder("String_Node_Str" + entry.getKey() + "String_Node_Str");
      for (      WaitingObject waitingObject : entry.getValue()) {
        sb.append(waitingObject.toString() + "String_Node_Str");
      }
      LOGGER.info(sb.toString());
    }
    throw new BimServerClientException("String_Node_Str");
  }
}
Program: 160542
Project: 160542
Buggy source:
private void writeWrappedValue(int pid,int rid,Object value,ByteBuffer buffer) throws BimserverDatabaseException {
  IdEObject wrappedValue=(IdEObject)value;
  EStructuralFeature eStructuralFeature=wrappedValue.eClass().getEStructuralFeature("String_Node_Str");
  Short cid=database.getCidOfEClass(wrappedValue.eClass());
  buffer.putShort((short)-cid);
  writePrimitiveValue(eStructuralFeature,wrappedValue.eGet(eStructuralFeature),buffer);
  if (wrappedValue instanceof IfcGloballyUniqueId) {
    if (wrappedValue.getOid() == -1) {
      ((IdEObjectImpl)wrappedValue).setOid(newOid(Ifc2x3tc1Package.eINSTANCE.getIfcGloballyUniqueId()));
    }
    ByteBuffer b=ByteBuffer.allocate(getExactSize(wrappedValue));
    ByteBuffer convertObjectToByteArray=convertObjectToByteArray(wrappedValue,b);
    ByteBuffer createKeyBuffer=createKeyBuffer(pid,wrappedValue.getOid(),rid);
    try {
      EClass ifcGloballyUniqueIdEClass=Ifc2x3tc1Package.eINSTANCE.getIfcGloballyUniqueId();
      database.getKeyValueStore().storeNoOverwrite(ifcGloballyUniqueIdEClass.getEPackage().getName() + "String_Node_Str" + ifcGloballyUniqueIdEClass.getName(),createKeyBuffer.array(),convertObjectToByteArray.array(),this);
      database.incrementCommittedWrites(1);
    }
 catch (    BimserverLockConflictException e) {
      LOGGER.error("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
private void writeWrappedValue(int pid,int rid,Object value,ByteBuffer buffer) throws BimserverDatabaseException {
  IdEObject wrappedValue=(IdEObject)value;
  EStructuralFeature eStructuralFeature=wrappedValue.eClass().getEStructuralFeature("String_Node_Str");
  Short cid=database.getCidOfEClass(wrappedValue.eClass());
  buffer.putShort((short)-cid);
  writePrimitiveValue(eStructuralFeature,wrappedValue.eGet(eStructuralFeature),buffer);
  if (wrappedValue instanceof IfcGloballyUniqueId) {
    if (wrappedValue.getOid() == -1) {
      ((IdEObjectImpl)wrappedValue).setOid(newOid(Ifc2x3tc1Package.eINSTANCE.getIfcGloballyUniqueId()));
    }
    ByteBuffer convertObjectToByteArray=convertObjectToByteArray(wrappedValue,ByteBuffer.allocate(getExactSize(wrappedValue)));
    ByteBuffer createKeyBuffer=createKeyBuffer(pid,wrappedValue.getOid(),rid);
    try {
      EClass ifcGloballyUniqueIdEClass=Ifc2x3tc1Package.eINSTANCE.getIfcGloballyUniqueId();
      database.getKeyValueStore().storeNoOverwrite(ifcGloballyUniqueIdEClass.getEPackage().getName() + "String_Node_Str" + ifcGloballyUniqueIdEClass.getName(),createKeyBuffer.array(),convertObjectToByteArray.array(),this);
      database.incrementCommittedWrites(1);
    }
 catch (    BimserverLockConflictException e) {
      LOGGER.error("String_Node_Str",e);
    }
  }
}
Program: 160544
Project: 160544
Buggy source:
public void loadPluginsFromJar(File file) throws PluginException {
  if (loadedLocations.contains(file.getAbsolutePath())) {
    return;
  }
  LOGGER.debug("String_Node_Str" + file.getAbsolutePath());
  if (!file.isFile()) {
    throw new PluginException("String_Node_Str" + file.getAbsolutePath());
  }
  try {
    FileJarClassLoader jarClassLoader=new FileJarClassLoader(getClass().getClassLoader(),file,new File(tempDir,file.getName()));
    InputStream pluginStream=jarClassLoader.getResourceAsStream("String_Node_Str");
    if (pluginStream == null) {
      throw new PluginException("String_Node_Str");
    }
    PluginDescriptor pluginDescriptor=getPluginDescriptor(pluginStream);
    if (pluginDescriptor == null) {
      throw new PluginException("String_Node_Str");
    }
    LOGGER.debug(pluginDescriptor.toString());
    loadedLocations.add(file.getAbsolutePath());
    loadPlugins(jarClassLoader,file.getAbsolutePath(),file.getAbsolutePath(),pluginDescriptor,PluginSourceType.JAR_FILE);
  }
 catch (  JAXBException e) {
    throw new PluginException(e);
  }
catch (  FileNotFoundException e) {
    throw new PluginException(e);
  }
catch (  IOException e) {
    throw new PluginException(e);
  }
}

Fixed version (ground truth):
public void loadPluginsFromJar(File file) throws PluginException {
  if (loadedLocations.contains(file.getAbsolutePath())) {
    return;
  }
  LOGGER.debug("String_Node_Str" + file.getAbsolutePath());
  if (!file.isFile()) {
    throw new PluginException("String_Node_Str" + file.getAbsolutePath());
  }
  try {
    FileJarClassLoader jarClassLoader=new FileJarClassLoader(getClass().getClassLoader(),file,tempDir);
    InputStream pluginStream=jarClassLoader.getResourceAsStream("String_Node_Str");
    if (pluginStream == null) {
      throw new PluginException("String_Node_Str");
    }
    PluginDescriptor pluginDescriptor=getPluginDescriptor(pluginStream);
    if (pluginDescriptor == null) {
      throw new PluginException("String_Node_Str");
    }
    LOGGER.debug(pluginDescriptor.toString());
    loadedLocations.add(file.getAbsolutePath());
    loadPlugins(jarClassLoader,file.getAbsolutePath(),file.getAbsolutePath(),pluginDescriptor,PluginSourceType.JAR_FILE);
  }
 catch (  JAXBException e) {
    throw new PluginException(e);
  }
catch (  FileNotFoundException e) {
    throw new PluginException(e);
  }
catch (  IOException e) {
    throw new PluginException(e);
  }
}