From 2d8cf20d0d5ca6b1fbdefc22229d4b7cf1497ede Mon Sep 17 00:00:00 2001 From: mark Date: Tue, 17 Jan 2006 18:09:40 +0000 Subject: Imported GNU Classpath 0.20 * Makefile.am (AM_CPPFLAGS): Add classpath/include. * java/nio/charset/spi/CharsetProvider.java: New override file. * java/security/Security.java: Likewise. * sources.am: Regenerated. * Makefile.in: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109831 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/classpath/gnu/CORBA/Poa/gnuPOA.java | 76 ++++++++++++++++------------- 1 file changed, 43 insertions(+), 33 deletions(-) (limited to 'libjava/classpath/gnu/CORBA/Poa/gnuPOA.java') diff --git a/libjava/classpath/gnu/CORBA/Poa/gnuPOA.java b/libjava/classpath/gnu/CORBA/Poa/gnuPOA.java index 6f2a019a3bb..460a0a6029a 100644 --- a/libjava/classpath/gnu/CORBA/Poa/gnuPOA.java +++ b/libjava/classpath/gnu/CORBA/Poa/gnuPOA.java @@ -1052,12 +1052,12 @@ public class gnuPOA /** * Returns the servant that is serving this object. - * - * @return if the RETAIN policy applies and the object is in the Active - * Object Map, the method returns the servant, associated with this object. + * + * @return if the RETAIN policy applies and the object is in the Active Object + * Map, the method returns the servant, associated with this object. * Otherwise, if the USE_DEFAULT_SERVANT policy applies, the method returns * the default servant (if one was set). - * + * * @throws ObjectNotActive if none of the conditions above are satisfied. * @throws WrongAdapter if the object reference was not created with this POA. * @throws WrongPolicy. This method requires either RETAIN or @@ -1065,14 +1065,26 @@ public class gnuPOA * apply to this POA. */ public Servant reference_to_servant(org.omg.CORBA.Object the_Object) - throws ObjectNotActive, WrongPolicy, - WrongAdapter + throws ObjectNotActive, WrongPolicy, WrongAdapter { if (applies(ServantRetentionPolicyValue.RETAIN)) { AOM.Obj ref = aom.findObject(the_Object); if (ref == null) - throw new WrongAdapter(); + { + String object; + if (the_Object == null) + object = "null passed"; + else if (the_Object instanceof gnuServantObject) + { + gnuServantObject gs = (gnuServantObject) the_Object; + object = "Wrong owner POA " + gs.poa.the_name(); + } + else + object = "Unknown " + the_Object.getClass().getName(); + + throw new WrongAdapter(object + " for '" + the_name() + "'"); + } else if (ref.isDeactiveted() || ref.servant == null) { if (default_servant != null) @@ -1092,32 +1104,30 @@ public class gnuPOA } /** - * Returns the id of the object, served by the given servant - * (assuming that the servant serves only one object). - * The id is found in one of the following ways. - * - * @throws ServantNotActive in all cases, not listed in the list above. - * @throws WrongPolicy The method requres USE_DEFAULT_SERVANT policy or - * a combination of the RETAIN policy and either the UNIQUE_ID or - * IMPLICIT_ACTIVATION policies and throws the WrongPolicy if these conditions - * are not satisfied. - */ + * Returns the id of the object, served by the given servant (assuming that + * the servant serves only one object). The id is found in one of the + * following ways. + * + * + * @throws ServantNotActive in all cases, not listed in the list above. + * @throws WrongPolicy The method requres USE_DEFAULT_SERVANT policy or a + * combination of the RETAIN policy and either the UNIQUE_ID or + * IMPLICIT_ACTIVATION policies and throws the WrongPolicy if these conditions + * are not satisfied. + */ public byte[] servant_to_id(Servant the_Servant) throws ServantNotActive, WrongPolicy { -- cgit v1.2.3