String key = subselect==null ? Table.qualify(catalog, schema, name) : subselect; Table table = (Table) tables.get(key); if (table == null) { table = new Table(); table.setAbstract(isAbstract); table.setName(name); table.setSchema(schema); table.setCatalog(catalog); table.setSubselect(subselect); tables.put(key, table); } else { if (!isAbstract) table.setAbstract(false); } return table;
String key = subselect==null ? Table.qualify(catalog, schema, name) : subselect; if ( tables.containsKey(key) ) { throw new DuplicateMappingException("table", name); } Table table = new DenormalizedTable(includedTable); table.setAbstract(isAbstract); table.setName(name); table.setSchema(schema); table.setCatalog(catalog); table.setSubselect(subselect); tables.put(key, table); return table;
Clone fragments detected by clone detection tool
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
		return table;
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.1
Clones locationClones are declared in the same class
Number of node comparisons76