auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public ObjectId getItem(int index) { checkWidget(); if <START> (0 > index || <END> index >= commits.size()) { SWT.error(SWT.ERROR_INVALID_RANGE); } return commits.get(index).objectId; }</code><technical_language>Personally I find index < 0 simpler parse</technical_language>

Target:
public ObjectId getItem(int index) { checkWidget(); if (index < 0 || commits.size() <= index) { SWT.error(SWT.ERROR_INVALID_RANGE); } return commits.get(index).objectId; }
Source:
<code>protected Response performRemove(String id) { <START> return Response.serverError().build(); END> }</code><technical_language>throw UnsupportedException here, this method called implemented ReadOnly interface</technical_language>

Target:
protected Response performRemove(String id) { throw new UnsupportedOperationException(); }
Source:
<code>private void transition(final State from, final State to) { if (state != from) { <START> throw new ISE("Cannot transition from[%s] to[%s].", from, to); <END> } state = to; }</code><technical_language>Suggest adding current state exception msg</technical_language>

Target:
private void transition(final State from, final State to) { if (state != from) { throw new ISE("Cannot transition from[%s] to[%s] because current state[%s] is not [%s].", from, to, state, from); } state = to; }
Source:
<code>public void createControl(Composite parent, final FormToolkit toolkit) { Collection<String> reviewUrls = taskReviewStore.getReviewUrls(getTaskEditorPage().getTask().getUrl()); getReviewsFromUrls(reviewUrls); if (reviews.size() == 0) { return; } reviewContainers = new ArrayList<TaskReview>(); try { populateReviews(reviewContainers); <START> } catch (NumberFormatException e) { <END> return; } selectionProvider = new SelectionProviderAdapter(); section = createSection(parent, toolkit, hasIncoming); section.setText(section.getText()); expandSection(toolkit, section); section.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent event) { if (reviewContainers == null) { expandSection(toolkit, section); getTaskEditorPage().reflow(); } } }); setSection(toolkit, section); }</code><technical_language>Catch this in populateReviews set zero. fail build section review a bad value</technical_language>

