Kaynağa Gözat

[공통][Common] PMD Analyze 반영중

Hasemi 6 yıl önce
ebeveyn
işleme
d0139d2700

+ 2 - 2
app/src/main/java/kr/co/zumo/app/lifeplus/bean/api/coop/CoopAPIBean.java

@@ -21,8 +21,8 @@ import okhttp3.Headers;
  */
 public class CoopAPIBean extends JsonBeanBase implements APIBean {
 
-  public static String RETURN_DEFAULT = "-1000";
-  public static String RETURN_SUCCESS = "0";
+  public static final String RETURN_DEFAULT = "-1000";
+  public static final String RETURN_SUCCESS = "0";
 
   @SerializedName("rcode")
   private String code = RETURN_DEFAULT;

+ 3 - 5
app/src/main/java/kr/co/zumo/app/lifeplus/tool/GuestContentsShowCounter.java

@@ -23,16 +23,14 @@ import kr.co.zumo.app.lifeplus.util.StringUtil;
  */
 public class GuestContentsShowCounter extends ReviewCounter {
 
-  private String[] dates;
-
   /**
    * 7일 이내 35번 이상 조회시
    */
 
   public GuestContentsShowCounter(LifeplusPreferences preferences, String dateString, long todayMillis) {
     super(preferences, dateString, todayMillis);
-    COUNT_LIMIT = 35;
-    DAY_LIMIT = 7;
+    countLimit = 35;
+    dayLimit = 7;
   }
 
   public GuestContentsShowCounter() {
@@ -57,7 +55,7 @@ public class GuestContentsShowCounter extends ReviewCounter {
     if (StringUtil.isEmpty(dateString)) {
       return 0;
     }
-
+    String[] dates;
     dates = dateString.split(SEPARATOR);
     return dates.length;
   }

+ 8 - 8
app/src/main/java/kr/co/zumo/app/lifeplus/tool/ReviewCounter.java

@@ -37,8 +37,8 @@ public class ReviewCounter {
   final long todayMillis;
   final LifeplusPreferences preferences;
 
-  protected int COUNT_LIMIT = 6;
-  protected int DAY_LIMIT = 10;
+  protected int countLimit = 6;
+  protected int dayLimit = 10;
 
   public ReviewCounter(LifeplusPreferences preferences, String dateString, long todayMillis) {
     this.preferences = preferences;
@@ -71,8 +71,8 @@ public class ReviewCounter {
     String today = Formatter.format(todayMillis, DATE_PATTERN);
     list.add(today);
 
-    // 최근 COUNT_LIMIT 개만 유지
-    if (list.size() > COUNT_LIMIT) {
+    // 최근 countLimit 개만 유지
+    if (list.size() > countLimit) {
       list.remove(0);
     }
     StringBuilder sb = new StringBuilder();
@@ -107,9 +107,9 @@ public class ReviewCounter {
       return false;
     }
 
-    // 수 체크 (COUNT_LIMIT)
+    // 수 체크 (countLimit)
     String[] dates = date.split(SEPARATOR);
-    if (dates.length == 0 || dates.length < COUNT_LIMIT) {
+    if (dates.length == 0 || dates.length < countLimit) {
       return false;
     }
 
@@ -118,9 +118,9 @@ public class ReviewCounter {
       return false;
     }
 
-    // 요건 일 체크 (DAY_LIMIT)
+    // 요건 일 체크 (dayLimit)
     long firstDayMillis = Formatter.dateStringToMillis(DATE_PATTERN, dates[0]);
-    long limitDayMillis = TimeUnit.DAYS.toMillis(DAY_LIMIT);
+    long limitDayMillis = TimeUnit.DAYS.toMillis(dayLimit);
 
     return (firstDayMillis + limitDayMillis) > todayMillis;
   }

+ 1 - 2
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/my/bucketlist/BucketListWithTagDetailFragment.java

@@ -70,8 +70,7 @@ public class BucketListWithTagDetailFragment extends FragmentBase<BucketListWith
   @Nullable
   @Override
   protected View onAfterCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
-    View view = inflater.inflate(R.layout.fragment_bucket_list_with_tag_detail, container, false);
-    return view;
+    return inflater.inflate(R.layout.fragment_bucket_list_with_tag_detail, container, false);
   }
 
   @Override