auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void doFlush() { while (!mStopFlushing) { while (mQueue.isEmpty() && !mStopFlushing) { try { if (mFlushSemaphore.tryAcquire(mFlushBatchTimeNs, TimeUnit.NANOSECONDS)) { break; } } catch (InterruptedException ie) { break; } } try { long startTime = System.nanoTime(); while (!mQueue.isEmpty()) { JournalEntry entry = mQueue.peek(); if (entry == null) { break; } mJournalWriter.write(entry); JournalUtils.sinkAppend(mJournalSinks, entry); mQueue.poll(); mWriteCounter++; if (((System.nanoTime() - startTime) >= mFlushBatchTimeNs) && !mStopFlushing) { break; } } if (mFlushCounter.get() < mWriteCounter) { try (Timer.Context ctx = MetricsSystem .timer(MetricKey.MASTER_JOURNAL_FLUSH_TIMER.getName()).time()) { mJournalWriter.flush(); } JournalUtils.sinkFlush(mJournalSinks); mFlushCounter.set(mWriteCounter); } Iterator<FlushTicket> ticketIterator = mTicketSet.iterator(); while (ticketIterator.hasNext()) { FlushTicket ticket = ticketIterator.next(); if (ticket.getTargetCounter() <= mFlushCounter.get()) { ticket.setCompleted(); ticketIterator.remove(); } } } catch (IOException | JournalClosedException exc) { <START> LOG.debug("Failed to flush journal entry", exc); <END> Metrics.JOURNAL_FLUSH_FAILURE.inc(); Iterator<FlushTicket> ticketIterator = mTicketSet.iterator(); while (ticketIterator.hasNext()) { FlushTicket ticket = ticketIterator.next(); ticketIterator.remove(); if (ticket.getTargetCounter() <= mFlushCounter.get()) { ticket.setCompleted(); } else { ticket.setError(exc); } } } } }</code><technical_language>(nit) consider SamplingLogger if error frequently</technical_language>

Target:
private void doFlush() { while (!mStopFlushing) { while (mQueue.isEmpty() && !mStopFlushing) { try { if (mFlushSemaphore.tryAcquire(mFlushBatchTimeNs, TimeUnit.NANOSECONDS)) { break; } } catch (InterruptedException ie) { break; } } try { long startTime = System.nanoTime(); while (!mQueue.isEmpty()) { JournalEntry entry = mQueue.peek(); if (entry == null) { break; } mJournalWriter.write(entry); JournalUtils.sinkAppend(mJournalSinks, entry); mQueue.poll(); mWriteCounter++; if (((System.nanoTime() - startTime) >= mFlushBatchTimeNs) && !mStopFlushing) { break; } } if (mFlushCounter.get() < mWriteCounter) { try (Timer.Context ctx = MetricsSystem .timer(MetricKey.MASTER_JOURNAL_FLUSH_TIMER.getName()).time()) { mJournalWriter.flush(); } JournalUtils.sinkFlush(mJournalSinks); mFlushCounter.set(mWriteCounter); } Iterator<FlushTicket> ticketIterator = mTicketSet.iterator(); while (ticketIterator.hasNext()) { FlushTicket ticket = ticketIterator.next(); if (ticket.getTargetCounter() <= mFlushCounter.get()) { ticket.setCompleted(); ticketIterator.remove(); } } } catch (IOException | JournalClosedException exc) { SAMPLING_LOG.warn("Failed to flush journal entry: " + exc.getMessage(), exc); Metrics.JOURNAL_FLUSH_FAILURE.inc(); Iterator<FlushTicket> ticketIterator = mTicketSet.iterator(); while (ticketIterator.hasNext()) { FlushTicket ticket = ticketIterator.next(); ticketIterator.remove(); if (ticket.getTargetCounter() <= mFlushCounter.get()) { ticket.setCompleted(); } else { ticket.setError(exc); } } } } }
Source:
<code>public String get() { <START> if (volumeOptions == null) { <END> volumeOptions=RO_Z; } if (SystemInfo.isWindows()) { try { final Path cheHome = WindowsHostUtils.ensureCheHomeExist(); final Path terminalPath = cheHome.resolve(TERMINAL); IoUtil.copy(Paths.get(terminalArchivePath).toFile(), terminalPath.toFile(), null, true); return getTargetOptions(terminalPath.toString()); } catch (IOException e) { LOG.warn(e.getMessage()); throw new RuntimeException(e); } } else { return getTargetOptions(terminalArchivePath); } }</code><technical_language>here, a required parameter needs provided handle this</technical_language>

Target:
public String get() { if (SystemInfo.isWindows()) { try { final Path cheHome = WindowsHostUtils.ensureCheHomeExist(); final Path terminalPath = cheHome.resolve(TERMINAL); IoUtil.copy(Paths.get(terminalArchivePath).toFile(), terminalPath.toFile(), null, true); return getTargetOptions(terminalPath.toString()); } catch (IOException e) { LOG.warn(e.getMessage()); throw new RuntimeException(e); } } else { return getTargetOptions(terminalArchivePath); } }
Source:
<code>public static @NonNull HttpConnection getLfsContentConnection( Repository repo, Protocol.Action action, String method) throws IOException { URL contentUrl = new URL(action.href); HttpConnection contentServerConn = HttpTransport.getConnectionFactory() .create(contentUrl, HttpSupport .proxyFor(ProxySelector.getDefault(), contentUrl)); contentServerConn.setRequestMethod(method); action.header .forEach((k, v) -> contentServerConn.setRequestProperty(k, v)); if <START> (contentUrl.getProtocol().equals("https") END> && !repo.getConfig().getBoolean(HttpConfig.HTTP, HttpConfig.SSL_VERIFY_KEY, true)) { HttpSupport.disableSslVerify(contentServerConn); } contentServerConn.setRequestProperty(HDR_ACCEPT_ENCODING, ENCODING_GZIP); return contentServerConn; }</code><technical_language>constant</technical_language>

