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.
I am able to turn on and off a bunch of different editor hints for general Java code through Preferences->Java Code->Hints, however I don't see a way to do the same thing with JavaEE hints. One hint in particular causes me problems because it fills my editor with a bunch of marks making it hard for me to see when there is really something that deserves my attention. I would like to be able to decide what hints I want to see. The hint that causes me problems is "persistent attribute should be encapsulated". I annotate entity attributes directly instead of the accessor methods. My attributes are private so encapsulation is not a problem. This allows me greater control so that I can leave off the setter for attributes that I don't want to be changed by external code or even leave off the getter for for attributes that are important to my persistence model but are not relevant to the public API. This hint tells me that I am wrong every time I do this and there are so many of them that it is impossible to find the useful hints that might really indicate a problem.
The ability to suppress JavaEE verification warnings is already being tracked as issue 87922. The "persistent attribute should be encapsulated" warning is probably wrong (to be verified). The relevant spec chapter is 2.1.1 (Persistent Fields and Properties).
It seems to me the warning should be removed. If the Java support doesn't display a hint that a field should be encapsulated, why should the JPA support? There is nothing in the JPA spec (section 2.2.1) requiring field encapsulation when field-based access is used.
Tomasz, any opinion to desc3?
Fixed by removing the hint. I will add a comment to issue 87922 to re-add the hint when that issue is addressed. Removing src/org/netbeans/modules/j2ee/jpa/verification/rules/attribute/AttrIsEncapsulated.java; /cvs/j2ee/persistence/verification/src/org/netbeans/modules/j2ee/jpa/verification/rules/attribute/AttrIsEncapsulated.java,v <-- AttrIsEncapsulated.java new revision: delete; previous revision: 1.5 done Checking in src/org/netbeans/modules/j2ee/jpa/verification/rules/attribute/Bundle.properties; /cvs/j2ee/persistence/verification/src/org/netbeans/modules/j2ee/jpa/verification/rules/attribute/Bundle.properties,v <-- Bundle.properties new revision: 1.12; previous revision: 1.11 done Checking in src/org/netbeans/modules/j2ee/jpa/verification/rules/entity/ValidAttributes.java; /cvs/j2ee/persistence/verification/src/org/netbeans/modules/j2ee/jpa/verification/rules/entity/ValidAttributes.java,v <-- ValidAttributes.java new revision: 1.16; previous revision: 1.15 done
Also: Checking in src/org/netbeans/modules/j2ee/jpa/verification/fixes/Bundle.properties; /cvs/j2ee/persistence/verification/src/org/netbeans/modules/j2ee/jpa/verification/fixes/Bundle.properties,v <-- Bundle.properties new revision: 1.17; previous revision: 1.16 done Removing src/org/netbeans/modules/j2ee/jpa/verification/fixes/EncapsulateFieldHint.java; /cvs/j2ee/persistence/verification/src/org/netbeans/modules/j2ee/jpa/verification/fixes/EncapsulateFieldHint.java,v <-- EncapsulateFieldHint.java new revision: delete; previous revision: 1.3 done