Perl5Matcher localMatcher = JMeterUtils.getMatcher(); // The headers and body are divided by a blank line String regularExpression = "^.$"; Pattern pattern = JMeterUtils.getPattern(regularExpression, Perl5Compiler.READ_ONLY_MASK | Perl5Compiler.CASE_INSENSITIVE_MASK | Perl5Compiler.MULTILINE_MASK); PatternMatcherInput input = new PatternMatcherInput(stringToCheck); while(localMatcher.contains(input, pattern)) { MatchResult match = localMatcher.getMatch(); return match.beginOffset(0); } // No divider was found return -1;
Perl5Matcher localMatcher = JMeterUtils.getMatcher(); // The headers and body are divided by a blank line (the \r is to allow for the CR before LF) String regularExpression = "^\\r$"; // $NON-NLS-1$ Pattern pattern = JMeterUtils.getPattern(regularExpression, Perl5Compiler.READ_ONLY_MASK | Perl5Compiler.CASE_INSENSITIVE_MASK | Perl5Compiler.MULTILINE_MASK); PatternMatcherInput input = new PatternMatcherInput(stringToCheck); if(localMatcher.contains(input, pattern)) { MatchResult match = localMatcher.getMatch(); return match.beginOffset(0); } // No divider was found return -1;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/control/HttpMirrorThread.java
Method name: int getPositionOfBody(String) Method name: int getPositionOfBody(String)
Number of AST nodes: 8 Number of AST nodes: 8
1
Perl5Matcher localMatcher = JMeterUtils.getMatcher();
1
Perl5Matcher localMatcher = JMeterUtils.getMatcher();
2
        // The headers and body are divided by a blank line
2
        // The headers and body are divided by a blank line (the \r is to allow for the CR before LF)
3
        String regularExpression = "^.$"; 
3
        String regularExpression = "^\\r$"; // $NON-NLS-1$
4
        Pattern pattern = JMeterUtils.getPattern(regularExpression, Perl5Compiler.READ_ONLY_MASK | Perl5Compiler.CASE_INSENSITIVE_MASK | Perl5Compiler.MULTILINE_MASK);
4
        Pattern pattern = JMeterUtils.getPattern(regularExpression, Perl5Compiler.READ_ONLY_MASK | Perl5Compiler.CASE_INSENSITIVE_MASK | Perl5Compiler.MULTILINE_MASK);
5
        
5
        
6
        PatternMatcherInput input = new PatternMatcherInput(stringToCheck);
6
        PatternMatcherInput input = new PatternMatcherInput(stringToCheck);
7
        while(localMatcher.contains(input, pattern)) {
7
        if(localMatcher.contains(input, pattern)) {
8
            MatchResult match = localMatcher.getMatch();
8
            MatchResult match = localMatcher.getMatch();
9
            return match.beginOffset(0);
9
            return match.beginOffset(0);
10
        }
10
        }
11
        // No divider was found
11
        // No divider was found
12
        return -1;
12
        return -1;
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are in different classes
Number of node comparisons1