Fix checkstyle violations in samples

This commit is contained in:
Phillip Webb
2018-05-25 15:57:29 -07:00
parent 4853477081
commit e69296d7d3
117 changed files with 453 additions and 482 deletions

View File

@@ -34,8 +34,7 @@ class CityServiceImpl implements CityService {
private final HotelRepository hotelRepository;
public CityServiceImpl(CityRepository cityRepository,
HotelRepository hotelRepository) {
CityServiceImpl(CityRepository cityRepository, HotelRepository hotelRepository) {
this.cityRepository = cityRepository;
this.hotelRepository = hotelRepository;
}

View File

@@ -41,8 +41,7 @@ class HotelServiceImpl implements HotelService {
private final ReviewRepository reviewRepository;
public HotelServiceImpl(HotelRepository hotelRepository,
ReviewRepository reviewRepository) {
HotelServiceImpl(HotelRepository hotelRepository, ReviewRepository reviewRepository) {
this.hotelRepository = hotelRepository;
this.reviewRepository = reviewRepository;
}
@@ -82,7 +81,7 @@ class HotelServiceImpl implements HotelService {
private final Map<Rating, Long> ratingCount;
public ReviewsSummaryImpl(List<RatingCount> ratingCounts) {
ReviewsSummaryImpl(List<RatingCount> ratingCounts) {
this.ratingCount = new HashMap<Rating, Long>();
for (RatingCount ratingCount : ratingCounts) {
this.ratingCount.put(ratingCount.getRating(), ratingCount.getCount());
@@ -92,7 +91,7 @@ class HotelServiceImpl implements HotelService {
@Override
public long getNumberOfReviewsWithRating(Rating rating) {
Long count = this.ratingCount.get(rating);
return count == null ? 0 : count;
return (count != null ? count : 0);
}
}