Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
biopet.biopet
Commits
998da3a9
Commit
998da3a9
authored
Sep 01, 2014
by
Peter van 't Hof
Browse files
fixed bug on default value
parent
5571a0d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/config/Configurable.scala
View file @
998da3a9
...
...
@@ -9,7 +9,7 @@ trait Configurable extends Logging {
val
configPath
:
List
[
String
]
=
if
(
root
!=
null
)
root
.
configFullPath
else
List
()
protected
val
configName
=
getClass
.
getSimpleName
.
toLowerCase
protected
val
configFullPath
=
configName
::
configPath
var
defaults
:
Map
[
String
,
Any
]
=
if
(
root
!=
null
)
root
.
defaults
else
Map
()
var
defaults
:
scala.collection.mutable.
Map
[
String
,
Any
]
=
if
(
root
!=
null
)
root
.
defaults
else
scala
.
collection
.
mutable
.
Map
()
val
config
=
new
ConfigFuntions
...
...
@@ -18,8 +18,8 @@ trait Configurable extends Logging {
val
m
=
if
(
submodule
!=
null
)
submodule
else
configName
val
p
=
if
(
submodule
!=
null
)
configName
::
configPath
else
configPath
val
d
=
{
val
value
=
Config
.
getValueFromMap
(
defaults
,
ConfigValueIndex
(
m
,
p
,
key
,
freeVar
))
if
(
value
.
isDefined
)
value
.
get
else
default
val
value
=
Config
.
getValueFromMap
(
defaults
.
toMap
,
ConfigValueIndex
(
m
,
p
,
key
,
freeVar
))
if
(
value
.
isDefined
)
value
.
get
.
value
else
default
}
if
(!
contains
(
key
,
submodule
,
freeVar
)
&&
d
==
null
)
{
if
(
required
)
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment