[JBoss-user] JBuilder compilation bug ???

2001-06-22 Thread Igor Rabinovich

Hi all!

I'm using JBuilder 4 enterprise and have such a strange bug:

In remote interface of my entity bean I declare toString function throws
RemoteException, but get error in compilation.

//Company.java

public interface Company extends javax.ejb.EJBObject {

public String toString()
throws RemoteException;
}

// error
Company.java: Error #: 462 :
method toString() in interface
com.filonet.filosafe.server.ejb.company.Company cannot override method
toString() in   class java.lang.Object, overridden method does not throw
java.rmi.RemoteException at line 10, column 19

It's strange because of I can compile it with Sun's JDK 1.3.0_02

What is it?

Igor


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



RE: [JBoss-user] JBuilder compilation bug ???

2001-06-22 Thread RRokytskyy

Hi,

 In remote interface of my entity bean I declare toString 
 function throws
 RemoteException, but get error in compilation.
 
 //Company.java
 
 public interface Company extends javax.ejb.EJBObject {
 
   public String toString()
   throws RemoteException;
 }
 
 // error
 Company.java: Error #: 462 :
   method toString() in interface
 com.filonet.filosafe.server.ejb.company.Company cannot 
 override  method
 toString() in class java.lang.Object, overridden 
 method does not throw
 java.rmi.RemoteException at line 10, column 19
 
 It's strange because of I can compile it with Sun's JDK 1.3.0_02

I would say, that _this_ is strange. This violates the Java language
specification. You cannot override method and _add_ exceptions to its
signature. This is because, if some of the code that uses your superclass
has no try/catch clause, your exception will go up and so on. 

So, what you do, is _not_ legal.

Regards,
Roman.

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user