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.

Implicit fallback converter for Object, CharSequence and Serializable

See original GitHub issue

String extends Object and implements CharSequence and Serializable. It makes no sense to force users to write their own no-op converters if these types are requested. Instead there should be a fallback to simply cast to the requested type, if no explicitly registered converter for the type is found, and the value could be cast to the requested type (i. e., the requested type is either Object, CharSequenceor Serializable):

if (no_converter_found && no_implicit_conversion_found && Arrays.asList(Object.class, CharSequence.class, Serializable.class).contains(requestedClass))
    return requestedClass.cast(propertyValue);

Issue Analytics

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

github_iconTop GitHub Comments

mkargcommented, Mar 4, 2020

@mkarg any additional comments? I’d like to either move this issue forward or close it.

Oops, missed your original answer. Sorry for that. Please keep it open for short, I will answer ASAP.

dmlloydcommented, Mar 4, 2020

@mkarg any additional comments? I’d like to either move this issue forward or close it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

System.Text.Json source generator fallback - .NET
Text.Json source generator will no longer implicitly fall back to reflection-based serialization for unrecognized types. Previous behavior.
Read more >
Scala implicit Long to Serializable - java - Stack Overflow
An implicit won't make scala.Long extend Serializable . You can either use java.lang.Long or create a class like case class SerializableLong(x: Long) ...
Read more >
StringValue - Saxonica
Convert to Java object (for passing to external functions) ... Note that although a StringValue may wrap any kind of CharSequence (usually a...
Read more >
StringBuilder - Scala 3 - EPFL
def append(cs: CharSequence): StringBuilder ... Convert collection to array. Convert collection to array. ... Returns a string representation of the object.
Read more >
Scio 0.7: a deep dive - Spotify Engineering
Luckily Kryo happens to serialize the CharSequence type as a UTF-8 ... wraps the implicitly scoped Coder as a com.spotify.scio.coders.
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 Post

No results found

github_iconTop Related Hashnode Post

No results found