dain        2005/06/24 08:32:02

  Modified:    modules/core/src/java/org/openejb/corba/util Util.java
  Log:

  Fixed many exception marshalling and wrapping problems
  Fixed class loader handling in StandardServant
  
  Revision  Changes    Path
  1.12      +7 -6      
openejb/modules/core/src/java/org/openejb/corba/util/Util.java
  
  Index: Util.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/corba/util/Util.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Util.java 24 Jun 2005 07:54:14 -0000      1.11
  +++ Util.java 24 Jun 2005 12:32:02 -0000      1.12
  @@ -495,19 +495,20 @@
           throw new UnexpectedException(id);
       }
   
  -    public static OutputStream writeException(Method method, ResponseHandler 
reply, Exception exception) throws Throwable {
  +    public static OutputStream writeUserException(Method method, 
ResponseHandler reply, Exception exception) throws Exception {
  +        if (exception instanceof RuntimeException || exception instanceof 
RemoteException) {
  +            throw exception;
  +        }
  +
           Class[] exceptionTypes = method.getExceptionTypes();
           for (int i = 0; i < exceptionTypes.length; i++) {
               Class exceptionType = exceptionTypes[i];
  -            if (RemoteException.class.isAssignableFrom(exceptionType) ||
  -                    RuntimeException.class.isAssignableFrom(exceptionType) ||
  -                    !exceptionType.isInstance(exception)) {
  +            if (!exceptionType.isInstance(exception)) {
                   continue;
               }
   
  -            String exceptionId = getExceptionId(exceptionType);
  -
               OutputStream out = (OutputStream) reply.createExceptionReply();
  +            String exceptionId = getExceptionId(exceptionType);
               out.write_string(exceptionId);
               out.write_value(exception);
               return out;
  
  
  

Reply via email to