auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void ephemeralCreateMultiOpTest() throws KeeperException, InterruptedException, IOException { final ZooKeeper zk = createClient(); <START> waitForClient(zk, ZooKeeper.States.CONNECTED); <END> String data = "test"; String path = "/ephemeralcreatemultiop"; zk.create(path, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); List<OpResult> multi = null; LOG.info("RUNNING MULTI-OP"); try { multi = zk.multi(Arrays.asList( Op.setData(path, data.getBytes(), 0), Op.create(path + "/e", data.getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL), Op.create(path + "/p", data.getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT), Op.create(path + "/q", data.getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL) )); } catch (KeeperException.SessionExpiredException e) { LOG.info("SESSION EXPIRED", e); } LOG.info("TESTING RESULTS"); Assert.assertNotNull(multi); Assert.assertEquals(4, multi.size()); Assert.assertEquals(data, new String(zk.getData(path + "/e", false, null))); Assert.assertEquals(data, new String(zk.getData(path + "/p", false, null))); Assert.assertEquals(data, new String(zk.getData(path + "/q", false, null))); }</code><technical_language>need this. I need do this in other tests</technical_language>

Target:
public void ephemeralCreateMultiOpTest() throws KeeperException, InterruptedException, IOException { final ZooKeeper zk = createClient(); String data = "test"; String path = "/ephemeralcreatemultiop"; zk.create(path, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); QuorumZooKeeperServer server = getConnectedServer(zk.getSessionId()); Assert.assertNotNull("unable to find server interlocutor", server); UpgradeableSessionTracker sessionTracker = (UpgradeableSessionTracker)server.getSessionTracker(); Assert.assertFalse("session already global", sessionTracker.isGlobalSession(zk.getSessionId())); List<OpResult> multi = null; try { multi = zk.multi(Arrays.asList( Op.setData(path, data.getBytes(), 0), Op.create(path + "/e", data.getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL), Op.create(path + "/p", data.getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT), Op.create(path + "/q", data.getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL) )); } catch (KeeperException.SessionExpiredException e) { Assert.fail("received session expired for a session promotion in a multi-op"); } Assert.assertNotNull(multi); Assert.assertEquals(4, multi.size()); Assert.assertEquals(data, new String(zk.getData(path + "/e", false, null))); Assert.assertEquals(data, new String(zk.getData(path + "/p", false, null))); Assert.assertEquals(data, new String(zk.getData(path + "/q", false, null))); Assert.assertTrue("session not promoted", sessionTracker.isGlobalSession(zk.getSessionId())); }
Source:
<code>public String marshal(Boolean v) throws Exception { if (v) { return "On"; } <START> return "Off"; <END> }</code><technical_language>return v ? "On" : "Off";</technical_language>

Target:
public String marshal(Boolean v) throws Exception { return v ? "On" : "Off"; }
Source:
<code>public void onFastRewind() { if (DEBUG) Log.d(TAG, "onFastRewind() called"); <START> final int duration = getSeekDuration(); <END> seekBy(-duration); }</code><technical_language>I is need for a local var</technical_language>

Target:
public void onFastRewind() { if (DEBUG) Log.d(TAG, "onFastRewind() called"); seekBy(-getSeekDuration()); }
Source:
<code>public static void sendMessage(Address[] recipients, Session session, MimeMessage message) throws MessagingException { Transport transport = null; try { transport = session.getTransport("smtp"); String host = session.getProperty("mail.smtp.host"); String port = session.getProperty("mail.smtp.port"); String user = session.getProperty("connect.mail.user"); String pass = session.getProperty("connect.mail.pass"); if (!StringUtils.isBlank(port)) { port = StringUtils.trim(port); } transport.connect(host, Integer.parseInt(port), user, pass); transport.sendMessage(message, recipients); logHeaders(message); } catch (AssertionError e) { LOG.error("Assertion Error while sending.", e); throw e; } finally { if (transport != null) { try { transport.close(); <START> } catch (Exception e) { <END> LOG.error("Exception while closing the transport: {}", e.getMessage(), e); } } } }</code><technical_language>Is 'java.lang.Exception' actual type thrown, this catch more granular</technical_language>

Target:
public static void sendMessage(Address[] recipients, Session session, MimeMessage message) throws MessagingException { Transport transport = null; try { transport = session.getTransport("smtp"); String host = session.getProperty("mail.smtp.host"); String port = session.getProperty("mail.smtp.port"); String user = session.getProperty("connect.mail.user"); String pass = session.getProperty("connect.mail.pass"); if (!StringUtils.isBlank(port)) { port = StringUtils.trim(port); } transport.connect(host, Integer.parseInt(port), user, pass); transport.sendMessage(message, recipients); logHeaders(message); } catch (AssertionError e) { LOG.error("Assertion Error while sending.", e); throw e; } finally { if (transport != null) { try { transport.close(); } catch (MessagingException e) { LOG.error("Exception while closing the transport: {}", e.getMessage(), e); } } } }
Source:
<code>public String getTypeName() { <START> return "Auto Stacker"; <END> }</code><technical_language>This more consistent if lowercase</technical_language>

Target:
public String getTypeName() { return "auto stacker"; }
Source:
<code>static RelDistribution getDistribution(RelNode node) { <START> if (node instanceof VoltLogicalTableScan) { <END> return node.getTable().getDistribution(); } return node.getTraitSet().getTrait(RelDistributionTraitDef.INSTANCE); }</code><technical_language>I return trait set avoid modifying trait a table</technical_language>

Target:
static RelDistribution getDistribution(RelNode node) { return node.getTraitSet().getTrait(RelDistributionTraitDef.INSTANCE); }
Source:
<code>public int compareTo(UnregisteredDiskId o) { int idComparison = diskId.compareTo(o.diskId); if (idComparison == 0) { return storageDomainId.compareTo(o.storageDomainId); } <START> else { <END> return idComparison; } }</code><technical_language>I drop else here</technical_language>

