8181157: CLDR Timezone name fallback implementation

Reviewed-by: sherman, scolebourne
This commit is contained in:
Naoto Sato 2018-04-26 12:39:15 -07:00
parent 3105e04e1b
commit fafd844bc6
22 changed files with 639 additions and 155 deletions

View file

@ -1,5 +1,5 @@
/*
* 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
@ -79,15 +79,16 @@ public abstract class TimeZoneNamesBundle extends OpenListResourceBundle {
*/
@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;
}
int clen = contents.length;
String[] tmpobj = new String[7];
tmpobj[0] = key;
System.arraycopy(contents, 0, tmpobj, 1, clen);
return tmpobj;
return val;
}
/**