CloneSet524


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
46220.997class_body_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
146853
plugins/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/SourceBasedSourceGenerator.java
246906
plugins/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/SourceBasedSourceGenerator.java
Clone Instance
1
Line Count
46
Source Line
853
Source File
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();
                        }
                }
        }


Clone Instance
2
Line Count
46
Source Line
906
Source File
plugins/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/SourceBasedSourceGenerator.java

        /**
         * @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();
                        }
                }
        }


Clone AbstractionParameter Count: 2Parameter Bindings

/* (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 Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#bb0c58a0]]
EnumDeclaration 
12[[#bb0c58a0]]
TypeDeclaration 
21[[#bb0c59e0]]
buildEnumDeclaration 
22[[#bb0c59e0]]
buildTypeDeclaration