CloneSet290


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
29350.959switch_group
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
129790
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MemberVisibilityAdjustor.java
229820
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MemberVisibilityAdjustor.java
329850
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MemberVisibilityAdjustor.java
Clone Instance
1
Line Count
29
Source Line
790
Source File
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MemberVisibilityAdjustor.java

                                case IJavaElement.TYPE: {
                                        final IType typeReferenced = (IType) referenced;
                                        final ICompilationUnit referencedUnit = typeReferenced.getCompilationUnit();
                                        switch (referencingType) {
                                                case IJavaElement.TYPE: {
                                                        keyword = thresholdTypeToType((IType) referencing, typeReferenced, monitor);
                                                        break;
                                                                        }
                                                case IJavaElement.FIELD:
                                                case IJavaElement.METHOD: {
                                                        final IMember member = (IMember) referencing;
                                                        if (typeReferenced.equals(member.getDeclaringType()))
                                                                keyword = ModifierKeyword.PRIVATE_KEYWORD;
                                                        else if (referencedUnit != null && referencedUnit.equals(member.getCompilationUnit()))
                                                                keyword = ModifierKeyword.PRIVATE_KEYWORD;
                                                             else
                                                             if (typeReferenced.getPackageFragment().equals(member.getDeclaringType().getPackageFragment()))
                                                                keyword = null;
                                                        break;
                                                                          }
                                                case IJavaElement.PACKAGE_FRAGMENT: {
                                                        final IPackageFragment fragment = (IPackageFragment) referencing;
                                                        if (typeReferenced.getPackageFragment().equals(fragment))
                                                                keyword = null;
                                                        break;
                                                                                    }
                                                default:
                                                        Assert.isTrue(false);
                                              }
                                        break;
                                                        }


Clone Instance
2
Line Count
29
Source Line
820
Source File
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MemberVisibilityAdjustor.java

                                case IJavaElement.FIELD: {
                                        final IField fieldReferenced = (IField) referenced;
                                        final ICompilationUnit referencedUnit = fieldReferenced.getCompilationUnit();
                                        switch (referencingType) {
                                                case IJavaElement.TYPE: {
                                                        keyword = thresholdTypeToField((IType) referencing, fieldReferenced, monitor);
                                                        break;
                                                                        }
                                                case IJavaElement.FIELD:
                                                case IJavaElement.METHOD: {
                                                        final IMember member = (IMember) referencing;
                                                        if (fieldReferenced.getDeclaringType().equals(member.getDeclaringType()))
                                                                keyword = ModifierKeyword.PRIVATE_KEYWORD;
                                                        else if (referencedUnit != null && referencedUnit.equals(member.getCompilationUnit()))
                                                                keyword = ModifierKeyword.PRIVATE_KEYWORD;
                                                             else
                                                             if (fieldReferenced.getDeclaringType().getPackageFragment().equals(member.getDeclaringType().getPackageFragment()))
                                                                keyword = null;
                                                        break;
                                                                          }
                                                case IJavaElement.PACKAGE_FRAGMENT: {
                                                        final IPackageFragment fragment = (IPackageFragment) referencing;
                                                        if (fieldReferenced.getDeclaringType().getPackageFragment().equals(fragment))
                                                                keyword = null;
                                                        break;
                                                                                    }
                                                default:
                                                        Assert.isTrue(false);
                                              }
                                        break;
                                                         }


Clone Instance
3
Line Count
29
Source Line
850
Source File
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MemberVisibilityAdjustor.java

                                case IJavaElement.METHOD: {
                                        final IMethod methodReferenced = (IMethod) referenced;
                                        final ICompilationUnit referencedUnit = methodReferenced.getCompilationUnit();
                                        switch (referencingType) {
                                                case IJavaElement.TYPE: {
                                                        keyword = thresholdTypeToMethod((IType) referencing, methodReferenced, monitor);
                                                        break;
                                                                        }
                                                case IJavaElement.FIELD:
                                                case IJavaElement.METHOD: {
                                                        final IMember member = (IMember) referencing;
                                                        if (methodReferenced.getDeclaringType().equals(member.getDeclaringType()))
                                                                keyword = ModifierKeyword.PRIVATE_KEYWORD;
                                                        else if (referencedUnit != null && referencedUnit.equals(member.getCompilationUnit()))
                                                                keyword = ModifierKeyword.PRIVATE_KEYWORD;
                                                             else
                                                             if (methodReferenced.getDeclaringType().getPackageFragment().equals(member.getDeclaringType().getPackageFragment()))
                                                                keyword = null;
                                                        break;
                                                                          }
                                                case IJavaElement.PACKAGE_FRAGMENT: {
                                                        final IPackageFragment fragment = (IPackageFragment) referencing;
                                                        if (methodReferenced.getDeclaringType().getPackageFragment().equals(fragment))
                                                                keyword = null;
                                                        break;
                                                                                    }
                                                default:
                                                        Assert.isTrue(false);
                                              }
                                        break;
                                                          }


Clone AbstractionParameter Count: 5Parameter Bindings

case IJavaElement. [[#variable6212f820]]:
  {
    final [[#variable6212f720]]  [[#variable6212f780]]= ( [[#variable6212f720]]) referenced;
    final ICompilationUnit referencedUnit = [[#variable6212f780]].getCompilationUnit();
    switch (referencingType) {
      case IJavaElement.TYPE:
        {
          keyword = [[#variable6212f700]]((IType) referencing,  [[#variable6212f780]], monitor);
          break;
        }
      case IJavaElement.FIELD:
      case IJavaElement.METHOD:
        {
          final IMember member = (IMember) referencing;
          if ( [[#variable6212f840]].equals(member.getDeclaringType()))
            keyword = ModifierKeyword.PRIVATE_KEYWORD;
          else
            if (referencedUnit != null && referencedUnit.equals(member.getCompilationUnit()))
              keyword = ModifierKeyword.PRIVATE_KEYWORD;
            else
              if ( [[#variable6212f840]].getPackageFragment().equals(member.getDeclaringType().getPackageFragment()))
                keyword = null;
          break;
        }
      case IJavaElement.PACKAGE_FRAGMENT:
        {
          final IPackageFragment fragment = (IPackageFragment) referencing;
          if ( [[#variable6212f840]].getPackageFragment().equals(fragment))
            keyword = null;
          break;
        }
      default:
        Assert.isTrue(false);
    }
    break;
  }
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#6212f820]]
TYPE 
12[[#6212f820]]
FIELD 
13[[#6212f820]]
METHOD 
21[[#6212f720]]
IType 
22[[#6212f720]]
IField 
23[[#6212f720]]
IMethod 
31[[#6212f780]]
typeReferenced 
32[[#6212f780]]
fieldReferenced 
33[[#6212f780]]
methodReferenced 
41[[#6212f700]]
thresholdTypeToType 
42[[#6212f700]]
thresholdTypeToField 
43[[#6212f700]]
thresholdTypeToMethod 
51[[#6212f840]]
typeReferenced 
52[[#6212f840]]
fieldReferenced.getDeclaringType() 
53[[#6212f840]]
methodReferenced.getDeclaringType()