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 configure(URL)
|
Method name: Configuration configure(File)
|
|||
Number of AST nodes: 3 | Number of AST nodes: 3 | |||
1 | log.info( "configuring from url: " + url.toString() );↵ | 1 | log.info( "configuring from file: " + configFile.getName() );↵ | |
2 | try {↵ | 2 | try {↵ | |
3 | return doConfigure( url.openStream(), url.toString() );↵ | 3 | return doConfigure( new FileInputStream( configFile ), configFile.toString() );↵ | |
4 | }↵ | 4 | }↵ | |
5 | catch (IOException ioe) {↵ | 5 | catch (FileNotFoundException fnfe) {↵ | |
6 | throw new HibernateException( "could not configure from URL: " + url, ioe );↵ | 6 | throw new HibernateException( "could not find file: " + configFile, fnfe );↵ | |
7 | } | 7 |
| |
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 5 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 2.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | log.info("configuring from file: " + configFile.getName()); | ||||||||||||||||||||||||||||||||||
1 | log.info("configuring from url: " + url.toString()); | | ||||||||||||||||||||||||||||||||||
2 | try |
| 2 | try | ||||||||||||||||||||||||||||||||
|
| 3 | return doConfigure(new FileInputStream(configFile), configFile.toString()); | |||||||||||||||||||||||||||||||||
3 | return doConfigure(url.openStream(), url.toString()); |
| |
Row | Violation |
---|---|
1 | Type java.net.URL of variable url does not match with type java.io.File of variable configFile |
2 | Unmatched statement return doConfigure(new FileInputStream(configFile),configFile.toString()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement return doConfigure(new FileInputStream(configFile),configFile.toString()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
4 | Unmatched return doConfigure(new FileInputStream(configFile),configFile.toString()); |
5 | Unmatched statement return doConfigure(url.openStream(),url.toString()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
6 | Unmatched statement return doConfigure(url.openStream(),url.toString()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
7 | Unmatched return doConfigure(url.openStream(),url.toString()); |