auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testCreateGetAllDatastreams() throws Exception { DatastreamResources resource = new DatastreamResources(_datastreamKafkaCluster.getPrimaryDatastreamServer()); String datastreamName = "TestDatastream-"; List<Datastream> datastreams = createDataStreams(resource, datastreamName, 10); List<Datastream> queryStreams = resource.getAll(new PagingContext(0, 0, false, false)); queryStreams.forEach(queryStream -> Assert.assertNotNull(queryStream.getDestination())); Assert.assertEquals(datastreams.stream().map(Datastream::getName).collect(Collectors.toSet()), queryStreams.stream().map(Datastream::getName).collect(Collectors.toSet())); Datastream removed = queryStreams.remove(0); Assert.assertTrue(resource.delete(removed.getName()).getStatus() == HttpStatus.S_200_OK); List<Datastream> remainingQueryStreams = resource.getAll(new PagingContext(0, 0, false, false)); Assert.assertEquals(queryStreams.stream().map(Datastream::getName).collect(Collectors.toSet()), remainingQueryStreams.stream().map(Datastream::getName).collect(Collectors.toSet())); }

Target:
public void testCreateGetAllDatastreams() throws Exception { DatastreamResources resource = new DatastreamResources(_datastreamKafkaCluster.getPrimaryDatastreamServer()); Assert.assertEquals(resource.getAll(NO_PAGING).size(), 0); String datastreamName = "TestDatastream-"; List<Datastream> datastreams = createDataStreams(resource, datastreamName, 10); Optional<List<Datastream>> result = PollUtils.poll(() -> resource.getAll(NO_PAGING), streams -> streams.size() == datastreams.size(), 100, 1000); Assert.assertTrue(result.isPresent()); List<Datastream> queryStreams = result.get(); queryStreams.forEach(queryStream -> Assert.assertNotNull(queryStream.getDestination())); Assert.assertEquals(datastreams.stream().map(Datastream::getName).collect(Collectors.toSet()), queryStreams.stream().map(Datastream::getName).collect(Collectors.toSet())); Datastream removed = queryStreams.remove(0); Assert.assertTrue(resource.delete(removed.getName()).getStatus() == HttpStatus.S_200_OK); List<Datastream> remainingQueryStreams = resource.getAll(NO_PAGING); Assert.assertEquals(queryStreams.stream().map(Datastream::getName).collect(Collectors.toSet()), remainingQueryStreams.stream().map(Datastream::getName).collect(Collectors.toSet())); }
Source:
public void stop() { if (channel != null) { channel.getProtocolStack().getTransport().unregisterProbeHandler(probeHandler); } String clusterName = configuration.transport().clusterName(); try { if (disconnectChannel && channel != null && channel.isConnected()) { log.disconnectJGroups(clusterName); if (globalStatsEnabled) { JmxConfigurator.unregisterChannel(channel, mbeanServer, domain, channel.getClusterName()); } channel.disconnect(); } if (closeChannel && channel != null && channel.isOpen()) { channel.close(); } } catch (Exception toLog) { log.problemClosingChannel(toLog, clusterName); } if (requests != null) { requests.forEach(request -> request.cancel(log.cacheManagerIsStopping())); } channel = null; address = null; clusterView = new ClusterView(ClusterView.FINAL_VIEW_ID, Collections.emptyList(), null); requests = null; address = null; physicalAddress = null; CompletableFuture<Void> oldFuture = null; viewUpdateLock.lock(); try { oldFuture = nextViewFuture; nextViewFuture = new CompletableFuture<>(); viewUpdateCondition.signalAll(); } finally { viewUpdateLock.unlock(); if (oldFuture != null) { oldFuture.complete(null); } } }

Target:
public void stop() { if (channel != null) { channel.getProtocolStack().getTransport().unregisterProbeHandler(probeHandler); } String clusterName = configuration.transport().clusterName(); try { if (disconnectChannel && channel != null && channel.isConnected()) { log.disconnectJGroups(clusterName); if (globalStatsEnabled) { JmxConfigurator.unregisterChannel(channel, mbeanServer, domain, channel.getClusterName()); } channel.disconnect(); } if (closeChannel && channel != null && channel.isOpen()) { channel.close(); } } catch (Exception toLog) { log.problemClosingChannel(toLog, clusterName); } if (requests != null) { requests.forEach(request -> request.cancel(log.cacheManagerIsStopping())); } channel = null; address = null; physicalAddress = null; clusterView = new ClusterView(ClusterView.FINAL_VIEW_ID, Collections.emptyList(), null); requests = null; CompletableFuture<Void> oldFuture = null; viewUpdateLock.lock(); try { oldFuture = nextViewFuture; nextViewFuture = new CompletableFuture<>(); viewUpdateCondition.signalAll(); } finally { viewUpdateLock.unlock(); if (oldFuture != null) { oldFuture.complete(null); } } }
Source:
public void testAsynchronousPutting() throws Exception { final EntityId entityId = mTable.getEntityId("foo"); final KijiDataRequest request = KijiDataRequest.create("info", "name"); final CountDownLatch latch = new CountDownLatch(1); final boolean success; KijiTableWriter writer = mTable.openTableWriter(); writer.put(entityId, "info", "name", 123L, "old"); writer.close(); KijiFuture<Object> future = mBufferedWriter.put(entityId, KijiColumnName.create("info", "name"), 123L, "baz"); Futures.addCallback(future, new FutureCallback<Object>() { @Override public void onSuccess(@Nullable final Object o) { latch.countDown(); } @Override public void onFailure(final Throwable throwable) { Assert.fail("Put should not fail"); latch.countDown(); } }); final String actual = mReader.get(entityId, request).getValue("info", "name", 123L).toString(); assertEquals("old", actual); mBufferedWriter.flush(); latch.await(5, TimeUnit.SECONDS); assertEquals("baz", mReader.get(entityId, request).getValue("info", "name", 123L).toString()); }

