diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2015-08-10 15:04:49 +0200 |
---|---|---|
committer | Duarte Meneses <duarte.meneses@sonarsource.com> | 2015-08-12 16:12:50 +0200 |
commit | 3be4a0c53385a59c40e87f7e8ba5283b1c5928d3 (patch) | |
tree | f49d582e482c3664281b2f60d9214a4e8223812d /sonar-plugin-api | |
parent | 3dfd88128803a86d614d4085a19c004e230f73ef (diff) | |
download | sonarqube-3be4a0c53385a59c40e87f7e8ba5283b1c5928d3.tar.gz sonarqube-3be4a0c53385a59c40e87f7e8ba5283b1c5928d3.zip |
SONAR-6777 Project cache sync
Diffstat (limited to 'sonar-plugin-api')
5 files changed, 20 insertions, 8 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java b/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java index 8e508b0d565..c023f8a0782 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java @@ -446,8 +446,6 @@ public interface CoreProperties { */ String ANALYSIS_MODE_ISSUES = "issues"; - String ANALYSIS_MODE_PUBLISH = "publish"; - /** * @since 5.2 */ diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/log/DefaultProfiler.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/log/DefaultProfiler.java index cfeb9b29604..266e4f10742 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/log/DefaultProfiler.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/log/DefaultProfiler.java @@ -94,24 +94,31 @@ class DefaultProfiler extends Profiler { @Override public Profiler stopTrace() { - return doStopWithoutMessage(LoggerLevel.TRACE); + return doStopWithoutMessage(LoggerLevel.TRACE, " (done)"); } @Override public Profiler stopDebug() { - return doStopWithoutMessage(LoggerLevel.DEBUG); + return doStopWithoutMessage(LoggerLevel.DEBUG, " (done)"); } @Override public Profiler stopInfo() { - return doStopWithoutMessage(LoggerLevel.INFO); + return stopInfo(false); } + - private Profiler doStopWithoutMessage(LoggerLevel level) { + @Override + public Profiler stopInfo(boolean cacheUsed) { + String suffix = cacheUsed ? " (done from cache)" : " (done)"; + return doStopWithoutMessage(LoggerLevel.INFO, suffix); + } + + private Profiler doStopWithoutMessage(LoggerLevel level, String suffix) { if (startMessage == null) { throw new IllegalStateException("Profiler#stopXXX() can't be called without any message defined in start methods"); } - doStop(level, startMessage, " (done)"); + doStop(level, startMessage, suffix); return this; } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/log/Loggers.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/log/Loggers.java index dc82b8b3f2b..c559d92cea4 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/log/Loggers.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/log/Loggers.java @@ -36,7 +36,7 @@ public abstract class Loggers { } } - public static Logger get(Class name) { + public static Logger get(Class<?> name) { return factory.newInstance(name.getName()); } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/log/NullProfiler.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/log/NullProfiler.java index 65a943e9447..7f0e3721a65 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/log/NullProfiler.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/log/NullProfiler.java @@ -93,4 +93,9 @@ class NullProfiler extends Profiler { // nothing to do return this; } + + @Override + public Profiler stopInfo(boolean cacheUsed) { + return this; + } } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/log/Profiler.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/log/Profiler.java index c22d4ed2939..d82c5622de3 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/log/Profiler.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/log/Profiler.java @@ -65,6 +65,8 @@ public abstract class Profiler { public abstract Profiler stopDebug(); public abstract Profiler stopInfo(); + + public abstract Profiler stopInfo(boolean cacheUsed); public abstract Profiler stopTrace(String message); |