CloneSet246


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
35201.000statement_sequence[2]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
135732
plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SelectionRequestor.java
235812
plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SelectionRequestor.java
Clone Instance
1
Line Count
35
Source Line
732
Source File
plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SelectionRequestor.java

        if (type == null) {
                IPackageFragment[] pkgs = this.nameLookup.findPackageFragments(
                        (packageName == null || packageName.length == 0) ? IPackageFragment.DEFAULT_PACKAGE_NAME:  new String(packageName), 
                        false                                                 );
                // iterate type lookup in each package fragment
                for (int i = 0, length = pkgs == null ? 0:  pkgs.length; i < length; i++) {
                        type = this.nameLookup.findType(new String(typeName), pkgs[i], false, acceptFlags, true
                                                                                                               /*consider secondary types*/
                                                                                                               );
                        if (type != null) break;
                }
                if (type == null) {
                        String pName = IPackageFragment.DEFAULT_PACKAGE_NAME;
                        if (packageName != null) {
                                pName = new String(packageName);
                        }
                        if (this.openable != null && this.openable.getParent().getElementName().equals(pName)) {
                                // look inside the type in which we are resolving in
                                String tName = new String(typeName);
                                tName = tName.replace('.', '$');
                                IType[] allTypes = null;
                                try {
                                        ArrayList list = this.openable.getChildrenOfType(IJavaElement.TYPE);
                                        allTypes = new IType[list.size()];
                                        list.toArray(allTypes);
                                } catch (JavaModelException e) {
                                        return null;
                                  }
                                for (int i = 0; i < allTypes.length; i++) {
                                        if (allTypes[i].getTypeQualifiedName().equals(tName)) {
                                                return allTypes[i];
                                        }
                                }
                        }
                }
        }
        return type;


Clone Instance
2
Line Count
35
Source Line
812
Source File
plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SelectionRequestor.java

        if (type == null) {
                IPackageFragment[] pkgs = this.nameLookup.findPackageFragments(
                        (packageName == null || packageName.length == 0) ? IPackageFragment.DEFAULT_PACKAGE_NAME:  new String(packageName), 
                        false                                                 );
                // iterate type lookup in each package fragment
                for (int i = 0, length = pkgs == null ? 0:  pkgs.length; i < length; i++) {
                        type = this.nameLookup.findType(new String(typeName), pkgs[i], false, acceptFlags, true
                                                                                                               /*consider secondary types*/
                                                                                                               );
                        if (type != null) break;
                }
                if (type == null) {
                        String pName = IPackageFragment.DEFAULT_PACKAGE_NAME;
                        if (packageName != null) {
                                pName = new String(packageName);
                        }
                        if (this.openable != null && this.openable.getParent().getElementName().equals(pName)) {
                                // look inside the type in which we are resolving in
                                String tName = new String(typeName);
                                tName = tName.replace('.', '$');
                                IType[] allTypes = null;
                                try {
                                        ArrayList list = this.openable.getChildrenOfType(IJavaElement.TYPE);
                                        allTypes = new IType[list.size()];
                                        list.toArray(allTypes);
                                } catch (JavaModelException e) {
                                        return null;
                                  }
                                for (int i = 0; i < allTypes.length; i++) {
                                        if (allTypes[i].getTypeQualifiedName().equals(tName)) {
                                                return allTypes[i];
                                        }
                                }
                        }
                }
        }
        return type;


Clone AbstractionParameter Count: 0Parameter Bindings

if (type == null) {
  IPackageFragment[] pkgs = this.nameLookup.findPackageFragments((packageName == null || packageName.length == 0) ? IPackageFragment.DEFAULT_PACKAGE_NAME: new String(packageName), false);
  // iterate type lookup in each package fragment
  for (int i = 0, length = pkgs == null ? 0: pkgs.length; i < length; i++) {
    type = this.nameLookup.findType(new String(typeName), pkgs[i], false, acceptFlags, true
                                                                                           /*consider secondary types*/
                                                                                           );
    if (type != null)
      break;
  }
  if (type == null) {
    String pName = IPackageFragment.DEFAULT_PACKAGE_NAME;
    if (packageName != null) {
      pName = new String(packageName);
    }
    if (this.openable != null && this.openable.getParent().getElementName().equals(pName)) {
      // look inside the type in which we are resolving in
      String tName = new String(typeName);
      tName = tName.replace('.', '$');
      IType[] allTypes = null;
      try {
        ArrayList list = this.openable.getChildrenOfType(IJavaElement.TYPE);
        allTypes = new IType[list.size()];
        list.toArray(allTypes);
      }
      catch (JavaModelException e) {
        return null;
      }
      for (int i = 0; i < allTypes.length; i++) {
        if (allTypes[i].getTypeQualifiedName().equals(tName)) {
          return allTypes[i];
        }
      }
    }
  }
}
return type;
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
None