lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: [jira] Updated: (LUCENE-665) temporary file access denied on Windows
Date Sat, 23 Sep 2006 01:27:40 GMT

: Indeed the first version I wrote followed the pattern you suggest (let's
: name it pattern_1 for the discussion). However with pattern_1 I could not
: cover the case of a method originally not throwing an exception. The
: problem is that in pattern_1 we have to catch the exception before deciding
: whether to wait or not. But if the decision is not to wait, the caught
: exception must be thrown, - which is not allowed by the original method
: signature.

Hmmm...  you're refering to methods like "filedExists" and "fileLength"
right? ... if the method isn't declared to throw the ExceptionType, then
the only way it can ever arrise from the super.call is if it's a runtime
exception, in which case the pattern still holds...

   ResultType methodName(ArgType args) {
     long maxTime = System.currentTimeMillis() + maxTotalDelay;
     while (true) {
       try {
         return super.methodName(args);
       } catch (RuntimeException e) {
         if (maxTime < System.currentTimeMillis()) throw e
       }
       wait(maxTime);
     }
   }

...right?

: method is hardly ever called. Perhaps should mention in the waitMore
: javadoc that these args are for debug mainly?

if that's the indent then yeah, i would document it.




-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message