#637 some finder methods in remove interface are marked with 'should through ObjectNotFound exception' errors.
Hello!
Here's the EJB 1.1 Home interface I have for entity bean:
public interface AccountHome extends EJBHome {
public Account create(String name, AccountType type, AccountKind kind)
throws RemoteException, CreateException;
public Enumeration findByUser(UserPK user_pk) throws RemoteException,
FinderException;
/**/ public Account findByPrimaryKey(AccountPK key) throws RemoteException,
FinderException;
public Account findByName(UserPK user_pk, String name) throws
RemoteException, FinderException;
public Account findSystem(String name) throws RemoteException,
FinderException;
/**/ public Account findByOrder(OrderPK order_pk) throws RemoteException,
FinderException;
public Enumeration findAll() throws RemoteException, FinderException;
public Enumeration findDirty() throws RemoteException, FinderException;
}
For some reason, IDEA #637 marks methods that I've marked with /**/ as
"method 'xxx' should throw 'javax.ejb.ObjectNotFoundException'". I don't see
any logic here (why only thouse two methods?). Nor I don't understand why I
should declare to throw ObjectNotFoundException (which extends
FinderException), if EJB specs, as far as I see, mandate that 'throws
FinderException' shall be declared and even give the corresponding sample in
the specs:
// Entity's home interface
public interface AccountHome extends javax.ejb.EJBHome {
....
Account findByPrimaryKey(AccountPrimaryKey primkey)
throws FinderException, RemoteException;
....
}
Roman Elizarov.
Please sign in to leave a comment.
Please check whether your finder methods implementations throw
ObjectNotFoundException.
If this is the case, then method declarations should throw
ObjectNotFoundException too
--
regards,
Alexey Kudravtsev.
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"
"Roman Elizarov" <elizarov@acm.org> wrote in message
news:ahopnq$n23$1@is.intellij.net...
>
>
RemoteException,
>
see
I
in
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
Since ObjectNotFoundException extends FinderException, is it really
necessary to explicitly declare it as well (that's what the intention
suggests)? It seems kind of redundant to me...
Regards,
Andrei
"Alexey Kudravtsev" <cdr@intellij.com> wrote in message
news:ahp2la$5sq$1@is.intellij.net...
>
>
>
RemoteException,
why
sample
>
>
"Alexey Kudravtsev" <cdr@intellij.com> wrote
Yes
No. That's ridiculous. The method declaration is declared to throw
FinderException which is a superset of ObjectNotFoundException.
Roman Elizarov.
Hello,
This bug is fixed in #639
Thank you for report
--
regards,
Alexey Kudravtsev.
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"
"Roman Elizarov" <elizarov@acm.org> wrote in message
news:ahopnq$n23$1@is.intellij.net...
>
>
RemoteException,
>
see
I
in
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>