Target:
public static @NonNull HttpConnection getLfsContentConnection( Repository repo, Protocol.Action action, String method) throws IOException { URL contentUrl = new URL(action.href); HttpConnection contentServerConn = HttpTransport.getConnectionFactory() .create(contentUrl, HttpSupport .proxyFor(ProxySelector.getDefault(), contentUrl)); contentServerConn.setRequestMethod(method); action.header .forEach((k, v) -> contentServerConn.setRequestProperty(k, v)); if (contentUrl.getProtocol().equals(SCHEME_HTTPS) && !repo.getConfig().getBoolean(HttpConfig.HTTP, HttpConfig.SSL_VERIFY_KEY, true)) { HttpSupport.disableSslVerify(contentServerConn); } contentServerConn.setRequestProperty(HDR_ACCEPT_ENCODING, ENCODING_GZIP); return contentServerConn; }
Source:
<code>public void testRefreshTokenConverter() { final String clientId = System.getenv(AAD_MULTI_TENANT_CLIENT_ID); final String clientSecret = System.getenv(AAD_MULTI_TENANT_CLIENT_SECRET); try (AppRunner app = new AppRunner(DumbApp.class)) { ChromeOptions options = new ChromeOptions(); options.addArguments("--incognito"); options.addArguments("--headless"); options.addArguments("--no-sandbox"); options.addArguments("--disable-dev-shm-usage"); WebDriver driver = new ChromeDriver(options); WebDriverWait wait = new WebDriverWait(driver, 10); app.property("azure.activedirectory.client-id", clientId); app.property("azure.activedirectory.client-secret", clientSecret); app.property("azure.activedirectory.user-group.allowed-groups", "group1,group2"); app.property("azure.activedirectory.authorization.office.scopes", "<LINK_0>"); <START> app.start(); <END> try { driver.get(app.root() + "api/getAccessToken"); wait.until(presenceOfElementLocated(By.name("loginfmt"))) .sendKeys(System.getenv(AAD_USER_NAME_1) + Keys.ENTER); Thread.sleep(10000); driver.findElement(By.name("passwd")) .sendKeys(System.getenv(AAD_USER_PASSWORD_1) + Keys.ENTER); Thread.sleep(10000); driver.findElement(By.cssSelector("input[type='submit']")).click(); Thread.sleep(10000); Assert.assertTrue(driver.findElement(By.tagName("body")).getText().indexOf("profile") < 0); Assert.assertTrue(driver.findElement(By.tagName("body")).getText().indexOf("<LINK_0>") >= 0); } catch (InterruptedException e) { throw new RuntimeException(e); } finally { driver.quit(); } } }</code><technical_language>reuse this part of code</technical_language>

Target:
public void testRefreshTokenConverter() { try (AppRunner app = new AppRunner(DumbApp.class)) { OAuthLoginUtils.addProperty(app); app.property("azure.activedirectory.authorization.office.scopes", "<LINK_0>"); List<String> endPoints = new ArrayList<>(); endPoints.add("api/accessTokenScopes"); List<String> result = OAuthLoginUtils.get(app , endPoints); Assert.assertTrue(result.get(0).indexOf("profile") < 0); Assert.assertTrue(result.get(0).indexOf("<LINK_0>") >= 0); } }
Source:
<code><START> @Override public String toString(){ <END> return NAME; }</code><technical_language>style: stick this bottom of class for neatness, forget move @override line</technical_language>

Target:
public String toString(){ return NAME; }
Source:
<code>public <ReqT, RespT> ClientCall<ReqT, RespT> interceptCall(MethodDescriptor<ReqT, RespT> method, final CallOptions callOptions, Channel next) { return new SimpleForwardingClientCall<ReqT, RespT>(next.newCall(method, callOptions)) { private volatile boolean unauthorized = false; @Override public void start(Listener<RespT> responseListener, Metadata headers) { int timeoutSeconds = TIMEOUT_SECONDS; if (callOptions.getDeadline() != null) { long deadlineMs = callOptions.getDeadline().timeRemaining(TimeUnit.MILLISECONDS); <START> int deadlineSeconds = (int) Math.round(deadlineMs / 1000.0); <END> timeoutSeconds = Math.min(deadlineSeconds, timeoutSeconds); } HeaderToken token = store.getHeader(timeoutSeconds); if (!token.getStatus().isOk()) { unauthorized = true; responseListener.onClose(token.getStatus(), new Metadata()); return; } headers.put(AUTHORIZATION_HEADER_KEY, token.getHeader()); delegate().start(new UnAuthResponseListener<>(responseListener, token), headers); } @Override public void request(int numMessages) { if (!unauthorized) { delegate().request(numMessages); } } @Override public void sendMessage(ReqT message) { if (!unauthorized) { delegate().sendMessage(message); } } @Override public void halfClose() { if (!unauthorized) { delegate().halfClose(); } } @Override public void cancel(String message, Throwable cause) { if (!unauthorized) { delegate().cancel(message, cause); } } }; }</code><technical_language>I deadlines in ms</technical_language>

Target:
public <ReqT, RespT> ClientCall<ReqT, RespT> interceptCall(MethodDescriptor<ReqT, RespT> method, final CallOptions callOptions, Channel next) { return new SimpleForwardingClientCall<ReqT, RespT>(next.newCall(method, callOptions)) { private volatile boolean unauthorized = false; @Override public void start(Listener<RespT> responseListener, Metadata headers) { long timeoutMs = -1; if (callOptions.getDeadline() != null) { timeoutMs = callOptions.getDeadline().timeRemaining(TimeUnit.MILLISECONDS); } else { timeoutMs = TimeUnit.SECONDS.toMillis(TIMEOUT_SECONDS); } HeaderToken token = store.getHeader(timeoutMs); if (!token.getStatus().isOk()) { unauthorized = true; responseListener.onClose(token.getStatus(), new Metadata()); return; } headers.put(AUTHORIZATION_HEADER_KEY, token.getHeader()); delegate().start(new UnAuthResponseListener<>(responseListener, token), headers); } @Override public void request(int numMessages) { if (!unauthorized) { delegate().request(numMessages); } } @Override public void sendMessage(ReqT message) { if (!unauthorized) { delegate().sendMessage(message); } } @Override public void halfClose() { if (!unauthorized) { delegate().halfClose(); } } @Override public void cancel(String message, Throwable cause) { if (!unauthorized) { delegate().cancel(message, cause); } } }; }
Source:
<code>public void shouldAlertGivenFunctionInHtmlScriptElements() throws HttpMalformedHeaderException, URIException { String body = "<h1>Some text <script>Some Html Element bypassSecurityTrustHtml()</script></h1>\n" + "<b>No script here</b>\n"; HttpMessage msg = createHttpMessageWithRespBody(body, "text/html;charset=ISO-8859-1"); <START> assertTrue(msg.getResponseHeader().isText()); <END> assertFalse(msg.getResponseHeader().isJavaScript()); rule.scanHttpResponseReceive(msg, -1, createSource(msg)); assertThat(alertsRaised, hasSize(1)); }</code><technical_language>(this line following) specific assertions</technical_language>

