• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSArray toString() different in WO 5.4.3
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSArray toString() different in WO 5.4.3


  • Subject: Re: NSArray toString() different in WO 5.4.3
  • From: Chuck Hill <email@hidden>
  • Date: Tue, 5 May 2009 15:03:55 -0700


On May 5, 2009, at 2:59 PM, Ricardo J. Parada wrote:

Hi All,

Another issue we discovered with WO 5.4.3:

This code:
NSArray array = new NSArray(new Object[] {"86309", "", "6.4000", "6.4000"});
System.out.println(array.toString());
Outputs the following:


5.3.3 :
( "86309", "", "6.4000", "6.4000" )

5.4.4 :
( 86309,
,
6.4000,
6.4000 )

We relied on NSArray toString() method to generate the plist format for an NSArray.

That was a mistake. That is the job of NSPropertyListSerialization.

Chuck


With WO 5.4.3 the output is different and then when we try to parse the string generated by WO 5.4.3 back into an NSArray using NSPropertyListSerialization.propertyListFromString we get this exception:

java.lang.IllegalArgumentException: Property list parsing failed while attempting to read unquoted string. No allowable characters were found. At line number: 1, column: 9.
[2009-5-5 16:27:12 EDT] java.lang.IllegalArgumentException: Property list parsing failed while attempting to read unquoted string. No allowable characters were found. At line number: 1, column: 9.
at com.webobjects.foundation.NSPropertyListSerialization $ _ApplePList ._readUnquotedStringIntoStringBuffer (NSPropertyListSerialization.java:1257)
at com.webobjects.foundation.NSPropertyListSerialization $ _ApplePList ._readObjectIntoObjectReference(NSPropertyListSerialization.java:1241)
at com.webobjects.foundation.NSPropertyListSerialization $ _ApplePList ._readArrayContentsIntoArray(NSPropertyListSerialization.java:1413)
at com.webobjects.foundation.NSPropertyListSerialization $ _ApplePList ._readObjectIntoObjectReference(NSPropertyListSerialization.java:1233)
at com.webobjects.foundation.NSPropertyListSerialization $ _ApplePList ._readArrayContentsIntoArray(NSPropertyListSerialization.java:1413)
at com.webobjects.foundation.NSPropertyListSerialization $ _ApplePList ._readObjectIntoObjectReference(NSPropertyListSerialization.java:1233)
at com.webobjects.foundation.NSPropertyListSerialization $_ApplePList.parseStringIntoPlist(NSPropertyListSerialization.java: 1069)
at com .webobjects .foundation .NSPropertyListSerialization .propertyListFromString(NSPropertyListSerialization.java:1669)
at com .webobjects .foundation .NSPropertyListSerialization .propertyListFromString(NSPropertyListSerialization.java:1646)
at your.app.components.Main.plistTest(Main.java:18)



The workaround is to write our own code for outputting NSArray. But this seems like a WO 5.4.3 bug to me.





_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden

-- Chuck Hill Senior Consultant / VP Development

Come to WOWODC'09 in San Fran this June!
http://www.wocommunity.org/wowodc09/

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSArray toString() different in WO 5.4.3
      • From: "Ricardo J. Parada" <email@hidden>
References: 
 >NSArray toString() different in WO 5.4.3 (From: "Ricardo J. Parada" <email@hidden>)

  • Prev by Date: NSArray toString() different in WO 5.4.3
  • Next by Date: Re: NSArray toString() different in WO 5.4.3
  • Previous by thread: NSArray toString() different in WO 5.4.3
  • Next by thread: Re: NSArray toString() different in WO 5.4.3
  • Index(es):
    • Date
    • Thread