I'm reading from an XML file to populate some data structures and I run into this sort of problem when I inspect my final structure:
arrayName
[0] = null
[1] = input
[2] = null
[3] = input
etc
input is what I want, and the type is my own class.
I'm used to C# so I'd use LINQ to get rid of them normally, idea for doing something like this in Java?
I'm going to look at what's wrong with the code that's making it happen but for now I need a quick solution.
Ideas?
EDIT:
I found the issue, I create an array of size doc.getChildNodes().getLength(), and when I'm setting elements in the array (while looping through), I check if
getNodeType() == Node.ELEMENT_NODE)
And it doesn't work half the time. Problem is, I initialise the array based on the size, so half the array gets filled.
Ideas?
null.nullkind of means removed or lack of.