public class DuplicateMappingException extends MappingException { private final String name; private final String type; public DuplicateMappingException(String customMessage, String type, String name) { super(customMessage); this.type=type; this.name=name; } public DuplicateMappingException(String type, String name) { this("Duplicate " + type + " mapping " + name, type, name); } public String getType() { return type; } public String getName() { return name
public static class EntityNotFoundException extends RuntimeException { private final String entityName; private final Serializable id; public EntityNotFoundException(String entityName, Serializable id) { this( "unable to locate specified entity", entityName, id ); } public EntityNotFoundException(String message, String entityName, Serializable id) { super( message ); this.entityName = entityName; this.id = id; } public String getEntityName() { return entityName; } public Serializable getId() { return id
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/DuplicateMappingException.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/jpa/AbstractJPATest.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class DuplicateMappingException extends MappingException {
1
public static class EntityNotFoundException extends RuntimeException {
2
	private final String name;
2
		private final String entityName;
3
	private final String type;
3
		private final Seri
4
	public DuplicateMappingException(String customMessage, String typ
4
alizable id;
5
e, String name) {
5
		public EntityNotFoundException(String entityName, Serializable id) {
6
		super(customMessage);
6
		
7
		this.type=type;
8
		this.name=name;
9
	}
10
	
11
	public DuplicateMapping
7
	this( "unable to locate specified entity", entityName, id );
8
		}
12
Exception(String type, String name) {
9
		public EntityNotFoundException(String message, String entityName, Serializable id) {
13
		this("Duplicate " + type + " mapping " + name, type, name);
10
		
14
	}
11
	super( message );
12
			this.entityName = entityName;
13
			this.id = id;
14
		}
15

15
	public String getType() {
16
		public String getEntityName() {
16
		return type;
17
			return 
17
	}
18
entityName;
19
		}
20

18
	
21
	
19
	public String getName() {
22
	public Serializable getId() {
20
		return name
23
			return id
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.0
Clones location
Number of node comparisons0