Parse error Type annotation are not allowed to type names used to access static members

I’m using sonarqube-ant-task-2.7.0.1612.jar to scan a java project and I’m seeing the following errors over and over again on my source files:

Parse error at line XXX column XX: Type annotation are not allowed to type names used to access static members

The code in question involves:

public Double getValue(@NonNull String key) {

SonarQube is complianing about the placement of the @NonNull annotation - is there any way to fix this up (without changing the source) so that it will parse these files correctly?

Hey,

Could you provide the entire logs of your analysis?
Also, what is your SonarQube version, as well as SonarSource Java Analyzer version?

Our Java parser is expected to be completely able to parse such annotations. I suspect the log to come from something else, or another part of the code.

Cheers,
Michael