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

java.awt.font.TransformAttribute.equals(null) throws NPE

    XMLWordPrintable

Details

    • 2d
    • b110
    • generic
    • generic
    • Verified

    Description

      Platform: all
      JDK: 7, 8

      The following method
      http://download.oracle.com/javase/7/docs/api/java/awt/font/TransformAttribute.html#equals%28java.lang.Object%29

      does not say anything regarding comparison with null argument value.

      However implementation produces NPE.

      Please see the following code sample:

      import java.awt.font.TransformAttribute;
      import java.awt.geom.AffineTransform;

      public class TrAttrEqNull {

          public static void main(String[] args) {
              final TransformAttribute ta =
                      new TransformAttribute(new AffineTransform(1, 0, 1, 1, 0, 0));
              ta.equals(null);
          }
      }

      The output will be:

      Exception in thread "main" java.lang.NullPointerException
      at java.awt.font.TransformAttribute.equals(TransformAttribute.java:149)

      Attachments

        Activity

          People

            prr Philip Race
            dbessono Dmitry Bessonov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: