Bug 486375 - Provide a mechanism to have different JavaDoc warning levels in different subtrees
Summary: Provide a mechanism to have different JavaDoc warning levels in different sub...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.5   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-22 10:59 EST by Stefan Xenos CLA
Modified: 2016-01-22 11:21 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Xenos CLA 2016-01-22 10:59:58 EST
Our codebase has slightly different JavaDoc conventions for unit tests and non-tests. In particular, normal code requires JavaDoc on all public declations but unit tests do not.

The same project contains both tests and non-tests, located in different source roots. I have a reliable way to tell the difference between tests and non-tests programmatically.

If it's already possible to do so, I'd like to write a plugin that causes the "missing javadoc on public declarations" feature to be enabled for non-tests and disabled for tests, such that these markers don't show up when compiling unit tests. 

If it's not possible, I'd like to contribute whatever JDT core support is necessary to facilitate such a plugin.

Either way, I could really use the advice of a JDT core expert to point me in the right direction. Where would be the best place to plug this feature in?

It looks to me as though the problem severity is determined by ProblemReporter, which in turn consults CompilerOptions... so if I could somehow use a different set of CompilerOptions for different subtrees, that should do the trick. Any tips?
Comment 1 Stefan Xenos CLA 2016-01-22 11:21:06 EST
I notice that ProblemHandler.java line 145 tests for "ignoreOptionalProblems()" on the compilation unit, which in turn consults a property attached to the source root.

Perhaps a similar mechanism would work here. Something like ICompilationUnit#ignoreProblemId(problemId), which could in turn consult a blacklist attached to the source root.