try {
PropertyDescriptor[] result = new PropertyDescriptor[2];
result[0] =
new PropertyDescriptor(
PointWrapper.IPropertyNames.X,
PointWrapper.class,
"getX",
"setX");
result[1] =
new PropertyDescriptor(
PointWrapper.IPropertyNames.Y,
PointWrapper.class,
"getY",
"setY");
return result;
} catch (IntrospectionException e) {
throw new Error(e);
}
try
{
PropertyDescriptor[] result = new PropertyDescriptor[2];
result[0] =
new PropertyDescriptor(DimensionWrapper.IPropertyNames.WIDTH, DimensionWrapper.class, "getWidth",
"setWidth");
result[1] =
new PropertyDescriptor(DimensionWrapper.IPropertyNames.HEIGHT, DimensionWrapper.class,
"getHeight", "setHeight");
return result;
}
catch (IntrospectionException e)
{
throw new Error(e);
}
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/util/beanwrapper/PointWrapperBeanInfo.java
|
|
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/util/beanwrapper/DimensionWrapperBeanInfo.java
|
Method name: PropertyDescriptor[] getPropertyDescriptors()
|
|
Method name: PropertyDescriptor[] getPropertyDescriptors()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | try ↵ | | 1 | try↵
|
2 | {↵ | | 2 | {↵
|
3 | PropertyDescriptor[] result = new PropertyDescriptor[2];↵ | | 3 | PropertyDescriptor[] result = new PropertyDescriptor[2];↵
|
4 | result[0] =↵ | | 4 | result[0] =↵
|
5 | new PropertyDescriptor(↵ | | 5 | new PropertyDescriptor(↵
|
6 | PointWrapper.IPropertyNames.X,↵ | | 6 | DimensionWrapper.IPropertyNames.↵
|
7 | PointWrapper.class,↵ | | 7 | WIDTH, DimensionWrapper.class,↵
|
8 | "getX",↵ | | 8 | "getWidth",↵
|
9 | "setX");↵ | | 9 | "setWidth");↵
|
10 | result[1] =↵ | | 10 | result[1] =↵
|
11 | new PropertyDescriptor(↵ | | 11 | new PropertyDescriptor(↵
|
12 | PointWrapper.IPropertyNames.Y,↵ | | 12 | DimensionWrapper.IPropertyNames.↵
|
13 | PointWrapper.class,↵ | | 13 | HEIGHT, DimensionWrapper.class,↵
|
14 | "getY",↵ | | 14 | "get↵
|
15 | "setY");↵ | | 15 | Height", "setHeight");↵
|
16 | return result;↵ | | 16 | return result;↵
|
17 | } ↵ | | 17 | }↵
|
18 | catch (IntrospectionException e) ↵ | | 18 | catch (IntrospectionException e)↵
|
19 | {↵ | | 19 | {↵
|
20 | throw new Error(e);↵ | | 20 | throw new Error(e);↵
|
21 | } | | 21 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 25 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 2.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | try | | 1 | try |
2 | PropertyDescriptor[] result = new PropertyDescriptor[2]; | | 2 | PropertyDescriptor[] result = new PropertyDescriptor[2]; |
3 | result[0] = new PropertyDescriptor(PointWrapper.IPropertyNames.X, PointWrapper.class, "getX", "setX"); | | 3 | result[0] = new PropertyDescriptor(DimensionWrapper.IPropertyNames.WIDTH, DimensionWrapper.class, "getWidth", "setWidth"); |
4 | result[1] = new PropertyDescriptor(PointWrapper.IPropertyNames.Y, PointWrapper.class, "getY", "setY"); | | 4 | result[1] = new PropertyDescriptor(DimensionWrapper.IPropertyNames.HEIGHT, DimensionWrapper.class, "getHeight", "setHeight"); |
5 | | | 5 | |
Precondition Violations (4)
Row |
Violation |
1 | Type net.sourceforge.squirrel_sql.fw.util.beanwrapper.PointWrapper does not match with type net.sourceforge.squirrel_sql.fw.util.beanwrapper.DimensionWrapper |
2 | Type net.sourceforge.squirrel_sql.fw.util.beanwrapper.PointWrapper.IPropertyNames does not match with type net.sourceforge.squirrel_sql.fw.util.beanwrapper.DimensionWrapper.IPropertyNames |
3 | Type net.sourceforge.squirrel_sql.fw.util.beanwrapper.PointWrapper does not match with type net.sourceforge.squirrel_sql.fw.util.beanwrapper.DimensionWrapper |
4 | Type net.sourceforge.squirrel_sql.fw.util.beanwrapper.PointWrapper.IPropertyNames does not match with type net.sourceforge.squirrel_sql.fw.util.beanwrapper.DimensionWrapper.IPropertyNames |