getParameterInfo - NullPointerException
See original GitHub issueHi, I tried to get info about parameters in method. But I catch an exception:
System.out.println(Arrays.toString(method.getParameterInfo()));
Exception in thread "Thread-6" java.lang.NullPointerException
at io.github.classgraph.MethodParameterInfo.getAnnotationInfo(MethodParameterInfo.java:138)
at io.github.classgraph.MethodParameterInfo.toString(MethodParameterInfo.java:167)
Snippet of scaner:
try (ScanResult scanResult = new ClassGraph()
.enableAllInfo()
.enableSystemPackages()
.disableJarScanning()
.disableDirScanning()
.whitelistPackages("java", "java.lang", "javax", "javafx")
.blacklistPackages("java.applet", "java.awt")
.scan()) {
// ...
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Unknown Source/NullPointerException accessing java script ...
If non-commented, then I get the same error message on line "getParameterInfo().length" as I get for eval function . Any ideas? Thanks,
Read more >Reading Image file using HTTP Server request : Null Pointer ...
I have developed a service , which gets Image file from HTTP client; input.getRequest().getByteArray() returns NULL, but I..
Read more >RE: RpcException$Companion.callFailed : FL-16271 - YouTrack
ParameterInfoApi#getParameterInfo> has failed: Failure[java.lang.NullPointerException: Parameter specified as non-null is null: method ...
Read more >RequestContext (CDS Services API 1.19.0 API) - javadoc.io
This method will throw a NullPointerException , if the passed CdsRuntime was null, but guarantees that it will never ... ParameterInfo getParameterInfo().
Read more >GetParameterInfo—ArcGIS Pro | Documentation
Display some parameter object properties for the specified tool. import arcpy # Load tool parameter objects into list. params = arcpy.GetParameterInfo("HotSpots ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@MrChebik Glad it’s working for you with the latest version.
See the Javadoc for
MethodParameterInfo#getName()
:https://github.com/classgraph/classgraph/blob/master/src/main/java/io/github/classgraph/MethodParameterInfo.java#L74
You need to compile your code with the
-parameters
switch (and you have to be using JDK 8+) for method parameter names to be stored in the classfile by the compiler. If you don’t do that, then thetoString()
method just uses “_unnamed_param” instead.(Eclipse has its own equivalent config option to the
-parameters
switch.)Hi @MrChebik, I believe this is a bug that was fixed a few versions ago. Can you please test with the latest version and see if it resolves the problem?