You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by mm...@locus.apache.org on 2000/09/19 17:34:38 UTC

cvs commit: xml-xalan/src/org/apache/xalan/xslt ElemNumber.java

mmidy       00/09/19 08:34:35

  Modified:    src/org/apache/xalan/xslt ElemNumber.java
  Log:
  Make resource bundle thread safe.
  
  Revision  Changes    Path
  1.15      +12 -12    xml-xalan/src/org/apache/xalan/xslt/ElemNumber.java
  
  Index: ElemNumber.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/ElemNumber.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ElemNumber.java	2000/03/29 03:51:57	1.14
  +++ ElemNumber.java	2000/09/19 15:34:30	1.15
  @@ -864,28 +864,28 @@
       case 0x3042:
         thisBundle = (XSLTResourceBundle)XSLTResourceBundle.loadResourceBundle( Constants.LANG_BUNDLE_NAME, new Locale("ja","JP","HA" ) );
         if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
  -        formattedNumber.append( tradAlphaCount(listElement));
  +        formattedNumber.append( tradAlphaCount(listElement, thisBundle));
         else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
           formattedNumber.append( int2singlealphaCount(listElement, (char[])thisBundle.getObject(Constants.LANG_ALPHABET)));			
         break;
       case 0x3044:
         thisBundle = (XSLTResourceBundle)XSLTResourceBundle.loadResourceBundle( Constants.LANG_BUNDLE_NAME, new Locale("ja","JP", "HI") );
         if ((letterVal != null) && letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
  -        formattedNumber.append( tradAlphaCount(listElement));
  +        formattedNumber.append( tradAlphaCount(listElement, thisBundle));
         else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
           formattedNumber.append( int2singlealphaCount(listElement, (char[])thisBundle.getObject(Constants.LANG_ALPHABET)));			
         break;
       case 0x30A2:
         thisBundle = (XSLTResourceBundle)XSLTResourceBundle.loadResourceBundle( Constants.LANG_BUNDLE_NAME, new Locale("ja","JP","A" ) );
         if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
  -        formattedNumber.append( tradAlphaCount(listElement));
  +        formattedNumber.append( tradAlphaCount(listElement, thisBundle));
         else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
           formattedNumber.append( int2singlealphaCount(listElement, (char[])thisBundle.getObject(Constants.LANG_ALPHABET)));			
         break;
       case 0x30A4:
         thisBundle = (XSLTResourceBundle)XSLTResourceBundle.loadResourceBundle( Constants.LANG_BUNDLE_NAME, new Locale("ja","JP", "I") );
         if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
  -        formattedNumber.append( tradAlphaCount(listElement));
  +        formattedNumber.append( tradAlphaCount(listElement, thisBundle));
         else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
           formattedNumber.append( int2singlealphaCount(listElement, (char[])thisBundle.getObject(Constants.LANG_ALPHABET)));			
         break;
  @@ -893,7 +893,7 @@
         thisBundle = (XSLTResourceBundle)XSLTResourceBundle.loadResourceBundle( Constants.LANG_BUNDLE_NAME, new Locale("zh","CN" ) );
         if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
         {
  -        formattedNumber.append(tradAlphaCount(listElement));
  +        formattedNumber.append(tradAlphaCount(listElement, thisBundle));
         }	
         else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
           int2alphaCount(listElement, (char[])thisBundle.getObject(Constants.LANG_ALPHABET), formattedNumber);
  @@ -901,42 +901,42 @@
       case 0x58F9:
         thisBundle = (XSLTResourceBundle)XSLTResourceBundle.loadResourceBundle( Constants.LANG_BUNDLE_NAME, new Locale("zh","TW") );
         if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
  -        formattedNumber.append( tradAlphaCount(listElement));
  +        formattedNumber.append( tradAlphaCount(listElement, thisBundle));
         else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
           int2alphaCount(listElement, (char[])thisBundle.getObject(Constants.LANG_ALPHABET), formattedNumber);			
         break;
       case 0x0E51:
         thisBundle = (XSLTResourceBundle)XSLTResourceBundle.loadResourceBundle( Constants.LANG_BUNDLE_NAME, new Locale("th","") );
         if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
  -        formattedNumber.append( tradAlphaCount(listElement));
  +        formattedNumber.append( tradAlphaCount(listElement, thisBundle));
         else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
           int2alphaCount(listElement, (char[])thisBundle.getObject(Constants.LANG_ALPHABET), formattedNumber);	
         break;
       case 0x05D0:
         thisBundle = (XSLTResourceBundle)XSLTResourceBundle.loadResourceBundle( Constants.LANG_BUNDLE_NAME, new Locale("he","") );
         if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
  -        formattedNumber.append( tradAlphaCount(listElement));
  +        formattedNumber.append( tradAlphaCount(listElement, thisBundle));
         else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
           int2alphaCount(listElement, (char[])thisBundle.getObject(Constants.LANG_ALPHABET), formattedNumber);	
         break;
       case 0x10D0:
         thisBundle = (XSLTResourceBundle)XSLTResourceBundle.loadResourceBundle( Constants.LANG_BUNDLE_NAME, new Locale("ka","") );
         if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
  -        formattedNumber.append( tradAlphaCount(listElement));
  +        formattedNumber.append( tradAlphaCount(listElement, thisBundle));
         else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
           int2alphaCount(listElement, (char[])thisBundle.getObject(Constants.LANG_ALPHABET), formattedNumber);	
         break;
       case 0x03B1:
         thisBundle = (XSLTResourceBundle)XSLTResourceBundle.loadResourceBundle( Constants.LANG_BUNDLE_NAME, new Locale("el","") );
         if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
  -        formattedNumber.append( tradAlphaCount(listElement));
  +        formattedNumber.append( tradAlphaCount(listElement, thisBundle));
         else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
           int2alphaCount(listElement, (char[])thisBundle.getObject(Constants.LANG_ALPHABET), formattedNumber);		
         break;
       case 0x0430:
         thisBundle = (XSLTResourceBundle)XSLTResourceBundle.loadResourceBundle( Constants.LANG_BUNDLE_NAME, new Locale("cy","") );
         if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL))
  -        formattedNumber.append( tradAlphaCount(listElement));
  +        formattedNumber.append( tradAlphaCount(listElement, thisBundle));
         else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC))
           int2alphaCount(listElement,(char[])thisBundle.getObject(Constants.LANG_ALPHABET), formattedNumber);		
         break;
  @@ -1082,7 +1082,7 @@
      * Note that the radix of the conversion is inferred from the size
      * of the table.
      */
  -  protected String tradAlphaCount(int val)
  +  protected String tradAlphaCount(int val, XSLTResourceBundle thisBundle)
     {
       // if this number is larger than the largest number we can represent, error!
       //if (val > ((Integer)thisBundle.getObject("MaxNumericalValue")).intValue())