URL url = new URL("http://d.e.f/goo.html"); man.addCookieFromHeader("test=moo", url); String s = man.getCookieHeaderForURL(new URL("http://d.e.f/")); assertNotNull(s); assertEquals("test=moo", s);
URL url = new URL("http://d.e.f/moo.html"); man.addCookieFromHeader("test=moo;path=/", url); String s = man.getCookieHeaderForURL(new URL("http://d.e.f/goo.html")); assertNotNull(s); assertEquals("test=moo", s);
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/control/TestCookieManager.java File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/control/TestCookieManager.java
Method name: void testMissingPath0() Method name: void testRootPath1()
Number of AST nodes: 5 Number of AST nodes: 5
1
URL url = new URL("http://d.e.f/goo.html");
1
URL url = new URL("http://d.e.f/moo.html");
2
 			man.addCookieFromHeader("test=moo", url);
2
 			man.addCookieFromHeader("test=moo;path=/", url);
3
 			String s = man.getCookieHeaderForURL(new URL("http://d.e.f/"));
3
 			String s = man.getCookieHeaderForURL(new URL("http://d.e.f/goo.html"));
4
 			assertNotNull(s);
4
 			assertNotNull(s);
5
 			assertEquals("test=moo", s);
5
 			assertEquals("test=moo", s);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are declared in the same class
Number of node comparisons17
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    URL url = new URL("http://d.e.f/goo.html");
    1
    URL url = new URL("http://d.e.f/goo.html");
    1
    URL url = new URL("http://d.e.f/moo.html");
    Differences
    Expression1Expression2Difference
    "http://d.e.f/goo.html""http://d.e.f/moo.html"LITERAL_VALUE_MISMATCH
    1
    URL url = new URL("http://d.e.f/moo.html");
    2
    man.addCookieFromHeader("test=moo", url);
    2
    man.addCookieFromHeader("test=moo", url);
    2
    man.addCookieFromHeader("test=moo;path=/", url);
    Differences
    Expression1Expression2Difference
    "test=moo""test=moo;path=/"LITERAL_VALUE_MISMATCH
    2
    man.addCookieFromHeader("test=moo;path=/", url);
    3
    String s = man.getCookieHeaderForURL(new URL("http://d.e.f/"));
    3
    String s = man.getCookieHeaderForURL(new URL("http://d.e.f/"));
    3
    String s = man.getCookieHeaderForURL(new URL("http://d.e.f/goo.html"));
    Differences
    Expression1Expression2Difference
    "http://d.e.f/""http://d.e.f/goo.html"LITERAL_VALUE_MISMATCH
    3
    String s = man.getCookieHeaderForURL(new URL("http://d.e.f/goo.html"));
    4
    assertNotNull(s);
    4
    assertNotNull(s);
    5
    assertEquals("test=moo", s);
    5
    assertEquals("test=moo", s);
    Precondition Violations (0)
    Row Violation