src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/StringType.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * reserved comment block |
2 * Copyright (c) 2015, 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. |
154 * Translates a internal string into an external (Java) string. |
154 * Translates a internal string into an external (Java) string. |
155 * |
155 * |
156 * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateFrom |
156 * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateFrom |
157 */ |
157 */ |
158 public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, |
158 public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, |
159 Class clazz) |
159 Class<?> clazz) |
160 { |
160 { |
161 // Is String <: clazz? I.e. clazz in { String, Object } |
161 // Is String <: clazz? I.e. clazz in { String, Object } |
162 if (clazz.isAssignableFrom(java.lang.String.class)) { |
162 if (clazz.isAssignableFrom(java.lang.String.class)) { |
163 methodGen.getInstructionList().append(NOP); |
163 methodGen.getInstructionList().append(NOP); |
164 } |
164 } |
173 * Translates an external (primitive) Java type into a string. |
173 * Translates an external (primitive) Java type into a string. |
174 * |
174 * |
175 * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateFrom |
175 * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateFrom |
176 */ |
176 */ |
177 public void translateFrom(ClassGenerator classGen, |
177 public void translateFrom(ClassGenerator classGen, |
178 MethodGenerator methodGen, Class clazz) |
178 MethodGenerator methodGen, Class<?> clazz) |
179 { |
179 { |
180 final ConstantPoolGen cpg = classGen.getConstantPool(); |
180 final ConstantPoolGen cpg = classGen.getConstantPool(); |
181 final InstructionList il = methodGen.getInstructionList(); |
181 final InstructionList il = methodGen.getInstructionList(); |
182 |
182 |
183 if (clazz.getName().equals("java.lang.String")) { |
183 if (clazz.getName().equals("java.lang.String")) { |