Target:
public void testAsynchronousPutting() throws Exception { final EntityId entityId = mTable.getEntityId("foo"); final KijiDataRequest request = KijiDataRequest.create("info", "name"); final CountDownLatch latch = new CountDownLatch(1); final Boolean success; KijiTableWriter writer = mTable.openTableWriter(); try { writer.put(entityId, "info", "name", 123L, "old"); } finally { writer.close(); } KijiFuture<Object> future = mBufferedWriter.put(entityId, KijiColumnName.create("info", "name"), 123L, "baz"); Futures.addCallback(future, new FutureCallback<Object>() { @Override public void onSuccess(@Nullable final Object o) { latch.countDown(); } @Override public void onFailure(final Throwable throwable) { Assert.fail("Put should not fail"); } }); final String actual = mReader.get(entityId, request).getValue("info", "name", 123L).toString(); assertEquals("old", actual); mBufferedWriter.flush(); assertTrue(latch.await(5, TimeUnit.SECONDS)); assertEquals("baz", mReader.get(entityId, request).getValue("info", "name", 123L).toString()); }
Source:
protected final void waitUntil(ConfigToolExecutionResult result, Matcher<ConfigToolExecutionResult> matcher) { waitUntil(() -> result, matcher, OP_TIMEOUT); }

Target:
protected final void waitUntil(ConfigToolExecutionResult result, Matcher<ConfigToolExecutionResult> matcher) { waitUntil(() -> result, matcher, getAssertTimeout()); }
Source:
public RsWithStatus(final Response res, final int code, final CharSequence rsn) { super( new RsOf( () -> RsWithStatus.head(res, code, rsn), res::body ) ); }

Target:
public RsWithStatus(final Response res, final int code, final CharSequence rsn) { super( new ResponseOf( () -> RsWithStatus.head(res, code, rsn), res::body ) ); }
Source:
public void shouldHandleNotification() { String requestBody = getNotificationString(); AbstractNotificationPayload finalPayload = webhookService.process(requestBody); OrderStatusChangeNotificationPayload orderNotification = (OrderStatusChangeNotificationPayload)finalPayload; assertThat(orderNotification, is(notNullValue())); assertThat(orderNotification.getPaymentStatus(), is(paymentStatus)); assertThat(orderNotification.getOrderCode(), is(orderCode)); assertThat(orderNotification.getEnvironment(), is(environment)); assertThat(orderNotification.getAdminCode(), is(adminCode)); assertThat(orderNotification.getMerchantId(), is(merchantId)); assertThat(orderNotification.getNotificationEventType(), is(notificationEventType)); }

Target:
public void shouldHandleNotification() { String requestBody = getNotificationString(); AbstractNotificationPayload finalPayload = webhookService.process(requestBody); assertThat("Notification Type", finalPayload, instanceOf(OrderStatusChangeNotificationPayload.class)); OrderStatusChangeNotificationPayload orderNotification = (OrderStatusChangeNotificationPayload)finalPayload; assertThat("Order notification", orderNotification, is(notNullValue())); assertThat("Payment status", orderNotification.getPaymentStatus(), is(paymentStatus)); assertThat("Order code", orderNotification.getOrderCode(), is(orderCode)); assertThat("Environment", orderNotification.getEnvironment(), is(environment)); assertThat("Admin code", orderNotification.getAdminCode(), is(adminCode)); assertThat("Merchant id", orderNotification.getMerchantId(), is(merchantId)); assertThat("Notification event type", orderNotification.getNotificationEventType(), is(notificationEventType)); }
Source:
public static void showRateDialogIfMeetsConditions(final Activity activity) { if (shouldShowRateDialog()) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { showRateDialog((FragmentActivity) activity); } else { showRateDialog(activity); } } }

Target:
public static void showRateDialogIfMeetsConditions(final Activity activity) { if (shouldShowRateDialog()) { if (activity instanceof FragmentActivity) { showRateDialog((FragmentActivity) activity); } else { showRateDialog(activity); } } }
Source:
public RexNode visitDynamicParam(RexDynamicParam dynamicParam) { return new RexDynamicParam(copy(dynamicParam.getType()), dynamicParam.getIndex()); }

Target:
public RexNode visitDynamicParam(RexDynamicParam dynamicParam) { return builder.makeDynamicParam(copy(dynamicParam.getType()), dynamicParam.getIndex()); }
Source:
private void createScheduler() throws SchedulerException { if (!configuration.getQuartzConfiguration().isEmpty()) { StdSchedulerFactory factory = new StdSchedulerFactory(); factory.initialize(createProperties()); scheduler = factory.getScheduler(); return; } scheduler = StdSchedulerFactory.getDefaultScheduler(); }

Target:
private void createScheduler() throws SchedulerException { if (configuration.getQuartzConfiguration().isEmpty()) { scheduler = StdSchedulerFactory.getDefaultScheduler(); return; } StdSchedulerFactory factory = new StdSchedulerFactory(); factory.initialize(createProperties()); scheduler = factory.getScheduler(); }
Source:
private void padLines(CodeMirror cm, int delta, int where) { for (int i = 0; i < delta; i++) { genPadding(cm, where); } }

Target:
private void padLines(CodeMirror cm, int delta, int where) { Element div = DOM.createDiv(); div.setClassName(diffTable.style.padding()); div.setAttribute("style", "height : " + delta + "em"); cm.addLineWidget(where, div, Configuration.create().set("coverGutter", true)); }
Source:
protected Set<Guid> getDiskIds() { if (getVM() == null) { System.out.println("VM is null"); } if (getVM().getDiskMap() == null) { System.out.println("DiskMap is null"); } return getVM().getDiskMap().keySet(); }

Target:
protected Set<Guid> getDiskIds() { if (getVM() == null || getVM().getDiskMap() == null) { return Collections.<Guid>emptySet(); } return getVM().getDiskMap().keySet(); }
Source:
public void anyCombinationOfDefaulfAndOverriddenHostsAreMismatched(DefaultConsoleAddress defaultAddress, OverriddenConsoleAddress overriddenAddress) { List<VDS> mergedAddresses = new ArrayList<VDS>(); mergedAddresses.addAll(defaultAddress.getAllVds()); mergedAddresses.addAll(overriddenAddress.getAllVds()); assertThat(command.isConsoleAddressPartiallyOverridden(mergedAddresses), is(true)); }

