elementType = "L" + elementType.replace('.', '/') + ";"; return new ClassName(new String(dimType) + elementType); return new ClassName(name.substring(-dim)); else if (type == 'L') return new ClassName(name.substring(-dim + 1, name.length() - 1).replace('/', '.')); else if (type == TypeTag.DOUBLE.decodedName) return TypeTag.DOUBLE;
/** * @param dim array dimension. It may be negative. */ public TypeData getArrayType(int dim) throws NotFoundException { if (this == TypeTag.TOP) return this; else if (dim < 0) throw new NotFoundException("no element type: " + name); else if (dim == 0) return this; else { char[] name = new char[dim + 1]; for (int i = 0; i < dim; i++) name[i] = '['; name[dim] = decodedName; return new ClassName(new String(name)); } }
switch (descriptor.charAt(top)) { case '[' : types[index] = new TypeData.ClassName(descriptor.substring(top)); break; case 'L' : types[index] = new TypeData.ClassName(getFieldClassName(descriptor, top)); break; case 'J' :
/** * @param dim array dimension. It may be negative. */ @Override public TypeData getArrayType(int dim) throws NotFoundException { if (this == TypeTag.TOP) return this; else if (dim < 0) throw new NotFoundException("no element type: " + name); else if (dim == 0) return this; else { char[] name = new char[dim + 1]; for (int i = 0; i < dim; i++) name[i] = '['; name[dim] = decodedName; return new ClassName(new String(name)); } }
locals[0] = new TypeData.UninitThis(className); else if (!isStatic) locals[0] = new TypeData.ClassName(className);
stackTypes[s] = new TypeData.ClassName(type); return 2;
int i2 = desc.indexOf(';', ++i); if (arrayDim > 0) types[n] = new TypeData.ClassName(desc.substring(i0, ++i2)); else types[n] = new TypeData.ClassName(desc.substring(i0 + 1, ++i2 - 1) .replace('/', '.')); return i2; types[n] = new TypeData.ClassName(desc.substring(i0, ++i)); return i;
private TypeData.ClassName toExceptionType(int exceptionType) { String type; if (exceptionType == 0) // for finally clauses type= "java.lang.Throwable"; else type = cpool.getClassInfo(exceptionType); return new TypeData.ClassName(type); }
private int doMultiANewArray(int pos, byte[] code) { int i = ByteArray.readU16bit(code, pos + 1); int dim = code[pos + 3] & 0xff; stackTop -= dim - 1; String type = cpool.getClassInfo(i).replace('.', '/'); stackTypes[stackTop - 1] = new TypeData.ClassName(type); return 4; }
private void doLDC(int index) { TypeData[] stackTypes = this.stackTypes; int tag = cpool.getTag(index); if (tag == ConstPool.CONST_String) stackTypes[stackTop++] = new TypeData.ClassName("java.lang.String"); else if (tag == ConstPool.CONST_Integer) stackTypes[stackTop++] = INTEGER; else if (tag == ConstPool.CONST_Float) stackTypes[stackTop++] = FLOAT; else if (tag == ConstPool.CONST_Long) { stackTypes[stackTop++] = LONG; stackTypes[stackTop++] = TOP; } else if (tag == ConstPool.CONST_Double) { stackTypes[stackTop++] = DOUBLE; stackTypes[stackTop++] = TOP; } else if (tag == ConstPool.CONST_Class) stackTypes[stackTop++] = new TypeData.ClassName("java.lang.Class"); else throw new RuntimeException("bad LDC: " + tag); }
@Override public TypeData getArrayType(int dim) throws NotFoundException { if (dim == 0) return this; BasicType bt = isBasicType(); if (bt == null) if (isNullType()) return new NullType(); else return new ClassName(getName()).getArrayType(dim); return bt.getArrayType(dim); }
@Override public TypeData join() { if (initialized) return new TypeVar(new ClassName(getName())); return new UninitTypeVar(copy()); }
static TypeData make(TypeData element) throws BadBytecode { if (element instanceof ArrayElement) return ((ArrayElement)element).arrayType(); else if (element instanceof AbsTypeVar) return new ArrayType((AbsTypeVar)element); else if (element instanceof ClassName) if (!element.isNullType()) return new ClassName(typeName(element.getName())); throw new BadBytecode("bad AASTORE: " + element); }
public static TypeData make(TypeData array) throws BadBytecode { if (array instanceof ArrayType) return ((ArrayType)array).elementType(); else if (array instanceof AbsTypeVar) return new ArrayElement((AbsTypeVar)array); else if (array instanceof ClassName) if (!array.isNullType()) return new ClassName(typeName(array.getName())); throw new BadBytecode("bad AASTORE: " + array); }
public TypeData getArrayType(int dim) throws NotFoundException { if (dim == 0) return this; else { BasicType bt = isBasicType(); if (bt == null) if (isNullType()) return new NullType(); else return new ClassName(getName()).getArrayType(dim); else return bt.getArrayType(dim); } }
private TypeData.ClassName toExceptionType(int exceptionType) { String type; if (exceptionType == 0) // for finally clauses type= "java.lang.Throwable"; else type = cpool.getClassInfo(exceptionType); return new TypeData.ClassName(type); }
private int doMultiANewArray(int pos, byte[] code) { int i = ByteArray.readU16bit(code, pos + 1); int dim = code[pos + 3] & 0xff; stackTop -= dim - 1; String type = cpool.getClassInfo(i).replace('.', '/'); stackTypes[stackTop - 1] = new TypeData.ClassName(type); return 4; }
public TypeData join() { if (initialized) return new TypeVar(new ClassName(getName())); else return new UninitTypeVar(copy()); }
static TypeData make(TypeData element) throws BadBytecode { if (element instanceof ArrayElement) return ((ArrayElement)element).arrayType(); else if (element instanceof AbsTypeVar) return new ArrayType((AbsTypeVar)element); else if (element instanceof ClassName) if (!element.isNullType()) return new ClassName(typeName(element.getName())); throw new BadBytecode("bad AASTORE: " + element); }
public static TypeData make(TypeData array) throws BadBytecode { if (array instanceof ArrayType) return ((ArrayType)array).elementType(); else if (array instanceof AbsTypeVar) return new ArrayElement((AbsTypeVar)array); else if (array instanceof ClassName) if (!array.isNullType()) return new ClassName(typeName(array.getName())); throw new BadBytecode("bad AASTORE: " + array); }