Skip to content

Commit 7a1bda9

Browse files
committed
[generator] bring back static methods in the public API.
We were marking interface methods too much as non-public. Static methods in the interfaces are generated in C# classes and they should remain public!
1 parent 27c9436 commit 7a1bda9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tools/generator/CodeGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@ public void WriteMethod (Method method, TextWriter writer, string indent, CodeGe
11001100
writer.WriteLine ("{0}[Register (\"{1}\", \"{2}\", \"{3}\"{4})]",
11011101
indent, method.JavaName, method.JniSignature, method.IsVirtual ? method.ConnectorName : String.Empty, method.AdditionalAttributeString ());
11021102
WriteMethodCustomAttributes (method, writer, indent);
1103-
string visibility = type.IsInterface ? string.Empty : method.Visibility;
1103+
string visibility = type.IsInterface && !method.IsStatic ? string.Empty : method.Visibility;
11041104
writer.WriteLine ("{0}{1}{2}{3}{4} unsafe {5} {6}{7} ({8})",
11051105
indent,
11061106
visibility,

tools/generator/GenBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ protected virtual bool GetEnumMappedMemberInfo ()
795795

796796
public void FixupMethodOverrides (CodeGenerationOptions opt)
797797
{
798-
foreach (Method m in methods.Where (m => !m.IsInterfaceDefaultMethod)) {
798+
foreach (Method m in methods.Where (m => !m.IsStatic && !m.IsInterfaceDefaultMethod)) {
799799
for (var bt = this.GetBaseGen (opt); bt != null; bt = bt.GetBaseGen (opt)) {
800800
var bm = bt.Methods.FirstOrDefault (mm => mm.Name == m.Name && mm.Visibility == m.Visibility && ParameterList.Equals (mm.Parameters, m.Parameters));
801801
if (bm != null && bm.RetVal.FullName == m.RetVal.FullName) { // if return type is different, it could be still "new", not "override".

0 commit comments

Comments
 (0)