Target:
public void anyCombinationOfDefaulfAndOverriddenHostsAreMismatched(DefaultConsoleAddress defaultAddress, OverriddenConsoleAddress overriddenAddress) { List<VDS> mergedAddresses = new ArrayList<VDS>(); mergedAddresses.addAll(defaultAddress.getAllVds()); mergedAddresses.addAll(overriddenAddress.getAllVds()); assertThat(command.isDisplayAddressPartiallyOverridden(mergedAddresses), is(true)); }
Source:
protected GroupConfiguration(String name, int cooldown, int minEntities, int maxEntities, Map<String,String> metadata) { this.name = checkNotNull(name, "name required"); checkArgument(cooldown >= 0, "cooldown should be non-negative"); checkArgument(minEntities >= 0, "minEntities should be non-negative"); checkArgument(maxEntities >= 0, "maxEntities should be non-negative"); this.cooldown = cooldown; this.minEntities = minEntities; this.maxEntities = maxEntities; this.metadata = metadata; if(metadata == null) { this.metadata = Maps.newHashMap(); } }

Target:
protected GroupConfiguration(String name, int cooldown, int minEntities, int maxEntities, Map<String,String> metadata) { this.name = checkNotNull(name, "name required"); checkArgument(cooldown >= 0, "cooldown should be non-negative"); checkArgument(minEntities >= 0, "minEntities should be non-negative"); checkArgument(maxEntities >= 0, "maxEntities should be non-negative"); this.cooldown = cooldown; this.minEntities = minEntities; this.maxEntities = maxEntities; if(metadata == null) { this.metadata = ImmutableMap.of(); } else { this.metadata = ImmutableMap.copyOf(metadata); } }
Source:
Optional<List<ReportEntry>> read(FileSystem fs, Path path) { Supplier<List<ReportEntry>> reportEntriesSupplier = () -> { try { return DataStore.read(new FileSystemPath(fs, path), ReportEntry.SCHEMA$); } catch (Exception e) { logger.error("Reading data store failed."); e.printStackTrace(); return null; } }; return read(reportEntriesSupplier); }

Target:
Optional<List<ReportEntry>> read(FileSystem fs, Path path) { Supplier<List<ReportEntry>> reportEntriesSupplier = () -> { try { return DataStore.read(new FileSystemPath(fs, path), ReportEntry.SCHEMA$); } catch (Exception e) { logger.error("Reading data store failed.", e); return null; } }; return read(reportEntriesSupplier); }
Source:
public void removeFile(long id) throws TskCoreException, SQLException { DrawableTransaction trans = null; CaseDbTransaction caseDbTransaction = null; try { trans = beginTransaction(); removeFile(id, trans); commitTransaction(trans, true); } catch (TskCoreException | SQLException ex) { if (null != caseDbTransaction) { try { caseDbTransaction.rollback(); } catch (TskCoreException ex2) { logger.log(Level.SEVERE, String.format("Failed to roll back case db transaction after error: %s", ex.getMessage()), ex2); } } if (null != trans) { try { rollbackTransaction(trans); } catch (SQLException ex2) { logger.log(Level.SEVERE, String.format("Failed to roll back drawables db transaction after error: %s", ex.getMessage()), ex2); } } throw ex; } }

Target:
public void removeFile(long id) throws TskCoreException, SQLException { DrawableTransaction trans = null; try { trans = beginTransaction(); removeFile(id, trans); commitTransaction(trans, true); } catch (TskCoreException | SQLException ex) { if (null != trans) { try { rollbackTransaction(trans); } catch (SQLException ex2) { logger.log(Level.SEVERE, String.format("Failed to roll back drawables db transaction after error: %s", ex.getMessage()), ex2); } } throw ex; } }
Source:
protected void messageReceived(ChannelHandlerContext ctx, Message message) throws Exception { switch (message.getMessageType()) { case InitResponse: InitResponse initResponseMessage = (InitResponse) message; if (initResponseMessage.getVersion() == InitMessage.DEFAULT_VERSION) { ctx.pipeline().remove(this); } else { throw new FatalProtocolError( new Trace(0, 0, 0, (byte) 0x00), String.format("Expected Protocol version: %d", InitMessage.DEFAULT_VERSION) ); } break; default: throw new FatalProtocolError( new Trace(0, 0, 0, (byte) 0x00), "Must not send any data until receiving Init Response" ); } }

Target:
protected void messageReceived(ChannelHandlerContext ctx, Message message) throws ProtocolError { switch (message.getMessageType()) { case InitResponse: InitResponse initResponseMessage = (InitResponse) message; if (initResponseMessage.getVersion() == InitMessage.DEFAULT_VERSION) { ctx.pipeline().remove(this); } else { throw new FatalProtocolError( String.format("Expected Protocol version: %d", InitMessage.DEFAULT_VERSION), new Trace(0, 0, 0, (byte) 0x00) ); } break; default: throw new FatalProtocolError( "Must not send any data until receiving Init Response", new Trace(0, 0, 0, (byte) 0x00) ); } }
Source:
public void requestSpace(long sessionId, long blockId, long additionalBytes) throws BlockDoesNotExistException, WorkerOutOfSpaceException, IOException { LOG.debug("requestSpace: sessionId={}, blockId={}, additionalBytes={}", sessionId, blockId, additionalBytes); try (LockResource r = new LockResource(mMetadataWriteLock)) { TempBlockMeta tempBlockMeta = mMetaManager.getTempBlockMeta(blockId); StorageDirView allocationDir = allocateSpace(sessionId, AllocateOptions.forRequestSpace(additionalBytes, tempBlockMeta.getBlockLocation())); if (allocationDir == null) { throw new WorkerOutOfSpaceException(String.format( "Can't reserve more space for block: %d under session: %d.", blockId, sessionId)); } if (!allocationDir.toBlockStoreLocation().equals(tempBlockMeta.getBlockLocation())) { throw new RuntimeException("Allocation error: location enforcement failed"); } try { mMetaManager.resizeTempBlockMeta( tempBlockMeta, tempBlockMeta.getBlockSize() + additionalBytes); } catch (InvalidWorkerStateException e) { throw Throwables.propagate(e); } } }

