Program: 92467
Project: 92467
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public void init(IEditorSite site,IEditorInput input) throws PartInitException {
  if (input instanceof TmfEditorInput) {
    fFile=((TmfEditorInput)input).getFile();
    fTrace=((TmfEditorInput)input).getTrace();
    input=new FileEditorInput(fFile);
  }
 else   if (input instanceof IFileEditorInput) {
    fFile=((IFileEditorInput)input).getFile();
    if (fFile == null) {
      throw new PartInitException("String_Node_Str" + input);
    }
    try {
      String traceTypeId=fFile.getPersistentProperty(TmfTraceElement.TRACETYPE);
      if (traceTypeId == null) {
        throw new PartInitException(Messages.OpenTraceHandler_NoTraceType);
      }
      if (traceTypeId.equals(TmfExperiment.class.getCanonicalName())) {
        TmfNavigatorContentProvider ncp=new TmfNavigatorContentProvider();
        ncp.getChildren(fFile.getProject());
        TmfProjectElement project=TmfProjectRegistry.getProject(fFile.getProject());
        if (project == null) {
          throw new PartInitException(Messages.OpenExperimentHandler_NoTraceType);
        }
        for (        ITmfProjectModelElement projectElement : project.getExperimentsFolder().getChildren()) {
          String traceName=fFile.getParent().getName();
          if (projectElement.getName().equals(traceName)) {
            TmfExperimentElement experimentElement=(TmfExperimentElement)projectElement;
            List<TmfTraceElement> traceEntries=experimentElement.getTraces();
            int nbTraces=traceEntries.size();
            int cacheSize=Integer.MAX_VALUE;
            ITmfTrace<?>[] traces=new ITmfTrace[nbTraces];
            for (int i=0; i < nbTraces; i++) {
              TmfTraceElement traceElement=traceEntries.get(i);
              ITmfTrace trace=traceElement.instantiateTrace();
              ITmfEvent traceEvent=traceElement.instantiateEvent();
              if ((trace == null) || (traceEvent == null)) {
                for (int j=0; j < i; j++) {
                  traces[j].dispose();
                }
                throw new PartInitException(Messages.OpenExperimentHandler_NoTraceType);
              }
              try {
                trace.initTrace(traceElement.getName(),traceElement.getLocation().getPath(),traceEvent.getClass());
              }
 catch (              FileNotFoundException e) {
              }
              trace.setResource(traceElement.getResource());
              cacheSize=Math.min(cacheSize,trace.getIndexPageSize());
              traces[i]=trace;
            }
            TmfExperiment experiment=new TmfExperiment(TmfEvent.class,experimentElement.getName(),traces,cacheSize);
            experiment.setBookmarksFile(fFile);
            fTrace=experiment;
            experiment.initTrace(null,null,null);
            experiment.indexTrace(true);
            break;
          }
        }
      }
 else       if (traceTypeId.equals(TmfTrace.class.getCanonicalName())) {
        TmfNavigatorContentProvider ncp=new TmfNavigatorContentProvider();
        ncp.getChildren(fFile.getProject());
        TmfProjectElement project=TmfProjectRegistry.getProject(fFile.getProject());
        for (        ITmfProjectModelElement projectElement : project.getTracesFolder().getChildren()) {
          String traceName=fFile.getParent().getName();
          if (projectElement.getName().equals(traceName)) {
            TmfTraceElement traceElement=(TmfTraceElement)projectElement;
            ITmfTrace trace=traceElement.instantiateTrace();
            ITmfEvent traceEvent=traceElement.instantiateEvent();
            if ((trace == null) || (traceEvent == null)) {
              throw new PartInitException(Messages.OpenTraceHandler_NoTraceType);
            }
            try {
              trace.initTrace(traceElement.getName(),traceElement.getLocation().getPath(),traceEvent.getClass());
              trace.indexTrace(false);
            }
 catch (            FileNotFoundException e) {
            }
            trace.setResource(traceElement.getResource());
            fTrace=trace;
            break;
          }
        }
      }
 else {
        TmfNavigatorContentProvider ncp=new TmfNavigatorContentProvider();
        ncp.getChildren(fFile.getProject());
        TmfProjectElement project=TmfProjectRegistry.getProject(fFile.getProject());
        for (        ITmfProjectModelElement projectElement : project.getTracesFolder().getChildren()) {
          if (projectElement.getResource().equals(fFile)) {
            TmfTraceElement traceElement=(TmfTraceElement)projectElement;
            ITmfTrace trace=traceElement.instantiateTrace();
            ITmfEvent traceEvent=traceElement.instantiateEvent();
            if ((trace == null) || (traceEvent == null)) {
              throw new PartInitException(Messages.OpenTraceHandler_NoTraceType);
            }
            try {
              trace.initTrace(traceElement.getName(),traceElement.getLocation().getPath(),traceEvent.getClass());
              trace.indexTrace(false);
            }
 catch (            FileNotFoundException e) {
            }
            if (trace instanceof TmfTrace) {
              ((TmfTrace)trace).setResource(traceElement.getResource());
            }
            fTrace=trace;
            break;
          }
        }
      }
    }
 catch (    InvalidRegistryObjectException e) {
      e.printStackTrace();
    }
catch (    PartInitException e) {
      throw e;
    }
catch (    CoreException e) {
      e.printStackTrace();
    }
  }
 else {
    throw new PartInitException("String_Node_Str" + input.getClass());
  }
  if (fTrace == null) {
    throw new PartInitException("String_Node_Str" + fFile.getName());
  }
  super.setSite(site);
  super.setInput(input);
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public void init(IEditorSite site,IEditorInput input) throws PartInitException {
  if (input instanceof TmfEditorInput) {
    fFile=((TmfEditorInput)input).getFile();
    fTrace=((TmfEditorInput)input).getTrace();
    input=new FileEditorInput(fFile);
  }
 else   if (input instanceof IFileEditorInput) {
    fFile=((IFileEditorInput)input).getFile();
    if (fFile == null) {
      throw new PartInitException("String_Node_Str" + input);
    }
    try {
      String traceTypeId=fFile.getPersistentProperty(TmfTraceElement.TRACETYPE);
      if (traceTypeId == null) {
        throw new PartInitException(Messages.OpenTraceHandler_NoTraceType);
      }
      if (traceTypeId.equals(TmfExperiment.class.getCanonicalName())) {
        TmfNavigatorContentProvider ncp=new TmfNavigatorContentProvider();
        ncp.getChildren(fFile.getProject());
        TmfProjectElement project=TmfProjectRegistry.getProject(fFile.getProject());
        if (project == null) {
          throw new PartInitException(Messages.OpenExperimentHandler_NoTraceType);
        }
        for (        ITmfProjectModelElement projectElement : project.getExperimentsFolder().getChildren()) {
          String traceName=fFile.getParent().getName();
          if (projectElement.getName().equals(traceName)) {
            TmfExperimentElement experimentElement=(TmfExperimentElement)projectElement;
            List<TmfTraceElement> traceEntries=experimentElement.getTraces();
            int nbTraces=traceEntries.size();
            int cacheSize=Integer.MAX_VALUE;
            ITmfTrace<?>[] traces=new ITmfTrace[nbTraces];
            for (int i=0; i < nbTraces; i++) {
              TmfTraceElement traceElement=traceEntries.get(i);
              ITmfTrace trace=traceElement.instantiateTrace();
              ITmfEvent traceEvent=traceElement.instantiateEvent();
              if ((trace == null) || (traceEvent == null)) {
                for (int j=0; j < i; j++) {
                  traces[j].dispose();
                }
                throw new PartInitException(Messages.OpenExperimentHandler_NoTraceType);
              }
              try {
                trace.initTrace(traceElement.getName(),traceElement.getLocation().getPath(),traceEvent.getClass());
              }
 catch (              FileNotFoundException e) {
              }
              trace.setResource(traceElement.getResource());
              cacheSize=Math.min(cacheSize,trace.getIndexPageSize());
              traces[i]=trace;
            }
            TmfExperiment experiment=new TmfExperiment(ITmfEvent.class,experimentElement.getName(),traces,cacheSize);
            experiment.setBookmarksFile(fFile);
            fTrace=experiment;
            experiment.initTrace(null,null,null);
            experiment.indexTrace(true);
            break;
          }
        }
      }
 else       if (traceTypeId.equals(TmfTrace.class.getCanonicalName())) {
        TmfNavigatorContentProvider ncp=new TmfNavigatorContentProvider();
        ncp.getChildren(fFile.getProject());
        TmfProjectElement project=TmfProjectRegistry.getProject(fFile.getProject());
        for (        ITmfProjectModelElement projectElement : project.getTracesFolder().getChildren()) {
          String traceName=fFile.getParent().getName();
          if (projectElement.getName().equals(traceName)) {
            TmfTraceElement traceElement=(TmfTraceElement)projectElement;
            ITmfTrace trace=traceElement.instantiateTrace();
            ITmfEvent traceEvent=traceElement.instantiateEvent();
            if ((trace == null) || (traceEvent == null)) {
              throw new PartInitException(Messages.OpenTraceHandler_NoTraceType);
            }
            try {
              trace.initTrace(traceElement.getName(),traceElement.getLocation().getPath(),traceEvent.getClass());
              trace.indexTrace(false);
            }
 catch (            FileNotFoundException e) {
            }
            trace.setResource(traceElement.getResource());
            fTrace=trace;
            break;
          }
        }
      }
 else {
        TmfNavigatorContentProvider ncp=new TmfNavigatorContentProvider();
        ncp.getChildren(fFile.getProject());
        TmfProjectElement project=TmfProjectRegistry.getProject(fFile.getProject());
        for (        ITmfProjectModelElement projectElement : project.getTracesFolder().getChildren()) {
          if (projectElement.getResource().equals(fFile)) {
            TmfTraceElement traceElement=(TmfTraceElement)projectElement;
            ITmfTrace trace=traceElement.instantiateTrace();
            ITmfEvent traceEvent=traceElement.instantiateEvent();
            if ((trace == null) || (traceEvent == null)) {
              throw new PartInitException(Messages.OpenTraceHandler_NoTraceType);
            }
            try {
              trace.initTrace(traceElement.getName(),traceElement.getLocation().getPath(),traceEvent.getClass());
              trace.indexTrace(false);
            }
 catch (            FileNotFoundException e) {
            }
            if (trace instanceof TmfTrace) {
              ((TmfTrace)trace).setResource(traceElement.getResource());
            }
            fTrace=trace;
            break;
          }
        }
      }
    }
 catch (    InvalidRegistryObjectException e) {
      e.printStackTrace();
    }
catch (    PartInitException e) {
      throw e;
    }
catch (    CoreException e) {
      e.printStackTrace();
    }
  }
 else {
    throw new PartInitException("String_Node_Str" + input.getClass());
  }
  if (fTrace == null) {
    throw new PartInitException("String_Node_Str" + fFile.getName());
  }
  super.setSite(site);
  super.setInput(input);
}