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.

[Question] TypeMatcher for Thread class and subclasses?

See original GitHub issue

ByteBuddy version: 1.10.10.

I’m trying to instrument java.lang.Thread class and its subclasses using the following matcher:

  • TypeMatcher: hasSuperType(named("java.lang.Thread"))).or(named("java.lang.Thread")
  • CLMatcher: any()

The classes which extends java.lang.Thread are discovered by the agent but the java.lang.Thread itself is not.

If I use

  • TypeMatcher: named("java.lang.Thread")
  • CLMatcher: any()

The java.lang.Thread is discovered by the agent without problems.

Is there a mistake in the TypeMatcher I’m using? Is there any limitation in this kind of TypeMatchers?

Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
raphwcommented, May 18, 2020

I assume they do some things to monitor started thread what then gets in the way.

0reactions
drodriguezhdezcommented, May 18, 2020

Thanks for your help! I close the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Confusion with subclassing a threading class, and inheritance
If I try to call MyThread._target I get an error. So it seems as if they are creating a completely new init ....
Read more >
Subclassing Thread and Overriding run
The first way to customize a thread is to subclass Thread (itself a Runnable object) and override its empty run method so that...
Read more >
Python Multithreading Tutorial: Subclassing Thread - 2020
To create our own thread in Python, we'll want to make our class to work as a thread. For this, we should subclass...
Read more >
TypeMatcher class - matcher library - Flutter - Dart API docs
A Matcher subclass that supports validating the Type of the target object. expect(shouldBeDuration, TypeMatcher<Duration>());.
Read more >
Java.lang.Thread Class in Java - GeeksforGeeks
Java provides a thread class that has various method calls in order to manage the behavior of threads by providing constructors and methods...
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