Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watcher: Use joda method to get local TZ #35608

Merged
merged 4 commits into from
Nov 16, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.TimeZone;

public class CronEvalTool extends LoggingAwareCommand {

Expand All @@ -31,7 +30,7 @@ public static void main(String[] args) throws Exception {
private static final DateTimeFormatter UTC_FORMATTER = DateTimeFormat.forPattern("EEE, d MMM yyyy HH:mm:ss")
.withZone(DateTimeZone.UTC).withLocale(Locale.ROOT);
private static final DateTimeFormatter LOCAL_FORMATTER = DateTimeFormat.forPattern("EEE, d MMM yyyy HH:mm:ss Z")
.withZone(DateTimeZone.forTimeZone(TimeZone.getDefault()));
.withZone(DateTimeZone.forTimeZone(null));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: I think it would be a bit more obvious to explicitly call DateTimeZone.getDefault() instead of null.
Since that is what Joda does with the null value.
http://joda-time.sourceforge.net/apidocs/src-html/org/joda/time/DateTimeZone.html#line.301

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doh! the recommendation is forbidden API ..never mind.


private final OptionSpec<Integer> countOption;
private final OptionSpec<String> arguments;
Expand Down