: 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to