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

Code snippets in java.nio classes should use @replace for uncompilable content

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • tbd
    • 21
    • core-libs
    • generic
    • generic

      Ideally the content copied to the clipboard from snippets containing code should be compilable. For variable initialization, the snippet

           * {@snippet lang=java :
           * Path path = ...
           * }

      should be manifested in the clipboard as something like

           Path path = null;

      rather than

           Path path = ...

      which could be effected using @replace:

           * {@snippet lang=java :
           * Path path = null; // @replace substring=“ = null;” replacement=“...”
           * }

      In the case of non-specific omitted code such as

       * {@snippet lang=java id="be" :
       * try {
       * begin();
       * // Perform blocking I/O operation here
       * ...

      the snippet could be changed to

       * {@snippet lang=java id="be" :
       * try {
       * begin();
       * // Perform blocking I/O operation here
       * code: // @replace substring=“code:” replacement=“...”

            bpb Brian Burkhalter
            bpb Brian Burkhalter
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: