diff options
author | jfrijters <jfrijters> | 2013-08-06 16:11:26 +0400 |
---|---|---|
committer | jfrijters <jfrijters> | 2013-08-06 16:11:26 +0400 |
commit | 19c7daaf38a3c170da96fadb0c66fa00d9c46f4f (patch) | |
tree | 9583eba3770328b630568ffe8843631da5c262a6 | |
parent | 4424e7c316e9893a4c5475acb441d11617e82501 (diff) |
Don't add SourceFileAttribute for inner classes if the name matches the outer class.
-rw-r--r-- | openjdk/response.txt | 34 | ||||
-rw-r--r-- | runtime/DynamicTypeWrapper.cs | 7 | ||||
-rw-r--r-- | runtime/TypeWrapper.cs | 244 |
3 files changed, 210 insertions, 75 deletions
diff --git a/openjdk/response.txt b/openjdk/response.txt index 9dca1438..a09e5342 100644 --- a/openjdk/response.txt +++ b/openjdk/response.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2002-2012 Jeroen Frijters +# Copyright (C) 2002-2013 Jeroen Frijters # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages @@ -27,9 +27,9 @@ assembly.class -baseaddress:0x56000000 -remap:map.xml -exclude:exclude.lst + -resource:META-INF/MANIFEST.MF=MANIFEST.MF -resource:java/lang/uniName.dat=@OPENJDK7@/build/linux-amd64/classes/java/lang/uniName.dat - -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/META-INF/MANIFEST.MF - -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/sun/net/idn/uidna.spp + -resource:sun/net/idn/uidna.spp=@OPENJDK7@/build/linux-amd64/classes/sun/net/idn/uidna.spp ikvm/internal/*.class java/io/*.class java/lang/*.class @@ -487,7 +487,7 @@ assembly.class } { -out:IKVM.OpenJDK.XML.WebServices.dll - -baseaddress:0x58670000 + -baseaddress:0x58640000 -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/xml/internal/messaging/* -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/xml/internal/ws/* @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/glassfish/external/amx/*.class @@ -607,7 +607,7 @@ assembly.class } { -out:IKVM.OpenJDK.XML.Crypto.dll - -baseaddress:0x58BE0000 + -baseaddress:0x58BB0000 -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/org/apache/xml/internal/security/* @OPENJDK7@/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/*.class @OPENJDK7@/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/*.class @@ -643,7 +643,7 @@ assembly.class } { -out:IKVM.OpenJDK.SwingAWT.dll - -baseaddress:0x58D30000 + -baseaddress:0x58D00000 -remap:swingawt.xml -resource:META-INF/services/sun.java2d.pipe.RenderingEngine=resources/META-INF/services/sun.java2d.pipe.RenderingEngine -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/META-INF/services/sun.java2d.cmm.PCMM @@ -743,7 +743,7 @@ assembly.class } { -out:IKVM.OpenJDK.Charsets.dll - -baseaddress:0x59F30000 + -baseaddress:0x59ED0000 -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/charsets.jar/sun/nio/cs/ext/sjis0213.dat -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/charsets.jar/META-INF/services/java.nio.charset.spi.CharsetProvider @OPENJDK7@/build/linux-amd64/gensrc/sun/nio/cs/ext/*.class @@ -752,7 +752,7 @@ assembly.class } { -out:IKVM.OpenJDK.Util.dll - -baseaddress:0x5A5C0000 + -baseaddress:0x5A560000 -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/java/util/jar/pack/intrinsic.properties -recurse:resources.zip/sun/launcher/resources/* -resource:META-INF/services/java.nio.file.spi.FileSystemProvider=@OPENJDK7@/jdk/src/share/demo/nio/zipfs/src/META-INF/services/java.nio.file.spi.FileSystemProvider @@ -775,7 +775,7 @@ assembly.class } { -out:IKVM.OpenJDK.Text.dll - -baseaddress:0x5AB90000 + -baseaddress:0x5AB30000 -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/sun/text/* @OPENJDK7@/build/linux-amd64/j2re-image/lib/ext/localedata.jar @OPENJDK7@/jdk/src/share/classes/java/text/*.class @@ -787,7 +787,7 @@ assembly.class } { -out:IKVM.OpenJDK.Security.dll - -baseaddress:0x5AE00000 + -baseaddress:0x5ADA0000 -remap:security.xml sun/security/jgss/wrapper/*.class @OPENJDK7@/jdk/src/share/classes/com/sun/crypto/provider/*.class @@ -858,7 +858,7 @@ assembly.class } { -out:IKVM.OpenJDK.Management.dll - -baseaddress:0x5B610000 + -baseaddress:0x5B5B0000 com/sun/management/*.class java/lang/management/*.class sun/management/*.class @@ -892,7 +892,7 @@ assembly.class } { -out:IKVM.OpenJDK.Misc.dll - -baseaddress:0x5B970000 + -baseaddress:0x5B910000 -resource:com/sun/servicetag/resources/javase_5_swordfish.properties=@OPENJDK7@/jdk/src/share/classes/com/sun/servicetag/resources/javase_5_swordfish.properties -resource:com/sun/servicetag/resources/javase_6_swordfish.properties=@OPENJDK7@/jdk/src/share/classes/com/sun/servicetag/resources/javase_6_swordfish.properties -resource:com/sun/servicetag/resources/javase_7_swordfish.properties=@OPENJDK7@/jdk/src/share/classes/com/sun/servicetag/resources/javase_7_swordfish.properties @@ -993,7 +993,7 @@ assembly.class } { -out:IKVM.OpenJDK.Naming.dll - -baseaddress:0x5BA90000 + -baseaddress:0x5BA30000 -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/jndi/ldap/jndiprovider.properties -resource:META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor=@OPENJDK7@/jdk/src/share/classes/sun/net/spi/nameservice/dns/META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor sun/net/dns/*.class @@ -1019,7 +1019,7 @@ assembly.class } { -out:IKVM.OpenJDK.Jdbc.dll - -baseaddress:0x5BBE0000 + -baseaddress:0x5BB80000 -resource:META-INF/services/java.sql.Driver=resources/META-INF/services/java.sql.Driver -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/rowset/* -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/javax/sql/* @@ -1037,7 +1037,7 @@ assembly.class } { -out:IKVM.OpenJDK.Remoting.dll - -baseaddress:0x5BD30000 + -baseaddress:0x5BCD0000 -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/sun/rmi/* @OPENJDK7@/build/linux-amd64/classes/sun/rmi/registry/*.class @OPENJDK7@/build/linux-amd64/classes/sun/rmi/server/*.class @@ -1063,7 +1063,7 @@ assembly.class } { -out:IKVM.OpenJDK.Beans.dll - -baseaddress:0x5BE50000 + -baseaddress:0x5BDF0000 @OPENJDK7@/build/linux-amd64/impsrc/com/sun/activation/registries/*.class @OPENJDK7@/build/linux-amd64/impsrc/javax/activation/*.class @OPENJDK7@/jdk/src/share/classes/com/sun/beans/*.class @@ -1076,7 +1076,7 @@ assembly.class } { -out:IKVM.OpenJDK.Media.dll - -baseaddress:0x5BF10000 + -baseaddress:0x5BEB0000 -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/META-INF/services/javax.print.* -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/META-INF/services/javax.sound.* -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/imageio/plugins/common/iio-plugin.properties diff --git a/runtime/DynamicTypeWrapper.cs b/runtime/DynamicTypeWrapper.cs index c91a409a..4ea4a803 100644 --- a/runtime/DynamicTypeWrapper.cs +++ b/runtime/DynamicTypeWrapper.cs @@ -832,7 +832,12 @@ namespace IKVM.Internal { if (f.SourceFileAttribute != null) { - if (f.SourceFileAttribute != typeBuilder.Name + ".java") + if ((outerClassWrapper == null && f.SourceFileAttribute == typeBuilder.Name + ".java") + || (outerClassWrapper != null && f.SourceFileAttribute == outerClassWrapper.sourceFileName)) + { + // we don't need to record the name because it matches our heuristic + } + else { AttributeHelper.SetSourceFile(typeBuilder, f.SourceFileAttribute); } diff --git a/runtime/TypeWrapper.cs b/runtime/TypeWrapper.cs index ade02f85..e0aa3768 100644 --- a/runtime/TypeWrapper.cs +++ b/runtime/TypeWrapper.cs @@ -1282,6 +1282,7 @@ namespace IKVM.Internal { // note that MangleNestedTypeName() assumes that there are less than 16 special characters private const string specialCharactersString = "\\+,[]*&\u0000"; + internal const string ProxiesContainer = "__<Proxies>"; internal static string ReplaceIllegalCharacters(string name) { @@ -1374,6 +1375,41 @@ namespace IKVM.Internal } return sb.ToString(); } + + internal static string GetProxyNestedName(TypeWrapper[] interfaces) + { + System.Text.StringBuilder sb = new System.Text.StringBuilder(); + foreach (TypeWrapper tw in interfaces) + { + sb.Append(tw.Name.Length).Append('|').Append(tw.Name); + } + return TypeNameUtil.MangleNestedTypeName(sb.ToString()); + } + + internal static string GetProxyName(TypeWrapper[] interfaces) + { + return ProxiesContainer + "+" + GetProxyNestedName(interfaces); + } + } + + static class ArrayUtil + { + internal static T[] Concat<T, X>(X obj, T[] arr) + where X : T + { + T[] narr = new T[arr.Length + 1]; + narr[0] = obj; + Array.Copy(arr, 0, narr, 1, arr.Length); + return narr; + } + + internal static T[] Concat<T, X>(T[] arr, X obj) + where X : T + { + Array.Resize(ref arr, arr.Length + 1); + arr[arr.Length - 1] = obj; + return arr; + } } abstract class Annotation @@ -1553,6 +1589,21 @@ namespace IKVM.Internal return false; } + internal static bool HasObsoleteAttribute(object[] annotations) + { + if (annotations != null) + { + foreach (object[] def in annotations) + { + if (def[1].Equals("Lcli/System/ObsoleteAttribute$Annotation;")) + { + return true; + } + } + } + return false; + } + protected static object QualifyClassNames(ClassLoaderWrapper loader, object annotation) { bool copy = false; @@ -1671,6 +1722,7 @@ namespace IKVM.Internal internal const string NonVirtual = "<nonvirtual>"; internal const string Bridge = "<bridge>"; internal const string Incomplete = "<incomplete>"; + internal const string DefaultMethod = "<default>"; } internal abstract class TypeWrapper @@ -1699,7 +1751,7 @@ namespace IKVM.Internal this.name = name == null ? null : String.Intern(name); } -#if !STUB_GENERATOR +#if EMITTERS internal void EmitClassLiteral(CodeEmitter ilgen) { Debug.Assert(!this.IsPrimitive); @@ -1732,7 +1784,7 @@ namespace IKVM.Internal ilgen.Emit(OpCodes.Ldsfld, RuntimeHelperTypes.GetClassLiteralField(type)); } } -#endif // !STUB_GENERATOR +#endif // EMITTERS private Type GetClassLiteralType() { @@ -1842,7 +1894,7 @@ namespace IKVM.Internal if (classObject == null) { // DynamicTypeWrapper should haved already had SetClassObject explicitly - Debug.Assert(!(this is DynamicTypeWrapper)); + Debug.Assert(!IsDynamic); #if !FIRST_PASS java.lang.Class clazz; // note that this has to be the same check as in EmitClassLiteral @@ -2351,7 +2403,7 @@ namespace IKVM.Internal if(methods == null) { #if STATIC_COMPILER - if(!CheckMissingBaseTypes(TypeAsBaseType)) + if(IsUnloadable || !CheckMissingBaseTypes(TypeAsBaseType)) { return methods = MethodWrapper.EmptyArray; } @@ -2372,7 +2424,7 @@ namespace IKVM.Internal if(fields == null) { #if STATIC_COMPILER - if (!CheckMissingBaseTypes(TypeAsBaseType)) + if(IsUnloadable || !CheckMissingBaseTypes(TypeAsBaseType)) { return fields = FieldWrapper.EmptyArray; } @@ -2491,15 +2543,7 @@ namespace IKVM.Internal return ccl.IsEquivalentTo(wrapper.GetClassLoader()); } #endif - if (GetClassLoader() != wrapper.GetClassLoader()) - { - return false; - } -#if STATIC_COMPILER || STUB_GENERATOR - return true; -#else - return InternalsVisibleTo(wrapper); -#endif + return GetClassLoader() == wrapper.GetClassLoader(); } else { @@ -2564,6 +2608,14 @@ namespace IKVM.Internal } } + internal Type TypeAsPublicSignatureType + { + get + { + return (IsPublic ? this : GetPublicBaseTypeWrapper()).TypeAsSignatureType; + } + } + internal virtual Type TypeAsBaseType { get @@ -2835,7 +2887,7 @@ namespace IKVM.Internal } #endif -#if !STUB_GENERATOR +#if EMITTERS internal void EmitUnbox(CodeEmitter ilgen) { Debug.Assert(this.IsNonPrimitiveValueType); @@ -2970,7 +3022,7 @@ namespace IKVM.Internal ilgen.Emit_instanceof(TypeAsTBD); } } -#endif // !STUB_GENERATOR +#endif // EMITTERS // NOTE don't call this method, call MethodWrapper.Link instead internal virtual MethodBase LinkMethod(MethodWrapper mw) @@ -2984,11 +3036,11 @@ namespace IKVM.Internal return fw.GetField(); } -#if !STUB_GENERATOR +#if EMITTERS internal virtual void EmitRunClassConstructor(CodeEmitter ilgen) { } -#endif // !STUB_GENERATOR +#endif // EMITTERS internal virtual string GetGenericSignature() { @@ -3072,9 +3124,40 @@ namespace IKVM.Internal } } + private static Type[] GetInterfaces(Type type) + { +#if STATIC_COMPILER || STUB_GENERATOR + List<Type> list = new List<Type>(); + for (; type != null && !type.__IsMissing; type = type.BaseType) + { + AddInterfaces(list, type); + } + return list.ToArray(); +#else + return type.GetInterfaces(); +#endif + } + +#if STATIC_COMPILER || STUB_GENERATOR + private static void AddInterfaces(List<Type> list, Type type) + { + foreach (Type iface in type.__GetDeclaredInterfaces()) + { + if (!list.Contains(iface)) + { + list.Add(iface); + if (!iface.__IsMissing) + { + AddInterfaces(list, iface); + } + } + } + } +#endif + protected static TypeWrapper[] GetImplementedInterfacesAsTypeWrappers(Type type) { - Type[] interfaceTypes = type.GetInterfaces(); + Type[] interfaceTypes = GetInterfaces(type); TypeWrapper[] interfaces = new TypeWrapper[interfaceTypes.Length]; for (int i = 0; i < interfaceTypes.Length; i++) { @@ -3099,8 +3182,7 @@ namespace IKVM.Internal interfaces[i] = tw; if (Array.IndexOf(interfaces, twRemapped) == -1) { - Array.Resize(ref interfaces, interfaces.Length + 1); - interfaces[interfaces.Length - 1] = twRemapped; + interfaces = ArrayUtil.Concat(interfaces, twRemapped); } } } @@ -3127,7 +3209,6 @@ namespace IKVM.Internal // return the constructor used for automagic .NET serialization internal virtual MethodBase GetSerializationConstructor() { - Debug.Assert(!(this is DynamicTypeWrapper)); return this.TypeAsBaseType.GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, new Type[] { JVM.Import(typeof(System.Runtime.Serialization.SerializationInfo)), JVM.Import(typeof(System.Runtime.Serialization.StreamingContext)) }, null); } @@ -3137,6 +3218,27 @@ namespace IKVM.Internal return BaseTypeWrapper.GetSerializationConstructor(); } #endif + +#if !STATIC_COMPILER && !STUB_GENERATOR + internal virtual object GhostWrap(object obj) + { + return obj; + } + + internal virtual object GhostUnwrap(object obj) + { + return obj; + } +#endif + + internal bool IsDynamic + { +#if STUB_GENERATOR + get { return false; } +#else + get { return this is DynamicTypeWrapper; } +#endif + } } sealed class UnloadableTypeWrapper : TypeWrapper @@ -3252,7 +3354,7 @@ namespace IKVM.Internal this.customModifier = type; } -#if !STUB_GENERATOR +#if EMITTERS internal Type GetCustomModifier(TypeWrapperFactory context) { // we don't need to lock, because we're only supposed to be called while holding the finish lock @@ -3268,7 +3370,7 @@ namespace IKVM.Internal { throw new InvalidOperationException("EmitInstanceOf called on UnloadableTypeWrapper: " + Name); } -#endif // !STUB_GENERATOR +#endif // EMITTERS } sealed class PrimitiveTypeWrapper : TypeWrapper @@ -3564,6 +3666,18 @@ namespace IKVM.Internal return true; } } + +#if !STATIC_COMPILER && !STUB_GENERATOR && !FIRST_PASS + internal override object GhostWrap(object obj) + { + return type.GetMethod("Cast").Invoke(null, new object[] { obj }); + } + + internal override object GhostUnwrap(object obj) + { + return type.GetMethod("ToObject").Invoke(obj, new object[0]); + } +#endif } internal static string GetName(Type type) @@ -4045,14 +4159,14 @@ namespace IKVM.Internal invoke = (MethodInfo)mw.GetMethod(); } -#if !STUB_GENERATOR +#if EMITTERS internal override void EmitNewobj(CodeEmitter ilgen) { ilgen.Emit(OpCodes.Dup); ilgen.Emit(OpCodes.Ldvirtftn, invoke); ilgen.Emit(OpCodes.Newobj, constructor); } -#endif // !STUB_GENERATOR +#endif // EMITTERS } protected override void LazyPublishMethods() @@ -4089,7 +4203,7 @@ namespace IKVM.Internal } else { - if(method.IsSpecialName && method.Name.StartsWith("__<")) + if(method.IsSpecialName && (method.Name.StartsWith("__<", StringComparison.Ordinal) || method.Name.StartsWith(NamePrefix.DefaultMethod, StringComparison.Ordinal))) { // skip } @@ -4301,7 +4415,7 @@ namespace IKVM.Internal #endif } -#if !STUB_GENERATOR +#if EMITTERS protected override void CallImpl(CodeEmitter ilgen) { MethodBase mb = GetMethod(); @@ -4354,33 +4468,51 @@ namespace IKVM.Internal ilgen.Emit(OpCodes.Newobj, mb); } } -#endif // !STUB_GENERATOR +#endif // EMITTERS #if !STATIC_COMPILER && !FIRST_PASS && !STUB_GENERATOR [HideFromJava] - protected override object InvokeNonvirtualRemapped(object obj, object[] args) + internal override object Invoke(object obj, object[] args) + { + MethodBase mb = mbHelper != null ? mbHelper : GetMethod(); + if (mb.IsStatic && !IsStatic) + { + args = ArrayUtil.Concat(obj, args); + obj = null; + } + return InvokeAndUnwrapException(mb, obj, args); + } + + [HideFromJava] + internal override object CreateInstance(object[] args) + { + MethodBase mb = mbHelper != null ? mbHelper : GetMethod(); + if (mb.IsStatic) + { + return InvokeAndUnwrapException(mb, null, args); + } + return base.CreateInstance(args); + } + + [HideFromJava] + internal override object InvokeNonvirtualRemapped(object obj, object[] args) { - Type[] p1 = GetParametersForDefineMethod(); - Type[] argTypes = new Type[p1.Length + 1]; - p1.CopyTo(argTypes, 1); - argTypes[0] = this.DeclaringType.TypeAsSignatureType; MethodInfo mi = mbNonvirtualHelper; if (mi == null) { mi = mbHelper; } - object[] args1 = new object[args.Length + 1]; - args1[0] = obj; - args.CopyTo(args1, 1); - return mi.Invoke(null, args1); + return mi.Invoke(null, ArrayUtil.Concat(obj, args)); } +#endif // !STATIC_COMPILER && !FIRST_PASS && !STUB_GENERATOR +#if EMITTERS internal override void EmitCallvirtReflect(CodeEmitter ilgen) { MethodBase mb = mbHelper != null ? mbHelper : GetMethod(); ilgen.Emit(mb.IsStatic ? OpCodes.Call : OpCodes.Callvirt, mb); } -#endif // !STATIC_COMPILER +#endif // EMITTERS internal string GetGenericSignature() { @@ -4507,7 +4639,7 @@ namespace IKVM.Internal } } -#if !STUB_GENERATOR +#if EMITTERS internal override void EmitRunClassConstructor(CodeEmitter ilgen) { if(HasStaticInitializer) @@ -4515,7 +4647,7 @@ namespace IKVM.Internal ilgen.Emit(OpCodes.Call, clinitMethod); } } -#endif // !STUB_GENERATOR +#endif // EMITTERS internal override string GetGenericSignature() { @@ -4631,52 +4763,46 @@ namespace IKVM.Internal internal sealed class CompiledAnnotation : Annotation { - private readonly Type type; + private readonly ConstructorInfo constructor; internal CompiledAnnotation(Type type) { - this.type = type; + constructor = type.GetConstructor(new Type[] { JVM.Import(typeof(object[])) }); } - private CustomAttributeBuilder MakeCustomAttributeBuilder(object annotation) + private CustomAttributeBuilder MakeCustomAttributeBuilder(ClassLoaderWrapper loader, object annotation) { - return new CustomAttributeBuilder(type.GetConstructor(new Type[] { JVM.Import(typeof(object[])) }), new object[] { annotation }); + return new CustomAttributeBuilder(constructor, new object[] { QualifyClassNames(loader, annotation) }); } internal override void Apply(ClassLoaderWrapper loader, TypeBuilder tb, object annotation) { - annotation = QualifyClassNames(loader, annotation); - tb.SetCustomAttribute(MakeCustomAttributeBuilder(annotation)); + tb.SetCustomAttribute(MakeCustomAttributeBuilder(loader, annotation)); } internal override void Apply(ClassLoaderWrapper loader, MethodBuilder mb, object annotation) { - annotation = QualifyClassNames(loader, annotation); - mb.SetCustomAttribute(MakeCustomAttributeBuilder(annotation)); + mb.SetCustomAttribute(MakeCustomAttributeBuilder(loader, annotation)); } internal override void Apply(ClassLoaderWrapper loader, FieldBuilder fb, object annotation) { - annotation = QualifyClassNames(loader, annotation); - fb.SetCustomAttribute(MakeCustomAttributeBuilder(annotation)); + fb.SetCustomAttribute(MakeCustomAttributeBuilder(loader, annotation)); } internal override void Apply(ClassLoaderWrapper loader, ParameterBuilder pb, object annotation) { - annotation = QualifyClassNames(loader, annotation); - pb.SetCustomAttribute(MakeCustomAttributeBuilder(annotation)); + pb.SetCustomAttribute(MakeCustomAttributeBuilder(loader, annotation)); } internal override void Apply(ClassLoaderWrapper loader, AssemblyBuilder ab, object annotation) { - annotation = QualifyClassNames(loader, annotation); - ab.SetCustomAttribute(MakeCustomAttributeBuilder(annotation)); + ab.SetCustomAttribute(MakeCustomAttributeBuilder(loader, annotation)); } internal override void Apply(ClassLoaderWrapper loader, PropertyBuilder pb, object annotation) { - annotation = QualifyClassNames(loader, annotation); - pb.SetCustomAttribute(MakeCustomAttributeBuilder(annotation)); + pb.SetCustomAttribute(MakeCustomAttributeBuilder(loader, annotation)); } internal override bool IsCustomAttribute @@ -4718,6 +4844,10 @@ namespace IKVM.Internal { return ((SourceFileAttribute)attr[0]).SourceFile; } + if(DeclaringTypeWrapper != null) + { + return DeclaringTypeWrapper.GetSourceFileName(); + } if(type.Module.IsDefined(typeof(SourceFileAttribute), false)) { return type.Name + ".java"; |