Skip to content
This repository was archived by the owner on Jul 6, 2026. It is now read-only.
Merged
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
15 changes: 13 additions & 2 deletions src/Xamarin.Android.Tools.Bytecode/XmlClassDeclarationBuilder.cs
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Xml.Linq;
using System.Text;
Expand DownExpand Up@@ -443,9 +444,19 @@ static XAttribute GetValue (FieldInfo field)
else if (Double.IsPositiveInfinity (doubleItem.Value))
value = "(1.0 / 0.0)";
else
value = doubleItem.Value.ToString ("R");
value = doubleItem.Value.ToString ("R", CultureInfo.InvariantCulture);
break;
case ConstantPoolItemType.Float:
var floatItem = (ConstantPoolFloatItem) constant;
if (Double.IsNaN (floatItem.Value))
value = "(0.0f / 0.0f)";
else if (Double.IsNegativeInfinity (floatItem.Value))
value = "(-1.0f / 0.0f)";
else if (Double.IsPositiveInfinity (floatItem.Value))
value = "(1.0f / 0.0f)";
else
value = floatItem.Value.ToString ("R", CultureInfo.InvariantCulture);
break;
case ConstantPoolItemType.Float: value = ((ConstantPoolFloatItem)constant).Value.ToString ("R"); break;
case ConstantPoolItemType.Long: value = ((ConstantPoolLongItem) constant).Value.ToString (); break;
case ConstantPoolItemType.Integer:
if (field.Descriptor == "Z")
Expand Down