Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
6 | 2 | 2 | 0.976 | class_body_declarations[2] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 6 | 39 | plugins/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/actions/RefactoringActions.java |
2 | 6 | 67 | plugins/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/actions/RefactoringActions.java |
| ||||
/** * Converts the given selection into a type using the following rules: * <ul> * <li>if the selection is enclosed by a type than that type is returned.</li> * <li>if the selection is inside a compilaiton unit or class file than the * primary type is returned.</li> * <li>otherwise <code>null</code> is returned. * </ul> */ public static IType getEnclosingOrPrimaryType(JavaTextSelection selection) throws JavaModelException { return convertToEnclosingOrPrimaryType(selection.resolveEnclosingElement()); } public static IType getEnclosingOrPrimaryType(JavaEditor editor) throws JavaModelException { return convertToEnclosingOrPrimaryType(SelectionConverter.resolveEnclosingElement( editor, (ITextSelection) editor.getSelectionProvider().getSelection() )); } |
| ||||
/** * Converts the given selection into a type using the following rules: * <ul> * <li>if the selection is enclosed by a type than that type is returned.</li> * <li>otherwise <code>null</code> is returned. * </ul> */ public static IType getEnclosingType(JavaTextSelection selection) throws JavaModelException { return convertToEnclosingType(selection.resolveEnclosingElement()); } public static IType getEnclosingType(JavaEditor editor) throws JavaModelException { return convertToEnclosingType(SelectionConverter.resolveEnclosingElement( editor, (ITextSelection) editor.getSelectionProvider().getSelection())); } |
| |||
/** * Converts the given selection into a type using the following rules: * <ul> * <li>if the selection is enclosed by a type than that type is returned.</li> * <li>otherwise <code>null</code> is returned. * </ul> */ /** * Converts the given selection into a type using the following rules: * <ul> * <li>if the selection is enclosed by a type than that type is returned.</li> * <li>if the selection is inside a compilaiton unit or class file than the * primary type is returned.</li> * <li>otherwise <code>null</code> is returned. * </ul> */ public static IType [[#variableb41f6c40]](JavaTextSelection selection) throws JavaModelException { return [[#variableb08e6680]](selection.resolveEnclosingElement()); } public static IType [[#variableb41f6c40]](JavaEditor editor) throws JavaModelException { return [[#variableb08e6680]](SelectionConverter.resolveEnclosingElement(editor, (ITextSelection) editor.getSelectionProvider().getSelection())); } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#b41f6c40]] | getEnclosingType |
1 | 2 | [[#b41f6c40]] | getEnclosingOrPrimaryType |
2 | 1 | [[#b08e6680]] | convertToEnclosingType |
2 | 2 | [[#b08e6680]] | convertToEnclosingOrPrimaryType |