From b84d917af0916674301d72deaab77a49c149bbd9 Mon Sep 17 00:00:00 2001 From: ivinokur Date: Mon, 5 Feb 2024 12:02:24 +0200 Subject: [PATCH] Add isNullOrEmpty check to the BitbucketServerURLParser --- .../factory/server/bitbucket/BitbucketServerURLParser.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wsmaster/che-core-api-factory-bitbucket-server/src/main/java/org/eclipse/che/api/factory/server/bitbucket/BitbucketServerURLParser.java b/wsmaster/che-core-api-factory-bitbucket-server/src/main/java/org/eclipse/che/api/factory/server/bitbucket/BitbucketServerURLParser.java index f275b6b5f3..03fab2a9b2 100644 --- a/wsmaster/che-core-api-factory-bitbucket-server/src/main/java/org/eclipse/che/api/factory/server/bitbucket/BitbucketServerURLParser.java +++ b/wsmaster/che-core-api-factory-bitbucket-server/src/main/java/org/eclipse/che/api/factory/server/bitbucket/BitbucketServerURLParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2023 Red Hat, Inc. + * Copyright (c) 2012-2024 Red Hat, Inc. * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 * which is available at https://www.eclipse.org/legal/epl-2.0/ @@ -11,6 +11,7 @@ */ package org.eclipse.che.api.factory.server.bitbucket; +import static com.google.common.base.Strings.isNullOrEmpty; import static java.lang.String.format; import static java.util.regex.Pattern.compile; @@ -70,7 +71,7 @@ public BitbucketServerURLParser( this.devfileFilenamesProvider = devfileFilenamesProvider; this.oAuthAPI = oAuthAPI; this.personalAccessTokenManager = personalAccessTokenManager; - if (bitbucketEndpoints != null) { + if (!isNullOrEmpty(bitbucketEndpoints)) { for (String bitbucketEndpoint : Splitter.on(",").split(bitbucketEndpoints)) { String trimmedEndpoint = StringUtils.trimEnd(bitbucketEndpoint, '/'); URI uri = URI.create(trimmedEndpoint);