File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeBlob.java | File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeClob.java | |||
Method name: boolean wholeBlobRead(BlobDescriptor)
|
Method name: boolean wholeClobRead(ClobDescriptor)
|
|||
Number of AST nodes: 12 | Number of AST nodes: 11 | |||
1 | if (bdesc == null)↵ | 1 | if (cdesc == null)↵ | |
2 | return true; // can use an empty blob for editing↵ | 2 | return true; // can use an empty clob for editing↵ | |
3 | if (bdesc.getWholeBlobRead())↵ | 3 | if (cdesc.getWholeClobRead())↵ | |
4 | return true; // the whole blob has been previously read in↵ | 4 | return true; // the whole clob has been previously read in↵ | |
5 | // data was not fully read in before, so try to do that now↵ | 5 | // data was not fully read in before, so try to do that now↵ | |
6 | try {↵ | 6 | try {↵ | |
7 | System.out.println("reading bytes from BLOB");↵ | 7 | S↵ | |
8 | byte[] data = bdesc.getBlob().getBytes(1, (int)bdesc.getBlob().length());↵ | 8 | tring data = cdesc.getClob().getSubString(1, (int)cdesc.getClob().length());↵ | |
9 | // read succeeded, so reset the BlobDescriptor to match↵ | 9 | // read succeeded, so reset the ClobDescriptor to match↵ | |
10 | bdesc.setBlobRead(true);↵ | 10 | cdesc.setClobRead(true);↵ | |
11 | bdesc.setData(data);↵ | 11 | cdesc.setData(data);↵ | |
12 | bdesc.setWholeBlobRead(true);↵ | 12 | cdesc.setWholeClobRead(true);↵ | |
13 | bdesc.setUserSetBlobLimit(0);↵ | 13 | cdesc.setUserSetClobLimit(0);↵ | |
14 | // we successfully read the whole thing↵ | 14 | // we successfully read the whole thing↵ | |
15 | return true;↵ | 15 | return true;↵ | |
16 | }↵ | 16 | }↵ | |
17 | catch (Exception ex) {↵ | 17 | catch (Exception ex) {↵ | |
18 | bdesc.setBlobRead(false);↵ | 18 | cdesc.setClobRead(false);↵ | |
19 | bdesc.setWholeBlobRead(false);↵ | 19 | cdesc.setWholeClobRead(false);↵ | |
20 | bdesc.setData(null);↵ | 20 | cdesc.setData(null);↵ | |
21 | //?? What to do with this error?↵ | 21 | //?? What to do with this error?↵ | |
22 | //?? error message = "Could not read the complete data. Error was: "+ex.getMessage());↵ | 22 | //?? error message = "Could not read the complete data. Error was: "+ex.getMessage());↵ | |
23 | return false;↵ | 23 | return false;↵ | |
24 | } | 24 |
| |
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) | 1.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 67 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 7 |
Number of unmapped statements in the second code fragment | 6 |
Time elapsed for statement mapping (ms) | 13.5 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (bdesc == null) |
| 1 | if (cdesc == null) | ||||||||||||||||||||||||||||||||||||||
2 | return true; | 2 | return true; | |||||||||||||||||||||||||||||||||||||||
| 3 | if (cdesc.getWholeClobRead()) | ||||||||||||||||||||||||||||||||||||||||
|
| 4 | return true; | |||||||||||||||||||||||||||||||||||||||
3 | if (bdesc.getWholeBlobRead()) | | ||||||||||||||||||||||||||||||||||||||||
4 | return true; |
| | |||||||||||||||||||||||||||||||||||||||
5 | try |
| 5 | try | ||||||||||||||||||||||||||||||||||||||
|
| 6 | String data = cdesc.getClob().getSubString(1, (int)cdesc.getClob().length()); | |||||||||||||||||||||||||||||||||||||||
6 | System.out.println("reading bytes from BLOB"); | | ||||||||||||||||||||||||||||||||||||||||
|
| 7 | cdesc.setClobRead(true); | |||||||||||||||||||||||||||||||||||||||
7 | byte[] data = bdesc.getBlob().getBytes(1, (int)bdesc.getBlob().length()); |
| | |||||||||||||||||||||||||||||||||||||||
8 | bdesc.setBlobRead(true); |
| | |||||||||||||||||||||||||||||||||||||||
9 | bdesc.setData(data); |
| 8 | cdesc.setData(data); | ||||||||||||||||||||||||||||||||||||||
|
| 9 | cdesc.setWholeClobRead(true); | |||||||||||||||||||||||||||||||||||||||
|
| 10 | cdesc.setUserSetClobLimit(0); | |||||||||||||||||||||||||||||||||||||||
10 | bdesc.setWholeBlobRead(true); |
| | |||||||||||||||||||||||||||||||||||||||
11 | bdesc.setUserSetBlobLimit(0); |
| | |||||||||||||||||||||||||||||||||||||||
12 | return true; | 11 | return true; |
Row | Violation |
---|---|
1 | Type net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.BlobDescriptor of variable bdesc does not match with type net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.ClobDescriptor of variable cdesc |
2 | Unmatched return true; |
3 | Unmatched return true; |
4 | Expression bdesc.setBlobRead(false) is a void method call, and thus it cannot be parameterized |
5 | Expression cdesc.setClobRead(false) is a void method call, and thus it cannot be parameterized |
6 | Type net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.BlobDescriptor of variable bdesc does not match with type net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.ClobDescriptor of variable cdesc |
7 | Expression bdesc.setWholeBlobRead(false) is a void method call, and thus it cannot be parameterized |
8 | Expression cdesc.setWholeClobRead(false) is a void method call, and thus it cannot be parameterized |
9 | Type net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.BlobDescriptor of variable bdesc does not match with type net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.ClobDescriptor of variable cdesc |
10 | Type net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.BlobDescriptor of variable bdesc does not match with type net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.ClobDescriptor of variable cdesc |
11 | Unmatched statement String data=cdesc.getClob().getSubString(1,(int)cdesc.getClob().length()); 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 |
12 | Unmatched statement cdesc.setClobRead(true); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
13 | Unmatched statement byte[] data=bdesc.getBlob().getBytes(1,(int)bdesc.getBlob().length()); 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 |
14 | Unmatched statement bdesc.setBlobRead(true); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
15 | Type byte[] of variable data does not match with type java.lang.String of variable data |
16 | Type net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.BlobDescriptor of variable bdesc does not match with type net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.ClobDescriptor of variable cdesc |
17 | Unmatched statement cdesc.setWholeClobRead(true); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
18 | Unmatched statement cdesc.setUserSetClobLimit(0); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
19 | Unmatched statement bdesc.setWholeBlobRead(true); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
20 | Unmatched statement bdesc.setUserSetBlobLimit(0); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
21 | Not all possible execution flows end in a return statement |