diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2011-10-11 14:23:43 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2011-10-11 14:23:43 +0200 |
commit | cb9597afe6f21f4751cfb5a82c8947f467d7b315 (patch) | |
tree | 9c309534ec198550c183312045f00a5345fd63ff | |
parent | f1a1da830bf72b890786da3c8de23fe7c36d2440 (diff) | |
download | sonarqube-cb9597afe6f21f4751cfb5a82c8947f467d7b315.tar.gz sonarqube-cb9597afe6f21f4751cfb5a82c8947f467d7b315.zip |
SONAR-2875 deprecate CodeCheck CheckMessage#getChecker(), replaced by Object CheckMessage#getCheck()
-rw-r--r-- | plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/ChecksBridge.java | 2 | ||||
-rw-r--r-- | sonar-squid/src/main/java/org/sonar/squid/api/CheckMessage.java | 24 |
2 files changed, 17 insertions, 9 deletions
diff --git a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/ChecksBridge.java b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/ChecksBridge.java index 836c1b886aa..02b0e486ab8 100644 --- a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/ChecksBridge.java +++ b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/ChecksBridge.java @@ -39,7 +39,7 @@ public class ChecksBridge extends Bridge { Set<CheckMessage> messages = squidFile.getCheckMessages(); if (messages != null) { for (CheckMessage checkMessage : messages) { - ActiveRule rule = checkFactory.getActiveRule(checkMessage.getChecker()); + ActiveRule rule = checkFactory.getActiveRule(checkMessage.getCheck()); Violation violation = Violation.create(rule, sonarFile); violation.setLineId(checkMessage.getLine()); violation.setMessage(checkMessage.getText(Locale.ENGLISH)); diff --git a/sonar-squid/src/main/java/org/sonar/squid/api/CheckMessage.java b/sonar-squid/src/main/java/org/sonar/squid/api/CheckMessage.java index 7fd41a638f3..d1760d8dd39 100644 --- a/sonar-squid/src/main/java/org/sonar/squid/api/CheckMessage.java +++ b/sonar-squid/src/main/java/org/sonar/squid/api/CheckMessage.java @@ -30,13 +30,13 @@ public class CheckMessage implements Message { private Integer line; private Double cost; private SourceCode sourceCode; - private Object checker; + private Object check; private String defaultMessage; private Object[] messageArguments; private Boolean bypassExclusion; - public CheckMessage(Object checker, String message, Object... messageArguments) { - this.checker = checker; + public CheckMessage(Object check, String message, Object... messageArguments) { + this.check = check; this.defaultMessage = message; this.messageArguments = messageArguments; } @@ -45,8 +45,8 @@ public class CheckMessage implements Message { * @deprecated replaced by the other constructor since 2.12. See SONAR-2875. */ @Deprecated - public CheckMessage(CodeCheck checker, String message, Object... messageArguments) { - this((Object)checker, message, messageArguments); + public CheckMessage(CodeCheck check, String message, Object... messageArguments) { + this((Object)check, message, messageArguments); } public void setSourceCode(SourceCode sourceCode) { @@ -81,8 +81,16 @@ public class CheckMessage implements Message { return bypassExclusion == null ? false : bypassExclusion; } - public Object getChecker() { - return checker; + /** + * @deprecated replaced by getCheck() since 2.12. Warning, to be called only if check is CodeCheck. + */ + @Deprecated + public CodeCheck getChecker() { + return (CodeCheck)check; + } + + public Object getCheck() { + return check; } public String getDefaultMessage() { @@ -99,7 +107,7 @@ public class CheckMessage implements Message { @Override public String toString() { - return new ToStringBuilder(this).append("source", sourceCode).append("checker", checker).append("msg", defaultMessage) + return new ToStringBuilder(this).append("source", sourceCode).append("check", check).append("msg", defaultMessage) .append("line", line).toString(); } |