if (item.getEmailAddress() != null) { buf.append("<br> eMail: " + convert((String) item.getEmailAddress())); } // TODO // if (item.getWebsite() != null) { // buf.append("<br> Website: " // + convert((String) item.getWebsite())); // } buf.append("</body></html>"); return buf.toString(); } public static String createToolTip(IGroupItem item) { StringBuffer buf = new StringBuffer(); buf.append("<html><body> Name: " + item.getName()); if (item.getDescription() != null) { buf.append("<br> Description: " + item.getDescription()); } buf.append("</body></html>"); return buf.toString(); } private static String convert(String str) { if (str == null) { return ""; } StringBuffer result = new StringBuffer(); int pos = 0; char ch; while (pos < str.length()) { ch = str.charAt(pos); if (ch == '<') { result.append("<"); } else if (ch == '>') { result.append(">"); } else { result.append(ch); } pos++; } return result.toString();
if (item.getWebsite() != null) { buf.append("<br> Website: " + convert((String) item.getWebsite())); } buf.append("</body></html>"); return buf.toString(); } public static String createToolTip(GroupModelPartial item) { StringBuffer buf = new StringBuffer(); buf.append("<html><body> Name: " + item.getName()); if (item.getDescription() != null) { buf.append("<br> Description: " + item.getDescription()); } buf.append("</body></html>"); return buf.toString(); } private static String convert(String str) { if (str == null) { return ""; } StringBuffer result = new StringBuffer(); int pos = 0; char ch; while (pos < str.length()) { ch = str.charAt(pos); if (ch == '<') { result.append("<"); } else if (ch == '>') { result.append(">"); } else { result.append(ch); } pos++; } return result.toString();
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/contact/list/HeaderItemToolTipFactory.java File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/util/ToolTipFactory.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
if (item.getEmailAddress() != null) {
2
			buf.append("<br> eMail: "
3
					+ convert((String) item.getEmailAddress()));
4
		}
5
		// TODO 
6
//		if (item.getWebsite() != null) {
1
if (item.getWebsite() != null) {
7
//			buf.append("<br> Website: "
2
			buf.append("<br> Website: "
8
//					+ convert((String) item.getWebsite()));
3
					+ convert((String) item.getWebsite()));
9
//		}
4
		}
10
		buf.append("</body></html>");
5
		buf.append("</body></html>");
11
		return buf.toString();
6
		return buf.toString();
12
	}
7
	}
13
	public static String createToolTip(IGroupItem item) {
8
	public static String createToolTip(GroupModelPartial item) {
14
		StringBuffer buf = new StringBuffer();
9
		StringBuffer buf = new StringBuffer();
15
		buf.append("<html><body> Name: " + item.getName());
10
		buf.append("<html><body> Name: " + item.getName());
16
		if (item.getDescription() != null) {
11
		if (item.getDescription() != null) {
17
			buf.append("<br> Description: " + item.getDescription());
12
			buf.append("<br> Description: " + item.getDescription());
18
		}
13
		}
19
		buf.append("</body></html>");
14
		buf.append("</body></html>");
20
		return buf.toString();
15
		return buf.toString();
21
	}
16
	}
22
	private static String convert(String str) {
17
	private static String convert(String str) {
23
		if (str == null) {
18
		if (str == null) {
24
			return "";
19
			return "";
25
		}
20
		}
26
		StringBuffer result = new StringBuffer();
21
		StringBuffer result = new StringBuffer();
27
		int pos = 0;
22
		int pos = 0;
28
		char ch;
23
		char ch;
29
		while (pos < str.length()) {
24
		while (pos < str.length()) {
30
			ch = str.charAt(pos);
25
			ch = str.charAt(pos);
31
			if (ch == '<') {
26
			if (ch == '<') {
32
				result.append("<");
27
				result.append("<");
33
			} else if (ch == '>') {
28
			} else if (ch == '>') {
34
				result.append(">");
29
				result.append(">");
35
			} else {
30
			} else {
36
				result.append(ch);
31
				result.append(ch);
37
			}
32
			}
38
			pos++;
33
			pos++;
39
		}
34
		}
40
		return result.toString();
35
		return result.toString();
41
	
36
	
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