Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4712731
Votes 9
Synopsis REGRESSION: Inserting org.omg.TimeBase.TimeT in CORBA-any fails
Category idl:other
Reported Against hopper-beta
Release Fixed
State 11-Closed, Will Not Fix, bug
Priority: 3-Medium
Related Bugs
Submit Date 10-JUL-2002
Description




FULL PRODUCT VERSION :
java version "1.4.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_01-b03)
Java HotSpot(TM) Client VM (build 1.4.0_01-b03, mixed mode)

and also

java version "1.4.1-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-beta-b14)
Java HotSpot(TM) Client VM (build 1.4.1-beta-b14, mixed mode)


FULL OPERATING SYSTEM VERSION :

Linux fnsnb24 2.2.14-5.0 #1 Tue Mar 7 21:07:39 EST 2000 i686 unknown
Red Hat Linux release 6.2 (Zoot)

Windows 2000                              


A DESCRIPTION OF THE PROBLEM :
Inserting a org.omg.TimeBase.TimeT  customer  into a CORBA-any
fails by throwing a nullpointer exception:
        Exception in thread "main"
java.lang.NullPointerException
        at
com.sun.corba.se.internal.corba.TCUtility.unmarshalIn(TCUtility.java:290)
        at
com.sun.corba.se.internal.corba.AnyImpl.read_value(AnyImpl.java:561)
        at
org.omg.TimeBase.TimeTHelper.insert(TimeTHelper.java:20)
        at CorbaBug.main(CorbaBug.java:13)



STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :

1. From CorbaBug.java copy the TimeBase idl into a file name timebase.idl (lines starting with '#ifndef _TIME_BASE_IDL' and up to '#endif'      (create timebase idl) 

2. idjl -pkgPrefix TimeBase  org.omg timebase.idl    (compile the timebase idl) 

3. java CorbaBug  (run the test) 


This bug can be reproduced always.



The problem is not reproducible on Windows 2000 using JDK1.3.1_04.

Here is the output I got.
-------------------------

Any:   xxxxx@xxxxx  


---------- BEGIN SOURCE ----------
public class CorbaBug {
    public static void main(String[] args) throws Exception {
        String[] orb_args = new String[] { "-ORBInitialHost", "fnsnb24",
"-ORBInitialPort", "2809" };
        org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(orb_args, null);
        org.omg.CORBA.Any any = orb.create_any();
        System.out.println("Any: " + any);
        org.omg.TimeBase.TimeTHelper.insert(any, 500L); // -> This throws an
exception as shown below
        System.exit(0);
    }

    /** Output is:
        Any:   xxxxx@xxxxx  
        Exception in thread "main" java.lang.NullPointerException
        at
com.sun.corba.se.internal.corba.TCUtility.unmarshalIn(TCUtility.java:290)
        at com.sun.corba.se.internal.corba.AnyImpl.read_value(AnyImpl.java:561)
        at org.omg.TimeBase.TimeTHelper.insert(TimeTHelper.java:20)
        at CorbaBug.main(CorbaBug.java:13)

        ------------------------------------------------------
        jdk is: j2sdk1.4.0_01
        java version "1.4.0_01"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_01-b03)
        Java HotSpot(TM) Client VM (build 1.4.0_01-b03, mixed mode)
     */
}



/** The used omg idl is (we don't use the NOLONGLONG options, so TimeT is a
single long long type):

#ifndef _TIME_BASE_IDL_
#define _TIME_BASE_IDL_
#pragma prefix "omg.org"

module TimeBase {

#ifdef NOLONGLONG
    struct ulonglong{
        unsigned long       low;
        unsigned long       high;
    };
    typedef ulonglong       TimeT;
#else
    typedef unsigned long long  TimeT;
#endif
    
    typedef TimeT           InaccuracyT;
    typedef short           TdfT;
    struct UtcT {
        TimeT           time;       // 8 octets
        unsigned long   inacclo;    // 4 octets
        unsigned short  inacchi;    // 2 octets
        TdfT            tdf;        // 2 octets
                                    // total 16 octets.
    };

    struct IntervalT {
        TimeT           lower_bound;
        TimeT           upper_bound;
    };
};
#endif

*/



---------- END SOURCE ----------

Release Regression From : 1.3.1_04
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.

(Review ID: 153463) 
======================================================================
Work Around
N/A
Evaluation
  xxxxx@xxxxx   2002-07-11

This seems to be a bug.
Comments
  
  Include a link with my name & email   

Submitted On 13-SEP-2002
alvarezc
The problem seems to be in 
com.sun.corba.se.internal.corba.AnyImpl, in the read_value
(InputStream in, TypeCode tc) method:

The call to unmarshalIn passes the variable typeCode, rather 
than realType():

public void read_value(org.omg.CORBA.portable.InputStream 
in, TypeCode tc)
{
    typeCode = TypeCodeImpl.convertToNative(orb, tc);
    int kind = realType().kind().value();
    ...
    if (AnyImpl.isStreamed[kind]) {
    ...
    }else {
    ...
    TCUtility.unmarshalIn(in, typeCode, longholder, objholder);
    ...
    }
    ...
}

Changing the last line in the code snippet above as follows 
seems to resolve the problem:

    TCUtility.unmarshalIn(in, realType(), longholder, objholder);



PLEASE NOTE: JDK6 is formerly known as Project Mustang