CloneSet797


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
38210.995class_body_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
138270
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaAddElementFromHistoryImpl.java
238106
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaTextBufferNode.java
Clone Instance
1
Line Count
38
Source Line
270
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaAddElementFromHistoryImpl.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;
        }


Clone Instance
2
Line Count
38
Source Line
106
Source File
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
         */
        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;
        }


Clone AbstractionParameter Count: 1Parameter Bindings

 [[#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 Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#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 
12[[#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