what are the purpose of parameters first, last and mid if an ArrayList has properties that can get you these values easily (and much more, judging by your code)? taking advantage of this, you can easily avoid a bad index and a lot of trouble. if you're using a class like this, you need to check out the api.
I found the problem: the newarray ArrayList was empty.
But can anyone help me with how to do this:
copy newarray to array[first to (last-1)]
which should be the last line in the merge method, in place of "array = newarray"?
you can get from the original arraylist and just add to the new arraylist. i don't know if there is a more efficient way to do this off the top of my head, but you should just read the arraylist api and figure out for yourself whatever solution you are most comfortable with.
also, "array = newarray" will do nothing for your program as a whole. in recursion, you're passing a reference of your arraylist down, so by saying array = newarray, the parent call will not know of this reassignment. instead, you need to directly modify the "array".