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 = Boolean.valueOf(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/DataTypeBoolean.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
	{
2
 {
3
		// handle null, which is shown as the special string "<null>"
3
		// handle null, which is shown as the special string "<null>"
4
		if (value.equals("<null>") || value.equals("")) 
4
		if (value.equals("<null>") || value.equals(""))
5
return null;
5
			return null;
6
		// Do the conversion into the object in a safe manner
6
		// Do the conversion into the object in a safe manner
7
		try
7
		try
8
		{
8
 {
9
			Object obj = Boolean.valueOf(value);
9
			Object obj = new Long(value);
10
			return obj;
10
			return obj;
11
		}
11
		}
12
		catch (Exception e)
12
		catch (Exception e)
13
		{
13
 {
14
			messageBuffer.append(e.toString() + "\n");
14
			messageBuffer.append(e.toString()+"\n");
15
			// ?? do we need the message also, or is it automatically part of the toString()?
15
			//?? do we need the message also, or is it automatically part of the toString()?
16
			// messageBuffer.append(e.getMessage());
16
			//messageBuffer.append(e.getMessage());
17
			return null;
17
			return null;
18
		
18
		
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