Uploaded image for project: 'Maven Indexer'
  1. Maven Indexer
  2. MINDEXER-122

Add getName() to Record.EntryKey

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • None
    • 6.1.0, 6.1.1
    • None

    Description

      Currently I'm doing this to pull the name field out of EntryKey

        @SneakyThrows
        private static MethodHandle entryKeyNameField() {
          return MethodHandles.privateLookupIn(EntryKey.class, MethodHandles.lookup())
              .findGetter(EntryKey.class, "name", String.class);
        }
      
        private static final MethodHandle entryKeyNameField = entryKeyNameField();
      
        @SneakyThrows
        static String getName(EntryKey entryKey) {
          return (String) entryKeyNameField.invokeExact(entryKey);
        }
      

      It would be nice if getName() was a method on EntryKey itself.

      Attachments

        Activity

          People

            slachiewicz Sylwester Lachiewicz
            sixcorners Stephen Buergler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: