jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java
Print this page
*** 52,61 ****
--- 52,62 ----
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ObjectType;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ReferenceType;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
+ import com.sun.org.apache.xalan.internal.utils.Objects;
/**
* @author Jacek Ambroziak
* @author Santiago Pericas-Geertsen
* @author Morten Jorgensen
*** 154,165 ****
public JavaType(Class type, int distance){
this.type = type;
this.distance = distance;
}
public boolean equals(Object query){
! return query.equals(type);
}
}
/**
* Defines 2 conversion tables:
--- 155,173 ----
public JavaType(Class type, int distance){
this.type = type;
this.distance = distance;
}
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(this.type);
+ }
+
+ @Override
public boolean equals(Object query){
! return query != null && query.equals(type);
}
}
/**
* Defines 2 conversion tables:
*** 275,284 ****
--- 283,293 ----
public String getName() {
return(_fname.toString());
}
+ @Override
public void setParser(Parser parser) {
super.setParser(parser);
if (_arguments != null) {
final int n = _arguments.size();
for (int i = 0; i < n; i++) {
*** 317,326 ****
--- 326,336 ----
/**
* Type check a function call. Since different type conversions apply,
* type checking is different for standard and external (Java) functions.
*/
+ @Override
public Type typeCheck(SymbolTable stable)
throws TypeCheckError
{
if (_type != null) return _type;
*** 678,687 ****
--- 688,698 ----
/**
* Compile the function call and treat as an expression
* Update true/false-lists.
*/
+ @Override
public void translateDesynthesized(ClassGenerator classGen,
MethodGenerator methodGen)
{
Type type = Type.Boolean;
if (_chosenMethodType != null)
*** 698,707 ****
--- 709,719 ----
/**
* Translate a function call. The compiled code will leave the function's
* return value on the JVM's stack.
*/
+ @Override
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
final int n = argumentCount();
final ConstantPoolGen cpg = classGen.getConstantPool();
final InstructionList il = methodGen.getInstructionList();
final boolean isSecureProcessing = classGen.getParser().getXSLTC().isSecureProcessing();
*** 855,864 ****
--- 867,877 ----
_type.translateFrom(classGen, methodGen,
_chosenMethod.getReturnType());
}
}
+ @Override
public String toString() {
return "funcall(" + _fname + ", " + _arguments + ')';
}
public boolean isStandard() {
*** 1067,1077 ****
* Note: dashes only appear in middle of an EXSLT function or element name.
*/
protected static String replaceDash(String name)
{
char dash = '-';
! StringBuffer buff = new StringBuffer("");
for (int i = 0; i < name.length(); i++) {
if (i > 0 && name.charAt(i-1) == dash)
buff.append(Character.toUpperCase(name.charAt(i)));
else if (name.charAt(i) != dash)
buff.append(name.charAt(i));
--- 1080,1090 ----
* Note: dashes only appear in middle of an EXSLT function or element name.
*/
protected static String replaceDash(String name)
{
char dash = '-';
! final StringBuilder buff = new StringBuilder("");
for (int i = 0; i < name.length(); i++) {
if (i > 0 && name.charAt(i-1) == dash)
buff.append(Character.toUpperCase(name.charAt(i)));
else if (name.charAt(i) != dash)
buff.append(name.charAt(i));