Byte[] bBytes = BinaryDisplayConverter.convertToBytes(text, BinaryDisplayConverter.HEX, false); // check that the text is a valid representation StringBuffer messageBuffer = new StringBuffer(); validateAndConvertInPopup(text, null, messageBuffer); if (messageBuffer.length() > 0) { // there was an error in the conversion throw new IOException(new String(messageBuffer)); } // Convert Bytes to bytes byte[] bytes = new byte[bBytes.length]; for (int i=0; i<bytes.length; i++) bytes[i] = bBytes[i].byteValue(); // just send the text to the output file outStream.write(bytes); outStream.flush(); outStream.close();
Byte[] bBytes = BinaryDisplayConverter.convertToBytes(text, BinaryDisplayConverter.HEX, false); // check that the text is a valid representation StringBuffer messageBuffer = new StringBuffer(); validateAndConvertInPopup(text, null, messageBuffer); if (messageBuffer.length() > 0) { // there was an error in the conversion throw new IOException(new String(messageBuffer)); } // Convert Bytes to bytes byte[] bytes = new byte[bBytes.length]; for (int i=0; i<bytes.length; i++) bytes[i] = bBytes[i].byteValue(); // just send the text to the output file outStream.write(bytes); outStream.flush(); outStream.close();
Clone fragments detected by clone detection tool
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
		outStream.close();
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.7
Clones locationClones are in different classes having the same super class
Number of node comparisons47
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.4
    Clone typeType 1
    Mapped Statements
    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();
    Precondition Violations (0)
    Row Violation