Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitef69f4c

Browse files
committed
Workaround the com.dropbox.core.BadRequestException on devices with locale whose numeric character is non-ascii (dropbox#119)
1 parentce883f4 commitef69f4c

File tree

1 file changed

+4
-3
lines changed
  • src/main/java/com/dropbox/core/stone

1 file changed

+4
-3
lines changed

‎src/main/java/com/dropbox/core/stone/Util.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
importjava.text.SimpleDateFormat;
66
importjava.util.Date;
77
importjava.util.GregorianCalendar;
8+
importjava.util.Locale;
89
importjava.util.TimeZone;
910

1011
importcom.fasterxml.jackson.core.JsonFactory;
@@ -19,7 +20,7 @@ final class Util {
1920
privatestaticfinalintSHORT_FORMAT_LENGTH =DATE_FORMAT.replace("'","").length();
2021

2122
publicstaticStringformatTimestamp(Datetimestamp) {
22-
DateFormatformat =newSimpleDateFormat(DATE_TIME_FORMAT);
23+
DateFormatformat =newSimpleDateFormat(DATE_TIME_FORMAT,Locale.ENGLISH);
2324
format.setCalendar(newGregorianCalendar(UTC));
2425
returnformat.format(timestamp);
2526
}
@@ -29,9 +30,9 @@ public static Date parseTimestamp(String timestamp) throws ParseException {
2930

3031
DateFormatformat =null;
3132
if (length ==LONG_FORMAT_LENGTH) {
32-
format =newSimpleDateFormat(DATE_TIME_FORMAT);
33+
format =newSimpleDateFormat(DATE_TIME_FORMAT,Locale.ENGLISH);
3334
}elseif (length ==SHORT_FORMAT_LENGTH) {
34-
format =newSimpleDateFormat(DATE_FORMAT);
35+
format =newSimpleDateFormat(DATE_FORMAT,Locale.ENGLISH);
3536
}else {
3637
thrownewParseException("timestamp has unexpected format: '" +timestamp +"'",0);
3738
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp