morten      01/07/31 03:04:52

  Modified:    java/src/org/apache/xalan/xsltc/compiler Predicate.java
                        Step.java Stylesheet.java XSLTC.java
  Log:
  Removed type-cast error in Stylesheet.java
  PR:           n/a
  Obtained from:        n/a
  Submitted by: [EMAIL PROTECTED]
  Reviewed by:  [EMAIL PROTECTED]
  
  Revision  Changes    Path
  1.8       +5 -3      
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Predicate.java
  
  Index: Predicate.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Predicate.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Predicate.java    2001/07/31 09:11:51     1.7
  +++ Predicate.java    2001/07/31 10:04:51     1.8
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: Predicate.java,v 1.7 2001/07/31 09:11:51 morten Exp $
  + * @(#)$Id: Predicate.java,v 1.8 2001/07/31 10:04:51 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -330,8 +330,9 @@
            try {
                if ((tleft == Type.String) && (!(left instanceof Step)))
                    _value = exp.getLeft();
  -             if (left instanceof VariableRefBase)
  +             if (left instanceof VariableRefBase) 
                    _value = new CastExpr(left, Type.String);
  +             if (_value != null) return _value;
            }
            catch (TypeCheckError e) { }
   
  @@ -340,11 +341,12 @@
                    _value = exp.getRight();
                if (right instanceof VariableRefBase)
                    _value = new CastExpr(right, Type.String);
  +             if (_value != null) return _value;
            }
            catch (TypeCheckError e) { }
   
        }
  -     return _value;
  +     return null;
       }
   
       /**
  
  
  
  1.6       +4 -3      
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Step.java
  
  Index: Step.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Step.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Step.java 2001/07/30 13:35:40     1.5
  +++ Step.java 2001/07/31 10:04:51     1.6
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: Step.java,v 1.5 2001/07/30 13:35:40 morten Exp $
  + * @(#)$Id: Step.java,v 1.6 2001/07/31 10:04:51 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -364,11 +364,12 @@
                try {
                    path.typeCheck(getParser().getSymbolTable());
                }
  -             catch (TypeCheckError e) {}
  +             catch (TypeCheckError e) { }
   
                il.append(methodGen.loadDOM());
                path.translate(classGen, methodGen);
  -             
  +             predicate.translate(classGen, methodGen);
  +
                final String signature =
                    "("+NODE_ITERATOR_SIG+STRING_SIG+"Z)"+NODE_ITERATOR_SIG;
                final int iter = cpg.addMethodref(DOM_CLASS,
  
  
  
  1.15      +2 -2      
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Stylesheet.java
  
  Index: Stylesheet.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Stylesheet.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Stylesheet.java   2001/07/31 09:11:51     1.14
  +++ Stylesheet.java   2001/07/31 10:04:51     1.15
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: Stylesheet.java,v 1.14 2001/07/31 09:11:51 morten Exp $
  + * @(#)$Id: Stylesheet.java,v 1.15 2001/07/31 10:04:51 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -613,7 +613,7 @@
            }
            // xsl:variable or xsl:param
            else if (element instanceof VariableBase) {
  -             ((Variable)element).translate(classGen,toplevel);
  +             ((VariableBase)element).translate(classGen,toplevel);
            }
        }
   
  
  
  
  1.22      +12 -10    
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/XSLTC.java
  
  Index: XSLTC.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/XSLTC.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- XSLTC.java        2001/07/30 13:35:40     1.21
  +++ XSLTC.java        2001/07/31 10:04:51     1.22
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: XSLTC.java,v 1.21 2001/07/30 13:35:40 morten Exp $
  + * @(#)$Id: XSLTC.java,v 1.22 2001/07/31 10:04:51 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -307,7 +307,8 @@
                _stylesheet.translate();
            }
        }
  -     catch (CompilerException e) {
  +     catch (Exception e) {
  +         if (_debug) e.printStackTrace();
            _parser.reportError(Constants.FATAL, new ErrorMsg(e.getMessage()));
        }
        finally {
  @@ -337,14 +338,15 @@
            else
                return false;
        }
  -
  -     // Traverse all elements in the vector and compile
  -     final Enumeration urls = stylesheets.elements();
  -     while (urls.hasMoreElements()) {
  -         _className = null; // reset, so that new name will be computed 
  -         final Object url = urls.nextElement();
  -         if (url instanceof URL) {
  -             if (!compile((URL)url)) return false;
  +     else {
  +         // Traverse all elements in the vector and compile
  +         final Enumeration urls = stylesheets.elements();
  +         while (urls.hasMoreElements()) {
  +             _className = null; // reset, so that new name will be computed 
  +             final Object url = urls.nextElement();
  +             if (url instanceof URL) {
  +                 if (!compile((URL)url)) return false;
  +             }
            }
        }
        return true;
  
  
  

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

Reply via email to