summaryrefslogtreecommitdiff
path: root/gnu/CORBA/gnuAny.java
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2005-08-02 20:12:05 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2005-08-02 20:12:05 +0000
commit33bace404a240c1335ab1f6e95bd6616e22c0ecd (patch)
tree004ab1587e14d3df272c6944ce325d3584b95aa5 /gnu/CORBA/gnuAny.java
parentd30622846e00f908cb5d4beac7de4e5e78dcd630 (diff)
downloadclasspath-33bace404a240c1335ab1f6e95bd6616e22c0ecd.tar.gz
2005-08-02 Andrew John Hughes <gnu_andrew@member.fsf.org>
* Merge of HEAD --> generics-branch for 2005/06/05 - 2005/07/31. See patch on classpath-patches@gnu.org for a full ChangeLog.
Diffstat (limited to 'gnu/CORBA/gnuAny.java')
-rw-r--r--gnu/CORBA/gnuAny.java20
1 files changed, 16 insertions, 4 deletions
diff --git a/gnu/CORBA/gnuAny.java b/gnu/CORBA/gnuAny.java
index 7997265df..a48c50d61 100644
--- a/gnu/CORBA/gnuAny.java
+++ b/gnu/CORBA/gnuAny.java
@@ -15,8 +15,8 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
@@ -68,6 +68,8 @@ import org.omg.CORBA.portable.Streamable;
import java.io.IOException;
import java.io.Serializable;
+import java.lang.reflect.Field;
+
import java.math.BigDecimal;
import java.util.Arrays;
@@ -279,9 +281,19 @@ public class gnuAny
{
try
{
- return ((ValueBaseHolder) has).value;
+ if (has instanceof ValueBaseHolder)
+ return ((ValueBaseHolder) has).value;
+ else
+ {
+ // Normally, ValueBase holder must be an instance of the
+ // ValueBaseHolder. However some IDL compilers probably
+ // have a bug, do not deriving this way. The the only
+ // way to access the wrapped value is via reflection.
+ Field f = has.getClass().getField("value");
+ return (Serializable) f.get(has);
+ }
}
- catch (ClassCastException ex)
+ catch (Exception ex)
{
return new BAD_OPERATION("Value type expected");
}