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

Unclear URLConnection.setContentHandlerFactory() behavior

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 5.0
    • core-libs
    • generic
    • generic

      In the java.net package there is URLConnection.setContentHandlerFactory() method with following description:
      It can be called at most once by an application.

      I suppose this description is quite strong to be without any explanations in the spec. It would be better to have some reasons according that behavior in the spec.

      Also such behavior causes inconveniences for engineers who use Java to develop applications. They should always remember either the method was still called or not.

      After all it is hard to write test cases to check the compatibility for dependent implementations such as Java Standard Edition and Micro Edition. The method may be called at most once, so it is impossible to cover all the equvivalence class partions cases.

      Finally if there are no any objections to leave such a behavior I suggest to throw it out to have more clear spec since in fact it is not known what should the user get if he/she calls the method setContentHandlerFactory twice or thrice with a null parameter.




      ###@###.### 2005-2-28 16:10:36 GMT

            Unassigned Unassigned
            ydanilev Yury Danilevich (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: