pivot-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sandro Martini <sandro.mart...@gmail.com>
Subject Re: FindBugs Analysis
Date Mon, 20 Jun 2011 13:57:09 GMT
>> http://www.exampledepot.com/egs/java.io/deletefile.html
>
>Yes, I understand how to process a boolean return value.  :-)  
I imagine ;D ... the given example was to show how they handle a typical
file deletion.
>But the Javadoc for File#delete() does not make it clear what the return
value means (see above).
>From what I read here (and FindBugs say) in case of file NOT deleted only a
false will be returned (no exception will be thrown by File):
http://download.oracle.com/javase/6/docs/api/java/io/File.html#delete%28%29
so the idea: like in the doPut, return a boolean indicating what happened
inside, and in the caller method see if return an HTTP error or other ...

    protected boolean doPut(Path path, Object value) throws QueryException {

    protected void doDelete(Path path) throws QueryException {
  -- this is the signature to change,  not the other (of the Servlet), so
it's even safe to do in the 2.0.1 if wanted.


>>>> And last:
>>>> tests/src/org/apache/pivot/tests/ShutdownTest.java:55
>>>> Unchecked/unconfirmed cast from org.apache.pivot.wtk.Dialog to
>>>> org.apache.pivot.wtk.Alert
>>>> ...
>>> Ignore all these. The casts are valid.
>> Ok, but I guess if for the 2.1 could make sense to change a little their
>> generics signature to have compile-time checks for these like <Y extends
>> X>,
>> but it's a small thing ...
>
>They aren't generics.
Yes, but could become to avoid casts, but we can see what to do, no problem
...


Later I could create a "Small improvements" ticket for the 2.1 where put
some small things, but we have time, it's not a priority now :-) ...

Bye


--
View this message in context: http://apache-pivot-developers.417237.n3.nabble.com/FindBugs-Analysis-tp3076403p3086330.html
Sent from the Apache Pivot - Developers mailing list archive at Nabble.com.

Mime
View raw message