| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 38 | 2 | 1 | 0.995 | class_body_declaration |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 38 | 270 | plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaAddElementFromHistoryImpl.java |
| 2 | 38 | 106 | plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaTextBufferNode.java |
| ||||
/**
* Returns the corresponding place holder type for the given element.
* @return a place holder type (see ASTRewrite) or -1 if there is no corresponding placeholder
*/
private int getPlaceHolderType(ITypedElement element) {
if (element instanceof DocumentRangeNode) {
JavaNode jn = (JavaNode) element;
switch (jn.getTypeCode()) {
case JavaNode.PACKAGE:
return ASTNode.PACKAGE_DECLARATION;
case JavaNode.CLASS:
case JavaNode.INTERFACE:
return ASTNode.TYPE_DECLARATION;
case JavaNode.ENUM:
return ASTNode.ENUM_DECLARATION;
case JavaNode.ANNOTATION:
return ASTNode.ANNOTATION_TYPE_DECLARATION;
case JavaNode.CONSTRUCTOR:
case JavaNode.METHOD:
return ASTNode.METHOD_DECLARATION;
case JavaNode.FIELD:
return ASTNode.FIELD_DECLARATION;
case JavaNode.INIT:
return ASTNode.INITIALIZER;
case JavaNode.IMPORT:
case JavaNode.IMPORT_CONTAINER:
return ASTNode.IMPORT_DECLARATION;
case JavaNode.CU:
return ASTNode.COMPILATION_UNIT;
}
}
return -1;
}
|
| ||||
/**
* Returns the corresponding place holder type for the given element.
* @return a place holder type (see ASTRewrite) or -1 if there is no corresponding placeholder
*/
static final int getPlaceHolderType(ITypedElement element) {
if (element instanceof DocumentRangeNode) {
JavaNode jn = (JavaNode) element;
switch (jn.getTypeCode()) {
case JavaNode.PACKAGE:
return ASTNode.PACKAGE_DECLARATION;
case JavaNode.CLASS:
case JavaNode.INTERFACE:
return ASTNode.TYPE_DECLARATION;
case JavaNode.ENUM:
return ASTNode.ENUM_DECLARATION;
case JavaNode.ANNOTATION:
return ASTNode.ANNOTATION_TYPE_DECLARATION;
case JavaNode.CONSTRUCTOR:
case JavaNode.METHOD:
return ASTNode.METHOD_DECLARATION;
case JavaNode.FIELD:
return ASTNode.FIELD_DECLARATION;
case JavaNode.INIT:
return ASTNode.INITIALIZER;
case JavaNode.IMPORT:
case JavaNode.IMPORT_CONTAINER:
return ASTNode.IMPORT_DECLARATION;
case JavaNode.CU:
return ASTNode.COMPILATION_UNIT;
}
}
return -1;
}
|
| |||
[[#variablebe4cf3a0]]int getPlaceHolderType(ITypedElement element) {
if (element instanceof DocumentRangeNode) {
JavaNode jn = (JavaNode) element;
switch (jn.getTypeCode()) {
case JavaNode.PACKAGE:
return ASTNode.PACKAGE_DECLARATION;
case JavaNode.CLASS:
case JavaNode.INTERFACE:
return ASTNode.TYPE_DECLARATION;
case JavaNode.ENUM:
return ASTNode.ENUM_DECLARATION;
case JavaNode.ANNOTATION:
return ASTNode.ANNOTATION_TYPE_DECLARATION;
case JavaNode.CONSTRUCTOR:
case JavaNode.METHOD:
return ASTNode.METHOD_DECLARATION;
case JavaNode.FIELD:
return ASTNode.FIELD_DECLARATION;
case JavaNode.INIT:
return ASTNode.INITIALIZER;
case JavaNode.IMPORT:
case JavaNode.IMPORT_CONTAINER:
return ASTNode.IMPORT_DECLARATION;
case JavaNode.CU:
return ASTNode.COMPILATION_UNIT;
}
}
return -1;
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#be4cf3a0]] | /** * Returns the corresponding place holder type for the given element. * @return a place holder type (see ASTRewrite) or -1 if there is no corresponding placeholder */ static final |
| 1 | 2 | [[#be4cf3a0]] | /** * Returns the corresponding place holder type for the given element. * @return a place holder type (see ASTRewrite) or -1 if there is no corresponding placeholder */ private |