public class DoubleType extends PrimitiveType { public Serializable getDefaultValue() { return new Double(0.0); } public Object get(ResultSet rs, String name) throws SQLException { return new Double( rs.getDouble(name) ); } public Class getPrimitiveClass() { return double.class; } public Class getReturnedClass() { return Double.class; } public void set(PreparedStatement st, Object value, int index) throws SQLException { st.setDouble( index, ( (Double) value ).doubleValue() ); } public int sqlType() { return Types.DOUBLE; } public String getName() { return "double"; } public String objectToSQLString(Object value, Dialect dialect) throws Exception { return value.toString(); } public Object fromStringValue(String xml) { return new Double(xml);
public class FloatType extends PrimitiveType { public Serializable getDefaultValue() { return new Float(0.0); } public Object get(ResultSet rs, String name) throws SQLException { return new Float( rs.getFloat(name) ); } public Class getPrimitiveClass() { return float.class; } public Class getReturnedClass() { return Float.class; } public void set(PreparedStatement st, Object value, int index) throws SQLException { st.setFloat( index, ( (Float) value ).floatValue() ); } public int sqlType() { return Types.FLOAT; } public String getName() { return "float"; } public String objectToSQLString(Object value, Dialect dialect) throws Exception { return value.toString(); } public Object fromStringValue(String xml) { return new Float(xml);
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/type/DoubleType.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/type/FloatType.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class DoubleType extends PrimitiveType {
1
public class FloatType extends PrimitiveType {
2
	public Serializable getDefaultValue() {
2
	public Serializable getDefaultValue() {
3
		return new Double(0.0);
3
		return new Float(0.0);
4
	}
4
	}
5
	
5
	
6
	public Object get(ResultSet rs, String name) throws SQLException {
6
	public Object get(ResultSet rs, String name) throws SQLException {
7
		return new Double( rs.getDouble(name) );
7
		return new Float( rs.getFloat(name) );
8
	}
8
	}
9
	public Class getPrimitiveClass() {
9
	public Class getPrimitiveClass() {
10
		return double.class;
10
		return float.class;
11
	}
11
	}
12
	public Class getReturnedClass() {
12
	public Class getReturnedClass() {
13
		return Double.class;
13
		return Float.class;
14
	}
14
	}
15
	public void set(PreparedStatement st, Object value, int index)
15
	public void set(PreparedStatement st, Object value, int index)
16
		throws SQLException {
16
	throws SQLException {
17
		st.setDouble( index, ( (Double) value ).doubleValue() );
17
		st.setFloat( index, ( (Float) value ).floatValue() );
18
	}
18
	}
19
	public int sqlType() {
19
	public int sqlType() {
20
		return Types.DOUBLE;
20
		return Types.FLOAT;
21
	}
21
	}
22
	public String getName() { return "double"; }
22
	public String getName() { return "float"; }
23
	public String objectToSQLString(Object value, Dialect dialect) throws Exception {
23
	public String objectToSQLString(Object value, Dialect dialect) throws Exception {
24
		return value.toString();
24
		return value.toString();
25
	}
25
	}
26
	public Object fromStringValue(String xml) {
26
	public Object fromStringValue(String xml) {
27
		return new Double(xml);
27
		return new Float(xml);
28
	
28
	
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