aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-deprecated
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2014-03-26 00:02:16 +0100
committerSimon Brandhof <simon.brandhof@gmail.com>2014-03-26 00:02:16 +0100
commit90175211388d86ddd6a124ac69c201670edef946 (patch)
tree7d51f857aee40b2812194bbafe3eb87034213c70 /sonar-deprecated
parent1b8416c73a97f61899286d2e1f4e3e7685135e9a (diff)
downloadsonarqube-90175211388d86ddd6a124ac69c201670edef946.tar.gz
sonarqube-90175211388d86ddd6a124ac69c201670edef946.zip
SONAR-5154 remove duplications
Diffstat (limited to 'sonar-deprecated')
-rw-r--r--sonar-deprecated/src/main/java/org/sonar/api/resources/JavaFile.java39
-rw-r--r--sonar-deprecated/src/main/java/org/sonar/api/resources/JavaPackage.java22
2 files changed, 35 insertions, 26 deletions
diff --git a/sonar-deprecated/src/main/java/org/sonar/api/resources/JavaFile.java b/sonar-deprecated/src/main/java/org/sonar/api/resources/JavaFile.java
index 0b0f7a983eb..a7f2f3ba7cf 100644
--- a/sonar-deprecated/src/main/java/org/sonar/api/resources/JavaFile.java
+++ b/sonar-deprecated/src/main/java/org/sonar/api/resources/JavaFile.java
@@ -28,7 +28,8 @@ import java.util.List;
* A class that represents a Java class. This class can either be a Test class or source class
*
* @since 1.10
- * @deprecated since 4.2 use {@link org.sonar.api.resources.File}
+ * @deprecated since 4.2 use {@link org.sonar.api.resources.File}. See
+ * http://docs.codehaus.org/display/SONAR/API+Changes for more details
*/
@Deprecated
public class JavaFile extends Resource {
@@ -38,78 +39,82 @@ public class JavaFile extends Resource {
}
public JavaFile(String packageName, String className) {
- throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
+ throw unsupported();
}
public JavaFile(String packageKey, String className, boolean unitTest) {
- throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
+ throw unsupported();
}
public JavaFile(String deprecatedKey) {
- throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
+ throw unsupported();
}
public JavaFile(String deprecatedKey, boolean unitTest) {
- throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
+ throw unsupported();
}
@Override
public JavaPackage getParent() {
- throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
+ throw unsupported();
}
@Override
public String getDescription() {
- throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
+ throw unsupported();
}
@Override
public Language getLanguage() {
- throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
+ throw unsupported();
}
@Override
public String getName() {
- throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
+ throw unsupported();
}
@Override
public String getLongName() {
- throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
+ throw unsupported();
}
@Override
public String getScope() {
- throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
+ throw unsupported();
}
@Override
public String getQualifier() {
- throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
+ throw unsupported();
}
public boolean isUnitTest() {
- throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
+ throw unsupported();
}
@Override
public boolean matchFilePattern(String antPattern) {
- throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
+ throw unsupported();
}
public static JavaFile fromIOFile(File file, Project module, boolean unitTest) {
- throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
+ throw unsupported();
}
public static JavaFile fromRelativePath(String relativePath, boolean unitTest) {
- throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
+ throw unsupported();
}
public static JavaFile fromIOFile(File file, List<File> sourceDirs, boolean unitTest) {
- throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
+ throw unsupported();
}
public static JavaFile fromAbsolutePath(String path, List<File> sourceDirs, boolean unitTest) {
+ throw unsupported();
+ }
+
+ private static UnsupportedOperationException unsupported() {
throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
}
diff --git a/sonar-deprecated/src/main/java/org/sonar/api/resources/JavaPackage.java b/sonar-deprecated/src/main/java/org/sonar/api/resources/JavaPackage.java
index 1c021775ae1..650c7c96889 100644
--- a/sonar-deprecated/src/main/java/org/sonar/api/resources/JavaPackage.java
+++ b/sonar-deprecated/src/main/java/org/sonar/api/resources/JavaPackage.java
@@ -35,50 +35,54 @@ public class JavaPackage extends Resource {
}
public JavaPackage(String deprecatedKey) {
- throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
+ throw unsupported();
}
public boolean isDefault() {
- throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
+ throw unsupported();
}
@Override
public boolean matchFilePattern(String antPattern) {
- throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
+ throw unsupported();
}
@Override
public String getDescription() {
- throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
+ throw unsupported();
}
@Override
public String getScope() {
- throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
+ throw unsupported();
}
@Override
public String getQualifier() {
- throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
+ throw unsupported();
}
@Override
public String getName() {
- throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
+ throw unsupported();
}
@Override
public Resource getParent() {
- throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
+ throw unsupported();
}
@Override
public String getLongName() {
- throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
+ throw unsupported();
}
@Override
public Language getLanguage() {
+ throw unsupported();
+ }
+
+ private static UnsupportedOperationException unsupported() {
throw new UnsupportedOperationException("Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes");
}
}