Target:
public void requestSpace(long sessionId, long blockId, long additionalBytes) throws BlockDoesNotExistException, WorkerOutOfSpaceException, IOException { LOG.debug("requestSpace: sessionId={}, blockId={}, additionalBytes={}", sessionId, blockId, additionalBytes); try (LockResource r = new LockResource(mMetadataWriteLock)) { TempBlockMeta tempBlockMeta = mMetaManager.getTempBlockMeta(blockId); StorageDirView allocationDir = allocateSpace(sessionId, AllocateOptions.forRequestSpace(additionalBytes, tempBlockMeta.getBlockLocation())); if (allocationDir == null) { throw new WorkerOutOfSpaceException(String.format( "Can't reserve more space for block: %d under session: %d.", blockId, sessionId)); } if (!allocationDir.toBlockStoreLocation().equals(tempBlockMeta.getBlockLocation())) { throw new IllegalStateException( String.format("Allocation error: location enforcement failed for location: %s", allocationDir.toBlockStoreLocation())); } try { mMetaManager.resizeTempBlockMeta( tempBlockMeta, tempBlockMeta.getBlockSize() + additionalBytes); } catch (InvalidWorkerStateException e) { throw Throwables.propagate(e); } } }
Source:
public HeaderExtension getAbsoluteSendTimeExtension(RawPacket packet) { if( packet.getExtensionBit() && packet.getHeaderExtensionType() == getAbsSendTimeExtensionID() ) { return packet.getHeaderExtension(getAbsSendTimeExtensionID()); } return null; }

Target:
public HeaderExtension getAbsoluteSendTimeExtension(RawPacket packet) { if( packet.getExtensionBit() && getAbsSendTimeExtensionID() != -1 ) { return packet.getHeaderExtension(getAbsSendTimeExtensionID()); } return null; }
Source:
public UstDebugInfoBinaryFile(String filePath, String buildId, boolean isPic) { fFilePath = filePath; fBuildId = buildId; fIsPic = isPic; StringBuilder sb = new StringBuilder(); sb.append(filePath).append(" ("); if (fIsPic) { sb.append("PIC"); } else { sb.append("non-PIC"); } sb.append(", ").append(buildId).append(')'); fToString = sb.toString(); }

Target:
public UstDebugInfoBinaryFile(String filePath, String buildId, boolean isPic) { fFilePath = filePath; fBuildId = buildId; fIsPic = isPic; fToString = filePath + " (" + (fIsPic ? "PIC" : "non-PIC") + ", " + buildId + ')'; }
Source:
public ConfigureProjectPresenter(ConfigureProjectView view, OpenshiftServiceClient openShiftClient, ProjectServiceClient projectServiceClient, DtoUnmarshallerFactory dtoUnmarshaller, DtoFactory dtoFactory, OpenshiftLocalizationConstant locale) { this.view = view; this.openShiftClient = openShiftClient; this.projectServiceClient = projectServiceClient; this.dtoUnmarshaller = dtoUnmarshaller; this.dtoFactory = dtoFactory; this.locale = locale; view.setDelegate(this); }

Target:
public ConfigureProjectPresenter(ConfigureProjectView view, OpenshiftServiceClient openShiftClient, ProjectServiceClient projectServiceClient, DtoUnmarshallerFactory dtoUnmarshaller, DtoFactory dtoFactory, OpenshiftLocalizationConstant locale) { this.view = view; this.openShiftClient = openShiftClient; this.projectServiceClient = projectServiceClient; this.dtoUnmarshaller = dtoUnmarshaller; this.dtoFactory = dtoFactory; this.locale = locale; openShiftProjects = new ArrayList<>(); cheProjects = new ArrayList<>(); view.setDelegate(this); }
Source:
protected void setErrorMessageUI(String message, boolean showNotificationButton) { setLoginBoxesColorError(); username.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.icon_user_attnneg), null, null, null); passwordOrPin.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.icon_lock_attnneg), null, null, null); loginButton.setBackgroundColor(getResources().getColor(R.color.cc_attention_negative_bg)); loginButton.setTextColor(getResources().getColor(R.color.cc_attention_negative_text)); errorContainer.setVisibility(View.VISIBLE); errorTextView.setText(message); if(showNotificationButton) { notificationButtonView.setVisibility(View.VISIBLE); } }

Target:
protected void setErrorMessageUI(String message, boolean showNotificationButton) { setLoginBoxesColorError(); username.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.icon_user_attnneg), null, null, null); passwordOrPin.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.icon_lock_attnneg), null, null, null); loginButton.setBackgroundColor(getResources().getColor(R.color.cc_attention_negative_bg)); loginButton.setTextColor(getResources().getColor(R.color.cc_attention_negative_text)); errorContainer.setVisibility(View.VISIBLE); errorTextView.setText(message); notificationButtonView.setVisibility(showNotificationButton ? View.VISIBLE : View.GONE); }
Source:
protected final Collection<DRepresentation> getRepresentationsByName(final String representationName) { final Collection<DRepresentation> representations = DialectManager.INSTANCE.getAllLoadedRepresentations(session).stream().filter(rep -> rep.getName().equals(representationName)) .collect(Collectors.toList()); return representations; }

Target:
protected final List<DRepresentation> getRepresentationsByName(final String representationName) { final List<DRepresentation> representations = DialectManager.INSTANCE.getAllLoadedRepresentations(session).stream().filter(rep -> representationName.equals(rep.getName())) .collect(Collectors.toList()); return representations; }
Source:
public void setDetailModels(List<HasEntity<D>> value) { if (detailModels != value) { detailModels = value; onPropertyChanged(new PropertyChangedEventArgs("DetailModels")); } }

Target:
public void setDetailModels(List<HasEntity<D>> value) { if (detailModels != value) { detailModels = value; onPropertyChanged(new PropertyChangedEventArgs(DETAIL_MODELS)); } }
Source:
public synchronized long getTimestamp(final int offset) { HistogramScaledData scaledData = fScaledData; if (scaledData != null) { return fScaledData.fFirstBucketTime + (long) (0.5 + (fScaledData.fBucketDuration * offset)); } return 0; }

Target:
public synchronized long getTimestamp(final int offset) { HistogramScaledData scaledData = fScaledData; if (scaledData != null) { return fScaledData.fFirstBucketTime + Math.round(scaledData.fBucketDuration * offset); } return 0; }
Source:
public MapEntryMappers() { keyColumn = null; valueColumn = null; }

Target:
public MapEntryMappers()
Source:
protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) { BeanDefinitionBuilder candidateBuilder = BeanDefinitionBuilder.genericBeanDefinition(DefaultCandidate.class); candidateBuilder.addConstructorArgValue(UUID.randomUUID().toString()); candidateBuilder.addConstructorArgValue(element.getAttribute("role")); BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(LeaderInitiator.class); builder.addConstructorArgReference(element.getAttribute("client")); builder.addConstructorArgValue(candidateBuilder.getBeanDefinition()); builder.addConstructorArgValue(element.getAttribute("path")); BeanDefinitionBuilder publisherBuilder = BeanDefinitionBuilder .genericBeanDefinition(DefaultLeaderEventPublisher.class); builder.addPropertyValue("leaderEventPublisher", publisherBuilder.getBeanDefinition()); return builder.getBeanDefinition(); }

