auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static Number readNumber(JsonReader reader) throws IOException { String str = reader.nextString(); <START> try { <END> return Integer.parseInt(str); } catch (NumberFormatException e) { try { return Double.parseDouble(str); } catch (NumberFormatException ex) { try { return Long.parseLong(str); } catch (NumberFormatException exception) { throw new IOException(exception); } } } }</code><technical_language>Throwing exceptions (or allowing thrown) is a expensive operation. Instead, do a check if a decimal point exists in string parse a double based instead, I if faster. neaten this slightly too</technical_language>

Target:
private static Number readNumber(JsonReader reader) throws IOException { String str = reader.nextString(); if (str.contains(".")) { return Double.parseDouble(str); } else { int limit = str.charAt(0) == '-' ? 11 : 10; if (str.length() < limit) { return Integer.parseInt(str); } else if (str.length() > limit) { return Long.parseLong(str); } else { try { return Integer.parseInt(str); } catch (NumberFormatException e) { return Long.parseLong(str); } } } }
Source:
<code>public HdfsDataSegmentKiller(final Configuration config, final HdfsDataSegmentPusherConfig pusherConfig) { this.config = config; <START> this.storageDirectory = new Path(HdfsDataSegmentUtil.getFullyQualifiedHdfsPath(pusherConfig.getStorageDirectory(), config)); <END> }</code><technical_language>this needed if wanted namenode uri in loadSpec</technical_language>

Target:
public HdfsDataSegmentKiller(final Configuration config, final HdfsDataSegmentPusherConfig pusherConfig) { this.config = config; this.storageDirectory = new Path(pusherConfig.getStorageDirectory()); }
Source:
<code>private List<ResourceTraversal> createTraversalForContainer(GitModelObject child) { GitModelObject[] containerChildren = child.getChildren(); List<ResourceTraversal> result = new ArrayList<ResourceTraversal>(); for (GitModelObject aChild : containerChildren) { <START> if(aChild.isContainer()) { <END> result.addAll(createTraversalForContainer(aChild)); } else { result.add(createTraversalForFile(aChild)); } } return result; }</code><technical_language>Curly brackets needed ;)</technical_language>

Target:
private List<ResourceTraversal> createTraversalForContainer(GitModelObject child) { GitModelObject[] containerChildren = child.getChildren(); List<ResourceTraversal> result = new ArrayList<ResourceTraversal>(); for (GitModelObject aChild : containerChildren) { if(aChild.isContainer()) result.addAll(createTraversalForContainer(aChild)); else result.add(createTraversalForFile(aChild)); } return result; }
Source:
<code>public void closeEditors() { IFile file = getBookmarksFile(); FileEditorInput input = new FileEditorInput(file); IWorkbench wb = PlatformUI.getWorkbench(); for (IWorkbenchWindow wbWindow : wb.getWorkbenchWindows()) { for (IWorkbenchPage wbPage : wbWindow.getPages()) { for (IEditorReference editorReference : wbPage.getEditorReferences()) { try { if (editorReference.getEditorInput().equals(input)) { wbPage.closeEditor(editorReference.getEditor(false), false); } } catch (PartInitException e) { <START> e.printStackTrace(); <END> } } } } }</code><technical_language>log in ErrorLog (Activator.getDefault().logError())</technical_language>

Target:
public void closeEditors() { IFile file = getBookmarksFile(); FileEditorInput input = new FileEditorInput(file); IWorkbench wb = PlatformUI.getWorkbench(); for (IWorkbenchWindow wbWindow : wb.getWorkbenchWindows()) { for (IWorkbenchPage wbPage : wbWindow.getPages()) { for (IEditorReference editorReference : wbPage.getEditorReferences()) { try { if (editorReference.getEditorInput().equals(input)) { wbPage.closeEditor(editorReference.getEditor(false), false); } } catch (PartInitException e) { Activator.getDefault().logError("Error closing editor for experiment " + getName(), e); } } } } }
Source:
<code>private JacksonIdValue( @JsonProperty("entity-type") <START> String entityType, <END> @JsonProperty("id") String id) { this.entityType = entityType; this.id = id; contents = new HashMap<>(); }</code><technical_language>I "id" is key is supposed exist. do fail in this case</technical_language>

Target:
private JacksonIdValue( @JsonProperty("entity-type") String entityType, @JsonProperty("id") String id) { Validate.notNull(id); this.entityType = entityType; this.id = id; contents = new HashMap<>(); }
Source:
<code>public List<List<Map<String, Object>>> accumulate(List<List<Map<String, Object>>> accumulatedValue, InputT1 input) { <START> if (firstTimeStream) { <END> createGetters(input.getClass(),1); firstTimeStream = false; } try { return accumulateWithIndex(0, accumulatedValue, input); } catch (NoSuchFieldException e) { throw Throwables.propagate(e); } }</code><technical_language>check if getters1 is null remove firstTimeStream</technical_language>

Target:
public List<List<Map<String, Object>>> accumulate(List<List<Map<String, Object>>> accumulatedValue, InputT1 input) { if (gettersStream1 == null) { gettersStream1 = createGetters(input.getClass()); } try { return accumulateWithIndex(0, accumulatedValue, input); } catch (NoSuchFieldException e) { throw Throwables.propagate(e); } }
Source:
<code>public void testLowercaseNamesQuery() throws Exception { snowflakeReader.properties.convertColumnsAndTableToUppercase.setValue(false); Statement statementMock = Mockito.mock(Statement.class); Connection connectionMock = Mockito.mock(Connection.class); ResultSet resultSetMock = Mockito.mock(ResultSet.class); Mockito.when(resultSetMock.next()).thenReturn(true); Mockito.when(resultSetMock.getMetaData()).thenReturn(Mockito.mock(ResultSetMetaData.class)); Mockito.when(resultSetMock.getMetaData().getColumnCount()).thenReturn(2); Mockito.when(resultSetMock.getString(0)).thenReturn("row1field", "row1column"); Mockito.when((snowflakeSourceMock).createConnection(runtimeContainerMock)).thenReturn(connectionMock); Mockito.when(connectionMock.createStatement()).thenReturn(statementMock); Mockito.when(statementMock.executeQuery(TEST_LOWERCASE_NAMES_QUERY)).thenReturn(resultSetMock); snowflakeReader.start(); snowflakeReader.getCurrent(); <START> } <END></code><technical_language>is a bad practice a unit test assertions</technical_language>

