for (int j = 0; j < entries.size(); j++)
{
Entry temp = (Entry)entries.get(j);
if (temp.plugin == dep.plugin)
{
if (value)
{
temp.parents.add(entry);
setValueAt(Boolean.TRUE,j,0);
}
else
temp.parents.remove(entry);
}
}
for (int i = 0; i < length; i++)
{
Entry entry = (Entry)pluginModel.entries.get(i);
if (entry.install)
{
entry.plugin.install(roster,installDirectory,downloadSource);
if (updates)
entry.plugin.getCompatibleBranch().satisfyDependencies(
roster,installDirectory,downloadSource);
instcount++;
}
}
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/pluginmgr/InstallPanel.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/pluginmgr/InstallPanel.java
|
Method name: void setValueAt(Object, int, int)
|
|
Method name: void actionPerformed(ActionEvent)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | for (int j = 0; j < entries.size(); j++)↵ | | 1 | for (int i = 0; i < length; i++)↵
|
2 | {↵ | | 2 | ↵
|
3 | ↵ | | 3 | {↵
|
4 | Entry temp = (Entry)entries.get(j);↵ | | 4 | Entry entry = (Entry)pluginModel.entries.get(i);↵
|
5 | if (temp.plugin == dep.plugin)↵ | | 5 | if (↵
|
6 | {↵ | | |
|
7 | if (valu↵ | | 6 | entry.install)↵
|
| | | 7 | {↵
|
8 | e)↵ | | 8 | entry.plugin.install(roster,installDirectory,downloadSource);↵
|
9 | {↵ | | 9 | ↵
|
10 | temp.parents.add(entry);↵ | | |
|
11 | setValueAt(Boolean.TRUE,j,0);↵ | | |
|
12 | }↵ | | |
|
13 | else↵ | | |
|
14 | temp.parents.remove(entry);↵ | | |
|
15 | }↵ | | |
|
16 | ↵ | | 10 | if (updates)↵
|
| | | 11 | entry.plugin.getCompatibleBranch().satisfyDependencies(↵
|
| | | 12 | roster,installDirectory,downloadSource);↵
|
| | | 13 | instcount++;↵
|
| | | 14 | }↵
|
17 | } | | 15 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are in the same java file |
Number of node comparisons | 9 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 15 | entry.plugin.install(roster, installDirectory, downloadSource); |
25 | if (value) | | 16 | if (updates) |
| | | 17 | entry.plugin.getCompatibleBranch().satisfyDependencies(roster, installDirectory, downloadSource); |
26 | | | | |
27 | setValueAt(Boolean.TRUE, j, 0); | | | |
| | | | |
28 | temp.parents.remove(entry); | | | |
Precondition Violations (0)
Row |
Violation |