Target:
public void shouldAlertGivenFunctionInHtmlScriptElements() throws HttpMalformedHeaderException, URIException { String body = "<h1>Some text <script>Some Html Element bypassSecurityTrustHtml()</script></h1>\n" + "<b>No script here</b>\n"; HttpMessage msg = createHttpMessageWithRespBody(body, "text/html;charset=ISO-8859-1"); rule.scanHttpResponseReceive(msg, -1, createSource(msg)); assertThat(alertsRaised, hasSize(1)); assertEquals("bypassSecurityTrustHtml", alertsRaised.get(0).getEvidence()); }
Source:
<code>public BucketFunction getBucketFunction( ConnectorTransactionHandle transactionHandle, ConnectorSession session, ConnectorPartitioningHandle partitioningHandle, List<Type> partitionChannelTypes, int bucketCount) { HivePartitioningHandle handle = (HivePartitioningHandle) partitioningHandle; <START> return new HiveBucketFunction(bucketCount, handle.getHiveTypes(), handle.getTypes()); <END> }</code><technical_language>This partitionChannelTypes</technical_language>

Target:
public BucketFunction getBucketFunction( ConnectorTransactionHandle transactionHandle, ConnectorSession session, ConnectorPartitioningHandle partitioningHandle, List<Type> partitionChannelTypes, int bucketCount) { HivePartitioningHandle handle = (HivePartitioningHandle) partitioningHandle; BucketFunctionType bucketFunctionType = handle.getBucketFunctionType(); switch (bucketFunctionType) { case HIVE_COMPATIBLE: return createHiveCompatibleBucketFunction(bucketCount, handle.getHiveTypes().get()); case PRESTO_NATIVE: return createPrestoNativeBucketFunction(bucketCount, handle.getTypes().get()); default: throw new IllegalArgumentException("Unsupported bucket function type " + bucketFunctionType); } }
Source:
<code>public PageRenderUtil( final IHTMLPage htmlPage, final User user, final PageMode mode, final long languageId, final Host site) throws DotSecurityException, DotDataException { <START> this.site = null == site? APILocator.getHostAPI().findDefaultHost(user, mode.respectAnonPerms):site; <END> this.pageFoundTags = Lists.newArrayList(); this.htmlPage = htmlPage; this.user = user; this.mode = mode; this.languageId=languageId; this.widgetPreExecute = new StringBuilder(); final Template template = APILocator.getHTMLPageAssetAPI().getTemplate(htmlPage, !mode.showLive); this.templateLayout = template != null && template.isDrawed() ? DotTemplateTool.themeLayout(template.getInode()) : null; this.contextMap = populateContext(); this.containersRaw = populateContainers(); }</code><technical_language>I more readable</technical_language>

Target:
public PageRenderUtil( final IHTMLPage htmlPage, final User user, final PageMode mode, final long languageId, final Host site) throws DotSecurityException, DotDataException { if (site == null) { this.site = APILocator.getHostAPI().findDefaultHost(user, mode.respectAnonPerms); } else { this.site = site; } this.pageFoundTags = Lists.newArrayList(); this.htmlPage = htmlPage; this.user = user; this.mode = mode; this.languageId=languageId; this.widgetPreExecute = new StringBuilder(); final Template template = APILocator.getHTMLPageAssetAPI().getTemplate(htmlPage, !mode.showLive); this.templateLayout = template != null && template.isDrawed() ? DotTemplateTool.themeLayout(template.getInode()) : null; this.contextMap = populateContext(); this.containersRaw = populateContainers(); }
Source:
<code>public static void main(String... args) throws IOException { MockWebServer server = new MockWebServer(); server.start(); server.enqueue(new MockResponse().setBody("{\"name\": \"jason\"}")); <START> server.enqueue(new MockResponse().setBody("<user name=\"Eximel\"/>")); <END> Retrofit retrofit = new Retrofit.Builder() .baseUrl(server.url("/")) .addConverterFactory(new QualifiedTypeConverterFactory( GsonConverterFactory.create(), SimpleXmlConverterFactory.create())) .build(); Service service = retrofit.create(Service.class); User user1 = service.exampleJson().execute().body(); System.out.println("User 1: " + user1.name); User user2 = service.exampleXml().execute().body(); System.out.println("User 2: " + user2.name); server.shutdown(); }</code><technical_language>Cute example</technical_language>

Target:
public static void main(String... args) throws IOException { MockWebServer server = new MockWebServer(); server.start(); server.enqueue(new MockResponse().setBody("{\"name\": \"Jason\"}")); server.enqueue(new MockResponse().setBody("<user name=\"Eximel\"/>")); Retrofit retrofit = new Retrofit.Builder() .baseUrl(server.url("/")) .addConverterFactory(new QualifiedTypeConverterFactory( GsonConverterFactory.create(), SimpleXmlConverterFactory.create())) .build(); Service service = retrofit.create(Service.class); User user1 = service.exampleJson().execute().body(); System.out.println("User 1: " + user1.name); User user2 = service.exampleXml().execute().body(); System.out.println("User 2: " + user2.name); server.shutdown(); }
Source:
<code>protected void writeRequested(ChannelPipeline pipeline, MessageEvent evt) throws Exception { if (LOGGER.isDebugEnabled()) { LOGGER.debug("writeRequested pipeline = " + pipeline + " evt = " + evt); } ChannelBuffer channelBuffer = (ChannelBuffer) evt.getMessage(); writeBuffer.writeBytes(channelBuffer); ChannelFuture writeFuture = evt.getFuture(); <START> writeFuture.setSuccess(); <END> }</code><technical_language>if is insufficient space end of file accommodate write request</technical_language>