Target:
public void createControl(Composite parent, final FormToolkit toolkit) { if (taskReviewStore != null) { Collection<String> reviewUrls = taskReviewStore.getReviewUrls(getTaskEditorPage().getTask().getUrl()); getReviewsFromUrls(reviewUrls); } if (reviews.size() == 0 || reviews == null) { return; } reviewContainers = new ArrayList<TaskReview>(); populateReviews(reviewContainers); selectionProvider = new SelectionProviderAdapter(); section = createSection(parent, toolkit, true); section.setText(section.getText()); createContents(toolkit, section); section.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent event) { if (reviewContainers == null) { createContents(toolkit, section); getTaskEditorPage().reflow(); } } }); setSection(toolkit, section); }
Source:
<code>void emitEscapedContent(int c) throws IOException { if (c == '\\') { super.emitContent("&#92;"); } else { <START> if (c == '{' || c == '\\' <END> || c == '[' || c == ']') { super.emitContent('\\'); } super.emitContent(c); } }</code><technical_language>I want remove this... character content (that's entity reference) properly</technical_language>

Target:
void emitEscapedContent(int c) throws IOException { if (c == '\\') { super.emitContent("&#92;"); } else { if ((c == '#' && getLastChar() == '&') || (c == '{' || c == '\\' || c == '[' || c == ']')) { super.emitContent('\\'); } super.emitContent(c); } }
Source:
<code>public void setUp() { PaChannelsIngester paChannelsIngester = mock(PaChannelsIngester.class); PaChannelGroupsIngester paChannelGroupsIngester = mock(PaChannelGroupsIngester.class); ChannelResolver channelResolver = mock(ChannelResolver.class); ChannelWriter channelWriter = mock(ChannelWriter.class); ChannelGroupResolver channelGroupResolver = mock(ChannelGroupResolver.class); ChannelGroupWriter channelGroupWriter = mock(ChannelGroupWriter.class); channelDataHandler = new PaChannelDataHandler( paChannelsIngester, paChannelGroupsIngester, channelResolver, channelWriter, channelGroupResolver, channelGroupWriter ); Image existingImage = Image.builder("existing uri").withTheme(ImageTheme.DARK_MONOCHROME).build(); existingChannel = Channel.builder().withImage(existingImage).build(); Image newImage = Image.builder("new uri").withTheme(ImageTheme.DARK_MONOCHROME).build(); <START> newChannel = Channel.builder().withImage(newImage).build(); <END> }</code><technical_language>override this in test methods this variable need this scope. test</technical_language>

Target:
public void setUp() { PaChannelsIngester paChannelsIngester = mock(PaChannelsIngester.class); PaChannelGroupsIngester paChannelGroupsIngester = mock(PaChannelGroupsIngester.class); ChannelResolver channelResolver = mock(ChannelResolver.class); ChannelWriter channelWriter = mock(ChannelWriter.class); ChannelGroupResolver channelGroupResolver = mock(ChannelGroupResolver.class); ChannelGroupWriter channelGroupWriter = mock(ChannelGroupWriter.class); channelDataHandler = new PaChannelDataHandler( paChannelsIngester, paChannelGroupsIngester, channelResolver, channelWriter, channelGroupResolver, channelGroupWriter ); Image existingImage = Image.builder("existing uri").withTheme(ImageTheme.DARK_MONOCHROME).build(); existingChannel = Channel.builder().withImage(existingImage).build(); }
Source:
<code>public void reapEntries(final Date reapingDate) { sqlDao.inTransaction(new Transaction<Void, QueueSqlDao<T>>() { @Override public Void inTransaction(final QueueSqlDao<T> transactional, final TransactionStatus status) throws Exception { final DateTime now = clock.getUTCNow(); final List<T> entriesLeftBehind = sqlDao.getEntriesLeftBehind(config.getMaxReDispatchCount(), now.toDate(), reapingDate, config.getTableName()); if (entriesLeftBehind.size() > 0) { final Iterable<T> entriesToMove = Iterables.transform(entriesLeftBehind, new Function<T, T>() { @Nullable @Override public T apply(@Nullable final T entry) { entry.setProcessingState(PersistentQueueEntryLifecycleState.REAPED); return entry; } }); moveEntriesToHistoryFromTransaction(transactional, entriesToMove); for (T entry : entriesLeftBehind) { entry.setCreatedDate(now); entry.setProcessingState(PersistentQueueEntryLifecycleState.AVAILABLE); entry.setCreatingOwner(CreatorName.get()); } <START> transactional.insertEntries(entriesLeftBehind, config.getTableName()); <END> log.warn("{} entries were reaped by {}",DB_QUEUE_LOG_ID ,entriesLeftBehind.size(), CreatorName.get()); } return null; } }); }</code><technical_language>@wwjbatista I for this PR (STICKY_POLLING), bypassing logic insertEntryFromTransaction straight DB is fine, update stats (totalInsert.inc()). @sbrossie I this is want for full implementation (i.e. considering STICKY_EVENTS <LINK_0> re-insert ids inflight queue (unless want solely rely orphan polling mechanism?)</technical_language>

Target:
public void reapEntries(final Date reapingDate) { sqlDao.inTransaction(new Transaction<Void, QueueSqlDao<T>>() { @Override public Void inTransaction(final QueueSqlDao<T> transactional, final TransactionStatus status) throws Exception { final DateTime now = clock.getUTCNow(); final List<T> entriesLeftBehind = sqlDao.getEntriesLeftBehind(config.getMaxReDispatchCount(), now.toDate(), reapingDate, config.getTableName()); if (entriesLeftBehind.size() > 0) { final Iterable<T> entriesToMove = Iterables.transform(entriesLeftBehind, new Function<T, T>() { @Nullable @Override public T apply(@Nullable final T entry) { entry.setProcessingState(PersistentQueueEntryLifecycleState.REAPED); return entry; } }); moveEntriesToHistoryFromTransaction(transactional, entriesToMove); for (T entry : entriesLeftBehind) { entry.setCreatedDate(now); entry.setProcessingState(PersistentQueueEntryLifecycleState.AVAILABLE); entry.setCreatingOwner(CreatorName.get()); totalInsert.inc(); } transactional.insertEntries(entriesLeftBehind, config.getTableName()); log.warn("{} entries were reaped by {}",DB_QUEUE_LOG_ID ,entriesLeftBehind.size(), CreatorName.get()); } return null; } }); }
Source:
<code>public void runAtDriver(RuntimeContainer container) { if (container != null) { DatabaseClient containerClient = (DatabaseClient) container.getComponentData(properties.getReferencedComponentId(), MarkLogicConnection.CONNECTION); if (containerClient != null) { containerClient.release(); } <START> LOGGER.info("Connection released"); <END> } }</code><technical_language>this message appeared containerClient == null please add i18n for log messages</technical_language>

Target:
public void runAtDriver(RuntimeContainer container) { if (container != null) { DatabaseClient containerClient = (DatabaseClient) container.getComponentData(properties.getReferencedComponentId(), MarkLogicConnection.CONNECTION); if (containerClient != null) { containerClient.release(); LOGGER.info("Connection released"); } } }
Source:
<code>public static void setupProducts() { removeProducts(); setupTestProducts(); setupEvilTestProducts(); final SearchSort<ProductProjection> sortByCreatedAt = ProductProjectionSearch.model().createdAt().sort(SimpleSearchSortDirection.DESC); final TermFacetExpression<ProductProjection, String> facet = ProductProjectionSearch.model().allVariants().attribute().ofText(ATTR_NAME_COLOR).facetOf().all(); final SearchDsl<ProductProjection> search = ProductProjectionSearch.of(STAGED).withSort(sortByCreatedAt).plusFacet(facet); execute(search, res -> { final List<String> ids = SphereTestUtils.toIds(res.getResults()); final boolean productsExist = ids.contains(product1.getId()) && ids.contains(product2.getId()) && ids.contains(product3.getId()) && ids.contains(evilProduct1.getId()) && ids.contains(evilProduct2.getId()); <START> final boolean facetsExist = res.getTermFacetResult(facet).map(term -> term.getMissing() > 1 && term.getTotal() > 1).orElse(false); <END> return productsExist && facetsExist; }); try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } }</code><technical_language>I understand yet, facet check helps is necessary</technical_language>

Target:
public static void setupProducts() { removeProducts(); setupTestProducts(); setupEvilTestProducts(); }
Source:
<code>private void getHistory(IngestJobContext context, AbstractFile historyFile) throws TskCoreException, IOException { if (historyFile.getSize() == 0) { return; } File tempHistoryFile = createTemporaryFile(context, historyFile); try { ContentUtils.writeToFile(historyFile, tempHistoryFile, context::dataSourceIngestIsCancelled); } catch (IOException ex) { throw new IOException("Error writingToFile: " + historyFile, ex); } try { <START> postArtifact(getHistoryArtifacts(historyFile, tempHistoryFile.toPath(), context)); <END> } finally { tempHistoryFile.delete(); } }</code><technical_language>check for postArtifact postArtifacts</technical_language>

Target:
private void getHistory(IngestJobContext context, AbstractFile historyFile) throws TskCoreException, IOException { if (historyFile.getSize() == 0) { return; } File tempHistoryFile = createTemporaryFile(context, historyFile); try { ContentUtils.writeToFile(historyFile, tempHistoryFile, context::dataSourceIngestIsCancelled); } catch (IOException ex) { throw new IOException("Error writingToFile: " + historyFile, ex); } try { postArtifacts(getHistoryArtifacts(historyFile, tempHistoryFile.toPath(), context)); } finally { tempHistoryFile.delete(); } }
Source:
<code>private String getRootUrl() { <START> return appUrl.concat("/medic/_design/medic/_rewrite/"); <END> }</code><technical_language>I want this be... suggestion return appUrl; "/medic/_design/medic/_rewrite/" bit is format longer need</technical_language>

Target:
private String getRootUrl() { return appUrl; }
Source:
<code><START> protected Object readResolve() { <END> if (parameterDefinitions == null) { parameterDefinitions = Collections.emptyList(); } return this; }</code><technical_language>if making private return parameterDefinitions == null ? new ParametersDefinitionProperty() : this; field stay final FTW</technical_language>

Target:
private Object readResolve() { return parameterDefinitions == null ? new ParametersDefinitionProperty() : this; }
Source:
<code>private void validateTypeCombination(OMElement sourceElement, OMElement targetElement) { int sourceType = -1; int targetType = -1; OMAttribute sourceTypeAttr = sourceElement.getAttribute(ATT_TYPE); if (sourceTypeAttr != null && sourceTypeAttr.getAttributeValue() != null) { sourceType = convertTypeToInt(sourceTypeAttr.getAttributeValue()); if (sourceType < 0) { <START> throw new SynapseException("Un-expected source type"); <END> } } OMAttribute targetTypeAttr = targetElement.getAttribute(ATT_TYPE); if (targetTypeAttr != null && targetTypeAttr.getAttributeValue() != null) { targetType = convertTypeToInt(targetTypeAttr.getAttributeValue()); if (targetType < 0) { throw new SynapseException("Un-expected target type"); } if (targetType == 4) { throw new SynapseException("Inline not support for target attribute"); } } if (sourceType == 1) { if (targetType == 0 || targetType == 1 || targetType == 2) { throw new SynapseException("Wrong combination of source and target type"); } } else if (sourceType == 2) { if (targetType == 1 || targetType == 2) { throw new SynapseException("Wrong combination of source and target type"); } } else if (sourceType == 0 && targetType == 1) { throw new SynapseException("Wrong combination of source and target type"); } }</code><technical_language>Unexpected a single word</technical_language>

Target:
private void validateTypeCombination(OMElement sourceElement, OMElement targetElement) { int sourceType = -1; int targetType = -1; OMAttribute sourceTypeAttr = sourceElement.getAttribute(ATT_TYPE); if (sourceTypeAttr != null && sourceTypeAttr.getAttributeValue() != null) { sourceType = convertTypeToInt(sourceTypeAttr.getAttributeValue()); if (sourceType < 0) { throw new SynapseException("Unexpected source type"); } } OMAttribute targetTypeAttr = targetElement.getAttribute(ATT_TYPE); if (targetTypeAttr != null && targetTypeAttr.getAttributeValue() != null) { targetType = convertTypeToInt(targetTypeAttr.getAttributeValue()); if (targetType < 0) { throw new SynapseException("Unexpected target type"); } if (targetType == 4) { throw new SynapseException("Inline not support for target attribute"); } } if (sourceType == 1) { if (targetType == 0 || targetType == 1 || targetType == 2) { throw new SynapseException("Wrong combination of source and target type"); } } else if (sourceType == 2) { if (targetType == 1 || targetType == 2) { throw new SynapseException("Wrong combination of source and target type"); } } else if (sourceType == 0 && targetType == 1) { throw new SynapseException("Wrong combination of source and target type"); } }
Source:
<code>public void testCreateJUnitTestCase() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); StringBuffer buf= new StringBuffer(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append("}\n"); ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); String string= "E"; int offset= buf.toString().indexOf(string); AssistContext context= getCorrectionContext(cu, offset, string.length()); List<IJavaCompletionProposal> proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 1); assertProposalExists(proposals, <START> "Create new test case for class 'E.java'"); <END> }</code><technical_language>Is this string CorrectionMessages.properties change</technical_language>

