Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 313238

Summary: Text#getTextLimit does not return a value equal to Text.LIMIT when not previously changed by setTextLimit.
Product: [Eclipse Project] Platform Reporter: brandon.rockhold
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: eclipse.felipe
Version: 4.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard: stalebug
Attachments:
Description Flags
Test case illustrating bug none

Description brandon.rockhold CLA 2010-05-17 16:31:05 EDT
Build Identifier: 20090920-1017

According to the documentation for Text#getTextLimit, if the max number of characters that the receiver is capable of holding has not been changed by calling setTextLimit(), the result of the method will be the constant Text.LIMIT. On both Windows Vista and Windows 7, however, this does not appear to be the case. The value of the Text.LIMIT constant ends up being 2147483647, and the value returned by getTextLimit (with no previous invocations of setTextLimit) is 2147483646.

Reproducible: Always

Steps to Reproduce:
1. Create an instance of org.eclipse.swt.widgets.Text.
2. Call Text#getTextLimit and compare the returned value with the constant Text.LIMIT.
3. Verify that the two values differ, despite documentation indicating otherwise.
Comment 1 brandon.rockhold CLA 2010-05-17 16:32:33 EDT
Created attachment 168821 [details]
Test case illustrating bug
Comment 2 Felipe Heidrich CLA 2010-05-18 09:59:32 EDT
This is the code that initializes Text.LIMIT

	* These values can be different on different platforms.
	* Therefore they are not initialized in the declaration
	* to stop the compiler from inlining.
	*/
	static {
		LIMIT = OS.IsWinNT ? 0x7FFFFFFF : 0x7FFF;
		DELIMITER = "\r\n";
	}

it is over 10 years old, I guess things changed a bit since the code was first written.
Comment 3 Eclipse Webmaster CLA 2019-09-06 15:30:59 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
Comment 4 Eclipse Genie CLA 2022-02-02 15:27:37 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.