Properties properties = new Properties(); properties.putAll( cfg.getProperties() ); if (propertiesFile == null) { properties.putAll( getProject().getProperties() ); } else { properties.load( new FileInputStream(propertiesFile) ); } cfg.setProperties(properties); return new SchemaExport(cfg) .setHaltOnError(haltOnError) .setOutputFile( outputFile.getPath() ) .setDelimiter(delimiter);
Properties properties = new Properties(); properties.putAll( cfg.getProperties() ); if (propertiesFile == null) { properties.putAll( getProject().getProperties() ); } else { properties.load( new FileInputStream(propertiesFile) ); } cfg.setProperties(properties); return new SchemaValidator(cfg);
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tool/hbm2ddl/SchemaExportTask.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tool/hbm2ddl/SchemaValidatorTask.java
Method name: SchemaExport getSchemaExport(Configuration) Method name: SchemaValidator getSchemaValidator(Configuration)
Number of AST nodes: 7 Number of AST nodes: 7
1
Properties properties = new Properties();
1
Properties properties = new Properties();
2
		properties.putAll( cfg.getProperties() );
2
		properties.putAll( cfg.getProperties() );
3
		if (propertiesFile == null) {
3
		if (propertiesFile == null) {
4
			properties.putAll( getProject().getProperties() );
4
			properties.putAll( getProject().getProperties() );
5
		}
5
		}
6
		else {
6
		else {
7
			properties.load( new FileInputStream(propertiesFile) );
7
			properties.load( new FileInputStream(propertiesFile) );
8
		}
8
		}
9
		cfg.setProperties(properties);
9
		cfg.setProperties(properties);
10
		return new SchemaExport(cfg)
10
		return new Schema
11
				.setHaltOnError(haltOnError)
12
				.setOutputFile( outputFile.getPath() )
13
				.setDelimiter(delimiter);
11
Validator(cfg);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in different classes having the same super class
Number of node comparisons19
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Properties properties = new Properties();
    1
    Properties properties = new Properties();
    2
    properties.putAll(cfg.getProperties());
    2
    properties.putAll(cfg.getProperties());
    3
    if (propertiesFile == null)
    3
    if (propertiesFile == null)
    4
    properties.putAll(getProject().getProperties());
    4
    properties.putAll(getProject().getProperties());
    else
    else
    5
    properties.load(new FileInputStream(propertiesFile));
    5
    properties.load(new FileInputStream(propertiesFile));
    6
    cfg.setProperties(properties);
    6
    cfg.setProperties(properties);
                                                                          
    7
    return new SchemaValidator(cfg);
    Preondition Violations
    Unmatched return new SchemaValidator(cfg);
    7
    return new SchemaValidator(cfg);
    7
    return new SchemaExport(cfg).setHaltOnError(haltOnError).setOutputFile(outputFile.getPath()).setDelimiter(delimiter);
    7
    return new SchemaExport(cfg).setHaltOnError(haltOnError).setOutputFile(outputFile.getPath()).setDelimiter(delimiter);
    Preondition Violations
    Unmatched return new SchemaExport(cfg).setHaltOnError(haltOnError).setOutputFile(outputFile.getPath()).setDelimiter(delimiter);
                                                                                                                                                                                                                                                    
    Precondition Violations (2)
    Row Violation
    1Unmatched return new SchemaValidator(cfg);
    2Unmatched return new SchemaExport(cfg).setHaltOnError(haltOnError).setOutputFile(outputFile.getPath()).setDelimiter(delimiter);