int start = i;
int start = (i < 0) ? 0 : i;
    public static LinkList getUrls(String s) {    	int max = s.length();    	int i = s.indexOf(URL);    	ArrayList linkRanges = new ArrayList();    	ArrayList links = new ArrayList();    	while (i != -1) {    	    while (i != -1) {    	        if (Character.isWhitespace(s.charAt(i)) || s.substring(i, i + 1).equals("\n")) { //$NON-NLS-1$    	            i++;    	            break;    	        }    	        i--;    	    }    		int start = i;    		// look for the first whitespace character    		boolean found = false;    		i += URL.length();    		while (!found && i < max) {    			found = (Character.isWhitespace(s.charAt(i)) || s.substring(i, i + 1).equals("\n")); //$NON-NLS-1$    			i++;    		}    		if (i!=max) i--;    		linkRanges.add(new int[] {start, i - start});    		links.add(s.substring(start, i));    		i = s.indexOf(URL, i);    	}    	return new LinkList(    			(int[][])linkRanges.toArray(new int[linkRanges.size()][2]),    			(String[])links.toArray(new String[links.size()]));    }