Target:
protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) { BeanDefinitionBuilder candidateBuilder = BeanDefinitionBuilder.genericBeanDefinition(DefaultCandidate.class); candidateBuilder.addConstructorArgValue(UUID.randomUUID().toString()); candidateBuilder.addConstructorArgValue(element.getAttribute("role")); BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(LeaderInitiator.class); builder.addConstructorArgReference(element.getAttribute("client")); builder.addConstructorArgValue(candidateBuilder.getBeanDefinition()); builder.addConstructorArgValue(element.getAttribute("path")); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "auto-startup"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "phase"); BeanDefinitionBuilder publisherBuilder = BeanDefinitionBuilder .genericBeanDefinition(DefaultLeaderEventPublisher.class); builder.addPropertyValue("leaderEventPublisher", publisherBuilder.getBeanDefinition()); return builder.getBeanDefinition(); }
Source:
public void onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); if (mContainerActivity.getStorageManager() != null) { FileMenuFilter mf = new FileMenuFilter( getFile(), mContainerActivity.getStorageManager().getAccount(), mContainerActivity, getActivity() ); mf.filter(menu); } MenuItem item = menu.findItem(R.id.action_see_details); if (item != null) { item.setVisible(false); item.setEnabled(false); } item = menu.findItem(R.id.action_move); if (item != null) { item.setVisible(false); item.setEnabled(false); } item = menu.findItem(R.id.action_copy); if (item != null) { item.setVisible(false); item.setEnabled(false); } item = menu.findItem(R.id.action_switch_view); if (item != null){ item.setVisible(false); item.setEnabled(false); } item = menu.findItem(R.id.action_sync_account); if (item != null) { item.setVisible(false); item.setEnabled(false); } item = menu.findItem(R.id.action_sort); if (item != null) { item.setVisible(false); item.setEnabled(false); } }

Target:
public void onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); if (mContainerActivity.getStorageManager() != null) { FileMenuFilter mf = new FileMenuFilter( getFile(), mContainerActivity.getStorageManager().getAccount(), mContainerActivity, getActivity() ); mf.filter(menu); } MenuItem item = menu.findItem(R.id.action_see_details); if (item != null) { item.setVisible(false); item.setEnabled(false); } item = menu.findItem(R.id.action_move); if (item != null) { item.setVisible(false); item.setEnabled(false); } item = menu.findItem(R.id.action_copy); if (item != null) { item.setVisible(false); item.setEnabled(false); } Boolean dualPane = getResources().getBoolean(R.bool.large_land_layout); item = menu.findItem(R.id.action_switch_view); if (item != null && !dualPane){ item.setVisible(false); item.setEnabled(false); } item = menu.findItem(R.id.action_sync_account); if (item != null && !dualPane) { item.setVisible(false); item.setEnabled(false); } item = menu.findItem(R.id.action_sort); if (item != null && !dualPane) { item.setVisible(false); item.setEnabled(false); } }
Source:
public cgeocoords(final AbstractActivity contextIn, cgSettings settingsIn, final Geopoint gpIn, final cgGeo geoIn) { super(contextIn); context = contextIn; settings = settingsIn; geo = geoIn; if (gpIn != null) { gp = gpIn; } else if (geo != null && geo.latitudeNow != null && geo.longitudeNow != null) { gp = new Geopoint(geo.latitudeNow, geo.longitudeNow); } else { gp = new Geopoint(); } }

Target:
public cgeocoords(final AbstractActivity contextIn, cgSettings settingsIn, final Geopoint gpIn, final cgGeo geoIn) { super(contextIn); context = contextIn; settings = settingsIn; geo = geoIn; if (gpIn != null) { gp = gpIn; } else if (geo != null && geo.latitudeNow != null && geo.longitudeNow != null) { gp = new Geopoint(geo.latitudeNow, geo.longitudeNow); } }
Source:
public SolrQuery propertyIsBetween( String propertyName, Object lowerBoundary, Object upperBoundary) { return getBetweenQuery( propertyName, AttributeFormat.FLOAT, (Number) lowerBoundary, (Number) upperBoundary); }

Target:
public SolrQuery propertyIsBetween( String propertyName, Object lowerBoundary, Object upperBoundary) throws IllegalArgumentException { if (lowerBoundary instanceof Number && upperBoundary instanceof Number) { return getBetweenQuery( propertyName, AttributeFormat.FLOAT, (Number) lowerBoundary, (Number) upperBoundary); } throw new IllegalArgumentException("Non Number Object values are not accepted."); }
Source:
private List<DSpaceObject> constructDSpaceObjectList(Context context, HttpServletRequest request) throws IOException { List<String> list = readFromRequest(request); List<DSpaceObject> dSpaceObjects = new LinkedList<>(); for (String string : list) { String uuid = string.substring(string.lastIndexOf('/') + 1); try { for (DSpaceObjectService dSpaceObjectService : dSpaceObjectServices) { DSpaceObject dSpaceObject = dSpaceObjectService.find(context, UUIDUtils.fromString(uuid)); if (dSpaceObject != null) { dSpaceObjects.add(dSpaceObject); break; } } } catch (SQLException e) { log.error(e.getMessage(), e); } } return dSpaceObjects; }

Target:
private List<DSpaceObject> constructDSpaceObjectList(Context context, HttpServletRequest request) { List<String> list = null; try { list = readFromRequest(request); } catch (IOException e) { log.error("Something went wrong with reading in the inputstream from the request", e); } List<DSpaceObject> dSpaceObjects = new LinkedList<>(); for (String string : list) { if (string.endsWith("/")) { string = string.substring(0, string.length() - 1); } String uuid = string.substring(string.lastIndexOf('/') + 1); try { for (DSpaceObjectService dSpaceObjectService : dSpaceObjectServices) { DSpaceObject dSpaceObject = dSpaceObjectService.find(context, UUIDUtils.fromString(uuid)); if (dSpaceObject != null) { dSpaceObjects.add(dSpaceObject); break; } } } catch (SQLException e) { log.error("Could not find DSpaceObject for UUID: " + uuid, e); } } return dSpaceObjects; }
Source:
public void enqueue(Set<LockToken> tokens) { outstandingLockTokens.getAndAccumulate(tokens, Sets::union); scheduleIfNoTaskRunning(); }

