Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8123049

NPE thrown from EventType.EventTypeSerialization#findSubType

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8
    • 8
    • javafx
    • None

      Encountered a failure in EventTypeTest -

      Caused by: java.lang.NullPointerException
      at javafx.event.EventType$EventTypeSerialization.findSubType(EventType.java:228)
      at javafx.event.EventType$EventTypeSerialization.readResolve(EventType.java:214)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1104)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1808)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1349)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
      at javafx.event.EventSerializationTest.testUnknownEventTypeSerialization(EventSerializationTest.java:98)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
      at org.junit.internal.runners.statements.ExpectException.evaluate(ExpectException.java:22)

      Most likely because 't' is null in this block of code:

              private EventType findSubType(Set<EventType> subTypes, String name) {
                  for (EventType t : subTypes) {
                      if (((t.name == null && name == null) || (t != null && t.name.equals(name)))) {
                          return t;
                      }
                  }
                  return null;
              }

            msladecek Martin Sládeček
            dgrieve David Grieve
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: