auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>static void downloadJobResult(TDJobOperator j, Workspace workspace, Optional<String> downloadFile, Config state) { if (!downloadFile.isPresent()) { return; } Config downloadState = state.getNestedOrSetEmpty(DOWNLOAD); boolean done = downloadState.get(DONE, boolean.class, false); if (done) { return; } try { j.getResult(ite -> { try (BufferedWriter out = workspace.newBufferedWriter(downloadFile.get(), UTF_8)) { addCsvHeader(out, j.getResultColumnNames()); while (ite.hasNext()) { addCsvRow(out, ite.next().asArrayValue()); } <START> downloadState.set(DONE, true); <END> return true; } catch (IOException ex) { throw new UncheckedIOException(ex); } }); } catch (UncheckedIOException | TDClientException e) { if (isDeterministicClientException(e)) { throw new TaskExecutionException(e, TaskExecutionException.buildExceptionErrorConfig(e)); } int retry = downloadState.get(RETRY, int.class, 0); downloadState.set(RETRY, retry + 1); int interval = (int) Math.min(INITIAL_DOWNLOAD_RETRY_INTERVAL * Math.pow(2, retry), MAX_DOWNLOAD_RETRY_INTERVAL); logger.warn("Failed to download result of job '{}', retrying in seconds", j.getJobId(), interval, e); throw TaskExecutionException.ofNextPolling(interval, ConfigElement.copyOf(state)); } }</code><technical_language>need clear retry state here</technical_language>

Target:
static void downloadJobResult(TDJobOperator j, Workspace workspace, Optional<String> downloadFile, Config state) { if (!downloadFile.isPresent()) { return; } Config downloadState = state.getNestedOrSetEmpty(DOWNLOAD); boolean done = downloadState.get(DONE, boolean.class, false); if (done) { return; } try { j.getResult(ite -> { try (BufferedWriter out = workspace.newBufferedWriter(downloadFile.get(), UTF_8)) { addCsvHeader(out, j.getResultColumnNames()); while (ite.hasNext()) { addCsvRow(out, ite.next().asArrayValue()); } downloadState.remove(RETRY); downloadState.set(DONE, true); return true; } catch (IOException ex) { throw new UncheckedIOException(ex); } }); } catch (UncheckedIOException | TDClientException e) { if (isDeterministicClientException(e)) { throw new TaskExecutionException(e, TaskExecutionException.buildExceptionErrorConfig(e)); } int retry = downloadState.get(RETRY, int.class, 0); downloadState.set(RETRY, retry + 1); int interval = (int) Math.min(INITIAL_DOWNLOAD_RETRY_INTERVAL * Math.pow(2, retry), MAX_DOWNLOAD_RETRY_INTERVAL); logger.warn("Failed to download result of job '{}', retrying in seconds", j.getJobId(), interval, e); throw TaskExecutionException.ofNextPolling(interval, ConfigElement.copyOf(state)); } }
Source:
<code>public static String sanitizeFileDirectory(String value){ while (value.startsWith("\\") || value.startsWith("/") || value.startsWith("-") || value.startsWith(".")){ value = value.substring(1); } while (value.endsWith("\\") || value.endsWith("/") || value.endsWith("-") || value.endsWith(".")){ value = value.substring(0, value.length() - 1); } <START> <END> return value; }</code><technical_language>@sekmiller This method correctly strips leading trailing slashes (and "." "-"); I thought plan replace multiple slashes nested folders a single slash. For example, implemented now, I enter "folder1///folder2", saved displayed this, 3 slashes. I thought wanted sanitize "folder1/folder2"</technical_language>

Target:
public static String sanitizeFileDirectory(String value) { return sanitizeFileDirectory(value, false); }
Source:
<code>public BudgetGoalDTO(@JsonProperty(required = true, value = "activityCategoryUrl") String activityCategoryUrl, @JsonProperty(required = true, value = "maxDurationMinutes") int maxDurationMinutes) { <START> this(null, determineActivityCategoryID(activityCategoryUrl), maxDurationMinutes, false ); <END> }</code><technical_language>move this call determineActivityCategoryID a GoalDTO constructor repeated for goal DTO</technical_language>

Target:
public BudgetGoalDTO(@JsonProperty(required = true, value = "activityCategoryUrl") String activityCategoryUrl, @JsonProperty(required = true, value = "maxDurationMinutes") int maxDurationMinutes) { super(activityCategoryUrl); this.maxDurationMinutes = maxDurationMinutes; }
Source:
<code>protected Object processResponseBeforeSending(Object response) { ReplicatedMapService replicatedMapService = getService(ReplicatedMapService.SERVICE_NAME); if (replicatedMapService.getReplicatedMapConfig(parameters.name).isStatisticsEnabled()) { LocalReplicatedMapStatsImpl stats = replicatedMapService.getLocalReplicatedMapStatsImpl(parameters.name); <START> stats.incrementGets(TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startTimeNanos)); <END> } return response; }</code><technical_language>another look, do metrics for maps' total get latency, do a bit different: <LINK_0> accumulate nanos, convert millis for metrics collector. I this is right do. @alex-dukhno @puzpuzpuz :point_up:</technical_language>

Target:
protected Object processResponseBeforeSending(Object response) { ReplicatedMapService replicatedMapService = getService(ReplicatedMapService.SERVICE_NAME); if (replicatedMapService.getReplicatedMapConfig(parameters.name).isStatisticsEnabled()) { LocalReplicatedMapStatsImpl stats = replicatedMapService.getLocalReplicatedMapStatsImpl(parameters.name); stats.incrementGetsNanos(System.nanoTime() - startTimeNanos); } return response; }
Source:
<code>private static List<byte[]> chunkMetadataStoreValue(byte[] value) { try { <START> byte[] valueCrcAsBytes = getCRCChecksum(value); <END> value = ArrayUtils.addAll(value, valueCrcAsBytes); List<byte[]> valueSegments = new ArrayList<>(); int valueLength = value.length; for (int index = 0; index < valueLength; index += VALUE_SEGMENT_SIZE_IN_BYTES) { byte[] valueSegment = ArrayUtils.subarray(value, index, Math.min(index + VALUE_SEGMENT_SIZE_IN_BYTES, valueLength)); valueSegments.add(valueSegment); } return valueSegments; } catch (Exception e) { throw new SamzaException(String.format("Exception occurred when splitting the value: %s to small chunks.", value), e); } }</code><technical_language>Nitpick: 'checksum'</technical_language>

