Mercurial > hg > graal-compiler
comparison src/share/vm/classfile/classFileParser.cpp @ 17640:4638c4d7ff10 hs25.20-b02
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 | 19146c82b6fc |
children | 9acf9c25774d |
comparison
equal
deleted
inserted
replaced
17639:7b35e546ba31 | 17640:4638c4d7ff10 |
---|---|
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. |
4498 super_m = InstanceKlass::cast(k)->lookup_method(name, signature); | 4498 super_m = InstanceKlass::cast(k)->lookup_method(name, signature); |
4499 if (super_m == NULL) { | 4499 if (super_m == NULL) { |
4500 break; // didn't find any match; get out | 4500 break; // didn't find any match; get out |
4501 } | 4501 } |
4502 | 4502 |
4503 if (super_m->is_final() && | 4503 if (super_m->is_final() && !super_m->is_static() && |
4504 // matching method in super is final | 4504 // matching method in super is final, and not static |
4505 (Reflection::verify_field_access(this_klass(), | 4505 (Reflection::verify_field_access(this_klass(), |
4506 super_m->method_holder(), | 4506 super_m->method_holder(), |
4507 super_m->method_holder(), | 4507 super_m->method_holder(), |
4508 super_m->access_flags(), false)) | 4508 super_m->access_flags(), false)) |
4509 // this class can access super final method and therefore override | 4509 // this class can access super final method and therefore override |