CloneSet37


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
26640.961statement_sequence[5]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
126849
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractConstantRefactoring.java
232961
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodRefactoring.java
326960
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractTempRefactoring.java
426533
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/IntroduceParameterRefactoring.java
526849
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/PromoteTempToFieldRefactoring.java
6261484
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ChangeTypeRefactoring.java
Clone Instance
1
Line Count
26
Source Line
849
Source File
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractConstantRefactoring.java

                        final String selection = extended.getAttribute(JavaRefactoringDescriptor.ATTRIBUTE_SELECTION);
                        if (selection != null) {
                                int offset = -1;
                                int length = -1;
                                final StringTokenizer tokenizer = new StringTokenizer(selection);
                                if (tokenizer.hasMoreTokens())
                                        offset = Integer.valueOf(tokenizer.nextToken()).intValue();
                                if (tokenizer.hasMoreTokens())
                                        length = Integer.valueOf(tokenizer.nextToken()).intValue();
                                if (offset >= 0 && length >= 0) {
                                        fSelectionStart = offset;
                                        fSelectionLength = length;
                                }
                                else    return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] {
                                                                                                                                                                                          selection, JavaRefactoringDescriptor.ATTRIBUTE_SELECTION
                                                                                                                                                                                        } ));
                        }
                        else    return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptor.ATTRIBUTE_SELECTION));
                        final String handle = extended.getAttribute(JavaRefactoringDescriptor.ATTRIBUTE_INPUT);
                        if (handle != null) {
                                final IJavaElement element = JavaRefactoringDescriptor.handleToElement(extended.getProject(), handle, false);
                                if (element == null || !element.exists() || element.getElementType() != IJavaElement.COMPILATION_UNIT)
                                        return createInputFatalStatus(element, ID_EXTRACT_CONSTANT);
                                else
                                        fCu = (ICompilationUnit) element;
                        }
                        else    return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptor.ATTRIBUTE_INPUT));
                        final String visibility = extended.getAttribute(ATTRIBUTE_VISIBILITY);


Clone Instance
2
Line Count
32
Source Line
961
Source File
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodRefactoring.java

                        final String selection = extended.getAttribute(JavaRefactoringDescriptor.ATTRIBUTE_SELECTION);
                        if (selection != null) {
                                int offset = -1;
                                int length = -1;
                                final StringTokenizer tokenizer = new StringTokenizer(selection);
                                if (tokenizer.hasMoreTokens())
                                        offset = Integer.valueOf(tokenizer.nextToken()).intValue();
                                if (tokenizer.hasMoreTokens())
                                        length = Integer.valueOf(tokenizer.nextToken()).intValue();
                                if (offset >= 0 && length >= 0) {
                                        fSelectionStart = offset;
                                        fSelectionLength = length;
                                }
                                else    return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] {
                                                                                                                                                                                          selection, JavaRefactoringDescriptor.ATTRIBUTE_SELECTION
                                                                                                                                                                                        } ));
                        }
                        else    return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptor.ATTRIBUTE_SELECTION));
                        final String handle = extended.getAttribute(JavaRefactoringDescriptor.ATTRIBUTE_INPUT);
                        if (handle != null) {
                                final IJavaElement element = JavaRefactoringDescriptor.handleToElement(extended.getProject(), handle, false);
                                if (element == null || !element.exists() || element.getElementType() != IJavaElement.COMPILATION_UNIT)
                                        return createInputFatalStatus(element, ID_EXTRACT_METHOD);
                                else {
                                        fCUnit = (ICompilationUnit) element;
                                try {
                                                initialize(fCUnit);
                                }         catch (CoreException exception) {
                                                JavaPlugin.log(exception);
                                          }
                                }
                        }
                        else    return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptor.ATTRIBUTE_INPUT));
                        final String visibility = extended.getAttribute(ATTRIBUTE_VISIBILITY);


