Fix checkstyle violations in samples
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user