File path: /jruby-1.4.0/src/org/jruby/RubyDigest.java | File path: /jruby-1.4.0/src/org/jruby/java/invokers/ConstructorInvoker.java | |||
Method name: MessageDigest createMessageDigest(Ruby, String)
|
Method name: void ConstructorInvoker(RubyModule, List
|
|||
Number of AST nodes: 3 | Number of AST nodes: 3 | |||
1 | if(provider != null) {↵ | 1 | if (!Ruby.isSecurityRestricted()) {↵ | |
2 | try {↵ | 2 | try {↵ | |
3 | return MessageDigest.getInstance(providerName, provider);↵ | 3 | Method.setAccessible(this.ctors, true);↵ | |
4 | } catch(NoSuchAlgorithmException e) {↵ | 4 | } catch(SecurityException e) {↵ | |
5 | // bouncy castle doesn't support algorithm↵ | |||
6 | }↵ | 5 | }↵ | |
7 | } | 6 |
| |
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 in different classes |
Number of node comparisons | 5 |
Number of mapped statements | 1 |
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) | 0.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | try |
| 4 | try | |||||||||||||
3 | return MessageDigest.getInstance(providerName, provider); |
| | ||||||||||||||
|
| 5 | Method.setAccessible(this.ctors, true); |
Row | Violation |
---|---|
1 | Unmatched statement return MessageDigest.getInstance(providerName,provider); 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 |
2 | Unmatched return MessageDigest.getInstance(providerName,provider); |
3 | Unmatched statement Method.setAccessible(this.ctors,true); 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 |