[Ikvm-commit] ikvm/runtime DynamicTypeWrapper.cs,1.250,1.251
Brought to you by:
jfrijters
|
From: Jeroen F. <jfr...@us...> - 2014-06-24 08:26:15
|
Update of /cvsroot/ikvm/ikvm/runtime In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv29021 Modified Files: DynamicTypeWrapper.cs Log Message: Bug fix. Interfaces can't "override" final methods in Object. Index: DynamicTypeWrapper.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/runtime/DynamicTypeWrapper.cs,v retrieving revision 1.250 retrieving revision 1.251 diff -C2 -d -r1.250 -r1.251 *** DynamicTypeWrapper.cs 13 Jun 2014 06:54:06 -0000 1.250 --- DynamicTypeWrapper.cs 24 Jun 2014 08:26:13 -0000 1.251 *************** *** 118,124 **** this.classLoader = classLoader; this.sourceFileName = f.SourceFileAttribute; ! this.baseTypeWrapper = f.IsInterface ? null : LoadTypeWrapper(classLoader, pd, f.SuperClass); ! if (BaseTypeWrapper != null) { if (!BaseTypeWrapper.IsAccessibleFrom(this)) { --- 118,139 ---- this.classLoader = classLoader; this.sourceFileName = f.SourceFileAttribute; ! if (f.IsInterface) { + // interfaces can't "override" final methods in object + foreach (ClassFile.Method method in f.Methods) + { + MethodWrapper mw; + if (method.IsVirtual + && (mw = CoreClasses.java.lang.Object.Wrapper.GetMethodWrapper(method.Name, method.Signature, false)) != null + && mw.IsVirtual + && mw.IsFinal) + { + throw new VerifyError("class " + f.Name + " overrides final method " + method.Name + "." + method.Signature); + } + } + } + else + { + this.baseTypeWrapper = LoadTypeWrapper(classLoader, pd, f.SuperClass); if (!BaseTypeWrapper.IsAccessibleFrom(this)) { |