Program: 160518
Project: 160518
Buggy source:
@Override public void register(SInternalServicePluginConfiguration internalServicePluginConfiguration,PluginConfiguration pluginConfiguration){
  ServiceDescriptor serviceDescriptor=StoreFactory.eINSTANCE.createServiceDescriptor();
  serviceDescriptor.setProviderName("String_Node_Str");
  serviceDescriptor.setIdentifier(getClass().getName());
  serviceDescriptor.setName("String_Node_Str");
  serviceDescriptor.setDescription("String_Node_Str");
  serviceDescriptor.setNotificationProtocol(AccessMethod.INTERNAL);
  serviceDescriptor.setTrigger(Trigger.NEW_REVISION);
  serviceDescriptor.setReadRevision(true);
  serviceDescriptor.setWriteExtendedData("String_Node_Str");
  registerNewRevisionHandler(serviceDescriptor,new NewRevisionHandler(){
    @Override public void newRevision(    BimServerClientInterface bimServerClientInterface,    long poid,    long roid,    String userToken,    long soid,    SObjectType settings) throws ServerException, UserException {
      try {
        Date startDate=new Date();
        Long topicId=bimServerClientInterface.getRegistry().registerProgressOnRevisionTopic(SProgressTopicType.RUNNING_SERVICE,poid,roid,"String_Node_Str");
        SLongActionState state=new SLongActionState();
        state.setTitle("String_Node_Str");
        state.setState(SActionState.STARTED);
        state.setProgress(-1);
        state.setStart(startDate);
        bimServerClientInterface.getRegistry().updateProgressTopic(topicId,state);
        IfcModelInterface model=bimServerClientInterface.getModel(poid,roid,true);
        try {
          WorkbookSettings wbSettings=new WorkbookSettings();
          wbSettings.setLocale(new Locale("String_Node_Str","String_Node_Str"));
          WritableWorkbook workbook=null;
          WritableFont times10pt=new WritableFont(WritableFont.ARIAL,10);
          times=new WritableCellFormat(times10pt);
          WritableFont times10ptbold=new WritableFont(WritableFont.ARIAL,10);
          times10ptbold.setBoldStyle(WritableFont.BOLD);
          timesbold=new WritableCellFormat(times10ptbold);
          ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream();
          workbook=Workbook.createWorkbook(byteArrayOutputStream,wbSettings);
          WritableSheet allSheet=workbook.createSheet("String_Node_Str",0);
          WritableSheet noFurnitureSheet=workbook.createSheet("String_Node_Str",1);
          WritableSheet noProxySheet=workbook.createSheet("String_Node_Str",2);
          createHeader(allSheet);
          createHeader(noFurnitureSheet);
          createHeader(noProxySheet);
          float scaleFactorToMeter=1;
          for (          IfcSIUnit ifcSIUnit : model.getAll(IfcSIUnit.class)) {
            if (ifcSIUnit.getUnitType() == IfcUnitEnum.LENGTHUNIT) {
              IfcSIUnitName ifcSiUnitName=ifcSIUnit.getName();
              if (IfcSIUnitName.METRE == ifcSiUnitName) {
                IfcSIPrefix lengthPrefix=ifcSIUnit.getPrefix();
                System.out.println("String_Node_Str" + lengthPrefix);
                if (lengthPrefix == IfcSIPrefix.DECA) {
                  scaleFactorToMeter=10f;
                }
 else                 if (lengthPrefix == IfcSIPrefix.CENTI) {
                  scaleFactorToMeter=0.1f;
                }
 else                 if (lengthPrefix == IfcSIPrefix.DECI) {
                  scaleFactorToMeter=0.01f;
                }
 else                 if (lengthPrefix == IfcSIPrefix.MILLI) {
                  scaleFactorToMeter=0.001f;
                }
 else                 if (lengthPrefix == IfcSIPrefix.NULL) {
                  scaleFactorToMeter=1;
                }
 else {
                  System.out.println("String_Node_Str" + lengthPrefix);
                }
              }
 else {
                System.out.println("String_Node_Str");
              }
            }
          }
          double cubicScaleFactor=Math.pow(scaleFactorToMeter,3);
          int totalNrTriangles=0;
          int totalNrTrianglesNoProxies=0;
          int totalNrTrianglesNoFurniture=0;
          int nrIfcProducts=0;
          int nrIfcProductsNoFurniture=0;
          int nrIfcProductsNoProxies=0;
          Bounds totalBounds=new Bounds();
          int totalUsedAttributes=0;
          int totalUsedAttributesNoFurniture=0;
          int totalUsedAttributesNoProxies=0;
          double totalSpaceM3=0;
          model.getAll(GeometryInfo.class);
          model.getAll(Vector3f.class);
          int nrSpaces=0;
          for (          IfcSpace ifcSpace : model.getAll(IfcSpace.class)) {
            if (ifcSpace.getGeometry() != null) {
              Vector3f minBounds=ifcSpace.getGeometry().getMinBounds();
              Vector3f maxBounds=ifcSpace.getGeometry().getMinBounds();
              double v=cubicScaleFactor * (maxBounds.getX() - minBounds.getX() * (maxBounds.getY() - minBounds.getY()) * (maxBounds.getZ() - minBounds.getZ()));
              totalSpaceM3+=v;
              nrSpaces++;
            }
          }
          for (          IfcProduct ifcProduct : model.getAllWithSubTypes(IfcProduct.class)) {
            if (ifcProduct.getGeometry() != null) {
              totalBounds.integrate(new Bounds(ifcProduct.getGeometry().getMinBounds(),ifcProduct.getGeometry().getMaxBounds()));
              totalNrTriangles+=ifcProduct.getGeometry().getPrimitiveCount();
              if (!(ifcProduct instanceof IfcFurnishingElement)) {
                totalNrTrianglesNoFurniture+=ifcProduct.getGeometry().getPrimitiveCount();
              }
              if (!(ifcProduct instanceof IfcProxy)) {
                totalNrTrianglesNoProxies+=ifcProduct.getGeometry().getPrimitiveCount();
              }
              int usedAttributes=0;
              for (              EAttribute eAttribute : ifcProduct.eClass().getEAllAttributes()) {
                Object val=ifcProduct.eGet(eAttribute);
                if (eAttribute.isMany()) {
                  List<?> list=(List<?>)val;
                  if (list.size() > 0) {
                    usedAttributes++;
                  }
                }
 else {
                  if (val != null) {
                    usedAttributes++;
                  }
                }
              }
              for (              IfcRelDefines ifcRelDefines : ifcProduct.getIsDefinedBy()) {
                if (ifcRelDefines instanceof IfcRelDefinesByProperties) {
                  IfcRelDefinesByProperties ifcRelDefinesByProperties=(IfcRelDefinesByProperties)ifcRelDefines;
                  IfcPropertySetDefinition propertySetDefinition=ifcRelDefinesByProperties.getRelatingPropertyDefinition();
                  if (propertySetDefinition instanceof IfcPropertySet) {
                    IfcPropertySet ifcPropertySet=(IfcPropertySet)propertySetDefinition;
                    usedAttributes+=ifcPropertySet.getHasProperties().size();
                  }
                }
              }
              totalUsedAttributes+=usedAttributes;
              nrIfcProducts++;
              if (!(ifcProduct instanceof IfcFurnishingElement)) {
                totalUsedAttributesNoFurniture+=usedAttributes;
                nrIfcProductsNoFurniture++;
              }
              if (!(ifcProduct instanceof IfcProxy)) {
                totalUsedAttributesNoProxies+=usedAttributes;
                nrIfcProductsNoProxies++;
              }
            }
          }
          writeRow(allSheet,2,"String_Node_Str",cubicScaleFactor,totalNrTriangles,nrIfcProducts,totalBounds,totalUsedAttributes,totalSpaceM3,nrSpaces);
          writeRow(noFurnitureSheet,2,"String_Node_Str",cubicScaleFactor,totalNrTrianglesNoFurniture,nrIfcProductsNoFurniture,totalBounds,totalUsedAttributesNoFurniture,totalSpaceM3,nrSpaces);
          writeRow(noProxySheet,2,"String_Node_Str",cubicScaleFactor,totalNrTrianglesNoProxies,nrIfcProductsNoProxies,totalBounds,totalUsedAttributesNoProxies,totalSpaceM3,nrSpaces);
          workbook.write();
          workbook.close();
          SExtendedDataSchema extendedDataSchemaByNamespace=bimServerClientInterface.getBimsie1ServiceInterface().getExtendedDataSchemaByNamespace("String_Node_Str");
          SFile file=new SFile();
          SExtendedData extendedData=new SExtendedData();
          extendedData.setTitle("String_Node_Str");
          file.setFilename("String_Node_Str");
          extendedData.setSchemaId(extendedDataSchemaByNamespace.getOid());
          try {
            byte[] bytes=byteArrayOutputStream.toByteArray();
            file.setData(bytes);
            file.setMime("String_Node_Str");
            long fileId=bimServerClientInterface.getServiceInterface().uploadFile(file);
            extendedData.setFileId(fileId);
            bimServerClientInterface.getBimsie1ServiceInterface().addExtendedDataToRevision(roid,extendedData);
          }
 catch (          Exception e) {
            LOGGER.error("String_Node_Str",e);
          }
        }
 catch (        Exception e) {
          e.printStackTrace();
        }
        state=new SLongActionState();
        state.setProgress(100);
        state.setTitle("String_Node_Str");
        state.setState(SActionState.FINISHED);
        state.setStart(startDate);
        state.setEnd(new Date());
        bimServerClientInterface.getRegistry().updateProgressTopic(topicId,state);
        bimServerClientInterface.getRegistry().unregisterProgressTopic(topicId);
      }
 catch (      PublicInterfaceNotFoundException e) {
        LOGGER.error("String_Node_Str",e);
      }
catch (      BimServerClientException e) {
        LOGGER.error("String_Node_Str",e);
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void register(SInternalServicePluginConfiguration internalServicePluginConfiguration,PluginConfiguration pluginConfiguration){
  ServiceDescriptor serviceDescriptor=StoreFactory.eINSTANCE.createServiceDescriptor();
  serviceDescriptor.setProviderName("String_Node_Str");
  serviceDescriptor.setIdentifier("String_Node_Str" + internalServicePluginConfiguration.getOid());
  serviceDescriptor.setName("String_Node_Str");
  serviceDescriptor.setDescription("String_Node_Str");
  serviceDescriptor.setNotificationProtocol(AccessMethod.INTERNAL);
  serviceDescriptor.setTrigger(Trigger.NEW_REVISION);
  serviceDescriptor.setReadRevision(true);
  serviceDescriptor.setWriteExtendedData("String_Node_Str");
  registerNewRevisionHandler(serviceDescriptor,new NewRevisionHandler(){
    @Override public void newRevision(    BimServerClientInterface bimServerClientInterface,    long poid,    long roid,    String userToken,    long soid,    SObjectType settings) throws ServerException, UserException {
      try {
        Date startDate=new Date();
        Long topicId=bimServerClientInterface.getRegistry().registerProgressOnRevisionTopic(SProgressTopicType.RUNNING_SERVICE,poid,roid,"String_Node_Str");
        SLongActionState state=new SLongActionState();
        state.setTitle("String_Node_Str");
        state.setState(SActionState.STARTED);
        state.setProgress(-1);
        state.setStart(startDate);
        bimServerClientInterface.getRegistry().updateProgressTopic(topicId,state);
        IfcModelInterface model=bimServerClientInterface.getModel(poid,roid,true);
        try {
          WorkbookSettings wbSettings=new WorkbookSettings();
          wbSettings.setLocale(new Locale("String_Node_Str","String_Node_Str"));
          WritableWorkbook workbook=null;
          WritableFont times10pt=new WritableFont(WritableFont.ARIAL,10);
          times=new WritableCellFormat(times10pt);
          WritableFont times10ptbold=new WritableFont(WritableFont.ARIAL,10);
          times10ptbold.setBoldStyle(WritableFont.BOLD);
          timesbold=new WritableCellFormat(times10ptbold);
          ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream();
          workbook=Workbook.createWorkbook(byteArrayOutputStream,wbSettings);
          WritableSheet allSheet=workbook.createSheet("String_Node_Str",0);
          WritableSheet noFurnitureSheet=workbook.createSheet("String_Node_Str",1);
          WritableSheet noProxySheet=workbook.createSheet("String_Node_Str",2);
          createHeader(allSheet);
          createHeader(noFurnitureSheet);
          createHeader(noProxySheet);
          float scaleFactorToMeter=1;
          for (          IfcSIUnit ifcSIUnit : model.getAll(IfcSIUnit.class)) {
            if (ifcSIUnit.getUnitType() == IfcUnitEnum.LENGTHUNIT) {
              IfcSIUnitName ifcSiUnitName=ifcSIUnit.getName();
              if (IfcSIUnitName.METRE == ifcSiUnitName) {
                IfcSIPrefix lengthPrefix=ifcSIUnit.getPrefix();
                System.out.println("String_Node_Str" + lengthPrefix);
                if (lengthPrefix == IfcSIPrefix.DECA) {
                  scaleFactorToMeter=10f;
                }
 else                 if (lengthPrefix == IfcSIPrefix.CENTI) {
                  scaleFactorToMeter=0.1f;
                }
 else                 if (lengthPrefix == IfcSIPrefix.DECI) {
                  scaleFactorToMeter=0.01f;
                }
 else                 if (lengthPrefix == IfcSIPrefix.MILLI) {
                  scaleFactorToMeter=0.001f;
                }
 else                 if (lengthPrefix == IfcSIPrefix.NULL) {
                  scaleFactorToMeter=1;
                }
 else {
                  System.out.println("String_Node_Str" + lengthPrefix);
                }
              }
 else {
                System.out.println("String_Node_Str");
              }
            }
          }
          double cubicScaleFactor=Math.pow(scaleFactorToMeter,3);
          int totalNrTriangles=0;
          int totalNrTrianglesNoProxies=0;
          int totalNrTrianglesNoFurniture=0;
          int nrIfcProducts=0;
          int nrIfcProductsNoFurniture=0;
          int nrIfcProductsNoProxies=0;
          Bounds totalBounds=new Bounds();
          int totalUsedAttributes=0;
          int totalUsedAttributesNoFurniture=0;
          int totalUsedAttributesNoProxies=0;
          double totalSpaceM3=0;
          model.getAll(GeometryInfo.class);
          model.getAll(Vector3f.class);
          int nrSpaces=0;
          for (          IfcSpace ifcSpace : model.getAll(IfcSpace.class)) {
            if (ifcSpace.getGeometry() != null) {
              Vector3f minBounds=ifcSpace.getGeometry().getMinBounds();
              Vector3f maxBounds=ifcSpace.getGeometry().getMinBounds();
              double v=cubicScaleFactor * (maxBounds.getX() - minBounds.getX() * (maxBounds.getY() - minBounds.getY()) * (maxBounds.getZ() - minBounds.getZ()));
              totalSpaceM3+=v;
              nrSpaces++;
            }
          }
          for (          IfcProduct ifcProduct : model.getAllWithSubTypes(IfcProduct.class)) {
            if (ifcProduct.getGeometry() != null) {
              totalBounds.integrate(new Bounds(ifcProduct.getGeometry().getMinBounds(),ifcProduct.getGeometry().getMaxBounds()));
              totalNrTriangles+=ifcProduct.getGeometry().getPrimitiveCount();
              if (!(ifcProduct instanceof IfcFurnishingElement)) {
                totalNrTrianglesNoFurniture+=ifcProduct.getGeometry().getPrimitiveCount();
              }
              if (!(ifcProduct instanceof IfcProxy)) {
                totalNrTrianglesNoProxies+=ifcProduct.getGeometry().getPrimitiveCount();
              }
              int usedAttributes=0;
              for (              EAttribute eAttribute : ifcProduct.eClass().getEAllAttributes()) {
                Object val=ifcProduct.eGet(eAttribute);
                if (eAttribute.isMany()) {
                  List<?> list=(List<?>)val;
                  if (list.size() > 0) {
                    usedAttributes++;
                  }
                }
 else {
                  if (val != null) {
                    usedAttributes++;
                  }
                }
              }
              for (              IfcRelDefines ifcRelDefines : ifcProduct.getIsDefinedBy()) {
                if (ifcRelDefines instanceof IfcRelDefinesByProperties) {
                  IfcRelDefinesByProperties ifcRelDefinesByProperties=(IfcRelDefinesByProperties)ifcRelDefines;
                  IfcPropertySetDefinition propertySetDefinition=ifcRelDefinesByProperties.getRelatingPropertyDefinition();
                  if (propertySetDefinition instanceof IfcPropertySet) {
                    IfcPropertySet ifcPropertySet=(IfcPropertySet)propertySetDefinition;
                    usedAttributes+=ifcPropertySet.getHasProperties().size();
                  }
                }
              }
              totalUsedAttributes+=usedAttributes;
              nrIfcProducts++;
              if (!(ifcProduct instanceof IfcFurnishingElement)) {
                totalUsedAttributesNoFurniture+=usedAttributes;
                nrIfcProductsNoFurniture++;
              }
              if (!(ifcProduct instanceof IfcProxy)) {
                totalUsedAttributesNoProxies+=usedAttributes;
                nrIfcProductsNoProxies++;
              }
            }
          }
          writeRow(allSheet,2,"String_Node_Str",cubicScaleFactor,totalNrTriangles,nrIfcProducts,totalBounds,totalUsedAttributes,totalSpaceM3,nrSpaces);
          writeRow(noFurnitureSheet,2,"String_Node_Str",cubicScaleFactor,totalNrTrianglesNoFurniture,nrIfcProductsNoFurniture,totalBounds,totalUsedAttributesNoFurniture,totalSpaceM3,nrSpaces);
          writeRow(noProxySheet,2,"String_Node_Str",cubicScaleFactor,totalNrTrianglesNoProxies,nrIfcProductsNoProxies,totalBounds,totalUsedAttributesNoProxies,totalSpaceM3,nrSpaces);
          workbook.write();
          workbook.close();
          SExtendedDataSchema extendedDataSchemaByNamespace=bimServerClientInterface.getBimsie1ServiceInterface().getExtendedDataSchemaByNamespace("String_Node_Str");
          SFile file=new SFile();
          SExtendedData extendedData=new SExtendedData();
          extendedData.setTitle("String_Node_Str");
          file.setFilename("String_Node_Str");
          extendedData.setSchemaId(extendedDataSchemaByNamespace.getOid());
          try {
            byte[] bytes=byteArrayOutputStream.toByteArray();
            file.setData(bytes);
            file.setMime("String_Node_Str");
            long fileId=bimServerClientInterface.getServiceInterface().uploadFile(file);
            extendedData.setFileId(fileId);
            bimServerClientInterface.getBimsie1ServiceInterface().addExtendedDataToRevision(roid,extendedData);
          }
 catch (          Exception e) {
            LOGGER.error("String_Node_Str",e);
          }
        }
 catch (        Exception e) {
          e.printStackTrace();
        }
        state=new SLongActionState();
        state.setProgress(100);
        state.setTitle("String_Node_Str");
        state.setState(SActionState.FINISHED);
        state.setStart(startDate);
        state.setEnd(new Date());
        bimServerClientInterface.getRegistry().updateProgressTopic(topicId,state);
        bimServerClientInterface.getRegistry().unregisterProgressTopic(topicId);
      }
 catch (      PublicInterfaceNotFoundException e) {
        LOGGER.error("String_Node_Str",e);
      }
catch (      BimServerClientException e) {
        LOGGER.error("String_Node_Str",e);
      }
    }
  }
);
}