src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/RealType.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. |
|
3 * @LastModified: Oct 2017 |
3 */ |
4 */ |
4 /* |
5 /* |
5 * Licensed to the Apache Software Foundation (ASF) under one or more |
6 * Licensed to the Apache Software Foundation (ASF) under one or more |
6 * contributor license agreements. See the NOTICE file distributed with |
7 * contributor license agreements. See the NOTICE file distributed with |
7 * this work for additional information regarding copyright ownership. |
8 * this work for additional information regarding copyright ownership. |
206 * Translates a real into the Java type denoted by <code>clazz</code>. |
207 * Translates a real into the Java type denoted by <code>clazz</code>. |
207 * Expects a real on the stack and pushes a number of the appropriate |
208 * Expects a real on the stack and pushes a number of the appropriate |
208 * type after coercion. |
209 * type after coercion. |
209 */ |
210 */ |
210 public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, |
211 public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, |
211 final Class clazz) { |
212 final Class<?> clazz) { |
212 final InstructionList il = methodGen.getInstructionList(); |
213 final InstructionList il = methodGen.getInstructionList(); |
213 if (clazz == Character.TYPE) { |
214 if (clazz == Character.TYPE) { |
214 il.append(D2I); |
215 il.append(D2I); |
215 il.append(I2C); |
216 il.append(I2C); |
216 } |
217 } |
248 /** |
249 /** |
249 * Translates an external (primitive) Java type into a real. Expects a java |
250 * Translates an external (primitive) Java type into a real. Expects a java |
250 * object on the stack and pushes a real (i.e., a double). |
251 * object on the stack and pushes a real (i.e., a double). |
251 */ |
252 */ |
252 public void translateFrom(ClassGenerator classGen, MethodGenerator methodGen, |
253 public void translateFrom(ClassGenerator classGen, MethodGenerator methodGen, |
253 Class clazz) { |
254 Class<?> clazz) { |
254 InstructionList il = methodGen.getInstructionList(); |
255 InstructionList il = methodGen.getInstructionList(); |
255 |
256 |
256 if (clazz == Character.TYPE || clazz == Byte.TYPE || |
257 if (clazz == Character.TYPE || clazz == Byte.TYPE || |
257 clazz == Short.TYPE || clazz == Integer.TYPE) { |
258 clazz == Short.TYPE || clazz == Integer.TYPE) { |
258 il.append(I2D); |
259 il.append(I2D); |