Target:
public void testLowercaseNamesQuery() throws Exception { snowflakeReader.properties.convertColumnsAndTableToUppercase.setValue(false); Statement statementMock = Mockito.mock(Statement.class); Connection connectionMock = Mockito.mock(Connection.class); ResultSet resultSetMock = Mockito.mock(ResultSet.class); Mockito.when(resultSetMock.next()).thenReturn(true); Mockito.when(resultSetMock.getMetaData()).thenReturn(Mockito.mock(ResultSetMetaData.class)); Mockito.when(resultSetMock.getMetaData().getColumnCount()).thenReturn(2); Mockito.when(resultSetMock.getString(0)).thenReturn("row1field", "row1column"); Mockito.when((snowflakeSourceMock).createConnection(runtimeContainerMock)).thenReturn(connectionMock); Mockito.when(connectionMock.createStatement()).thenReturn(statementMock); Mockito.when(statementMock.executeQuery(TEST_LOWERCASE_NAMES_QUERY)).thenReturn(resultSetMock); snowflakeReader.start(); snowflakeReader.getCurrent(); Assert.assertEquals(1, snowflakeReader.getReturnValues().get("totalRecordCount")); }
Source:
<code>private synchronized PrepPipeline createOrFindPreparer(DatabasePreparer preparer) throws IOException, SQLException { <START> PrepPipeline result = CLUSTERS.get(preparer); <END> if (result != null) { return result; } result = new PrepPipeline(EmbeddedPostgres.start()); try (Connection c = result.getPg().getTemplateDatabase().getConnection()) { preparer.prepare(c); } result.start(); CLUSTERS.put(preparer, result); return result; }</code><technical_language>removing it, grep for strings "migratory"? missed anything</technical_language>

Target:
private synchronized PrepPipeline createOrFindPreparer(DatabasePreparer preparer) throws IOException, SQLException { PrepPipeline result = CLUSTERS.get(preparer); if (result != null) { return result; } final EmbeddedPostgres pg = EmbeddedPostgres.start(); preparer.prepare(pg.getTemplateDatabase()); result = new PrepPipeline(pg).start(); CLUSTERS.put(preparer, result); return result; }
Source:
<code><START> protected void waitUntil(BooleanSupplier supplier, long timeout) { <END> if (!waitUntilNoFail(supplier, timeout)) { throw new IllegalStateException("Timed out"); } }</code><technical_language>rename this method assertWaitUntil fail test instead. waitUntilNoFail named waitUntil</technical_language>

Target:
protected boolean waitUntil(BooleanSupplier supplier, long timeout) { long start = System.currentTimeMillis(); while (true) { if (supplier.getAsBoolean()) { return true; } try { Thread.sleep(10); } catch (InterruptedException ignore) { } long now = System.currentTimeMillis(); if (now - start > timeout) { return false; } } }
Source:
<code>public void getConceptIdForUnits_shouldReturnConcept_idForDrug_order_quantity_units() throws Exception { <START> Database1_9To1_10UpgradeTest.createOrderEntryUpgradeFileWithTestData("mg=5401" + "\n" + "drug order quantity units=5403" + "\n" <END> + "ounces=5402"); Integer conceptId = UpgradeUtil.getConceptIdForUnits("drug order quantity units"); Assert.assertThat(conceptId, Is.is(5403)); }</code><technical_language>new line characters reason replace reading properties file, remove pass method a Properties instance, worst case a map</technical_language>

Target:
public void getConceptIdForUnits_shouldReturnConcept_idForDrug_order_quantity_units() throws Exception { Database1_9To1_10UpgradeTest.createOrderEntryUpgradeFileWithTestData("mg=5401" + "\n" + "drug_order_quantity_units=5403" + "\n" + "ounces=5402"); Integer conceptId = UpgradeUtil.getConceptIdForUnits("drug_order_quantity_units"); Assert.assertThat(conceptId, Is.is(5403)); }
Source:
<code><START> public Object extract(final Jar jar, final Locale locale) { <END> Objects.requireNonNull(jar, "jar"); Objects.requireNonNull(locale, "locale"); ChecksumDTO checksumDTO = new ChecksumDTO(); checksumDTO.md5 = calcChecksum(jar, "MD5"); checksumDTO.sha1 = calcChecksum(jar, "SHA-1"); checksumDTO.sha256 = calcChecksum(jar, "SHA-256"); if (checksumDTO.md5 == null && checksumDTO.sha1 == null && checksumDTO.sha256 == null) { return null; } return checksumDTO; }</code><technical_language>return actual type DTO type</technical_language>

Target:
public ChecksumDTO extract(final Jar jar, final Locale locale) { Objects.requireNonNull(jar, "jar"); Objects.requireNonNull(locale, "locale"); ChecksumDTO checksumDTO = new ChecksumDTO(); checksumDTO.md5 = calcChecksum(jar, "MD5"); checksumDTO.sha1 = calcChecksum(jar, "SHA-1"); checksumDTO.sha256 = calcChecksum(jar, "SHA-256"); if (checksumDTO.md5 == null && checksumDTO.sha1 == null && checksumDTO.sha256 == null) { return null; } return checksumDTO; }
Source:
<code>public List<ByteString> parseNextBlock(boolean skipIfStartingOnBoundary) throws IOException { LOG.debug("BlockReader: none left to read, skipping to sync point"); long skipped = skipToNextSyncPoint(); if (skipped <= -1) { LOG.debug("BlockReader: SYNC point eof"); return null; } int blockSize = readInt(); LOG.debug("BlockReader: found sync point, next block has size " + blockSize); if (blockSize < 0) { LOG.debug("ProtobufReader: reading size after sync point eof"); return null; } byte[] byteArray; if(lastBlock.length >= blockSize) { byteArray = lastBlock; } else { lastBlock = new byte[blockSize*2]; byteArray = lastBlock; } IOUtils.readFully(in_, byteArray, 0, blockSize); if (skipIfStartingOnBoundary && skipped == Protobufs.KNOWN_GOOD_POSITION_MARKER.length) { return parseNextBlock(false); } <START> SerializedBlock block = SerializedBlock.parseFrom(byteArray, blockSize); <END> curBlobs_ = block.getProtoBlobs(); numLeftToReadThisBlock_ = curBlobs_.size(); LOG.debug("ProtobufReader: number in next block is " + numLeftToReadThisBlock_); return curBlobs_; }</code><technical_language>if in_ SerializedBlock.parseFrom(in_), remove byteArray lastBlock</technical_language>

