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 32182 - Unused Keys Detection Tool
Summary: Unused Keys Detection Tool
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: I18N (show other bugs)
Version: 3.x
Hardware: Sun Solaris
: P3 blocker (vote)
Assignee: Ralph Ruijs
URL:
Keywords: UI
Depends on:
Blocks:
 
Reported: 2003-03-21 04:16 UTC by Ken Frank
Modified: 2011-11-28 09:21 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 Ken Frank 2003-03-21 04:16:09 UTC
this is jdk issue 4834881 - they felt that this
rfe really applied to an ide like netbeans and
asked me to file it as rfe -
I'm not sure if nb already does this.

A DESCRIPTION OF THE REQUEST :
Maintaining resource bundle properties files can
often be a tediou
s task.  Over time, a properties file can become
filled with strin
gs that are no longer used.  Currently, the only
way to fix this i
s to manually go through the list of strings in
the properties fil
e and ensure that each string is actually being
used in a java fil
e somewhere.

JUSTIFICATION :
Increases efficiency of I18n tasks, since unused
strings don't nee
d to be translated.

EXPECTED VERSUS ACTUAL BEHAVIOR :
It would be nice if support was built into the
compiler to optiona
lly verify the contents of properties files and
display a message 
for each string that is missing or not used.
I don't think it's possible to determine this with
100% accuracy, 
since the keys can be determined at runtime. 
However, most of the
 time developers use string literals as keys, so
it might be possi
ble to develop something useful.
Comment 1 _ pkuzel 2003-03-24 10:06:52 UTC
We already have Test internatinalization wizard (the name was
suggested by HIE) that use some heuristics to detect missing keys for
given Java source.

It's even more complicated to automaticaly detect non-referenced
strings. The problem is how to define non-referenced. E.g. if you look
over NetBeans codebase you can find that properties are used to
localize XML documents. They ate also used to localize manifests. They
are also used to localize editor token names. None of above examples
has pairing line containing direct reference to key in a Java source.

Properties file is secondary structure that does no know its primary
referees and cannot be reliably used in key garbage decision process.
It would be possible for keys annotated by referencing file(s).

On the other hand it's real problem and we could address it by action
that would provide hints leaving final action/key_removal on user's
decision.
Comment 2 Ondrej Rypacek 2005-04-29 10:22:46 UTC
Yes, I guess some tool offering candidates for removal might be possible and useful.