if (currentProfile == null) { // create profile XmlElement profileElement = new XmlElement("profile"); profileElement.addAttribute("name", location); profileElement.addAttribute("location", location); profiles.addElement(profileElement); // save to profiles.xml try { xml.save(); } catch (Exception e) { e.printStackTrace(); } currentProfile = getProfileForLocation(location); }
if (CIDPart != null) { mimePartFile = TempFileStore.createTempFile(); try { downloadMimePart(CIDPart, mimePartFile); matcher.appendReplacement(modifiedBody, mimePartFile.toURL() .toString()); } catch (Exception e) { matcher.appendReplacement(modifiedBody, "missing"); } } else { matcher.appendReplacement(modifiedBody, "missing"); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/profiles/ProfileManager.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/message/viewer/TextViewer.java
Method name: Profile getProfile(String) Method name: String downloadCIDParts(String, MimeTree)
Number of AST nodes: 8 Number of AST nodes: 6
1
if (currentProfile == null) {
1
if (
2
				// create profile
3
				XmlElement profileElement = new XmlElement("prof
2
CIDPart != null) {
4
ile");
3
			mimePartFile = TempFileStore.createTempFile();
5
				profileElement.addAttribute("name", location);
4
			
6
				profileElement.addAttribute("location", location
5
try {
7
);
6
				downloadMimePart(CIDPart, mimePartFile);
8
				profiles.addElement(profileElement);
7
				matcher.appendReplacement(
9
				// save to profiles.xml
10
				try {
11
					xml.save
8
modifiedBody, mimePartFile.toURL()
12
();
9
						.toString());
13
				} catch (Exception e) {
10
			} catch (Exception e) {
14
					e.printStackTrace();
11
				
15
				}
16
				currentProfile = getProfileForLocation(location
12
matcher.appendReplacement(modifiedBody, "missing");
13
			}
14
		} else {
17
);
15
			matcher.appendReplacement(modifiedBody, "missing");
18
			}
16
		}
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are in different classes
Number of node comparisons1