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 27344 - Bad Boolean pattern generated
Summary: Bad Boolean pattern generated
Status: CLOSED FIXED
Alias: None
Product: ide
Classification: Unclassified
Component: Schema2Beans (show other bugs)
Version: 4.x
Hardware: PC All
: P3 blocker (vote)
Assignee: Libor Kotouc
URL: http://www.netbeans.org/servlets/Read...
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2002-09-16 09:55 UTC by _ rkubacki
Modified: 2006-03-24 09:41 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ rkubacki 2002-09-16 09:55:34 UTC
Generated code allocates new Boolean objects
instead of using
Boolean.TRUE and Boolean.FALSE. Generated code is
then used at least in tomcatint and web modules.
Likely AbstractCodeGeneratorClass needs to be
improved to handle this better.
Comment 1 _ cliffwd 2002-10-01 21:49:11 UTC
I changed "new Boolean(value)" to "value ? Boolean.TRUE :
Boolean.FALSE" as requested.
Comment 2 _ rkubacki 2004-09-29 13:59:50 UTC
I still see some usages like in
tomcatint/tomcat5/src/org/netbeans/modules/tomcat5/config/Context.java
setValve(boolean[]) method. 

BTW: we can use Boolean.valueOf to avoid ternary terms and itis not
neceseary to use fully qualified name of Boolean class because
java.lang is automaticaly imported.
Comment 3 Petr Jiricka 2004-10-05 18:40:04 UTC
Libor, can you please look at this one? Thanks.
Comment 4 Libor Kotouc 2004-10-26 08:58:10 UTC
Added decision based on class used during generation of bean's setter
method. In case of Boolean class, the static constant Boolean.TRUE or
Boolean.FALSE is directly returned instead of calling Boolean(..)
constructor. 
For J2ME platform, the Boolean(..) constructor is always used.
Comment 5 _ rkubacki 2004-11-26 07:32:35 UTC
generated files in web & tomcatint seems to be OK now, thanks