CloneSet223


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
39220.996statement_sequence[4]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
139957
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ExtractInterfaceProcessor.java
2391771
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/PullUpRefactoringProcessor.java
Clone Instance
1
Line Count
39
Source Line
957
Source File
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ExtractInterfaceProcessor.java

                        if (isSubUnit)
                                currentRewrite = rewrite;
                        else
                                currentRewrite = new CompilationUnitRewrite(unit, node);
                        final Collection collection = (Collection) fTypeOccurrences.get(unit);
                        if (collection != null && !collection.isEmpty()) {
                                final IProgressMonitor subMonitor = new SubProgressMonitor(monitor, 100);
                                try {
                                        subMonitor.beginTask("", collection.size() * 10); //$NON-NLS-1$
                                        subMonitor.setTaskName(RefactoringCoreMessages.ExtractInterfaceProcessor_creating);
                                        TType estimate = null;
                                        ISourceConstraintVariable variable = null;
                                        ITypeConstraintVariable constraint = null;
                                        for ( final Iterator iterator = collection.iterator(); iterator.hasNext();) {
                                                variable = (ISourceConstraintVariable) iterator.next();
                                                if (variable instanceof ITypeConstraintVariable) {
                                                        constraint = (ITypeConstraintVariable) variable;
                                                        estimate = (TType) constraint.getData(SuperTypeConstraintsSolver.DATA_TYPE_ESTIMATE);
                                                        if (estimate != null) {
                                                                final CompilationUnitRange range = constraint.getRange();
                                                                if (isSubUnit)
                                                                        rewriteTypeOccurrence(range, estimate, requestor, currentRewrite, node, replacements, currentRewrite.createCategorizedGroupDescription(RefactoringCoreMessages.SuperTypeRefactoringProcessor_update_type_occurrence, SET_SUPER_TYPE));
                                                                else {
                                                                        final ASTNode result = NodeFinder.perform(node, range.getSourceRange());
                                                                        if (result != null)
                                                                                rewriteTypeOccurrence(estimate, currentRewrite, result, currentRewrite.createCategorizedGroupDescription(RefactoringCoreMessages.SuperTypeRefactoringProcessor_update_type_occurrence, SET_SUPER_TYPE));
                                                                }
                                                                subMonitor.worked(10);
                                                        }
                                                }
                                        }
                                } finally {
                                        subMonitor.done();
                                  }
                        }
                        if ( !isSubUnit) {
                                final TextChange change = currentRewrite.createChange();
                                if (change != null)
                                        manager.manage(unit, change);
                        }


Clone Instance
2
Line Count
39
Source Line
1771
Source File
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/PullUpRefactoringProcessor.java

                        if (isTouched)
                                currentRewrite = existingRewrite;
                        else
                                currentRewrite = new CompilationUnitRewrite(unit, node);
                        final Collection collection = (Collection) fTypeOccurrences.get(unit);
                        if (collection != null && !collection.isEmpty()) {
                                final IProgressMonitor subMonitor = new SubProgressMonitor(monitor, 100);
                                try {
                                        subMonitor.beginTask("", collection.size() * 10); //$NON-NLS-1$
                                        subMonitor.setTaskName(RefactoringCoreMessages.ExtractInterfaceProcessor_creating);
                                        TType estimate = null;
                                        ISourceConstraintVariable variable = null;
                                        ITypeConstraintVariable constraint = null;
                                        for ( final Iterator iterator = collection.iterator(); iterator.hasNext();) {
                                                variable = (ISourceConstraintVariable) iterator.next();
                                                if (variable instanceof ITypeConstraintVariable) {
                                                        constraint = (ITypeConstraintVariable) variable;
                                                        estimate = (TType) constraint.getData(SuperTypeConstraintsSolver.DATA_TYPE_ESTIMATE);
                                                        if (estimate != null) {
                                                                final CompilationUnitRange range = constraint.getRange();
                                                                if (isTouched)
                                                                        rewriteTypeOccurrence(range, estimate, requestor, currentRewrite, node, replacements, currentRewrite.createCategorizedGroupDescription(RefactoringCoreMessages.SuperTypeRefactoringProcessor_update_type_occurrence, SET_SUPER_TYPE));
                                                                else {
                                                                        final ASTNode result = NodeFinder.perform(node, range.getSourceRange());
                                                                        if (result != null)
                                                                                rewriteTypeOccurrence(estimate, currentRewrite, result, currentRewrite.createCategorizedGroupDescription(RefactoringCoreMessages.SuperTypeRefactoringProcessor_update_type_occurrence, SET_SUPER_TYPE));
                                                                }
                                                                subMonitor.worked(10);
                                                        }
                                                }
                                        }
                                } finally {
                                        subMonitor.done();
                                  }
                        }
                        if ( !isTouched) {
                                final TextChange change = currentRewrite.createChange();
                                if (change != null)
                                        manager.manage(unit, change);
                        }


Clone AbstractionParameter Count: 2Parameter Bindings

if ( [[#variableb5819620]])
  currentRewrite = [[#variableb58195e0]];
else
  currentRewrite = new CompilationUnitRewrite(unit, node);
final Collection collection = (Collection) fTypeOccurrences.get(unit);
if (collection != null && !collection.isEmpty()) {
  final IProgressMonitor subMonitor = new SubProgressMonitor(monitor, 100);
  try {
    subMonitor.beginTask("", collection.size() * 10); //$NON-NLS-1$
    subMonitor.setTaskName(RefactoringCoreMessages.ExtractInterfaceProcessor_creating);
    TType estimate = null;
    ISourceConstraintVariable variable = null;
    ITypeConstraintVariable constraint = null;
    for ( final Iterator iterator = collection.iterator(); iterator.hasNext();) {
      variable = (ISourceConstraintVariable) iterator.next();
      if (variable instanceof ITypeConstraintVariable) {
        constraint = (ITypeConstraintVariable) variable;
        estimate = (TType) constraint.getData(SuperTypeConstraintsSolver.DATA_TYPE_ESTIMATE);
        if (estimate != null) {
          final CompilationUnitRange range = constraint.getRange();
          if ( [[#variableb5819620]])
            rewriteTypeOccurrence(range, estimate, requestor, currentRewrite, node, replacements, currentRewrite.createCategorizedGroupDescription(RefactoringCoreMessages.SuperTypeRefactoringProcessor_update_type_occurrence, SET_SUPER_TYPE));
          else {
            final ASTNode result = NodeFinder.perform(node, range.getSourceRange());
            if (result != null)
              rewriteTypeOccurrence(estimate, currentRewrite, result, currentRewrite.createCategorizedGroupDescription(RefactoringCoreMessages.SuperTypeRefactoringProcessor_update_type_occurrence, SET_SUPER_TYPE));
          }
          subMonitor.worked(10);
        }
      }
    }
  }
  finally {
    subMonitor.done();
  }
}
if ( ! [[#variableb5819620]]) {
  final TextChange change = currentRewrite.createChange();
  if (change != null)
    manager.manage(unit, change);
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#b5819620]]
isSubUnit 
12[[#b5819620]]
isTouched 
21[[#b58195e0]]
rewrite 
22[[#b58195e0]]
existingRewrite