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 87922 - Ability to suppress JPA warnings
Summary: Ability to suppress JPA warnings
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-25 04:02 UTC by _ gtzabari
Modified: 2016-07-07 08:54 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2006-10-25 04:02:39 UTC
There should be a way to suppress warnings from Netbeans about "The column name
of the persistent field is a SQL-99 keyword". Ideally using @SupressWarnings
Comment 1 Andrei Badea 2006-10-25 09:13:40 UTC
Tomasz, I guess this is yours.
Comment 2 Tomasz Slota 2007-02-16 09:48:12 UTC
I suggest the following:

- it will possible to suppress warnings on the following levels  "jpa", "ejb" and "jaxws"

- errors will not be suppressed

open questions: 

- should hints associated with suppressed warnings be still available (examples: create persistence 
unit..., implement java.io.Serializable)

problems:

- there is a number of checks that operate on class level. To be compliant with 
java.lang.SupressWarnings semantics, if a class is annotated with @SuppressWarnings we will have to 
suppress warnings for all the class members as well, which may not be desirable

- we will be introducing new warning names ("jpa", "ejb" and "jaxws"). According to the spec:

"The presence of unrecognized warning names is not an error: Compilers must ignore any warning 
names they do not recognize. They are, however, free to emit a warning if an annotation contains an 
unrecognized warning name." In practice numerous static analysis tools define their own warning 
names, such as "PMD"

Comment 3 Jesse Glick 2007-02-16 16:53:03 UTC
Doesn't javac in fact warn about unrecognized warning names?

FindBugs uses @SuppressWarnings... but in a different package... sometimes. It's
a mess. See:

https://sourceforge.net/tracker/?func=detail&aid=1557422&group_id=96405&atid=614693
Comment 4 Tomasz Slota 2007-02-16 18:49:05 UTC
Does it mean there is no "clean" solution? I will ask the AVK team if the were thinking of anything similar
Comment 5 Sanjeeb Sahoo 2007-02-17 09:01:28 UTC
We have never done any thing like @SuppressWarnings in AVK. In the
pre-annotation days we thought of providing a mechanism to users to suppress
running some assertions by listing them in a user supplied XML file, but that
was never implemented.

The suggestion to use SuppressWarnings for NetBeans verification module sounds
good to me. If we deicide to use an annotation, we should use
java.lang.SuppressWarnings, otherwise user's code become non-portable. Another
option would be to encode the information in comments, similar to what pragmas
are in some languages.

Thanks,
Sahoo
Comment 6 Andrei Badea 2008-01-21 13:35:51 UTC
When (and if) this is implemented, consider re-adding the "entity field must be encapsulated" warning, which was removed
in issue 124225.
Comment 7 _ gtzabari 2008-01-21 13:37:09 UTC
As a side-note, FindBugs already uses @SuppressWarnings to suppress its own warnings.
Comment 8 Martin Balin 2016-07-07 08:54:41 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss