CloneSet183


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
73230.991class_body_declarations[5]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
1731484
plugins/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NaiveASTFlattener.java
2731431
plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/ASTFlattener.java
Clone Instance
1
Line Count
73
Source Line
1484
Source File
plugins/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NaiveASTFlattener.java

        /*
         * @see ASTVisitor#visit(TypeDeclarationStatement)
         */
        public boolean visit(TypeDeclarationStatement node) {
                if (node.getAST().apiLevel() == AST.JLS2_INTERNAL) {
                        node.internalGetTypeDeclaration().accept(this );
                }
                if (node.getAST().apiLevel() >= AST.JLS3) {
                        node.getDeclaration().accept(this );
                }
                return false;
        }

        /*
         * @see ASTVisitor#visit(TypeLiteral)
         */
        public boolean visit(TypeLiteral node) {
                node.getType().accept(this );
                this.buffer.append(".class"); //$NON-NLS-1$
                return false;
        }

        /*
         * @see ASTVisitor#visit(TypeParameter)
         * @since 3.1
         */
        public boolean visit(TypeParameter node) {
                node.getName().accept(this );
                if ( !node.typeBounds().isEmpty()) {
                        this.buffer.append(" extends "); //$NON-NLS-1$
                        for (Iterator it = node.typeBounds().iterator(); it.hasNext();)  {
                                Type t = (Type) it.next();
                                t.accept(this );
                                if (it.hasNext()) {
                                        this.buffer.append(" & "); //$NON-NLS-1$
                                }
                        }
                }
                return false;
        }

        /*
         * @see ASTVisitor#visit(VariableDeclarationExpression)
         */
        public boolean visit(VariableDeclarationExpression node) {
                if (node.getAST().apiLevel() == AST.JLS2_INTERNAL) {
                        printModifiers(node.getModifiers());
                }
                if (node.getAST().apiLevel() >= AST.JLS3) {
                        printModifiers(node.modifiers());
                }
                node.getType().accept(this );
                this.buffer.append(" "); //$NON-NLS-1$
                for (Iterator it = node.fragments().iterator(); it.hasNext();)  {
                        VariableDeclarationFragment f = (VariableDeclarationFragment) it.next();
                        f.accept(this );
                        if (it.hasNext()) {
                                this.buffer.append(", "); //$NON-NLS-1$
                        }
                }
                return false;
        }

        /*
         * @see ASTVisitor#visit(VariableDeclarationFragment)
         */
        public boolean visit(VariableDeclarationFragment node) {
                node.getName().accept(this );
                for (int i = 0; i < node.getExtraDimensions(); i++) {
                        this.buffer.append("[]"); //$NON-NLS-1$
                }
                if (node.getInitializer() != null) {
                        this.buffer.append("="); //$NON-NLS-1$
                        node.getInitializer().accept(this );
                }
                return false;
        }


Clone Instance
2
Line Count
73
Source Line
1431
Source File
plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/ASTFlattener.java

        /*
         * @see ASTVisitor#visit(TypeDeclarationStatement)
         */
        public boolean visit(TypeDeclarationStatement node) {
                if (node.getAST().apiLevel() == AST.JLS2) {
                        node.getTypeDeclaration().accept(this );
                }
                if (node.getAST().apiLevel() >= AST.JLS3) {
                        node.getDeclaration().accept(this );
                }
                return false;
        }

        /*
         * @see ASTVisitor#visit(TypeLiteral)
         */
        public boolean visit(TypeLiteral node) {
                node.getType().accept(this );
                this.fBuffer.append(".class"); //$NON-NLS-1$
                return false;
        }

        /*
         * @see ASTVisitor#visit(TypeParameter)
         * @since 3.0
         */
        public boolean visit(TypeParameter node) {
                node.getName().accept(this );
                if ( !node.typeBounds().isEmpty()) {
                        this.fBuffer.append(" extends "); //$NON-NLS-1$
                        for (Iterator it = node.typeBounds().iterator(); it.hasNext();) {
                                Type t = (Type) it.next();
                                t.accept(this );
                                if (it.hasNext()) {
                                        this.fBuffer.append(" & "); //$NON-NLS-1$
                                }
                        }
                }
                return false;
        }

        /*
         * @see ASTVisitor#visit(VariableDeclarationExpression)
         */
        public boolean visit(VariableDeclarationExpression node) {
                if (node.getAST().apiLevel() == AST.JLS2) {
                        printModifiers(node.getModifiers());
                }
                if (node.getAST().apiLevel() >= AST.JLS3) {
                        printModifiers(node.modifiers());
                }
                node.getType().accept(this );
                this.fBuffer.append(" "); //$NON-NLS-1$
                for (Iterator it = node.fragments().iterator(); it.hasNext();) {
                        VariableDeclarationFragment f = (VariableDeclarationFragment) it.next();
                        f.accept(this );
                        if (it.hasNext()) {
                                this.fBuffer.append(", "); //$NON-NLS-1$
                        }
                }
                return false;
        }

        /*
         * @see ASTVisitor#visit(VariableDeclarationFragment)
         */
        public boolean visit(VariableDeclarationFragment node) {
                node.getName().accept(this );
                for (int i = 0; i < node.getExtraDimensions(); i++) {
                        this.fBuffer.append("[]"); //$NON-NLS-1$
                }
                if (node.getInitializer() != null) {
                        this.fBuffer.append("="); //$NON-NLS-1$
                        node.getInitializer().accept(this );
                }
                return false;
        }