Target:
public void testCreateJUnitTestCase() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); StringBuffer buf= new StringBuffer(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append("}\n"); ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); String string= "E"; int offset= buf.toString().indexOf(string); AssistContext context= getCorrectionContext(cu, offset, string.length()); List<IJavaCompletionProposal> proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 1); assertProposalExists(proposals, Messages.format(CorrectionMessages.QuickAssistProcessor_create_new_junit_test_case, "E.java")); }
Source:
<code>public void testWithArrays() { final byte[] authenthicationKey = { 1 }; final byte[] encryptionKey = { 1 }; final KeySet keySet = new KeySet(authenthicationKey, encryptionKey); final KeySetDto keySetDto = this.configurationMapper.map(keySet, KeySetDto.class); <START> assertNotNull(keySet); <END> assertNotNull(keySetDto); assertNotNull(keySetDto.getAuthenticationKey()); assertNotNull(keySetDto.getEncryptionKey()); assertEquals(keySet.getAuthenticationKey().length, keySetDto.getAuthenticationKey().length); assertEquals(keySet.getEncryptionKey().length, keySetDto.getEncryptionKey().length); assertEquals(keySet.getAuthenticationKey()[0], keySetDto.getAuthenticationKey()[0]); assertEquals(keySet.getEncryptionKey()[0], keySetDto.getEncryptionKey()[0]); }</code><technical_language>delete this line</technical_language>

Target:
public void testWithArrays() { final byte[] authenthicationKey = { 1 }; final byte[] encryptionKey = { 1 }; final KeySet keySet = new KeySet(authenthicationKey, encryptionKey); final KeySetDto keySetDto = this.configurationMapper.map(keySet, KeySetDto.class); assertNotNull(keySetDto); assertNotNull(keySetDto.getAuthenticationKey()); assertNotNull(keySetDto.getEncryptionKey()); assertEquals(keySet.getAuthenticationKey().length, keySetDto.getAuthenticationKey().length); assertEquals(keySet.getEncryptionKey().length, keySetDto.getEncryptionKey().length); assertEquals(keySet.getAuthenticationKey()[0], keySetDto.getAuthenticationKey()[0]); assertEquals(keySet.getEncryptionKey()[0], keySetDto.getEncryptionKey()[0]); }
Source:
<code>public final int hashCode() { if (hashCode == Utils.NO_HASHCODE) { <START> hashCode = computeHash(); <END> } return hashCode; }</code><technical_language>I this a suggestion of @dwightguth: if computeHash() returns 0, set hashCode 1</technical_language>

