tmiller     2002/06/18 06:29:35

  Modified:    java/src/org/apache/xalan/xsltc/trax
                        TransformerFactoryImpl.java
  Log:
  fixed bug that passes warnings to listener
  
  Revision  Changes    Path
  1.41      +23 -19    
xml-xalan/java/src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
  
  Index: TransformerFactoryImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- TransformerFactoryImpl.java       17 Jun 2002 18:37:11 -0000      1.40
  +++ TransformerFactoryImpl.java       18 Jun 2002 13:29:35 -0000      1.41
  @@ -375,21 +375,18 @@
       /**
        * Pass warning messages from the compiler to the error listener
        */
  -    private void passWarningsToListener(Vector messages) {
  -     try {
  -         // Nothing to do if there is no registered error listener
  -         if (_errorListener == null) return;
  -         // Nothing to do if there are not warning messages
  -         if (messages == null) return;
  -         // Pass messages to listener, one by one
  -         final int count = messages.size();
  -         for (int pos=0; pos<count; pos++) {
  -             String message = messages.elementAt(pos).toString();
  -             _errorListener.warning(new TransformerException(message));
  -         }
  -     }
  -     catch (TransformerException e) {
  -         // nada
  +    private void passWarningsToListener(Vector messages) 
  +     throws TransformerException 
  +    {
  +     if (_errorListener == null || messages == null ) {
  +         return;
  +     }
  +     // Pass messages to listener, one by one
  +     final int count = messages.size();
  +     for (int pos = 0; pos < count; pos++) {
  +         String message = messages.elementAt(pos).toString();
  +         _errorListener.error(
  +             new TransformerConfigurationException(message));
        }
       }
   
  @@ -514,10 +511,17 @@
        final String transletName = xsltc.getClassName();
   
        // Pass compiler warnings to the error listener
  -     if (_errorListener != null)
  -         passWarningsToListener(xsltc.getWarnings());
  -     else
  +     if (_errorListener != this) {
  +         try {
  +             passWarningsToListener(xsltc.getWarnings());
  +         }
  +         catch (TransformerException e) {
  +             throw new TransformerConfigurationException(e);
  +         }
  +     }
  +     else {
            xsltc.printWarnings();
  +     }
   
        // Check that the transformation went well before returning
        if (bytecodes == null) {
  
  
  

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

Reply via email to