< prev index next >
src/java.base/share/classes/sun/util/resources/TimeZoneNamesBundle.java
Print this page
rev 49854 : 8181157: CLDR Timezone name fallback implementation
Reviewed-by: sherman
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -77,20 +77,21 @@
* <code>getContents</code> implementations, while the time zone
* ID is inserted into the returned array by this method.
*/
@Override
public Object handleGetObject(String key) {
- String[] contents = (String[]) super.handleGetObject(key);
- if (Objects.isNull(contents)) {
- return null;
- }
+ Object val = super.handleGetObject(key);
+ if (val instanceof String[]) {
+ String[] contents = (String[]) val;
int clen = contents.length;
String[] tmpobj = new String[7];
tmpobj[0] = key;
System.arraycopy(contents, 0, tmpobj, 1, clen);
return tmpobj;
}
+ return val;
+ }
/**
* Use LinkedHashMap to preserve the order of bundle entries.
*/
@Override
< prev index next >