diff --git a/src/main/java/ch/poole/openinghoursparser/Rule.java b/src/main/java/ch/poole/openinghoursparser/Rule.java index 71b32fe..feb5e87 100644 --- a/src/main/java/ch/poole/openinghoursparser/Rule.java +++ b/src/main/java/ch/poole/openinghoursparser/Rule.java @@ -175,19 +175,19 @@ public int hashCode() { /** * Returns true if the input only differs in the days and times objects * Current considers comments significant - * @param o - * @return + * @param r rule to test against + * @return true if r can be merged with this rule */ - public boolean isMergeableWith(Rule o) { - if (this == o) { + public boolean isMergeableWith(Rule r) { + if (this == r) { return true; } if (!twentyfourseven - && (comment == o.comment || (comment != null && comment.equals(o.comment))) - && (years == o.years || (years != null && years.equals(o.years))) - && (weeks == o.weeks || (weeks != null && weeks.equals(o.weeks))) - && (monthdays == o.monthdays || (monthdays != null && monthdays.equals(o.monthdays))) - && (modifier == o.modifier || (modifier != null && modifier.equals(o.modifier)))){ + && (comment == r.comment || (comment != null && comment.equals(r.comment))) + && (years == r.years || (years != null && years.equals(r.years))) + && (weeks == r.weeks || (weeks != null && weeks.equals(r.weeks))) + && (monthdays == r.monthdays || (monthdays != null && monthdays.equals(r.monthdays))) + && (modifier == r.modifier || (modifier != null && modifier.equals(r.modifier)))){ return true; } return false; diff --git a/src/main/java/ch/poole/openinghoursparser/Util.java b/src/main/java/ch/poole/openinghoursparser/Util.java index f77fea9..79ebdd8 100644 --- a/src/main/java/ch/poole/openinghoursparser/Util.java +++ b/src/main/java/ch/poole/openinghoursparser/Util.java @@ -33,8 +33,8 @@ private Util() { /** * find rules that only differs in the days and times objects and can be merged for display puposes - * @param rules - * @return + * @param rules rules to check + * @return list of list of rules that can be merged */ public static List> getMergeableRules(List rules) { @@ -64,8 +64,8 @@ public static List> getMergeableRules(List rules) { /** * Generate an OH string from rules - * @param rules - * @return + * @param rules rules to convert to an opening_hours string + * @return specification conformant opening_hours string */ public static String rulesToOpeningHoursString(List rules) { StringBuilder result = new StringBuilder(); @@ -91,8 +91,8 @@ public static String rulesToOpeningHoursString(List rules) { /** * Capitalize a string - * @param s - * @return + * @param s string to capitalize + * @return capitalized string */ public static String capitalize(String s) { char[] c = s.toLowerCase(Locale.US).toCharArray();