comparison src/share/vm/classfile/classFileParser.cpp @ 14292:2e7b5143763f

8028553: The JVM should not throw VerifyError when 'overriding' a static final method in a superclass. Summary: Check if method is static before throwing exception. Reviewed-by: kamg, coleenp, lfoltan, fparain
author hseigel
date Fri, 24 Jan 2014 08:13:42 -0500
parents 715bc50198c1
children 4802ce6fbff6
comparison
equal deleted inserted replaced
14290:d050fbf914d8 14292:2e7b5143763f
1 /* 1 /*
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
4502 super_m = InstanceKlass::cast(k)->lookup_method(name, signature); 4502 super_m = InstanceKlass::cast(k)->lookup_method(name, signature);
4503 if (super_m == NULL) { 4503 if (super_m == NULL) {
4504 break; // didn't find any match; get out 4504 break; // didn't find any match; get out
4505 } 4505 }
4506 4506
4507 if (super_m->is_final() && 4507 if (super_m->is_final() && !super_m->is_static() &&
4508 // matching method in super is final 4508 // matching method in super is final, and not static
4509 (Reflection::verify_field_access(this_klass(), 4509 (Reflection::verify_field_access(this_klass(),
4510 super_m->method_holder(), 4510 super_m->method_holder(),
4511 super_m->method_holder(), 4511 super_m->method_holder(),
4512 super_m->access_flags(), false)) 4512 super_m->access_flags(), false))
4513 // this class can access super final method and therefore override 4513 // this class can access super final method and therefore override