* allow non-virtual class methods to be declared as "final" in Java classes,

since virtual class methods are handled differently from regular ones and
    the JDK contains several (non-virtual, since Java does not support virtual
    class methods) final class methods

git-svn-id: branches/jvmbackend@18720 -
This commit is contained in:
Jonas Maebe 2011-08-20 08:27:32 +00:00
parent 7092f2957a
commit e7528bbc05

View File

@ -1374,7 +1374,9 @@ begin
if is_objectpascal_helper(tprocdef(pd).struct) and
(m_objfpc in current_settings.modeswitches) then
Message1(parser_e_not_allowed_in_helper, arraytokeninfo[_FINAL].str);
if (po_virtualmethod in pd.procoptions) then
if (po_virtualmethod in pd.procoptions) or
(is_javaclass(tprocdef(pd).struct) and
(po_classmethod in pd.procoptions)) then
include(pd.procoptions,po_finalmethod)
else
Message(parser_e_only_virtual_methods_final);