| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 18 | 2 | 4 | 0.991 | class_body_declaration |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 18 | 1274 | plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/SemanticHighlightings.java |
| 2 | 18 | 1346 | plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/SemanticHighlightings.java |
| ||||
/*
* @see org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlighting#consumes(org.eclipse.jdt.internal.ui.javaeditor.SemanticToken)
*/
public boolean consumes(SemanticToken token) {
// 1: match types
SimpleName name = token.getNode();
ASTNode node = name.getParent();
int nodeType = node.getNodeType();
if (nodeType != ASTNode.SIMPLE_TYPE && nodeType != ASTNode.THIS_EXPRESSION && nodeType != ASTNode.QUALIFIED_TYPE && nodeType != ASTNode.QUALIFIED_NAME && nodeType != ASTNode.TYPE_DECLARATION)
return false;
while (nodeType == ASTNode.QUALIFIED_NAME) {
node = node.getParent();
nodeType = node.getNodeType();
if (nodeType == ASTNode.IMPORT_DECLARATION)
return false;
}
// 2: match classes
IBinding binding = token.getBinding();
return binding instanceof ITypeBinding && ((ITypeBinding) binding).isClass();
}
|
| ||||
/*
* @see org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlighting#consumes(org.eclipse.jdt.internal.ui.javaeditor.SemanticToken)
*/
public boolean consumes(SemanticToken token) {
// 1: match types
SimpleName name = token.getNode();
ASTNode node = name.getParent();
int nodeType = node.getNodeType();
if (nodeType != ASTNode.SIMPLE_TYPE && nodeType != ASTNode.QUALIFIED_TYPE && nodeType != ASTNode.QUALIFIED_NAME && nodeType != ASTNode.QUALIFIED_NAME && nodeType != ASTNode.ENUM_DECLARATION)
return false;
while (nodeType == ASTNode.QUALIFIED_NAME) {
node = node.getParent();
nodeType = node.getNodeType();
if (nodeType == ASTNode.IMPORT_DECLARATION)
return false;
}
// 2: match enums
IBinding binding = token.getBinding();
return binding instanceof ITypeBinding && ((ITypeBinding) binding).isEnum();
}
|
| |||
/*
* @see org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlighting#consumes(org.eclipse.jdt.internal.ui.javaeditor.SemanticToken)
*/
public boolean consumes(SemanticToken token) {
// 1: match types
SimpleName name = token.getNode();
ASTNode node = name.getParent();
int nodeType = node.getNodeType();
if (nodeType != ASTNode.SIMPLE_TYPE && nodeType != ASTNode. [[#variable945c4040]]&& nodeType != ASTNode. [[#variable5873b800]]&& nodeType != ASTNode.QUALIFIED_NAME && nodeType != ASTNode. [[#variablea39a1ec0]])
return false;
while (nodeType == ASTNode.QUALIFIED_NAME) {
node = node.getParent();
nodeType = node.getNodeType();
if (nodeType == ASTNode.IMPORT_DECLARATION)
return false;
}
// 2: match classes
// 2: match enums
IBinding binding = token.getBinding();
return binding instanceof ITypeBinding && ((ITypeBinding) binding). [[#variablea39a1f20]]();
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#945c4040]] | THIS_EXPRESSION |
| 1 | 2 | [[#945c4040]] | QUALIFIED_TYPE |
| 2 | 1 | [[#5873b800]] | QUALIFIED_TYPE |
| 2 | 2 | [[#5873b800]] | QUALIFIED_NAME |
| 3 | 1 | [[#a39a1ec0]] | TYPE_DECLARATION |
| 3 | 2 | [[#a39a1ec0]] | ENUM_DECLARATION |
| 4 | 1 | [[#a39a1f20]] | isClass |
| 4 | 2 | [[#a39a1f20]] | isEnum |