Search in sources :

Example 1 with Phase

use of org.sonar.api.batch.Phase in project sonarlint-core by SonarSource.

the class ScannerExtensionDictionnary method evaluatePhase.

private static Phase.Name evaluatePhase(Object extension) {
    Object extensionToEvaluate;
    if (extension instanceof SensorWrapper) {
        extensionToEvaluate = ((SensorWrapper) extension).wrappedSensor();
    } else {
        extensionToEvaluate = extension;
    }
    Phase phaseAnnotation = AnnotationUtils.getAnnotation(extensionToEvaluate, Phase.class);
    if (phaseAnnotation != null) {
        return phaseAnnotation.name();
    }
    return Phase.Name.DEFAULT;
}
Also used : Phase(org.sonar.api.batch.Phase)

Example 2 with Phase

use of org.sonar.api.batch.Phase in project sonarqube by SonarSource.

the class ScannerExtensionDictionnary method evaluatePhase.

private static Phase.Name evaluatePhase(Object extension) {
    Object extensionToEvaluate;
    if (extension instanceof SensorWrapper) {
        extensionToEvaluate = ((SensorWrapper) extension).wrappedSensor();
    } else {
        extensionToEvaluate = extension;
    }
    Phase phaseAnnotation = AnnotationUtils.getAnnotation(extensionToEvaluate, Phase.class);
    if (phaseAnnotation != null) {
        return phaseAnnotation.name();
    }
    return Phase.Name.DEFAULT;
}
Also used : SensorWrapper(org.sonar.scanner.sensor.SensorWrapper) Phase(org.sonar.api.batch.Phase)

Aggregations

Phase (org.sonar.api.batch.Phase)2 SensorWrapper (org.sonar.scanner.sensor.SensorWrapper)1