Target:
private static List<byte[]> chunkMetadataStoreValue(byte[] value) { try { byte[] checksum = getCRCChecksum(value); byte[] valueWithChecksum = ArrayUtils.addAll(value, checksum); List<byte[]> valueSegments = new ArrayList<>(); int length = valueWithChecksum.length; for (int index = 0; index < length; index += VALUE_SEGMENT_SIZE_IN_BYTES) { byte[] valueSegment = ArrayUtils.subarray(valueWithChecksum, index, Math.min(index + VALUE_SEGMENT_SIZE_IN_BYTES, length)); valueSegments.add(valueSegment); } return valueSegments; } catch (Exception e) { throw new SamzaException(String.format("Exception occurred when splitting the value: %s to small chunks.", value), e); } }
Source:
<code>public IntegerValidation() { <START> super(Integer.MIN_VALUE, Integer.MAX_VALUE, Integer.class); <END> }</code><technical_language>Here, simply call other constructor: this(Integer.MIN_VALUE, Integer.MAX_VALUE);</technical_language>

Target:
public IntegerValidation() { this(Integer.MIN_VALUE, Integer.MAX_VALUE); }
Source:
<code>public void update(Long id) { AgentInfo agent = getOne(id); if (agent == null) { return; } hazelcastService.publish(new TopicEvent<>(AGENT_MANAGER_TOPIC_LISTENER_KEY, <START> extractRegionFromAgentRegion(agent.getRegion()), new ClusteredAgentRequest(agent.getIp(), agent.getName(), UPDATE_AGENT))); <END> }</code><technical_language>change method name extractRegionKey</technical_language>

Target:
public void update(Long id) { AgentInfo agent = getOne(id); if (agent == null) { return; } publishTopic(agent, AGENT_TOPIC_LISTENER_NAME, UPDATE_AGENT); }
Source:
<code>Map<String, String> toParameters() { final Map<String, String> outParams = new LinkedHashMap<String, String>(); if (this.params != null) { outParams.putAll(this.params); } if(!outParams.containsKey("scope")) { <START> outParams.put("scope", "openid"); <END> } outParams.putAll(grant.toParameters()); return outParams; }</code><technical_language>scope parameter is multi-valued. add openid end if there</technical_language>

Target:
Map<String, String> toParameters() { final Map<String, String> outParams = new LinkedHashMap<String, String>(); if (this.params != null) { outParams.putAll(this.params); } outParams.put("scope", "openid"); outParams.putAll(grant.toParameters()); return outParams; }
Source:
<code>private ClientConfig createClientConfig() { ClientConfig cc = new ClientConfig(); <START> cc.setProcedureCallTimeout(10 * 60 * 1000); <END> return cc; }</code><technical_language>10 minutes a long timeout especially for a test</technical_language>

Target:
private ClientConfig createClientConfig() { ClientConfig cc = new ClientConfig(); cc.setProcedureCallTimeout(30 * 1000); return cc; }
Source:
<code>public void testGetAllForQuotaId() { List<DiskImage> disks = dao.getAllForQuotaId(FixturesTool.QUOTA_GENERAL); <START> assertEquals("Wrong number of disk images for quota ", 12, disks.size()); <END> }</code><technical_language>please extract expect result (12) a constant. +2 for rest</technical_language>

Target:
public void testGetAllForQuotaId() { List<DiskImage> disks = dao.getAllForQuotaId(FixturesTool.QUOTA_GENERAL); assertEquals("Wrong number of disk images for quota ", TOTAL_DISK_IMAGES_FOR_QAUOTA, disks.size()); }
Source:
<code>public static RoleMappingsProvider bootstrapRoleMappingsProvider(final SamlDeployment deployment, final ResourceLoader loader, final SP.RoleMappingsProviderConfig providerConfig) { String providerId; if (providerConfig == null || providerConfig.getId() == null) { <START> providerId = PropertiesBasedRoleMapper.PROVIDER_ID; <END> } else { providerId = providerConfig.getId(); } Map<String, RoleMappingsProvider> roleMappingsProviders = new HashMap<>(); loadProviders(roleMappingsProviders, RoleMappingsProviderUtils.class.getClassLoader()); loadProviders(roleMappingsProviders, Thread.currentThread().getContextClassLoader()); RoleMappingsProvider provider = roleMappingsProviders.get(providerId); if (provider == null) { throw new RuntimeException("Couldn't find RoleMappingsProvider implementation class with id: " + providerId + ". Loaded authentication providers: " + roleMappingsProviders.keySet()); } provider.init(deployment, loader, providerConfig != null ? providerConfig.getConfiguration() : new Properties()); return provider; }</code><technical_language>return null; in case providerConfig is null</technical_language>

Target:
public static RoleMappingsProvider bootstrapRoleMappingsProvider(final SamlDeployment deployment, final ResourceLoader loader, final SP.RoleMappingsProviderConfig providerConfig) { String providerId; if (providerConfig == null || providerConfig.getId() == null) { return null; } else { providerId = providerConfig.getId(); } Map<String, RoleMappingsProvider> roleMappingsProviders = new HashMap<>(); loadProviders(roleMappingsProviders, RoleMappingsProviderUtils.class.getClassLoader()); loadProviders(roleMappingsProviders, Thread.currentThread().getContextClassLoader()); RoleMappingsProvider provider = roleMappingsProviders.get(providerId); if (provider == null) { throw new RuntimeException("Couldn't find RoleMappingsProvider implementation class with id: " + providerId + ". Loaded role mappings providers: " + roleMappingsProviders.keySet()); } provider.init(deployment, loader, providerConfig != null ? providerConfig.getConfiguration() : new Properties()); return provider; }
Source:
<code>public boolean shutdown() { <START> return freeze() && kill(); <END> }</code><technical_language>I this enough, wait currently running tasks</technical_language>

