I'm trying to find out what source code file I'm analyzing (to read config
files accordingly), but unfortunately, RuleContext.getSourceCodeFile() always
returns null (I'm overriding AbstractJavaRule.start(RuleContext)).
The PMD version I am currently using is 4.2.x. Do you have any insight on
That API is not called per AST, it is meant to be called across ASTs. For a
Java rule, visit 'ASTCompilationUnit' and the RuleContext will have source
code file set.
Thank you! I didn't realize that the data object passed to visit methods is
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.