IContainer[] frames = FrameManager.getInstance().getOpenFrames(); if (frames.length == 0) { LOG.warning(getClass().getName() + ": Not enough open frames!"); return null; } return frames[0];
IContainer[] frames = FrameManager.getInstance().getOpenFrames(); if (frames.length == 0) { LOG.warning(getClass().getName() + ": Not enough open frames!"); return null; } return frames[0];
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/scripting/extensions/MenuExtensionPoint.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/scripting/extensions/ToolbarExtensionPoint.java
Method name: IContainer getFirstContainer() Method name: IContainer getFirstContainer()
Number of AST nodes: 5 Number of AST nodes: 5
1
IContainer[] frames = FrameManager.getInstance().getOpenFrames();
1
IContainer[] frames = FrameManager.getInstance().getOpenFrames();
2
		if (frames.length == 0) {
2
		if (frames.length == 0) {
3
			LOG.warning(getClass().getName() + ": Not enough open frames!");
3
			LOG.warning(getClass().getName() + ": Not enough open frames!");
4
			return null;
4
			return null;
5
		}
5
		}
6
		return frames[0];
6
		return frames[0];
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.1
Clones locationClones are in different classes having the same super 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.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    IContainer[] frames = FrameManager.getInstance().getOpenFrames();
    1
    IContainer[] frames = FrameManager.getInstance().getOpenFrames();
    2
    if (frames.length == 0)
    2
    if (frames.length == 0)
    3
    LOG.warning(getClass().getName() + ": Not enough open frames!");
    3
    LOG.warning(getClass().getName() + ": Not enough open frames!");
    3
    LOG.warning(getClass().getName() + ": Not enough open frames!");
    Differences
    Expression1Expression2Difference
    java.lang.Classjava.lang.ClassVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Class<> of variable getClass() does not match with type java.lang.Class<> of variable getClass()
    • Make classes java.lang.Class and java.lang.Class extend a common superclass
    3
    LOG.warning(getClass().getName() + ": Not enough open frames!");
    4
    return null;
    4
    return null;
    5
    return frames[0];
    5
    return frames[0];
    Precondition Violations (1)
    Row Violation
    1Type java.lang.Class<> of variable getClass() does not match with type java.lang.Class<> of variable getClass()