Target:
public boolean shutdown() { if (status.isDown()) { return false; } status = SchedulerStatus.SHUTTING_DOWN; logger.info("Scheduler is shutting down, this may take time to finish every running tasks!"); listener.schedulerStateUpdated(SchedulerEvent.SHUTTING_DOWN); infrastructure.schedule(new Runnable() { public void run() { if (jobs.getRunningTasks().isEmpty()) { kill(); } else { infrastructure.schedule(this, 5000); } } }, 5000); return true; }
Source:
<code>public void addAppenderator(String taskId, Appenderator appenderator) { taskAppenderatorMap.computeIfAbsent( taskId, (myTaskId) -> { return new ArrayList<>(); } ); <START> taskAppenderatorMap.get(taskId).add(appenderator); <END> }</code><technical_language>I is avoid extra lookup map. taskAppenderatorMap.computeIfAbsent(taskId, myTaskId -> new ArrayList<>()).add(appenderator);</technical_language>

Target:
public void addAppenderator(String taskId, Appenderator appenderator) { taskAppenderatorMap.computeIfAbsent( taskId, (myTaskId) -> { return new ArrayList<>(); } ).add(appenderator); }
Source:
<code>public void save() { <START> Globals.prefs.setProtectedTermsPreferences(termsLoader); <END> }</code><technical_language>Injected PreferencesService pass parameter ViewModel</technical_language>

Target:
public void save() { preferences.setProtectedTermsPreferences(termsLoader); }
Source:
<code>public boolean validateSourceGroup() { File sourceArchiveFile = getSourceArchiveFile(); <START> File source = fImportFromDirectoryRadio.getSelection() ? getSourceDirectory() : sourceArchiveFile; <END> if (source == null) { setMessage(Messages.ImportTraceWizard_SelectTraceSourceEmpty); setErrorMessage(null); return false; } if (sourceConflictsWithDestination(new Path(source.getPath()))) { setMessage(null); setErrorMessage(getSourceConflictMessage()); return false; } if (!fImportFromDirectoryRadio.getSelection() && sourceArchiveFile != null) { if (!ensureTarSourceIsValid(getSourceArchiveFile().getAbsolutePath()) && !ensureZipSourceIsValid(getSourceArchiveFile().getAbsolutePath())) { setMessage(null); setErrorMessage(Messages.ImportTraceWizard_BadArchiveFormat); return false; } } if (fSelectionGroup.getCheckedElementCount() == 0) { setMessage(null); setErrorMessage(Messages.ImportTraceWizard_SelectTraceNoneSelected); return false; } IContainer container = getSpecifiedContainer(); if (container != null && container.isVirtual()) { if (Platform.getPreferencesService().getBoolean(Activator.PLUGIN_ID, ResourcesPlugin.PREF_DISABLE_LINKING, false, null)) { setMessage(null); setErrorMessage(Messages.ImportTraceWizard_CannotImportFilesUnderAVirtualFolder); return false; } if (fCreateLinksInWorkspaceButton == null || !fCreateLinksInWorkspaceButton.getSelection()) { setMessage(null); setErrorMessage(Messages.ImportTraceWizard_HaveToCreateLinksUnderAVirtualFolder); return false; } } setErrorMessage(null); return true; }</code><technical_language>getter for archive</technical_language>

Target:
public boolean validateSourceGroup() { File source = fImportFromDirectoryRadio.getSelection() ? getSourceDirectory() : getSourceArchiveFile(); if (source == null) { setMessage(Messages.ImportTraceWizard_SelectTraceSourceEmpty); setErrorMessage(null); return false; } if (sourceConflictsWithDestination(new Path(source.getPath()))) { setMessage(null); setErrorMessage(getSourceConflictMessage()); return false; } if (!fImportFromDirectoryRadio.getSelection()) { if (!ensureTarSourceIsValid(source.getAbsolutePath()) && !ensureZipSourceIsValid(source.getAbsolutePath())) { setMessage(null); setErrorMessage(Messages.ImportTraceWizard_BadArchiveFormat); return false; } } if (fSelectionGroup.getCheckedElementCount() == 0) { setMessage(null); setErrorMessage(Messages.ImportTraceWizard_SelectTraceNoneSelected); return false; } IContainer container = getSpecifiedContainer(); if (container != null && container.isVirtual()) { if (Platform.getPreferencesService().getBoolean(Activator.PLUGIN_ID, ResourcesPlugin.PREF_DISABLE_LINKING, false, null)) { setMessage(null); setErrorMessage(Messages.ImportTraceWizard_CannotImportFilesUnderAVirtualFolder); return false; } if (fCreateLinksInWorkspaceButton == null || !fCreateLinksInWorkspaceButton.getSelection()) { setMessage(null); setErrorMessage(Messages.ImportTraceWizard_HaveToCreateLinksUnderAVirtualFolder); return false; } } setErrorMessage(null); return true; }
Source:
<code><START> public Map<String, Object> toMap() { <END> Map<String, Object> map = new HashMap<String, Object>(); map.put("active", this.getActive()); map.put("actualCompanyId", this.getActualCompanyId()); map.put("birthday", this.getBirthday()); map.put("comments", this.getComments()); map.put("companyId", this.getCompanyId()); map.put("createDate", this.getCreateDate()); map.put("modificationDate", this.getModificationDate()); map.put("emailAddress", this.getEmailAddress()); map.put("failedLoginAttempts", this.getFailedLoginAttempts()); map.put("male", this.getMale()); map.put("firstName", this.getFirstName()); map.put("fullName", this.getFullName()); map.put("languageId", this.getLanguageId()); map.put("lastLoginDate", this.getLastLoginDate()); map.put("lastLoginIP", this.getLastLoginIP()); map.put("lastName", this.getLastName()); map.put("middleName", this.getMiddleName()); map.put("female", this.getFemale()); map.put("nickname", this.getNickName()); map.put("userId", this.getUserId()); map.put("timeZoneId", this.getTimeZoneId()); map.put("deleteInProgress", getDeleteInProgress()); map.put("deleteDate", getDeleteDate()); return map; }</code><technical_language>removing signature? change User methods</technical_language>

