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.

BUG: Passing in existing state for a field of type double is not working

See original GitHub issue

In C# see below:

//update the initial state before calling dialog
var state = new MyDialog();

state.StringItem = someString; //this string gets copied into the called dialog
state.StringItem2 = someString2; //this string gets copied into the called dialog
state.DoubleItem = doubleVal; //this double DOES NOT get copied into the called dialog and i am prompted to enter it in the dialog

context.Call(new FormDialog<MyDialog>(state, MyDialog.BuildForm, options: FormOptions.PromptInStart), null);

neither of the following assignment substitutions work either:

state.DoubleItem = 99; //doesn't work
state.DoubleItem = 99d; //nor does this

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
chrimc62commented, Apr 15, 2016

This is by design. We have no idea whether or not there is a value in your field–how do we know 0.0 is no value, but 1.0 is a value? If you change your double to be a nullable field then we can distinguish and it will be skipped if you supply a value.

0reactions
rodzillarrcommented, Apr 15, 2016

I figured it out right when you posted your reply and after hunting down that chunk of code. Changed my field from a double to a double? and naturally it works. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

BUG: Passing in existing state for a field of type double is not ...
I believe this is a different issue. The logic to skip fields with existing state is getting called but it's not handling Doubles....
Read more >
Bug descriptions — spotbugs 4.7.3 documentation
This document lists the standard bug patterns reported by SpotBugs. ... As most comparators have little or no state, making them serializable is...
Read more >
Eclipse error ... cannot be resolved to a type - Stack Overflow
I have a dynamic web project that I am working on to migrate a jsp/servlet app from JRun to Tomcat ...
Read more >
Fixing common type problems - Dart programming language
Common type issues you may have and how to fix them.
Read more >
Bug Patterns - Error Prone
A constructor cannot have two @Assisted parameters of the same type unless they are disambiguated with named @Assisted annotations. GuiceInjectOnFinalField
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