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

Remove redundant method in generated code

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • None
    • None
    • tools

      As we have introduced `SymbolLookup::FindOrThrow` we could remove the generated method:

      ```
          public static MemorySegment findOrThrow(String symbol) {
              return SYMBOL_LOOKUP.find(symbol)
                      .orElseThrow(() -> new UnsatisfiedLinkError("unresolved symbol: " + symbol));
          }
      ```

      However, this can only be made if targeting Java 23 or later so there is a compatibility issue to be solved here.

            nbenalla Nizar Benalla
            pminborg Per-Ake Minborg
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: