Symbian
Symbian OS Library

FAQ-0799 Why does an "ETEXT 12" error occur on the "AWT-Server 00" thread?

[Index][spacer] [Previous] [Next]



 

Classification: Java Category: AWT
Created: 06/11/2002 Modified: 07/09/2002
Number: FAQ-0799
Platform: ER5

Question:
I got an ETEXT error number 12 on program "AWT-Server 00". What does this mean and what might I do about it?

Answer:
This problem is likely to have occurred through trying to access the string in an AWT text component outside its bounds. The JDK 1.1.8 documentation for TextComponent.select(int selectionStart, int selectionEnd) indicates that this should not be possible:

    "This method sets the start and end positions of the selected text, enforcing the restriction that the end position must be greater than or equal to the start position. The start position must be greater than zero, and the end position must be less that or equal to the length of the text component's text. If the caller supplies values that are inconsistent or out of bounds, the method enforces these constraints silently, and without failure."

    Unfortunately, Sun's reference implementation does not enforce this constraint successfully in the case when selectionStart and selectionEnd are both greater than the length of the text string owned by the text component. This will occur in particular if setSelectionEnd(int selectionEnd) is called with a value longer than the text string. The ETEXT error is simply the system complaining that a text string has been accessed beyond its end.

    The best work around is to make sure that your client code manipulating the text string in the text component checks the bounds. This problem only affects v5 of Symbian OS as checking was introduced in the native code called by the text component's peer class in Symbian OS v6.