Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 64
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -107,6 +107,57 @@ internal string CalculateEventName (Func<string, bool> checkNameDuplicate) | ||
| public bool CanHaveStringOverload => IsReturnCharSequence || Parameters.HasCharSequence; | ||
| public Method Clone (GenBase declaringType) | ||
| { | ||
| var clone = new Method (declaringType); | ||
| // MethodBase | ||
| clone.Annotation = Annotation; | ||
| clone.ApiAvailableSince = ApiAvailableSince; | ||
| clone.AssemblyName = AssemblyName; | ||
| clone.Deprecated = Deprecated; | ||
| clone.DeprecatedSince = DeprecatedSince; | ||
| clone.IsAcw = IsAcw; | ||
| clone.Name = Name; | ||
| clone.Visibility = Visibility; | ||
| clone.LineNumber = LineNumber; | ||
| clone.LinePosition = LinePosition; | ||
| clone.SourceFile = SourceFile; | ||
| clone.JavadocInfo = JavadocInfo; | ||
| if (GenericArguments != null) | ||
| foreach (var ga in GenericArguments) | ||
| clone.GenericArguments.Add (ga.Clone ()); | ||
| foreach (var p in Parameters) | ||
| clone.Parameters.Add (p.Clone ()); | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While writing the draft commit message, my thoughts turn to Rephrased, I would expect that the newParameter(name:"value",type:"java.lang.Object",managedType:"Java.Lang.Object"
isEnumified: false
);but I don't see this happening. Should this be happening? Or is this instead handled by new lines 128-130 (above), wherein we added | ||
| // Method | ||
| clone.ArgsType = ArgsType; | ||
| clone.CustomAttributes = CustomAttributes; | ||
| clone.EventName = EventName; | ||
| clone.GenerateAsyncWrapper = GenerateAsyncWrapper; | ||
| clone.GenerateDispatchingSetter = GenerateDispatchingSetter; | ||
| clone.IsAbstract = IsAbstract; | ||
| clone.IsFinal = IsFinal; | ||
| clone.IsInterfaceDefaultMethod = IsInterfaceDefaultMethod; | ||
| clone.OverriddenInterfaceMethod = OverriddenInterfaceMethod; | ||
| clone.IsReturnEnumified = IsReturnEnumified; | ||
| clone.IsStatic = IsStatic; | ||
| clone.IsVirtual = IsVirtual; | ||
| clone.JavaName = JavaName; | ||
| clone.ManagedOverride = ManagedOverride; | ||
| clone.ManagedReturn = ManagedReturn; | ||
| clone.PropertyNameOverride = PropertyNameOverride; | ||
| clone.Return = Return; | ||
| clone.ReturnNotNull = ReturnNotNull; | ||
| clone.RetVal = RetVal.Clone (clone); | ||
| clone.SourceApiLevel = SourceApiLevel; | ||
| clone.ExplicitInterface = ExplicitInterface; | ||
| return clone; | ||
| } | ||
| public string ConnectorName => $"Get{Name}{IDSignature}Handler"; | ||
| public string EscapedCallbackName => IdentifierValidator.CreateValidIdentifier ($"cb_{JavaName}{IDSignature}", true); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this asserting that the method got removed?
OK, this test is asserting that we no longer NRE, that the BG8800 warning is still emitted (implicitly), that
public_classhas no methods, andbase_class.Methodsis still sane.But… shouldn't the "final" fix be a situation in which:
public_class.Methods.Countis also 1, andpublic_class.Methods[0].IsValidis true, andpublic_class.Methods[0].Parameters[0].JniTypeisjava/lang/Object?Upon review, it feels like this PR fixes the NRE, but doesn't resolve the underlying scenario allowing publicly accessible members from package-private types to be bound in the derived type.
Is that possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, this PR only fixes the NRE. It does not try to fix the underlying issue of correctly supporting generics when copying methods from a
package-privateclass. I do not believe that is a topic we want to tackle any time soon.