Clone Instance
3
Line Count
26
Source Line
960
Source File
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractTempRefactoring.java

                        final String selection = extended.getAttribute(JavaRefactoringDescriptor.ATTRIBUTE_SELECTION);
                        if (selection != null) {
                                int offset = -1;
                                int length = -1;
                                final StringTokenizer tokenizer = new StringTokenizer(selection);
                                if (tokenizer.hasMoreTokens())
                                        offset = Integer.valueOf(tokenizer.nextToken()).intValue();
                                if (tokenizer.hasMoreTokens())
                                        length = Integer.valueOf(tokenizer.nextToken()).intValue();
                                if (offset >= 0 && length >= 0) {
                                        fSelectionStart = offset;
                                        fSelectionLength = length;
                                }
                                else    return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] {
                                                                                                                                                                                          selection, JavaRefactoringDescriptor.ATTRIBUTE_SELECTION
                                                                                                                                                                                        } ));
                        }
                        else    return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptor.ATTRIBUTE_SELECTION));
                        final String handle = extended.getAttribute(JavaRefactoringDescriptor.ATTRIBUTE_INPUT);
                        if (handle != null) {
                                final IJavaElement element = JavaRefactoringDescriptor.handleToElement(extended.getProject(), handle, false);
                                if (element == null || !element.exists() || element.getElementType() != IJavaElement.COMPILATION_UNIT)
                                        return createInputFatalStatus(element, ID_EXTRACT_TEMP);
                                else
                                        fCu = (ICompilationUnit) element;
                        }
                        else    return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptor.ATTRIBUTE_INPUT));
                        final String name = extended.getAttribute(JavaRefactoringDescriptor.ATTRIBUTE_NAME);


Clone Instance
4
Line Count
26
Source Line
533
Source File
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/IntroduceParameterRefactoring.java

                        final String selection = extended.getAttribute(JavaRefactoringDescriptor.ATTRIBUTE_SELECTION);
                        if (selection != null) {
                                int offset = -1;
                                int length = -1;
                                final StringTokenizer tokenizer = new StringTokenizer(selection);
                                if (tokenizer.hasMoreTokens())
                                        offset = Integer.valueOf(tokenizer.nextToken()).intValue();
                                if (tokenizer.hasMoreTokens())
                                        length = Integer.valueOf(tokenizer.nextToken()).intValue();
                                if (offset >= 0 && length >= 0) {
                                        fSelectionStart = offset;
                                        fSelectionLength = length;
                                }
                                else    return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] {
                                                                                                                                                                                          selection, JavaRefactoringDescriptor.ATTRIBUTE_SELECTION
                                                                                                                                                                                        } ));
                        }
                        else    return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptor.ATTRIBUTE_SELECTION));
                        final String handle = extended.getAttribute(JavaRefactoringDescriptor.ATTRIBUTE_INPUT);
                        if (handle != null) {
                                final IJavaElement element = JavaRefactoringDescriptor.handleToElement(extended.getProject(), handle, false);
                                if (element == null || !element.exists() || element.getElementType() != IJavaElement.COMPILATION_UNIT)
                                        return createInputFatalStatus(element, ID_INTRODUCE_PARAMETER);
                                else
                                        fSourceCU = ((IMethod) element).getCompilationUnit();
                        }
                        else    return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptor.ATTRIBUTE_INPUT));
                        final String name = extended.getAttribute(ATTRIBUTE_ARGUMENT);


Clone Instance
5
Line Count
26
Source Line
849
Source File
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/PromoteTempToFieldRefactoring.java

                        final String selection = extended.getAttribute(JavaRefactoringDescriptor.ATTRIBUTE_SELECTION);
                        if (selection != null) {
                                int offset = -1;
                                int length = -1;
                                final StringTokenizer tokenizer = new StringTokenizer(selection);
                                if (tokenizer.hasMoreTokens())
                                        offset = Integer.valueOf(tokenizer.nextToken()).intValue();
                                if (tokenizer.hasMoreTokens())
                                        length = Integer.valueOf(tokenizer.nextToken()).intValue();
                                if (offset >= 0 && length >= 0) {
                                        fSelectionStart = offset;
                                        fSelectionLength = length;
                                }
                                else    return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] {
                                                                                                                                                                                          selection, JavaRefactoringDescriptor.ATTRIBUTE_SELECTION
                                                                                                                                                                                        } ));
                        }
                        else    return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptor.ATTRIBUTE_SELECTION));
                        final String handle = extended.getAttribute(JavaRefactoringDescriptor.ATTRIBUTE_INPUT);
                        if (handle != null) {
                                final IJavaElement element = JavaRefactoringDescriptor.handleToElement(extended.getProject(), handle, false);
                                if (element == null || !element.exists() || element.getElementType() != IJavaElement.COMPILATION_UNIT)
                                        return createInputFatalStatus(element, ID_PROMOTE_TEMP);
                                else
                                        fCu = (ICompilationUnit) element;
                        }
                        else    return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptor.ATTRIBUTE_INPUT));
                        final String visibility = extended.getAttribute(ATTRIBUTE_VISIBILITY);


