[
https://issues.apache.org/jira/browse/SYNCOPE-574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14176983#comment-14176983
]
Guido Wimmel commented on SYNCOPE-574:
--------------------------------------
Probably the reason is that in Java 8, an improvement was implemented to make
use of Comparable when adding Objects to a HashMap [1] (which is used in the
implementation of HashSet). ConnConfProperty.compareTo() doesn't handle the
case when schema == null, which however is the case in
ConnInstanceDataBinder:255.
If I change ConnConfProperty.compareTo() handle schema == null (e.g. by using
the null-safe compare method in commons lang ObjectUtils), the build is
successful.
[1] http://openjdk.java.net/jeps/180
> NullPointerException in ConnInstanceDataBinder with Java 8
> ----------------------------------------------------------
>
> Key: SYNCOPE-574
> URL: https://issues.apache.org/jira/browse/SYNCOPE-574
> Project: Syncope
> Issue Type: Bug
> Components: common, core
> Affects Versions: 1.2.0, 1.3.0
> Environment: jdk-8u25-windows-x64, Tomcat 7.0.56
> Reporter: Guido Wimmel
> Priority: Minor
>
> Not sure if this can be reproduced, but in my environment, when building
> Syncope core with Java 8, the ConnnectorTestITCase fails with a
> NullPointerException (see stack trace below).
> {code}
> 17:18:22.561 ERROR
> org.apache.syncope.core.rest.utils.RestServiceExceptionMapper - Exception
> thrown by REST method: null
> java.lang.NullPointerException
> at
> org.apache.syncope.common.types.ConnConfProperty.compareTo(ConnConfProperty.java:67)
> ~[syncope-common-1.2.1-SNAPSHOT.jar:?]
> at
> org.apache.syncope.common.types.ConnConfProperty.compareTo(ConnConfProperty.java:30)
> ~[syncope-common-1.2.1-SNAPSHOT.jar:?]
> at java.util.HashMap.compareComparables(HashMap.java:371) ~[?:1.8.0_25]
> at java.util.HashMap$TreeNode.treeify(HashMap.java:1920) ~[?:1.8.0_25]
> at java.util.HashMap.treeifyBin(HashMap.java:771) ~[?:1.8.0_25]
> at java.util.HashMap.putVal(HashMap.java:643) ~[?:1.8.0_25]
> at java.util.HashMap.put(HashMap.java:611) ~[?:1.8.0_25]
> at java.util.HashSet.add(HashSet.java:219) ~[?:1.8.0_25]
> at
> org.apache.syncope.core.rest.data.ConnInstanceDataBinder.getConnInstanceTO(ConnInstanceDataBinder.java:225)
> ~[ConnInstanceDataBinder.class:?]
> at
> org.apache.syncope.core.rest.controller.ConnectorController.list(ConnectorController.java:142)
> ~[ConnectorController.class:?]
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)