Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Instrument Control
NomadCommandSystem
Commits
ac68e8bf
Commit
ac68e8bf
authored
Nov 14, 2016
by
ortizh
Browse files
Catch exception thrown when trying to format a invalid float value
(avoid a client crash : see brisp 03 nov 2016).
parent
af78cc13
Changes
3
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
ac68e8bf
3.0.5-SNAPSHOT
--------------
* Catch exception thrown when trying to format a invalid float value (avoid a client crash : see brisp 03 nov 2016).
3.0.4
-----
...
...
src/main/java/fr/ill/ics/core/property/Float64Property.java
View file @
ac68e8bf
...
...
@@ -29,10 +29,16 @@ public class Float64Property extends FloatProperty {
}
public
String
getServerValue
()
{
if
(
isCommandBox
)
{
return
this
.
propertyFormat
.
formatForDisplay
(
new
Double
(
AtomicCommandBoxAccessorProxy
.
getInstance
(
serverId
).
getFloat64Value
(
containerId
,
id
)).
toString
());
}
else
{
return
this
.
propertyFormat
.
formatForDisplay
(
new
Double
(
DataAccessor
.
getInstance
(
serverId
).
getFloat64Value
(
containerId
,
id
)).
toString
());
try
{
if
(
isCommandBox
)
{
return
this
.
propertyFormat
.
formatForDisplay
(
new
Double
(
AtomicCommandBoxAccessorProxy
.
getInstance
(
serverId
).
getFloat64Value
(
containerId
,
id
)).
toString
());
}
else
{
return
this
.
propertyFormat
.
formatForDisplay
(
new
Double
(
DataAccessor
.
getInstance
(
serverId
).
getFloat64Value
(
containerId
,
id
)).
toString
());
}
}
catch
(
Exception
e
)
{
System
.
err
.
println
(
"Exception while getting value for property "
+
getName
());
ConfigManager
.
CONFIGURATION_ERROR
=
true
;
return
""
;
}
}
...
...
src/main/java/fr/ill/ics/core/property/format/DecimalFormat.java
View file @
ac68e8bf
...
...
@@ -50,7 +50,12 @@ public class DecimalFormat extends PropertyFormat {
"0.000000"
,
"0.0000000"
,
"0.00000000"
,
"0.000000000"
};
"0.000000000"
,
"0.0000000000"
,
"0.00000000000"
,
"0.000000000000"
,
"0.0000000000000"
};
public
DecimalFormat
(
int
numberOfDecimalPlaces
,
boolean
isScientific
)
{
...
...
@@ -120,8 +125,6 @@ public class DecimalFormat extends PropertyFormat {
}
else
{
df
=
new
java
.
text
.
DecimalFormat
(
decimalDisplayFormats
[
nbOfDecimalPlaces
]);
}
return
df
.
format
(
valueAsDouble
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment