<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I'll fix in trunk soon.<br>
<br>
Mark<br>
Greg Barton wrote:
<blockquote cite="mid:404826.80296.qm@web81504.mail.mud.yahoo.com"
 type="cite">
  <pre wrap="">I have to agree with Zoltan on this one.  Catching
Throwable is ungood.

--- Mark Proctor <a class="moz-txt-link-rfc2396E" href="mailto:mproctor@codehaus.org">&lt;mproctor@codehaus.org&gt;</a> wrote:

  </pre>
  <blockquote type="cite">
    <pre wrap="">If no one is agueing for Throwable, I'll update it
to Exception then.

Mark
Zoltan Farkas wrote:
    </pre>
    <blockquote type="cite">
      <pre wrap="">This is my opinion also and is in line with the
      </pre>
    </blockquote>
    <pre wrap="">java best practices...
    </pre>
    <blockquote type="cite">
      <pre wrap="">Based on javadoc(see class Error and Exception):

"The class Exception and its subclasses are a form
      </pre>
    </blockquote>
    <pre wrap="">of Throwable that indicates conditions that a
reasonable application might want to catch. "
    </pre>
    <blockquote type="cite">
      <pre wrap="">"An Error is a subclass of Throwable that
      </pre>
    </blockquote>
    <pre wrap="">indicates serious problems that a reasonable
application should not try to catch."
    </pre>
    <blockquote type="cite">
      <pre wrap="">In all my apps I want my application to stop on a
      </pre>
    </blockquote>
    <pre wrap="">unrecoverable error (like OOM). However since most
libraries have some catch(Throwable) in the code, I
always have to use: 
    </pre>
    <blockquote type="cite">
      <pre wrap="">-XX:+HeapDumpOnOutOfMemoryError
      </pre>
    </blockquote>
    <pre wrap="">-XX:HeapDumpPath=${DUMP_PATH}
-XX:OnOutOfMemoryError="kill -9 %p"
    </pre>
    <blockquote type="cite">
      <pre wrap="">For me as a user of the drools engine as a 3rd
      </pre>
    </blockquote>
    <pre wrap="">party I would expect that Error not be "hidden"
inside a RuntimeException. For me Errors are
something I cannot recover from... however I might
choose to continue the application on a Exception
...
    </pre>
    <blockquote type="cite">
      <pre wrap="">This is my opinion on this...

thanks

--zoly


________________________________________
From: <a class="moz-txt-link-abbreviated" href="mailto:rules-dev-bounces@lists.jboss.org">rules-dev-bounces@lists.jboss.org</a>
      </pre>
    </blockquote>
    <pre wrap="">[<a class="moz-txt-link-freetext" href="mailto:rules-dev-bounces@lists.jboss.org">mailto:rules-dev-bounces@lists.jboss.org</a>] On Behalf
Of Geoffrey Wiseman
    </pre>
    <blockquote type="cite">
      <pre wrap="">Sent: Friday, April 04, 2008 2:10 PM
To: Rules Dev List
Subject: Re: [rules-dev] Questionable Exception
      </pre>
    </blockquote>
    <pre wrap="">Handling
    </pre>
    <blockquote type="cite">
      <pre wrap="">In most cases, I'd say that Errors shouldn't even
      </pre>
    </blockquote>
    <pre wrap="">be caught and rethrown, personally -- something like
an OOME doesn't need additional object creation, for
instance.
    </pre>
    <blockquote type="cite">
      <pre wrap="">On Fri, Apr 4, 2008 at 1:55 PM, Mark Proctor
      </pre>
    </blockquote>
    <pre wrap=""><a class="moz-txt-link-rfc2396E" href="mailto:mproctor@codehaus.org">&lt;mproctor@codehaus.org&gt;</a> wrote:
    </pre>
    <blockquote type="cite">
      <pre wrap="">I don't see a problem with Throwable there? We
      </pre>
    </blockquote>
    <pre wrap="">rethrow again, adding in some additional
information. I found that just catching Exception
didn't work as you could get verification errors and
other stuch things. If you look at the context of
that that method is doing too, its using reflection
to instantiate a class.
    </pre>
    <blockquote type="cite">
      <pre wrap="">Mark
Zoltan Farkas wrote: 
I was browsing through the drools source code 
 
I am not a fan of seeing catching Throwable in any
      </pre>
    </blockquote>
    <pre wrap="">java code ...
    </pre>
    <blockquote type="cite">
      <pre wrap=""> 
I see this in class org.drools.util.ClassUtils:
 
    /**
     * This method will attempt to create an
      </pre>
    </blockquote>
    <pre wrap="">instance of the specified Class. It uses
    </pre>
    <blockquote type="cite">
      <pre wrap="">     * a syncrhonized HashMap to cache the
      </pre>
    </blockquote>
    <pre wrap="">reflection Class lookup.
    </pre>
    <blockquote type="cite">
      <pre wrap="">     * @param className
     * @return
     */
    public static Object instantiateObject(String
      </pre>
    </blockquote>
    <pre wrap="">className) {
    </pre>
    <blockquote type="cite">
      <pre wrap="">        Class cls = (Class)
      </pre>
    </blockquote>
    <pre wrap="">ClassUtils.classes.get( className );
    </pre>
    <blockquote type="cite">
      <pre wrap="">        if ( cls == null ) {
            try {
                cls = Class.forName( className );
                ClassUtils.classes.put( 
      </pre>
    </blockquote>
    <pre wrap="">className, cls );
    </pre>
    <blockquote type="cite">
      <pre wrap="">            } catch ( Throwable e ) {
                throw new RuntimeException("Unable
      </pre>
    </blockquote>
    <pre wrap="">to load class '" + className + "'", e );
    </pre>
    <blockquote type="cite">
      <pre wrap="">            }            
        }
        
        Object object = null;
        try {
            object = cls.newInstance();           
      </pre>
    </blockquote>
    <blockquote type="cite">
      <pre wrap="">        } catch ( Throwable e ) {
            throw new RuntimeException("Unable to
      </pre>
    </blockquote>
    <pre wrap="">instantiate object for class '" + className + "'", e
);
    </pre>
    <blockquote type="cite">
      <pre wrap="">        }  
        return object;
    }
 
I believe this masks important errors where the
      </pre>
    </blockquote>
    <pre wrap="">application should not continue to run and it would
be preferable to crash...
    </pre>
    <blockquote type="cite">
      <pre wrap=""> 
--zoly
 
________________________________________

_______________________________________________
rules-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a>
  


_______________________________________________
rules-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a>



  
      </pre>
    </blockquote>
    <pre wrap="">_______________________________________________
rules-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a>

    </pre>
  </blockquote>
  <pre wrap=""><!---->


      ____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.  
<a class="moz-txt-link-freetext" href="http://tc.deals.yahoo.com/tc/blockbuster/text5.com">http://tc.deals.yahoo.com/tc/blockbuster/text5.com</a>
_______________________________________________
rules-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a>

  </pre>
</blockquote>
<br>
</body>
</html>