Program: 92303
Project: 92303
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public void init(final 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 {
      final String traceTypeId=fFile.getPersistentProperty(TmfCommonConstants.TRACETYPE);
      if (traceTypeId == null)       throw new PartInitException(Messages.OpenTraceHandler_NoTraceType);
      if (traceTypeId.equals(TmfExperiment.class.getCanonicalName())) {
        final TmfNavigatorContentProvider ncp=new TmfNavigatorContentProvider();
        ncp.getChildren(fFile.getProject());
        final TmfProjectElement project=TmfProjectRegistry.getProject(fFile.getProject());
        if (project == null)         throw new PartInitException(Messages.OpenExperimentHandler_NoTraceType);
        for (        final ITmfProjectModelElement projectElement : project.getExperimentsFolder().getChildren()) {
          final String traceName=fFile.getParent().getName();
          if (projectElement.getName().equals(traceName)) {
            final TmfExperimentElement experimentElement=(TmfExperimentElement)projectElement;
            final List<TmfTraceElement> traceEntries=experimentElement.getTraces();
            final int nbTraces=traceEntries.size();
            int cacheSize=Integer.MAX_VALUE;
            final ITmfTrace<?>[] traces=new ITmfTrace[nbTraces];
            for (int i=0; i < nbTraces; i++) {
              final TmfTraceElement traceElement=traceEntries.get(i);
              final ITmfTrace trace=traceElement.instantiateTrace();
              final 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.getResource(),traceElement.getLocation().getPath(),traceEvent.getClass());
              }
 catch (              final TmfTraceException e) {
              }
              cacheSize=Math.min(cacheSize,trace.getCacheSize());
              traces[i]=trace;
            }
            final TmfExperiment experiment=new TmfExperiment(ITmfEvent.class,experimentElement.getName(),traces,cacheSize);
            experiment.setBookmarksFile(fFile);
            fTrace=experiment;
            experiment.initTrace(null,null,null);
            break;
          }
        }
      }
 else       if (traceTypeId.equals(TmfTrace.class.getCanonicalName())) {
        final TmfNavigatorContentProvider ncp=new TmfNavigatorContentProvider();
        ncp.getChildren(fFile.getProject());
        final TmfProjectElement project=TmfProjectRegistry.getProject(fFile.getProject());
        for (        final ITmfProjectModelElement projectElement : project.getTracesFolder().getChildren()) {
          final String traceName=fFile.getParent().getName();
          if (projectElement.getName().equals(traceName)) {
            final TmfTraceElement traceElement=(TmfTraceElement)projectElement;
            final ITmfTrace trace=traceElement.instantiateTrace();
            final ITmfEvent traceEvent=traceElement.instantiateEvent();
            if ((trace == null) || (traceEvent == null))             throw new PartInitException(Messages.OpenTraceHandler_NoTraceType);
            try {
              trace.initTrace(traceElement.getResource(),traceElement.getLocation().getPath(),traceEvent.getClass());
            }
 catch (            final TmfTraceException e) {
            }
            fTrace=trace;
            break;
          }
        }
      }
 else {
        final TmfNavigatorContentProvider ncp=new TmfNavigatorContentProvider();
        ncp.getChildren(fFile.getProject());
        final TmfProjectElement project=TmfProjectRegistry.getProject(fFile.getProject());
        for (        final ITmfProjectModelElement projectElement : project.getTracesFolder().getChildren())         if (projectElement.getResource().equals(fFile)) {
          final TmfTraceElement traceElement=(TmfTraceElement)projectElement;
          final ITmfTrace trace=traceElement.instantiateTrace();
          final ITmfEvent traceEvent=traceElement.instantiateEvent();
          if ((trace == null) || (traceEvent == null))           throw new PartInitException(Messages.OpenTraceHandler_NoTraceType);
          try {
            trace.initTrace(traceElement.getResource(),traceElement.getLocation().getPath(),traceEvent.getClass());
          }
 catch (          final TmfTraceException e) {
          }
          fTrace=trace;
          break;
        }
      }
    }
 catch (    final InvalidRegistryObjectException e) {
      Activator.getDefault().logError("String_Node_Str",e);
    }