Target:
public final int hashCode() { if (hashCode == Utils.NO_HASHCODE) { hashCode = computeHash(); hashCode = hashCode == 0 ? 1 : hashCode; } return hashCode; }
Source:
<code>public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) { <START> final int fortune = 0; <END> EnumHempGrowth growth = state.get(GROWTH); List<ItemStack> drops = new ArrayList<ItemStack>(); drops.add(new ItemStack(IEContent.itemSeeds, 1)); if(growth==getMaxGrowth(growth)) { for(int i = 0; i < 3+fortune; ++i) if(Utils.RAND.nextInt(8) <= growth.ordinal()) drops.add(new ItemStack(IEContent.itemHempFiber, 1)); } return drops; }</code><technical_language>get fortune loot context? Edit: this method unnecessary written loot table JSON</technical_language>

Target:
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) { ItemStack tool = builder.get(LootParameters.TOOL); int fortune = (tool==null)?(0):(EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, tool)); EnumHempGrowth growth = state.get(GROWTH); List<ItemStack> drops = new ArrayList<ItemStack>(); drops.add(new ItemStack(IEContent.itemSeeds, 1)); if(growth==getMaxGrowth(growth)) { for(int i = 0; i < 3+fortune; ++i) if(Utils.RAND.nextInt(8) <= growth.ordinal()) drops.add(new ItemStack(IEContent.itemHempFiber, 1)); } return drops; }
Source:
<code><START> public Throwable getThrowable() { <END> return throwable; }</code><technical_language>Comparing [TestExecutionResult](<LINK_0> this Getter return Optional</technical_language>

Target:
public Optional<Throwable> getThrowable() { return Optional.ofNullable(throwable); }
Source:
<code>protected int run() throws Exception { boolean errorOccurred = false; try { <START> Jenkins.getInstance().getQueue().clear(); <END> } catch (AccessDeniedException e) { stderr.println(e.getMessage()); errorOccurred = true; } catch (Exception e) { final String errorMsg = String.format("Unexpected exception occurred during performing clear-queue command: %s", e.getMessage()); stderr.println(errorMsg); LOGGER.warning(errorMsg); errorOccurred = true; } return errorOccurred ? 1 : 0; }</code><technical_language>Jenkins.getActiveInstance() instead (nullability check)</technical_language>

Target:
protected int run() throws Exception { Jenkins.getActiveInstance().getQueue().clear(); return 0; }
Source:
<code>public static <T, E extends Exception> T maybeLog(CallableCheckedException<T, E> action, BiConsumer<LoggingFunction, Stopwatch> primaryLogger, BiConsumer<LoggingFunction, T> additonalLoggerWithAccessToResult) throws E { if (log.isTraceEnabled() || slowlogger.isWarnEnabled()) { Monitor<T> monitor = Monitor.createMonitor( primaryLogger, additonalLoggerWithAccessToResult, slowLogPredicate); try { T res = action.call(); monitor.registerResult(res); return res; } catch (Exception ex) { monitor.registerException(ex); <START> throw Throwables.throwUncheckedException(ex); <END> } finally { monitor.log(); } } else { return action.call(); } }</code><technical_language>wrapping this now? declaring throw E, throwing a RuntimeException</technical_language>

Target:
public static <T, E extends Exception> T maybeLog(CallableCheckedException<T, E> action, BiConsumer<LoggingFunction, Stopwatch> primaryLogger, BiConsumer<LoggingFunction, T> additonalLoggerWithAccessToResult) throws E { if (log.isTraceEnabled() || slowlogger.isWarnEnabled()) { Monitor<T> monitor = Monitor.createMonitor( primaryLogger, additonalLoggerWithAccessToResult, slowLogPredicate); try { T res = action.call(); monitor.registerResult(res); return res; } catch (Exception ex) { monitor.registerException(ex); throw ex; } finally { monitor.log(); } } else { return action.call(); } }
Source:
<code>@Override public JsonWriter value(BufferedSource source) throws IOException { Object value = JsonReader.of(source).readJsonValue(); if (value instanceof String) { return value((String) value); } if (value instanceof Number) { return value((Number) value); } if (promoteValueToName) { <START> throw new AssertionError("This is not a map key."); <END> } boolean serializeNulls = this.serializeNulls; this.serializeNulls = true; try { add(value); } finally { this.serializeNulls = serializeNulls; } pathIndices[stackSize - 1]++; return this; }</code><technical_language>IllegalStateException</technical_language>

Target:
@Override public JsonWriter value(BufferedSource source) throws IOException { if (promoteValueToName) { throw new IllegalStateException( "BufferedSource cannot be used as a map key in JSON at path " + getPath()); } Object value = JsonReader.of(source).readJsonValue(); boolean serializeNulls = this.serializeNulls; this.serializeNulls = true; try { add(value); } finally { this.serializeNulls = serializeNulls; } pathIndices[stackSize - 1]++; return this; }
Source:
<code>private static StringBuilder buildSecurityHeader(StringBuilder securityHeaderBuilder, String username, String password, WsTrustVersion version) { StringBuilder messageCredentialsBuilder = new StringBuilder( MAX_EXPECTED_MESSAGE_SIZE); String guid = UUID.randomUUID().toString(); username = StringEscapeUtils.escapeXml10(username); password = StringEscapeUtils.escapeXml10(password); DateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US); dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); Date date = new Date(); String currentTimeString = dateFormat.format(date); int toAdd = 60 * 1000 * 10; date = new Date(date.getTime() + toAdd); String expiryTimString = dateFormat.format(date); messageCredentialsBuilder.append(String.format( "<o:UsernameToken u:Id='uuid-" + "%s'>" + "<o:Username>%s</o:Username>" + "<o:Password>%s</o:Password>" + "</o:UsernameToken>", guid, username, password)); securityHeaderBuilder.append("<o:Security s:mustUnderstand='1' xmlns:o='<LINK_0>'>"); securityHeaderBuilder.append(String.format( "<u:Timestamp u:Id='_0'>" + "<u:Created>%s</u:Created>" + "<u:Expires>%s</u:Expires>" + "</u:Timestamp>", <START> currentTimeString, expiryTimString)); <END> securityHeaderBuilder.append(messageCredentialsBuilder.toString()); securityHeaderBuilder.append("</o:Security>"); return securityHeaderBuilder; }</code><technical_language>Super nitpick: this expiryTimeString</technical_language>

