i have this two POJOS
i have this two methods
this method: searchRolesByUser returns a list of roles with a empty permList, i mean the roles dont have perms in this list.
And this method searchPermsByRoleName returns a list of perms
so i want to add to my list roles that have empty perms in their field private ArrayList<Perm> permList those perms that i have in the list that returns the method searchPermsByRoleId
here is the two ways that i have tried to add them but when i get to the part getPermsList().add(perm) i get a null pointer exception.
that method gives me and null pointer exception in this line roleList.get(i).getPermsList().add(permList.get(k));
i dont know why if is the getPermsList() that was the default get that netbeans
ide created for me or the deafult add method that have the Arraylist class
and that method gives me a nullpointer exception in this line rol.getPermsList().add(perm);
i dont know why if is the getPermsList() that was the default get that netbeans ide created for me or the deafult add method that have the Arraylist class