Author: dgeraskov
Date: 2011-10-14 10:26:08 -0400 (Fri, 14 Oct 2011)
New Revision: 35664
Modified:
branches/dead/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate3_5/src/org/jboss/tools/hibernate3_5/HibernateExtension3_5.java
branches/dead/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/HibernateExtension4_0.java
Log:
Handle Throwable instead of Exception as incompatible libraries versions (when
ConsoleConfiguration and user libraries has different versions) throw Exceptions which
actually subclasses of Error
Modified:
branches/dead/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate3_5/src/org/jboss/tools/hibernate3_5/HibernateExtension3_5.java
===================================================================
---
branches/dead/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate3_5/src/org/jboss/tools/hibernate3_5/HibernateExtension3_5.java 2011-10-14
14:23:38 UTC (rev 35663)
+++
branches/dead/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate3_5/src/org/jboss/tools/hibernate3_5/HibernateExtension3_5.java 2011-10-14
14:26:08 UTC (rev 35664)
@@ -93,7 +93,10 @@
try {
session = sessionFactory.openSession();
return QueryExecutor.executeCriteriaQuery(session, criteriaCode, model);
- } catch (Exception e){
+ } catch (Throwable e){
+ //Incompatible library versions could throw subclasses of Error, like
AbstractMethodError
+ //may be there is a sense to say to user that the reason is probably a wrong CC
version
+ //(when catch a subclass of Error)
return new QueryResultImpl(e);
}
} finally {
Modified:
branches/dead/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/HibernateExtension4_0.java
===================================================================
---
branches/dead/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/HibernateExtension4_0.java 2011-10-14
14:23:38 UTC (rev 35663)
+++
branches/dead/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/HibernateExtension4_0.java 2011-10-14
14:26:08 UTC (rev 35664)
@@ -101,7 +101,10 @@
try {
session = sessionFactory.openSession();
return QueryExecutor.executeCriteriaQuery(session, criteriaCode, model);
- } catch (Exception e){
+ } catch (Throwable e){
+ //Incompatible library versions could throw subclasses of Error, like
AbstractMethodError
+ //may be there is a sense to say to user that the reason is probably a wrong CC
version
+ //(when catch a subclass of Error)
return new QueryResultImpl(e);
}
} finally {
Show replies by date