Target:
public List<ByteString> parseNextBlock(boolean skipIfStartingOnBoundary) throws IOException { LOG.debug("BlockReader: none left to read, skipping to sync point"); long skipped = skipToNextSyncPoint(); if (skipped <= -1) { LOG.debug("BlockReader: SYNC point eof"); return null; } int blockSize = readInt(); LOG.debug("BlockReader: found sync point, next block has size " + blockSize); if (blockSize < 0) { LOG.debug("ProtobufReader: reading size after sync point eof"); return null; } if (skipIfStartingOnBoundary && skipped == Protobufs.KNOWN_GOOD_POSITION_MARKER.length) { in_.skip(blockSize); return parseNextBlock(false); } SerializedBlock block = SerializedBlock.parseFrom(new BoundedInputStream(in_, blockSize)); curBlobs_ = block.getProtoBlobs(); numLeftToReadThisBlock_ = curBlobs_.size(); LOG.debug("ProtobufReader: number in next block is " + numLeftToReadThisBlock_); return curBlobs_; }
Source:
<code>public AdminEmailAttributes getAdminEmailBySubject(String subject) { <START> AdminEmail matched = getAdminEmailEntityBySubject(subject); <END> if (matched == null) { return null; } return new AdminEmailAttributes(matched); }</code><technical_language>matchedEmail</technical_language>

Target:
public AdminEmailAttributes getAdminEmailBySubject(String subject) { AdminEmail matchedEmail = getAdminEmailEntityBySubject(subject); if (matchedEmail == null) { return null; } return new AdminEmailAttributes(matchedEmail); }
Source:
<code>public void refresh() { if (getManagedForm() == null || getManagedForm().getForm().isDisposed()) { return; } try { showEditorBusy(true); boolean hasIncoming = false; if (getTask() != null) { hasIncoming = getTask().getSynchronizationState().isIncoming(); } if (model != null) { doSave(new NullProgressMonitor()); refreshInput(); } else { initModel(getTaskEditor().getTaskEditorInput()); } if (taskData != null) { try { setReflow(false); if (focusTracker != null) { focusTracker.reset(); } lastSelection = null; boolean recreatePage = false; for (AbstractTaskEditorPart part : parts) { boolean hasIncomingChanges = part.hasIncomingChanges(); <START> if (hasIncomingChanges && !part.supportsRefreshing()) { <END> recreatePage = true; break; } else if (hasIncomingChanges) { part.refresh(); } } if (recreatePage) { Menu menu = editorComposite.getMenu(); CommonUiUtil.setMenu(editorComposite, null); for (Control control : editorComposite.getChildren()) { control.dispose(); } for (AbstractTaskEditorPart part : parts) { part.dispose(); getManagedForm().removePart(part); } parts.clear(); editorComposite.setMenu(menu); createFormContentInternal(); } getTaskEditor().setMessage(null, 0); if (hasIncoming) { getTaskEditor().setActivePage(getId()); } setSubmitEnabled(true); } finally { setReflow(true); } } updateOutlinePage(); updateHeaderMessage(); getManagedForm().dirtyStateChanged(); getTaskEditor().updateHeaderToolBar(); } finally { showEditorBusy(false); } reflow(); }</code><technical_language>more readable if(part.hasIncomingChanges()) { if (part.supportsRefreshing()) { } else { } }</technical_language>

Target:
public void refresh() { if (getManagedForm() == null || getManagedForm().getForm().isDisposed()) { return; } try { showEditorBusy(true); boolean hasIncoming = false; if (getTask() != null) { hasIncoming = getTask().getSynchronizationState().isIncoming(); } if (model != null) { doSave(new NullProgressMonitor()); refreshInput(); } else { initModel(getTaskEditor().getTaskEditorInput()); } if (taskData != null) { try { setReflow(false); if (focusTracker != null) { focusTracker.reset(); } lastSelection = null; boolean recreatePage = false; for (AbstractTaskEditorPart part : parts) { if (part.hasIncomingChanges()) { if (!part.supportsRefreshing()) { recreatePage = true; break; } else { part.refresh(); } } } if (recreatePage) { Menu menu = editorComposite.getMenu(); CommonUiUtil.setMenu(editorComposite, null); for (Control control : editorComposite.getChildren()) { control.dispose(); } for (AbstractTaskEditorPart part : parts) { part.dispose(); getManagedForm().removePart(part); } parts.clear(); editorComposite.setMenu(menu); createFormContentInternal(); } getTaskEditor().setMessage(null, 0); if (hasIncoming) { getTaskEditor().setActivePage(getId()); } setSubmitEnabled(true); } finally { setReflow(true); } } updateOutlinePage(); updateHeaderMessage(); getManagedForm().dirtyStateChanged(); getTaskEditor().updateHeaderToolBar(); } finally { showEditorBusy(false); } reflow(); }
Source:
<code><START> private void printAllProvidedServices(StringBuilder buf, boolean detail) { <END> boolean printHeader = true; for (ProviderModel provider : ApplicationModel.allProviderModels()) { if (printHeader) { buf.append("PROVIDER:\r\n"); printHeader = false; } buf.append(provider.getServiceName()); if (detail) { buf.append(" -> "); buf.append(" published: "); buf.append(isRegistered(provider.getServiceName()) ? "Y" : "N"); } buf.append("\r\n"); } }</code><technical_language>simplified private void printAllProvidedServices(StringBuilder buf, boolean detail) { if(!ApplicationModel.allProviderModels().isEmpty()) { buf.append("PROVIDER:\r\n"); } for (ProviderModel provider : ApplicationModel.allProviderModels()) { buf.append(provider.getServiceName()); if (detail) { buf.append(" -> "); buf.append(" published: "); buf.append(isRegistered(provider.getServiceName()) ? "Y" : "N"); } buf.append("\r\n"); } }</technical_language>

