Merge pull request #3283 from andersonvom/3273-renable-linting

Re-enable deprecation and serial linting
This commit is contained in:
H. Lehmann 2019-08-10 17:45:18 +02:00 committed by GitHub
commit 9ffd9a9848
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 96 additions and 98 deletions

View File

@ -776,6 +776,7 @@ public abstract class NanoHTTPD {
} }
public static final class ResponseException extends Exception { public static final class ResponseException extends Exception {
private static final long serialVersionUID = 1L;
private final Response.Status status; private final Response.Status status;

View File

@ -19,7 +19,7 @@ allprojects {
gradle.projectsEvaluated { gradle.projectsEvaluated {
tasks.withType(JavaCompile) { tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint" << "-Xlint:-deprecation" << "-Xlint:-serial" options.compilerArgs << "-Xlint"
} }
} }
} }

View File

@ -1,6 +1,7 @@
package de.danoeh.antennapod.core.gpoddernet; package de.danoeh.antennapod.core.gpoddernet;
public class GpodnetServiceAuthenticationException extends GpodnetServiceException { public class GpodnetServiceAuthenticationException extends GpodnetServiceException {
private static final long serialVersionUID = 1L;
public GpodnetServiceAuthenticationException() { public GpodnetServiceAuthenticationException() {
super(); super();
@ -17,5 +18,4 @@ public class GpodnetServiceAuthenticationException extends GpodnetServiceExcepti
public GpodnetServiceAuthenticationException(Throwable cause) { public GpodnetServiceAuthenticationException(Throwable cause) {
super(cause); super(cause);
} }
} }

View File

@ -1,12 +1,12 @@
package de.danoeh.antennapod.core.gpoddernet; package de.danoeh.antennapod.core.gpoddernet;
class GpodnetServiceBadStatusCodeException extends GpodnetServiceException { class GpodnetServiceBadStatusCodeException extends GpodnetServiceException {
private static final long serialVersionUID = 1L;
private final int statusCode; private final int statusCode;
public GpodnetServiceBadStatusCodeException(String message, int statusCode) { public GpodnetServiceBadStatusCodeException(String message, int statusCode) {
super(message); super(message);
this.statusCode = statusCode; this.statusCode = statusCode;
} }
} }

View File

@ -1,6 +1,7 @@
package de.danoeh.antennapod.core.gpoddernet; package de.danoeh.antennapod.core.gpoddernet;
public class GpodnetServiceException extends Exception { public class GpodnetServiceException extends Exception {
private static final long serialVersionUID = 1L;
GpodnetServiceException() { GpodnetServiceException() {
} }

View File

@ -1,6 +1,5 @@
package de.danoeh.antennapod.core.menuhandler; package de.danoeh.antennapod.core.menuhandler;
import android.support.v4.view.MenuItemCompat;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
@ -25,7 +24,7 @@ public class MenuItemUtils {
// expand actionview if feeds are being downloaded, collapse otherwise // expand actionview if feeds are being downloaded, collapse otherwise
if (checker.isRefreshing()) { if (checker.isRefreshing()) {
MenuItem refreshItem = menu.findItem(resId); MenuItem refreshItem = menu.findItem(resId);
MenuItemCompat.setActionView(refreshItem, R.layout.refresh_action_view); refreshItem.setActionView(R.layout.refresh_action_view);
return true; return true;
} else { } else {
return false; return false;

View File

@ -5,21 +5,21 @@ package de.danoeh.antennapod.core.storage;
* or something went wrong while processing the request. * or something went wrong while processing the request.
*/ */
public class DownloadRequestException extends Exception { public class DownloadRequestException extends Exception {
private static final long serialVersionUID = 1L;
public DownloadRequestException() { public DownloadRequestException() {
super(); super();
} }
public DownloadRequestException(String detailMessage, Throwable throwable) { public DownloadRequestException(String message, Throwable cause) {
super(detailMessage, throwable); super(message, cause);
} }
public DownloadRequestException(String detailMessage) { public DownloadRequestException(String message) {
super(detailMessage); super(message);
} }
public DownloadRequestException(Throwable throwable) {
super(throwable);
}
public DownloadRequestException(Throwable cause) {
super(cause);
}
} }

View File

@ -3,44 +3,42 @@ package de.danoeh.antennapod.core.syndication.handler;
import de.danoeh.antennapod.core.syndication.handler.TypeGetter.Type; import de.danoeh.antennapod.core.syndication.handler.TypeGetter.Type;
public class UnsupportedFeedtypeException extends Exception { public class UnsupportedFeedtypeException extends Exception {
private static final long serialVersionUID = 9105878964928170669L; private static final long serialVersionUID = 9105878964928170669L;
private final TypeGetter.Type type; private final TypeGetter.Type type;
private String rootElement; private String rootElement;
private String message = null; private String message = null;
public UnsupportedFeedtypeException(Type type) { public UnsupportedFeedtypeException(Type type) {
super(); super();
this.type = type; this.type = type;
} }
public UnsupportedFeedtypeException(Type type, String rootElement) { public UnsupportedFeedtypeException(Type type, String rootElement) {
this.type = type; this.type = type;
this.rootElement = rootElement; this.rootElement = rootElement;
} }
public UnsupportedFeedtypeException(String message) { public UnsupportedFeedtypeException(String message) {
this.message = message; this.message = message;
type = Type.INVALID; type = Type.INVALID;
} }
public TypeGetter.Type getType() { public TypeGetter.Type getType() {
return type; return type;
} }
public String getRootElement() { public String getRootElement() {
return rootElement; return rootElement;
} }
@Override @Override
public String getMessage() { public String getMessage() {
if (message != null) { if (message != null) {
return message; return message;
} else if (type == TypeGetter.Type.INVALID) { } else if (type == TypeGetter.Type.INVALID) {
return "Invalid type"; return "Invalid type";
} else { } else {
return "Type " + type + " not supported"; return "Type " + type + " not supported";
} }
} }
} }

View File

@ -1,21 +1,23 @@
package de.danoeh.antennapod.core.util; package de.danoeh.antennapod.core.util;
/** Thrown if a feed has invalid attribute values. */ /**
* Thrown if a feed has invalid attribute values.
*/
public class InvalidFeedException extends Exception { public class InvalidFeedException extends Exception {
private static final long serialVersionUID = 1L;
public InvalidFeedException() { public InvalidFeedException() {
} }
public InvalidFeedException(String detailMessage) { public InvalidFeedException(String message) {
super(detailMessage); super(message);
} }
public InvalidFeedException(Throwable throwable) { public InvalidFeedException(Throwable cause) {
super(throwable); super(cause);
} }
public InvalidFeedException(String detailMessage, Throwable throwable) {
super(detailMessage, throwable);
}
public InvalidFeedException(String message, Throwable cause) {
super(message, cause);
}
} }

View File

@ -3,16 +3,16 @@ package de.danoeh.antennapod.core.util.exception;
import de.danoeh.antennapod.core.feed.FeedMedia; import de.danoeh.antennapod.core.feed.FeedMedia;
public class MediaFileNotFoundException extends Exception { public class MediaFileNotFoundException extends Exception {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private final FeedMedia media; private final FeedMedia media;
public MediaFileNotFoundException(String msg, FeedMedia media) { public MediaFileNotFoundException(String msg, FeedMedia media) {
super(msg); super(msg);
this.media = media; this.media = media;
} }
public FeedMedia getMedia() { public FeedMedia getMedia() {
return media; return media;
} }
} }

View File

@ -1,20 +1,20 @@
package de.danoeh.antennapod.core.util.id3reader; package de.danoeh.antennapod.core.util.id3reader;
public class ID3ReaderException extends Exception { public class ID3ReaderException extends Exception {
private static final long serialVersionUID = 1L;
public ID3ReaderException() { public ID3ReaderException() {
} }
public ID3ReaderException(String arg0) { public ID3ReaderException(String message) {
super(arg0); super(message);
} }
public ID3ReaderException(Throwable arg0) { public ID3ReaderException(Throwable message) {
super(arg0); super(message);
} }
public ID3ReaderException(String arg0, Throwable arg1) {
super(arg0, arg1);
}
public ID3ReaderException(String message, Throwable cause) {
super(message, cause);
}
} }

View File

@ -33,8 +33,8 @@ public class HtmlToPlainText {
*/ */
public String getPlainText(Element element) { public String getPlainText(Element element) {
FormattingVisitor formatter = new FormattingVisitor(); FormattingVisitor formatter = new FormattingVisitor();
NodeTraversor traversor = new NodeTraversor(formatter); // walk the DOM, and call .head() and .tail() for each node
traversor.traverse(element); // walk the DOM, and call .head() and .tail() for each node NodeTraversor.traverse(formatter, element);
return formatter.toString(); return formatter.toString();
} }

View File

@ -1,24 +1,21 @@
package de.danoeh.antennapod.core.util.vorbiscommentreader; package de.danoeh.antennapod.core.util.vorbiscommentreader;
public class VorbisCommentReaderException extends Exception { public class VorbisCommentReaderException extends Exception {
private static final long serialVersionUID = 1L;
public VorbisCommentReaderException() { public VorbisCommentReaderException() {
super(); super();
// TODO Auto-generated constructor stub }
}
public VorbisCommentReaderException(String arg0, Throwable arg1) { public VorbisCommentReaderException(String message, Throwable cause) {
super(arg0, arg1); super(message, cause);
// TODO Auto-generated constructor stub }
}
public VorbisCommentReaderException(String arg0) { public VorbisCommentReaderException(String message) {
super(arg0); super(message);
// TODO Auto-generated constructor stub }
}
public VorbisCommentReaderException(Throwable arg0) {
super(arg0);
// TODO Auto-generated constructor stub
}
public VorbisCommentReaderException(Throwable message) {
super(message);
}
} }