|
From: Mike B. <mb...@Ga...> - 2003-02-26 18:25:01
|
th...@cy... wrote:
> private HtmlAnchor getHtmlAnchor(String label) {
> List returnedAnchors = _page.getAnchors();
> Iterator i = returnedAnchors.iterator();
> HtmlAnchor anchor = null;
> while(i.hasNext()) {
> //some debug output
> _logger.displayProgressInfo("DebugInfo: " +
> ((HtmlAnchor)i.next()).toString());
> if (label.equals(((HtmlAnchor)i.next()).asText())) {
> anchor = (HtmlAnchor)i.next();
> }
> }
> return anchor;
> }
This is calling i.next() twice within the loop. Once in the debug
statement and once in the equals(). This would cause you to skip every
other anchor.
Is this the problem you're seeing?
--
Mike Bowler
Principal, Gargoyle Software Inc.
Voice: (416) 822-0973 | Email : mb...@Ga...
Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com
|