JaroslavTulach commented on a change in pull request #3764:
URL: https://github.com/apache/netbeans/pull/3764#discussion_r824822359
##########
File path:
ide/schema2beans/src/org/netbeans/modules/schema2beansdev/gen/JavaUtil.java
##########
@@ -874,10 +874,16 @@ public static int getOptimialHashMapSize(Object[] keys,
int maxSize) {
}
return table.length;
}
- } catch (java.lang.IllegalAccessException e) {
- return defaultAnswer;
- } catch (java.lang.NoSuchFieldException e) {
+ } catch (IllegalAccessException | NoSuchFieldException e) {
return defaultAnswer;
+ } catch (RuntimeException ex) {
+ // todo: remove this workaround post JDK 9+ migration
+ // modules on modern JDKs should prefere immutable collections
anyway, e.g Map.of();
Review comment:
There is a way to use `Map.of`. Described in my [Run on JDK8, use JDK11
APIs post](http://wiki.apidesign.org/wiki/AlternativeImplementation) - if you
believe this case deserves that design pattern (I don't), feel free to do
implement it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists