diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2012-08-16 18:00:48 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2012-08-16 18:00:48 +0200 |
commit | faa012f7b03c7e62dcd6aefd59bbad0c6b4be351 (patch) | |
tree | 412472a6141044b30f0621a781133647bb051b74 /sonar-check-api | |
parent | 5c66652705937dbb24b6728180c63b1c951051d3 (diff) | |
download | sonarqube-faa012f7b03c7e62dcd6aefd59bbad0c6b4be351.tar.gz sonarqube-faa012f7b03c7e62dcd6aefd59bbad0c6b4be351.zip |
SONAR-3706 API : remove the deprecated annotation org.sonar.check.Check
Diffstat (limited to 'sonar-check-api')
5 files changed, 0 insertions, 242 deletions
diff --git a/sonar-check-api/src/main/java/org/sonar/check/Check.java b/sonar-check-api/src/main/java/org/sonar/check/Check.java deleted file mode 100644 index b96b655dd3e..00000000000 --- a/sonar-check-api/src/main/java/org/sonar/check/Check.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.check; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @since 2.1 (experimental) - * @deprecated since 2.3. Use @Rule - */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -@Deprecated -public @interface Check { - - /** - * The default key is the class name. - */ - String key() default ""; - - /** - * The path to resource bundles (optional). If not set, then it equals the class name. - */ - String bundle() default ""; - - /** - * The check title. If not defined, then the title is the key - */ - String title() default ""; - - /** - * The check description, optional. - */ - String description() default ""; - - /** - * Default priority. - */ - Priority priority() default Priority.MAJOR; - - /** - * Will probably be deprecated and replaced by tags - * - * @deprecated since 2.5. See http://jira.codehaus.org/browse/SONAR-2007 - */ - @Deprecated - IsoCategory isoCategory(); -} diff --git a/sonar-check-api/src/main/java/org/sonar/check/CheckProperty.java b/sonar-check-api/src/main/java/org/sonar/check/CheckProperty.java deleted file mode 100644 index 64ba5859034..00000000000 --- a/sonar-check-api/src/main/java/org/sonar/check/CheckProperty.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.check; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @since 2.1 (experimental) - * @deprecated since 2.3. Use @RuleProperty - */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.FIELD) -@Deprecated -public @interface CheckProperty { - - /** - * The default key is the field name, read by reflection. Overriding this key can be useful when - * obfuscating the code. - */ - String key() default ""; - - String title() default ""; - - /** - * Optional description - */ - String description() default ""; -} diff --git a/sonar-check-api/src/test/java/org/sonar/check/AnnotationIntrospectorTest.java b/sonar-check-api/src/test/java/org/sonar/check/AnnotationIntrospectorTest.java deleted file mode 100644 index 0370e8e1ded..00000000000 --- a/sonar-check-api/src/test/java/org/sonar/check/AnnotationIntrospectorTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.check; - - -@Check(isoCategory = IsoCategory.Portability, priority = Priority.CRITICAL) -class SimplestCheck { - -} - -@Check(key = "overridenKey", isoCategory = IsoCategory.Portability, priority = Priority.CRITICAL) -class CheckWithOverridenKey { - -} - -@Check(isoCategory = IsoCategory.Portability, priority = Priority.CRITICAL) -class CheckWithProperties { - - @CheckProperty - private boolean active = false; - - @CheckProperty(key = "Maximum") - private int max = 50; - - private String nonProperty; -}
\ No newline at end of file diff --git a/sonar-check-api/src/test/java/org/sonar/check/CheckTest.java b/sonar-check-api/src/test/java/org/sonar/check/CheckTest.java deleted file mode 100644 index 10c690480e6..00000000000 --- a/sonar-check-api/src/test/java/org/sonar/check/CheckTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.check; - -import org.junit.Test; - -import java.lang.reflect.Field; - -import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; - -public class CheckTest { - @Test - public void getCheckMetadata() { - Check check = FakeCheck.class.getAnnotation(Check.class); - assertThat(check.title(), is("Detailed Check")); - assertThat(check.description(), is("Detailed description")); - } - - @Test - public void getCheckProperty() throws NoSuchFieldException { - Field field = FakeCheck.class.getDeclaredField("max"); - CheckProperty propertyAnnotation = field.getAnnotation(CheckProperty.class); - assertThat(propertyAnnotation.description(), is("Maximum value")); - } -} diff --git a/sonar-check-api/src/test/java/org/sonar/check/FakeCheck.java b/sonar-check-api/src/test/java/org/sonar/check/FakeCheck.java deleted file mode 100644 index 051922c6dac..00000000000 --- a/sonar-check-api/src/test/java/org/sonar/check/FakeCheck.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.check; - -@Check(title ="Detailed Check", description = "Detailed description", isoCategory = IsoCategory.Reliability) -public class FakeCheck { - - @CheckProperty(description = "Maximum value") - private String max; - - @CheckProperty(description ="Minimum value") - protected String min; - - private int nonConfigurableProperty; - - public String getMax() { - return max; - } - - public void setMax(String max) { - this.max = max; - } -} |