Closed befc closed 5 months ago
SonarQube Quality Gate
Build command:
mvn clean verify -B -e -Daudit -Djs.no.sandbox -pl extensions
:ok_hand: All tests passed!
Tests run: 1563, Failures: 0, Skipped: 5 Test Results
:information_source: This is an automatic message
Refactored the code according to the suggestion made in the ticket's description by @dcleao. This will effectively correct the performance issue with the previous implementation by using the regex without wildcards and make usage of the
find()
method, that performs a lot better thanmatches()
.The target code is being covered by
FileResourceTest.validateSecurityPrincipal()
, from my evaluation, no further UTs seem to be necessary with this change.Conducted some benchmark tests with JMH to better understand the impact and improvements with this change for both valid and invalid strings, before and after refactor: Short strings (~10 char.):
Long string (1000 char.):