0

simply, I want to check if an Element is deleted from a list, and than do some actions after that. Here is a snippet of my code:

(...)
private CollectionUtils removed;    
    public void subscription() {    
            if (CollectionUtils.isEmpty(save)) {
                System.out.println("blabla");
                JsfUtils.addTranslatedMessageToTarget(FacesMessage.SEVERITY_INFO, null, "bla");
            } else if (CollectionUtils.subtract(save, removed)){ //Check if element is deleted
                System.out.println(removed + " blablaca");
            } else {
                System.out.println("blabla");
            }

        }

I edited and cut some code because its for a company I work for. At subtract he suggest to cast the Collection Type on "Collection", which doesnt make any sense for me. As Exception it points out an nullpointer exception.

Thanks

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
sickzz1
  • 29
  • 2
  • 7
  • Check what 'CollecionUtils.subtract' does... That is not jsf or hibernate related – Kukeltje Nov 10 '16 at 10:09
  • Have you tried the List/Collection#contains and/or List/Collection#indexOf element ? i am not sure to understand well what you want to do. – Incepter Nov 10 '16 at 10:12

0 Answers0