File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeBinary.java | File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeBlob.java | |||
Method name: void exportObject(FileOutputStream, String)
|
Method name: void exportObject(FileOutputStream, String)
|
|||
Number of AST nodes: 11 | Number of AST nodes: 11 | |||
1 | Byte[] bBytes = BinaryDisplayConverter.convertToBytes(text,↵ | 1 | Byte[] bBytes = BinaryDisplayConverter.convertToBytes(text,↵ | |
2 | BinaryDisplayConverter.HEX, false);↵ | 2 | BinaryDisplayConverter.HEX, false);↵ | |
3 | ↵ | |||
4 | // check that the text is a valid representation↵ | 3 | // check that the text is a valid representation↵ | |
5 | StringBuffer messageBuffer = new StringBuffer();↵ | 4 | StringBuffer messageBuffer = new StringBuffer();↵ | |
6 | validateAndConvertInPopup(text, null, messageBuffer);↵ | 5 | validateAndConvertInPopup(text, null, messageBuffer);↵ | |
7 | if (messageBuffer.length() > 0) {↵ | 6 | if (messageBuffer.length() > 0) {↵ | |
8 | // there was an error in the conversion↵ | 7 | // there was an error in the conversion↵ | |
9 | throw new IOException(new String(messageBuffer));↵ | 8 | throw new IOException(new String(messageBuffer));↵ | |
10 | }↵ | 9 | }↵ | |
11 | ↵ | |||
12 | // Convert Bytes to bytes↵ | 10 | // Convert Bytes to bytes↵ | |
13 | byte[] bytes = new byte[bBytes.length];↵ | 11 | byte[] bytes = new byte[bBytes.length];↵ | |
14 | for (int i=0; i<bytes.length; i++)↵ | 12 | for (int i=0; i<bytes.length; i++)↵ | |
15 | bytes[i] = bBytes[i].byteValue();↵ | 13 | bytes[i] = bBytes[i].byteValue();↵ | |
16 | ↵ | |||
17 | // just send the text to the output file↵ | 14 | // just send the text to the output file↵ | |
18 | outStream.write(bytes);↵ | 15 | outStream.write(bytes);↵ | |
19 | outStream.flush();↵ | 16 | outStream.flush();↵ | |
20 | outStream.close(); | 17 |
| |
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.7 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 47 |
Number of mapped statements | 11 |
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.4 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
1 | Byte[] bBytes = BinaryDisplayConverter.convertToBytes(text, BinaryDisplayConverter.HEX, false); | 1 | Byte[] bBytes = BinaryDisplayConverter.convertToBytes(text, BinaryDisplayConverter.HEX, false); | |
2 | StringBuffer messageBuffer = new StringBuffer(); | 2 | StringBuffer messageBuffer = new StringBuffer(); | |
3 | validateAndConvertInPopup(text, null, messageBuffer); | 3 | validateAndConvertInPopup(text, null, messageBuffer); | |
4 | if (messageBuffer.length() > 0) | 4 | if (messageBuffer.length() > 0) | |
5 | throw new IOException(new String(messageBuffer)); | 5 | throw new IOException(new String(messageBuffer)); | |
6 | byte[] bytes = new byte[bBytes.length]; | 6 | byte[] bytes = new byte[bBytes.length]; | |
7 | for (int i = 0; i < bytes.length; i++) | 7 | for (int i = 0; i < bytes.length; i++) | |
8 | bytes[i] = bBytes[i].byteValue(); | 8 | bytes[i] = bBytes[i].byteValue(); | |
9 | outStream.write(bytes); | 9 | outStream.write(bytes); | |
10 | outStream.flush(); | 10 | outStream.flush(); | |
11 | outStream.close(); | 11 | outStream.close(); |
Row | Violation |
---|