From 4fd276fb8febe54800f3f23fe4b815dba0cd8fb4 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Tue, 8 Sep 2015 14:49:21 +0200 Subject: [PATCH] SONAR-6730 Improve javadoc --- .../sonar/api/ce/measure/MeasureComputer.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/ce/measure/MeasureComputer.java b/sonar-plugin-api/src/main/java/org/sonar/api/ce/measure/MeasureComputer.java index df3e4f2ce37..daa7821a0d7 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/ce/measure/MeasureComputer.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/ce/measure/MeasureComputer.java @@ -67,7 +67,7 @@ import org.sonar.api.server.ServerSide; * * MyMeasureComputer underTest = new MyMeasureComputer(); * - * @Test + * {@literal @}Test * public void test_definition() { * TestMeasureComputerDefinitionContext defContext = new TestMeasureComputerDefinitionContext(); * MeasureComputerDefinition def = underTest.define(defContext); @@ -76,7 +76,7 @@ import org.sonar.api.server.ServerSide; * assertThat(def.getOutputMetrics()).containsOnly("my_new_metric"); * } * - * @Test + * {@literal @}Test * public void sum_ncloc_and_issues() { * TestMeasureComputerContext context = new TestMeasureComputerContext(underTest); * context.addMeasure("ncloc", 2); @@ -119,14 +119,26 @@ public interface MeasureComputer { Set getOutputMetrics(); interface Builder { + /** - * Input metrics can be empty (for instance when only issues are needed) + * List of metric keys of the measures that will be loaded by this computer. It can be empty (for instance when only issues are needed). + * A metric must be either a {@link org.sonar.api.measures.CoreMetrics} or a metric provided by {@link org.sonar.api.measures.Metrics} + * * @throws NullPointerException if inputMetrics is null * @throws NullPointerException if the metrics contains a {@code null} * */ Builder setInputMetrics(String... inputMetrics); /** + * List of metric keys of the measures that can be added by this computer. At least one metric key must be defined. + * + * At runtime, the following conditions will be validated : + * + * * @throws NullPointerException if outputMetrics is null * @throws IllegalArgumentException if there's not at least one output metrics * @throws NullPointerException if the metrics contains a {@code null} -- 2.39.5