• 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: NPE in WOHTTPConnection readResponse()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NPE in WOHTTPConnection readResponse()


  • Subject: Re: NPE in WOHTTPConnection readResponse()
  • From: "Mr. Pierre Frisch" <email@hidden>
  • Date: Tue, 22 Jan 2008 14:39:21 -0800

I had another look at the code I think there is a bug in Wonder implementation of NSArray.toArray(); If this method is invoked on an empty array it will cause a NPE.


public <T> T[] toArray(T objects[]) {
// ak: the original imp is plain garbage. Who came up with this?
// NSArray array = arrayByAddingObjectsFromArray(new NSArray(objects));
// return (T[]) array.objects();
if(objects.length < _objects.length) {
objects = (T[]) java.lang.reflect.Array.newInstance(objects.getClass().getComponentType(), _objects.length);
}
for (int i = 0; i < _objects.length; i++) {
objects[i] = (T) _objects[i];
}
return objects;
}
smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: NPE in WOHTTPConnection readResponse()
      • From: Anjo Krank <email@hidden>
    • Re: NPE in WOHTTPConnection readResponse()
      • From: Mike Schrag <email@hidden>
    • Re: NPE in WOHTTPConnection readResponse()
      • From: Mike Schrag <email@hidden>
References: 
 >NPE in WOHTTPConnection readResponse() (From: Thomas <email@hidden>)
 >Re: NPE in WOHTTPConnection readResponse() (From: Alexander Spohr <email@hidden>)
 >Re: NPE in WOHTTPConnection readResponse() (From: Thomas <email@hidden>)
 >Re: NPE in WOHTTPConnection readResponse() (From: "Mr. Pierre Frisch" <email@hidden>)
 >Re: NPE in WOHTTPConnection readResponse() (From: Thomas <email@hidden>)
 >Re: NPE in WOHTTPConnection readResponse() (From: "Mr. Pierre Frisch" <email@hidden>)
 >Re: NPE in WOHTTPConnection readResponse() (From: Mike Schrag <email@hidden>)

  • Prev by Date: Re: NPE in WOHTTPConnection readResponse()
  • Next by Date: Re: NPE in WOHTTPConnection readResponse()
  • Previous by thread: Re: NPE in WOHTTPConnection readResponse()
  • Next by thread: Re: NPE in WOHTTPConnection readResponse()
  • Index(es):
    • Date
    • Thread