• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reflection issue ...  RSS feed

 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to use reflection. When I do, ClassName.class, i can get no defined constructors and no nothing.

The class itself is generated by a tool.

My question: Is there a possibility that this class is obfuscated ? If yes, is there a way to overcome this issue ?

I have used java Introspector instead, but it does not provide that facilities that I'm looking for, as an example: to look for a specific Method by name, all it provides is a to iterate over the properties and Methods in sequence.

Please advice,
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Obfuscation has no impact on the JVM's ability to get at a class's methods and fields via reflection.

How are you trying to go about this? The basic workings of the reflection API are shown here.
 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But why all the declared methods of the class are returning null?

What may be the cause of this ?

Thanks,
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vassili Vladimir:
But why all the declared methods of the class are returning null?

What may be the cause of this ?

Thanks,


Most likely, it's that your code is wrong.
If you post your code, it will make it easier to give you a more useful answer.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!