Target:
private static StringBuilder buildSecurityHeader(StringBuilder securityHeaderBuilder, String username, String password, WsTrustVersion version) { StringBuilder messageCredentialsBuilder = new StringBuilder( MAX_EXPECTED_MESSAGE_SIZE); String guid = UUID.randomUUID().toString(); username = StringEscapeUtils.escapeXml10(username); password = StringEscapeUtils.escapeXml10(password); DateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US); dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); Date date = new Date(); String currentTimeString = dateFormat.format(date); int toAdd = 60 * 1000 * 10; date = new Date(date.getTime() + toAdd); String expiryTimeString = dateFormat.format(date); messageCredentialsBuilder.append(String.format( "<o:UsernameToken u:Id='uuid-" + "%s'>" + "<o:Username>%s</o:Username>" + "<o:Password>%s</o:Password>" + "</o:UsernameToken>", guid, username, password)); securityHeaderBuilder.append("<o:Security s:mustUnderstand='1' xmlns:o='<LINK_0>'>"); securityHeaderBuilder.append(String.format( "<u:Timestamp u:Id='_0'>" + "<u:Created>%s</u:Created>" + "<u:Expires>%s</u:Expires>" + "</u:Timestamp>", currentTimeString, expiryTimeString)); securityHeaderBuilder.append(messageCredentialsBuilder.toString()); securityHeaderBuilder.append("</o:Security>"); return securityHeaderBuilder; }
Source:
<code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ((WordPress) getApplication()).component().inject(this); setContentView(R.layout.post_list_activity); mIsPage = getIntent().getBooleanExtra(EXTRA_VIEW_PAGES, false); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setTitle(getString(mIsPage ? R.string.pages : R.string.posts)); actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); } if (savedInstanceState == null) { mSite = (SiteModel) getIntent().getSerializableExtra(WordPress.SITE); } else { mSite = (SiteModel) savedInstanceState.getSerializable(WordPress.SITE); } if (mSite == null) { ToastUtils.showToast(this, R.string.blog_not_found, ToastUtils.Duration.SHORT); finish(); return; } mPostList = PostsListFragment.newInstance(mSite); <START> <END> FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction(); fragmentTransaction.replace(R.id.post_list_container, mPostList); fragmentTransaction.commit(); showErrorDialogIfNeeded(getIntent().getExtras()); }</code><technical_language>necessary create fragment activity is recreated. Instead find existing fragment, if create it. Ex: mPostList = (PostsListFragment) getFragmentManager().findFragmentByTag(PostsListFragment.TAG); if (mPostList == null) { mPostList = PostsListFragment.newInstance(mSite); getFragmentManager().beginTransaction() .add(R.id.post_list_container, mPostList, PostsListFragment.TAG) .commit(); }</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ((WordPress) getApplication()).component().inject(this); setContentView(R.layout.post_list_activity); mIsPage = getIntent().getBooleanExtra(EXTRA_VIEW_PAGES, false); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setTitle(getString(mIsPage ? R.string.pages : R.string.posts)); actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); } if (savedInstanceState == null) { mSite = (SiteModel) getIntent().getSerializableExtra(WordPress.SITE); } else { mSite = (SiteModel) savedInstanceState.getSerializable(WordPress.SITE); } if (mSite == null) { ToastUtils.showToast(this, R.string.blog_not_found, ToastUtils.Duration.SHORT); finish(); return; } mPostList = (PostsListFragment) getFragmentManager().findFragmentByTag(PostsListFragment.TAG); if (mPostList == null) { mPostList = PostsListFragment.newInstance(mSite); getFragmentManager().beginTransaction() .add(R.id.post_list_container, mPostList, PostsListFragment.TAG) .commit(); } showErrorDialogIfNeeded(getIntent().getExtras()); }
Source:
<code><START> public void shouldRestoreAndProgressWhenTopicWrittenToDuringRestorationWithEosAlphaEnabled() throws Exception { <END> try { STREAMS_CONFIG.put(StreamsConfig.PROCESSING_GUARANTEE_CONFIG, StreamsConfig.EXACTLY_ONCE); streamsOne = new KafkaStreams(streamsBuilder.build(), STREAMS_CONFIG); streamsOne.start(); produceKeyValues("a", "b", "c"); assertNumberValuesRead(readKeyValues, expectedInitialResultsMap, "Table did not read all values"); streamsOne.close(); streamsOne = new KafkaStreams(streamsBuilder.build(), STREAMS_CONFIG); streamsOne.setGlobalStateRestoreListener(new UpdatingSourceTopicOnRestoreStartStateRestoreListener()); streamsOne.start(); produceKeyValues("f", "g", "h"); assertNumberValuesRead( readKeyValues, expectedResultsWithDataWrittenDuringRestoreMap, "Table did not get all values after restart"); } finally { streamsOne.close(Duration.ofSeconds(5)); } }</code><technical_language>extract test portion a common function</technical_language>

Target:
public void shouldRestoreAndProgressWhenTopicWrittenToDuringRestorationWithEosAlphaEnabled() throws Exception { STREAMS_CONFIG.put(StreamsConfig.PROCESSING_GUARANTEE_CONFIG, StreamsConfig.EXACTLY_ONCE); shouldRestoreAndProgressWhenTopicWrittenToDuringRestorationWithEosEnabled(); }
Source:
<code>public void addRegion(Region region) { if (!regions.contains(region)) { if (serviceConnected) { try { beaconManager.startMonitoringBeaconsInRegion(region); } catch (RemoteException e) { LogManager.e(e, TAG, "Can't add bootstrap region"); } }else{ <START> LogManager.w(TAG, "Adding a rigion: service not yet Connected"); <END> } regions.add(region); } }</code><technical_language>"rigion" "region"</technical_language>

