X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=plugins%2Forg.argeo.slc.client.ui%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fclient%2Fui%2Fmodel%2FSingleResultNode.java;h=d587a932195cf1b49e0e71c4db5e3180426e9649;hb=e797ab69fbb9d6a4abe901155108ab8155ceba5b;hp=5a08349a98687f698d6e4f47a715370a231e131c;hpb=e8997305e4d5fe939e2e4ec55195afdc0d488bbc;p=gpl%2Fargeo-slc.git diff --git a/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/model/SingleResultNode.java b/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/model/SingleResultNode.java index 5a08349a9..d587a9321 100644 --- a/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/model/SingleResultNode.java +++ b/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/model/SingleResultNode.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2012 Mathieu Baudier + * Copyright (C) 2007-2012 Argeo GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,8 @@ import org.argeo.slc.jcr.SlcNames; * It has no child. */ -public class SingleResultNode extends ResultParent { +public class SingleResultNode extends ResultParent implements + Comparable { private final Node node; private boolean passed; @@ -48,9 +49,15 @@ public class SingleResultNode extends ResultParent { public boolean refreshPassedStatus() { try { - Node check = node.getNode(SlcNames.SLC_STATUS); - passed = check.getProperty(SlcNames.SLC_SUCCESS).getBoolean(); - return passed; + Node check; + if (node.hasNode(SlcNames.SLC_STATUS)) { + check = node.getNode(SlcNames.SLC_STATUS); + passed = check.getProperty(SlcNames.SLC_SUCCESS).getBoolean(); + return passed; + } else + // Happens only if the UI triggers a refresh while the execution + // is in progress and the corresponding node is being built + return false; } catch (RepositoryException re) { throw new SlcException( "Unexpected error while checking result status", re); @@ -84,4 +91,8 @@ public class SingleResultNode extends ResultParent { // Do nothing this object is fully initialized at instantiation time. } + public int compareTo(SingleResultNode o) { + return super.compareTo(o); + } + }