File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tool/hbm2ddl/SchemaValidatorTask.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tool/hbm2ddl/SchemaUpdateTask.java | |||
Method name: Configuration getConfiguration()
|
Method name: Configuration getConfiguration()
|
|||
Number of AST nodes: 12 | Number of AST nodes: 12 | |||
1 | Configuration cfg = new Configuration();↵ | 1 | Configuration cfg = new Configuration();↵ | |
2 | if (namingStrategy!=null) {↵ | 2 | if (namingStrategy!=null) {↵ | |
3 | cfg.setNamingStrategy(↵ | 3 | cfg.setNamingStrategy(↵ | |
4 | (NamingStrategy) ReflectHelper.classForName(namingStrategy).newInstance()↵ | 4 | (NamingStrategy) ReflectHelper.classForName(namingStrategy).newInstance()↵ | |
5 | );↵ | 5 | );↵ | |
6 | }↵ | 6 | }↵ | |
7 | if (configurationFile!=null) {↵ | 7 | if (configurationFile!=null) {↵ | |
8 | cfg.configure( configurationFile );↵ | 8 | cfg.configure( configurationFile );↵ | |
9 | }↵ | 9 | }↵ | |
10 | String[] files = getFiles();↵ | 10 | String[] files = getFiles();↵ | |
11 | for (int i = 0; i < files.length; i++) {↵ | 11 | for (int i = 0; i < files.length; i++) {↵ | |
12 | String filename = files[i];↵ | 12 | String filename = files[i];↵ | |
13 | if ( filename.endsWith(".jar") ) {↵ | 13 | if ( filename.endsWith(".jar") ) {↵ | |
14 | cfg.addJar( new File(filename) );↵ | 14 | cfg.addJar( new File(filename) );↵ | |
15 | }↵ | 15 | }↵ | |
16 | else {↵ | 16 | else {↵ | |
17 | cfg.addFile(filename);↵ | 17 | cfg.addFile(filename);↵ | |
18 | }↵ | 18 | }↵ | |
19 | }↵ | 19 | }↵ | |
20 | return cfg; | 20 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.5 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 31 |
Number of mapped statements | 12 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 2.2 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
1 | Configuration cfg = new Configuration(); | 1 | Configuration cfg = new Configuration(); | |
2 | if (namingStrategy != null) | 2 | if (namingStrategy != null) | |
3 | cfg.setNamingStrategy((NamingStrategy)ReflectHelper.classForName(namingStrategy).newInstance()); | 3 | cfg.setNamingStrategy((NamingStrategy)ReflectHelper.classForName(namingStrategy).newInstance()); | |
4 | if (configurationFile != null) | 4 | if (configurationFile != null) | |
5 | cfg.configure(configurationFile); | 5 | cfg.configure(configurationFile); | |
6 | String[] files = getFiles(); | 6 | String[] files = getFiles(); | |
7 | for (int i = 0; i < files.length; i++) | 7 | for (int i = 0; i < files.length; i++) | |
8 | String filename = files[i]; | 8 | String filename = files[i]; | |
9 | if (filename.endsWith(".jar")) | 9 | if (filename.endsWith(".jar")) | |
10 | cfg.addJar(new File(filename)); | 10 | cfg.addJar(new File(filename)); | |
else | else | |||
11 | cfg.addFile(filename); | 11 | cfg.addFile(filename); | |
12 | return cfg; | 12 | return cfg; |
Row | Violation |
---|