]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-21452 move from commons-lang:commons-lang to org.apache.commons:commons-lang3
authorMatteo Mara <matteo.mara@sonarsource.com>
Fri, 8 Mar 2024 17:08:49 +0000 (18:08 +0100)
committersonartech <sonartech@sonarsource.com>
Sat, 16 Mar 2024 20:02:46 +0000 (20:02 +0000)
668 files changed:
build.gradle
plugins/sonar-xoo-plugin/build.gradle
plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/coverage/AbstractCoverageSensor.java
plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/LineMeasureSensor.java
plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/MeasureSensor.java
plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/SignificantCodeSensor.java
plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/SymbolReferencesSensor.java
plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/SyntaxHighlightingSensor.java
plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/AnalysisErrorSensor.java
plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/scm/XooBlameCommand.java
plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/scm/XooScmProvider.java
server/sonar-alm-client/src/main/java/org/sonar/alm/client/GenericApplicationHttpClient.java
server/sonar-alm-client/src/main/java/org/sonar/alm/client/azure/AzureDevOpsHttpClient.java
server/sonar-alm-client/src/main/java/org/sonar/alm/client/github/GithubApplicationClientImpl.java
server/sonar-alm-client/src/main/java/org/sonar/alm/client/github/GithubGlobalSettingsValidator.java
server/sonar-alm-client/src/main/java/org/sonar/alm/client/github/SonarQubeIssueKeyFormatter.java
server/sonar-alm-client/src/test/java/org/sonar/alm/client/github/GenericApplicationHttpClientTest.java
server/sonar-alm-client/src/test/java/org/sonar/alm/client/github/GithubApplicationClientImplTest.java
server/sonar-alm-client/src/test/java/org/sonar/alm/client/github/SonarQubeIssueKeyFormatterTest.java
server/sonar-alm-client/src/test/java/org/sonar/alm/client/github/security/GithubAppSecurityImplTest.java
server/sonar-auth-common/build.gradle
server/sonar-auth-common/src/test/java/org/sonar/auth/OAuthRestClientTest.java
server/sonar-auth-github/src/main/java/org/sonar/auth/github/GitHubSettings.java
server/sonar-auth-github/src/test/java/org/sonar/auth/github/GithubAppConfigurationTest.java
server/sonar-auth-ldap/build.gradle
server/sonar-auth-ldap/src/main/java/org/sonar/auth/ldap/DefaultLdapAuthenticator.java
server/sonar-auth-ldap/src/main/java/org/sonar/auth/ldap/LdapContextFactory.java
server/sonar-auth-ldap/src/main/java/org/sonar/auth/ldap/LdapGroupMapping.java
server/sonar-auth-ldap/src/main/java/org/sonar/auth/ldap/LdapSettingsManager.java
server/sonar-auth-ldap/src/main/java/org/sonar/auth/ldap/LdapUserMapping.java
server/sonar-ce-common/build.gradle
server/sonar-ce-common/src/it/java/org/sonar/ce/queue/CeQueueImplIT.java
server/sonar-ce-task-projectanalysis/build.gradle
server/sonar-ce-task-projectanalysis/src/it/java/org/sonar/ce/task/projectanalysis/component/BranchPersisterImplIT.java
server/sonar-ce-task-projectanalysis/src/it/java/org/sonar/ce/task/projectanalysis/issue/AdHocRuleCreatorIT.java
server/sonar-ce-task-projectanalysis/src/it/java/org/sonar/ce/task/projectanalysis/issue/ClosedIssuesInputFactoryIT.java
server/sonar-ce-task-projectanalysis/src/it/java/org/sonar/ce/task/projectanalysis/issue/ComponentIssuesLoaderIT.java
server/sonar-ce-task-projectanalysis/src/it/java/org/sonar/ce/task/projectanalysis/step/BuildComponentTreeStepIT.java
server/sonar-ce-task-projectanalysis/src/it/java/org/sonar/ce/task/projectanalysis/step/LoadPeriodsStepIT.java
server/sonar-ce-task-projectanalysis/src/it/java/org/sonar/ce/task/projectanalysis/step/PersistAnalysisPropertiesStepIT.java
server/sonar-ce-task-projectanalysis/src/it/java/org/sonar/ce/task/projectanalysis/step/ReportPersistAnalysisStepIT.java
server/sonar-ce-task-projectanalysis/src/it/java/org/sonar/ce/task/projectanalysis/step/SendIssueNotificationsStepIT.java
server/sonar-ce-task-projectanalysis/src/it/java/org/sonar/ce/task/projectexport/analysis/ExportAnalysesStepIT.java
server/sonar-ce-task-projectanalysis/src/it/java/org/sonar/ce/task/projectexport/branches/ExportBranchesStepIT.java
server/sonar-ce-task-projectanalysis/src/it/java/org/sonar/ce/task/projectexport/rule/ExportAdHocRulesStepIT.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/analysis/AnalysisMetadataHolderImpl.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/component/ComponentImpl.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/component/ComponentTreeBuilder.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/component/FileAttributes.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/component/ProjectPersister.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/component/TreeRootHolderImpl.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/issue/AdHocRuleCreator.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/issue/ComputeLocationHashesVisitor.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/issue/IssueAssigner.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/issue/IssueLocations.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/issue/NewAdHocRule.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/issue/TrackerRawInputFactory.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/measure/BatchMeasureToMeasure.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/scm/ReportScmInfo.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/source/PersistFileSourcesStep.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/source/SourceLinesHashRepositoryImpl.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/BuildComponentTreeStep.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/PersistComponentsStep.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/PersistDuplicationDataStep.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/QualityGateMeasuresStep.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/QualityProfileEventsStep.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectexport/analysis/ExportAnalysesStep.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectexport/branches/ExportBranchesStep.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectexport/component/ExportComponentsStep.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectexport/steps/ExportEventsStep.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectexport/steps/ExportLinksStep.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectexport/steps/ExportLiveMeasuresStep.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectexport/steps/ExportMeasuresStep.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectexport/steps/ExportMetricsStep.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectexport/steps/ExportPluginsStep.java
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectexport/steps/ExportSettingsStep.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/api/posttask/PostProjectAnalysisTasksExecutorTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/component/ComponentImplTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/component/ComponentTreeBuilderTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/duplication/IntegrateCrossProjectDuplicationsTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/filemove/ScoreMatrixDumperImplTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/issue/IssueCreationDateCalculatorTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/locations/flow/FlowGeneratorTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/notification/NotificationFactoryTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/notification/ReportAnalysisFailureNotificationHandlerTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/pushevent/PushEventFactoryTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/source/FileSourceDataWarningsTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/PersistComponentsStepTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/QualityGateEventsStepTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/webhook/WebhookPostTaskTest.java
server/sonar-ce-task-projectanalysis/src/testFixtures/java/org/sonar/ce/task/projectanalysis/analysis/AnalysisMetadataHolderRule.java
server/sonar-ce-task-projectanalysis/src/testFixtures/java/org/sonar/ce/task/projectanalysis/analysis/TestBranch.java
server/sonar-ce-task/src/it/java/org/sonar/ce/task/log/CeTaskMessagesImplIT.java
server/sonar-ce-task/src/test/java/org/sonar/ce/task/CeTaskCanceledExceptionTest.java
server/sonar-ce-task/src/test/java/org/sonar/ce/task/CeTaskComponentTest.java
server/sonar-ce-task/src/test/java/org/sonar/ce/task/CeTaskInterruptedExceptionTest.java
server/sonar-ce-task/src/test/java/org/sonar/ce/task/CeTaskTimeoutExceptionTest.java
server/sonar-ce-task/src/test/java/org/sonar/ce/task/log/CeTaskMessagesMessageTest.java
server/sonar-ce/src/it/java/org/sonar/ce/container/ComputeEngineContainerImplIT.java
server/sonar-ce/src/it/java/org/sonar/ce/notification/ReportAnalysisFailureNotificationExecutionListenerIT.java
server/sonar-ce/src/it/java/org/sonar/ce/taskprocessor/CeWorkerImplIT.java
server/sonar-ce/src/main/java/org/sonar/ce/queue/NextPendingTaskPicker.java
server/sonar-ce/src/test/java/org/sonar/ce/configuration/CeWorkerCountSettingWarningTest.java
server/sonar-ce/src/test/java/org/sonar/ce/monitoring/CeTasksMBeanImplTest.java
server/sonar-ce/src/test/java/org/sonar/ce/taskprocessor/SimpleCeTaskInterrupterTest.java
server/sonar-ce/src/test/java/org/sonar/ce/taskprocessor/TimeoutCeTaskInterrupterTest.java
server/sonar-db-core/build.gradle
server/sonar-db-core/src/main/java/org/sonar/db/DatabaseUtils.java
server/sonar-db-core/src/main/java/org/sonar/db/DefaultDatabase.java
server/sonar-db-core/src/main/java/org/sonar/db/dialect/DialectUtils.java
server/sonar-db-core/src/main/java/org/sonar/db/dialect/H2.java
server/sonar-db-core/src/main/java/org/sonar/db/dialect/MsSql.java
server/sonar-db-core/src/main/java/org/sonar/db/dialect/Oracle.java
server/sonar-db-core/src/main/java/org/sonar/db/dialect/PostgreSql.java
server/sonar-db-core/src/main/java/org/sonar/db/profiling/SqlLogFormatter.java
server/sonar-db-core/src/test/java/org/sonar/db/DefaultDatabaseTest.java
server/sonar-db-core/src/test/java/org/sonar/db/profiling/SqlLogFormatterTest.java
server/sonar-db-core/src/testFixtures/java/org/sonar/db/AbstractDbTester.java
server/sonar-db-core/src/testFixtures/java/org/sonar/db/CoreDbTester.java
server/sonar-db-dao/build.gradle
server/sonar-db-dao/src/it/java/org/sonar/db/alm/pat/AlmPatDaoIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/audit/AuditDaoIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/ce/CeActivityDaoIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/component/AnalysisPropertiesDaoIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/component/BranchDaoIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/component/ComponentDaoIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/component/ComponentKeyUpdaterDaoIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/component/ScrollForFileMoveComponentDaoIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/component/SnapshotDaoIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/event/EventComponentChangeDaoIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/issue/IssueDaoIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/issue/IssueMapperIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/measure/LiveMeasureDaoIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/project/ProjectDaoIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/project/ProjectExportDaoIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/property/InternalPropertiesDaoIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/property/PropertiesDaoIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/purge/PurgeCommandsIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/purge/PurgeDaoIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/qualitygate/QualityGateConditionDaoIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/qualitygate/QualityGateGroupPermissionsDaoIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/qualityprofile/QualityProfileDaoIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/rule/RuleDaoIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/scim/ScimUserDaoIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/user/UserDaoIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/user/UserDaoWithPersisterIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/user/UserTokenDaoIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/user/UserTokenDaoWithPersisterIT.java
server/sonar-db-dao/src/main/java/org/sonar/db/audit/model/ComponentNewValue.java
server/sonar-db-dao/src/main/java/org/sonar/db/audit/model/DevOpsPlatformSettingNewValue.java
server/sonar-db-dao/src/main/java/org/sonar/db/audit/model/PermissionTemplateNewValue.java
server/sonar-db-dao/src/main/java/org/sonar/db/audit/model/UserNewValue.java
server/sonar-db-dao/src/main/java/org/sonar/db/ce/CeTaskMessageDto.java
server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentDto.java
server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentKeyUpdaterDao.java
server/sonar-db-dao/src/main/java/org/sonar/db/component/SnapshotDto.java
server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueChangeDto.java
server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueDto.java
server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueTesting.java
server/sonar-db-dao/src/main/java/org/sonar/db/issue/PrIssueDto.java
server/sonar-db-dao/src/main/java/org/sonar/db/measure/ProjectMeasuresIndexerIterator.java
server/sonar-db-dao/src/main/java/org/sonar/db/notification/NotificationQueueDto.java
server/sonar-db-dao/src/main/java/org/sonar/db/permission/PermissionQuery.java
server/sonar-db-dao/src/main/java/org/sonar/db/plugin/PluginDto.java
server/sonar-db-dao/src/main/java/org/sonar/db/project/ProjectDto.java
server/sonar-db-dao/src/main/java/org/sonar/db/property/PropertiesDao.java
server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeableAnalysisDto.java
server/sonar-db-dao/src/main/java/org/sonar/db/purge/period/Filters.java
server/sonar-db-dao/src/main/java/org/sonar/db/purge/period/Interval.java
server/sonar-db-dao/src/main/java/org/sonar/db/qualitygate/ProjectQgateAssociationQuery.java
server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleDto.java
server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleParamDto.java
server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/QProfileChangeDto.java
server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/QProfileChangeQuery.java
server/sonar-db-dao/src/main/java/org/sonar/db/rule/RuleDao.java
server/sonar-db-dao/src/main/java/org/sonar/db/rule/RuleDescriptionSectionContextDto.java
server/sonar-db-dao/src/main/java/org/sonar/db/rule/RuleDto.java
server/sonar-db-dao/src/main/java/org/sonar/db/rule/RuleParamDto.java
server/sonar-db-dao/src/main/java/org/sonar/db/rule/RuleRepositoryDao.java
server/sonar-db-dao/src/main/java/org/sonar/db/scim/ScimGroupQuery.java
server/sonar-db-dao/src/main/java/org/sonar/db/scim/ScimUserQuery.java
server/sonar-db-dao/src/main/java/org/sonar/db/user/GroupMembershipQuery.java
server/sonar-db-dao/src/main/java/org/sonar/db/user/GroupQuery.java
server/sonar-db-dao/src/main/java/org/sonar/db/user/SearchPermissionQuery.java
server/sonar-db-dao/src/main/java/org/sonar/db/user/UserDao.java
server/sonar-db-dao/src/main/java/org/sonar/db/user/UserMembershipQuery.java
server/sonar-db-dao/src/main/java/org/sonar/db/user/UserQuery.java
server/sonar-db-dao/src/main/java/org/sonar/db/webhook/WebhookDeliveryDto.java
server/sonar-db-dao/src/main/java/org/sonar/db/webhook/WebhookDeliveryLiteDto.java
server/sonar-db-dao/src/test/java/org/sonar/db/DBSessionsImplTest.java
server/sonar-db-dao/src/test/java/org/sonar/db/DbSessionImplTest.java
server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeActivityDtoTest.java
server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeTaskMessageDtoTest.java
server/sonar-db-dao/src/test/java/org/sonar/db/ce/UpdateIfTest.java
server/sonar-db-dao/src/test/java/org/sonar/db/component/AnalysisPropertyDtoTest.java
server/sonar-db-dao/src/test/java/org/sonar/db/component/ScrapAnalysisPropertyDtoTest.java
server/sonar-db-dao/src/test/java/org/sonar/db/component/SnapshotDtoTest.java
server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueDtoTest.java
server/sonar-db-dao/src/test/java/org/sonar/db/property/InternalComponentPropertyDtoTest.java
server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDtoTest.java
server/sonar-db-dao/src/test/java/org/sonar/db/scim/ScimGroupDaoTest.java
server/sonar-db-dao/src/test/java/org/sonar/db/user/UserTokenDtoTest.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/TestDbImpl.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/alm/integration/pat/AlmPatsTesting.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/almsettings/AlmSettingsTesting.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/anticipatedtransition/AnticipatedTransitionDbTester.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/audit/AuditTesting.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/ce/CeQueueTesting.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ComponentTesting.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ProjectLinkTesting.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/SnapshotTesting.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/event/EventTesting.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/measure/MeasureTesting.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/metric/MetricTesting.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/permission/template/PermissionTemplateTesting.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/plugin/PluginTesting.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/property/PropertyTesting.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/qualitygate/QualityGateDbTester.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/qualityprofile/QualityProfileDbTester.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/qualityprofile/QualityProfileTesting.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/rule/RuleTesting.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/source/FileSourceTester.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/user/GroupTesting.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/user/UserDbTester.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/user/UserTesting.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/user/UserTokenTesting.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/webhook/WebhookDeliveryTesting.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/webhook/WebhookTesting.java
server/sonar-db-migration/build.gradle
server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/step/DataChangeIT.java
server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/step/ForceReloadingOfAllPluginsIT.java
server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/PopulateNclocForForProjectsIT.java
server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/UpdateUserLocalValueInUsersIT.java
server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/charset/MssqlCharsetHandler.java
server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/charset/OracleCharsetHandler.java
server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/charset/PostgresCharsetHandler.java
server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v101/MigrateScmAccountsFromUsersToScmAccounts.java
server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/sql/RenameColumnsBuilderTest.java
server/sonar-db-migration/src/testFixtures/java/org/sonar/db/OrchestratorSettingsUtils.java
server/sonar-main/build.gradle
server/sonar-main/src/main/java/org/sonar/application/config/CommandLineParser.java
server/sonar-main/src/main/java/org/sonar/application/config/JdbcSettings.java
server/sonar-main/src/main/java/org/sonar/application/es/EsInstallation.java
server/sonar-main/src/test/java/org/sonar/application/AbstractStopRequestWatcherTest.java
server/sonar-main/src/test/java/org/sonar/application/SchedulerImplTest.java
server/sonar-main/src/test/java/org/sonar/application/cluster/health/SearchNodeHealthProviderTest.java
server/sonar-main/src/test/java/org/sonar/application/command/AbstractCommandTest.java
server/sonar-main/src/test/java/org/sonar/application/command/EsJvmOptionsTest.java
server/sonar-main/src/test/java/org/sonar/application/command/JvmOptionsTest.java
server/sonar-main/src/test/java/org/sonar/application/es/EsSettingsTest.java
server/sonar-process/build.gradle
server/sonar-process/src/main/java/org/sonar/process/MinimumViableSystem.java
server/sonar-process/src/main/java/org/sonar/process/Props.java
server/sonar-process/src/main/java/org/sonar/process/System2.java
server/sonar-process/src/main/java/org/sonar/process/logging/Log4JPropertiesBuilder.java
server/sonar-process/src/main/java/org/sonar/process/logging/LogbackHelper.java
server/sonar-process/src/main/java/org/sonar/process/logging/LogbackJsonLayout.java
server/sonar-process/src/main/java/org/sonar/process/sharedmemoryfile/AllProcessesCommands.java
server/sonar-process/src/test/java/org/sonar/process/FileUtils2Test.java
server/sonar-process/src/test/java/org/sonar/process/NetworkUtilsImplTest.java
server/sonar-process/src/test/java/org/sonar/process/PropsTest.java
server/sonar-process/src/test/java/org/sonar/process/cluster/health/NodeDetailsTest.java
server/sonar-process/src/test/java/org/sonar/process/cluster/health/NodeDetailsTestSupport.java
server/sonar-process/src/test/java/org/sonar/process/cluster/health/NodeHealthTest.java
server/sonar-process/src/test/java/org/sonar/process/cluster/health/SharedHealthStateImplTest.java
server/sonar-process/src/test/java/org/sonar/process/logging/Log4JPropertiesBuilderTest.java
server/sonar-process/src/test/java/org/sonar/process/logging/LogLevelConfigTest.java
server/sonar-process/src/test/java/org/sonar/process/logging/LogbackHelperTest.java
server/sonar-server-common/build.gradle
server/sonar-server-common/src/it/java/org/sonar/server/es/metadata/MetadataIndexIT.java
server/sonar-server-common/src/it/java/org/sonar/server/issue/notification/NewIssuesNotificationIT.java
server/sonar-server-common/src/it/java/org/sonar/server/rule/DefaultRuleFinderIT.java
server/sonar-server-common/src/it/java/org/sonar/server/rule/index/RuleIndexDefinitionIT.java
server/sonar-server-common/src/it/java/org/sonar/server/rule/index/RuleIndexerIT.java
server/sonar-server-common/src/it/java/org/sonar/server/webhook/WebhookDeliveryStorageIT.java
server/sonar-server-common/src/main/java/org/sonar/server/config/ConfigurationProvider.java
server/sonar-server-common/src/main/java/org/sonar/server/email/EmailSender.java
server/sonar-server-common/src/main/java/org/sonar/server/es/EsRequestDetails.java
server/sonar-server-common/src/main/java/org/sonar/server/es/Facets.java
server/sonar-server-common/src/main/java/org/sonar/server/es/Index.java
server/sonar-server-common/src/main/java/org/sonar/server/es/SearchIdResult.java
server/sonar-server-common/src/main/java/org/sonar/server/es/SearchOptions.java
server/sonar-server-common/src/main/java/org/sonar/server/es/SearchResult.java
server/sonar-server-common/src/main/java/org/sonar/server/es/StickyFacetBuilder.java
server/sonar-server-common/src/main/java/org/sonar/server/es/searchrequest/NestedFieldTopAggregationDefinition.java
server/sonar-server-common/src/main/java/org/sonar/server/es/textsearch/ComponentTextSearchFeatureRepertoire.java
server/sonar-server-common/src/main/java/org/sonar/server/es/textsearch/JavaTokenizer.java
server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/EmailMessage.java
server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/IssueChangesEmailTemplate.java
server/sonar-server-common/src/main/java/org/sonar/server/issue/workflow/Transition.java
server/sonar-server-common/src/main/java/org/sonar/server/notification/NotificationDispatcher.java
server/sonar-server-common/src/main/java/org/sonar/server/notification/email/EmailNotificationChannel.java
server/sonar-server-common/src/main/java/org/sonar/server/permission/index/PermissionIndexerDao.java
server/sonar-server-common/src/main/java/org/sonar/server/platform/StartupMetadataProvider.java
server/sonar-server-common/src/main/java/org/sonar/server/platform/UrlSettings.java
server/sonar-server-common/src/main/java/org/sonar/server/platform/serverid/JdbcUrlSanitizer.java
server/sonar-server-common/src/main/java/org/sonar/server/qualitygate/notification/QGChangeEmailTemplate.java
server/sonar-server-common/src/main/java/org/sonar/server/qualityprofile/ActiveRuleChange.java
server/sonar-server-common/src/main/java/org/sonar/server/qualityprofile/index/ActiveRuleDoc.java
server/sonar-server-common/src/main/java/org/sonar/server/rule/index/RuleDoc.java
server/sonar-server-common/src/main/java/org/sonar/server/rule/index/RuleIndex.java
server/sonar-server-common/src/main/java/org/sonar/server/setting/DatabaseSettingLoader.java
server/sonar-server-common/src/main/java/org/sonar/server/webhook/HttpUrlHelper.java
server/sonar-server-common/src/main/java/org/sonar/server/webhook/WebhookCallerImpl.java
server/sonar-server-common/src/test/java/org/sonar/server/config/ConfigurationProviderTest.java
server/sonar-server-common/src/test/java/org/sonar/server/es/DocIdTest.java
server/sonar-server-common/src/test/java/org/sonar/server/es/IndexDefinitionContextTest.java
server/sonar-server-common/src/test/java/org/sonar/server/es/IndexTest.java
server/sonar-server-common/src/test/java/org/sonar/server/es/newindex/FieldAwareTest.java
server/sonar-server-common/src/test/java/org/sonar/server/es/newindex/NewAuthorizedIndexTest.java
server/sonar-server-common/src/test/java/org/sonar/server/es/newindex/NewIndexTest.java
server/sonar-server-common/src/test/java/org/sonar/server/es/newindex/NewRegularIndexTest.java
server/sonar-server-common/src/test/java/org/sonar/server/es/searchrequest/AllFiltersTest.java
server/sonar-server-common/src/test/java/org/sonar/server/es/searchrequest/NestedFieldFilterScopeTest.java
server/sonar-server-common/src/test/java/org/sonar/server/es/searchrequest/NestedFieldTopAggregationDefinitionTest.java
server/sonar-server-common/src/test/java/org/sonar/server/es/searchrequest/SimpleFieldFilterScopeTest.java
server/sonar-server-common/src/test/java/org/sonar/server/es/searchrequest/SimpleFieldTopAggregationDefinitionTest.java
server/sonar-server-common/src/test/java/org/sonar/server/es/searchrequest/SubAggregationHelperTest.java
server/sonar-server-common/src/test/java/org/sonar/server/es/searchrequest/TopAggregationHelperTest.java
server/sonar-server-common/src/test/java/org/sonar/server/issue/IssueFieldsSetterTest.java
server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/ChangesOnMyIssueNotificationHandlerTest.java
server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/ChangesOnMyIssuesEmailTemplateTest.java
server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/ChangesOnMyIssuesNotificationTest.java
server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/EmailMessageTest.java
server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/FPOrAcceptedNotificationHandlerTest.java
server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/FpPrAcceptedEmailTemplateTest.java
server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/MyNewIssuesNotificationHandlerTest.java
server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/NewIssuesNotificationHandlerTest.java
server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/NewIssuesStatisticsTest.java
server/sonar-server-common/src/test/java/org/sonar/server/issue/workflow/IssueWorkflowForSecurityHotspotsTest.java
server/sonar-server-common/src/test/java/org/sonar/server/issue/workflow/IssueWorkflowTest.java
server/sonar-server-common/src/test/java/org/sonar/server/log/ServerLoggingTest.java
server/sonar-server-common/src/test/java/org/sonar/server/notification/DefaultNotificationManagerTest.java
server/sonar-server-common/src/test/java/org/sonar/server/notification/EmailRecipientTest.java
server/sonar-server-common/src/test/java/org/sonar/server/notification/NotificationServiceTest.java
server/sonar-server-common/src/test/java/org/sonar/server/notification/email/EmailNotificationChannelTest.java
server/sonar-server-common/src/test/java/org/sonar/server/permission/index/AuthorizationDocTest.java
server/sonar-server-common/src/test/java/org/sonar/server/qualitygate/EvaluatedQualityGateTest.java
server/sonar-server-common/src/test/java/org/sonar/server/qualitygate/notification/QGChangeNotificationHandlerTest.java
server/sonar-server-common/src/test/java/org/sonar/server/setting/ChildSettingsTest.java
server/sonar-server-common/src/test/java/org/sonar/server/setting/ThreadLocalSettingsTest.java
server/sonar-server-common/src/test/java/org/sonar/server/telemetry/TelemetryDataJsonWriterTest.java
server/sonar-server-common/src/test/java/org/sonar/server/webhook/HttpUrlHelperTest.java
server/sonar-server-common/src/test/java/org/sonar/server/webhook/WebhookCallerImplTest.java
server/sonar-server-common/src/testFixtures/java/org/sonar/server/es/EsTester.java
server/sonar-server-common/src/testFixtures/java/org/sonar/server/issue/IssueDocTesting.java
server/sonar-server-common/src/testFixtures/java/org/sonar/server/issue/notification/IssuesChangesNotificationBuilderTesting.java
server/sonar-webserver-api/src/it/java/org/sonar/server/rule/CachingRuleFinderIT.java
server/sonar-webserver-api/src/main/java/org/sonar/server/plugins/PluginDownloader.java
server/sonar-webserver-api/src/main/java/org/sonar/server/util/BooleanTypeValidation.java
server/sonar-webserver-api/src/main/java/org/sonar/server/util/StringListTypeValidation.java
server/sonar-webserver-api/src/test/java/org/sonar/server/exceptions/NotFoundExceptionTest.java
server/sonar-webserver-api/src/test/java/org/sonar/server/plugins/edition/EditionBundledPluginsTest.java
server/sonar-webserver-api/src/test/java/org/sonar/server/project/RekeyedProjectTest.java
server/sonar-webserver-api/src/test/java/org/sonar/server/qualitygate/changeevent/QGChangeEventListenersImplTest.java
server/sonar-webserver-api/src/test/java/org/sonar/server/util/GlobalLockManagerImplTest.java
server/sonar-webserver-auth/src/it/java/org/sonar/server/authentication/CredentialsLocalAuthenticationIT.java
server/sonar-webserver-auth/src/it/java/org/sonar/server/user/UserUpdaterCreateIT.java
server/sonar-webserver-auth/src/main/java/org/sonar/server/authentication/BasicAuthentication.java
server/sonar-webserver-auth/src/main/java/org/sonar/server/authentication/Credentials.java
server/sonar-webserver-auth/src/main/java/org/sonar/server/authentication/CredentialsExternalAuthentication.java
server/sonar-webserver-auth/src/main/java/org/sonar/server/authentication/CredentialsLocalAuthentication.java
server/sonar-webserver-auth/src/main/java/org/sonar/server/authentication/GithubWebhookAuthentication.java
server/sonar-webserver-auth/src/main/java/org/sonar/server/authentication/HttpHeadersAuthentication.java
server/sonar-webserver-auth/src/main/java/org/sonar/server/authentication/JwtCsrfVerifier.java
server/sonar-webserver-auth/src/main/java/org/sonar/server/authentication/JwtHttpHandler.java
server/sonar-webserver-auth/src/main/java/org/sonar/server/authentication/LdapCredentialsAuthentication.java
server/sonar-webserver-auth/src/main/java/org/sonar/server/authentication/LogOAuthWarning.java
server/sonar-webserver-auth/src/main/java/org/sonar/server/authentication/OAuthCsrfVerifier.java
server/sonar-webserver-auth/src/main/java/org/sonar/server/authentication/SamlValidationRedirectionFilter.java
server/sonar-webserver-auth/src/main/java/org/sonar/server/authentication/UserSessionInitializer.java
server/sonar-webserver-auth/src/main/java/org/sonar/server/user/BearerPasscode.java
server/sonar-webserver-auth/src/main/java/org/sonar/server/user/SecurityRealmFactory.java
server/sonar-webserver-auth/src/main/java/org/sonar/server/user/SystemPasscodeImpl.java
server/sonar-webserver-auth/src/main/java/org/sonar/server/user/UserUpdater.java
server/sonar-webserver-auth/src/main/java/org/sonar/server/usertoken/UserTokenAuthentication.java
server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/JwtSerializerTest.java
server/sonar-webserver-auth/src/test/java/org/sonar/server/permission/GroupUuidOrAnyoneTest.java
server/sonar-webserver-auth/src/testFixtures/java/org/sonar/server/language/LanguageTesting.java
server/sonar-webserver-common/src/main/java/org/sonar/server/common/gitlab/config/GitlabConfigurationService.java
server/sonar-webserver-common/src/main/java/org/sonar/server/common/rule/RuleCreator.java
server/sonar-webserver-common/src/main/java/org/sonar/server/common/user/UserAnonymizer.java
server/sonar-webserver-common/src/test/java/org/sonar/server/common/group/service/GroupServiceTest.java
server/sonar-webserver-common/src/test/java/org/sonar/server/common/health/AppNodeClusterCheckTest.java
server/sonar-webserver-common/src/test/java/org/sonar/server/common/health/EsStatusClusterCheckTest.java
server/sonar-webserver-core/src/it/java/org/sonar/server/platform/serverid/ServerIdManagerIT.java
server/sonar-webserver-core/src/it/java/org/sonar/server/rule/registration/RulesRegistrantIT.java
server/sonar-webserver-core/src/it/java/org/sonar/server/telemetry/TelemetryDataLoaderImplIT.java
server/sonar-webserver-core/src/it/java/org/sonar/server/webhook/WebhookQGChangeEventListenerIT.java
server/sonar-webserver-core/src/main/java/org/sonar/server/app/WebServerProcessLogging.java
server/sonar-webserver-core/src/main/java/org/sonar/server/platform/DefaultServerUpgradeStatus.java
server/sonar-webserver-core/src/main/java/org/sonar/server/platform/db/EmbeddedDatabase.java
server/sonar-webserver-core/src/main/java/org/sonar/server/platform/db/EmbeddedDatabaseFactory.java
server/sonar-webserver-core/src/main/java/org/sonar/server/platform/monitoring/SettingsSection.java
server/sonar-webserver-core/src/main/java/org/sonar/server/platform/serverid/ServerIdFactoryImpl.java
server/sonar-webserver-core/src/main/java/org/sonar/server/platform/serverid/ServerIdManager.java
server/sonar-webserver-core/src/main/java/org/sonar/server/platform/web/logging/EntrypointMDCStorage.java
server/sonar-webserver-core/src/main/java/org/sonar/server/rule/LegacyIssueRuleDescriptionSectionsGenerator.java
server/sonar-webserver-core/src/main/java/org/sonar/server/rule/registration/NewRuleCreator.java
server/sonar-webserver-core/src/main/java/org/sonar/server/rule/registration/StartupRuleUpdater.java
server/sonar-webserver-core/src/main/java/org/sonar/server/startup/GeneratePluginIndex.java
server/sonar-webserver-core/src/test/java/org/sonar/server/platform/monitoring/SettingsSectionTest.java
server/sonar-webserver-core/src/test/java/org/sonar/server/platform/serverid/ServerIdFactoryImplTest.java
server/sonar-webserver-core/src/test/java/org/sonar/server/rule/registration/SingleDeprecatedRuleKeyTest.java
server/sonar-webserver-core/src/test/java/org/sonar/server/telemetry/FakeServer.java
server/sonar-webserver-es/src/main/java/org/sonar/server/es/IndexCreator.java
server/sonar-webserver-es/src/main/java/org/sonar/server/es/RecoveryIndexer.java
server/sonar-webserver-es/src/main/java/org/sonar/server/issue/index/IssueIndex.java
server/sonar-webserver-es/src/main/java/org/sonar/server/issue/index/IssueQuery.java
server/sonar-webserver-es/src/main/java/org/sonar/server/issue/index/IssueQueryFactory.java
server/sonar-webserver-es/src/main/java/org/sonar/server/measure/index/ProjectsTextSearchQueryFactory.java
server/sonar-webserver-es/src/test/java/org/sonar/server/es/metadata/EsDbCompatibilityImplTest.java
server/sonar-webserver-es/src/test/java/org/sonar/server/issue/index/IssueIndexProjectStatisticsTest.java
server/sonar-webserver-es/src/test/java/org/sonar/server/issue/index/IssueQueryFactoryTest.java
server/sonar-webserver-pushapi/src/main/java/org/sonar/server/pushapi/qualityprofile/QualityProfileChangeEventServiceImpl.java
server/sonar-webserver-pushapi/src/test/java/org/sonar/server/pushapi/qualityprofile/QualityProfileChangeEventServiceImplTest.java
server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/gitlab/config/controller/DefaultGitlabConfigurationController.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/almintegration/ws/bitbucketserver/ImportBitbucketServerProjectActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/almintegration/ws/gitlab/ImportGitLabProjectActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/almsettings/ws/UpdateGithubActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/badge/ws/MeasureActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/badge/ws/QualityGateActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/ce/queue/BranchReportSubmitterIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/ce/ws/ActivityActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/ce/ws/ComponentActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/ce/ws/TaskActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/component/ComponentUpdaterIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/component/ws/AppActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/component/ws/ShowActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/component/ws/SuggestionsActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/developers/ws/SearchEventsActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/developers/ws/SearchEventsActionNewIssuesIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/developers/ws/SearchEventsActionQualityGateIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/duplication/ws/DuplicationsParserIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/duplication/ws/ShowActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/duplication/ws/ShowResponseBuilderIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/hotspot/ws/AddCommentActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/hotspot/ws/AssignActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/hotspot/ws/ChangeStatusActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/hotspot/ws/SearchActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/hotspot/ws/ShowActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/issue/IssueChangeWSSupportIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/issue/ws/PullTaintActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/issue/ws/SearchActionComponentsIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/issue/ws/SearchActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/metric/ws/SearchActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/GroupPermissionChangerIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/UserPermissionChangerIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/ws/UsersActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/ws/template/BulkApplyTemplateActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/project/ws/BulkDeleteActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/projectanalysis/ws/DeleteActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/projectanalysis/ws/UpdateEventActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/projectlink/ws/CreateActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualitygate/ws/ProjectStatusActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/QProfileRuleImplIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/RegisterQualityProfilesNotificationIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/ActivateRuleActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/ActivateRulesActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/ChangeParentActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/CompareActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/DeactivateRuleActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/DeactivateRulesActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/ExportActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/rule/ws/SearchActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/source/ws/LinesActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/source/ws/RawActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/user/ws/CurrentActionHomepageIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/user/ws/SetHomepageActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/usergroups/ws/CreateActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/usergroups/ws/SearchActionIT.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/ProjectKeyGenerator.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/azure/SearchAzureReposAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/CreateGithubAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/CreateGitlabAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/UpdateAzureAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/UpdateBitbucketAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/UpdateBitbucketCloudAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/UpdateGithubAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/UpdateGitlabAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/authentication/ws/LoginAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/badge/ws/SvgFormatter.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/badge/ws/SvgGenerator.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/batch/BatchIndex.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/ce/queue/ReportSubmitter.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/ce/ws/SubmitAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ws/ComponentViewerJsonWriter.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/duplication/ws/DuplicationsParser.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/duplication/ws/ShowResponseBuilder.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/hotspot/ws/ChangeStatusAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/Result.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/TransitionService.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/IssueUpdater.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ApplyPermissionTemplateQuery.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/PermissionTemplateService.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/ws/template/UpdateTemplateAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/platform/ws/UpgradesAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/plugins/ws/PluginWSCommons.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/project/ws/BulkDeleteAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/project/ws/CreateAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/projectanalysis/ws/UpdateEventAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/projectdump/ws/StatusAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/projecttag/TagsWsSupport.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/QProfileBackuperImpl.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/QProfileExporters.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/QProfileFactoryImpl.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/QProfileParser.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/RegisterQualityProfiles.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/builtin/RuleActivator.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/ws/ChangeParentAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/RuleUpdate.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/RuleUpdater.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/RulesResponseFormatter.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/UpdateAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/setting/ws/SetAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/setting/ws/ValuesAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/source/HtmlSourceDecorator.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/source/ws/ScmAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/source/ws/ShowAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/CurrentAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/EmailValidator.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/user/ws/SetHomepageAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/webhook/ws/CreateAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/webhook/ws/ListAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/webhook/ws/UpdateAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/webhook/ws/WebhookDeliveriesAction.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/almintegration/ws/ProjectKeyGeneratorTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/badge/ws/ETagUtilsTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/batch/BatchIndexTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/ce/queue/BranchSupportTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/component/NewComponentTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/component/ws/ComponentsWsTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/health/ClusterHealthTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/health/HealthCheckerImplTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/health/HealthTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/health/NodeHealthModuleTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/health/NodeHealthProviderImplTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/hotspot/ws/HotspotsWsTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/issue/IssuesFinderSortTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/issue/ws/SearchResponseFormatFormatOperationTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/newcodeperiod/ws/NewCodePeriodsWsTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/platform/ws/HealthActionTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/platform/ws/SafeModeHealthActionTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/qualityprofile/builtin/BuiltInQPChangeNotificationTemplateTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/qualityprofile/builtin/BuiltInQPChangeNotificationTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/qualityprofile/builtin/BuiltInQualityProfilesUpdateListenerTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/user/ws/UsersWsTest.java
server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/ServletRequest.java
server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/WebServiceEngine.java
server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/WebServiceEngineTest.java
server/sonar-webserver/src/main/java/org/sonar/server/app/ProgrammaticLogbackValve.java
server/sonar-webserver/src/main/java/org/sonar/server/platform/web/StaticResourcesServlet.java
sonar-core/build.gradle
sonar-core/src/main/java/org/sonar/core/component/ComponentKeys.java
sonar-core/src/main/java/org/sonar/core/hash/SourceLineHashesComputer.java
sonar-core/src/main/java/org/sonar/core/issue/AnticipatedTransition.java
sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java
sonar-core/src/main/java/org/sonar/core/issue/FieldDiffs.java
sonar-core/src/main/java/org/sonar/core/issue/tracking/AbstractTracker.java
sonar-core/src/main/java/org/sonar/core/platform/PluginClassLoader.java
sonar-core/src/main/java/org/sonar/core/platform/PluginInfo.java
sonar-core/src/main/java/org/sonar/core/user/DefaultUser.java
sonar-core/src/main/java/org/sonar/core/util/CloseableIterator.java
sonar-core/src/main/java/org/sonar/core/util/ContextException.java
sonar-core/src/main/java/org/sonar/core/util/SequenceUuidFactory.java
sonar-core/src/main/java/org/sonar/core/util/SettingFormatter.java
sonar-core/src/main/java/org/sonar/core/util/logs/DefaultProfiler.java
sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueTest.java
sonar-core/src/test/java/org/sonar/core/issue/tracking/TrackerTest.java
sonar-core/src/test/java/org/sonar/core/platform/PluginClassloaderFactoryTest.java
sonar-core/src/test/java/org/sonar/core/platform/ServerIdTest.java
sonar-core/src/test/java/org/sonar/core/sarif/RuleTest.java
sonar-core/src/test/java/org/sonar/core/sarif/SarifVersionValidatorTest.java
sonar-core/src/test/java/org/sonar/core/util/FileUtilsTest.java
sonar-markdown/build.gradle
sonar-markdown/src/main/java/org/sonar/markdown/Markdown.java
sonar-plugin-api-impl/build.gradle
sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/fs/internal/AbstractProjectOrModule.java
sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/fs/internal/DefaultInputDir.java
sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/fs/internal/PathPattern.java
sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/rule/internal/NewActiveRule.java
sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/rule/internal/NewRule.java
sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/highlighting/internal/SyntaxHighlightingRule.java
sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/internal/DefaultStorable.java
sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/issue/internal/DefaultIssueLocation.java
sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/measure/internal/DefaultMeasure.java
sonar-plugin-api-impl/src/main/java/org/sonar/api/batch/sensor/rule/internal/DefaultAdHocRule.java
sonar-plugin-api-impl/src/main/java/org/sonar/api/config/internal/AesCipher.java
sonar-plugin-api-impl/src/main/java/org/sonar/api/config/internal/AesECBCipher.java
sonar-plugin-api-impl/src/main/java/org/sonar/api/config/internal/AesGCMCipher.java
sonar-plugin-api-impl/src/main/java/org/sonar/api/config/internal/MultivalueProperty.java
sonar-plugin-api-impl/src/main/java/org/sonar/api/config/internal/Settings.java
sonar-plugin-api-impl/src/main/java/org/sonar/api/impl/utils/JUnitTempFolder.java
sonar-plugin-api-impl/src/main/java/org/sonar/api/impl/utils/ScannerUtils.java
sonar-plugin-api-impl/src/main/java/org/sonar/api/impl/utils/WorkDuration.java
sonar-plugin-api-impl/src/main/java/org/sonar/api/impl/ws/ValidatingRequest.java
sonar-plugin-api-impl/src/main/java/org/sonar/api/internal/MetadataLoader.java
sonar-plugin-api-impl/src/test/java/org/sonar/api/batch/fs/internal/DefaultIndexedFileTest.java
sonar-plugin-api-impl/src/test/java/org/sonar/api/batch/sensor/issue/internal/DefaultIssueLocationTest.java
sonar-plugin-api-impl/src/test/java/org/sonar/api/config/internal/AesECBCipherTest.java
sonar-plugin-api-impl/src/test/java/org/sonar/api/config/internal/AesGCMCipherTest.java
sonar-plugin-api-impl/src/test/java/org/sonar/api/config/internal/MapSettingsTest.java
sonar-plugin-api-impl/src/test/java/org/sonar/api/config/internal/MultivaluePropertyTest.java
sonar-scanner-engine/build.gradle
sonar-scanner-engine/src/it/java/org/sonar/scanner/mediumtest/fs/FileSystemMediumIT.java
sonar-scanner-engine/src/main/java/org/sonar/batch/bootstrapper/LoggingConfiguration.java
sonar-scanner-engine/src/main/java/org/sonar/batch/bootstrapper/LoggingConfigurator.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/ProjectInfo.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/AbstractExtensionDictionary.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/DefaultScannerWsClient.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalTempFolderProvider.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerWsClientProvider.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/SpringGlobalContainer.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/CiConfigurationImpl.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/vendors/AzureDevops.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/vendors/BitbucketPipelines.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/vendors/CirrusCi.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/vendors/CodeMagic.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/vendors/GithubActions.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/vendors/Jenkins.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/vendors/SemaphoreCi.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/ci/vendors/TravisCi.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/config/DefaultConfiguration.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/ExternalIssueImporter.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/genericcoverage/StaxParser.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/DefaultFilterableIssue.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/IssuePublisher.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/ignore/pattern/AbstractPatternInitializer.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/ignore/pattern/IssueExclusionPatternInitializer.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/ignore/scanner/IssueExclusionsLoader.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/platform/DefaultServer.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/report/AnalysisContextReportPublisher.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/report/ComponentsPublisher.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/report/ReportPublisher.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/repository/settings/AbstractSettingsLoader.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/DeprecatedPropertiesWarningGenerator.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ProjectReactorBuilder.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ProjectReactorValidator.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ProjectServerSettingsProvider.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/AbstractExclusionFilters.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/DirectoryFileVisitor.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/LanguageDetection.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/ProjectFileIndexer.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/StatusDetection.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/DefaultBlameOutput.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/ScmConfiguration.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/ScmPublisher.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/ScmRevisionImpl.java
sonar-scanner-engine/src/main/java/org/sonar/scm/git/NativeGitBlameCommand.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/ProjectInfoTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/WsTestUtil.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/DefaultScannerWsClientTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/ExtensionInstallerTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/PluginFilesTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/externalissue/ExternalIssueImporterTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/report/AnalysisContextReportPublisherTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/report/MetadataPublisherTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/ProjectReactorBuilderTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/ProjectReactorValidatorTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/filesystem/CharsetDetectorTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/filesystem/CharsetValidationTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/filesystem/DirectoryFileVisitorTest.java
sonar-scanner-engine/src/test/java/org/sonar/scm/git/ChangedFileTest.java
sonar-scanner-engine/src/test/java/org/sonar/scm/git/GitScmProviderTest.java
sonar-scanner-protocol/build.gradle
sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/viewer/ScannerReportViewerApp.java
sonar-ws/build.gradle
sonar-ws/src/test/java/org/sonarqube/ws/client/HttpConnectorTest.java

index 608c18ed564f5e03c9c544f28362ac38c0791ba3..512f7a40107a32fe7f04debce035c8d0f2f8e8e1 100644 (file)
@@ -296,7 +296,6 @@ subprojects {
       dependency 'commons-codec:commons-codec:1.16.0'
       dependency 'commons-dbutils:commons-dbutils:1.8.1'
       dependency 'commons-io:commons-io:2.15.1'
-      dependency 'commons-lang:commons-lang:2.6'
       imports { mavenBom 'com.fasterxml.jackson:jackson-bom:2.16.1' }
       dependency 'com.eclipsesource.minimal-json:minimal-json:0.9.5'
       dependencySet(group: 'com.github.scribejava', version: '8.3.3') {
@@ -374,6 +373,7 @@ subprojects {
       dependency 'org.awaitility:awaitility:4.2.0'
       dependency 'org.apache.commons:commons-collections4:4.4'
       dependency 'org.apache.commons:commons-csv:1.10.0'
+      dependency 'org.apache.commons:commons-lang3:3.14.0'
       dependency 'org.apache.commons:commons-email:1.6.0'
       dependency 'com.zaxxer:HikariCP:5.1.0'
       dependency('org.apache.httpcomponents:httpclient:4.5.14') {
index d3330473874a7baf6c7843fcef42e82d1dd78907..221bdc559e0f49e54c4cd9a734e6a91252db87a5 100644 (file)
@@ -2,7 +2,7 @@
 dependencies {
   api 'com.google.guava:guava'
   api 'commons-io:commons-io'
-  api 'commons-lang:commons-lang'
+  api 'org.apache.commons:commons-lang3'
   api 'org.apache.commons:commons-csv'
 
   compileOnlyApi 'com.google.code.findbugs:jsr305'
index b38b3e1da0565e012a78d3ec99ad187ee94c724d..0a28bf989e5870241bbab07e27e167a87241d483 100644 (file)
@@ -25,14 +25,14 @@ import java.io.IOException;
 import java.util.Iterator;
 import java.util.List;
 import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.sonar.api.batch.fs.InputFile;
 import org.sonar.api.batch.sensor.Sensor;
 import org.sonar.api.batch.sensor.SensorContext;
 import org.sonar.api.batch.sensor.SensorDescriptor;
 import org.sonar.api.batch.sensor.coverage.NewCoverage;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.sonar.xoo.Xoo;
 
 public abstract class AbstractCoverageSensor implements Sensor {
index cb8f065c234028a2bfe15c854bcb6b4ffe7ebb23..86bf9ad028269cf1b5ac2e8dd81620fb9e9463c5 100644 (file)
@@ -24,7 +24,9 @@ import java.io.IOException;
 import java.util.List;
 import java.util.Map;
 import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.sonar.api.batch.fs.InputFile;
 import org.sonar.api.batch.sensor.Sensor;
 import org.sonar.api.batch.sensor.SensorContext;
@@ -32,8 +34,6 @@ import org.sonar.api.batch.sensor.SensorDescriptor;
 import org.sonar.api.measures.FileLinesContext;
 import org.sonar.api.measures.FileLinesContextFactory;
 import org.sonar.api.utils.KeyValueFormat;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.sonar.xoo.Xoo;
 
 /**
index 04938314f6dabe0d7542d4f6993a678120a1a383..30bd9061108ed17702db058f93749f725510e154 100644 (file)
@@ -24,7 +24,9 @@ import java.io.IOException;
 import java.io.Serializable;
 import java.util.List;
 import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.sonar.api.batch.fs.InputComponent;
 import org.sonar.api.batch.fs.InputDir;
 import org.sonar.api.batch.fs.InputFile;
@@ -33,8 +35,6 @@ import org.sonar.api.batch.sensor.Sensor;
 import org.sonar.api.batch.sensor.SensorContext;
 import org.sonar.api.batch.sensor.SensorDescriptor;
 import org.sonar.api.batch.sensor.measure.NewMeasure;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.sonar.xoo.Xoo;
 import org.sonar.xoo.Xoo2;
 
index df175eeb90a86a0f09b0218f966c66ecf89de36a..e1605c6258e1ae84d87f66ad58771db4c2c713cd 100644 (file)
@@ -23,7 +23,7 @@ import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.util.List;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.batch.fs.InputFile;
 import org.sonar.api.batch.sensor.Sensor;
 import org.sonar.api.batch.sensor.SensorContext;
index 08ada34c9f6b451f31bcb3f17db22d0a6e2a47dc..9030056a8f5adf478ff784db1ed8b07c8f6546ff 100644 (file)
@@ -25,7 +25,7 @@ import java.io.IOException;
 import java.util.Iterator;
 import java.util.List;
 import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.batch.fs.InputFile;
 import org.sonar.api.batch.sensor.Sensor;
 import org.sonar.api.batch.sensor.SensorContext;
index 1e55d51e26b2019d8b8d0b87957800ec5ef0d172..cfa34658e11067d486d7db17f926088c136601c7 100644 (file)
@@ -23,7 +23,7 @@ import java.io.File;
 import java.io.IOException;
 import java.util.List;
 import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.batch.fs.InputFile;
 import org.sonar.api.batch.sensor.Sensor;
 import org.sonar.api.batch.sensor.SensorContext;
index 9e55b60066b6931f79b5a2cad2901983e39ecd03..94a477c2244ea30a6963ac27c123ad0c7ea49e48 100644 (file)
@@ -23,14 +23,13 @@ import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.util.List;
-
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.sonar.api.batch.fs.InputFile;
 import org.sonar.api.batch.sensor.Sensor;
 import org.sonar.api.batch.sensor.SensorContext;
 import org.sonar.api.batch.sensor.SensorDescriptor;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.sonar.xoo.Xoo;
 
 public class AnalysisErrorSensor implements Sensor {
index 852a01ae5912595f5b4de12bcf8b2043e6181d5d..b575b73423df9381deaa4ec310578c255ff99f9c 100644 (file)
@@ -34,7 +34,7 @@ import org.sonar.api.batch.scm.BlameLine;
 import org.sonar.api.utils.DateUtils;
 
 import static com.google.common.base.Preconditions.checkState;
-import static org.apache.commons.lang.StringUtils.trimToNull;
+import static org.apache.commons.lang3.StringUtils.trimToNull;
 
 public class XooBlameCommand extends BlameCommand {
 
index 4b1d8391248ef4ec254b02d1eda0e03ad4d03520..212f9bd4ac4f7362a791b668a26622c2119b05a4 100644 (file)
@@ -34,7 +34,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import javax.annotation.CheckForNull;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.sonar.api.batch.scm.BlameCommand;
index 5d600a06ccbda6fbd4bcc7f1a7c54d48dd9a0e59..1b81a366a37a7f078601b57894abccd796cbb23a 100644 (file)
@@ -34,7 +34,7 @@ import okhttp3.OkHttpClient;
 import okhttp3.Request;
 import okhttp3.RequestBody;
 import okhttp3.ResponseBody;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.sonar.auth.github.security.AccessToken;
index 51ba944b6828f5855ec429b973908bb29caa714d..0bad92f43280e74526ffe7c0c46d572815629d77 100644 (file)
@@ -35,11 +35,11 @@ import okhttp3.RequestBody;
 import okhttp3.Response;
 import okhttp3.ResponseBody;
 import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.lang.StringUtils;
-import org.sonar.alm.client.TimeoutConfiguration;
-import org.sonar.api.server.ServerSide;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.sonar.alm.client.TimeoutConfiguration;
+import org.sonar.api.server.ServerSide;
 import org.sonarqube.ws.client.OkHttpClientBuilder;
 
 import static java.util.stream.Collectors.joining;
index b730be0f32d249ce3715edc0787a390133e1fcd2..63220e429614d33f307324c5b691a9b9d185f3c3 100644 (file)
@@ -39,23 +39,23 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.sonar.alm.client.ApplicationHttpClient;
 import org.sonar.alm.client.ApplicationHttpClient.GetResponse;
+import org.sonar.alm.client.github.security.AppToken;
+import org.sonar.alm.client.github.security.GithubAppSecurity;
+import org.sonar.alm.client.gitlab.GsonApp;
+import org.sonar.api.internal.apachecommons.lang.StringUtils;
 import org.sonar.auth.github.AppInstallationToken;
+import org.sonar.auth.github.GitHubSettings;
+import org.sonar.auth.github.GithubAppConfiguration;
+import org.sonar.auth.github.GithubAppInstallation;
 import org.sonar.auth.github.GithubBinding;
 import org.sonar.auth.github.GithubBinding.GsonGithubRepository;
 import org.sonar.auth.github.GithubBinding.GsonInstallations;
 import org.sonar.auth.github.GithubBinding.GsonRepositorySearch;
 import org.sonar.auth.github.GsonRepositoryCollaborator;
 import org.sonar.auth.github.GsonRepositoryTeam;
-import org.sonar.auth.github.GithubAppConfiguration;
-import org.sonar.auth.github.GithubAppInstallation;
+import org.sonar.auth.github.client.GithubApplicationClient;
 import org.sonar.auth.github.security.AccessToken;
-import org.sonar.alm.client.github.security.AppToken;
-import org.sonar.alm.client.github.security.GithubAppSecurity;
 import org.sonar.auth.github.security.UserAccessToken;
-import org.sonar.alm.client.gitlab.GsonApp;
-import org.sonar.api.internal.apachecommons.lang.StringUtils;
-import org.sonar.auth.github.GitHubSettings;
-import org.sonar.auth.github.client.GithubApplicationClient;
 import org.sonar.server.exceptions.ServerException;
 import org.sonarqube.ws.client.HttpException;
 
@@ -234,7 +234,7 @@ public class GithubApplicationClientImpl implements GithubApplicationClient {
       Long.toString(gsonInstallation.getId()),
       gsonInstallation.getAccount().getLogin(),
       gsonInstallation.getPermissions(),
-      org.apache.commons.lang.StringUtils.isNotEmpty(gsonInstallation.getSuspendedAt()));
+      org.apache.commons.lang3.StringUtils.isNotEmpty(gsonInstallation.getSuspendedAt()));
   }
 
   private static boolean isOrganizationWhiteListed(Set<String> allowedOrganizations, String organizationName) {
index 49753899765bbc4880cf475c9d05040ef30f716c..f6758823fb96175fdaa4019eeaee55eec8e82f94 100644 (file)
 package org.sonar.alm.client.github;
 
 import java.util.Optional;
-import org.sonar.auth.github.GithubAppConfiguration;
 import org.sonar.api.config.internal.Encryption;
 import org.sonar.api.config.internal.Settings;
 import org.sonar.api.server.ServerSide;
+import org.sonar.auth.github.GithubAppConfiguration;
 import org.sonar.auth.github.client.GithubApplicationClient;
 import org.sonar.db.alm.setting.AlmSettingDto;
 
-import static org.apache.commons.lang.StringUtils.isBlank;
+import static org.apache.commons.lang3.StringUtils.isBlank;
 
 @ServerSide
 public class GithubGlobalSettingsValidator {
index 4ecc6db64063cba2523ac94dca5f2333ee71e3e4..7bf261eb5f32d7943e158ab603084b81e5bad26d 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.alm.client.github;
 
 import java.util.Optional;
 
-import static org.apache.commons.lang.StringUtils.substringBetween;
+import static org.apache.commons.lang3.StringUtils.substringBetween;
 
 
 public final class SonarQubeIssueKeyFormatter {
index 89fea3115ce20bf174f098f20f6f5d7307d57928..5beea1acad1f4f6baf9ed86fa468f589c0efcd05 100644 (file)
@@ -35,19 +35,19 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.slf4j.event.Level;
+import org.sonar.alm.client.ApplicationHttpClient.GetResponse;
+import org.sonar.alm.client.ApplicationHttpClient.Response;
 import org.sonar.alm.client.ConstantTimeoutConfiguration;
 import org.sonar.alm.client.DevopsPlatformHeaders;
 import org.sonar.alm.client.GenericApplicationHttpClient;
 import org.sonar.alm.client.TimeoutConfiguration;
-import org.sonar.alm.client.ApplicationHttpClient.GetResponse;
-import org.sonar.alm.client.ApplicationHttpClient.Response;
-import org.sonar.auth.github.security.AccessToken;
-import org.sonar.auth.github.security.UserAccessToken;
 import org.sonar.api.testfixtures.log.LogTester;
 import org.sonar.api.utils.log.LoggerLevel;
+import org.sonar.auth.github.security.AccessToken;
+import org.sonar.auth.github.security.UserAccessToken;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.junit.Assert.fail;
index 346090977b9119c166ddfff7d97897124b035e17..a0596acb20a8139e63a6e78e2b79d9c214a1d66b 100644 (file)
@@ -37,29 +37,29 @@ import org.junit.runner.RunWith;
 import org.mockito.ArgumentCaptor;
 import org.slf4j.event.Level;
 import org.sonar.alm.client.ApplicationHttpClient.RateLimit;
-import org.sonar.auth.github.GsonRepositoryCollaborator;
-import org.sonar.auth.github.GsonRepositoryTeam;
-import org.sonar.auth.github.AppInstallationToken;
-import org.sonar.auth.github.GithubAppConfiguration;
-import org.sonar.auth.github.GithubAppInstallation;
-import org.sonar.auth.github.GithubBinding;
-import org.sonar.auth.github.security.AccessToken;
 import org.sonar.alm.client.github.security.AppToken;
 import org.sonar.alm.client.github.security.GithubAppSecurity;
-import org.sonar.auth.github.security.UserAccessToken;
 import org.sonar.api.testfixtures.log.LogAndArguments;
 import org.sonar.api.testfixtures.log.LogTester;
 import org.sonar.api.utils.log.LoggerLevel;
+import org.sonar.auth.github.AppInstallationToken;
 import org.sonar.auth.github.GitHubSettings;
+import org.sonar.auth.github.GithubAppConfiguration;
+import org.sonar.auth.github.GithubAppInstallation;
+import org.sonar.auth.github.GithubBinding;
+import org.sonar.auth.github.GsonRepositoryCollaborator;
 import org.sonar.auth.github.GsonRepositoryPermissions;
+import org.sonar.auth.github.GsonRepositoryTeam;
 import org.sonar.auth.github.client.GithubApplicationClient;
+import org.sonar.auth.github.security.AccessToken;
+import org.sonar.auth.github.security.UserAccessToken;
 import org.sonarqube.ws.client.HttpException;
 
 import static java.net.HttpURLConnection.HTTP_CREATED;
 import static java.net.HttpURLConnection.HTTP_FORBIDDEN;
 import static java.net.HttpURLConnection.HTTP_NOT_FOUND;
 import static java.net.HttpURLConnection.HTTP_UNAUTHORIZED;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatCode;
 import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
index 612fa3828b1fe348b30e88c29ab9a7810dc52852..b025b75aeaac0afe42667c4d68a55bcf187e799e 100644 (file)
@@ -20,7 +20,7 @@
 package org.sonar.alm.client.github;
 
 import java.util.Optional;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.Test;
 
 import static java.lang.String.join;
index b80445eed329c8831087551288171689533c6977..5dde4896e8576589197837d47059fcb23660fcd1 100644 (file)
@@ -30,8 +30,8 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.sonar.auth.github.GithubAppConfiguration;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
index 0b79c334014127328eff76a709a7e6fa13315b73..bbdf7b48d3aae55620c9495191ea4c0e8f9fc3e8 100644 (file)
@@ -12,7 +12,7 @@ dependencies {
 
     compileOnlyApi 'com.google.code.findbugs:jsr305'
 
-    testImplementation 'commons-lang:commons-lang'
+    testImplementation 'org.apache.commons:commons-lang3'
     testImplementation 'com.squareup.okhttp3:mockwebserver'
     testImplementation 'junit:junit'
     testImplementation 'org.assertj:assertj-core'
index 6221894f03ed1a69f26e8c1c01dd4cf12b7d4efe..76b95efbf19a5e3bc1cafac4d2b3e256b6a73bdf 100644 (file)
@@ -34,7 +34,7 @@ import org.junit.Rule;
 import org.junit.Test;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.Mockito.mock;
index d1d9e32f03a3f4d9dab1b9b6c3bfc8dfef2ede4f..90e49d115566c73d4684bc7f814c2828143e8920 100644 (file)
@@ -38,7 +38,7 @@ import org.sonar.server.property.InternalProperties;
 
 import static java.lang.String.format;
 import static java.lang.String.valueOf;
-import static org.apache.commons.lang.StringUtils.isNotBlank;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
 import static org.sonar.api.PropertyType.BOOLEAN;
 import static org.sonar.api.PropertyType.PASSWORD;
 import static org.sonar.api.PropertyType.STRING;
index 4426514d2f31c7038c5403baa3fece68daae3dd5..7c17bcd0ed6b098493458fcabd63fabbd94817ee 100644 (file)
@@ -25,11 +25,11 @@ import com.tngtech.java.junit.dataprovider.UseDataProvider;
 import java.util.Random;
 import java.util.stream.Stream;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.ArrayUtils;
+import org.apache.commons.lang3.ArrayUtils;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
index 77692decb3eb73b77473e81478526ddc55ce6500..510579ad44317e0072af62eb7673e0e17a63ebfd 100644 (file)
@@ -7,7 +7,7 @@ configurations {
 dependencies {
     // please keep the list ordered
 
-    api 'commons-lang:commons-lang'
+    api 'org.apache.commons:commons-lang3'
 
     compileOnlyApi 'com.google.code.findbugs:jsr305'
     compileOnlyApi 'javax.servlet:javax.servlet-api'
index 2dfb118c2c26a5b17c4d48b9cea6ea07d776b16b..2d7cd638a9754b164b769e53e9a9d76e1030f066 100644 (file)
@@ -26,10 +26,10 @@ import javax.naming.directory.SearchResult;
 import javax.security.auth.login.Configuration;
 import javax.security.auth.login.LoginContext;
 import javax.security.auth.login.LoginException;
-import org.apache.commons.lang.StringUtils;
-import org.sonar.api.server.ServerSide;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.sonar.api.server.ServerSide;
 
 /**
  * @author Evgeny Mandrikov
index 17955ca3a42e7cd7690402d796963a073470fa53..bbcbf8b9f27580387779b1a197972eb80f9b9310 100644 (file)
@@ -34,7 +34,7 @@ import javax.security.auth.Subject;
 import javax.security.auth.login.Configuration;
 import javax.security.auth.login.LoginContext;
 import javax.security.auth.login.LoginException;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index f10a10b101f98d3a893b9e0a091479e43a1c3414..365016a20f6caf5117db7b239cf095a352ccbddc 100644 (file)
@@ -23,7 +23,7 @@ import java.util.Arrays;
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.SearchResult;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.config.Configuration;
 
 /**
index 81c4f78fc76cd11931fe12b394cb7d4f0de6dd92..59fdb2120e5cd7807543f82c52c6bbcdfe681b40 100644 (file)
@@ -21,11 +21,11 @@ package org.sonar.auth.ldap;
 
 import java.util.LinkedHashMap;
 import java.util.Map;
-import org.apache.commons.lang.StringUtils;
-import org.sonar.api.config.Configuration;
-import org.sonar.api.server.ServerSide;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.sonar.api.config.Configuration;
+import org.sonar.api.server.ServerSide;
 
 /**
  * The LdapSettingsManager will parse the settings.
index bc90b60e8e6e3c5c2aa31b7ae3ab17881449d130..a32eb37eccd24ec5fd559c614be61cd8228d423f 100644 (file)
@@ -19,7 +19,7 @@
  */
 package org.sonar.auth.ldap;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.config.Configuration;
 
 import static org.sonar.auth.ldap.LdapSettingsManager.MANDATORY_LDAP_PROPERTY_ERROR;
index 71ad94881137a325ba37c236e76d8eac58e2f430..1ae3c93d58d5f5f1045f88c9350a1f5a432234cd 100644 (file)
@@ -43,7 +43,7 @@ dependencies {
 
   testImplementation 'com.google.code.findbugs:jsr305'
   testImplementation 'com.tngtech.java:junit-dataprovider'
-  testImplementation 'commons-lang:commons-lang'
+  testImplementation 'org.apache.commons:commons-lang3'
   testImplementation 'junit:junit'
   testImplementation 'org.apache.logging.log4j:log4j-api'
   testImplementation 'org.apache.logging.log4j:log4j-core'
index ac26f3a76f7ae9911ed0dd196244d756880be3c0..5bcfa4824697927bada1b236ecc7daeff9a10e4d 100644 (file)
@@ -50,7 +50,7 @@ import org.sonar.server.platform.NodeInformation;
 import static com.google.common.collect.ImmutableList.of;
 import static java.util.Arrays.asList;
 import static java.util.Collections.emptyMap;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.catchThrowable;
index 9fd9a02784146a447fbe09e655dbcf783748f893..2468ec47745bd03426974b3ba55d6d5b2b6de4bc 100644 (file)
@@ -22,7 +22,7 @@ dependencies {
   api 'net.sf.trove4j:core:3.1.0'
   api 'commons-codec:commons-codec'
   api 'commons-io:commons-io'
-  api 'commons-lang:commons-lang'
+  api 'org.apache.commons:commons-lang3'
   api 'com.google.code.gson:gson'
   api 'com.google.guava:guava'
   api 'com.google.code.findbugs:jsr305'
index 09f1d21585f849ecea50b4e52342de551cec1771..7016999d8e56d6e9f8d4bf7d44ddb179dcf020d5 100644 (file)
@@ -44,7 +44,7 @@ import org.sonar.db.component.ProjectData;
 import org.sonar.db.protobuf.DbProjectBranches;
 import org.sonar.server.project.Project;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.Mockito.mock;
index c3a546560f39f4050103c958abe8467e3e5048a4..4327e98bad7d5992cd05a31d3a0faf7190386ad4 100644 (file)
@@ -36,7 +36,7 @@ import org.sonar.scanner.protocol.output.ScannerReport;
 import org.sonar.server.es.EsTester;
 import org.sonar.server.rule.index.RuleIndexer;
 
-import static org.apache.commons.lang.StringUtils.repeat;
+import static org.apache.commons.lang3.StringUtils.repeat;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.tuple;
 
index 9e0915f85c462b4326c6a5320c26dafb74aaf447..3ff4cb4b18a144a2ae3dc44fe025385be3fba480 100644 (file)
@@ -30,7 +30,7 @@ import org.sonar.core.issue.DefaultIssue;
 import org.sonar.core.issue.tracking.Input;
 import org.sonar.db.DbClient;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.reset;
index 5ab14235cb4f6d52f5816cab8615f295c02a7ca6..50927dad62e8f5c2477a7704771eeb6e007a10fa 100644 (file)
@@ -52,7 +52,7 @@ import org.sonar.db.rule.RuleDto;
 
 import static java.util.Collections.emptyList;
 import static java.util.Collections.singleton;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verifyNoInteractions;
index b51bc868a118bdc8f4eb3e03e470785e0c2ef78c..76d916163e3326e217d5893b57237bbb0d92b3ac 100644 (file)
@@ -48,8 +48,8 @@ import org.sonar.scanner.protocol.output.ScannerReport.Component.FileStatus;
 import org.sonar.server.project.Project;
 
 import static java.util.Optional.ofNullable;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.ArgumentMatchers.any;
index 7d47e56f219902594a83e2d7b394de319c127a3b..0d1184c2167ef71dd2ddd299d920ea967a1c210d 100644 (file)
@@ -36,9 +36,9 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.slf4j.event.Level;
+import org.sonar.api.testfixtures.log.LogTester;
 import org.sonar.api.utils.MessageException;
 import org.sonar.api.utils.System2;
-import org.sonar.api.testfixtures.log.LogTester;
 import org.sonar.ce.task.log.CeTaskMessages;
 import org.sonar.ce.task.projectanalysis.analysis.AnalysisMetadataHolder;
 import org.sonar.ce.task.projectanalysis.component.Component;
@@ -58,7 +58,7 @@ import org.sonar.db.newcodeperiod.NewCodePeriodDao;
 import org.sonar.db.newcodeperiod.NewCodePeriodType;
 import org.sonar.server.project.Project;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.fail;
index 27fb4b77b06768e1e596c6e98bfda6956bfb03d8..3eee1239ad47545b5f9c4f158269aafc72bbfd5d 100644 (file)
@@ -35,7 +35,7 @@ import org.sonar.db.DbTester;
 import org.sonar.db.component.AnalysisPropertyDto;
 import org.sonar.scanner.protocol.output.ScannerReport;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.tuple;
 import static org.mockito.Mockito.mock;
index a0dc4f00fb9f36df3d0f826a733a28ad526ffb77..5281f0201aeab003b1cc166f0a7ed14d784d1868 100644 (file)
@@ -42,7 +42,7 @@ import org.sonar.db.component.SnapshotDto;
 import org.sonar.db.component.SnapshotQuery;
 import org.sonar.db.component.SnapshotTesting;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
index 85975c863e0368c144c0ddcab09035ba3f40d964..b8847b5c6ded36137678c14525e8fbc34039258c 100644 (file)
@@ -75,8 +75,7 @@ import static java.util.Collections.shuffle;
 import static java.util.Collections.singleton;
 import static java.util.stream.Collectors.toList;
 import static java.util.stream.Stream.concat;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
-import static org.apache.commons.lang.math.RandomUtils.nextInt;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.groups.Tuple.tuple;
 import static org.mockito.ArgumentCaptor.forClass;
@@ -519,7 +518,7 @@ public class SendIssueNotificationsStepIT extends BaseStepTest {
         builder(Type.FILE, 11).setKey(file.getKey()).setName(file.longName()).build())
       .build());
     RuleDto ruleDefinitionDto = newRule();
-    RuleType randomTypeExceptHotspot = RuleType.values()[nextInt(RuleType.values().length - 1)];
+    RuleType randomTypeExceptHotspot = RuleType.values()[random.nextInt(RuleType.values().length - 1)];
     DefaultIssue issue = prepareIssue(issueCreatedAt, user, project, file, ruleDefinitionDto, randomTypeExceptHotspot);
     IssuesChangesNotification issuesChangesNotification = mock(IssuesChangesNotification.class);
     when(notificationService.hasProjectSubscribersForTypes(project.uuid(), NOTIF_TYPES)).thenReturn(true);
@@ -564,7 +563,7 @@ public class SendIssueNotificationsStepIT extends BaseStepTest {
       builder(Type.FILE, 11).setKey(file.getKey()).setName(file.longName()).build()).build());
     analysisMetadataHolder.setProject(Project.from(project));
     RuleDto ruleDefinitionDto = newRule();
-    RuleType randomTypeExceptHotspot = RuleType.values()[nextInt(RuleType.values().length - 1)];
+    RuleType randomTypeExceptHotspot = RuleType.values()[random.nextInt(RuleType.values().length - 1)];
     DefaultIssue issue = newIssue(ruleDefinitionDto, branch, file).setType(randomTypeExceptHotspot).toDefaultIssue()
       .setNew(false)
       .setChanged(true)
@@ -594,7 +593,7 @@ public class SendIssueNotificationsStepIT extends BaseStepTest {
     ComponentDto project = newPrivateProjectDto().setKey(PROJECT.getKey()).setLongName(PROJECT.getName());
     ComponentDto file = newFileDto(project).setKey(FILE.getKey()).setLongName(FILE.getName());
     RuleDto ruleDefinitionDto = newRule();
-    RuleType randomTypeExceptHotspot = RuleType.values()[nextInt(RuleType.values().length - 1)];
+    RuleType randomTypeExceptHotspot = RuleType.values()[random.nextInt(RuleType.values().length - 1)];
     List<DefaultIssue> issues = IntStream.range(0, 2001 + new Random().nextInt(10))
       .mapToObj(i -> newIssue(ruleDefinitionDto, project, file).setKee("uuid_" + i).setType(randomTypeExceptHotspot).toDefaultIssue()
         .setNew(false).setChanged(true).setSendNotifications(true).setAssigneeUuid(user.getUuid()))
index 678d67bcf02c22f59e59c30469c840556898e5ed..33e9463a68f7084f3454276e591b5b15fbf4d8ab 100644 (file)
@@ -44,8 +44,8 @@ import org.sonar.db.DbTester;
 import org.sonar.db.component.ComponentDto;
 import org.sonar.db.component.SnapshotDto;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
-import static org.apache.commons.lang.StringUtils.defaultString;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.StringUtils.defaultString;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.Mockito.mock;
index b4899fcdb45da053deb363dcb3b7307705d0344c..af1260bd9da2a5259fbedc215b71b3dcb682d0ca 100644 (file)
@@ -25,7 +25,7 @@ import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.function.Function;
-import org.apache.commons.lang.time.DateUtils;
+import org.apache.commons.lang3.time.DateUtils;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
index 366196f6ce915825a8943ebf25673682a2ab09a1..0d1ac24b094bf1ec63f66409ca20e04f713bffbb 100644 (file)
@@ -26,7 +26,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.stream.Collectors;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
index 6704d1aeb8f8596b10b9e773a44f219075f338d1..1e0626beb4d197e61c68fbd39c27875713988764 100644 (file)
@@ -33,7 +33,7 @@ import org.sonar.server.qualityprofile.QualityProfile;
 
 import static com.google.common.base.Preconditions.checkState;
 import static java.util.Objects.requireNonNull;
-import static org.apache.commons.lang.StringUtils.defaultIfBlank;
+import static org.apache.commons.lang3.StringUtils.defaultIfBlank;
 
 public class AnalysisMetadataHolderImpl implements MutableAnalysisMetadataHolder {
   private static final String BRANCH_NOT_SET = "Branch has not been set";
index 57b7f66fb1ec859adf508b46f3f620ce312eec9c..c1659d8db79cb7dd9c29f16ed22846a263e8bb89 100644 (file)
@@ -30,8 +30,8 @@ import javax.annotation.concurrent.Immutable;
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkState;
 import static java.util.Objects.requireNonNull;
-import static org.apache.commons.lang.StringUtils.abbreviate;
-import static org.apache.commons.lang.StringUtils.trimToNull;
+import static org.apache.commons.lang3.StringUtils.abbreviate;
+import static org.apache.commons.lang3.StringUtils.trimToNull;
 import static org.sonar.db.component.ComponentValidator.MAX_COMPONENT_DESCRIPTION_LENGTH;
 import static org.sonar.db.component.ComponentValidator.MAX_COMPONENT_NAME_LENGTH;
 
index 0023e1d4f4c6c62274343f5e073c06acbb2db05a..804ab3a42c6244bcec8331f8e0d71f085f358bea 100644 (file)
@@ -30,7 +30,7 @@ import java.util.function.UnaryOperator;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
 import org.apache.commons.io.FilenameUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.ce.task.projectanalysis.analysis.Branch;
 import org.sonar.scanner.protocol.output.ScannerReport;
 import org.sonar.scanner.protocol.output.ScannerReport.Component.FileStatus;
@@ -39,8 +39,8 @@ import org.sonar.server.project.Project;
 import static com.google.common.base.Preconditions.checkArgument;
 import static java.lang.String.format;
 import static java.util.Objects.requireNonNull;
-import static org.apache.commons.lang.StringUtils.removeStart;
-import static org.apache.commons.lang.StringUtils.trimToNull;
+import static org.apache.commons.lang3.StringUtils.removeStart;
+import static org.apache.commons.lang3.StringUtils.trimToNull;
 import static org.sonar.scanner.protocol.output.ScannerReport.Component.ComponentType.FILE;
 
 public class ComponentTreeBuilder {
index 56c2128ab896e88dc17061f8e07194013b710e8c..03616f4bdeddfca146420a927fa890df2fcc97f2 100644 (file)
@@ -24,8 +24,8 @@ import javax.annotation.Nullable;
 import javax.annotation.concurrent.Immutable;
 
 import static com.google.common.base.Preconditions.checkArgument;
-import static org.apache.commons.lang.StringUtils.abbreviate;
-import static org.apache.commons.lang.StringUtils.trimToNull;
+import static org.apache.commons.lang3.StringUtils.abbreviate;
+import static org.apache.commons.lang3.StringUtils.trimToNull;
 import static org.sonar.db.component.ComponentValidator.MAX_COMPONENT_NAME_LENGTH;
 
 /**
index 569b894c2f8b7976f13b001ecba0b0c8cd1a19f9..ff151d68f42e7f2fda723642ae33d4d9b839515f 100644 (file)
@@ -19,7 +19,7 @@
  */
 package org.sonar.ce.task.projectanalysis.component;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.resources.Qualifiers;
 import org.sonar.api.utils.System2;
 import org.sonar.db.DbClient;
index 39426294ce552c5f5ed10e553eccbd4a4bc87049..291f956cc534fd9fe544b24a3ec1fce8fa1a901a 100644 (file)
@@ -27,7 +27,7 @@ import javax.annotation.CheckForNull;
 
 import static com.google.common.base.Preconditions.checkState;
 import static java.util.Objects.requireNonNull;
-import static org.apache.commons.lang.StringUtils.isNotBlank;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
 import static org.sonar.ce.task.projectanalysis.component.ComponentVisitor.Order.POST_ORDER;
 
 /**
index 24502c5cce1f44f6ccfea53ae82f04bbbf4dbd37..f3a04d9f938aa7c89cc121f8ae3655e0016efe2a 100644 (file)
@@ -38,7 +38,7 @@ import org.sonar.db.rule.RuleDto;
 import org.sonar.server.rule.index.RuleIndexer;
 
 import static java.util.Objects.requireNonNull;
-import static org.apache.commons.lang.StringUtils.substring;
+import static org.apache.commons.lang3.StringUtils.substring;
 import static org.sonar.api.rule.RuleStatus.READY;
 import static org.sonar.db.rule.RuleDto.Scope.ALL;
 
index 7deb4cd77de7b6a7a9b4aa48734982caac2921ff..4cfbb2be3f7f833ceb606002bd07fa4972203f63 100644 (file)
@@ -36,7 +36,7 @@ import org.sonar.db.protobuf.DbCommons;
 import org.sonar.db.protobuf.DbIssues;
 import org.sonar.server.issue.TaintChecker;
 
-import static org.apache.commons.lang.StringUtils.defaultIfEmpty;
+import static org.apache.commons.lang3.StringUtils.defaultIfEmpty;
 
 /**
  * This visitor will update the locations field of issues, by filling hashes for their locations:
index 38757e046938b33dd920d38cdc1f856dff19d189..8020f73912a2b2e5923cee7cbf0a685b37b9d998 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.ce.task.projectanalysis.issue;
 import java.util.Comparator;
 import java.util.Date;
 import java.util.Optional;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.sonar.ce.task.projectanalysis.analysis.AnalysisMetadataHolder;
@@ -36,7 +36,7 @@ import org.sonar.db.issue.IssueDto;
 import org.sonar.db.user.UserIdDto;
 import org.sonar.server.issue.IssueFieldsSetter;
 
-import static org.apache.commons.lang.StringUtils.defaultIfEmpty;
+import static org.apache.commons.lang3.StringUtils.defaultIfEmpty;
 import static org.sonar.core.issue.IssueChangeContext.issueChangeContextByScanBuilder;
 
 /**
index a26247844ec44b0b82d68c918fe5de6b46cdf270..e1aba76370cddf4fba08a616ff20b6fc597ea0a9 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.ce.task.projectanalysis.issue;
 import java.util.Objects;
 import java.util.stream.IntStream;
 import java.util.stream.Stream;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.core.issue.DefaultIssue;
 import org.sonar.db.protobuf.DbCommons;
 import org.sonar.db.protobuf.DbIssues;
index 6bc32e64b046de745342c417b0d9c9b3378884da..8ca6d401cdffcd397429688b42db7d1e4bb75702 100644 (file)
@@ -38,8 +38,8 @@ import org.sonar.api.server.rule.internal.ImpactMapper;
 import org.sonar.scanner.protocol.Constants;
 import org.sonar.scanner.protocol.output.ScannerReport;
 
-import static org.apache.commons.lang.StringUtils.isNotBlank;
-import static org.apache.commons.lang.StringUtils.trimToNull;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
+import static org.apache.commons.lang3.StringUtils.trimToNull;
 
 @Immutable
 public class NewAdHocRule {
index ec54a50b68c87cd88910bf5f5f66f452329b96ef..3100a1368b66e4aa02751a99bd6879a98ea40f27 100644 (file)
@@ -54,7 +54,7 @@ import org.sonar.scanner.protocol.output.ScannerReport.IssueType;
 import org.sonar.server.rule.CommonRuleKeys;
 
 import static java.util.stream.Collectors.toMap;
-import static org.apache.commons.lang.StringUtils.isNotEmpty;
+import static org.apache.commons.lang3.StringUtils.isNotEmpty;
 import static org.sonar.api.issue.Issue.STATUS_OPEN;
 import static org.sonar.api.issue.Issue.STATUS_TO_REVIEW;
 
index 965a018fca32210b65720104f901202b6e793b56..ded09f27e62b3e989ec246fd4d93104a65fac268 100644 (file)
@@ -27,7 +27,7 @@ import org.sonar.scanner.protocol.output.ScannerReport;
 import org.sonar.scanner.protocol.output.ScannerReport.Measure.ValueCase;
 
 import static java.util.Optional.of;
-import static org.apache.commons.lang.StringUtils.trimToNull;
+import static org.apache.commons.lang3.StringUtils.trimToNull;
 
 public class BatchMeasureToMeasure {
 
index b64d65912cb7681e74c4e32c3aec306291334954..825233686a494b9eba5c0310e688e93d5219b490 100644 (file)
@@ -27,7 +27,7 @@ import org.sonar.scanner.protocol.output.ScannerReport;
 
 import static com.google.common.base.Preconditions.checkState;
 import static java.util.Objects.requireNonNull;
-import static org.apache.commons.lang.StringUtils.isNotEmpty;
+import static org.apache.commons.lang3.StringUtils.isNotEmpty;
 
 /**
  * ScmInfo implementation based on the changeset information from the Report
index 418ad197f256b51361f60a69a54cee4456c481bd..82d6d759ba92015b2906d2368f4c0d0962662d39 100644 (file)
@@ -23,7 +23,7 @@ import java.util.List;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
 import org.apache.commons.codec.digest.DigestUtils;
-import org.apache.commons.lang.ObjectUtils;
+import org.apache.commons.lang3.ObjectUtils;
 import org.sonar.api.utils.System2;
 import org.sonar.ce.task.projectanalysis.component.Component;
 import org.sonar.ce.task.projectanalysis.component.CrawlerDepthLimit;
index 9f364a463e4812eadda0f8ab4399cf89bf138202..eb8c82455e8a259cba772f2e3f0ed62effda9159 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.ce.task.projectanalysis.source;
 
 import java.util.List;
 import java.util.Optional;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.ce.task.projectanalysis.component.Component;
 import org.sonar.core.hash.LineRange;
 import org.sonar.core.hash.SourceLineHashesComputer;
index 6a4c68d77e4e7cb4fe134c7d71e18cfbccb72c7a..5de90d57207f3b1b027cb147b18acbbfb4730402 100644 (file)
@@ -38,7 +38,7 @@ import org.sonar.db.component.SnapshotDto;
 import org.sonar.scanner.protocol.output.ScannerReport;
 
 import static com.google.common.base.MoreObjects.firstNonNull;
-import static org.apache.commons.lang.StringUtils.trimToNull;
+import static org.apache.commons.lang3.StringUtils.trimToNull;
 
 /**
  * Populates the {@link MutableTreeRootHolder} and {@link MutableAnalysisMetadataHolder} from the {@link BatchReportReader}
index ea0b1783db5cb54d5e02b9ac76c1a5471eee1961..f6acc76ccd19b765c86e6d3b2c7ecc91107251a4 100644 (file)
@@ -26,7 +26,7 @@ import java.util.Optional;
 import java.util.Set;
 import java.util.function.Function;
 import java.util.stream.Collectors;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.resources.Qualifiers;
 import org.sonar.api.resources.Scopes;
 import org.sonar.api.utils.System2;
index 2f930c25c1e010caa3eb54796b54c5c26bb5e27e..74323644cd8c268b499cc3ef2c3a815c2fb34e76 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.ce.task.projectanalysis.step;
 
 import java.util.ArrayList;
 import java.util.List;
-import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.commons.lang3.StringEscapeUtils;
 import org.sonar.ce.task.projectanalysis.component.Component;
 import org.sonar.ce.task.projectanalysis.component.CrawlerDepthLimit;
 import org.sonar.ce.task.projectanalysis.component.DepthTraversalTypeAwareCrawler;
index c7b9bdd378992c72b3d355a8136fa0b654323cfc..8fb0cb7c4a2b8ef87e72fb0d82caf676b18ac484 100644 (file)
@@ -30,7 +30,7 @@ import java.util.Set;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.measures.CoreMetrics;
 import org.sonar.ce.task.projectanalysis.component.Component;
 import org.sonar.ce.task.projectanalysis.component.CrawlerDepthLimit;
index 16c6c9e95ba2be66d4405f39f351dc3e7bf50f12..c776783f3b8da45df2b4b7234d785f16b8edd077 100644 (file)
@@ -25,7 +25,7 @@ import java.util.Date;
 import java.util.Map;
 import java.util.Optional;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.time.DateUtils;
+import org.apache.commons.lang3.time.DateUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.sonar.api.measures.CoreMetrics;
index cdf1c033ef7fe1de3f850b0e859362bf250abcdf..6feb7f79754ce231fe76d2e2512f017e925ca4cb 100644 (file)
@@ -35,7 +35,7 @@ import org.sonar.db.DbClient;
 import org.sonar.db.DbSession;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.StringUtils.defaultString;
+import static org.apache.commons.lang3.StringUtils.defaultString;
 import static org.sonar.db.DatabaseUtils.getString;
 import static org.sonar.db.component.SnapshotDto.STATUS_PROCESSED;
 
index a43abe85ebf0b74ff8d5834eed88bce99b9712f4..c6001fd70a638cf23167e3956873767ad17095d2 100644 (file)
@@ -32,7 +32,7 @@ import org.sonar.db.DbSession;
 import org.sonar.db.component.BranchDto;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.StringUtils.defaultString;
+import static org.apache.commons.lang3.StringUtils.defaultString;
 
 public class ExportBranchesStep implements ComputationStep {
 
index ea8c2a6868634572bb385837d929a6a91c9bb6b8..562c9a8c088727259cf748fa931f06bb285d9f43 100644 (file)
@@ -23,8 +23,8 @@ import com.sonarsource.governance.projectdump.protobuf.ProjectDump;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
-import org.sonar.api.resources.Qualifiers;
 import org.slf4j.LoggerFactory;
+import org.sonar.api.resources.Qualifiers;
 import org.sonar.ce.task.projectexport.steps.DumpElement;
 import org.sonar.ce.task.projectexport.steps.DumpWriter;
 import org.sonar.ce.task.projectexport.steps.ProjectHolder;
@@ -35,7 +35,7 @@ import org.sonar.db.DbClient;
 import org.sonar.db.DbSession;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.StringUtils.defaultString;
+import static org.apache.commons.lang3.StringUtils.defaultString;
 import static org.sonar.db.DatabaseUtils.getString;
 
 public class ExportComponentsStep implements ComputationStep {
index 74f107644626d51441d7273e6790d5ec7e7cef41..d773c3f9f38cb9e56e643ecd3ea32191d6a07663 100644 (file)
@@ -32,7 +32,7 @@ import org.sonar.db.DbSession;
 import org.sonar.db.component.SnapshotDto;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.StringUtils.defaultString;
+import static org.apache.commons.lang3.StringUtils.defaultString;
 import static org.sonar.db.DatabaseUtils.getString;
 
 public class ExportEventsStep implements ComputationStep {
index 90e751ba9095e07b6065a1f541ff913faf91af85..68548a4fc2929dde2c0f1a2de931ff4f9d468635 100644 (file)
@@ -28,7 +28,7 @@ import org.sonar.db.DbSession;
 import org.sonar.db.component.ProjectLinkDto;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.StringUtils.defaultString;
+import static org.apache.commons.lang3.StringUtils.defaultString;
 
 public class ExportLinksStep implements ComputationStep {
 
index 880e246da81052f2ee5be79e3519f7b1f566f905..316a939a605a8c2a3b159c2b40c776204a1c9652 100644 (file)
@@ -30,7 +30,7 @@ import org.sonar.db.DbClient;
 import org.sonar.db.DbSession;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.StringUtils.defaultString;
+import static org.apache.commons.lang3.StringUtils.defaultString;
 import static org.sonar.db.DatabaseUtils.getDouble;
 import static org.sonar.db.DatabaseUtils.getString;
 
index 622065eae255dc1a2dfb5cf471fc364e9174bfad..6606c02a829100b7400ccde332378154f5fffd07 100644 (file)
@@ -32,7 +32,7 @@ import org.sonar.db.DbSession;
 import org.sonar.db.component.SnapshotDto;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.StringUtils.defaultString;
+import static org.apache.commons.lang3.StringUtils.defaultString;
 import static org.sonar.db.DatabaseUtils.getDouble;
 import static org.sonar.db.DatabaseUtils.getString;
 
index a981b84b51f6d1ea690603ceb3125d583a8603fd..a2902287fadf4f3939026198f178f0b40c9d8a6a 100644 (file)
@@ -29,7 +29,7 @@ import org.sonar.db.DbSession;
 import org.sonar.db.metric.MetricDto;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.StringUtils.defaultString;
+import static org.apache.commons.lang3.StringUtils.defaultString;
 
 public class ExportMetricsStep implements ComputationStep {
 
index 5660a82454b1de5a74e002300e08028ced01745e..c8c1ec21cb067f52fbbc9a82a182aa3637f17767 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.ce.task.projectexport.steps;
 
 import com.sonarsource.governance.projectdump.protobuf.ProjectDump;
 import java.util.Collection;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.LoggerFactory;
 import org.sonar.ce.task.step.ComputationStep;
 import org.sonar.core.platform.PluginInfo;
index df2f25251830d0bddc54b7bf1b123997b112116a..573e0bcf6bd241b3017df5ee987ccf0dfda4dfd7 100644 (file)
@@ -29,7 +29,7 @@ import org.sonar.db.DbSession;
 import org.sonar.db.property.PropertyDto;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.StringUtils.defaultString;
+import static org.apache.commons.lang3.StringUtils.defaultString;
 
 public class ExportSettingsStep implements ComputationStep {
 
index 952a702ee7a414e57e53b8f4757384d8c6831ed0..72d8fc66994c32012ca9ff27f1e4ce9c203d92f3 100644 (file)
@@ -29,7 +29,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Random;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
index b2a567a98d6f47b61fe60c7a592436781796386d..02efc7fc4dad44eef95b7582a4d1d89c6abde469 100644 (file)
@@ -25,7 +25,7 @@ import org.junit.Test;
 import org.sonar.ce.task.projectanalysis.component.Component.Status;
 
 import static com.google.common.base.Strings.repeat;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.fail;
index 813832cd13d77f75e735ee3ef4cf24bd975e1c2f..8f6e737572cd7b56879e4c1188cd9ea7da58a061 100644 (file)
@@ -39,7 +39,7 @@ import org.sonar.scanner.protocol.output.ScannerReport;
 import org.sonar.server.project.Project;
 
 import static com.google.common.base.Preconditions.checkArgument;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.junit.Assert.fail;
index f7a170782c3969d2a5586a410150ec37a92bb197..03955c55068f99f3810e537ac8fc8c50f39c3f65 100644 (file)
@@ -38,7 +38,7 @@ import org.sonar.duplications.block.ByteArray;
 import static com.google.common.base.Strings.padStart;
 import static java.util.Arrays.asList;
 import static java.util.Collections.singletonList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
index c529e2dc793cc98e9b4bc882400f8fa3efba2823..9d17a2cddec47a03bdee2e15271fcdae68d77788 100644 (file)
@@ -38,7 +38,7 @@ import org.sonar.ce.task.CeTask;
 import org.sonar.ce.task.projectanalysis.filemove.ScoreMatrix.ScoreFile;
 import org.sonar.server.platform.ServerFileSystem;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
index 872470a696372509ac1560f861231b1109290323..aa9d78dc20568b14a8be61db3fbd0a899da7be4b 100644 (file)
@@ -29,7 +29,7 @@ import java.util.Map;
 import java.util.Optional;
 import java.util.function.BiConsumer;
 import java.util.stream.Stream;
-import org.apache.commons.lang.ArrayUtils;
+import org.apache.commons.lang3.ArrayUtils;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
index d4581c0ec461b82dcb18d0e73ccfe6f14da946d6..90f547b0fe0c44089d61f2df9956102b53e1bf2b 100644 (file)
  */
 package org.sonar.ce.task.projectanalysis.locations.flow;
 
+import java.security.SecureRandom;
 import java.util.List;
 import java.util.Map;
-import org.apache.commons.lang.math.RandomUtils;
+import java.util.Random;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.InjectMocks;
@@ -34,7 +35,7 @@ import org.sonar.db.protobuf.DbIssues;
 
 import static java.util.function.Function.identity;
 import static java.util.stream.Collectors.toMap;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
@@ -44,6 +45,9 @@ public class FlowGeneratorTest {
 
   private static final String COMPONENT_NAME = "test_comp";
 
+  private final Random random = new SecureRandom();
+
+
   @Mock
   private TreeRootHolder treeRootHolder;
 
@@ -124,10 +128,10 @@ public class FlowGeneratorTest {
 
   private DbIssues.Location createDbLocation(String componentId) {
     org.sonar.db.protobuf.DbCommons.TextRange textRange = org.sonar.db.protobuf.DbCommons.TextRange.newBuilder()
-      .setStartLine(RandomUtils.nextInt())
-      .setEndLine(RandomUtils.nextInt())
-      .setStartOffset(RandomUtils.nextInt())
-      .setEndOffset(RandomUtils.nextInt())
+      .setStartLine(random.nextInt(Integer.MAX_VALUE))
+      .setEndLine(random.nextInt(Integer.MAX_VALUE))
+      .setStartOffset(random.nextInt(Integer.MAX_VALUE))
+      .setEndOffset(random.nextInt(Integer.MAX_VALUE))
       .build();
 
     Component component = mock(Component.class);
index ee249303fffc60f0d6891033527556d4cd7adecb..3c859cff728efae494382b30bac0a870c6a0928a 100644 (file)
@@ -60,7 +60,7 @@ import org.sonar.server.issue.notification.NewIssuesNotification.DetailsSupplier
 import org.sonar.server.issue.notification.NewIssuesNotification.RuleDefinition;
 
 import static java.util.Collections.emptyMap;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.ArgumentMatchers.any;
index 896a73070452016edc0418341bae4cea1ceef830..1b2c639eeffe2fa276a0d1235718dd2dbeeac079 100644 (file)
@@ -38,7 +38,7 @@ import org.sonar.server.notification.email.EmailNotificationChannel.EmailDeliver
 
 import static java.util.Collections.emptySet;
 import static java.util.stream.Collectors.toSet;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
index e585411262877b83d1e90f472d4ec7d9b10330f3..56dbc23139cbeec62d1cb68aebb6eaa4dd50f858 100644 (file)
@@ -49,7 +49,7 @@ import org.sonar.db.protobuf.DbIssues;
 import org.sonar.db.rule.RuleDto;
 import org.sonar.server.issue.TaintChecker;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.fail;
 import static org.assertj.core.api.Assertions.tuple;
index 0f2360fa8866958a372bb212cd02b53f314e82b7..df5120f8d6869ab60a83dee57dc12ac3b16821f5 100644 (file)
@@ -34,7 +34,7 @@ import org.sonar.ce.task.projectanalysis.component.Component;
 import org.sonar.ce.task.projectanalysis.component.ReportComponent;
 import org.sonar.ce.task.projectanalysis.source.linereader.LineReader;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
index 30dc90073063956301f2048120dd9b4acff52733..88788df63f3e71a16163c7512287f7c93ad2ef17 100644 (file)
@@ -32,7 +32,7 @@ import org.sonar.db.DbSession;
 import org.sonar.db.component.ComponentDao;
 
 import static java.util.Collections.emptyList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.eq;
index 23eb02894cfafa18e1d45dbfaf67b152f645c7c7..f869075e53730ad950cdcf4322ccfd9208573a4a 100644 (file)
@@ -47,7 +47,7 @@ import org.sonar.server.project.Project;
 import org.sonar.server.qualitygate.notification.QGChangeNotification;
 
 import static java.util.Collections.emptyList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.reset;
index a2055e549bfb7582d4fe7f2c4b1c5120fe4ca02a..98a9032e054e84578e71352b036f2f1023235477 100644 (file)
@@ -47,7 +47,7 @@ import org.sonar.server.webhook.WebHooks;
 import org.sonar.server.webhook.WebhookPayload;
 import org.sonar.server.webhook.WebhookPayloadFactory;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.eq;
index 647322c36a1a2d4f4c518161ab52e2223f01f35a..aaf1a421187034b7db512c66814c2eaaa65440b9 100644 (file)
@@ -34,7 +34,7 @@ import org.sonar.server.qualityprofile.QualityProfile;
 
 import static com.google.common.base.Preconditions.checkNotNull;
 import static com.google.common.base.Preconditions.checkState;
-import static org.apache.commons.lang.StringUtils.defaultIfBlank;
+import static org.apache.commons.lang3.StringUtils.defaultIfBlank;
 
 public class AnalysisMetadataHolderRule extends ExternalResource implements MutableAnalysisMetadataHolder, AfterEachCallback {
 
index 7750b937287178844458f075d7fce9a1b3ff38be..b5acf20381ff5db5a90be414d1ae9f634df2afd4 100644 (file)
@@ -23,8 +23,8 @@ import javax.annotation.Nullable;
 import org.sonar.core.component.ComponentKeys;
 import org.sonar.db.component.BranchType;
 
-import static org.apache.commons.lang.StringUtils.isEmpty;
-import static org.apache.commons.lang.StringUtils.trimToNull;
+import static org.apache.commons.lang3.StringUtils.isEmpty;
+import static org.apache.commons.lang3.StringUtils.trimToNull;
 
 public class TestBranch implements Branch {
   private final String name;
index a20b0e914047f9b617174a44c4c890bb3d9adf0f..966c7f84ce80fd7784219a3cdbee1f57da204219 100644 (file)
@@ -36,8 +36,8 @@ import org.sonar.db.DbClient;
 import org.sonar.db.DbTester;
 
 import static java.util.stream.Collectors.toList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.tuple;
index 1e39226221bad449ea5687341698a12f37a9a000..6f3825f1dd19153fb1848b714fbe7c69f3e02100 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.ce.task;
 import org.junit.Test;
 import org.sonar.db.ce.CeActivityDto;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 
 public class CeTaskCanceledExceptionTest {
index 3fb1b68cba739093e4b2fe88f3161b43512a0ef8..091c4fd6fb3c265126ec85480319af6a3b1ba934 100644 (file)
@@ -25,7 +25,7 @@ import com.tngtech.java.junit.dataprovider.UseDataProvider;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
index 44c18bf764e14722588430cafd9c1c79e200c690..c0c69cc7aca0187a087805697dc8aeaa1cd339e6 100644 (file)
@@ -23,7 +23,7 @@ import java.util.Random;
 import org.junit.Test;
 import org.sonar.db.ce.CeActivityDto;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonar.ce.task.CeTaskInterruptedException.isTaskInterruptedException;
 
index 98768c65f3c922a2d53f2efc6fe1c88535405636..d624ed250239a23ceddae2b550a4e1e230415fb7 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.ce.task;
 
 import java.io.PrintWriter;
 import java.io.StringWriter;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.Test;
 import org.sonar.db.ce.CeActivityDto;
 
index ae8018472dbd3ec7de47f9efcaaa0ea7b139c69a..74663de4144338ff0853254e73cdaba6b6103639 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.ce.task.log;
 import org.junit.Test;
 import org.sonar.ce.task.log.CeTaskMessages.Message;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
index c55507478cb25dd280ef622c4864f1c234809388..d6c05c878bd24527948bbea41956eb560edb420e 100644 (file)
@@ -26,7 +26,7 @@ import java.util.Date;
 import java.util.Locale;
 import java.util.Properties;
 import org.apache.commons.codec.digest.DigestUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
index a214e8da472167e4618749fcdc77837c638c3e18..74bb003acf69997974dabaf691523a0c2ade6ad4 100644 (file)
@@ -51,7 +51,7 @@ import org.sonar.db.project.ProjectDto;
 import org.sonar.server.notification.NotificationService;
 
 import static java.util.Collections.singleton;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.fail;
index 60b753a3a74d2c6a1f4a71abe500a6233f31377b..0387d7ec429b0441893999e5b8f8b090148738b2 100644 (file)
@@ -23,9 +23,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
-import java.util.Random;
 import java.util.Set;
-import java.util.UUID;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 import javax.annotation.CheckForNull;
@@ -55,7 +53,7 @@ import org.sonar.db.ce.CeTaskTypes;
 import org.sonar.db.user.UserDto;
 import org.sonar.db.user.UserTesting;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.ArgumentMatchers.any;
index 0ac8ba87107a475406521e9e586d5f9ec47625cf..fa6ac94fdb4ea7788eb2bba779f6487491055a4e 100644 (file)
@@ -25,7 +25,7 @@ import java.util.Objects;
 import java.util.Optional;
 import java.util.Set;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.ObjectUtils;
+import org.apache.commons.lang3.ObjectUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.sonar.api.ce.ComputeEngineSide;
index 7d7c3b0bda11f1b5bbf150181666badddb088f9e..8e45999d8b97fc74d60a496950b84ce480ad7bb5 100644 (file)
@@ -25,7 +25,7 @@ import org.slf4j.event.Level;
 import org.sonar.api.config.internal.MapSettings;
 import org.sonar.api.testfixtures.log.LogTester;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 
 public class CeWorkerCountSettingWarningTest {
index caf5600410732c47b82fe82c43489bc6f3d4393e..c4808e860ef78d56222251cad6e792aee52f54e9 100644 (file)
@@ -32,7 +32,7 @@ import javax.annotation.CheckForNull;
 import javax.management.InstanceNotFoundException;
 import javax.management.ObjectInstance;
 import javax.management.ObjectName;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.sonar.ce.configuration.CeConfiguration;
index 5995310e08d3e2348ae0ce57f2e1c5cf0a6490a1..56558d16cff6cee9bf3857fddaaf762531fee3fa 100644 (file)
@@ -23,7 +23,7 @@ import org.junit.Test;
 import org.sonar.ce.task.CeTask;
 import org.sonar.ce.task.CeTaskCanceledException;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verifyNoInteractions;
index 2b07008a7af3eac3b669ca85025d1f19d1ccbaf2..d22d6e12bbbc6b04ce8d5370960fc6b0338c5be2 100644 (file)
@@ -30,7 +30,7 @@ import org.sonar.ce.task.CeTask;
 import org.sonar.ce.task.CeTaskCanceledException;
 import org.sonar.ce.task.CeTaskTimeoutException;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.Mockito.mock;
index c65d7834a21978d87c1917c1f2560ba7ad627384..58f26e01f0dc8feca549204c7de62b82ebf8d9a7 100644 (file)
@@ -11,7 +11,7 @@ dependencies {
   api 'ch.qos.logback:logback-core'
   api 'com.google.guava:guava'
   api 'commons-io:commons-io'
-  api 'commons-lang:commons-lang'
+  api 'org.apache.commons:commons-lang3'
   api 'com.zaxxer:HikariCP'
   api 'org.mybatis:mybatis'
   api 'org.slf4j:slf4j-api'
index e818da5f0b3d31e2bbf7fc1303fd4ba4688e64c9..c53ec52e471eef160248e311ca707c39b4829d11 100644 (file)
@@ -49,7 +49,7 @@ import java.util.regex.Pattern;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index fe6da27b242a01bbb2d9b52c68eeadfd3b2d49a5..b29d832f23e60efff62c5761aa4c99ab272db81e 100644 (file)
@@ -30,7 +30,7 @@ import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
 import javax.sql.DataSource;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.sonar.api.config.internal.Settings;
index 6ef18a9cc140ee386b3c908348af3cba05eae0ef..0cdfbafd45569d154492d0af0731a904516d3503 100644 (file)
@@ -24,7 +24,7 @@ import java.util.Optional;
 import java.util.Set;
 import java.util.function.Predicate;
 import java.util.function.Supplier;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.utils.MessageException;
 
 public final class DialectUtils {
index 87d2e312b0ea9f1928aa53c0263dd4f80fa4b8b2..d4fe21d254a1a27c1acf82669d17be93582ccca7 100644 (file)
@@ -20,7 +20,7 @@
 package org.sonar.db.dialect;
 
 import java.sql.DatabaseMetaData;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.LoggerFactory;
 
 public class H2 extends AbstractDialect {
index d17dd1aac674771084efaf7d669e5ed105c530d5..1d6898e27062adc6f692f11c19adcfa816417ec9 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.db.dialect;
 
 import java.sql.DatabaseMetaData;
 import java.sql.SQLException;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.utils.Version;
 
 public class MsSql extends AbstractDialect {
index c7208f6395887af6e112795dae26218468e164fb..8f38e7e1f6d38fc6b7981ada3dc4c14b43cc2db0 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.db.dialect;
 import java.sql.DatabaseMetaData;
 import java.sql.SQLException;
 import java.util.List;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.utils.MessageException;
 import org.sonar.api.utils.Version;
 
index 517da57c68a6b0879614537cc3b4c872cf47d2d5..1d5568abc0bf0b29ebc8ebf8abf52cf9c7dfb7ed 100644 (file)
@@ -22,9 +22,9 @@ package org.sonar.db.dialect;
 import java.sql.DatabaseMetaData;
 import java.sql.SQLException;
 import java.util.List;
-import org.apache.commons.lang.StringUtils;
-import org.sonar.api.utils.Version;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.LoggerFactory;
+import org.sonar.api.utils.Version;
 
 import static com.google.common.base.Preconditions.checkState;
 
index 6f21081969384a78a549156163f31e97f7f39ce9..71c5c3d17b34418f772d4b34d62de54f1ae2a45b 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.db.profiling;
 import java.util.regex.Pattern;
 import javax.annotation.Nullable;
 
-import static org.apache.commons.lang.StringUtils.abbreviate;
+import static org.apache.commons.lang3.StringUtils.abbreviate;
 
 public class SqlLogFormatter {
 
index ec57a457daed066b42866651f2e930cc4b1b1e08..d67068b9efc43d62f9b1f41221071b14627dbf58 100644 (file)
@@ -32,7 +32,7 @@ import org.sonar.api.testfixtures.log.LogTester;
 import org.sonar.db.dialect.PostgreSql;
 import org.sonar.process.logging.LogbackHelper;
 
-import static org.apache.commons.lang.StringUtils.removeStart;
+import static org.apache.commons.lang3.StringUtils.removeStart;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.Mockito.mock;
index 5e68f1a43f564cdc05be102864c793df4f577039..b15bdbe97f9a5261ff44ddacee3c69d75bc97e19 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.db.profiling;
 
 import org.junit.Test;
 
-import static org.apache.commons.lang.StringUtils.repeat;
+import static org.apache.commons.lang3.StringUtils.repeat;
 import static org.assertj.core.api.Assertions.assertThat;
 
 public class SqlLogFormatterTest {
index 18cd8c70b449830f86ad2de190d21bffd9923f6c..bb664813519983a3f3bf4cfbcc39d951d8f0940b 100644 (file)
@@ -50,7 +50,7 @@ import javax.annotation.Nullable;
 import org.apache.commons.collections4.map.CaseInsensitiveMap;
 import org.apache.commons.dbutils.QueryRunner;
 import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.rules.ExternalResource;
 import org.slf4j.LoggerFactory;
 import org.sonar.db.dialect.H2;
index 75a29f2675e83f0bd7ef2317b19e2cf27a2d33f2..49af5141c67830c05d16531f04a63916bf8654e3 100644 (file)
@@ -19,7 +19,7 @@
  */
 package org.sonar.db;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.jupiter.api.extension.AfterEachCallback;
 import org.junit.jupiter.api.extension.BeforeEachCallback;
 import org.junit.jupiter.api.extension.ExtensionContext;
index 1fe53397fbba08e064c59a5546a9981634cccb8f..a75979c4356fa360ff471a6317197b779a07a754 100644 (file)
@@ -10,7 +10,7 @@ dependencies {
   api 'com.google.guava:guava'
   api 'com.google.protobuf:protobuf-java'
   api 'commons-io:commons-io'
-  api 'commons-lang:commons-lang'
+  api 'org.apache.commons:commons-lang3'
   api 'org.lz4:lz4-java'
   api 'org.mybatis:mybatis'
   api 'org.sonarsource.api.plugin:sonar-plugin-api'
index 9a53ae0c4f67375c49489fea474e247faddde8de..7fba2db8cce0f290d4462d165b9af7e6100c63f7 100644 (file)
@@ -30,7 +30,7 @@ import org.sonar.db.alm.setting.AlmSettingDto;
 import org.sonar.db.audit.NoOpAuditPersister;
 import org.sonar.db.user.UserDto;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
index 059240f24deef7fc0ac9893a7c31bf529cc53e57..089898fa803e6bb48876742ef5fafe564138f3da 100644 (file)
@@ -30,7 +30,7 @@ import org.sonar.core.util.UuidFactoryImpl;
 import org.sonar.db.DbSession;
 import org.sonar.db.DbTester;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonar.db.audit.AuditDao.EXCEEDED_LENGTH;
 
index 7313854807e46919ff79c28fbd2a2fa161228497..5159888bea3ed3ff2e60b312c45dbddc096122f5 100644 (file)
@@ -51,7 +51,7 @@ import org.sonar.db.project.ProjectDto;
 import static java.util.Collections.emptyList;
 import static java.util.Collections.singleton;
 import static java.util.Collections.singletonList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.tuple;
 import static org.sonar.db.Pagination.forPage;
index fd8c3f4394b83517a97cf7f168d0e62295e6704d..60c5b58dc46d7558a2bf003b0b06aba7349dfae1 100644 (file)
@@ -31,7 +31,7 @@ import org.sonar.db.DbSession;
 import org.sonar.db.DbTester;
 import org.sonar.db.project.ProjectDto;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.AssertionsForClassTypes.tuple;
index 7c06c0b0f36a4f491305191ea084e575c7dc2dd8..1b5a45eabb2db1bdf98df8e664964022f727a15d 100644 (file)
@@ -45,7 +45,7 @@ import org.sonar.db.protobuf.DbProjectBranches;
 import static java.util.Arrays.asList;
 import static java.util.Collections.emptyList;
 import static java.util.Collections.singletonList;
-import static org.apache.commons.lang.StringUtils.repeat;
+import static org.apache.commons.lang3.StringUtils.repeat;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.entry;
 import static org.assertj.core.api.Assertions.tuple;
index 142377764a87464ad87c402bbb7c7798c760e1f5..198ae57e5c100623f506389cef11bad12b91d741 100644 (file)
@@ -48,7 +48,6 @@ import org.sonar.db.audit.AuditPersister;
 import org.sonar.db.audit.NoOpAuditPersister;
 import org.sonar.db.audit.model.ComponentNewValue;
 import org.sonar.db.issue.IssueDto;
-import org.sonar.db.metric.MetricDto;
 import org.sonar.db.project.ProjectDto;
 import org.sonar.db.rule.RuleDto;
 import org.sonar.db.source.FileSourceDto;
@@ -61,7 +60,7 @@ import static java.util.Collections.emptySet;
 import static java.util.Collections.singleton;
 import static java.util.Collections.singletonList;
 import static java.util.stream.Collectors.toSet;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.entry;
index 76291a2f157cf7d0b04790247936bb39b43beb3d..c6964a51ba79d3d7b9276657bf410bbe6d0a796f 100644 (file)
@@ -32,7 +32,7 @@ import org.sonar.db.audit.AuditPersister;
 import org.sonar.db.audit.model.ComponentKeyNewValue;
 import org.sonar.db.project.ProjectDto;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.ArgumentMatchers.any;
index 0b349d7711953fb22648d7e7198062837a429175..0f6edb1c5d9a3634c9efd84de2db1420f324d96a 100644 (file)
@@ -38,7 +38,7 @@ import org.sonar.db.DbTester;
 import org.sonar.db.audit.NoOpAuditPersister;
 import org.sonar.db.source.FileSourceDto;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonar.api.resources.Qualifiers.FILE;
 import static org.sonar.api.resources.Qualifiers.UNIT_TEST_FILE;
index 148c133b957f6e52253362025882e5b7e9705f02..606ac14a93c53295df234e586baf6cf846723fd2 100644 (file)
@@ -19,6 +19,7 @@
  */
 package org.sonar.db.component;
 
+import java.security.SecureRandom;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Comparator;
@@ -45,8 +46,7 @@ import static com.google.common.collect.Lists.newArrayList;
 import static java.util.Collections.emptyList;
 import static java.util.Collections.singletonList;
 import static java.util.stream.Collectors.toList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
-import static org.apache.commons.lang.math.RandomUtils.nextLong;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.tuple;
 import static org.sonar.db.ce.CeActivityDto.Status.CANCELED;
@@ -61,6 +61,8 @@ import static org.sonar.db.component.SnapshotTesting.newAnalysis;
 
 class SnapshotDaoIT {
 
+  private final Random random = new SecureRandom();
+
   @RegisterExtension
   private final DbTester db = DbTester.create(System2.INSTANCE);
 
@@ -210,7 +212,6 @@ class SnapshotDaoIT {
 
   @Test
   void selectAnalysesByQuery_all() {
-    Random random = new Random();
     List<SnapshotDto> snapshots = IntStream.range(0, 1 + random.nextInt(5))
       .mapToObj(i -> {
         ComponentDto project = db.components().insertPrivateProject().getMainBranchComponent();
@@ -227,7 +228,6 @@ class SnapshotDaoIT {
 
   @Test
   void selectAnalysesByQuery_by_component_uuid() {
-    Random random = new Random();
     ComponentDto project1 = db.components().insertPrivateProject().getMainBranchComponent();
     ComponentDto project2 = db.components().insertPrivateProject().getMainBranchComponent();
     List<SnapshotDto> snapshots1 = IntStream.range(0, 1 + random.nextInt(20))
@@ -249,7 +249,6 @@ class SnapshotDaoIT {
 
   @Test
   void selectAnalysesByQuery_sort_by_date() {
-    Random random = new Random();
     ComponentDto project = db.components().insertPrivateProject().getMainBranchComponent();
     List<SnapshotDto> snapshots = IntStream.range(0, 1 + random.nextInt(20))
       .mapToObj(j -> SnapshotTesting.newAnalysis(project).setCreatedAt(1_000L + j))
@@ -573,11 +572,11 @@ class SnapshotDaoIT {
     queueDto.setTaskType(CeTaskTypes.REPORT);
     queueDto.setComponentUuid(projectUuid);
     queueDto.setUuid(randomAlphanumeric(40));
-    queueDto.setCreatedAt(nextLong());
+    queueDto.setCreatedAt(random.nextLong(Long.MAX_VALUE));
     CeActivityDto activityDto = new CeActivityDto(queueDto);
     activityDto.setStatus(status);
-    activityDto.setExecutionTimeMs(nextLong());
-    activityDto.setExecutedAt(nextLong());
+    activityDto.setExecutionTimeMs(random.nextLong(10000));
+    activityDto.setExecutedAt(random.nextLong(Long.MAX_VALUE));
     activityDto.setAnalysisUuid(analysis.getUuid());
     db.getDbClient().ceActivityDao().insert(db.getSession(), activityDto);
     db.commit();
index d7c7ae1a727fcc553dd3bcc57882bd50726ba12a..bb7b889b155a6ffd635453c3a1a639ce734c9e18 100644 (file)
@@ -30,7 +30,7 @@ import org.sonar.db.DbSession;
 import org.sonar.db.DbTester;
 
 import static java.util.Collections.singletonList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.tuple;
 import static org.mockito.Mockito.mock;
index 99416540c8af441bad3bf4cc6d5b12ec382c2dff..015f87d4271db7a3af3ba4c9d2d45f74e1ad0c66 100644 (file)
@@ -19,6 +19,7 @@
  */
 package org.sonar.db.issue;
 
+import java.security.SecureRandom;
 import java.sql.SQLException;
 import java.util.Collection;
 import java.util.Collections;
@@ -26,6 +27,7 @@ import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Optional;
+import java.util.Random;
 import java.util.Set;
 import java.util.stream.IntStream;
 import java.util.stream.Stream;
@@ -56,7 +58,6 @@ import org.sonar.db.user.UserDto;
 
 import static java.util.Arrays.asList;
 import static java.util.Collections.emptyList;
-import static org.apache.commons.lang.math.RandomUtils.nextInt;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.fail;
@@ -96,6 +97,8 @@ class IssueDaoIT {
   private static final String TEST_CONTEXT_KEY = "test_context_key";
   private static final String USER_LOGIN = "user_login";
 
+  private static final Random RANDOM = new SecureRandom();
+
   private static final RuleType[] RULE_TYPES_EXCEPT_HOTSPOT = Stream.of(RuleType.values())
     .filter(r -> r != RuleType.SECURITY_HOTSPOT)
     .toArray(RuleType[]::new);
@@ -1041,7 +1044,7 @@ class IssueDaoIT {
   }
 
   private static RuleType randomRuleTypeExceptHotspot() {
-    return RULE_TYPES_EXCEPT_HOTSPOT[nextInt(RULE_TYPES_EXCEPT_HOTSPOT.length)];
+    return RULE_TYPES_EXCEPT_HOTSPOT[RANDOM.nextInt(RULE_TYPES_EXCEPT_HOTSPOT.length)];
   }
 
   private void insertBranchIssue(ComponentDto branch, ComponentDto file, RuleDto rule, String id, String status,
index 7708b9046ecf02e2723bca54e336ce596043b09a..9646983c237967ad76626cafa30aee30d4b01c81 100644 (file)
@@ -51,7 +51,7 @@ import org.sonar.db.component.ComponentTesting;
 import org.sonar.db.rule.RuleDto;
 import org.sonar.db.rule.RuleTesting;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.tuple;
 
index b415146656ddb5da677cd4c72835e65f2a324c0b..99b137f10939f207aab3ad37b6b6deefe8757cb5 100644 (file)
@@ -27,7 +27,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Optional;
 import java.util.stream.IntStream;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
index d6e13e8dbae7f5f7a239517b725468204be7f74d..83b1fdfff64f165ffc538f2c16389769c3fddb7d 100644 (file)
@@ -19,6 +19,7 @@
  */
 package org.sonar.db.project;
 
+import java.security.SecureRandom;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -27,6 +28,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
+import java.util.Random;
 import java.util.Set;
 import java.util.function.Consumer;
 import java.util.stream.Collectors;
@@ -53,7 +55,6 @@ import org.sonar.db.metric.MetricDto;
 import org.sonar.db.qualityprofile.QProfileDto;
 
 import static java.util.Collections.emptySet;
-import static org.apache.commons.lang.math.RandomUtils.nextInt;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.tuple;
 import static org.mockito.ArgumentMatchers.any;
@@ -66,6 +67,8 @@ import static org.sonar.api.measures.Metric.ValueType.STRING;
 
 class ProjectDaoIT {
 
+  private final Random random = new SecureRandom();
+
   private final System2 system2 = new AlwaysIncreasingSystem2(1000L);
 
   @RegisterExtension
@@ -312,7 +315,7 @@ class ProjectDaoIT {
   @Test
   void select_project_uuids_associated_to_default_quality_profile_for_specific_language() {
     String language = "xoo";
-    Set<ProjectData> projects = insertProjects(nextInt(10));
+    Set<ProjectData> projects = insertProjects(random.nextInt(10));
     insertDefaultQualityProfile(language);
     insertProjectsLiveMeasures(language, projects);
 
@@ -427,7 +430,7 @@ class ProjectDaoIT {
       .setMetricUuid(metric.getUuid())
       .setComponentUuid(componentDto.uuid())
       .setProjectUuid(project.getUuid())
-      .setData(language + "=" + nextInt(10));
+      .setData(language + "=" + random.nextInt(10));
   }
 
   private Consumer<ProjectData> insertLiveMeasure(String language, MetricDto metric) {
index 64bd52e95c8fc0a9e0007a1aacd45f0bcbaa1ba1..6d7dbfe061925a1a5213e36e7133ad33e32ba2b7 100644 (file)
@@ -25,7 +25,7 @@ import java.util.Set;
 import java.util.function.Consumer;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.apache.ibatis.cursor.Cursor;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
index 3ea737b4332a524937ede4c46f8ab43d3488a5f0..3bb89a1adeb885f2e0e9e93026e35d8cfe9436f1 100644 (file)
@@ -48,7 +48,7 @@ import org.sonar.db.audit.model.PropertyNewValue;
 
 import static java.lang.Boolean.FALSE;
 import static java.lang.Boolean.TRUE;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.entry;
index e3cc2950c321861733e44f42f5999783237469a7..754eb0ece6eb40a364a22dd064f3f0c05ab0a540 100644 (file)
@@ -50,7 +50,7 @@ import org.sonar.db.user.UserDto;
 import static com.google.common.collect.ImmutableSet.of;
 import static com.google.common.collect.Sets.newHashSet;
 import static java.util.Collections.singletonList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.groups.Tuple.tuple;
index 48a3e200b9738df2ef8fc0a8acff1e2c839ade19..818fd7582359b3b9376fdf37ea8a56401bcf5638 100644 (file)
@@ -69,7 +69,7 @@ import static com.google.common.collect.Lists.newArrayList;
 import static java.util.Arrays.asList;
 import static java.util.Collections.singleton;
 import static java.util.Collections.singletonList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatNoException;
 import static org.assertj.core.api.Assertions.tuple;
index 8bdb1ac281513f125be0eea35de78ed52908e3d1..2bef9d30cc926b8e95fc1fc465870d9774d6ebfc 100644 (file)
@@ -22,6 +22,7 @@ package org.sonar.db.purge;
 import com.google.common.collect.ImmutableSet;
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
+import java.security.SecureRandom;
 import java.time.LocalDateTime;
 import java.time.ZoneOffset;
 import java.util.ArrayList;
@@ -37,8 +38,7 @@ import java.util.stream.Collectors;
 import java.util.stream.IntStream;
 import java.util.stream.Stream;
 import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.math.RandomUtils;
-import org.apache.commons.lang.time.DateUtils;
+import org.apache.commons.lang3.time.DateUtils;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
 import org.slf4j.event.Level;
@@ -98,7 +98,7 @@ import static java.nio.charset.StandardCharsets.UTF_8;
 import static java.time.ZoneOffset.UTC;
 import static java.util.Arrays.asList;
 import static java.util.Collections.singletonList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.groups.Tuple.tuple;
 import static org.mockito.Mockito.mock;
@@ -125,6 +125,8 @@ class PurgeDaoIT {
 
   private static final String PROJECT_UUID = "P1";
 
+  private final Random random = new SecureRandom();
+
   private final System2 system2 = mock(System2.class);
 
   @RegisterExtension
@@ -2045,7 +2047,7 @@ oldCreationDate));
   }
 
   private CeActivityDto insertCeActivity(ComponentDto component, String entityUuid) {
-    Status unusedStatus = Status.values()[RandomUtils.nextInt(Status.values().length)];
+    Status unusedStatus = Status.values()[random.nextInt(Status.values().length)];
     CeQueueDto queueDto = createCeQueue(component, entityUuid, unusedStatus);
 
     CeActivityDto dto = new CeActivityDto(queueDto);
index 8d9746b1f2712752deb5e9e76605dd2a6c50281a..9d484660ef0a94e55b6666c7747ed4b227dc6d15 100644 (file)
@@ -31,7 +31,7 @@ import org.sonar.db.DbSession;
 import org.sonar.db.DbTester;
 import org.sonar.db.metric.MetricDto;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.AssertionsForClassTypes.tuple;
 
index 08309c7f4e6c40197381b47f9c798a9658177d95..ad21b9f43eb3795592abe0d450abb14b773d25b8 100644 (file)
@@ -35,7 +35,7 @@ import org.sonar.db.user.GroupDto;
 import org.sonar.db.user.GroupTesting;
 import org.sonar.db.user.SearchGroupMembershipDto;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.tuple;
 import static org.mockito.ArgumentMatchers.eq;
index 8b42ec6a36590c5c2638513a99c6c0378a9d7a53..a99c13ffdad049e59a4bbddcbf52808aaa5e4e13 100644 (file)
@@ -45,7 +45,7 @@ import static java.util.Arrays.asList;
 import static java.util.Collections.emptyList;
 import static java.util.Collections.singleton;
 import static java.util.Collections.singletonList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.tuple;
 import static org.mockito.Mockito.mock;
index 94df40f66cf3038076285a2b2da22d5545381dc0..fcf19a2ed78f33a8549c60181720ffaf2c0148d7 100644 (file)
@@ -30,7 +30,7 @@ import java.util.Optional;
 import java.util.Set;
 import java.util.function.Consumer;
 import java.util.function.Function;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.apache.ibatis.exceptions.PersistenceException;
 import org.jetbrains.annotations.NotNull;
 import org.junit.jupiter.api.Test;
@@ -58,7 +58,7 @@ import static com.google.common.collect.Sets.newHashSet;
 import static java.util.Arrays.asList;
 import static java.util.Collections.emptyList;
 import static java.util.Collections.singletonList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.tuple;
index 6942062d8676dae396f63aa20af2df89d00d96d4..bba0587f4e8a84272da78c5755fc6c0b944ee2a0 100644 (file)
@@ -39,7 +39,7 @@ import org.sonar.db.Pagination;
 import org.sonar.db.user.GroupDto;
 import org.sonar.db.user.UserDto;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatCode;
 import static org.assertj.core.api.Fail.fail;
index 180b179e82cb86f097b2f007839175333e28839e..97c15d618ac41542d957b4571a319898d46150cd 100644 (file)
@@ -49,7 +49,7 @@ import static java.util.Collections.emptySet;
 import static java.util.Collections.singletonList;
 import static java.util.stream.Collectors.toMap;
 import static java.util.stream.Collectors.toSet;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatNoException;
 import static org.assertj.core.groups.Tuple.tuple;
index 81405ea50a7172f276c8b506be77d215bcae8d2d..3977de53ad3f3c252b87053a3d8b2ceaefcd36a0 100644 (file)
@@ -30,7 +30,7 @@ import org.sonar.db.DbTester;
 import org.sonar.db.audit.AuditPersister;
 import org.sonar.db.audit.model.UserNewValue;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
index 495b31e3723d38b75438c8417c008828bff8095c..9d3a5948b8f068a03520957b0b97432a86f21881 100644 (file)
  */
 package org.sonar.db.user;
 
+import java.security.SecureRandom;
 import java.time.LocalDate;
 import java.time.ZoneOffset;
 import java.util.List;
 import java.util.Map;
+import java.util.Random;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
 import org.sonar.api.utils.System2;
@@ -31,12 +33,14 @@ import org.sonar.db.DbTester;
 import org.sonar.db.component.ComponentDto;
 
 import static java.util.Collections.singletonList;
-import static org.apache.commons.lang.math.RandomUtils.nextLong;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonar.db.user.UserTokenTesting.newProjectAnalysisToken;
 import static org.sonar.db.user.UserTokenTesting.newUserToken;
 
 class UserTokenDaoIT {
+
+  private final Random random = new SecureRandom();
+
   @RegisterExtension
   private final DbTester db = DbTester.create(System2.INSTANCE);
 
@@ -57,7 +61,7 @@ class UserTokenDaoIT {
 
   @Test
   void insert_user_token_with_expiration_date() {
-    UserTokenDto userToken = newUserToken().setExpirationDate(nextLong());
+    UserTokenDto userToken = newUserToken().setExpirationDate(10000L);
 
     underTest.insert(db.getSession(), userToken, "login");
 
index b067c137e17c84261efc5f12b8e056f200d34db6..e186a61a167661be8d834b275a05224a6806be83 100644 (file)
@@ -19,6 +19,8 @@
  */
 package org.sonar.db.user;
 
+import java.security.SecureRandom;
+import java.util.Random;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
 import org.mockito.ArgumentCaptor;
@@ -30,7 +32,6 @@ import org.sonar.db.DbTester;
 import org.sonar.db.audit.AuditPersister;
 import org.sonar.db.audit.model.UserTokenNewValue;
 
-import static org.apache.commons.lang.math.RandomUtils.nextLong;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.eq;
@@ -40,6 +41,9 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
 import static org.sonar.db.user.UserTokenTesting.newUserToken;
 
 class UserTokenDaoWithPersisterIT {
+
+  private final Random random = new SecureRandom();
+
   private final AuditPersister auditPersister = mock(AuditPersister.class);
   private final ArgumentCaptor<UserTokenNewValue> newValueCaptor = ArgumentCaptor.forClass(UserTokenNewValue.class);
 
@@ -53,8 +57,8 @@ class UserTokenDaoWithPersisterIT {
   @Test
   void insert_token_is_persisted() {
     UserTokenDto userToken = newUserToken()
-      .setExpirationDate(nextLong())
-      .setLastConnectionDate(nextLong());
+      .setExpirationDate(random.nextLong(Long.MAX_VALUE))
+      .setLastConnectionDate(random.nextLong(Long.MAX_VALUE));
     underTest.insert(db.getSession(), userToken, "login");
 
     verify(auditPersister).addUserToken(eq(db.getSession()), newValueCaptor.capture());
index 80584ca1e4f4aaf0b0bc91652dee43c329ab309a..146ae5d33b36a475321f819d0efcb51f790719ca 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.db.audit.model;
 
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.ObjectUtils;
+import org.apache.commons.lang3.ObjectUtils;
 import org.sonar.db.component.ComponentDto;
 import org.sonar.db.project.ProjectDto;
 
index a478f9a34cfb47c9cbec09eece877253e044d958..39040b313caccf58891b146a8223b5d68b08b229 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.db.audit.model;
 
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.ObjectUtils;
+import org.apache.commons.lang3.ObjectUtils;
 import org.sonar.db.alm.setting.AlmSettingDto;
 import org.sonar.db.alm.setting.ProjectAlmSettingDto;
 import org.sonar.db.project.ProjectDto;
index 9d68bba3a5a44f0e7c38c2872050be8dcfaebf53..d7f135f1dd623d604bccb13d7c666af9da717c97 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.db.audit.model;
 
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.ObjectUtils;
+import org.apache.commons.lang3.ObjectUtils;
 import org.sonar.db.permission.template.PermissionTemplateDto;
 
 public class PermissionTemplateNewValue extends NewValue {
index 835c1dc29fcece153223dcc03cfd479071491413..70a4d389a5cb676633c21b0f52cb1550f97c7fed 100644 (file)
@@ -23,7 +23,7 @@ import java.util.ArrayList;
 import java.util.List;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.ObjectUtils;
+import org.apache.commons.lang3.ObjectUtils;
 import org.sonar.api.utils.DateUtils;
 import org.sonar.db.user.UserDto;
 
index 4bb344311faf2cb264415a4153a6a410c0379ea2..5d17d6d6411b7f487894076ba126f44d6adc3a06 100644 (file)
@@ -23,7 +23,7 @@ import com.google.common.annotations.VisibleForTesting;
 import org.sonar.db.dismissmessage.MessageType;
 
 import static com.google.common.base.Preconditions.checkArgument;
-import static org.apache.commons.lang.StringUtils.abbreviate;
+import static org.apache.commons.lang3.StringUtils.abbreviate;
 
 public class CeTaskMessageDto {
   @VisibleForTesting
index 2079cff6e550ca97574d0c1dadb5145676e7c6b5..ef0ce834b1c9a7b95397fa5525972767cbcc77f6 100644 (file)
@@ -26,13 +26,13 @@ import java.util.List;
 import java.util.Objects;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.sonar.api.resources.Scopes;
 import org.sonar.db.WildcardPosition;
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static java.lang.String.format;
-import static org.apache.commons.lang.StringUtils.substringBeforeLast;
+import static org.apache.commons.lang3.StringUtils.substringBeforeLast;
 import static org.sonar.db.DaoUtils.buildLikeValue;
 import static org.sonar.db.component.ComponentValidator.checkComponentKey;
 import static org.sonar.db.component.ComponentValidator.checkComponentLongName;
index 7861973f3d1c4162a4a82b9b77260e04993e4337..cd4242694106f2abd72dedd0dd89520ef0c9a14f 100644 (file)
@@ -25,7 +25,7 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.function.BiConsumer;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.resources.Qualifiers;
 import org.sonar.api.resources.Scopes;
 import org.sonar.db.Dao;
index b33e0c296b3b69e3d1dc83cf7e54e56a8c078f0b..872001ba4974f1ee8c827b6a96516187bf393a29 100644 (file)
@@ -24,7 +24,7 @@ import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
 
 import static com.google.common.base.Preconditions.checkArgument;
-import static org.apache.commons.lang.StringUtils.trimToNull;
+import static org.apache.commons.lang3.StringUtils.trimToNull;
 
 public final class SnapshotDto {
 
index 3880fced6c4e6a1d58f7968c61fa179c880fca58..f85afd35243c77dc2866a968b5a4d2b20c235543 100644 (file)
@@ -23,8 +23,8 @@ import java.io.Serializable;
 import java.util.Date;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
 import org.sonar.api.utils.System2;
 import org.sonar.core.issue.DefaultIssueComment;
 import org.sonar.core.issue.FieldDiffs;
index 8e3cdb99a69bae83e25e3a30178028bc8241f2c3..dfa4c7e74e69b88045a5c41711fad8489166cec3 100644 (file)
@@ -34,8 +34,8 @@ import java.util.Set;
 import java.util.stream.Collectors;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
 import org.jetbrains.annotations.NotNull;
 import org.sonar.api.issue.IssueStatus;
 import org.sonar.api.issue.impact.Severity;
index fe5563c9eccb907c179b0e295c597294d458867a..c527cebd03ec76c97c86c36b965e2bdc7557c006 100644 (file)
  */
 package org.sonar.db.issue;
 
+import java.security.SecureRandom;
 import java.util.Date;
 import java.util.List;
+import java.util.Random;
 import java.util.function.Function;
 import java.util.stream.Stream;
-import org.apache.commons.lang.math.RandomUtils;
 import org.sonar.api.issue.Issue;
 import org.sonar.api.issue.impact.SoftwareQuality;
 import org.sonar.api.resources.Qualifiers;
@@ -36,13 +37,13 @@ import org.sonar.db.rule.RuleDto;
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.collect.Sets.newHashSet;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
-import static org.apache.commons.lang.math.RandomUtils.nextInt;
-import static org.apache.commons.lang.math.RandomUtils.nextLong;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 
 public class IssueTesting {
 
+  private static final Random RANDOM = new SecureRandom();
+
   private IssueTesting() {
     // only statics
   }
@@ -68,14 +69,14 @@ public class IssueTesting {
       .setComponent(file)
       .setStatus(Issue.STATUS_OPEN)
       .setResolution(null)
-      .setSeverity(Severity.ALL.get(nextInt(Severity.ALL.size())))
+      .setSeverity(Severity.ALL.get(RANDOM.nextInt(Severity.ALL.size())))
       //TODO map to correct impact. Will be fixed with persistence of impacts on issues
       .addImpact(new ImpactDto().setSoftwareQuality(SoftwareQuality.MAINTAINABILITY).setSeverity(org.sonar.api.issue.impact.Severity.HIGH))
-      .setEffort((long) RandomUtils.nextInt(10))
+      .setEffort((long) RANDOM.nextInt(10))
       .setAssigneeUuid("assignee-uuid_" + randomAlphabetic(26))
       .setAuthorLogin("author_" + randomAlphabetic(5))
-      // Adding one to the generated random value in order to never get 0 (as it's a forbidden value)
-      .setLine(nextInt(1_000) + 1)
+      // Starting from 1 in order to never get 0 (as it's a forbidden value)
+      .setLine(RANDOM.nextInt(1, 1_001))
       .setMessage("message_" + randomAlphabetic(5))
       .setChecksum("checksum_" + randomAlphabetic(5))
       .setTags(newHashSet("tag_" + randomAlphanumeric(5), "tag_" + randomAlphanumeric(5)))
@@ -95,9 +96,9 @@ public class IssueTesting {
       .setChangeType(IssueChangeDto.TYPE_FIELD_CHANGE)
       .setUserUuid("userUuid_" + randomAlphanumeric(40))
       .setProjectUuid(issue.getProjectUuid())
-      .setIssueChangeCreationDate(nextLong())
-      .setCreatedAt(nextLong())
-      .setUpdatedAt(nextLong());
+      .setIssueChangeCreationDate(RANDOM.nextLong(Long.MAX_VALUE))
+      .setCreatedAt(RANDOM.nextLong(Long.MAX_VALUE))
+      .setUpdatedAt(RANDOM.nextLong(Long.MAX_VALUE));
   }
 
   public static NewCodeReferenceIssueDto newCodeReferenceIssue(IssueDto issue) {
index c1e21d4ccb8ea61654180d0278521495d516f536..a149573f35896f8b16964254a5ac8f66783252ab 100644 (file)
@@ -22,8 +22,8 @@ package org.sonar.db.issue;
 import java.io.Serializable;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
 import org.sonar.api.rule.RuleKey;
 import org.sonar.db.component.BranchType;
 
index d37fd18fec04eb85db0cf5cbd2640ffe6ad4c600..95c0eb350dc877e4d19b739e944314939e66eeeb 100644 (file)
@@ -37,7 +37,7 @@ import java.util.function.Consumer;
 import java.util.stream.Collectors;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.measures.CoreMetrics;
 import org.sonar.api.resources.Qualifiers;
 import org.sonar.core.util.CloseableIterator;
index 873c766b429e8e16166683c904fe8fb06b4b58cc..1ef337a8f57bdceab7e602a6a913a80510b05ae3 100644 (file)
@@ -24,8 +24,8 @@ import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
 import org.sonar.api.notifications.Notification;
 
 /**
index 79c21b395a52840797d1a33e02537d1fa76f31c1..d2b08773a45b94a04f115517c22b12f182fffb0c 100644 (file)
@@ -29,7 +29,7 @@ import org.sonar.db.entity.EntityDto;
 
 import static com.google.common.base.MoreObjects.firstNonNull;
 import static com.google.common.base.Preconditions.checkArgument;
-import static org.apache.commons.lang.StringUtils.defaultIfBlank;
+import static org.apache.commons.lang3.StringUtils.defaultIfBlank;
 import static org.sonar.api.utils.Paging.offset;
 import static org.sonar.db.DaoUtils.buildLikeValue;
 
index f1006fac2663ec8c581c2d5f2ea2a51dc69c0b6f..e1e848701f5c19d7f1dd0edacf22d8ca0a0072bd 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.db.plugin;
 
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
 
 public class PluginDto {
   /** Technical unique identifier, can't be null */
index aaef5e5ad70f747cfa46f00392585c4d50d32ffd..b01511fed232c040a2e2e289a996d5b13dbdb533 100644 (file)
@@ -25,7 +25,7 @@ import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
 import org.sonar.db.entity.EntityDto;
 
-import static org.apache.commons.lang.StringUtils.trimToNull;
+import static org.apache.commons.lang3.StringUtils.trimToNull;
 import static org.sonar.db.component.DbTagsReader.readDbTags;
 
 public class ProjectDto extends EntityDto {
index 7b024c72b48e248c5df1d4e3d23a2ef34b1edee6..e921e12bab345f3fc3642e086acee6433aec1e5d 100644 (file)
@@ -42,7 +42,7 @@ import org.sonar.db.audit.model.PropertyNewValue;
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static java.util.Collections.singletonList;
-import static org.apache.commons.lang.StringUtils.repeat;
+import static org.apache.commons.lang3.StringUtils.repeat;
 import static org.sonar.db.DatabaseUtils.executeLargeInputs;
 import static org.sonar.db.DatabaseUtils.executeLargeInputsIntoSet;
 
index 283fbda0b0f8d4ff3265f8186e91fd84b450b0a0..c9c5cee6a7309e9d89e63bec76d42df0cfb1d3a8 100644 (file)
@@ -22,8 +22,8 @@ package org.sonar.db.purge;
 import java.util.Date;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.builder.ReflectionToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
+import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
 
 /**
  * Represents an analysis, aka. root snapshot, aka. snapshot of a project or portfolio
index 4ce8ad38e6b58161f0c66d47b0ca9fb05348d35d..0c093b316db00f761fc1194ce7f2600aef0f69fd 100644 (file)
@@ -23,7 +23,7 @@ import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
-import org.apache.commons.lang.time.DateUtils;
+import org.apache.commons.lang3.time.DateUtils;
 import org.sonar.api.config.Configuration;
 import org.sonar.core.config.PurgeConstants;
 
index 1c1412644f0940e170c8b454d403d54243ef45b1..f20ed83ed5862f9bdbd6d9b1e86217c9d46f2021 100644 (file)
@@ -24,7 +24,7 @@ import java.util.Calendar;
 import java.util.Date;
 import java.util.GregorianCalendar;
 import java.util.List;
-import org.apache.commons.lang.time.DateUtils;
+import org.apache.commons.lang3.time.DateUtils;
 import org.sonar.db.purge.PurgeableAnalysisDto;
 
 final class Interval {
index f6d052563dc66daa211885fe61e63b48f0ae54bd..3ee99176d825e7a0074fa73376ec47fe791ea172 100644 (file)
@@ -25,7 +25,7 @@ import java.util.Locale;
 import java.util.Set;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.db.DaoUtils;
 import org.sonar.db.WildcardPosition;
 
index 1fde477e67efb7fd69f5e32346b03adf444aa8f7..005dff79be548ca2a1fe2702447524ed2be14066 100644 (file)
@@ -21,9 +21,9 @@ package org.sonar.db.qualityprofile;
 
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.builder.ReflectionToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
 import org.sonar.api.rule.RuleKey;
 import org.sonar.api.rules.ActiveRule;
 import org.sonar.db.rule.RuleDto;
index 6dc648456092b85e9a9ceceb74e4692a8d6a13ef..1c5ce4d25fa1de554c6e301f29e1714a05ac3074 100644 (file)
@@ -23,8 +23,8 @@ import com.google.common.base.Preconditions;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
-import org.apache.commons.lang.builder.ReflectionToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
+import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
 import org.sonar.db.rule.RuleParamDto;
 
 public class ActiveRuleParamDto {
index caefb931ffaa79d5ef123cde20ea2e2a7bd33edd..3abf3f1f86817157cf0c01b141e6d475aa201365 100644 (file)
@@ -23,8 +23,8 @@ import java.util.Collections;
 import java.util.Map;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.builder.ReflectionToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
+import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
 import org.sonar.api.utils.KeyValueFormat;
 import org.sonar.db.rule.RuleChangeDto;
 
index a14c6654de762e535d535090086850341b0da9dc..8403c99434780ba3c69cce06639c2c6e890b0417 100644 (file)
@@ -21,8 +21,8 @@ package org.sonar.db.qualityprofile;
 
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.builder.ReflectionToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
+import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
 
 import static java.util.Objects.requireNonNull;
 
index d3e7bf7d5707ed11a716638451645a462d7ca7d2..cfa2f96711cf2d06f43576810b1a62ee46c8039e 100644 (file)
@@ -42,7 +42,7 @@ import org.sonar.db.issue.ImpactDto;
 import static com.google.common.base.Preconditions.checkNotNull;
 import static java.util.Collections.emptyList;
 import static java.util.stream.Collectors.toMap;
-import static org.apache.commons.lang.StringUtils.isBlank;
+import static org.apache.commons.lang3.StringUtils.isBlank;
 import static org.sonar.db.DatabaseUtils.executeLargeInputs;
 import static org.sonar.db.DatabaseUtils.executeLargeInputsWithoutOutput;
 import static org.sonar.db.DatabaseUtils.executeLargeUpdates;
index a7644f810b44951d63a5af7d7749c847ab0e5074..189674102113df16cd82c56f467ed54e4dcbe389 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.db.rule;
 
 import java.util.Objects;
 
-import static org.apache.commons.lang.StringUtils.isNotEmpty;
+import static org.apache.commons.lang3.StringUtils.isNotEmpty;
 import static org.sonar.api.utils.Preconditions.checkArgument;
 
 public class RuleDescriptionSectionContextDto {
index e71a33ebf0576a4eb2560b6d614d7316e7434315..ea65b61c9076e5b1444ca4dba52474cf4a3ae2f8 100644 (file)
@@ -29,7 +29,7 @@ import java.util.Set;
 import java.util.stream.Collectors;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.sonar.api.issue.impact.SoftwareQuality;
 import org.sonar.api.rule.RuleKey;
 import org.sonar.api.rule.RuleStatus;
index 517dbdba5b8ed614ef10ae62266a88af0a35ca41..352570bca65411d1f70e4ed69e863e306f5f4012 100644 (file)
@@ -21,8 +21,8 @@ package org.sonar.db.rule;
 
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.builder.ReflectionToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
+import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
 
 import static com.google.common.base.Preconditions.checkArgument;
 
index 917c89b03de4c7db0228f4fa58bd78fc601d5aa6..2ec3875f338007514bf555ad54a4fcd5f2e0c1cf 100644 (file)
@@ -30,7 +30,7 @@ import org.sonar.db.DatabaseUtils;
 import org.sonar.db.DbSession;
 
 import static com.google.common.base.Preconditions.checkArgument;
-import static org.apache.commons.lang.StringUtils.isBlank;
+import static org.apache.commons.lang3.StringUtils.isBlank;
 
 public class RuleRepositoryDao implements Dao {
 
index e12e45a897215ff857241d24b9bec1b8760758a0..065af654034981406a965db31db1973949dae0ed 100644 (file)
@@ -26,7 +26,7 @@ import java.util.regex.Pattern;
 import javax.annotation.Nullable;
 
 import static java.util.regex.Pattern.CASE_INSENSITIVE;
-import static org.apache.commons.lang.StringUtils.isBlank;
+import static org.apache.commons.lang3.StringUtils.isBlank;
 
 public class ScimGroupQuery {
   private static final Pattern DISPLAY_NAME_FILTER_PATTERN = Pattern.compile("^displayName\\s+eq\\s+\"([^\"]*?)\"$", CASE_INSENSITIVE);
index 89f39cae32bb1503ab39fea17a6f1e4eeec49e89..234b78d17db989aefc563e0af9e71658f7ad192c 100644 (file)
@@ -27,7 +27,7 @@ import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
 
 import static java.util.regex.Pattern.CASE_INSENSITIVE;
-import static org.apache.commons.lang.StringUtils.isBlank;
+import static org.apache.commons.lang3.StringUtils.isBlank;
 
 public class ScimUserQuery {
   private static final Pattern USERNAME_FILTER_PATTERN = Pattern.compile("^userName\\s+eq\\s+\"([^\"]*?)\"$", CASE_INSENSITIVE);
index ee6d283bc22b56096a95223005a5bfbc3f4fe259..42962f69bd631eb783d8226ab2e031c6616088dc 100644 (file)
@@ -23,7 +23,7 @@ import com.google.common.collect.ImmutableSet;
 import java.util.Set;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 
 import static com.google.common.base.MoreObjects.firstNonNull;
 import static com.google.common.base.Preconditions.checkArgument;
index ca81edb50c5ec3c6e0083faa93d71b7ca50e5826..c981b2aa4fb58b2f5a3aca082b6c4b19c55ba8c1 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.db.user;
 import java.util.Locale;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.db.DaoUtils;
 import org.sonar.db.WildcardPosition;
 
index 03782036be5b1a8daec07e9e182e94559bb06f1e..e238779046475920e3c789122c7eae4d658d5c88 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.db.user;
 import java.util.Set;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 
 import static com.google.common.base.MoreObjects.firstNonNull;
 import static com.google.common.base.Preconditions.checkArgument;
index 814a5bd32f407f42ce4ef4f9dbf14d83ea36833e..39d4954a4ef1136e2af54daa052dcc5851076c59 100644 (file)
@@ -28,7 +28,7 @@ import java.util.function.Consumer;
 import java.util.function.Function;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.utils.System2;
 import org.sonar.core.util.UuidFactory;
 import org.sonar.db.Dao;
index a1838fac23efc2d7eebc46ab794caa39bb90bc09..cb1df6aa5bbe24d2d0ca0fc59f2528999b9fd3ac 100644 (file)
@@ -24,7 +24,7 @@ import java.util.Locale;
 import java.util.Set;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 
 import static com.google.common.base.MoreObjects.firstNonNull;
 import static com.google.common.base.Preconditions.checkArgument;
index ce908f4da074c3207ab80f12e8770ccd013c2d42..66d4c7f519b49df0770f54775d65741449110b69 100644 (file)
@@ -26,7 +26,7 @@ import java.util.HashSet;
 import java.util.Set;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 
 public class UserQuery {
   private final String searchText;
index 3b4c698bb92d341d74f2f38757c3ee117d97a911..7598168322e1c12d1e4f8ddb856f6ea950f5f2fb 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.db.webhook;
 
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
 
 public class WebhookDeliveryDto extends WebhookDeliveryLiteDto<WebhookDeliveryDto> {
   /** Error message if HTTP request cannot be sent, else null */
index 3c8aa5ac36c5ad15d04116c5f81bb3a2a3a51338..6ee6868bfee76b36a6cae542b88c532215715b15 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.db.webhook;
 
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
 
 public class WebhookDeliveryLiteDto<T extends WebhookDeliveryLiteDto> {
   /** Technical unique identifier, can't be null */
index 49b4699c66ac82771e277bbf88a0a1b6cd879eec..28a7df9aa5b4b6f4c88ad7bc461630ebae26e37a 100644 (file)
@@ -41,7 +41,7 @@ import org.slf4j.event.Level;
 import org.sonar.api.testfixtures.log.LogTesterJUnit5;
 
 import static java.lang.Math.abs;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.anyBoolean;
 import static org.mockito.Mockito.mock;
index 1d57449ff4bc1867909cd1b1458487a3499431b0..63080cc63c6cb46d21dea2dcc826901dfbb52546 100644 (file)
@@ -34,7 +34,7 @@ import org.apache.ibatis.session.RowBounds;
 import org.apache.ibatis.session.SqlSession;
 import org.junit.jupiter.api.Test;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.reset;
index 5cf25f7670de36c34d720e3d252e46d325c03397..bb6ee8a1bc7b15487efecc78319fed48dfd9b226 100644 (file)
@@ -24,8 +24,8 @@ import org.junit.jupiter.api.Test;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.MethodSource;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatNoException;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
index 17f83d4cffa957a2fd448af243fdc7a7503f87b1..bddef84d28dcf271bee0aa5f6939fa7df855e3a8 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.db.ce;
 
 import org.junit.jupiter.api.Test;
 
-import static org.apache.commons.lang.StringUtils.repeat;
+import static org.apache.commons.lang3.StringUtils.repeat;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.sonar.db.ce.CeTaskMessageDto.MAX_MESSAGE_SIZE;
index 7e8367e062fff7a3832e4789c7f6742a05f9f4e7..26eeec51bcaa0831a192b5c29b90682c895e8e83 100644 (file)
@@ -20,7 +20,7 @@
 package org.sonar.db.ce;
 
 import java.util.Random;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.MethodSource;
index 5c5056ea67268215a52c903386f455f8a9124bd6..2b6c722ddd94deee2dc67c329deb74472c1f4e0a 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.db.component;
 
 import org.junit.jupiter.api.Test;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
index 8ef91e030bedaddba96c7a542777f00811a9d72c..c868dca9097c97284ea2836fd81afe639aedaf89 100644 (file)
@@ -23,7 +23,7 @@ import org.junit.jupiter.api.Test;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.ValueSource;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 
 class ScrapAnalysisPropertyDtoTest {
index 801d4ab7454450ae2ba654054f3e576f740662ee..6a1e6faa6011234190c797d47f83d9f20bbee517 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.db.component;
 
 import org.junit.jupiter.api.Test;
 
-import static org.apache.commons.lang.StringUtils.repeat;
+import static org.apache.commons.lang3.StringUtils.repeat;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.sonar.api.utils.DateUtils.parseDate;
index aeea53fb97bbcae5f3625d1e2a403c68702af5cc..84508faee349a0b276dc9ffef69da6b474ff4f52 100644 (file)
@@ -26,7 +26,7 @@ import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 import java.util.Set;
-import org.apache.commons.lang.time.DateUtils;
+import org.apache.commons.lang3.time.DateUtils;
 import org.junit.jupiter.api.Test;
 import org.sonar.api.issue.Issue;
 import org.sonar.api.issue.IssueStatus;
index 6a730e2098aaad6a80c138028649006d93016a0a..9c521edd3ce9d6d306baabe39627061623e20e0a 100644 (file)
@@ -19,7 +19,7 @@
  */
 package org.sonar.db.property;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.NullAndEmptySource;
index 30fa9f0689b5f8bebfa28e6949dd274cef30d94e..5d5fdf89a43a3ed72212a6f6c65d7fc111ebb8c0 100644 (file)
@@ -31,8 +31,8 @@ import org.sonar.api.rules.RuleType;
 import org.sonar.core.util.Uuids;
 import org.sonar.db.issue.ImpactDto;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
-import static org.apache.commons.lang.StringUtils.repeat;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.StringUtils.repeat;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.tuple;
index f80118de9bb37049e861ddd57efd5b26d933f59d..3fd4797c6a45e3f3fb2e33a7e1194826a70944ce 100644 (file)
@@ -23,7 +23,7 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.IntStream;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.params.ParameterizedTest;
@@ -33,7 +33,7 @@ import org.sonar.db.OffsetBasedPagination;
 import org.sonar.db.Pagination;
 import org.sonar.db.user.GroupDto;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatCode;
 import static org.assertj.core.api.Fail.fail;
index 44c22aaf334dff890199ece54d049faa3f790424..5a7482f59a0ebc979f65daa988bf1ee74f3e8689 100644 (file)
@@ -23,7 +23,7 @@ import java.time.ZoneId;
 import java.time.ZonedDateTime;
 import org.junit.jupiter.api.Test;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
index 927497792c0251b72faac0459e17c486a1afb3d6..5e2cd46a63e892e38d49104883f22a2dfcc96ff7 100644 (file)
@@ -29,7 +29,7 @@ import java.util.function.Function;
 import java.util.stream.Collectors;
 import javax.annotation.Nullable;
 import org.apache.commons.codec.digest.DigestUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.AssumptionViolatedException;
 import org.sonar.api.config.internal.Settings;
 import org.sonar.db.dialect.H2;
index 8b926163eea1d8ddf6320b81f731fb05c3c6ff5f..ed2433ccb8662211347437d6497db75dc222eb23 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.db.alm.integration.pat;
 
 import org.sonar.db.alm.pat.AlmPatDto;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 
 public class AlmPatsTesting {
 
index d5d1b10a92e912179f9a0c33ba42a9fd148f516d..d54d1a0142570a4fbab957b494cfd0222f236e7c 100644 (file)
@@ -24,8 +24,8 @@ import org.sonar.db.alm.setting.AlmSettingDto;
 import org.sonar.db.alm.setting.ProjectAlmSettingDto;
 import org.sonar.db.project.ProjectDto;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
-import static org.apache.commons.lang.RandomStringUtils.randomNumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomNumeric;
 
 public class AlmSettingsTesting {
 
index 64f6e742fb037063f8af5572ba336c2c40ac7a3a..09a41b7d9146dd305ec666415889c56dc1fde25d 100644 (file)
@@ -27,7 +27,7 @@ import org.sonar.db.DbTester;
 import org.sonar.db.issue.AnticipatedTransitionDto;
 import org.sonar.db.issue.AnticipatedTransitionMapper;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 
 public class AnticipatedTransitionDbTester {
 
index 0d3ee6960f9540dd1b42bf1e36a22aa7b53368dc..a18902908111e5c1302c774d4be552de2c81bc3f 100644 (file)
  */
 package org.sonar.db.audit;
 
+import java.security.SecureRandom;
 import java.util.Random;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 
 public class AuditTesting {
 
-  private static final Random random = new Random();
+  private static final Random RANDOM = new SecureRandom();
 
   private AuditTesting() {
     throw new IllegalStateException("Utility class");
   }
 
   public static AuditDto newAuditDto() {
-    return newAuditDto(random.nextLong(), "operation");
+    return newAuditDto(RANDOM.nextLong(Long.MAX_VALUE), "operation");
   }
 
   public static AuditDto newAuditDto(String operation) {
-    return newAuditDto(random.nextLong(), operation);
+    return newAuditDto(RANDOM.nextLong(Long.MAX_VALUE), operation);
   }
 
   public static AuditDto newAuditDto(long createdAt) {
index 39d0ba4cab42cd95880a21c1356840431b86f058..9db889fbe1f1d15b4edb0026af4eef31e248406d 100644 (file)
  */
 package org.sonar.db.ce;
 
+import java.security.SecureRandom;
+import java.util.Random;
 import java.util.stream.Stream;
 import org.sonar.db.DbSession;
 
 import static com.google.common.base.Preconditions.checkArgument;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
-import static org.apache.commons.lang.math.RandomUtils.nextLong;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonar.db.ce.CeQueueDto.Status.IN_PROGRESS;
 import static org.sonar.db.ce.CeQueueDto.Status.PENDING;
 
 public class CeQueueTesting {
+
+  private static final Random RANDOM = new SecureRandom();
+
   private CeQueueTesting() {
     // static methods only
   }
@@ -42,8 +46,8 @@ public class CeQueueTesting {
       .setStatus(CeQueueDto.Status.PENDING)
       .setTaskType(CeTaskTypes.REPORT)
       .setSubmitterUuid(randomAlphanumeric(255))
-      .setCreatedAt(nextLong())
-      .setUpdatedAt(nextLong());
+      .setCreatedAt(RANDOM.nextLong(Long.MAX_VALUE))
+      .setUpdatedAt(RANDOM.nextLong(Long.MAX_VALUE));
   }
 
   public static void makeInProgress(DbSession dbSession, String workerUuid, long now, CeQueueDto... ceQueueDtos) {
index 49beb7377ea9ee3dbfe3bbbf991e26ebd73c5daf..a0178d92e98446298c601fd49351d908eed0d3c4 100644 (file)
@@ -29,7 +29,7 @@ import org.sonar.db.project.CreationMethod;
 import org.sonar.db.project.ProjectDto;
 
 import static com.google.common.base.Preconditions.checkArgument;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.sonar.db.component.BranchDto.DEFAULT_MAIN_BRANCH_NAME;
 import static org.sonar.db.component.ComponentDto.UUID_PATH_OF_ROOT;
 import static org.sonar.db.component.ComponentDto.formatUuidPathFromParent;
index 4ac0aad70724f77580ae8235b722cbbdfa6c1104..3bae295722d66031bc80d9a5af0d019271ed01a7 100644 (file)
  */
 package org.sonar.db.component;
 
-import org.apache.commons.lang.math.RandomUtils;
+import java.security.SecureRandom;
+import java.util.Random;
 import org.sonar.core.util.Uuids;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 
 public class ProjectLinkTesting {
 
+  private static final Random RANDOM = new SecureRandom();
+
   public static ProjectLinkDto newProvidedLinkDto() {
     return newCommonLinkDto()
       .setName(null)
-      .setType(ProjectLinkDto.PROVIDED_TYPES.get(RandomUtils.nextInt(ProjectLinkDto.PROVIDED_TYPES.size() - 1)));
+      .setType(ProjectLinkDto.PROVIDED_TYPES.get(RANDOM.nextInt(ProjectLinkDto.PROVIDED_TYPES.size() - 1)));
   }
 
   public static ProjectLinkDto newCustomLinkDto() {
index 0aaaf713c4f08f149b0bd13fb1e7daa806e7579b..39ad4a518ccbaeedd5a76e5b8d654c68ae95a414 100644 (file)
@@ -21,8 +21,8 @@ package org.sonar.db.component;
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkNotNull;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
-import static org.apache.commons.lang.RandomStringUtils.randomAscii;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAscii;
 
 public class SnapshotTesting {
 
index 1a6ca8d5002148542b2cccf13563b7e692e4212a..d95dc7b6b656143fc9a2584b56d617e8a93f33ab 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.db.event;
 import org.sonar.db.component.SnapshotDto;
 
 import static java.util.Objects.requireNonNull;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 
 public class EventTesting {
 
index a9928b8a05e108a4ccb7078c4598b04c7c51f4d9..1beb000887cc24ef85e84fb7574af67716e126de 100644 (file)
@@ -19,7 +19,8 @@
  */
 package org.sonar.db.measure;
 
-import org.apache.commons.lang.math.RandomUtils;
+import java.security.SecureRandom;
+import java.util.Random;
 import org.sonar.db.component.BranchDto;
 import org.sonar.db.component.ComponentDto;
 import org.sonar.db.component.SnapshotDto;
@@ -29,7 +30,9 @@ import static com.google.common.base.Preconditions.checkNotNull;
 
 public class MeasureTesting {
 
-  private static int cursor = RandomUtils.nextInt(100);
+  private static final Random RANDOM = new SecureRandom();
+
+  private static int cursor = RANDOM.nextInt(100);
 
   private MeasureTesting() {
     // static methods only
index 62d202552d7e14a7cf736a999b41296694d9e07c..84cdc5a757157547f0b194eb66537c3cb6ccce43 100644 (file)
  */
 package org.sonar.db.metric;
 
-import org.apache.commons.lang.RandomStringUtils;
-import org.apache.commons.lang.math.RandomUtils;
+import java.security.SecureRandom;
+import java.util.Random;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.sonar.api.measures.Metric;
 
 public class MetricTesting {
+
+  private static final Random RANDOM = new SecureRandom();
+
   private MetricTesting() {
     // static stuff only
   }
@@ -34,16 +38,16 @@ public class MetricTesting {
       .setUuid(RandomStringUtils.randomAlphanumeric(40))
       .setKey(RandomStringUtils.randomAlphanumeric(64))
       .setShortName(RandomStringUtils.randomAlphanumeric(64))
-      .setValueType(metricTypes[RandomUtils.nextInt(metricTypes.length - 1)].name())
+      .setValueType(metricTypes[RANDOM.nextInt(metricTypes.length - 1)].name())
       .setDomain(RandomStringUtils.randomAlphanumeric(64))
       .setDescription(RandomStringUtils.randomAlphanumeric(250))
-      .setBestValue(RandomUtils.nextDouble())
-      .setDeleteHistoricalData(RandomUtils.nextBoolean())
-      .setDirection(RandomUtils.nextInt())
-      .setHidden(RandomUtils.nextBoolean())
+      .setBestValue(RANDOM.nextDouble())
+      .setDeleteHistoricalData(RANDOM.nextBoolean())
+      .setDirection(RANDOM.nextInt(Integer.MAX_VALUE))
+      .setHidden(RANDOM.nextBoolean())
       .setEnabled(true)
-      .setOptimizedBestValue(RandomUtils.nextBoolean())
-      .setQualitative(RandomUtils.nextBoolean())
-      .setWorstValue(RandomUtils.nextDouble());
+      .setOptimizedBestValue(RANDOM.nextBoolean())
+      .setQualitative(RANDOM.nextBoolean())
+      .setWorstValue(RANDOM.nextDouble());
   }
 }
index 8c52c8bbc71fb7fda1ef8dbac0bf4d3714c18509..8cb96a4afe841c090508e8f280609b7d274d3407 100644 (file)
  */
 package org.sonar.db.permission.template;
 
+import java.security.SecureRandom;
 import java.util.Date;
+import java.util.Random;
 import java.util.function.Consumer;
-import org.apache.commons.lang.math.RandomUtils;
 import org.sonar.core.util.Uuids;
 import org.sonar.db.permission.PermissionsTestHelper;
 
 import static java.util.Arrays.stream;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
-import static org.apache.commons.lang.RandomStringUtils.randomAscii;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAscii;
 
 public class PermissionTemplateTesting {
+
+  private static final Random RANDOM = new SecureRandom();
+
   @SafeVarargs
   public static PermissionTemplateDto newPermissionTemplateDto(Consumer<PermissionTemplateDto>... populators) {
     PermissionTemplateDto dto = new PermissionTemplateDto()
@@ -44,7 +48,7 @@ public class PermissionTemplateTesting {
 
   public static PermissionTemplateUserDto newPermissionTemplateUserDto() {
     return new PermissionTemplateUserDto()
-      .setPermission(PermissionsTestHelper.ALL_PERMISSIONS.toArray(new String[0])[RandomUtils.nextInt(PermissionsTestHelper.ALL_PERMISSIONS.size())])
+      .setPermission(PermissionsTestHelper.ALL_PERMISSIONS.toArray(new String[0])[RANDOM.nextInt(PermissionsTestHelper.ALL_PERMISSIONS.size())])
       .setCreatedAt(new Date())
       .setUpdatedAt(new Date());
   }
@@ -52,7 +56,7 @@ public class PermissionTemplateTesting {
   public static PermissionTemplateGroupDto newPermissionTemplateGroupDto() {
     return new PermissionTemplateGroupDto()
       .setUuid(Uuids.createFast())
-      .setPermission(PermissionsTestHelper.ALL_PERMISSIONS.toArray(new String[0])[RandomUtils.nextInt(PermissionsTestHelper.ALL_PERMISSIONS.size())])
+      .setPermission(PermissionsTestHelper.ALL_PERMISSIONS.toArray(new String[0])[RANDOM.nextInt(PermissionsTestHelper.ALL_PERMISSIONS.size())])
       .setCreatedAt(new Date())
       .setUpdatedAt(new Date());
   }
@@ -60,8 +64,8 @@ public class PermissionTemplateTesting {
   public static PermissionTemplateCharacteristicDto newPermissionTemplateCharacteristicDto() {
     return new PermissionTemplateCharacteristicDto()
       .setUuid(Uuids.createFast())
-      .setPermission(PermissionsTestHelper.ALL_PERMISSIONS.toArray(new String[0])[RandomUtils.nextInt(PermissionsTestHelper.ALL_PERMISSIONS.size())])
-      .setWithProjectCreator(RandomUtils.nextBoolean())
+      .setPermission(PermissionsTestHelper.ALL_PERMISSIONS.toArray(new String[0])[RANDOM.nextInt(PermissionsTestHelper.ALL_PERMISSIONS.size())])
+      .setWithProjectCreator(RANDOM.nextBoolean())
       .setCreatedAt(System.currentTimeMillis())
       .setUpdatedAt(System.currentTimeMillis());
   }
index 6ca04bf047dc4593f7e0624aa8f7919f6faa9675..517a31ba5f84d436200381a05d5ed3c9b422a2e7 100644 (file)
  */
 package org.sonar.db.plugin;
 
+import java.security.SecureRandom;
+import java.util.Random;
 import org.sonar.core.util.Uuids;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
-import static org.apache.commons.lang.math.RandomUtils.nextLong;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 
 public class PluginTesting {
 
+  private static final Random RANDOM = new SecureRandom();
+
   private PluginTesting() {
     // prevent instantiation
   }
@@ -39,8 +42,8 @@ public class PluginTesting {
       .setUuid(uuid)
       .setKee(uuid)
       .setFileHash(randomAlphanumeric(32))
-      .setCreatedAt(nextLong())
-      .setUpdatedAt(nextLong());
+      .setCreatedAt(RANDOM.nextLong(Long.MAX_VALUE))
+      .setUpdatedAt(RANDOM.nextLong(Long.MAX_VALUE));
   }
 
 }
index 7ae874f0fb9aa9e603564052eaf449d24043b7ad..2112e423d9d43ce76db5f4c66d45a6e694a4bf18 100644 (file)
@@ -19,8 +19,9 @@
  */
 package org.sonar.db.property;
 
+import java.security.SecureRandom;
+import java.util.Random;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.math.RandomUtils;
 import org.sonar.db.entity.EntityDto;
 import org.sonar.db.user.UserDto;
 
@@ -28,7 +29,8 @@ import static com.google.common.base.Preconditions.checkNotNull;
 
 public class PropertyTesting {
 
-  private static int cursor = RandomUtils.nextInt(100);
+  private static final Random RANDOM = new SecureRandom();
+  private static int cursor = RANDOM.nextInt(100);
 
   private PropertyTesting() {
     // static methods only
index 05efceac40578f9b862393013b4c0cab638a12c3..2da309dde91742b42d6ec6f76f4dfed7e0cb3dda 100644 (file)
@@ -33,8 +33,8 @@ import org.sonar.db.property.PropertyDto;
 import org.sonar.db.user.GroupDto;
 import org.sonar.db.user.UserDto;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
-import static org.apache.commons.lang.RandomStringUtils.randomNumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomNumeric;
 
 public class QualityGateDbTester {
   private static final String DEFAULT_QUALITY_GATE_PROPERTY_NAME = "qualitygate.default";
index 8f2bf0a2632af114c91e5aefbb0e3ca69c98938b..1b964f67e81a10ced4782ebc4671ad4a16feaf97 100644 (file)
  */
 package org.sonar.db.qualityprofile;
 
+import java.security.SecureRandom;
 import java.util.Arrays;
 import java.util.Optional;
+import java.util.Random;
 import java.util.function.Consumer;
 import org.sonar.api.rule.Severity;
 import org.sonar.core.util.Uuids;
@@ -33,11 +35,10 @@ import org.sonar.db.user.GroupDto;
 import org.sonar.db.user.UserDto;
 
 import static com.google.common.base.Preconditions.checkArgument;
-import static org.apache.commons.lang.math.RandomUtils.nextInt;
-import static org.apache.commons.lang.math.RandomUtils.nextLong;
 import static org.sonar.db.qualityprofile.ActiveRuleDto.createFor;
 
 public class QualityProfileDbTester {
+  private final Random random = new SecureRandom();
   private final DbClient dbClient;
   private final DbSession dbSession;
 
@@ -94,9 +95,9 @@ public class QualityProfileDbTester {
 
   public ActiveRuleDto activateRule(QProfileDto profile, RuleDto rule, Consumer<ActiveRuleDto> consumer) {
     ActiveRuleDto activeRule = createFor(profile, rule)
-      .setSeverity(Severity.ALL.get(nextInt(Severity.ALL.size())))
-      .setCreatedAt(nextLong())
-      .setUpdatedAt(nextLong());
+      .setSeverity(Severity.ALL.get(random.nextInt(Severity.ALL.size())))
+      .setCreatedAt(random.nextLong(Long.MAX_VALUE))
+      .setUpdatedAt(random.nextLong(Long.MAX_VALUE));
     consumer.accept(activeRule);
     dbClient.activeRuleDao().insert(dbSession, activeRule);
     dbSession.commit();
index f29a32dbc0469e57cc1b2e441cf4f94c099cd8e9..32034fd616296c0ac9073627d09578c4d69f5434 100644 (file)
  */
 package org.sonar.db.qualityprofile;
 
+import java.security.SecureRandom;
+import java.util.Random;
 import java.util.function.Consumer;
 import org.sonar.core.util.Uuids;
 
 import static java.util.Arrays.stream;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
-import static org.apache.commons.lang.math.RandomUtils.nextLong;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 
 public class QualityProfileTesting {
 
+  private static final Random RANDOM = new SecureRandom();
+
   private QualityProfileTesting() {
     // prevent instantiation
   }
@@ -43,7 +46,7 @@ public class QualityProfileTesting {
       .setRulesProfileUuid(Uuids.createFast())
       .setName(uuid)
       .setLanguage(randomAlphanumeric(20))
-      .setLastUsed(nextLong());
+      .setLastUsed(RANDOM.nextLong(Long.MAX_VALUE));
   }
 
   /**
@@ -54,7 +57,7 @@ public class QualityProfileTesting {
     return new QProfileChangeDto()
       .setUuid(randomAlphanumeric(40))
       .setRulesProfileUuid(randomAlphanumeric(40))
-      .setCreatedAt(nextLong())
+      .setCreatedAt(RANDOM.nextLong(Long.MAX_VALUE))
       .setChangeType("ACTIVATED")
       .setUserUuid("userUuid_" + randomAlphanumeric(10));
   }
index b2fae217b5141f0ae3deec6d2b1ac9a3ddcb297a..b81a436edc2ee6599f14dc28823f2543e6ea9869 100644 (file)
@@ -19,7 +19,9 @@
  */
 package org.sonar.db.rule;
 
+import java.security.SecureRandom;
 import java.util.Collection;
+import java.util.Random;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.function.Consumer;
@@ -40,9 +42,8 @@ import static com.google.common.base.Preconditions.checkNotNull;
 import static com.google.common.collect.ImmutableSet.copyOf;
 import static com.google.common.collect.Sets.newHashSet;
 import static java.util.Arrays.stream;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
-import static org.apache.commons.lang.math.RandomUtils.nextInt;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.sonar.api.rule.RuleKey.EXTERNAL_RULE_REPO_PREFIX;
 import static org.sonar.api.rules.RuleType.CODE_SMELL;
 import static org.sonar.db.rule.RuleDescriptionSectionDto.createDefaultRuleDescriptionSection;
@@ -59,6 +60,8 @@ public class RuleTesting {
 
   private static final AtomicLong nextRuleId = new AtomicLong(0);
 
+  private static final Random RANDOM = new SecureRandom();
+
   private static final UuidFactory uuidFactory = UuidFactoryFast.getInstance();
 
   private RuleTesting() {
@@ -102,19 +105,19 @@ public class RuleTesting {
         .setSeverity(org.sonar.api.issue.impact.Severity.HIGH))
       .setStatus(RuleStatus.READY)
       .setConfigKey("configKey_" + ruleKey.rule())
-      .setSeverity(Severity.ALL.get(nextInt(Severity.ALL.size())))
+      .setSeverity(Severity.ALL.get(RANDOM.nextInt(Severity.ALL.size())))
       .setIsTemplate(false)
       .setIsExternal(false)
       .setIsAdHoc(false)
       .setSystemTags(newHashSet("tag_" + randomAlphanumeric(5), "tag_" + randomAlphanumeric(5)))
       .setLanguage("lang_" + randomAlphanumeric(3))
       .setGapDescription("gapDescription_" + randomAlphanumeric(5))
-      .setDefRemediationBaseEffort(nextInt(10) + "h")
+      .setDefRemediationBaseEffort(RANDOM.nextInt(10) + "h")
       // voluntarily offset the remediation to be able to detect issues
-      .setDefRemediationGapMultiplier((nextInt(10) + 10) + "h")
+      .setDefRemediationGapMultiplier((RANDOM.nextInt(10) + 10) + "h")
       .setDefRemediationFunction("LINEAR_OFFSET")
-      .setRemediationBaseEffort(nextInt(10) + "h")
-      .setRemediationGapMultiplier(nextInt(10) + "h")
+      .setRemediationBaseEffort(RANDOM.nextInt(10) + "h")
+      .setRemediationGapMultiplier(RANDOM.nextInt(10) + "h")
       .setRemediationFunction("LINEAR_OFFSET")
       .setTags(newHashSet("tag_" + randomAlphanumeric(5), "tag_" + randomAlphanumeric(5)))
       .setNoteData("noteData_" + randomAlphanumeric(5))
@@ -123,8 +126,8 @@ public class RuleTesting {
       .setNoteUpdatedAt(System.currentTimeMillis() - 150)
       .setAdHocName("adHocName_" + randomAlphanumeric(5))
       .setAdHocDescription("adHocDescription_" + randomAlphanumeric(5))
-      .setAdHocSeverity(Severity.ALL.get(nextInt(Severity.ALL.size())))
-      .setAdHocType(RuleType.values()[nextInt(RuleType.values().length - 1)])
+      .setAdHocSeverity(Severity.ALL.get(RANDOM.nextInt(Severity.ALL.size())))
+      .setAdHocType(RuleType.values()[RANDOM.nextInt(RuleType.values().length - 1)])
       .setCreatedAt(currentTimeMillis)
       .setUpdatedAt(currentTimeMillis + 5)
       .setScope(Scope.MAIN)
index 7cd31ecf38de2f6061d42b28d4ef24ad472686e0..3926b3452ea6fb915091284d4d4c788f2c365de4 100644 (file)
  */
 package org.sonar.db.source;
 
+import java.security.SecureRandom;
 import java.util.Arrays;
 import java.util.Date;
 import java.util.Random;
 import java.util.function.Consumer;
 import java.util.stream.IntStream;
-import org.apache.commons.lang.math.RandomUtils;
 import org.sonar.core.util.Uuids;
 import org.sonar.db.DbTester;
 import org.sonar.db.component.ComponentDto;
 import org.sonar.db.protobuf.DbFileSources;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 
 public class FileSourceTester {
 
+  private static final Random RANDOM = new SecureRandom();
+
   private final DbTester db;
 
   public FileSourceTester(DbTester db) {
@@ -48,7 +50,7 @@ public class FileSourceTester {
       .setFileUuid(file.uuid())
       .setSrcHash(randomAlphanumeric(50))
       .setDataHash(randomAlphanumeric(50))
-      .setLineHashes(IntStream.range(0, new Random().nextInt(21)).mapToObj(String::valueOf).toList())
+      .setLineHashes(IntStream.range(0, RANDOM.nextInt(21)).mapToObj(String::valueOf).toList())
       .setRevision(randomAlphanumeric(100))
       .setSourceData(newRandomData(3).build())
       .setCreatedAt(new Date().getTime())
@@ -86,14 +88,14 @@ public class FileSourceTester {
         .setLine(i)
         .setScmRevision(randomAlphanumeric(15))
         .setScmAuthor(randomAlphanumeric(10))
-        .setScmDate(RandomUtils.nextLong())
+        .setScmDate(RANDOM.nextLong(Long.MAX_VALUE))
         .setSource(randomAlphanumeric(20))
-        .setLineHits(RandomUtils.nextInt(4))
-        .setConditions(RandomUtils.nextInt(4))
-        .setCoveredConditions(RandomUtils.nextInt(4))
+        .setLineHits(RANDOM.nextInt(4))
+        .setConditions(RANDOM.nextInt(4))
+        .setCoveredConditions(RANDOM.nextInt(4))
         .setHighlighting(randomAlphanumeric(40))
         .setSymbols(randomAlphanumeric(30))
-        .addAllDuplication(Arrays.asList(RandomUtils.nextInt(200), RandomUtils.nextInt(200)))
+        .addAllDuplication(Arrays.asList(RANDOM.nextInt(200), RANDOM.nextInt(200)))
         .build();
     }
     return dataBuilder;
index fe7bae60142bc40f7ad4425b171bdf42374473b0..08d7f04db06bc545105758d283ce3f89521b03a4 100644 (file)
  */
 package org.sonar.db.user;
 
+import java.security.SecureRandom;
 import java.util.Date;
+import java.util.Random;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
-import static org.apache.commons.lang.math.RandomUtils.nextLong;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 
 public class GroupTesting {
 
+  private static final Random RANDOM = new SecureRandom();
+
   private GroupTesting() {
     // only statics
   }
@@ -35,7 +38,7 @@ public class GroupTesting {
       .setUuid(randomAlphanumeric(40))
       .setName(randomAlphanumeric(255))
       .setDescription(randomAlphanumeric(200))
-      .setCreatedAt(new Date(nextLong()))
-      .setUpdatedAt(new Date(nextLong()));
+      .setCreatedAt(new Date(RANDOM.nextLong(Long.MAX_VALUE)))
+      .setUpdatedAt(new Date(RANDOM.nextLong(Long.MAX_VALUE)));
   }
 }
index 5d84d1c7ff039fc3deeeac39e9eecc24eb33f851..004b5fd2caada7a8be7d922f8f08a381a098a008 100644 (file)
  */
 package org.sonar.db.user;
 
+import java.security.SecureRandom;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Optional;
+import java.util.Random;
 import java.util.Set;
 import java.util.function.Consumer;
 import javax.annotation.CheckForNull;
@@ -32,9 +34,9 @@ import org.sonar.api.web.UserRole;
 import org.sonar.core.util.Uuids;
 import org.sonar.db.DbClient;
 import org.sonar.db.DbTester;
-import org.sonar.db.dismissmessage.MessageType;
 import org.sonar.db.component.BranchDto;
 import org.sonar.db.component.ComponentDto;
+import org.sonar.db.dismissmessage.MessageType;
 import org.sonar.db.entity.EntityDto;
 import org.sonar.db.permission.GlobalPermission;
 import org.sonar.db.permission.GroupPermissionDto;
@@ -47,8 +49,7 @@ import org.sonar.db.scim.ScimUserDto;
 import static com.google.common.base.Preconditions.checkArgument;
 import static java.util.Arrays.stream;
 import static java.util.stream.Collectors.toSet;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
-import static org.apache.commons.lang.math.RandomUtils.nextLong;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.sonar.db.permission.GlobalPermission.ADMINISTER;
 import static org.sonar.db.user.GroupTesting.newGroupDto;
 
@@ -56,6 +57,8 @@ public class UserDbTester {
   private static final Set<String> PUBLIC_PERMISSIONS = Set.of(UserRole.USER, UserRole.CODEVIEWER);
   public static final String PERMISSIONS_CANT_BE_GRANTED_ON_BRANCHES = "Permissions can't be granted on branches";
 
+  private final Random random = new SecureRandom();
+
   private final DbTester db;
   private final DbClient dbClient;
 
@@ -482,7 +485,7 @@ public class UserDbTester {
   public final SessionTokenDto insertSessionToken(UserDto user, Consumer<SessionTokenDto>... populators) {
     SessionTokenDto dto = new SessionTokenDto()
       .setUserUuid(user.getUuid())
-      .setExpirationDate(nextLong());
+      .setExpirationDate(random.nextLong(Long.MAX_VALUE));
     stream(populators).forEach(p -> p.accept(dto));
     db.getDbClient().sessionTokensDao().insert(db.getSession(), dto);
     db.commit();
index 0a66a03c5096378a8d11ef20c976ff80d5c109f3..ae148ef54d87deb80d63db93c46f78fc3cd63950 100644 (file)
  */
 package org.sonar.db.user;
 
+import java.security.SecureRandom;
 import java.util.Locale;
+import java.util.Random;
 import javax.annotation.Nullable;
 
 import static java.util.Collections.emptyList;
 import static java.util.Collections.singletonList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
-import static org.apache.commons.lang.math.RandomUtils.nextBoolean;
-import static org.apache.commons.lang.math.RandomUtils.nextLong;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 
 public class UserTesting {
 
+  private static final Random RANDOM = new SecureRandom();
+
   public static UserDto newUserDto() {
     return new UserDto()
       .setUuid(randomAlphanumeric(40))
       .setActive(true)
-      .setLocal(nextBoolean())
+      .setLocal(RANDOM.nextBoolean())
       .setLogin(randomAlphanumeric(30))
       .setName(randomAlphanumeric(30))
       .setEmail(randomAlphanumeric(30))
@@ -44,8 +46,8 @@ public class UserTesting {
       .setExternalIdentityProvider(randomAlphanumeric(40))
       .setSalt(randomAlphanumeric(40))
       .setCryptedPassword(randomAlphanumeric(40))
-      .setCreatedAt(nextLong())
-      .setUpdatedAt(nextLong());
+      .setCreatedAt(RANDOM.nextLong(Long.MAX_VALUE))
+      .setUpdatedAt(RANDOM.nextLong(Long.MAX_VALUE));
   }
 
   public static UserDto newUserDto(String login, String name, @Nullable String email) {
index 33465a5fea7d60573c264667188a30d1ccc8c98c..d7c3d90fbe1ad0a2015949a28ef7ab5f13c594a8 100644 (file)
  */
 package org.sonar.db.user;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
-import static org.apache.commons.lang.math.RandomUtils.nextLong;
+import org.sonar.api.utils.System2;
+
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 
 public class UserTokenTesting {
 
+  private static final long NOW = System2.INSTANCE.now();
+
   private UserTokenTesting() {
     throw new UnsupportedOperationException("This is a utility class and cannot be instantiated");
   }
@@ -33,7 +36,7 @@ public class UserTokenTesting {
       .setUserUuid("userUuid_" + randomAlphanumeric(40))
       .setName("name_" + randomAlphanumeric(20))
       .setTokenHash("hash_" + randomAlphanumeric(30))
-      .setCreatedAt(nextLong())
+      .setCreatedAt(NOW)
       .setType("USER_TOKEN");
   }
 
@@ -45,7 +48,7 @@ public class UserTokenTesting {
       .setProjectUuid("projectUuid_" + randomAlphanumeric(20))
       .setProjectKey("projectKey_" + randomAlphanumeric(40))
       .setProjectName("Project " + randomAlphanumeric(40))
-      .setCreatedAt(nextLong())
+      .setCreatedAt(NOW)
       .setType("PROJECT_ANALYSIS_TOKEN");
   }
 
index 30c9d9c7f6b067af7e645a76ae3cba315f5ef82e..c458c909d4242ba7acd7339c8823eecf6d459ab5 100644 (file)
  */
 package org.sonar.db.webhook;
 
+import java.security.SecureRandom;
 import java.util.List;
+import java.util.Random;
 import org.sonar.core.util.Uuids;
 import org.sonar.db.DbSession;
 import org.sonar.db.DbTester;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
-import static org.apache.commons.lang.math.RandomUtils.nextBoolean;
-import static org.apache.commons.lang.math.RandomUtils.nextInt;
-import static org.apache.commons.lang.math.RandomUtils.nextLong;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 
 public class WebhookDeliveryTesting {
 
+  private static final Random RANDOM = new SecureRandom();
+
   private WebhookDeliveryTesting() {
     // only statics
   }
@@ -56,11 +57,11 @@ public class WebhookDeliveryTesting {
       .setAnalysisUuid(randomAlphanumeric(40))
       .setName(randomAlphanumeric(10))
       .setUrl(randomAlphanumeric(10))
-      .setDurationMs(nextInt())
-      .setHttpStatus(nextInt())
-      .setSuccess(nextBoolean())
+      .setDurationMs(RANDOM.nextInt(Integer.MAX_VALUE))
+      .setHttpStatus(RANDOM.nextInt(Integer.MAX_VALUE))
+      .setSuccess(RANDOM.nextBoolean())
       .setPayload(randomAlphanumeric(10))
-      .setCreatedAt(nextLong());
+      .setCreatedAt(RANDOM.nextLong(Long.MAX_VALUE));
   }
 
   public static List<String> selectAllDeliveryUuids(DbTester dbTester, DbSession dbSession) {
index c6da5ce9eb5b7301e55d2602adb68f431dbe4c48..686fa1fd934dd5c5fbe324a0039bdbb2ad77331e 100644 (file)
@@ -24,7 +24,7 @@ import java.util.Calendar;
 import java.util.function.Consumer;
 import org.sonar.db.project.ProjectDto;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 
 public class WebhookTesting {
 
index 0025201269facc8d5402bce2165858a7f41aa182..c1c37924fe7894a6fb6b105c8dc21df08cdf4080 100644 (file)
@@ -8,7 +8,7 @@ dependencies {
   // please keep the list grouped by configuration and ordered by name
 
   api 'com.google.guava:guava'
-  api 'commons-lang:commons-lang'
+  api 'org.apache.commons:commons-lang3'
   api 'commons-codec:commons-codec'
   api 'com.fasterxml.staxmate:staxmate'
 
index b48f129f89312c7418b2484f1ef16503e5965a55..273fbca71d1478d6d6007853f3ec63eb7acd501d 100644 (file)
@@ -29,7 +29,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicBoolean;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
index 4c65c78f8b24081b18c2ebab42f67d0a8f699521..8b05c83ecf4b0fd62393bfe897e34e84f538af11 100644 (file)
@@ -28,7 +28,7 @@ import org.sonar.core.util.UuidFactory;
 import org.sonar.core.util.UuidFactoryFast;
 import org.sonar.db.CoreDbTester;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonar.server.platform.db.migration.step.ForceReloadingOfAllPlugins.OVERWRITE_HASH;
 
index 2384ca1eafc0f4e04a3a276d804c6ad71d436e19..0fa8d7e5edea41610d7288cdaec69716c9d1c337 100644 (file)
@@ -29,7 +29,7 @@ import org.sonar.core.util.UuidFactoryFast;
 import org.sonar.db.MigrationDbTester;
 import org.sonar.server.platform.db.migration.step.DataChange;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 
 class PopulateNclocForForProjectsIT {
index 63b917015007ff61548736a2f9b0a1e154d0be1f..6e10a1de33294acf38afdce0deb2968c3685350c 100644 (file)
@@ -29,8 +29,8 @@ import org.sonar.core.util.UuidFactoryFast;
 import org.sonar.db.MigrationDbTester;
 import org.sonar.server.platform.db.migration.step.DataChange;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
-import static org.apache.commons.lang.RandomStringUtils.randomNumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomNumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 
 class UpdateUserLocalValueInUsersIT {
index 545fe88b0c848888e73498d35e2961d4a5c774c0..1a587fe93e8bf632d0ad7ffb7261c38d15d5af5e 100644 (file)
@@ -24,12 +24,12 @@ import java.sql.Connection;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.List;
-import org.sonar.api.utils.MessageException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.sonar.api.utils.MessageException;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.StringUtils.containsIgnoreCase;
+import static org.apache.commons.lang3.StringUtils.containsIgnoreCase;
 
 class MssqlCharsetHandler extends CharsetHandler {
 
index f6754a58fa73d4026df331fc00ff5b501521e1e0..88800902e39e9d67939890428a78cc4efd899773 100644 (file)
@@ -21,11 +21,11 @@ package org.sonar.server.platform.db.migration.charset;
 
 import java.sql.Connection;
 import java.sql.SQLException;
-import org.sonar.api.utils.MessageException;
 import org.slf4j.LoggerFactory;
+import org.sonar.api.utils.MessageException;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.StringUtils.containsIgnoreCase;
+import static org.apache.commons.lang3.StringUtils.containsIgnoreCase;
 
 class OracleCharsetHandler extends CharsetHandler {
 
index fefb2a81df1232e50d9b3cdccf5546b10496fa78..2112dc613fdfc7622a1567694425e86512ed0931 100644 (file)
@@ -27,14 +27,14 @@ import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Set;
 import java.util.stream.Collectors;
-import org.sonar.api.utils.MessageException;
 import org.slf4j.LoggerFactory;
+import org.sonar.api.utils.MessageException;
 import org.sonar.db.version.SqTables;
 
 import static java.lang.String.format;
 import static java.util.Optional.ofNullable;
-import static org.apache.commons.lang.StringUtils.containsIgnoreCase;
-import static org.apache.commons.lang.StringUtils.isBlank;
+import static org.apache.commons.lang3.StringUtils.containsIgnoreCase;
+import static org.apache.commons.lang3.StringUtils.isBlank;
 
 class PostgresCharsetHandler extends CharsetHandler {
 
index 64529005c5806c55a9ba488390cf4c5ee9e2b804..ed80421db306180cf5069a574179aa9aca7e3ae4 100644 (file)
@@ -23,7 +23,7 @@ import com.google.common.annotations.VisibleForTesting;
 import java.sql.SQLException;
 import java.util.Arrays;
 import java.util.Set;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.db.Database;
 import org.sonar.db.DatabaseUtils;
 import org.sonar.server.platform.db.migration.step.DataChange;
index 4c84728cd572e254b2aaee9706ca801227211c65..b041f4f9d4dbc2d1addde618b86faf3392af7bb7 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.server.platform.db.migration.sql;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import org.apache.commons.lang.text.StrSubstitutor;
+import org.apache.commons.lang3.text.StrSubstitutor;
 import org.junit.Test;
 import org.sonar.db.dialect.Dialect;
 import org.sonar.db.dialect.H2;
@@ -39,7 +39,7 @@ import org.sonar.server.platform.db.migration.def.IntegerColumnDef;
 import org.sonar.server.platform.db.migration.def.TinyIntColumnDef;
 import org.sonar.server.platform.db.migration.def.VarcharColumnDef;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
index 85b9869c45eabe5e282816e7672e29b7eaecf7a7..285e126041271c19e2006f5154c9a20df39f0c56 100644 (file)
@@ -27,10 +27,10 @@ import java.util.Map;
 import java.util.Properties;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.text.StrSubstitutor;
+import org.apache.commons.lang3.text.StrSubstitutor;
 import org.sonar.api.config.internal.Settings;
 
-import static org.apache.commons.lang.StringUtils.isEmpty;
+import static org.apache.commons.lang3.StringUtils.isEmpty;
 
 public class OrchestratorSettingsUtils {
   private OrchestratorSettingsUtils() {
index 2926de0f43ec157a4dc19922543d32282d75b966..f3937fcdcc028c8a58a17cfc86bace731049ba69 100644 (file)
@@ -14,7 +14,7 @@ dependencies {
   api 'com.google.guava:guava'
   api 'com.hazelcast:hazelcast'
   api 'commons-io:commons-io'
-  api 'commons-lang:commons-lang'
+  api 'org.apache.commons:commons-lang3'
   api 'org.apache.logging.log4j:log4j-to-slf4j'
   api 'org.apache.logging.log4j:log4j-api'
   api 'org.elasticsearch.client:elasticsearch-rest-high-level-client'
index f3797bd91edf09cea1af1dc9d8f0e5885c4c2b85..d426908902d3429083b4207aaf84736c2e03b377 100644 (file)
  */
 package org.sonar.application.config;
 
-import org.apache.commons.lang.StringUtils;
-
 import java.util.Map;
 import java.util.Properties;
+import org.apache.commons.lang3.StringUtils;
 
 public class CommandLineParser {
 
index 692f59b0e326e56fd09f59db9630686869557776..58ee6740228f067a31381143118bf83db7d57d26 100644 (file)
@@ -28,15 +28,15 @@ import java.util.function.Consumer;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.sonar.process.MessageException;
 import org.sonar.process.Props;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.StringUtils.isEmpty;
-import static org.apache.commons.lang.StringUtils.isNotEmpty;
+import static org.apache.commons.lang3.StringUtils.isEmpty;
+import static org.apache.commons.lang3.StringUtils.isNotEmpty;
 import static org.sonar.process.ProcessProperties.Property.JDBC_DRIVER_PATH;
 import static org.sonar.process.ProcessProperties.Property.JDBC_EMBEDDED_PORT;
 import static org.sonar.process.ProcessProperties.Property.JDBC_URL;
index 3617195018a0a6e84fa2a7d13a950b7996e73e70..c57d813f014f44e9af2867641f57f3ec1016094b 100644 (file)
@@ -28,7 +28,7 @@ import java.util.Optional;
 import java.util.Properties;
 import java.util.stream.Stream;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.application.command.EsJvmOptions;
 import org.sonar.process.Props;
 
index e5acaf714b4053c9f898d89eed72711152ab6b09..a81e4cc1d9712c7d4434d4cedd72551677cae1a6 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.application;
 import java.util.Random;
 import java.util.concurrent.TimeUnit;
 import java.util.function.BooleanSupplier;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.DisableOnDebug;
index eb1433cacef6685489bdb47c58aaa3da1106004c..0a6ec85fcf34c59449b36fac4720cb3f123b414f 100644 (file)
@@ -53,7 +53,7 @@ import org.sonar.process.cluster.hz.HazelcastMember;
 
 import static com.google.common.collect.ImmutableMap.of;
 import static java.util.Collections.synchronizedList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
index 0407f8a57f5f702b79172c6033433334b43b6f3b..9e1f27a1f48520153ee08b8e6b92f510f28f1217 100644 (file)
@@ -30,8 +30,8 @@ import org.sonar.process.Props;
 import org.sonar.process.cluster.health.NodeHealth;
 
 import static java.lang.String.valueOf;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat;
 import static org.mockito.Mockito.mock;
index fe724847e78b464578befd024c570c1b23c19075..4ba830d0fa2d78700756916954a5439022aa5b08 100644 (file)
@@ -33,7 +33,7 @@ import org.mockito.Mockito;
 import org.sonar.process.ProcessId;
 import org.sonar.process.System2;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.Mockito.when;
index 489e110ca757dd623686739cb5c2df98b9bfb01d..4e238f542305df637eeb9ee3bf4d1ac40d741cd5 100644 (file)
@@ -31,7 +31,7 @@ import org.junit.rules.TemporaryFolder;
 import org.junit.runner.RunWith;
 import org.sonar.process.Props;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
index 10a4c9fa5da6a2a2f7ebbf622c80cc142a73e3c8..ae4a4ad6d7e74be9abc414805660685c5c664a03 100644 (file)
@@ -41,8 +41,8 @@ import org.sonar.process.MessageException;
 import org.sonar.process.Props;
 
 import static java.lang.String.valueOf;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.fail;
index 3d7206717b3cd35ed25bac6ed02472a542847643..b5e264b8ddb890f65987fccd06ee6875c0b9817b 100644 (file)
@@ -43,7 +43,7 @@ import org.sonar.process.Props;
 import org.sonar.process.System2;
 
 import static java.util.Optional.ofNullable;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.Mockito.mock;
index 63a03012d98cd79984eb32670572ee40faab9775..927d3fefaaf162862df0d44b72401a9c35279447 100644 (file)
@@ -11,7 +11,7 @@ dependencies {
   api 'ch.qos.logback:logback-core'
   api 'commons-codec:commons-codec'
   api 'commons-io:commons-io'
-  api 'commons-lang:commons-lang'
+  api 'org.apache.commons:commons-lang3'
   api 'com.google.code.gson:gson'
   api 'com.google.guava:guava'
   api 'com.google.protobuf:protobuf-java'
index 95be74a6a9a57e304590084d9cc27ca07d6543dc..d54feb60eabba48661acf8d795977b7e252b4b60 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.process;
 import java.io.File;
 import java.io.IOException;
 import java.util.Map;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 
 import static java.lang.String.format;
 import static org.sonar.process.FileUtils2.deleteQuietly;
index 652ee4efd087882f5fb5e966c2e3ec0a30afe154..3186ae27ec23fd307e2828fcac28d0d4256f4e01 100644 (file)
@@ -23,8 +23,7 @@ import java.io.File;
 import java.util.Properties;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.config.internal.Encryption;
 
 import static org.sonar.api.CoreProperties.ENCRYPTION_SECRET_KEY_PATH;
index 58ad684f88df51180bf6498644207a3bb138e338..ff13ae182aa319c5ecb97b2e81991207f0abe125 100644 (file)
@@ -20,7 +20,7 @@
 package org.sonar.process;
 
 import java.util.Map;
-import org.apache.commons.lang.SystemUtils;
+import org.apache.commons.lang3.SystemUtils;
 
 /**
  * An interface allowing to wrap around static call to {@link System} class.
index 58c462032953a83c22117e933d95c66a3dd21ee9..b0dfb5ad515341ee6bdd0aeb50cabfc3ff2b01dd 100644 (file)
@@ -27,7 +27,7 @@ import java.util.Properties;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.process.MessageException;
 import org.sonar.process.ProcessProperties;
 import org.sonar.process.Props;
index 4b7d3d3dfcb875ba4a8479fc92b39da3f15663c8..5a1fb32086eb9181b7887ed2e2d572a1d35a3fb9 100644 (file)
@@ -42,7 +42,7 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
 import java.util.logging.LogManager;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.LoggerFactory;
 import org.slf4j.bridge.SLF4JBridgeHandler;
 import org.sonar.process.MessageException;
index 83c6b91214b66345141355f08e800e36a39b3c7f..40cc70323dda70fc2bab7c7bda32c24795bd1713 100644 (file)
@@ -34,7 +34,7 @@ import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 import java.util.regex.Pattern;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 
 import static java.lang.String.format;
 import static java.util.Objects.requireNonNull;
index a442181e477a1fab3fe6f27e5b90380fdc90003f..9527dcbeb50f9697cc1085733cdbcc74ca1c5036 100644 (file)
@@ -28,7 +28,7 @@ import java.nio.charset.StandardCharsets;
 import org.apache.commons.io.IOUtils;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.StringUtils.rightPad;
+import static org.apache.commons.lang3.StringUtils.rightPad;
 import static org.sonar.process.sharedmemoryfile.ProcessCommands.MAX_PROCESSES;
 
 /**
index 0e4bc4a612e60ba1458ab02b35380e1dbe9b3bd5..16b2c1dd09a8e7a14342f494b40d3cfcf01d3728 100644 (file)
@@ -26,7 +26,7 @@ import java.nio.file.Path;
 import java.nio.file.attribute.BasicFileAttributes;
 import javax.annotation.CheckForNull;
 import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.SystemUtils;
+import org.apache.commons.lang3.SystemUtils;
 import org.assertj.core.api.ThrowableAssert.ThrowingCallable;
 import org.junit.Rule;
 import org.junit.Test;
index d3a6813094b728e81dfb1ca7e8ba45a1235d3024..d9d22a09d03be32b09135f99d313c3e5b52525f2 100644 (file)
@@ -29,7 +29,7 @@ import java.util.Set;
 import org.hamcrest.CoreMatchers;
 import org.junit.Test;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assume.assumeThat;
 
index f1a2582ebb92a6225e22e55984336cc44146fcf5..bed9daa475f52968e37712c67c49e51cc3804917 100644 (file)
@@ -25,7 +25,7 @@ import com.tngtech.java.junit.dataprovider.UseDataProvider;
 import java.io.File;
 import java.io.IOException;
 import java.util.Properties;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
index 89dbf04d5d44b2b82a70df3ffe83894f6193957f..83be9bcb570b71e931f36a2ad681337c3137c8f6 100644 (file)
@@ -25,7 +25,7 @@ import java.io.ObjectInputStream;
 import java.util.Random;
 import org.junit.Test;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.sonar.process.cluster.health.NodeDetails.newNodeDetailsBuilder;
index f6061495575de942310c176a88447eac48c8f2c6..191b10bf3464baaadb919ae6afda3c061411d10c 100644 (file)
@@ -25,7 +25,7 @@ import java.io.ObjectOutputStream;
 import java.util.Random;
 import java.util.stream.IntStream;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.sonar.process.cluster.health.NodeDetails.newNodeDetailsBuilder;
 import static org.sonar.process.cluster.health.NodeHealth.newNodeHealthBuilder;
 
index 0bfb8215b742cee54e97b45ef4c17987c8100311..129b9b72812237d1a232bec9f0448a23aa422da0 100644 (file)
@@ -27,7 +27,7 @@ import java.util.Random;
 import java.util.stream.IntStream;
 import org.junit.Test;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.sonar.process.cluster.health.NodeHealth.newNodeHealthBuilder;
index b0056f8fd39889ed704e87184b2cf5e1807628c5..00e60860b770d445e81478111c17e5c32811d925 100644 (file)
@@ -32,7 +32,7 @@ import org.sonar.process.LoggingRule;
 import org.sonar.process.cluster.hz.HazelcastMember;
 
 import static java.util.Collections.singleton;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.Mockito.doReturn;
index bec94b723ab0ee180868747b2c55981d41754080..eda1a1708faea64d3f79bd00ac571e86f0f7b805 100644 (file)
@@ -29,7 +29,7 @@ import java.util.HashSet;
 import java.util.Properties;
 import java.util.Random;
 import java.util.Set;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
@@ -39,7 +39,7 @@ import org.sonar.process.ProcessId;
 import org.sonar.process.Props;
 
 import static java.lang.String.valueOf;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.junit.Assert.assertThrows;
index 27aae52bc5f3a14eb15241b4e492f328aff2b53d..df79c5b4d8eb8774504e4fcde31335bb36b6cb0e 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.process.logging;
 
 import ch.qos.logback.classic.Level;
 import java.util.Collections;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.Test;
 import org.sonar.process.ProcessId;
 
index 754f3ee5b647a7286845cdd149c62a523150959c..7cd6f7eb572b88b536a91b8ffdf337a0aa6e4abd 100644 (file)
@@ -43,8 +43,8 @@ import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Properties;
-import org.apache.commons.lang.RandomStringUtils;
-import org.apache.commons.lang.reflect.FieldUtils;
+import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.commons.lang3.reflect.FieldUtils;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
@@ -56,7 +56,7 @@ import org.sonar.process.ProcessId;
 import org.sonar.process.Props;
 
 import static java.util.stream.Collectors.toList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.junit.Assert.fail;
index 05b34279c0eebe05731577506d18d08530525ef7..f3abdbeecc0949c3f97009101e45f8fac2517acd 100644 (file)
@@ -11,7 +11,7 @@ dependencies {
 
   api 'org.apache.commons:commons-email'
   api 'commons-io:commons-io'
-  api 'commons-lang:commons-lang'
+  api 'org.apache.commons:commons-lang3'
   api 'com.google.guava:guava'
   api 'org.slf4j:slf4j-api'
   api 'com.squareup.okhttp3:okhttp'
index 9f2e9679f403c77c4f032e54a58c6ca900a69867..659652305877515ff1d8d61332d989e9b7cbe695 100644 (file)
@@ -33,8 +33,8 @@ import org.sonar.server.es.IndexType;
 import org.sonar.server.es.IndexType.IndexMainType;
 import org.sonar.server.es.newindex.FakeIndexDefinition;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 
 @RunWith(DataProviderRunner.class)
index ccbe1d1dabb28b6c3a86e19f27120a911261d63c..5677a893c6c8d1650e88a6d3bd92795ba10e1987 100644 (file)
@@ -35,8 +35,8 @@ import org.sonar.server.issue.notification.NewIssuesNotification.RuleDefinition;
 
 import static java.util.Arrays.asList;
 import static java.util.Collections.singletonList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
index d0cd3d38234f5c3af710d1b62be05b913aa364be..4ff697978d26c1694755decd7f8a91d17e7264fa 100644 (file)
@@ -36,7 +36,7 @@ import org.sonar.db.rule.RuleDto.Scope;
 import org.sonar.db.rule.RuleParamDto;
 
 import static java.util.Collections.emptySet;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.groups.Tuple.tuple;
 import static org.mockito.Mockito.mock;
index a0a3700e53c0bf9d7e2bdd9634d05b915cf4536d..6d77fdde8ce7000f01caf5acd925690d23b79a6d 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.server.rule.index;
 import java.io.IOException;
 import java.util.List;
 import java.util.Map;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.lucene.search.TotalHits;
 import org.elasticsearch.client.RequestOptions;
 import org.elasticsearch.client.indices.AnalyzeRequest;
index b07090b12db01d05e6d27d3ef6e6ce499c1b2b6d..8d499b45360c6da1091fdc7f6c19544b786bc4dd 100644 (file)
@@ -52,7 +52,7 @@ import static java.lang.String.format;
 import static java.util.Collections.emptyList;
 import static java.util.stream.Collectors.joining;
 import static java.util.stream.Collectors.toSet;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonar.db.rule.RuleDescriptionSectionDto.createDefaultRuleDescriptionSection;
 import static org.sonar.db.rule.RuleTesting.newRule;
index e1208a070cbbcf23ebf6d5ebf4301f8dbf3e184f..cc0210de2541594382b2f8f8be962cb4dae87d21 100644 (file)
@@ -20,7 +20,7 @@
 package org.sonar.server.webhook;
 
 import java.io.IOException;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.Rule;
 import org.junit.Test;
 import org.sonar.api.utils.System2;
@@ -31,7 +31,7 @@ import org.sonar.db.DbTester;
 import org.sonar.db.webhook.WebhookDeliveryDto;
 import org.sonar.db.webhook.WebhookDeliveryTesting;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
index df37467b2e0d49a583047dbdeed376fe53bd903d..0275fcbdc6644b2cf79ecb9701d42cdf73aaa84e 100644 (file)
  */
 package org.sonar.server.config;
 
-import static java.util.function.UnaryOperator.identity;
-import org.apache.commons.lang.ArrayUtils;
+import java.util.Optional;
+import java.util.function.UnaryOperator;
+import org.apache.commons.lang3.ArrayUtils;
 import org.sonar.api.config.Configuration;
 import org.sonar.api.config.PropertyDefinition;
-import static org.sonar.api.config.internal.MultivalueProperty.parseAsCsv;
 import org.sonar.api.config.internal.Settings;
 import org.springframework.context.annotation.Bean;
 
-import java.util.Optional;
-import java.util.function.UnaryOperator;
+import static java.util.function.UnaryOperator.identity;
+import static org.sonar.api.config.internal.MultivalueProperty.parseAsCsv;
 
 public class ConfigurationProvider {
 
index 08d5f84c52445e81fb8f56d6853fde982155d513..8d1e95103f3f50c4686e8e873630249ea62a814c 100644 (file)
@@ -29,9 +29,9 @@ import org.sonar.api.config.EmailSettings;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
 import static java.time.temporal.ChronoUnit.SECONDS;
-import static org.apache.commons.lang.StringUtils.equalsIgnoreCase;
-import static org.apache.commons.lang.StringUtils.isBlank;
-import static org.apache.commons.lang.StringUtils.isNotBlank;
+import static org.apache.commons.lang3.StringUtils.equalsIgnoreCase;
+import static org.apache.commons.lang3.StringUtils.isBlank;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
 
 public abstract class EmailSender<T extends BasicEmail> {
 
index 29fe2ada71649bfd2fba6780bf3e29365b2b610e..ddc7017854c5cca751cd13914b3f6a9b90920076 100644 (file)
 package org.sonar.server.es;
 
 import java.util.Arrays;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest;
 import org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheRequest;
-import org.elasticsearch.client.indices.PutMappingRequest;
 import org.elasticsearch.action.admin.indices.refresh.RefreshRequest;
 import org.elasticsearch.action.delete.DeleteRequest;
 import org.elasticsearch.action.get.GetRequest;
@@ -32,6 +31,7 @@ import org.elasticsearch.action.search.SearchRequest;
 import org.elasticsearch.action.search.SearchScrollRequest;
 import org.elasticsearch.client.indices.CreateIndexRequest;
 import org.elasticsearch.client.indices.GetIndexRequest;
+import org.elasticsearch.client.indices.PutMappingRequest;
 import org.elasticsearch.common.bytes.BytesReference;
 
 final class EsRequestDetails {
index 91b799442f930bc376ee7a3b89e1cddf5c94f151..575816c42951669ed8edc7564b2954556eda3f02 100644 (file)
@@ -28,8 +28,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import javax.annotation.CheckForNull;
-import org.apache.commons.lang.builder.ReflectionToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
+import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
 import org.elasticsearch.action.search.SearchResponse;
 import org.elasticsearch.search.aggregations.Aggregation;
 import org.elasticsearch.search.aggregations.Aggregations;
index be476af7c83674948c43f41b501166035d045b55..90dfb5d40fa602063238d44dfd98db8d7ed41dfd 100644 (file)
@@ -20,7 +20,7 @@
 package org.sonar.server.es;
 
 import java.util.Objects;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkState;
index 0d7ff98fb18af5b2549e8d366ef61483bd4cc8cf..a3b4799a4eafbcc25f6f5ae787eb612accfd7321 100644 (file)
@@ -23,7 +23,7 @@ import java.time.ZoneId;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.function.Function;
-import org.apache.commons.lang.builder.ReflectionToStringBuilder;
+import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
 import org.apache.lucene.search.TotalHits;
 import org.elasticsearch.action.search.SearchResponse;
 import org.elasticsearch.search.SearchHit;
index 2cfb88de2b5cc6f706f7372f663be9162ee23031..7f68c7b449b0faee71aa1982528054a72db54a6c 100644 (file)
@@ -25,7 +25,7 @@ import java.util.HashSet;
 import java.util.LinkedHashSet;
 import java.util.Set;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.server.ws.WebService;
 import org.sonar.api.utils.text.JsonWriter;
 
index fcea4af0853833d699d133121c5af98f99eb0e9e..e24e59fb4f64076abd0f232292b1c1a0fbdf8b0d 100644 (file)
@@ -23,7 +23,7 @@ import java.time.ZoneId;
 import java.util.List;
 import java.util.Map;
 import java.util.function.Function;
-import org.apache.commons.lang.builder.ReflectionToStringBuilder;
+import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
 import org.apache.lucene.search.TotalHits;
 import org.elasticsearch.action.search.SearchResponse;
 
index 4315f97e3a25a2391b87c53230d2c5085446f7f0..50cf3b83907686d65cc58a5df9cbcf0b13e71adb 100644 (file)
@@ -26,7 +26,7 @@ import java.util.function.Function;
 import java.util.stream.Collector;
 import java.util.stream.Collectors;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.ArrayUtils;
+import org.apache.commons.lang3.ArrayUtils;
 import org.elasticsearch.index.query.BoolQueryBuilder;
 import org.elasticsearch.index.query.QueryBuilder;
 import org.elasticsearch.search.aggregations.AbstractAggregationBuilder;
index 78e7bf5815824f289ef5a13acfe49857da0005df..594c433abd2d2ce3665b7d302154513d908fd262 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.server.es.searchrequest;
 import java.util.Arrays;
 import java.util.Objects;
 import javax.annotation.concurrent.Immutable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.server.es.searchrequest.TopAggregationDefinition.NestedFieldFilterScope;
 
 import static com.google.common.base.Preconditions.checkArgument;
index 643e66548f6de98c14a81bfeadb28e125b81e058..6d9d93ee3b55e7198e3ec34413751951c3dcb0b6 100644 (file)
@@ -24,7 +24,7 @@ import java.util.Locale;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.stream.Stream;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.elasticsearch.index.query.BoolQueryBuilder;
 import org.elasticsearch.index.query.MatchQueryBuilder;
 import org.elasticsearch.index.query.QueryBuilder;
index dbdbd1d421874601e7cc9fdbe0b66da027be089c..1522daa5969f1f281229a939ed751e36b02ecc91 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.server.es.textsearch;
 
 import java.util.Arrays;
 import java.util.List;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.server.es.newindex.DefaultIndexSettings;
 
 import static org.sonar.server.es.newindex.DefaultIndexSettings.MINIMUM_NGRAM_LENGTH;
index 980a6a41a4caa2deab7565e982529c34e81c4a92..27e17494ed84f382f999cfad419d79b0d8db34cd 100644 (file)
@@ -19,7 +19,7 @@
  */
 package org.sonar.server.issue.notification;
 
-import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
 
 public class EmailMessage {
 
index 8ba368894abfd5576ef45b9bed4e2a6ca8ae47a9..8debc1f4c1e48448c25c8ec353da17b29fd59421 100644 (file)
@@ -46,7 +46,7 @@ import org.sonar.server.issue.notification.IssuesChangesNotificationBuilder.Rule
 import static java.net.URLEncoder.encode;
 import static java.nio.charset.StandardCharsets.UTF_8;
 import static java.util.function.Function.identity;
-import static org.apache.commons.lang.StringEscapeUtils.escapeHtml;
+import static org.apache.commons.lang3.StringEscapeUtils.escapeHtml4;
 import static org.sonar.core.util.stream.MoreCollectors.index;
 import static org.sonar.server.issue.notification.RuleGroup.ISSUES;
 import static org.sonar.server.issue.notification.RuleGroup.SECURITY_HOTSPOTS;
@@ -97,7 +97,7 @@ public abstract class IssueChangesEmailTemplate implements EmailTemplate {
     if (branchName.isPresent()) {
       value += ", " + branchName.get();
     }
-    sb.append(escapeHtml(value));
+    sb.append(escapeHtml4(value));
   }
 
   static String toUrlParams(Project project) {
@@ -163,7 +163,7 @@ public abstract class IssueChangesEmailTemplate implements EmailTemplate {
       Rule rule = rules.next();
       Collection<ChangedIssue> issues = issuesByRule.get(rule);
 
-      String ruleName = escapeHtml(rule.getName());
+      String ruleName = escapeHtml4(rule.getName());
       sb.append("<li>").append("Rule ").append(" <em>").append(ruleName).append("</em> - ");
       appendIssueLinks(sb, issuePageHref, issues, rule.getRuleType());
       sb.append("</li>");
index 5ae75a87b457154f156ba3ecaf194a7698706da6..37b4080f61cd625d14b2e3113cfa17e3244cedf4 100644 (file)
@@ -24,7 +24,7 @@ import com.google.common.collect.Lists;
 import java.util.Arrays;
 import java.util.List;
 import javax.annotation.CheckForNull;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.issue.Issue;
 
 import static com.google.common.base.Preconditions.checkArgument;
index 85765163125d81d1d5bd0d2524b56df8d71a4a9e..e7319f4a2397d9aefce2048641d99c3e618198c3 100644 (file)
@@ -19,7 +19,7 @@
  */
 package org.sonar.server.notification;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.ExtensionPoint;
 import org.sonar.api.ce.ComputeEngineSide;
 import org.sonar.api.notifications.Notification;
index 8dca6805161c6c62d793724311128dbfbc4eb6a8..b052d3110a58d89409173641ca13cfd26bd28903 100644 (file)
@@ -26,7 +26,7 @@ import java.util.Objects;
 import java.util.Set;
 import java.util.regex.Pattern;
 import javax.annotation.CheckForNull;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.mail.Email;
 import org.apache.commons.mail.EmailException;
 import org.apache.commons.mail.HtmlEmail;
index 672c2df8e917f27720404b2df1771db4e54ed23b..72fd058c97665d0330cda400036b3a239fabd229 100644 (file)
@@ -28,11 +28,11 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.db.DbClient;
 import org.sonar.db.DbSession;
 
-import static org.apache.commons.lang.StringUtils.repeat;
+import static org.apache.commons.lang3.StringUtils.repeat;
 import static org.sonar.db.DatabaseUtils.executeLargeInputs;
 
 /**
index f06c71a7a612783a1192ea17d4f3030d31df5a26..0e5282bfdd1035f08078de4f30566ccc0c549264 100644 (file)
@@ -32,7 +32,7 @@ import org.sonar.db.property.PropertyDto;
 import org.springframework.context.annotation.Bean;
 
 import static com.google.common.base.Preconditions.checkState;
-import static org.apache.commons.lang.StringUtils.isBlank;
+import static org.apache.commons.lang3.StringUtils.isBlank;
 import static org.sonar.api.CoreProperties.SERVER_STARTTIME;
 
 @ComputeEngineSide
index 3b518cd1ae183f09e4db68dd7eebbe277f1af785..1dbd95e01fef50098516b54b9938fa9bb9da2de0 100644 (file)
  */
 package org.sonar.server.platform;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.ce.ComputeEngineSide;
 import org.sonar.api.config.Configuration;
 import org.sonar.api.server.ServerSide;
 
-import static org.apache.commons.lang.StringUtils.isEmpty;
-import static org.apache.commons.lang.StringUtils.isNotEmpty;
-import static org.apache.commons.lang.StringUtils.stripEnd;
+import static org.apache.commons.lang3.StringUtils.isEmpty;
+import static org.apache.commons.lang3.StringUtils.isNotEmpty;
+import static org.apache.commons.lang3.StringUtils.stripEnd;
 import static org.sonar.api.CoreProperties.SERVER_BASE_URL;
 import static org.sonar.process.ProcessProperties.Property.WEB_CONTEXT;
 import static org.sonar.process.ProcessProperties.Property.WEB_HOST;
index a9ddb580517331ad1207c7f36ad478b81cf0d7ef..533e01f23b8dcdfec20d877384b47b3f88ca4705 100644 (file)
@@ -24,7 +24,7 @@ import java.util.Locale;
 import java.util.Map;
 import java.util.Objects;
 import java.util.Optional;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.utils.KeyValueFormat;
 
 public class JdbcUrlSanitizer {
index e41f21549f78cc8960bae47e1163ec1226125bf2..f7abea14a29541949d7a6b857178420e010a9fe6 100644 (file)
  */
 package org.sonar.server.qualitygate.notification;
 
+import java.util.Optional;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.config.EmailSettings;
 import org.sonar.api.measures.Metric;
 import org.sonar.api.notifications.Notification;
@@ -30,8 +30,6 @@ import org.sonar.server.issue.notification.EmailMessage;
 import org.sonar.server.issue.notification.EmailTemplate;
 import org.sonar.server.measure.Rating;
 
-import java.util.Optional;
-
 /**
  * Creates email message for notification "alerts".
  *
index 87540a7153f928031705677bdd96e6df45d06ff8..f91396cf486522b2645644dd5bf9886abd2583c8 100644 (file)
@@ -24,7 +24,7 @@ import java.util.HashMap;
 import java.util.Map;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.db.qualityprofile.ActiveRuleDto;
 import org.sonar.db.qualityprofile.ActiveRuleKey;
 import org.sonar.db.qualityprofile.QProfileChangeDto;
index fb7bc88d764f03968ebf1aa975f332bfd6794083..eedbf89adc653ef2e5e00979fc8810c16c725aae 100644 (file)
@@ -25,7 +25,7 @@ import javax.annotation.Nullable;
 import org.sonar.server.es.BaseDoc;
 import org.sonar.server.qualityprofile.ActiveRuleInheritance;
 
-import static org.apache.commons.lang.StringUtils.containsIgnoreCase;
+import static org.apache.commons.lang3.StringUtils.containsIgnoreCase;
 import static org.sonar.server.rule.index.RuleIndexDefinition.FIELD_ACTIVE_RULE_INHERITANCE;
 import static org.sonar.server.rule.index.RuleIndexDefinition.FIELD_ACTIVE_RULE_PROFILE_UUID;
 import static org.sonar.server.rule.index.RuleIndexDefinition.FIELD_ACTIVE_RULE_SEVERITY;
index a67a999e8d01b3a53e4939828052353122a349b3..3cd68b6b29c3dd3c4afbc3e5a92a31e3abd7d153 100644 (file)
@@ -31,7 +31,7 @@ import java.util.Set;
 import java.util.stream.Collectors;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.builder.ReflectionToStringBuilder;
+import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
 import org.sonar.api.issue.impact.SoftwareQuality;
 import org.sonar.api.rule.RuleKey;
 import org.sonar.api.rule.RuleStatus;
index 4fcb7c0165a19e67704452b03eb9eaab1a736b54..4416dc50cd9d26e28018609fea0cdbc697cab52d 100644 (file)
@@ -30,7 +30,7 @@ import java.util.Map;
 import java.util.function.Function;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.lucene.search.join.ScoreMode;
 import org.elasticsearch.action.search.SearchRequest;
 import org.elasticsearch.action.search.SearchResponse;
index 1732abef3aebe7240cb736dc0a2c9e1d828b6efb..2adb03ba4e3e826be6207caa799594f71d70a71d 100644 (file)
@@ -25,7 +25,7 @@ import org.sonar.db.DbClient;
 import org.sonar.db.DbSession;
 import org.sonar.db.property.PropertyDto;
 
-import static org.apache.commons.lang.StringUtils.defaultString;
+import static org.apache.commons.lang3.StringUtils.defaultString;
 
 public class DatabaseSettingLoader implements SettingLoader {
 
index 111676b384f31d75444d2defed0b3eeeeee12add..3b143b483bcf8b2f428b11379c894decf54b15d2 100644 (file)
@@ -27,7 +27,7 @@ import javax.annotation.Nullable;
 import okhttp3.HttpUrl;
 
 import static com.google.common.base.Preconditions.checkState;
-import static org.apache.commons.lang.StringUtils.repeat;
+import static org.apache.commons.lang3.StringUtils.repeat;
 
 public final class HttpUrlHelper {
   private HttpUrlHelper() {
index 235225d3396cf68f2b567bc0eb396d4f91ec8f2e..fb6aaf551065456ec848f8ed19acfdbef6af9690 100644 (file)
@@ -40,7 +40,7 @@ import static java.net.HttpURLConnection.HTTP_MOVED_TEMP;
 import static java.nio.charset.StandardCharsets.UTF_8;
 import static okhttp3.internal.http.StatusLine.HTTP_PERM_REDIRECT;
 import static okhttp3.internal.http.StatusLine.HTTP_TEMP_REDIRECT;
-import static org.apache.commons.lang.StringUtils.isNotEmpty;
+import static org.apache.commons.lang3.StringUtils.isNotEmpty;
 
 @ServerSide
 @ComputeEngineSide
index 801750e126cddd382a948161ee8da5479b847ab8..d7e52cec8b81c17e3ebe6580cf277f83970356db 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.server.config;
 import com.tngtech.java.junit.dataprovider.DataProvider;
 import com.tngtech.java.junit.dataprovider.DataProviderRunner;
 import com.tngtech.java.junit.dataprovider.UseDataProvider;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.sonar.api.config.Configuration;
index a1603d4382d3ffab981873bc6d4d058dc9ed6db1..1f7b898deee34e9fa61d02fa37c43b1f99e57488 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.server.es;
 
 import org.junit.Test;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 
 public class DocIdTest {
index 54d043f61d88b396eacd8ed32e6f81ad5e30504d..aae40c01e2761e3bf020663bca88ed9492f0c375 100644 (file)
@@ -28,7 +28,7 @@ import org.junit.runner.RunWith;
 import org.sonar.api.config.internal.MapSettings;
 import org.sonar.server.es.newindex.SettingsConfiguration;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.sonar.server.es.newindex.SettingsConfiguration.newBuilder;
index b560c1e220fc51eaa984538de6bda8c3cdf18177..cb437950e3e75dcbace196b5ed357eee18a867c4 100644 (file)
@@ -26,7 +26,7 @@ import java.util.Locale;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
index e9b3dccc66e6c4883b14d2f9587579f9b53110be..20bfa8f725ce5f55ba4676518545f1c9fd9006ad 100644 (file)
@@ -24,7 +24,7 @@ import java.util.function.BiConsumer;
 import java.util.stream.Stream;
 import org.junit.Test;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Fail.fail;
 
index c21715c9fdb50caebb11d5862f3fd246770c74cc..a30587ba7dd9a3e37805df9fa57e63f469ce50ac 100644 (file)
@@ -27,7 +27,7 @@ import org.sonar.api.config.internal.MapSettings;
 import org.sonar.server.es.Index;
 import org.sonar.server.es.IndexType;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.entry;
index 794ca3c3a9ca5ea845a8dde89d7d045ca5267e70..eab6b8f9d11774671133c60c7f2f853d83db8819 100644 (file)
@@ -33,7 +33,7 @@ import org.sonar.server.es.Index;
 import org.sonar.server.es.IndexType;
 import org.sonar.server.es.IndexType.IndexMainType;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.data.MapEntry.entry;
index 9e79767c5dca67284a6ca1c012e47d48c8df9ba8..643d0d8fdf2f0613d573e1728e6873d4b20e23e9 100644 (file)
@@ -31,7 +31,7 @@ import org.sonar.api.config.internal.MapSettings;
 import org.sonar.server.es.Index;
 import org.sonar.server.es.IndexType;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.entry;
index 47222844b763ab2435b6448ddefda313568926b8..fceb696a323bb8e6254099920f46abeb146db3dd 100644 (file)
@@ -29,7 +29,7 @@ import org.elasticsearch.index.query.QueryBuilder;
 import org.junit.Test;
 import org.sonar.server.es.searchrequest.TopAggregationDefinition.FilterScope;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.elasticsearch.index.query.QueryBuilders.boolQuery;
index 94e1450b1dfe3d1cd981c58c68e4eaf6d885e82d..33485e6219981c25ea45a1a782dc96fd320fcc5d 100644 (file)
@@ -23,7 +23,7 @@ import org.junit.Test;
 import org.sonar.server.es.searchrequest.TopAggregationDefinition.NestedFieldFilterScope;
 import org.sonar.server.es.searchrequest.TopAggregationDefinition.SimpleFieldFilterScope;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
index 9a5c8a877b3927fdbb6cf5f3e35139ea4f178576..cb782d720b46e5a7fe015a4378fbc83bfcfefa8b 100644 (file)
@@ -32,7 +32,7 @@ import org.junit.runner.RunWith;
 
 import static java.util.Collections.emptyList;
 import static java.util.Collections.singletonList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
index 820ea289c79d2c6b51bf131fa372ea06f0e14fe2..159097cf72f0bcc8733cf31516d9bbb717a8d1a6 100644 (file)
@@ -23,7 +23,7 @@ import org.junit.Test;
 import org.sonar.server.es.searchrequest.TopAggregationDefinition.NestedFieldFilterScope;
 import org.sonar.server.es.searchrequest.TopAggregationDefinition.SimpleFieldFilterScope;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
index 08336d47e76fbd968f780b1acf31bb54ea22bc5d..20933384d78aca30e3b982a77abed7d945059f7d 100644 (file)
@@ -23,10 +23,10 @@ import java.util.Random;
 import java.util.Set;
 import java.util.stream.Collectors;
 import java.util.stream.IntStream;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.Test;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
index 15d3944cfeebc5411d69c88cc0af7ba1027d0cf8..2bf3faecea05b661355e34d4f3855dc6ed01fb26 100644 (file)
@@ -28,7 +28,7 @@ import org.elasticsearch.search.aggregations.BucketOrder;
 import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder;
 import org.junit.Test;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonar.server.es.searchrequest.TopAggregationHelperTest.DEFAULT_BUCKET_SIZE;
 
index 2ffbdf8e7e25b113abaa74ea389a33e6f2872d6d..152956666afdc4bb1e192cba00ef46f2292f52ba 100644 (file)
@@ -32,7 +32,7 @@ import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilde
 import org.elasticsearch.search.aggregations.metrics.MinAggregationBuilder;
 import org.junit.Test;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.elasticsearch.index.query.QueryBuilders.boolQuery;
index d6cc42df94ee12609819c9b86a4793dd8b830d6d..de740b2fd9603e8bcc57d4fa30e2e953aebd1ec3 100644 (file)
@@ -27,7 +27,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Random;
 import java.util.Set;
-import org.apache.commons.lang.time.DateUtils;
+import org.apache.commons.lang3.time.DateUtils;
 import org.junit.Test;
 import org.sonar.api.issue.Issue;
 import org.sonar.api.issue.IssueStatus;
index b4068eea333b616099f1e1b3b3ce926cae6662bf..286c39d5a56d02b2a28707ce006c82773cb6e317 100644 (file)
@@ -50,7 +50,7 @@ import org.sonar.server.notification.email.EmailNotificationChannel;
 import org.sonar.server.notification.email.EmailNotificationChannel.EmailDeliveryRequest;
 
 import static java.util.stream.Collectors.toSet;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.anySet;
 import static org.mockito.Mockito.mock;
index 4205cfd7ed9fa2ae0a880ac72f88858e2e0afab7..ad3ab1c94297bf6434804d5a9d0a3e049f67b2b3 100644 (file)
@@ -52,8 +52,8 @@ import org.sonar.test.html.HtmlParagraphAssert;
 import static java.util.stream.Collectors.joining;
 import static java.util.stream.Collectors.toList;
 import static java.util.stream.Collectors.toSet;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
-import static org.apache.commons.lang.StringEscapeUtils.escapeHtml;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.StringEscapeUtils.escapeHtml4;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.Mockito.mock;
@@ -426,9 +426,9 @@ public class ChangesOnMyIssuesEmailTemplateTest {
 
     assertThat(emailMessage.getMessage())
       .doesNotContain(project.getProjectName())
-      .contains(escapeHtml(project.getProjectName()))
+      .contains(escapeHtml4(project.getProjectName()))
       .doesNotContain(ruleName)
-      .contains(escapeHtml(ruleName));
+      .contains(escapeHtml4(ruleName));
 
     String expectedHref = host + "/project/issues?id=" + project.getKey()
       + "&issues=" + changedIssues.stream().map(ChangedIssue::getKey).collect(joining("%2C"));
index 82f837e018e7673fb97cd14401099b789ba78b9a..89c9fef0663bd859446d0cead13454dd545d5a86 100644 (file)
@@ -28,7 +28,7 @@ import org.sonar.server.issue.notification.IssuesChangesNotificationBuilder.Chan
 import org.sonar.server.issue.notification.IssuesChangesNotificationBuilder.User;
 import org.sonar.server.issue.notification.IssuesChangesNotificationBuilder.UserChange;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.sonar.server.issue.notification.IssuesChangesNotificationBuilderTesting.newRandomNotAHotspotRule;
index 43d0af887ae957adc7bc0ca276e61afa1b0bf1ee..b9f193b08ffd3a240b7a6018303e8500b7675cb8 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.server.issue.notification;
 
 import org.junit.Test;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 
 public class EmailMessageTest {
index aae3d2fb1379a3da7783c8d997dc66c61cbd1c6f..fe25236bc074a4a8db83cdd1242a8ebe4899d221 100644 (file)
@@ -47,7 +47,7 @@ import org.sonar.server.notification.email.EmailNotificationChannel.EmailDeliver
 
 import static java.util.Collections.singleton;
 import static java.util.stream.Collectors.toSet;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.fail;
 import static org.mockito.ArgumentMatchers.any;
index 1d38f930124df281c8d3341f939b6fcdae9ac9cb..b3a7700a67170fc506dc06fd9c77f5ac8fa6e863 100644 (file)
@@ -48,13 +48,13 @@ import org.sonar.test.html.HtmlFragmentAssert;
 
 import static java.util.stream.Collectors.joining;
 import static java.util.stream.Collectors.toList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 import static org.sonar.api.rules.RuleType.SECURITY_HOTSPOT;
-import static org.sonar.server.issue.notification.FPOrAcceptedNotification.FpPrAccepted.FP;
 import static org.sonar.server.issue.notification.FPOrAcceptedNotification.FpPrAccepted.ACCEPTED;
+import static org.sonar.server.issue.notification.FPOrAcceptedNotification.FpPrAccepted.FP;
 import static org.sonar.server.issue.notification.IssuesChangesNotificationBuilderTesting.newRandomNotAHotspotRule;
 import static org.sonar.server.issue.notification.IssuesChangesNotificationBuilderTesting.newSecurityHotspotRule;
 import static org.sonar.server.issue.notification.IssuesChangesNotificationBuilderTesting.randomRuleTypeHotspotExcluded;
index 018c6ba9d3fd7f7baf7a77397ba47b1e30770fb9..c9a698b37b47692a20fabce7eef2ea3ccc6fc6a5 100644 (file)
@@ -37,7 +37,7 @@ import org.sonar.server.notification.email.EmailNotificationChannel.EmailDeliver
 import static com.google.common.collect.ImmutableSet.of;
 import static java.util.Collections.emptySet;
 import static java.util.stream.Collectors.toSet;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
index 87f41946fb9266b9e14126fac4e629ba19fddda8..6b85ad907e44c684bb6bc8ae47146acde78ae047 100644 (file)
@@ -36,7 +36,7 @@ import org.sonar.server.notification.email.EmailNotificationChannel.EmailDeliver
 
 import static java.util.Collections.emptySet;
 import static java.util.stream.Collectors.toSet;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
index c7ca17f19eb0bf96e89ceb93e671b93a05a103df..f0ea29d45d4a1a392eac01a0d91738d5d0045cfd 100644 (file)
@@ -36,8 +36,8 @@ import org.sonar.api.utils.Duration;
 import org.sonar.core.issue.DefaultIssue;
 import org.sonar.server.issue.notification.NewIssuesStatistics.Metric;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 
 public class NewIssuesStatisticsTest {
index 76fba84a6124c5b2fd36a7fda00dc503df88819b..aac60df573f8bd90c0e4eadc250297add38280ca 100644 (file)
@@ -28,7 +28,7 @@ import java.util.Date;
 import java.util.List;
 import java.util.stream.Stream;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.time.DateUtils;
+import org.apache.commons.lang3.time.DateUtils;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.sonar.api.issue.Issue;
@@ -38,7 +38,7 @@ import org.sonar.core.issue.FieldDiffs;
 import org.sonar.core.issue.IssueChangeContext;
 import org.sonar.server.issue.IssueFieldsSetter;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonar.api.issue.DefaultTransitions.RESET_AS_TO_REVIEW;
 import static org.sonar.api.issue.DefaultTransitions.RESOLVE_AS_ACKNOWLEDGED;
index 389be0ce3560f3633f0c054c6eb869ccb8dcf63e..52bbc77b44278cedea219a449f26a165b8aa0ded 100644 (file)
@@ -31,7 +31,7 @@ import java.util.Date;
 import java.util.List;
 import java.util.Random;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.time.DateUtils;
+import org.apache.commons.lang3.time.DateUtils;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.sonar.api.issue.DefaultTransitions;
@@ -42,7 +42,7 @@ import org.sonar.core.issue.IssueChangeContext;
 import org.sonar.server.issue.IssueFieldsSetter;
 
 import static com.google.common.base.Preconditions.checkArgument;
-import static org.apache.commons.lang.time.DateUtils.addDays;
+import static org.apache.commons.lang3.time.DateUtils.addDays;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.junit.Assert.fail;
index f3af3adff080125c7499cb1bded2b7521039f98d..b756b7a8342bc3ec7e58c8b08a9e4f82d1d4e6fd 100644 (file)
@@ -25,7 +25,7 @@ import com.tngtech.java.junit.dataprovider.DataProviderRunner;
 import com.tngtech.java.junit.dataprovider.UseDataProvider;
 import java.io.File;
 import java.io.IOException;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
index 9d59c16b3b369d657fab8373c5a39bee2e709d5e..9a2b0d77947e8fcefb29250a5d024e442ccfc186 100644 (file)
@@ -44,8 +44,8 @@ import org.sonar.server.notification.NotificationManager.EmailRecipient;
 import org.sonar.server.notification.NotificationManager.SubscriberPermissionsOnProject;
 
 import static com.google.common.collect.Sets.newHashSet;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.ArgumentMatchers.any;
index f797beb25a42764e0036a50266cbe979b086e692..ee3c11ea8a7e0be4e6ce5a8479d46e49676a9a04 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.server.notification;
 import org.junit.Test;
 import org.sonar.server.notification.NotificationManager.EmailRecipient;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
index 463362972720ec774a40ca192edeeb8dd6ba21db..c95bb9cb3cecf0f1f85c04f10875a8f45488baf1 100644 (file)
@@ -30,7 +30,7 @@ import org.sonar.api.notifications.Notification;
 import org.sonar.db.DbClient;
 import org.sonar.db.property.PropertiesDao;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.ArgumentMatchers.anyCollection;
index 7bc41828c5f4469e16aaf0725ce40de14a79e9ce..567b829639897d7ae8190c1622d392778f257860 100644 (file)
@@ -52,7 +52,7 @@ import org.subethamail.wiser.WiserMessage;
 import static java.util.stream.Collectors.toMap;
 import static java.util.stream.Collectors.toSet;
 import static junit.framework.Assert.fail;
-import static org.apache.commons.lang.RandomStringUtils.random;
+import static org.apache.commons.lang3.RandomStringUtils.random;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
index 9f692d5912b7f47fed24fb344c76944cbfcb2b21..75246618e7c481b74114476c86fa64e1d9014ca3 100644 (file)
@@ -30,7 +30,7 @@ import org.junit.runner.RunWith;
 import org.sonar.server.es.Index;
 import org.sonar.server.es.IndexType;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Fail.fail;
index b6fc87120d23ef4ebfefb93bc2044f068c960d26..e401bd741c8853a05ad1e7bc2f9a7f30c43b6603 100644 (file)
@@ -23,7 +23,7 @@ import com.google.common.collect.ImmutableSet;
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Random;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.Test;
 import org.sonar.api.measures.CoreMetrics;
 import org.sonar.api.measures.Metric.Level;
index 1fbfc38399d2d6e71f0e884a73e9bba09925cc3d..a3b3843bd83075e673545689a5faae4f34b53a9e 100644 (file)
@@ -34,7 +34,7 @@ import org.sonar.server.notification.email.EmailNotificationChannel;
 
 import static java.util.Collections.emptySet;
 import static java.util.stream.Collectors.toSet;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
index 88a6478516f1cf104f64fb7da5ef1ed540c73dc8..0bf3c297dfb48d5445853bd83f2368b6682930e5 100644 (file)
@@ -29,7 +29,7 @@ import org.sonar.api.config.PropertyDefinitions;
 import org.sonar.api.config.internal.MapSettings;
 import org.sonar.api.utils.System2;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
@@ -52,7 +52,7 @@ public class ChildSettingsTest {
     parent.setProperty(randomAlphanumeric(12), RANDOM.nextDouble());
     parent.setProperty(randomAlphanumeric(13), RANDOM.nextFloat());
     parent.setProperty(randomAlphanumeric(14), RANDOM.nextBoolean());
-    parent.setProperty(randomAlphanumeric(15), RANDOM.nextInt());
+    parent.setProperty(randomAlphanumeric(15), RANDOM.nextInt(Integer.MAX_VALUE));
     parent.setProperty(randomAlphanumeric(16), new Date(RANDOM.nextInt()));
     parent.setProperty(randomAlphanumeric(17), new Date(RANDOM.nextInt()), true);
     parent.setProperty(randomAlphanumeric(18), new Date(RANDOM.nextInt()), false);
index 79ede501bd1b4a712ba0fe65aff41fc4b9a6b46f..3c0d9e5c8b969b8d500d8ed77e971d34d0e04479 100644 (file)
@@ -40,7 +40,7 @@ import org.sonar.core.config.CorePropertyDefinitions;
 import static java.util.Collections.emptyMap;
 import static java.util.Collections.unmodifiableMap;
 import static java.util.concurrent.TimeUnit.SECONDS;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.data.MapEntry.entry;
 import static org.mockito.Mockito.doAnswer;
index f1dec7b3b436ccfbbc409a5a7508dbcef01f4b9b..afddb67daa48d21208adf889f5d1956a02ea4b21 100644 (file)
@@ -45,7 +45,7 @@ import org.sonar.db.user.UserTelemetryDto;
 import org.sonar.server.qualitygate.Condition;
 
 import static java.util.stream.Collectors.joining;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
index 340fb9c3776bba7bfb7dee5da42a1d25034cb7c6..76d1ad44e19cc22f6f493e66b50afe5fcfb68515 100644 (file)
@@ -29,7 +29,7 @@ import okhttp3.HttpUrl;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import static org.apache.commons.lang.StringUtils.repeat;
+import static org.apache.commons.lang3.StringUtils.repeat;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonar.server.webhook.HttpUrlHelper.obfuscateCredentials;
 
index fabe9870ed587d1bc133d45b9bf6b2025da4bc63..385cdf137cf35ce809735e4f3dd2f741a275272e 100644 (file)
@@ -41,7 +41,7 @@ import org.sonar.api.utils.Version;
 import org.sonar.core.platform.SonarQubeVersion;
 import org.sonar.server.util.OkHttpClientProvider;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.when;
 import static org.sonar.api.CoreProperties.SONAR_VALIDATE_WEBHOOKS_PROPERTY;
index 1f65868a9bb45b54c569503c0a68b4892bfc637e..813f13aa96ec9a128d2db0169a6a6bcc6995de71 100644 (file)
@@ -39,7 +39,7 @@ import java.util.Random;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.stream.Stream;
-import org.apache.commons.lang.reflect.ConstructorUtils;
+import org.apache.commons.lang3.reflect.ConstructorUtils;
 import org.apache.http.HttpHost;
 import org.elasticsearch.ElasticsearchStatusException;
 import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest;
index cce4446f7de484360a403e25d3d5dd3755ea2900..255ee0ce5f0229d8f48cdd5fc6415d5c00515cbb 100644 (file)
  */
 package org.sonar.server.issue;
 
+import java.security.SecureRandom;
 import java.time.LocalDateTime;
 import java.time.ZoneOffset;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.Random;
 import org.sonar.api.resources.Scopes;
 import org.sonar.api.rule.Severity;
 import org.sonar.api.rules.RuleType;
@@ -31,12 +33,13 @@ import org.sonar.db.component.ComponentDto;
 import org.sonar.server.issue.index.IssueDoc;
 import org.sonar.server.issue.index.IssueScope;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
-import static org.apache.commons.lang.math.RandomUtils.nextInt;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.sonar.api.issue.Issue.STATUS_OPEN;
 
 public class IssueDocTesting {
 
+  private static final Random RANDOM = new SecureRandom();
+
   public static IssueDoc newDoc(ComponentDto componentDto, String projectUuid) {
     return newDoc(Uuids.createFast(), projectUuid, componentDto);
   }
@@ -91,11 +94,11 @@ public class IssueDocTesting {
     doc.setFilePath("filePath_" + randomAlphabetic(5));
     doc.setDirectoryPath("directory_" + randomAlphabetic(5));
     doc.setProjectUuid(Uuids.createFast());
-    doc.setLine(nextInt(1_000) + 1);
+    doc.setLine(RANDOM.nextInt(1_000) + 1);
     doc.setStatus(STATUS_OPEN);
     doc.setResolution(null);
-    doc.setSeverity(Severity.ALL.get(nextInt(Severity.ALL.size())));
-    doc.setEffort((long) nextInt(10));
+    doc.setSeverity(Severity.ALL.get(RANDOM.nextInt(Severity.ALL.size())));
+    doc.setEffort((long) RANDOM.nextInt(10));
     doc.setFuncCreationDate(new Date(System.currentTimeMillis() - 2_000));
     doc.setFuncUpdateDate(new Date(System.currentTimeMillis() - 1_000));
     doc.setFuncCloseDate(null);
index e7c0a6b29d92b27df55de0648e4c0f11f5cbeec9..b9f0d04af2d5e0856aaa33fd89ba5a0c9c5636c1 100644 (file)
@@ -35,7 +35,7 @@ import org.sonar.server.issue.notification.IssuesChangesNotificationBuilder.User
 import org.sonar.server.issue.notification.IssuesChangesNotificationBuilder.UserChange;
 
 import static com.google.common.base.Preconditions.checkArgument;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.sonar.api.rules.RuleType.BUG;
 import static org.sonar.api.rules.RuleType.CODE_SMELL;
 import static org.sonar.api.rules.RuleType.SECURITY_HOTSPOT;
index 520c253a58c6969f941c29cbaffd4d15d5eba84f..dee8b18493ee982e0a6321febd840974b81c34dc 100644 (file)
@@ -39,7 +39,7 @@ import org.sonar.db.rule.RuleParamDto;
 import org.sonar.db.rule.RuleTesting;
 
 import static java.util.stream.Collectors.toList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.anyBoolean;
 import static org.mockito.Mockito.mock;
index 79412f7ba3ebac48bc7a471e9f1c818c8fd0d00e..d15aea6943ccd50d5e0ba34089857281bd307fb2 100644 (file)
@@ -42,7 +42,7 @@ import static org.apache.commons.io.FileUtils.copyFile;
 import static org.apache.commons.io.FileUtils.copyFileToDirectory;
 import static org.apache.commons.io.FileUtils.forceMkdir;
 import static org.apache.commons.io.FileUtils.toFile;
-import static org.apache.commons.lang.StringUtils.substringAfterLast;
+import static org.apache.commons.lang3.StringUtils.substringAfterLast;
 import static org.sonar.core.util.FileUtils.deleteQuietly;
 import static org.sonar.server.exceptions.BadRequestException.checkRequest;
 
index cb83314f637cc0b08fe85d3cbdb979ed3eda4526..d060476bb5dca007dd5269f1d4166c5c3d1a0aad 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.server.util;
 
 import java.util.List;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.PropertyType;
 
 import static org.sonar.server.exceptions.BadRequestException.checkRequest;
index 47d528cc78998dfff439ee989733b6b7d738b210..af1c410d91f288e48cd7f98caf388b62de3ba1ea 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.server.util;
 
 import java.util.List;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.PropertyType;
 
 import static org.sonar.server.exceptions.BadRequestException.checkRequest;
index 18e1d2df26533026a4d8dba4ad186c8bfbfedd74..f34b8117ba9b2a82ef199a81fedead743a046737 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.server.exceptions;
 import java.util.Optional;
 import org.junit.Test;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
 import static org.sonar.server.exceptions.NotFoundException.checkFound;
index 78a420b9d5f3d2bc24c3373e7cb34bdefed7a538..47d9d3a3cabadbe1dc295d2ce485649070442dd8 100644 (file)
@@ -24,7 +24,7 @@ import org.junit.Test;
 import org.sonar.core.platform.PluginInfo;
 import org.sonar.updatecenter.common.Plugin;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
index 3ce3f6f02eb653fc45987ccbac4a16696c5cc619..6b1908b5c865699afa04170c844692f05acb786e 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.server.project;
 import org.junit.Test;
 
 import static java.util.Collections.emptyList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.sonar.db.component.ComponentTesting.newPrivateProjectDto;
index 50845495458a39c02865abb80820526c6fccc03d..68308dcccb7f9241fcbbc6dbe13fdef82034963f 100644 (file)
@@ -29,7 +29,7 @@ import java.util.List;
 import java.util.Random;
 import java.util.Set;
 import java.util.stream.Stream;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.assertj.core.groups.Tuple;
 import org.junit.Before;
 import org.junit.Rule;
index c1e7cba5f1d90f935d462f38d8a4f9e879787f54..3cdfd3b435d704d2a57d0aa7b8d71607ea23236f 100644 (file)
@@ -23,7 +23,7 @@ import com.tngtech.java.junit.dataprovider.DataProvider;
 import com.tngtech.java.junit.dataprovider.DataProviderRunner;
 import com.tngtech.java.junit.dataprovider.UseDataProvider;
 import java.util.Random;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.assertj.core.api.ThrowableAssert.ThrowingCallable;
 import org.junit.Before;
 import org.junit.Test;
@@ -32,7 +32,7 @@ import org.sonar.db.DbClient;
 import org.sonar.db.DbSession;
 import org.sonar.db.property.InternalPropertiesDao;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatNoException;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
index 066b0d84d4d492944cd2c8edd2598e36d7a2bca0..3e469619d0cfa625af810b9c36723b3919329e5b 100644 (file)
@@ -36,7 +36,7 @@ import org.sonar.server.authentication.event.AuthenticationEvent;
 import org.sonar.server.authentication.event.AuthenticationException;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
index 1945ca013dc7489048f6a967fb188d12559db612..fd7f815f31774514ac3b4668ea921c18d102dda4 100644 (file)
@@ -46,7 +46,7 @@ import org.sonar.server.usergroups.DefaultGroupFinder;
 
 import static java.util.Arrays.asList;
 import static java.util.Collections.singletonList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.junit.Assert.assertNotNull;
index 62df289677169cf59ef64762a10b8501a0ea3415..d19a733626031afe607b9c4b143caceb99ba6e06 100644 (file)
@@ -28,7 +28,7 @@ import org.sonar.server.authentication.event.AuthenticationException;
 import org.sonar.server.usertoken.UserTokenAuthentication;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
-import static org.apache.commons.lang.StringUtils.startsWithIgnoreCase;
+import static org.apache.commons.lang3.StringUtils.startsWithIgnoreCase;
 import static org.sonar.server.authentication.event.AuthenticationEvent.Method;
 import static org.sonar.server.authentication.event.AuthenticationEvent.Source;
 
index 297bab6bb6d4bc749c27314ed092293e47b60f0b..45aed30b7b1602801226b61e8225091a7422c79a 100644 (file)
@@ -25,7 +25,7 @@ import javax.annotation.Nullable;
 import javax.annotation.concurrent.Immutable;
 
 import static com.google.common.base.Preconditions.checkArgument;
-import static org.apache.commons.lang.StringUtils.defaultIfEmpty;
+import static org.apache.commons.lang3.StringUtils.defaultIfEmpty;
 
 @Immutable
 public class Credentials {
index 57cffbc61f35c6844c4f01fabe3cb6ee2a7b7724..65ef290d7c4f298d5db00ce59825a10495915a49 100644 (file)
@@ -45,8 +45,8 @@ import org.sonar.server.http.JavaxHttpRequest;
 import org.sonar.server.user.SecurityRealmFactory;
 
 import static java.util.Objects.requireNonNull;
-import static org.apache.commons.lang.StringUtils.isEmpty;
-import static org.apache.commons.lang.StringUtils.trimToNull;
+import static org.apache.commons.lang3.StringUtils.isEmpty;
+import static org.apache.commons.lang3.StringUtils.trimToNull;
 import static org.sonar.server.user.ExternalIdentity.SQ_AUTHORITY;
 
 /**
index 758d0a6296a081597b8e0b0033dbb43a9808e2f8..ebb73be857d8fb2f2419a36eba620bd04d8f113e 100644 (file)
@@ -27,7 +27,7 @@ import java.util.EnumMap;
 import javax.annotation.Nullable;
 import javax.crypto.SecretKeyFactory;
 import javax.crypto.spec.PBEKeySpec;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.mindrot.jbcrypt.BCrypt;
 import org.sonar.api.config.Configuration;
 import org.sonar.db.DbClient;
index c815ade410764fc018926f70956b1ccb9e3f2bed..422f3e4ffd11ad8e7a814662b6ad66602d31865d 100644 (file)
@@ -24,11 +24,11 @@ import java.security.MessageDigest;
 import java.util.Optional;
 import org.apache.commons.codec.digest.HmacAlgorithms;
 import org.apache.commons.codec.digest.HmacUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.sonar.api.config.internal.Encryption;
 import org.sonar.api.config.internal.Settings;
 import org.sonar.api.server.http.HttpRequest;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.sonar.db.DbClient;
 import org.sonar.db.DbSession;
 import org.sonar.db.alm.setting.ALM;
@@ -38,7 +38,7 @@ import org.sonar.server.authentication.event.AuthenticationException;
 import static java.lang.String.format;
 import static java.nio.charset.StandardCharsets.UTF_8;
 import static java.util.stream.Collectors.joining;
-import static org.apache.commons.lang.StringUtils.isEmpty;
+import static org.apache.commons.lang3.StringUtils.isEmpty;
 import static org.sonar.server.user.GithubWebhookUserSession.GITHUB_WEBHOOK_USER_NAME;
 
 public class GithubWebhookAuthentication {
index e42529b74733a16a3d03d6077c1da4fdb4e04d9d..05aebc081e9f37b6c38e61c7161d2b27bbdeaa57 100644 (file)
@@ -29,6 +29,8 @@ import java.util.Locale;
 import java.util.Map;
 import java.util.Optional;
 import javax.annotation.CheckForNull;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.sonar.api.Startable;
 import org.sonar.api.config.Configuration;
 import org.sonar.api.server.authentication.Display;
@@ -37,8 +39,6 @@ import org.sonar.api.server.authentication.UserIdentity;
 import org.sonar.api.server.http.HttpRequest;
 import org.sonar.api.server.http.HttpResponse;
 import org.sonar.api.utils.System2;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.sonar.db.user.UserDto;
 import org.sonar.process.ProcessProperties;
 import org.sonar.server.authentication.event.AuthenticationEvent;
@@ -46,7 +46,7 @@ import org.sonar.server.authentication.event.AuthenticationEvent.Source;
 import org.sonar.server.authentication.event.AuthenticationException;
 import org.sonar.server.exceptions.BadRequestException;
 
-import static org.apache.commons.lang.time.DateUtils.addMinutes;
+import static org.apache.commons.lang3.time.DateUtils.addMinutes;
 import static org.sonar.process.ProcessProperties.Property.SONAR_WEB_SSO_EMAIL_HEADER;
 import static org.sonar.process.ProcessProperties.Property.SONAR_WEB_SSO_ENABLE;
 import static org.sonar.process.ProcessProperties.Property.SONAR_WEB_SSO_GROUPS_HEADER;
index a91973e658af7089f67c96b8e296cab24f619a45..dcc22a382eb5547b6b9a3fe5c2d6a58a205c30d7 100644 (file)
@@ -24,12 +24,12 @@ import java.security.SecureRandom;
 import java.util.Set;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.server.http.HttpRequest;
 import org.sonar.api.server.http.HttpResponse;
 import org.sonar.server.authentication.event.AuthenticationException;
 
-import static org.apache.commons.lang.StringUtils.isBlank;
+import static org.apache.commons.lang3.StringUtils.isBlank;
 import static org.sonar.server.authentication.Cookies.SAMESITE_LAX;
 import static org.sonar.server.authentication.Cookies.SET_COOKIE;
 import static org.sonar.server.authentication.Cookies.newCookieBuilder;
index f7bf8a13640b50ae3c8b8258da3cdfb68adf24c0..c97bc1b7f9b916151290c411de988d5a8c59838d 100644 (file)
@@ -39,8 +39,8 @@ import org.sonar.db.user.UserDto;
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static java.util.Objects.requireNonNull;
-import static org.apache.commons.lang.StringUtils.isEmpty;
-import static org.apache.commons.lang.time.DateUtils.addSeconds;
+import static org.apache.commons.lang3.StringUtils.isEmpty;
+import static org.apache.commons.lang3.time.DateUtils.addSeconds;
 import static org.sonar.process.ProcessProperties.Property.WEB_SESSION_TIMEOUT_IN_MIN;
 import static org.sonar.server.authentication.Cookies.SAMESITE_LAX;
 import static org.sonar.server.authentication.Cookies.SET_COOKIE;
index 695130a73c2c2cd5df0517ff68a59700bca4ef80..842ed888040f61e5c228911442119053053fe175 100644 (file)
@@ -23,13 +23,13 @@ import java.util.Collection;
 import java.util.HashSet;
 import java.util.Locale;
 import java.util.Optional;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.sonar.api.config.Configuration;
 import org.sonar.api.server.authentication.Display;
 import org.sonar.api.server.authentication.IdentityProvider;
 import org.sonar.api.server.authentication.UserIdentity;
 import org.sonar.api.server.http.HttpRequest;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.sonar.auth.ldap.LdapAuthenticationResult;
 import org.sonar.auth.ldap.LdapAuthenticator;
 import org.sonar.auth.ldap.LdapGroupsProvider;
@@ -41,8 +41,8 @@ import org.sonar.server.authentication.event.AuthenticationEvent;
 import org.sonar.server.authentication.event.AuthenticationEvent.Source;
 import org.sonar.server.authentication.event.AuthenticationException;
 
-import static org.apache.commons.lang.StringUtils.isEmpty;
-import static org.apache.commons.lang.StringUtils.trimToNull;
+import static org.apache.commons.lang3.StringUtils.isEmpty;
+import static org.apache.commons.lang3.StringUtils.trimToNull;
 
 public class LdapCredentialsAuthentication {
 
index edec18bea68c933de4d285319565ccfe9471924a..cc195be9739c07a8b6cd931bc8573e951520aa40 100644 (file)
  */
 package org.sonar.server.authentication;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.LoggerFactory;
 import org.sonar.api.Startable;
 import org.sonar.api.platform.Server;
 import org.sonar.api.server.authentication.OAuth2IdentityProvider;
-import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 
 public class LogOAuthWarning implements Startable {
index bab926a57597a7c244234860ea99b80ffd1ed16f..59f9aebfb11fba92a2cabc18f1256ada9d097f9e 100644 (file)
@@ -29,7 +29,7 @@ import org.sonar.server.authentication.event.AuthenticationException;
 
 import static java.lang.String.format;
 import static org.apache.commons.codec.digest.DigestUtils.sha256Hex;
-import static org.apache.commons.lang.StringUtils.isBlank;
+import static org.apache.commons.lang3.StringUtils.isBlank;
 import static org.sonar.server.authentication.Cookies.findCookie;
 import static org.sonar.server.authentication.Cookies.newCookieBuilder;
 import static org.sonar.server.authentication.event.AuthenticationEvent.Source;
index 1e6c2d6ba579c22ca6658aceefb76599419cc065..d8ef581bd13626b4c07260d118dcaa3cb85c197b 100644 (file)
@@ -25,7 +25,7 @@ import java.net.URI;
 import java.net.URL;
 import java.nio.charset.StandardCharsets;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.internal.apachecommons.lang.StringEscapeUtils;
 import org.sonar.api.platform.Server;
 import org.sonar.api.server.http.HttpRequest;
index a8f85aee96640f1d19c926b317cf5a0b46a653cc..1cbb469704a49adf3cf5cf5eaae11c8a4e6faf84 100644 (file)
@@ -37,7 +37,7 @@ import org.sonar.server.user.TokenUserSession;
 import org.sonar.server.user.UserSession;
 
 import static java.net.HttpURLConnection.HTTP_UNAUTHORIZED;
-import static org.apache.commons.lang.StringUtils.defaultString;
+import static org.apache.commons.lang3.StringUtils.defaultString;
 import static org.sonar.api.CoreProperties.CORE_FORCE_AUTHENTICATION_DEFAULT_VALUE;
 import static org.sonar.api.CoreProperties.CORE_FORCE_AUTHENTICATION_PROPERTY;
 import static org.sonar.api.utils.DateUtils.formatDateTime;
index a916c63c10405c6765d012270cc927369327d86f..dc3272940757d6aa84e11262ca151cc0f934fa8a 100644 (file)
@@ -20,7 +20,7 @@
 package org.sonar.server.user;
 
 import java.util.Optional;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.config.Configuration;
 import org.sonar.api.server.ws.Request;
 
index 467c79674297ce8e19b9c33c3a64c0c9846b80bc..91b8919880bdd37975e2050933b775f22b65b9b6 100644 (file)
@@ -20,7 +20,7 @@
 package org.sonar.server.user;
 
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.sonar.api.Startable;
index 4adeeb4ac2d8384d38b8303b3abafa2b1582ba0a..cfb1ef88084ffe4632d281ed94b51856bebd3a85 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.server.user;
 import java.util.Objects;
 import java.util.Optional;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.Startable;
 import org.sonar.api.config.Configuration;
 import org.sonar.api.server.ServerSide;
index 206e58fd5a48d1bbab93112b21fb3f58cc53e22c..d0ec42ad224a4ba22b88ee285f625a18f9444b9b 100644 (file)
@@ -21,16 +21,17 @@ package org.sonar.server.user;
 
 import com.google.common.base.Joiner;
 import com.google.common.base.Strings;
+import java.security.SecureRandom;
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Objects;
 import java.util.Optional;
+import java.util.Random;
 import java.util.function.Consumer;
 import java.util.regex.Pattern;
 import javax.annotation.Nullable;
 import javax.inject.Inject;
-import org.apache.commons.lang.math.RandomUtils;
 import org.sonar.api.config.Configuration;
 import org.sonar.api.platform.NewUserHandler;
 import org.sonar.api.server.ServerSide;
@@ -56,7 +57,6 @@ import static org.sonar.server.exceptions.BadRequestException.checkRequest;
 
 @ServerSide
 public class UserUpdater {
-
   private static final String SQ_AUTHORITY = "sonarqube";
 
   private static final String LOGIN_PARAM = "Login";
@@ -76,6 +76,8 @@ public class UserUpdater {
   private final DefaultGroupFinder defaultGroupFinder;
   private final AuditPersister auditPersister;
   private final CredentialsLocalAuthentication localAuthentication;
+  private final Random random = new SecureRandom();
+
 
   @Inject
   public UserUpdater(NewUserNotifier newUserNotifier, DbClient dbClient, DefaultGroupFinder defaultGroupFinder, Configuration config,
@@ -183,7 +185,7 @@ public class UserUpdater {
   private String generateUniqueLogin(DbSession dbSession, String userName) {
     String slugName = slugify(userName);
     for (int i = 0; i < 10; i++) {
-      String login = slugName + RandomUtils.nextInt(100_000);
+      String login = slugName + random.nextInt(100_000);
       UserDto existingUser = dbClient.userDao().selectByLogin(dbSession, login);
       if (existingUser == null) {
         return login;
index f6ddb55c49a1f0d8bf48c8ba1b5ff00e0b435f24..3896d63069af685f4e9b3529ea40f711ec62398f 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.server.usertoken;
 
 import java.util.Optional;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.server.http.HttpRequest;
 import org.sonar.db.DbClient;
 import org.sonar.db.DbSession;
@@ -34,7 +34,7 @@ import org.sonar.server.authentication.event.AuthenticationEvent;
 import org.sonar.server.authentication.event.AuthenticationException;
 import org.sonar.server.exceptions.NotFoundException;
 
-import static org.apache.commons.lang.StringUtils.startsWithIgnoreCase;
+import static org.apache.commons.lang3.StringUtils.startsWithIgnoreCase;
 import static org.sonar.api.utils.DateUtils.formatDateTime;
 import static org.sonar.server.authentication.BasicAuthentication.extractCredentialsFromHeader;
 
index 973cb1f18028e774551e8b98080d989c055c2c1f..ff4f4a313e462e6199d0ceee73ca9af37fc858a2 100644 (file)
@@ -36,8 +36,8 @@ import org.sonar.api.utils.System2;
 import org.sonar.server.authentication.JwtSerializer.JwtSession;
 import org.sonar.server.authentication.event.AuthenticationException;
 
-import static org.apache.commons.lang.time.DateUtils.addMinutes;
-import static org.apache.commons.lang.time.DateUtils.addYears;
+import static org.apache.commons.lang3.time.DateUtils.addMinutes;
+import static org.apache.commons.lang3.time.DateUtils.addYears;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.sonar.server.authentication.event.AuthenticationEvent.Source;
index 0a712410fcfa94eadc14e7ea02abffefd4f3dfa6..67cf9b7f874d34c9f0369bdb985c07ba6bf7f033 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.server.permission;
 import org.junit.Test;
 import org.sonar.db.user.GroupDto;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 
 public class GroupUuidOrAnyoneTest {
index 726d5c034633ae7da58b922d0cf3b14332bebb13..87305574b03f56c046fbdb7ab133a629f4c6fdea 100644 (file)
 package org.sonar.server.language;
 
 import com.google.common.collect.Collections2;
-import org.apache.commons.lang.StringUtils;
+import java.util.Arrays;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.resources.AbstractLanguage;
 import org.sonar.api.resources.Language;
 import org.sonar.api.resources.Languages;
 import org.sonar.core.util.NonNullInputFunction;
 
-import java.util.Arrays;
-
 public class LanguageTesting {
 
   public static Language newLanguage(String key, String name, final String... prefixes) {
index 25d1a4977aa0ce7cf9d15adc93a760bbfe15ee20..52521d0d765977553c2ea53013548fc4e59a4ecd 100644 (file)
@@ -39,7 +39,7 @@ import org.sonar.server.management.ManagedInstanceService;
 import org.sonar.server.setting.ThreadLocalSettings;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.StringUtils.isNotBlank;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
 import static org.sonar.alm.client.gitlab.GitlabGlobalSettingsValidator.ValidationMode.AUTH_ONLY;
 import static org.sonar.alm.client.gitlab.GitlabGlobalSettingsValidator.ValidationMode.COMPLETE;
 import static org.sonar.api.utils.Preconditions.checkState;
index f64553b4ecb8340267a7d7ac4c91e2a4383d9ede..eb854e16c4d8e2c13015c0f1bfd73370d51b5671 100644 (file)
@@ -30,7 +30,7 @@ import java.util.function.Function;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.issue.impact.SoftwareQuality;
 import org.sonar.api.rule.RuleKey;
 import org.sonar.api.rule.RuleStatus;
index 952a46b4a428afaf8509c0ff27a3781985c87501..5d7608bd76810db5b7d9d161de39642f83b0cb88 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.server.common.user;
 
 import java.util.function.Supplier;
 import javax.inject.Inject;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.sonar.db.DbClient;
 import org.sonar.db.DbSession;
 import org.sonar.db.user.UserDto;
index 3bedfb0686209f53c56528957d1e8a1fbb78e9f0..b61267214b2062963c2993dfa0b31b6ee52c843c 100644 (file)
@@ -60,7 +60,7 @@ import org.sonar.server.usergroups.DefaultGroupFinder;
 
 import static java.lang.String.format;
 import static java.util.function.Function.identity;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatNoException;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
index b83e5faaacced6e1c9096d7536cda07d93b4eeda..a68c4121dea2c5051fea1e78d1dfc559fa11cc18 100644 (file)
@@ -31,7 +31,7 @@ import org.sonar.server.health.Health;
 
 import static java.util.stream.Collectors.toSet;
 import static java.util.stream.Stream.of;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.sonar.process.cluster.health.NodeHealth.Status.GREEN;
 import static org.sonar.process.cluster.health.NodeHealth.Status.RED;
 import static org.sonar.process.cluster.health.NodeHealth.Status.YELLOW;
index 72ae80f9f635be9993206a4e18644ad719e2a171..5a18f084a5dca59d52c3b391f943b6dc2c667bc7 100644 (file)
@@ -31,7 +31,7 @@ import org.sonar.server.common.health.EsStatusClusterCheck;
 import org.sonar.server.es.EsClient;
 import org.sonar.server.health.Health;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
index 44c584b06b2a5f722b61d70a1db967958ada78b0..e7cb5a6f6f67e8eb5cc3371b9e1c26e0855f2a6b 100644 (file)
@@ -39,7 +39,7 @@ import org.sonar.db.property.PropertyDto;
 import org.sonar.server.platform.NodeInformation;
 import org.sonar.server.property.InternalProperties;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.fail;
index 6c5b9f337156848fff3f1fd3393fab44ea8d00a8..30914150e481d3811778b2d470a771bf3ccdbb90 100644 (file)
@@ -93,7 +93,7 @@ import static java.lang.String.format;
 import static java.lang.String.valueOf;
 import static java.util.Collections.emptySet;
 import static java.util.Collections.singletonList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.tuple;
index 63b2486f302a13d8c5712fe251de09af50d7c750..762aaec40f83757c54bce10fc7dc25df4f8295a7 100644 (file)
@@ -74,7 +74,7 @@ import org.sonar.server.telemetry.TelemetryData.ProjectStatistics;
 import org.sonar.updatecenter.common.Version;
 
 import static java.util.Arrays.asList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.entry;
 import static org.assertj.core.groups.Tuple.tuple;
index 81cd75a3dbb13cd62b742faf77bb136af4bdd4bd..cc530b0e9469e245e3281674ad89272c8cde4220 100644 (file)
@@ -55,7 +55,7 @@ import static java.util.Arrays.stream;
 import static java.util.Collections.emptySet;
 import static java.util.stream.Stream.concat;
 import static java.util.stream.Stream.of;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.eq;
index e4c6d48c3f11e2d874c713f8d5e2eca76a056edf..50b0c782242390a673b767a2e32c3bb1894b5249 100644 (file)
@@ -34,8 +34,8 @@ import org.sonar.process.logging.LogLevelConfig;
 import org.sonar.process.logging.RootLoggerConfig;
 import org.sonar.server.log.ServerProcessLogging;
 
-import static org.apache.commons.lang.StringUtils.EMPTY;
-import static org.apache.commons.lang.StringUtils.isBlank;
+import static org.apache.commons.lang3.StringUtils.EMPTY;
+import static org.apache.commons.lang3.StringUtils.isBlank;
 import static org.sonar.process.ProcessId.WEB_SERVER;
 import static org.sonar.process.ProcessProperties.Property.LOG_JSON_OUTPUT;
 import static org.sonar.process.logging.AbstractLogHelper.PREFIX_LOG_FORMAT;
index cf640682f7a5d66a0463428b4e028c13b9e25b5b..1c521a3bf8263182b2af4bba3da6b36b157a1620 100644 (file)
@@ -20,8 +20,8 @@
 package org.sonar.server.platform;
 
 import java.util.Optional;
-import org.apache.commons.lang.builder.ReflectionToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
+import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
 import org.sonar.api.Startable;
 import org.sonar.api.config.Configuration;
 import org.sonar.api.platform.ServerUpgradeStatus;
index c7686054e5bc2901cb7098730e0224d3ee7d018b..6d3a94305d5940548904627ec1191be58c13f9b3 100644 (file)
@@ -25,15 +25,15 @@ import java.sql.DriverManager;
 import java.sql.SQLException;
 import org.h2.Driver;
 import org.h2.tools.Server;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.sonar.api.Startable;
 import org.sonar.api.config.Configuration;
 import org.sonar.api.utils.System2;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static java.lang.String.format;
-import static org.apache.commons.lang.StringUtils.isNotEmpty;
+import static org.apache.commons.lang3.StringUtils.isNotEmpty;
 import static org.sonar.process.ProcessProperties.Property.JDBC_EMBEDDED_PORT;
 import static org.sonar.process.ProcessProperties.Property.JDBC_PASSWORD;
 import static org.sonar.process.ProcessProperties.Property.JDBC_URL;
index cb2099b924b6c464e4a1e89ceae1c1613a2845b5..053d5a11532606e79a9d245946ee9956b5797a2c 100644 (file)
@@ -24,7 +24,7 @@ import org.sonar.api.Startable;
 import org.sonar.api.config.Configuration;
 import org.sonar.api.utils.System2;
 
-import static org.apache.commons.lang.StringUtils.startsWith;
+import static org.apache.commons.lang3.StringUtils.startsWith;
 import static org.sonar.process.ProcessProperties.Property.JDBC_URL;
 
 public class EmbeddedDatabaseFactory implements Startable {
index 0530d90def391c3ef71dd985a9c2683d43d4813d..380e0206dfdd87b93789bd84575a1999ce565b0a 100644 (file)
@@ -40,8 +40,8 @@ import org.sonar.process.systeminfo.protobuf.ProtobufSystemInfo.Section.Builder;
 import org.sonar.server.platform.NodeInformation;
 
 import static java.util.stream.Collectors.toUnmodifiableSet;
-import static org.apache.commons.lang.StringUtils.containsIgnoreCase;
-import static org.apache.commons.lang.StringUtils.endsWithIgnoreCase;
+import static org.apache.commons.lang3.StringUtils.containsIgnoreCase;
+import static org.apache.commons.lang3.StringUtils.endsWithIgnoreCase;
 import static org.sonar.process.ProcessProperties.Property.AUTH_JWT_SECRET;
 import static org.sonar.process.ProcessProperties.Property.CE_JAVA_ADDITIONAL_OPTS;
 import static org.sonar.process.ProcessProperties.Property.CE_JAVA_OPTS;
index 2951a33ee2ca4d04260acbf03ce6dc084e2afbea..e75c1abdf1219df1644d251d1de3331c2503c8e7 100644 (file)
@@ -23,7 +23,7 @@ import com.google.common.annotations.VisibleForTesting;
 import java.nio.charset.StandardCharsets;
 import java.util.Locale;
 import java.util.zip.CRC32;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.config.Configuration;
 import org.sonar.core.platform.ServerId;
 
index b75048648c1254f7d42b751c2c1bac47af7553ee..f5081e04b9a60daadfe9abc1fa27a0511150adc9 100644 (file)
@@ -33,8 +33,8 @@ import org.sonar.server.platform.NodeInformation;
 import org.sonar.server.property.InternalProperties;
 
 import static com.google.common.base.Preconditions.checkState;
-import static org.apache.commons.lang.StringUtils.isEmpty;
-import static org.apache.commons.lang.StringUtils.isNotEmpty;
+import static org.apache.commons.lang3.StringUtils.isEmpty;
+import static org.apache.commons.lang3.StringUtils.isNotEmpty;
 import static org.sonar.api.CoreProperties.SERVER_ID;
 import static org.sonar.server.property.InternalProperties.SERVER_ID_CHECKSUM;
 
index c2e254233d5e6ce63f23ed03d43723b3d8837935..62cbfb70a8c889b27051caae38546f3624a6eaa7 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.server.platform.web.logging;
 import javax.annotation.Nullable;
 import org.slf4j.MDC;
 
-import static org.apache.commons.lang.StringUtils.isBlank;
+import static org.apache.commons.lang3.StringUtils.isBlank;
 
 public class EntrypointMDCStorage implements AutoCloseable {
   public static final String ENTRYPOINT_MDC_KEY = "ENTRYPOINT";
index 3620cce79ecdf0291c41dc41eedd935e78333b8a..586bdc4c1aee6e6c91f455978fdb020089ca218b 100644 (file)
@@ -28,7 +28,7 @@ import org.sonar.db.rule.RuleDescriptionSectionDto;
 
 import static java.util.Collections.emptySet;
 import static java.util.Collections.singleton;
-import static org.apache.commons.lang.StringUtils.isNotEmpty;
+import static org.apache.commons.lang3.StringUtils.isNotEmpty;
 import static org.sonar.api.rules.RuleType.BUG;
 import static org.sonar.api.rules.RuleType.CODE_SMELL;
 import static org.sonar.api.rules.RuleType.VULNERABILITY;
index 49664e6d51b691430fa2be7eb90cc59d284607df..f19717a8e27f686de0db0eb670be0a55cec38d73 100644 (file)
@@ -31,7 +31,7 @@ import org.sonar.db.issue.ImpactDto;
 import org.sonar.db.rule.RuleDto;
 import org.sonar.server.rule.RuleDescriptionSectionsGeneratorResolver;
 
-import static org.apache.commons.lang.StringUtils.isNotEmpty;
+import static org.apache.commons.lang3.StringUtils.isNotEmpty;
 
 public class NewRuleCreator {
 
index b86603b0cc2bdfb8a5b27b17e86e0f340c1a6435..db27410fb1925f3c7e06c27c4c02077231a2dbe9 100644 (file)
@@ -28,7 +28,7 @@ import java.util.Set;
 import java.util.stream.Collectors;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.issue.impact.Severity;
 import org.sonar.api.issue.impact.SoftwareQuality;
 import org.sonar.api.rule.RuleStatus;
@@ -56,7 +56,7 @@ import org.sonar.server.rule.RuleDescriptionSectionsGeneratorResolver;
 import static com.google.common.collect.Sets.difference;
 import static java.lang.String.format;
 import static java.util.Collections.emptySet;
-import static org.apache.commons.lang.StringUtils.isNotEmpty;
+import static org.apache.commons.lang3.StringUtils.isNotEmpty;
 
 /**
  * The class detects changes between the rule definition coming from plugins during startup and rule from database.
index e3d08d21fccf66c9fe9f304e02e962da9b891032..91ec66094350cc018aa6951eb9e5e444403540f3 100644 (file)
@@ -26,7 +26,7 @@ import java.io.OutputStreamWriter;
 import java.io.Writer;
 import java.nio.charset.StandardCharsets;
 import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.CharUtils;
+import org.apache.commons.lang3.CharUtils;
 import org.sonar.api.Startable;
 import org.sonar.api.server.ServerSide;
 import org.sonar.api.utils.log.Logger;
index 5cb53e47c57d026ddd253f6993ea66a3cf10afac..6b422f4ba7f209dbe7f864d82ecd9fdeacbc58ff 100644 (file)
@@ -33,7 +33,7 @@ import org.sonar.db.newcodeperiod.NewCodePeriodType;
 import org.sonar.process.systeminfo.protobuf.ProtobufSystemInfo;
 import org.sonar.server.platform.NodeInformation;
 
-import static org.apache.commons.lang.StringUtils.repeat;
+import static org.apache.commons.lang3.StringUtils.repeat;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
index 2e1c3f5cf4b2ccd4f2ab4fd259a4caa517e7b815..cc1dd1047ffee3ba2550e72aa5b502e6a048d4df 100644 (file)
@@ -31,7 +31,7 @@ import org.sonar.api.config.Configuration;
 import org.sonar.api.config.internal.MapSettings;
 import org.sonar.core.platform.ServerId;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.Mockito.mock;
index 9f62a6e25665a65b9136641d0ca9e2b4f6158b6c..311ccad5dd3ebce0c181b46f7439586883bb9dcb 100644 (file)
@@ -28,7 +28,7 @@ import org.sonar.api.server.rule.RulesDefinition;
 import org.sonar.db.rule.DeprecatedRuleKeyDto;
 import org.sonar.server.rule.registration.SingleDeprecatedRuleKey;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.groups.Tuple.tuple;
 import static org.mockito.Mockito.mock;
index 3440a7b01273f285918407acc0296e3fe4d1081e..211bbc6836e5c7405cb25b6d13462d18344e6d83 100644 (file)
@@ -23,7 +23,7 @@ import java.util.Date;
 import javax.annotation.CheckForNull;
 import org.sonar.api.platform.Server;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 
 class FakeServer extends Server {
   private String id;
index f75136522afeb3f3b8c70d6c5d02b0e309f5f9b5..4d613f04d93423f4112aca28608aff342e3b8405 100644 (file)
@@ -24,7 +24,7 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Set;
 import java.util.stream.Collectors;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
 import org.elasticsearch.action.admin.indices.settings.get.GetSettingsRequest;
 import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequest;
@@ -35,10 +35,10 @@ import org.elasticsearch.client.indices.GetIndexRequest;
 import org.elasticsearch.client.indices.PutMappingRequest;
 import org.elasticsearch.cluster.health.ClusterHealthStatus;
 import org.elasticsearch.common.settings.Settings;
-import org.sonar.api.Startable;
-import org.sonar.api.server.ServerSide;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.sonar.api.Startable;
+import org.sonar.api.server.ServerSide;
 import org.sonar.server.es.metadata.EsDbCompatibility;
 import org.sonar.server.es.metadata.MetadataIndex;
 import org.sonar.server.es.metadata.MetadataIndexDefinition;
index 13f9ebe5724960d7366b4589b3d6d92197a41fa8..27a2b3e560e9329e0ef952c2df2c306f71293bb7 100644 (file)
@@ -22,14 +22,15 @@ package org.sonar.server.es;
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.collect.ListMultimap;
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
+import java.security.SecureRandom;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Random;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
-import org.apache.commons.lang.math.RandomUtils;
 import org.sonar.api.Startable;
 import org.sonar.api.config.Configuration;
 import org.sonar.api.utils.System2;
@@ -68,6 +69,8 @@ public class RecoveryIndexer implements Startable {
   private final long minAgeInMs;
   private final long loopLimit;
 
+  private final Random random = new SecureRandom();
+
   public RecoveryIndexer(System2 system2, Configuration config, DbClient dbClient, ResilientIndexer... indexers) {
     this.system2 = system2;
     this.config = config;
@@ -87,7 +90,7 @@ public class RecoveryIndexer implements Startable {
 
     // in the cluster mode, avoid (but not prevent!) simultaneous executions of recovery
     // indexers so that a document is not handled multiple times.
-    long initialDelayInMs = getSetting(PROPERTY_INITIAL_DELAY, RandomUtils.nextInt(1 + (int) (delayInMs / 2)));
+    long initialDelayInMs = getSetting(PROPERTY_INITIAL_DELAY, random.nextInt(1 + (int) (delayInMs / 2)));
 
     executorService.scheduleAtFixedRate(
       this::recover,
index 79b9982ffa6d7d18c0a6d4a05343c6cf44fb34d8..ca890e63e4921d97632fa02107d38ec5a9fe3e3d 100644 (file)
@@ -39,7 +39,7 @@ import java.util.stream.IntStream;
 import java.util.stream.Stream;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.lucene.search.join.ScoreMode;
 import org.elasticsearch.action.search.SearchRequest;
 import org.elasticsearch.action.search.SearchResponse;
index b712c5be6cb2f816c4bb154a3daff16751b5da93..2a9816cace7f33aa84babd5c70b8aa1cbb3d5349 100644 (file)
@@ -28,7 +28,7 @@ import java.util.Optional;
 import java.util.Set;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.builder.ReflectionToStringBuilder;
+import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
 import org.sonar.db.rule.RuleDto;
 
 /**
index 8a982b76466b274951d68d60110858e3590a0c67..4671118117d50ab6a7c056abc52bff02730386a6 100644 (file)
@@ -40,8 +40,8 @@ import java.util.Optional;
 import java.util.Set;
 import java.util.stream.Collectors;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.BooleanUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.jetbrains.annotations.NotNull;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
index 0a4b036a9c33f11207a7e18968a25c788127c785..7aca8b928dd89ec0b16d57d75b6d0336f53deaa0 100644 (file)
@@ -23,7 +23,7 @@ import java.util.Arrays;
 import java.util.Locale;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.stream.Stream;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.elasticsearch.index.query.BoolQueryBuilder;
 import org.elasticsearch.index.query.MatchQueryBuilder;
 import org.elasticsearch.index.query.QueryBuilder;
index 7e05d61da41b2876d8743f388ea3c4290e3431e9..73444a3a10d077fa800b54e59094299c5b47dd13 100644 (file)
@@ -29,7 +29,7 @@ import org.sonar.db.DbClient;
 import org.sonar.server.es.Index;
 import org.sonar.server.es.IndexType;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.mock;
index 1bc0f6deb434a00d07526f9342c2ce2bb95bcb82..e505cc3504281c54cf5e98e146eefdb9af37b8c9 100644 (file)
@@ -28,7 +28,7 @@ import org.sonar.db.component.ComponentDto;
 import static java.util.Arrays.asList;
 import static java.util.Collections.emptyList;
 import static java.util.Collections.singletonList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.tuple;
 import static org.sonar.db.component.ComponentTesting.newBranchComponent;
index 2d98b68b1fbf6fd5880fcf32f0d891806fe51d39..89f9d5900078b1054fd19d50030fd75d2752020c 100644 (file)
@@ -44,7 +44,7 @@ import org.sonar.server.tester.UserSessionRule;
 
 import static java.util.Arrays.asList;
 import static java.util.Collections.singletonList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.tuple;
index bcde07c91cea9928c835559859b0ce631bad3af0..baf693c63bea74b3ff2bcdecc934e36a8a96c819 100644 (file)
@@ -33,7 +33,7 @@ import java.util.function.Predicate;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.jetbrains.annotations.NotNull;
 import org.sonar.api.rule.RuleKey;
 import org.sonar.api.server.ServerSide;
index db00b3846d8e64aa223309212edda725636b72d3..cea9b9855cbafb455976b5ba3def9010cf8b15c4 100644 (file)
 package org.sonar.server.pushapi.qualityprofile;
 
 import java.nio.charset.StandardCharsets;
+import java.security.SecureRandom;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Deque;
 import java.util.List;
+import java.util.Random;
 import java.util.Set;
 import java.util.function.Consumer;
 import org.junit.Rule;
@@ -46,8 +48,7 @@ import org.sonar.server.qualityprofile.ActiveRuleChange;
 import org.sonarqube.ws.Common;
 
 import static java.util.List.of;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
-import static org.apache.commons.lang.math.RandomUtils.nextInt;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonar.api.measures.CoreMetrics.NCLOC_LANGUAGE_DISTRIBUTION_KEY;
 import static org.sonar.api.measures.Metric.ValueType.STRING;
@@ -57,6 +58,8 @@ import static org.sonar.server.qualityprofile.ActiveRuleChange.Type.ACTIVATED;
 
 public class QualityProfileChangeEventServiceImplTest {
 
+  private final Random random = new SecureRandom();
+
   @Rule
   public DbTester db = DbTester.create();
 
@@ -226,7 +229,7 @@ public class QualityProfileChangeEventServiceImplTest {
       .setMetricUuid(metric.getUuid())
       .setComponentUuid(branch.uuid())
       .setProjectUuid(projectDto.getUuid())
-      .setData(language + "=" + nextInt(10));
+      .setData(language + "=" + random.nextInt(10));
 
     db.measures().insertLiveMeasure(branch, metric, configureLiveMeasure);
   }
index d9c30bb8c5c4329fd7af9a37ef85d42e851eab9a..d88fc9d8642b9bf37987b169019e6135422a0fdb 100644 (file)
@@ -24,7 +24,7 @@ import java.util.List;
 import java.util.Optional;
 import java.util.Set;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.server.common.gitlab.config.GitlabConfiguration;
 import org.sonar.server.common.gitlab.config.GitlabConfigurationService;
 import org.sonar.server.common.gitlab.config.ProvisioningType;
index f2c691afdd358ec877833006f0d57b24e9207ada..1ddecc7a5248eb5fcc3880132721a6dbefcd4b6d 100644 (file)
  */
 package org.sonar.server.almintegration.ws.bitbucketserver;
 
+import java.security.SecureRandom;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.Optional;
+import java.util.Random;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Rule;
@@ -67,8 +69,7 @@ import org.sonar.server.ws.WsActionTester;
 import org.sonarqube.ws.Projects;
 
 import static java.util.Objects.requireNonNull;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
-import static org.apache.commons.lang.math.JVMRandom.nextLong;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatNoException;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -105,6 +106,8 @@ public class ImportBitbucketServerProjectActionIT {
     mock(PermissionTemplateService.class), new FavoriteUpdater(db.getDbClient()), new TestIndexers(), new SequenceUuidFactory(),
     defaultBranchNameResolver, mock(PermissionUpdater.class), mock(PermissionService.class));
 
+  private final Random random = new SecureRandom();
+
   private final ImportHelper importHelper = new ImportHelper(db.getDbClient(), userSession);
   private final ProjectKeyGenerator projectKeyGenerator = mock(ProjectKeyGenerator.class);
   private final WsActionTester ws = new WsActionTester(new ImportBitbucketServerProjectAction(db.getDbClient(), userSession,
@@ -517,7 +520,7 @@ public class ImportBitbucketServerProjectActionIT {
     bbsResult.setProject(project);
     bbsResult.setSlug(randomAlphanumeric(5));
     bbsResult.setName(randomAlphanumeric(5));
-    bbsResult.setId(nextLong(100));
+    bbsResult.setId(random.nextLong(100));
     when(bitbucketServerRestClient.getRepo(any(), any(), any(), any())).thenReturn(bbsResult);
     when(bitbucketServerRestClient.getBranches(any(), any(), any(), any())).thenReturn(branchesList);
     return bbsResult;
@@ -526,7 +529,7 @@ public class ImportBitbucketServerProjectActionIT {
   private Project getGsonBBSProject() {
     return new Project()
       .setKey(randomAlphanumeric(5))
-      .setId(nextLong(100))
+      .setId(random.nextLong(100))
       .setName(randomAlphanumeric(5));
   }
 
index 8bae45e0fdeb057923547268343fd24de62fd676..fb6533fa52bbf743cc6e7a08a9771795f43226d7 100644 (file)
@@ -60,7 +60,7 @@ import org.sonarqube.ws.Projects;
 
 import static java.util.Collections.emptyList;
 import static java.util.Collections.singletonList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatNoException;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
index 560119cdba50340217d3d0f8b5701e5f753c2042..8c6b73256363f0f0c04fa5af15c29cfccb5e9c24 100644 (file)
@@ -48,7 +48,7 @@ import org.sonar.server.ws.TestRequest;
 import org.sonar.server.ws.WsActionTester;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.groups.Tuple.tuple;
index abad855cd904901f931a5b91d3124d1df1f43174..15ad123446b6eca8bf1b875a8a53c45ff4c9306c 100644 (file)
@@ -53,7 +53,7 @@ import org.sonar.server.ws.TestRequest;
 import org.sonar.server.ws.TestResponse;
 import org.sonar.server.ws.WsActionTester;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.tuple;
index 5dffcafd40da85fcb80dba337093bb2e7f1d5942..d4e58e87ad6b64d08f118b4effe52645e118dadd 100644 (file)
@@ -51,7 +51,7 @@ import org.sonar.server.tester.UserSessionRule;
 import org.sonar.server.ws.TestResponse;
 import org.sonar.server.ws.WsActionTester;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.tuple;
index 97edaa41626be1e0d14c219b776cf3fc915753f0..623c04f0f8134c302bde965459a45c4ee1aeef77 100644 (file)
@@ -62,7 +62,7 @@ import org.sonar.server.project.ws.ProjectCreator;
 import org.sonar.server.tester.UserSessionRule;
 
 import static java.util.Collections.emptyMap;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.junit.Assert.fail;
index 903206b9f7c44d78d87a02679dd50602fe56211a..08cd3c65d6193d22fc1690985d17b3f6bb43d75d 100644 (file)
@@ -23,7 +23,7 @@ import java.util.Date;
 import java.util.List;
 import java.util.stream.IntStream;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.Rule;
 import org.junit.Test;
 import org.sonar.api.server.ws.WebService.Param;
@@ -38,13 +38,13 @@ import org.sonar.db.ce.CeActivityDto.Status;
 import org.sonar.db.ce.CeQueueDto;
 import org.sonar.db.ce.CeTaskCharacteristicDto;
 import org.sonar.db.ce.CeTaskMessageDto;
-import org.sonar.db.dismissmessage.MessageType;
 import org.sonar.db.ce.CeTaskTypes;
 import org.sonar.db.component.BranchType;
 import org.sonar.db.component.ComponentDto;
 import org.sonar.db.component.PortfolioData;
 import org.sonar.db.component.ProjectData;
 import org.sonar.db.component.SnapshotDto;
+import org.sonar.db.dismissmessage.MessageType;
 import org.sonar.server.exceptions.BadRequestException;
 import org.sonar.server.exceptions.ForbiddenException;
 import org.sonar.server.exceptions.NotFoundException;
index 580629340747b60e1dc7c320a6241ca8c59c071d..32d2033afe3de269dfc9b27ad14f4b283ff16b70 100644 (file)
@@ -52,7 +52,7 @@ import org.sonarqube.ws.Common;
 import org.sonarqube.ws.MediaTypes;
 
 import static java.util.Collections.emptyList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.tuple;
index e98eda41ca08337cd924cbfeee4c9e49eb5a7a92..e8bddb90dc75ded4305aafb9fda118e93d609e6d 100644 (file)
@@ -53,7 +53,7 @@ import org.sonarqube.ws.Ce;
 import org.sonarqube.ws.Common;
 
 import static java.util.Collections.singleton;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.sonar.api.web.UserRole.ADMIN;
index 78dbc052f894bc5348853070cc2f4a45de4fd811..11077edd3e443f109884827d7b55c4b1558afbac 100644 (file)
@@ -60,7 +60,7 @@ import org.sonar.server.permission.index.PermissionIndexer;
 import org.sonar.server.project.DefaultBranchNameResolver;
 
 import static java.util.stream.IntStream.rangeClosed;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.ArgumentMatchers.any;
index ad952a7e58b278f580da6ea187432d5e74a5094a..e5e5fd83504dc822151c046abab7a4a33aab05fa 100644 (file)
@@ -19,7 +19,7 @@
  */
 package org.sonar.server.component.ws;
 
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -37,7 +37,7 @@ import org.sonar.server.tester.UserSessionRule;
 import org.sonar.server.ws.TestRequest;
 import org.sonar.server.ws.WsActionTester;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.sonar.api.measures.CoreMetrics.COVERAGE_KEY;
index 641a83fae585ad8ac79a6547109ce097a915185d..35beb3c850aa2dce34f88b77380ad57911772462 100644 (file)
@@ -42,7 +42,7 @@ import org.sonar.server.ws.WsActionTester;
 import org.sonarqube.ws.Components.Component;
 import org.sonarqube.ws.Components.ShowWsResponse;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.tuple;
index 5e837c22d13809847dbaad774df13461bf1cd691..a8708689fc0cf9acad04f3ff7f5a73904e8c648e 100644 (file)
@@ -56,7 +56,7 @@ import static java.util.Collections.singletonList;
 import static java.util.Optional.ofNullable;
 import static java.util.stream.Collectors.joining;
 import static java.util.stream.IntStream.range;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.groups.Tuple.tuple;
 import static org.mockito.Mockito.doReturn;
index 89e44b2efeeea978b164050c31371f1ddaf5e1a8..66c26815102ae8fd2886a75febc40cb23584f41b 100644 (file)
@@ -19,7 +19,9 @@
  */
 package org.sonar.server.developers.ws;
 
+import java.security.SecureRandom;
 import java.util.Date;
+import java.util.Random;
 import java.util.stream.IntStream;
 import java.util.stream.Stream;
 import org.junit.Rule;
@@ -51,9 +53,7 @@ import org.sonarqube.ws.Developers.SearchEventsWsResponse;
 import org.sonarqube.ws.Developers.SearchEventsWsResponse.Event;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
-import static org.apache.commons.lang.math.RandomUtils.nextInt;
-import static org.apache.commons.lang.math.RandomUtils.nextLong;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.tuple;
@@ -87,6 +87,7 @@ public class SearchEventsActionIT {
   private IssueIndexer issueIndexer = new IssueIndexer(es.client(), db.getDbClient(), new IssueIteratorFactory(db.getDbClient()), null);
   private WsActionTester ws = new WsActionTester(new SearchEventsAction(db.getDbClient(), userSession, server, issueIndex,
     issueIndexSyncProgressChecker));
+  private final Random random = new SecureRandom();
 
   @Test
   public void definition() {
@@ -270,11 +271,11 @@ public class SearchEventsActionIT {
     queueDto.setTaskType(CeTaskTypes.REPORT);
     queueDto.setComponentUuid(mainBranchUuid);
     queueDto.setUuid(randomAlphanumeric(40));
-    queueDto.setCreatedAt(nextLong());
+    queueDto.setCreatedAt(random.nextLong(Long.MAX_VALUE));
     CeActivityDto activityDto = new CeActivityDto(queueDto);
     activityDto.setStatus(status);
-    activityDto.setExecutionTimeMs(nextLong());
-    activityDto.setExecutedAt(nextLong());
+    activityDto.setExecutionTimeMs(random.nextLong(Long.MAX_VALUE));
+    activityDto.setExecutedAt(random.nextLong(Long.MAX_VALUE));
     activityDto.setAnalysisUuid(analysis.getUuid());
     db.getDbClient().ceActivityDao().insert(db.getSession(), activityDto);
     db.commit();
@@ -301,6 +302,6 @@ public class SearchEventsActionIT {
   }
 
   private RuleType randomRuleTypeExceptHotspot() {
-    return RULE_TYPES_EXCEPT_HOTSPOT[nextInt(RULE_TYPES_EXCEPT_HOTSPOT.length)];
+    return RULE_TYPES_EXCEPT_HOTSPOT[random.nextInt(RULE_TYPES_EXCEPT_HOTSPOT.length)];
   }
 }
index 9c52ce42eed61a06d84b89b54363fcfd1f235d1e..e9212dfe7bb273d46a44ae81cf4547380b9f65d8 100644 (file)
@@ -21,7 +21,9 @@ package org.sonar.server.developers.ws;
 
 import java.io.UnsupportedEncodingException;
 import java.net.URLEncoder;
+import java.security.SecureRandom;
 import java.util.Date;
+import java.util.Random;
 import java.util.stream.Stream;
 import org.junit.Rule;
 import org.junit.Test;
@@ -48,9 +50,7 @@ import org.sonarqube.ws.Developers.SearchEventsWsResponse.Event;
 
 import static java.lang.String.format;
 import static java.nio.charset.StandardCharsets.UTF_8;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
-import static org.apache.commons.lang.math.RandomUtils.nextInt;
-import static org.apache.commons.lang.math.RandomUtils.nextLong;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.tuple;
 import static org.mockito.Mockito.mock;
@@ -81,6 +81,7 @@ public class SearchEventsActionNewIssuesIT {
   private IssueIndexSyncProgressChecker issueIndexSyncProgressChecker = mock(IssueIndexSyncProgressChecker.class);
   private WsActionTester ws = new WsActionTester(new SearchEventsAction(db.getDbClient(), userSession, server, issueIndex,
     issueIndexSyncProgressChecker));
+  private final Random random = new SecureRandom();
 
   @Test
   public void issue_event() {
@@ -306,11 +307,11 @@ public class SearchEventsActionNewIssuesIT {
     queueDto.setTaskType(CeTaskTypes.REPORT);
     queueDto.setComponentUuid(mainBranchUuid);
     queueDto.setUuid(randomAlphanumeric(40));
-    queueDto.setCreatedAt(nextLong());
+    queueDto.setCreatedAt(random.nextLong(Long.MAX_VALUE));
     CeActivityDto activityDto = new CeActivityDto(queueDto);
     activityDto.setStatus(status);
-    activityDto.setExecutionTimeMs(nextLong());
-    activityDto.setExecutedAt(nextLong());
+    activityDto.setExecutionTimeMs(random.nextLong(Long.MAX_VALUE));
+    activityDto.setExecutedAt(random.nextLong(Long.MAX_VALUE));
     activityDto.setAnalysisUuid(analysis.getUuid());
     db.getDbClient().ceActivityDao().insert(db.getSession(), activityDto);
     db.commit();
@@ -318,6 +319,6 @@ public class SearchEventsActionNewIssuesIT {
   }
 
   private RuleType randomRuleTypeExceptHotspot() {
-    return RULE_TYPES_EXCEPT_HOTSPOT[nextInt(RULE_TYPES_EXCEPT_HOTSPOT.length)];
+    return RULE_TYPES_EXCEPT_HOTSPOT[random.nextInt(RULE_TYPES_EXCEPT_HOTSPOT.length)];
   }
 }
index 938909cafd93457002979dbeef5efb198f9c5489..31fa46f1827a11837bb4cb6344cb42bc3af2fcda 100644 (file)
@@ -40,7 +40,7 @@ import org.sonarqube.ws.Developers.SearchEventsWsResponse.Event;
 
 import static java.lang.String.format;
 import static java.lang.String.join;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.tuple;
 import static org.mockito.Mockito.mock;
index 4b88913d261b0a1acdd072160a0691a862c0b05c..7b788ae0be4336e1ee3634232db5a1db53fcfe44 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.server.duplication.ws;
 import com.google.common.collect.Iterables;
 import java.util.List;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.Rule;
 import org.junit.Test;
 import org.sonar.db.DbTester;
@@ -31,7 +31,7 @@ import org.sonar.db.component.ComponentDto;
 import org.sonar.server.component.ComponentFinder;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonar.db.component.ComponentTesting.newFileDto;
 
index 1f4e83953c1ed20c9a91ae30c54be7160bc95489..07306cae74d7a5e5cddcfb2d5870d8a305861160 100644 (file)
@@ -40,7 +40,7 @@ import org.sonar.server.ws.TestResponse;
 import org.sonar.server.ws.WsActionTester;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.sonar.db.component.BranchType.PULL_REQUEST;
index 691b8687e14062267ba072a61a8649e712fa58f8..4ee0dd0aef954d6ff38c53236afd3602828849cc 100644 (file)
@@ -32,7 +32,7 @@ import org.sonar.db.component.ComponentDto;
 import org.sonar.test.JsonAssert;
 
 import static com.google.common.collect.Lists.newArrayList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.sonar.db.component.BranchType.PULL_REQUEST;
 import static org.sonar.db.component.ComponentTesting.newDirectory;
 import static org.sonar.db.component.ComponentTesting.newFileDto;
index 0bb0d320ccc23188177131c363bea7b9dcae863e..67822c7a3d303e4bfc791afc5042166824d627dd 100644 (file)
@@ -52,7 +52,7 @@ import org.sonar.server.tester.UserSessionRule;
 import org.sonar.server.ws.TestRequest;
 import org.sonar.server.ws.WsActionTester;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.ArgumentMatchers.any;
index 5abf8a6be163d6a7acfc0d550c1d96b1809edd23..c1a2186966911c373e3ef59e2cdb2535ca5f7bd7 100644 (file)
@@ -65,7 +65,7 @@ import org.sonar.server.tester.UserSessionRule;
 import org.sonar.server.ws.TestRequest;
 import org.sonar.server.ws.WsActionTester;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatNoException;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
index 9b303c9a89a336a11df783b74c0c0ac62dcc2dec..44af6e704722d30d681de85eda4a2dd8ed573779 100644 (file)
@@ -65,7 +65,7 @@ import org.sonar.server.tester.UserSessionRule;
 import org.sonar.server.ws.TestRequest;
 import org.sonar.server.ws.WsActionTester;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.ArgumentMatchers.any;
index b05627c6cb367509551a5e2ffab1fcb245b77181..ff29ff985faaa44f0b8aca243b873c8ca12ece09 100644 (file)
@@ -88,8 +88,8 @@ import static java.util.Collections.singleton;
 import static java.util.stream.Collectors.joining;
 import static java.util.stream.Collectors.toList;
 import static java.util.stream.Collectors.toSet;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.groups.Tuple.tuple;
index fdf51e7af2ab46bfedd7558ede437d67c955664f..66c2cb4026ab5e8f9ffe2cc7aa683e829404d0bf 100644 (file)
@@ -86,8 +86,8 @@ import org.sonarqube.ws.Common.User;
 import org.sonarqube.ws.Hotspots;
 
 import static java.util.Collections.emptySet;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.tuple;
index d0b026e4aecae3b9556ca3d52860441f6567d057..9103fc33a68fc994c71e7b6138a315469e339bff 100644 (file)
@@ -57,7 +57,7 @@ import org.sonarqube.ws.Common.Comment;
 
 import static java.util.Collections.emptySet;
 import static java.util.Collections.singleton;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.tuple;
 import static org.sonar.api.utils.DateUtils.formatDateTime;
index b2a51271387c77c83563f5e4e26e30b855819bc6..993d5b9abbfee7a283effe4fb277ecc2c36cbb8d 100644 (file)
@@ -57,7 +57,7 @@ import org.sonarqube.ws.Issues;
 
 import static java.lang.String.format;
 import static java.util.stream.Collectors.toList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.groups.Tuple.tuple;
index cd73645cb397f014f7fc0e4c285176b9c38ab521..634f923fd93dc751a80a16f33c497b40fa4fce89 100644 (file)
@@ -59,7 +59,7 @@ import org.sonarqube.ws.Issues.Component;
 import org.sonarqube.ws.Issues.Issue;
 import org.sonarqube.ws.Issues.SearchWsResponse;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.tuple;
 import static org.sonar.api.resources.Qualifiers.APP;
index 856923416cb9e01f96c666ef29a1d2c8d3831906..85340b82b7e52cb003d035c055b62758bff7bbbf 100644 (file)
@@ -98,7 +98,7 @@ import org.sonarqube.ws.Issues.SearchWsResponse;
 
 import static java.util.Arrays.asList;
 import static java.util.Collections.singletonList;
-import static org.apache.commons.lang.StringUtils.EMPTY;
+import static org.apache.commons.lang3.StringUtils.EMPTY;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.groups.Tuple.tuple;
index bbd89eeaabae7f530f5846999ebba8ca2e1157ca..2f45dd6f765b5ebeaee7331dcc7743616dfff658 100644 (file)
@@ -19,7 +19,7 @@
  */
 package org.sonar.server.metric.ws;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.Rule;
 import org.junit.Test;
 import org.sonar.api.server.ws.Change;
index faa36ea16c992ad78f1598e2f3bb06b0b56cf096..10c8f1a57de005c7f31b5a820079085312a4374b 100644 (file)
@@ -20,7 +20,7 @@
 package org.sonar.server.permission;
 
 import java.util.Set;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
index 12842f859407ae57f5a5f28ec07d7ecdd01b03d9..f98ff2ae425613de0d0d2cd440d55c3462b06070 100644 (file)
@@ -20,7 +20,7 @@
 package org.sonar.server.permission;
 
 import java.util.Set;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
index 2043fde9b644062e08a80e720bc6c5af38674a97..2f06dfb3795126838919bc221d919a717f0da746 100644 (file)
@@ -45,7 +45,7 @@ import org.sonar.server.permission.RequestValidator;
 
 import static java.util.function.Function.identity;
 import static java.util.stream.Collectors.toMap;
-import static org.apache.commons.lang.StringUtils.countMatches;
+import static org.apache.commons.lang3.StringUtils.countMatches;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.ArgumentMatchers.any;
index fd556ad3ff07838fcfa1c9f2def3d78ba47e4a2d..52f93e53f5cc9190a1ea5689dce20a9d4965d38e 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.server.permission.ws.template;
 
 import java.util.Collections;
 import java.util.List;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.Before;
 import org.junit.Test;
 import org.sonar.api.resources.Qualifiers;
index e88eb57bcfefb679f0c00ab47af438d1b0ba4c3a..bc0e669f2adb95929ccfe190639f44ef217be199 100644 (file)
 package org.sonar.server.project.ws;
 
 import java.net.HttpURLConnection;
+import java.security.SecureRandom;
 import java.util.Arrays;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Random;
 import java.util.Set;
 import java.util.stream.Collectors;
 import java.util.stream.IntStream;
 import java.util.stream.Stream;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.math.RandomUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.joda.time.DateTime;
 import org.junit.Rule;
 import org.junit.Test;
@@ -84,6 +85,7 @@ public class BulkDeleteActionIT {
   private final ComponentCleanerService componentCleanerService = mock(ComponentCleanerService.class);
   private final DbClient dbClient = db.getDbClient();
   private final ProjectLifeCycleListeners projectLifeCycleListeners = mock(ProjectLifeCycleListeners.class);
+  private final Random random = new SecureRandom();
 
   private final BulkDeleteAction underTest = new BulkDeleteAction(componentCleanerService, dbClient, userSession, projectLifeCycleListeners);
   private final WsActionTester ws = new WsActionTester(underTest);
@@ -291,7 +293,7 @@ public class BulkDeleteActionIT {
     userSession.logIn().addPermission(ADMINISTER);
 
     Date now = new Date();
-    Date futureDate = new DateTime(now).plusDays(RandomUtils.nextInt() + 1).toDate();
+    Date futureDate = new DateTime(now).plusDays(random.nextInt(1, Integer.MAX_VALUE)).toDate();
     ComponentDto project1 = db.components().insertPublicProject().getMainBranchComponent();
     db.getDbClient().snapshotDao().insert(db.getSession(), newAnalysis(project1).setCreatedAt(now.getTime()));
     ComponentDto project2 = db.components().insertPublicProject().getMainBranchComponent();
index da0e0d67406f06aae18cbc7ba7d29b5d650d3a92..382f8184d1864c066bc9ede937c7afaa1074f1af 100644 (file)
@@ -19,7 +19,7 @@
  */
 package org.sonar.server.projectanalysis.ws;
 
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.Rule;
 import org.junit.Test;
 import org.sonar.api.server.ws.WebService;
index 465a337a614a563cf56bb012704088131ecf8890..ac280fb969ebe109812c5a87332db7da4a6d5790 100644 (file)
@@ -40,7 +40,7 @@ import org.sonarqube.ws.ProjectAnalyses;
 import org.sonarqube.ws.ProjectAnalyses.UpdateEventResponse;
 
 import static java.util.Optional.ofNullable;
-import static org.apache.commons.lang.StringUtils.repeat;
+import static org.apache.commons.lang3.StringUtils.repeat;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.sonar.db.component.SnapshotTesting.newAnalysis;
index 681749b526ee58dbf66d6d012d0ee7c468a75562..9ea7905b9a0df9c7a1ad2a40c905efce07d0a306 100644 (file)
@@ -19,7 +19,7 @@
  */
 package org.sonar.server.projectlink.ws;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.Rule;
 import org.junit.Test;
 import org.sonar.api.server.ws.WebService;
index 70974dd79759f56affc0e3cac75ce43dc8fd526b..bad2353ba3fd2c5fa93b175da48d47c8a986a9c7 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.server.qualitygate.ws;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
 import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -50,7 +50,7 @@ import org.sonarqube.ws.Qualitygates.ProjectStatusResponse;
 import org.sonarqube.ws.Qualitygates.ProjectStatusResponse.Status;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.tuple;
index 00510c71134ef0050ec58b775c76893c7423047c..4a7f1c31d4ccbb9d6bed733318788dd5c1bdede6 100644 (file)
@@ -64,7 +64,7 @@ import static java.util.Arrays.asList;
 import static java.util.Collections.emptyMap;
 import static java.util.Collections.singleton;
 import static java.util.Collections.singletonList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.junit.Assert.fail;
index c86118ceef14e33b4194e40ec6f19ae1694a3446..a94ff75156ce7c2ab6fb8c5b7a15818441a01bbb 100644 (file)
@@ -71,8 +71,7 @@ import org.sonar.server.util.TypeValidations;
 
 import static com.google.common.base.Preconditions.checkState;
 import static java.util.Collections.singleton;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
-import static org.apache.commons.lang.math.RandomUtils.nextLong;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.tuple;
 import static org.mockito.ArgumentMatchers.any;
@@ -362,8 +361,8 @@ public class RegisterQualityProfilesNotificationIT {
       .setProfileUuid(profile.getUuid())
       .setSeverity(severity.name())
       .setRuleUuid(rule.getUuid())
-      .setCreatedAt(nextLong())
-      .setUpdatedAt(nextLong());
+      .setCreatedAt(RANDOM.nextLong(Long.MAX_VALUE))
+      .setUpdatedAt(RANDOM.nextLong(Long.MAX_VALUE));
     db.getDbClient().activeRuleDao().insert(db.getSession(), dto);
     db.commit();
   }
index b8e206fed267132410d01ed6e10f7b3949cb2d55..0cb0b6a809b94df11ca684486a3f75b1aac430c1 100644 (file)
@@ -47,7 +47,7 @@ import org.sonar.server.ws.TestRequest;
 import org.sonar.server.ws.TestResponse;
 import org.sonar.server.ws.WsActionTester;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.ArgumentMatchers.any;
index aecf7a2af6646896611cb7bda6ba53da646bd05f..0eb7b35b42bc0128972904bf15e0786a9660a680 100644 (file)
@@ -37,7 +37,7 @@ import org.sonar.server.tester.UserSessionRule;
 import org.sonar.server.ws.TestRequest;
 import org.sonar.server.ws.WsActionTester;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.ArgumentMatchers.any;
index 416dec44a94155cd18e22d447e8bed8179be8330..6712cd354c7b28cb7d678bfb72717c0ad731cf8d 100644 (file)
@@ -65,7 +65,7 @@ import org.sonar.server.ws.WsActionTester;
 import org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters;
 
 import static java.util.Arrays.asList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.Mockito.mock;
index ce2dd1cea500bb59435b0aa74a3e25909117c825..6fed4869d8e5c553d44aec205810913fb299a7aa 100644 (file)
@@ -19,7 +19,7 @@
  */
 package org.sonar.server.qualityprofile.ws;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.Rule;
 import org.junit.Test;
 import org.sonar.api.issue.impact.SoftwareQuality;
index 3f05e83859bccc96a3c04074782efb1eeebc6211..fbb963c029e12d5f973388ea51a72007007c6626 100644 (file)
@@ -44,7 +44,7 @@ import org.sonar.server.ws.TestRequest;
 import org.sonar.server.ws.TestResponse;
 import org.sonar.server.ws.WsActionTester;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.ArgumentMatchers.any;
index 37add93ad632d476427e62a9aff7e983f7d2c4a1..ca95745839dcbc83f681f72ec45605af1b5f8574 100644 (file)
@@ -36,7 +36,7 @@ import org.sonar.server.tester.UserSessionRule;
 import org.sonar.server.ws.TestRequest;
 import org.sonar.server.ws.WsActionTester;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.ArgumentMatchers.any;
index d694db40feba3fc7c62e2c49f6db943938180477..f80ecd0106c00481a2f2ef86f95517a7a41a4107 100644 (file)
@@ -23,7 +23,7 @@ import java.io.IOException;
 import java.io.Reader;
 import java.io.Writer;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.Rule;
 import org.junit.Test;
 import org.sonar.api.profiles.ProfileExporter;
index 2cb0ccec8368e8a1f59f789a85aa9723636df59d..cfd07ec45505b3ab19ecc940d97ad3b81d041a9a 100644 (file)
@@ -89,7 +89,7 @@ import static java.util.Arrays.stream;
 import static java.util.Collections.emptySet;
 import static java.util.Collections.singleton;
 import static java.util.Collections.singletonList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.tuple;
index 6e1da84d3f7fa9e902aecb26722f48577403ade5..65ff0b8fc14df2a61d594d96546694b35970b9e6 100644 (file)
@@ -49,7 +49,7 @@ import org.sonar.server.ws.TestResponse;
 import org.sonar.server.ws.WsActionTester;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.mock;
index ee1064f23c3de28a30ea58d6c70189f56b71a651..65d673385d2e5f9740fa9df63eebc5cc8ce8df3b 100644 (file)
@@ -35,7 +35,7 @@ import org.sonar.server.tester.UserSessionRule;
 import org.sonar.server.ws.WsActionTester;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.sonar.db.component.ComponentTesting.newFileDto;
index 330410eef375fb360cc9f34d6e5a751bac0c0894..6d699f34f3bc5d2aaf3650f6e49644187ae455f9 100644 (file)
@@ -46,7 +46,7 @@ import org.sonar.server.tester.UserSessionRule;
 import org.sonar.server.ws.WsActionTester;
 import org.sonarqube.ws.Users.CurrentWsResponse;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
index 14e443de3cfa4820af900fea0eb63ddccf6554a4..81be9933807e263d9c6bf304a04c8ac8a8e92ee5 100644 (file)
@@ -33,7 +33,7 @@ import org.sonar.server.ws.TestResponse;
 import org.sonar.server.ws.WsActionTester;
 
 import static javax.servlet.http.HttpServletResponse.SC_NO_CONTENT;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.sonar.server.user.ws.SetHomepageAction.PARAM_COMPONENT;
index 410f6a39acafaee29ba063b73d3a3b2335bf66bb..d6131cc723dce281c8d4f16d70a8c3b3033d2b0d 100644 (file)
@@ -19,7 +19,7 @@
  */
 package org.sonar.server.usergroups.ws;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
index 65c5f44cc99fff612e0d31e966e7004610c7134d..fd93ae5190d8828cdc974604e1a07c1d117ae673 100644 (file)
@@ -45,7 +45,7 @@ import org.sonarqube.ws.MediaTypes;
 
 import static java.util.function.Function.identity;
 import static java.util.stream.Collectors.toMap;
-import static org.apache.commons.lang.StringUtils.capitalize;
+import static org.apache.commons.lang3.StringUtils.capitalize;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
index b4ab75de8532bd25182179f8e66b059de05ff513..4a84afdc9f4d9d6b5aa84ef8a8fc37007cfc68fa 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.server.almintegration.ws;
 
 import com.google.common.annotations.VisibleForTesting;
 import java.util.List;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.core.util.UuidFactory;
 
 import static com.google.common.collect.Lists.asList;
index 9f1ee1c7a0bbf73f54be3cacfd858a407c2f930c..97d102ba8aed28e32ef3dcb7a3be89b03e549cca 100644 (file)
@@ -53,7 +53,7 @@ import static java.util.Comparator.comparing;
 import static java.util.Objects.requireNonNull;
 import static java.util.stream.Collectors.toMap;
 import static java.util.stream.Collectors.toSet;
-import static org.apache.commons.lang.StringUtils.containsIgnoreCase;
+import static org.apache.commons.lang3.StringUtils.containsIgnoreCase;
 import static org.sonar.db.permission.GlobalPermission.PROVISION_PROJECTS;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
 
index ed472e7ec55ab2cc44fa895b85ca26cf92edd684..d41261a976bbd9f60c03789116a0d7b2f8776c2f 100644 (file)
@@ -28,7 +28,7 @@ import org.sonar.db.DbSession;
 import org.sonar.db.alm.setting.AlmSettingDto;
 import org.sonar.server.user.UserSession;
 
-import static org.apache.commons.lang.StringUtils.removeEnd;
+import static org.apache.commons.lang3.StringUtils.removeEnd;
 import static org.sonar.db.alm.setting.ALM.GITHUB;
 
 public class CreateGithubAction implements AlmSettingsWsAction {
index 13a493f3ba2ed2dd66ea274da5e785fd71e3b521..8ac0ee634ba05a960bc8da1537a87cc5ba5b643e 100644 (file)
@@ -19,7 +19,7 @@
  */
 package org.sonar.server.almsettings.ws;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.server.ws.Change;
 import org.sonar.api.server.ws.Request;
 import org.sonar.api.server.ws.Response;
index fe3347676e1941b681b25b61da253cea50523e37..3a2cdafd8f6ffe1b5ba18facb043809784e602b4 100644 (file)
@@ -28,7 +28,7 @@ import org.sonar.db.DbSession;
 import org.sonar.db.alm.setting.AlmSettingDto;
 import org.sonar.server.user.UserSession;
 
-import static org.apache.commons.lang.StringUtils.isNotBlank;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
 import static org.sonar.server.projectlink.ws.ProjectLinksWsParameters.PARAM_URL;
 
 public class UpdateAzureAction implements AlmSettingsWsAction {
index fc2bc34beab35683229199c030b429137b308fd5..e7d330729f19e255f3962e175d241e3351c1cc71 100644 (file)
@@ -28,7 +28,7 @@ import org.sonar.db.DbSession;
 import org.sonar.db.alm.setting.AlmSettingDto;
 import org.sonar.server.user.UserSession;
 
-import static org.apache.commons.lang.StringUtils.isNotBlank;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
 
 public class UpdateBitbucketAction implements AlmSettingsWsAction {
 
index 76c03aa7ec174d88c584f1325d560d47c5e5389f..23c41a7b8c20fb641a35be0faf38b7faef73bcf0 100644 (file)
@@ -27,7 +27,7 @@ import org.sonar.db.DbSession;
 import org.sonar.db.alm.setting.AlmSettingDto;
 import org.sonar.server.user.UserSession;
 
-import static org.apache.commons.lang.StringUtils.isNotBlank;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
 
 public class UpdateBitbucketCloudAction implements AlmSettingsWsAction {
 
index fd1473d804cedc5759a9ba62d7b1871f801d2a37..f3b4c310129ad14b1c65adc89f21f5e651b7f489 100644 (file)
@@ -28,9 +28,9 @@ import org.sonar.db.DbSession;
 import org.sonar.db.alm.setting.AlmSettingDto;
 import org.sonar.server.user.UserSession;
 
-import static org.apache.commons.lang.StringUtils.isBlank;
-import static org.apache.commons.lang.StringUtils.isNotBlank;
-import static org.apache.commons.lang.StringUtils.removeEnd;
+import static org.apache.commons.lang3.StringUtils.isBlank;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
+import static org.apache.commons.lang3.StringUtils.removeEnd;
 
 public class UpdateGithubAction implements AlmSettingsWsAction {
 
index 4e1e08acd37a84bd67cd4175b99eb09d52607313..d197fddbbf1ff7f91a3441c09c259edd4a704c1f 100644 (file)
@@ -19,7 +19,7 @@
  */
 package org.sonar.server.almsettings.ws;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.server.ws.Change;
 import org.sonar.api.server.ws.Request;
 import org.sonar.api.server.ws.Response;
@@ -29,7 +29,7 @@ import org.sonar.db.DbSession;
 import org.sonar.db.alm.setting.AlmSettingDto;
 import org.sonar.server.user.UserSession;
 
-import static org.apache.commons.lang.StringUtils.isNotBlank;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
 
 public class UpdateGitlabAction implements AlmSettingsWsAction {
 
index 71f4c3444bd39cdb318fda3d2343c1cfb5bc61ca..316665f8294a22ded77aa13b14c9a26fdf3925c1 100644 (file)
@@ -38,7 +38,7 @@ import org.sonar.server.ws.ServletFilterHandler;
 
 import static java.net.HttpURLConnection.HTTP_BAD_REQUEST;
 import static java.net.HttpURLConnection.HTTP_UNAUTHORIZED;
-import static org.apache.commons.lang.StringUtils.isEmpty;
+import static org.apache.commons.lang3.StringUtils.isEmpty;
 import static org.sonar.server.authentication.event.AuthenticationEvent.Method;
 import static org.sonar.server.authentication.event.AuthenticationEvent.Source;
 import static org.sonar.server.authentication.ws.AuthenticationWs.AUTHENTICATION_CONTROLLER;
index c810cb91a4ce6efd443e498cf287fbaba327fb00..251284a47807ce29cb33aa7c0c062b52bd3457cc 100644 (file)
@@ -25,7 +25,7 @@ import java.text.NumberFormat;
 import java.util.Locale;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.StringUtils.trim;
+import static org.apache.commons.lang3.StringUtils.trim;
 
 class SvgFormatter {
 
index 259bea7c1fe7f46cfcdb555df2a2ef55a7b807e2..5a71ad54a9e738a9eaaaa17d9f377ea6ea7c7368 100644 (file)
@@ -23,7 +23,7 @@ import com.google.common.collect.ImmutableMap;
 import java.io.IOException;
 import java.util.Map;
 import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.text.StrSubstitutor;
+import org.apache.commons.lang3.text.StrSubstitutor;
 import org.sonar.api.measures.Metric;
 import org.sonar.api.server.ServerSide;
 
index 2fa9934bee9bd18bc97f2b22eb112092a2f5915d..ead0a300f6ea226460ffbb43124b3639ba03112e 100644 (file)
@@ -28,8 +28,8 @@ import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.FilenameUtils;
 import org.apache.commons.io.filefilter.FileFilterUtils;
 import org.apache.commons.io.filefilter.HiddenFileFilter;
-import org.apache.commons.lang.CharUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.CharUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.Startable;
 import org.sonar.api.server.ServerSide;
 import org.sonar.server.exceptions.NotFoundException;
index 001b5f691df58b9f35dc14b8dc4d53d6f6f9f589..c619bcee57b37242837123bdcda013db3938278a 100644 (file)
@@ -49,7 +49,7 @@ import org.sonar.server.project.ws.ProjectCreator;
 import org.sonar.server.user.UserSession;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.StringUtils.defaultIfBlank;
+import static org.apache.commons.lang3.StringUtils.defaultIfBlank;
 import static org.sonar.db.permission.GlobalPermission.SCAN;
 import static org.sonar.db.project.CreationMethod.SCANNER_API;
 import static org.sonar.db.project.CreationMethod.SCANNER_API_DEVOPS_AUTO_CONFIG;
index fb20e956a13ecd9d3d74bdae1341029599ea29ce..92e30f7ca050a40026cef0893995c5b10b22473f 100644 (file)
@@ -23,7 +23,7 @@ import java.io.BufferedInputStream;
 import java.io.InputStream;
 import java.util.LinkedHashMap;
 import java.util.Map;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.sonar.api.server.ws.Request;
@@ -37,8 +37,8 @@ import org.sonar.server.ws.WsUtils;
 import org.sonarqube.ws.Ce;
 
 import static java.net.HttpURLConnection.HTTP_INTERNAL_ERROR;
-import static org.apache.commons.lang.StringUtils.abbreviate;
-import static org.apache.commons.lang.StringUtils.defaultIfBlank;
+import static org.apache.commons.lang3.StringUtils.abbreviate;
+import static org.apache.commons.lang3.StringUtils.defaultIfBlank;
 import static org.sonar.core.component.ComponentKeys.MAX_COMPONENT_KEY_LENGTH;
 import static org.sonar.db.component.ComponentValidator.MAX_COMPONENT_NAME_LENGTH;
 import static org.sonar.server.exceptions.BadRequestException.checkRequest;
index 8c27aacf08fc75f2ac27483a7869f385a67272b5..7c40b7616b62008faa46c0354fdf89cb8bf441e0 100644 (file)
@@ -25,7 +25,7 @@ import java.util.List;
 import java.util.Map;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.BooleanUtils;
+import org.apache.commons.lang3.BooleanUtils;
 import org.sonar.api.measures.Metric;
 import org.sonar.api.utils.text.JsonWriter;
 import org.sonar.db.DbClient;
index 75fb5060cf8e60726e3e971c42c210ebbd8b0c53..d9b1dd9492d3060731d662f937eb057c4edc8546 100644 (file)
@@ -31,7 +31,7 @@ import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamException;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.codehaus.staxmate.SMInputFactory;
 import org.codehaus.staxmate.in.SMHierarchicCursor;
 import org.codehaus.staxmate.in.SMInputCursor;
index 8ae2c5a4f04bc797a96bca997287752b7876db89..03d2556a06033175c5f44b6cea8dbfba0bff8cb1 100644 (file)
@@ -28,7 +28,7 @@ import java.util.Optional;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
 import javax.inject.Inject;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.db.DbClient;
 import org.sonar.db.DbSession;
 import org.sonar.db.component.ComponentDao;
index 1805ff3428d90ba910e744624451707523b7685a..acb0a112f69f6cf09dff6f41d2092b992e29d5c2 100644 (file)
@@ -42,7 +42,7 @@ import org.sonar.server.pushapi.hotspots.HotspotChangeEventService;
 import org.sonar.server.pushapi.hotspots.HotspotChangedEvent;
 
 import static com.google.common.base.Preconditions.checkArgument;
-import static org.apache.commons.lang.StringUtils.trimToNull;
+import static org.apache.commons.lang3.StringUtils.trimToNull;
 import static org.sonar.api.issue.Issue.RESOLUTION_ACKNOWLEDGED;
 import static org.sonar.api.issue.Issue.RESOLUTION_FIXED;
 import static org.sonar.api.issue.Issue.SECURITY_HOTSPOT_RESOLUTIONS;
index 8f04f23b2ee4792291f56b0ae4c5cfd1e8ccc80d..cef2447ff35849a02b742c4f9b04fc7385c19b71 100644 (file)
@@ -23,7 +23,7 @@ import java.util.Arrays;
 import java.util.List;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.builder.ReflectionToStringBuilder;
+import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
 
 import static com.google.common.collect.Lists.newArrayList;
 
index 7b575a6798f354c9124d59c3664f3a9ca461ebae..e8a071f48bd5529571bacdd0fc06e6a9bec60f40 100644 (file)
@@ -27,8 +27,8 @@ import org.sonar.server.issue.workflow.Transition;
 import org.sonar.server.user.UserSession;
 
 import static java.util.Objects.requireNonNull;
-import static org.apache.commons.lang.StringUtils.isBlank;
-import static org.apache.commons.lang.StringUtils.isNotBlank;
+import static org.apache.commons.lang3.StringUtils.isBlank;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
 
 /**
  * This service is a kind of overlay of {@link IssueWorkflow} that also deals with permission checking
index 29249c93c482544a2e1d86566af16461df60fde2..7d5c86257d104e267460d9ae27a5e4482f54bea5 100644 (file)
@@ -51,7 +51,7 @@ import static com.google.common.base.Preconditions.checkState;
 import static java.util.Collections.singleton;
 import static java.util.Collections.singletonList;
 import static java.util.Optional.ofNullable;
-import static org.apache.commons.lang.StringUtils.isNotEmpty;
+import static org.apache.commons.lang3.StringUtils.isNotEmpty;
 import static org.sonar.db.component.BranchType.PULL_REQUEST;
 
 public class IssueUpdater {
index 476cf5137aeafb12ab7db942b40ec25fdf8223c2..042b533819a178102c80814b10771d16f9514072 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.server.permission;
 
 import java.util.List;
 
-import static org.apache.commons.lang.StringUtils.isNotBlank;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
 import static org.sonar.server.exceptions.BadRequestException.checkRequest;
 
 public class ApplyPermissionTemplateQuery {
index c4b38bdb70ba818047e50193db121864fb279858..2b2bd606adacb740449833de313b0000a5a6c38f 100644 (file)
@@ -29,7 +29,7 @@ import java.util.Set;
 import java.util.stream.Collectors;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.resources.Qualifiers;
 import org.sonar.api.server.ServerSide;
 import org.sonar.core.util.UuidFactory;
index 14b5b824c7fe0b0cd6fd3de2e58e0e6a92fb8819..6a6bfca7aad4480b8c22c7288ec0c1b76993c361 100644 (file)
@@ -41,7 +41,7 @@ import org.sonarqube.ws.Permissions.UpdateTemplateWsResponse;
 
 import static java.lang.String.format;
 import static java.util.Objects.requireNonNull;
-import static org.apache.commons.lang.StringUtils.isBlank;
+import static org.apache.commons.lang3.StringUtils.isBlank;
 import static org.sonar.server.exceptions.BadRequestException.checkRequest;
 import static org.sonar.server.permission.PermissionPrivilegeChecker.checkGlobalAdmin;
 import static org.sonar.server.permission.RequestValidator.MSG_TEMPLATE_WITH_SAME_NAME;
index 95065ba433f2d0505ae00a2674928cb46633a640..166a44767fbf0e36fb2f05f0d9ec7a2b75a5f4b0 100644 (file)
@@ -34,7 +34,7 @@ import org.sonar.updatecenter.common.SonarUpdate;
 import org.sonar.updatecenter.common.UpdateCenter;
 import org.sonar.updatecenter.common.Version;
 
-import static org.apache.commons.lang.StringUtils.isNotBlank;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
 import static org.sonar.server.plugins.edition.EditionBundledPlugins.isEditionBundled;
 
 /**
index 75c5763046802b8f8f7cca5a733a0bada3819584..1edb9ccfa22410c73ee492535c16f28397bac724 100644 (file)
@@ -42,7 +42,7 @@ import org.sonarqube.ws.Plugins.UpdateStatus;
 
 import static java.lang.String.CASE_INSENSITIVE_ORDER;
 import static java.util.Optional.ofNullable;
-import static org.apache.commons.lang.StringUtils.isNotBlank;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
 import static org.sonar.api.utils.DateUtils.formatDate;
 import static org.sonar.server.plugins.edition.EditionBundledPlugins.isEditionBundled;
 import static org.sonarqube.ws.Plugins.UpdateStatus.COMPATIBLE;
index 92c5dcce3ec571fddc63e38f79475b482322ea83..7344511d809d18cc29fba42176c811306908f381 100644 (file)
@@ -29,7 +29,7 @@ import java.util.Set;
 import java.util.stream.Collectors;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.server.ws.Change;
 import org.sonar.api.server.ws.Request;
 import org.sonar.api.server.ws.Response;
index a1e6df48ea7329d6fcf0fdbcf18473f2905301ab..9dde9e80e4c88409ed51bccceb0419475268775f 100644 (file)
@@ -43,7 +43,7 @@ import org.sonar.server.user.UserSession;
 import org.sonarqube.ws.Projects.CreateWsResponse;
 
 import static java.util.Objects.requireNonNull;
-import static org.apache.commons.lang.StringUtils.abbreviate;
+import static org.apache.commons.lang3.StringUtils.abbreviate;
 import static org.sonar.api.resources.Qualifiers.PROJECT;
 import static org.sonar.core.component.ComponentKeys.MAX_COMPONENT_KEY_LENGTH;
 import static org.sonar.db.component.ComponentValidator.MAX_COMPONENT_NAME_LENGTH;
index 7e242b7d6b8999bcc85adc5fda01895db49f3e18..89c3069561516bf4c81b77656e85fa3960af2c5e 100644 (file)
@@ -45,7 +45,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 import static java.lang.String.format;
 import static java.util.Objects.requireNonNull;
 import static java.util.Optional.ofNullable;
-import static org.apache.commons.lang.StringUtils.isNotBlank;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
 import static org.sonar.server.projectanalysis.ws.EventValidator.checkModifiable;
 import static org.sonar.server.projectanalysis.ws.EventValidator.checkVersionName;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
index 291a29b1c37bc0a8441b42bf0138dc9eb95a2dbc..0b5afb43a46c494bd80f3090076c15c7f0d12a9b 100644 (file)
@@ -38,7 +38,7 @@ import org.sonar.server.component.ComponentFinder;
 import org.sonar.server.user.UserSession;
 
 import static com.google.common.base.Preconditions.checkArgument;
-import static org.apache.commons.lang.StringUtils.isNotBlank;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
 import static org.sonar.core.util.Slug.slugify;
 import static org.sonar.core.util.Uuids.UUID_EXAMPLE_01;
 import static org.sonar.db.DatabaseUtils.closeQuietly;
index b8c58b1f09a8b4c5a63d18d6cbff9b09c546b0d7..8d2b66984308dbf5f00bbba928d8aa37ce55a2e6 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.server.projecttag;
 import java.util.List;
 import java.util.Locale;
 import java.util.regex.Pattern;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.utils.System2;
 import org.sonar.api.web.UserRole;
 import org.sonar.db.DbClient;
index bb333e092aa1751716c5379c791b4a6e2d6d519c..74e58d995a3ce0aa021dddcf7eb0b3ad16b0271e 100644 (file)
@@ -31,7 +31,7 @@ import java.util.Set;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.builder.CompareToBuilder;
+import org.apache.commons.lang3.builder.CompareToBuilder;
 import org.sonar.api.rule.RuleKey;
 import org.sonar.api.rule.RuleStatus;
 import org.sonar.api.rules.RuleType;
@@ -43,9 +43,9 @@ import org.sonar.db.qualityprofile.ExportRuleParamDto;
 import org.sonar.db.qualityprofile.QProfileDto;
 import org.sonar.db.rule.DeprecatedRuleKeyDto;
 import org.sonar.db.rule.RuleDto;
-import org.sonar.server.qualityprofile.builtin.QProfileName;
-import org.sonar.server.common.rule.service.NewCustomRule;
 import org.sonar.server.common.rule.RuleCreator;
+import org.sonar.server.common.rule.service.NewCustomRule;
+import org.sonar.server.qualityprofile.builtin.QProfileName;
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static java.util.function.Function.identity;
index f31b698e060cbbb86bf23eebc04eb54720dbfe96..204f483fbece6c368a3bdc9d597b0924947a34d5 100644 (file)
@@ -34,8 +34,8 @@ import java.util.Objects;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 import javax.annotation.CheckForNull;
-import org.apache.commons.lang.ArrayUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.profiles.ProfileExporter;
 import org.sonar.api.profiles.ProfileImporter;
 import org.sonar.api.profiles.RulesProfile;
index 37dd28accc7b5bb412c78c6f877fe7ab9439395a..c1fbe09865e20f69b3bf08c6c9e8652d1b2f311a 100644 (file)
@@ -26,7 +26,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.utils.System2;
 import org.sonar.core.util.UuidFactory;
 import org.sonar.db.DbClient;
index 7e3338d5633bdfcd8f01bfc4d17920f73a01f40a..013a29905011072cf65717aa72fb43c17e278cf0 100644 (file)
@@ -32,7 +32,7 @@ import java.util.Set;
 import java.util.stream.Collectors;
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamException;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.codehaus.staxmate.SMInputFactory;
 import org.codehaus.staxmate.in.SMHierarchicCursor;
 import org.codehaus.staxmate.in.SMInputCursor;
index e84b3ba71afbde3b5240c4e68209144d63f49fa6..e0a1e7c1c29910e35654ff4a03afe0d5065cd315 100644 (file)
@@ -32,7 +32,7 @@ import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
 import java.util.function.Function;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.Startable;
 import org.sonar.api.resources.Language;
 import org.sonar.api.resources.Languages;
index 2ad34e28bbb924f1f79f1a917ea71bb5ad50ad49..065422beca80b7d102325cb31c09b3e915e31cca 100644 (file)
@@ -30,7 +30,7 @@ import java.util.stream.Collectors;
 import java.util.stream.Stream;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.config.Configuration;
 import org.sonar.api.rule.RuleStatus;
 import org.sonar.api.server.ServerSide;
index 65223eaccae00b9b9159f461e7517d6050aefaac..b57b6d2be8a9f63b2db68463f672187ba12ff9b5 100644 (file)
@@ -31,7 +31,7 @@ import org.sonar.server.qualityprofile.QProfileTree;
 import org.sonar.server.user.UserSession;
 import org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters;
 
-import static org.apache.commons.lang.StringUtils.isEmpty;
+import static org.apache.commons.lang3.StringUtils.isEmpty;
 import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_LANGUAGE;
 
 public class ChangeParentAction implements QProfileWsAction {
index 7de5b43eda38e0f2b9028f79f2843b6942233f4a..3cd5c21b45c942ce510d84d8989a2665ca6bace2 100644 (file)
@@ -24,7 +24,7 @@ import java.util.Map;
 import java.util.Set;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.rule.RuleKey;
 import org.sonar.api.rule.RuleStatus;
 import org.sonar.api.server.debt.DebtRemediationFunction;
index f918af7f6be23c50e6b5fb298af178cb902f8d23..5fa23689c0c4c25e6ea70cd5a9e14d6b734e7918 100644 (file)
@@ -31,7 +31,7 @@ import java.util.Optional;
 import java.util.Set;
 import java.util.function.Consumer;
 import javax.annotation.Nonnull;
-import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.EqualsBuilder;
 import org.sonar.api.rule.RuleStatus;
 import org.sonar.api.rule.Severity;
 import org.sonar.api.server.ServerSide;
@@ -54,7 +54,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
 import static com.google.common.base.Strings.isNullOrEmpty;
 import static com.google.common.collect.FluentIterable.from;
 import static com.google.common.collect.Lists.newArrayList;
-import static org.apache.commons.lang.StringUtils.isBlank;
+import static org.apache.commons.lang3.StringUtils.isBlank;
 import static org.sonar.db.rule.RuleDescriptionSectionDto.createDefaultRuleDescriptionSection;
 
 @ServerSide
index 9f038d0b25b71672f4e203821a96f41e105223c8..30376d14673581e283917ebddf63cae5a5e2e154 100644 (file)
@@ -34,7 +34,7 @@ import java.util.function.Function;
 import java.util.stream.Collectors;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.resources.Language;
 import org.sonar.api.resources.Languages;
 import org.sonar.api.rule.RuleKey;
index 9acd0b5a74f46526d9ded46e7598e6a3b0f7c76f..b08473e3b895c36a2a215ac5b1e9125950c86259 100644 (file)
@@ -24,7 +24,7 @@ import com.google.common.io.Resources;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.rule.RuleKey;
 import org.sonar.api.rule.RuleStatus;
 import org.sonar.api.rule.Severity;
index 769d44b167179344b82324fff21190e48ab011eb..c3ac6e87296316ff3ec4f7f8d9730457fa1147f8 100644 (file)
@@ -34,7 +34,7 @@ import java.util.stream.Collectors;
 import java.util.stream.IntStream;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.PropertyType;
 import org.sonar.api.config.PropertyDefinition;
 import org.sonar.api.config.PropertyDefinitions;
index 007f8206fa319a3051cc08b6b5cbb1ae9b121983..110d9a51fb133714082357fe49b4af8fb4453b62 100644 (file)
@@ -54,7 +54,7 @@ import org.sonarqube.ws.Settings.ValuesWsResponse;
 
 import static java.lang.String.format;
 import static java.util.stream.Stream.concat;
-import static org.apache.commons.lang.StringUtils.isEmpty;
+import static org.apache.commons.lang3.StringUtils.isEmpty;
 import static org.sonar.api.CoreProperties.SERVER_ID;
 import static org.sonar.api.CoreProperties.SERVER_STARTTIME;
 import static org.sonar.api.PropertyType.FORMATTED_TEXT;
index a7041fb8b8a846f9e4aa9e61308fd42f6017b81d..bde32f911d425a5ed92c5330432e0f1fcbb73890 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.server.source;
 import java.util.List;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 
 public class HtmlSourceDecorator {
 
index 894cfa39283729eecc303df69ef5ff13721b6a8a..1f0bf728f0f71d12cfcc2be1d24e4b3f7f5b1ea6 100644 (file)
@@ -22,8 +22,8 @@ package org.sonar.server.source.ws;
 import com.google.common.base.Strings;
 import com.google.common.io.Resources;
 import java.util.Date;
-import org.apache.commons.lang.ObjectUtils;
-import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.builder.EqualsBuilder;
 import org.sonar.api.server.ws.Request;
 import org.sonar.api.server.ws.Response;
 import org.sonar.api.server.ws.WebService;
index 803e7fd54c756967c71131370ea6f5793098b394..58c4ca0795bdf628a9f69b3929374bfe130d3ec3 100644 (file)
@@ -20,7 +20,7 @@
 package org.sonar.server.source.ws;
 
 import com.google.common.io.Resources;
-import org.apache.commons.lang.ObjectUtils;
+import org.apache.commons.lang3.ObjectUtils;
 import org.sonar.api.server.ws.Request;
 import org.sonar.api.server.ws.Response;
 import org.sonar.api.server.ws.WebService;
index b601b79caccb71521174291ee8a5376a6efd0446..4dec38b01061bb415e3b4a48cff6f508697bf346 100644 (file)
@@ -47,15 +47,15 @@ import static java.util.Collections.singletonList;
 import static java.util.Optional.empty;
 import static java.util.Optional.of;
 import static java.util.Optional.ofNullable;
-import static org.apache.commons.lang.StringUtils.EMPTY;
+import static org.apache.commons.lang3.StringUtils.EMPTY;
 import static org.sonar.api.web.UserRole.USER;
 import static org.sonar.server.user.ws.DismissNoticeAction.AVAILABLE_NOTICE_KEYS;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
-import static org.sonarqube.ws.Users.CurrentWsResponse.Permissions;
-import static org.sonarqube.ws.Users.CurrentWsResponse.newBuilder;
 import static org.sonarqube.ws.Users.CurrentWsResponse.HomepageType.APPLICATION;
 import static org.sonarqube.ws.Users.CurrentWsResponse.HomepageType.PORTFOLIO;
 import static org.sonarqube.ws.Users.CurrentWsResponse.HomepageType.PROJECT;
+import static org.sonarqube.ws.Users.CurrentWsResponse.Permissions;
+import static org.sonarqube.ws.Users.CurrentWsResponse.newBuilder;
 import static org.sonarqube.ws.client.user.UsersWsParameters.ACTION_CURRENT;
 
 public class CurrentAction implements UsersWsAction {
index 3bbbcfefbde67e8347d6ae3e4dbf2be42d6db1c3..3325e90405a2d72eadf049afc7214abfb041cdf6 100644 (file)
@@ -23,7 +23,7 @@ import javax.annotation.Nullable;
 import javax.mail.internet.AddressException;
 import javax.mail.internet.InternetAddress;
 
-import static org.apache.commons.lang.StringUtils.isEmpty;
+import static org.apache.commons.lang3.StringUtils.isEmpty;
 
 public class EmailValidator {
 
index 4bf3ef75bf2eff1adae6e42b489185c69c80fc82..e6f9d9527172483f0dea981eb14b44c3df1f89ce 100644 (file)
@@ -35,7 +35,7 @@ import org.sonar.server.user.UserSession;
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkState;
 import static java.lang.String.format;
-import static org.apache.commons.lang.StringUtils.isNotBlank;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
 import static org.sonar.server.user.ws.HomepageTypes.Type.PROJECT;
 import static org.sonar.server.ws.KeyExamples.KEY_BRANCH_EXAMPLE_001;
 import static org.sonar.server.ws.KeyExamples.KEY_PROJECT_EXAMPLE_001;
index f820e20428c1c0ba44e4a113b6daf10876e27867..c987f0143704906690c66541f88be983e906ceb2 100644 (file)
@@ -32,7 +32,7 @@ import org.sonar.server.component.ComponentFinder;
 import org.sonar.server.user.UserSession;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.StringUtils.isNotBlank;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
 import static org.sonar.server.webhook.ws.WebhooksWsParameters.ACTION_CREATE;
 import static org.sonar.server.webhook.ws.WebhooksWsParameters.NAME_PARAM;
 import static org.sonar.server.webhook.ws.WebhooksWsParameters.NAME_PARAM_MAXIMUM_LENGTH;
index 49da7248f1fc0989be0b1256979e90754ddeb74c..ed71f6e56d88cbeee1fc47a32cbe3e71581a8995 100644 (file)
@@ -37,7 +37,7 @@ import org.sonarqube.ws.Webhooks;
 import org.sonarqube.ws.Webhooks.ListResponse;
 import org.sonarqube.ws.Webhooks.ListResponseElement;
 
-import static org.apache.commons.lang.StringUtils.isNotBlank;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
 import static org.sonar.api.utils.DateUtils.formatDateTime;
 import static org.sonar.server.webhook.HttpUrlHelper.obfuscateCredentials;
 import static org.sonar.server.webhook.ws.WebhooksWsParameters.LIST_ACTION;
index 771a8d89eaf3c42accb1c2b1d3a4c43d54ed8664..b146c73fa3a3a1b3f32bae4caa55acf2a5b5fdf6 100644 (file)
@@ -31,7 +31,7 @@ import org.sonar.db.webhook.WebhookDto;
 import org.sonar.server.component.ComponentFinder;
 import org.sonar.server.user.UserSession;
 
-import static org.apache.commons.lang.StringUtils.isBlank;
+import static org.apache.commons.lang3.StringUtils.isBlank;
 import static org.sonar.server.exceptions.NotFoundException.checkFoundWithOptional;
 import static org.sonar.server.webhook.ws.WebhooksWsParameters.KEY_PARAM;
 import static org.sonar.server.webhook.ws.WebhooksWsParameters.KEY_PARAM_MAXIMUM_LENGTH;
index 8154abbc65b18f830d4828b13a8b18fc355e0d01..4cba7a22003bb7664984baf0da7901373400311c 100644 (file)
@@ -44,7 +44,7 @@ import org.sonarqube.ws.Common;
 import org.sonarqube.ws.Webhooks;
 
 import static com.google.common.base.Preconditions.checkArgument;
-import static org.apache.commons.lang.StringUtils.isNotBlank;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
 import static org.sonar.api.server.ws.WebService.Param.PAGE;
 import static org.sonar.api.server.ws.WebService.Param.PAGE_SIZE;
 import static org.sonar.core.util.Uuids.UUID_EXAMPLE_02;
index daa4246e4982b4092c0a6919f2d0ba3baf3d398c..576c92503914665719c7990b280fb526669963d3 100644 (file)
@@ -19,7 +19,7 @@
  */
 package org.sonar.server.almintegration.ws;
 
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
index ba3dc0a68f5bba4ee36106b028426d1552d7d303..6cc77b6217d334bde1b6fc3d3becd289e06c5826 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.server.badge.ws;
 
 import org.junit.Test;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 
 
index 5a744a8615edbe330470de11b68be7034649aceb..fae49d335f5176d6eae933916b53a6f975ff0313 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.server.batch;
 import java.io.File;
 import java.io.IOException;
 import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.CharUtils;
+import org.apache.commons.lang3.CharUtils;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
index 9e327fbb147dcc2630b69c70307603973d4b4224..4d58bed4faa6a66195ef510aba1ad9fe614664a9 100644 (file)
@@ -33,8 +33,8 @@ import org.sonar.db.component.BranchDto;
 import org.sonar.db.component.ComponentDto;
 import org.sonar.server.ce.queue.BranchSupport.ComponentKey;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.Mockito.mock;
index 219c44ec2733f41cb7d985a48f1b4c1230a96bda..dd29147cdf82ec028e052ef47d72dd9829d70423 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.server.component;
 import org.junit.Test;
 
 import static com.google.common.base.Strings.repeat;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.sonar.api.resources.Qualifiers.PROJECT;
index 663f745fb4ed63ddd5ca78635410140d501ac251..2f5f926500e5a4e853c3889f55d415063fd63008 100644 (file)
@@ -24,7 +24,7 @@ import org.sonar.api.server.ws.Request;
 import org.sonar.api.server.ws.Response;
 import org.sonar.api.server.ws.WebService;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonarqube.ws.client.component.ComponentsWsParameters.CONTROLLER_COMPONENTS;
 
index a6976e4efa816420ef6ac21b12cd5c9c6996ed80..c750e0251cde3e3ca511f61fc315486828596e92 100644 (file)
@@ -32,7 +32,7 @@ import org.sonar.process.cluster.health.NodeHealth;
 
 import static java.util.stream.Collectors.toSet;
 import static java.util.stream.Stream.concat;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.sonar.process.cluster.health.NodeHealth.newNodeHealthBuilder;
index d5d5b6f65c320531ea26968f88cf6401afbe0984..395f083273a04b348ff2026c584a006145a87a77 100644 (file)
@@ -36,7 +36,7 @@ import org.sonar.server.common.health.ClusterHealthCheck;
 import org.sonar.server.common.health.NodeHealthCheck;
 import org.sonar.server.platform.NodeInformation;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.ArgumentMatchers.same;
index f6400e80fa9699a120135112430f97c92e13f93d..5660068d49ae94f9d6d3db4d5a8769efcf537bcb 100644 (file)
@@ -27,7 +27,7 @@ import java.util.stream.IntStream;
 import org.assertj.core.api.AbstractCharSequenceAssert;
 import org.junit.Test;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.ThrowableAssert.ThrowingCallable;
index 1a49640e9c8285b26c32b2dd3ec8b51530c9fb79..2b772c675ae870e877b4f9f766486b5b47284c74 100644 (file)
@@ -25,14 +25,14 @@ import org.junit.Test;
 import org.sonar.api.config.internal.MapSettings;
 import org.sonar.api.platform.Server;
 import org.sonar.api.utils.System2;
+import org.sonar.core.platform.ListContainer;
 import org.sonar.core.platform.SpringComponentContainer;
 import org.sonar.process.NetworkUtils;
 import org.sonar.process.cluster.health.SharedHealthStateImpl;
 import org.sonar.process.cluster.hz.HazelcastMember;
-import org.sonar.core.platform.ListContainer;
 
 import static java.lang.String.valueOf;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
index 274840364e88accddd91ce40a0e230e7134bbba0..eba8e68eb37be0f7ceaa3cf1d67a641cc61bfa4f 100644 (file)
@@ -30,8 +30,8 @@ import org.sonar.process.NetworkUtils;
 import org.sonar.process.cluster.health.NodeDetails;
 import org.sonar.process.cluster.health.NodeHealth;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.Mockito.mock;
index 16f059a5e7a6963cc1070b5eb20932cf6728f32c..91b7e70abebf6c058778aae8eeadfe3580de0e38 100644 (file)
@@ -27,7 +27,7 @@ import org.sonar.api.server.ws.Request;
 import org.sonar.api.server.ws.Response;
 import org.sonar.api.server.ws.WebService;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 
 public class HotspotsWsTest {
index 44483a3f5ae388bc55722fea01d5db2581f96821..37bef38598d704c2ba525bd5c35542d2808e4f84 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.server.issue;
 
 import java.util.Date;
 import java.util.List;
-import org.apache.commons.lang.time.DateUtils;
+import org.apache.commons.lang3.time.DateUtils;
 import org.junit.Test;
 import org.sonar.db.issue.IssueDto;
 import org.sonar.server.issue.index.IssueQuery;
index 00adc638340f61b14090c2149a7a426e6a29bd41..f68802909fa461894c59b1ed38262e1a002572f3 100644 (file)
@@ -51,7 +51,7 @@ import org.sonarqube.ws.Issues.Operation;
 
 import static java.lang.System.currentTimeMillis;
 import static java.util.stream.Collectors.toList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.groups.Tuple.tuple;
 import static org.mockito.ArgumentMatchers.any;
index 8918d2b2eb0f30273bee984aba5cea41b6cdee70..58ff9a327b41d0303b53b04dede8b483b2a0f327 100644 (file)
@@ -25,7 +25,7 @@ import org.sonar.api.server.ws.Response;
 import org.sonar.api.server.ws.WebService;
 import org.sonar.core.documentation.DocumentationLinkGenerator;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 
index 71d626420721b950ac067e213886e7400cbef972..08837be653216cd78f4ecda6e87b97b2d2fdc348 100644 (file)
@@ -28,7 +28,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Random;
 import java.util.stream.IntStream;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.Rule;
 import org.junit.Test;
 import org.sonar.api.server.ws.WebService;
@@ -48,8 +48,8 @@ import org.sonarqube.ws.System;
 
 import static java.util.Collections.emptySet;
 import static java.util.Collections.singleton;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.ThrowableAssert.ThrowingCallable;
index 71f711afdd245aecd49e81c1e12401d7dd87a7a4..c4d3aca4363badd47aee5fec32411421f8cc13c7 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.server.platform.ws;
 import java.util.Arrays;
 import java.util.Random;
 import java.util.stream.IntStream;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.assertj.core.api.ThrowableAssert.ThrowingCallable;
 import org.junit.Test;
 import org.sonar.api.server.ws.WebService;
@@ -35,7 +35,7 @@ import org.sonar.server.ws.TestResponse;
 import org.sonar.server.ws.WsActionTester;
 import org.sonarqube.ws.System;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.ArgumentMatchers.any;
index 18257a07d4ff568e88136b1acba2b941ea8506bb..ebc80eda297abb062d99cef0ce75bb24a4c6b059 100644 (file)
@@ -26,7 +26,7 @@ import org.sonar.api.platform.Server;
 import org.sonar.server.issue.notification.EmailMessage;
 import org.sonar.server.qualityprofile.builtin.BuiltInQPChangeNotificationBuilder.Profile;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
index d5efae2e9e51823efc29120f95c81501f05eebbe..a117b35432fccde52dda12a130c51577fc32e89b 100644 (file)
@@ -24,7 +24,7 @@ import org.junit.Test;
 import org.sonar.api.notifications.Notification;
 import org.sonar.server.qualityprofile.builtin.BuiltInQPChangeNotificationBuilder.Profile;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.tuple;
index 2ec9b1e7800c1eb64762052bd32cb178e153a298..39bbce9ec89a4ee712d50abf56c3b57165ea1f05 100644 (file)
@@ -36,7 +36,7 @@ import org.sonar.server.qualityprofile.ActiveRuleChange;
 import org.sonar.server.qualityprofile.builtin.BuiltInQPChangeNotificationBuilder.Profile;
 
 import static java.util.Arrays.asList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.tuple;
 import static org.mockito.Mockito.mock;
index 266de77825ebd54999eba20452cbf9dbf6122c8b..41296e7c148d3e3f7badf8a41a6b59567d3a9e5a 100644 (file)
@@ -24,7 +24,7 @@ import org.junit.Test;
 import org.sonar.api.server.ws.WebService;
 import org.sonar.server.ws.ServletFilterHandler;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 
 public class UsersWsTest {
index ef7bbee678d1554311c41d94051015184a12f722..35843e51cfe72f384b00fe3be002fa235a7ce006 100644 (file)
@@ -42,7 +42,7 @@ import org.sonarqube.ws.MediaTypes;
 import static com.google.common.base.MoreObjects.firstNonNull;
 import static java.util.Collections.emptyList;
 import static java.util.Locale.ENGLISH;
-import static org.apache.commons.lang.StringUtils.substringAfterLast;
+import static org.apache.commons.lang3.StringUtils.substringAfterLast;
 import static org.apache.tomcat.util.http.fileupload.FileUploadBase.MULTIPART;
 
 public class ServletRequest extends ValidatingRequest {
index 678e74e92dad7da78988e554ed8119c5c939f45a..149e2e84d244293173ab3c92e94af21919ffc372 100644 (file)
@@ -46,9 +46,9 @@ import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Strings.isNullOrEmpty;
 import static java.util.Collections.singletonList;
 import static java.util.Objects.requireNonNull;
-import static org.apache.commons.lang.StringUtils.substring;
-import static org.apache.commons.lang.StringUtils.substringAfterLast;
-import static org.apache.commons.lang.StringUtils.substringBeforeLast;
+import static org.apache.commons.lang3.StringUtils.substring;
+import static org.apache.commons.lang3.StringUtils.substringAfterLast;
+import static org.apache.commons.lang3.StringUtils.substringBeforeLast;
 import static org.sonar.server.exceptions.NotFoundException.checkFound;
 import static org.sonar.server.ws.RequestVerifier.verifyRequest;
 import static org.sonar.server.ws.ServletRequest.SUPPORTED_MEDIA_TYPES_BY_URL_SUFFIX;
index e12edbad22c5ea3abef1f4efe2bd59a1ab2acd62..84d54757adf716ec45147200a87edb37bb469d90 100644 (file)
@@ -41,8 +41,8 @@ import org.sonar.server.exceptions.BadRequestException;
 import org.sonarqube.ws.MediaTypes;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
-import static org.apache.commons.lang.StringUtils.substringAfterLast;
-import static org.apache.commons.lang.StringUtils.substringBeforeLast;
+import static org.apache.commons.lang3.StringUtils.substringAfterLast;
+import static org.apache.commons.lang3.StringUtils.substringBeforeLast;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.anyInt;
 import static org.mockito.Mockito.mock;
index a8715fd9f913a3cabe35d8bcf771dd5fd07a63f6..3e7dcf5a0746e4b48d6e34065ac1de349130de49 100644 (file)
@@ -23,7 +23,7 @@ import ch.qos.logback.access.tomcat.LogbackValve;
 import ch.qos.logback.core.util.ExecutorServiceUtil;
 import org.apache.catalina.LifecycleException;
 import org.apache.catalina.LifecycleState;
-import org.apache.commons.lang.reflect.FieldUtils;
+import org.apache.commons.lang3.reflect.FieldUtils;
 
 /**
  * Implementation of {@link ch.qos.logback.access.tomcat.LogbackValve} that does not
index 153043eff5f02efb7bb4c18106e255ab6b559920..dcb6755bcc549e995098c3301a1d85e63d7fddc3 100644 (file)
@@ -29,7 +29,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import org.apache.catalina.connector.ClientAbortException;
 import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.sonar.core.platform.PluginRepository;
index e68c4095e443adc74db82a4f94dec67e2e1b7f0f..26872fcd0b0f94fcec9462cc16d095fa90cf5e42 100644 (file)
@@ -14,7 +14,7 @@ dependencies {
   api 'com.squareup.okhttp3:okhttp'
   api 'commons-codec:commons-codec'
   api 'commons-io:commons-io'
-  api 'commons-lang:commons-lang'
+  api 'org.apache.commons:commons-lang3'
   api 'javax.annotation:javax.annotation-api'
   api 'javax.inject:javax.inject'
   api 'org.slf4j:slf4j-api'
index d070711f51ef2247ea7558b41871d70c17e9b9e8..a37697ce133e10d5ead6e8a04feac097edd7700a 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.core.component;
 
 import java.util.regex.Pattern;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 
 import static com.google.common.base.Preconditions.checkArgument;
 
index 34c4ccacc30cc444ff1f20f6848712faa3ae3592..9a149dc1dd19b9aa0f348d82f4ec2b05a78b3945 100644 (file)
@@ -25,7 +25,7 @@ import java.util.Collections;
 import java.util.List;
 import org.apache.commons.codec.binary.Hex;
 import org.apache.commons.codec.digest.DigestUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
 import static java.util.Objects.requireNonNull;
index 90068c65fb1af9629a2bd4f4bfbce4f6cda81eef..e5e1b246b111c44019dcaea276ab80a86c694d08 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.core.issue;
 import java.time.Instant;
 import java.util.Date;
 import java.util.Objects;
-import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.jetbrains.annotations.Nullable;
 import org.sonar.api.issue.Issue;
 import org.sonar.api.rule.RuleKey;
index 0ca4cab45450e3dbabdd298df4987e02cdd68918..7afc0784a4950afc55d9eb093892ccc813529308 100644 (file)
@@ -38,9 +38,9 @@ import java.util.Optional;
 import java.util.Set;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
 import org.sonar.api.issue.Issue;
 import org.sonar.api.issue.IssueStatus;
 import org.sonar.api.issue.impact.SoftwareQuality;
index affaf53258fdc5b18dea53e6f6e68b38ea18a118..5d17343f234ca8177249134dc4a82c62290d658d 100644 (file)
@@ -31,12 +31,12 @@ import java.util.Objects;
 import java.util.Optional;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 
 import static com.google.common.base.Strings.emptyToNull;
 import static com.google.common.base.Strings.isNullOrEmpty;
-import static org.apache.commons.lang.StringUtils.isNotBlank;
-import static org.apache.commons.lang.StringUtils.trimToNull;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
+import static org.apache.commons.lang3.StringUtils.trimToNull;
 
 /**
  * PLUGINS MUST NOT USE THIS CLASS, EXCEPT FOR UNIT TESTING.
index b3b9f343c97c9436f8a737cd1783cdd1b34da7f3..41b4aa79f870e056428951b09a427a3f96b90973 100644 (file)
@@ -25,7 +25,7 @@ import java.util.Collection;
 import java.util.Objects;
 import java.util.function.Function;
 import javax.annotation.Nonnull;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.rule.RuleKey;
 
 import static java.util.Comparator.comparing;
index 7e47b756adf15d1e243c244e962921f3aee8caa0..fe59b63e287a4397d3ee643cf04ce030c52a68c2 100644 (file)
@@ -26,7 +26,7 @@ import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.stream.Collectors;
-import org.apache.commons.lang.SystemUtils;
+import org.apache.commons.lang3.SystemUtils;
 import org.slf4j.LoggerFactory;
 import org.sonar.api.Plugin;
 import org.sonar.updatecenter.common.Version;
@@ -134,7 +134,7 @@ public class PluginClassLoader {
         try {
           instancesByPluginKey.put(pluginKey, (Plugin) classLoader.loadClass(mainClass).getDeclaredConstructor().newInstance());
         } catch (UnsupportedClassVersionError e) {
-          throw new IllegalStateException(String.format("The plugin [%s] does not support Java %s", pluginKey, SystemUtils.JAVA_VERSION_TRIMMED), e);
+          throw new IllegalStateException(String.format("The plugin [%s] does not support Java %s", pluginKey, SystemUtils.JAVA_VERSION), e);
         } catch (Throwable e) {
           throw new IllegalStateException(String.format("Fail to instantiate class [%s] of plugin [%s]", mainClass, pluginKey), e);
         }
index 9f8d85f268981f8bf7cd0443ddc2ffbe3558ca0e..636dc7e5eddd876e337aa9c2b68f8b30371214b0 100644 (file)
@@ -35,7 +35,7 @@ import java.util.regex.Pattern;
 import java.util.zip.ZipEntry;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.sonar.api.utils.MessageException;
index 53bc4cc2c99bfc540de925eb2dfdbdb333a2b0f7..cd7e19b22ff0102c82fd5ddcceb5fab638ceedd2 100644 (file)
@@ -21,9 +21,9 @@ package org.sonar.core.user;
 
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
 import org.sonar.api.user.User;
 
 /**
index 3537eff1e30e34bcfedb521cc175921cfdea617e..8acf3a9cc8f478ba47d21cd2fc0173f7afdbaef6 100644 (file)
@@ -25,7 +25,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.NoSuchElementException;
 import javax.annotation.CheckForNull;
-import org.apache.commons.lang.ArrayUtils;
+import org.apache.commons.lang3.ArrayUtils;
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static java.util.Objects.requireNonNull;
index 7166737617cbc74cd1f21398c0d236a93d3c04e7..7e7f7917c0ce7dda6306e5dadb952a56e3b6b14f 100644 (file)
@@ -27,7 +27,7 @@ import java.util.List;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 
 /**
  * A runtime exception that provides contextual information as a list of key-value
index 32b10651ead4d9b95e049ba795fbea0c3c6b7b07..51aa70811d56fa93a9c73b47a1f0b119f7373baf 100644 (file)
@@ -20,7 +20,7 @@
 package org.sonar.core.util;
 
 import com.google.common.annotations.VisibleForTesting;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 
 import java.util.concurrent.atomic.AtomicInteger;
 
index ac741e9a8d1a3f286c4a404968711d6dea3353ee..bf9669067335c92c3ffbf47aa615d17efeb37927 100644 (file)
@@ -20,9 +20,9 @@
 package org.sonar.core.util;
 
 import java.util.Locale;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 
-import static org.apache.commons.lang.StringUtils.trim;
+import static org.apache.commons.lang3.StringUtils.trim;
 
 public final class SettingFormatter {
   private SettingFormatter() {
index 846415ee4f2da942851688ed953057eab01ff803..5ab3dceefdcdaed580d3bd17ea6616e1e55e458c 100644 (file)
@@ -22,9 +22,9 @@ package org.sonar.core.util.logs;
 import java.util.LinkedHashMap;
 import java.util.Map;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
-import org.sonar.api.utils.System2;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
+import org.sonar.api.utils.System2;
 import org.sonar.api.utils.log.LoggerLevel;
 
 class DefaultProfiler extends Profiler {
index 2c97f6f2b668bf67e6fd85a1392694f7a5ff0181..a550be9ca87b4d61919ec51a3c0b931eaddd95d9 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.core.issue;
 
 import java.util.List;
 import java.util.Map;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.Test;
 import org.sonar.api.issue.Issue;
 import org.sonar.api.issue.IssueStatus;
index 4f18d6dfd2680b53cfa9545858e18787d0d4e7c0..a32e8eb66816bc7ee627561318739261cf37db22 100644 (file)
@@ -30,7 +30,7 @@ import org.junit.Test;
 import org.sonar.api.rule.RuleKey;
 
 import static java.util.Arrays.asList;
-import static org.apache.commons.lang.StringUtils.trim;
+import static org.apache.commons.lang3.StringUtils.trim;
 import static org.assertj.core.api.Assertions.assertThat;
 
 public class TrackerTest {
index 6729412189198b24744f36a157bc1e872128bc50..cec48fb6a7fe09eacef78e1ee20a1e995183a813 100644 (file)
@@ -23,7 +23,7 @@ import com.sonarsource.plugins.license.api.FooBar;
 import java.io.File;
 import java.util.List;
 import java.util.Map;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.Test;
 import org.sonar.api.server.rule.RulesDefinition;
 
index c427f1abc8a2bd9551d7e18e3a6dd8c08e6ca58d..792687975deaac01ca9da98bc3e355578d1d3421 100644 (file)
@@ -30,8 +30,8 @@ import java.util.stream.Stream;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
-import static org.apache.commons.lang.StringUtils.repeat;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.StringUtils.repeat;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.sonar.core.platform.ServerId.DATABASE_ID_LENGTH;
index 12366cbd32b3f4a6341295c84c225189b46fe4ab..c446697d5fb517dfb902ad1965c9d943222a3d7b 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.core.sarif;
 import java.util.Set;
 import org.junit.Test;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 
 
index a9600d5a6a206f3a9f5c99fc8e4388f7a4c6e9d8..11797d5ea93b7a05326b262cc4e9051795f13502 100644 (file)
@@ -27,7 +27,7 @@ import java.util.Set;
 import java.util.stream.Collectors;
 import java.util.stream.IntStream;
 import java.util.stream.Stream;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
index 4992a3975a724ea57f5c9a5658a6ff09e009803e..e6ad1e12fc46a9a78e2cd8560533ee72d74d9f96 100644 (file)
@@ -25,7 +25,7 @@ import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.attribute.BasicFileAttributes;
 import javax.annotation.CheckForNull;
-import org.apache.commons.lang.SystemUtils;
+import org.apache.commons.lang3.SystemUtils;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
index 714a4651345af33890cb3854faf6dcf787c61ef3..4e7c2fc790c9218e32540ecf12c3e6bc3f7ab6b2 100644 (file)
@@ -7,7 +7,7 @@ sonar {
 dependencies {
   // please keep list ordered
 
-  api 'commons-lang:commons-lang'
+  api 'org.apache.commons:commons-lang3'
   api 'org.codehaus.sonar:sonar-channel'
 
   testImplementation 'ch.qos.logback:logback-classic'
index 5cc06455e524dc56305ab2d4f1fc996a2aca7e04..9431f9c61e5bf2b6eab1fd0c2044cb91971f43c6 100644 (file)
@@ -19,7 +19,7 @@
  */
 package org.sonar.markdown;
 
-import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.commons.lang3.StringEscapeUtils;
 import org.sonar.channel.ChannelDispatcher;
 import org.sonar.channel.CodeReader;
 
@@ -54,6 +54,6 @@ public final class Markdown {
   }
 
   public static String convertToHtml(String input) {
-    return new Markdown().convert(StringEscapeUtils.escapeHtml(input));
+    return new Markdown().convert(StringEscapeUtils.escapeHtml4(input));
   }
 }
index 3c1f5be70b9c0124075b86631cb63ec1e4c7a446..3731d7b28b0b887487e8ef21868be4fb75848db5 100644 (file)
@@ -9,7 +9,7 @@ dependencies {
 
   api 'commons-codec:commons-codec'
   api 'commons-io:commons-io'
-  api 'commons-lang:commons-lang'
+  api 'org.apache.commons:commons-lang3'
   api 'org.apache.commons:commons-csv'
   api 'org.sonarsource.api.plugin:sonar-plugin-api'
 
index 6bb2953a5fefc925e7601c59c98c197e2374892b..76308148feeb0ecd37e0b39a3b9b755e3269cc88 100644 (file)
@@ -30,12 +30,12 @@ import java.util.HashMap;
 import java.util.Map;
 import javax.annotation.CheckForNull;
 import javax.annotation.concurrent.Immutable;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.SystemUtils;
-import org.sonar.api.CoreProperties;
-import org.sonar.api.batch.bootstrap.ProjectDefinition;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.SystemUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.sonar.api.CoreProperties;
+import org.sonar.api.batch.bootstrap.ProjectDefinition;
 
 @Immutable
 public abstract class AbstractProjectOrModule extends DefaultInputComponent {
index b2a99b1c64fe360ee06b0f11714bfafb4423d608..c7e1a59ec3611d212358b573d6302aad800c3046 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.api.batch.fs.internal;
 import java.io.File;
 import java.net.URI;
 import java.nio.file.Path;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.batch.fs.InputDir;
 import org.sonar.api.utils.PathUtils;
 
index e6ed000b717f4f61a2982ab053b9c5f38c011db4..b6c3d2668de522f4f5dd80c47744b7a3a87a9d2d 100644 (file)
@@ -23,11 +23,11 @@ import java.nio.file.Path;
 import java.util.Arrays;
 import javax.annotation.concurrent.ThreadSafe;
 import org.apache.commons.io.FilenameUtils;
-import org.apache.commons.lang.StringUtils;
-import org.sonar.api.utils.PathUtils;
-import org.sonar.api.utils.WildcardPattern;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.sonar.api.utils.PathUtils;
+import org.sonar.api.utils.WildcardPattern;
 
 @ThreadSafe
 public abstract class PathPattern {
index ad7542e59b101625563114d46ff42fb45120d4ea..9afdf89f9c97d6359adda623c1597c8c22b6ae3d 100644 (file)
@@ -25,7 +25,7 @@ import java.util.Map;
 import java.util.Set;
 import javax.annotation.Nullable;
 import javax.annotation.concurrent.Immutable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.rule.RuleKey;
 import org.sonar.api.rule.Severity;
 
index ff071a22ac1e05ec30b123b7202567afb0957916..f30a0b5837113e44d0c0ea59f93ead1b5839b9ae 100644 (file)
@@ -22,8 +22,8 @@ package org.sonar.api.batch.rule.internal;
 import java.util.HashMap;
 import java.util.Map;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.ObjectUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.rule.RuleKey;
 import org.sonar.api.rule.RuleStatus;
 import org.sonar.api.rule.Severity;
index ed60c2ecfe89ae3076acc0139ae5e22cb65d6d69..05d07cac09ab0ef0dc6a15b79eb4e12f7fbecac8 100644 (file)
@@ -19,8 +19,8 @@
  */
 package org.sonar.api.batch.sensor.highlighting.internal;
 
-import org.apache.commons.lang.builder.ReflectionToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
+import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
 import org.sonar.api.batch.fs.TextRange;
 import org.sonar.api.batch.sensor.highlighting.TypeOfText;
 
index 86b1dc8499d4973b5b60d3309bb74cbb3861e5a6..c22d6ac6c56e860ad7588b8a6156cfa78b133f97 100644 (file)
@@ -20,8 +20,8 @@
 package org.sonar.api.batch.sensor.internal;
 
 import javax.annotation.Nullable;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
 
 import static java.util.Objects.requireNonNull;
 import static org.sonar.api.utils.Preconditions.checkState;
index 15110b5592ebdf0c3e9870c490b6223ccd494140..1631d8de7b8b32fd1be0aff27414144ce163bcff 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.api.batch.sensor.issue.internal;
 
 import java.util.ArrayList;
 import java.util.List;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.batch.fs.InputComponent;
 import org.sonar.api.batch.fs.TextRange;
 import org.sonar.api.batch.fs.internal.DefaultInputFile;
@@ -32,8 +32,8 @@ import org.sonar.api.batch.sensor.issue.NewMessageFormatting;
 import org.sonar.api.issue.Issue;
 
 import static java.util.Objects.requireNonNull;
-import static org.apache.commons.lang.StringUtils.abbreviate;
-import static org.apache.commons.lang.StringUtils.trim;
+import static org.apache.commons.lang3.StringUtils.abbreviate;
+import static org.apache.commons.lang3.StringUtils.trim;
 import static org.sonar.api.utils.Preconditions.checkArgument;
 import static org.sonar.api.utils.Preconditions.checkState;
 
index 58bd61f05f91b774410aacc9accdc85b8c6617ed..4b7b570a7a11ebc3633a96eddef093f0d30c66b4 100644 (file)
@@ -21,8 +21,8 @@ package org.sonar.api.batch.sensor.measure.internal;
 
 import java.io.Serializable;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.sonar.api.batch.fs.InputComponent;
 import org.sonar.api.batch.measure.Metric;
 import org.sonar.api.batch.sensor.internal.DefaultStorable;
index 347c1f719c12819270b1981ccdca18fae9b21663..791f335179318ca3eef80a181d21ec48901cc526 100644 (file)
@@ -32,7 +32,7 @@ import org.sonar.api.issue.impact.SoftwareQuality;
 import org.sonar.api.rules.CleanCodeAttribute;
 import org.sonar.api.rules.RuleType;
 
-import static org.apache.commons.lang.StringUtils.isNotBlank;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
 import static org.sonar.api.utils.Preconditions.checkState;
 
 public class DefaultAdHocRule extends DefaultStorable implements AdHocRule, NewAdHocRule {
index cae98056a20e773dfff7a65d89f5ac6712eb6d75..2484cc59a7428e6010ba60c32cafc49feadb613e 100644 (file)
@@ -29,7 +29,7 @@ import javax.crypto.SecretKey;
 import javax.crypto.spec.SecretKeySpec;
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
 import static org.sonar.api.CoreProperties.ENCRYPTION_SECRET_KEY_PATH;
index 4da4a7352d222a127e9cc7f84b9efaf3b9f701bb..3577821210ce75d3e6a171948c6ec57e55578b15 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.api.config.internal;
 import java.nio.charset.StandardCharsets;
 import javax.annotation.Nullable;
 import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 
 /**
  * @deprecated since 8.7.0
index 13e5b6e14918e952b670c4d7309f4ee9d505721e..0887f666db1a401d14d762d342487041c21a1bec 100644 (file)
@@ -24,9 +24,8 @@ import java.nio.charset.StandardCharsets;
 import java.security.SecureRandom;
 import javax.annotation.Nullable;
 import javax.crypto.spec.GCMParameterSpec;
-
 import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 
 final class AesGCMCipher extends AesCipher {
   private static final int GCM_TAG_LENGTH_IN_BITS = 128;
index 03b3b8d8f274881edff79569ec86beb0bd46dfcc..d15a08d88787bed0f0497413f18e844ce9054097 100644 (file)
@@ -30,7 +30,7 @@ import java.util.function.UnaryOperator;
 import org.apache.commons.csv.CSVFormat;
 import org.apache.commons.csv.CSVParser;
 import org.apache.commons.csv.CSVRecord;
-import org.apache.commons.lang.ArrayUtils;
+import org.apache.commons.lang3.ArrayUtils;
 
 import static java.util.function.UnaryOperator.identity;
 
index 69d6b8eaa8363175923104458a0240aa238e1916..d05b5ae4698511aa4bfe7fb6dffb8ae10cec5b61 100644 (file)
@@ -29,14 +29,14 @@ import java.util.Properties;
 import java.util.stream.Collectors;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.ArrayUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.config.PropertyDefinition;
 import org.sonar.api.config.PropertyDefinitions;
 import org.sonar.api.utils.DateUtils;
 
 import static java.util.Objects.requireNonNull;
-import static org.apache.commons.lang.StringUtils.trim;
+import static org.apache.commons.lang3.StringUtils.trim;
 
 /**
  * Implementation of the deprecated Settings interface
index 897af9a8108134c84e2f839195abc940dcae17dd..d9b07614df7a83357549857a1f2edd323a1ce368 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.api.impl.utils;
 import java.io.File;
 import java.io.IOException;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.rules.ExternalResource;
 import org.junit.rules.TemporaryFolder;
 import org.junit.runner.Description;
index 8bf5851b8561391cfc4fcd0f5949999cfdc99da4..9340720857ba4d05a82f633c5d659fd02087805b 100644 (file)
@@ -23,7 +23,7 @@ import java.io.UnsupportedEncodingException;
 import java.net.URLEncoder;
 import java.nio.charset.StandardCharsets;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 
 public class ScannerUtils {
 
index c48699b2323d6a5d39f62e3201f4a3171546a35f..b5ab2d971055f6ad9a4260ac1b9ae6cbaf7e8a31 100644 (file)
@@ -21,8 +21,8 @@ package org.sonar.api.impl.utils;
 
 import java.io.Serializable;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
 
 /**
  * @since 4.2
index b1d220a1227923ebce707fe9d36cd911b38bbf34..cc62c256c08d18fd6ec6add5e9a4839adf555705 100644 (file)
@@ -33,7 +33,7 @@ import static java.lang.String.format;
 import static java.util.Collections.emptyList;
 import static java.util.Collections.singletonList;
 import static java.util.Objects.requireNonNull;
-import static org.apache.commons.lang.StringUtils.defaultString;
+import static org.apache.commons.lang3.StringUtils.defaultString;
 import static org.sonar.api.utils.Preconditions.checkArgument;
 
 /**
index e0c75d17013479f1b6b3532e6f5e9e32c1e150d1..ad8e12b610a4fa8bc7a9abcbbd10b79fd6528890 100644 (file)
@@ -28,7 +28,7 @@ import org.sonar.api.SonarEdition;
 import org.sonar.api.utils.System2;
 import org.sonar.api.utils.Version;
 
-import static org.apache.commons.lang.StringUtils.trimToEmpty;
+import static org.apache.commons.lang3.StringUtils.trimToEmpty;
 
 /**
  * For internal use
index 68740e3bb6eea21c89121efcb8d2d21d51b47e92..6bbddeaadd656efc5b31618b0a2bde21f49f98eb 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.api.batch.fs.internal;
 
 import java.nio.file.Path;
 import java.nio.file.Paths;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.assertj.core.api.Assertions;
 import org.junit.Test;
 
index 6e06b926ddd576c3332008950c6f6fe9dab2527a..8a6aa88043a9a23859e64b28c686f43b83f467fc 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.api.batch.sensor.issue.internal;
 
 import java.util.Collections;
 import java.util.List;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.Test;
 import org.sonar.api.batch.fs.InputFile;
 import org.sonar.api.batch.fs.internal.TestInputFileBuilder;
index 162188606f3c93bab1cf8639dd6a7f4ed1dc15ca..cf57bcf914a145571dd5abcacb1131d8c4f3d1f6 100644 (file)
@@ -25,7 +25,7 @@ import java.security.InvalidKeyException;
 import java.security.Key;
 import javax.crypto.BadPaddingException;
 import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.Test;
 
 import static org.assertj.core.api.Assertions.assertThat;
index 9be49c2176b00eeda51e2c30c8e1e63b1bfe9ff0..e402d11efd0881fd8d2685b40686bbcf16ef5a01 100644 (file)
@@ -23,8 +23,7 @@ import java.io.File;
 import java.net.URL;
 import java.security.InvalidKeyException;
 import javax.crypto.BadPaddingException;
-
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.Test;
 
 import static org.assertj.core.api.Assertions.assertThat;
index ca3a91e6e982cf7197557aa33e8a9d63b4810872..590788fd9af2b024e87a3ee2708ad6efc9343541 100644 (file)
@@ -42,7 +42,7 @@ import org.sonar.api.utils.DateUtils;
 import org.sonar.api.utils.System2;
 
 import static java.util.Collections.singletonList;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.ThrowableAssert.ThrowingCallable;
index 771c0e8a8b5d223d8891ba46d8e055cefd3e18b6..9e09ecd203146a1b2d33be696a1063193a5d4b64 100644 (file)
@@ -27,7 +27,7 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 
 import static java.util.function.UnaryOperator.identity;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.sonar.api.config.internal.MultivalueProperty.parseAsCsv;
index 14d071603ef3e97a266155a83c1b039503051dec..40ff8e0a2baefe7fdf627e2eafbc23a30ed64afe 100644 (file)
@@ -20,7 +20,7 @@ dependencies {
   api 'ch.qos.logback:logback-core'
   api 'commons-codec:commons-codec'
   api 'commons-io:commons-io'
-  api 'commons-lang:commons-lang'
+  api 'org.apache.commons:commons-lang3'
   api 'com.google.code.gson:gson'
   api 'org.apache.commons:commons-csv'
   api 'com.google.protobuf:protobuf-java'
index d160bd3f50e4d1f6e0abff23bb67733f2957602d..384e8a8a1644c272145606d63e58ed2d581cacf4 100644 (file)
@@ -30,8 +30,8 @@ import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.Random;
 import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.SystemUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.SystemUtils;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Rule;
index 7c2a1aaaa0aa25a193aac0991c18b39ba19c08e7..a7606c4c98b92908f3a7da43354e4afbedfb1205 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.batch.bootstrapper;
 import java.util.HashMap;
 import java.util.Map;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 
 /**
  * @since 2.14
index cc6f7b9b71b62f3139585ae6a7a20c57e923d289..4c275c7e4408fdc98617e5414691483aa8a0f924 100644 (file)
@@ -24,7 +24,7 @@ import ch.qos.logback.classic.Logger;
 import ch.qos.logback.classic.spi.ILoggingEvent;
 import ch.qos.logback.core.Appender;
 import java.io.File;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.LoggerFactory;
 import org.sonar.core.config.Logback;
 
index 9480c66e468b9c690f7a07737d249399f24995b1..788d8661eabd2772b12e26f13f5feadad753b863 100644 (file)
@@ -23,7 +23,7 @@ import java.time.Clock;
 import java.util.Date;
 import java.util.Optional;
 import java.util.function.Predicate;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.CoreProperties;
 import org.sonar.api.Startable;
 import org.sonar.api.config.Configuration;
index fd69f0413f50f7daa1cc8ba58575a192925450c2..eeb4f04ac9deb9e73ca0f413ee25eba9eea3c863 100644 (file)
@@ -28,7 +28,7 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.ClassUtils;
+import org.apache.commons.lang3.ClassUtils;
 import org.sonar.api.batch.DependedUpon;
 import org.sonar.api.batch.DependsUpon;
 import org.sonar.api.batch.Phase;
index 7c536195a8c90c1615a5efd6233f329a90d77eea..1d192ad95846b4afc4396582cc0be7d349af4b36 100644 (file)
@@ -32,7 +32,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import javax.annotation.CheckForNull;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.CoreProperties;
 import org.sonar.api.notifications.AnalysisWarnings;
 import org.sonar.api.utils.MessageException;
index c864911e1824181464d13f7ffe32657610a78734..821529b3d6064490901037a3bfbce58dfb282128 100644 (file)
  */
 package org.sonar.scanner.bootstrap;
 
-import org.apache.commons.lang.StringUtils;
-import org.sonar.api.CoreProperties;
-import org.sonar.api.impl.utils.DefaultTempFolder;
-import org.sonar.api.utils.System2;
-import org.sonar.api.utils.TempFolder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import static org.sonar.core.util.FileUtils.deleteQuietly;
-import org.springframework.context.annotation.Bean;
-
 import java.io.IOException;
 import java.nio.file.DirectoryStream;
 import java.nio.file.Files;
@@ -36,6 +26,16 @@ import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.nio.file.attribute.BasicFileAttributes;
 import java.util.concurrent.TimeUnit;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.sonar.api.CoreProperties;
+import org.sonar.api.impl.utils.DefaultTempFolder;
+import org.sonar.api.utils.System2;
+import org.sonar.api.utils.TempFolder;
+import org.springframework.context.annotation.Bean;
+
+import static org.sonar.core.util.FileUtils.deleteQuietly;
 
 public class GlobalTempFolderProvider {
   private static final Logger LOG = LoggerFactory.getLogger(GlobalTempFolderProvider.class);
index 7ae7dad9aa656cd017f0b8a6f788382d9217edb2..9d1dfe6fa0eaee94719570fa64123edc26c4cd6c 100644 (file)
@@ -29,7 +29,7 @@ import org.springframework.context.annotation.Bean;
 
 import static java.lang.Integer.parseInt;
 import static java.lang.String.valueOf;
-import static org.apache.commons.lang.StringUtils.defaultIfBlank;
+import static org.apache.commons.lang3.StringUtils.defaultIfBlank;
 import static org.sonar.core.config.ProxyProperties.HTTP_PROXY_PASSWORD;
 import static org.sonar.core.config.ProxyProperties.HTTP_PROXY_USER;
 
index 3c3bf87af47cfcc646aa1f2353f4ad371964f1fe..69a430dd8699de33165cd8bad86f477882f387c2 100644 (file)
@@ -23,7 +23,7 @@ import java.time.Clock;
 import java.util.List;
 import java.util.Map;
 import javax.annotation.Priority;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.sonar.api.CoreProperties;
index 76e993c3721ca9c8ab4d0637dc36a22910a681bb..e3292074409eef52060add56fb8076668c67f5c5 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.scanner.ci;
 import java.util.Optional;
 import javax.annotation.Nullable;
 
-import static org.apache.commons.lang.StringUtils.defaultIfBlank;
+import static org.apache.commons.lang3.StringUtils.defaultIfBlank;
 
 public class CiConfigurationImpl implements CiConfiguration {
   private final String ciName;
index a96e9fba67e5c0e6cc1e13fe90be7fa40614efaa..944a664637297b34069c95015964a0dff52eb360 100644 (file)
@@ -24,7 +24,7 @@ import org.sonar.scanner.ci.CiConfiguration;
 import org.sonar.scanner.ci.CiConfigurationImpl;
 import org.sonar.scanner.ci.CiVendor;
 
-import static org.apache.commons.lang.StringUtils.isBlank;
+import static org.apache.commons.lang3.StringUtils.isBlank;
 
 /**
  * Support of https://azure.microsoft.com/en-us/services/devops/
index 0466418894865ca9d9aee3e454e53cbbec62dc3f..5be6ef0c4bec5621de8dc11b76ee2e1fd162b8ca 100644 (file)
@@ -24,7 +24,7 @@ import org.sonar.scanner.ci.CiConfiguration;
 import org.sonar.scanner.ci.CiConfigurationImpl;
 import org.sonar.scanner.ci.CiVendor;
 
-import static org.apache.commons.lang.StringUtils.isNotEmpty;
+import static org.apache.commons.lang3.StringUtils.isNotEmpty;
 
 public class BitbucketPipelines implements CiVendor {
 
index a0fb45ea37c79c44c168dadaf71b222b8db599c3..7b920043961363bfa071abff64e92f9933551263 100644 (file)
  */
 package org.sonar.scanner.ci.vendors;
 
-import org.sonar.api.utils.System2;
 import org.slf4j.LoggerFactory;
+import org.sonar.api.utils.System2;
 import org.sonar.scanner.ci.CiConfiguration;
 import org.sonar.scanner.ci.CiConfigurationImpl;
 import org.sonar.scanner.ci.CiVendor;
 
-import static org.apache.commons.lang.StringUtils.isEmpty;
+import static org.apache.commons.lang3.StringUtils.isEmpty;
 
 /**
  * Support https://cirrus-ci.org/
index c37cac1b1cadbfa076864657f0cc23bdbf230e3d..1bb3865c9e96855ddbb94322f2e972e5c775d777 100644 (file)
  */
 package org.sonar.scanner.ci.vendors;
 
-import org.sonar.api.utils.System2;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.sonar.api.utils.System2;
 import org.sonar.scanner.ci.CiConfiguration;
 import org.sonar.scanner.ci.CiConfigurationImpl;
 import org.sonar.scanner.ci.CiVendor;
 
-import static org.apache.commons.lang.StringUtils.isEmpty;
+import static org.apache.commons.lang3.StringUtils.isEmpty;
 
 public class CodeMagic implements CiVendor {
 
index 7b48a90f6b4830bbe50c1d0e92211e2a2a95c81e..5cc999b72e18abc58d207241e8acdc9760a0bf62 100644 (file)
@@ -19,7 +19,7 @@
  */
 package org.sonar.scanner.ci.vendors;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.sonar.api.utils.System2;
@@ -28,7 +28,7 @@ import org.sonar.scanner.ci.CiConfigurationImpl;
 import org.sonar.scanner.ci.CiVendor;
 import org.sonar.scanner.ci.DevOpsPlatformInfo;
 
-import static org.apache.commons.lang.StringUtils.isEmpty;
+import static org.apache.commons.lang3.StringUtils.isEmpty;
 
 /**
  * Support of https://github.com/features/actions
index f3a262ba4260eb7c18459cd81d40b9ba0e7235b5..65002ce3037a8b4fe5ac6808b0c94d1224838dc0 100644 (file)
@@ -21,20 +21,20 @@ package org.sonar.scanner.ci.vendors;
 
 import java.nio.file.Path;
 import java.util.Optional;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.Ref;
 import org.eclipse.jgit.lib.Repository;
 import org.eclipse.jgit.lib.RepositoryBuilder;
-import org.sonar.api.batch.fs.internal.DefaultInputProject;
-import org.sonar.api.utils.System2;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.sonar.api.batch.fs.internal.DefaultInputProject;
+import org.sonar.api.utils.System2;
 import org.sonar.scanner.ci.CiConfiguration;
 import org.sonar.scanner.ci.CiConfigurationImpl;
 import org.sonar.scanner.ci.CiVendor;
 
-import static org.apache.commons.lang.StringUtils.isNotBlank;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
 
 public class Jenkins implements CiVendor {
   private static final Logger LOG = LoggerFactory.getLogger(Jenkins.class);
index f3e16a5fae18b3f61707e55224cc1bec8634102e..21f8f944d7829fab970630cd4a5e97eb2ecfc53f 100644 (file)
@@ -24,7 +24,7 @@ import org.sonar.scanner.ci.CiConfiguration;
 import org.sonar.scanner.ci.CiConfigurationImpl;
 import org.sonar.scanner.ci.CiVendor;
 
-import static org.apache.commons.lang.StringUtils.isNotEmpty;
+import static org.apache.commons.lang3.StringUtils.isNotEmpty;
 
 /**
  * Support https://semaphoreci.com
index 91ee2d6908e63f4dc082b9201701b6225b189a54..fc9f30caef5bd8e28cc6c60196d7633820d07a80 100644 (file)
@@ -24,7 +24,7 @@ import org.sonar.scanner.ci.CiConfiguration;
 import org.sonar.scanner.ci.CiConfigurationImpl;
 import org.sonar.scanner.ci.CiVendor;
 
-import static org.apache.commons.lang.StringUtils.isBlank;
+import static org.apache.commons.lang3.StringUtils.isBlank;
 
 /**
  * Support of https://travis-ci.com
index 46c36144fc94bf932201216b0ca840f1e67c37f5..57ebb4d907583cf68618dcfe2e44917899d8b032 100644 (file)
@@ -24,16 +24,16 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Optional;
 import javax.annotation.concurrent.Immutable;
-import org.apache.commons.lang.ArrayUtils;
+import org.apache.commons.lang3.ArrayUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.sonar.api.config.Configuration;
-import org.sonar.api.config.internal.Encryption;
 import org.sonar.api.config.PropertyDefinition;
 import org.sonar.api.config.PropertyDefinitions;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.sonar.api.config.internal.Encryption;
 
 import static java.util.Objects.requireNonNull;
-import static org.apache.commons.lang.StringUtils.trim;
+import static org.apache.commons.lang3.StringUtils.trim;
 import static org.sonar.api.config.internal.MultivalueProperty.parseAsCsv;
 
 @Immutable
index 848a54c12781ed2738f4c229c3087bc638159713..b8dba3ffdb80c1d90e107d5bf0840564a514aac3 100644 (file)
@@ -26,7 +26,7 @@ import java.util.Objects;
 import java.util.Set;
 import java.util.stream.Collectors;
 import javax.annotation.CheckForNull;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.sonar.api.batch.fs.InputFile;
index 79d6bd5121fb5464f8b8175cb0a04ec567ddb572..3fd28b9dd183059906519b6dcf1774631c487f96 100644 (file)
@@ -30,7 +30,7 @@ import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLResolver;
 import javax.xml.stream.XMLStreamException;
 import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.codehaus.staxmate.SMInputFactory;
 import org.codehaus.staxmate.in.SMHierarchicCursor;
 
index 33a0e1fc6d08613ed0e5941e658cb6e25d03ece8..ddb665c796595aa3b45f7edb6277b5b2865e02eb 100644 (file)
@@ -20,8 +20,8 @@
 package org.sonar.scanner.issue;
 
 import javax.annotation.concurrent.ThreadSafe;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
 import org.sonar.api.batch.fs.InputComponent;
 import org.sonar.api.batch.fs.TextRange;
 import org.sonar.api.batch.fs.internal.DefaultInputProject;
index 9e0b26e96dca58f85cbc808a124a30b086391e65..66329f4e6ac37be3d2f3cfa0ea7a61d177b406da 100644 (file)
@@ -26,7 +26,7 @@ import java.util.Map;
 import java.util.function.Consumer;
 import javax.annotation.Nullable;
 import javax.annotation.concurrent.ThreadSafe;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.batch.fs.TextRange;
 import org.sonar.api.batch.fs.internal.DefaultInputComponent;
 import org.sonar.api.batch.fs.internal.DefaultInputFile;
index a5142ab61699f5fea44b3401f6817c9bca63f8ce..37afea9f39806e89a326bce39511e1b2d35b2f65 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.scanner.issue.ignore.pattern;
 
 import java.util.ArrayList;
 import java.util.List;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.config.Configuration;
 import org.sonar.api.utils.MessageException;
 
index b06c73ca9a75a072937b602816a4fb1c802cd7d3..959780b8a37a45dbe287e6e2d44b9e90e8b633aa 100644 (file)
@@ -23,7 +23,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.config.Configuration;
 import org.sonar.api.utils.MessageException;
 import org.sonar.core.config.IssueExclusionProperties;
index d391d8064f4e851eda136d352d45fd1e043e38dd..84a0e7920bb0dfeb3511407f25d5c75cdb3791b5 100644 (file)
@@ -22,12 +22,12 @@ package org.sonar.scanner.issue.ignore.scanner;
 import java.util.ArrayList;
 import java.util.List;
 import javax.annotation.CheckForNull;
-import org.apache.commons.lang.StringUtils;
-import org.sonar.api.notifications.AnalysisWarnings;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.sonar.api.batch.fs.internal.DefaultInputFile;
 import org.sonar.api.batch.fs.internal.charhandler.CharHandler;
+import org.sonar.api.notifications.AnalysisWarnings;
 import org.sonar.scanner.issue.ignore.IgnoreIssuesFilter;
 import org.sonar.scanner.issue.ignore.pattern.BlockIssuePattern;
 import org.sonar.scanner.issue.ignore.pattern.IssueExclusionPatternInitializer;
index 3b68dc3737c477d54d4fef7b115285abde6f95bb..9ec8ac9ae9c33ca9cc1bbc1e0b1b581d990842ba 100644 (file)
@@ -20,7 +20,7 @@
 package org.sonar.scanner.platform;
 
 import java.util.Date;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.CoreProperties;
 import org.sonar.api.config.Configuration;
 import org.sonar.api.platform.Server;
@@ -28,7 +28,7 @@ import org.sonar.api.utils.DateUtils;
 import org.sonar.core.platform.SonarQubeVersion;
 import org.sonar.scanner.bootstrap.DefaultScannerWsClient;
 
-import static org.apache.commons.lang.StringUtils.trimToEmpty;
+import static org.apache.commons.lang3.StringUtils.trimToEmpty;
 
 public class DefaultServer extends Server {
 
index b09d782054a2a7a4ab693af229d52d9e541d5332..1bbddc452c54439367c120ddf4d736084cdd9862 100644 (file)
@@ -28,7 +28,7 @@ import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.TreeSet;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.CoreProperties;
 import org.sonar.api.batch.fs.internal.AbstractProjectOrModule;
 import org.sonar.api.batch.fs.internal.DefaultInputModule;
index 2a074d1cc9182f98ca0910a9eb8856baeb689fec..254ae3eb86796ac9763d2c1b9be22e5161e725b7 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.scanner.report;
 
 import java.util.Map;
 import javax.annotation.CheckForNull;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.CoreProperties;
 import org.sonar.api.batch.fs.InputFile;
 import org.sonar.api.batch.fs.InputFile.Status;
index cf9d79ba9b5ff9c59d67d738b27642e5ff4619ca..2f1787885ad2b1767fe9f2501875788bc366c6b3 100644 (file)
@@ -61,8 +61,8 @@ import org.sonarqube.ws.client.RequestWithPayload.Part;
 import org.sonarqube.ws.client.WsResponse;
 
 import static java.net.URLEncoder.encode;
-import static org.apache.commons.lang.StringUtils.EMPTY;
-import static org.apache.commons.lang.StringUtils.isBlank;
+import static org.apache.commons.lang3.StringUtils.EMPTY;
+import static org.apache.commons.lang3.StringUtils.isBlank;
 import static org.sonar.core.ce.CeTaskCharacteristics.BRANCH_TYPE;
 import static org.sonar.core.ce.CeTaskCharacteristics.DEVOPS_PLATFORM_PROJECT_IDENTIFIER;
 import static org.sonar.core.ce.CeTaskCharacteristics.DEVOPS_PLATFORM_URL;
index 6994ba5009e80dded864b39c9e9f38b29648ec12..9c17a76a8c2be953bada5f30c88f668df3fd6d00 100644 (file)
@@ -29,7 +29,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.commons.lang3.StringEscapeUtils;
 import org.sonar.api.impl.utils.ScannerUtils;
 import org.sonar.api.utils.log.Logger;
 import org.sonar.api.utils.log.Loggers;
index 1ba0126c134915bbd307130ac88639e27059f669..244fbe4aea94ff9e1caa1d166c12650d33a51804 100644 (file)
@@ -21,12 +21,12 @@ package org.sonar.scanner.scan;
 
 import com.google.common.annotations.VisibleForTesting;
 import java.util.Optional;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.sonar.api.CoreProperties;
 import org.sonar.api.config.Configuration;
 import org.sonar.api.notifications.AnalysisWarnings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.sonar.batch.bootstrapper.EnvironmentInformation;
 import org.sonar.scanner.bootstrap.ScannerWsClientProvider;
 
index bcf20ab71b8775aa15a325b767d47aacc6a614f6..858c302e093d3ac2d3c60f0f3fbb931dfe74854e 100644 (file)
@@ -34,8 +34,8 @@ import java.util.Map.Entry;
 import java.util.Objects;
 import java.util.stream.Stream;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.ArrayUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.CoreProperties;
 import org.sonar.api.batch.bootstrap.ProjectDefinition;
 import org.sonar.api.batch.bootstrap.ProjectReactor;
index 2d234d9a105a97e2bcd537f8cbdd4ab78fb2f96f..535b6b2a562570bd1f57b41459b2cc5599897af6 100644 (file)
@@ -34,7 +34,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 
 import static java.lang.String.format;
 import static java.util.Objects.nonNull;
-import static org.apache.commons.lang.StringUtils.isNotEmpty;
+import static org.apache.commons.lang3.StringUtils.isNotEmpty;
 import static org.sonar.core.component.ComponentKeys.ALLOWED_CHARACTERS_MESSAGE;
 import static org.sonar.core.config.ScannerProperties.BRANCHES_DOC_LINK_SUFFIX;
 import static org.sonar.core.config.ScannerProperties.BRANCH_NAME;
index 8cf507f04a417a1a0533146a46666b8d0dd478ee..6a1f1087c990a104161310728ec4d7cef1100f11 100644 (file)
 package org.sonar.scanner.scan;
 
 import java.util.Map;
-import org.apache.commons.lang.StringUtils;
-import org.sonar.api.CoreProperties;
-import org.sonar.api.notifications.AnalysisWarnings;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.sonar.api.CoreProperties;
+import org.sonar.api.notifications.AnalysisWarnings;
 import org.sonar.scanner.repository.settings.ProjectSettingsLoader;
 import org.springframework.context.annotation.Bean;
 
index 5ce70a9892ca49addc2890ab6994123ef701f466..36840fb6ac8bf446079ce7a028e757345b407844 100644 (file)
@@ -24,14 +24,14 @@ import java.util.Arrays;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
-import org.apache.commons.lang.ArrayUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.sonar.api.CoreProperties;
 import org.sonar.api.batch.fs.InputFile;
 import org.sonar.api.batch.fs.internal.PathPattern;
 import org.sonar.api.notifications.AnalysisWarnings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import static java.lang.String.format;
 import static org.sonar.api.CoreProperties.PROJECT_TESTS_EXCLUSIONS_PROPERTY;
index ea0bacb9a594709d860e670fde9020b2411b70bd..e4e968daf8aba5f2d72c230e6fc3a29c2e177c50 100644 (file)
@@ -29,7 +29,7 @@ import java.nio.file.LinkOption;
 import java.nio.file.Path;
 import java.nio.file.attribute.BasicFileAttributes;
 import java.nio.file.attribute.DosFileAttributes;
-import org.apache.commons.lang.SystemUtils;
+import org.apache.commons.lang3.SystemUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.sonar.api.batch.fs.InputFile;
index dba9523c6bffba4bce69a1500a2983957746bca3..8873d79c60eb9b49e625db165de85d11350a205c 100644 (file)
@@ -31,7 +31,7 @@ import java.util.stream.Collectors;
 import java.util.stream.Stream;
 import javax.annotation.CheckForNull;
 import javax.annotation.concurrent.ThreadSafe;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.sonar.api.batch.fs.internal.PathPattern;
index 3aa51baeca4d45530faa350366fdbcafbc343726..6f8815222ae2a92d154f4d28cfc43e354f168977 100644 (file)
@@ -29,7 +29,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Optional;
 import java.util.concurrent.TimeUnit;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.sonar.api.batch.fs.InputFile.Type;
index d8fae760a6268468e2cb5366767be822c8d5cdde..24a8c5d304f2b4054a0225ff2700ddb6ea6d64a4 100644 (file)
@@ -20,7 +20,7 @@
 package org.sonar.scanner.scan.filesystem;
 
 import javax.annotation.concurrent.Immutable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.api.batch.fs.InputFile;
 import org.sonar.api.batch.fs.internal.DefaultInputFile;
 import org.sonar.scanner.repository.FileData;
index 113064a9cfd9bd5134c013d905e6f1d339d3313c..75ae9a29db54e5c9946119d37c5bc48fb0fc4f68 100644 (file)
@@ -28,14 +28,14 @@ import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.sonar.api.batch.fs.InputFile;
 import org.sonar.api.batch.fs.internal.DefaultInputFile;
 import org.sonar.api.batch.scm.BlameCommand.BlameOutput;
 import org.sonar.api.batch.scm.BlameLine;
 import org.sonar.api.notifications.AnalysisWarnings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.sonar.core.documentation.DocumentationLinkGenerator;
 import org.sonar.scanner.protocol.output.ScannerReport;
 import org.sonar.scanner.protocol.output.ScannerReport.Changesets.Builder;
index 443a4801dc9228c9f7aaf50cbaf7aa046c9fa5c1..1a156d7e704c664c418183d4d0c4e2faaad5f8d1 100644 (file)
@@ -23,7 +23,9 @@ import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.stream.Collectors;
 import javax.annotation.CheckForNull;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.sonar.api.CoreProperties;
 import org.sonar.api.Properties;
 import org.sonar.api.Property;
@@ -33,8 +35,6 @@ import org.sonar.api.batch.scm.ScmProvider;
 import org.sonar.api.config.Configuration;
 import org.sonar.api.notifications.AnalysisWarnings;
 import org.sonar.api.utils.MessageException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.sonar.core.config.ScannerProperties;
 import org.sonar.scanner.fs.InputModuleHierarchy;
 
index c7c01c2c5395586773c176ec00cb9c84bf63c138..be3311e69d72ba666a44c2b84ea3d5230aacb031 100644 (file)
@@ -21,7 +21,9 @@ package org.sonar.scanner.scm;
 
 import java.util.LinkedList;
 import java.util.List;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.sonar.api.CoreProperties;
 import org.sonar.api.batch.fs.FileSystem;
 import org.sonar.api.batch.fs.InputFile;
@@ -29,8 +31,6 @@ import org.sonar.api.batch.fs.InputFile.Status;
 import org.sonar.api.batch.fs.internal.DefaultInputFile;
 import org.sonar.api.batch.scm.ScmProvider;
 import org.sonar.api.notifications.AnalysisWarnings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.sonar.core.documentation.DocumentationLinkGenerator;
 import org.sonar.scanner.protocol.output.ScannerReport;
 import org.sonar.scanner.protocol.output.ScannerReport.Changesets.Builder;
index 4ec04af0f952ced46fd70f12ef101e4a3d819eea..e05ecf758a384f146408be0a7b1996c3ea4c6586 100644 (file)
 package org.sonar.scanner.scm;
 
 import java.util.Optional;
-import org.sonar.api.batch.scm.ScmProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.sonar.api.batch.scm.ScmProvider;
 import org.sonar.scanner.bootstrap.ScannerProperties;
 import org.sonar.scanner.ci.CiConfiguration;
 import org.sonar.scanner.fs.InputModuleHierarchy;
 
-import static org.apache.commons.lang.StringUtils.isBlank;
+import static org.apache.commons.lang3.StringUtils.isBlank;
 import static org.sonar.scanner.scan.ScanProperties.SCM_REVISION;
 
 public class ScmRevisionImpl implements ScmRevision {
index 8dc7bf70ce986a217efd88fced0384ddf688ca3c..23ac5478766d90633c7e71e21c1959961394b40d 100644 (file)
@@ -28,12 +28,12 @@ import java.util.List;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
-import org.apache.commons.lang.math.NumberUtils;
+import org.apache.commons.lang3.math.NumberUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.sonar.api.batch.scm.BlameLine;
 import org.sonar.api.utils.System2;
 import org.sonar.api.utils.Version;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import static java.util.Collections.emptyList;
index db8391901398f7ec1eb27260b9d5de3325f4b489..943a40144c0af02a45ee0c1f73d57d7f0a62edfa 100644 (file)
@@ -26,17 +26,15 @@ import java.time.ZoneId;
 import java.time.ZoneOffset;
 import java.util.Date;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.params.ParameterizedTest;
-import org.junit.jupiter.params.provider.EmptySource;
 import org.junit.jupiter.params.provider.NullAndEmptySource;
-import org.junit.jupiter.params.provider.NullSource;
 import org.sonar.api.CoreProperties;
 import org.sonar.api.config.internal.MapSettings;
 import org.sonar.api.utils.MessageException;
 
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.Mockito.mock;
index 39e87f202702b153b47aa52e4c578a64019c2f2a..cac8b43768984b463c3d52ad60be944412d7d175 100644 (file)
@@ -22,7 +22,7 @@ package org.sonar.scanner;
 import java.io.InputStream;
 import java.io.Reader;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.mockito.ArgumentMatcher;
 import org.sonar.scanner.bootstrap.DefaultScannerWsClient;
 import org.sonarqube.ws.client.WsRequest;
index a3401061a57a324f74078625295aec57bba8ec87..07bcae141a71e1af7c1d3ccdf7f6299d02d9e170 100644 (file)
@@ -24,7 +24,7 @@ import java.time.ZoneOffset;
 import java.time.format.DateTimeFormatter;
 import java.util.Collections;
 import java.util.List;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.Rule;
 import org.junit.Test;
 import org.mockito.Mockito;
index 351913c9a1f079c575fec0e2fbd4e3c471b35136..e8159ed92ba32205c000c2dabee37947b089ee20 100644 (file)
@@ -20,8 +20,7 @@
 package org.sonar.scanner.bootstrap;
 
 import java.util.Arrays;
-
-import org.apache.commons.lang.ClassUtils;
+import org.apache.commons.lang3.ClassUtils;
 import org.junit.Test;
 import org.sonar.api.Plugin;
 import org.sonar.api.SonarRuntime;
index c39887b17c4d0c19ea94322a30b01edf995b0f47..a252bbbe3a0e0c187dc79efcd64f8e89ffa12e6d 100644 (file)
@@ -33,7 +33,7 @@ import okhttp3.mockwebserver.MockWebServer;
 import okio.Buffer;
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
index 549a8517a164fa70b7f7989727d2c9db08c161ad..bdbd28fcdaaf5658b11dfe19c65f7af1b1d5351b 100644 (file)
 package org.sonar.scanner.externalissue;
 
 import java.io.File;
+import java.security.SecureRandom;
 import java.util.Map;
+import java.util.Random;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.math.RandomUtils;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -41,8 +42,8 @@ import org.sonar.api.rules.RuleType;
 import org.sonar.api.testfixtures.log.LogTester;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
-import static org.apache.commons.lang.ObjectUtils.defaultIfNull;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.ObjectUtils.defaultIfNull;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.sonar.api.issue.impact.Severity.HIGH;
@@ -57,6 +58,8 @@ public class ExternalIssueImporterTest {
   public static final String RULE_NAME = "some_rule_name";
   public static final CleanCodeAttribute RULE_ATTRIBUTE = CleanCodeAttribute.FORMATTED;
 
+  private final Random random = new SecureRandom();
+
   @Rule
   public TemporaryFolder temp = new TemporaryFolder();
   @Rule
@@ -381,7 +384,7 @@ public class ExternalIssueImporterTest {
     input.ruleId = randomAlphabetic(5);
     input.severity = "CRITICAL";
     input.type = "BUG";
-    input.effortMinutes = RandomUtils.nextInt();
+    input.effortMinutes = random.nextInt(Integer.MAX_VALUE);
     input.primaryLocation = new ExternalIssueReport.Location();
     input.primaryLocation.filePath = sourceFile.getProjectRelativePath();
     input.primaryLocation.message = randomAlphabetic(5);
index 4133dddf0adeb2997118f8e02494f9937443964a..ab647c6a29d12929de53513775caec4d17f6fd6c 100644 (file)
@@ -27,15 +27,15 @@ import java.util.Arrays;
 import java.util.List;
 import java.util.Properties;
 import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
 import org.sonar.api.batch.bootstrap.ProjectDefinition;
 import org.sonar.api.batch.fs.internal.DefaultInputModule;
-import org.sonar.api.utils.System2;
 import org.sonar.api.testfixtures.log.LogTester;
+import org.sonar.api.utils.System2;
 import org.sonar.api.utils.log.LoggerLevel;
 import org.sonar.core.platform.PluginInfo;
 import org.sonar.scanner.bootstrap.GlobalServerSettings;
index cda7b52c3777a0a002cb20a0fb0aac36fbe18552..91607834d0dda181a7fb05e4877974a84439a499 100644 (file)
@@ -60,7 +60,7 @@ import org.sonar.scanner.scm.ScmConfiguration;
 import org.sonar.scanner.scm.ScmRevision;
 
 import static java.util.Collections.emptyMap;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.entry;
 import static org.mockito.ArgumentMatchers.any;
index 25d5800a45f687e8ac02c2dc9d73df0731c244dd..7ed5fc9e084876292e1131f61b68f174b93c0cef 100644 (file)
@@ -28,14 +28,14 @@ import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.Rule;
 import org.junit.Test;
 import org.sonar.api.batch.bootstrap.ProjectDefinition;
 import org.sonar.api.batch.bootstrap.ProjectReactor;
 import org.sonar.api.notifications.AnalysisWarnings;
-import org.sonar.api.utils.MessageException;
 import org.sonar.api.testfixtures.log.LogTester;
+import org.sonar.api.utils.MessageException;
 import org.sonar.scanner.bootstrap.ScannerProperties;
 
 import static java.util.Collections.emptyMap;
index e24235de671347ce674be9c880a26e9f13d7182e..3be0fda2132cc2773d539507ffc1a751970d27c4 100644 (file)
@@ -38,7 +38,7 @@ import org.sonar.scanner.ProjectInfo;
 import org.sonar.scanner.bootstrap.GlobalConfiguration;
 
 import static java.lang.String.format;
-import static org.apache.commons.lang.RandomStringUtils.randomAscii;
+import static org.apache.commons.lang3.RandomStringUtils.randomAscii;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.mock;
index 65c98bae53066fe74b18503c743474a648c2204f..64d7a67e1f30dce2831f1f760316dd0bca5073d6 100644 (file)
@@ -29,7 +29,7 @@ import java.nio.file.Paths;
 import java.util.List;
 import java.util.Random;
 import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
index 4f76294bf5fb50bbc877e8c7aee27f3239ee1e6d..382eae972e86baadeaa6bafc31ab53c82604a7e8 100644 (file)
@@ -32,7 +32,7 @@ import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.Arrays;
 import java.util.List;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.Before;
 import org.junit.Test;
 import org.sonar.scanner.scan.filesystem.CharsetValidation.Validation;
index b7794c959a843b44dc4a9c170fc54f4ecd015dd7..59bc00a3654f50f9bd6297d9efa0259ec842762c 100644 (file)
@@ -27,7 +27,7 @@ import java.nio.file.Files;
 import java.nio.file.LinkOption;
 import java.nio.file.Path;
 import java.nio.file.attribute.BasicFileAttributes;
-import org.apache.commons.lang.SystemUtils;
+import org.apache.commons.lang3.SystemUtils;
 import org.junit.ClassRule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
index 1f05e6cc9eb6f1cba0f2c5e020f50cb34d11bb84..1bb25a29438285ca0017e23042f2db3e14711ab6 100644 (file)
@@ -26,8 +26,8 @@ import org.sonar.api.batch.fs.internal.DefaultIndexedFile;
 import org.sonar.api.batch.fs.internal.DefaultInputFile;
 import org.sonar.api.batch.fs.internal.SensorStrategy;
 
-import static org.apache.commons.lang.RandomStringUtils.random;
-import static org.apache.commons.lang.RandomStringUtils.randomNumeric;
+import static org.apache.commons.lang3.RandomStringUtils.random;
+import static org.apache.commons.lang3.RandomStringUtils.randomNumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 
 public class ChangedFileTest {
index ae3e1cb1aa680129ad8fc32400f003c6161c3ef1..81580d127870009451068f9c0fefb83394266fff 100644 (file)
@@ -27,6 +27,7 @@ import java.nio.file.LinkOption;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.nio.file.StandardOpenOption;
+import java.security.SecureRandom;
 import java.time.Instant;
 import java.util.Arrays;
 import java.util.Collections;
@@ -57,10 +58,10 @@ import org.junit.rules.TemporaryFolder;
 import org.sonar.api.config.Configuration;
 import org.sonar.api.notifications.AnalysisWarnings;
 import org.sonar.api.scan.filesystem.PathResolver;
-import org.sonar.api.utils.MessageException;
-import org.sonar.api.utils.System2;
 import org.sonar.api.testfixtures.log.LogAndArguments;
 import org.sonar.api.testfixtures.log.LogTester;
+import org.sonar.api.utils.MessageException;
+import org.sonar.api.utils.System2;
 import org.sonar.core.documentation.DocumentationLinkGenerator;
 import org.sonar.scm.git.strategy.DefaultBlameStrategy;
 
@@ -122,7 +123,7 @@ public class GitScmProviderTest {
   public LogTester logs = new LogTester();
 
   private final GitIgnoreCommand gitIgnoreCommand = mock(GitIgnoreCommand.class);
-  private static final Random random = new Random();
+  private static final Random RANDOM = new SecureRandom();
   private static final System2 system2 = mock(System2.class);
 
   private Path worktree;
@@ -812,7 +813,7 @@ public class GitScmProviderTest {
     for (int i = 0; i < 4; i++) {
       sb.append(' ');
       for (int j = 0; j < prefix.length(); j++) {
-        sb.append((char) ('a' + random.nextInt(26)));
+        sb.append((char) ('a' + RANDOM.nextInt(26)));
       }
     }
     return sb.toString();
index 3e45afc6882c85d344fe9998d9189e971d2eb25c..18158a88d5c571e2e0d2fa607d978b1a2f53c3ba 100644 (file)
@@ -10,7 +10,7 @@ dependencies {
   api 'com.google.code.gson:gson'
   api 'com.google.protobuf:protobuf-java'
   api 'commons-io:commons-io'
-  api 'commons-lang:commons-lang'
+  api 'org.apache.commons:commons-lang3'
   api project(':sonar-core')
 
   compileOnlyApi 'com.google.code.findbugs:jsr305'
index 73827224313d766578c907f054fdde90a1c56ab8..e21a64a8bed35d54ad6440ca7209e6edc99b4944 100644 (file)
@@ -50,7 +50,7 @@ import javax.swing.tree.DefaultMutableTreeNode;
 import javax.swing.tree.DefaultTreeModel;
 import javax.swing.tree.TreeSelectionModel;
 import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.sonar.core.util.CloseableIterator;
 import org.sonar.scanner.protocol.output.FileStructure;
 import org.sonar.scanner.protocol.output.FileStructure.Domain;
index 72f0de293f617095a19dbe9b6b5b8b12dcd65167..34b04237f0e1d52a3308b6d80452bf505272c1a2 100644 (file)
@@ -23,7 +23,7 @@ dependencies {
     testImplementation 'com.squareup.okhttp3:mockwebserver'
     testImplementation 'com.squareup.okio:okio'
     testImplementation 'commons-io:commons-io'
-    testImplementation 'commons-lang:commons-lang'
+    testImplementation 'org.apache.commons:commons-lang3'
     testImplementation 'junit:junit'
     testImplementation 'org.assertj:assertj-core'
     testImplementation 'org.hamcrest:hamcrest-core'
index a6f128ae8120283e94a7117eeac580f95bd68a99..75986e3617d9b9b99962499498561bdf1f5ce9d4 100644 (file)
@@ -36,8 +36,8 @@ import okhttp3.mockwebserver.MockWebServer;
 import okhttp3.mockwebserver.RecordedRequest;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.RandomStringUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;