From 2c9f6713459028830800e8211a719edef2b2e4d3 Mon Sep 17 00:00:00 2001 From: Stuart Boston Date: Wed, 4 Mar 2015 15:30:33 +0000 Subject: [PATCH] Minor sonar fixes --- .../themoviedbapi/methods/TmdbKeywords.java | 13 ------------- .../omertron/themoviedbapi/methods/TmdbPeople.java | 10 ++++++---- .../model/person/PersonCreditsMixIn.java | 8 ++++++-- 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/omertron/themoviedbapi/methods/TmdbKeywords.java b/src/main/java/com/omertron/themoviedbapi/methods/TmdbKeywords.java index 2aa30fdfd..9012d386b 100644 --- a/src/main/java/com/omertron/themoviedbapi/methods/TmdbKeywords.java +++ b/src/main/java/com/omertron/themoviedbapi/methods/TmdbKeywords.java @@ -93,19 +93,6 @@ public class TmdbKeywords extends AbstractMethod { TmdbResultsList results = new TmdbResultsList(wrapper.getResults()); results.copyWrapper(wrapper); return results; - - - -// String webpage = httpTools.getRequest(url); -// -// try { -// WrapperKeywordMovies wrapper = MAPPER.readValue(webpage, WrapperKeywordMovies.class); -// TmdbResultsList results = new TmdbResultsList(wrapper.getResults()); -// results.copyWrapper(wrapper); -// return results; -// } catch (IOException ex) { -// throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get keyword movies", url, ex); -// } } } diff --git a/src/main/java/com/omertron/themoviedbapi/methods/TmdbPeople.java b/src/main/java/com/omertron/themoviedbapi/methods/TmdbPeople.java index c897780aa..25fd4f44d 100644 --- a/src/main/java/com/omertron/themoviedbapi/methods/TmdbPeople.java +++ b/src/main/java/com/omertron/themoviedbapi/methods/TmdbPeople.java @@ -106,7 +106,8 @@ public class TmdbPeople extends AbstractMethod { String webpage = httpTools.getRequest(url); try { - TypeReference tr = new TypeReference>(){}; + TypeReference tr = new TypeReference>() { + }; return MAPPER.readValue(webpage, tr); } catch (IOException ex) { throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get person movie credits", url, ex); @@ -138,7 +139,8 @@ public class TmdbPeople extends AbstractMethod { String webpage = httpTools.getRequest(url); try { - TypeReference tr = new TypeReference>(){}; + TypeReference tr = new TypeReference>() { + }; return MAPPER.readValue(webpage, tr); } catch (IOException ex) { throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get person TV credits", url, ex); @@ -172,8 +174,8 @@ public class TmdbPeople extends AbstractMethod { try { ObjectMapper mapper = new ObjectMapper(); mapper.addMixIn(PersonCredits.class, PersonCreditsMixIn.class); - TypeReference tr = new TypeReference>(){}; -// return mapper.readValue(webpage, PersonCredits.class); + TypeReference tr = new TypeReference>() { + }; return mapper.readValue(webpage, tr); } catch (IOException ex) { throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get person combined credits", url, ex); diff --git a/src/main/java/com/omertron/themoviedbapi/model/person/PersonCreditsMixIn.java b/src/main/java/com/omertron/themoviedbapi/model/person/PersonCreditsMixIn.java index 632abb1e5..a3fe866cb 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/person/PersonCreditsMixIn.java +++ b/src/main/java/com/omertron/themoviedbapi/model/person/PersonCreditsMixIn.java @@ -42,7 +42,9 @@ public class PersonCreditsMixIn { @JsonSubTypes.Type(value = CreditTVBasic.class, name = "tv") }) @JsonSetter("cast") - public void setCast(List cast){} + public void setCast(List cast) { + // Mixin empty class + } @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, @@ -55,6 +57,8 @@ public class PersonCreditsMixIn { @JsonSubTypes.Type(value = CreditTVBasic.class, name = "tv") }) @JsonSetter("crew") - public void setCrew(List crew){} + public void setCrew(List crew) { + // Mixin empty class + } }