File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/regexp/RegexpFactory.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/regexp/RegexpMatcherFactory.java | |||
Method name: Regexp newRegexp(Project)
|
Method name: RegexpMatcher newRegexpMatcher(Project)
|
|||
Number of AST nodes: 10 | Number of AST nodes: 10 | |||
1 | try {↵ | 1 | try {↵ | |
2 | testAvailability("java.util.regex.Matcher");↵ | 2 | testAvailability("java.util.regex.Matcher");↵ | |
3 | return createRegexpInstance("org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp");↵ | 3 | return createInstance("org.apache.tools.ant.util.regexp.Jdk14RegexpMatcher");↵ | |
4 | } catch (BuildException be) {↵ | 4 | } catch (BuildException be) {↵ | |
5 | cause = orCause(cause, be, JavaEnvUtils.getJavaVersionNumber() < 14);↵ | 5 | cause = orCause(cause, be, JavaEnvUtils.getJavaVersionNumber() < 14);↵ | |
6 | }↵ | 6 | }↵ | |
7 | try {↵ | 7 | try {↵ | |
8 | testAvailability("org.apache.oro.text.regex.Pattern");↵ | 8 | testAvailability("org.apache.oro.text.regex.Pattern");↵ | |
9 | return createRegexpInstance("org.apache.tools.ant.util.regexp.JakartaOroRegexp");↵ | 9 | return createInstance("org.apache.tools.ant.util.regexp.JakartaOroMatcher");↵ | |
10 | } catch (BuildException be) {↵ | 10 | } catch (BuildException be) {↵ | |
11 | cause = orCause(cause, be, true);↵ | 11 | cause = orCause(cause, be, true);↵ | |
12 | }↵ | 12 | }↵ | |
13 | try {↵ | 13 | try {↵ | |
14 | testAvailability("org.apache.regexp.RE");↵ | 14 | testAvailability("org.apache.regexp.RE");↵ | |
15 | return createRegexpInstance("org.apache.tools.ant.util.regexp.JakartaRegexpRegexp");↵ | 15 | return createInstance("org.apache.tools.ant.util.regexp.JakartaRegexpMatcher");↵ | |
16 | } catch (BuildException be) {↵ | 16 | } catch (BuildException be) {↵ | |
17 | cause = orCause(cause, be, true);↵ | 17 | cause = orCause(cause, be, true);↵ | |
18 | }↵ | 18 | }↵ | |
19 | throw new BuildException(↵ | 19 | throw new BuildException(↵ | |
20 | "No supported regular expression matcher found"↵ | 20 | "No supported regular expression matcher found"↵ | |
21 | + (cause != null ? ": " + cause : ""), cause); | 21 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 1.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 58 |
Number of mapped statements | 10 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 54.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8 | try | 8 | try | ||||||||||||||||
9 | testAvailability("java.util.regex.Matcher"); | 9 | testAvailability("java.util.regex.Matcher"); | ||||||||||||||||
10 | return createRegexpInstance("org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp"); |
| 10 | return createInstance("org.apache.tools.ant.util.regexp.Jdk14RegexpMatcher"); | |||||||||||||||
11 | try | 11 | try | ||||||||||||||||
12 | testAvailability("org.apache.oro.text.regex.Pattern"); | 12 | testAvailability("org.apache.oro.text.regex.Pattern"); | ||||||||||||||||
13 | return createRegexpInstance("org.apache.tools.ant.util.regexp.JakartaOroRegexp"); |
| 13 | return createInstance("org.apache.tools.ant.util.regexp.JakartaOroMatcher"); | |||||||||||||||
14 | try | 14 | try | ||||||||||||||||
15 | testAvailability("org.apache.regexp.RE"); | 15 | testAvailability("org.apache.regexp.RE"); | ||||||||||||||||
16 | return createRegexpInstance("org.apache.tools.ant.util.regexp.JakartaRegexpRegexp"); |
| 16 | return createInstance("org.apache.tools.ant.util.regexp.JakartaRegexpMatcher"); | |||||||||||||||
17 | throw new BuildException("No supported regular expression matcher found" + (cause != null ? ": " + cause : ""), cause); | 17 | throw new BuildException("No supported regular expression matcher found" + (cause != null ? ": " + cause : ""), cause); |
Row | Violation |
---|---|
1 | Expression createRegexpInstance("org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp") is a method call throwing exception(s) that should be caught by a try block that will be extracted |
2 | Expression createInstance("org.apache.tools.ant.util.regexp.Jdk14RegexpMatcher") is a method call throwing exception(s) that should be caught by a try block that will be extracted |
3 | Expression createRegexpInstance("org.apache.tools.ant.util.regexp.JakartaOroRegexp") is a method call throwing exception(s) that should be caught by a try block that will be extracted |
4 | Expression createInstance("org.apache.tools.ant.util.regexp.JakartaOroMatcher") is a method call throwing exception(s) that should be caught by a try block that will be extracted |
5 | Expression createRegexpInstance("org.apache.tools.ant.util.regexp.JakartaRegexpRegexp") is a method call throwing exception(s) that should be caught by a try block that will be extracted |
6 | Expression createInstance("org.apache.tools.ant.util.regexp.JakartaRegexpMatcher") is a method call throwing exception(s) that should be caught by a try block that will be extracted |