aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/firrtl/annotations
diff options
context:
space:
mode:
authorSchuyler Eldridge2019-11-07 12:33:22 -0500
committerSchuyler Eldridge2019-11-14 13:47:03 -0500
commitb076ac8fb482d2ef694f5b941cd8d72a2d9761ef (patch)
tree5d8221340400fadc8742888d7b435d18ceeab7ba /src/main/scala/firrtl/annotations
parent4d80f5d41a6cd05838999b7b64389fc053325a18 (diff)
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 <schuyler.eldridge@ibm.com>
Diffstat (limited to 'src/main/scala/firrtl/annotations')
-rw-r--r--src/main/scala/firrtl/annotations/JsonProtocol.scala2
1 files changed, 1 insertions, 1 deletions
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