Target:
private void printAllProvidedServices(StringBuilder buf, boolean detail) { if (!ApplicationModel.allProviderModels().isEmpty()) { buf.append("PROVIDER:\r\n"); } for (ProviderModel provider : ApplicationModel.allProviderModels()) { buf.append(provider.getServiceName()); if (detail) { buf.append(" -> "); buf.append(" published: "); buf.append(isRegistered(provider.getServiceName()) ? "Y" : "N"); } buf.append("\r\n"); } }
Source:
<code>public final void wrapEditXmlModel(Runnable editAction) { IStructuredModel model = null; try { if (mIsEditXmlModelPending == 0) { model = getModelForEdit(); model.aboutToChangeModel(); } mIsEditXmlModelPending++; editAction.run(); } finally { <START> mIsEditXmlModelPending--; <END> if (model != null) { model.changedModel(); model.releaseFromEdit(); } } }</code><technical_language>if get exception test <=0 instead of ==0 (and reset 1 in case instead of a simple inc?) check if <0 decrement reset 0</technical_language>

Target:
public final void wrapEditXmlModel(Runnable editAction) { IStructuredModel model = null; try { if (mIsEditXmlModelPending == 0) { try { model = getModelForEdit(); model.aboutToChangeModel(); } catch (Throwable t) { AdtPlugin.log(t, "XML Editor failed to get model to edit"); return; } } mIsEditXmlModelPending++; editAction.run(); } finally { mIsEditXmlModelPending--; if (model != null) { model.changedModel(); model.releaseFromEdit(); if (mIsEditXmlModelPending < 0) { AdtPlugin.log(IStatus.ERROR, "wrapEditXmlModel finished with invalid nested counter==%d", mIsEditXmlModelPending); mIsEditXmlModelPending = 0; } } } }
Source:
<code>public InetSocketAddress[] getPeers(long services, long timeoutValue, TimeUnit timeoutUnit) throws PeerDiscoveryException { try { HttpUrl.Builder url = HttpUrl.get(details.uri).newBuilder(); if (services != 0) url.addQueryParameter("srvmask", Long.toString(services)); Request.Builder request = new Request.Builder(); request.url(url.build()); request.addHeader("User-Agent", VersionMessage.LIBRARY_SUBVER); log.info("Requesting seeds from {}", url); Response response = client.newCall(request.build()).execute(); if (!response.isSuccessful()) throw new PeerDiscoveryException("HTTP request failed: " + response.code() + " " + response.message()); InputStream stream = response.body().byteStream(); GZIPInputStream zip = new GZIPInputStream(stream); PeerSeedProtos.SignedPeerSeeds proto; try { proto = PeerSeedProtos.SignedPeerSeeds.parseDelimitedFrom(zip); } catch (IOException ioe){ zip.close(); throw ioe; } <START> if (zip != null){ <END> zip.close(); } return protoToAddrs(proto); } catch (PeerDiscoveryException e1) { throw e1; } catch (Exception e) { throw new PeerDiscoveryException(e); } }</code><technical_language>null check? if zip null here</technical_language>

Target:
public InetSocketAddress[] getPeers(long services, long timeoutValue, TimeUnit timeoutUnit) throws PeerDiscoveryException { try { HttpUrl.Builder url = HttpUrl.get(details.uri).newBuilder(); if (services != 0) url.addQueryParameter("srvmask", Long.toString(services)); Request.Builder request = new Request.Builder(); request.url(url.build()); request.addHeader("User-Agent", VersionMessage.LIBRARY_SUBVER); log.info("Requesting seeds from {}", url); Response response = client.newCall(request.build()).execute(); if (!response.isSuccessful()) throw new PeerDiscoveryException("HTTP request failed: " + response.code() + " " + response.message()); InputStream stream = response.body().byteStream(); GZIPInputStream zip = new GZIPInputStream(stream); PeerSeedProtos.SignedPeerSeeds proto; try { proto = PeerSeedProtos.SignedPeerSeeds.parseDelimitedFrom(zip); } finally { zip.close(); } return protoToAddrs(proto); } catch (PeerDiscoveryException e1) { throw e1; } catch (Exception e) { throw new PeerDiscoveryException(e); } }
Source:
<code>public void freeRevocable(QueryId queryId, long bytes) { checkArgument(bytes >= 0, "bytes is negative"); checkArgument(reservedRevocableBytes >= bytes, "tried to free more revocable memory than is reserved"); if (bytes == 0) { return; } Long queryReservation = queryMemoryRevocableReservations.get(queryId); requireNonNull(queryReservation, "queryReservation is null"); checkArgument(queryReservation - bytes >= 0, "tried to free more revocable memory than is reserved by query"); queryReservation -= bytes; if (queryReservation == 0) { queryMemoryRevocableReservations.remove(queryId, queryReservation); } else { <START> queryMemoryRevocableReservations.put(queryId, queryReservation); <END> } synchronized (this) { reservedRevocableBytes -= bytes; if (getFreeBytes() > 0 && future != null) { future.set(null); future = null; } } }</code><technical_language>This match regular free works. This unconditional put overwrites another thread put in. I needs basically match in free in terms of merging in initial -bytes. remove "else"</technical_language>

Target:
public void freeRevocable(QueryId queryId, long bytes) { checkArgument(bytes >= 0, "bytes is negative"); checkArgument(reservedRevocableBytes >= bytes, "tried to free more revocable memory than is reserved"); if (bytes == 0) { return; } Long queryReservation = queryMemoryRevocableReservations.merge(queryId, -bytes, Long::sum); checkArgument(queryReservation != -bytes, "queryId does not exist in queryMemoryRevocableReservations"); checkArgument(queryReservation >= 0, "tried to free more revocable memory than is reserved by query"); if (queryReservation == 0) { queryMemoryRevocableReservations.remove(queryId, queryReservation); } synchronized (this) { reservedRevocableBytes -= bytes; if (getFreeBytes() > 0 && future != null) { future.set(null); future = null; } } }
Source:
<code>private static Map<String, Object> parseArgs(String[] args) throws Exception { if(args.length < 1) { throw new IllegalArgumentException("Please provide module. To list existing modules use --help argument."); <START> } <END> Properties prop = CoreUtil.loadProperties(ExtensionsToolExecutor.class); ParametersParser parser = new ParametersParser(prop); Map<String, Object> argMap = parser.parse(args); return argMap; }</code><technical_language>this done caller I this is required for 2nd parse</technical_language>

