File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
perun-base/src/main/java/cz/metacentrum/perun/core/api Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -112,12 +112,20 @@ public boolean equals(Object obj) {
112112 return false ;
113113 }
114114 if (attributes == null ) {
115- if (other .getAttributes () != null ) {
116- return false ;
117- }
118- } else if (!this .getAttributes ().equals (other .getAttributes ())) {
115+ return other .getAttributes () == null ;
116+ }
117+ if (this .getAttributes ().size () != other .getAttributes ().size ()) {
119118 return false ;
120119 }
121- return true ;
120+
121+ List <Attribute > sortedThis = this .getAttributes ().stream ()
122+ .sorted ()
123+ .toList ();
124+
125+ List <Attribute > sortedOther = other .getAttributes ().stream ()
126+ .sorted ()
127+ .toList ();
128+
129+ return sortedThis .equals (sortedOther );
122130 }
123131}
You can’t perform that action at this time.
0 commit comments