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 227271 - HintTest should enforce Fix contracts for Inspect&Transform
Summary: HintTest should enforce Fix contracts for Inspect&Transform
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.4
Hardware: PC Linux
: P3 normal (vote)
Assignee: apireviews
URL:
Keywords: API, API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2013-03-11 09:35 UTC by Jan Lahoda
Modified: 2013-04-04 12:28 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Proposed change. (16.85 KB, patch)
2013-03-11 09:40 UTC, Jan Lahoda
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Lahoda 2013-03-11 09:35:48 UTC
If a hint is do be used in Inspect&Transform, the fixes (and especially the "primary" Fix) it provides must fulfil a number of constraints:
1. must be JavaFix-es
2. must not have any side-effects
3. must be repeatable

The proposal is to partially enforce these constraints in tests, while a Fix is being applied. In particular, unless the hint is marked as QUERY, NO_BULK or it is an action, it is:
-checked to be JavaFix
-applies the fix twice, and checks the resulting ModificationResults are equivalent

This is a behaviourally incompatible change - so far these constraints were not enforced by the tests. Currently, there is no way to suppress these specific test failures, either the fix must be fixed, or the hint marked as QUERY or NO_BULK. But a way to suppress the failure can be added if a compelling reason for suppression is found.
Comment 1 Jan Lahoda 2013-03-11 09:40:41 UTC
Created attachment 132445 [details]
Proposed change.
Comment 2 Jan Lahoda 2013-03-11 09:42:08 UTC
Please review this behaviourally incompatible change to the hint test API.

Thanks.
Comment 3 Jan Lahoda 2013-03-18 11:41:37 UTC
Unless there are objections, I'll integrate tomorrow.
Comment 4 Quality Engineering 2013-03-24 01:54:11 UTC
Integrated into 'main-golden', will be available in build *201303232300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/b55ff1661fd9
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #227271: partial enforcement of Java hints constraints for Inspect&Transform