catch (    final CoreException e) {
      Activator.getDefault().logError("String_Node_Str",e);
    }
  }
 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(final 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 {
      final String traceTypeId=fFile.getPersistentProperty(TmfCommonConstants.TRACETYPE);
      if (traceTypeId == null)       throw new PartInitException(Messages.OpenTraceHandler_NoTraceType);
      if (traceTypeId.equals(TmfExperiment.class.getCanonicalName())) {
        final TmfNavigatorContentProvider ncp=new TmfNavigatorContentProvider();
        ncp.getChildren(fFile.getProject());
        final TmfProjectElement project=TmfProjectRegistry.getProject(fFile.getProject());
        if (project == null)         throw new PartInitException(Messages.OpenExperimentHandler_NoTraceType);
        for (        final ITmfProjectModelElement projectElement : project.getExperimentsFolder().getChildren()) {
          final String traceName=fFile.getParent().getName();
          if (projectElement.getName().equals(traceName)) {
            final TmfExperimentElement experimentElement=(TmfExperimentElement)projectElement;
            final List<TmfTraceElement> traceEntries=experimentElement.getTraces();
            final int nbTraces=traceEntries.size();
            int cacheSize=Integer.MAX_VALUE;
            final ITmfTrace<?>[] traces=new ITmfTrace[nbTraces];
            for (int i=0; i < nbTraces; i++) {
              final TmfTraceElement traceElement=traceEntries.get(i);
              final ITmfTrace trace=traceElement.instantiateTrace();
              final 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.getResource(),traceElement.getLocation().getPath(),traceEvent.getClass());
              }
 catch (              final TmfTraceException e) {
              }
              cacheSize=Math.min(cacheSize,trace.getCacheSize());
              traces[i]=trace;
            }
            final TmfExperiment experiment=new TmfExperiment(ITmfEvent.class,experimentElement.getName(),traces,cacheSize){
              @Override public void initTrace(              IResource resource,              String path,              Class type){
                super.initTrace(resource,path,type);
                getIndexer().buildIndex(getNbEvents(),TmfTimeRange.ETERNITY,false);
              }
            }
;
            experiment.setBookmarksFile(fFile);
            fTrace=experiment;
            experiment.initTrace(null,null,null);
            break;
          }
        }
      }
 else       if (traceTypeId.equals(TmfTrace.class.getCanonicalName())) {
        final TmfNavigatorContentProvider ncp=new TmfNavigatorContentProvider();
        ncp.getChildren(fFile.getProject());
        final TmfProjectElement project=TmfProjectRegistry.getProject(fFile.getProject());
        for (        final ITmfProjectModelElement projectElement : project.getTracesFolder().getChildren()) {
          final String traceName=fFile.getParent().getName();
          if (projectElement.getName().equals(traceName)) {
            final TmfTraceElement traceElement=(TmfTraceElement)projectElement;
            final ITmfTrace trace=traceElement.instantiateTrace();
            final ITmfEvent traceEvent=traceElement.instantiateEvent();
            if ((trace == null) || (traceEvent == null))             throw new PartInitException(Messages.OpenTraceHandler_NoTraceType);
            try {
              trace.initTrace(traceElement.getResource(),traceElement.getLocation().getPath(),traceEvent.getClass());
            }
 catch (            final TmfTraceException e) {
            }
            fTrace=trace;
            break;
          }
        }
      }
 else {
        final TmfNavigatorContentProvider ncp=new TmfNavigatorContentProvider();
        ncp.getChildren(fFile.getProject());
        final TmfProjectElement project=TmfProjectRegistry.getProject(fFile.getProject());
        for (        final ITmfProjectModelElement projectElement : project.getTracesFolder().getChildren())         if (projectElement.getResource().equals(fFile)) {
          final TmfTraceElement traceElement=(TmfTraceElement)projectElement;
          final ITmfTrace trace=traceElement.instantiateTrace();
          final ITmfEvent traceEvent=traceElement.instantiateEvent();
          if ((trace == null) || (traceEvent == null))           throw new PartInitException(Messages.OpenTraceHandler_NoTraceType);
          try {
            trace.initTrace(traceElement.getResource(),traceElement.getLocation().getPath(),traceEvent.getClass());
          }
 catch (          final TmfTraceException e) {
          }
          fTrace=trace;
          break;
        }
      }
    }
 catch (    final InvalidRegistryObjectException e) {
      Activator.getDefault().logError("String_Node_Str",e);
    }
catch (    final CoreException e) {
      Activator.getDefault().logError("String_Node_Str",e);
    }
  }
 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);
}