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.

Reflection access from context objects

See original GitHub issue

In the version 2.6.1 (currently the latest version), it is no longer possible to access the relevant reflection object from the relevant context objects. For example, when writing a custom OperationBuilderPlugin in version 2.5.0, I could get the appropriate java.lang.reflect.Method from the OperationContext by calling context.getHandlerMethod().getMethod(); but I no longer see any way to accomplish this.

Assuming you don’t want to prevent developers from writing custom plugins that require access to reflection-based objects like this, I can see 3 options:

  • Add back getHandlerMethod() and similar methods to various context objects for full backward-compatibility (I assume you had a reason for removing the method in the first place, so I don’t expect this will be a viable option)
  • Add a method to the context object to access the reflection object directly, like OperationContext.getReflectionMethod()
  • Add some kind of mechanism for developers to provide their own implementation of context objects

Depending on the approach, I would be happy to work on this and submit a pull request.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:20 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
piglingcncommented, Jun 4, 2018
0reactions
dilipkrishcommented, Aug 28, 2018

You know you can use something like @Description annotation and create your own plugin to read that right?

Read more comments on GitHub >

github_iconTop Results From Across the Web

CustomReflectionContext Class (System.Reflection.Context)
CustomReflectionContext provides a way for you to add or remove custom attributes from reflection objects, or add dummy properties to those objects, without...
Read more >
sql - Acessing Calling Context from a Reflection Assembly in C#
I have a windows service written in C# that sends emails based on variables in an XML file this includes access to SQL...
Read more >
Attachmate.Reflection.Objects.Emulation.Common Library
Common Library. Represents an individual item within a context menu. Defines valid values used to determine a field's attributes. HostField represents a field ......
Read more >
How to: Load Assemblies into the Reflection-Only Context
The reflection-only load context allows you to examine assemblies compiled for other platforms or for other versions of the .NET Framework.
Read more >
ReflectivePropertyAccessor (Spring Framework 6.0.2 API)
A powerful PropertyAccessor that uses reflection to access properties for reading and possibly also for writing on a target instance.
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