Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-server
Commits
d2946ed0
Commit
d2946ed0
authored
3 years ago
by
Florian Spreckelsen
Browse files
Options
Downloads
Plain Diff
Merge branch 'f-nan-in-lists' into 'dev'
F nan in lists See merge request
!32
parents
9d51e956
3a8d8d9b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!41
REL: update changelog, bump version of pom.xml, update DEPENDENCIES
,
!32
F nan in lists
Pipeline
#13654
failed
3 years ago
Stage: setup
Stage: test
Stage: deploy
Changes
2
Pipelines
8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+2
-0
2 additions, 0 deletions
CHANGELOG.md
src/main/java/org/caosdb/server/datatype/DoubleDatatype.java
+9
-6
9 additions, 6 deletions
src/main/java/org/caosdb/server/datatype/DoubleDatatype.java
with
11 additions
and
6 deletions
CHANGELOG.md
+
2
−
0
View file @
d2946ed0
...
...
@@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
*
#127 "nan" as value (list item) in properties with data type "LIST
<DOUBLE>
"
return with "Cannot parse value to double" error.
*
#170 Updating an abstract list-type property with a default value fails with
"unkown error".
*
#145 Documentation of importances and inheritance
...
...
This diff is collapsed.
Click to expand it.
src/main/java/org/caosdb/server/datatype/DoubleDatatype.java
+
9
−
6
View file @
d2946ed0
...
...
@@ -33,16 +33,19 @@ public class DoubleDatatype extends AbstractDatatype {
public
SingleValue
parseValue
(
final
Object
value
)
throws
Message
{
try
{
if
(
value
instanceof
GenericValue
)
{
return
new
GenericValue
(
Double
.
parseDoubl
e
(((
GenericValue
)
value
).
toDatabaseString
())
)
;
return
pars
e
(((
GenericValue
)
value
).
toDatabaseString
());
}
else
{
String
valueStr
=
value
.
toString
();
if
(
valueStr
.
toLowerCase
().
equals
(
"nan"
))
{
valueStr
=
"NaN"
;
}
return
new
GenericValue
(
Double
.
parseDouble
(
valueStr
));
return
parse
(
value
.
toString
());
}
}
catch
(
final
NumberFormatException
e
)
{
throw
ServerMessages
.
CANNOT_PARSE_DOUBLE_VALUE
;
}
}
private
GenericValue
parse
(
String
valueStr
)
{
if
(
valueStr
.
toLowerCase
().
equals
(
"nan"
))
{
valueStr
=
"NaN"
;
}
return
new
GenericValue
(
Double
.
parseDouble
(
valueStr
));
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment