src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionAvailableCall.java
changeset 47359 e1a6c0168741
parent 47216 71c04702a3d5
child 47712 bde0215f1f70
equal deleted inserted replaced
47358:d07d5f7cab35 47359:e1a6c0168741
     1 /*
     1 /*
     2  * reserved comment block
     2  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT REMOVE OR ALTER!
     3  * @LastModified: Oct 2017
     4  */
     4  */
     5 /*
     5 /*
     6  * Licensed to the Apache Software Foundation (ASF) under one or more
     6  * Licensed to the Apache Software Foundation (ASF) under one or more
     7  * contributor license agreements.  See the NOTICE file distributed with
     7  * contributor license agreements.  See the NOTICE file distributed with
     8  * this work for additional information regarding copyright ownership.
     8  * this work for additional information regarding copyright ownership.
    19  * limitations under the License.
    19  * limitations under the License.
    20  */
    20  */
    21 
    21 
    22 package com.sun.org.apache.xalan.internal.xsltc.compiler;
    22 package com.sun.org.apache.xalan.internal.xsltc.compiler;
    23 
    23 
    24 import java.lang.reflect.Method;
       
    25 import java.lang.reflect.Modifier;
       
    26 import java.util.Vector;
       
    27 
       
    28 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
    24 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
    29 import com.sun.org.apache.bcel.internal.generic.PUSH;
    25 import com.sun.org.apache.bcel.internal.generic.PUSH;
       
    26 import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
    30 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
    27 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
    31 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
    28 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
    32 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
    29 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
    33 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
    30 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
    34 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
    31 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
    35 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
    32 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
    36 import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
    33 import java.lang.reflect.Method;
       
    34 import java.lang.reflect.Modifier;
       
    35 import java.util.List;
    37 
    36 
    38 /**
    37 /**
    39  * @author G. Todd Miller
    38  * @author G. Todd Miller
    40  * @author Santiago Pericas-Geertsen
    39  * @author Santiago Pericas-Geertsen
    41  */
    40  */
    50      * Constructs a FunctionAvailableCall FunctionCall. Takes the
    49      * Constructs a FunctionAvailableCall FunctionCall. Takes the
    51      * function name qname, for example, 'function-available', and
    50      * function name qname, for example, 'function-available', and
    52      * a list of arguments where the arguments must be instances of
    51      * a list of arguments where the arguments must be instances of
    53      * LiteralExpression.
    52      * LiteralExpression.
    54      */
    53      */
    55     public FunctionAvailableCall(QName fname, Vector arguments) {
    54     public FunctionAvailableCall(QName fname, List<Expression> arguments) {
    56         super(fname, arguments);
    55         super(fname, arguments);
    57         _arg = (Expression)arguments.elementAt(0);
    56         _arg = (Expression)arguments.get(0);
    58         _type = null;
    57         _type = null;
    59 
    58 
    60         if (_arg instanceof LiteralExpr) {
    59         if (_arg instanceof LiteralExpr) {
    61             LiteralExpr arg = (LiteralExpr) _arg;
    60             LiteralExpr arg = (LiteralExpr) _arg;
    62             _namespaceOfFunct = arg.getNamespace();
    61             _namespaceOfFunct = arg.getNamespace();
   129         // Replace the '-' characters in the method name
   128         // Replace the '-' characters in the method name
   130         if (methodName.indexOf('-') > 0)
   129         if (methodName.indexOf('-') > 0)
   131           methodName = replaceDash(methodName);
   130           methodName = replaceDash(methodName);
   132 
   131 
   133         try {
   132         try {
   134             final Class clazz = ObjectFactory.findProviderClass(className, true);
   133             final Class<?> clazz = ObjectFactory.findProviderClass(className, true);
   135 
   134 
   136             if (clazz == null) {
   135             if (clazz == null) {
   137                 return false;
   136                 return false;
   138             }
   137             }
   139 
   138