4 ms·
There are quite a few breaking changes in Java 8, here's the official compatibility guide: http://www.oracle.com/technetwork/java/javase/8-compatibility-guide-
by notimetorelax 13y ago
There are quite a few breaking changes in Java 8, here's the official compatibility guide:
http://www.oracle.com/technetwork/java/javase/8-compatibility-guide-2156366.html http://www.oracle.com/technetwork/java/javase/8-compatibilit...
One worth noting: If existing code is using Proxy.getProxyClass and the Constructor.newInstance method to create a proxy instance, it will fail with IllegalAccessException. RFE 4487672
- RyanZAG 13y agoWhy would you ever do that..? If your production code is using those kind of proxies, it must be one terrible mess. First order of businesses would be to fix the code at the very least.
- notimetorelax 13y agoThis used to be the right way to create dynamic proxies. Why one would do this is another discussion. For completeness here's a link to the usage in Spring: https://github.com/spring-projects/spring-framework/search?q=Proxy.getProxyClass https://github.com/spring-projects/spring-framework/search?q...
- RyanZAG 13y agoThe Spring code is still fine. You didn't quote the entire advisory: > If existing code is using Proxy.getProxyClass and the Constructor.newInstance method to create a proxy instance, it will fail with IllegalAccessException if the caller is not in the same runtime package as the non-public proxy interface. For such code, it requires a source change to either (1) call Constructor.setAccessible to set the accessible flag to true, or (2) use the Proxy.newProxyInstance convenience method. To end up in that specific condition is fairly difficult and usually means something is wrong with the code to begin with. It's still a very easy fix in any event (adding in 1 extra line of code before the call).