If I try to compile the MQ source using Java 8 it fails with this message:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.4:compile (default-compile) on project mqdisk-io: Compilation failure
[ERROR] C:\src\mq5.1.1\main\persist\disk-io\src\main\java\com\sun\messaging\jmq\io\disk\PHashMap.java:[394,15] error: keySet() in PHashMap cannot over
ride keySet() in ConcurrentHashMap
The cause is that this class subclasses ConcurrentHashMap.
In Java 7 ConcurrentHashMap#keySet() returns a Set
In Java 8 ConcurrentHashMap#keySet() returns a KeySetView<K, V> (which implements Set)
We therefore need to change PHashMap#keySet() so that it returns a KeySetView<K, V>.
There is no requirement to be able to compile the MQ 5.1.1 source using Java 8. However this will doubtless be a requirement of a future version of MQ.
If I try to compile the MQ source using Java 8 it fails with this message:
The cause is that this class subclasses ConcurrentHashMap.
In Java 7 ConcurrentHashMap#keySet() returns a Set In Java 8 ConcurrentHashMap#keySet() returns a KeySetView<K, V> (which implements Set)
We therefore need to change PHashMap#keySet() so that it returns a KeySetView<K, V>.
There is no requirement to be able to compile the MQ 5.1.1 source using Java 8. However this will doubtless be a requirement of a future version of MQ.
Affected Versions
[5.1.1]