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