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