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 77345 - New queries: fix getClass() in NbBundle calls, add private to serialVersionUID fields
Summary: New queries: fix getClass() in NbBundle calls, add private to serialVersionUI...
Status: RESOLVED WONTFIX
Alias: None
Product: contrib
Classification: Unclassified
Component: Jackpot (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@contrib
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-03 02:10 UTC by Nathan Fiedler
Modified: 2010-04-27 18:41 UTC (History)
0 users

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 Nathan Fiedler 2006-06-03 02:10:05 UTC
There isn't an appropriate subcomponent yet, but this should be entered under
something like "queries". In the meantime, here are two ideas for new queries:

1. Fix NbBundle.getMessage(getClass(), ...) such that getClass() is replaced
with the NameOfContainingClass.class expression.

2. Add 'private' to all serialVersionUID fields that do not specify an access
modifier. Possibly also change other modifiers to private, since it is "strongly
advised" to make them private anyway.
Comment 1 Jesse Glick 2006-06-03 13:02:38 UTC
Note that there is a NB module apisupport/jackpotrules which contains some
NetBeans-specific rules. There is currently a rule

java.util.ResourceBundle.getBundle($bundle) =>
org.openide.util.NbBundle.getBundle($bundle);

I don't think it's possible to write most of the more useful rules re. NbBundle
in the current rule language. Would need to use a Java-implemented rule, I
guess. Here are some:

1. Your rule (getClass() -> ThisClass.class)

2. Ensure existing Class constant is correct (needs human review)

3. NbB.gB($b) -> NbB.gB(ThisClass.class) where $b = pkgOf(ThisClass) + ".Bundle"

4. Change NbB.getBundle($b).getString($s) -> NbB.gMessage($b, $s) and
MessageFormat.format(NbB.gB($b), $args$) -> NbB.getMessage($b, $args$) [this
part should work in rule language]

5. Do not keep ResourceBundle's in (usually static) fields; load on demand
Comment 2 _ gtzabari 2008-01-08 21:18:37 UTC

*** This issue has been marked as a duplicate of 70746 ***
Comment 3 _ gtzabari 2008-01-08 21:19:11 UTC
Sorry, I modified the wrong issue.
Comment 4 Jesse Glick 2010-04-27 18:41:13 UTC
The old Jackpot module is no longer maintained. There is a rewrite in progress at: http://bitbucket.org/jlahoda/jackpot30/wiki/Home