Target:
public int compareTo(UnregisteredDiskId o) { int idComparison = diskId.compareTo(o.diskId); if (idComparison == 0) { return storageDomainId.compareTo(o.storageDomainId); } return idComparison; }
Source:
<code>public LocalMemoryManager(NodeMemoryConfig config) { requireNonNull(config, "config is null"); <START> maxMemory = new DataSize(Runtime.getRuntime().maxMemory(), BYTE); <END> checkArgument(config.getMaxQueryMemoryPerNode().toBytes() <= maxMemory.toBytes(), format("%s set to %s, but only %s of useable heap available", QUERY_MAX_MEMORY_PER_NODE_CONFIG, config.getMaxQueryMemoryPerNode(), maxMemory)); ImmutableMap.Builder<MemoryPoolId, MemoryPool> builder = ImmutableMap.builder(); builder.put(RESERVED_POOL, new MemoryPool(RESERVED_POOL, config.getMaxQueryMemoryPerNode())); DataSize generalPoolSize = new DataSize(Math.max(0, maxMemory.toBytes() - config.getMaxQueryMemoryPerNode().toBytes()), BYTE); builder.put(GENERAL_POOL, new MemoryPool(GENERAL_POOL, generalPoolSize)); this.pools = builder.build(); }</code><technical_language>I this is a good idea. Removing reserved pool necessitate removing reserved system memory. I suppose need set a part of heap track, overhead, etc. set reserved system memory a value</technical_language>

Target:
public LocalMemoryManager(NodeMemoryConfig config) { requireNonNull(config, "config is null"); long availableMemory = Runtime.getRuntime().maxMemory(); validateHeapHeadroom(config, availableMemory); maxMemory = new DataSize(availableMemory - config.getHeapHeadroom().toBytes(), BYTE); checkArgument(config.getMaxQueryMemoryPerNode().toBytes() <= config.getMaxQueryTotalMemoryPerNode().toBytes(), "Max query memory per node cannot be greater than the max query total memory per node."); ImmutableMap.Builder<MemoryPoolId, MemoryPool> builder = ImmutableMap.builder(); builder.put(RESERVED_POOL, new MemoryPool(RESERVED_POOL, config.getMaxQueryTotalMemoryPerNode())); long generalPoolSize = maxMemory.toBytes() - config.getMaxQueryTotalMemoryPerNode().toBytes(); verify(generalPoolSize > 0, "general memory pool size is 0"); builder.put(GENERAL_POOL, new MemoryPool(GENERAL_POOL, new DataSize(generalPoolSize, BYTE))); this.pools = builder.build(); }
Source:
<code>protected String scriptInvocationCommand(Integer optionalThriftPort, String fileToRun) { List<String> args = Lists.newArrayList(); args.add("bin/cassandra-cli"); if (optionalThriftPort != null) { args.add("--port"); args.add(Integer.toString(optionalThriftPort)); } args.add("--file"); args.add(fileToRun); <START> return Joiner.on(" ").join(args); <END> }</code><technical_language>This feel improvement; original form easier follow, IMO, ugly lack of whitespace binary operators ;o)</technical_language>

Target:
protected String scriptInvocationCommand(Integer optionalThriftPort, String fileToRun) { return "bin/cassandra-cli " + (optionalThriftPort != null ? "--port " + optionalThriftPort : "") + " --file "+fileToRun; }
Source:
<code>public void PostUpdateItemsAvailability(NewEditStorageModelBehavior behavior, IStorageModel item, boolean isNoStorageAttached) { storage_pool dataCenter = (storage_pool) getModel().getDataCenter().getSelectedItem(); Model model = (Model) item; model.setIsSelectable(dataCenter != null && ((dataCenter.getId().equals(StorageModel.UnassignedDataCenterId) && item.getRole() == StorageDomainType.Data) || (!dataCenter.getId().equals(StorageModel.UnassignedDataCenterId) && ((item.getRole() == StorageDomainType.Data && item.getType() == dataCenter.getstorage_pool_type()) || (item.getRole() == StorageDomainType.ImportExport && item.getType() == StorageType.NFS && dataCenter.getstatus() != StoragePoolStatus.Uninitialized && isNoStorageAttached) || item.getRole() == StorageDomainType.ISO <START> && (item.getType() == StorageType.NFS || item.getType() == StorageType.LOCALFS) <END> && dataCenter.getstatus() != StoragePoolStatus.Uninitialized && isNoStorageAttached)) || (getModel().getStorage() != null && item.getType() == getModel().getStorage() .getStorageType()))); behavior.OnStorageModelUpdated(item); }</code><technical_language>If accept general suggestion, this done item.getTime().isFileDomain()</technical_language>

Target:
public void PostUpdateItemsAvailability(NewEditStorageModelBehavior behavior, IStorageModel item, boolean isNoStorageAttached) { storage_pool dataCenter = (storage_pool) getModel().getDataCenter().getSelectedItem(); Model model = (Model) item; model.setIsSelectable(dataCenter != null && ((dataCenter.getId().equals(StorageModel.UnassignedDataCenterId) && item.getRole() == StorageDomainType.Data) || (!dataCenter.getId().equals(StorageModel.UnassignedDataCenterId) && ((item.getRole() == StorageDomainType.Data && item.getType() == dataCenter.getstorage_pool_type()) || (item.getRole() == StorageDomainType.ImportExport && item.getType() == StorageType.NFS && dataCenter.getstatus() != StoragePoolStatus.Uninitialized && isNoStorageAttached) || item.getRole() == StorageDomainType.ISO && item.getType().isFileDomain() && dataCenter.getstatus() != StoragePoolStatus.Uninitialized && isNoStorageAttached)) || (getModel().getStorage() != null && item.getType() == getModel().getStorage() .getStorageType()))); behavior.OnStorageModelUpdated(item); }
Source:
<code>public void init(StreamGraph graph, Config config) { graph.setDefaultKeySerde(new StringSerde()); <START> graph.setDefaultMsgSerde(new JsonSerde<>(PageView.class)); <END> MessageStream<PageView> pageViews = graph.getInputStream("page-views", (k, v) -> (PageView) v); OutputStream<String, String, WindowPane<String, Collection<PageView>>> outputStream = graph.getOutputStream(TestRepartitionWindowApp.OUTPUT_TOPIC, new StringSerde(), new StringSerde(), m -> m.getKey().getKey(), m -> Integer.toString(m.getMessage().size())); pageViews .partitionBy(PageView::getUserId) .window(Windows.keyedSessionWindow(PageView::getUserId, Duration.ofSeconds(3))) .sendTo(outputStream); }</code><technical_language>likelihood messages change in some in pipeline this is type safe, considered defaulting for pipeline type? other consideration is neglecting set this explicit serializer give info entry in log a class cast exception. require user explicitly a pass-through SerDe error out early if SerDe is set. Also, if do expose ClassCastException user good augment some info for (e.g. serde matches type)</technical_language>

