aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2017-03-01 15:17:30 +0100
committerdbmeneses <duarte.meneses@sonarsource.com>2017-03-16 16:44:48 +0100
commit6a03df65cc0c91a26150ea172a2c480e07326ea1 (patch)
tree7e50c42c842c62a9afb82c0880e64f8cb71ed472 /sonar-plugin-api
parent77cf76d3531ea6cdd5f7b60808ac00867e902c58 (diff)
downloadsonarqube-6a03df65cc0c91a26150ea172a2c480e07326ea1.tar.gz
sonarqube-6a03df65cc0c91a26150ea172a2c480e07326ea1.zip
SONAR-7860 Remove CodeColorizerFormat API
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/pom.xml11
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/web/CodeColorizerFormat.java82
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/web/CodeColorizerFormatTest.java55
3 files changed, 0 insertions, 148 deletions
diff --git a/sonar-plugin-api/pom.xml b/sonar-plugin-api/pom.xml
index a982696bda0..6ce34e9f521 100644
--- a/sonar-plugin-api/pom.xml
+++ b/sonar-plugin-api/pom.xml
@@ -69,17 +69,6 @@
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>sonar-colorizer</artifactId>
- <version>${project.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
<artifactId>sonar-duplications</artifactId>
<version>${project.version}</version>
<exclusions>
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/CodeColorizerFormat.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/CodeColorizerFormat.java
deleted file mode 100644
index 30a8cca29fd..00000000000
--- a/sonar-plugin-api/src/main/java/org/sonar/api/web/CodeColorizerFormat.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.api.web;
-
-import com.google.common.base.MoreObjects;
-import java.util.List;
-import org.sonar.api.batch.sensor.SensorContext;
-import org.sonar.api.task.TaskExtension;
-import org.sonar.colorizer.Tokenizer;
-
-/**
- * Extend the library sonar-colorizer to support new languages.
- *
- * @since 1.12
- * @deprecated since 4.5.2 use {@link SensorContext#newHighlighting()}
- */
-@Deprecated
-public abstract class CodeColorizerFormat implements TaskExtension {
-
- private String languageKey;
-
- /**
- * @param languageKey the unique sonar key. Not null.
- */
- protected CodeColorizerFormat(String languageKey) {
- this.languageKey = languageKey;
- }
-
- public final String getLanguageKey() {
- return languageKey;
- }
-
- /**
- * sonar-colorizer tokenizers for HTML output.
- *
- * @return a not null list (empty if no tokenizers)
- */
- public abstract List<Tokenizer> getTokenizers();
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (!(o instanceof CodeColorizerFormat)) {
- return false;
- }
-
- CodeColorizerFormat format = (CodeColorizerFormat) o;
- return languageKey.equals(format.languageKey);
-
- }
-
- @Override
- public int hashCode() {
- return languageKey.hashCode();
- }
-
- @Override
- public String toString() {
- return MoreObjects.toStringHelper(this)
- .add("lang", languageKey)
- .toString();
- }
-}
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/web/CodeColorizerFormatTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/web/CodeColorizerFormatTest.java
deleted file mode 100644
index 1bb318a0e73..00000000000
--- a/sonar-plugin-api/src/test/java/org/sonar/api/web/CodeColorizerFormatTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.api.web;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.junit.Test;
-import org.sonar.colorizer.Tokenizer;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class CodeColorizerFormatTest {
-
- @Test
- public void keyIsLanguage() {
- CodeColorizerFormat format = new FakeFormat("foo");
- assertThat(format.getLanguageKey()).isEqualTo("foo");
-
- assertThat(format.equals(new FakeFormat("foo"))).isTrue();
- assertThat(format.equals(new FakeFormat("bar"))).isFalse();
- assertThat(format.hashCode()).isEqualTo(format.hashCode());
- assertThat(format.hashCode()).isEqualTo(new FakeFormat("foo").hashCode());
- assertThat(format.toString()).isEqualTo("FakeFormat{lang=foo}");
- }
-
- private static class FakeFormat extends CodeColorizerFormat {
-
- public FakeFormat(String languageKey) {
- super(languageKey);
- }
-
- @Override
- public List<Tokenizer> getTokenizers() {
- return Collections.emptyList();
- }
- }
-}