From 1d4b54a9f6607f9f193f2fa2ded6de062228536c Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Sat, 25 Sep 2010 16:35:18 -0600 Subject: [PATCH] fix failure to add abstract virtuals to class with no declared virtuals --- src/machine.cpp | 1 + test/Misc.java | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/machine.cpp b/src/machine.cpp index 9640760fa2..4c7d26a21a 100644 --- a/src/machine.cpp +++ b/src/machine.cpp @@ -1494,6 +1494,7 @@ parseMethodTable(Thread* t, Stream& s, object class_, object pool) bool populateInterfaceVtables = false; if (declaredVirtualCount == 0 + and abstractVirtuals == 0 and (classFlags(t, class_) & ACC_INTERFACE) == 0) { if (classSuper(t, class_)) { diff --git a/test/Misc.java b/test/Misc.java index 5542ce5cfd..2bdc3396ca 100644 --- a/test/Misc.java +++ b/test/Misc.java @@ -1,4 +1,16 @@ public class Misc { + private interface Bar { + public int baz(); + } + + private static abstract class Bim implements Bar { } + + private static class Baz extends Bim { + public int baz() { + return 42; + } + } + private static int alpha; private static int beta; private static byte byte1, byte2, byte3; @@ -93,6 +105,9 @@ public class Misc { } public static void main(String[] args) { + Bim bim = new Baz(); + expect(bim.baz() == 42); + expect(queryDefault(new Object()) != null); { Foo foo = new Foo();