A little background about what I am trying to do may be in order. I work on several forums specializing in malware removal. The malware we remove tends to be weeks ahead of commercial applications catching up, so we come up with our own tools for analysis, etc. In the process of coming up with new fixes, we frequently infect our own
test systems, and analyze the changes.
What I am trying to do is compare registry files, which are basically just text files...that part is easy enough. A typical registry key looks something like this:
The registry keys vary in size, from one line, to hundreds. When I started this little venture, I decided that since there was an unknown amount of keys in the registry, that an ArrayList would be the way to go. I also decided that since the key lengths varied, that putting them in seperate ArrayLists would be the way to go. So essentially, I would end up with an ArrayList of ArrayLists. Here is my code:
That part seems to be working well. They are returned to the calling class like they are supposed to be. But this is where I get a little confused. In my test class, I have the following:
This seems to print out the keys just fine....but they are not printing exactly like I would expect them to be. To me, that could should only print out the first line of each "key". So if I happened to have read in three keys, I would only expect three lines of output.
If I alter the above code to:
Then it prints out the entire key on one line. I am trying to understand what is happening, or why it is happening. When one prints out an ArrayList containing ArrayLists, does it spit out the entire list? There is some weird twilight zone thing happening that is beyond my understanding....
Anybody still awake out there??