United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4941777 : Deprecate Boolean constructor

Details
Type:
Enhancement
Submit Date:
2003-10-22
Status:
Closed
Updated Date:
2016-04-15
Project Name:
JDK
Resolved Date:
2016-04-15
Component:
core-libs
OS:
generic,windows_xp
Sub-Component:
java.lang
CPU:
generic,x86
Priority:
P3
Resolution:
Duplicate
Affected Versions:
1.4.2,6
Fixed Versions:
tbd_major

Related Reports
Duplicate:
Relates:
Relates:
Relates:

Sub Tasks

Description
Name: tb29552			Date: 10/22/2003


A DESCRIPTION OF THE REQUEST :
We should encourage people to move from "new Boolean()" to Boolean.TRUE, Boolean.FALSE by deprecating the constructor and documented the aforementioned alternative methods.

JUSTIFICATION :
Using Boolean.TRUE, Boolean.FALSE leads to improved performance, reduced memory footprint. Many developers are unaware of this recent addition and continue to use the constructor. A deprecation should formalize this migration route.
(Review ID: 216908) 
======================================================================

                                    

Comments
The Boolean constructor is being deprecated as part of JDK-8145468.
                                     
2016-04-15
Maybe the Byte() constructor should also be deprecated, since all Byte values are cached.
                                     
2015-10-03
Dr. Deprecator should provide a diagnosis for this situation.
                                     
2014-10-03
EVALUATION

Contribution-Forum:https://jdk-collaboration.dev.java.net/servlets/ProjectForumMessageView?messageID=12004&forumID=1463
                                     
2006-03-15
EVALUATION

Due to the disruption deprecating an API can have, currently an API has to be "actively hazardous" to be deprecated, like Thread.stop.  While the use this constructor is certainly ill-advised, it doesn't rise (or sink) to the standard of hazardousness to be deprecated in the JDK.  In the future we may add a "denigration" facility to mark API elements that aren't quite so bad that they should be deprecated, but shouldn't be used in most cases.  This constructor would be a good candidate for denigration.
                                     
2005-11-15
PUBLIC COMMENTS

.
                                     
2004-06-10
EVALUATION

A reasonable request; the JavaDoc already encourages use of the static factory.

###@###.### 2003-10-30
                                     
2003-10-30



Hardware and Software, Engineered to Work Together