Target:
protected void writeRequested(ChannelPipeline pipeline, MessageEvent evt) throws Exception { if (LOGGER.isDebugEnabled()) { LOGGER.debug("writeRequested pipeline = " + pipeline + " evt = " + evt); } ChannelBuffer channelBuffer = (ChannelBuffer) evt.getMessage(); FileChannel fileChannel = (FileChannel) evt.getChannel(); ChannelFuture writeFuture = evt.getFuture(); try { fileChannel.write(channelBuffer); writeFuture.setSuccess(); } catch (Throwable t) { writeFuture.setFailure(t); } }
Source:
<code>public ModelAndView viewSequencer(@PathVariable(value = "referenceId") Long referenceId, ModelMap model) throws IOException { SequencerReference sr = requestManager.getSequencerReferenceById(referenceId); Collection<Run> runs = requestManager.listRunsBySequencerId(referenceId); Collection<SequencerServiceRecord> serviceRecords = requestManager.listSequencerServiceRecordsBySequencerId(referenceId); Collection<SequencerReference> otherSequencers = requestManager.listAllSequencerReferences(); SequencerReference sameRef = null; for (SequencerReference ref : otherSequencers) { if (ref.getId() == sr.getId()) { sameRef = ref; break; } } otherSequencers.remove(sameRef); if (sr != null) { model.put("sequencerReference", sr); model.put("sequencerRuns", runs); model.put("sequencerServiceRecords", serviceRecords); <START> model.put("otherSequencerReferences", otherSequencers); <END> String ip = sr.getIpAddress() == null ? "" : sr.getIpAddress().toString(); if (ip.startsWith("/")) { model.put("trimmedIpAddress", ip.substring(1)); } else { model.put("trimmedIpAddress", ip); } } else { throw new IOException("Cannot retrieve the named Sequencer reference"); } return new ModelAndView("/pages/editSequencerReference.jsp", model); }</code><technical_language>more magic strings :sparkles: defining encourage reuse</technical_language>

Target:
public ModelAndView viewSequencer(@PathVariable(value = "referenceId") Long referenceId, ModelMap model) throws IOException { SequencerReference sr = requestManager.getSequencerReferenceById(referenceId); if (sr != null) { Collection<Run> runs = requestManager.listRunsBySequencerId(referenceId); Collection<SequencerServiceRecord> serviceRecords = requestManager.listSequencerServiceRecordsBySequencerId(referenceId); Collection<SequencerReference> otherSequencers = getOtherSequencers(sr.getId()); model.put(ModelKeys.SEQUENCER.getKey(), sr); model.put(ModelKeys.RUNS.getKey(), runs); model.put(ModelKeys.RECORDS.getKey(), serviceRecords); model.put(ModelKeys.OTHER_SEQUENCERS.getKey(), otherSequencers); String ip = sr.getIpAddress() == null ? "" : sr.getIpAddress().toString(); if (ip.startsWith("/")) { model.put(ModelKeys.TRIMMED_IP.getKey(), ip.substring(1)); } else { model.put(ModelKeys.TRIMMED_IP.getKey(), ip); } } else { throw new IOException("Cannot retrieve the named Sequencer reference"); } return new ModelAndView("/pages/editSequencerReference.jsp", model); }
Source:
<code>public void init(Map<String, String> props, Schema indexingSchema, String topicName) throws Exception { checkState(props.containsKey(SCHEMA_REGISTRY_REST_URL), "Missing required property '%s'", SCHEMA_REGISTRY_REST_URL); String schemaRegistryUrl = props.get(SCHEMA_REGISTRY_REST_URL); <START> requireNonNull(indexingSchema, "indexingSchema is null"); <END> _sourceFieldNames = SourceFieldNameExtractor.extract(indexingSchema); SchemaRegistryClient schemaRegistryClient = new CachedSchemaRegistryClient(schemaRegistryUrl, 1000); deserializer = new KafkaAvroDeserializer(schemaRegistryClient); this.topicName = requireNonNull(topicName, "topicName is null"); this.avroRecordConverter = PluginManager.get().createInstance(AvroRecordExtractor.class.getName()); }</code><technical_language>suggestion Preconditions.checkState(indexingSchema != null, "Schema provided"); remove static import</technical_language>

Target:
public void init(Map<String, String> props, Schema indexingSchema, String topicName) throws Exception { checkState(props.containsKey(SCHEMA_REGISTRY_REST_URL), "Missing required property '%s'", SCHEMA_REGISTRY_REST_URL); String schemaRegistryUrl = props.get(SCHEMA_REGISTRY_REST_URL); Preconditions.checkNotNull(indexingSchema, "Schema must be provided"); Set<String> sourceFields = SchemaFieldExtractorUtils.extract(indexingSchema); SchemaRegistryClient schemaRegistryClient = new CachedSchemaRegistryClient(schemaRegistryUrl, 1000); _deserializer = new KafkaAvroDeserializer(schemaRegistryClient); Preconditions.checkNotNull(topicName, "Topic must be provided"); _topicName = topicName; _avroRecordExtractor = PluginManager.get().createInstance(AvroRecordExtractor.class.getName()); _avroRecordExtractor.init(sourceFields, null); }
Source:
<code>public Object getCellValue(Cell cell, EStructuralFeature eStructuralFeature) throws EMFFormsConverterException { final EAttribute eAttribute = EAttribute.class.cast(eStructuralFeature); if (cell.getCellType() == Cell.CELL_TYPE_BLANK) { return null; } if (eAttribute == null) { return null; } final EDataType attributeType = eAttribute.getEAttributeType(); if (attributeType == null) { return null; } try { return readCellValue(cell, attributeType); } catch (final IllegalStateException e) { throw new EMFFormsConverterException( String.format("Cell value of column %1$s in row %2$s on sheet %3$s must be a string.", cell.getColumnIndex() + 1, cell.getRowIndex() + 1, cell.getSheet().getSheetName()), e); } catch (final NumberFormatException e) { throw new EMFFormsConverterException( <START> String.format("Cell value of column %1$s in row %2$s on sheet %3$s must be a string.", END> cell.getColumnIndex() + 1, cell.getRowIndex() + 1, cell.getSheet().getSheetName()), e); } }</code><technical_language>String catching a NumberFormatException</technical_language>

Target:
public Object getCellValue(Cell cell, EStructuralFeature eStructuralFeature) throws EMFFormsConverterException { final EAttribute eAttribute = EAttribute.class.cast(eStructuralFeature); if (cell.getCellType() == Cell.CELL_TYPE_BLANK) { return null; } if (eAttribute == null) { return null; } final EDataType attributeType = eAttribute.getEAttributeType(); if (attributeType == null) { return null; } try { return readCellValue(cell, attributeType); } catch (final IllegalStateException e) { throw new EMFFormsConverterException( String.format("Cell value of column %1$s in row %2$s on sheet %3$s must be a string.", cell.getColumnIndex() + 1, cell.getRowIndex() + 1, cell.getSheet().getSheetName()), e); } catch (final NumberFormatException e) { throw new EMFFormsConverterException( String.format("Cell value of column %1$s in row %2$s on sheet %3$s is not a valud number.", cell.getColumnIndex() + 1, cell.getRowIndex() + 1, cell.getSheet().getSheetName()), e); } }
Source:
<code>private boolean validInputs(String name, String groupType) { <START> return (name != null) && (groupType != null); <END> }</code><technical_language>StringUtils.hasText(name) && StringUtils.hasText(groupType)</technical_language>

