Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
53 | 2 | 3 | 0.953 | statement_sequence[5] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 53 | 406 | plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/StubUtility2.java |
2 | 52 | 494 | plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/StubUtility2.java |
| ||||
String delimiter = StubUtility.getLineDelimiterUsed(unit); if ( !deferred) { Block body = ast.newBlock(); decl.setBody(body); String bodyStatement = ""; //$NON-NLS-1$ ITypeBinding declaringType = binding.getDeclaringClass(); if (Modifier.isAbstract(binding.getModifiers()) || declaringType.isAnnotation() || declaringType.isInterface()) { Expression expression = ASTNodeFactory.newDefaultExpression(ast, decl.getReturnType2(), decl.getExtraDimensions()); if (expression != null) { ReturnStatement returnStatement = ast.newReturnStatement(); returnStatement.setExpression(expression); bodyStatement = ASTNodes.asFormattedString(returnStatement, 0, delimiter); } } else { SuperMethodInvocation invocation = ast.newSuperMethodInvocation(); invocation.setName(ast.newSimpleName(binding.getName())); SingleVariableDeclaration varDecl = null; for (Iterator iterator = parameters.iterator(); iterator.hasNext();) { varDecl = (SingleVariableDeclaration) iterator.next(); invocation.arguments().add(ast.newSimpleName(varDecl.getName().getIdentifier())); } Expression expression = invocation; Type returnType = decl.getReturnType2(); if (returnType != null && (returnType instanceof PrimitiveType) && ((PrimitiveType) returnType).getPrimitiveTypeCode().equals(PrimitiveType.VOID)) { bodyStatement = ASTNodes.asFormattedString(ast.newExpressionStatement(expression), 0, delimiter); } else { ReturnStatement returnStatement = ast.newReturnStatement(); returnStatement.setExpression(expression); bodyStatement = ASTNodes.asFormattedString(returnStatement, 0, delimiter); } } String placeHolder = CodeGeneration.getMethodBodyContent(unit, type, binding.getName(), false, bodyStatement, delimiter); if (placeHolder != null) { ASTNode todoNode = rewrite.createStringPlaceholder(placeHolder, ASTNode.RETURN_STATEMENT); body.statements().add(todoNode); } } if (settings.createComments) { String string = CodeGeneration.getMethodComment(unit, type, decl, binding, delimiter); if (string != null) { Javadoc javadoc = (Javadoc) rewrite.createStringPlaceholder(string, ASTNode.JAVADOC); decl.setJavadoc(javadoc); } } if (settings.overrideAnnotation && JavaModelUtil.is50OrHigher(unit.getJavaProject())) { addOverrideAnnotation(rewrite, decl, binding); } return decl; |
| ||||
String delimiter = StubUtility.getLineDelimiterUsed(unit); if ( !deferred) { Block body = ast.newBlock(); decl.setBody(body); String bodyStatement = ""; //$NON-NLS-1$ ITypeBinding declaringType = binding.getDeclaringClass(); if (Modifier.isAbstract(binding.getModifiers()) || declaringType.isAnnotation() || declaringType.isInterface()) { Expression expression = ASTNodeFactory.newDefaultExpression(ast, decl.getReturnType2(), decl.getExtraDimensions()); if (expression != null) { ReturnStatement returnStatement = ast.newReturnStatement(); returnStatement.setExpression(expression); bodyStatement = ASTNodes.asFormattedString(returnStatement, 0, delimiter); } } else { SuperMethodInvocation invocation = ast.newSuperMethodInvocation(); invocation.setName(ast.newSimpleName(binding.getName())); SingleVariableDeclaration varDecl = null; for (Iterator iterator = parameters.iterator(); iterator.hasNext();) { varDecl = (SingleVariableDeclaration) iterator.next(); invocation.arguments().add(ast.newSimpleName(varDecl.getName().getIdentifier())); } Expression expression = invocation; Type returnType = decl.getReturnType2(); if (returnType instanceof PrimitiveType && ((PrimitiveType) returnType).getPrimitiveTypeCode().equals(PrimitiveType.VOID)) { bodyStatement = ASTNodes.asFormattedString(ast.newExpressionStatement(expression), 0, delimiter); } else { ReturnStatement returnStatement = ast.newReturnStatement(); returnStatement.setExpression(expression); bodyStatement = ASTNodes.asFormattedString(returnStatement, 0, delimiter); } } String placeHolder = CodeGeneration.getMethodBodyContent(unit, type, binding.getName(), false, bodyStatement, delimiter); if (placeHolder != null) { ASTNode todoNode = rewrite.createStringPlaceholder(placeHolder, ASTNode.RETURN_STATEMENT); body.statements().add(todoNode); } } if (settings != null && settings.createComments) { String string = CodeGeneration.getMethodComment(unit, type, decl, binding, delimiter); if (string != null) { Javadoc javadoc = (Javadoc) rewrite.createStringPlaceholder(string, ASTNode.JAVADOC); decl.setJavadoc(javadoc); } } if (settings != null && settings.overrideAnnotation && JavaModelUtil.is50OrHigher(unit.getJavaProject())) { addOverrideAnnotation(rewrite, decl, binding); } return decl; |
| |||
String delimiter = StubUtility.getLineDelimiterUsed(unit); if ( !deferred) { Block body = ast.newBlock(); decl.setBody(body); String bodyStatement = ""; //$NON-NLS-1$ ITypeBinding declaringType = binding.getDeclaringClass(); if (Modifier.isAbstract(binding.getModifiers()) || declaringType.isAnnotation() || declaringType.isInterface()) { Expression expression = ASTNodeFactory.newDefaultExpression(ast, decl.getReturnType2(), decl.getExtraDimensions()); if (expression != null) { ReturnStatement returnStatement = ast.newReturnStatement(); returnStatement.setExpression(expression); bodyStatement = ASTNodes.asFormattedString(returnStatement, 0, delimiter); } } else { SuperMethodInvocation invocation = ast.newSuperMethodInvocation(); invocation.setName(ast.newSimpleName(binding.getName())); SingleVariableDeclaration varDecl = null; for (Iterator iterator = parameters.iterator(); iterator.hasNext();) { varDecl = (SingleVariableDeclaration) iterator.next(); invocation.arguments().add(ast.newSimpleName(varDecl.getName().getIdentifier())); } Expression expression = invocation; Type returnType = decl.getReturnType2(); if ( [[#variablea1603b40]]&& ((PrimitiveType) returnType).getPrimitiveTypeCode().equals(PrimitiveType.VOID)) { bodyStatement = ASTNodes.asFormattedString(ast.newExpressionStatement(expression), 0, delimiter); } else { ReturnStatement returnStatement = ast.newReturnStatement(); returnStatement.setExpression(expression); bodyStatement = ASTNodes.asFormattedString(returnStatement, 0, delimiter); } } String placeHolder = CodeGeneration.getMethodBodyContent(unit, type, binding.getName(), false, bodyStatement, delimiter); if (placeHolder != null) { ASTNode todoNode = rewrite.createStringPlaceholder(placeHolder, ASTNode.RETURN_STATEMENT); body.statements().add(todoNode); } } if ( [[#variableb825f140]]) { String string = CodeGeneration.getMethodComment(unit, type, decl, binding, delimiter); if (string != null) { Javadoc javadoc = (Javadoc) rewrite.createStringPlaceholder(string, ASTNode.JAVADOC); decl.setJavadoc(javadoc); } } if ( [[#variablea3864b80]]&& JavaModelUtil.is50OrHigher(unit.getJavaProject())) { addOverrideAnnotation(rewrite, decl, binding); } return decl; |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#a1603b40]] | returnType != null && (returnType instanceof PrimitiveType) |
1 | 2 | [[#a1603b40]] | returnType instanceof PrimitiveType |
2 | 1 | [[#b825f140]] | settings.createComments |
2 | 2 | [[#b825f140]] | settings != null && settings.createComments |
3 | 1 | [[#a3864b80]] | settings.overrideAnnotation |
3 | 2 | [[#a3864b80]] | settings != null && settings.overrideAnnotation |