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

JavaCompiler.getTask(....) has longer parameter lists.

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 7
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      Item 25 of Effective java says:
      "
      ==>Avoid long parameter lists: As a rule, three parameters should be viewed as a practical maximum, and fewer is better. Most programmers can't remember longer parameter lists. If many of your methods exceed this limit, your API won't be usable without constant reference to its documentation.
      ==> Long sequences of identically typed parameters are especially harmful. Not only won't the users of your API be able to remember the order the parameters, but when they transpose parameters by mistake, their programs will still compile and run. They just won't do what their author intended.
      "

      I feel its very true for
      JavaCompiler.getTask(Writer out, JavaFileManager fileManager, DiagnosticListener<? super JavaFileObject> diagnosticListener, Iterable<String> options, Iterable<String> classes, Iterable<? extends JavaFileObject> compilationUnits) .
      Its very difficult to use this method without constant reference of the documentation, also
      it has identical sequence of Iterable<String>.

      Is it possible to set this values through some property object? or breaking this method.

        Attachments

          Activity

            People

            • Assignee:
              jjg Jonathan Gibbons
              Reporter:
              savadhansunw Seetharama Avadhanam (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Imported:
                Indexed: