This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 21187

Summary: JTextComponentOperator should throw exception when searched text not found
Product: qa Reporter: Jiri Skrivanek <jskrivanek>
Component: CodeAssignee: issues@qa <issues>
Status: CLOSED FIXED    
Severity: blocker    
Priority: P3    
Version: 3.x   
Hardware: Sun   
OS: Solaris   
Issue Type: DEFECT Exception Reporter:

Description Jiri Skrivanek 2002-03-05 14:29:12 UTC
Some methods use getPositionByText() method to identify start position and then
they try to change caret position. If the text is not found, method
getPositionByText() returns -1 and caret starts to trying reach -1 position.
It would be better if JemmyException is thrown from methods below when text is
not found.

public void changeCaretPosition(String text, int index, boolean before)
public void selectText(String text, int index)
Comment 1 Alexandre Iline 2002-03-08 11:55:53 UTC
Now changeCaretPosition and selectText methods throws NoSuchText 
exception - subclass of JemmyException.

Comment 2 Jiri Skrivanek 2002-03-11 08:50:44 UTC
Verified.