Yes that makes sense to me, I'll fix that as part of my merge, thanks! Colm.
On Tue, Dec 13, 2016 at 12:40 PM, Francesco Chicchiriccò < ilgro...@apache.org> wrote: > On 13/12/2016 13:31, Colm O hEigeartaigh wrote: > >> The following case in JPAConfDao will result in a ClassCastException as >> JPACPlainAttrValue does not implement the interface PlainAttrUniqueValue. >> >> JPACPlainAttrValue attrValue; >> if (newAttr.getSchema().isUniqueConstraint()) { >> attrValue = new JPACPlainAttrValue(); >> ((PlainAttrUniqueValue) attrValue).setSchema(newAttr.getSchema()); >> } >> >> What should this be instead? >> > > > I guess you are referring to [1]; to me, the highlighted snippet should > become > > PlainAttrValue attrValue; > if (newAttr.getSchema().isUniqueConstraint()) { > attrValue = new JPACPlainAttrUniqueValue(); > ((PlainAttrUniqueValue) attrValue).setSchema(newAttr.g > etSchema()); > } else { > attrValue = new JPACPlainAttrValue(); > } > > WDYT? > > [1] https://github.com/apache/syncope/blob/2_0_X/core/persistenc > e-jpa/src/main/java/org/apache/syncope/core/persistenc > e/jpa/dao/JPAConfDAO.java#L71-L77 > > -- > Francesco Chicchiriccò > > Tirasa - Open Source Excellence > http://www.tirasa.net/ > > Member at The Apache Software Foundation > Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail > http://home.apache.org/~ilgrosso/ > > -- Colm O hEigeartaigh Talend Community Coder http://coders.talend.com