Closed michaelrolnik closed 1 year ago
The class has two constructors
public PrettyTimeParser(TimeZone timezone) { parser = new Parser(timezone); } /** * Create a new {@link PrettyTimeParser} with the current system default {@link TimeZone}. */ public PrettyTimeParser() { this(TimeZone.getDefault()); for (int hours = 0; hours < 24; hours++) for (int min = 0; min < 60; min++) translations.put(provideRepresentation(hours * 100 + min), "" + hours * 100 + min); translations.put(provideRepresentation(60), "" + 60); translations.put(provideRepresentation(70), "" + 70); translations.put(provideRepresentation(80), "" + 80); translations.put(provideRepresentation(90), "" + 90); translations.put(provideRepresentation(100), "" + 100); periods.add("morning"); periods.add("afternoon"); periods.add("evening"); periods.add("night"); periods.add("am"); periods.add("pm"); periods.add("ago"); periods.add("from now"); }
in case the first constructor is used translations is not initialized
translations
Hey @michaelrolnik, you're right! Good find. I'll work on fixing this :)
The class has two constructors
in case the first constructor is used
translations
is not initialized