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

Transformer.setErrorListener() doesn't throw IllegalArgumentException

    XMLWordPrintable

    Details

      Description

      Name: eaR10174 Date: 09/28/2001


        Method javax.xml.transform.Transformer.setErrorListener(ErrorListener listener) is not thrown the
      IllegalArgumentException if listener is null (See test.java below).
        
        The javadoc description (build jdk1.4.0beta-b80) of this method reads:
        
            "public abstract void setErrorListener(ErrorListener listener)
                                     throws IllegalArgumentException
             ...
               Throws:
                  IllegalArgumentException - if listener is null."

      This bug is found in the builds jdk1.4.0-beta3-b80, jaxp-1.1.1-b26-26_jun_2001 and affects a new
      JCK1.4 test
        
      api/javax_xml/transform/Transformer/index.html#GetSetEL[GetSetEL003]

      ------------------------------------test.java-----------------------------
      import javax.xml.transform.TransformerFactory;
      import javax.xml.transform.TransformerException;
      import javax.xml.transform.Transformer;

      public class test {
          public static void main(String argv[]) {
              try {
                  Transformer transformer = TransformerFactory.newInstance().newTransformer();

                  transformer.setErrorListener(null);
              
                  System.out.println("IllegalArgumentException not thrown");
              } catch (IllegalArgumentException e) {
                  System.out.println("OK");
              } catch (TransformerException e) {
                  System.out.println(e.toString());
              }
          }
      }
      ---------------------------------------------------------------------------
      ---------------------------------------------------------------------------
      % java -showversion test
      java version "1.4.0-beta3"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta3-b80)
      Java HotSpot(TM) Client VM (build 1.4.0-beta3-b80, mixed mode)

      IllegalArgumentException not thrown
      ---------------------------------------------------------------------------

      ======================================================================

        Attachments

          Activity

            People

            Assignee:
            gsharmasunw Gopal Sharma (Inactive)
            Reporter:
            evgsunw Evg Evg (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: