[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Jimplification error



On Tue, 10 Jul 2001, Stephen Andrew Neuendorffer wrote:

> CopyPropagator throws NullPointerException if a local is undefined:
>
>                                     int defCount = ((Integer)
> localToDefCount.get(m)).intValue();
>
>                                     if(defCount == 0)
>                                         throw new RuntimeException("Variable
> " + m + " used without definition!");
>
> But localToDefCount is never initialized to zero, so the nicely useful
> RuntimeException is never thrown.

I take it that this should fix the bug:

Object dcObj = localToDefCount.get(m);

if (dcObj == null)
    throw new RuntimeException("Variable " + m + " used without definition!");

int defCount = ((Integer)dcObj).intValue();

If that's so, I will commit the change.

pat