Target:
public void enqueue(Set<LockToken> tokens) { readWriteLock.readLock().lock(); try { outstandingLockTokens.addAll(tokens); } finally { readWriteLock.readLock().unlock(); } if (unlockIsScheduled.compareAndSet(false, true)) { scheduledExecutorService.submit(this::unlockOutstanding); } }
Source:
protected Response.StatusType getStatus() { return Response.Status.BAD_REQUEST; }

Target:
protected Response.StatusType getStatus() { return Response.Status.CONFLICT; }
Source:
public Repo randomRepo() { final int len = 4; return new MkRepo( this.storage, this.self, new Coordinates.Simple( this.self, RandomStringUtils.randomAlphanumeric( new Random().nextInt(len) + len ) ) ); }

Target:
public Repo randomRepo() { return new MkRepo( this.storage, this.self, new Coordinates.Simple( this.self, RandomStringUtils.randomAlphanumeric(Tv.TEN) ) ); }
Source:
public long add(Packet packet) { int pointer = writerPointer.getAndUpdate(operand -> { Packet p = store[operand]; if (p != null) { return operand; } packet.setCorrelationID(correlationID(operand, sequence.incrementAndGet())); store[operand] = packet; return operand + 1 == store.length ? 0 : operand + 1; }); if (pointer(packet.getCorrelationID()) != pointer) { throw new ActiveMQInterruptedException("unable to send due to buffer full"); } return packet.getCorrelationID(); }

Target:
public void add(Packet packet) { if (store.size() + 1 > size) { throw ActiveMQClientMessageBundle.BUNDLE.cannotSendPacketWhilstResponseCacheFull(); } this.store.put(packet.getCorrelationID(), packet); }
Source:
protected void addCommands() { UICommand tempVar2 = new UICommand("OnSave", this); tempVar2.setTitle(ConstantsManager.getInstance().getConstants().ok()); tempVar2.setIsDefault(true); getCommands().add(tempVar2); UICommand tempVar3 = new UICommand("Cancel", this); tempVar3.setTitle(ConstantsManager.getInstance().getConstants().cancel()); tempVar3.setIsCancel(true); getCommands().add(tempVar3); }

Target:
protected void addCommands() { getCommands().add(new UICommand("OnSave", this).setTitle(ConstantsManager.getInstance().getConstants().ok()) .setIsDefault(true)); getCommands().add(new UICommand("Cancel", this).setTitle(ConstantsManager.getInstance().getConstants().cancel()) .setIsCancel(true)); }
Source:
public static void updateBeanValue(final WComponent component, final boolean visibleOnly) { if (!component.isVisible() && visibleOnly) { return; } if (component instanceof WBeanComponent) { ((WBeanComponent) component).updateBeanValue(); } if (component instanceof WDataTable || component instanceof WTable || component instanceof WRepeater) { return; } if (component instanceof Container) { final List<WComponent> children = ((Container) component).getChildren(); Collections.reverse(children); for (WComponent child : children) { updateBeanValue(child, visibleOnly); } } }

Target:
public static void updateBeanValue(final WComponent component, final boolean visibleOnly) { if (!component.isVisible() && visibleOnly) { return; } if (component instanceof WBeanComponent) { ((WBeanComponent) component).updateBeanValue(); } if (component instanceof WDataTable || component instanceof WTable || component instanceof WRepeater) { return; } if (component instanceof Container) { for (int i = ((Container) component).getChildCount() - 1; i >= 0; i--) { updateBeanValue(((Container) component).getChildAt(i), visibleOnly); } } }
Source:
public void shouldResumeWhenWritabilityChanged() throws Exception { TestThrottleLock lockOverride = new TestThrottleLock(); TransportThrottle throttle = newThrottleAndInstall( channel, lockOverride ); when( channel.isWritable() ).thenReturn( false ); Thread throttleThread = Executors.defaultThreadFactory().newThread( () -> throttle.acquire( channel ) ); throttleThread.start(); awaitWaitingState( throttleThread, TimeUnit.MINUTES.toMillis( 1 ) ); when( channel.isWritable() ).thenReturn( true ); ArgumentCaptor<ChannelInboundHandler> captor = ArgumentCaptor.forClass( ChannelInboundHandler.class ); verify( channel.pipeline() ).addLast( captor.capture() ); captor.getValue().channelWritabilityChanged( context ); throttleThread.join( TimeUnit.MINUTES.toMillis( 1 ) ); assertFalse( throttleThread.isAlive() ); assertThat( lockOverride.lockCallCount(), greaterThan( 0 ) ); assertThat( lockOverride.unlockCallCount(), is( 1 ) ); }

Target:
public void shouldResumeWhenWritabilityChanged() throws Exception { TestThrottleLock lockOverride = new TestThrottleLock(); TransportThrottle throttle = newThrottleAndInstall( channel, lockOverride ); when( channel.isWritable() ).thenReturn( false ); Future<Void> completionFuture = otherThread.execute( state -> { throttle.acquire( channel ); return null; } ); otherThread.get().waitUntilWaiting(); when( channel.isWritable() ).thenReturn( true ); ArgumentCaptor<ChannelInboundHandler> captor = ArgumentCaptor.forClass( ChannelInboundHandler.class ); verify( channel.pipeline() ).addLast( captor.capture() ); captor.getValue().channelWritabilityChanged( context ); otherThread.get().awaitFuture( completionFuture ); assertThat( lockOverride.lockCallCount(), greaterThan( 0 ) ); assertThat( lockOverride.unlockCallCount(), is( 1 ) ); }
Source:
public void disableDarkTheme(boolean disabled) { darkThemeDisabled = disabled; }

Target:
public synchronized void disableDarkTheme(boolean disabled) { darkThemeDisabled = disabled; }
Source:
public void testCommandLine() throws IOException { final File tnCoverageFile = LOG2_TN_COVERAGE_FILE; final File outputSegmentFile = createTempFile("segments", ".seg"); final int initialNumStates = 10; final String[] arguments = { "-" + ExomeStandardArgumentDefinitions.TANGENT_NORMALIZED_COUNTS_FILE_SHORT_NAME, tnCoverageFile.getAbsolutePath(), "-" + PerformCopyRatioSegmentation.INITIAL_NUM_STATES_SHORT_NAME, Integer.toString(initialNumStates), "-" + ExomeStandardArgumentDefinitions.SEGMENT_FILE_SHORT_NAME, outputSegmentFile.getAbsolutePath(), }; runCommandLine(arguments); final List<ModeledSegment> segments = SegmentUtils.readModeledSegmentsFromSegmentFile(outputSegmentFile); }

