PrinterJob printJob = PrinterJob.getPrinterJob();
printJob.setPrintable(this);
if (printJob.printDialog()) {
try {
printJob.print();
} catch (PrinterException pe) {
s_log.error("Error printing", pe);
}
}
try
{
String hql = _hqlEntryPanel.getText();
final ArrayList<AliasInfo> infos = parse(hql);
GUIUtils.processOnSwingEventThread(new Runnable()
{
public void run()
{
_aliasFinderListener.aliasesFound(infos);
}
});
}
catch (Throwable t)
{
s_log.error("Error in HQLAliasFinder:", t);
}
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/util/PrintUtilities.java
|
|
File path: /sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/completion/HQLAliasFinder.java
|
Method name: void print()
|
|
Method name: void findAliases()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 4
|
|
1 | PrinterJob printJob = PrinterJob.getPrinterJob↵ | | 1 | try↵
|
| | | 2 | {↵
|
2 | ();↵ | | 3 | String hql = _hqlEntryPanel.getText();↵
|
|
3 | printJob.setPrintable(this);↵ | | 4 | final ArrayList<AliasInfo> infos = parse(hql);↵
|
|
4 | if (printJob.printDialog()) {↵ | | 5 | ↵
|
5 | try {↵ | | |
|
6 | printJob.print();↵ | | |
|
7 | } catch (PrinterException pe) {↵ | | 6 | GUIUtils.processOnSwingEventThread(new Runnable()↵
|
| | | 7 | {↵
|
| | | 8 | public void run()↵
|
| | | 9 | {↵
|
| | | 10 | _aliasFinderListener.aliasesFound(infos);↵
|
| | | 11 | }↵
|
| | | 12 | });↵
|
| | | 13 | }↵
|
| | | 14 | catch (Throwable t)↵
|
8 | ↵ | | 15 | {↵
|
9 | s_log.error("Error printing", pe);↵ | | 16 | s_log.error("Error in HQLAliasFinder:", t);↵
|
10 | }↵ | | |
|
11 | } | | 17 | }
|
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.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 8 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 1.2 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
4 | try | | 1 | try |
| | | 2 | String hql = _hqlEntryPanel.getText(); |
| | | 3 | final ArrayList<AliasInfo> infos = parse(hql); |
| | | 4 | GUIUtils.processOnSwingEventThread(new Runnable() {...}); |
5 | | | | |
Precondition Violations (2)
Row |
Violation |
1 | Unmatched statement GUIUtils.processOnSwingEventThread(new Runnable(){
public void run(){
_aliasFinderListener.aliasesFound(infos);
}
}
); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
2 | Unmatched statement printJob.print(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |