Niclas Hedhman a écrit :
There are some substantial changes around isActive() and
isAvailable(), and one case in particular I wonder if you have gotten
everything right;

For instance; ImportedServiceReferenceInstance

public boolean isAvailable()
{
-        try
-        {
-            getInstance();
-            return serviceInstance.isAvailable();
-        }
-        catch( ServiceImporterException e )
-        {
-            LoggerFactory.getLogger( getClass() ).warn( "Imported
service throwed an exception on isAvailable(), will return false.", e
);
-            return false;
-        }
+        return serviceInstance != null&&  serviceInstance.isAvailable();

The previous code would activate the service before checking if it is
available. The replaced code looks like it ignores the effect of lazy
activation.
Good catch!


_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to