Target:
public void testCommandLine() throws IOException { final File tnCoverageFile = LOG2_TN_COVERAGE_FILE; final File outputSegmentFile = createTempFile("segments", ".seg"); final int initialNumStates = 10; final String[] arguments = { "-" + ExomeStandardArgumentDefinitions.TANGENT_NORMALIZED_COUNTS_FILE_SHORT_NAME, tnCoverageFile.getAbsolutePath(), "-" + PerformCopyRatioSegmentation.INITIAL_NUM_STATES_SHORT_NAME, Integer.toString(initialNumStates), "-" + ExomeStandardArgumentDefinitions.SEGMENT_FILE_SHORT_NAME, outputSegmentFile.getAbsolutePath() }; runCommandLine(arguments); final List<ModeledSegment> segments = SegmentUtils.readModeledSegmentsFromSegmentFile(outputSegmentFile); }
Source:
protected void attachCVterms(SqwFile file, String ontID, String commaSepTerms) { System.err.println("Use of attachCVTerms is deprecated. Please use attachCVlabels"); attachCVlabels(file, ontID, commaSepTerms); }

Target:
protected void attachCVterms(SqwFile file, String ontID, String commaSepTerms) { Log.warn("Use of attachCVTerms is deprecated. Please use attachCVlabels"); attachCVlabels(file, ontID, commaSepTerms); }
Source:
public void startAllServices(final Map<Service, ServiceConfiguration<?>> serviceConfigs) throws Exception { Deque<Service> started = new ArrayDeque<Service>(); final Lock lock = runningLock.writeLock(); lock.lock(); try { if (!running.compareAndSet(false, true)) { throw new IllegalStateException("Already started!"); } for (Service service : services.values()) { service.start(serviceConfigs.get(service)); started.push(service); LOGGER.info("All Services successfully started. "); } } catch (Exception e) { while(!started.isEmpty()) { Service toBeStopped = started.pop(); try { toBeStopped.stop(); } catch (Exception e1) { LOGGER.error("Stopping Service failed due to "+e1.getMessage()); } } throw e; } finally { lock.unlock(); } }

Target:
public void startAllServices(final Map<Service, ServiceConfiguration<?>> serviceConfigs) throws Exception { Deque<Service> started = new ArrayDeque<Service>(); final Lock lock = runningLock.writeLock(); lock.lock(); try { if (!running.compareAndSet(false, true)) { throw new IllegalStateException("Already started!"); } for (Service service : services.values()) { service.start(serviceConfigs.get(service)); started.push(service); } LOGGER.info("All Services successfully started."); } catch (Exception e) { while(!started.isEmpty()) { Service toBeStopped = started.pop(); try { toBeStopped.stop(); } catch (Exception e1) { LOGGER.error("Stopping Service failed due to ", e1); } } throw e; } finally { lock.unlock(); } }
Source:
public static String hostFromAssignmentId(String assignmentId, String delimiter) { int last = assignmentId.lastIndexOf(delimiter); String host = assignmentId.substring(last + delimiter.length()); LOG.debug("AssignMentId: " + assignmentId + " Host: " + host); return host; }

Target:
public static String hostFromAssignmentId(String assignmentId, String delimiter) { final int last = assignmentId.lastIndexOf(delimiter); String host = assignmentId.substring(last + delimiter.length()); LOG.debug("assignmentId=" + assignmentId + " host=" + host); return host; }
Source:
public void initialise() { setAnimationSystem(MenuAnimationSystems.createDefaultSwipeAnimation()); gameModules = find("modules", UIList.class); gameWorlds = find("worlds", UIList.class); biomes = find("biomes", UIList.class); blocks = find("blocks", UIList.class); description = find("description", UIText.class); descriptionTitle = find("descriptionTitle", UILabel.class); worldDescription = find("worldDescription", ScrollableArea.class); descriptionContainer = find("descriptionContainer", ScrollableArea.class); openModuleDetails = find("openModuleDetails", UIButton.class); previewSlideshow = find("preview", UIImageSlideshow.class); if (descriptionContainer != null && worldDescription != null && descriptionTitle != null && gameModules != null && gameWorlds != null && biomes != null && blocks != null && openModuleDetails != null || previewSlideshow != null) { setUpGameModules(); setUpGameWorlds(); setUpBlocks(); setUpBiomes(); setUpPreviewSlideshow(); openModuleDetails.subscribe(button -> openModuleDetailsScreen()); WidgetUtil.trySubscribe(this, "showErrors", button -> showErrors()); WidgetUtil.trySubscribe(this, "close", button -> triggerBackAnimation()); } else { logger.error("Can't initialize screen correctly!"); triggerBackAnimation(); getManager().pushScreen(MessagePopup.ASSET_URI, MessagePopup.class).setMessage(translationSystem.translate("${engine:menu#game-details-errors-message-title}"), translationSystem.translate("${engine:menu#game-details-errors-message-body}")); } }

Target:
public void initialise() { setAnimationSystem(MenuAnimationSystems.createDefaultSwipeAnimation()); gameModules = find("modules", UIList.class); gameWorlds = find("worlds", UIList.class); biomes = find("biomes", UIList.class); blocks = find("blocks", UIList.class); description = find("description", UIText.class); descriptionTitle = find("descriptionTitle", UILabel.class); worldDescription = find("worldDescription", ScrollableArea.class); descriptionContainer = find("descriptionContainer", ScrollableArea.class); openModuleDetails = find("openModuleDetails", UIButton.class); previewSlideshow = find("preview", UIImageSlideshow.class); if (descriptionContainer != null && worldDescription != null && descriptionTitle != null && gameModules != null && gameWorlds != null && biomes != null && blocks != null && openModuleDetails != null && previewSlideshow != null) { setUpGameModules(); setUpGameWorlds(); setUpBlocks(); setUpBiomes(); setUpPreviewSlideshow(); openModuleDetails.subscribe(button -> openModuleDetailsScreen()); WidgetUtil.trySubscribe(this, "showErrors", button -> showErrors()); WidgetUtil.trySubscribe(this, "close", button -> triggerBackAnimation()); } else { logger.error("Can't initialize screen correctly!"); triggerBackAnimation(); getManager().pushScreen(MessagePopup.ASSET_URI, MessagePopup.class).setMessage(translationSystem.translate("${engine:menu#game-details-errors-message-title}"), translationSystem.translate("${engine:menu#game-details-errors-message-body}")); } }
Source:
public void updateDomain(UpdateDomain domain) throws CreateDomainException { try { directProxy.updateDomain(domain); } catch (Exception ex) { throw new CreateDomainException("Duplicate Domain: " + domain.getDomain().getDomainName(), ex); } }

