Program: 25614
Project: 25614
Buggy source:
private static void tryExtractDiskImage(Object rspecSliverObject,Resource omnSliver) throws MissingRspecElementException {
  try {
    @SuppressWarnings("String_Node_Str") final JAXBElement<DiskImageContents> diJaxb=(JAXBElement<DiskImageContents>)rspecSliverObject;
    final DiskImageContents diskImageContents=diJaxb.getValue();
    String diskImageURL=diskImageContents.getUrl();
    Resource diskImage=omnSliver.getModel().createResource(diskImageURL);
    diskImage.addProperty(RDF.type,Omn_domain_pc.DiskImage);
    String name=diskImageContents.getName();
    if (name == null) {
      throw new MissingRspecElementException("String_Node_Str");
    }
    diskImage.addLiteral(Omn_domain_pc.hasDiskimageLabel,name);
    String os=diskImageContents.getOs();
    if (os != null) {
      diskImage.addLiteral(Omn_domain_pc.hasDiskimageOS,os);
    }
    String version=diskImageContents.getVersion();
    if (version != null) {
      diskImage.addLiteral(Omn_domain_pc.hasDiskimageVersion,version);
    }
    String url=diskImageContents.getUrl();
    if (url != null) {
      diskImage.addLiteral(Omn_domain_pc.hasDiskimageURI,url);
    }
    String description=diskImageContents.getDescription();
    if (description != null) {
      diskImage.addLiteral(Omn_domain_pc.hasDiskimageDescription,description);
    }
    boolean alreadyExists=false;
    if (omnSliver.hasProperty(Omn_domain_pc.hasDiskImage)) {
      StmtIterator diskImages=omnSliver.listProperties(Omn_domain_pc.hasDiskImage);
      while (diskImages.hasNext()) {
        Statement diskImageStatement=diskImages.next();
        Resource diskImageResource=diskImageStatement.getObject().asResource();
        if (diskImageResource.hasProperty(Omn_domain_pc.hasDiskimageLabel)) {
          String diskImageLabel=diskImageResource.getProperty(Omn_domain_pc.hasDiskimageLabel).getObject().asLiteral().getString();
          if (diskImageLabel.equals(name)) {
            alreadyExists=true;
          }
        }
      }
    }
    if (!alreadyExists) {
      omnSliver.addProperty(Omn_domain_pc.hasDiskImage,diskImage);
    }
  }
 catch (  final ClassCastException e) {
    RequestConverter.LOG.finer(e.getMessage());
  }
catch (  final InvalidPropertyURIException e) {
    RequestConverter.LOG.info(e.getMessage());
  }
}

Fixed version (ground truth):
private static void tryExtractDiskImage(Object rspecSliverObject,Resource omnSliver) throws MissingRspecElementException {
  if (rspecSliverObject instanceof JAXBElement) {
    if (((JAXBElement<?>)rspecSliverObject).getDeclaredType().equals(DiskImageContents.class)) {
      DiskImageContents diskImageContents=(DiskImageContents)((JAXBElement<?>)rspecSliverObject).getValue();
      String diskImageURL=diskImageContents.getUrl();
      Resource diskImage=omnSliver.getModel().createResource(diskImageURL);
      diskImage.addProperty(RDF.type,Omn_domain_pc.DiskImage);
      String name=diskImageContents.getName();
      if (name == null) {
        throw new MissingRspecElementException("String_Node_Str");
      }
      diskImage.addLiteral(Omn_domain_pc.hasDiskimageLabel,name);
      String os=diskImageContents.getOs();
      if (os != null) {
        diskImage.addLiteral(Omn_domain_pc.hasDiskimageOS,os);
      }
      String version=diskImageContents.getVersion();
      if (version != null) {
        diskImage.addLiteral(Omn_domain_pc.hasDiskimageVersion,version);
      }
      String url=diskImageContents.getUrl();
      if (url != null) {
        diskImage.addLiteral(Omn_domain_pc.hasDiskimageURI,url);
      }
      String description=diskImageContents.getDescription();
      if (description != null) {
        diskImage.addLiteral(Omn_domain_pc.hasDiskimageDescription,description);
      }
      boolean alreadyExists=false;
      if (omnSliver.hasProperty(Omn_domain_pc.hasDiskImage)) {
        StmtIterator diskImages=omnSliver.listProperties(Omn_domain_pc.hasDiskImage);
        while (diskImages.hasNext()) {
          Statement diskImageStatement=diskImages.next();
          Resource diskImageResource=diskImageStatement.getObject().asResource();
          if (diskImageResource.hasProperty(Omn_domain_pc.hasDiskimageLabel)) {
            String diskImageLabel=diskImageResource.getProperty(Omn_domain_pc.hasDiskimageLabel).getObject().asLiteral().getString();
            if (diskImageLabel.equals(name)) {
              alreadyExists=true;
            }
          }
        }
      }
      if (!alreadyExists) {
        omnSliver.addProperty(Omn_domain_pc.hasDiskImage,diskImage);
      }
    }
  }
}