void set(String key, String value) { Element child = getParentElement().getChild(key); if (child == null) { child = new Element(key); getParentElement().addContent(child); } child.setText(value); } public void set(String key, String prefix, String value) { Element child = getParentElement().getChild(key); if (child == null) { child = new Element(key); getParentElement().addContent(child); } Element prefixchild = child.getChild(prefix); if (prefixchild == null) { prefixchild = new Element(prefix); child.addContent(prefixchild); } prefixchild.setText(value); } public String get(String key) { Element child = getParentElement().getChild(key); if (child == null) { child = new Element(key); getParentElement().addContent(child); } return child.getTextNormalize(); } public String get(String key, String prefix) { Element child = getParentElement().getChild(key); if (child == null) { child = new Element(key); getParentElement().addContent(child); } Element prefixchild = child.getChild(prefix); if (prefixchild == null) { prefixchild = new Element(prefix); child.addContent(prefixchild); } return prefixchild.getTextNormalize(); } public Document getDocument() { return doc; } /** * @return Returns the id. */ public String getId() { return get(VCARD.ID); } public void setId(String id) { set(VCARD.ID, id); }
void set(String key, String value) { Element child = getParentElement().getChild(key); if (child == null) { child = new Element(key); getParentElement().addContent(child); } child.setText(value); } /** * @see org.columba.calendar.model.api.IBasicModel#set(java.lang.String, * java.lang.String, java.lang.String) */ protected void set(String key, String prefix, String value) { Element child = getParentElement().getChild(key); if (child == null) { child = new Element(key); getParentElement().addContent(child); } Element prefixchild = child.getChild(prefix); if (prefixchild == null) { prefixchild = new Element(prefix); child.addContent(prefixchild); } prefixchild.setText(value); } /** * @see org.columba.calendar.model.api.IBasicModel#get(java.lang.String) */ protected String get(String key) { Element child = getParentElement().getChild(key); if (child == null) { child = new Element(key); getParentElement().addContent(child); } return child.getTextNormalize(); } /** * @see org.columba.calendar.model.api.IBasicModel#get(java.lang.String, * java.lang.String) */ protected String get(String key, String prefix) { Element child = getParentElement().getChild(key); if (child == null) { child = new Element(key); getParentElement().addContent(child); } Element prefixchild = child.getChild(prefix); if (prefixchild == null) { prefixchild = new Element(prefix); child.addContent(prefixchild); } return prefixchild.getTextNormalize(); } /** * @see org.columba.calendar.model.api.IBasicModel#getDocument() */ public Document getDocument() { return doc; } /** * @return Returns the id. */ public String getId() { return get(ICALENDAR.UID); } public void setId(String id) { set(ICALENDAR.UID, id); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/parser/XMLContactDocumentParser.java File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/parser/XCSDocumentParser.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
void set(String key, String value) {
1
void set(String key, String value) {
2
		Element child = getParentElement().getChild(key);
2
		Element child = getParentElement().getChild(key);
3
		if (child == null) {
3
		if (child == null) {
4
			child = new Element(key);
4
			child = new Element(key);
5
			getParentElement().addContent(child);
5
			getParentElement().addContent(child);
6
		}
6
		}
7
		child.setText(value);
7
		child.setText(value);
8
	}
8
	}
9
	public
9
	/**
10
	 * @see org.columba.calendar.model.api.IBasicModel#set(java.lang.String,
11
	 *      java.lang.String, java.lang.String)
12
	 */
10
 void set(String key, String prefix, String value) {
13
	protected void set(String key, String prefix, String value) {
11
		Element child = getParentElement().getChild(key);
14
		Element child = getParentElement().getChild(key);
12
		if (child == null) {
15
		if (child == null) {
13
			child = new Element(key);
16
			child = new Element(key);
14
			getParentElement().addContent(child);
17
			getParentElement().addContent(child);
15
		}
18
		}
16
		Element prefixchild = child.getChild(prefix);
19
		Element prefixchild = child.getChild(prefix);
17
		if (prefixchild == null) {
20
		if (prefixchild == null) {
18
			prefixchild = new Element(prefix);
21
			prefixchild = new Element(prefix);
19
			child.addContent(prefixchild);
22
			child.addContent(prefixchild);
20
		}
23
		}
21
		prefixchild.setText(value);
24
		prefixchild.setText(value);
22
	}
25
	}
23
	public
26
	/**
27
	 * @see org.columba.calendar.model.api.IBasicModel#get(java.lang.String)
28
	 */
24
 String get(String key) {
29
	protected String get(String key) {
25
		Element child = getParentElement().getChild(key);
30
		Element child = getParentElement().getChild(key);
26
		if (child == null) {
31
		if (child == null) {
27
			child = new Element(key);
32
			child = new Element(key);
28
			getParentElement().addContent(child);
33
			getParentElement().addContent(child);
29
		}
34
		}
30
		return child.getTextNormalize();
35
		return child.getTextNormalize();
31
	}
36
	}
32
	public
37
	/**
38
	 * @see org.columba.calendar.model.api.IBasicModel#get(java.lang.String,
39
	 *      java.lang.String)
40
	 */
33
 String get(String key, String prefix) {
41
	protected String get(String key, String prefix) {
34
		Element child = getParentElement().getChild(key);
42
		Element child = getParentElement().getChild(key);
35
		if (child == null) {
43
		if (child == null) {
36
			child = new Element(key);
44
			child = new Element(key);
37
			getParentElement().addContent(child);
45
			getParentElement().addContent(child);
38
		}
46
		}
39
		Element prefixchild = child.getChild(prefix);
47
		Element prefixchild = child.getChild(prefix);
40
		if (prefixchild == null) {
48
		if (prefixchild == null) {
41
			prefixchild = new Element(prefix);
49
			prefixchild = new Element(prefix);
42
			child.addContent(prefixchild);
50
			child.addContent(prefixchild);
43
		}
51
		}
44
		return prefixchild.getTextNormalize();
52
		return prefixchild.getTextNormalize();
45
	}
53
	}
54
	/**
55
	 * @see org.columba.calendar.model.api.IBasicModel#getDocument()
56
	 */
46
	public Document getDocument() {
57
	public Document getDocument() {
47
		return doc;
58
		return doc;
48
	}
59
	}
49
	/**
60
	/**
50
	 * @return Returns the id.
61
	 * @return Returns the id.
51
	 */
62
	 */
52
	public String getId() {
63
	public String getId() {
53
		return get(VCARD.ID);
64
		return get(ICALENDAR.UID);
54
	}
65
	}
55
	public void setId(String id) {
66
	public void setId(String id) {
56
		set(VCARD.ID, id);
67
		set(ICALENDAR.UID, id);
57
	}
68
	}
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.0
Clones location
Number of node comparisons0