Target:
public Map<String, Object> toMap() throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { Map<String, Object> map = new HashMap<String, Object>(); map.put("active", this.getActive()); map.put("actualCompanyId", this.getActualCompanyId()); map.put("birthday", this.getBirthday()); map.put("comments", this.getComments()); map.put("companyId", this.getCompanyId()); map.put("createDate", this.getCreateDate()); map.put("modificationDate", this.getModificationDate()); map.put("emailAddress", this.getEmailAddress()); map.put("failedLoginAttempts", this.getFailedLoginAttempts()); map.put("male", this.getMale()); map.put("firstName", this.getFirstName()); map.put("fullName", this.getFullName()); map.put("languageId", this.getLanguageId()); map.put("lastLoginDate", this.getLastLoginDate()); map.put("lastLoginIP", this.getLastLoginIP()); map.put("lastName", this.getLastName()); map.put("middleName", this.getMiddleName()); map.put("female", this.getFemale()); map.put("nickname", this.getNickName()); map.put("userId", this.getUserId()); map.put("timeZoneId", this.getTimeZoneId()); map.put("deleteInProgress", getDeleteInProgress()); map.put("deleteDate", getDeleteDate()); return map; }
Source:
<code>public String getRecoveredAdUnitId(String adUnitId) { jsActions.waitForJavaScriptTruthy("window._sp_"); <START> jsActions.waitForJavaScriptTruthy("window._sp_.getElementId"); <END> return jsActions.execute(String.format("window._sp_.getElementId('%s')", adUnitId)).toString(); }</code><technical_language>jsActions.waitForJavaScriptTruthy("window._sp_ && window._sp_.getElementId"); (let's reduce amount of requests selenium server)</technical_language>

Target:
public String getRecoveredAdUnitId(String adUnitId) { jsActions.waitForJavaScriptTruthy("window._sp_ && window._sp_.getElementId"); return jsActions.execute(String.format("window._sp_.getElementId('%s')", adUnitId)).toString(); }
Source:
<code>private RulesetManagementInterface openRulesetFile(String fileName) throws IOException, RulesetNotFoundException { final long begin = System.nanoTime(); String metadataLanguage = ServiceManager.getUserService().getCurrentUser().getMetadataLanguage(); priorityList = Locale.LanguageRange.parse(metadataLanguage.isEmpty() ? "en" : metadataLanguage); RulesetManagementInterface ruleset = ServiceManager.getRulesetManagementService().getRulesetManagement(); try { ruleset.load(new File(Paths.get(ConfigCore.getParameter(ParameterCore.DIR_RULESETS), fileName).toString())); } catch (FileNotFoundException e) { <START> throw new RulesetNotFoundException("Ruleset " + fileName + " not found"); <END> } if (logger.isTraceEnabled()) { logger.trace("Reading ruleset took ms", TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - begin)); } return ruleset; }</code><technical_language>suggestion throw new RulesetNotFoundException("Ruleset file " + fileName + " found");</technical_language>

Target:
private RulesetManagementInterface openRulesetFile(String fileName) throws IOException, RulesetNotFoundException { final long begin = System.nanoTime(); String metadataLanguage = ServiceManager.getUserService().getCurrentUser().getMetadataLanguage(); priorityList = Locale.LanguageRange.parse(metadataLanguage.isEmpty() ? "en" : metadataLanguage); RulesetManagementInterface ruleset = ServiceManager.getRulesetManagementService().getRulesetManagement(); try { ruleset.load(new File(Paths.get(ConfigCore.getParameter(ParameterCore.DIR_RULESETS), fileName).toString())); } catch (FileNotFoundException e) { List<String> param = new ArrayList<>(); param.add(fileName); throw new RulesetNotFoundException(Helper.getTranslation("rulesetNotFound", param)); } if (logger.isTraceEnabled()) { logger.trace("Reading ruleset took ms", TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - begin)); } return ruleset; }
Source:
<code>public static Optional<RemoteInstance> getRemoteInstance(String applicationKey) { Optional<Integer> port = getSavedPort(applicationKey); if (!port.isPresent()) { return Optional.empty(); } SocketChannel channel = null; boolean close = true; try { channel = SocketChannel.open(); channel.configureBlocking(false); LOG.info("connecting to instance {}", port.get()); channel.connect(new InetSocketAddress(InetAddress.getLoopbackAddress(), port.get())); SocketChannel fChannel = channel; if (!TimeoutTask.attempt(t -> fChannel.finishConnect(), 1000, 10)) { return Optional.empty(); } LOG.info("connected to instance {}", port.get()); final byte[] bytes = applicationKey.getBytes(); ByteBuffer buf = ByteBuffer.allocate(bytes.length); tryFill(channel, buf, 1000); if (buf.hasRemaining()) { return Optional.empty(); } buf.flip(); for (int i = 0; i < bytes.length; i++) { if (buf.get() != bytes[i]) { return Optional.empty(); } } close = false; return Optional.of(new RemoteInstance(channel)); } catch (Exception e) { return Optional.empty(); } finally { try { if (channel != null && close && channel.isOpen()) { channel.close(); } } catch (Exception e) { <START> } <END> } }</code><technical_language>IOUtils.closeQuietly in this finally block</technical_language>

Target:
public static Optional<RemoteInstance> getRemoteInstance(String applicationKey) { Optional<Integer> port = getSavedPort(applicationKey); if (!port.isPresent()) { return Optional.empty(); } SocketChannel channel = null; boolean close = true; try { channel = SocketChannel.open(); channel.configureBlocking(false); LOG.info("connecting to instance {}", port.get()); channel.connect(new InetSocketAddress(InetAddress.getLoopbackAddress(), port.get())); SocketChannel fChannel = channel; if (!TimeoutTask.attempt(t -> fChannel.finishConnect(), 1000, 10)) { return Optional.empty(); } LOG.info("connected to instance {}", port.get()); final byte[] bytes = applicationKey.getBytes(); ByteBuffer buf = ByteBuffer.allocate(bytes.length); tryFill(channel, buf, 1000); if (buf.hasRemaining()) { return Optional.empty(); } buf.flip(); for (int i = 0; i < bytes.length; i++) { if (buf.get() != bytes[i]) { return Optional.empty(); } } close = false; return Optional.of(new RemoteInstance(channel)); } catch (Exception e) { return Optional.empty(); } finally { if (close) { IOUtils.closeQuietly(channel); } } }
Source:
<code>private void processMatchingMilestonesByQuerySentence(List<PickerMilestone> milestones, String querySentence) { <START> String[] userInputWords = querySentence.split(" "); <END> Stream.of(userInputWords) .forEach(queryWord -> processMatchingMilestonesByQueryWord(milestones, queryWord)); }</code><technical_language>userInputWords renamed. queryWords</technical_language>

