< prev index next >
src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/Type.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
--- 1,7 ----
/*
! * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
*** 28,39 ****
/**
* Abstract super class for all possible java types, namely basic types
* such as int, object types like String and array types, e.g. int[]
*
! * @version $Id$
! * @LastModified: Jun 2019
*/
public abstract class Type {
private final byte type;
private String signature; // signature for the type
--- 28,38 ----
/**
* Abstract super class for all possible java types, namely basic types
* such as int, object types like String and array types, e.g. int[]
*
! * @LastModified: Jan 2020
*/
public abstract class Type {
private final byte type;
private String signature; // signature for the type
*** 205,217 ****
// consumed_chars += dim; // update counter - is replaced by
final int _temp = unwrap(consumed_chars) + dim;
wrap(consumed_chars, _temp);
return new ArrayType(t, dim);
} else { // type == T_REFERENCE
! // Utility.signatureToString understands how to parse
! // generic types.
! final String parsedSignature = Utility.signatureToString(signature, false);
wrap(consumed_chars, parsedSignature.length() + 2); // "Lblabla;" `L' and `;' are removed
return ObjectType.getInstance(parsedSignature.replace('/', '.'));
}
}
--- 204,215 ----
// consumed_chars += dim; // update counter - is replaced by
final int _temp = unwrap(consumed_chars) + dim;
wrap(consumed_chars, _temp);
return new ArrayType(t, dim);
} else { // type == T_REFERENCE
! // Utility.typeSignatureToString understands how to parse generic types.
! final String parsedSignature = Utility.typeSignatureToString(signature, false);
wrap(consumed_chars, parsedSignature.length() + 2); // "Lblabla;" `L' and `;' are removed
return ObjectType.getInstance(parsedSignature.replace('/', '.'));
}
}
*** 240,254 ****
*/
public static Type[] getArgumentTypes( final String signature ) {
final List<Type> vec = new ArrayList<>();
int index;
Type[] types;
! try { // Read all declarations between for `(' and `)'
! if (signature.charAt(0) != '(') {
throw new ClassFormatException("Invalid method signature: " + signature);
}
- index = 1; // current string position
while (signature.charAt(index) != ')') {
vec.add(getType(signature.substring(index)));
//corrected concurrent private static field acess
index += unwrap(consumed_chars); // update position
}
--- 238,253 ----
*/
public static Type[] getArgumentTypes( final String signature ) {
final List<Type> vec = new ArrayList<>();
int index;
Type[] types;
! try {
! // Skip any type arguments to read argument declarations between `(' and `)'
! index = signature.indexOf('(') + 1;
! if (index <= 0) {
throw new ClassFormatException("Invalid method signature: " + signature);
}
while (signature.charAt(index) != ')') {
vec.add(getType(signature.substring(index)));
//corrected concurrent private static field acess
index += unwrap(consumed_chars); // update position
}
*** 342,356 ****
}
static int getArgumentTypesSize( final String signature ) {
int res = 0;
int index;
! try { // Read all declarations between for `(' and `)'
! if (signature.charAt(0) != '(') {
throw new ClassFormatException("Invalid method signature: " + signature);
}
- index = 1; // current string position
while (signature.charAt(index) != ')') {
final int coded = getTypeSize(signature.substring(index));
res += size(coded);
index += consumed(coded);
}
--- 341,356 ----
}
static int getArgumentTypesSize( final String signature ) {
int res = 0;
int index;
! try {
! // Skip any type arguments to read argument declarations between `(' and `)'
! index = signature.indexOf('(') + 1;
! if (index <= 0) {
throw new ClassFormatException("Invalid method signature: " + signature);
}
while (signature.charAt(index) != ')') {
final int coded = getTypeSize(signature.substring(index));
res += size(coded);
index += consumed(coded);
}
< prev index next >