| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 22 | 2 | 4 | 0.987 | class_body_declaration |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 22 | 71 | plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/ChangeCollector.java |
| 2 | 22 | 169 | plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/ChangeCollector.java |
| ||||
/*
* Adds the given delta on a compilation unit to the list of changes.
*/
public void addChange(ICompilationUnit cu, IJavaElementDelta newDelta) throws JavaModelException {
int newKind = newDelta.getKind();
switch (newKind) {
case IJavaElementDelta.ADDED:
ArrayList allTypes = new ArrayList();
getAllTypesFromElement(cu, allTypes);
for (int i = 0, length = allTypes.size(); i < length; i++) {
IType type = (IType) allTypes.get(i);
addTypeAddition(type, (SimpleDelta) this.changes.get(type));
}
break;
case IJavaElementDelta.REMOVED:
allTypes = new ArrayList();
getAllTypesFromHierarchy((JavaElement) cu, allTypes);
for (int i = 0, length = allTypes.size(); i < length; i++) {
IType type = (IType) allTypes.get(i);
addTypeRemoval(type, (SimpleDelta) this.changes.get(type));
}
break;
case IJavaElementDelta.CHANGED:
addAffectedChildren(newDelta);
break;
}
}
|
| ||||
/*
* Adds a change for the given member (a method, a field or an initializer) and the types it defines.
*/
private void addChange(IMember member, IJavaElementDelta newDelta) throws JavaModelException {
int newKind = newDelta.getKind();
switch (newKind) {
case IJavaElementDelta.ADDED:
ArrayList allTypes = new ArrayList();
getAllTypesFromElement(member, allTypes);
for (int i = 0, length = allTypes.size(); i < length; i++) {
IType innerType = (IType) allTypes.get(i);
addTypeAddition(innerType, (SimpleDelta) this.changes.get(innerType));
}
break;
case IJavaElementDelta.REMOVED:
allTypes = new ArrayList();
getAllTypesFromHierarchy((JavaElement) member, allTypes);
for (int i = 0, length = allTypes.size(); i < length; i++) {
IType type = (IType) allTypes.get(i);
addTypeRemoval(type, (SimpleDelta) this.changes.get(type));
}
break;
case IJavaElementDelta.CHANGED:
addAffectedChildren(newDelta);
break;
}
}
|
| |||
[[#variable9b1c9f00]]void addChange( [[#variable9b1c9e00]] [[#variable9b1c9dc0]], IJavaElementDelta newDelta) throws JavaModelException {
int newKind = newDelta.getKind();
switch (newKind) {
case IJavaElementDelta.ADDED:
ArrayList allTypes = new ArrayList();
getAllTypesFromElement( [[#variable9b1c9dc0]], allTypes);
for (int i = 0, length = allTypes.size(); i < length; i++) {
IType [[#variable9b1c9d80]]= (IType) allTypes.get(i);
addTypeAddition( [[#variable9b1c9d80]], (SimpleDelta) this.changes.get( [[#variable9b1c9d80]]));
}
break;
case IJavaElementDelta.REMOVED:
allTypes = new ArrayList();
getAllTypesFromHierarchy((JavaElement) [[#variable9b1c9dc0]], allTypes);
for (int i = 0, length = allTypes.size(); i < length; i++) {
IType type = (IType) allTypes.get(i);
addTypeRemoval(type, (SimpleDelta) this.changes.get(type));
}
break;
case IJavaElementDelta.CHANGED:
addAffectedChildren(newDelta);
break;
}
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#9b1c9f00]] | /* * Adds a change for the given member (a method, a field or an initializer) and the types it defines. */ private |
| 1 | 2 | [[#9b1c9f00]] | /* * Adds the given delta on a compilation unit to the list of changes. */ public |
| 2 | 1 | [[#9b1c9e00]] | IMember |
| 2 | 2 | [[#9b1c9e00]] | ICompilationUnit |
| 3 | 1 | [[#9b1c9dc0]] | member |
| 3 | 2 | [[#9b1c9dc0]] | cu |
| 4 | 1 | [[#9b1c9d80]] | innerType |
| 4 | 2 | [[#9b1c9d80]] | type |