File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/config/MultipartUrlConfig.java | File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java | |||
Method name: String getHeaderValue(String, String)
|
Method name: String getBoundaryStringFromContentType(String)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 7 | |||
1 | String regularExpression = headerName + "\\s*:\\s*(.*)$"; //$NON-NLS-1$↵ | |||
2 | Perl5Matcher localMatcher = JMeterUtils.getMatcher();↵ | 1 | Perl5Matcher localMatcher = JMeterUtils.getMatcher();↵ | |
2 | String regularExpression = "^" + HTTPSamplerBase.HEADER_CONTENT_TYPE + ": multipart/form-data; boundary=(.+)$"; ↵ | |||
3 | Pattern pattern = JMeterUtils.getPattern(regularExpression, Perl5Compiler.READ_ONLY_MASK | Perl5Compiler.CASE_INSENSITIVE_MASK | Perl5Compiler.MULTILINE_MASK);↵ | 3 | Pattern pattern = JMeterUtils.getPattern(regularExpression, Perl5Compiler.READ_ONLY_MASK | Perl5Compiler.CASE_INSENSITIVE_MASK | Perl5Compiler.MULTILINE_MASK);↵ | |
4 | if(localMatcher.contains(multiPart, pattern)) {↵ | 4 | if(localMatcher.contains(requestHeaders, pattern)) {↵ | |
5 | return localMatcher.getMatch()↵ | 5 | MatchResult match = localMatcher.getMatch();↵ | |
6 | .group(1).trim();↵ | 6 | return match.group(1);↵ | |
7 | }↵ | 7 | }↵ | |
8 | else {↵ | 8 | else {↵ | |
9 | return null;↵ | 9 | return null;↵ | |
10 | } | 10 |
| |
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 | 21 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 1.7 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | String regularExpression = headerName + "\\s*:\\s*(.*)$"; |
| 2 | String regularExpression = "^" + HTTPSamplerBase.HEADER_CONTENT_TYPE + ": multipart/form-data; boundary=(.+)$"; | ||||||||||||||||
2 | Perl5Matcher localMatcher = JMeterUtils.getMatcher(); | 1 | Perl5Matcher localMatcher = JMeterUtils.getMatcher(); | |||||||||||||||||
3 | Pattern pattern = JMeterUtils.getPattern(regularExpression, Perl5Compiler.READ_ONLY_MASK | Perl5Compiler.CASE_INSENSITIVE_MASK | Perl5Compiler.MULTILINE_MASK); | 3 | Pattern pattern = JMeterUtils.getPattern(regularExpression, Perl5Compiler.READ_ONLY_MASK | Perl5Compiler.CASE_INSENSITIVE_MASK | Perl5Compiler.MULTILINE_MASK); | |||||||||||||||||
4 | if (localMatcher.contains(multiPart, pattern)) |
| 4 | if (localMatcher.contains(requestHeaders, pattern)) | ||||||||||||||||
| 5 | MatchResult match = localMatcher.getMatch(); | ||||||||||||||||||
5 | return localMatcher.getMatch().group(1).trim(); | | ||||||||||||||||||
|
| 6 | return match.group(1); | |||||||||||||||||
else | else | |||||||||||||||||||
6 | return null; | 7 | return null; |
Row | Violation |
---|---|
1 | Unmatched return match.group(1); |