src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Sort.java
changeset 48697 0474300affbd
parent 48409 5ab69533994b
equal deleted inserted replaced
48696:917868f73209 48697:0474300affbd
    64 
    64 
    65     private Expression     _select;
    65     private Expression     _select;
    66     private AttributeValue _order;
    66     private AttributeValue _order;
    67     private AttributeValue _caseOrder;
    67     private AttributeValue _caseOrder;
    68     private AttributeValue _dataType;
    68     private AttributeValue _dataType;
    69     private String         _lang; // bug! see 26869
    69     private AttributeValue _lang; // bug! see 26869, see XALANJ-2546
    70 
    70 
    71     private String _className = null;
    71     private String _className = null;
    72     private List<VariableRefBase> _closureVars = null;
    72     private List<VariableRefBase> _closureVars = null;
    73     private boolean _needsSortRecordFactory = false;
    73     private boolean _needsSortRecordFactory = false;
    74 
    74 
   152                 val = "text";
   152                 val = "text";
   153             }
   153             }
   154         }
   154         }
   155         _dataType = AttributeValue.create(this, val, parser);
   155         _dataType = AttributeValue.create(this, val, parser);
   156 
   156 
   157          _lang =  getAttribute("lang"); // bug! see 26869
   157         val =  getAttribute("lang");
   158   // val =  getAttribute("lang");
   158         _lang = AttributeValue.create(this, val, parser);
   159   // _lang = AttributeValue.create(this, val, parser);
       
   160         // Get the case order; default is language dependant
   159         // Get the case order; default is language dependant
   161     val = getAttribute("case-order");
   160         val = getAttribute("case-order");
   162     _caseOrder = AttributeValue.create(this, val, parser);
   161         _caseOrder = AttributeValue.create(this, val, parser);
   163 
       
   164     }
   162     }
   165 
   163 
   166     /**
   164     /**
   167      * Run type checks on the attributes; expression must return a string
   165      * Run type checks on the attributes; expression must return a string
   168      * which we will use as a sort key
   166      * which we will use as a sort key
   177         }
   175         }
   178 
   176 
   179         _order.typeCheck(stable);
   177         _order.typeCheck(stable);
   180         _caseOrder.typeCheck(stable);
   178         _caseOrder.typeCheck(stable);
   181         _dataType.typeCheck(stable);
   179         _dataType.typeCheck(stable);
       
   180         _lang.typeCheck(stable);
   182         return Type.Void;
   181         return Type.Void;
   183     }
   182     }
   184 
   183 
   185     /**
   184     /**
   186      * These two methods are needed in the static methods that compile the
   185      * These two methods are needed in the static methods that compile the
   194     public void translateSortOrder(ClassGenerator classGen,
   193     public void translateSortOrder(ClassGenerator classGen,
   195                                    MethodGenerator methodGen) {
   194                                    MethodGenerator methodGen) {
   196         _order.translate(classGen, methodGen);
   195         _order.translate(classGen, methodGen);
   197     }
   196     }
   198 
   197 
   199      public void translateCaseOrder(ClassGenerator classGen,
   198     public void translateCaseOrder(ClassGenerator classGen,
   200                    MethodGenerator methodGen) {
   199                    MethodGenerator methodGen) {
   201     _caseOrder.translate(classGen, methodGen);
   200         _caseOrder.translate(classGen, methodGen);
   202     }
   201     }
   203 
   202 
   204     public void translateLang(ClassGenerator classGen,
   203     public void translateLang(ClassGenerator classGen,
   205                    MethodGenerator methodGen) {
   204                    MethodGenerator methodGen) {
   206     final ConstantPoolGen cpg = classGen.getConstantPool();
   205         _lang.translate(classGen, methodGen);
   207     final InstructionList il = methodGen.getInstructionList();
       
   208     il.append(new PUSH(cpg, _lang)); // bug! see 26869
       
   209     }
   206     }
   210 
   207 
   211     /**
   208     /**
   212      * This method compiles code for the select expression for this
   209      * This method compiles code for the select expression for this
   213      * xsl:sort element. The method is called from the static code-generating
   210      * xsl:sort element. The method is called from the static code-generating