Issue 2608: Java - Mapping for Struct issue (java-rtf) Source: (, ) Nature: Uncategorized Issue Severity: Summary: Summary: The Mapping of OMG IDL to Java, Section 25-20, Mapping for Struct, has a String field that is not initialized. I would like to consider that the String value is initialized to a empty String within a Struct eg., String foo = new String(); I have an application with a Sequence of Structs. The Struct has two attributes, a boolean and String. The boolean is initialized to "false" but the String is not initialized. When I try to add the containing object, the attribute of Sequence of Structs fails. I do not want to require the use to initialize each Struct within the Sequence before createing the object. Resolution: Revised Text: Actions taken: April 14, 1999: received issue January 9, 2001: closed issue Discussion: In Section 25-20, Mapping for Struct, have the String value be initialized to an empty String within a Struct eg., String foo = ""; End of Annotations:===== From: hammondb@us.ibm.com X-Lotus-FromDomain: IBMUS To: issues@omg.org Date: Wed, 14 Apr 1999 10:46:35 -0500 Subject: Java - Mapping for Struct Content-Disposition: inline Hi, The Mapping of OMG IDL to Java, Section 25-20, Mapping for Struct, has a String field that is not initialized. I would like to consider that the String value is initialized to a empty String within a Struct eg., String foo = new String(); I have an application with a Sequence of Structs. The Struct has two attributes, a boolean and String. The boolean is initialized to "false" but the String is not initialized. When I try to add the containing object, the attribute of Sequence of Structs fails. I do not want to require the use to initialize each Struct within the Sequence before createing the object. I was told to submit this request to this address.. Thanks.. Barton W. Hammond IBM Component Broker - Samples Team 512-838-3715 Date: Wed, 14 Jun 2000 11:39:31 -0700 From: "Vijaykumar Natarajan" X-Mailer: Mozilla 4.72 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: java-rtf@omg.org Subject: Issue 2608: Java - Mapping for Struct issue Content-Type: multipart/mixed; boundary="------------82E815666D889241D301D67C" X-UIDL: $,8e9c>'!!;+;!!)+3!! One minor nit in this proposal, otherwise looks OK to me. I would suggest the following text (note the absence of new String()): In Section 25-20, Mapping for Struct, have the String value be initialized to an empty String within a Struct eg., String foo = ""; This case causes the "" string to be shared, whereas the former creates new String objects every time. Thanks, Vijay The Mapping of OMG IDL to Java, Section 25-20, Mapping for Struct, has a String field that is not initialized. I would like to consider that the String value is initialized to a empty String within a Struct eg., String foo = new String(); I have an application with a Sequence of Structs. The Struct has two attributes, a boolean and String. The boolean is initialized to "false" but the String is not initialized. When I try to add the containing object, the attribute of Sequence of Structs fails. I do not want to require the use to initialize each Struct within the Sequence before createing the object. Proposal: In Section 25-20, Mapping for Struct, have the String value be initialized to an empty String within a Struct eg., String foo = new String(); [] vijayn3.vcf Date: Fri, 07 Jul 2000 10:26:10 -0400 From: Mary Leland Organization: HP EIAL X-Mailer: Mozilla 4.73 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: Simon Nash Cc: Vijaykumar Natarajan , Java RTF Subject: Re: IDL to Java RTF: Vote 1 (2608) References: <3953C2A3.51E1A00D@fpk.hp.com> <396516F3.3BD3EAD0@inprise.com> <39659342.9877C423@hursley.ibm.com> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-UIDL: ZXSd9`OQ!!,6cd9Q"$!! Vijay & Simon, Well, the literal answer is that the issue was only raised for strings :-). However, I think the conceptual issue is that for many folks, strings ought to act more like basic types (even if they aren't really), and so have sensible default actions. If someone wants fixes for constructed or template types in structs, he or she can raise that as a new issue. -- Mary Simon Nash wrote: > Vijaykumar Natarajan wrote: > > > > 2. Issue 2608: > > Why are we making a special case for strings. The same issue continues to exist when the struct contains any constructed or template types(struct, union, enum, array and sequence). Why is a fix needed only for strings (or wstrings). > > > Good point. This is a problem for (w)string because the Java default null value > for a (w)string causes a BAD_PARAM when marshalling. However, this also applies > to the other types you listed with the possible exception of enum. So maybe this > change is not such a good idea after all. > > Simon > -- > Simon C Nash, Technology Architect, IBM Java Technology Centre > Tel. +44-1962-815156 Fax +44-1962-818999 Hursley, England > Internet: nash@hursley.ibm.com Lotus Notes: Simon Nash@ibmgb Date: Thu, 06 Jul 2000 16:32:03 -0700 From: "Vijaykumar Natarajan" X-Mailer: Mozilla 4.72 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: Mary Leland CC: Java RTF , juergen@omg.org Subject: Re: IDL to Java RTF: Vote 1 References: <3953C2A3.51E1A00D@fpk.hp.com> Content-Type: multipart/mixed; boundary="------------A4773183A192A1BC57EE32E9" X-UIDL: P(Yd9I1:e9k:3e9gB_d9 Hi all, Two concerns were raised in our internal discussion of these votes. Just thought I'd bring it up for everybody's consideration. I am sorry this is late in the voting cycle. 1. Issue 2517: This requires reading the user.home property and the orb.properties file from that directory. This does not work with applets due to security restrictions. How should these properties be handled in the applet scenario. 2. Issue 2608: Why are we making a special case for strings. The same issue continues to exist when the struct contains any constructed or template types(struct, union, enum, array and sequence). Why is a fix needed only for strings (or wstrings). thanks, Vijay Mary Leland wrote: Date: Fri, 07 Jul 2000 09:22:26 +0100 From: Simon Nash Organization: IBM X-Mailer: Mozilla 4.72 [en] (Windows NT 5.0; I) X-Accept-Language: en MIME-Version: 1.0 To: Vijaykumar Natarajan CC: Mary Leland , Java RTF Subject: Re: IDL to Java RTF: Vote 1 References: <3953C2A3.51E1A00D@fpk.hp.com> <396516F3.3BD3EAD0@inprise.com> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-UIDL: CPJe9;-9e9eOc!!ZLjd9 Vijay, Vijaykumar Natarajan wrote: > > Hi all, > > Two concerns were raised in our internal discussion of these votes. Just thought I'd bring it up for everybody's consideration. I am sorry this is late in the voting cycle. > > 1. Issue 2517: > This requires reading the user.home property and the orb.properties file from that directory. This does not work with applets due to security restrictions. How should these properties be handled in the applet scenario. > This applies equally to reading the orb.properties file from the /lib directory, which is already part of the specified search order. So this issue is not introduced by the proposed change. A comment preceding the code in the org.omg.CORBA.ORB class that reads the /lib/orb.properties file says: // JDK1.2 only // This will not throw a SecurityException because this // class was loaded from rt.jar using the bootstrap classloader. It seems there was some value in putting this class in the JDK core :-) > 2. Issue 2608: > Why are we making a special case for strings. The same issue continues to exist when the struct contains any constructed or template types(struct, union, enum, array and sequence). Why is a fix needed only for strings (or wstrings). > Good point. This is a problem for (w)string because the Java default null value for a (w)string causes a BAD_PARAM when marshalling. However, this also applies to the other types you listed with the possible exception of enum. So maybe this change is not such a good idea after all. Simon -- Simon C Nash, Technology Architect, IBM Java Technology Centre Tel. +44-1962-815156 Fax +44-1962-818999 Hursley, England Internet: nash@hursley.ibm.com Lotus Notes: Simon Nash@ibmgb