From 9139e008abe30b7beaf4afd6533228a1dd9b202c Mon Sep 17 00:00:00 2001 From: Alex Light Date: Fri, 9 Oct 2015 15:59:48 -0700 Subject: Correct exception behavior for default methods Default methods are defined to throw an IncompatibleClassChangeError (ICCE) when they are called and there is no "best" implementation. Previously we would simply throw an ICCE during class loading as soon as we noticed that this would happen if called. This makes us wait until we actually attempt to execute the method. Furthermore, this allows us to use other, non-conflicting, methods on the object as normal. Furthermore, this makes us correctly throw AbstractMethodErrors in cases where all default implementations of a method are overridden by abstract declarations. Adds 3 tests for this new behavior. Bug: 24618811 Change-Id: Id891958a81f9b3862b2ce5919636aabef7d3422e --- test/utils/python/testgen/mixins.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/utils/python/testgen/mixins.py') diff --git a/test/utils/python/testgen/mixins.py b/test/utils/python/testgen/mixins.py index 085e51def2..aa8943baf3 100644 --- a/test/utils/python/testgen/mixins.py +++ b/test/utils/python/testgen/mixins.py @@ -79,6 +79,12 @@ class SmaliFileMixin(get_file_extension_mixin(".smali")): """ pass +class JavaFileMixin(get_file_extension_mixin(".java")): + """ + A mixin that defines that the file this class belongs to is get_name() + ".java". + """ + pass + class NameComparableMixin(object): """ A mixin that defines the object comparison and related functionality in terms -- cgit v1.2.3-59-g8ed1b