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

Example in javax.script.ScriptEngineFactory.getMethodCallSyntax method description is invalid

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 6
    • core-libs
    • None
    • b53
    • generic
    • generic
    • Verified

      The code example in javax.script.ScriptEngineFactory.getMethodCallSyntax method description contains several typos and fails compilation:

      ------------
      String getMethodCallSyntax(String obj,
                                 String m,
                                 String... args)

      ...

            int ret = obj;
            ^^^
            should be String
            obj += "." + method + "(";
                         ^^^
                         should be "m"
            for (int i = 0; i < args.length; i++) {
                return += args[i];
                ^^^
                should be "ret"
                if (i == args.length - 1) {
                    obj += ")";
                } else {
                    obj += ",");
                              ^
                              invalid symbol
                }
            }
            return ret;
       }
      ------------
      ###@###.### 2005-06-28 03:27:12 GMT

            sundar Sundararajan Athijegannathan
            agavrilosunw Alexey Gavrilov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: