Lucas Franceschi
Software Developer for SGI Sistemas, [email protected]
Originally posted by Campbell Ritchie:
Welcome to JavaRanch![]()
Difficult to understand this problem, but I think you are making things far too complicated.
Where are you getting the out of bounds exception? You ought not to catch such an unchecked Exception at all, but find out why it occurring and prevent it. You have two for loops which appear correctly formed, so they ought not to throw exceptions.
You are creating an ArrayList[] which looks strange; an ArrayList ought to be parameterised (ArrayList<Foo>and you ought not to create an array of parameterised objects. It is however easy to create a List<List<Foo>>.
Why are you using a switch (which ought to have 12 "break;" statements, please, not 11)?
You can set up the Mes variable much more easily like thisYour populating your data from a pair of HashMaps looks very complicated. What you are passing doesn't look like a typical use for a Map, but an object in its own right.I don't understand where you get the ArrayLists from, but that looks like something which ought to be a field of the ChartData object too.
This ChartData object will be very large!
Your 5 Soma numbers and the number for the month look like values which ought to be in their own object too.
I can't see just looking at your code why you are losing the loop. I suspect the Exception occurs because you are trying to get 6 objects out of an ArrayList which doesn't contain 6 objects, but you should be able to work that out from the stack trace. Are you sure it is the ArrayIndexOutOfBoundsException causing the trouble; you have two catches (NullPointer and IllegalArgument) which you ought not to use, but include System.exit(-1) and your catch (IOException) also includes an exit call.
Lucas Franceschi
Software Developer for SGI Sistemas, [email protected]
Cheers, Martijn,
Twitter.
the reason is that, when system throws the "ArrayIndexOutOfBoundsException", it just print the StackTrace, and SHOULD continue the loop normally.
but....
it doesn't.
Lucas Franceschi
Software Developer for SGI Sistemas, [email protected]
Lucas Franceschi
Software Developer for SGI Sistemas, [email protected]
Joanne
Lucas Franceschi
Software Developer for SGI Sistemas, [email protected]
Lucas Franceschi
Software Developer for SGI Sistemas, [email protected]
Consider Paul's rocket mass heater. |