Source:
<code>public AbstractChatTabController(ClanService clanService, WebViewConfigurer webViewConfigurer, UserService userService, ChatService chatService, PlatformService platformService, PreferencesService preferencesService, PlayerService playerService, AudioService audioService, TimeService timeService, I18n i18n, ImageUploadService imageUploadService, UrlPreviewResolver urlPreviewResolver, NotificationService notificationService, ReportingService reportingService, UiService uiService, AutoCompletionHelper autoCompletionHelper, EventBus eventBus, CountryFlagService countryFlagService, ReplayService replayService, ClientProperties clientProperties) { this.webViewConfigurer = webViewConfigurer; this.clanService = clanService; this.uiService = uiService; this.chatService = chatService; this.userService = userService; this.platformService = platformService; this.preferencesService = preferencesService; this.playerService = playerService; this.audioService = audioService; this.timeService = timeService; this.i18n = i18n; this.imageUploadService = imageUploadService; this.urlPreviewResolver = urlPreviewResolver; this.notificationService = notificationService; this.reportingService = reportingService; this.autoCompletionHelper = autoCompletionHelper; this.eventBus = eventBus; this.countryFlagService = countryFlagService; this.replayService = replayService; <START> replayBaseUrl = String.format(clientProperties.getVault().getReplayDownloadUrlFormat(), ""); <END> waitingMessages = new ArrayList<>(); unreadMessagesCount = new SimpleIntegerProperty(); resetUnreadMessagesListener = (observable, oldValue, newValue) -> { if (hasFocus()) { setUnread(false); } }; }</code><technical_language>This approach works long ID is end of URL, be. A safer implementation convert string format a regular expression allows extracting ID, so: String quotedReplayUrlFormat = Pattern.quote(clientProperties.getVault().getReplayDownloadUrlFormat()); replayUrlPattern = Pattern.compile(quotedReplayUrlFormat.replace("%s", "(.*?)")); then, below, do: Matcher replayUrlMatcher = replayUrlPattern.matcher(url); if(replayUrlMatcher.matches()) { String replayId = replayUrlMatcher.group(1); ... }</technical_language>

Target:
public AbstractChatTabController(ClanService clanService, WebViewConfigurer webViewConfigurer, UserService userService, ChatService chatService, PlatformService platformService, PreferencesService preferencesService, PlayerService playerService, AudioService audioService, TimeService timeService, I18n i18n, ImageUploadService imageUploadService, UrlPreviewResolver urlPreviewResolver, NotificationService notificationService, ReportingService reportingService, UiService uiService, AutoCompletionHelper autoCompletionHelper, EventBus eventBus, CountryFlagService countryFlagService, ReplayService replayService, ClientProperties clientProperties) { this.webViewConfigurer = webViewConfigurer; this.clanService = clanService; this.uiService = uiService; this.chatService = chatService; this.userService = userService; this.platformService = platformService; this.preferencesService = preferencesService; this.playerService = playerService; this.audioService = audioService; this.timeService = timeService; this.i18n = i18n; this.imageUploadService = imageUploadService; this.urlPreviewResolver = urlPreviewResolver; this.notificationService = notificationService; this.reportingService = reportingService; this.autoCompletionHelper = autoCompletionHelper; this.eventBus = eventBus; this.countryFlagService = countryFlagService; this.replayService = replayService; String urlFormat = clientProperties.getVault().getReplayDownloadUrlFormat(); String[] splittedFormat = urlFormat.split("%s"); replayUrlPattern = Pattern.compile(Pattern.quote(splittedFormat[0]) + "(\\d+)" + Pattern.compile(splittedFormat.length == 2 ? splittedFormat[1] : "")); waitingMessages = new ArrayList<>(); unreadMessagesCount = new SimpleIntegerProperty(); resetUnreadMessagesListener = (observable, oldValue, newValue) -> { if (hasFocus()) { setUnread(false); } }; }