Collection<IAssociation> c = AssociationStore.getInstance() .getAllAssociations(uri.toString()); for (IAssociation as : c) { if (as.getServiceId().equals(SERVICE_ID) && (as.getMetaDataId() != null) && (as.getMetaDataId().equals(tag.getId()))) { return true; } } return false;
Collection<IAssociation> c = AssociationStore.getInstance() .getAllAssociations(uri.toString()); for (IAssociation as : c) { if (as.getServiceId().equals(SERVICE_ID) && (as.getMetaDataId() != null) && (as.getMetaDataId().equals(tag.getId()))) { return true; } } return false;
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/ui/tagging/TagCalendarMenu.java File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/action/TagContactMenu.java
Method name: boolean checkAssocation(String, String, ITag) Method name: boolean checkAssocation(String, String, ITag)
Number of AST nodes: 5 Number of AST nodes: 5
1
Collection<IAssociation> c = AssociationStore.getInstance()
1
Collection<IAssociation> c = AssociationStore.getInstance()
2
				.getAllAssociations(uri.toString());
2
				.getAllAssociations(uri.toString());
3
		for (IAssociation as : c) {
3
		for (IAssociation as : c) {
4
			if (as.getServiceId().equals(SERVICE_ID)
4
			if (as.getServiceId().equals(SERVICE_ID)
5
					&& (as.getMetaDataId() != null)
5
					&& (as.getMetaDataId() != null)
6
					&& (as.getMetaDataId().equals(tag.getId()))) {
6
					&& (as.getMetaDataId().equals(tag.getId()))) {
7
				return true;
7
				return true;
8
			}
8
			}
9
		}
9
		}
10
		return false;
10
		return false;
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.6
Clones locationClones are in different classes having the same super class
Number of node comparisons9
  1. {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)2.0
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    6
    Collection<IAssociation> c = AssociationStore.getInstance().getAllAssociations(uri.toString());
    2
    Collection<IAssociation> c = AssociationStore.getInstance().getAllAssociations(uri.toString());
    7
    for (IAssociation as : c)
    3
    for (IAssociation as : c)
    8
    if (as.getServiceId().equals(SERVICE_ID) && (as.getMetaDataId() != null) && (as.getMetaDataId().equals(tag.getId())))
    4
    if (as.getServiceId().equals(SERVICE_ID) && (as.getMetaDataId() != null) && (as.getMetaDataId().equals(tag.getId())))
    9
    return true;
    5
    return true;
    10
    return false;
    6
    return false;
    Precondition Violations (0)
    Row Violation