Target:
public void init(StreamGraph graph, Config config) { MessageStream<PageView> pageViews = graph.getInputStream(INPUT_TOPIC, new JsonSerdeV2<>(PageView.class)); OutputStream<KV<String, String>> outputStream = graph.getOutputStream(OUTPUT_TOPIC, new KVSerde<>(new StringSerde(), new StringSerde())); pageViews .partitionBy(PageView::getUserId, pv -> pv, new KVSerde<>(new StringSerde(), new JsonSerdeV2<>(PageView.class))) .window(Windows.keyedSessionWindow(KV::getKey, Duration.ofSeconds(3))) .map(windowPane -> KV.of(windowPane.getKey().getKey(), String.valueOf(windowPane.getMessage().size()))) .sendTo(outputStream); }
Source:
<code>public void testDeleteFeedMediaOfItemRemoveFromQueue() throws IOException, ExecutionException, InterruptedException, TimeoutException { File dest = new File(getInstrumentation().getTargetContext().getExternalFilesDir(TEST_FOLDER), "testFile"); assertTrue(dest.createNewFile()); Feed feed = new Feed("url", null, "title"); List<FeedItem> items = new ArrayList<>(); List<FeedItem> queue = new ArrayList<>(); feed.setItems(items); FeedItem item = new FeedItem(0, "Item", "Item", "url", new Date(), FeedItem.UNPLAYED, feed); FeedMedia media = new FeedMedia(0, item, 1, 1, 1, "mime_type", dest.getAbsolutePath(), "download_url", true, null, 0, 0); item.setMedia(media); items.add(item); queue.add(item); PodDBAdapter adapter = PodDBAdapter.getInstance(); adapter.open(); adapter.setCompleteFeed(feed); adapter.setQueue(queue); adapter.close(); assertTrue(media.getId() != 0); assertTrue(item.getId() != 0); queue = DBReader.getQueue(); assertTrue(queue.size() != 0); DBWriter.deleteFeedMediaOfItem(getInstrumentation().getTargetContext(), media.getId()) .get(TIMEOUT, TimeUnit.SECONDS); media = DBReader.getFeedMedia(media.getId()); assertNotNull(media); assertFalse(dest.exists()); assertFalse(media.isDownloaded()); assertNull(media.getFile_url()); queue = DBReader.getQueue(); assertTrue(queue.size() == 0); <START> } <END></code><technical_language>Hmm, test state Preference shouldDeleteRemoveFromQueue is</technical_language>

Target:
public void testDeleteFeedMediaOfItemRemoveFromQueue() throws IOException, ExecutionException, InterruptedException, TimeoutException { assertTrue(UserPreferences.shouldDeleteRemoveFromQueue()); File dest = new File(getInstrumentation().getTargetContext().getExternalFilesDir(TEST_FOLDER), "testFile"); assertTrue(dest.createNewFile()); Feed feed = new Feed("url", null, "title"); List<FeedItem> items = new ArrayList<>(); List<FeedItem> queue = new ArrayList<>(); feed.setItems(items); FeedItem item = new FeedItem(0, "Item", "Item", "url", new Date(), FeedItem.UNPLAYED, feed); FeedMedia media = new FeedMedia(0, item, 1, 1, 1, "mime_type", dest.getAbsolutePath(), "download_url", true, null, 0, 0); item.setMedia(media); items.add(item); queue.add(item); PodDBAdapter adapter = PodDBAdapter.getInstance(); adapter.open(); adapter.setCompleteFeed(feed); adapter.setQueue(queue); adapter.close(); assertTrue(media.getId() != 0); assertTrue(item.getId() != 0); queue = DBReader.getQueue(); assertTrue(queue.size() != 0); DBWriter.deleteFeedMediaOfItem(getInstrumentation().getTargetContext(), media.getId()); Awaitility.await().until(() -> dest.exists() == false); media = DBReader.getFeedMedia(media.getId()); assertNotNull(media); assertFalse(dest.exists()); assertFalse(media.isDownloaded()); assertNull(media.getFile_url()); queue = DBReader.getQueue(); assertTrue(queue.size() == 0); }
Source:
<code>private boolean updateDefinitionStatus(final TransactionContext context, final Concept concept) { final Set<String> newOwlAxiomExpressions = Optional.ofNullable(members) .map(Collection::stream) .orElseGet(Stream::empty) .filter(member -> SnomedRefSetType.OWL_AXIOM == member.type() || Concepts.REFSET_OWL_AXIOM.equals(member.getReferenceSetId())) .map(member -> (String) member.getProperties().get(SnomedRf2Headers.FIELD_OWL_EXPRESSION)) .collect(Collectors.toSet()); final String newDefinitionStatusId; if (!newOwlAxiomExpressions.isEmpty()) { newDefinitionStatusId = SnomedOWLAxiomHelper.getDefinitionStatusFromExpressions(newOwlAxiomExpressions).getConceptId(); } else { <START> final String incomingDefinitionStatusId = definitionStatus == null ? DefinitionStatus.PRIMITIVE.getConceptId() : definitionStatus.getConceptId(); <END> final Set<String> previousOwlExpressions = getPreviousOwlExpressions(concept.getId(), context); if (previousOwlExpressions.isEmpty()) { newDefinitionStatusId = incomingDefinitionStatusId; } else { newDefinitionStatusId = SnomedOWLAxiomHelper.getDefinitionStatusFromExpressions(previousOwlExpressions).getConceptId(); } } final String existingDefinitionStatusId = concept.getDefinitionStatus().getId(); if (!newDefinitionStatusId.equals(existingDefinitionStatusId)) { concept.setDefinitionStatus(context.lookup(newDefinitionStatusId, Concept.class)); return true; } else { return false; } }</code><technical_language>If definitionStatus is null, return updateDefinitionStatus() method. Null update property</technical_language>

