Program: 137681
Project: 137681
Buggy source:
public void selectionChanged(IWorkbenchPart part,ISelection selection){
  clearContainer();
  boolean isNeedcreateDefault=true;
  try {
    if (part instanceof DQRespositoryView) {
      if (selection.equals(currentSelection)) {
        return;
      }
 else {
        currentSelection=selection;
      }
      StructuredSelection sel=(StructuredSelection)selection;
      Object fe=sel.getFirstElement();
      if (fe instanceof AnalysisRepNode || fe instanceof ReportRepNode || fe instanceof SysIndicatorDefinitionRepNode|| fe instanceof PatternRepNode|| fe instanceof RuleRepNode) {
        fe=((IRepositoryNode)fe).getObject();
      }
      if (fe instanceof IFile) {
        IFile fe2=(IFile)fe;
        isNeedcreateDefault=createFileDetail(isNeedcreateDefault,fe2);
      }
 else       if (fe instanceof IRepositoryViewObject) {
        isNeedcreateDefault=createFileDetail(isNeedcreateDefault,(IRepositoryViewObject)fe);
      }
 else       if (fe instanceof DBConnectionRepNode) {
        DBConnectionRepNode connNode=(DBConnectionRepNode)fe;
        ConnectionItem connectionItem=(ConnectionItem)connNode.getObject().getProperty().getItem();
        createDataProviderDetail(connectionItem);
        isNeedcreateDefault=false;
      }
 else       if (fe instanceof DBCatalogRepNode) {
        DBCatalogRepNode catalogNode=(DBCatalogRepNode)fe;
        Catalog catalog=catalogNode.getCatalog();
        createTdCatalogDetail(catalog);
        isNeedcreateDefault=false;
      }
 else       if (fe instanceof DBSchemaRepNode) {
        DBSchemaRepNode schemaNode=(DBSchemaRepNode)fe;
        Schema schema=schemaNode.getSchema();
        createTdSchemaDetail(schema);
        isNeedcreateDefault=false;
      }
 else       if (fe instanceof DBTableRepNode) {
        DBTableRepNode tableNode=(DBTableRepNode)fe;
        if (!DQRepositoryNode.isOnFilterring()) {
          tableNode.getChildren().get(0).getChildren();
        }
        TdTable tdTable=tableNode.getTdTable();
        createTableDetail(tdTable);
        isNeedcreateDefault=false;
      }
 else       if (fe instanceof DBViewRepNode) {
        DBViewRepNode viewNode=(DBViewRepNode)fe;
        if (!DQRepositoryNode.isOnFilterring()) {
          viewNode.getChildren().get(0).getChildren();
        }
        createNameCommentDetail(viewNode.getTdView());
        isNeedcreateDefault=false;
      }
 else       if (fe instanceof DBColumnRepNode) {
        DBColumnRepNode columnNode=(DBColumnRepNode)fe;
        TdColumn column=columnNode.getTdColumn();
        createTdColumn(column);
        isNeedcreateDefault=false;
      }
 else       if (fe instanceof IEcosComponent) {
        IEcosComponent component=(IEcosComponent)fe;
        createEcosComponent(component);
        isNeedcreateDefault=false;
      }
 else       if (fe instanceof RegularExpression) {
        RegularExpression regularExpression=(RegularExpression)fe;
        createRegularExpression(regularExpression);
        isNeedcreateDefault=false;
      }
 else       if (fe instanceof PatternLanguageRepNode) {
        PatternLanguageRepNode pattLangNode=(PatternLanguageRepNode)fe;
        createRegularExpression(pattLangNode.getRegularExpression());
        isNeedcreateDefault=false;
      }
 else       if (fe instanceof SourceFileRepNode) {
        IPath filePath=WorkbenchUtils.getFilePath((SourceFileRepNode)fe);
        IFile file=ResourceManager.getRootProject().getFile(filePath);
        createSqlFileDetail(file);
      }
 else       if (fe instanceof ExchangeComponentRepNode) {
        IEcosComponent ecosComponent=((ExchangeComponentRepNode)fe).getEcosComponent();
        IEcosComponent component=ecosComponent;
        createEcosComponent(component);
        isNeedcreateDefault=false;
      }
 else       if (fe instanceof MDMConnectionRepNode) {
        MDMConnectionRepNode mdmNode=(MDMConnectionRepNode)fe;
        MDMConnection mdmConnection=mdmNode.getMdmConnection();
        createDataProviderDetail(mdmConnection);
        isNeedcreateDefault=false;
      }
 else       if (fe instanceof DFConnectionRepNode) {
        DFConnectionRepNode dfNode=(DFConnectionRepNode)fe;
        DelimitedFileConnection dfConnection=dfNode.getDfConnection();
        createDFconnectionName(dfNode.getObject().getLabel());
        createDataProviderDetail(dfConnection);
        isNeedcreateDefault=false;
      }
      if (PluginChecker.isTDQLoaded()) {
        if (fe instanceof EObject) {
          createTechnicalDetail((EObject)fe);
        }
 else         if (fe instanceof IFile) {
          createTechnicalDetail((IFile)fe);
        }
 else         if (fe instanceof IRepositoryViewObject) {
          createTechnicalDetail((IRepositoryViewObject)fe);
        }
 else {
          createExtDefault();
        }
      }
      if (!scomp.isDisposed()) {
        scomp.setMinSize(composite.computeSize(SWT.DEFAULT,SWT.DEFAULT));
        composite.layout();
      }
    }
 else     if (part instanceof CommonFormEditor) {
      CommonFormEditor editor=(CommonFormEditor)part;
      IEditorInput editorInput=editor.getEditorInput();
      if (editorInput instanceof IFileEditorInput) {
        IFileEditorInput input=(IFileEditorInput)editorInput;
        IFile file=input.getFile();
        isNeedcreateDefault=createFileDetail(isNeedcreateDefault,file);
      }
    }
    if (isNeedcreateDefault) {
      createDefault();
    }
    if (!gContainer.isDisposed()) {
      gContainer.layout();
      if (tContainer != null) {
        tContainer.layout();
      }
    }
  }
 catch (  RuntimeException e) {
    int indexOf=e.getMessage().indexOf("String_Node_Str");
    if (indexOf > 0 && PluginChecker.isOnlyTopLoaded()) {
      String errorMessage=e.getMessage().substring(indexOf);
      MessageDialog.openWarning(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),DefaultMessagesImpl.getString("String_Node_Str"),errorMessage);
    }
 else {
      log.error(e);
    }
  }
}