Clone AbstractionParameter Count: 3Parameter Bindings

/*
         * @see ASTVisitor#visit(TypeDeclarationStatement)
         */
public boolean visit(TypeDeclarationStatement node) {
  if (node.getAST().apiLevel() == AST. [[#variable950df480]]) {
    node. [[#variable950df460]]().accept(this );
  }
  if (node.getAST().apiLevel() >= AST.JLS3) {
    node.getDeclaration().accept(this );
  }
  return false;
}

/*
         * @see ASTVisitor#visit(TypeLiteral)
         */
public boolean visit(TypeLiteral node) {
  node.getType().accept(this );
  this. [[#variable950df440]].append(".class"); //$NON-NLS-1$
  return false;
}

/*
         * @see ASTVisitor#visit(TypeParameter)
         * @since 3.1
         */
/*
         * @see ASTVisitor#visit(TypeParameter)
         * @since 3.0
         */
public boolean visit(TypeParameter node) {
  node.getName().accept(this );
  if ( !node.typeBounds().isEmpty()) {
    this. [[#variable950df440]].append(" extends "); //$NON-NLS-1$
    for (Iterator it = node.typeBounds().iterator(); it.hasNext();) {
      Type t = (Type) it.next();
      t.accept(this );
      if (it.hasNext()) {
        this. [[#variable950df440]].append(" & "); //$NON-NLS-1$
      }
    }
  }
  return false;
}

/*
         * @see ASTVisitor#visit(VariableDeclarationExpression)
         */
public boolean visit(VariableDeclarationExpression node) {
  if (node.getAST().apiLevel() == AST. [[#variable950df480]]) {
    printModifiers(node.getModifiers());
  }
  if (node.getAST().apiLevel() >= AST.JLS3) {
    printModifiers(node.modifiers());
  }
  node.getType().accept(this );
  this. [[#variable950df440]].append(" "); //$NON-NLS-1$
  for (Iterator it = node.fragments().iterator(); it.hasNext();) {
    VariableDeclarationFragment f = (VariableDeclarationFragment) it.next();
    f.accept(this );
    if (it.hasNext()) {
      this. [[#variable950df440]].append(", "); //$NON-NLS-1$
    }
  }
  return false;
}

/*
         * @see ASTVisitor#visit(VariableDeclarationFragment)
         */
public boolean visit(VariableDeclarationFragment node) {
  node.getName().accept(this );
  for (int i = 0; i < node.getExtraDimensions(); i++) {
    this. [[#variable950df440]].append("[]"); //$NON-NLS-1$
  }
  if (node.getInitializer() != null) {
    this. [[#variable950df440]].append("="); //$NON-NLS-1$
    node.getInitializer().accept(this );
  }
  return false;
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#950df480]]
JLS2_INTERNAL 
12[[#950df480]]
JLS2 
21[[#950df460]]
internalGetTypeDeclaration 
22[[#950df460]]
getTypeDeclaration 
31[[#950df440]]
buffer 
32[[#950df440]]
fBuffer