CloneSet256


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

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

        /*
         * @see ASTVisitor#visit(TagElement)
         * @since 3.0
         */
        public boolean visit(TagElement node) {
                if (node.isNested()) {
                        // nested tags are always enclosed in braces
                        this.buffer.append("{"); //$NON-NLS-1$
                }
                else   {
                        // top-level tags always begin on a new line
                        this.buffer.append("\n * "); //$NON-NLS-1$
                }
                boolean previousRequiresWhiteSpace = false;
                if (node.getTagName() != null) {
                        this.buffer.append(node.getTagName());
                        previousRequiresWhiteSpace = true;
                }
                boolean previousRequiresNewLine = false;
                for (Iterator it = node.fragments().iterator(); it.hasNext();)  {
                        ASTNode e = (ASTNode) it.next();
                        // assume text elements include necessary leading and trailing whitespace
                        // but Name, MemberRef, MethodRef, and nested TagElement do not include white space
                        boolean currentIncludesWhiteSpace = (e instanceof TextElement);
                        if (previousRequiresNewLine && currentIncludesWhiteSpace) {
                                this.buffer.append("\n * "); //$NON-NLS-1$
                        }
                        previousRequiresNewLine = currentIncludesWhiteSpace;
                        // add space if required to separate
                        if (previousRequiresWhiteSpace && !currentIncludesWhiteSpace) {
                                this.buffer.append(" "); //$NON-NLS-1$
                        }
                        e.accept(this );
                        previousRequiresWhiteSpace = !currentIncludesWhiteSpace && !(e instanceof TagElement);
                }
                if (node.isNested()) {
                        this.buffer.append("}"); //$NON-NLS-1$
                }
                return false;
        }

        /*
         * @see ASTVisitor#visit(TextElement)
         * @since 3.0
         */
        public boolean visit(TextElement node) {
                this.buffer.append(node.getText());
                return false;
        }

        /*
         * @see ASTVisitor#visit(ThisExpression)
         */
        public boolean visit(ThisExpression node) {
                if (node.getQualifier() != null) {
                        node.getQualifier().accept(this );
                        this.buffer.append("."); //$NON-NLS-1$
                }
                this.buffer.append("this"); //$NON-NLS-1$
                return false;
        }


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

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

        /*
         * @see ASTVisitor#visit(TagElement)
         * @since 3.0
         */
        public boolean visit(TagElement node) {
                if (node.isNested()) {
                        // nested tags are always enclosed in braces
                        this.fBuffer.append("{"); //$NON-NLS-1$
                }
                else   {
                        // top-level tags always begin on a new line
                        this.fBuffer.append("\n * "); //$NON-NLS-1$
                }
                boolean previousRequiresWhiteSpace = false;
                if (node.getTagName() != null) {
                        this.fBuffer.append(node.getTagName());
                        previousRequiresWhiteSpace = true;
                }
                boolean previousRequiresNewLine = false;
                for (Iterator it = node.fragments().iterator(); it.hasNext();) {
                        ASTNode e = (ASTNode) it.next();
                        // assume text elements include necessary leading and trailing whitespace
                        // but Name, MemberRef, MethodRef, and nested TagElement do not include white space
                        boolean currentIncludesWhiteSpace = (e instanceof TextElement);
                        if (previousRequiresNewLine && currentIncludesWhiteSpace) {
                                this.fBuffer.append("\n * "); //$NON-NLS-1$
                        }
                        previousRequiresNewLine = currentIncludesWhiteSpace;
                        // add space if required to separate
                        if (previousRequiresWhiteSpace && !currentIncludesWhiteSpace) {
                                this.fBuffer.append(" "); //$NON-NLS-1$
                        }
                        e.accept(this );
                        previousRequiresWhiteSpace = !currentIncludesWhiteSpace && !(e instanceof TagElement);
                }
                if (node.isNested()) {
                        this.fBuffer.append("}"); //$NON-NLS-1$
                }
                return false;
        }

        /*
         * @see ASTVisitor#visit(TextElement)
         * @since 3.0
         */
        public boolean visit(TextElement node) {
                this.fBuffer.append(node.getText());
                return false;
        }

        /*
         * @see ASTVisitor#visit(ThisExpression)
         */
        public boolean visit(ThisExpression node) {
                if (node.getQualifier() != null) {
                        node.getQualifier().accept(this );
                        this.fBuffer.append("."); //$NON-NLS-1$
                }
                this.fBuffer.append("this"); //$NON-NLS-1$
                return false;
        }


Clone AbstractionParameter Count: 1Parameter Bindings

/*
         * @see ASTVisitor#visit(SynchronizedStatement)
         */
public boolean visit(SynchronizedStatement node) {
  this. [[#variablea4baf000]].append("synchronized ("); //$NON-NLS-1$
  node.getExpression().accept(this );
  this. [[#variablea4baf000]].append(") "); //$NON-NLS-1$
  node.getBody().accept(this );
  return false;
}

/*
         * @see ASTVisitor#visit(TagElement)
         * @since 3.0
         */
public boolean visit(TagElement node) {
  if (node.isNested()) {
    // nested tags are always enclosed in braces
    this. [[#variablea4baf000]].append("{"); //$NON-NLS-1$
  }
  else {
    // top-level tags always begin on a new line
    this. [[#variablea4baf000]].append("\n * "); //$NON-NLS-1$
  }
  boolean previousRequiresWhiteSpace = false;
  if (node.getTagName() != null) {
    this. [[#variablea4baf000]].append(node.getTagName());
    previousRequiresWhiteSpace = true;
  }
  boolean previousRequiresNewLine = false;
  for (Iterator it = node.fragments().iterator(); it.hasNext();) {
    ASTNode e = (ASTNode) it.next();
    // assume text elements include necessary leading and trailing whitespace
    // but Name, MemberRef, MethodRef, and nested TagElement do not include white space
    boolean currentIncludesWhiteSpace = (e instanceof TextElement);
    if (previousRequiresNewLine && currentIncludesWhiteSpace) {
      this. [[#variablea4baf000]].append("\n * "); //$NON-NLS-1$
    }
    previousRequiresNewLine = currentIncludesWhiteSpace;
    // add space if required to separate
    if (previousRequiresWhiteSpace && !currentIncludesWhiteSpace) {
      this. [[#variablea4baf000]].append(" "); //$NON-NLS-1$
    }
    e.accept(this );
    previousRequiresWhiteSpace = !currentIncludesWhiteSpace && !(e instanceof TagElement);
  }
  if (node.isNested()) {
    this. [[#variablea4baf000]].append("}"); //$NON-NLS-1$
  }
  return false;
}

/*
         * @see ASTVisitor#visit(TextElement)
         * @since 3.0
         */
public boolean visit(TextElement node) {
  this. [[#variablea4baf000]].append(node.getText());
  return false;
}

/*
         * @see ASTVisitor#visit(ThisExpression)
         */
public boolean visit(ThisExpression node) {
  if (node.getQualifier() != null) {
    node.getQualifier().accept(this );
    this. [[#variablea4baf000]].append("."); //$NON-NLS-1$
  }
  this. [[#variablea4baf000]].append("this"); //$NON-NLS-1$
  return false;
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#a4baf000]]
buffer 
12[[#a4baf000]]
fBuffer