Target:
public void addRegion(Region region) { if (!regions.contains(region)) { if (serviceConnected) { try { beaconManager.startMonitoringBeaconsInRegion(region); } catch (RemoteException e) { LogManager.e(e, TAG, "Can't add bootstrap region"); } }else{ LogManager.w(TAG, "Adding a region: service not yet Connected"); } regions.add(region); } }
Source:
<code>private void persistWorkbenchModel() { try { <START> Job.getJobManager().join(WORKBENCH_AUTO_SAVE_JOB, new NullProgressMonitor()); <END> } catch (OperationCanceledException e) { } catch (InterruptedException e) { } final MApplication appCopy = (MApplication) EcoreUtil.copy((EObject) application); if (detectWorkbenchCorruption(appCopy)) { return; } final IModelResourceHandler handler = e4Context.get(IModelResourceHandler.class); Job cleanAndSaveJob = new Job(WORKBENCH_AUTO_SAVE_BACKGROUND_JOB) { @Override protected IStatus run(IProgressMonitor monitor) { final Resource res = handler.createResourceWithApp(appCopy); cleanUpCopy(appCopy, e4Context); try { if (!detectWorkbenchCorruption((MApplication) res.getContents().get(0))) { res.save(null); } } catch (IOException e) { } finally { res.unload(); res.getResourceSet().getResources().remove(res); } return Status.OK_STATUS; } @Override public boolean belongsTo(Object family) { return WORKBENCH_AUTO_SAVE_JOB.equals(family); } }; cleanAndSaveJob.setPriority(Job.SHORT); cleanAndSaveJob.setSystem(true); cleanAndSaveJob.schedule(); }</code><technical_language>is, this IDE freeze if saving takes a long time. I upload a new revision of change new JobGroup API. This ensure Jobs queued blocking</technical_language>

Target:
private void persistWorkbenchModel() { final MApplication appCopy = (MApplication) EcoreUtil.copy((EObject) application); if (detectWorkbenchCorruption(appCopy)) { return; } final IModelResourceHandler handler = e4Context.get(IModelResourceHandler.class); Job cleanAndSaveJob = new Job(APPLICATIONMODEL_SAVE_JOB) { @Override protected IStatus run(IProgressMonitor monitor) { final Resource res = handler.createResourceWithApp(appCopy); cleanUpCopy(appCopy, e4Context); try { if (!detectWorkbenchCorruption((MApplication) res.getContents().get(0))) { res.save(null); } } catch (IOException e) { } finally { res.unload(); res.getResourceSet().getResources().remove(res); } return Status.OK_STATUS; } }; cleanAndSaveJob.setPriority(Job.SHORT); cleanAndSaveJob.setSystem(true); cleanAndSaveJob.setJobGroup(jobGroupWorkbenchSaveJob); cleanAndSaveJob.schedule(); }
Source:
<code>private SnomedNamespaceAndModuleAssignerProvider() { <START> Builder<String, SnomedNamespaceAndModuleAssigner> mapBuilder = ImmutableMap.builder(); <END> Extensions.getExtensions(NAMESPACE_ASSIGNER_EXTENSION, SnomedNamespaceAndModuleAssigner.class) .forEach(assigner -> mapBuilder.put(assigner.getConfigurationKey(), assigner)); assigners = mapBuilder.build(); }</code><technical_language>ImmutableMap.builder throws exception register another assigner registered name. fail initialize class, leads NoClassDefFoundError Snow Owl startup error. This registration phase report duplicate assigners warnings in log register assigner</technical_language>

Target:
private SnomedNamespaceAndModuleAssignerProvider() { Extensions.getExtensions(NAMESPACE_ASSIGNER_EXTENSION, SnomedNamespaceAndModuleAssigner.class) .forEach(assigner -> { if (assigners.containsKey(assigner.getName())) { LOG.warn(String.format("A namespace/module assigner with the name '%s' is already registered.", assigner.getName())); } else { assigners.put(assigner.getName(), assigner); } }); }
Source:
<code>public static String normalizeBranchName(String name) { if (name == null || name.isEmpty()) { <START> return name; <END> } String result = name.trim(); String fullName = result.startsWith(Constants.R_HEADS) ? result : Constants.R_HEADS + result; if (isValidRefName(fullName)) { return result; } result = result.replaceAll("(?:\\h|\\v)+", "_"); StringBuilder b = new StringBuilder(); char p = '/'; for (int i = 0, len = result.length(); i < len; i++) { char c = result.charAt(i); if (c < ' ' || c == 127) { continue; } switch (c) { case '\\': case '^': case '~': case ':': case '?': case '*': case '[': case '@': case '<': case '>': case '|': case '"': c = '-'; break; default: break; } switch (c) { case '/': if (p == '/') { continue; } p = '/'; break; case '.': case '_': case '-': if (p == '/' || p == '-') { continue; } p = '-'; break; default: p = c; break; } b.append(c); } result = b.toString().replaceFirst("[/_.-]+$", "") .replaceAll("\\.lock($|/)", "_lock$1"); return FORBIDDEN_BRANCH_NAME_COMPONENTS.matcher(result) .replaceAll("$1+$2$3"); }</code><technical_language>return empty String here, callers need check for nullness</technical_language>

Target:
public static String normalizeBranchName(String name) { if (name == null || name.isEmpty()) { return ""; } String result = name.trim(); String fullName = result.startsWith(Constants.R_HEADS) ? result : Constants.R_HEADS + result; if (isValidRefName(fullName)) { return result; } result = result.replaceAll("(?:\\h|\\v)+", "_"); StringBuilder b = new StringBuilder(); char p = '/'; for (int i = 0, len = result.length(); i < len; i++) { char c = result.charAt(i); if (c < ' ' || c == 127) { continue; } switch (c) { case '\\': case '^': case '~': case ':': case '?': case '*': case '[': case '@': case '<': case '>': case '|': case '"': c = '-'; break; default: break; } switch (c) { case '/': if (p == '/') { continue; } p = '/'; break; case '.': case '_': case '-': if (p == '/' || p == '-') { continue; } p = '-'; break; default: p = c; break; } b.append(c); } result = b.toString().replaceFirst("[/_.-]+$", "") .replaceAll("\\.lock($|/)", "_lock$1"); return FORBIDDEN_BRANCH_NAME_COMPONENTS.matcher(result) .replaceAll("$1+$2$3"); }
Source:
<code><START> private UriBuilder buildUri(long offset) { <END> UriBuilder builder = UriBuilder.fromUri(baseUrl) .queryParam(offsetParameter, startIndex + offset) .queryParam(limitParameter, limit); for (String curKey : parameters.keySet()) { Object[] value = parameters.get(curKey); if (value != null && value.length > 0) { builder.queryParam(curKey, value); } } return builder; }</code><technical_language>this function returning a Builder URI. If need builder, return URI rename this function</technical_language>

