Skip to content

[Java.Interop.Tools.JavaCallableWrappers] NRT Support #1012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#nullable enable

using System;

using Mono.Cecil;
Expand All @@ -10,9 +12,9 @@ namespace Android.Runtime {
#endif // !JCW_ONLY_TYPE_NAMES
sealed class RegisterAttribute : Attribute, Java.Interop.IJniNameProviderAttribute {

string connector;
string? connector;
string name;
string signature;
string? signature;

public RegisterAttribute (string name)
{
Expand All @@ -26,22 +28,22 @@ public RegisterAttribute (string name, string signature, string connector)
this.signature = signature;
}
#if HAVE_CECIL
public RegisterAttribute (string name, CustomAttribute originAttribute)
public RegisterAttribute (string name, CustomAttribute? originAttribute)
: this (name)
{
OriginAttribute = originAttribute;
}

public RegisterAttribute (string name, string signature, string connector, CustomAttribute originAttribute)
public RegisterAttribute (string name, string signature, string connector, CustomAttribute? originAttribute)
: this (name, signature, connector)
{
OriginAttribute = originAttribute;
}

public CustomAttribute OriginAttribute { get; }
public CustomAttribute? OriginAttribute { get; }
#endif // HAVE_CECIL

public string Connector {
public string? Connector {
get { return connector; }
set { connector = value; }
}
Expand All @@ -51,7 +53,7 @@ public string Name {
set { name = value; }
}

public string Signature {
public string? Signature {
get { return signature; }
set { signature = value; }
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#nullable enable

using System;

namespace Java.Interop {
Expand All @@ -15,15 +17,15 @@ public ExportAttribute ()
{
}

public ExportAttribute (string name)
public ExportAttribute (string? name)
{
Name = name;
}

public string Name {get; private set;}
public string SuperArgumentsString {get; set;}
public Type [] Throws {get; set;}
internal string [] ThrownNames {get; set;} // msbuild internal use
public string? Name {get; private set;}
public string? SuperArgumentsString {get; set;}
public Type []? Throws {get; set;}
internal string []? ThrownNames {get; set;} // msbuild internal use
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ namespace Java.Interop.Tools.Diagnostics {
//

public static class Diagnostic {
public static void Error (int code, SequencePoint location, string message, params object[] args)
public static void Error (int code, SequencePoint? location, string message, params object[] args)
{
throw new XamarinAndroidException (code, message, args) {
Location = location,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<LangVersion>8.0</LangVersion>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\product.snk</AssemblyOriginatorKeyFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public static class IdentifierValidator
// We use [^ ...] to detect any character that is NOT a match.
static Regex validIdentifier = new Regex ($"[^{Identifier}]", RegexOptions.Compiled);

public static string CreateValidIdentifier (string identifier, bool useEncodedReplacements = false)
public static string CreateValidIdentifier (string? identifier, bool useEncodedReplacements = false)
{
if (string.IsNullOrWhiteSpace (identifier)) return string.Empty;
if (identifier == null || string.IsNullOrWhiteSpace (identifier)) return string.Empty;

var normalizedIdentifier = identifier.Normalize ();

Expand Down
Loading