| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 67 | 2 | 1 | 0.989 | class_body_declarations[4] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 67 | 1293 | plugins/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NaiveASTFlattener.java |
| 2 | 67 | 1245 | 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.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;
}
|
| ||||
/*
* @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;
}
|
| |||
/*
* @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 Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#a4baf000]] | buffer |
| 1 | 2 | [[#a4baf000]] | fBuffer |