Target:
private String buildUri(long offset) { UriBuilder builder = UriBuilder.fromUri(baseUrl) .queryParam(offsetParameter, startIndex + offset) .queryParam(limitParameter, limit); for (String curKey : parameters.keySet()) { Object[] value = parameters.get(curKey); if (value != null && value.length > 0) { builder.queryParam(curKey, value); } } return builder.toString(); }
Source:
<code>public void disposeComponent() { <START> executorService.shutdown(); <END> }</code><technical_language>rejects new tasks, practical effect in this case. I try shutdownNow, a bad support of interrupts thread</technical_language>

Target:
public void disposeComponent() { List<Runnable> rejected = executorService.shutdownNow(); if (!rejected.isEmpty()) { LOGGER.debug("rejected " + rejected.size() + " pending tasks"); } }
Source:
<code>private static String getAbbreviation(String name, String token) { StringBuilder abbrev = new StringBuilder(); if (name != null) { <START> for (String t : name.split(token)) { abbrev.append(t.substring(0, 1).toUpperCase()); } <END> } return abbrev.toString(); }</code><technical_language>This give strange results for names non-latin characters, for example Japanese name: ?? ?? result in: ?? is a bit weird. This considered unusual edge case though. easy add proper handling for later. for interest, names: ?? ?? ?? ?? ?? ?? properly abbreviated as: ?? (?) ?? (?) ?</technical_language>

Target:
private static String getAbbreviation(String name, String token) { StringBuilder abbrev = new StringBuilder(); if (name != null) { List<String> nameList = new ArrayList<String>(); for (String t : name.split(token)) { nameList.add(t); } RegExp re = RegExp.compile("[A-Za-z]+"); if (!re.test(nameList.get(0))) { abbrev.append(nameList.get(0).toUpperCase()); if (nameList.size() > 1) { abbrev.append(" ("+ nameList.get(nameList.size()-1).substring(0, 1).toUpperCase()+ ")"); } } else { for (String t : nameList) { abbrev.append(t.substring(0, 1).toUpperCase()); } } } return abbrev.toString(); }
Source:
<code>public ZkRoutingDataWriter(String namespace, String zkAddress) { if (namespace == null || namespace.isEmpty()) { throw new IllegalArgumentException("namespace cannot be null or empty!"); } _namespace = namespace; if (zkAddress == null || zkAddress.isEmpty()) { throw new IllegalArgumentException("Zk address cannot be null or empty!"); } _zkClient = DedicatedZkClientFactory.getInstance() .buildZkClient(new HelixZkClient.ZkConnectionConfig(zkAddress), new HelixZkClient.ZkClientConfig().setZkSerializer(new ZNRecordSerializer())); try { _zkClient.createPersistent(MetadataStoreRoutingConstants.ROUTING_DATA_PATH, true); } catch (ZkNodeExistsException e) { } ZNRecord myServerInfo = new ZNRecord( <START> System.getProperty(MetadataStoreRoutingConstants.HOSTNAME_SYSTEM_PROPERTY_KEY)); <END> _leaderElection = new ZkDistributedLeaderElection(_zkClient, MetadataStoreRoutingConstants.LEADER_ELECTION_ZNODE, myServerInfo); _forwardHttpClient = HttpClients.createDefault(); }</code><technical_language>if property is set in system</technical_language>

Target:
public ZkRoutingDataWriter(String namespace, String zkAddress) { if (namespace == null || namespace.isEmpty()) { throw new IllegalArgumentException("namespace cannot be null or empty!"); } _namespace = namespace; if (zkAddress == null || zkAddress.isEmpty()) { throw new IllegalArgumentException("Zk address cannot be null or empty!"); } _zkClient = DedicatedZkClientFactory.getInstance() .buildZkClient(new HelixZkClient.ZkConnectionConfig(zkAddress), new HelixZkClient.ZkClientConfig().setZkSerializer(new ZNRecordSerializer())); try { _zkClient.createPersistent(MetadataStoreRoutingConstants.ROUTING_DATA_PATH, true); } catch (ZkNodeExistsException e) { } String hostName = System.getProperty(MetadataStoreRoutingConstants.MSDS_SERVER_HOSTNAME_KEY); if (hostName == null || hostName.isEmpty()) { throw new IllegalStateException( "Unable to get the hostname of this server instance. System.getProperty fails to fetch " + MetadataStoreRoutingConstants.MSDS_SERVER_HOSTNAME_KEY + "."); } if (hostName.charAt(hostName.length() - 1) == '/') { hostName = hostName.substring(0, hostName.length() - 1); } _myHostName = hostName; ZNRecord myServerInfo = new ZNRecord(_myHostName); _leaderElection = new ZkDistributedLeaderElection(_zkClient, MetadataStoreRoutingConstants.LEADER_ELECTION_ZNODE, myServerInfo); RequestConfig config = RequestConfig.custom().setConnectTimeout(HTTP_REQUEST_FORWARDING_TIMEOUT) .setConnectionRequestTimeout(HTTP_REQUEST_FORWARDING_TIMEOUT) .setSocketTimeout(HTTP_REQUEST_FORWARDING_TIMEOUT).build(); _forwardHttpClient = HttpClientBuilder.create().setDefaultRequestConfig(config).build(); }
Source:
<code>public void whenPOSTEventTypeWithAuthorizationThenOk() throws JsonProcessingException { final EventType eventType = buildDefaultEventType(); eventType.setAuthorization(new EventTypeAuthorization( ImmutableList.of(new EventTypeAuthorizationAttribute("type1", "value1")), ImmutableList.of(new EventTypeAuthorizationAttribute("type2", "value2")), ImmutableList.of(new EventTypeAuthorizationAttribute("type3", "value3")))); final String body = MAPPER.writer().writeValueAsString(eventType); <START> System.out.println(body); <END> given().body(body) .header("accept", "application/json") .contentType(JSON) .when() .post(ENDPOINT) .then() .statusCode(HttpStatus.SC_CREATED); when().get(String.format("%s/%s", ENDPOINT, eventType.getName())) .then() .body("authorization.admins[0].data_type", equalTo("type1")) .body("authorization.admins[0].value", equalTo("value1")) .body("authorization.readers[0].data_type", equalTo("type2")) .body("authorization.readers[0].value", equalTo("value2")) .body("authorization.writers[0].data_type", equalTo("type3")) .body("authorization.writers[0].value", equalTo("value3")); }</code><technical_language>I recommend replace logger :)</technical_language>

