File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/Mappings.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/Mappings.java | |||
Method name: Table addTable(String, String, String, String, boolean)
|
Method name: Table addDenormalizedTable(String, String, String, boolean, String, Table)
|
|||
Number of AST nodes: 13 | Number of AST nodes: 11 | |||
1 | String key = subselect==null ?↵ | 1 | String key = subselect==null ?↵ | |
2 | Table.qualify(catalog, schema, name) :↵ | 2 | Table.qualify(catalog, schema, name) :↵ | |
3 | subselect;↵ | 3 | subselect;↵ | |
4 | Table table = (Table) tables.get(key);↵ | 4 | ↵ | |
5 | if (table == null) {↵ | |||
6 | table = new Table(↵ | 5 | if ( tables.containsKey(key) ) {↵ | |
6 | throw new DuplicateMappingException("table", name);↵ | |||
7 | }↵ | |||
8 | ↵ | |||
7 | );↵ | 9 | Table table = new DenormalizedTable(includedTable);↵ | |
8 | table.setAbstract(isAbstract);↵ | 10 | table.setAbstract(isAbstract);↵ | |
9 | table.setName(name);↵ | 11 | table.setName(name);↵ | |
10 | table.setSchema(schema);↵ | 12 | table.setSchema(schema);↵ | |
11 | table.setCatalog(catalog);↵ | 13 | table.setCatalog(catalog);↵ | |
12 | table.setSubselect(subselect);↵ | 14 | table.setSubselect(subselect);↵ | |
13 | tables.put(key, table);↵ | 15 | tables.put(key, table);↵ | |
14 | }↵ | |||
15 | else {↵ | |||
16 | if (!isAbstract) table.setAbstract(false);↵ | |||
17 | }↵ | |||
18 | return table; | 16 |
| |
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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 76 |
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 4.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | String key = subselect == null ? Table.qualify(catalog, schema, name) : subselect; | ||||||||||||
3 | if (table == null) | | ||||||||||||
4 | table = new Table(); | | ||||||||||||
| 4 | Table table = new DenormalizedTable(includedTable); | ||||||||||||
5 | table.setAbstract(isAbstract); | 5 | table.setAbstract(isAbstract); | |||||||||||
6 | table.setName(name); | 6 | table.setName(name); | |||||||||||
7 | table.setSchema(schema); | 7 | table.setSchema(schema); | |||||||||||
8 | table.setCatalog(catalog); | 8 | table.setCatalog(catalog); | |||||||||||
9 | table.setSubselect(subselect); | 9 | table.setSubselect(subselect); | |||||||||||
10 | tables.put(key, table); | 10 | tables.put(key, table); | |||||||||||
11 | if (!isAbstract) |
| 2 | if (tables.containsKey(key)) | ||||||||||
|
| 3 | throw new DuplicateMappingException("table", name); | |||||||||||
12 | table.setAbstract(false); | | ||||||||||||
|
| 11 | return table; |
Row | Violation |
---|---|
1 | Unmatched throw new DuplicateMappingException("table",name); |
2 | Unmatched return table; |