Target:
private void processMatchingMilestonesByQuerySentence(List<PickerMilestone> milestones, String querySentence) { String[] queryWords = querySentence.split(" "); Stream.of(queryWords) .forEach(queryWord -> processMatchingMilestonesByQueryWord(milestones, queryWord)); }
Source:
<code><START> public NodeProbe create(String host, int port, String username, String password) throws IOException { <END> return new InternalNodeProbe(host, port, username, password); }</code><technical_language>personal preference (aka call) return new InternalNodeProbe(); dumby constructors in InternalNodeProbe</technical_language>

Target:
public NodeProbe create(String host, int port, String username, String password) throws IOException { return new InternalNodeProbe(); }
Source:
<code>public void testNoArgRestore() throws Exception { BackupCommand backupCommand = new BackupCommand() { @Override protected HttpWrapper getHttpClient() { return mockHttpWrapper; } }; backupCommand.execute(); setupSystemProperties(SOLR_STANDALONE_TYPE); when(mockHttpWrapper.execute(any(URI.class))).thenReturn(mockResponse(HttpStatus.SC_OK, "")); RestoreCommand restoreCommand = new RestoreCommand() { @Override protected HttpWrapper getHttpClient() { return mockHttpWrapper; } }; restoreCommand.execute(); <START> assertThat( <END> consoleOutput.getOutput(), containsString(String.format("Restore of [%s] complete.", DEFAULT_CORE_NAME))); }</code><technical_language>assertion statement of a test if test expects exception thrown</technical_language>

Target:
public void testNoArgRestore() throws Exception { setupSystemProperties(SOLR_STANDALONE_TYPE); RestoreCommand restoreCommand = new RestoreCommand() { @Override HttpResponse sendGetRequest(URI backupUri) { return mockResponse(HttpStatus.SC_OK, ""); } }; restoreCommand.execute(); }
Source:
<code>void configureAdditionalDependencies(OperationContext context, CapabilityServiceBuilder serviceBuilder, ModelNode model, ListenerService service) throws OperationFailedException { ModelNode redirectBindingRef = ListenerResourceDefinition.REDIRECT_SOCKET.resolveModelAttribute(context, model); if (redirectBindingRef.isDefined()) { ServiceName serviceName = context.getCapabilityServiceName(REF_SOCKET_BINDING, redirectBindingRef.asString(), SocketBinding.class); serviceBuilder.addDependency(serviceName, SocketBinding.class, service.getRedirectSocket()); } ServiceName httpListenerRegistry = context.getCapabilityServiceName(Capabilities.REF_HTTP_LISTENER_REGISTRY, ListenerRegistry.class); <START> serviceBuilder.addDependency(httpListenerRegistry, ListenerRegistry.class, ((HttpListenerService) service).getHttpListenerRegistry()); <END> }</code><technical_language>serviceBuilder is a CapabilityServiceBuilder, use: java serviceBuilder.addCapabilityRequirement(Capabilities.REF_HTTP_LISTENER_REGISTRY, ListenerRegistry.class, ((HttpListenerService) service).getHttpListenerRegistry());</technical_language>

Target:
void configureAdditionalDependencies(OperationContext context, CapabilityServiceBuilder serviceBuilder, ModelNode model, ListenerService service) throws OperationFailedException { ModelNode redirectBindingRef = ListenerResourceDefinition.REDIRECT_SOCKET.resolveModelAttribute(context, model); if (redirectBindingRef.isDefined()) { ServiceName serviceName = context.getCapabilityServiceName(REF_SOCKET_BINDING, redirectBindingRef.asString(), SocketBinding.class); serviceBuilder.addDependency(serviceName, SocketBinding.class, service.getRedirectSocket()); } serviceBuilder.addCapabilityRequirement(Capabilities.REF_HTTP_LISTENER_REGISTRY, ListenerRegistry.class, ((HttpListenerService) service).getHttpListenerRegistry()); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_motion_tracking); final TextView rot0 = (TextView) findViewById(R.id.rotation0); final TextView rot1 = (TextView) findViewById(R.id.rotation1); final TextView rot2 = (TextView) findViewById(R.id.rotation2); final TextView rot3 = (TextView) findViewById(R.id.rotation3); final TextView pos0 = (TextView) findViewById(R.id.positionX); final TextView pos1 = (TextView) findViewById(R.id.positionY); final TextView pos2 = (TextView) findViewById(R.id.positionZ); final DecimalFormat fourDec = new DecimalFormat("0.0000"); mTangoClient = new TangoClient(this, false, false, false); poseCallBack = new poseUpdateListener(){ @Override public void onPoseUpdate(final VioStatus status) { <START> final DecimalFormat fourDec = new DecimalFormat("0.0000"); <END> runOnUiThread(new Runnable() { @Override public void run() { try { rot0.setText(fourDec.format(status.rotation[0])); rot1.setText(fourDec.format(status.rotation[1])); rot2.setText(fourDec.format(status.rotation[2])); rot3.setText(fourDec.format(status.rotation[3])); pos0.setText(fourDec.format(status.translation[0])); pos1.setText(fourDec.format(status.translation[1])); pos2.setText(fourDec.format(status.translation[2])); } catch (Exception e) { e.printStackTrace(); } } }); } }; poseUpdater(); }</code><technical_language>this in line 35. this again</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_motion_tracking); final TextView rot0 = (TextView) findViewById(R.id.rotation0); final TextView rot1 = (TextView) findViewById(R.id.rotation1); final TextView rot2 = (TextView) findViewById(R.id.rotation2); final TextView rot3 = (TextView) findViewById(R.id.rotation3); final TextView pos0 = (TextView) findViewById(R.id.positionX); final TextView pos1 = (TextView) findViewById(R.id.positionY); final TextView pos2 = (TextView) findViewById(R.id.positionZ); mTangoClient = new TangoClient(this, false, false, false); poseCallBack = new poseUpdateListener(){ @Override public void onPoseUpdate(final VioStatus status) { final DecimalFormat fourDec = new DecimalFormat("0.0000"); runOnUiThread(new Runnable() { @Override public void run() { try { rot0.setText(fourDec.format(status.rotation[0])); rot1.setText(fourDec.format(status.rotation[1])); rot2.setText(fourDec.format(status.rotation[2])); rot3.setText(fourDec.format(status.rotation[3])); pos0.setText(fourDec.format(status.translation[0])); pos1.setText(fourDec.format(status.translation[1])); pos2.setText(fourDec.format(status.translation[2])); } catch (Exception e) { e.printStackTrace(); } } }); } }; poseUpdater(); }
Source:
<code>public boolean shouldCollide(SolObject object, Fixture fixture, FactionManager factionManager) { if (object instanceof SolShip) { SolShip ship = (SolShip) object; if (ship.getHull().getShieldFixture() == fixture) { if (config.density > 0) { return false; } Shield shield = ship.getShield(); <START> return shield != null && shield.canAbsorb(config.dmgType); <END> } return true; } return true; }</code><technical_language>need this anymore</technical_language>

