Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
32 | 2 | 2 | 0.998 | class_body_declaration |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 32 | 949 | plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMapper.java |
2 | 32 | 1009 | plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMapper.java |
| ||||
/** * Returns the SourceRange for the name of the given element, or * {-1, -1} if no source range is known for the name of the element. */ public SourceRange getNameRange(IJavaElement element) { switch (element.getElementType()) { case IJavaElement.METHOD: if (((IMember) element).isBinary()) { IJavaElement[] el = getUnqualifiedMethodHandle((IMethod) element, false); if (el[1] != null && this.sourceRanges.get(el[0]) == null) { element = getUnqualifiedMethodHandle((IMethod) element, true)[0]; } else { element = el[0]; } } break; case IJavaElement.TYPE_PARAMETER: IJavaElement parent = element.getParent(); if (parent.getElementType() == IJavaElement.METHOD) { IMethod method = (IMethod) parent; if (method.isBinary()) { IJavaElement[] el = getUnqualifiedMethodHandle(method, false); if (el[1] != null && this.sourceRanges.get(el[0]) == null) { method = (IMethod) getUnqualifiedMethodHandle(method, true)[0]; } else { method = (IMethod) el[0]; } element = method.getTypeParameter(element.getElementName()); } } } SourceRange[] ranges = (SourceRange[]) this.sourceRanges.get(element); if (ranges == null) { return UNKNOWN_RANGE; } else { return ranges[1]; } } |
| ||||
/** * Returns the <code>SourceRange</code> for the given element, or * {-1, -1} if no source range is known for the element. */ public SourceRange getSourceRange(IJavaElement element) { switch (element.getElementType()) { case IJavaElement.METHOD: if (((IMember) element).isBinary()) { IJavaElement[] el = getUnqualifiedMethodHandle((IMethod) element, false); if (el[1] != null && this.sourceRanges.get(el[0]) == null) { element = getUnqualifiedMethodHandle((IMethod) element, true)[0]; } else { element = el[0]; } } break; case IJavaElement.TYPE_PARAMETER: IJavaElement parent = element.getParent(); if (parent.getElementType() == IJavaElement.METHOD) { IMethod method = (IMethod) parent; if (method.isBinary()) { IJavaElement[] el = getUnqualifiedMethodHandle(method, false); if (el[1] != null && this.sourceRanges.get(el[0]) == null) { method = (IMethod) getUnqualifiedMethodHandle(method, true)[0]; } else { method = (IMethod) el[0]; } element = method.getTypeParameter(element.getElementName()); } } } SourceRange[] ranges = (SourceRange[]) this.sourceRanges.get(element); if (ranges == null) { return UNKNOWN_RANGE; } else { return ranges[0]; } } |
| |||
/** * Returns the SourceRange for the name of the given element, or * {-1, -1} if no source range is known for the name of the element. */ /** * Returns the <code>SourceRange</code> for the given element, or * {-1, -1} if no source range is known for the element. */ public SourceRange [[#variablebadc1840]](IJavaElement element) { switch (element.getElementType()) { case IJavaElement.METHOD: if (((IMember) element).isBinary()) { IJavaElement[] el = getUnqualifiedMethodHandle((IMethod) element, false); if (el[1] != null && this.sourceRanges.get(el[0]) == null) { element = getUnqualifiedMethodHandle((IMethod) element, true)[0]; } else { element = el[0]; } } break; case IJavaElement.TYPE_PARAMETER: IJavaElement parent = element.getParent(); if (parent.getElementType() == IJavaElement.METHOD) { IMethod method = (IMethod) parent; if (method.isBinary()) { IJavaElement[] el = getUnqualifiedMethodHandle(method, false); if (el[1] != null && this.sourceRanges.get(el[0]) == null) { method = (IMethod) getUnqualifiedMethodHandle(method, true)[0]; } else { method = (IMethod) el[0]; } element = method.getTypeParameter(element.getElementName()); } } } SourceRange[] ranges = (SourceRange[]) this.sourceRanges.get(element); if (ranges == null) { return UNKNOWN_RANGE; } else { return ranges[ [[#variablebadc1720]]]; } } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#badc1840]] | getNameRange |
1 | 2 | [[#badc1840]] | getSourceRange |
2 | 1 | [[#badc1720]] | 1 |
2 | 2 | [[#badc1720]] | 0 |