File path: /jEdit-4.2/src/org/gjt/sp/jedit/BufferHistory.java | File path: /jEdit-4.2/src/org/gjt/sp/jedit/buffer/KillRing.java | |||
Method name: void save()
|
Method name: void save()
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | String settingsDirectory = jEdit.getSettingsDirectory();↵ | 1 | String settingsDirectory = jEdit.getSettingsDirectory();↵ | |
2 | if(settingsDirectory == null)↵ | 2 | if(settingsDirectory == null)↵ | |
3 | return;↵ | 3 | return;↵ | |
4 | File file1 = new File(MiscUtilities.constructPath(↵ | 4 | File file1 = new File(MiscUtilities.constructPath(↵ | |
5 | settingsDirectory, "#recent.xml#save#"));↵ | 5 | settingsDirectory, "#killring.xml#save#"));↵ | |
6 | File file2 = new File(MiscUtilities.constructPath(↵ | 6 | File file2 = new File(MiscUtilities.constructPath(↵ | |
7 | settingsDirectory, "recent.xml"));↵ | 7 | settingsDirectory, "killring.xml"));↵ | |
8 | if(file2.exists() && file2.lastModified() != recentModTime)↵ | 8 | if(file2.exists() && file2.lastModified() != killRingModTime)↵ | |
9 | {↵ | 9 | {↵ | |
10 | Log.log(Log.WARNING,BufferHistory.class,file2↵ | 10 | Log.log(Log.WARNING,KillRing.class,file2↵ | |
11 | + " changed on disk; will not save recent"↵ | 11 | + " changed on disk; will not save recent"↵ | |
12 | + " files");↵ | 12 | + " files");↵ | |
13 | return;↵ | 13 | return;↵ | |
14 | }↵ | 14 | }↵ | |
15 | jEdit.backupSettingsFile(file2); | 15 |
| |
See real code fragment | See real code fragment |
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.7 |
Clones location | Clones are in different classes |
Number of node comparisons | 28 |
Number of mapped statements | 9 |
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) | 4.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | String settingsDirectory = jEdit.getSettingsDirectory(); | 1 | String settingsDirectory = jEdit.getSettingsDirectory(); | |||||||||||
2 | if (settingsDirectory == null) | 2 | if (settingsDirectory == null) | |||||||||||
3 | return; |
| 3 | return; | ||||||||||
4 | File file1 = new File(MiscUtilities.constructPath(settingsDirectory, "#recent.xml#save#")); |
| 4 | File file1 = new File(MiscUtilities.constructPath(settingsDirectory, "#killring.xml#save#")); | ||||||||||
5 | File file2 = new File(MiscUtilities.constructPath(settingsDirectory, "recent.xml")); |
| 5 | File file2 = new File(MiscUtilities.constructPath(settingsDirectory, "killring.xml")); | ||||||||||
6 | if (file2.exists() && file2.lastModified() != recentModTime) |
| 6 | if (file2.exists() && file2.lastModified() != killRingModTime) | ||||||||||
7 | Log.log(Log.WARNING, BufferHistory.class, file2 + " changed on disk; will not save recent" + " files"); | 7 | Log.log(Log.WARNING, KillRing.class, file2 + " changed on disk; will not save recent" + " files"); | |||||||||||
8 | return; |
| 8 | return; | ||||||||||
9 | jEdit.backupSettingsFile(file2); | 9 | jEdit.backupSettingsFile(file2); |
Row | Violation |
---|---|
1 | Conditional return; |
2 | Conditional return; |
3 | Conditional return; |
4 | Conditional return; |
5 | Clone fragment #1 returns variables file1, file2 , while Clone fragment #2 returns variables file1, file2 |