Bug 124533 - [batch] Ability to turn off discouraged references warnings
Summary: [batch] Ability to turn off discouraged references warnings
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.2 M5   Edit
Assignee: Maxime Daniel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-19 15:10 EST by Darin Swanson CLA
Modified: 2006-02-14 07:50 EST (History)
0 users

See Also:


Attachments
Fix for diagnostic suppression (10.40 KB, patch)
2006-01-20 12:20 EST, Maxime Daniel CLA
no flags Details | Diff
Patch #1 plus improved messages (19.96 KB, patch)
2006-01-23 04:47 EST, Maxime Daniel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Swanson CLA 2006-01-19 15:10:20 EST
We are working on a project that is in its early stages and the API is still being defined.

As such, access rules have not fully been defined.

During our PDE build using the JDT compiler we are getting many many discouraged references warnings.

I would request that we could pass a compiler argument to turn off the reporting of these warnings that map to the OPTION_ReportDiscouragedReference
Comment 1 Olivier Thomann CLA 2006-01-19 15:32:27 EST
Once the build.xml is generated, the workaround I see is to comment out the line that contains the access rules generated by PDE.
It is the line with: <compilerarg .... javaCompiler...args ...
When commented out, the compiler won't be fed with access rules.

Then you make sure that you don't override that file again.
Comment 2 Philipe Mulet CLA 2006-01-19 16:41:42 EST
To clarify. Are you talking about the Ant javac adapter ? The batch compiler ?

Olivier - can't we make this configurable on the commandline ? -warn:-discouragedRestrictions,forbiddenRestrictions

or something in same area...
Comment 3 Philipe Mulet CLA 2006-01-19 16:43:14 EST
Or maybe simpler form:
-warn:-discouraged,-forbidden
Comment 4 Darin Swanson CLA 2006-01-19 17:36:00 EST
> Or maybe simpler form:
> -warn:-discouraged,-forbidden
These would be great to feed to the Ant javac adapter via the compilerArg. Currently we are only using -warn:-serial.

I do not see the commenting out as a viable solution as we have many plugins from numerous teams and the build.xml is generated by pdebuild.

Comment 5 Olivier Thomann CLA 2006-01-19 18:46:32 EST
I could. But talking with Maxime, this is implicitely done by the access rule which sets what is discouraged, forbidden or ok.
I can investigate to add warnings.
Comment 6 Philipe Mulet CLA 2006-01-20 04:28:41 EST
Reassigning to Maxime.

I need 2 things:
- allow to configure severity (warning/none) on command line for either discouraged or forbidden references. Note that the defaults are fine (warning).
- change restriction messages to align with standard messages issued by the builder.
Comment 7 Philipe Mulet CLA 2006-01-20 04:29:44 EST
This way the batch compiler will be able to ignore restrictions from its classpath, like the builder does (the severity for restricted access is controlled in compiler preferences).
Comment 8 Maxime Daniel CLA 2006-01-20 12:20:30 EST
Created attachment 33363 [details]
Fix for diagnostic suppression

Adds -warn:-discouraged and -warn:-forbidden.
Messages alignment still in progress.
Comment 9 Maxime Daniel CLA 2006-01-23 04:47:35 EST
Created attachment 33452 [details]
Patch #1 plus improved messages
Comment 10 Maxime Daniel CLA 2006-01-23 05:34:50 EST
See BatchCompilerTest 41->43 for test cases.
Comment 11 Jerome Lanneluc CLA 2006-02-14 07:50:12 EST
Verified for 3.2 M5 using build I20060214-0010