@@ -789,6 +789,7 @@ boolean isRestrictedServiceAllowed(Service service, boolean checkUse) {
789
789
if (debug != null ) {
790
790
debug .println ("Security constraints check of provider." );
791
791
}
792
+ constraints :
792
793
for (Constraint constraint : constraints ) {
793
794
String cType = constraint .type ;
794
795
String cAlgorithm = constraint .algorithm ;
@@ -807,14 +808,14 @@ boolean isRestrictedServiceAllowed(Service service, boolean checkUse) {
807
808
if (debug != null ) {
808
809
debug .println ("The constraint doesn't apply to the service type." );
809
810
}
810
- continue ;
811
+ continue constraints ;
811
812
}
812
813
if (!isAsterisk (cAlgorithm ) && !algorithm .equalsIgnoreCase (cAlgorithm )) {
813
814
// The constraint doesn't apply to the service algorithm.
814
815
if (debug != null ) {
815
816
debug .println ("The constraint doesn't apply to the service algorithm." );
816
817
}
817
- continue ;
818
+ continue constraints ;
818
819
}
819
820
820
821
// For type and algorithm match, and attribute is not *.
@@ -836,7 +837,8 @@ boolean isRestrictedServiceAllowed(Service service, boolean checkUse) {
836
837
+ "\n against the service attribute value: " + sValue );
837
838
}
838
839
if ((sValue == null ) || !cValue .equalsIgnoreCase (sValue )) {
839
- // If any attribute doesn't match, return service is not allowed.
840
+ // If any of the attributes don't match,
841
+ // then this constraint doesn't match so move on.
840
842
if (debug != null ) {
841
843
debug .println ("Attributes don't match!" );
842
844
debug .println ("The following service:"
@@ -845,7 +847,7 @@ boolean isRestrictedServiceAllowed(Service service, boolean checkUse) {
845
847
+ "\n \t Attribute: " + cAttribute
846
848
+ "\n is NOT allowed in provider: " + providerClassName );
847
849
}
848
- return false ;
850
+ continue constraints ;
849
851
}
850
852
if (debug != null ) {
851
853
debug .println ("Attributes match!" );
@@ -903,7 +905,7 @@ boolean isRestrictedServiceAllowed(Service service, boolean checkUse) {
903
905
}
904
906
905
907
// If nothing matching the accepted uses is found in the call stack,
906
- // this service is not allowed .
908
+ // then this constraint doesn't match so move on .
907
909
if (!found ) {
908
910
if (debug != null ) {
909
911
debug .println ("Classes in call stack are not part of accepted uses!" );
@@ -914,7 +916,7 @@ boolean isRestrictedServiceAllowed(Service service, boolean checkUse) {
914
916
+ "\n \t Accepted uses: " + cAcceptedUses
915
917
+ "\n is NOT allowed in provider: " + providerClassName );
916
918
}
917
- return false ;
919
+ continue constraints ;
918
920
}
919
921
}
920
922
0 commit comments