aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2016-02-24 15:59:44 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2016-02-25 10:18:10 +0100
commitf778401c09aa500c89e0d1ac3d86b8ab6ac6c069 (patch)
tree4ea4c1036b7cc607c22702cdd65b32570d5fe1a3 /sonar-core
parent1352671c05bcd69ad09884256ec1f928de9c8417 (diff)
downloadsonarqube-f778401c09aa500c89e0d1ac3d86b8ab6ac6c069.tar.gz
sonarqube-f778401c09aa500c89e0d1ac3d86b8ab6ac6c069.zip
Move org.sonar.core.rule to org.sonar.server.rule
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/rule/RuleKeyFunctions.java49
-rw-r--r--sonar-core/src/main/java/org/sonar/core/rule/SeverityUtil.java37
-rw-r--r--sonar-core/src/main/java/org/sonar/core/rule/package-info.java24
-rw-r--r--sonar-core/src/test/java/org/sonar/core/rule/RuleKeyFunctionsTest.java46
4 files changed, 0 insertions, 156 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/rule/RuleKeyFunctions.java b/sonar-core/src/main/java/org/sonar/core/rule/RuleKeyFunctions.java
deleted file mode 100644
index d7fae9d920a..00000000000
--- a/sonar-core/src/main/java/org/sonar/core/rule/RuleKeyFunctions.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.core.rule;
-
-import com.google.common.base.Function;
-import javax.annotation.Nonnull;
-import org.sonar.api.rule.RuleKey;
-
-public final class RuleKeyFunctions {
-
- private RuleKeyFunctions() {
- // only static methods
- }
-
- public static Function<String, RuleKey> stringToRuleKey() {
- return StringToRuleKey.INSTANCE;
- }
-
- /**
- * Transforms a string representation of key to {@link RuleKey}. It
- * does not accept null string inputs.
- */
- private enum StringToRuleKey implements Function<String, RuleKey> {
- INSTANCE;
- @Nonnull
- @Override
- public RuleKey apply(@Nonnull String input) {
- return RuleKey.parse(input);
- }
- }
-
-}
diff --git a/sonar-core/src/main/java/org/sonar/core/rule/SeverityUtil.java b/sonar-core/src/main/java/org/sonar/core/rule/SeverityUtil.java
deleted file mode 100644
index a226ccb8fef..00000000000
--- a/sonar-core/src/main/java/org/sonar/core/rule/SeverityUtil.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.core.rule;
-
-import org.sonar.api.rule.Severity;
-
-public class SeverityUtil {
-
- private SeverityUtil() {
- // Only static stuff
- }
-
- public static String getSeverityFromOrdinal(int ordinal) {
- return Severity.ALL.get(ordinal);
- }
-
- public static int getOrdinalFromSeverity(String severity) {
- return Severity.ALL.indexOf(severity);
- }
-}
diff --git a/sonar-core/src/main/java/org/sonar/core/rule/package-info.java b/sonar-core/src/main/java/org/sonar/core/rule/package-info.java
deleted file mode 100644
index 2b945fd258e..00000000000
--- a/sonar-core/src/main/java/org/sonar/core/rule/package-info.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-@ParametersAreNonnullByDefault
-package org.sonar.core.rule;
-
-import javax.annotation.ParametersAreNonnullByDefault;
-
diff --git a/sonar-core/src/test/java/org/sonar/core/rule/RuleKeyFunctionsTest.java b/sonar-core/src/test/java/org/sonar/core/rule/RuleKeyFunctionsTest.java
deleted file mode 100644
index 909b3a9fffc..00000000000
--- a/sonar-core/src/test/java/org/sonar/core/rule/RuleKeyFunctionsTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.core.rule;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-import org.junit.Test;
-import org.sonar.api.rule.RuleKey;
-import org.sonar.test.TestUtils;
-
-import static com.google.common.collect.FluentIterable.from;
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class RuleKeyFunctionsTest {
-
- @Test
- public void stringToRuleKey() {
- Collection<String> strings = Arrays.asList("js:S001", "java:S002");
- List<RuleKey> keys = from(strings).transform(RuleKeyFunctions.stringToRuleKey()).toList();
-
- assertThat(keys).containsExactly(RuleKey.of("js", "S001"), RuleKey.of("java", "S002"));
- }
-
- @Test
- public void on_static_methods() {
- assertThat(TestUtils.hasOnlyPrivateConstructors(RuleKeyFunctions.class)).isTrue();
- }
-}