File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/Configuration.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/Configuration.java | |||
Method name: Configuration addFile(File)
|
Method name: Configuration addXML(String)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 9 | |||
1 | if ( log.isDebugEnabled() ) {↵ | |||
2 | log.debug( "Mapping XML:\n" + xml );↵ | |||
3 | }↵ | |||
1 | try {↵ | 4 | try {↵ | |
2 | List errors = new ArrayList();↵ | 5 | List errors = new ArrayList();↵ | |
3 | org.dom4j.Document doc = xmlHelper.createSAXReader( xmlFile.toString(), errors, entityResolver )↵ | 6 | org.dom4j.Document doc = xmlHelper.createSAXReader( "XML String", errors, entityResolver )↵ | |
4 | .read( xmlFile );↵ | 7 | .read( new StringReader( xml ) );↵ | |
5 | if ( errors.size() != 0 ) {↵ | 8 | if ( errors.size() != 0 ) {↵ | |
6 | throw new InvalidMappingException( "file", xmlFile.toString(), ( Throwable ) errors.get( 0 ) );↵ | 9 | throw new MappingException( "invalid mapping", (Throwable) errors.get( 0 ) );↵ | |
7 | }↵ | 10 | }↵ | |
8 | add( doc );↵ | 11 | add( doc );↵ | |
9 | return this;↵ | 12 | ↵ | |
10 | }↵ | |||
11 | catch ( InvalidMapping↵ | 13 | }↵ | |
12 | Exception e ) {↵ | 14 | catch (DocumentException e) {↵ | |
13 | throw e;↵ | 15 | throw ↵ | |
14 | }↵ | |||
15 | catch ( MappingNotFoundException e ) {↵ | |||
16 | throw e;↵ | |||
17 | }↵ | |||
18 | catch ( Exception e ) {↵ | |||
19 | throw new InvalidMappingException( "file", xmlFile.toString(), e );↵ | 16 | new MappingException( "Could not parse mapping document in XML string", e );↵ | |
20 | } | 17 | }↵ | |
18 |
| |||
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 declared in the same class |
Number of node comparisons | 9 |
Number of mapped statements | 3 |
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 | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5 | List errors = new ArrayList(); | 4 | List errors = new ArrayList(); | ||||||||||||||||||
7 | if (errors.size() != 0) | 6 | if (errors.size() != 0) | ||||||||||||||||||
8 | throw new InvalidMappingException("file", xmlFile.toString(), (Throwable)errors.get(0)); |
| 7 | throw new MappingException("invalid mapping", (Throwable)errors.get(0)); |
Row | Violation |
---|---|
1 | Expression new InvalidMappingException("file",xmlFile.toString(),(Throwable)errors.get(0)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new MappingException("invalid mapping",(Throwable)errors.get(0)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression new InvalidMappingException("file",xmlFile.toString(),(Throwable)errors.get(0)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression new MappingException("invalid mapping",(Throwable)errors.get(0)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |