Source:
<code>public CompletableFuture<Void> stopAsync(Workspace workspace, Map<String, String> options) throws NotFoundException, ConflictException { TracingTags.WORKSPACE_ID.set(workspace.getId()); TracingTags.STOPPED_BY.set( () -> <START> firstNonNull( <END> sessionUserIdOr(workspace.getAttributes().get(WORKSPACE_STOPPED_BY)), "undefined")); TracingTags.STACK_ID.set(() -> workspace.getAttributes().getOrDefault("stackId", "no stack")); String workspaceId = workspace.getId(); WorkspaceStatus status = statuses.get(workspaceId); if (status == null) { throw new NotFoundException("Workspace with id '" + workspaceId + "' is not running."); } if (status != RUNNING && status != STARTING) { throw new ConflictException( format("Could not stop workspace '%s' because its state is '%s'", workspaceId, status)); } if (!statuses.replace(workspaceId, status, STOPPING)) { WorkspaceStatus newStatus = statuses.get(workspaceId); throw new ConflictException( format( "Could not stop workspace '%s' because its state is '%s'", workspaceId, newStatus == null ? STOPPED : newStatus)); } setRuntimesId(workspaceId); String stoppedBy = firstNonNull( sessionUserNameOr(workspace.getAttributes().get(WORKSPACE_STOPPED_BY)), "undefined"); LOG.info( "Workspace '{}/{}' with id '{}' is stopping by user '{}'", workspace.getNamespace(), workspace.getConfig().getName(), workspace.getId(), stoppedBy); publishWorkspaceStatusEvent(workspaceId, STOPPING, status, options.get(WORKSPACE_STOP_REASON)); return CompletableFuture.runAsync( ThreadLocalPropagateContext.wrap(new StopRuntimeTask(workspace, options, stoppedBy)), sharedPool.getExecutor()); }</code><technical_language>This code overweight. leave SubjectID is? @sleshchenko @mshaposhnik @metlos wdyt</technical_language>

Target:
public CompletableFuture<Void> stopAsync(Workspace workspace, Map<String, String> options) throws NotFoundException, ConflictException { TracingTags.WORKSPACE_ID.set(workspace.getId()); TracingTags.STOPPED_BY.set(getStoppedBy(workspace)); TracingTags.STACK_ID.set(() -> workspace.getAttributes().getOrDefault("stackId", "no stack")); String workspaceId = workspace.getId(); WorkspaceStatus status = statuses.get(workspaceId); if (status == null) { throw new NotFoundException("Workspace with id '" + workspaceId + "' is not running."); } if (status != RUNNING && status != STARTING) { throw new ConflictException( format("Could not stop workspace '%s' because its state is '%s'", workspaceId, status)); } if (!statuses.replace(workspaceId, status, STOPPING)) { WorkspaceStatus newStatus = statuses.get(workspaceId); throw new ConflictException( format( "Could not stop workspace '%s' because its state is '%s'", workspaceId, newStatus == null ? STOPPED : newStatus)); } setRuntimesId(workspaceId); String stoppedBy = firstNonNull( sessionUserNameOr(workspace.getAttributes().get(WORKSPACE_STOPPED_BY)), "undefined"); LOG.info( "Workspace '{}/{}' with id '{}' is stopping by user '{}'", workspace.getNamespace(), workspace.getConfig().getName(), workspace.getId(), stoppedBy); publishWorkspaceStatusEvent(workspaceId, STOPPING, status, options.get(WORKSPACE_STOP_REASON)); return CompletableFuture.runAsync( ThreadLocalPropagateContext.wrap(new StopRuntimeTask(workspace, options, stoppedBy)), sharedPool.getExecutor()); }