Target:
private boolean updateDefinitionStatus(final TransactionContext context, final Concept concept) { final Set<String> newOwlAxiomExpressions = Optional.ofNullable(members) .map(Collection::stream) .orElseGet(Stream::empty) .filter(member -> SnomedRefSetType.OWL_AXIOM == member.type() || Concepts.REFSET_OWL_AXIOM.equals(member.getReferenceSetId())) .map(member -> (String) member.getProperties().get(SnomedRf2Headers.FIELD_OWL_EXPRESSION)) .collect(Collectors.toSet()); final String newDefinitionStatusId; if (!newOwlAxiomExpressions.isEmpty()) { newDefinitionStatusId = SnomedOWLAxiomHelper.getDefinitionStatusFromExpressions(newOwlAxiomExpressions).getConceptId(); } else { if (definitionStatus == null) return false; final String incomingDefinitionStatusId = definitionStatus.getConceptId(); newDefinitionStatusId = incomingDefinitionStatusId; } final String existingDefinitionStatusId = concept.getDefinitionStatus().getId(); if (!newDefinitionStatusId.equals(existingDefinitionStatusId)) { concept.setDefinitionStatus(context.lookup(newDefinitionStatusId, Concept.class)); return true; } else { return false; } }
Source:
<code>default BitSet<T> tail() { if (isEmpty()) { throw new UnsupportedOperationException("tail of empty BitSet"); } else { <START> return remove(head()); <END> } }</code><technical_language>drop(1)</technical_language>

Target:
default BitSet<T> tail() { if (isEmpty()) { throw new UnsupportedOperationException("tail of empty BitSet"); } else { return drop(1); } }
Source:
<code>public void storageIsLazy() { assertNull(ShadowEnvironment.EXTERNAL_CACHE_DIR); assertNull(ShadowEnvironment.EXTERNAL_FILES_DIR); <START> ShadowEnvironment.getExternalStorageDirectory(); <END> ShadowEnvironment.getExternalStoragePublicDirectory(null); assertNotNull(ShadowEnvironment.EXTERNAL_CACHE_DIR); assertNotNull(ShadowEnvironment.EXTERNAL_FILES_DIR); }</code><technical_language>prefer test Environment.getExternal....()</technical_language>

