if (file.isDirectory()) {
return true;
}
return checkFileName(file.getName().toLowerCase());
if (methodName.startsWith("supportsAdd") || methodName.startsWith("supportsCreate")
|| methodName.startsWith("supportsAlter") || methodName.startsWith("supportsDrop")
|| methodName.startsWith("supportsRename") || methodName.equals("supportsViewDefinition"))
{
return true;
}
return false;
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/util/FileExtensionFilter.java
|
|
File path: /sql12/plugins/refactoring/src/net/sourceforge/squirrel_sql/plugins/refactoring/tab/SupportedRefactoringsTab.java
|
Method name: boolean accept(File)
|
|
Method name: boolean isRefactoringSupportMethodName(String)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | if (file.isDirectory()) {↵ | | 1 | if (↵
|
2 | return true;↵ | | |
|
3 | }↵ | | |
|
4 | return checkFileName(file.getName().toLowerCase())↵ | | 2 | methodName.startsWith("supportsAdd") || methodName.startsWith("supportsCreate")↵
|
| | | 3 | || methodName.startsWith("supportsAlter") || methodName.startsWith("supportsDrop")↵
|
| | | 4 | || methodName.startsWith("supportsRename") || methodName.equals("supportsViewDefinition"))↵
|
| | | 5 | {↵
|
| | | 6 | return true;↵
|
| | | 7 | }↵
|
5 | ; | | 8 | return false;
|
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 |
Number of node comparisons | 2 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.6 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 1 | if (methodName.startsWith("supportsAdd") || methodName.startsWith("supportsCreate") || methodName.startsWith("supportsAlter") || methodName.startsWith("supportsDrop") || methodName.startsWith("supportsRename") || methodName.equals("supportsViewDefinition")) |
| | | 2 | |
1 | if (file.isDirectory()) | | | |
2 | | | | |
3 | return checkFileName(file.getName().toLowerCase()); | | 3 | return false; |
Precondition Violations (3)
Row |
Violation |
1 | Unmatched return true; |
2 | Unmatched return true; |
3 | The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.fw.util.FileExtensionFilter and net.sourceforge.squirrel_sql.plugins.refactoring.tab.SupportedRefactoringsTab do not have a common superclass |