Program: 92560
Project: 92560
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public void init(IEditorSite site,IEditorInput input) throws PartInitException {
  fEditorAreaVisible=site.getPage().isEditorAreaVisible();
  if (input instanceof TmfEditorInput) {
    fResource=((TmfEditorInput)input).getResource();
    fTrace=((TmfEditorInput)input).getTrace();
  }
 else   if (input instanceof IFileEditorInput) {
    fResource=((IFileEditorInput)input).getFile();
    if (fResource == null) {
      throw new PartInitException("String_Node_Str" + input);
    }
    TmfExperiment currentExperiment=TmfExperiment.getCurrentExperiment();
    if (currentExperiment != null && fResource.equals(currentExperiment.getResource())) {
      fTrace=currentExperiment;
      super.setSite(site);
      super.setInput(input);
      return;
    }
    try {
      String traceTypeId=fResource.getPersistentProperty(TmfTraceElement.TRACETYPE);
      if (traceTypeId == null) {
        throw new PartInitException(Messages.OpenTraceHandler_NoTraceType);
      }
      if (traceTypeId.equals(TmfExperiment.class.getCanonicalName())) {
        TmfNavigatorContentProvider ncp=new TmfNavigatorContentProvider();
        ncp.getChildren(fResource.getProject());
        TmfProjectElement project=TmfProjectRegistry.getProject(fResource.getProject());
        if (project == null) {
          throw new PartInitException(Messages.OpenExperimentHandler_NoTraceType);
        }
        for (        ITmfProjectModelElement projectElement : project.getExperimentsFolder().getChildren()) {
          String traceName=fResource.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();
              TmfEvent 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(),false);
              }
 catch (              FileNotFoundException e) {
              }
              if (trace instanceof TmfTrace) {
                ((TmfTrace)trace).setResource(traceElement.getResource());
              }
              cacheSize=Math.min(cacheSize,trace.getCacheSize());
              traces[i]=trace;
            }
            TmfExperiment experiment=new TmfExperiment(TmfEvent.class,experimentElement.getName(),traces,cacheSize);
            experiment.setResource(fResource);
            fTrace=experiment;
            TmfExperiment.setCurrentExperiment(experiment);
            TmfSignalManager.dispatchSignal(new TmfExperimentSelectedSignal(this,experiment));
            break;
          }
        }
      }
 else       if (traceTypeId.equals(TmfTrace.class.getCanonicalName())) {
        TmfNavigatorContentProvider ncp=new TmfNavigatorContentProvider();
        ncp.getChildren(fResource.getProject());
        TmfProjectElement project=TmfProjectRegistry.getProject(fResource.getProject());
        for (        ITmfProjectModelElement projectElement : project.getTracesFolder().getChildren()) {
          String traceName=fResource.getParent().getName();
          if (projectElement.getName().equals(traceName)) {
            TmfTraceElement traceElement=(TmfTraceElement)projectElement;
            ITmfTrace trace=traceElement.instantiateTrace();
            TmfEvent traceEvent=traceElement.instantiateEvent();
            if (trace == null || traceEvent == null) {
              throw new PartInitException(Messages.OpenTraceHandler_NoTraceType);
            }
            try {
              trace.initTrace(traceElement.getName(),traceElement.getLocation().getPath(),traceEvent.getClass(),false);
            }
 catch (            FileNotFoundException e) {
            }
            if (trace instanceof TmfTrace) {
              ((TmfTrace)trace).setResource(traceElement.getResource());
            }
            ITmfTrace[] traces=new ITmfTrace[]{trace};
            TmfExperiment experiment=new TmfExperiment(traceEvent.getClass(),traceElement.getName(),traces,trace.getCacheSize());
            experiment.setResource(fResource);
            fTrace=experiment;
            TmfExperiment.setCurrentExperiment(experiment);
            TmfSignalManager.dispatchSignal(new TmfExperimentSelectedSignal(this,experiment));
            break;
          }
        }
      }
 else {
        TmfNavigatorContentProvider ncp=new TmfNavigatorContentProvider();
        ncp.getChildren(fResource.getProject());
        TmfProjectElement project=TmfProjectRegistry.getProject(fResource.getProject());
        for (        ITmfProjectModelElement projectElement : project.getTracesFolder().getChildren()) {
          if (projectElement.getResource().equals(fResource)) {
            TmfTraceElement traceElement=(TmfTraceElement)projectElement;
            ITmfTrace trace=traceElement.instantiateTrace();
            TmfEvent traceEvent=traceElement.instantiateEvent();
            if (trace == null || traceEvent == null) {
              throw new PartInitException(Messages.OpenTraceHandler_NoTraceType);
            }
            try {
              trace.initTrace(traceElement.getName(),traceElement.getLocation().getPath(),traceEvent.getClass(),true);
            }
 catch (            FileNotFoundException e) {
            }
            if (trace instanceof TmfTrace) {
              ((TmfTrace)trace).setResource(traceElement.getResource());
            }
            ITmfTrace[] traces=new ITmfTrace[]{trace};
            TmfExperiment experiment=new TmfExperiment(traceEvent.getClass(),traceElement.getName(),traces,trace.getCacheSize());
            experiment.setResource(fResource);
            fTrace=experiment;
            TmfExperiment.setCurrentExperiment(experiment);
            TmfSignalManager.dispatchSignal(new TmfExperimentSelectedSignal(this,experiment));
            break;
          }
        }
      }
    }
 catch (    InvalidRegistryObjectException e) {
      e.printStackTrace();
    }
