Useless parentheses around expressions should be removed to prevent any misunderstanding

master
Stuart Boston 11 years ago
parent 2e7c85a41a
commit 6ed9d9ea4c

@ -339,7 +339,7 @@ public class TheMovieDbApi {
* @param distance
*/
private static boolean compareDistance(String title1, String title2, int distance) {
return (StringUtils.getLevenshteinDistance(title1, title2) <= distance);
return StringUtils.getLevenshteinDistance(title1, title2) <= distance;
}
/**
@ -348,7 +348,7 @@ public class TheMovieDbApi {
* @param year
*/
private static boolean isValidYear(String year) {
return (StringUtils.isNotBlank(year) && !"UNKNOWN".equals(year));
return StringUtils.isNotBlank(year) && !"UNKNOWN".equals(year);
}
//<editor-fold defaultstate="collapsed" desc="Configuration Functions">
@ -378,7 +378,7 @@ public class TheMovieDbApi {
sb.append(requiredSize);
sb.append(imagePath);
try {
return (new URL(sb.toString()));
return new URL(sb.toString());
} catch (MalformedURLException ex) {
LOG.warn("Failed to create image URL: {}", ex.getMessage(), ex);
throw new MovieDbException(MovieDbExceptionType.INVALID_URL, sb.toString(), "", ex);

@ -20,7 +20,6 @@
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
/**
@ -67,10 +66,10 @@ public class AlternativeTitle implements Serializable {
return false;
}
final AlternativeTitle other = (AlternativeTitle) obj;
if ((this.country == null) ? (other.country != null) : !this.country.equals(other.country)) {
if (this.country == null ? other.country != null : !this.country.equals(other.country)) {
return false;
}
if ((this.title == null) ? (other.title != null) : !this.title.equals(other.title)) {
if (this.title == null ? other.title != null : !this.title.equals(other.title)) {
return false;
}
return true;

@ -142,13 +142,13 @@ public class Artwork extends AbstractJsonMapping {
if (Float.floatToIntBits(this.aspectRatio) != Float.floatToIntBits(other.aspectRatio)) {
return false;
}
if ((this.filePath == null) ? (other.filePath != null) : !this.filePath.equals(other.filePath)) {
if (this.filePath == null ? other.filePath != null : !this.filePath.equals(other.filePath)) {
return false;
}
if (this.height != other.height) {
return false;
}
if ((this.language == null) ? (other.language != null) : !this.language.equals(other.language)) {
if (this.language == null ? other.language != null : !this.language.equals(other.language)) {
return false;
}
if (this.width != other.width) {

@ -110,16 +110,16 @@ public class Collection extends AbstractJsonMapping {
return false;
}
final Collection other = (Collection) obj;
if ((this.backdropPath == null) ? (other.backdropPath != null) : !this.backdropPath.equals(other.backdropPath)) {
if (this.backdropPath == null ? other.backdropPath != null : !this.backdropPath.equals(other.backdropPath)) {
return false;
}
if (this.id != other.id) {
return false;
}
if ((this.title == null) ? (other.title != null) : !this.title.equals(other.title)) {
if (this.title == null ? other.title != null : !this.title.equals(other.title)) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
if (this.name == null ? other.name != null : !this.name.equals(other.name)) {
return false;
}
return true;

@ -19,12 +19,13 @@
*/
package com.omertron.themoviedbapi.model;
import org.apache.commons.lang3.StringUtils;
import static com.omertron.themoviedbapi.tools.ApiUrl.PARAM_ADULT;
import static com.omertron.themoviedbapi.tools.ApiUrl.PARAM_LANGUAGE;
import static com.omertron.themoviedbapi.tools.ApiUrl.PARAM_PAGE;
import static com.omertron.themoviedbapi.tools.ApiUrl.PARAM_YEAR;
import java.util.HashMap;
import java.util.Map;
import static com.omertron.themoviedbapi.tools.ApiUrl.*;
import org.apache.commons.lang3.StringUtils;
/**
* Generate a discover object for use in the MovieDbApi
@ -273,6 +274,6 @@ public class Discover {
* @return
*/
private boolean checkYear(int year) {
return (year >= YEAR_MIN && year <= YEAR_MAX);
return year >= YEAR_MIN && year <= YEAR_MAX;
}
}

@ -65,7 +65,7 @@ public class Genre extends AbstractJsonMapping {
if (this.id != other.id) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
if (this.name == null ? other.name != null : !this.name.equals(other.name)) {
return false;
}
return true;

@ -66,7 +66,7 @@ public class Keyword extends AbstractJsonMapping {
if (this.id != other.id) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
if (this.name == null ? other.name != null : !this.name.equals(other.name)) {
return false;
}
return true;

@ -62,10 +62,10 @@ public class Language extends AbstractJsonMapping {
return false;
}
final Language other = (Language) obj;
if ((this.isoCode == null) ? (other.isoCode != null) : !this.isoCode.equals(other.isoCode)) {
if (this.isoCode == null ? other.isoCode != null : !this.isoCode.equals(other.isoCode)) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
if (this.name == null ? other.name != null : !this.name.equals(other.name)) {
return false;
}
return true;

@ -20,8 +20,16 @@
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.wrapper.*;
import com.omertron.themoviedbapi.wrapper.WrapperAlternativeTitles;
import com.omertron.themoviedbapi.wrapper.WrapperImages;
import com.omertron.themoviedbapi.wrapper.WrapperMovie;
import com.omertron.themoviedbapi.wrapper.WrapperMovieCasts;
import com.omertron.themoviedbapi.wrapper.WrapperMovieKeywords;
import com.omertron.themoviedbapi.wrapper.WrapperMovieList;
import com.omertron.themoviedbapi.wrapper.WrapperReleaseInfo;
import com.omertron.themoviedbapi.wrapper.WrapperReviews;
import com.omertron.themoviedbapi.wrapper.WrapperTrailers;
import com.omertron.themoviedbapi.wrapper.WrapperTranslations;
import java.util.List;
/**
@ -399,7 +407,7 @@ public class MovieDb extends AbstractJsonMapping {
if (this.id != other.id) {
return false;
}
if ((this.imdbID == null) ? (other.imdbID != null) : !this.imdbID.equals(other.imdbID)) {
if (this.imdbID == null ? other.imdbID != null : !this.imdbID.equals(other.imdbID)) {
return false;
}
if (this.runtime != other.runtime) {

@ -20,10 +20,9 @@
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
/**
* @author stuart.boston
@ -274,22 +273,22 @@ public class Person extends AbstractJsonMapping {
if (this.id != other.id) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
if (this.name == null ? other.name != null : !this.name.equals(other.name)) {
return false;
}
if ((this.profilePath == null) ? (other.profilePath != null) : !this.profilePath.equals(other.profilePath)) {
if (this.profilePath == null ? other.profilePath != null : !this.profilePath.equals(other.profilePath)) {
return false;
}
if (this.personType != other.personType) {
return false;
}
if ((this.department == null) ? (other.department != null) : !this.department.equals(other.department)) {
if (this.department == null ? other.department != null : !this.department.equals(other.department)) {
return false;
}
if ((this.job == null) ? (other.job != null) : !this.job.equals(other.job)) {
if (this.job == null ? other.job != null : !this.job.equals(other.job)) {
return false;
}
if ((this.character == null) ? (other.character != null) : !this.character.equals(other.character)) {
if (this.character == null ? other.character != null : !this.character.equals(other.character)) {
return false;
}
return true;

@ -115,16 +115,16 @@ public class PersonCast extends AbstractJsonMapping {
if (this.id != other.id) {
return false;
}
if ((this.character == null) ? (other.character != null) : !this.character.equals(other.character)) {
if (this.character == null ? other.character != null : !this.character.equals(other.character)) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
if (this.name == null ? other.name != null : !this.name.equals(other.name)) {
return false;
}
if (this.order != other.order) {
return false;
}
if ((this.profilePath == null) ? (other.profilePath != null) : !this.profilePath.equals(other.profilePath)) {
if (this.profilePath == null ? other.profilePath != null : !this.profilePath.equals(other.profilePath)) {
return false;
}
return true;

@ -105,13 +105,13 @@ public class PersonCrew extends AbstractJsonMapping {
if (this.id != other.id) {
return false;
}
if ((this.department == null) ? (other.department != null) : !this.department.equals(other.department)) {
if (this.department == null ? other.department != null : !this.department.equals(other.department)) {
return false;
}
if ((this.job == null) ? (other.job != null) : !this.job.equals(other.job)) {
if (this.job == null ? other.job != null : !this.job.equals(other.job)) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
if (this.name == null ? other.name != null : !this.name.equals(other.name)) {
return false;
}
return true;

@ -66,7 +66,7 @@ public class ProductionCompany extends AbstractJsonMapping {
if (this.id != other.id) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
if (this.name == null ? other.name != null : !this.name.equals(other.name)) {
return false;
}
return true;

@ -63,10 +63,10 @@ public class ProductionCountry extends AbstractJsonMapping {
return false;
}
final ProductionCountry other = (ProductionCountry) obj;
if ((this.isoCode == null) ? (other.isoCode != null) : !this.isoCode.equals(other.isoCode)) {
if (this.isoCode == null ? other.isoCode != null : !this.isoCode.equals(other.isoCode)) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
if (this.name == null ? other.name != null : !this.name.equals(other.name)) {
return false;
}
return true;

@ -71,13 +71,13 @@ public class ReleaseInfo extends AbstractJsonMapping {
return false;
}
final ReleaseInfo other = (ReleaseInfo) obj;
if ((this.country == null) ? (other.country != null) : !this.country.equals(other.country)) {
if (this.country == null ? other.country != null : !this.country.equals(other.country)) {
return false;
}
if ((this.certification == null) ? (other.certification != null) : !this.certification.equals(other.certification)) {
if (this.certification == null ? other.certification != null : !this.certification.equals(other.certification)) {
return false;
}
if ((this.releaseDate == null) ? (other.releaseDate != null) : !this.releaseDate.equals(other.releaseDate)) {
if (this.releaseDate == null ? other.releaseDate != null : !this.releaseDate.equals(other.releaseDate)) {
return false;
}
return true;

@ -20,9 +20,8 @@
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang3.StringUtils;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
/**
* @author stuart.boston
@ -176,9 +175,9 @@ public class TmdbConfiguration extends AbstractJsonMapping {
* @return
*/
public boolean isValidSize(String sizeToCheck) {
return (isValidPosterSize(sizeToCheck)
return isValidPosterSize(sizeToCheck)
|| isValidBackdropSize(sizeToCheck)
|| isValidProfileSize(sizeToCheck)
|| isValidLogoSize(sizeToCheck));
|| isValidLogoSize(sizeToCheck);
}
}

@ -90,13 +90,13 @@ public class Trailer extends AbstractJsonMapping {
return false;
}
final Trailer other = (Trailer) obj;
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
if (this.name == null ? other.name != null : !this.name.equals(other.name)) {
return false;
}
if ((this.size == null) ? (other.size != null) : !this.size.equals(other.size)) {
if (this.size == null ? other.size != null : !this.size.equals(other.size)) {
return false;
}
if ((this.source == null) ? (other.source != null) : !this.source.equals(other.source)) {
if (this.source == null ? other.source != null : !this.source.equals(other.source)) {
return false;
}
return true;

@ -73,13 +73,13 @@ public class Translation extends AbstractJsonMapping {
return false;
}
final Translation other = (Translation) obj;
if ((this.englishName == null) ? (other.englishName != null) : !this.englishName.equals(other.englishName)) {
if (this.englishName == null ? other.englishName != null : !this.englishName.equals(other.englishName)) {
return false;
}
if ((this.isoCode == null) ? (other.isoCode != null) : !this.isoCode.equals(other.isoCode)) {
if (this.isoCode == null ? other.isoCode != null : !this.isoCode.equals(other.isoCode)) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
if (this.name == null ? other.name != null : !this.name.equals(other.name)) {
return false;
}
return true;

@ -76,7 +76,7 @@ public class PersonCreditDateComparator implements Comparator<PersonCredit>, Ser
int year1 = extractYear(pc1.getReleaseDate());
int year2 = extractYear(pc2.getReleaseDate());
return ascending ? (year1 - year2) : (year2 - year1);
return ascending ? year1 - year2 : year2 - year1;
}
/**
@ -89,7 +89,7 @@ public class PersonCreditDateComparator implements Comparator<PersonCredit>, Ser
int year = 0;
Matcher m = YEAR_PATTERN.matcher(date);
if (m.find()) {
year = Integer.valueOf(m.group(1)).intValue();
year = Integer.parseInt(m.group(1));
}
// Give up and return 0

Loading…
Cancel
Save