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

SnippetTaglet should report an error if provided ambiguous links

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • 25
    • 24, 25
    • tools
    • None

      Consider code like:

      ```
      interface One {
          /**
           * {@code One obj1}
           * {@snippet lang = java:
           * // @link substring="ab" target="One#ab" :
           * obj1.ab(a()); // @link substring="a" target="#a"
           *} class comment
           */
          void start();
          int a();
          void with();
          void ab(int i);
      }
      ```

      The "a" in "ab" matches for two regexes, this creates ambiguity, which is resolved at random.

      An error should be reported to inform users about this, something like "error: ambiguous link in <location>"

            nbenalla Nizar Benalla
            nbenalla Nizar Benalla
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: