Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
histream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Raphael
histream
Commits
f10c959f
Commit
f10c959f
authored
Oct 07, 2016
by
R.W.Majeed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed NPE when element concept/value is missing
parent
8dc957c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
histream-import/src/main/java/de/sekmi/histream/etl/config/Concept.java
...t/src/main/java/de/sekmi/histream/etl/config/Concept.java
+13
-9
No files found.
histream-import/src/main/java/de/sekmi/histream/etl/config/Concept.java
View file @
f10c959f
...
...
@@ -77,7 +77,6 @@ public class Concept{
String
concept
=
this
.
id
;
MapFeedback
mf
=
new
MapFeedback
();
Object
value
=
this
.
value
.
valueOf
(
map
,
row
,
mf
);
if
(
mf
.
isActionDrop
()
){
return
null
;
// ignore this fact
}
...
...
@@ -94,23 +93,28 @@ public class Concept{
unit
=
this
.
unit
.
valueOf
(
map
,
row
);
}
// TODO: use type of column this.value to infer value type
if
(
value
==
null
){
Object
val
=
null
;
if
(
this
.
value
!=
null
){
// Objects.requireNonNull(this.value, "No value for concept: "+id);
val
=
this
.
value
.
valueOf
(
map
,
row
,
mf
);
}
if
(
val
==
null
){
// no value
o
.
setValue
(
null
);
}
else
if
(
val
ue
instanceof
String
){
}
else
if
(
val
instanceof
String
){
// string
o
.
setValue
(
new
StringValue
((
String
)
val
ue
));
o
.
setValue
(
new
StringValue
((
String
)
val
));
// TODO: set unit
}
else
if
(
val
ue
instanceof
BigDecimal
){
}
else
if
(
val
instanceof
BigDecimal
){
// numeric
NumericValue
v
=
new
NumericValue
((
BigDecimal
)
val
ue
,
unit
);
NumericValue
v
=
new
NumericValue
((
BigDecimal
)
val
,
unit
);
o
.
setValue
(
v
);
}
else
if
(
val
ue
instanceof
Long
){
}
else
if
(
val
instanceof
Long
){
// numeric
NumericValue
v
=
new
NumericValue
((
Long
)
val
ue
,
unit
);
NumericValue
v
=
new
NumericValue
((
Long
)
val
,
unit
);
o
.
setValue
(
v
);
}
else
{
throw
new
ParseException
(
"Unsupported value type for concept id "
+
this
.
id
+
": "
+
val
ue
.
getClass
());
throw
new
ParseException
(
"Unsupported value type for concept id "
+
this
.
id
+
": "
+
val
.
getClass
());
}
// TODO: modifiers
...
...
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