private String[] getCompletions(String str) { 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()]);
public static String[] getVFSs() { // the sooner ppl move to the new api, the less we'll need // crap like this 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: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
private String[] getCompletions(String str)
1
public static String[] get
2
	{
3
		str = str.toLowerCase();
4
		String[] actions = jEdit.getActionNames();
5
		ArrayList returnValue = new ArrayList(actions.length);
2
VFSs()
3
	{
4
		// the sooner ppl move to the new api, the less we'll need
5
		// crap like this
6
		List returnValue = new LinkedList();
7
		String[] newAPI = ServiceManager.getServiceNames(SERVICE);
8
		if(newAPI != null)
9
		{
6
		for(int i = 0; i < actions.length; i++)
10
			for(int i = 0; i < newAPI.length; i++)
7
		{
11
			{
8
			if(actions[i].toLowerCase().indexOf(str) != -1
12
				returnValue.add(newAPI[i]);
13
			}
14
		}
15
		Enumeration oldAPI = vfsHash.keys();
9
)
16
		while(oldAPI.hasMoreElements())
10
				returnValue.add(actions[i]);
17
			returnValue.add(
11
		}
18
oldAPI.nextElement());
12
		return (String[])returnValue.toArray(new String[
19
		return (String[])returnValue.toArray(new String[
13
returnValue.size()]);
20
			returnValue.size()]);
14
	
21
	
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