< prev index next >

src/java.base/share/classes/sun/util/resources/TimeZoneNamesBundle.java

Print this page
rev 49575 : imported patch 8181157

*** 1,7 **** /* ! * Copyright (c) 2005, 2012, 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 --- 1,7 ---- /* ! * 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,96 **** * <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; ! } int clen = contents.length; String[] tmpobj = new String[7]; tmpobj[0] = key; System.arraycopy(contents, 0, tmpobj, 1, clen); return tmpobj; } /** * Use LinkedHashMap to preserve the order of bundle entries. */ @Override --- 77,97 ---- * <code>getContents</code> implementations, while the time zone * ID is inserted into the returned array by this method. */ @Override public Object handleGetObject(String key) { ! 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 >