Ah, right! My old mistake, I get confused by missing curly braces. Thanks for explaining :)

Oliver

Guido Casper wrote:

Oliver Zeigermann wrote:

While reviewing Tara's patch I came across this code in storeObject:

statement =
connection.prepareStatement(
"select 1 from OBJECT o, URI u where o.URI_ID=u.URI_ID and u.URI_STRING=?");
statement.setString(1, uri.toString());
res = statement.executeQuery();
if (res.next()) {
if (create)
return false;
} else {
if (!create)
return false;
}



Isn't this nonsense?


Hm, I don't think it's nonsense. I read it like this:

If this request is to create a new resource but the resource already
exists --> return false.

If this request is not to create a resource (but overwrite one) and the
resource does not exist --> return false.

Makes sense?

Guido


Maybe it was meant to be:

                if (res.next()) {
                    if (create)
                        return false;
                } else {
                    if (!create)
                        return true;
                }



Does anyone know if this is needed anyhow as it did not seem to cause any problems in the past?


Clueless...

Oliver


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]







--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to