catch (    PartInitException e) {
      throw e;
    }
catch (    CoreException e) {
      e.printStackTrace();
    }
    input=new TmfEditorInput(fResource,fTrace);
  }
 else {
    throw new PartInitException("String_Node_Str" + input.getClass());
  }
  if (fTrace == null) {
    throw new PartInitException("String_Node_Str" + fResource.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 {
  fEditorAreaVisible=site.getPage().isEditorAreaVisible();
  if (input instanceof TmfEditorInput) {
    fFile=((TmfEditorInput)input).getFile();
    fTrace=((TmfEditorInput)input).getTrace();
  }
 else   if (input instanceof IFileEditorInput) {
    fFile=((IFileEditorInput)input).getFile();
    if (fFile == null) {
      throw new PartInitException("String_Node_Str" + input);
    }
    TmfExperiment currentExperiment=TmfExperiment.getCurrentExperiment();
    if (currentExperiment != null && fFile.equals(currentExperiment.getBookmarksFile())) {
      fTrace=currentExperiment;
      super.setSite(site);
      super.setInput(input);
      return;
    }
    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();
              TmfEvent 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(),false);
              }
 catch (              FileNotFoundException e) {
              }
              trace.setResource(traceElement.getResource());
              cacheSize=Math.min(cacheSize,trace.getCacheSize());
              traces[i]=trace;
            }
            TmfExperiment experiment=new TmfExperiment(TmfEvent.class,experimentElement.getName(),traces,cacheSize);
            experiment.setBookmarksFile(fFile);
            fTrace=experiment;
            TmfExperiment.setCurrentExperiment(experiment);
            TmfSignalManager.dispatchSignal(new TmfExperimentSelectedSignal(this,experiment));
            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();
            TmfEvent traceEvent=traceElement.instantiateEvent();
            if (trace == null || traceEvent == null) {
              throw new PartInitException(Messages.OpenTraceHandler_NoTraceType);
            }
            try {
              trace.initTrace(traceElement.getName(),traceElement.getLocation().getPath(),traceEvent.getClass(),false);
            }
 catch (            FileNotFoundException e) {
            }
            trace.setResource(traceElement.getResource());
            ITmfTrace[] traces=new ITmfTrace[]{trace};
            TmfExperiment experiment=new TmfExperiment(traceEvent.getClass(),traceElement.getName(),traces,trace.getCacheSize());
            experiment.setBookmarksFile(fFile);
            fTrace=experiment;
            TmfExperiment.setCurrentExperiment(experiment);
            TmfSignalManager.dispatchSignal(new TmfExperimentSelectedSignal(this,experiment));
            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();
            TmfEvent traceEvent=traceElement.instantiateEvent();
            if (trace == null || traceEvent == null) {
              throw new PartInitException(Messages.OpenTraceHandler_NoTraceType);
            }
            try {
              trace.initTrace(traceElement.getName(),traceElement.getLocation().getPath(),traceEvent.getClass(),true);
            }
 catch (            FileNotFoundException e) {
            }
            if (trace instanceof TmfTrace) {
              ((TmfTrace)trace).setResource(traceElement.getResource());
            }
            ITmfTrace[] traces=new ITmfTrace[]{trace};
            TmfExperiment experiment=new TmfExperiment(traceEvent.getClass(),traceElement.getName(),traces,trace.getCacheSize());
            experiment.setBookmarksFile(fFile);
            fTrace=experiment;
            TmfExperiment.setCurrentExperiment(experiment);
            TmfSignalManager.dispatchSignal(new TmfExperimentSelectedSignal(this,experiment));
            break;
          }
        }
      }
    }
 catch (    InvalidRegistryObjectException e) {
      e.printStackTrace();
    }
catch (    PartInitException e) {
      throw e;
    }
catch (    CoreException e) {
      e.printStackTrace();
    }
    input=new TmfEditorInput(fFile,fTrace);
  }
 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);
}