if(s.charAt(0) == 'r') permissions += 0400; if(s.charAt(1) == 'w') permissions += 0200; if(s.charAt(2) == 'x') permissions += 0100;
if(s.charAt(2) == 'S') permissions += 04000; if(s.charAt(3) == 'r') permissions += 040; if(s.charAt(4) == 'w') permissions += 020;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/MiscUtilities.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/MiscUtilities.java
Method name: int parsePermissions(String) Method name: int parsePermissions(String)
Number of AST nodes: 5 Number of AST nodes: 6
1
if(s.charAt(0) == 'r')
1
if(s.charAt(2) == 'S')
2
				permissions += 0400;
2
				permissions += 04000;
3
			if(s.charAt(1) == 'w')
3
			if(s.charAt(3) == 'r')
4
				permissions += 0200;
4
				permissions += 040;
5
			if(s.charAt(2) == 'x')
5
			if(s.charAt(4) == 'w')
6
				permissions += 0100;
6
				permissions += 020;
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.7
Clones locationClones are in the same method
Number of node comparisons16
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (s.charAt(0) == 'r')
    3
    if (s.charAt(0) == 'r')
    13
    if (s.charAt(3) == 'r')
    Differences
    Expression1Expression2Difference
    03LITERAL_VALUE_MISMATCH
    13
    if (s.charAt(3) == 'r')
    4
    permissions += 0400;
    4
    permissions += 0400;
    14
    permissions += 040;
    Differences
    Expression1Expression2Difference
    0400040LITERAL_VALUE_MISMATCH
    14
    permissions += 040;
    5
    if (s.charAt(1) == 'w')
    5
    if (s.charAt(1) == 'w')
    11
    if (s.charAt(2) == 'S')
    Differences
    Expression1Expression2Difference
    12LITERAL_VALUE_MISMATCH
    'w''S'LITERAL_VALUE_MISMATCH
    11
    if (s.charAt(2) == 'S')
    6
    permissions += 0200;
    6
    permissions += 0200;
    12
    permissions += 04000;
    Differences
    Expression1Expression2Difference
    020004000LITERAL_VALUE_MISMATCH
    12
    permissions += 04000;
    Precondition Violations (0)
    Row Violation