Target:
private static Map<String, Object> parseArgs(String[] args) throws Exception { if(args.length < 1) { throw new IllegalArgumentException("Please provide module. To list existing modules use --help argument."); } return new ParametersParser( CoreUtil.loadProperties(ExtensionsToolExecutor.class, "arguments.properties"), CoreUtil.loadProperties(ExtensionsToolExecutor.class, "defaults.properties") ).parse(args); }
Source:
<code>public void update() throws BankException, LoginException, BankChoiceException, IOException { super.update(); if (getUsername().isEmpty()) { throw new LoginException(res.getText(R.string.invalid_card_number).toString()); } urlopen = login(); Document d = Jsoup.parse(response); Element e = d.getElementById("cphMain_lblAmount"); if (e == null) { throw new BankException( res.getText(R.string.unable_to_find).toString() + res.getText(R.string.balance).toString()); } BigDecimal b = Helpers.parseBalance(e.text()); e = d.getElementById("lblCardName"); <START> String name = "HÖRS"; <END> if (e != null) { name = e.text(); if (this.getCustomName().isEmpty()) { this.setCustomName(name); } } Account a = new Account(name, b, "0"); accounts.add(a); balance = balance.add(a.getBalance()); d = Jsoup.parse(urlopen.open("<LINK_0>")); Elements es = d.select("tr"); List<Transaction> transactions = new ArrayList<Transaction>(); if (es != null) { for (Element el : es) { transactions.add( new Transaction(el.child(0).text().trim(), el.child(1).text().trim(), Helpers.parseBalance(el.child(2).text()))); } } a.setTransactions(transactions); if (accounts.isEmpty()) { throw new BankException(res.getText(R.string.no_accounts_found).toString()); } super.updateComplete(); }</code><technical_language>reuse NAME constant instead of declaring a new String</technical_language>

Target:
public void update() throws BankException, LoginException, BankChoiceException, IOException { super.update(); urlopen = login(); Document document = Jsoup.parse(response); Element balanceElement = document.getElementById("cphMain_lblAmount"); if (balanceElement == null) { throw new BankException( res.getText(R.string.unable_to_find).toString() + res.getText(R.string.balance).toString()); } Element nameElement = document.getElementById("lblCardName"); String accountName = nameElement == null ? NAME.toUpperCase() : nameElement.text(); if (this.getCustomName().isEmpty()) { this.setCustomName(accountName); } Account account = new Account(accountName, Helpers.parseBalance(balanceElement.text()), "0"); accounts.add(account); balance = balance.add(account.getBalance()); document = Jsoup.parse(urlopen.open("<LINK_0>")); Elements transactionElements = document.select("tr"); List<Transaction> transactions = new ArrayList<Transaction>(); if (transactionElements != null) { for (Element element : transactionElements) { transactions.add(asTransaction(element)); } } account.setTransactions(transactions); super.updateComplete(); }
Source:
<code>private void checkSuccessfulClientStart(String[] cipherSuites, String[] protocols) throws Exception { this.cipherSuites = F.isEmpty(cipherSuites) ? null : cipherSuites; this.protocols = F.isEmpty(protocols) ? null : protocols; IgniteClient client = Ignition.startClient(getClientConfiguration()); client.getOrCreateCache(TEST_CACHE_NAME); <START> client.close(); <END> }</code><technical_language>Please try resources</technical_language>

Target:
private void checkSuccessfulClientStart(String[] cipherSuites, String[] protocols) throws Exception { this.cipherSuites = F.isEmpty(cipherSuites) ? null : cipherSuites; this.protocols = F.isEmpty(protocols) ? null : protocols; try (IgniteClient client = Ignition.startClient(getClientConfiguration())) { client.getOrCreateCache(TEST_CACHE_NAME); } }
Source:
<code>Proverb(String[] words) { <START> this.words = words; <END> }</code><technical_language>This replaced throw new UnsupportedOperationException("Delete this statement write implementation.");. want provide users signatures for exercise, of implementation :)</technical_language>

Target:
Proverb(String[] words) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); }
Source:
<code>@Test public void getWithNonStringUrlThrows() { class Example { @GET Call<Object> method(@Url Object url) { return null; } } try { <START> buildRequest(Example.class, "foo/bar"); <END> } catch (IllegalArgumentException e) { assertThat(e).hasMessage("@Url must be String type. (parameter #1)\n" + " for method Example.method"); } }</code><technical_language>fail</technical_language>

Target:
@Test public void getWithNonStringUrlThrows() { class Example { @GET Call<Object> method(@Url Object url) { return null; } } try { buildRequest(Example.class, "foo/bar"); fail(); } catch (IllegalArgumentException e) { assertThat(e).hasMessage("@Url must be String type. (parameter #1)\n" + " for method Example.method"); } }
Source:
<code>public void updateVendorUpdatesStatusInPaymentWorks(List<PaymentWorksUpdateVendorStatus> paymentWorksUpdateVendorStatus) { String jsonString = new PaymentWorksUtil().pojoToJsonString(paymentWorksUpdateVendorStatus); Client client = buildClient(); String URL = (new StringBuilder(getPaymentworksApiUrl()).append(NEW_VENDOR_REQUEST_UPDATE_STATUS)).toString(); ClientResponse response = client.handle(buildClientRequest(URL, jsonString)); LOG.debug("Status: " + response.getStatus()); if (response.getStatus() == 200) { LOG.debug("Vendor Update status updated"); } else { <START> LOG.error("Failed to update Vendor Update status: " + response.getEntity(String.class)); <END> } }</code><technical_language>question - need do more here</technical_language>

Target:
public void updateVendorUpdatesStatusInPaymentWorks( List<PaymentWorksUpdateVendorStatus> paymentWorksUpdateVendorStatus) { String jsonString = getPaymentWorksUtilityService().pojoToJsonString(paymentWorksUpdateVendorStatus); Client client = buildClient(); String URL = (new StringBuilder(getPaymentworksApiUrl()).append(NEW_VENDOR_REQUEST_UPDATE_STATUS)).toString(); ClientResponse response = client.handle(buildClientRequest(URL, jsonString)); if (response.getStatus() == HttpURLConnection.HTTP_OK) { LOG.debug("Vendor Update status updated"); } else { LOG.error("Failed to update Vendor Update status: " + response.getEntity(String.class)); throw new RuntimeException("Unable to update vendor status in PaymentWorks"); } }
Source:
<code>public CloseableHttpClient build() { org.apache.http.impl.client.HttpClientBuilder httpClientBuilder = createHttpClientBuilder(); boolean acceptAnyCertificate = false; boolean acceptAnyHostname = false; <START> if (useSystemProperties) { <END> httpClientBuilder.useSystemProperties(); String property = System.getProperty(WebProperties.WEB_HTTPS_ALLOW_ANY_CERTIFICATE); if ("true".equalsIgnoreCase(property)) { acceptAnyCertificate = true; } property = System.getProperty(WebProperties.WEB_HTTPS_ALLOW_ANY_HOSTNAME); if ("true".equalsIgnoreCase(property)) { acceptAnyHostname = true; } } if (allowAnyHostname != null) { if (allowAnyHostname) { acceptAnyHostname = true; } else { acceptAnyHostname = false; } } if (allowAnyCertificate != null) { if (allowAnyCertificate) { acceptAnyCertificate = true; } else { acceptAnyCertificate = false; } } if (acceptAnyCertificate) { httpClientBuilder.setSslcontext(createSslContext()); } if (acceptAnyHostname) { httpClientBuilder.setHostnameVerifier(SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); } if (maxConnections > 0) { httpClientBuilder.setMaxConnPerRoute(maxConnections); httpClientBuilder.setMaxConnTotal(maxConnections); } if (requestConfig != null) { httpClientBuilder.setDefaultRequestConfig(requestConfig); } if (!useContentCompression) { httpClientBuilder.disableContentCompression(); } httpClientBuilder.setUserAgent("ProActive"); return httpClientBuilder.build(); }</code><technical_language>do need this flag (useSystemProperties) ? Is enough confusing check if system properties passed? is some business logic I missing</technical_language>

