Fix incorrect IncompatibleClassChangeError in ClassInfo.getDefaultMethod (#7)
[jpf-core.git] / src / main / gov / nasa / jpf / vm / ClassInfo.java
index d26abeda060b94d8053569a4a392188c26245035..d9e5331835833c8f8e7635daf78b2f584eca2de3 100644 (file)
@@ -1095,7 +1095,7 @@ public class ClassInfo extends InfoObject implements Iterable<MethodInfo>, Gener
       for (ClassInfo ciIfc : ci.interfaces){
         MethodInfo miIfc = ciIfc.getMethod(uniqueName, true);
         if (miIfc != null && !miIfc.isAbstract()){
-          if (mi != null){
+          if (mi != null && !mi.equals(miIfc)){
             // this has to throw a IncompatibleClassChangeError in the client since Java prohibits ambiguous default methods
             String msg = "Conflicting default methods: " + mi.getFullName() + ", " + miIfc.getFullName();
             throw new ClassChangeException(msg);