From 94bcccd2f51d707f6cc65738ab27a7fab8059823 Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 15 Jan 1999 10:55:53 +0000 Subject: [PATCH] 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 --- jode/jode/type/ClassInterfacesType.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/jode/jode/type/ClassInterfacesType.java b/jode/jode/type/ClassInterfacesType.java index c4cb415..21adb32 100644 --- a/jode/jode/type/ClassInterfacesType.java +++ b/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;