Target:
public CloseableHttpClient build() { org.apache.http.impl.client.HttpClientBuilder internalHttpClientBuilder = createInternalHttpClientBuilder(); boolean acceptAnyCertificate = false; boolean acceptAnyHostname = false; if (useSystemProperties) { internalHttpClientBuilder.useSystemProperties(); String property = System.getProperty(WebProperties.WEB_HTTPS_ALLOW_ANY_CERTIFICATE); if ("true".equalsIgnoreCase(property)) { acceptAnyCertificate = true; } property = System.getProperty(WebProperties.WEB_HTTPS_ALLOW_ANY_HOSTNAME); if ("true".equalsIgnoreCase(property)) { acceptAnyHostname = true; } } if (allowAnyHostname != null) { if (allowAnyHostname) { acceptAnyHostname = true; } else { acceptAnyHostname = false; } } if (allowAnyCertificate != null) { if (allowAnyCertificate) { acceptAnyCertificate = true; } else { acceptAnyCertificate = false; } } if (acceptAnyCertificate) { internalHttpClientBuilder.setSslcontext(createSslContext()); } if (acceptAnyHostname) { internalHttpClientBuilder.setHostnameVerifier( SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); } if (maxConnections > 0) { internalHttpClientBuilder.setMaxConnPerRoute(maxConnections); internalHttpClientBuilder.setMaxConnTotal(maxConnections); } if (requestConfig != null) { internalHttpClientBuilder.setDefaultRequestConfig(requestConfig); } if (!useContentCompression) { internalHttpClientBuilder.disableContentCompression(); } return internalHttpClientBuilder.build(); }
Source:
<code>public String initializeProperties(String formName, PropertiesDto propertiesContainer) { Properties properties = propertiesHelpers.propertiesFromDto(propertiesContainer); properties.refreshLayout(properties.getForm(formName)); <START> return properties == null ? "{}" : jsonSerializationHelper.toJson(formName, properties); <END> }</code><technical_language>if properties instance null code in line NPE check for null calling *refreshLayout*</technical_language>

Target:
public String initializeProperties(String formName, PropertiesDto propertiesContainer) { Properties properties = propertiesHelpers.propertiesFromDto(propertiesContainer); if (properties == null) { return "{}"; } properties.refreshLayout(properties.getForm(formName)); return jsonSerializationHelper.toJson(formName, properties); }
Source:
<code>protected void onPostExecute(Void aVoid) { if (mApi == null) { mApi = new RestApi(SyncthingService.this, mConfig.getWebGuiUrl(), mConfig.getApiKey(), SyncthingService.this::onApiAvailable, () -> onServiceStateChange(mCurrentState)); Log.i(TAG, "Web GUI will be available at " + mConfig.getWebGuiUrl()); } if (mSyncthingRunnable != null || mSyncthingRunnableThread != null) { <START> Log.e(TAG, "StartupTask/onPostExecute: Syncthing binary lifecycle violated"); <END> } mSyncthingRunnable = new SyncthingRunnable(SyncthingService.this, SyncthingRunnable.Command.main); mSyncthingRunnableThread = new Thread(mSyncthingRunnable); mSyncthingRunnableThread.start(); if (mPollWebGuiAvailableTask == null) { mPollWebGuiAvailableTask = new PollWebGuiAvailableTask( SyncthingService.this, getWebGuiUrl(), mConfig.getApiKey(), result -> { Log.i(TAG, "Web GUI has come online at " + mConfig.getWebGuiUrl()); if (mApi != null) { mApi.readConfigFromRestApi(); } }); } }</code><technical_language>This errors good. crash return here</technical_language>

Target:
protected void onPostExecute(Void aVoid) { if (mApi == null) { mApi = new RestApi(SyncthingService.this, mConfig.getWebGuiUrl(), mConfig.getApiKey(), SyncthingService.this::onApiAvailable, () -> onServiceStateChange(mCurrentState)); Log.i(TAG, "Web GUI will be available at " + mConfig.getWebGuiUrl()); } if (mSyncthingRunnable != null || mSyncthingRunnableThread != null) { Log.e(TAG, "StartupTask/onPostExecute: Syncthing binary lifecycle violated"); return; } mSyncthingRunnable = new SyncthingRunnable(SyncthingService.this, SyncthingRunnable.Command.main); mSyncthingRunnableThread = new Thread(mSyncthingRunnable); mSyncthingRunnableThread.start(); if (mPollWebGuiAvailableTask == null) { mPollWebGuiAvailableTask = new PollWebGuiAvailableTask( SyncthingService.this, getWebGuiUrl(), mConfig.getApiKey(), result -> { Log.i(TAG, "Web GUI has come online at " + mConfig.getWebGuiUrl()); if (mApi != null) { mApi.readConfigFromRestApi(); } }); } }
Source:
<code>public SliceDictionarySelectiveReader(StreamDescriptor streamDescriptor, Optional<TupleDomainFilter> filter, Optional<Type> outputType, LocalMemoryContext systemMemoryContext) { this.streamDescriptor = requireNonNull(streamDescriptor, "streamDescriptor is null"); this.filter = requireNonNull(filter, "filter is null").orElse(null); this.systemMemoryContext = systemMemoryContext; this.nonDeterministicFilter = this.filter != null && !this.filter.isDeterministic(); this.nullsAllowed = this.filter == null || nonDeterministicFilter || this.filter.testNull(); this.outputType = requireNonNull(outputType, "outputType is null").orElse(null); this.outputRequired = outputType.isPresent(); if (!outputRequired) { <START> checkState(filter != null, "filter should be present if output is not required"); <END> } }</code><technical_language>in direct reader this: checkArgument(filter.isPresent() || outputRequired, "filter present if output is required");</technical_language>

