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 233475 - Integrate Inspect & Transform with OnSave
Summary: Integrate Inspect & Transform with OnSave
Status: RESOLVED DUPLICATE of bug 204063
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 7.1
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-26 09:51 UTC by Geertjan Wielenga
Modified: 2016-01-10 20:54 UTC (History)
2 users (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 Geertjan Wielenga 2013-07-26 09:51:23 UTC
In the OnSave panel in Options window, all the items under Source | Inspect and Refactor | Inspect and Transform should be available. In that way, user should be able to select the inspections that are executed on saving a file.
Comment 1 Jan Lahoda 2013-07-26 12:16:26 UTC
Hm, on the lowest level, the internal infrastructure is the same - the difference between On Save and Inspect&Transform is mostly the UI.

Placing a fixable hint into On Save list brings some challenges, though:
a) it needs to be decided if it should have an option to be applied only on modified lines. If yes, then there is currently no infrastructure support for this, so it would need to be added (this option does not make much sense for Organize Imports/Members, but might make sense for e.g. Make fields final).
b) the quality requirements on hints in the On Save list are much higher than for "normal" hints: a misbehaving hint may render the IDE virtually unusable. This is not only a development constraint, it is also a testing constraint: someone needs to test the hint much better.

So, I don't think we can commit to just adding all fixable hints into the On Save list (and to simply let new ones appear there as new hints are created). I would much more prefer to add specific hints in testable and fixable amounts as found useful.
Comment 2 Geertjan Wielenga 2013-07-26 12:20:44 UTC
I'm fine with that. I'm thinking specifically about Java Code Metrics, i.e., on save, run Java Code Metrics so the developer can see the current state of metrics based on latest changes.
Comment 3 Svata Dedic 2013-07-26 15:57:46 UTC
Is it really necessary to run inspect & transform on save ? For example IDEA allows to configure inspections before commit into VCS; in the case the inspection founds some errors, the commit is delayed -- the user is warned with an option to commit anyway or review the potential defects found.
Comment 4 Geertjan Wielenga 2013-07-26 20:37:52 UTC
Wow, that would be great. That is a better idea than mine. My main concern is that we need to integrate these inspections into the workflow, rather than requiring the user to take separate steps to perform the inspections. I.e., if they happen somewhere automatically, that would be brilliant and I agree with the scenario you describe. This will be great.
Comment 5 markiewb 2016-01-10 20:54:39 UTC
(In reply to Svata Dedic from comment #3)
> Is it really necessary to run inspect & transform on save ? For example IDEA
> allows to configure inspections before commit into VCS; in the case the
> inspection founds some errors, the commit is delayed -- the user is warned
> with an option to commit anyway or review the potential defects found.

Duplicate of https://netbeans.org/bugzilla/show_bug.cgi?id=204063

*** This bug has been marked as a duplicate of bug 204063 ***