Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simonstrator
PeerfactSim.KOM
Commits
c31d45dd
Commit
c31d45dd
authored
Mar 15, 2021
by
Julian Zobel
🦄
Browse files
To prevent later NPEs, throw an error if the input value is null in Default Configurator
parent
bc716265
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/scenario/DefaultConfigurator.java
View file @
c31d45dd
...
...
@@ -867,10 +867,13 @@ public class DefaultConfigurator implements Configurator {
@SuppressWarnings
(
"unchecked"
)
public
static
<
T
extends
Number
>
T
parseNumber
(
String
value
,
Class
<
T
>
targetClass
)
{
assert
value
!=
null
;
//
assert value != null;
if
(
value
==
null
)
System
.
out
.
println
(
""
);
if
(
value
==
null
)
{
System
.
out
.
println
(
targetClass
);
throw
new
UnsupportedOperationException
(
"[DefaultConfigurator]: value cannot be null! "
);
}
String
number
=
value
;
double
factor
=
1
;
...
...
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