str = str.toLowerCase(); String[] actions = jEdit.getActionNames(); ArrayList returnValue = new ArrayList(actions.length); for(int i = 0; i < actions.length; i++) { if(actions[i].toLowerCase().indexOf(str) != -1) returnValue.add(actions[i]); } return (String[])returnValue.toArray(new String[returnValue.size()]);
List returnValue = new LinkedList(); String[] newAPI = ServiceManager.getServiceNames(SERVICE); if(newAPI != null) { for(int i = 0; i < newAPI.length; i++) { returnValue.add(newAPI[i]); } } Enumeration oldAPI = vfsHash.keys(); while(oldAPI.hasMoreElements()) returnValue.add(oldAPI.nextElement()); return (String[])returnValue.toArray(new String[ returnValue.size()]);
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/ActionBar.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/io/VFSManager.java
Method name: String[] getCompletions(String) Method name: String[] getVFSs()
Number of AST nodes: 7 Number of AST nodes: 9
1
str = str.toLowerCase();
2
		String[] actions = jEdit.getActionNames();
3
		ArrayList returnValue = new ArrayList(actions.length);
1
List returnValue = new LinkedList();
2
		String[] newAPI = ServiceManager.getServiceNames(SERVICE);
3
		if(newAPI != null)
4
		{
4
		for(int i = 0; i < actions.length; i++)
5
			for(int i = 0; i < newAPI.length; i++)
5
		{
6
			{
6
			if(actions[i].toLowerCase().indexOf(str) != -1
7
				returnValue.add(newAPI[i]);
8
			}
9
		}
10
		Enumeration oldAPI = vfsHash.keys();
7
)
11
		while(oldAPI.hasMoreElements())
8
				returnValue.add(actions[i]);
12
			returnValue.add(
9
		}
13
oldAPI.nextElement());
10
		return (String[])returnValue.toArray(new String[
14
		return (String[])returnValue.toArray(new String[
11
returnValue.size()]);
15
			returnValue.size()]);
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 locationClones are in different classes
Number of node comparisons1