Target:
public boolean shouldCollide(SolObject object, Fixture fixture, FactionManager factionManager) { if (object instanceof SolShip) { SolShip ship = (SolShip) object; if (this.ship == ship) { return false; } if (ship.getHull().getShieldFixture() == fixture) { if (config.density > 0) { return false; } Shield shield = ship.getShield(); return shield != null && shield.canAbsorb(config.dmgType); } return true; } return true; }
Source:
<code>private String prepareResponse(String msgID, String targetURI, String sourceURI) <START> throws FileOperationException { <END> String response = null; String responseFilePath; File responseFile; try { if (MESSAGE_ID_ONE_TEMP.equals(msgID)) { responseFile = new File(getClass().getClassLoader().getResource(Constants.SyncML. SYNCML_RESPONSE).getFile()); responseFilePath = responseFile.getPath(); response = new String(Files.readAllBytes(Paths.get(responseFilePath))); if ((targetURI != null)&&(sourceURI != null)) { response = response.replaceAll(Constants.SyncML.SYNCML_SOURCE_URI, targetURI); response = response.replaceAll(Constants.SyncML.SYNCML_TARGET_URI, sourceURI); } } else if(MESSAGE_ID_TWO_TEMP.equals(msgID)){ responseFile = new File(getClass().getClassLoader().getResource(Constants.SyncML. SYNCML_SECOND_RESPONSE).getFile()); responseFilePath = responseFile.getPath(); response = new String(Files.readAllBytes(Paths.get(responseFilePath))); if ((targetURI != null)&&(sourceURI != null)) { response = response.replaceAll(Constants.SyncML.SYNCML_SOURCE_URI, targetURI); response = response.replaceAll(Constants.SyncML.SYNCML_TARGET_URI, sourceURI); } } } catch (IOException e) { String msg = "Syncml response file cannot be read."; logger.error(msg, e); throw new FileOperationException(msg, e); } return response; }</code><technical_language>keyword "throws" line itself. break line point, indication some exceptions method declaration</technical_language>

Target:
private String prepareResponse(String msgID, String targetURI, String sourceURI) throws FileOperationException { String response = null; String responseFilePath; File responseFile; try { if (SYNCML_FIRST_MESSAGE.equals(msgID)) { responseFile = new File(getClass().getClassLoader().getResource(Constants.SyncML. SYNCML_RESPONSE).getFile()); responseFilePath = responseFile.getPath(); response = new String(Files.readAllBytes(Paths.get(responseFilePath))); if ((targetURI != null)&&(sourceURI != null)) { response = response.replaceAll(Constants.SyncML.SYNCML_SOURCE_URI, targetURI); response = response.replaceAll(Constants.SyncML.SYNCML_TARGET_URI, sourceURI); } } else if(SYNCML_SECOND_MESSAGE.equals(msgID)){ responseFile = new File(getClass().getClassLoader().getResource(Constants.SyncML. SYNCML_SECOND_RESPONSE).getFile()); responseFilePath = responseFile.getPath(); response = new String(Files.readAllBytes(Paths.get(responseFilePath))); if ((targetURI != null)&&(sourceURI != null)) { response = response.replaceAll(Constants.SyncML.SYNCML_SOURCE_URI, targetURI); response = response.replaceAll(Constants.SyncML.SYNCML_TARGET_URI, sourceURI); } } } catch (IOException e) { String msg = "Syncml response file cannot be read."; log.error(msg, e); throw new FileOperationException(msg, e); } return response; }
Source:
<code>public void initialize(HttpRequest request) { request.setInterceptor(credential); request.setNumberOfRetries(maxRequestRetries); request.setConnectTimeout(connectTimeoutMillis); request.setReadTimeout(readTimeoutMillis); HttpBackOffIOExceptionHandler exceptionHandler = new HttpBackOffIOExceptionHandler(new ExponentialBackOff()); if (sleeperOverride != null) { exceptionHandler.setSleeper(sleeperOverride); } LoggingResponseHandler loggingResponseHandler = new LoggingResponseHandler( new CredentialOrBackoffResponseHandler(), exceptionHandler, ImmutableSet.of(HttpStatus.SC_GONE, HttpStatus.SC_SERVICE_UNAVAILABLE), ImmutableSet.of(HTTP_SC_TOO_MANY_REQUESTS)); request.setUnsuccessfulResponseHandler(loggingResponseHandler); request.setIOExceptionHandler(loggingResponseHandler); if (Strings.isNullOrEmpty(request.getHeaders().getUserAgent())) { logger.atFiner().log( "Request is missing a user-agent, adding default value of '%s'", defaultUserAgent); request.getHeaders().setUserAgent(defaultUserAgent); } if (headers != null) { for (Map.Entry<String, String> header : headers.entrySet()) { request.getHeaders().set(header.getKey(), header.getValue()); <START> } <END> } }</code><technical_language>setAll similar method instead of loop</technical_language>

Target:
public void initialize(HttpRequest request) { request.setInterceptor(credential); request.setNumberOfRetries(maxRequestRetries); request.setConnectTimeout(connectTimeoutMillis); request.setReadTimeout(readTimeoutMillis); HttpBackOffIOExceptionHandler exceptionHandler = new HttpBackOffIOExceptionHandler(new ExponentialBackOff()); if (sleeperOverride != null) { exceptionHandler.setSleeper(sleeperOverride); } LoggingResponseHandler loggingResponseHandler = new LoggingResponseHandler( new CredentialOrBackoffResponseHandler(), exceptionHandler, ImmutableSet.of(HttpStatus.SC_GONE, HttpStatus.SC_SERVICE_UNAVAILABLE), ImmutableSet.of(HTTP_SC_TOO_MANY_REQUESTS)); request.setUnsuccessfulResponseHandler(loggingResponseHandler); request.setIOExceptionHandler(loggingResponseHandler); if (Strings.isNullOrEmpty(request.getHeaders().getUserAgent())) { logger.atFiner().log( "Request is missing a user-agent, adding default value of '%s'", defaultUserAgent); request.getHeaders().setUserAgent(defaultUserAgent); } for (Map.Entry<String, String> header : headers.entrySet()) { request.getHeaders().set(header.getKey(), header.getValue()); } }
Source:
<code>public static long castToLong(@SqlType(StandardTypes.DOUBLE) double value) { <START> if (value >= Long.MAX_VALUE || value <= Long.MIN_VALUE) { <END> throw new PrestoException(NUMERIC_VALUE_OUT_OF_RANGE, "Out of range for bigint: " + value); } return (long) MathFunctions.round(value); }</code><technical_language>Bug is here. = here. understand this bug affected negative test case, positive test case</technical_language>

