Skip to content

Commit

Permalink
fix Aspects exclude is true if one Aspects is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasHefti committed Nov 17, 2016
1 parent 73aeb67 commit 9346513
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/inari/commons/lang/aspect/Aspects.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public final boolean include( Aspects aspects ) {
public final boolean exclude( Aspects aspects ) {
checkType( aspects );
if ( bitset.isEmpty() || aspects.bitset.isEmpty() ) {
return false;
return true;
}

if ( this == aspects ) {
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/com/inari/commons/lang/aspect/AspectsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ public void testExclude() {
Aspects aspect3 = aspectGroup.createAspects();
Aspects aspect4 = aspectGroup.createAspects();

assertFalse( aspect1.exclude( aspect2 ) );
assertFalse( aspect2.exclude( aspect3 ) );
assertFalse( aspect4.exclude( aspect4 ) );
assertTrue( aspect1.exclude( aspect2 ) );
assertTrue( aspect2.exclude( aspect3 ) );
assertTrue( aspect4.exclude( aspect4 ) );

aspect1.bitset.set( 1 );
aspect1.bitset.set( 3 );
Expand Down

0 comments on commit 9346513

Please sign in to comment.