question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

argument has type java.lang.Double, got java.lang.Integer

See original GitHub issue

Hi there,

I try to parse some objects from an PHP-JSON-API.

In my Kotlin class I have val workingPriceNetto: Double,

But the json could hold 0 as well - 0. seems to be not possible with PHP (unless its a string “0.00”)

The parser should handle a 0 value as a Double

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
cbeustcommented, Dec 25, 2018

Good point, fixed.

1reaction
cbeustcommented, Sep 10, 2018

Right, make it an Any and type check it at runtime…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Provided id of the wrong type for class . Expected: class java ...
Have a look at definition of your repository. Does it have right generic type? do you have Integer as second parameter?
Read more >
Double (Java Platform SE 8 ) - Oracle Help Center
The Double class wraps a value of the primitive type double in an object. An object of type Double contains a single field...
Read more >
Calling Java from Kotlin
Note that a boxed primitive type used as a type parameter is mapped to a platform type: for example, List<java.lang.Integer> becomes a List<Int!>...
Read more >
Data types that map to database data types in Java applications
Mappings of Java data types to data server data types for updating database ... BigDecimal, long, int, short, byte, float, double, boolean, java.lang.String....
Read more >
Java Programming Tutorial on Generics
In generics, instead of passing arguments, we pass type information inside the angle brackets <> . ... Integer cannot be cast to class...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found