{"action":"closed","issue":{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/178","labels_url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/178/labels{/name}","comments_url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/178/comments","events_url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/178/events","html_url":"https://github.com/chrsmith/google-api-java-client/issues/178","id":59522508,"number":178,"title":"map empty XML attribute to null","user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars.githubusercontent.com/u/9614759?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/labels/auto-migrated","name":"auto-migrated","color":"ededed"},{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/labels/Component-XML","name":"Component-XML","color":"ededed"},{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/labels/Milestone-Version1.5.0","name":"Milestone-Version1.5.0","color":"ededed"},{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/labels/Priority-Medium","name":"Priority-Medium","color":"ededed"},{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/labels/Type-Enhancement","name":"Type-Enhancement","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-02T18:26:26Z","updated_at":"2015-03-02T18:26:27Z","closed_at":"2015-03-02T18:26:26Z","body":"```\nI have a class that maps an XML attribue to a BigDecimal.\n\npublic class SalesTaxRate\n{\n    @Key(\"@rate\")\n    public BigDecimal totalRate;\n}\n\nI don't have any control over the web service that I'm calling, but I noticed \nthat they sometimes send an empty attribute value for \"rate\" and when \ngoogle-api-java-client tries to map the empty string to a BigDecimal, a \nNumberFormatException is thrown.\n\n<response rate=\"\" />\n\nPartial stacktrace:\n\njava.lang.NumberFormatException\n\tat java.math.BigDecimal.<init>(BigDecimal.java:457)\n\tat java.math.BigDecimal.<init>(BigDecimal.java:647)\n\tat com.google.api.client.util.FieldInfo.parsePrimitiveValue(FieldInfo.java:240)...\n\nIs there a way around this problem without resorting to using String instead of \nBigDecimal?\n\nIf not, I would like to request that empty attribute values be mapped to null, \nas though the attribute wasn't present at all. Perhaps there could be an \nannotation to achieve this, if this could not be a global behavior.\n```\n\nOriginal issue reported on code.google.com by `tra...@circutus.com` on 13 Apr 2011 at 9:12"}}