Community
Participate
Working Groups
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
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.
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...
Or maybe simpler form: -warn:-discouraged,-forbidden
> 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.
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.
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.
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).
Created attachment 33363 [details] Fix for diagnostic suppression Adds -warn:-discouraged and -warn:-forbidden. Messages alignment still in progress.
Created attachment 33452 [details] Patch #1 plus improved messages
See BatchCompilerTest 41->43 for test cases.
Verified for 3.2 M5 using build I20060214-0010