Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 1905 [details]
.jar binding doesn't like binding constant fields that have embedded newlines.
To reproduce, bind json-org.jar from:
Or see the conveniently attached project. ;-)
The problem is that there are two fixups that are required in order to bind json-org.jar; from Transforms\Metadata.xml:
> <remove-node path="/api/package[@name='org.json']/class[@name='HTTP']/field[@name='CRLF']" />
> <remove-node path="/api/package[@name='org.json']/class[@name='Test.1Obj']" />
We can't bind the HTTP.CRLF field, because it has an embedded newline in it. This causes `generator` to produce:
public const string Crlf = "
which makes the C# compiler angry. We should instead generate:
public const string Crlf = "\u000d\u000a";
(We should probably unicode-encode any character outside the range 0x20 through 0x7f as well, though this might also break surrogate pairs...or can \uXXXX\uYYYY be used to do surrogate pairs properly?)
The second problem is the org.json.Test.1Obj class, which can't be bound because it starts with a number. Firstly, it shouldn't be bound (it's not public!). Secondly, any type that starts with a number should just be skipped, not bound.
String literal part is fixed.
Numeric class issue also fixed.