CloneSet1014


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
28260.970class_body_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
128328
plugins/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/ExceptionFilterEditor.java
228580
plugins/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/JUnitPreferencePage.java
Clone Instance
1
Line Count
28
Source Line
328
Source File
plugins/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/ExceptionFilterEditor.java

        private void validateChangeAndCleanup() {
                String trimmedValue = fEditorText.getText().trim();
                // if the new value is blank, remove the filter
                if (trimmedValue.length() < 1) {
                        removeNewFilter();
                }
                // if it's invalid, beep and leave sitting in the editor
                else if ( !validateEditorInput(trimmedValue)) {
                        fInvalidEditorText = trimmedValue;
                        fEditorText.setText(PropertyPageMessages.ExceptionFilterEditor_14);
                        fEditorText.getDisplay().beep();
                        return;
                        // otherwise, commit the new value if not a duplicate
                     }
                     else {
                        Object[] filters = fFilterContentProvider.getElements(null);
                        for (int i = 0; i < filters.length; i++) {
                                Filter filter = (Filter) filters[i];
                                if (filter.getName().equals(trimmedValue)) {
                                        removeNewFilter();
                                        cleanupEditor();
                                        return;
                                }
                        }
                        fNewTableItem.setText(trimmedValue);
                        fNewFilter.setName(trimmedValue);
                        fFilterViewer.refresh();
                     }
                cleanupEditor();
        }


Clone Instance
2
Line Count
28
Source Line
580
Source File
plugins/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/JUnitPreferencePage.java

        private void validateChangeAndCleanup() {
                String trimmedValue = fEditorText.getText().trim();
                // if the new value is blank, remove the filter
                if (trimmedValue.length() < 1)
                        removeNewFilter();

                // if it's invalid, beep and leave sitting in the editor
                else if ( !validateEditorInput(trimmedValue)) {
                        fInvalidEditorText = trimmedValue;
                        fEditorText.setText(JUnitMessages.JUnitPreferencePage_invalidstepfilterreturnescape);
                        getShell().getDisplay().beep();
                        return;
                        // otherwise, commit the new value if not a duplicate
                     }
                     else {
                        Object[] filters = fStackFilterContentProvider.getElements(null);
                        for (int i = 0; i < filters.length; i++) {
                                Filter filter = (Filter) filters[i];
                                if (filter.getName().equals(trimmedValue)) {
                                        removeNewFilter();
                                        cleanupEditor();
                                        return;
                                }
                        }
                        fNewTableItem.setText(trimmedValue);
                        fNewStackFilter.setName(trimmedValue);
                        fFilterViewer.refresh();
                     }
                cleanupEditor();
        }


Clone AbstractionParameter Count: 6Parameter Bindings

private void validateChangeAndCleanup() {
  String trimmedValue = fEditorText.getText().trim();
  // if the new value is blank, remove the filter
  if (trimmedValue.length() < 1)
     [[#variableba97d600]]
  // if it's invalid, beep and leave sitting in the editor
  else
    if ( !validateEditorInput(trimmedValue)) {
      fInvalidEditorText = trimmedValue;
      fEditorText.setText( [[#variableba97d5a0]]. [[#variableba97d520]]);
       [[#variableba97d480]].getDisplay().beep();
      return;
    // otherwise, commit the new value if not a duplicate
    }
    else {
      Object[] filters = [[#variableba97d3c0]].getElements(null);
      for (int i = 0; i < filters.length; i++) {
        Filter filter = (Filter) filters[i];
        if (filter.getName().equals(trimmedValue)) {
          removeNewFilter();
          cleanupEditor();
          return;
        }
      }
      fNewTableItem.setText(trimmedValue);
       [[#variableba97d2e0]].setName(trimmedValue);
      fFilterViewer.refresh();
    }
  cleanupEditor();
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#ba97d600]]
removeNewFilter(); 
12[[#ba97d600]]
{
  removeNewFilter();
} 
21[[#ba97d5a0]]
JUnitMessages 
22[[#ba97d5a0]]
PropertyPageMessages 
31[[#ba97d520]]
JUnitPreferencePage_invalidstepfilterreturnescape 
32[[#ba97d520]]
ExceptionFilterEditor_14 
41[[#ba97d480]]
getShell() 
42[[#ba97d480]]
fEditorText 
51[[#ba97d3c0]]
fStackFilterContentProvider 
52[[#ba97d3c0]]
fFilterContentProvider 
61[[#ba97d2e0]]
fNewStackFilter 
62[[#ba97d2e0]]
fNewFilter