public Object validateAndConvert(String value, Object originalValue, StringBuffer messageBuffer) { // handle null, which is shown as the special string "<null>" if (value.equals("<null>") || value.equals("")) return null; // Do the conversion into the object in a safe manner try { Object obj = new Byte(value); return obj; } catch (Exception e) { messageBuffer.append(e.toString()+"\n"); //?? do we need the message also, or is it automatically part of the toString()? //messageBuffer.append(e.getMessage()); return null;
public Object validateAndConvert(String value, Object originalValue, StringBuffer messageBuffer) { // handle null, which is shown as the special string "<null>" if (value.equals("<null>") || value.equals("")) return null; // Do the conversion into the object in a safe manner try { Object obj = new Long(value); return obj; } catch (Exception e) { messageBuffer.append(e.toString()+"\n"); //?? do we need the message also, or is it automatically part of the toString()? //messageBuffer.append(e.getMessage()); return null;
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeByte.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeLong.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public Object validateAndConvert(String value, Object originalValue, StringBuffer messageBuffer) {
1
public Object validateAndConvert(String value, Object originalValue, StringBuffer messageBuffer) {
2
		// handle null, which is shown as the special string "<null>"
2
		// handle null, which is shown as the special string "<null>"
3
		if (value.equals("<null>") || value.equals(""))
3
		if (value.equals("<null>") || value.equals(""))
4
			return null;
4
			return null;
5
		// Do the conversion into the object in a safe manner
5
		// Do the conversion into the object in a safe manner
6
		try {
6
		try {
7
			Object obj = new Byte(value);
7
			Object obj = new Long(value);
8
			return obj;
8
			return obj;
9
		}
9
		}
10
		catch (Exception e) {
10
		catch (Exception e) {
11
			messageBuffer.append(e.toString()+"\n");
11
			messageBuffer.append(e.toString()+"\n");
12
			//?? do we need the message also, or is it automatically part of the toString()?
12
			//?? do we need the message also, or is it automatically part of the toString()?
13
			//messageBuffer.append(e.getMessage());
13
			//messageBuffer.append(e.getMessage());
14
			return null;
14
			return null;
15
		
15
		
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0