if (siteDown && (sample.getTime() != -1) && !successMsgSent) { // Send the mail ... if (successCount > getSuccessLimit()) { Vector addressVector = getAddressVector(); try { sendMail(getFromAddress(), addressVector, getSuccessSubject(), "URL Restarted: " + sample.getSampleLabel(), getSmtpHost()); } catch (Exception e) { log.error("Problem sending mail", e); } siteDown = false; successMsgSent = true; failureCount = 0; failureMsgSent = false; } }
if (this.isFailing() && !siteDown && !failureMsgSent) { // Send the mail ... Vector addressVector = getAddressVector(); if (addressVector.size() != 0) { try { sendMail(getFromAddress(), addressVector, getFailureSubject(), "URL Failed: " + sample.getSampleLabel(), getSmtpHost()); } catch (Exception e) { log.error("Problem sending mail", e); } siteDown = true; failureMsgSent = true; successCount = 0; successMsgSent = false; } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/reporters/MailerModel.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/reporters/MailerModel.java
Method name: void add(SampleResult) Method name: void add(SampleResult)
Number of AST nodes: 9 Number of AST nodes: 9
1
if (siteDown && (sample.getTime() != -1) && !successMsgSent) {
1
if (
2
			// Send the mail ...
3
			if (successCount > getSuccessLimit()) {
4
	
2
this.isFailing() && !siteDown && !failureMsgSent) {
3
			// Send the mail ...
5
			Vector addressVector = getAddressVector();
4
			Vector addressVector = getAddressVector();
5
			if (addressVector.size() != 0) {
6
				try {
6
				try {
7
					sendMail(getFromAddress(), addressVector, getSuccessSubject(), "URL Restarted: "
7
					sendMail(getFromAddress(), addressVector, getFailureSubject(), "URL Failed: "
8
							+ sample.getSampleLabel(), getSmtpHost());
8
							+ sample.getSampleLabel(), getSmtpHost());
9
				} catch (Exception e) {
9
				} catch (Exception e) {
10
					log.error("Problem sending mail", e);
10
					log.error("Problem sending mail", e);
11
				}
11
				}
12
				siteDown = false;
12
				siteDown = true;
13
				successMsgSent = true;
13
				failureMsgSent = true;
14
				failureCount = 0;
14
				successCount = 0;
15
				failureMsgSent = false;
15
				successMsgSent = false;
16
			}
16
			}
17
		}
17
		}
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.3
Clones locationClones are in the same method
Number of node comparisons5
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.1
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    16
    Vector addressVector = getAddressVector();
                                                                                            
    17
    try
    8
    try
    18
    sendMail(getFromAddress(), addressVector, getSuccessSubject(), "URL Restarted: " + sample.getSampleLabel(), getSmtpHost());
    18
    sendMail(getFromAddress(), addressVector, getSuccessSubject(), "URL Restarted: " + sample.getSampleLabel(), getSmtpHost());
    9
    sendMail(getFromAddress(), addressVector, getFailureSubject(), "URL Failed: " + sample.getSampleLabel(), getSmtpHost());
    Differences
    Expression1Expression2Difference
    getSuccessSubjectgetFailureSubjectMETHOD_INVOCATION_NAME_MISMATCH
    "URL Restarted: ""URL Failed: "LITERAL_VALUE_MISMATCH
    9
    sendMail(getFromAddress(), addressVector, getFailureSubject(), "URL Failed: " + sample.getSampleLabel(), getSmtpHost());
    Precondition Violations (0)
    Row Violation