BufferUpdate bmsg = (BufferUpdate)msg; if(bmsg.getWhat() == BufferUpdate.CLOSED) { if(bmsg.getBuffer() == buffer) stopRecording(view); }
EditPaneUpdate eu = (EditPaneUpdate)msg; if(eu.getWhat() == EditPaneUpdate.CREATED) { initTextArea(eu.getEditPane() .getTextArea()); }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/Macros.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/Java14.java
Method name: void handleMessage(EBMessage) Method name: void handleMessage(EBMessage)
Number of AST nodes: 4 Number of AST nodes: 3
1
BufferUpdate bmsg = (BufferUpdate)msg;
1
EditPaneUpdate eu = (EditPaneUpdate)msg;
2
				if(bmsg.getWhat() == BufferUpdate.CLOSED)
2
					if(eu.getWhat() == EditPaneUpdate.CREATED)
3
				{
3
					{
4
					if(bmsg.getBuffer() == buffer)
4
					
5
						stopRecording(view
5
	initTextArea(eu.getEditPane()
6
);
6
							.getTextArea());
7
				}
7
					}
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.4
Clones locationClones are in different classes
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)35.3
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                      
    6
    EditPaneUpdate eu = (EditPaneUpdate)msg;
    4
    if (bmsg.getBuffer() == buffer)
    4
    if (bmsg.getBuffer() == buffer)
    7
    if (eu.getWhat() == EditPaneUpdate.CREATED)
    Differences
    Expression1Expression2Difference
    getBuffergetWhatMETHOD_INVOCATION_NAME_MISMATCH
    org.gjt.sp.jedit.Bufferjava.lang.ObjectVARIABLE_TYPE_MISMATCH
    bmsgeuVARIABLE_NAME_MISMATCH
    org.gjt.sp.jedit.msg.BufferUpdateorg.gjt.sp.jedit.msg.EditPaneUpdateSUBCLASS_TYPE_MISMATCH
    bufferEditPaneUpdate.CREATEDAST_TYPE_MISMATCH
    Preondition Violations
    Expression eu.getWhat() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.gjt.sp.jedit.Buffer of variable bmsg.getBuffer() does not match with type java.lang.Object of variable eu.getWhat()
    • Make classes org.gjt.sp.jedit.Buffer and java.lang.Object extend a common superclass
    Expression bmsg cannot be unified with expression eu , because common superclass org.gjt.sp.jedit.EBMessage does not declare member(s) public org.gjt.sp.jedit.Buffer getBuffer() , public java.lang.Object getWhat()
    7
    if (eu.getWhat() == EditPaneUpdate.CREATED)
    5
    stopRecording(view);
    5
    stopRecording(view);
    8
    initTextArea(eu.getEditPane().getTextArea());
    Differences
    Expression1Expression2Difference
    org.gjt.sp.jedit.Vieworg.gjt.sp.jedit.textarea.JEditTextAreaSUBCLASS_TYPE_MISMATCH
    vieweu.getEditPane().getTextArea()TYPE_COMPATIBLE_REPLACEMENT
    stopRecordinginitTextAreaMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression eu.getEditPane().getTextArea() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression stopRecording(view) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression initTextArea(eu.getEditPane().getTextArea()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression stopRecording(view) is a void method call, and thus it cannot be parameterized
    Expression initTextArea(eu.getEditPane().getTextArea()) is a void method call, and thus it cannot be parameterized
    8
    initTextArea(eu.getEditPane().getTextArea());
    Precondition Violations (9)
    Row Violation
    1Expression eu.getWhat() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Type org.gjt.sp.jedit.Buffer of variable bmsg.getBuffer() does not match with type java.lang.Object of variable eu.getWhat()
    3Expression bmsg cannot be unified with expression eu , because common superclass org.gjt.sp.jedit.EBMessage does not declare member(s) public org.gjt.sp.jedit.Buffer getBuffer() , public java.lang.Object getWhat()
    4Expression eu.getEditPane().getTextArea() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression stopRecording(view) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression initTextArea(eu.getEditPane().getTextArea()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression stopRecording(view) is a void method call, and thus it cannot be parameterized
    8Expression initTextArea(eu.getEditPane().getTextArea()) is a void method call, and thus it cannot be parameterized
    9The refactoring of the clones is infeasible, because classes org.gjt.sp.jedit.Macros.Recorder and do not have a common superclass