[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [mat-dev] fix for CollectionFillRatioQuery.java for null tables
|
Thanks for the hint, Andrew! I changed it.
-----Original Message-----
From: mat-dev-bounces@xxxxxxxxxxx [mailto:mat-dev-bounces@xxxxxxxxxxx]
On Behalf Of Andrew Johnson
Sent: Freitag, 3. Oktober 2008 15:59
To: mat-dev@xxxxxxxxxxx
Subject: [mat-dev] fix for CollectionFillRatioQuery.java for null tables
I think the fix for CollectionFillRatioQuery to deal with HashMaps under
construction isn't quite right.
Would this be better?
### Eclipse Workspace Patch 1.0
#P org.eclipse.mat.api
Index:
src/org/eclipse/mat/inspections/collections/CollectionFillRatioQuery.jav
a
===================================================================
---
src/org/eclipse/mat/inspections/collections/CollectionFillRatioQuery.jav
a
(revision 150)
+++
src/org/eclipse/mat/inspections/collections/CollectionFillRatioQuery.jav
a
(working copy)
@@ -148,7 +148,7 @@
int size = info.getSize(hashtableObject);
IObjectArray table = info.getBackingArray(hashtableObject);
- if (table.getLength() == 0 || table.getLength() == 0)
+ if (table == null || table.getLength() == 0)
return 1; // 100% if the array has length 0 --> the good
ones
return (double) size / (double) table.getLength();
Andrew Johnson
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU
_______________________________________________
mat-dev mailing list
mat-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/mat-dev