-
Bug
-
Resolution: Fixed
-
P2
-
1.4.2
-
None
-
07
-
generic
-
windows_nt
-
Not verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2074263 | 7 | Yumin Qi | P3 | Closed | Won't Fix | |
JDK-2074261 | 5.0 | Yumin Qi | P2 | Closed | Fixed | b31 |
JDK-2074260 | 1.4.2 | Yumin Qi | P2 | Closed | Fixed | 04 |
Customer problem description:
>synopsis: wrong discriminator received on a union with multiple case
>labels on a branch
>description: FULL PRODUCT VERSION :
>java version "1.4.2_01"
>Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_01-b06)
>Java HotSpot(TM) Client VM (build 1.4.2_01-b06, mixed mode)
>
>
>FULL OS VERSION :
>Windows NT Version 4.0
>
>
>A DESCRIPTION OF THE PROBLEM :
>Consider this IDL union with a branch that has multiple case labels.
// Multiple case labels per member.
// ================================================================
union U switch(long)
{
case 1:
case 2:
long longer;
default:
short shot;
};
// Interfaces
// ================================================================
interface Simple
{
void testmcls(inout U u);
};
interface SimpleFactory
{
Simple find_simple();
};
>
>In either client or server, select the "longer" branch, setting the
>discriminator to 2. Now pass the union to the other side, and examine
>it: the discriminator value is 1.
>
>Here's a swatch of the UHelper.read() code generated by idlj:
>
> public static U read (org.omg.CORBA.portable.InputStream istream)
> {
> U value = new U ();
> int _dis0 = (int)0;
> _dis0 = istream.read_long ();
> switch (_dis0)
> {
> case 1:
> case 2:
> int _longer = (int)0;
> _longer = istream.read_long ();
> value.longer (_longer);
> break;
>
>Shouldn't it be doing this instead?
>
> value.longer (_dis0, _longer);
UHelper.write() is sending the union's discriminator
correctly, but UHelper.read() isn't selecting the union's "longer"
branch with the discriminator _dis0 that it had just read.
The same problem also exists in the default branch in UHelper.read().
>
>STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
>Use idlj to generate code.
>Build a CORBA application that passes the union from client to server.
>Select the "longer" union member, setting the discriminant to 2.
>Pass the union to the other side.
>Examine the discriminator value, which should be 2, but it is 1.
>
>
>EXPECTED VERSUS ACTUAL BEHAVIOR :
>EXPECTED -
>Discriminator value should be 2.
>
>ACTUAL -
>Discriminator value was 1.
>
>
>ERROR MESSAGES/STACK TRACES THAT OCCUR :
>none.
>
>
>REPRODUCIBILITY :
>This bug can be reproduced always.
>
>synopsis: wrong discriminator received on a union with multiple case
>labels on a branch
>description: FULL PRODUCT VERSION :
>java version "1.4.2_01"
>Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_01-b06)
>Java HotSpot(TM) Client VM (build 1.4.2_01-b06, mixed mode)
>
>
>FULL OS VERSION :
>Windows NT Version 4.0
>
>
>A DESCRIPTION OF THE PROBLEM :
>Consider this IDL union with a branch that has multiple case labels.
// Multiple case labels per member.
// ================================================================
union U switch(long)
{
case 1:
case 2:
long longer;
default:
short shot;
};
// Interfaces
// ================================================================
interface Simple
{
void testmcls(inout U u);
};
interface SimpleFactory
{
Simple find_simple();
};
>
>In either client or server, select the "longer" branch, setting the
>discriminator to 2. Now pass the union to the other side, and examine
>it: the discriminator value is 1.
>
>Here's a swatch of the UHelper.read() code generated by idlj:
>
> public static U read (org.omg.CORBA.portable.InputStream istream)
> {
> U value = new U ();
> int _dis0 = (int)0;
> _dis0 = istream.read_long ();
> switch (_dis0)
> {
> case 1:
> case 2:
> int _longer = (int)0;
> _longer = istream.read_long ();
> value.longer (_longer);
> break;
>
>Shouldn't it be doing this instead?
>
> value.longer (_dis0, _longer);
UHelper.write() is sending the union's discriminator
correctly, but UHelper.read() isn't selecting the union's "longer"
branch with the discriminator _dis0 that it had just read.
The same problem also exists in the default branch in UHelper.read().
>
>STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
>Use idlj to generate code.
>Build a CORBA application that passes the union from client to server.
>Select the "longer" union member, setting the discriminant to 2.
>Pass the union to the other side.
>Examine the discriminator value, which should be 2, but it is 1.
>
>
>EXPECTED VERSUS ACTUAL BEHAVIOR :
>EXPECTED -
>Discriminator value should be 2.
>
>ACTUAL -
>Discriminator value was 1.
>
>
>ERROR MESSAGES/STACK TRACES THAT OCCUR :
>none.
>
>
>REPRODUCIBILITY :
>This bug can be reproduced always.
>
- backported by
-
JDK-2074260 Wrong discriminator received on a union with multiple case labels on a branch
-
- Closed
-
-
JDK-2074261 Wrong discriminator received on a union with multiple case labels on a branch
-
- Closed
-
-
JDK-2074262 Wrong discriminator received on a union with multiple case labels on a branch
-
- Closed
-
-
JDK-2074263 Wrong discriminator received on a union with multiple case labels on a branch
-
- Closed
-