JDK-8057919 - Java Issue Tracker
The method toMethodDescriptorString is more suitable if unambiguous spellings are required. Meanwhile, if we were to use Class.getName to build MethodType.
The method toMethodDescriptorString is more suitable if unambiguous spellings are required. Meanwhile, if we were to use Class.getName to build MethodType.
MyTest Classfile xxx/MyTest.class Last modified Sep 8, 2016; size 1142 bytes MD5 checksum 2b2abc16281f5f368a40eb0c6e7d550f Compiled from "MyTest.java" public class MyTest minor version: 0 major version: 52 flags: ACC_PUBLIC, ACC_SUPER Constant pool...
If a method calling AClass.giveMeANumber() was expecting a Number object, I see no objection to giving it an Integer object.In comparison, the java.text.Format.parseObject(String) is implemented in a similar way, except that its error message is more general (and less explicit)
This could be a method like Test<String> t = Test<String>(); parameters = Test.class.getActualParameters(obj); other = Test.class.getActualParameters(obj); JUSTIFICATION : I have needed it for my experimental framework but other developers will need to face it.
The behaviour can even be "cloaked" by using java.util.regex classes: Matcher.group() etc. which seem to use substring internally for String extraction. This way it's nearly impossible to detect the memory leak. This behaviour is totally independent of OS, Java Version, VM type etc.
Java SE. Community. Bug Database.A DESCRIPTION OF THE REQUEST : With reference to bug report 4191731: Method Class.getDeclaringClass() returns null when called for anonymous member classes.