codahale/metrics — Issue #134: Can't create metric instances in the default package
Author: collinvandyck
Created: 2011-12-12 19:51:33+00:00
State: open

Creating a metric in the default package results in a NPE in the MetricName constructor when evaluating

```java

public MetricName(Class klass, String name, String scope) {
this(klass.getPackage().getName(),
klass.getSimpleName().replaceAll("\\$$", ""),
name,
scope);
}

```

```klass.getPackage()``` returns null in this case.

This occurs under version 2.0.0-BETA18-SNAPSHOT.