From: Julien Lancelot Date: Tue, 8 Sep 2015 12:49:21 +0000 (+0200) Subject: SONAR-6730 Improve javadoc X-Git-Tag: 5.2-RC1~460 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4fd276fb8febe54800f3f23fe4b815dba0cd8fb4;p=sonarqube.git SONAR-6730 Improve javadoc --- 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}