Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7901651

ExtraPropDefns might detect class name incorrectly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P3 P3
    • None
    • jt4.2
    • tools
    • None

      ExtraPropDefns the class which handles "extra property definitions" for @requires clauses uses the following patterns to extract the class name java source:

          private static Pattern packagePattern =
                  Pattern.compile("package\\s+(((?:\\w+\\.)*)(?:\\w+))\\s*;");
          private static Pattern classPattern =
                  Pattern.compile("(?:public\\s+)?(?:class|enum|interface)\\s+(\\w+)");

      When I defined my class as:
      /**
       * The class to be invoked by jtreg prior Test Suite execution to
       * collect information about VM.
       */
      public class VMProps implements Callable<Map<String, String>> {
         ...
      }

      jtreg reported a very confusing message:

      java.lang.ClassNotFoundException: requires.to
      Error: failed to get JDK properties for /set/java/re/jdk/9/promoted/latest/binaries/solaris-x64/bin/java ; exit code 1


            jjg Jonathan Gibbons
            dfazunen Dmitry Fazunenko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: