File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/ConfigurationCache.java | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/ConfigurationCache.java | |||
Method name: void releaseEscape(Escape)
|
Method name: void releasePrinter(XMLString)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | ++freeEscapeIndex;↵ | 1 | ++freePrinterIndex;↵ | |
2 | if (escapes.length == freeEscapeIndex)↵ | 2 | if (printers.length == freePrinterIndex)↵ | |
3 | {↵ | 3 | {↵ | |
4 | currentSize += SIZE;↵ | 4 | currentSize += SIZE;↵ | |
5 | Escape newarray[] = new Escape [currentSize];↵ | 5 | XMLString newarray[] = new XMLString [currentSize];↵ | |
6 | System.arraycopy(escapes, 0, newarray, 0, escapes.length);↵ | 6 | System.arraycopy(printers, 0, newarray, 0, printers.length);↵ | |
7 | escapes = newarray;↵ | 7 | printers = newarray;↵ | |
8 | }↵ | 8 | }↵ | |
9 | escapes[freeEscapeIndex] = escape; | 9 | printers[freePrinterIndex] = printer; | |
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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 28 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | ++freeEscapeIndex; |
| 1 | ++freePrinterIndex; | |||||||||||||||||||
2 | if (escapes.length == freeEscapeIndex) |
| 2 | if (printers.length == freePrinterIndex) | |||||||||||||||||||
3 | currentSize += SIZE; | 3 | currentSize += SIZE; | ||||||||||||||||||||
|
| 4 | XMLString newarray[] = new XMLString[currentSize]; | ||||||||||||||||||||
4 | Escape newarray[] = new Escape[currentSize]; |
| | ||||||||||||||||||||
5 | System.arraycopy(escapes, 0, newarray, 0, escapes.length); |
| 5 | System.arraycopy(printers, 0, newarray, 0, printers.length); | |||||||||||||||||||
| 6 | printers = newarray; | |||||||||||||||||||||
6 | escapes = newarray; | | |||||||||||||||||||||
| 7 | printers[freePrinterIndex] = printer; | |||||||||||||||||||||
7 | escapes[freeEscapeIndex] = escape; | |
Row | Violation |
---|---|
1 | Expression freeEscapeIndex is a field being modified, and thus it cannot be parameterized |
2 | Expression freePrinterIndex is a field being modified, and thus it cannot be parameterized |
3 | Type org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.Escape[] of variable escapes does not match with type org.eclipse.emf.ecore.xmi.impl.XMLString[] of variable printers |
4 | Expression freeEscapeIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression freePrinterIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement XMLString newarray[]=new XMLString[currentSize]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Unmatched statement Escape newarray[]=new Escape[currentSize]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
8 | Type org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.Escape[] of variable escapes does not match with type org.eclipse.emf.ecore.xmi.impl.XMLString[] of variable printers |