-
Bug
-
Resolution: Fixed
-
P3
-
5.0
-
beta
-
x86
-
windows_2000
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2116873 | 5.0u3 | Andrey Pikalev | P3 | Closed | Won't Fix |
Name: jl125535 Date: 02/10/2004
A DESCRIPTION OF THE REQUEST :
In JDK 1.4, you could specify that an UndoManager had no limit for the number of undos it could hold by setting the limit to 0. This acted as though there was no limit. The fix for bug 4706533 eliminates this capability and zero now means that it cannot hold any edits.
I want to maintain the ability to have no limit on the number of edits (except for the maximum size of the Vector). I thought I could do that by using setLimit( -1 ), but that doesn't work because it will try to allocate a Vector of size -1. Setting limit to some extremely large value is not an acceptable solution because discardAllEdits will allocate a Vector that big.
I would like setLimit with a negative number to eliminate the limit and dynamically resize as big as needed. The only change in the class needed to support this is to add a check in discardAllEdits to check for limit < 0 and if so create a vector of default size instead of limit size.
JUSTIFICATION :
There needs to be a way to not limit the number edits that can be contained in an UndoManager without requiring the allocation of a large Vector.
CUSTOMER SUBMITTED WORKAROUND :
Creat my own version of UndoManager
Release Regression From : 1.4.2
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
(Incident Review ID: 237763)
======================================================================
A DESCRIPTION OF THE REQUEST :
In JDK 1.4, you could specify that an UndoManager had no limit for the number of undos it could hold by setting the limit to 0. This acted as though there was no limit. The fix for bug 4706533 eliminates this capability and zero now means that it cannot hold any edits.
I want to maintain the ability to have no limit on the number of edits (except for the maximum size of the Vector). I thought I could do that by using setLimit( -1 ), but that doesn't work because it will try to allocate a Vector of size -1. Setting limit to some extremely large value is not an acceptable solution because discardAllEdits will allocate a Vector that big.
I would like setLimit with a negative number to eliminate the limit and dynamically resize as big as needed. The only change in the class needed to support this is to add a check in discardAllEdits to check for limit < 0 and if so create a vector of default size instead of limit size.
JUSTIFICATION :
There needs to be a way to not limit the number edits that can be contained in an UndoManager without requiring the allocation of a large Vector.
CUSTOMER SUBMITTED WORKAROUND :
Creat my own version of UndoManager
Release Regression From : 1.4.2
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
(Incident Review ID: 237763)
======================================================================
- backported by
-
JDK-2116873 REGRESSION: Allow unlimited number of edits in an UndoManager
-
- Closed
-
- relates to
-
JDK-6215849 javax.swing.undo.UndoManager.setLimit() should state that -1 means "no limit"
-
- Resolved
-