Target:
public SliceDictionarySelectiveReader(StreamDescriptor streamDescriptor, Optional<TupleDomainFilter> filter, Optional<Type> outputType, LocalMemoryContext systemMemoryContext) { this.streamDescriptor = requireNonNull(streamDescriptor, "streamDescriptor is null"); this.filter = requireNonNull(filter, "filter is null").orElse(null); this.systemMemoryContext = systemMemoryContext; this.nonDeterministicFilter = this.filter != null && !this.filter.isDeterministic(); this.nullsAllowed = this.filter == null || nonDeterministicFilter || this.filter.testNull(); this.outputType = requireNonNull(outputType, "outputType is null").orElse(null); OrcType orcType = streamDescriptor.getOrcType(); this.maxCodePointCount = orcType == null ? 0 : orcType.getLength().orElse(-1); this.isCharType = orcType.getOrcTypeKind() == CHAR; this.outputRequired = outputType.isPresent(); checkArgument(filter.isPresent() || outputRequired, "filter must be present if outputRequired is false"); }
Source:
<code>private void syncLunsForBlockStorageDomains() { if (getOldStoragePool().getCompatibilityVersion().lessOrEquals(Version.v4_0) && <START> getStoragePool().getCompatibilityVersion().greaterOrEquals(Version.v4_1)) { <END> Collection<StorageDomain> unSyncedStorageDomains = syncLunsForStorageDomains(storageDomainDao.getAllForStoragePool(getStoragePoolId())); if (!unSyncedStorageDomains.isEmpty()) { String unSyncedStorageDomainsList = unSyncedStorageDomains.stream() .map(StorageDomain::getId) .map(Guid::toString) .collect(Collectors.joining(", ")); addCustomValue("StorageDomainsIds", unSyncedStorageDomainsList); auditLogDirector.log(this, AuditLogType.STORAGE_DOMAINS_COULD_NOT_BE_SYNCED); } } }</code><technical_language>supported/unsupported versions hard coded here. Please check discard is supported FeatureSupported class</technical_language>

Target:
private void syncLunsForBlockStorageDomains() { if (!FeatureSupported.discardAfterDeleteSupported(getOldStoragePool().getCompatibilityVersion()) && FeatureSupported.discardAfterDeleteSupported(getStoragePool().getCompatibilityVersion())) { Collection<Guid> unSyncedStorageDomains = syncLunsForStorageDomains(storageDomainDao.getAllForStoragePool(getStoragePoolId())); if (!unSyncedStorageDomains.isEmpty()) { String unSyncedStorageDomainsList = unSyncedStorageDomains.stream() .map(Guid::toString) .collect(Collectors.joining(", ")); addCustomValue("StorageDomainsIds", unSyncedStorageDomainsList); auditLogDirector.log(this, AuditLogType.STORAGE_DOMAINS_COULD_NOT_BE_SYNCED); } } }
Source:
<code>public Spec acl() { try { return new Spec.Simple( <START> new JdkRequest(UriBuilder.fromUri(this.home).build()) <END> .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_XML) .header(HttpHeaders.AUTHORIZATION, this.token) .method(Request.GET) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(XmlResponse.class) .xml() .xpath("/page/stand/acl/text()") .get(0) ); } catch (IOException ex) { throw new IllegalStateException(ex); } }</code><technical_language>need UriBuilder</technical_language>

Target:
public Spec acl() { try { return new Spec.Simple( new JdkRequest(this.home) .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_XML) .header(HttpHeaders.AUTHORIZATION, this.token) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(XmlResponse.class) .xml() .xpath("/page/stand/acl/text()") .get(0) ); } catch (IOException ex) { throw new IllegalStateException(ex); } }
Source:
<code>public File takeScreenshot(Driver driver, WebElement element) { try { BufferedImage destination = takeScreenshotAsImage(driver, element); return writeToFile(driver, destination); } catch (IOException e) { <START> log.error("Failed to take screenshot of " + element, e); <END> return null; } }</code><technical_language>Format</technical_language>

Target:
public File takeScreenshot(Driver driver, WebElement element) { try { BufferedImage destination = takeScreenshotAsImage(driver, element); return writeToFile(driver, destination); } catch (IOException e) { log.error("Failed to take screenshot of {}", element, e); return null; } }
Source:
<code>protected void inputChanged(Object input, Object oldInput) { elements.clear(); Object[] children = getSortedChildren(getRoot()); list.removeAll(); for (Object <START> element : <END> children) { elements.add(element); mapElement(element, list); } list.setElements(children); }</code><technical_language>rename 'child'</technical_language>

Target:
protected void inputChanged(Object input, Object oldInput) { elements.clear(); Object[] children = getSortedChildren(getRoot()); list.removeAll(); for (Object child : children) { elements.add(child); mapElement(child, list); } list.setElements(children); }
Source:
<code>public static Link valueOf(String element) { if (!StringUtils.hasText(element)) { return null; } Pattern uriAndAttributes = Pattern.compile("<(.*)>;(.*)"); Matcher matcher = uriAndAttributes.matcher(element); if (matcher.find()) { Map<String, String> attributes = getAttributeMap(matcher.group(2)); if (!attributes.containsKey("rel")) { throw new IllegalArgumentException("Link does not provide a rel attribute!"); } <START> Set<String> unrecognizedHeaders = unrecognizedHeaders(attributes); <END> if (!unrecognizedHeaders.isEmpty()) { throw new IllegalArgumentException("Link contains invalid RFC5988 headers! => " + unrecognizedHeaders); } Link link = new Link(matcher.group(1), attributes.get("rel")); if (attributes.containsKey("hreflang")) { link = link.withHreflang(attributes.get("hreflang")); } if (attributes.containsKey("media")) { link = link.withMedia(attributes.get("media")); } if (attributes.containsKey("title")) { link = link.withTitle(attributes.get("title")); } if (attributes.containsKey("type")) { link = link.withType(attributes.get("type")); } if (attributes.containsKey("deprecation")) { link = link.withDeprecation(attributes.get("deprecation")); } return link; } else { throw new IllegalArgumentException(String.format("Given link header %s is not RFC5988 compliant!", element)); } }</code><technical_language>Postel's Law I throw exception ignore attributes understand</technical_language>