Target:
public static long castToLong(@SqlType(StandardTypes.DOUBLE) double value) { try { return DoubleMath.roundToLong(value, HALF_UP); } catch (ArithmeticException e) { throw new PrestoException(INVALID_CAST_ARGUMENT, format("Unable to cast %s to bigint", value), e); } }
Source:
<code>public void write(final ChannelHandlerContext context, final Object message, final ChannelPromise promise) { this.traceOperation(context, "write", message); if (message instanceof RntbdRequestRecord) { final RntbdRequestRecord record = (RntbdRequestRecord) message; this.timestamps.channelWriteAttempted(); record.setSendingRequestHasStarted(); context.write(this.addPendingRequestRecord(context, record), promise).addListener(completed -> { record.stage(RntbdRequestRecord.Stage.SENT); if (completed.isSuccess()) { this.timestamps.channelWriteCompleted(); } }); return; } if (message == RntbdHealthCheckRequest.MESSAGE) { <START> context.writeAndFlush(RntbdHealthCheckRequest.MESSAGE, promise).addListener(completed -> { <END> if (completed.isSuccess()) { this.timestamps.channelPingCompleted(); } }); return; } final IllegalStateException error = new IllegalStateException(lenientFormat("message of %s: %s", message.getClass(), message)); reportIssue(context, "", error); this.exceptionCaught(context, error); }</code><technical_language>is reason this change</technical_language>

Target:
public void write(final ChannelHandlerContext context, final Object message, final ChannelPromise promise) { this.traceOperation(context, "write", message); if (message instanceof RntbdRequestRecord) { final RntbdRequestRecord record = (RntbdRequestRecord) message; this.timestamps.channelWriteAttempted(); record.setSendingRequestHasStarted(); context.write(this.addPendingRequestRecord(context, record), promise).addListener(completed -> { record.stage(RntbdRequestRecord.Stage.SENT); if (completed.isSuccess()) { this.timestamps.channelWriteCompleted(); } }); return; } if (message == RntbdHealthCheckRequest.MESSAGE) { context.write(RntbdHealthCheckRequest.MESSAGE, promise).addListener(completed -> { if (completed.isSuccess()) { this.timestamps.channelPingCompleted(); } }); return; } final IllegalStateException error = new IllegalStateException(lenientFormat("message of %s: %s", message.getClass(), message)); reportIssue(context, "", error); this.exceptionCaught(context, error); }
Source:
<code>private static Iterable<Slice> getGeometrySlicesFromBlock(Block block) { requireNonNull(block, "block is null"); return () -> new Iterator<Slice>() { private final int blockPositionCount = block.getPositionCount(); private int iteratorPosition; @Override public boolean hasNext() { <START> return iteratorPosition != blockPositionCount; <END> } @Override public Slice next() { if (!hasNext()) { throw new NoSuchElementException("Slices have been consumed"); } return GEOMETRY.getSlice(block, iteratorPosition++); } }; }</code><technical_language>call block.getPositionCount() instead of a final variable? diff in perf</technical_language>

Target:
private static Iterable<Slice> getGeometrySlicesFromBlock(Block block) { requireNonNull(block, "block is null"); return () -> new Iterator<Slice>() { private int iteratorPosition; @Override public boolean hasNext() { return iteratorPosition != block.getPositionCount(); } @Override public Slice next() { if (!hasNext()) { throw new NoSuchElementException("Slices have been consumed"); } return GEOMETRY.getSlice(block, iteratorPosition++); } }; }
Source:
<code>public static double[][] removeSelfRatings(double[][] input) { double[][] output = new double[input.length][input.length]; for (int i = 0; i < input.length; i++) { for (int j = 0; j < input[i].length; j++) { <START> output[i][j] = (i == j) ? NA : input[i][j]; <END> } } return output; }</code><technical_language>brackets i == j is useful</technical_language>

Target:
public static double[][] removeSelfRatings(double[][] input) { double[][] output = new double[input.length][input.length]; for (int i = 0; i < input.length; i++) { for (int j = 0; j < input[i].length; j++) { output[i][j] = i == j ? NA : input[i][j]; } } return output; }
Source:
<code>private int readInternal(String path, ByteBuffer buf, long size, long offset, FuseFileInfo fi) { int nread = 0; int rd = 0; final int sz = (int) size; long fd = fi.fh.get(); try (LockResource r1 = new LockResource(getFileLock(fd).writeLock())) { FileInStream is = mOpenFileEntries.get(fd); if (is == null) { LOG.error("Cannot find fd for {}", fd, path); return -ErrorCodes.EBADFD(); } is.seek(offset); final byte[] dest = new byte[sz]; while (rd >= 0 && nread < size) { rd = is.read(dest, nread, sz - nread); if (rd >= 0) { nread += rd; } } if (nread == -1) { nread = 0; } else if (nread > 0) { buf.put(dest, 0, nread); } } catch (Throwable e) { <START> LOG.error("Failed to read {},{},{}: ", path, size, offset, e); <END> return -ErrorCodes.EIO(); } return nread; }</code><technical_language>add labels log, "path: {}, size: {}, offset: {}"</technical_language>

