Bug 124533

Summary: [batch] Ability to turn off discouraged references warnings
Product: [Eclipse Project] JDT Reporter: Darin Swanson <Darin_Swanson>
Component: CoreAssignee: Maxime Daniel <maxime_daniel>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: 3.2   
Target Milestone: 3.2 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Fix for diagnostic suppression
none
Patch #1 plus improved messages none

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