foursquare/heapaudit — pull request #6 by sfraser (2012-03-23 19:38:21+00:00)
Title: Patches to HeapUtil to keep it from throwing NPE on allocations of zerolength multidim arrays

This is similar to my previous pull request. In this case HeapUtil was having problems with multidim arrays that had explicitly zero length dimensions.

For example this:

```java
char[][] arrayC = new char[0][0];
```

Might cause this:

```
java.lang.NullPointerException
at com.foursquare.heapaudit.HeapUtil.record(HeapUtil.java:196)
```

I added some more tests in unit test TestMULTIARRAY to try various varieties of this issue that were causing issues, and then patched HeapUtil to get the tests to pass. I also added one more test to TestNEWARRAY to sanity check single dimensional zero length arrays.

As on my last pull request, I am not sure if the numbers are accurate on the heap usage of these zero length arrays, but this is a good start on tracking them.