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 256906 - Migrate to JDK 5/7/8 inspect and transform should not have Static imports conversion enabled by default
Summary: Migrate to JDK 5/7/8 inspect and transform should not have Static imports con...
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-01 19:02 UTC by an_re
Modified: 2015-12-01 19:02 UTC (History)
0 users

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 an_re 2015-12-01 19:02:44 UTC
Actually I just tried "Migrate to JDK 7" "Inspect and Transform" action and was surprised that it replaced static method usages by static imports.
It was clear for me how to avoid that behavior (unlike for user reporting Bug 241030). I still was surprised because it is not a JDK 7 feature (and existed for quiet long) which is used not so often (perhaps except for JUnit's assert methods).

Looking at the Manage Inspections dialog box for Migrate to JDK 5/7/8, my assumption is that it was added to "Migrate to JDK 5" Inspect and Transform (because it was a JDK 5 feature) and is still there for Migrate to JDK 7/8 because the inspections always add up (as it is not defined from which JDK the transformation is done).

However, IMHO "Static imports" Inspect and Transform should not be enabled by default for Migrate to JDK 5/7/8 (even if JDK 5/7/8 support that feature) because even the JavaDoc for static imports (https://docs.oracle.com/javase/1.5.0/docs/guide/language/static-import.html) says that this feature should be used "Very sparingly!" (the reasons are given in the last paragraph of the above-mentioned URL). IMHO, something which should be done "very sparingly", should not be done automatically (on project level), at least not as default, because it requires a conscious decision.