Skip to content

Instantly share code, notes, and snippets.

@gvsmirnov
Created January 31, 2016 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gvsmirnov/0270f0f15f9498e3b655 to your computer and use it in GitHub Desktop.
Save gvsmirnov/0270f0f15f9498e3b655 to your computer and use it in GitHub Desktop.
Boxing Fixed
7c7
< private static volatile Double sensorValue;
---
> private static volatile double sensorValue = Double.NaN;
15,16c15,16
< private static void processSensorValue(Double value) {
< if(value != null) {
---
> private static void processSensorValue(double value) {
> if(!Double.isNaN(value)) {
33c33
< Thread sensorReader = new Thread(Boxing::readSensor);
---
> Thread sensorReader = new Thread(FixedBoxing::readSensor);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment