From 618bf37b0547c0e994af34ea1e128af320410736 Mon Sep 17 00:00:00 2001 From: Tania Bento Date: Thu, 5 Apr 2007 00:15:16 +0000 Subject: [PATCH] DecimalFormatSymbols.java: Added the year 2007 to Copyright information and introduced new variable, currency. 2007-04-04 Tania Bento * java/text/DecimalFormatSymbols.java: Added the year 2007 to Copyright information and introduced new variable, currency. (DecimalFormatSymbols(Locale)): Define currency and intlCurrencySymbol to "XXX", currencySymbol to "?" and localCurrency appropriately. (getCurrency): Fixed documentation and return the value of currency. (setCurrency): Fixed documentation and update the value of currency. (setInternationalCurrencySymbol): Fixed documentation and update the value of currency. * java/util/Currency.java: Introduced two new variables, properties and fractionDigits. In the static block, a properties object is created and the currency resource is loaded. (Currency(Locale)): fractionDigits is defined. (Currency(String)): New method. (getDefaultFractionDigits): Return the value of fractionDigits. (getInstance(String)): Check if String is equal to "XXX". From-SVN: r123512 --- libjava/ChangeLog | 18 ++++ .../lib/java/text/DecimalFormatSymbols.class | Bin 6530 -> 6861 bytes .../classpath/lib/java/util/Currency.class | Bin 3337 -> 4292 bytes libjava/gnu/java/net/PlainSocketImpl.h | 2 +- libjava/gnu/java/util/jar/JarUtils.h | 1 - libjava/java/lang/VMCompiler.h | 1 - libjava/java/text/DecimalFormatSymbols.h | 1 + libjava/java/text/DecimalFormatSymbols.java | 84 ++++++++++++++---- libjava/java/util/Currency.h | 3 + libjava/java/util/Currency.java | 73 ++++++++++++++- 10 files changed, 162 insertions(+), 21 deletions(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 3d0b9eca45a..ec79a056606 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,21 @@ +2007-04-04 Tania Bento + + * java/text/DecimalFormatSymbols.java: Added the year 2007 to + Copyright information and introduced new variable, currency. + (DecimalFormatSymbols(Locale)): Define currency and intlCurrencySymbol + to "XXX", currencySymbol to "?" and localCurrency appropriately. + (getCurrency): Fixed documentation and return the value of currency. + (setCurrency): Fixed documentation and update the value of currency. + (setInternationalCurrencySymbol): Fixed documentation and update the + value of currency. + * java/util/Currency.java: Introduced two new variables, properties + and fractionDigits. In the static block, a properties object is + created and the currency resource is loaded. + (Currency(Locale)): fractionDigits is defined. + (Currency(String)): New method. + (getDefaultFractionDigits): Return the value of fractionDigits. + (getInstance(String)): Check if String is equal to "XXX". + 2007-04-04 Kyle Galloway * classpath/gnu/classpath/jdwp/util/VariableTable.java: Change longs diff --git a/libjava/classpath/lib/java/text/DecimalFormatSymbols.class b/libjava/classpath/lib/java/text/DecimalFormatSymbols.class index a88226feba5cd0841a30a7a9bd0971082f030e36..253b14efe4fc3f24457907516f2075b51dc7f0ae 100644 GIT binary patch literal 6861 zcmb7Idw5jU5&zxICc9Z~!X`iv5Jak&Y)FE|YD-kA0c^B!mA2aUuiF0R+`GFso11=LKR))H zIcMf~=FH5QnVZKyy8l4{XX0Nzcr?sfXKXO)lIF%_-D0yn++#$R#^OCjvUyWaTP%|B z!K)#tcp^r$t8Qi6IKOF50N5jcYJRlrRMjG-?E$#_NQ;FtqSCsNS#7Y|RO%C~j6~+px(Q71= zW<2WH@b#MUcAl(3W=-J;6_}DxS8OrkiEu2sGRkY1Mh{hP)KI+HjK>yRY8ORf?S>e^ zzH=%Wj?^tzYrL~RV;S1cvWeQyXf9S6b*IBKp)^|YDsi!HyFt9!H<^fmo#FM5;R;e>|S*6HJh7j-E*SG;w;hJwnf zmHPi8+UzbbJD5YY23i$;D=;k&4g}+3Pv@>I2a5NgZ|g6#Y}_u%~VBsumh9 zVRV`onMo_`G^}>=tu_;}6kUB`D%ue->m3HPqjcDY`f zOJJGF%#j+VIs+@STwm4V#{?1js*cZ~QBJ>F#{}qplnC)P9VJ4P3h@mcr9w;;;+r}q z3K8_<+cemleR~AvdL0X)?stQZAOe0&66WnXCJA%75I5;47hyC`|$p$BC3RvnXt ze~J)$bW9PJ3L);$Q6a=sA-=0)su0tK*so(cbeY|)V+Kz4;rp3)s-8h(Bw}_MkqhEo zsUDUR$2%=x81wA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.class b/libjava/classpath/lib/java/util/Currency.class index 147415ca1e935202ee48666ef88591b81e745bc6..b2ca13189c6b47bd2e8876fb74dbc6ad1be23b98 100644 GIT binary patch literal 4292 zcmai1`+F4C8GcU)>}E3|WVv5mq6x_+BoMF&K@ft0g+S0?LTYI{*&V{bWOm)1jYMlL zh^bRF{i#3nALzf(%X`ku>`vl7PoF%SnLXz_-}%1x zd*APz{qR3;-2ku=e-EKTAbL_C)!XxqX|;FdvsuGVj)hPuut1Glx;@<9J9N@WIw8yx zSfobHbbFtXHFe8;NFTBc8t2s4ej}SR)AoIdJpy9CKuuTL&N;g6^y^mMnEUUKp4&fI z_sT5-^Q?4ImkXmkrR{svSf{|8tdSE~5tzEy$ffhyq_I11r!0dekxVw7F|v*+Etdo= z4;RO2r6s+Ly3(oAW-6yXCu`cnw3&ZAt0x^sy~i9j9eNW9fw@UNd4ely1D+4+8JdT; zCoR)9ogECbskvXEQu+>Il|Wr7m3?~d1nnbOi8UH-!E&a&T`jAEz*-GUur!2QeLNNV zrN|?w#~Nwas9^!>!e}B;W-h(CW8;>#QsNQB(HcSv!z|UR%hGc>4eQY+uyELLeB^fJ zn6aUc2sAgjNd;kOc86Hkgq_Jdu4$)?V}nMfbTCaTt)~Q*d5dRRHuqOyGd>r>?K6ne zHbrH*GEy-o9g~s7 z{L0426-AA0u?V(eheUfPw<(uozqHt;VK=&14?UAHY^Jn6XzEhE)59YGkrxXw*^0Y0 zbYm~M;H2F^S;wZ&E}?A#2ST6_7OK<;S|Di+Ju=czM&e-EAshn!YuHK?bEB!h(Nd0+(RYqw^3Fd$&1~dn2SWD-GNunl>KWaKA(&Lbi3K^R|;63*(poBKQ*Y5Weg$381NA2uaq!cp$G^48`A5 znfNu}c9dX!i4_UUGKO_)S9Ul*V%Sa*p)iI8niBRX8&WFPWQ=5-vF2FPjfKyY5j&pF zk~gyFY>Oa;9a3EmePD ztcC}WC8h+yWqn{yVEGJs1g2OL2cse6DJ|t!;p&UlZFd?T#A$&lx^@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- a/libjava/gnu/java/net/PlainSocketImpl.h +++ b/libjava/gnu/java/net/PlainSocketImpl.h @@ -46,8 +46,8 @@ public: ::java::lang::Object * getOption(jint); void shutdownInput(); void shutdownOutput(); -public: // actually protected void create(jboolean); +public: // actually protected void connect(::java::lang::String *, jint); void connect(::java::net::InetAddress *, jint); void connect(::java::net::SocketAddress *, jint); diff --git a/libjava/gnu/java/util/jar/JarUtils.h b/libjava/gnu/java/util/jar/JarUtils.h index 4704582d0db..1d12845fd65 100644 --- a/libjava/gnu/java/util/jar/JarUtils.h +++ b/libjava/gnu/java/util/jar/JarUtils.h @@ -50,7 +50,6 @@ private: static void writeVersionInfo(::java::util::jar::Attributes *, ::java::io::OutputStream *); static void writeAttributeEntry(::java::util::Map$Entry *, ::java::io::OutputStream *); static void writeHeader(::java::lang::String *, ::java::lang::String *, ::java::io::OutputStream *); - static ::java::util::logging::Logger * log; public: static ::java::lang::String * META_INF; static ::java::lang::String * DSA_SUFFIX; diff --git a/libjava/java/lang/VMCompiler.h b/libjava/java/lang/VMCompiler.h index 9034bd3b826..e81f694e196 100644 --- a/libjava/java/lang/VMCompiler.h +++ b/libjava/java/lang/VMCompiler.h @@ -41,7 +41,6 @@ public: private: VMCompiler(); static ::java::lang::Class * loadSharedLibrary(::java::lang::ClassLoader *, ::java::lang::String *, ::java::security::ProtectionDomain *, ::java::lang::String *); - static ::java::lang::String * bytesToString(JArray< jbyte > *); public: static ::java::lang::Class * compileClass(::java::lang::ClassLoader *, ::java::lang::String *, JArray< jbyte > *, jint, jint, ::java::security::ProtectionDomain *); static jboolean compileClass(::java::lang::Class *); diff --git a/libjava/java/text/DecimalFormatSymbols.h b/libjava/java/text/DecimalFormatSymbols.h index 96bd2861693..b38140c0620 100644 --- a/libjava/java/text/DecimalFormatSymbols.h +++ b/libjava/java/text/DecimalFormatSymbols.h @@ -83,6 +83,7 @@ private: jint serialVersionOnStream; jchar zeroDigit; ::java::util::Locale * locale; + ::java::util::Currency * currency; static const jlong serialVersionUID = 5772796243397350300LL; public: static ::java::lang::Class class$; diff --git a/libjava/java/text/DecimalFormatSymbols.java b/libjava/java/text/DecimalFormatSymbols.java index c58530fc544..110e45f1200 100644 --- a/libjava/java/text/DecimalFormatSymbols.java +++ b/libjava/java/text/DecimalFormatSymbols.java @@ -1,5 +1,5 @@ /* DecimalFormatSymbols.java -- Format symbols used by DecimalFormat - Copyright (C) 1999, 2000, 2001, 2004 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2004, 2007 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -121,8 +121,19 @@ public final class DecimalFormatSymbols implements Cloneable, Serializable /** * This method initializes a new instance of * DecimalFormatSymbols for the specified locale. + * Note: if the locale does not have an associated + * Currency instance, the currency symbol and + * international currency symbol will be set to the strings "?" + * and "XXX" respectively. This generally happens with language + * locales (those with no specified country), such as + * Locale.ENGLISH. This constructor only obtains + * instances using the runtime's resources; to also include + * {@link java.text.spi.DecimalFormatSymbolsProvider} instances, + * call {@link #getInstance(java.util.Locale)} instead. * * @param loc The local to load symbols for. + * @throws NullPointerException if the locale is null. + * @see #getInstance(java.util.Locale) */ public DecimalFormatSymbols (Locale loc) { @@ -136,14 +147,26 @@ public final class DecimalFormatSymbols implements Cloneable, Serializable { res = null; } - currencySymbol = safeGetString (res, "currencySymbol", "$"); + currency = Currency.getInstance("XXX"); + currencySymbol = "?"; + intlCurrencySymbol = "XXX"; + try + { + Currency localeCurrency = Currency.getInstance(loc); + if (localeCurrency != null) + { + setCurrency(localeCurrency); + } + } + catch(IllegalArgumentException exception) + { + /* Locale has an invalid currency */ + } decimalSeparator = safeGetChar (res, "decimalSeparator", '.'); digit = safeGetChar (res, "digit", '#'); exponential = safeGetChar (res, "exponential", 'E'); groupingSeparator = safeGetChar (res, "groupingSeparator", ','); infinity = safeGetString (res, "infinity", "\u221e"); - // FIXME: default? - intlCurrencySymbol = safeGetString (res, "intlCurrencySymbol", "$"); try { monetarySeparator = safeGetChar (res, "monetarySeparator", '.'); @@ -200,12 +223,13 @@ public final class DecimalFormatSymbols implements Cloneable, Serializable * Returns the currency corresponding to the currency symbol stored * in the instance of DecimalFormatSymbols. * - * @return A new instance of Currency if - * the currency code matches a known one. + * @return An instance of Currency which matches + * the currency used, or null if there is no corresponding + * instance. */ public Currency getCurrency () { - return Currency.getInstance (currencySymbol); + return currency; } /** @@ -368,13 +392,16 @@ public final class DecimalFormatSymbols implements Cloneable, Serializable } /** - * This method sets the currency to the specified value. + * This method sets the currency symbol and ISO 4217 currency + * code to the values obtained from the supplied currency. * - * @param currency The new currency + * @param currency the currency from which to obtain the values. + * @throws NullPointerException if the currency is null. */ public void setCurrency (Currency currency) { setCurrencySymbol (currency.getSymbol()); + this.currency = currency; } /** @@ -435,14 +462,31 @@ public final class DecimalFormatSymbols implements Cloneable, Serializable } /** - * This method sets the international currency symbols to the - * specified value. + * This method sets the international currency symbol to the + * specified value. If a valid Currency instance + * exists for the international currency code, then this is + * used for the currency attribute, and the currency symbol + * is set to the corresponding value from this instance. + * Otherwise, the currency attribute is set to null and the + * symbol is left unmodified. * - * @param intlCurrencySymbol The new international currency symbol. + * @param currencyCode The new international currency symbol. */ - public void setInternationalCurrencySymbol (String currency) + public void setInternationalCurrencySymbol (String currencyCode) { - intlCurrencySymbol = currency; + intlCurrencySymbol = currencyCode; + try + { + currency = Currency.getInstance(currencyCode); + } + catch (IllegalArgumentException exception) + { + currency = null; + } + if (currency != null) + { + setCurrencySymbol(currency.getSymbol(locale)); + } } /** @@ -593,7 +637,17 @@ public final class DecimalFormatSymbols implements Cloneable, Serializable * @serial The locale of these currency symbols. */ private Locale locale; - + + /** + * The currency used for the symbols in this instance. + * This is stored temporarily for efficiency reasons, + * as well as to ensure that the correct instance + * is restored from the currency code. + * + * @serial Ignored. + */ + private transient Currency currency; + private static final long serialVersionUID = 5772796243397350300L; private void readObject(ObjectInputStream stream) diff --git a/libjava/java/util/Currency.h b/libjava/java/util/Currency.h index c868cef9ca3..ac8878c7e2b 100644 --- a/libjava/java/util/Currency.h +++ b/libjava/java/util/Currency.h @@ -13,6 +13,7 @@ class java::util::Currency : public ::java::lang::Object Currency(); Currency(::java::util::Locale *); + Currency(::java::lang::String *); public: ::java::lang::String * getCurrencyCode(); jint getDefaultFractionDigits(); @@ -28,7 +29,9 @@ public: // actually package-private private: ::java::util::Locale * __attribute__((aligned(__alignof__( ::java::lang::Object)))) locale; ::java::util::ResourceBundle * res; + static ::java::util::Properties * properties; ::java::lang::String * currencyCode; + jint fractionDigits; static ::java::util::Map * cache; public: static ::java::lang::Class class$; diff --git a/libjava/java/util/Currency.java b/libjava/java/util/Currency.java index e1a28e0b8c6..66888fa666b 100644 --- a/libjava/java/util/Currency.java +++ b/libjava/java/util/Currency.java @@ -37,6 +37,7 @@ exception statement from your version. */ package java.util; +import java.io.IOException; import java.io.ObjectStreamException; import java.io.Serializable; import java.text.NumberFormat; @@ -82,6 +83,16 @@ public final class Currency */ private transient ResourceBundle res; + /** + * The set of properties which map a currency to + * the currency information such as the ISO 4217 + * currency code and the number of decimal points. + * + * @see #getCurrencyCode() + * @serial ignored. + */ + private static transient Properties properties; + /** * The ISO 4217 currency code associated with this * particular instance. @@ -91,6 +102,15 @@ public final class Currency */ private String currencyCode; + /** + * The number of fraction digits associated with this + * particular instance. + * + * @see #getDefaultFractionDigits() + * @serial the number of fraction digits + */ + private transient int fractionDigits; + /** * A cache of Currency instances to * ensure the singleton nature of this class. The key @@ -108,6 +128,17 @@ public final class Currency static { cache = new HashMap(); + /* Create the properties object */ + properties = new Properties(); + /* Try and load the properties from our iso4217.properties resource */ + try + { + properties.load(Currency.class.getResourceAsStream("iso4217.properties")); + } + catch (IOException exception) + { + System.out.println("Failed to load currency resource: " + exception); + } } /** @@ -130,9 +161,24 @@ public final class Currency */ private Currency (Locale loc) { + String countryCode; + String fractionDigitsKey; + + /* Retrieve the country code from the locale */ + countryCode = loc.getCountry(); + + /* If there is no country code, return */ + if (countryCode.equals("")) + { + throw new + IllegalArgumentException("Invalid (empty) country code for locale:" + + loc); + } + this.locale = loc; this.res = ResourceBundle.getBundle ("gnu.java.locale.LocaleInformation", locale, ClassLoader.getSystemClassLoader()); + /* Retrieve the ISO4217 currency code */ try { @@ -142,6 +188,25 @@ public final class Currency { currencyCode = null; } + + /* Construct the key for the fraction digits */ + fractionDigitsKey = countryCode + ".fractionDigits"; + + /* Retrieve the fraction digits */ + fractionDigits = Integer.parseInt(properties.getProperty(fractionDigitsKey)); + } + + /** + * Constructor for the "XXX" special case. This allows + * a Currency to be constructed from an assumed good + * currency code. + * + * @param code the code to use. + */ + private Currency(String code) + { + currencyCode = code; + fractionDigits = -1; /* Pseudo currency */ } /** @@ -168,9 +233,7 @@ public final class Currency */ public int getDefaultFractionDigits () { - NumberFormat currency = NumberFormat.getCurrencyInstance (locale); - - return currency.getMaximumFractionDigits(); + return fractionDigits; } /** @@ -226,6 +289,10 @@ public final class Currency { Locale[] allLocales = Locale.getAvailableLocales (); + /* Nasty special case to allow an erroneous currency... blame Sun */ + if (currencyCode.equals("XXX")) + return new Currency("XXX"); + for (int i = 0;i < allLocales.length; i++) { Currency testCurrency = getInstance (allLocales[i]);