Target:
private boolean validInputs(String name, String groupType) { return hasText(name) && hasText(groupType); }
Source:
<code>public String getString(int columnIndex) throws SQLException { connection.getLogger().log(Level.FINEST, " getString columnIndex: {0}", columnIndex); checkResultSet(columnIndex); if (wasNullFlag) { return null; } if (isBinary(columnIndex) && getSQLType(columnIndex) != Types.VARCHAR) { Field field = fields[columnIndex - 1]; Object obj = internalGetObject(columnIndex, field); if (obj == null) { obj = getObject(columnIndex); if (obj == null) { return null; } <START> return getObject(columnIndex).toString(); <END> } if (obj instanceof java.util.Date) { int oid = field.getOID(); return connection.getTimestampUtils().timeToString((java.util.Date) obj, oid == Oid.TIMESTAMPTZ || oid == Oid.TIMETZ); } if ("hstore".equals(getPGType(columnIndex))) { return HStoreConverter.toString((Map<?, ?>) obj); } return trimString(columnIndex, obj.toString()); } Encoding encoding = connection.getEncoding(); try { return trimString(columnIndex, encoding.decode(this_row[columnIndex - 1])); } catch (IOException ioe) { throw new PSQLException( GT.tr( "Invalid character data was found. This is most likely caused by stored data containing characters that are invalid for the character set the database was created in. The most common example of this is storing 8bit data in a SQL_ASCII database."), PSQLState.DATA_ERROR, ioe); } }</code><technical_language>This odd: is calling getObject twice</technical_language>

Target:
public String getString(int columnIndex) throws SQLException { connection.getLogger().log(Level.FINEST, " getString columnIndex: {0}", columnIndex); checkResultSet(columnIndex); if (wasNullFlag) { return null; } if (isBinary(columnIndex) && getSQLType(columnIndex) != Types.VARCHAR) { Field field = fields[columnIndex - 1]; Object obj = internalGetObject(columnIndex, field); if (obj == null) { obj = getObject(columnIndex); if (obj == null) { return null; } return obj.toString(); } if (obj instanceof java.util.Date) { int oid = field.getOID(); return connection.getTimestampUtils().timeToString((java.util.Date) obj, oid == Oid.TIMESTAMPTZ || oid == Oid.TIMETZ); } if ("hstore".equals(getPGType(columnIndex))) { return HStoreConverter.toString((Map<?, ?>) obj); } return trimString(columnIndex, obj.toString()); } Encoding encoding = connection.getEncoding(); try { return trimString(columnIndex, encoding.decode(this_row[columnIndex - 1])); } catch (IOException ioe) { throw new PSQLException( GT.tr( "Invalid character data was found. This is most likely caused by stored data containing characters that are invalid for the character set the database was created in. The most common example of this is storing 8bit data in a SQL_ASCII database."), PSQLState.DATA_ERROR, ioe); } }
Source:
<code>public static String response(final String authHeaderAlgorithm, final String user, final String realm, final String password, final String clientPasswordAlgorithm, final String nonce, final String nc, final String cnonce, final String method, final String uri, String body, final String qop) { validate(user, realm, password, nonce, method, uri, authHeaderAlgorithm); String ha1; <START> if (clientPasswordAlgorithm.equalsIgnoreCase(RestcommConfiguration.getInstance().getMain().getClearTextPasswordAlgorithm())) { <END> final String a1 = A1(authHeaderAlgorithm, user, realm, password, nonce, cnonce); ha1 = H(a1, authHeaderAlgorithm); } else { ha1 = password; } final String a2 = A2(authHeaderAlgorithm, method, uri, body, qop); if (cnonce != null && qop != null && nc != null && (qop.equalsIgnoreCase("auth") || qop.equalsIgnoreCase("auth-int"))) { return KD(ha1, nonce + ":" + nc + ":" + cnonce + ":" + qop + ":" + H(a2, authHeaderAlgorithm), authHeaderAlgorithm); } else { return KD(ha1, nonce + ":" + H(a2, authHeaderAlgorithm), authHeaderAlgorithm); } }</code><technical_language>do need a configuration setting set token for ClearText algorithm</technical_language>

Target:
public static String response(final String authHeaderAlgorithm, final String user, final String realm, final String password, final String clientPasswordAlgorithm, final String nonce, final String nc, final String cnonce, final String method, final String uri, String body, final String qop) { validate(user, realm, password, nonce, method, uri, authHeaderAlgorithm); String ha1; if (clientPasswordAlgorithm.equalsIgnoreCase("cleartext")) { final String a1 = A1(authHeaderAlgorithm, user, realm, password, nonce, cnonce); ha1 = H(a1, authHeaderAlgorithm); } else { ha1 = password; } final String a2 = A2(authHeaderAlgorithm, method, uri, body, qop); if (cnonce != null && qop != null && nc != null && (qop.equalsIgnoreCase("auth") || qop.equalsIgnoreCase("auth-int"))) { return KD(ha1, nonce + ":" + nc + ":" + cnonce + ":" + qop + ":" + H(a2, authHeaderAlgorithm), authHeaderAlgorithm); } else { return KD(ha1, nonce + ":" + H(a2, authHeaderAlgorithm), authHeaderAlgorithm); } }
Source:
<code>private void addSenderUserPhotoLinkIfAvailable(MessageDto message) { <START> if (message.getSenderUserPhotoId().isPresent()) <END> { message.add( UserPhotoController.getUserPhotoLinkBuilder(message.getSenderUserPhotoId().get()).withRel("userPhoto")); } }</code><technical_language>This done simpler. refactored addSenderBuddyLinkIfAvailable example: private void addSenderBuddyLinkIfAvailable(MessageDto message) { message.getSenderBuddyId().ifPresent(buddyId -> message.add( BuddyController.getBuddyLinkBuilder(goalIdMapping.getUserId(), buddyId).withRel(BuddyController.BUDDY_LINK))); }</technical_language>

