Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Re: Array objects get changed when sorting the array

Reply
Thread Tools

Re: Array objects get changed when sorting the array

 
 
markspace
Guest
Posts: n/a
 
      06-25-2009
Peter Duniho wrote:

> But, absent a specific, useful question I would say that the most likely
> cause of the behavior you're describing would be an incorrect comparison
> implementation, one that returns non-deterministic results.



Well, if we're going to speculate, I see two potential likely issues:

1. OP was unaware of objects with some default values in the array and
incorrectly assumed they were added during the sort.

2. Some other part of the program is changing values and the OP is again
assuming incorrectly that it was the sort that made the changes.
 
Reply With Quote
 
 
 
 
markspace
Guest
Posts: n/a
 
      06-25-2009
Peter Duniho wrote:

> Oh sure, modify the problem statement by presuming (however confidently
> ) that the OP has mis-stated the actual conditions of the problem.



Yeah, that never happens here. I'm really out on a limb, aren't I?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Array objects get changed when sorting the array Roedy Green Java 1 06-25-2009 08:25 PM
class objects, method objects, function objects 7stud Python 11 03-20-2007 06:05 PM
changed state to up changed state to down FastEthernet LINEPROTO-5-UPDOWN surrealarmada@gmail.com Cisco 3 03-07-2007 06:06 PM
scroll position is changed when style is changed? mxbrunet Javascript 1 11-03-2006 03:40 AM
xmlDocument.Save "
" getting changed changed to "&#10" st@jpa.co.jp ASP .Net 1 10-11-2005 01:30 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57