Fixed version (ground truth):
public void selectionChanged(IWorkbenchPart part,ISelection selection){
  clearContainer();
  boolean isNeedcreateDefault=true;
  try {
    if (part instanceof DQRespositoryView) {
      if (selection.equals(currentSelection)) {
        return;
      }
 else {
        currentSelection=selection;
      }
      StructuredSelection sel=(StructuredSelection)selection;
      Object fe=sel.getFirstElement();
      if (fe instanceof AnalysisRepNode || fe instanceof ReportRepNode || fe instanceof SysIndicatorDefinitionRepNode|| fe instanceof PatternRepNode|| fe instanceof RuleRepNode) {
        fe=((IRepositoryNode)fe).getObject();
      }
      if (fe instanceof IFile) {
        IFile fe2=(IFile)fe;
        isNeedcreateDefault=createFileDetail(isNeedcreateDefault,fe2);
      }
 else       if (fe instanceof IRepositoryViewObject) {
        isNeedcreateDefault=createFileDetail(isNeedcreateDefault,(IRepositoryViewObject)fe);
      }
 else       if (fe instanceof DBConnectionRepNode) {
        DBConnectionRepNode connNode=(DBConnectionRepNode)fe;
        ConnectionItem connectionItem=(ConnectionItem)connNode.getObject().getProperty().getItem();
        createDataProviderDetail(connectionItem);
        isNeedcreateDefault=false;
      }
 else       if (fe instanceof DBCatalogRepNode) {
        DBCatalogRepNode catalogNode=(DBCatalogRepNode)fe;
        Catalog catalog=catalogNode.getCatalog();
        createTdCatalogDetail(catalog);
        isNeedcreateDefault=false;
      }
 else       if (fe instanceof DBSchemaRepNode) {
        DBSchemaRepNode schemaNode=(DBSchemaRepNode)fe;
        Schema schema=schemaNode.getSchema();
        createTdSchemaDetail(schema);
        isNeedcreateDefault=false;
      }
 else       if (fe instanceof DBTableRepNode) {
        DBTableRepNode tableNode=(DBTableRepNode)fe;
        if (!DQRepositoryNode.isOnFilterring()) {
          tableNode.getChildren().get(0).getChildren();
        }
        TdTable tdTable=tableNode.getTdTable();
        createTableDetail(tdTable);
        isNeedcreateDefault=false;
      }
 else       if (fe instanceof DBViewRepNode) {
        DBViewRepNode viewNode=(DBViewRepNode)fe;
        if (!DQRepositoryNode.isOnFilterring()) {
          viewNode.getChildren().get(0).getChildren();
        }
        createNameCommentDetail(viewNode.getTdView());
        isNeedcreateDefault=false;
      }
 else       if (fe instanceof DBColumnRepNode) {
        DBColumnRepNode columnNode=(DBColumnRepNode)fe;
        TdColumn column=columnNode.getTdColumn();
        createTdColumn(column);
        isNeedcreateDefault=false;
      }
 else       if (fe instanceof IEcosComponent) {
        IEcosComponent component=(IEcosComponent)fe;
        createEcosComponent(component);
        isNeedcreateDefault=false;
      }
 else       if (fe instanceof RegularExpression) {
        RegularExpression regularExpression=(RegularExpression)fe;
        createRegularExpression(regularExpression);
        isNeedcreateDefault=false;
      }
 else       if (fe instanceof PatternLanguageRepNode) {
        PatternLanguageRepNode pattLangNode=(PatternLanguageRepNode)fe;
        createRegularExpression(pattLangNode.getRegularExpression());
        isNeedcreateDefault=false;
      }
 else       if (fe instanceof SourceFileRepNode) {
        IPath filePath=WorkbenchUtils.getFilePath((SourceFileRepNode)fe);
        IFile file=ResourceManager.getRootProject().getFile(filePath);
        createSqlFileDetail(file);
      }
 else       if (fe instanceof ExchangeComponentRepNode) {
        IEcosComponent ecosComponent=((ExchangeComponentRepNode)fe).getEcosComponent();
        IEcosComponent component=ecosComponent;
        createEcosComponent(component);
        isNeedcreateDefault=false;
      }
 else       if (fe instanceof MDMConnectionRepNode) {
        MDMConnectionRepNode mdmNode=(MDMConnectionRepNode)fe;
        MDMConnection mdmConnection=mdmNode.getMdmConnection();
        createDataProviderDetail(mdmConnection);
        isNeedcreateDefault=false;
      }
 else       if (fe instanceof DFConnectionRepNode) {
        DFConnectionRepNode dfNode=(DFConnectionRepNode)fe;
        DelimitedFileConnection dfConnection=dfNode.getDfConnection();
        createDFconnectionName(dfNode.getObject().getLabel());
        createDataProviderDetail(dfConnection);
        isNeedcreateDefault=false;
      }
      if (PluginChecker.isTDQLoaded()) {
        if (fe instanceof EObject) {
          createTechnicalDetail((EObject)fe);
        }
 else         if (fe instanceof IFile) {
          createTechnicalDetail((IFile)fe);
        }
 else         if (fe instanceof IRepositoryViewObject) {
          createTechnicalDetail((IRepositoryViewObject)fe);
        }
 else {
          createExtDefault();
        }
      }
      if (!scomp.isDisposed()) {
        scomp.setMinSize(composite.computeSize(SWT.DEFAULT,SWT.DEFAULT));
        composite.layout();
      }
    }
 else     if (part instanceof CommonFormEditor) {
      CommonFormEditor editor=(CommonFormEditor)part;
      IEditorInput editorInput=editor.getEditorInput();
      if (editorInput instanceof IFileEditorInput) {
        IFileEditorInput input=(IFileEditorInput)editorInput;
        IFile file=input.getFile();
        isNeedcreateDefault=createFileDetail(isNeedcreateDefault,file);
      }
    }
    if (isNeedcreateDefault) {
      createDefault();
    }
    if (!gContainer.isDisposed()) {
      gContainer.layout();
      if (tContainer != null) {
        tContainer.layout();
      }
    }
  }
 catch (  MissingDriverException e) {
    if (PluginChecker.isOnlyTopLoaded()) {
      MessageDialog.openWarning(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),DefaultMessagesImpl.getString("String_Node_Str"),e.getErrorMessage());
    }
 else {
      log.error(e,e);
    }
  }
}