catch a type error when range gets empty

make the initial comment more clear


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@147 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 22fd0b83e6
commit 94bcccd2f5
  1. 11
      jode/jode/type/ClassInterfacesType.java

@ -29,8 +29,8 @@ import java.util.Stack;
* type must extend and which interfaces it must implement.
*
* If this is the top boundary, this gives all interfaces and classes
* that may extend the type. I.e. the type may be one of the
* interfaces or the class type or any of their super types.
* that may extend the type. I.e. at least one interface or class extends
* the searched type.
*
* @author Jochen Hoenicke */
public class ClassInterfacesType extends Type {
@ -156,7 +156,12 @@ public class ClassInterfacesType extends Type {
ifaces[count++] = (this.ifaces[j]);
}
if (count < ifaces.length) {
if (clazz == null && count == 0) {
/* There are no more possible interfaces or classes left.
* This is a type error.
*/
return tError;
} else if (count < ifaces.length) {
ClassInfo[] shortIfaces = new ClassInfo[count];
System.arraycopy(ifaces, 0, shortIfaces, 0, count);
ifaces = shortIfaces;

Loading…
Cancel
Save