| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 28 | 2 | 6 | 0.959 | class_body_declarations[2] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 28 | 57 | Basic_Class1.java |
| 2 | 28 | 94 | Basic_Class1.java |
| ||||
// ****************************************************************
// ************************ Type 1 Clones ***********************
// ****************************************************************
// Note: The following clones were taken from work by Krawitz
//Type-1 Clones - Krawitz
public double Type1a_Krawitz(int n)
{
int p = -1;
int sum = 0;
for (p = 0; p < n; p++)
{
sum += p;
}
if (n == 0) return sum;
else return sum / n;
}
// Type 1 Clone - Krawitz
public double Type1b_Krawitz(int n)
{
int p = -1;
int sum = 0;
//this is a comment that is not in any other method()
for (p = 0; p < n; p++)
sum += p;
if (n == 0)
return sum;
else
return sum / n;
}
|
| ||||
// ****************************************************************
// ************************ Type 2 Clones ***********************
// ****************************************************************
//Type-2 Clones - Krawitz
public double Type2a_Krawitz(int n)
{
int q = -1;
double sum = 0;
for (q = 0; q < n; q++)
{
sum += q;
}
if (n == 0) return sum;
else return sum / n;
}
//Type-2 Clones - Krawitz
public double Type2b_Krawitz(int t)
{
int p = -1;
int tot = 0;
//this is a comment that is not the same as any other comment
for (p = 0; p < t; p++)
tot += p;
if (t == 0)
return tot;
else
return tot / t;
}
|
| |||
// ****************************************************************
// ************************ Type 2 Clones ***********************
// ************************ Type 1 Clones ***********************
// ****************************************************************
//Type-2 Clones - Krawitz
// Note: The following clones were taken from work by Krawitz
//Type-1 Clones - Krawitz
public double [[#variable6a6bda0]](int n) {
int [[#variable6a6bd40]]= -1;
[[#variable6a6bce0]] sum = 0;
for ( [[#variable6a6bd40]]= 0; [[#variable6a6bd40]] < n; [[#variable6a6bd40]]++) {
sum += [[#variable6a6bd40]];
}
if (n == 0)
return sum;
else
return sum / n;
}
//Type-2 Clones - Krawitz
// Type 1 Clone - Krawitz
public double [[#variable6a6bc80]](int [[#variable6a6bb60]]) {
int p = -1;
int [[#variable6a6bb00]]= 0;
//this is a comment that is not the same as any other comment
//this is a comment that is not in any other method()
for (p = 0; p < [[#variable6a6bb60]]; p++)
[[#variable6a6bb00]]+= p;
if ( [[#variable6a6bb60]]== 0)
return [[#variable6a6bb00]];
else
return [[#variable6a6bb00]] / [[#variable6a6bb60]];
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#6a6bda0]] | Type2a_Krawitz |
| 1 | 2 | [[#6a6bda0]] | Type1a_Krawitz |
| 2 | 1 | [[#6a6bd40]] | q |
| 2 | 2 | [[#6a6bd40]] | p |
| 3 | 1 | [[#6a6bce0]] | double |
| 3 | 2 | [[#6a6bce0]] | int |
| 4 | 1 | [[#6a6bc80]] | Type2b_Krawitz |
| 4 | 2 | [[#6a6bc80]] | Type1b_Krawitz |
| 5 | 1 | [[#6a6bb60]] | t |
| 5 | 2 | [[#6a6bb60]] | n |
| 6 | 1 | [[#6a6bb00]] | tot |
| 6 | 2 | [[#6a6bb00]] | sum |