Target:
public void whenPOSTEventTypeWithAuthorizationThenOk() throws JsonProcessingException { final EventType eventType = buildDefaultEventType(); eventType.setAuthorization(new EventTypeAuthorization( ImmutableList.of(new EventTypeAuthorizationAttribute("type1", "value1")), ImmutableList.of(new EventTypeAuthorizationAttribute("type2", "value2")), ImmutableList.of(new EventTypeAuthorizationAttribute("type3", "value3")))); final String body = MAPPER.writer().writeValueAsString(eventType); given().body(body) .header("accept", "application/json") .contentType(JSON) .when() .post(ENDPOINT) .then() .statusCode(HttpStatus.SC_CREATED); when().get(String.format("%s/%s", ENDPOINT, eventType.getName())) .then() .body("authorization.admins[0].data_type", equalTo("type1")) .body("authorization.admins[0].value", equalTo("value1")) .body("authorization.readers[0].data_type", equalTo("type2")) .body("authorization.readers[0].value", equalTo("value2")) .body("authorization.writers[0].data_type", equalTo("type3")) .body("authorization.writers[0].value", equalTo("value3")); }
Source:
<code>public Map<ContingencyState, Long> getContingencyStateCounts(final GenotypeConcordanceScheme scheme) { scheme.validateScheme(); final Map<ContingencyState, Long> counts = new HashMap<ContingencyState, Long>(); for (final ContingencyState contingencyState : ContingencyState.values()) { <START> counts.put(contingencyState, (long)0); <END> } for (final TruthState truthState : TruthState.values()) { for (final CallState callState : CallState.values()) { final TruthAndCallStates truthAndCallStates = new TruthAndCallStates(truthState, callState); final ContingencyState[] contingencyStateArray = scheme.getConcordanceStateArray(truthAndCallStates); for (final ContingencyState contingencyState : contingencyStateArray) { final long newCount = counts.get(contingencyState) + getCount(truthAndCallStates); counts.put(contingencyState, newCount); } } } return counts; }</code><technical_language>@lbergelson @nh13 in case, put 0L here</technical_language>

Target:
public Map<ContingencyState, Long> getContingencyStateCounts(final GenotypeConcordanceScheme scheme) { scheme.validateScheme(); final Map<ContingencyState, Long> counts = new HashMap<ContingencyState, Long>(); for (final ContingencyState contingencyState : ContingencyState.values()) { counts.put(contingencyState, 0L); } for (final TruthState truthState : TruthState.values()) { for (final CallState callState : CallState.values()) { final TruthAndCallStates truthAndCallStates = new TruthAndCallStates(truthState, callState); final ContingencyState[] contingencyStateArray = scheme.getConcordanceStateArray(truthAndCallStates); for (final ContingencyState contingencyState : contingencyStateArray) { final long newCount = counts.get(contingencyState) + getCount(truthAndCallStates); counts.put(contingencyState, newCount); } } } return counts; }
Source:
<code>public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller == null) { return false; } TargetCard target = new TargetDiscard(0, Integer.MAX_VALUE, StaticFilters.FILTER_CARD_CREATURE, controller.getId()); controller.choose(outcome, controller.getHand(), target, game); int counters = controller.discard(new CardsImpl(target.getTargets()), source, game).size(); Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent == null || counters < 1) { return true; } <START> return permanent.addCounters(CounterType.P1P1.createInstance(counters), source, game); <END> }</code><technical_language>return true time (addCounters fail replace event, cards discarded)</technical_language>

Target:
public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller == null) { return false; } TargetCard target = new TargetDiscard(0, Integer.MAX_VALUE, StaticFilters.FILTER_CARD_CREATURE, controller.getId()); controller.choose(outcome, controller.getHand(), target, game); int counters = controller.discard(new CardsImpl(target.getTargets()), source, game).size(); Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent == null || counters < 1) { return true; } permanent.addCounters(CounterType.P1P1.createInstance(counters), source, game); return true; }
Source:
<code>protected void setDimension(String dimension, String value) { synchronized (lock) { String oldValue = singleValueDims.put(dimension, value); <START> if (oldValue != null && !oldValue.equals(value)) { <END> handleIllegalModification(singleValueDims.getOrDefault(DruidMetrics.ID, ""), dimension); } } }</code><technical_language>Equal values tolerated. reassignment of existing dimension metric illegal</technical_language>

Target:
protected void setDimension(String dimension, String value) { synchronized (lock) { singleValueDims.compute(dimension, (key, oldValue) -> { if (oldValue != null && !oldValue.equals(value)) { throw new ISE("Changing dimension values in QueryMetrics is not allowed: %s", dimension); } return oldValue; }); } }
Source:
<code>public void create_ProjectEndpointNoScheme() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage( "Project endpoint \"prom-qa/datastore/v1beta42/projects/project-id\" must" + " include scheme."); factory.create(new DatastoreOptions.Builder() <START> .projectEndpoint("prom-qa/datastore/v1beta42/projects/project-id") <END> .build()); }</code><technical_language>do this test explicitly localhost:1234</technical_language>

Target:
public void create_ProjectEndpointNoScheme() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage( "Project endpoint \"localhost:1234/datastore/v1beta42/projects/project-id\" must" + " include scheme."); factory.create(new DatastoreOptions.Builder() .projectEndpoint("localhost:1234/datastore/v1beta42/projects/project-id") .build()); }