Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#21 Proxies do not declare exceptions

open
nobody
5
2002-11-07
2002-11-07
Anonymous
No

I have generated a Proxy class from an interface which
contains a method:

public String getValue(String subKeyName, String
valueName) throws NoSuchKeyException, NoSuchValueException;

The generated proxy method is:

public native java.lang.String
getValue(java.lang.String p0, java.lang.String p1);

which does not declare the exceptions. When my native
code throws an exception, it comes back to Java as an
uncaught exception of type java.lang.Object (Sun JDK
1.3.1_02 on Windows) which causes a program crash

Proxy methods should throw the same exceptions as the
Java interfaces.

Discussion

  • Kevin Gilpin
    Kevin Gilpin
    2002-11-07

    Logged In: YES
    user_id=44882

    When I say proxy I really mean generated Java peer