OutputStreamWriter outWriter = new OutputStreamWriter(outStream); // 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)); } // just send the text to the output file outWriter.write(text); outWriter.flush(); outWriter.close();
OutputStreamWriter outWriter = new OutputStreamWriter(outStream); // 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)); } // just send the text to the output file outWriter.write(text); outWriter.flush(); outWriter.close();
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeBoolean.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeInteger.java
Method name: void exportObject(FileOutputStream, String) Method name: void exportObject(FileOutputStream, String)
Number of AST nodes: 8 Number of AST nodes: 8
1
OutputStreamWriter outWriter = new OutputStreamWriter(outStream);
1
OutputStreamWriter outWriter = new OutputStreamWriter(outStream);
2
	 	
2
		// check that the text is a valid representation
3
	 	// check that the text is a valid representation
3
		StringBuffer messageBuffer = new StringBuffer();
4
	 	StringBuffer messageBuffer = new StringBuffer();
4
		validateAndConvertInPopup(text, null, messageBuffer);
5
	 	validateAndConvertInPopup(text, null, messageBuffer);
5
		if (messageBuffer.length() > 0)
6
	 	if (messageBuffer.length() > 0)
6
		{
7
 {
7
			// there was an error in the conversion
8
	 		// there was an error in the conversion
8
			throw new IOException(new String(messageBuffer));
9
	 		throw new IOException(new String(messageBuffer));
9
		}
10
	 	}
11
	 	
10
		// just send the text to the output file
12
	 	// just send the text to the output file
11
		outWriter.write(text);
13
		outWriter.write(text);
12
		outWriter.flush();
14
		outWriter.flush();
13
		outWriter.close();
15
		outWriter.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.1
Clones locationClones are in different classes having the same super class
Number of node comparisons23
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.5
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    1
    OutputStreamWriter outWriter = new OutputStreamWriter(outStream);
    1
    OutputStreamWriter outWriter = new OutputStreamWriter(outStream);
    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
    outWriter.write(text);
    6
    outWriter.write(text);
    7
    outWriter.flush();
    7
    outWriter.flush();
    8
    outWriter.close();
    8
    outWriter.close();
    Precondition Violations (0)
    Row Violation