Target:
private void addSenderUserPhotoLinkIfAvailable(MessageDto message) { message.getSenderUserPhotoId().ifPresent( userPhotoId -> message.add(UserPhotoController.getUserPhotoLinkBuilder(userPhotoId).withRel("userPhoto"))); }
Source:
<code>protected void executeIrsBrokerCommand() { StorageDomainHelper.checkNumberOfLVsForBlockDomain(getParameters().getStorageDomainId()); setReturnValue(Guid.Empty); log.info("-- executeIrsBrokerCommand: calling 'createVolume' with two new parameters: description and UUID"); String imageInitSize = null; if (getParameters().getImageInitialSizeInBytes() != 0) { imageInitSize = <START> Long.valueOf(getParameters().getImageInitialSizeInBytes()).toString(); <END> } uuidReturn = getIrsProxy().createVolume(getParameters().getStorageDomainId().toString(), getParameters().getStoragePoolId().toString(), getParameters().getImageGroupId().toString(), Long.valueOf(getParameters().getImageSizeInBytes()).toString(), getParameters().getVolumeFormat().getValue(), getParameters().getImageType().getValue(), 2, getParameters().getNewImageID().toString(), getParameters().getNewImageDescription(), getParameters().getSourceImageGroupId().toString(), getParameters().getImageId().toString(), imageInitSize); proceedProxyReturnValue(); Guid taskID = new Guid(uuidReturn.uuid); createdImageId = getParameters().getNewImageID().toString(); setReturnValue(new Guid(createdImageId)); getVDSReturnValue().setCreationInfo( new AsyncTaskCreationInfo(taskID, AsyncTaskType.createVolume, getParameters().getStoragePoolId())); }</code><technical_language>String.valueOf(getParameters().getImageInitialSizeInBytes())</technical_language>

Target:
protected void executeIrsBrokerCommand() { StorageDomainHelper.checkNumberOfLVsForBlockDomain(getParameters().getStorageDomainId()); setReturnValue(Guid.Empty); log.info("-- executeIrsBrokerCommand: calling 'createVolume' with two new parameters: description and UUID"); String imageInitSize = null; if (getParameters().getImageInitialSizeInBytes() != 0) { imageInitSize = String.valueOf(getParameters().getImageInitialSizeInBytes()); } uuidReturn = getIrsProxy().createVolume(getParameters().getStorageDomainId().toString(), getParameters().getStoragePoolId().toString(), getParameters().getImageGroupId().toString(), Long.valueOf(getParameters().getImageSizeInBytes()).toString(), getParameters().getVolumeFormat().getValue(), getParameters().getImageType().getValue(), 2, getParameters().getNewImageID().toString(), getParameters().getNewImageDescription(), getParameters().getSourceImageGroupId().toString(), getParameters().getImageId().toString(), imageInitSize); proceedProxyReturnValue(); Guid taskID = new Guid(uuidReturn.uuid); createdImageId = getParameters().getNewImageID().toString(); setReturnValue(new Guid(createdImageId)); getVDSReturnValue().setCreationInfo( new AsyncTaskCreationInfo(taskID, AsyncTaskType.createVolume, getParameters().getStoragePoolId())); }
Source:
<code>public void handleRequest(HttpServerExchange exchange) throws Exception { <START> exchange.getResponseSender().send(exchange.getSourceAddress() + "|" + exchange.getRequestScheme() + "|" <END> + exchange.getDestinationAddress()); next.handleRequest(exchange); }</code><technical_language>This is valid, response sender in this exchange ended, next handler operating a completed exchange, if want send this information do in a header</technical_language>

Target:
public void handleRequest(HttpServerExchange exchange) throws Exception { String value = exchange.getSourceAddress() + "|" + exchange.getRequestScheme() + "|" + exchange.getDestinationAddress(); exchange.getResponseHeaders().put(new HttpString(FORWARD_TEST_HEADER), value); next.handleRequest(exchange); }
Source:
<code>public double getPercentCopied() { if (pathInfo == null) { <START> return -1; <END> } if(pathInfo.getTotalSize() == 0) { return 0.0; } else { return (double) (totalBytesTransferred * 100) / (double) pathInfo.getTotalSize(); } }</code><technical_language>return type is double -1.0D</technical_language>

Target:
public double getPercentCopied() { if (pathInfo == null) { return -1.0; } if(pathInfo.getTotalSize() == 0) { return 0.0; } else { return (double) (totalBytesTransferred * 100) / (double) pathInfo.getTotalSize(); } }
Source:
<code>private void runPatchMetadataTests(EPerson asUser, int expectedStatus) throws Exception { context.turnOffAuthorisationSystem(); parentCommunity = CommunityBuilder.createCommunity(context).withName("Parent Community").build(); Community child1 = CommunityBuilder.createSubCommunity(context, parentCommunity) .withName("Sub Community").build(); Collection col1 = CollectionBuilder.createCollection(context, child1).withName("Collection 1").build(); <START> Item item = ItemBuilder.createItem(context, col1).build(); <END> String token = getAuthToken(asUser.getEmail(), password); new MetadataPatchSuite().runWith(getClient(token), "/api/core/items/" + item.getID(), expectedStatus); }</code><technical_language>Again, needs a context.restoreAuthSystemState();</technical_language>

Target:
private void runPatchMetadataTests(EPerson asUser, int expectedStatus) throws Exception { context.turnOffAuthorisationSystem(); parentCommunity = CommunityBuilder.createCommunity(context).withName("Parent Community").build(); Community child1 = CommunityBuilder.createSubCommunity(context, parentCommunity) .withName("Sub Community").build(); Collection col1 = CollectionBuilder.createCollection(context, child1).withName("Collection 1").build(); Item item = ItemBuilder.createItem(context, col1).build(); context.restoreAuthSystemState(); String token = getAuthToken(asUser.getEmail(), password); new MetadataPatchSuite().runWith(getClient(token), "/api/core/items/" + item.getID(), expectedStatus); }
Source:
<code>public ParquetProperties(int dictPageSize, WriterVersion writerVersion, boolean enableDict, ByteBufferAllocator allocator) { this.dictionaryPageSizeThreshold = dictPageSize; this.writerVersion = writerVersion; this.enableDictionary = enableDict; <START> this.allocator = allocator != null ? allocator : new HeapByteBufferAllocator(); <END> }</code><technical_language>enforce parameter is null. default is provided other constructor</technical_language>