Clone Instance
6
Line Count
26
Source Line
1484
Source File
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ChangeTypeRefactoring.java

                        final String selection = extended.getAttribute(JavaRefactoringDescriptor.ATTRIBUTE_SELECTION);
                        if (selection != null) {
                                int offset = -1;
                                int length = -1;
                                final StringTokenizer tokenizer = new StringTokenizer(selection);
                                if (tokenizer.hasMoreTokens())
                                        offset = Integer.valueOf(tokenizer.nextToken()).intValue();
                                if (tokenizer.hasMoreTokens())
                                        length = Integer.valueOf(tokenizer.nextToken()).intValue();
                                if (offset >= 0 && length >= 0) {
                                        fSelectionStart = offset;
                                        fSelectionLength = length;
                                }
                                else    return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] {
                                                                                                                                                                                          selection, JavaRefactoringDescriptor.ATTRIBUTE_SELECTION
                                                                                                                                                                                        } ));
                        }
                        else    return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptor.ATTRIBUTE_SELECTION));
                        final String handle = extended.getAttribute(JavaRefactoringDescriptor.ATTRIBUTE_INPUT);
                        if (handle != null) {
                                final IJavaElement element = JavaRefactoringDescriptor.handleToElement(extended.getProject(), handle, false);
                                if (element == null || !element.exists() || element.getElementType() != IJavaElement.COMPILATION_UNIT)
                                        return createInputFatalStatus(element, ID_CHANGE_TYPE);
                                else
                                        fCu = (ICompilationUnit) element;
                        }
                        else    return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptor.ATTRIBUTE_INPUT));
                        final String type = extended.getAttribute(ATTRIBUTE_TYPE);


Clone AbstractionParameter Count: 4Parameter Bindings

final String selection = extended.getAttribute(JavaRefactoringDescriptor.ATTRIBUTE_SELECTION);
if (selection != null) {
  int offset = -1;
  int length = -1;
  final StringTokenizer tokenizer = new StringTokenizer(selection);
  if (tokenizer.hasMoreTokens())
    offset = Integer.valueOf(tokenizer.nextToken()).intValue();
  if (tokenizer.hasMoreTokens())
    length = Integer.valueOf(tokenizer.nextToken()).intValue();
  if (offset >= 0 && length >= 0) {
    fSelectionStart = offset;
    fSelectionLength = length;
  }
  else
    return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] {
                                                                                                                                                      selection,
                                                                                                                                                      JavaRefactoringDescriptor.ATTRIBUTE_SELECTION
                                                                                                                                                    } ));
}
else
  return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptor.ATTRIBUTE_SELECTION));
final String handle = extended.getAttribute(JavaRefactoringDescriptor.ATTRIBUTE_INPUT);
if (handle != null) {
  final IJavaElement element = JavaRefactoringDescriptor.handleToElement(extended.getProject(), handle, false);
  if (element == null || !element.exists() || element.getElementType() != IJavaElement.COMPILATION_UNIT)
    return createInputFatalStatus(element,  [[#variableb2bab3a0]]);
  else
     [[#variableb2bab360]]
}
else
  return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptor.ATTRIBUTE_INPUT));
final String  [[#variableb2bab3c0]]= extended.getAttribute( [[#variableb2bab500]]);
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#b2bab3a0]]
ID_CHANGE_TYPE 
12[[#b2bab3a0]]
ID_PROMOTE_TEMP 
13[[#b2bab3a0]]
ID_INTRODUCE_PARAMETER 
14[[#b2bab3a0]]
ID_EXTRACT_TEMP 
15[[#b2bab3a0]]
ID_EXTRACT_METHOD 
16[[#b2bab3a0]]
ID_EXTRACT_CONSTANT 
21[[#b2bab360]]
fCu = (ICompilationUnit) element; 
22[[#b2bab360]]
fCu = (ICompilationUnit) element; 
23[[#b2bab360]]
fSourceCU = ((IMethod) element).getCompilationUnit(); 
24[[#b2bab360]]
fCu = (ICompilationUnit) element; 
25[[#b2bab360]]
{
  fCUnit = (ICompilationUnit) element;
  try {
    initialize(fCUnit);
  }
  catch (CoreException exception) {
    JavaPlugin.log(exception);
  }
} 
26[[#b2bab360]]
fCu = (ICompilationUnit) element; 
31[[#b2bab3c0]]
type 
32[[#b2bab3c0]]
visibility 
33[[#b2bab3c0]]
name 
34[[#b2bab3c0]]
name 
35[[#b2bab3c0]]
visibility 
36[[#b2bab3c0]]
visibility 
41[[#b2bab500]]
ATTRIBUTE_TYPE 
42[[#b2bab500]]
ATTRIBUTE_VISIBILITY 
43[[#b2bab500]]
ATTRIBUTE_ARGUMENT 
44[[#b2bab500]]
JavaRefactoringDescriptor.ATTRIBUTE_NAME 
45[[#b2bab500]]
ATTRIBUTE_VISIBILITY 
46[[#b2bab500]]
ATTRIBUTE_VISIBILITY