InputStream in = cache.passiveAdd("test1",new ByteArrayInputStream(random1)); byte[] test = new byte[1000]; in.read(test); in.close(); assertEquals(1000, cache.getActSize());
InputStream in = cache.passiveAdd("test1",new ByteArrayInputStream(random)); byte[] test = new byte[1000]; in.read(test); in.close(); assertEquals(1000, cache.getActSize());
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/test/java/org/columba/core/io/StreamCacheTest.java File path: /columba-1.4-src/core/src/test/java/org/columba/core/io/StreamCacheTest.java
Method name: void testMaxsize() Method name: void testAdd()
Number of AST nodes: 5 Number of AST nodes: 5
1
InputStream in = cache.passiveAdd("test1",new ByteArrayInputStream(random1));
1
InputStream in = cache.passiveAdd("test1",new ByteArrayInputStream(random));
2
		
2
		
3
		byte[] test = new byte[1000];
3
		byte[] test = new byte[1000];
4
		in.read(test);		
4
		in.read(test);		
5
		in.close();
5
		in.close();
6
		
6
		
7
		assertEquals(1000, cache.getActSize());
7
		assertEquals(1000, cache.getActSize());
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are declared in the same class
Number of node comparisons13
  1. {Non-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
    8
    InputStream in = cache.passiveAdd("test1", new ByteArrayInputStream(random1));
    8
    InputStream in = cache.passiveAdd("test1", new ByteArrayInputStream(random1));
    4
    InputStream in = cache.passiveAdd("test1", new ByteArrayInputStream(random));
    Differences
    Expression1Expression2Difference
    random1randomVARIABLE_NAME_MISMATCH
    4
    InputStream in = cache.passiveAdd("test1", new ByteArrayInputStream(random));
    9
    byte[] test = new byte[1000];
    5
    byte[] test = new byte[1000];
    10
    in.read(test);
    6
    in.read(test);
    11
    in.close();
    7
    in.close();
    12
    assertEquals(1000, cache.getActSize());
    8
    assertEquals(1000, cache.getActSize());
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables in, test , while Clone fragment #2 returns variables in, test