String result = "null"; if (_prefs.isUseFileCaching()) { try { bindClobVarInFile(ps, index, rs, type); } catch (Exception e) { // i18n[DBUtil.error.bindclobfailure=bindBlobVar: failed to // bind blob using filesystem - attempting to bind blob using // memory] String msg = s_stringMgr.getString("DBUtil.error.bindclobfailure"); log.error(msg, e); // if we failed to bind the blob in a file, try memory. result = bindClobVarInMemory(ps, index, rs, type); } } else { result = bindClobVarInMemory(ps, index, rs, type); } return result;
String result = "null"; if (_prefs.isUseFileCaching()) { try { bindBlobVarInFile(ps, index, rs, type); } catch (Exception e) { // i18n[DBUtil.error.bindblobfailure=bindBlobVar: failed to // bind blob using filesystem - attempting to bind blob using // memory] String msg = s_stringMgr.getString("DBUtil.error.bindblobfailure"); log.error(msg, e); // if we failed to bind the blob in a file, try memory. result = bindBlobVarInMemory(ps, index, rs, type); } } else { result = bindBlobVarInMemory(ps, index, rs, type); } return result;
Clone fragments detected by clone detection tool
File path: /sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/util/DBUtil.java File path: /sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/util/DBUtil.java
Method name: String bindClobVar(PreparedStatement, int, ResultSet, int) Method name: String bindBlobVar(PreparedStatement, int, ResultSet, int)
Number of AST nodes: 6 Number of AST nodes: 6
1
String result = "null";
1
String result = "null";
2
		if (_prefs.isUseFileCaching())
2
		if (_prefs.isUseFileCaching())
3
		{
3
		{
4
			try
4
			try
5
			{
5
			{
6
				bindClobVarInFile(ps, index, rs, type);
6
				bindBlobVarInFile(ps, index, rs, type);
7
			} catch (Exception e)
7
			} catch (Exception e)
8
			{
8
			{
9
				// i18n[DBUtil.error.bindclobfailure=bindBlobVar: failed to
9
				// i18n[DBUtil.error.bindblobfailure=bindBlobVar: failed to
10
				// bind blob using filesystem - attempting to bind blob using
10
				// bind blob using filesystem - attempting to bind blob using
11
				// memory]
11
				// memory]
12
				String msg = s_stringMgr.getString("DBUtil.error.bindclobfailure");
12
				String msg = s_stringMgr.getString("DBUtil.error.bindblobfailure");
13
				log.error(msg, e);
13
				log.error(msg, e);
14
				// if we failed to bind the blob in a file, try memory.
14
				// if we failed to bind the blob in a file, try memory.
15
				result = bindClobVarInMemory(ps, index, rs, type);
15
				result = bindBlobVarInMemory(ps, index, rs, type);
16
			}
16
			}
17
		} else
17
		} else
18
		{
18
		{
19
			result = bindClobVarInMemory(ps, index, rs, type);
19
			result = bindBlobVarInMemory(ps, index, rs, type);
20
		}
20
		}
21
		return result;
21
		return result;
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.6
Clones locationClones are declared in the same class
Number of node comparisons12
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    String result = "null";
    1
    String result = "null";
    2
    if (_prefs.isUseFileCaching())
    2
    if (_prefs.isUseFileCaching())
    3
    try
    3
    try
    3
    try
    Differences
    Expression1Expression2Difference
    "DBUtil.error.bindclobfailure""DBUtil.error.bindblobfailure"LITERAL_VALUE_MISMATCH
    bindClobVarInMemorybindBlobVarInMemoryMETHOD_INVOCATION_NAME_MISMATCH
    3
    try
    4
    bindClobVarInFile(ps, index, rs, type);
    4
    bindClobVarInFile(ps, index, rs, type);
    4
    bindBlobVarInFile(ps, index, rs, type);
    Differences
    Expression1Expression2Difference
    bindClobVarInFilebindBlobVarInFileMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression bindClobVarInFile(ps,index,rs,type) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method bindClobVarInFile
    Expression bindBlobVarInFile(ps,index,rs,type) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method bindBlobVarInFile
    Expression bindClobVarInFile(ps,index,rs,type) is a void method call, and thus it cannot be parameterized
    Expression bindBlobVarInFile(ps,index,rs,type) is a void method call, and thus it cannot be parameterized
    4
    bindBlobVarInFile(ps, index, rs, type);
    else
    else
    5
    result = bindClobVarInMemory(ps, index, rs, type);
    5
    result = bindClobVarInMemory(ps, index, rs, type);
    5
    result = bindBlobVarInMemory(ps, index, rs, type);
    Differences
    Expression1Expression2Difference
    bindClobVarInMemorybindBlobVarInMemoryMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression bindClobVarInMemory(ps,index,rs,type) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    • Inline private method bindClobVarInMemory
    Expression bindBlobVarInMemory(ps,index,rs,type) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    • Inline private method bindBlobVarInMemory
    5
    result = bindBlobVarInMemory(ps, index, rs, type);
    6
    return result;
    6
    return result;
    Precondition Violations (6)
    Row Violation
    1Expression bindClobVarInFile(ps,index,rs,type) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression bindBlobVarInFile(ps,index,rs,type) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression bindClobVarInFile(ps,index,rs,type) is a void method call, and thus it cannot be parameterized
    4Expression bindBlobVarInFile(ps,index,rs,type) is a void method call, and thus it cannot be parameterized
    5Expression bindClobVarInMemory(ps,index,rs,type) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    6Expression bindBlobVarInMemory(ps,index,rs,type) is a method call throwing exception(s) that should be caught by a try block that will be extracted