Target:
public void updateDomain(UpdateDomain domain) throws DomainException { try { directProxy.updateDomain(domain); } catch (Exception ex) { throw new DomainException("Unable to update Domain: " + domain.getDomain().getDomainName(), ex); } }
Source:
protected void configureColumnSettings(Displayer displayer, CSVDataSetDef csvDataSetDef) { DataSet dataSet = displayer.getDataSetHandler().getLastDataSet(); for (DataColumn column : dataSet.getColumns()) { if (column.getColumnType().equals(ColumnType.DATE)) { String pattern = csvDataSetDef.getDatePattern(column.getId()); if (pattern != null) { displayer.getDisplayerSettings().setColumnValuePattern(column.getId(), pattern); } } else if (column.getColumnType().equals(ColumnType.NUMBER)) { String pattern = csvDataSetDef.getNumberPattern(column.getId()); if (pattern != null) { displayer.getDisplayerSettings().setColumnValuePattern(column.getId(), pattern); } } } }

Target:
protected void configureColumnSettings(Displayer displayer, CSVDataSetDef csvDataSetDef) { DataSet dataSet = displayer.getDataSetHandler().getLastDataSet(); dataSet.getColumns().stream().forEach(column -> { if (column.getColumnType().equals(ColumnType.DATE)) { String pattern = csvDataSetDef.getDatePattern(column.getId()); if (pattern != null) { displayer.getDisplayerSettings().setColumnValuePattern(column.getId(), pattern); } } else if (column.getColumnType().equals(ColumnType.NUMBER)) { String pattern = csvDataSetDef.getNumberPattern(column.getId()); if (pattern != null) { displayer.getDisplayerSettings().setColumnValuePattern(column.getId(), pattern); } } }); }
Source:
public void cantDowngradeIfMixedTypesNotSupported() { storagePoolVersion35(); cmd.getStoragePool().setCompatibilityVersion(Version.v3_3); StorageDomain sdISCI = new StorageDomain(); sdISCI.setStorageFormat(StorageFormatType.V3); sdISCI.setStorageType(StorageType.ISCSI); StorageDomain sdNFS = new StorageDomain(); sdNFS.setStorageFormat(StorageFormatType.V3); sdNFS.setStorageType(StorageType.NFS); setAttachedDomains(sdISCI, sdNFS); List<StorageType> storageTypes = new ArrayList<>(); storageTypes.add(sdISCI.getStorageType()); storageTypes.add(sdNFS.getStorageType()); doReturn(storageTypes).when(spDao).getStorageTypesInPool(any(Guid.class)); canDoActionFailed(VdcBllMessages.ACTION_TYPE_FAILED_MIXED_STORAGE_TYPES_NOT_ALLOWED); }

Target:
public void cantDowngradeIfMixedTypesNotSupported() { storagePoolVersion35(); cmd.getStoragePool().setCompatibilityVersion(Version.v3_3); StorageDomain sdISCI = createStorageDomain(StorageFormatType.V3, StorageType.ISCSI); StorageDomain sdNFS = createStorageDomain(StorageFormatType.V3, StorageType.NFS); setAttachedDomains(sdISCI, sdNFS); List<StorageType> storageTypes = new ArrayList<>(); storageTypes.add(sdISCI.getStorageType()); storageTypes.add(sdNFS.getStorageType()); doReturn(storageTypes).when(spDao).getStorageTypesInPool(any(Guid.class)); canDoActionFailed(VdcBllMessages.ACTION_TYPE_FAILED_MIXED_STORAGE_TYPES_NOT_ALLOWED); }
Source:
public void actionPerformed(AnActionEvent e) { LOGGER.info("Performing AddFileToTfIgnoreAction for " + myServerFilePath); Workspace partialWorkspace = CommandUtils.getPartialWorkspace(myProject); String filePath = ObjectUtils.assertNotNull( TfsFileUtil.translateServerItemToLocalItem(partialWorkspace.getMappings(), myServerFilePath, false)); File localFile = new File(filePath); LOGGER.info("Local file path: " + localFile.getAbsolutePath()); File tfIgnore = TfIgnoreUtil.findNearestOrRootTfIgnore(partialWorkspace.getMappings(), localFile); LOGGER.info(".tfignore location: " + (tfIgnore == null ? "null" : tfIgnore.getAbsolutePath())); if (tfIgnore != null) { CommandProcessor.getInstance().executeCommand( myProject, () -> ApplicationManager.getApplication().runWriteAction(() -> { try { TfIgnoreUtil.addToTfIgnore(this, tfIgnore, localFile); } catch (IOException ex) { LOGGER.error(ex); } }), null, null); RefreshAction.doRefresh(myProject); } }

Target:
public void actionPerformed(AnActionEvent e) { ourLogger.info("Performing AddFileToTfIgnoreAction for " + myServerFilePath); Workspace partialWorkspace = CommandUtils.getPartialWorkspace(myProject); String filePath = ObjectUtils.assertNotNull( TfsFileUtil.translateServerItemToLocalItem(partialWorkspace.getMappings(), myServerFilePath, false)); File localFile = new File(filePath); ourLogger.info("Local file path: " + localFile.getAbsolutePath()); File tfIgnore = TfIgnoreUtil.findNearestOrRootTfIgnore(partialWorkspace.getMappings(), localFile); ourLogger.info(".tfignore location: " + (tfIgnore == null ? "null" : tfIgnore.getAbsolutePath())); if (tfIgnore != null) { CommandProcessor.getInstance().executeCommand( myProject, () -> ApplicationManager.getApplication().runWriteAction(() -> { try { TfIgnoreUtil.addToTfIgnore(this, tfIgnore, localFile); } catch (IOException ex) { ourLogger.error(ex); } }), null, null); RefreshAction.doRefresh(myProject); } }