CloneSet715


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
33201.000class_body_declarations[2]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
133829
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/SemanticHighlightings.java
2331122
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/SemanticHighlightings.java
Clone Instance
1
Line Count
33
Source Line
829
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/SemanticHighlightings.java

                /**
                 * Extracts the method binding from the token's simple name. The method
                 * binding is either the token's binding (if the parent of token is a
                 * method call or declaration) or the constructor binding of a class
                 * instance creation if the node is the type name of a class instance
                 * creation.
                 *
                 * @param token the token to extract the method binding from
                 * @return the corresponding method binding, or <code>null</code>
                 */
                private IBinding getMethodBinding(SemanticToken token) {
                        IBinding binding = null;
                        // work around: https://bugs.eclipse.org/bugs/show_bug.cgi?id=62605
                        ASTNode node = token.getNode();
                        ASTNode parent = node.getParent();
                        while (isTypePath(node, parent)) {
                                node = parent;
                                parent = parent.getParent();
                        }

                        if (parent != null && node.getLocationInParent() == ClassInstanceCreation.TYPE_PROPERTY)
                                binding = ((ClassInstanceCreation) parent).resolveConstructorBinding();
                        else
                                binding = token.getBinding();
                        return binding;
                }

                /**
                 * Returns <code>true</code> if the given child/parent nodes are valid
                 * sub nodes of a <code>Type</code> ASTNode.
                 * @param child the child node
                 * @param parent the parent node
                 * @return <code>true</code> if the nodes may be the sub nodes of a type node, false otherwise
                 */
                private boolean isTypePath(ASTNode child, ASTNode parent) {
                        if (parent instanceof Type) {
                                StructuralPropertyDescriptor location = child.getLocationInParent();
                                return location == ParameterizedType.TYPE_PROPERTY || location == SimpleType.NAME_PROPERTY;
                        }
                        else   if (parent instanceof QualifiedName) {
                                StructuralPropertyDescriptor location = child.getLocationInParent();
                                return location == QualifiedName.NAME_PROPERTY;
                               }
                        return false;
                }


Clone Instance
2
Line Count
33
Source Line
1122
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/SemanticHighlightings.java

                /**
                 * Extracts the method binding from the token's simple name. The method
                 * binding is either the token's binding (if the parent of token is a
                 * method call or declaration) or the constructor binding of a class
                 * instance creation if the node is the type name of a class instance
                 * creation.
                 *
                 * @param token the token to extract the method binding from
                 * @return the corresponding method binding, or <code>null</code>
                 */
                private IBinding getMethodBinding(SemanticToken token) {
                        IBinding binding = null;
                        // work around: https://bugs.eclipse.org/bugs/show_bug.cgi?id=62605
                        ASTNode node = token.getNode();
                        ASTNode parent = node.getParent();
                        while (isTypePath(node, parent)) {
                                node = parent;
                                parent = parent.getParent();
                        }

                        if (parent != null && node.getLocationInParent() == ClassInstanceCreation.TYPE_PROPERTY)
                                binding = ((ClassInstanceCreation) parent).resolveConstructorBinding();
                        else
                                binding = token.getBinding();
                        return binding;
                }

                /**
                 * Returns <code>true</code> if the given child/parent nodes are valid
                 * sub nodes of a <code>Type</code> ASTNode.
                 * @param child the child node
                 * @param parent the parent node
                 * @return <code>true</code> if the nodes may be the sub nodes of a type node, false otherwise
                 */
                private boolean isTypePath(ASTNode child, ASTNode parent) {
                        if (parent instanceof Type) {
                                StructuralPropertyDescriptor location = child.getLocationInParent();
                                return location == ParameterizedType.TYPE_PROPERTY || location == SimpleType.NAME_PROPERTY;
                        }
                        else   if (parent instanceof QualifiedName) {
                                StructuralPropertyDescriptor location = child.getLocationInParent();
                                return location == QualifiedName.NAME_PROPERTY;
                               }
                        return false;
                }


Clone AbstractionParameter Count: 0Parameter Bindings

/**
                 * Extracts the method binding from the token's simple name. The method
                 * binding is either the token's binding (if the parent of token is a
                 * method call or declaration) or the constructor binding of a class
                 * instance creation if the node is the type name of a class instance
                 * creation.
                 *
                 * @param token the token to extract the method binding from
                 * @return the corresponding method binding, or <code>null</code>
                 */
private IBinding getMethodBinding(SemanticToken token) {
  IBinding binding = null;
  // work around: https://bugs.eclipse.org/bugs/show_bug.cgi?id=62605
  ASTNode node = token.getNode();
  ASTNode parent = node.getParent();
  while (isTypePath(node, parent)) {
    node = parent;
    parent = parent.getParent();
  }
  if (parent != null && node.getLocationInParent() == ClassInstanceCreation.TYPE_PROPERTY)
    binding = ((ClassInstanceCreation) parent).resolveConstructorBinding();
  else
    binding = token.getBinding();
  return binding;
}

/**
                 * Returns <code>true</code> if the given child/parent nodes are valid
                 * sub nodes of a <code>Type</code> ASTNode.
                 * @param child the child node
                 * @param parent the parent node
                 * @return <code>true</code> if the nodes may be the sub nodes of a type node, false otherwise
                 */
private boolean isTypePath(ASTNode child, ASTNode parent) {
  if (parent instanceof Type) {
    StructuralPropertyDescriptor location = child.getLocationInParent();
    return location == ParameterizedType.TYPE_PROPERTY || location == SimpleType.NAME_PROPERTY;
  }
  else
    if (parent instanceof QualifiedName) {
      StructuralPropertyDescriptor location = child.getLocationInParent();
      return location == QualifiedName.NAME_PROPERTY;
    }
  return false;
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
None