question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add get to TextMap

See original GitHub issue

I complained about this a couple years ago, but re-complaining as it seems possible some things can change now.

TextMap is accidentally constrained to an awkward pattern where you can add keys by name, but not retrieve by name. This is awkward because getting by name involves creating an iterator then scanning it. It also encourages people to cast to vendor types like this for routine functionality.

I got bored looking to find a single implementation of TextMap that doesn’t support get by name natively or that doesn’t instantiate an intermediate java Map due to the awkwardness! The net result is guaranteed less efficient operations for the most common propagation use cases.

Can we please fix this as it will remove a lot of spaghetti. The fix is to add @Nullable String get(String key)

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
felixbarnycommented, Sep 14, 2018

The current method Iterator<Map.Entry<String, String>> iterator(); also suggests that multi-values are not expected (although technically, there could be multiple entries with the same key). I’m not sure if those would be needed for the tracing use-case. I’d say, the adapter should get the first header. If you think there is a use case to get the list of headers, I’d add two methods, so that no objects have to be allocated for the common case:

  • @Nullable String getFirst(String key)
  • List<String> get(String key)

Otherwise, big +1. Seems like a no-brainer to me.

0reactions
yurishkurocommented, Sep 28, 2018

Yeah, sgtm.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using TextMap - User Guide - LexisNexis
To get started using TextMap, we offer a variety of resources for you ... TextMap allows you to add and remove toolbar buttons...
Read more >
LexisNexis TextMap - Annotation, Redact, Report - YouTube
TextMap ® allows you to efficiently search, annotate, select text for redaction, and create summary reports to help you develop your case ...
Read more >
LexisNexis TextMap Overview - YouTube
TextMap ® allows you to search, annotate, add notes, create summary reports and cull key transcript passages for use in developing your case ......
Read more >
Facts - LexisNexis ® Support
Both of you have facts to add to the same case. ... Optionally, use Documents to upload documents or TextMap to upload transcripts....
Read more >
What's New TextMap 2 - DRAFT
As we developed TextMap 2, our goal was to add significant enhancements while ... imported transcripts that were 25 lines per page and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found