< prev index next >

src/java.base/share/classes/java/util/Currency.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2000, 2016, 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) 2000, 2017, 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
*** 31,40 **** --- 31,42 ---- import java.io.FileInputStream; import java.io.FileReader; import java.io.InputStream; import java.io.IOException; import java.io.Serializable; + import java.nio.file.Files; + import java.nio.file.Paths; import java.security.AccessController; import java.security.PrivilegedAction; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.concurrent.ConcurrentHashMap;
*** 198,213 **** static { AccessController.doPrivileged(new PrivilegedAction<>() { @Override public Void run() { ! try { ! try (InputStream in = getClass().getResourceAsStream("/java/util/currency.data")) { ! if (in == null) { ! throw new InternalError("Currency data not found"); ! } ! DataInputStream dis = new DataInputStream(new BufferedInputStream(in)); if (dis.readInt() != MAGIC_NUMBER) { throw new InternalError("Currency data is possibly corrupted"); } formatVersion = dis.readInt(); if (formatVersion != VALID_FORMAT_VERSION) { --- 200,213 ---- static { AccessController.doPrivileged(new PrivilegedAction<>() { @Override public Void run() { ! try (DataInputStream dis = new DataInputStream( ! new BufferedInputStream(Files.newInputStream(Paths ! .get(System.getProperty("java.home"), ! "lib", "currency.data"))))) { if (dis.readInt() != MAGIC_NUMBER) { throw new InternalError("Currency data is possibly corrupted"); } formatVersion = dis.readInt(); if (formatVersion != VALID_FORMAT_VERSION) {
*** 217,227 **** mainTable = readIntArray(dis, A_TO_Z * A_TO_Z); int scCount = dis.readInt(); specialCasesList = readSpecialCases(dis, scCount); int ocCount = dis.readInt(); otherCurrenciesList = readOtherCurrencies(dis, ocCount); - } } catch (IOException e) { throw new InternalError(e); } // look for the properties file for overrides --- 217,226 ----
< prev index next >