Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Noric Couderc
JBrainy
Commits
36ba84f7
Commit
36ba84f7
authored
Nov 14, 2021
by
Noric Couderc
Browse files
Improved error reporting when dropping features
Prints a more helpful error message, saying what features have been dropped.
parent
0ad3ab91
Changes
1
Hide whitespace changes
Inline
Side-by-side
core/src/main/kotlin/se/lth/cs/util/Features.kt
View file @
36ba84f7
...
...
@@ -204,8 +204,11 @@ class FeatureSet(vararg features : Feature) : ArrayList<Feature>() {
* Returns a subset of features which should be supported by the current machine!
*/
fun
checked
()
:
FeatureSet
{
val
featuresChecked
=
this
.
filter
{
it
.
isSupported
()
}
return
FeatureSet
(*
featuresChecked
.
toTypedArray
())
val
featuresChecked
=
this
.
partition
{
it
.
isSupported
()
}
System
.
err
.
println
(
"[WARNING]: Some features have been dropped, they are not supported on this machine: ${featuresChecked.second}"
)
return
FeatureSet
(*
featuresChecked
.
first
.
toTypedArray
())
}
fun
accept
(
visitor
:
FeatureVisitor
)
{
...
...
Write
Preview
Supports
Markdown
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