Target:
public static Link valueOf(String element) { if (!StringUtils.hasText(element)) { return null; } Pattern uriAndAttributes = Pattern.compile("<(.*)>;(.*)"); Matcher matcher = uriAndAttributes.matcher(element); if (matcher.find()) { Map<String, String> attributes = getAttributeMap(matcher.group(2)); if (!attributes.containsKey("rel")) { throw new IllegalArgumentException("Link does not provide a rel attribute!"); } Link link = new Link(matcher.group(1), attributes.get("rel")); if (attributes.containsKey("hreflang")) { link = link.withHreflang(attributes.get("hreflang")); } if (attributes.containsKey("media")) { link = link.withMedia(attributes.get("media")); } if (attributes.containsKey("title")) { link = link.withTitle(attributes.get("title")); } if (attributes.containsKey("type")) { link = link.withType(attributes.get("type")); } if (attributes.containsKey("deprecation")) { link = link.withDeprecation(attributes.get("deprecation")); } return link; } else { throw new IllegalArgumentException(String.format("Given link header %s is not RFC5988 compliant!", element)); } }
Source:
<code>void removeRemoteReplicaInfo(RemoteReplicaInfo remoteReplicaInfo) { lock.lock(); replicaLazyRemoveSet.add(remoteReplicaInfo); <START> lock.unlock(); <END> logger.trace("RemoteReplicaInfo scheduled to be removed from ReplicaThread {}.", remoteReplicaInfo, threadName); }</code><technical_language>call unlock needs in a finally block. better, if a simple mutex lock, switch synchronized(someLockObject) handles unlocking automatically</technical_language>

Target:
void removeRemoteReplicaInfo(RemoteReplicaInfo remoteReplicaInfo) { lock.lock(); try { DataNodeId dataNodeId = remoteReplicaInfo.getReplicaId().getDataNodeId(); Set<RemoteReplicaInfo> remoteReplicaInfos = replicasToReplicateGroupedByNode.get(dataNodeId); if (remoteReplicaInfos != null) { if (!remoteReplicaInfos.remove(remoteReplicaInfo)) { replicationMetrics.remoteReplicaInfoRemoveError.inc(); logger.error("ReplicaThread: {}, RemoteReplicaInfo not found.", threadName, remoteReplicaInfo); } } else { replicationMetrics.remoteReplicaInfoRemoveError.inc(); logger.error("ReplicaThread: {}, RemoteReplicaInfos Set is not created for DataNode {}, RemoteReplicaInfo: {}.", threadName, dataNodeId, remoteReplicaInfo); } } finally { lock.unlock(); } logger.trace("RemoteReplicaInfo is removed from ReplicaThread {}.", remoteReplicaInfo, threadName); }
Source:
<code>public int appendFromDirectly(byte[] byteArray, int offset, int length) throws IOException { if (!fileChannel.isOpen()) { throw new ClosedChannelException(); } if (endOffset.get() + length > capacityInBytes) { metrics.overflowWriteError.inc(); throw new IllegalArgumentException( <START> "Channel cannot be written to segment [" + file.getAbsolutePath() + "] because" + " it exceeds the capacity [" <END> + capacityInBytes + "]"); } else { try (DirectRandomAccessFile directFile = new DirectRandomAccessFile(file, "rw", 2 * 1024 * 1024)) { directFile.seek(endOffset.get()); directFile.write(byteArray, offset, length); } endOffset.addAndGet(length); return length; } }</code><technical_language>minor: "byte array be.."</technical_language>

Target:
int appendFromDirectly(byte[] byteArray, int offset, int length) throws IOException { if (!fileChannel.isOpen()) { throw new ClosedChannelException(); } validateAppendSize(length); try (DirectRandomAccessFile directFile = new DirectRandomAccessFile(file, "rw", 2 * 1024 * 1024)) { directFile.seek(endOffset.get()); directFile.write(byteArray, offset, length); endOffset.addAndGet(length); } return length; }
Source:
<code>public void adjustThreadNum(final int threadNum) { final int currentThreadNum = eventProcessors.size(); if (currentThreadNum <= threadNum) { addNewThreadsToSet(threadNum - currentThreadNum); } else if (currentThreadNum > threadNum) { int closedProcessorNum = 0; final Iterator<EventProcessor> iterator = eventProcessors.iterator(); while(iterator.hasNext()) { final EventProcessor eventProcessor = iterator.next(); try { eventProcessor.close(); <START> } catch (Exception e) { <END> e.printStackTrace(); } iterator.remove(); closedProcessorNum++; if (closedProcessorNum >= currentThreadNum - threadNum) { break; } } } }</code><technical_language>eventProcrssor.close throws exception? set a boolean value</technical_language>

Target:
public void adjustThreadNum(final int threadNum) { final int currentThreadNum = eventProcessors.size(); if (currentThreadNum <= threadNum) { addNewThreadsToSet(threadNum - currentThreadNum); } else if (currentThreadNum > threadNum) { int closedProcessorNum = 0; final Iterator<EventProcessor> iterator = eventProcessors.iterator(); while(iterator.hasNext()) { final EventProcessor eventProcessor = iterator.next(); eventProcessor.close(); iterator.remove(); closedProcessorNum++; if (closedProcessorNum >= currentThreadNum - threadNum) { break; } } } }
Source:
<code>public void testScrollService() { assertNotNull(service); assertTrue(service.exists("default")); assertTrue(service.exists("static")); assertTrue(service.exists("repository")); <START> assertFalse(service.exists("unknown")); <END> }</code><technical_language>Maybe, I simple dumb unit test, this test checks service is started initialized, need test tests. I cases a is useful understand failure in this case</technical_language>

Target:
public void testScrollService() { assertNotNull(service); assertTrue(service.exists(StaticScrollRequest.builder("").build())); assertTrue(service.exists(DocumentScrollRequest.builder("").build())); assertTrue(service.exists(DocumentScrollRequest.builder("").name("repository").build())); assertFalse(service.exists(DocumentScrollRequest.builder("").name("unknown").build())); }