getMeasure and saveMeasure methods in SensorContext interface
Now I’m moving to sonarqube 8.9.2 LTS, I couldn’t find a replacement for the Issuable class, and I don’t know if there’s actually an alternative for this class.
I’ve found a replacement for saveMeasure which is the SensorContext.newMeasure method but for the getMeasure method I couldn’t get any, is there an alternative?
This will be a bit difficult to tell you if there is a replacement without knowing your use case.
The “new” API is much more restrictive (for good reasons ). A Sensor can only “save” measures, using the SensorContext.newMeasure API as you already discovered.
Then if you need to aggregate measure in a later stage, you should have a look at the MeasureComputer extension point that allows to read other measures. Please have a look at sonar-custom-plugin-example/src/main/java/org/sonarsource/plugins/example/measures at 8.x · Sonar for examples.
For the Issuable class, I was using it to save issues on a given InputFile. Now, I’m no more using this method, since I execute the SensorContext.newMeasure method whithin the rule itself.
For the measure reading part, I’m going to get a look at the MeasureComputer extension.
Thank you again! your reply turned out to be really helpful.