Bug 5421 - generator: ArgumentOutOfRangeException when binding .jar
Summary: generator: ArgumentOutOfRangeException when binding .jar
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: Tools and Addins ()
Version: 4.2.x
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Atsushi Eno
URL:
Depends on:
Blocks:
 
Reported: 2012-05-30 15:22 UTC by Jonathan Pryor
Modified: 2012-06-01 02:29 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:
Status:
RESOLVED FIXED

Description Jonathan Pryor 2012-05-30 15:22:56 UTC
If an API description has a method declaration such as:

> <method abstract="false" deprecated="not deprecated" final="false" name="dump" native="false" return="java.util.List&lt;java.util.Map&lt;java.lang.String, java.lang.Object&gt;&gt;" static="false" synchronized="false" visibility="public">
> </method>

`generator` will crash when generating the source:

> Unhandled Exception: System.ArgumentOutOfRangeException: Cannot be negative.
> Parameter name: length
>   at System.String.Substring (Int32 startIndex, Int32 length) [0x00000] in <filename unknown>:0 
>   at MonoDroid.Generation.CodeGenerationOptions.GetOutputName (System.String s) [0x00000] in <filename unknown>:0 
>   at MonoDroid.Generation.CodeGenerationOptions.<GetOutputName>m__1F (System.String tp) [0x00000] in <filename unknown>:0 
>   at System.Linq.Enumerable+<CreateSelectIterator>c__Iterator27`2[System.String,System.String].MoveNext () [0x00000] in <filename unknown>:0 
>   at System.String.Join (System.String separator, IEnumerable`1 values) [0x00000] in <filename unknown>:0 
>   at MonoDroid.Generation.CodeGenerationOptions.GetOutputName (System.String s) [0x00000] in <filename unknown>:0 
>   at MonoDroid.Generation.CollectionSymbol.GetManagedTypeName (MonoDroid.Generation.CodeGenerationOptions opt) [0x00000] in <filename unknown>:0 
>   at MonoDroid.Generation.CollectionSymbol.ToNative (MonoDroid.Generation.CodeGenerationOptions opt, System.String varname) [0x00000] in <filename unknown>:0 
>   at MonoDroid.Generation.ReturnValue.ToNative (MonoDroid.Generation.CodeGenerationOptions opt, System.String var_name) [0x00000] in <filename unknown>:0 
>   at MonoDroid.Generation.Method.GenerateCallback (System.IO.StreamWriter sw, System.String indent, MonoDroid.Generation.CodeGenerationOptions opt, MonoDroid.Generation.GenBase type, System.String property_name, Boolean as_formatted) [0x00000] in <filename unknown>:0 

Context: http://lists.ximian.com/pipermail/monodroid/2012-May/010581.html
Comment 2 Atsushi Eno 2012-06-01 02:29:28 UTC
Fixed.