--- old/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/LDC2_W.java 2017-08-08 16:05:47.859133956 -0700 +++ new/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/LDC2_W.java 2017-08-08 16:05:47.775129750 -0700 @@ -20,63 +20,68 @@ package com.sun.org.apache.bcel.internal.generic; - /** * LDC2_W - Push long or double from constant pool * *
Stack: ... -> ..., item.word1, item.word2
* - * @author M. Dahm + * @version $Id: LDC2_W.java 1749603 2016-06-21 20:50:19Z ggregory $ */ -public class LDC2_W extends CPInstruction - implements PushInstruction, TypedInstruction { - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - LDC2_W() {} - - public LDC2_W(int index) { - super(com.sun.org.apache.bcel.internal.Constants.LDC2_W, index); - } - - public Type getType(ConstantPoolGen cpg) { - switch(cpg.getConstantPool().getConstant(index).getTag()) { - case com.sun.org.apache.bcel.internal.Constants.CONSTANT_Long: return Type.LONG; - case com.sun.org.apache.bcel.internal.Constants.CONSTANT_Double: return Type.DOUBLE; - default: // Never reached - throw new RuntimeException("Unknown constant type " + opcode); +public class LDC2_W extends CPInstruction implements PushInstruction { + + /** + * Empty constructor needed for the Class.newInstance() statement in + * Instruction.readInstruction(). Not to be used otherwise. + */ + LDC2_W() { + } + + + public LDC2_W(final int index) { + super(com.sun.org.apache.bcel.internal.Const.LDC2_W, index); + } + + + @Override + public Type getType( final ConstantPoolGen cpg ) { + switch (cpg.getConstantPool().getConstant(super.getIndex()).getTag()) { + case com.sun.org.apache.bcel.internal.Const.CONSTANT_Long: + return Type.LONG; + case com.sun.org.apache.bcel.internal.Const.CONSTANT_Double: + return Type.DOUBLE; + default: // Never reached + throw new RuntimeException("Unknown constant type " + super.getOpcode()); + } + } + + + public Number getValue( final ConstantPoolGen cpg ) { + final com.sun.org.apache.bcel.internal.classfile.Constant c = cpg.getConstantPool().getConstant(super.getIndex()); + switch (c.getTag()) { + case com.sun.org.apache.bcel.internal.Const.CONSTANT_Long: + return Long.valueOf(((com.sun.org.apache.bcel.internal.classfile.ConstantLong) c).getBytes()); + case com.sun.org.apache.bcel.internal.Const.CONSTANT_Double: + return new Double(((com.sun.org.apache.bcel.internal.classfile.ConstantDouble) c).getBytes()); + default: // Never reached + throw new RuntimeException("Unknown or invalid constant type at " + super.getIndex()); + } } - } - public Number getValue(ConstantPoolGen cpg) { - com.sun.org.apache.bcel.internal.classfile.Constant c = cpg.getConstantPool().getConstant(index); - switch(c.getTag()) { - case com.sun.org.apache.bcel.internal.Constants.CONSTANT_Long: - return Long.valueOf(((com.sun.org.apache.bcel.internal.classfile.ConstantLong)c).getBytes()); - - case com.sun.org.apache.bcel.internal.Constants.CONSTANT_Double: - return Double.valueOf(((com.sun.org.apache.bcel.internal.classfile.ConstantDouble)c).getBytes()); - - default: // Never reached - throw new RuntimeException("Unknown or invalid constant type at " + index); - } - } - - /** - * Call corresponding visitor method(s). The order is: - * Call visitor methods of implemented interfaces first, then - * call methods according to the class hierarchy in descending order, - * i.e., the most specific visitXXX() call comes last. - * - * @param v Visitor object - */ - public void accept(Visitor v) { - v.visitStackProducer(this); - v.visitPushInstruction(this); - v.visitTypedInstruction(this); - v.visitCPInstruction(this); - v.visitLDC2_W(this); - } + /** + * Call corresponding visitor method(s). The order is: + * Call visitor methods of implemented interfaces first, then + * call methods according to the class hierarchy in descending order, + * i.e., the most specific visitXXX() call comes last. + * + * @param v Visitor object + */ + @Override + public void accept( final Visitor v ) { + v.visitStackProducer(this); + v.visitPushInstruction(this); + v.visitTypedInstruction(this); + v.visitCPInstruction(this); + v.visitLDC2_W(this); + } }