Target:
private int readInternal(String path, ByteBuffer buf, long size, long offset, FuseFileInfo fi) { int nread = 0; int rd = 0; final int sz = (int) size; long fd = fi.fh.get(); try (LockResource r1 = new LockResource(mFileLocks.get(fd).writeLock())) { FileInStream is = mOpenFileEntries.get(fd); if (is == null) { LOG.error("Cannot find fd for {}", fd, path); return -ErrorCodes.EBADFD(); } is.seek(offset); final byte[] dest = new byte[sz]; while (rd >= 0 && nread < size) { rd = is.read(dest, nread, sz - nread); if (rd >= 0) { nread += rd; } } if (nread == -1) { nread = 0; } else if (nread > 0) { buf.put(dest, 0, nread); } } catch (Throwable e) { LOG.error("Failed to read, path: size: offset: {}", path, size, offset, e); return -ErrorCodes.EIO(); } return nread; }
Source:
<code>public String getTypeFilterRegex() { return typeFilterRegex; <START> } <END></code><technical_language>remember format code :)</technical_language>

Target:
public RegexParameterizedPatternParser getTypeFilterRegex() { return typeFilterPattern; }
Source:
<code>public Builder setAsyncMutatorWorkerCount(int asyncMutatorCount) { <START> this.asyncMutatorCount = asyncMutatorCount; <END> return this; }</code><technical_language>nit: check asyncMutatorCount > 0 ? check in private BigtableOptions()</technical_language>

Target:
public Builder setAsyncMutatorWorkerCount(int asyncMutatorCount) { Preconditions.checkArgument( asyncMutatorCount > 0, "asyncMutatorCount must be greater than 0."); this.asyncMutatorCount = asyncMutatorCount; return this; }
Source:
<code>private void logInfoMessage(String message) { <START> logger.log(Level.INFO, String.format("%s (data source = %s, objId = %d, jobId = %d)", message, getDataSourceName(), getDataSourceId(), id)); END> }</code><technical_language>Another place clear job pipeline dichotomy..</technical_language>

Target:
private void logInfoMessage(String message) { logger.log(Level.INFO, String.format("%s (data source = %s, objId = %d, pipeline id = %d, ingest job id = %d)", message, this.dataSource.getName(), this.dataSource.getId(), id, ingestJob.getIngestJobId())); }
Source:
<code>private Map<String, Ref> computeNewRefs() throws IOException { final Map<String, Ref> refs = new HashMap<String, Ref>(); <START> try (final RevWalk rw = new RevWalk(db); final BufferedReader br = new BufferedReader( <END> new InputStreamReader(new FileInputStream(refList), Constants.CHARSET))) { String line; while ((line = br.readLine()) != null) { final String[] parts = line.split("[ \t]{1,}"); final ObjectId origId = ObjectId.fromString(parts[0]); final String type = parts[1]; final String name = parts[2]; ObjectId id = rewrites.get(origId); if (id == null) id = origId; try { rw.parseAny(id); } catch (MissingObjectException mue) { if (!Constants.TYPE_COMMIT.equals(type)) { errw.println(MessageFormat.format(CLIText.get().skippingObject, type, name)); continue; } throw new MissingObjectException(id, type); } refs.put(name, new ObjectIdRef.Unpeeled(Ref.Storage.PACKED, name, id)); } } return refs; }</code><technical_language>(optional)</technical_language>

Target:
private Map<String, Ref> computeNewRefs() throws IOException { final Map<String, Ref> refs = new HashMap<String, Ref>(); try (RevWalk rw = new RevWalk(db); BufferedReader br = new BufferedReader( new InputStreamReader(new FileInputStream(refList), Constants.CHARSET))) { String line; while ((line = br.readLine()) != null) { final String[] parts = line.split("[ \t]{1,}"); final ObjectId origId = ObjectId.fromString(parts[0]); final String type = parts[1]; final String name = parts[2]; ObjectId id = rewrites.get(origId); if (id == null) id = origId; try { rw.parseAny(id); } catch (MissingObjectException mue) { if (!Constants.TYPE_COMMIT.equals(type)) { errw.println(MessageFormat.format(CLIText.get().skippingObject, type, name)); continue; } throw new MissingObjectException(id, type); } refs.put(name, new ObjectIdRef.Unpeeled(Ref.Storage.PACKED, name, id)); } } return refs; }
Source:
<code>public void deactivate() { try { httpService.unregister(WEBAPP_ALIAS + SERVLET_NAME); } catch(IllegalArgumentException e) { <START> logger.info("LgTv Servlet '{}' was not registered. Nothing to deactivate.", WEBAPP_ALIAS + SERVLET_NAME); <END> } finally { logger.info("Stopped LgTv Servlet"); } }</code><technical_language>debug</technical_language>

Target:
public void deactivate() { try { httpService.unregister(WEBAPP_ALIAS + SERVLET_NAME); } catch(IllegalArgumentException e) { logger.debug("LgTv Servlet '{}' was not registered. Nothing to deactivate.", WEBAPP_ALIAS + SERVLET_NAME); } finally { logger.info("Stopped LgTv Servlet"); } }
Source:
<code>public ListenableFuture<ResolvedEquivalents<E>> resolveIds(Iterable<Id> ids, ApplicationSources sources, Set<Annotation> activeAnnotations) { <START> if(!activeAnnotations.contains(Annotation.NON_MERGED)) { <END> ListenableFuture<ResolvedEquivalents<E>> unmerged = resolver.resolveIds(ids, sources.getEnabledReadSources(), activeAnnotations); return Futures.transform(unmerged, mergeUsing(sources)); } else { return resolver.resolveIdsWithoutEquivalence(ids, sources.getEnabledReadSources(), activeAnnotations); } }</code><technical_language>avoid negative conditions reasonable. Positive assertions a bit easier reason "!" easily missed. flip if</technical_language>

Target:
public ListenableFuture<ResolvedEquivalents<E>> resolveIds(Iterable<Id> ids, ApplicationSources sources, Set<Annotation> activeAnnotations) { if(activeAnnotations.contains(Annotation.NON_MERGED)) { return resolver.resolveIdsWithoutEquivalence(ids, sources.getEnabledReadSources(), activeAnnotations); } else { ListenableFuture<ResolvedEquivalents<E>> unmerged = resolver.resolveIds(ids, sources.getEnabledReadSources(), activeAnnotations); return Futures.transform(unmerged, mergeUsing(sources)); } }
Source:
<code><START> public void onBranchUnselected() { <END> view.setEnableCheckoutButton(false); view.setEnableRenameButton(false); view.setEnableDeleteButton(false); }</code><technical_language>I reset of current branch in this method</technical_language>

Target:
public void onBranchUnselected() { selectedBranch = null; view.setEnableCheckoutButton(false); view.setEnableRenameButton(false); view.setEnableDeleteButton(false); }