| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 46 | 2 | 2 | 0.997 | class_body_declaration |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 46 | 853 | plugins/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/SourceBasedSourceGenerator.java |
| 2 | 46 | 906 | plugins/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/SourceBasedSourceGenerator.java |
| ||||
/* (non-Javadoc)
* @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.EnumDeclaration)
*/
public void endVisit(EnumDeclaration node) {
if (hasError()) {
return;
}
if ( !rightTypeFound() && isRightType(node)) {
setRightTypeFound(true);
fSource = buildRunMethod(node.bodyDeclarations());
fEvaluateNextEndTypeDeclaration = true;
}
if ( !fEvaluateNextEndTypeDeclaration) {
fEvaluateNextEndTypeDeclaration = true;
return;
}
if (rightTypeFound()) {
StringBuffer source = buildEnumDeclaration(fSource, node);
if (node.isLocalTypeDeclaration()) {
// enclose in a method if nessecary
ASTNode parent = node.getParent();
while ( !(parent instanceof MethodDeclaration)) {
parent = parent.getParent();
}
MethodDeclaration enclosingMethodDeclaration = (MethodDeclaration) parent;
fSource = new StringBuffer();
if (Flags.isStatic(enclosingMethodDeclaration.getModifiers())) {
fSource.append("static "); //$NON-NLS-1$
}
fSource.append("void ___eval() {\n"); //$NON-NLS-1$
fSnippetStartPosition += fSource.length();
fSource.append(source);
fSource.append("}\n"); //$NON-NLS-1$
fLastTypeName = ""; //$NON-NLS-1$
}
else {
fSource = source;
fLastTypeName = node.getName().getIdentifier();
}
}
}
|
| ||||
/**
* @see ASTVisitor#endVisit(TypeDeclaration)
*/
public void endVisit(TypeDeclaration node) {
if (hasError()) {
return;
}
if ( !rightTypeFound() && isRightType(node)) {
setRightTypeFound(true);
fSource = buildRunMethod(node.bodyDeclarations());
fEvaluateNextEndTypeDeclaration = true;
}
if ( !fEvaluateNextEndTypeDeclaration) {
fEvaluateNextEndTypeDeclaration = true;
return;
}
if (rightTypeFound()) {
StringBuffer source = buildTypeDeclaration(fSource, node);
if (node.isLocalTypeDeclaration()) {
// enclose in a method if nessecary
ASTNode parent = node.getParent();
while ( !(parent instanceof MethodDeclaration)) {
parent = parent.getParent();
}
MethodDeclaration enclosingMethodDeclaration = (MethodDeclaration) parent;
fSource = new StringBuffer();
if (Flags.isStatic(enclosingMethodDeclaration.getModifiers())) {
fSource.append("static "); //$NON-NLS-1$
}
fSource.append("void ___eval() {\n"); //$NON-NLS-1$
fSnippetStartPosition += fSource.length();
fSource.append(source);
fSource.append("}\n"); //$NON-NLS-1$
fLastTypeName = ""; //$NON-NLS-1$
}
else {
fSource = source;
fLastTypeName = node.getName().getIdentifier();
}
}
}
|
| |||
/* (non-Javadoc)
* @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.EnumDeclaration)
*/
/**
* @see ASTVisitor#endVisit(TypeDeclaration)
*/
public void endVisit( [[#variablebb0c58a0]] node) {
if (hasError()) {
return;
}
if ( !rightTypeFound() && isRightType(node)) {
setRightTypeFound(true);
fSource = buildRunMethod(node.bodyDeclarations());
fEvaluateNextEndTypeDeclaration = true;
}
if ( !fEvaluateNextEndTypeDeclaration) {
fEvaluateNextEndTypeDeclaration = true;
return;
}
if (rightTypeFound()) {
StringBuffer source = [[#variablebb0c59e0]](fSource, node);
if (node.isLocalTypeDeclaration()) {
// enclose in a method if nessecary
ASTNode parent = node.getParent();
while ( !(parent instanceof MethodDeclaration)) {
parent = parent.getParent();
}
MethodDeclaration enclosingMethodDeclaration = (MethodDeclaration) parent;
fSource = new StringBuffer();
if (Flags.isStatic(enclosingMethodDeclaration.getModifiers())) {
fSource.append("static "); //$NON-NLS-1$
}
fSource.append("void ___eval() {\n"); //$NON-NLS-1$
fSnippetStartPosition += fSource.length();
fSource.append(source);
fSource.append("}\n"); //$NON-NLS-1$
fLastTypeName = ""; //$NON-NLS-1$
}
else {
fSource = source;
fLastTypeName = node.getName().getIdentifier();
}
}
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#bb0c58a0]] | EnumDeclaration |
| 1 | 2 | [[#bb0c58a0]] | TypeDeclaration |
| 2 | 1 | [[#bb0c59e0]] | buildEnumDeclaration |
| 2 | 2 | [[#bb0c59e0]] | buildTypeDeclaration |