8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass

Check if method is static before throwing exception.

Reviewed-by: kamg, coleenp, lfoltan, fparain
This commit is contained in:
Harold Seigel 2014-01-24 08:13:42 -05:00
parent 90a44b778d
commit 39f19c2f76
2 changed files with 145 additions and 3 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, 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
@ -4504,8 +4504,8 @@ void ClassFileParser::check_final_method_override(instanceKlassHandle this_klass
break; // didn't find any match; get out
}
if (super_m->is_final() &&
// matching method in super is final
if (super_m->is_final() && !super_m->is_static() &&
// matching method in super is final, and not static
(Reflection::verify_field_access(this_klass(),
super_m->method_holder(),
super_m->method_holder(),