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.
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.
That's is, XMLEncoder uses context class loader internally for java.lang.Integer, but it can tolerate null context class loader for java.lang.String. when JS call Java, the context class loader is null, so this bug happens. XMLEncoder should use other classloaders if context classloader is null.
EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - The class should compile with 'p.execute(foo)` inferring 'RuntimeException' as its type argument. ACTUAL - We get a compilation error that is the result of the compiler failing to infer the correct type information.