Target:
public void storageIsLazy() { assertNull(ShadowEnvironment.EXTERNAL_CACHE_DIR); assertNull(ShadowEnvironment.EXTERNAL_FILES_DIR); Environment.getExternalStorageDirectory(); Environment.getExternalStoragePublicDirectory(null); assertNotNull(ShadowEnvironment.EXTERNAL_CACHE_DIR); assertNotNull(ShadowEnvironment.EXTERNAL_FILES_DIR); }
Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, final Bundle savedInstanceState) { FrameLayout parentView = (FrameLayout) inflater.inflate(R.layout.fragment_page, container, false); webView = (WebView) parentView.findViewById(R.id.pageWebView); loadProgress = (ProgressBar) parentView.findViewById(R.id.pageLoadProgress); webView.getSettings().setBuiltInZoomControls(true); webView.getSettings().setDisplayZoomControls(false); bridge = new CommunicationBridge(webView, "file:/ linkHandler = new LinkHandler(getActivity(), bridge); <START> api = ((WikipediaApp)getActivity().getApplicationContext()).getPrimarySiteAPI(); <END> if (savedInstanceState != null && savedInstanceState.containsKey(KEY_TITLE)) { title = savedInstanceState.getParcelable(KEY_TITLE); if (savedInstanceState.containsKey(KEY_PAGE)) { page = savedInstanceState.getParcelable(KEY_PAGE); } state = savedInstanceState.getInt(KEY_STATE); } if (title == null) { throw new RuntimeException("No PageTitle passed in to constructor or in instanceState"); } switch (state) { case STATE_NO_FETCH: new LeadSectionFetchTask().execute(); break; case STATE_INITIAL_FETCH: new RestSectionsFetchTask().execute(); break; case STATE_COMPLETE_FETCH: displayLeadSection(page); populateAllSections(page); break; } return parentView; }</code><technical_language>time I this chain of calls a type cast it, I want slap replace shorter clearer WikipediaApp.getSingleton(), WikipediaApp.forContext(getActivity()). a thought. :D</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, final Bundle savedInstanceState) { FrameLayout parentView = (FrameLayout) inflater.inflate(R.layout.fragment_page, container, false); webView = (WebView) parentView.findViewById(R.id.pageWebView); loadProgress = (ProgressBar) parentView.findViewById(R.id.pageLoadProgress); webView.getSettings().setBuiltInZoomControls(true); webView.getSettings().setDisplayZoomControls(false); bridge = new CommunicationBridge(webView, "file:/ linkHandler = new LinkHandler(getActivity(), bridge, title.getSite()); api = ((WikipediaApp)getActivity().getApplicationContext()).getAPIForSite(title.getSite()); if (savedInstanceState != null && savedInstanceState.containsKey(KEY_TITLE)) { title = savedInstanceState.getParcelable(KEY_TITLE); if (savedInstanceState.containsKey(KEY_PAGE)) { page = savedInstanceState.getParcelable(KEY_PAGE); } state = savedInstanceState.getInt(KEY_STATE); } if (title == null) { throw new RuntimeException("No PageTitle passed in to constructor or in instanceState"); } switch (state) { case STATE_NO_FETCH: new LeadSectionFetchTask().execute(); break; case STATE_INITIAL_FETCH: new RestSectionsFetchTask().execute(); break; case STATE_COMPLETE_FETCH: displayLeadSection(page); populateAllSections(page); break; } return parentView; }
Source:
<code>private void terminateRemainingProcesses(GdbLaunch launch, IDebugCommandRequest request) { MultiStatus status = new MultiStatus(GdbUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, Messages.DsfTerminateCommand_Terminate_failed, null); for (IProcess p : launch.getProcesses()) { if (p.canTerminate()) { try { p.terminate(); } catch(DebugException e) { status.merge(e.getStatus()); } } } if (!status.isOK()) { request.setStatus(status); <START> } <END> }</code><technical_language>I need request.done()</technical_language>

Target:
private void terminateRemainingProcesses(GdbLaunch launch, IDebugCommandRequest request) { MultiStatus status = new MultiStatus(GdbUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, Messages.DsfTerminateCommand_Terminate_failed, null); for (IProcess p : launch.getProcesses()) { if (p.canTerminate()) { try { p.terminate(); } catch(DebugException e) { status.merge(e.getStatus()); } } } if (!status.isOK()) { request.setStatus(status); } request.done(); }
Source:
<code>protected void setDefaultSwitchTypeIfNeeded() { Cluster cluster = getCluster(); if <START> (cluster.hasRequiredSwitchType(null)) { <END> SwitchType defaultSwitchType = DefaultSwitchType.getDefaultSwitchType(cluster.getCompatibilityVersion()); cluster.setRequiredSwitchTypeForCluster(defaultSwitchType); } }</code><technical_language>'cluster.hasRequiredSwitchType()' 'cluster.isSetRequiredSwitchType()' passing 'null' a parameter</technical_language>

Target:
protected void setDefaultSwitchTypeIfNeeded() { Cluster cluster = getCluster(); if (cluster.isSetRequiredSwitchType()) { SwitchType defaultSwitchType = DefaultSwitchType.getDefaultSwitchType(cluster.getCompatibilityVersion()); cluster.setRequiredSwitchTypeForCluster(defaultSwitchType); } }
Source:
<code><START> public ProjectToOrganization[] buildObject(Result hbaseResult, <END> Oaf resolvedOafObject) throws InvalidProtocolBufferException { NavigableMap<byte[],byte[]> projOrgRelations = hbaseResult.getFamilyMap( relationColumnFamilyBytes); if (projOrgRelations!=null && projOrgRelations.size()>0) { List<ProjectToOrganization> results = new ArrayList<ProjectToOrganization>( projOrgRelations.size()); for (byte[] projOrgBytes : projOrgRelations.values()) { Oaf projOrgOAF = OafHelper.buildOaf(projOrgBytes); OafRel projOrgRel = projOrgOAF.getRel(); if (resultApprover!=null? resultApprover.approveBeforeBuilding(projOrgOAF): true) { ProjectToOrganization.Builder builder = ProjectToOrganization.newBuilder(); builder.setProjectId(projOrgRel.getSource()); builder.setOrganizationId(projOrgRel.getTarget()); results.add(builder.build()); } } return results.toArray(new ProjectToOrganization[results.size()]); } return null; }</code><technical_language>I return result array list</technical_language>

Target:
public List<ProjectToOrganization> buildObject(Result hbaseResult, Oaf resolvedOafObject) throws InvalidProtocolBufferException { Preconditions.checkNotNull(hbaseResult); NavigableMap<byte[], byte[]> projOrgRelations = hbaseResult.getFamilyMap(relationColumnFamilyBytes); if (!MapUtils.isEmpty(projOrgRelations)) { List<ProjectToOrganization> projectOrganizationList = new ArrayList<ProjectToOrganization>( projOrgRelations.size()); for (byte[] projOrgBytes : projOrgRelations.values()) { Oaf projOrgOaf = OafHelper.buildOaf(projOrgBytes); if (resultApprover.approveBeforeBuilding(projOrgOaf)) { OafRel projOrgRel = projOrgOaf.getRel(); ProjectToOrganization.Builder builder = ProjectToOrganization.newBuilder(); builder.setProjectId(projOrgRel.getSource()); builder.setOrganizationId(projOrgRel.getTarget()); projectOrganizationList.add(builder.build()); } } return projectOrganizationList; } else { return Collections.emptyList(); } }
Source:
<code>private int computeHashCode() { final int[] parts = new int[4]; parts[0] = (mapping == null) ? 0 : mapping.hashCode(); parts[1] = (semantic == null) ? 0 : getSemanticID(); parts[2] = (line == null) ? 0 : getLineID(); parts[3] = (column == null) ? 0 : getColumnID(); final String sep = "/"; <START> return KeyCache.DEFAULT.getKey(parts[0] + sep + parts[1] + sep + parts[2] + sep + parts[3]); <END> }</code><technical_language>I significant in practice, allocate array (presumably heap) read individual cells forget it? 4 locals (on stack) more straightforward (and marginally more efficient, measurable). drawback I is invent 4 names. (Note: "issue" in other class)</technical_language>

Target:
private int computeHashCode() { final int mappingCode = (mapping == null) ? 0 : mapping.hashCode(); final int semanticCode = (semantic == null) ? 0 : getSemanticID(); final int lineCode = (line == null) ? 0 : getLineID(); final int columnCode = (column == null) ? 0 : getColumnID(); final String sep = "/"; return KeyCache.DEFAULT.getKey(mappingCode + sep + semanticCode + sep + lineCode + sep + columnCode); }
Source:
<code>public void streamsAreNotReused() throws IOException { final byte[] bytes = new byte[2 * StreamTestStreamStore.BLOCK_SIZE_IN_BYTES]; long id = timestampService.getFreshTimestamp(); Random rand = new Random(); rand.nextBytes(bytes); Sha256Hash hash = Sha256Hash.computeHash(bytes); ImmutableMap<Long, InputStream> streams = ImmutableMap.of(id, <START> new CloseEnforcingInputStream(new ByteArrayInputStream(bytes))); <END> storeStreamAndCheckHash(id, hash, streams); byte[] bytesInKvs = readBytesForSingleStream(id); assertArrayEquals(bytesInKvs, bytes); }</code><technical_language>if tests wrap new ByteArrayInputStream(bytes) CloseEnforcingInputStream catch problems</technical_language>

Target:
public void streamsAreNotReused() throws IOException { long id = timestampService.getFreshTimestamp(); byte[] bytes = generateRandomTwoBlockStream(); Sha256Hash hash = Sha256Hash.computeHash(bytes); Map<Long, InputStream> streams = ImmutableMap.of(id, new CloseEnforcingInputStream(new ByteArrayInputStream(bytes))); storeStreamAndCheckHash(id, hash, streams); byte[] bytesInKvs = readBytesForSingleStream(id); assertArrayEquals(bytesInKvs, bytes); }
Source:
<code>public void testStationaryProbabilities() { for (final int padding : PADDINGS) { for (final RealMatrix transitionMatrix : TRANSITION_MATRICES) { final IntegerCopyNumberTransitionProbabilityCache cache = new IntegerCopyNumberTransitionProbabilityCache( new IntegerCopyNumberTransitionMatrixData(transitionMatrix, padding)); final double[] stationary = cache.getStationaryProbabilityVector().toArray(); final double[] stationaryFromMultiplication = cache.getTransitionProbabilityMatrix(Integer.MAX_VALUE) .getColumn(0); ArrayAsserts.assertArrayEquals(stationary, stationaryFromMultiplication, EPSILON); Assert.assertEquals(Arrays.stream(stationary).sum(), 1.0, EPSILON); } } <START> <END> }</code><technical_language>White space</technical_language>

Target:
public void testStationaryProbabilities() { for (final int padding : PADDINGS) { for (final RealMatrix transitionMatrix : TRANSITION_MATRICES) { final IntegerCopyNumberTransitionProbabilityCache cache = new IntegerCopyNumberTransitionProbabilityCache( new IntegerCopyNumberTransitionMatrix(transitionMatrix, padding)); final double[] stationary = cache.getStationaryProbabilityVector().toArray(); final double[] stationaryFromMultiplication = cache.getTransitionProbabilityMatrix(Integer.MAX_VALUE) .getColumn(0); ArrayAsserts.assertArrayEquals(stationary, stationaryFromMultiplication, EPSILON); Assert.assertEquals(Arrays.stream(stationary).sum(), 1.0, EPSILON); } } }
Source:
<code>public void writeVariable(UserVariable userVariable) throws IOException { if (checkDeviceVariableKeyEmpty(userVariable)) { addKeyToUserVariable(userVariable); } if (!deviceVariablesFile.exists()) { deviceVariablesFile.createNewFile(); } synchronized (LOCK) { HashMap deviceVariableMap = readMapFromJson(); if (deviceVariableMap == null) { deviceVariableMap = new HashMap<>(); } deviceVariableMap.put(userVariable.getDeviceValueKey(), userVariable.getValue()); writeMapToJson(deviceVariableMap); } <START> } <END></code><technical_language>this blows .getValue() returns NaN</technical_language>

Target:
public void writeVariable(UserVariable userVariable) throws IOException { synchronized (LOCK) { if (!deviceVariablesFile.exists()) { deviceVariablesFile.createNewFile(); } HashMap deviceVariableMap = readMapFromJson(); if (deviceVariableMap == null) { deviceVariableMap = new HashMap<>(); } deviceVariableMap.put(userVariable.getDeviceValueKey(), userVariable.getValue()); writeMapToJson(deviceVariableMap); } }
Source:
<code>public List<ClientResponse> poll(long timeout, long now) { ensureActive(); if (!abortedSends.isEmpty()) { List<ClientResponse> responses = new ArrayList<>(); handleAbortedSends(responses); completeResponses(responses); return responses; } long metadataTimeout = metadataUpdater.maybeUpdate(now); try { this.selector.poll(Utils.min(timeout, metadataTimeout, defaultRequestTimeoutMs)); } catch (IOException e) { log.error("Unexpected error during I/O", e); } long updatedNow = this.time.milliseconds(); List<ClientResponse> responses = new ArrayList<>(); handleCompletedSends(responses, updatedNow); handleCompletedReceives(responses, updatedNow); handleDisconnections(responses, updatedNow); handleConnections(); handleInitiateApiVersionRequests(updatedNow); <START> handleTimeOutConnections(responses, updatedNow); <END> handleTimedOutRequests(responses, updatedNow); completeResponses(responses); return responses; }</code><technical_language>TimeOut => TimedOut</technical_language>

Target:
public List<ClientResponse> poll(long timeout, long now) { ensureActive(); if (!abortedSends.isEmpty()) { List<ClientResponse> responses = new ArrayList<>(); handleAbortedSends(responses); completeResponses(responses); return responses; } long metadataTimeout = metadataUpdater.maybeUpdate(now); try { this.selector.poll(Utils.min(timeout, metadataTimeout, defaultRequestTimeoutMs)); } catch (IOException e) { log.error("Unexpected error during I/O", e); } long updatedNow = this.time.milliseconds(); List<ClientResponse> responses = new ArrayList<>(); handleCompletedSends(responses, updatedNow); handleCompletedReceives(responses, updatedNow); handleDisconnections(responses, updatedNow); handleConnections(); handleInitiateApiVersionRequests(updatedNow); handleTimeoutConnections(responses, updatedNow); handleTimeoutRequests(responses, updatedNow); completeResponses(responses); return responses; }
Source:
<code>public DescriptorImpl() { super(ThrottleJobProperty.class); synchronized(propertiesByCategoryLock) { load(); if (!propertiesByCategory.isEmpty()) { propertiesByCategory = new HashMap<String,Map<ThrottleJobProperty,Void>>(); save(); } <START> } <END> }</code><technical_language>Simpler rename field. XStream discard data automatically</technical_language>

Target:
public DescriptorImpl() { super(ThrottleJobProperty.class); synchronized(propertiesByCategoryLock) { load(); if (propertiesByCategory == null) { propertiesByCategory = new HashMap<String,Map<ThrottleJobProperty,Void>>(); } if (!propertiesByCategory.isEmpty()) { propertiesByCategory.clear(); save(); } } }
Source:
<code>public InputStream handleException(Request request, Exception exception) { <START> throw new RuntimeException("Request to worker failed", exception); <END> }</code><technical_language>PrestoException for StreamingJsonResponseHandler</technical_language>

Target:
public InputStream handleException(Request request, Exception exception) { throw new PrestoException(DRUID_BROKER_RESULT_ERROR, "Request to worker failed", exception); }
Source:
<code>static HttpPipeline buildNullClientPipeline() { <START> List<HttpPipelinePolicy> policies = new ArrayList<>(); <END> policies.add(new AddHeadersPolicy(new HttpHeaders().put("Accept", "application/json;odata=minimalmetadata"))); return new HttpPipelineBuilder() .policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(new NullHttpClient()) .build(); }</code><technical_language>is element, allocate a list for it: java HttpPipelinePolicy[] policies = { new AddHeadersPolicy(new HttpHeaders().put("Accept", "application/json;odata=minimalmetadata")) };</technical_language>

Target:
static HttpPipeline buildNullClientPipeline() { HttpPipelinePolicy[] policies = { new AddHeadersPolicy(new HttpHeaders().put("Accept", "application/json;odata=minimalmetadata")) }; return new HttpPipelineBuilder() .policies(policies) .httpClient(new NullHttpClient()) .build(); }
Source:
<code>public void vuapClickToPlayShouldStartPlayingAdvertisementAfterClickOnPlayIcon(Page page, String slot) { <START> AdsBaseObject ads = openPageWithVideoInLocalStorage(page, VuapVideos.VIDEO_10s); <END> final AutoplayVuap vuap = new AutoplayVuap(driver, slot, ads.findFirstIframeWithAd(slot), false); ads.scrollToSlot(slot); vuap.clickOnArea(2); VuapAssertions.verifyVideoPlay(vuap); }</code><technical_language>easier/safer prepare a test page video instead of forcing Porvata display specific video? This feature works Porvata slightly flow regular VUAP</technical_language>

Target:
public void vuapClickToPlayShouldStartPlayingAdvertisementAfterClickOnPlayIcon(Page page, String slot) { AdsBaseObject ads = new AdsBaseObject(driver, page.getUrl(), WindowSize.DESKTOP); final AutoplayVuap vuap = new AutoplayVuap(driver, slot, ads.findFirstIframeWithAd(slot), false); ads.scrollToSlot(slot); vuap.clickOnArea(2); VuapAssertions.verifyVideoPlay(vuap); }
Source:
<code>boolean reachedCapacity() { <START> return assignedTasks().size() >= capacity; <END> }</code><technical_language>req: I call assignedTaskCount() instead of assignedTasks().size()</technical_language>

Target:
boolean reachedCapacity() { return assignedTaskCount() >= capacity; }
Source:
<code>protected boolean hasVideoAvailable() { if ( isTokenEvent ) { return tokenAd != null; } else { <START> return incentivizedInterstitial.isAdReadyToDisplay(); <END> } }</code><technical_language>this is called incentivizedInterstitial is assigned</technical_language>

Target:
protected boolean hasVideoAvailable() { if ( isTokenEvent ) { return tokenAd != null; } else { return ( incentivizedInterstitial != null && incentivizedInterstitial.isAdReadyToDisplay() ); } }
Source:
<code>public static void log(final MuzimaApplication muzimaApplication, final String tag, final String details){ if(isLoggingFeatureEnabled(muzimaApplication)) { User authenticatedUser = muzimaApplication.getAuthenticatedUser(); if (authenticatedUser != null) { <START> String userId = authenticatedUser.getUuid(); <END> log(muzimaApplication, tag, userId, getAndParseGpsLocationForLogging(muzimaApplication), details); } else { Log.e("MuzimaLoggerService", "Could not save logs"); } } }</code><technical_language>userId userUuid is get uuid</technical_language>

Target:
public static void log(final MuzimaApplication muzimaApplication, final String tag, final String details){ if(isLoggingFeatureEnabled(muzimaApplication)) { User authenticatedUser = muzimaApplication.getAuthenticatedUser(); if (authenticatedUser != null) { String userId = authenticatedUser.getUuid(); log(muzimaApplication, tag, userId, getAndParseGPSLocationForLogging(muzimaApplication), details); } else { Log.e("MuzimaLoggerService", "Could not save logs"); } } }
Source:
<code>public void onMessageBuildSuccess(MimeMessage message, boolean isDraft) { if (isDraft) { draftNeedsSaving = false; currentMessageBuilder = null; if (mAction == Action.EDIT_DRAFT && mMessageReference != null) { message.setUid(mMessageReference.getUid()); } boolean saveRemotely = recipientPresenter.isAllowSavingDraftRemotely(); new SaveMessageTask(getApplicationContext(), mAccount, mContacts, mHandler, message, mDraftId, saveRemotely).execute(); if (mFinishAfterDraftSaved) { finish(); } else { setProgressBarIndeterminateVisibility(false); } } else { currentMessageBuilder = null; new SendMessageTask(getApplicationContext(), mAccount, mContacts, message, mDraftId != INVALID_DRAFT_ID ? mDraftId : null).execute(); <START> updateReferencedMessage(); <END> finish(); } }</code><technical_language>This triggers database operations in calling thread. call SendMessageTask</technical_language>

Target:
public void onMessageBuildSuccess(MimeMessage message, boolean isDraft) { if (isDraft) { draftNeedsSaving = false; currentMessageBuilder = null; if (mAction == Action.EDIT_DRAFT && mMessageReference != null) { message.setUid(mMessageReference.getUid()); } boolean saveRemotely = recipientPresenter.isAllowSavingDraftRemotely(); new SaveMessageTask(getApplicationContext(), mAccount, mContacts, mHandler, message, mDraftId, saveRemotely).execute(); if (mFinishAfterDraftSaved) { finish(); } else { setProgressBarIndeterminateVisibility(false); } } else { currentMessageBuilder = null; new SendMessageTask(getApplicationContext(), mAccount, mContacts, message, mDraftId != INVALID_DRAFT_ID ? mDraftId : null, mMessageReference).execute(); finish(); } }
Source:
<code>public String getQuestionResultStatisticsCsv( List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question, FeedbackSessionResultsBundle bundle) { if(responses.size() == 0){ return ""; } String csv = ""; String fragments = ""; List<String> options; List<Integer> optionPoints = new ArrayList<Integer>(); Map<String, Integer[]> optionTotalCount = new LinkedHashMap<String, Integer[]>(); if(distributeToRecipients){ for(FeedbackResponseAttributes response : responses){ FeedbackConstantSumResponseDetails frd = (FeedbackConstantSumResponseDetails)response.getResponseDetails(); String recipientEmail = response.recipientEmail; String recipientName = bundle.getNameForEmail(recipientEmail); Integer[] pointCount = optionTotalCount.get(recipientName); if(pointCount == null){ pointCount = new Integer[]{0,0}; } pointCount[0] += frd.getAnswerList().get(0); pointCount[1] += 1; optionTotalCount.put(recipientName, pointCount); } } else { options = constSumOptions; for(int i=0 ; i<options.size() ; i++){ optionPoints.add(0); } for(FeedbackResponseAttributes response : responses){ FeedbackConstantSumResponseDetails frd = (FeedbackConstantSumResponseDetails)response.getResponseDetails(); for(int i=0 ; i<frd.getAnswerList().size(); i++){ optionPoints.set(i, optionPoints.get(i)+frd.getAnswerList().get(i)); } } for(int i=0 ; i<options.size() ; i++){ optionTotalCount.put(options.get(i), new Integer[]{optionPoints.get(i),responses.size()}); } } DecimalFormat df = new DecimalFormat("#.##"); for(Entry<String, Integer[]> entry : optionTotalCount.entrySet() ){ <START> double average = (double)entry.getValue()[0]/entry.getValue()[1]; <END> fragments += entry.getKey() + "," + df.format(average) + Const.EOL; } csv += (distributeToRecipients? "Recipient":"Option") + ", Average Points" + Const.EOL; csv += fragments + Const.EOL; return csv; }</code><technical_language>webpage csv function calculate average? if not, should</technical_language>

Target:
public String getQuestionResultStatisticsCsv( List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question, FeedbackSessionResultsBundle bundle) { if(responses.size() == 0){ return ""; } String csv = ""; String fragments = ""; List<String> options = constSumOptions; Map<String, List<Integer>> optionPoints = generateOptionPointsMapping(responses); DecimalFormat df = new DecimalFormat("#.##"); for(Entry<String, List<Integer>> entry : optionPoints.entrySet() ){ String option; if(distributeToRecipients){ option = bundle.getNameForEmail(entry.getKey());; } else { option = options.get(Integer.parseInt(entry.getKey())); } List<Integer> points = entry.getValue(); double average = computeAverage(points); fragments += option + "," + df.format(average) + Const.EOL; } csv += (distributeToRecipients? "Recipient":"Option") + ", Average Points" + Const.EOL; csv += fragments + Const.EOL; return csv; }
Source:
<code>public WildcardPattern(String pattern, char wildcard) { _pattern = pattern; _wildcard = wildcard; <START> _startsWithDelim = (_pattern.charAt(0) == _wildcard); <END> _endsWithDelim = (_pattern.charAt(pattern.length() - 1) == _wildcard); }</code><technical_language>This throw IndexOutOfBoundsException if empty string is passed pattern</technical_language>

Target:
public WildcardPattern(String pattern, char wildcard) { _pattern = pattern; _wildcard = wildcard; if(_pattern.isEmpty()){ _startsWithDelim = _endsWithDelim = false; } else { _startsWithDelim = _pattern.charAt(0) == _wildcard; _endsWithDelim = _pattern.charAt(pattern.length() - 1) == _wildcard; } }
Source:
<code>public void shouldDeterminNodeIdFromResourceId() { String resourceIdString = "node[Test:1525957453778].interfaceSnmp[opennms-jvm]"; ResourceId resourceId = ResourceId.fromString(resourceIdString); ResourceDao resourceDao = Mockito.mock(ResourceDao.class); OnmsResource resource = Mockito.mock(OnmsResource.class); OnmsResource parentResource = Mockito.mock(OnmsResource.class); OnmsNode node = new OnmsNode(); node.setId(3); when(resourceDao.getResourceById(resourceId)).thenReturn(resource); when(resource.getParent()).thenReturn(parentResource); when(parentResource.getEntity()).thenReturn(node); KscDashlet dashlet = new KscDashlet( this.getClass().getSimpleName(), null, null, resourceDao, null); <START> assertEquals(Integer.toString(3), dashlet.determineNodeIdByResourceId(resourceIdString)); <END> }</code><technical_language>"3" instead of Integer.toString(3)</technical_language>

Target:
public void shouldDeterminNodeIdFromResourceId() { String resourceIdString = "node[Test:1525957453778].interfaceSnmp[opennms-jvm]"; ResourceId resourceId = ResourceId.fromString(resourceIdString); ResourceDao resourceDao = Mockito.mock(ResourceDao.class); OnmsResource resource = Mockito.mock(OnmsResource.class); OnmsResource parentResource = Mockito.mock(OnmsResource.class); OnmsNode node = new OnmsNode(); node.setId(3); when(resourceDao.getResourceById(resourceId)).thenReturn(resource); when(resource.getParent()).thenReturn(parentResource); when(parentResource.getEntity()).thenReturn(node); KscDashlet dashlet = new KscDashlet( this.getClass().getSimpleName(), null, null, resourceDao, null); assertEquals(parentResource, dashlet.determineResourceByResourceId(resourceId)); }
Source:
<code>private Gde(Parcel in) { <START> in.readStringList(product); <END> name = in.readString(); address = in.readString(); lat = in.readDouble(); lng = in.readDouble(); email = in.readString(); socialUrl = in.readString(); }</code><technical_language>this expect product ArrayList null? this instead <LINK_0></technical_language>

Target:
protected Gde(Parcel in) { name = in.readString(); address = in.readString(); email = in.readString(); socialUrl = in.readString(); product = in.createStringArrayList(); lat = in.readDouble(); lng = in.readDouble(); }
Source:
<code>private String getClasspathOrModulePath(String... classpathElements) { char separator = ';'; return <START> String.join("" + separator, classpathElements); <END> }</code><technical_language>";"</technical_language>

Target:
private String getClasspathOrModulePath(String... classpathElements) { return String.join(";", classpathElements); }
Source:
<code>private void checkStateOfWsAgent(WsAgentHealthStateDto agentHealthStateDto) { final int statusCode = agentHealthStateDto.getCode(); final String infoWindowTitle = "Workspace Agent Not Responding"; <START> final ConfirmCallback stopCallback = new StopCallback(false, true); <END> final ConfirmCallback stopAndReloadCallback = new StopCallback(true, false); if (statusCode == 200) { dialogFactory.createChoiceDialog(infoWindowTitle, "Workspace agent is no longer responding. To fix the problem, verify you have a" + " good network connection and restart the workspace.", "Restart", "Close", stopAndReloadCallback, stopCallback).show(); } else { dialogFactory.createChoiceDialog(infoWindowTitle, "Workspace agent is no longer responding. To fix the problem, restart the workspace.", "Restart", "Close", stopAndReloadCallback, stopCallback).show(); } }</code><technical_language>add named variable, hard understand StopCallback(false, true)</technical_language>

Target:
private void checkStateOfWsAgent(WsAgentHealthStateDto agentHealthStateDto) { final int statusCode = agentHealthStateDto.getCode(); final String infoWindowTitle = "Workspace Agent Not Responding"; final boolean reloadPage = true; final boolean createSnapshot = true; final ConfirmCallback stopCallback = new StopCallback(!reloadPage, createSnapshot); final ConfirmCallback stopAndReloadCallback = new StopCallback(reloadPage, !createSnapshot); if (statusCode == 200) { dialogFactory.createChoiceDialog(infoWindowTitle, "Workspace agent is no longer responding. To fix the problem, verify you have a" + " good network connection and restart the workspace.", "Restart", "Close", stopAndReloadCallback, stopCallback).show(); } else { dialogFactory.createChoiceDialog(infoWindowTitle, "Workspace agent is no longer responding. To fix the problem, restart the workspace.", "Restart", "Close", stopAndReloadCallback, stopCallback).show(); } }
Source:
<code><START> public static void close(final OnHeapStore onHeapStore) { <END> onHeapStore.map.clear(); onHeapStore.disableStoreEventNotifications(); }</code><technical_language>this need public</technical_language>

Target:
static void close(final OnHeapStore onHeapStore) { onHeapStore.map.clear(); onHeapStore.disableStoreEventNotifications(); }