From b076ac8fb482d2ef694f5b941cd8d72a2d9761ef Mon Sep 17 00:00:00 2001 From: Schuyler Eldridge Date: Thu, 7 Nov 2019 12:33:22 -0500 Subject: Use getName instead of getSimpleName This changes uses of `getSimpleName` to `getName`. The former throws idiotic exceptions under Java 8, e.g., `getSimpleName` will fail if used on a class inside an object. This fixes a bug where any call to the `name` method of a custom transform defined inside an object (or in an environment wrapping things in objects like a REPL) will throw a malformed class name exception. E.g., if you do this and run with `-ll info` or your custom transform deletes annotations. Signed-off-by: Schuyler Eldridge --- src/main/scala/firrtl/annotations/JsonProtocol.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/scala/firrtl/annotations') diff --git a/src/main/scala/firrtl/annotations/JsonProtocol.scala b/src/main/scala/firrtl/annotations/JsonProtocol.scala index c3853650..9992400a 100644 --- a/src/main/scala/firrtl/annotations/JsonProtocol.scala +++ b/src/main/scala/firrtl/annotations/JsonProtocol.scala @@ -109,7 +109,7 @@ object JsonProtocol { val annos = parsed match { case JArray(objs) => objs case x => throw new InvalidAnnotationJSONException( - s"Annotations must be serialized as a JArray, got ${x.getClass.getSimpleName} instead!") + s"Annotations must be serialized as a JArray, got ${x.getClass.getName} instead!") } // Recursively gather typeHints by pulling the "class" field from JObjects // Json4s should emit this as the first field in all serialized classes -- cgit v1.2.3