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
PaaSage
meta_solver
Commits
450be41d
Commit
450be41d
authored
Nov 30, 2015
by
Shirley Crompton
Browse files
attempt to fix NPE
parent
97918384
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/eu/paasage/upperware/metasolver/metrics/Mapper.java
View file @
450be41d
...
...
@@ -12,11 +12,13 @@ import java.util.List;
import
java.util.Set
;
import
org.apache.log4j.Logger
;
import
org.eclipse.emf.common.util.EList
;
import
org.eclipse.emf.ecore.EObject
;
import
com.eclipsesource.json.JsonObject
;
//import eu.paasage.upperware.cp.cloner.CDOClientExtended;
//import eu.paasage.upperware.cp.cloner.CPCloner;
import
eu.paasage.upperware.metamodel.cp.ConstraintProblem
;
...
...
@@ -132,8 +134,15 @@ public class Mapper {
+
" metric variables retrived from CP model in "
+
resId
+
"..."
);
// now get the solution
Solution
solution
=
CPModelTool
.
searchLastSolution
(
cp
.
getSolution
());
Solution
solution
=
null
;
EList
<
Solution
>
solutions
=
cp
.
getSolution
();
if
(
solutions
==
null
||
solutions
.
isEmpty
()){
System
.
out
.
println
(
"there is no solution in the CP Model("
+
resId
+
")"
);
log
.
debug
(
"there is no solution in the CP Model("
+
resId
+
")"
);
}
else
{
solution
=
CPModelTool
.
searchLastSolution
(
solutions
);
}
if
(
solution
==
null
)
{
// no solution in model, create one now
System
.
out
.
println
(
"CP model in "
+
resId
...
...
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