|Re: eclipse - how to change package explorer sorting order (don't want lexicographic sorting)? [message #991418 is a reply to message #991417]
||Wed, 19 December 2012 02:09
| Leon Kingston
Registered: December 2012
You're totally right. I actually didn't write the part of this program that read the logs, so I didn't want to touch the code for that, but your post helped me find a really critical bug. While I thought Eclipse was the problem, it turns out that was not the case and Eclipse just helped me see what the issue was!
First thing I noticed was that everything was in the wrong place (i.e. Sonication2's values were actually Sonication10's). Then I noticed Eclipse had the files listed in this manner, so I immediately blamed it without thinking and wanted a way to properly sort them in the package explorer, figuring this was the order it read the files. Well it was, but it didn't read them like that just because Eclipse listed them like that! With further research, I learned this was lexicographic order. In the code that reads these logs, there was a typical Java File array from created by listFiles(), and a loop that would go through this array to get all the filenames. Then, I found out listFiles() ALSO sorts in lexicographic order! I just had to resort the array it created that in alphabetical order and the program reads perfectly now.
[Updated on: Wed, 19 December 2012 02:10]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01822 seconds