try
{
PropertyDescriptor[] result = new PropertyDescriptor[2];
result[0] =
new PropertyDescriptor(MainFrameWindowState.IPropertyNames.ALIASES_WINDOW_STATE,
MainFrameWindowState.class, "getAliasesWindowState", "setAliasesWindowState");
result[1] =
new PropertyDescriptor(MainFrameWindowState.IPropertyNames.DRIVERS_WINDOW_STATE,
MainFrameWindowState.class, "getDriversWindowState", "setDriversWindowState");
return result;
}
catch (IntrospectionException e)
{
throw new Error(e);
}
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);
}
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/mainframe/MainFrameWindowStateBeanInfo.java
|
|
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/util/beanwrapper/PointWrapperBeanInfo.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(MainFrameWindowState.IPropertyNames.ALIASES_WINDOW_STATE,↵ | | 5 | new PropertyDescriptor(↵
|
6 | MainFrameWindowState.class, "getAliasesWindowState", "setAliasesWindowState");↵ | | |
|
7 | result[1] =↵ | | |
|
8 | new PropertyDescriptor(MainFrameWindowState.IPropertyNames.DRIVERS_WINDOW_STATE,↵ | | |
|
9 | MainFrameWindowState.class, "getDriversWindowState", "setDriversWindowState↵ | | |
|
| | | 6 | PointWrapper.IPropertyNames.X,↵
|
| | | 7 | PointWrapper.class,↵
|
| | | 8 | "getX",↵
|
| | | 9 | "setX");↵
|
| | | 10 | result[1] =↵
|
| | | 11 | new PropertyDescriptor(↵
|
| | | 12 | PointWrapper.IPropertyNames.Y,↵
|
| | | 13 | PointWrapper.class,↵
|
| | | 14 | "getY",↵
|
10 | ");↵ | | 15 | "setY");↵
|
11 | return result;↵ | | 16 | return result;↵
|
12 | }↵ | | 17 | }↵
|
13 | catch (IntrospectionException e)↵ | | 18 | catch (IntrospectionException e)↵
|
14 | {↵ | | 19 | {↵
|
15 | throw new Error(e);↵ | | 20 | throw new Error(e);↵
|
16 | } | | 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.9 |
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(MainFrameWindowState.IPropertyNames.ALIASES_WINDOW_STATE, MainFrameWindowState.class, "getAliasesWindowState", "setAliasesWindowState"); | | 3 | result[0] = new PropertyDescriptor(PointWrapper.IPropertyNames.X, PointWrapper.class, "getX", "setX"); |
4 | result[1] = new PropertyDescriptor(MainFrameWindowState.IPropertyNames.DRIVERS_WINDOW_STATE, MainFrameWindowState.class, "getDriversWindowState", "setDriversWindowState"); | | 4 | result[1] = new PropertyDescriptor(PointWrapper.IPropertyNames.Y, PointWrapper.class, "getY", "setY"); |
5 | | | 5 | |
Precondition Violations (4)
Row |
Violation |
1 | Type net.sourceforge.squirrel_sql.client.gui.mainframe.MainFrameWindowState does not match with type net.sourceforge.squirrel_sql.fw.util.beanwrapper.PointWrapper |
2 | Type net.sourceforge.squirrel_sql.client.gui.mainframe.MainFrameWindowState.IPropertyNames does not match with type net.sourceforge.squirrel_sql.fw.util.beanwrapper.PointWrapper.IPropertyNames |
3 | Type net.sourceforge.squirrel_sql.client.gui.mainframe.MainFrameWindowState does not match with type net.sourceforge.squirrel_sql.fw.util.beanwrapper.PointWrapper |
4 | Type net.sourceforge.squirrel_sql.client.gui.mainframe.MainFrameWindowState.IPropertyNames does not match with type net.sourceforge.squirrel_sql.fw.util.beanwrapper.PointWrapper.IPropertyNames |