Disable VariableNamingConventions for native methods
A source code analyzer
Brought to you by:
adangel,
juansotuyo
For this line :
private native void stream_dip_set_data(long stream, long dip_x, long dip_z);
I've the error :
VariableNamingConventions
=> Problem : this is a native function & not a variable !
The rule actually complains about the two parameter names "dip_x" and "dip_z" - they contain underscores.
There are a couple of parameters, to configure the rule: http://pmd.sourceforge.net/pmd-5.2.2/pmd-java/rules/java/naming.html#VariableNamingConventions
You can disable "checkParameters" to ignore all method parameter names.
Or do you think, a rule property, e.g. "ignoreNativeMethods" would be better? However, I would by default leave the rule, like it is currently - check native methods by default, too.
Let me know, if you want a "ignoreNativeMethods" flag.
Hello ,
Yeah i think it would be a good idea to have an option to disable this rule for native methods !
I have the same problem with the rule MethodNamingConventions that checks underscores on method names (I probably didn't report the correct one) : it would be interesting to define the same option (disable native methods) for this rule too !
Thanks a lot,
Added a new property
checkNativeMethodParameters
with which you can ignore parameters of native methods.Will be included in the next release.