Target:
public ParquetProperties(int dictPageSize, WriterVersion writerVersion, boolean enableDict, ByteBufferAllocator allocator) { this.dictionaryPageSizeThreshold = dictPageSize; this.writerVersion = writerVersion; this.enableDictionary = enableDict; Preconditions.checkNotNull(allocator, "ByteBufferAllocator"); this.allocator = allocator; }
Source:
<code>public void run() { String command = null; while (running) { try { if (color) { command = reader.readLine(colorize(ChatColor.RESET.toString()) + CONSOLE_PROMPT); } else { command = reader.readLine(CONSOLE_PROMPT); } if (command != null && !(command = command.trim()).isEmpty()) { reader.getTerminal().writer().println(colorize(ChatColor.RESET + "====" + ChatColor.GOLD + "g>" + ChatColor.RESET + '"' + command + '"')); if (command.startsWith("$")) { server.getScheduler().runTask(null, <START> new EvalTask(command.substring(1), command.startsWith("$$"))); <END> } else if (command.startsWith("!")) { server.getScheduler() .runTask(null, new ConsoleTask(command.substring(1))); } else { server.getScheduler().runTask(null, new CommandTask(command)); } } } catch (CommandException ex) { LocalizedStrings.Console.Error.Manager.COMMAND.log(ex, command); } catch (Exception ex) { LocalizedStrings.Console.Error.Manager.COMMAND_READ.log(ex); } } }</code><technical_language>Add a config setting disables this mode. Disable default, break mod compatibility, then. way, gaining control of console allow arbitrary code execution if legit admin it</technical_language>

Target:
public void run() { String command = null; while (running) { try { if (color) { command = reader.readLine(colorize(ChatColor.RESET.toString()) + CONSOLE_PROMPT); } else { command = reader.readLine(CONSOLE_PROMPT); } if (command != null && !(command = command.trim()).isEmpty()) { reader.getTerminal().writer().println(colorize(String.format( "%s====%sg>%s\"%s\"", ChatColor.RESET, ChatColor.GOLD, ChatColor.RESET, command))); server.getScheduler().runTask(null, new CommandTask(command)); } } catch (CommandException ex) { ConsoleMessages.Warn.Manager.COMMAND.log(ex, command); } catch (Exception ex) { ConsoleMessages.Error.Manager.COMMAND_READ.log(ex); } } }
Source:
<code>protected CommentManager recomputeCommentManager() { MigrationService migrationService = Framework.getService(MigrationService.class); MigrationService.MigrationStatus status = migrationService.getStatus(MIGRATION_ID); if (status == null) { throw new IllegalStateException("Unknown migration status for: " + MIGRATION_ID); } if (status.isRunning()) { String step = status.getStep(); if (Arrays.asList(MIGRATION_STEP_RELATION_TO_PROPERTY, MIGRATION_STEP_PROPERTY_TO_SECURED).contains(step)) { return new BridgeCommentManager(new CommentManagerImpl(config), new PropertyCommentManager(), new TreeCommentManager()); } else { throw new IllegalStateException("Unknown migration step: " + step); } <START> } else { <END> String state = status.getState(); if (MIGRATION_STATE_RELATION.equals(state)) { return new CommentManagerImpl(config); } else if (MIGRATION_STATE_PROPERTY.equals(state)) { return new PropertyCommentManager(); } else if (MIGRATION_STATE_SECURED.equals(state)) { return new TreeCommentManager(); } else { throw new IllegalStateException("Unknown migration state: " + state); } } }</code><technical_language>mentioned above, bridges, done times</technical_language>

Target:
protected CommentManager recomputeCommentManager() { MigrationService migrationService = Framework.getService(MigrationService.class); MigrationService.MigrationStatus status = migrationService.getStatus(MIGRATION_ID); if (status == null) { throw new IllegalStateException("Unknown migration status for: " + MIGRATION_ID); } if (status.isRunning()) { String step = status.getStep(); if (MIGRATION_STEP_RELATION_TO_PROPERTY.equals(step)) { return new BridgeCommentManager(new CommentManagerImpl(config), new PropertyCommentManager()); } else if (MIGRATION_STEP_PROPERTY_TO_SECURED.equals(step)) { return new BridgeCommentManager(new PropertyCommentManager(), new TreeCommentManager()); } else { throw new IllegalStateException("Unknown migration step: " + step); } } else { String state = status.getState(); if (MIGRATION_STATE_RELATION.equals(state)) { return new CommentManagerImpl(config); } else if (MIGRATION_STATE_PROPERTY.equals(state)) { return new PropertyCommentManager(); } else if (MIGRATION_STATE_SECURED.equals(state)) { return new TreeCommentManager(); } else { throw new IllegalStateException("Unknown migration state: " + state); } } }
Source:
<code>public Detail( String id, DisplayUnit title, Vector<Detail> details, Vector<DetailField> fields, OrderedHashtable<String, String> variables, Action action, Callout callout ) { this( id, title, ArrayUtilities.copyIntoArray(details, new Detail[details.size()]), <START> ArrayUtilities.copyIntoArray(fields, new DetailField[fields.size()]), <END> variables, action ); this.callout = callout; }</code><technical_language>need call copyIntoArray? vectors passed constructor defined this one</technical_language>

Target:
public Detail( String id, DisplayUnit title, Vector<Detail> details, Vector<DetailField> fields, OrderedHashtable<String, String> variables, Action action, Callout callout ) { this( id, title, details, fields, variables, action ); this.callout = callout; }
Source:
<code>public void testDynamicRoutingKey() throws Exception { runFlow("senderFlow"); MuleMessage result = muleContext.getClient().request("vm://result", 5000); <START> assertNotNull(result); <END> assertEquals(result.getPayloadAsString(), "testedDynamicRoutingKey"); }</code><technical_language>hamcrest</technical_language>

Target:
public void testDynamicRoutingKey() throws Exception { runFlow("senderFlow"); MuleMessage result = muleContext.getClient().request("vm://result", 5000); assertThat(result, is(notNullValue())); assertThat(result.getPayloadAsString(), is("testedDynamicRoutingKey")); }
Source:
<code>public IntraWikiSearchPageObject searchFor(String query) { typeQuery(query); <START> PageObjectLogging.log("searchFor", "searching for query: " + query, true, driver); <END> return clickSearchButton(); }</code><technical_language>logged query in typeQuery()</technical_language>

Target:
public IntraWikiSearchPageObject searchFor(String query) { PageObjectLogging.log("searchFor", "searching for query: " + query, true, driver); typeQuery(query); return clickSearchButton(); }
Source:
<code>public void initVertex() { super.initVertex(); if (outgoingMsg == null) outgoingMsg = new PathMergeMessage(); else outgoingMsg.reset(); <START> RANDOM_SEED = Long.parseLong(getContext().getConfiguration().get(GenomixJobConf.RANDOM_RANDSEED)); END> if (randGenerator == null) randGenerator = new Random(RANDOM_SEED); if (probBeingRandomHead < 0) probBeingRandomHead = Float.parseFloat(getContext().getConfiguration().get( GenomixJobConf.PATHMERGE_RANDOM_PROB_BEING_RANDOM_HEAD)); if (repeatKmer == null) repeatKmer = new VKmer(); tmpValue.reset(); if (getSuperstep() == 1) StatisticsAggregator.preGlobalCounters.clear(); counters.clear(); getVertexValue().getCounters().clear(); }</code><technical_language>GenomixJobConf.RANDOM_RANDSEED GenomixJobConf.RANDOM_SEED</technical_language>

