diff --git a/src/Xamarin.Android.Tools.Bytecode/JavaParameterNamesLoader.cs b/src/Xamarin.Android.Tools.Bytecode/JavaParameterNamesLoader.cs index 5194352cf..9f659a07a 100644 --- a/src/Xamarin.Android.Tools.Bytecode/JavaParameterNamesLoader.cs +++ b/src/Xamarin.Android.Tools.Bytecode/JavaParameterNamesLoader.cs @@ -97,7 +97,7 @@ List LoadParameterFixupDescription (string path) Name = name, Parameters = parameters.Replace (", ", "\0").Split ('\0') .Select (s => s.Split (' ')) - .Select (a => new Parameter { Type = string.Join (" ", a.Take (a.Length - 1)), Name = a.Last () }).ToList () + .Select (a => new Parameter { Type = string.Join (" ", a.Take (a.Length - 1)).Replace (",", ", "), Name = a.Last () }).ToList () }); } else { type = line.Substring (line.IndexOf (' ', 2) + 1); diff --git a/src/Xamarin.Android.Tools.Bytecode/Tests/ParameterDescription.txt b/src/Xamarin.Android.Tools.Bytecode/Tests/ParameterDescription.txt index 9c0e8c3cd..db04a6149 100644 --- a/src/Xamarin.Android.Tools.Bytecode/Tests/ParameterDescription.txt +++ b/src/Xamarin.Android.Tools.Bytecode/Tests/ParameterDescription.txt @@ -4,3 +4,7 @@ package java.util ; Anything after semicolon is comment. class Collection add(E e) #ctor() + +package com.xamarin + interface NestedInterface.DnsSdTxtRecordListener + onDnsSdTxtRecordAvailable(java.lang.String fullDomainName, java.util.Map txtRecordMap, java.lang.String srcDevice) diff --git a/src/Xamarin.Android.Tools.Bytecode/Tests/ParameterFixupFromDescriptionText.xml b/src/Xamarin.Android.Tools.Bytecode/Tests/ParameterFixupFromDescriptionText.xml new file mode 100644 index 000000000..dd18f3294 --- /dev/null +++ b/src/Xamarin.Android.Tools.Bytecode/Tests/ParameterFixupFromDescriptionText.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + diff --git a/src/Xamarin.Android.Tools.Bytecode/Tests/ParameterFixupTests.cs b/src/Xamarin.Android.Tools.Bytecode/Tests/ParameterFixupTests.cs index 4faac0120..2c2191d72 100644 --- a/src/Xamarin.Android.Tools.Bytecode/Tests/ParameterFixupTests.cs +++ b/src/Xamarin.Android.Tools.Bytecode/Tests/ParameterFixupTests.cs @@ -102,6 +102,15 @@ public void XmlDeclaration_FixedUpFromParameterDescription () if (File.Exists (tempFile)) File.Delete (tempFile); } + + try { + tempFile = LoadToTempFile ("ParameterDescription.txt"); + + AssertXmlDeclaration (new string [] { "NestedInterface$DnsSdTxtRecordListener.class" }, "ParameterFixupFromDescriptionText.xml", tempFile); + } finally { + if (File.Exists (tempFile)) + File.Delete (tempFile); + } } } } diff --git a/src/Xamarin.Android.Tools.Bytecode/Tests/Xamarin.Android.Tools.Bytecode-Tests.csproj b/src/Xamarin.Android.Tools.Bytecode/Tests/Xamarin.Android.Tools.Bytecode-Tests.csproj index 0cd24b389..ec7794584 100644 --- a/src/Xamarin.Android.Tools.Bytecode/Tests/Xamarin.Android.Tools.Bytecode-Tests.csproj +++ b/src/Xamarin.Android.Tools.Bytecode/Tests/Xamarin.Android.Tools.Bytecode-Tests.csproj @@ -57,13 +57,9 @@ - - + + + @@ -74,8 +70,8 @@ - - + + @@ -141,6 +137,9 @@ IJavaInterface.class + + NestedInterface$DnsSdTxtRecordListener.class + NonGenericGlobalType.class @@ -164,7 +163,11 @@ ParameterDescription.txt - + + + ParameterFixupFromDescriptionText.xml + + diff --git a/src/Xamarin.Android.Tools.Bytecode/Tests/java/com/xamarin/NestedInterface.java b/src/Xamarin.Android.Tools.Bytecode/Tests/java/com/xamarin/NestedInterface.java new file mode 100644 index 000000000..ecd8cdc4a --- /dev/null +++ b/src/Xamarin.Android.Tools.Bytecode/Tests/java/com/xamarin/NestedInterface.java @@ -0,0 +1,11 @@ +package com.xamarin; + +import java.util.Map; + +public class NestedInterface +{ + public interface DnsSdTxtRecordListener + { + void onDnsSdTxtRecordAvailable(String p1, Map p2, String p3); + } +}