diff options
author | acorn <none@none> | 2013-10-07 12:20:28 -0400 |
---|---|---|
committer | acorn <none@none> | 2013-10-07 12:20:28 -0400 |
commit | 49544dafdd77e683822d4c566f0a9ff245f244e6 (patch) | |
tree | 42059d5e70d88c55c0af82277e5e036312ed78f3 /src/share/vm/runtime/reflectionUtils.cpp | |
parent | 92cff8aba570bfa3cf399ada3520db36e755ab66 (diff) | |
download | jdk8u_hotspot-49544dafdd77e683822d4c566f0a9ff245f244e6.tar.gz |
8009130: Lambda: Fix access controls, loader constraints.
Summary: New default methods list with inherited superinterface methods
Reviewed-by: minqi, sspitsyn, coleenp
Diffstat (limited to 'src/share/vm/runtime/reflectionUtils.cpp')
-rw-r--r-- | src/share/vm/runtime/reflectionUtils.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/share/vm/runtime/reflectionUtils.cpp b/src/share/vm/runtime/reflectionUtils.cpp index 9fcf966b9..2ec82abc9 100644 --- a/src/share/vm/runtime/reflectionUtils.cpp +++ b/src/share/vm/runtime/reflectionUtils.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,8 +27,11 @@ #include "memory/universe.inline.hpp" #include "runtime/reflectionUtils.hpp" -KlassStream::KlassStream(instanceKlassHandle klass, bool local_only, bool classes_only) { - _klass = klass; +KlassStream::KlassStream(instanceKlassHandle klass, bool local_only, + bool classes_only, bool walk_defaults) { + _klass = _base_klass = klass; + _base_class_search_defaults = false; + _defaults_checked = false; if (classes_only) { _interfaces = Universe::the_empty_klass_array(); } else { @@ -37,6 +40,7 @@ KlassStream::KlassStream(instanceKlassHandle klass, bool local_only, bool classe _interface_index = _interfaces->length(); _local_only = local_only; _classes_only = classes_only; + _walk_defaults = walk_defaults; } bool KlassStream::eos() { @@ -45,7 +49,13 @@ bool KlassStream::eos() { if (!_klass->is_interface() && _klass->super() != NULL) { // go up superclass chain (not for interfaces) _klass = _klass->super(); + // Next for method walks, walk default methods + } else if (_walk_defaults && (_defaults_checked == false) && (_base_klass->default_methods() != NULL)) { + _base_class_search_defaults = true; + _klass = _base_klass; + _defaults_checked = true; } else { + // Next walk transitive interfaces if (_interface_index > 0) { _klass = _interfaces->at(--_interface_index); } else { |