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 160531 - Generating getters for a Boolean makes a getXxxx method instead of a isXxxx method
Summary: Generating getters for a Boolean makes a getXxxx method instead of a isXxxx m...
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Max Sauer
Depends on:
Reported: 2009-03-18 11:13 UTC by cbliard
Modified: 2009-07-03 12:29 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description cbliard 2009-03-18 11:13:37 UTC
When asking NetBeans to generate getters for a boolean field foo, it kindly creates a method isFoo(). But if we want a
getter for the Boolean class, then the getter is named getFoo().

I expected the getter generator to make a isFoo() method for both boolean and Boolean types.
Comment 1 Vitezslav Stejskal 2009-03-20 10:39:07 UTC
Sounds reasonable to me.
Comment 2 Max Sauer 2009-03-27 09:45:30 UTC
Comment 3 Quality Engineering 2009-03-28 20:37:05 UTC
Integrated into 'main-golden', will be available in build *200903281400* on (upload may still be in progress)
User: Max Sauer <>
Log: #160531: Generate is-like setter for java.lang.Boolean
Comment 4 Michel Graciano 2009-07-02 23:01:41 UTC
I am really reading this or I am getting an nightmare? How could this possible, generate isXXX for java.lang.Boolean? It
is totally against JavaBean specification. Just primitive boolean must be isXXX and this fix generated several
regressions such as:
. For editor, the getter never exists since isXXX for Boolean is not valid (getter generation is always visible);
. Encapsulate fields (thanks God) don't work like this;

So, now we have an inconsistent IDE that makes users looks crazy when using facing wrong behaviours from tools that
believe in JavaBean spec like Hibernate, Swing palette components at NetBeans and several others, since we trust in what
IDE generates. The issue #168061 was created about that and I agree with Jan Lahoda, this patch _must_ be reverted since
similar with patch suggested and make available as soon as possible. I will reopen it and wait for you revert it asap
and mark this as WONTFIX. I just can't believe in that yet...
Comment 5 Max Sauer 2009-07-03 12:29:56 UTC
Reverted this one and marking as WONTFIX, since it does not follow JavaBeans spec.