/[classpath]/classpath/java/util/Currency.java
ViewVC logotype

Diff of /classpath/java/util/Currency.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by gnu_andrew, Mon Jan 31 01:37:11 2005 UTC revision 1.15 by gnu_andrew, Sat Apr 16 01:22:52 2005 UTC
# Line 199  public final class Currency Line 199  public final class Currency
199    }    }
200    
201    /**    /**
202       * Constructor for the "XXX" special case.  This allows
203       * a Currency to be constructed from an assumed good
204       * currency code.
205       *
206       * @param code the code to use.
207       */  
208      private Currency(String code)
209      {
210        currencyCode = code;
211        fractionDigits = -1; /* Pseudo currency */
212      }
213    
214      /**
215     * Returns the ISO4217 currency code of this currency.     * Returns the ISO4217 currency code of this currency.
216     *     *
217     * @return a <code>String</code> containing currency code.     * @return a <code>String</code> containing currency code.
# Line 303  public final class Currency Line 316  public final class Currency
316    
317      /*      /*
318       * Throw a null pointer exception explicitly if currencyCode is null.       * Throw a null pointer exception explicitly if currencyCode is null.
319       * One is not thrown otherwise.  It results in an IllegalArgumentException.       * One is not thrown otherwise.  It results in an
320         * IllegalArgumentException.
321       */       */
322      if (currencyCode == null)      if (currencyCode == null)
323        {        {
324          throw new NullPointerException("The supplied currency code is null.");          throw new NullPointerException("The supplied currency code is null.");
325        }        }
326        /* Nasty special case to allow an erroneous currency... blame Sun */
327        if (currencyCode.equals("XXX"))
328          return new Currency("XXX");
329      Currency newCurrency = (Currency) cache.get(currencyCode);      Currency newCurrency = (Currency) cache.get(currencyCode);
330      if (newCurrency == null)      if (newCurrency == null)
331        {        {

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26