Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-5417

capability plugin : RegexpFieldValidator inverse logic

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 2.3
    • Component/s: Capabilities
    • Labels:
      None

      Description

      org.sonatype.nexus.plugins.capabilities.internal.validator.RegexpFieldValidator

      actually returns failure instead of success for valid match:

          @Override
          public ValidationResult validate( final Map<String, String> properties )
          {
              if ( properties != null )
              {
                  final String value = properties.get( key );
                  if ( value != null && pattern.matcher( value ).matches() )
                  {
                      return new DefaultValidationResult().add( key, label + " does not match '" + pattern.pattern() + "'" );
                  }
              }
              return ValidationResult.VALID;
          }
      

      since DefaultValidationResult is a set of Violation

        Attachments

          Activity

            People

            Assignee:
            alin Alin Dreghiciu
            Reporter:
            andrei.pozolotin Andrei Pozolotin
            Last Updated By:
            Peter Lynch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response:

                tigCommentSecurity.panel-title