Target:
public void initVertex() { super.initVertex(); if (outgoingMsg == null) outgoingMsg = new PathMergeMessage(); else outgoingMsg.reset(); RANDOM_SEED = Long.parseLong(getContext().getConfiguration().get(GenomixJobConf.RANDOM_SEED)); if (randGenerator == null) randGenerator = new Random(RANDOM_SEED); if (probBeingRandomHead < 0) probBeingRandomHead = Float.parseFloat(getContext().getConfiguration().get( GenomixJobConf.PATHMERGE_RANDOM_PROB_BEING_RANDOM_HEAD)); if (repeatKmer == null) repeatKmer = new VKmer(); tmpValue.reset(); if (getSuperstep() == 1) StatisticsAggregator.preGlobalCounters.clear(); counters.clear(); getVertexValue().getCounters().clear(); }
Source:
<code>private static boolean enabled() { final boolean enabled = CalciteSystemProperty.TEST_CASSANDRA.value(); Bug.upgrade("remove JDK version check once current adapter supports Cassandra 4.x"); <START> final List<Integer> incompatibleJdks = Arrays.asList(11, 12, 13); <END> final boolean compatibleJdk = !incompatibleJdks.contains(TestUtil.getJavaMajorVersion()); return enabled && compatibleJdk; }</code><technical_language>easier do: java final boolean compatibleJdk = TestUtil.getJavaMajorVersion() < 11;</technical_language>

Target:
private static boolean enabled() { final boolean enabled = CalciteSystemProperty.TEST_CASSANDRA.value(); Bug.upgrade("remove JDK version check once current adapter supports Cassandra 4.x"); final boolean compatibleJdk = TestUtil.getJavaMajorVersion() < 11; return enabled && compatibleJdk; }
Source:
<code>private DfsBlockCache(final DfsBlockCacheConfig cfg) { tableSize = tableSize(cfg); if (tableSize < 1) throw new IllegalArgumentException(JGitText.get().tSizeMustBeGreaterOrEqual1); table = new AtomicReferenceArray<HashEntry>(tableSize); loadLocks = new ReentrantLock[cfg.getConcurrencyLevel()]; for (int i = 0; i < loadLocks.length; i++) loadLocks[i] = new ReentrantLock(true ); maxBytes = cfg.getBlockLimit(); maxStreamThroughCache = (long) (maxBytes * cfg.getStreamRatio()); blockSize = cfg.getBlockSize(); <START> if ((blockSize & (blockSize - 1)) != 0) { <END> throw new IllegalArgumentException(JGitText.get().blockSizeNotPowerOf2); } blockSizeShift = Integer.numberOfTrailingZeros(blockSize); clockLock = new ReentrantLock(true ); clockHand = new Ref<Object>(new DfsPackKey(), -1, 0, null); clockHand.next = clockHand; packCache = new ConcurrentHashMap<DfsPackDescription, DfsPackFile>( 16, 0.75f, 1); packFiles = Collections.unmodifiableCollection(packCache.values()); statHit = new AtomicLong(); statMiss = new AtomicLong(); }</code><technical_language>* fail earlier moving this check DfsBlockCacheConfig.setBlockSize() ? * I prevent blockSize == 0</technical_language>

Target:
private DfsBlockCache(final DfsBlockCacheConfig cfg) { tableSize = tableSize(cfg); if (tableSize < 1) throw new IllegalArgumentException(JGitText.get().tSizeMustBeGreaterOrEqual1); table = new AtomicReferenceArray<HashEntry>(tableSize); loadLocks = new ReentrantLock[cfg.getConcurrencyLevel()]; for (int i = 0; i < loadLocks.length; i++) loadLocks[i] = new ReentrantLock(true ); maxBytes = cfg.getBlockLimit(); maxStreamThroughCache = (long) (maxBytes * cfg.getStreamRatio()); blockSize = cfg.getBlockSize(); blockSizeShift = Integer.numberOfTrailingZeros(blockSize); clockLock = new ReentrantLock(true ); clockHand = new Ref<Object>(new DfsPackKey(), -1, 0, null); clockHand.next = clockHand; packCache = new ConcurrentHashMap<DfsPackDescription, DfsPackFile>( 16, 0.75f, 1); packFiles = Collections.unmodifiableCollection(packCache.values()); statHit = new AtomicLong(); statMiss = new AtomicLong(); }
Source:
<code>private void doAnotherRequest(String messageSubject, Map<String, String> messageMap, SsmlDocumentBuilder builder, QuipMetadata metadata) { ConversationHistoryEntry entry = ConversationHistoryUtils.getLastNonMetaRequestBySubject(metadata.getConversationHistory(), new HashSet<String>(Arrays.asList(metaRequestSubjects))); <START> switchOnSubject(entry.getMessageSubject(), messageMap, builder, metadata); <END> }</code><technical_language>need a null check here. If ask for another a prior, blows up. "Alexa, ask Insultibot for another"</technical_language>

Target:
protected void doAnotherRequest(String messageSubject, Map<String, String> messageMap, SsmlDocumentBuilder builder, QuipMetadata metadata) { ConversationHistoryEntry entry = ConversationHistoryUtils.getLastNonMetaRequestBySubject(metadata.getConversationHistory(), new HashSet<String>(Arrays.asList(metaRequestSubjects))); if(entry == null){ doDefaultRequest(messageMap, builder, metadata); return; } switchOnSubject(entry.getMessageSubject(), messageMap, builder, metadata); }
Source:
<code>private E findOrThrow(I id) { return find(id).orElseThrow(() -> newIllegalArgumentException( <START> "An entity `%s` with ID `%s` is not found in the repository.", entityClass(), id <END> )); }</code><technical_language>Please word class is added message class name</technical_language>

Target:
private E findOrThrow(I id) { return find(id).orElseThrow(() -> newIllegalArgumentException( "An entity `%s` with ID `%s` is not found in the repository.", entityClass().getCanonicalName(), id )); }