morten      01/10/30 08:19:45

  Modified:    java/src/org/apache/xalan/xsltc/compiler Parser.java
               java/src/org/apache/xalan/xsltc/compiler/util ErrorMsg.java
               java/src/org/apache/xalan/xsltc/runtime BasisLibrary.java
  Log:
  Added "Compiler Warning" text to output.
  Submitted by: [EMAIL PROTECTED]
  
  Revision  Changes    Path
  1.30      +2 -2      
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java
  
  Index: Parser.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- Parser.java       2001/10/30 08:42:55     1.29
  +++ Parser.java       2001/10/30 16:19:45     1.30
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: Parser.java,v 1.29 2001/10/30 08:42:55 morten Exp $
  + * @(#)$Id: Parser.java,v 1.30 2001/10/30 16:19:45 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -959,7 +959,7 @@
       public void printWarnings() {
        final int size = _warnings.size();
        if (size > 0) {
  -         ErrorMsg.getCompileWarningMessage();
  +         System.err.println(ErrorMsg.getCompileWarningMessage());
            for (int i = 0; i < size; i++) {
                System.err.println("  " + _warnings.elementAt(i));
            }
  
  
  
  1.10      +2 -5      
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ErrorMsg.java
  
  Index: ErrorMsg.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ErrorMsg.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ErrorMsg.java     2001/10/30 15:35:30     1.9
  +++ ErrorMsg.java     2001/10/30 16:19:45     1.10
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: ErrorMsg.java,v 1.9 2001/10/30 15:35:30 morten Exp $
  + * @(#)$Id: ErrorMsg.java,v 1.10 2001/10/30 16:19:45 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -162,7 +162,6 @@
       public static final int COMPILE_USAGE_STR       = 72;
       public static final int TRANSFORM_USAGE_STR     = 73;
   
  -
       // All error messages are localized and are stored in resource bundles.
       // This array and the following 4 strings are read from that bundle.
       private static String[] _errorMessages;
  @@ -176,9 +175,7 @@
       public final static String RUNTIME_ERROR_KEY    = "runtime-error";
   
       static {
  -     Locale locale = Locale.getDefault();
  -     //Locale locale = new Locale("no","NO");
  -     ResourceBundle bundle = 
ResourceBundle.getBundle("org.apache.xalan.xsltc.compiler.util.ErrorMessages", 
locale);
  +     ResourceBundle bundle = 
ResourceBundle.getBundle("org.apache.xalan.xsltc.compiler.util.ErrorMessages", 
Locale.getDefault());
        _errorMessages  = bundle.getStringArray(ERROR_MESSAGES_KEY);
        _compileError   = bundle.getString(COMPILER_ERROR_KEY);
        _compileWarning = bundle.getString(COMPILER_WARNING_KEY);
  
  
  
  1.25      +16 -33    
xml-xalan/java/src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
  
  Index: BasisLibrary.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/BasisLibrary.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- BasisLibrary.java 2001/10/30 14:57:54     1.24
  +++ BasisLibrary.java 2001/10/30 16:19:45     1.25
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: BasisLibrary.java,v 1.24 2001/10/30 14:57:54 morten Exp $
  + * @(#)$Id: BasisLibrary.java,v 1.25 2001/10/30 16:19:45 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -66,6 +66,9 @@
   
   package org.apache.xalan.xsltc.runtime;
   
  +import java.util.Locale;
  +import java.util.ResourceBundle;
  +
   import java.text.MessageFormat;
   import java.text.FieldPosition;
   import java.text.DecimalFormat;
  @@ -955,47 +958,27 @@
       public static final int STRAY_NAMESPACE_ERR     = 11;
       public static final int NAMESPACE_PREFIX_ERR    = 12;
       public static final int DOM_ADAPTER_INIT_ERR    = 13;
  +
  +    // All error messages are localized and are stored in resource bundles.
  +    // This array and the following 4 strings are read from that bundle.
  +    private static String[] _errorMessages;
  +    
  +    public final static String ERROR_MESSAGES_KEY   = "error-messages";
   
  -    private final static String[] errorMessages = {
  -     // RUN_TIME_INTERNAL_ERR
  -     "Run-time internal error in ''{0}''",
  -     // RUN_TIME_COPY_ERR
  -     "Run-time error when executing <xsl:copy>.",
  -     // DATA_CONVERSION_ERR
  -     "Invalid conversion from ''{0}'' to ''{1}''.",
  -     // EXTERNAL_FUNC_ERR
  -     "External function ''{0}'' not supported by XSLTC.",
  -     // EQUALITY_EXPR_ERR
  -     "Unknown argument type in equality expression.",
  -     // INVALID_ARGUMENT_ERR
  -     "Invalid argument type ''{0}'' in call to ''{1}''",
  -     // FORMAT_NUMBER_ERR
  -     "Attempting to format number ''{0}'' using pattern ''{1}''.",
  -     // ITERATOR_CLONE_ERR
  -     "Cannot clone iterator ''{0}''.",
  -     // AXIS_SUPPORT_ERR
  -     "Iterator for axis ''{0}'' not supported.",
  -     // TYPED_AXIS_SUPPORT_ERR
  -     "Iterator for typed axis ''{0}'' not supported.",
  -     // STRAY_ATTRIBUTE_ERR
  -     "Attribute ''{0}'' outside of element.",
  -     // STRAY_NAMESPACE_ERR
  -     "Namespace declaration ''{0}''=''{1}'' outside of element.",
  -     // NAMESPACE_PREFIX_ERR
  -     "Namespace for prefix ''{0}'' has not been declared.",
  -     // DOM_ADAPTER_INIT_ERR
  -     "DOMAdapter created using wrong type of source DOM."
  -    };
  +    static {
  +     ResourceBundle bundle = 
ResourceBundle.getBundle("org.apache.xalan.xsltc.runtime.ErrorMessages", 
Locale.getDefault());
  +     _errorMessages  = bundle.getStringArray(ERROR_MESSAGES_KEY);
  +    }
   
       /**
        * Print a run-time error message.
        */
       public static void runTimeError(int code) {
  -     throw new RuntimeException(errorMessages[code]);
  +     throw new RuntimeException(_errorMessages[code]);
       }
   
       public static void runTimeError(int code, Object[] args) {
  -     final String message = MessageFormat.format(errorMessages[code],args);
  +     final String message = MessageFormat.format(_errorMessages[code],args);
        throw new RuntimeException(message);
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to