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); | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 19 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.5 |
Clone type | Type 2 |
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); | ||||
7 | return new SchemaExport(cfg).setHaltOnError(haltOnError).setOutputFile(outputFile.getPath()).setDelimiter(delimiter); |
| |
Row | Violation |
---|---|
1 | Unmatched return new SchemaValidator(cfg); |
2 | Unmatched return new SchemaExport(cfg).setHaltOnError(haltOnError).setOutputFile(outputFile.getPath()).setDelimiter(delimiter); |