File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/folder/mbox/MboxDataStorage.java | File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/folder/mbox/MboxDataStorage.java | |||
Method name: Source getMessageSource(Object)
|
Method name: InputStream getMessageStream(Object)
|
|||
Number of AST nodes: 10 | Number of AST nodes: 10 | |||
1 | MboxMessage message = (MboxMessage) messages.get(uid);↵ | 1 | MboxMessage message = (MboxMessage) messages.get(uid);↵ | |
2 | ↵ | |||
3 | ↵ | |||
4 | FileInputStream in = new FileInputStream(mboxFile);↵ | 2 | FileInputStream in = new FileInputStream(mboxFile);↵ | |
5 | in.skip(message.getStart());↵ | 3 | in.skip(message.getStart());↵ | |
6 | File tempFile = File.createTempFile("mbox_message", ".tmp");↵ | 4 | File tempFile = File.createTempFile("mbox_message", ".tmp");↵ | |
7 | tempFile.deleteOnExit();↵ | 5 | tempFile.deleteOnExit();↵ | |
8 | FileOutputStream out = new FileOutputStream(tempFile);↵ | 6 | FileOutputStream out = new FileOutputStream(tempFile);↵ | |
9 | StreamUtils.streamCopy(in, out, (int) message.getLength());↵ | 7 | StreamUtils.streamCopy(in, out, (int) message.getLength());↵ | |
10 | in.close();↵ | 8 | in.close();↵ | |
11 | out.close();↵ | 9 | out.close();↵ | |
12 | return new FileSource(tempFile); | 10 | return new FileInputStream(tempFile); | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 42 |
Number of mapped statements | 9 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
3 | MboxMessage message = (MboxMessage)messages.get(uid); | 1 | MboxMessage message = (MboxMessage)messages.get(uid); | |
4 | FileInputStream in = new FileInputStream(mboxFile); | 2 | FileInputStream in = new FileInputStream(mboxFile); | |
5 | in.skip(message.getStart()); | 3 | in.skip(message.getStart()); | |
6 | File tempFile = File.createTempFile("mbox_message", ".tmp"); | 4 | File tempFile = File.createTempFile("mbox_message", ".tmp"); | |
7 | tempFile.deleteOnExit(); | 5 | tempFile.deleteOnExit(); | |
8 | FileOutputStream out = new FileOutputStream(tempFile); | 6 | FileOutputStream out = new FileOutputStream(tempFile); | |
9 | StreamUtils.streamCopy(in, out, (int)message.getLength()); | 7 | StreamUtils.streamCopy(in, out, (int)message.getLength()); | |
10 | in.close(); | 8 | in.close(); | |
11 | out.close(); | 9 | out.close(); | |
| 10 | return new FileInputStream(tempFile); | ||
12 | return new FileSource(tempFile); | |
Row | Violation |
---|