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();
12
				} catch (Exception e) {
13
					e.printStackTrace();
14
				}
15
				currentProfile = getProfileForLocation(location
8
modifiedBody, mimePartFile
9
							.toURL().toString());
10
				} catch (Exception e) {
11
					matcher.appendReplacement(modifiedBody, "missing");
12
				}
13
			} else {
16
);
14
				matcher.appendReplacement(modifiedBody, "missing");
17
			}
15
			}
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.5
Clones locationClones are in different classes
Number of node comparisons1