[Fix] Fixed NPE in DateRange.toString()
This commit is contained in:
parent
ae0fba00ca
commit
b2bbfad26e
|
@ -127,7 +127,12 @@ public class DateRange {
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
ISO8601FormatFactory df = ISO8601FormatFactory.getInstance();
|
ISO8601FormatFactory df = ISO8601FormatFactory.getInstance();
|
||||||
return df.formatDate(this.fromDate) + (this.fromInclusive ? " (inc)" : " (exc)") + " - "
|
StringBuilder sb = new StringBuilder();
|
||||||
+ df.formatDate(this.toDate) + (this.toInclusive ? " (inc)" : " (exc)");
|
sb.append(this.fromDate == null ? "-" : df.formatDate(this.fromDate));
|
||||||
|
sb.append((this.fromInclusive ? " (inc)" : " (exc)"));
|
||||||
|
sb.append(" - ");
|
||||||
|
sb.append(this.toDate == null ? "-" : df.formatDate(this.toDate));
|
||||||
|
sb.append((this.toInclusive ? " (inc)" : " (exc)"));
|
||||||
|
return sb.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue