提交 34aeb550 编写于 作者: C coffeys

7197187: Currency.isPastCutoverDate should be made more robust

Reviewed-by: alanb
上级 51816a3e
/* /*
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -702,7 +702,7 @@ public final class Currency implements Serializable { ...@@ -702,7 +702,7 @@ public final class Currency implements Serializable {
" ignored since cutover date has not passed :" + curdata, null); " ignored since cutover date has not passed :" + curdata, null);
return; return;
} }
} catch (IndexOutOfBoundsException | NullPointerException | ParseException ex) { } catch (ParseException ex) {
info("currency.properties entry for " + ctry + info("currency.properties entry for " + ctry +
" ignored since exception encountered :" + ex.getMessage(), null); " ignored since exception encountered :" + ex.getMessage(), null);
return; return;
...@@ -732,8 +732,7 @@ public final class Currency implements Serializable { ...@@ -732,8 +732,7 @@ public final class Currency implements Serializable {
setMainTableEntry(ctry.charAt(0), ctry.charAt(1), entry); setMainTableEntry(ctry.charAt(0), ctry.charAt(1), entry);
} }
private static boolean isPastCutoverDate(String s) private static boolean isPastCutoverDate(String s) throws ParseException {
throws IndexOutOfBoundsException, NullPointerException, ParseException {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.ROOT); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.ROOT);
format.setTimeZone(TimeZone.getTimeZone("UTC")); format.setTimeZone(TimeZone.getTimeZone("UTC"));
format.setLenient(false); format.setLenient(false);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册