diff --git a/src/net/JNetReflector/InternalExtensions.cs b/src/net/JNetReflector/InternalExtensions.cs index 12216d16c0..c5b1dd1d24 100644 --- a/src/net/JNetReflector/InternalExtensions.cs +++ b/src/net/JNetReflector/InternalExtensions.cs @@ -561,7 +561,9 @@ public static string JVMInterfaceName(this Java.Lang.Reflect.Type type, IList genArguments, IList> genClauses, string prefix, bool usedInGenerics, bool camel) @@ -1167,9 +1169,9 @@ public static string JVMSimpleClassName(this Class entry) public static string JVMListenerClassName(this Class entry) { var cName = entry.Name; - var packageName = (entry.Package != null && !string.IsNullOrWhiteSpace(entry.Package.Name)) ? entry.Package.Name + var packageName = (entry.Package != null && !string.IsNullOrWhiteSpace(entry.Package.Name)) ? entry.Package.Name : string.Empty; - cName = (!string.IsNullOrWhiteSpace(packageName) && cName.StartsWith(packageName)) ? cName.Remove(0, packageName.Length + 1) + cName = (!string.IsNullOrWhiteSpace(packageName) && cName.StartsWith(packageName)) ? cName.Remove(0, packageName.Length + 1) : cName; cName = cName.Replace(SpecialNames.NestedClassSeparator, SpecialNames.ListenerNestedClassSeparator); return cName; @@ -1200,7 +1202,7 @@ public static string WhereClauses(this Class entry, bool usedInGenerics, bool ca if (!IsJVMNativeType(bound.TypeName)) { string result; - if (entry.IsJVMGenericClass() && usedInGenerics + if (entry.IsJVMGenericClass() && usedInGenerics && (entry.TypeName == bound.TypeName || bound.TypeName.StartsWith(entry.TypeName))) { // force the generic class in this case @@ -1388,7 +1390,7 @@ public static string JVMBaseClassName(this Class entry, bool usedInGenerics, boo || (JNetReflectorCore.ReflectDeprecated ? false : superCls.IsDeprecated()) || superCls.MustBeAvoided() || superCls.TypeName == SpecialNames.JavaLangObject) - { + { if ((superCls == null || superCls.TypeName == SpecialNames.JavaLangObject) && entry.ContainsIterable()) { string innerName = string.Empty; @@ -2396,9 +2398,9 @@ public static bool IsReturnTypeAListener(this Method entry, bool usedInGenerics) { return entry.ReturnType.IsJVMListenerClass(); } - else if (!entry.GenericReturnType.IsGenerics()) + else if (entry.GenericReturnType.IsGenerics()) { - return true; + return entry.GenericReturnType.IsJVMListenerClass(); } return false; }