auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private int atEnd(int res) { <START> URI nested = compensateURI != null ? extractParentLRA(compensateURI) : null; <END> boolean notifyForget = (nested != null && forgetURI != null); if (!isFinished() || !lra.isFinished()) { if (afterURI != null || notifyForget) { return TwoPhaseOutcome.HEURISTIC_HAZARD; } return res; } boolean r1 = afterURI == null || request(afterURI, lra, lra.getLRAStatus().name()); boolean r2 = !notifyForget || request(forgetURI, lra, lra.getLRAStatus().name()); if (r1) { afterURI = null; } if (r2) { forgetURI = null; } return r1 && r2 ? TwoPhaseOutcome.FINISH_OK : TwoPhaseOutcome.HEURISTIC_HAZARD; }</code><technical_language>this a normal compensateURI passed user? user-endpoint:user-port/something/compensate? parent LRA extracted</technical_language>

Target:
private int atEnd(int res) { if (!isFinished() || !lra.isFinished()) { if (afterURI != null) { return TwoPhaseOutcome.HEURISTIC_HAZARD; } return res; } if (afterURI == null || afterLRARequest(afterURI, lra.getLRAStatus().name())) { afterURI = null; return TwoPhaseOutcome.FINISH_OK; } return TwoPhaseOutcome.HEURISTIC_HAZARD; }
Source:
<code><START> public LocalCacheFileSystem(FileSystem fs, FileSystemContext fsContext) { <END> super(fs); mFsContext = fsContext; mLocalCacheManager = new LocalCacheManager(mFsContext); }</code><technical_language>I feel good this constructor. counter-intuitive fsContext argument here. is fsContext embededed fs object. Is a access it</technical_language>

Target:
public LocalCacheFileSystem(FileSystem fs, FileSystemContext fsContext) { super(fs); mFsContext = fsContext; }
Source:
<code>public static ConfigDef getConfig() { Set<String> skip = new HashSet<>(); skip.add(STORAGE_CLASS_CONFIG); skip.add(FORMAT_CLASS_CONFIG); skip.add(TOPICS_DIR_CONFIG); ConfigDef visible = new ConfigDef(); addAllConfigKeys(visible, newConfigDef(), skip); addAllConfigKeys(visible, StorageCommonConfig.newConfigDef(STORAGE_CLASS_RECOMMENDER), skip); addAllConfigKeys(visible, PartitionerConfig.newConfigDef(PARTITIONER_CLASS_RECOMMENDER), skip); addAllConfigKeys(visible, HiveConfig.getConfig(), skip); visible.define( STORAGE_CLASS_CONFIG, Type.CLASS, HdfsStorage.class.getName(), Importance.HIGH, STORAGE_CLASS_DOC, "Storage", 1, Width.NONE, STORAGE_CLASS_DISPLAY, STORAGE_CLASS_RECOMMENDER ); visible.define( FORMAT_CLASS_CONFIG, Type.CLASS, AvroFormat.class.getName(), Importance.HIGH, FORMAT_CLASS_DOC, "Connector", 1, Width.NONE, FORMAT_CLASS_DISPLAY, FORMAT_CLASS_RECOMMENDER ); visible.define( "topics.dir", Type.STRING, "topics", Importance.HIGH, <START> "Top level directory to store the data ingested from Kafka. " <END> + "Supports ``${topic}`` in the value, which will be replaced by the actual" + " topic name. Supports ``${1}``, ..., ``${n}`` in conjunction with " + TOPIC_REGEX_CAPTURE_GROUP_CONFIG + ". See " + TOPIC_REGEX_CAPTURE_GROUP_CONFIG + " configuration documentation for details.", "Storage", 2, Width.NONE, "Topics directory" ); return visible; }</code><technical_language>constants</technical_language>

Target:
public static ConfigDef getConfig() { Set<String> skip = new HashSet<>(); skip.add(STORAGE_CLASS_CONFIG); skip.add(FORMAT_CLASS_CONFIG); skip.add(TOPICS_DIR_CONFIG); ConfigDef visible = new ConfigDef(); addAllConfigKeys(visible, newConfigDef(), skip); addAllConfigKeys(visible, StorageCommonConfig.newConfigDef(STORAGE_CLASS_RECOMMENDER), skip); addAllConfigKeys(visible, PartitionerConfig.newConfigDef(PARTITIONER_CLASS_RECOMMENDER), skip); addAllConfigKeys(visible, HiveConfig.getConfig(), skip); visible.define( STORAGE_CLASS_CONFIG, Type.CLASS, HdfsStorage.class.getName(), Importance.HIGH, STORAGE_CLASS_DOC, "Storage", 1, Width.NONE, STORAGE_CLASS_DISPLAY, STORAGE_CLASS_RECOMMENDER ); visible.define( FORMAT_CLASS_CONFIG, Type.CLASS, AvroFormat.class.getName(), Importance.HIGH, FORMAT_CLASS_DOC, "Connector", 1, Width.NONE, FORMAT_CLASS_DISPLAY, FORMAT_CLASS_RECOMMENDER ); visible.define( TOPICS_DIR_CONFIG, Type.STRING, TOPICS_DIR_DEFAULT, Importance.HIGH, TOPICS_DIR_DOC + DIR_REGEX_DOC, "Storage", 2, Width.NONE, TOPICS_DIR_DISPLAY ); return visible; }
Source:
<code>protected IStatus run(IProgressMonitor monitor) { boolean successful = true; for (InstanceValidator validator : this.validators) { IOReporter defaultReporter = validator.createReporter(); defaultReporter.setSuccess(false); IOReport report = defaultReporter; try { ATransaction trans = log.begin(defaultReporter.getTaskName()); try { if (writer != null) { List<? extends Locatable> schemas = writer.getValidationSchemas(); validator.setSchemas(schemas.toArray(new Locatable[schemas.size()])); } IOReport result = validator.execute(new ProgressMonitorIndicator(monitor)); if (result != null) { report = result; } else { defaultReporter.setSuccess(true); } } catch (Throwable e) { defaultReporter.error(new IOMessageImpl(e.getLocalizedMessage(), e)); } finally { trans.end(); } } catch (Throwable e) { defaultReporter.error(new IOMessageImpl(e.getLocalizedMessage(), e)); } if (monitor.isCanceled()) { reset(); return Status.CANCEL_STATUS; } reportHandler.publishReport(report); if (report.isSuccess()) { <START> log.userInfo(report.getSummary()); <END> } else { log.userError(report.getSummary()); successful = false; } } reset(); if (successful) { return Status.OK_STATUS; } else { return ERROR_STATUS; } }</code><technical_language>If run in UI, mutiple validators used, this lead multiple dialogs displayed user, validator succeeded. log normal messages (e.g. info instead of userInfo) provide a general summary requesting user's attention validators completed</technical_language>

Target:
protected IStatus run(IProgressMonitor monitor) { boolean successful = true; for (InstanceValidator validator : this.validators) { IOReporter defaultReporter = validator.createReporter(); defaultReporter.setSuccess(false); IOReport report = defaultReporter; try { ATransaction trans = log.begin(defaultReporter.getTaskName()); try { if (writer != null) { List<? extends Locatable> schemas = writer.getValidationSchemas(); validator.setSchemas(schemas.toArray(new Locatable[schemas.size()])); } IOReport result = validator.execute(new ProgressMonitorIndicator(monitor)); if (result != null) { report = result; } else { defaultReporter.setSuccess(true); } } catch (Throwable e) { defaultReporter.error(new IOMessageImpl(e.getLocalizedMessage(), e)); } finally { trans.end(); } } catch (Throwable e) { defaultReporter.error(new IOMessageImpl(e.getLocalizedMessage(), e)); } if (monitor.isCanceled()) { reset(); return Status.CANCEL_STATUS; } reportHandler.publishReport(report); if (report.isSuccess()) { log.info(report.getSummary()); } else { log.error(report.getSummary()); successful = false; } } reset(); if (successful) { log.userInfo("All validations completed successfully."); return Status.OK_STATUS; } else { log.userError("There were validation failures. Please check the reports for details."); return ERROR_STATUS; } }
Source:
<code>public static boolean onLivingKnockBack(EntityLivingBase target, Entity attacker, float strength, double ratioX, double ratioZ) { <START> return !MinecraftForge.EVENT_BUS.post(new LivingKnockBackEvent(target, attacker, strength, ratioX, ratioZ)); <END> }</code><technical_language>negating result this function, avoid double-negation returning result directly</technical_language>

Target:
public static LivingKnockBackEvent onLivingKnockBack(EntityLivingBase target, Entity attacker, float strength, double ratioX, double ratioZ) { LivingKnockBackEvent event = new LivingKnockBackEvent(target, attacker, strength, ratioX, ratioZ); MinecraftForge.EVENT_BUS.post(event); return event; }
Source:
<code>public List<KeyValue> getKeyValues() { Collection<AgencyOrigin> agencyOrigins = getKeyValuesService().findAll(AgencyOrigin.class); List<KeyValue> keyValues = new ArrayList<>(); keyValues.add(new ConcreteKeyValue(KFSConstants.EMPTY_STRING, KFSConstants.EMPTY_STRING)); <START> agencyOrigins.stream() <END> .map(agencyOrigin -> new ConcreteKeyValue(agencyOrigin.getCode(), agencyOrigin.getName())) .forEach(keyValues::add); return keyValues; }</code><technical_language>add a sort here</technical_language>

Target:
public List<KeyValue> getKeyValues() { Collection<AgencyOrigin> agencyOrigins = getKeyValuesService().findAllOrderBy( AgencyOrigin.class, KFSPropertyConstants.CODE, false); List<KeyValue> keyValues = new ArrayList<>(); keyValues.add(new ConcreteKeyValue(KFSConstants.EMPTY_STRING, KFSConstants.EMPTY_STRING)); agencyOrigins.stream() .map(agencyOrigin -> new ConcreteKeyValue(agencyOrigin.getCode(), agencyOrigin.getName())) .forEach(keyValues::add); return keyValues; }
Source:
<code>public void fireProgress(float progress, String task) { if (progress > status.progress || StringUtils.equals(task, status.task)) { if (status.getPhase() == ProcessState.QUEUED) { status.setPhase(ProcessState.RUNNING); } status.setProgress(progress); status.setTask(task); if (progress > 0) { <START> long timeEalpsedMillis = <END> (new Date().getTime() - status.getCreationTime().getTime()); int estimatedCompletionMillis = (int) ((timeEalpsedMillis / progress) * timeEalpsedMillis + timeEalpsedMillis); Calendar calendar = Calendar.getInstance(); calendar.setTime(status.getCreationTime()); calendar.add(Calendar.MILLISECOND, estimatedCompletionMillis); status.setEstimatedCompletion(calendar.getTime()); } ProcessEvent event = new ProcessEvent(status, inputs, outputs); for (ProcessListener listener : listeners) { listener.progress(event); } } }</code><technical_language>typo, timeElapsedMillis</technical_language>

Target:
public void fireProgress(float progress, String task) { if (progress > status.progress || StringUtils.equals(task, status.task)) { if (status.getPhase() == ProcessState.QUEUED) { status.setPhase(ProcessState.RUNNING); } status.setProgress(progress); status.setTask(task); if (progress > 0) { long timeElapsedMillis = (new Date().getTime() - status.getCreationTime().getTime()); int estimatedCompletionMillis = (int) ((timeElapsedMillis / progress) * timeElapsedMillis + timeElapsedMillis); Calendar calendar = Calendar.getInstance(); calendar.setTime(status.getCreationTime()); calendar.add(Calendar.MILLISECOND, estimatedCompletionMillis); status.setEstimatedCompletion(calendar.getTime()); } ProcessEvent event = new ProcessEvent(status, inputs, outputs); for (ProcessListener listener : listeners) { listener.progress(event); } } }
Source:
<code><START> static List<HiveSplit> drainSplits(HiveSplitSource source) <END> throws Exception { ImmutableList.Builder<HiveSplit> splits = ImmutableList.builder(); while (!source.isFinished()) { source.getNextBatch(NOT_PARTITIONED, 100).get() .getSplits().stream() .map(HiveSplit.class::cast) .forEach(splits::add); } return splits.build(); }</code><technical_language>put tests in TestBackgroundHiveSplitLoaderForBucketedTables.java this TestBackgroundHiveSplitLoader.java class. In this specific case, I understand tests other helper methods in TestBackgroundHiveSplitLoaderForBucketedTables.java specific suit for general purposed TestBackgroundHiveSplitLoader.java. a preferred approach refactoring methods a helper class HvieSplitTestHelper (this name is up)</technical_language>

Target:
private static List<HiveSplit> drainSplits(HiveSplitSource source) throws Exception { ImmutableList.Builder<HiveSplit> splits = ImmutableList.builder(); while (!source.isFinished()) { source.getNextBatch(NOT_PARTITIONED, 100).get() .getSplits().stream() .map(HiveSplit.class::cast) .forEach(splits::add); } return splits.build(); }
Source:
<code>void searchProductLink() { String url = "<LINK_0>" + code; <START> if (!brand.getText().toString().isEmpty()) { <END> List<String> chipVals = brand.getChipValues(); url = url + " " + StringUtils.join(chipVals, ' '); } if (!name.getText().toString().isEmpty()) { url = url + " " + name.getText().toString(); } url = url + " " + getString(R.string.official_website); CustomTabsIntent customTabsIntent = CustomTabsHelper.getCustomTabsIntent(activity.getBaseContext(), null); CustomTabActivityHelper.openCustomTab(activity, customTabsIntent, Uri.parse(url), new WebViewFallback()); }</code><technical_language>condition changed !brand.getChipValues().isEmpty()</technical_language>

Target:
void searchProductLink() { String url = "<LINK_0>" + code; if (!brand.getChipAndTokenValues().isEmpty()) { List<String> brandNames = brand.getChipAndTokenValues(); url = url + " " + StringUtils.join(brandNames, ' '); } if (!name.getText().toString().isEmpty()) { url = url + " " + name.getText().toString(); } url = url + " " + getString(R.string.official_website); CustomTabsIntent customTabsIntent = CustomTabsHelper.getCustomTabsIntent(activity.getBaseContext(), null); CustomTabActivityHelper.openCustomTab(activity, customTabsIntent, Uri.parse(url), new WebViewFallback()); }
Source:
<code>protected void patch(Context context, HttpServletRequest request, String apiCategory, String model, UUID id, Patch patch) throws AuthorizeException, SQLException { Item item = itemService.find(obtainContext(), id); if (item == null) { throw new ResourceNotFoundException(apiCategory + "." + model + " with id: " + id + " not found"); } if (item.getTemplateItemOf() != null) { <START> throw new DSpaceBadRequestException("The given ID resolved to a template item"); <END> } ItemRest itemRest = dsoPatch.patch(findOne(context, id), patch.getOperations()); updateDSpaceObject(item, itemRest); }</code><technical_language>recommend updating this error message slightly return ID (as more useful reference problematic object). So, "The ID " + id + " resolved a template item"</technical_language>

Target:
protected void patch(Context context, HttpServletRequest request, String apiCategory, String model, UUID id, Patch patch) throws AuthorizeException, SQLException { Item item = itemService.find(obtainContext(), id); if (item == null) { throw new ResourceNotFoundException(apiCategory + "." + model + " with id: " + id + " not found"); } if (item.getTemplateItemOf() != null) { throw new DSpaceBadRequestException("The ID: " + id + " resolved to a template item"); } ItemRest itemRest = dsoPatch.patch(findOne(context, id), patch.getOperations()); updateDSpaceObject(item, itemRest); }
Source:
<code>protected void activate(BundleContext bundleContext) { XmlDocumentReader<List<?>> thingTypeReader = new ThingDescriptionReader(); thingTypeTracker = new XmlDocumentBundleTracker<List<?>>(bundleContext, XML_DIRECTORY, thingTypeReader, this, READY_MARKER, readyService); <START> trackerJob = scheduler.schedule(() -> { <END> thingTypeTracker.open(); }, 0, TimeUnit.SECONDS); }</code><technical_language>submit</technical_language>

Target:
protected void activate(BundleContext bundleContext) { XmlDocumentReader<List<?>> thingTypeReader = new ThingDescriptionReader(); thingTypeTracker = new XmlDocumentBundleTracker<List<?>>(bundleContext, XML_DIRECTORY, thingTypeReader, this, READY_MARKER, readyService); trackerJob = scheduler.submit(() -> { thingTypeTracker.open(); }); }
Source:
<code>private void saveWithDifferentEncoding(Path file, boolean selectedOnly, Charset encoding, Set<Character> encodingProblems, SavePreferences.DatabaseSaveType saveType) throws SaveException { DialogPane pane = new DialogPane(); VBox vbox = new VBox(); vbox.getChildren().addAll( <START> new Text(Localization.lang("The chosen encoding '%0' could not encode the following characters:", encoding.displayName())), <END> new Text(encodingProblems.stream().map(Object::toString).collect(Collectors.joining("."))), new Text(Localization.lang("What do you want to do?"))); pane.setContent(vbox); ButtonType tryDifferentEncoding = new ButtonType(Localization.lang("Try different encoding"), ButtonBar.ButtonData.OTHER); ButtonType ignore = new ButtonType(Localization.lang("Ignore"), ButtonBar.ButtonData.APPLY); boolean saveWithDifferentEncoding = dialogService .showCustomDialogAndWait(Localization.lang("Save library"), pane, ignore, tryDifferentEncoding) .filter(buttonType -> buttonType.equals(tryDifferentEncoding)) .isPresent(); if (saveWithDifferentEncoding) { Optional<Charset> newEncoding = dialogService.showChoiceDialogAndWait(Localization.lang("Save library"), Localization.lang("Select new encoding"), Localization.lang("Save library"), encoding, Encodings.getCharsets()); if (newEncoding.isPresent()) { panel.getBibDatabaseContext().getMetaData().setEncoding(newEncoding.get(), ChangePropagation.DO_NOT_POST_EVENT); saveDatabase(file, selectedOnly, newEncoding.get(), saveType); } } }</code><technical_language>intend fine</technical_language>

Target:
private void saveWithDifferentEncoding(Path file, boolean selectedOnly, Charset encoding, Set<Character> encodingProblems, SavePreferences.DatabaseSaveType saveType) throws SaveException { DialogPane pane = new DialogPane(); VBox vbox = new VBox(); vbox.getChildren().addAll( new Text(Localization.lang("The chosen encoding '%0' could not encode the following characters:", encoding.displayName())), new Text(encodingProblems.stream().map(Object::toString).collect(Collectors.joining("."))), new Text(Localization.lang("What do you want to do?")) ); pane.setContent(vbox); ButtonType tryDifferentEncoding = new ButtonType(Localization.lang("Try different encoding"), ButtonBar.ButtonData.OTHER); ButtonType ignore = new ButtonType(Localization.lang("Ignore"), ButtonBar.ButtonData.APPLY); boolean saveWithDifferentEncoding = dialogService .showCustomDialogAndWait(Localization.lang("Save library"), pane, ignore, tryDifferentEncoding) .filter(buttonType -> buttonType.equals(tryDifferentEncoding)) .isPresent(); if (saveWithDifferentEncoding) { Optional<Charset> newEncoding = dialogService.showChoiceDialogAndWait(Localization.lang("Save library"), Localization.lang("Select new encoding"), Localization.lang("Save library"), encoding, Encodings.getCharsets()); if (newEncoding.isPresent()) { libraryTab.getBibDatabaseContext().getMetaData().setEncoding(newEncoding.get(), ChangePropagation.DO_NOT_POST_EVENT); saveDatabase(file, selectedOnly, newEncoding.get(), saveType); } } }
Source:
<code>public void run() { try { Problem current = toProcess.takeFirst(); while <START> (current != REPORTING_DONE) { <END> handleProblem(current.getSeverity(), current.getReportable()); current = toProcess.takeFirst(); } } catch (InterruptedException e) { logger.log(Level.FINE, "Reporter thread " + Thread.currentThread().getName() + " was interrupted"); Thread.currentThread().interrupt(); } }</code><technical_language>(current = toProcess.takeFirst()) != REPORTING_NONE)</technical_language>

Target:
public void run() { try { Problem current; while ((current = toProcess.takeFirst()) != REPORTING_DONE) { handleProblem(current.getSeverity(), current.getReportable()); } } catch (InterruptedException e) { logger.log(Level.FINE, "Reporter thread '" + Thread.currentThread().getName() + "' was interrupted"); Thread.currentThread().interrupt(); } }
Source:
<code>private void sendError(ChannelHandlerContext ctx, HttpResponseStatus status) { HttpResponse response = new DefaultHttpResponse(HTTP_1_1, status); <START> response.setHeader(CONTENT_TYPE, "org/apache/tajo/storage/text/plain; charset=UTF-8"); <END> response.setContent(ChannelBuffers.copiedBuffer( "Failure: " + status.toString() + "\r\n", CharsetUtil.UTF_8)); ctx.getChannel().write(response).addListener(ChannelFutureListener.CLOSE); }</code><technical_language>intend change it</technical_language>

Target:
private void sendError(ChannelHandlerContext ctx, HttpResponseStatus status) { HttpResponse response = new DefaultHttpResponse(HTTP_1_1, status); response.setHeader(CONTENT_TYPE, "text/plain; charset=UTF-8"); response.setContent(ChannelBuffers.copiedBuffer( "Failure: " + status.toString() + "\r\n", CharsetUtil.UTF_8)); ctx.getChannel().write(response).addListener(ChannelFutureListener.CLOSE); }
Source:
<code>public void setPartitionSpilledLookupSourceHandle(int partitionIndex, SpilledLookupSourceHandle spilledLookupSourceHandle) { requireNonNull(spilledLookupSourceHandle, "spilledLookupSourceHandle is null"); boolean completed; rwLock.writeLock().lock(); try { if (destroyed.isDone()) { spilledLookupSourceHandle.dispose(); return; } checkState(!spilledPartitions.containsKey(partitionIndex), "Partition already set as spilled"); spilledPartitions.put(partitionIndex, spilledLookupSourceHandle); spillingInfo = new SpillingInfo(spillingInfo.spillEpoch() + 1, spilledPartitions.keySet()); if (partitions[partitionIndex] != null) { completed = false; } else { partitionsSet++; completed = partitionsSet == partitions.length; } partitions[partitionIndex] = () -> spilledLookupSource; if (lookupSourceSupplier != null) { verify(!completed, "lookupSourceSupplier already exist, so should not think completing now"); verify(!outer, "We are about to reset lookupSourceSupplier which is tracking for outer join's sake"); <START> verify(partitions.length > 1, "We are about to create partitioned lookup source for only one partition"); <END> lookupSourceSupplier = createPartitionedLookupSourceSupplier(ImmutableList.copyOf(partitions), hashChannelTypes, outer); } } finally { rwLock.writeLock().unlock(); } if (completed) { supplyLookupSources(); } }</code><technical_language>rewrite messages</technical_language>

Target:
public void setPartitionSpilledLookupSourceHandle(int partitionIndex, SpilledLookupSourceHandle spilledLookupSourceHandle) { requireNonNull(spilledLookupSourceHandle, "spilledLookupSourceHandle is null"); boolean completed; lock.writeLock().lock(); try { if (destroyed.isDone()) { spilledLookupSourceHandle.dispose(); return; } checkState(!spilledPartitions.containsKey(partitionIndex), "Partition already set as spilled"); spilledPartitions.put(partitionIndex, spilledLookupSourceHandle); spillingInfo = new SpillingInfo(spillingInfo.spillEpoch() + 1, spilledPartitions.keySet()); if (partitions[partitionIndex] != null) { completed = false; } else { partitionsSet++; completed = (partitionsSet == partitions.length); } partitions[partitionIndex] = () -> spilledLookupSource; if (lookupSourceSupplier != null) { verify(!completed, "lookupSourceSupplier already exist when completing"); verify(!outer, "It is not possible to reset lookupSourceSupplier which is tracking for outer join"); verify(partitions.length > 1, "Spill occurred when only one partition"); lookupSourceSupplier = createPartitionedLookupSourceSupplier(ImmutableList.copyOf(partitions), hashChannelTypes, outer); closeCachedLookupSources(); } else { verify(suppliedLookupSources.isEmpty(), "There are cached LookupSources even though lookupSourceSupplier does not exist"); } } finally { lock.writeLock().unlock(); } if (completed) { supplyLookupSources(); } }
Source:
<code>private void showFormatUpgradeConfirmIfRequired() { StoragePool dc = getEntity(); StorageFormatUpgradeConfirmationModel model = new StorageFormatUpgradeConfirmationModel(); boolean shouldDisplay = model.initialize( selectedStorageDomains, dc, "OnShowFormatUpgrade", "Cancel", this); if (shouldDisplay) { <START> setConfirmWindow(model); <END> } else { UICommand okCommand = UICommand.createDefaultOkUiCommand( "OnShowFormatUpgrade", this); okCommand.execute(); } }</code><technical_language>please add new HelpTag HashName (as in StorageListModel)</technical_language>

Target:
private void showFormatUpgradeConfirmIfRequired() { StoragePool dc = getEntity(); StorageFormatUpgradeConfirmationModel model = new StorageFormatUpgradeConfirmationModel(); boolean shouldDisplay = model.initialize( selectedStorageDomains, dc, "OnShowFormatUpgrade", "Cancel", this); if (shouldDisplay) { setConfirmWindow(model); model.setHelpTag(HelpTag.attach_storage_from_dc_confirmation); model.setHashName("attach_storage_from_dc_confirmation"); } else { UICommand okCommand = UICommand.createDefaultOkUiCommand( "OnShowFormatUpgrade", this); okCommand.execute(); } }
Source:
<code>public void abortProcessInstances(List<Long> processInstanceIds) { <START> processInstanceIds.stream().filter(processInstanceId -> !hasParentProcessInProcessInstanceList(null, processInstanceId, processInstanceIds)) <END> .forEach(processInstanceId -> abortProcessInstance(processInstanceId)); }</code><technical_language>if sort process instances based id, start aborting highest first? a child process a higher id parent</technical_language>

Target:
public void abortProcessInstances(List<Long> processInstanceIds) { processInstanceIds.stream().filter(processInstanceId -> !hasAbortedParentProcessInProcessInstanceList(null, processInstanceId, processInstanceIds)) .forEach(processInstanceId -> abortProcessInstance(processInstanceId)); }
Source:
<code>public void getJobCreatedNotification() throws IOException, SignatureException { final UUID notificationUUID = client.putJobCreatedNotificationRegistrationSpectraS3( new PutJobCreatedNotificationRegistrationSpectraS3Request("test@test.test")) .getJobCreatedNotificationRegistrationResult().getId(); <START> final GetJobCreatedNotificationRegistrationSpectraS3Response response = client <END> .getJobCreatedNotificationRegistrationSpectraS3(new GetJobCreatedNotificationRegistrationSpectraS3Request(notificationUUID)); assertThat(response.getStatusCode(), is(200)); }</code><technical_language>Is this notification removed? if not, this potential affect other tests</technical_language>

Target:
public void getJobCreatedNotification() throws IOException, SignatureException { UUID notificationUUID = null; try { notificationUUID = client.putJobCreatedNotificationRegistrationSpectraS3( new PutJobCreatedNotificationRegistrationSpectraS3Request("test@test.test")) .getJobCreatedNotificationRegistrationResult().getId(); final GetJobCreatedNotificationRegistrationSpectraS3Response response = client .getJobCreatedNotificationRegistrationSpectraS3(new GetJobCreatedNotificationRegistrationSpectraS3Request(notificationUUID)); assertThat(response.getStatusCode(), is(200)); } finally { if (notificationUUID != null) { client.deleteJobCreatedNotificationRegistrationSpectraS3( new DeleteJobCreatedNotificationRegistrationSpectraS3Request(notificationUUID)); } } }
Source:
<code>public void minimalConfig() { <START> ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("outbound-adapter-parser.xml", <END> this.getClass()); CassandraMessageHandler<?> handler = TestUtils.getPropertyValue(context.getBean("outbound1.adapter"), "handler", CassandraMessageHandler.class); assertEquals("outbound1.adapter", TestUtils.getPropertyValue(handler, "componentName")); assertEquals(CassandraMessageHandler.Type.INSERT, TestUtils.getPropertyValue(handler, "mode")); assertEquals(context.getBean("cassandraTemplate"), TestUtils.getPropertyValue(handler, "cassandraTemplate")); assertEquals(context.getBean("writeOptions"), TestUtils.getPropertyValue(handler, "writeOptions")); context.close(); }</code><technical_language>this test class based @RunWith(SpringJUnit4ClassRunner.class) anyway: context loading - performance! Yes, outbound-adapter-parser.xml renamed CassandraOutboundAdapterParserTests-context.xml loaded Spring Test Framework</technical_language>

Target:
public void minimalConfig() { CassandraMessageHandler<?> handler = TestUtils.getPropertyValue(context.getBean("outbound1.adapter"), "handler", CassandraMessageHandler.class); assertEquals("outbound1.adapter", TestUtils.getPropertyValue(handler, "componentName")); assertEquals(CassandraMessageHandler.Type.INSERT, TestUtils.getPropertyValue(handler, "mode")); assertEquals(context.getBean("cassandraTemplate"), TestUtils.getPropertyValue(handler, "cassandraTemplate")); assertEquals(context.getBean("writeOptions"), TestUtils.getPropertyValue(handler, "writeOptions")); }
Source:
<code>public Builder authorization(String scheme, byte[] auth) { <START> this.authInfos = Lists.newArrayList(); <END> this.authInfos.add(new AuthInfo(scheme, (auth != null) ? Arrays.copyOf(auth, auth.length) : null)); return this; }</code><technical_language>This call authorization(List<AuthInfo> authInfos). E.g. return authorization(Lists.newArrayList(new AuthInfo(scheme, (auth != null) ? Arrays.copyOf(auth, auth.length) : null)));</technical_language>

Target:
public Builder authorization(String scheme, byte[] auth) { return authorization(ImmutableList.of(new AuthInfo(scheme, (auth != null) ? Arrays.copyOf(auth, auth.length) : null))); }
Source:
<code>public Topology getTopology(Map<String, String> options) { int size = getOptionAsInteger(options, BATCH_SIZE_OPT, DEFAULT_BATCH_SIZE); int timer = getOptionAsInteger(options, BATCH_THRESHOLD_MS_OPT, DEFAULT_BATCH_THRESHOLD_MS); <START> return Topology.builder().addComputation(() -> createComputation(size, timer), getIOs()).build(); <END> }</code><technical_language>Watch out naming: timer/threshold, getIOs/getStreamMapping</technical_language>

Target:
public Topology getTopology(Map<String, String> options) { int size = getOptionAsInteger(options, BATCH_SIZE_OPT, DEFAULT_BATCH_SIZE); int threshold = getOptionAsInteger(options, BATCH_THRESHOLD_MS_OPT, DEFAULT_BATCH_THRESHOLD_MS); return Topology.builder().addComputation(() -> createComputation(size, threshold), getStreamMapping()).build(); }
Source:
<code>public void initializeApplication(ArtifactFactory factory, MavenProject project, ArtifactResolver resolver, ArtifactRepository localRepository) throws MojoFailureException { if (configuration.getApplication() == null) { Artifact artifact = resolveMavenProjectArtifact(factory, project, resolver, localRepository); configuration.setApplication(artifact.getFile()); log.info("No application configured. Using project artifact: " + configuration.getApplication()); if (configuration.getApplicationName() == null) { configuration.setApplicationName(artifact.getArtifactId()); } } else { <START> if (configuration.getApplicationName() == null) { <END> configuration.setApplicationName(configuration.getApplication().getName()); } } }</code><technical_language>if application name is empty string</technical_language>

Target:
public void initializeApplication(ArtifactFactory factory, MavenProject project, ArtifactResolver resolver, ArtifactRepository localRepository) throws MojoFailureException { if (configuration.getApplication() == null) { Artifact artifact = resolveMavenProjectArtifact(factory, project, resolver, localRepository); configuration.setApplication(artifact.getFile()); log.info("No application configured. Using project artifact: " + configuration.getApplication()); if (configuration.getApplicationName() == null) { configuration.setApplicationName(artifact.getArtifactId()); } } else { if (StringUtils.isBlank(configuration.getApplicationName())) { configuration.setApplicationName(configuration.getApplication().getName()); } } }
Source:
<code>public String script() throws IOException { return DockerRun.enlist( Iterables.concat( DockerRun.scripts( this.profile.read(), "/p/entry[@key='install']" ), DockerRun.scripts(this.node(), "entry[@key='script']"), DockerRun.scripts( <START> this.profile.read(), "/p/entry[@key='uninstall']" <END> ) ) ); }</code><technical_language>in this case, uninstall part executed if script part succeeds, right? If script fails, uninstallation..</technical_language>

Target:
public String script() throws IOException { final Iterable<String> uninstall; if (this.profile.read().nodes("/p/entry[@key='uninstall']").isEmpty()) { uninstall = Collections.emptyList(); } else { uninstall = Iterables.concat( Lists.newArrayList("function", "clean_up()", "{"), DockerRun.scripts( this.profile.read(), "/p/entry[@key='uninstall']" ), Lists.newArrayList("}", ";"), Lists.newArrayList("trap", "clean_up", "EXIT", ";") ); } return DockerRun.enlist( Iterables.concat( uninstall, DockerRun.scripts( this.profile.read(), "/p/entry[@key='install']" ), DockerRun.scripts(this.node(), "entry[@key='script']") ) ); }
Source:
<code>public static RequestOptions getDefault() { <START> return new RequestOptions(Stripe.apiKey, Stripe.apiVersion, null, null, 30 * 1000, 80 * 1000); <END> }</code><technical_language>mind declaring new constants DEFAULT_READ_TIMEOUT = 80*1000 DEFAULT_CONNECTION_TIMEOUT = 30*1000 named constants here</technical_language>

Target:
public static RequestOptions getDefault() { return new RequestOptions(Stripe.apiKey, Stripe.apiVersion, null, null, DEFAULT_CONNECT_TIMEOUT, DEFAULT_READ_TIMEOUT); }
Source:
<code><START> HeadlessEnvironment(Name... modules) { <END> super(modules); }</code><technical_language>removal of public breaks NameGenerator module - generally HeadlessEnvironment is for other use, IDE is in-use if lack module facade in workspace</technical_language>

Target:
public HeadlessEnvironment(Name... modules) { super(modules); }
Source:
<code>private void syncEntity(Entity ent, Set<? extends Entity> observers, boolean forceDestroy) { for (Entity observer : observers) { if (ent == observer) { continue; } if (!(observer instanceof Player)) { continue; } Player player = (Player) observer; if (!player.isOnline()) { continue; } PlayerNetworkComponent network = player.getNetwork(); <START> int view = network.getSyncDistance(); <END> boolean spawn, sync, destroy; spawn = sync = destroy = false; final SpoutPhysicsComponent physics = (SpoutPhysicsComponent) ent.getPhysics(); if (forceDestroy || ent.isRemoved() || physics.getTransformLive().getPosition().distanceSquared(player.getPhysics().getPosition()) > view * view || player.isInvisible(ent)) { destroy = true; } else if (network.hasSpawned(ent)) { sync = true; } else { spawn = true; } network.syncEntity(ent, physics.getTransformLive(), spawn, destroy, sync); } }</code><technical_language>naming</technical_language>

Target:
private void syncEntity(Entity ent, Set<? extends Entity> observers, boolean forceDestroy) { for (Entity observer : observers) { if (ent == observer) { continue; } if (!(observer instanceof Player)) { continue; } Player player = (Player) observer; if (!player.isOnline()) { continue; } PlayerNetworkComponent network = player.getNetwork(); int syncDistance = network.getSyncDistance(); boolean spawn, sync, destroy; spawn = sync = destroy = false; final SpoutPhysicsComponent physics = (SpoutPhysicsComponent) ent.getPhysics(); if (forceDestroy || ent.isRemoved() || physics.getTransformLive().getPosition().distanceSquared(player.getPhysics().getPosition()) > syncDistance * syncDistance || player.isInvisible(ent)) { destroy = true; } else if (network.hasSpawned(ent)) { sync = true; } else { spawn = true; } network.syncEntity(ent, physics.getTransformLive(), spawn, destroy, sync); } }
Source:
<code>protected void collectValidationErrors(LibraryType object, LibraryType beforeChange, List<ValidationError> errors) throws IOException { if ((ValidationUtils.isSetAndChanged(LibraryType::getPlatformType, object, beforeChange) || ValidationUtils.isSetAndChanged(LibraryType::getDescription, object, beforeChange)) && libraryTypeDao.getByPlatformAndDescription(object.getPlatformType(), object.getDescription()) != null) { errors.add(new ValidationError("description", "There is already a library type with this description for platform: " + object.getPlatformType().getKey())); } long libUsage = libraryTypeDao.getUsageByLibraries(beforeChange); long tempUsage = libraryTypeDao.getUsageByLibraryTemplates(beforeChange); if ((libUsage > 0L || tempUsage > 0L) && ValidationUtils.isSetAndChanged(LibraryType::getPlatformType, object, beforeChange)) { errors.add(new ValidationError("platform", <START> String.format("Cannot be changed because library type is already used by %d librar%s and %d library template%s", libUsage, <END> libUsage == 1L ? "y" : "ies", tempUsage, tempUsage == 1L ? "" : "s"))); } }</code><technical_language>I feel a build strings. a static method in interface takes a bool returns singular plural enum values a function generate string count+noun maker. a thought</technical_language>

Target:
protected void collectValidationErrors(LibraryType object, LibraryType beforeChange, List<ValidationError> errors) throws IOException { if ((ValidationUtils.isSetAndChanged(LibraryType::getPlatformType, object, beforeChange) || ValidationUtils.isSetAndChanged(LibraryType::getDescription, object, beforeChange)) && libraryTypeDao.getByPlatformAndDescription(object.getPlatformType(), object.getDescription()) != null) { errors.add(new ValidationError("description", "There is already a library type with this description for platform: " + object.getPlatformType().getKey())); } long libUsage = libraryTypeDao.getUsageByLibraries(beforeChange); long tempUsage = libraryTypeDao.getUsageByLibraryTemplates(beforeChange); if ((libUsage > 0L || tempUsage > 0L) && ValidationUtils.isSetAndChanged(LibraryType::getPlatformType, object, beforeChange)) { errors.add(new ValidationError("platform", String.format("Cannot be changed because library type is already used by %d %s and %d library %s", libUsage, Pluralizer.libraries(libUsage), tempUsage, Pluralizer.templates(tempUsage)))); } }
Source:
<code>public void testMessageCount() throws Exception { String topicName = "myTopic"; String groupId = "groupId"; AmqpConsumerAdapter adapter = createAdapterWithNonDurableConf(topicName, groupId, false); when(mockChannel.messageCount(anyString())).thenReturn(42L); adapter.subscribe((jsonMessage, ackHandler) -> { }); verify(mockChannel).exchangeDeclare(topicName, "fanout", false, true, null); Optional<Long> answer = Optional.of(42L); Optional<Long> result = adapter.messageCount(); verify(mockChannel, times(1)).messageCount(anyString()); <START> assertEquals(result, answer); <END> }</code><technical_language>nit: Expected argument in assertEquals</technical_language>

Target:
public void testMessageCount() throws Exception { String topicName = "myTopic"; String groupId = "groupId"; AmqpConsumerAdapter adapter = createAdapterWithNonDurableConf(topicName, groupId, false); when(mockChannel.messageCount(anyString())).thenReturn(42L); adapter.subscribe((jsonMessage, ackHandler) -> { }); verify(mockChannel).exchangeDeclare(topicName, "fanout", false, true, null); Optional<Long> answer = Optional.of(42L); Optional<Long> result = adapter.messageCount(); verify(mockChannel, times(1)).messageCount(anyString()); assertEquals(answer, result); }
Source:
<code>public synchronized String toString(Calendar cal, Timestamp x, boolean withTimeZone) { if (x.getTime() == PGStatement.DATE_POSITIVE_INFINITY) { return "infinity"; } else if (x.getTime() == PGStatement.DATE_NEGATIVE_INFINITY) { return "-infinity"; } cal = setupCalendar(cal); long timeMillis = x.getTime(); int nanos = x.getNanos(); if (nanos >= MAX_NANOS_BEFORE_WRAP_ON_ROUND) { nanos = 0; timeMillis++; } else if (nanos % 1000 >= 500) { <START> nanos = nanos + 1000 - nanos % 1000; <END> } cal.setTimeInMillis(timeMillis); sbuf.setLength(0); appendDate(sbuf, cal); sbuf.append(' '); appendTime(sbuf, cal, nanos); if (withTimeZone) { appendTimeZone(sbuf, cal); } appendEra(sbuf, cal); return sbuf.toString(); }</code><technical_language>appears appendTime simply truncates micro precision. nanos += 1000; sufficient here</technical_language>

Target:
public synchronized String toString(Calendar cal, Timestamp x, boolean withTimeZone) { if (x.getTime() == PGStatement.DATE_POSITIVE_INFINITY) { return "infinity"; } else if (x.getTime() == PGStatement.DATE_NEGATIVE_INFINITY) { return "-infinity"; } cal = setupCalendar(cal); long timeMillis = x.getTime(); int nanos = x.getNanos(); if (nanos >= MAX_NANOS_BEFORE_WRAP_ON_ROUND) { nanos = 0; timeMillis++; } else if (nanosExceed499(nanos)) { nanos += 1000 - nanos % 1000; } cal.setTimeInMillis(timeMillis); sbuf.setLength(0); appendDate(sbuf, cal); sbuf.append(' '); appendTime(sbuf, cal, nanos); if (withTimeZone) { appendTimeZone(sbuf, cal); } appendEra(sbuf, cal); return sbuf.toString(); }
Source:
<code>protected List<String> getKotlinCompilerOptions(boolean testOnly) { <START> if (!isKotlin) { <END> return ImmutableList.of(); } if (!getHasKotlinAndroidExtensions()) { return super.getKotlinCompilerOptions(testOnly); } ImmutableList.Builder<String> extraKotlincArgs = ImmutableList.builder(); StringBuilder plugin = new StringBuilder(); StringBuilder resDirs = new StringBuilder(); StringBuilder options = new StringBuilder(); String module = getProject().getPath().replace(":", File.separator).substring(1) + File.separator; getResVariantDirs() .forEach( (String dir, String variant) -> { String pathToRes = module + dir; resDirs.append(KOTLIN_EXTENSIONS_OPTION); resDirs.append("variant="); resDirs.append(variant); resDirs.append(";"); resDirs.append(pathToRes); resDirs.append(","); }); plugin.append("-Xplugin="); plugin.append(KotlinManager.KOTLIN_LIBRARIES_LOCATION); plugin.append(File.separator); plugin.append("kotlin-android-extensions.jar"); options.append(resDirs.toString()); options.append(KOTLIN_EXTENSIONS_OPTION); options.append("package="); options.append(getResPackage()); if (getHasExperimentalKotlinAndroidExtensions()) { options.append(","); options.append(KOTLIN_EXTENSIONS_OPTION); options.append("experimental=true"); } extraKotlincArgs.add(plugin.toString()); extraKotlincArgs.add("-P"); extraKotlincArgs.add(options.toString()); extraKotlincArgs.addAll(super.getKotlinCompilerOptions(testOnly)); return extraKotlincArgs.build(); }</code><technical_language>this is isKotlinAndroid</technical_language>

Target:
protected List<String> getKotlinCompilerOptions(boolean testOnly) { if (!getHasKotlinAndroidExtensions()) { return super.getKotlinCompilerOptions(testOnly); } ImmutableList.Builder<String> extraKotlincArgs = ImmutableList.builder(); StringBuilder plugin = new StringBuilder(); StringBuilder resDirs = new StringBuilder(); StringBuilder options = new StringBuilder(); String module = getProject().getPath().replace(":", File.separator).substring(1) + File.separator; getResVariantDirs() .forEach( (String dir, String variant) -> { String pathToRes = module + dir; resDirs.append(KOTLIN_EXTENSIONS_OPTION); resDirs.append("variant="); resDirs.append(variant); resDirs.append(";"); resDirs.append(pathToRes); resDirs.append(","); }); plugin.append("-Xplugin="); plugin.append(KotlinManager.KOTLIN_LIBRARIES_LOCATION); plugin.append(File.separator); plugin.append("kotlin-android-extensions.jar"); options.append(resDirs.toString()); options.append(KOTLIN_EXTENSIONS_OPTION); options.append("package="); options.append(getResPackage()); if (getHasExperimentalKotlinAndroidExtensions()) { options.append(","); options.append(KOTLIN_EXTENSIONS_OPTION); options.append("experimental=true"); } extraKotlincArgs.add(plugin.toString()); extraKotlincArgs.add("-P"); extraKotlincArgs.add(options.toString()); extraKotlincArgs.addAll(super.getKotlinCompilerOptions(testOnly)); return extraKotlincArgs.build(); }
Source:
<code>public void shouldFailWhenNoUsersOrEmailAreProvided() throws OperationException { DocumentModel doc = session.getDocument(new PathRef("/src")); OperationContext ctx = new OperationContext(session); ctx.setInput(doc); Map<String, Object> params = getParametersForAddOperation(null, null, null, "Write", null, null, null, false, false, null); try { automationService.run(ctx, AddPermission.ID, params); fail(); } catch (Exception e) { <START> assertEquals(IllegalParameterException.class, e.getClass()); <END> String expectedMsg = "'users' or 'email' parameters must be set"; assertEquals(expectedMsg, ((IllegalParameterException) e).getOriginalMessage()); } }</code><technical_language>Please catch (IllegalParameterException e) (same in other methods)</technical_language>

Target:
public void shouldFailWhenNoUsersOrEmailAreProvided() throws OperationException { DocumentModel doc = session.getDocument(new PathRef("/src")); assertNotNull(doc.getACP()); assertNull(doc.getACP().getACL("local")); OperationContext ctx = new OperationContext(session); ctx.setInput(doc); Map<String, Object> params = getParametersForAddOperation(null, null, null, "Write", null, null, null, false, false, null); try { automationService.run(ctx, AddPermission.ID, params); fail(); } catch (IllegalParameterException e) { String expectedMsg = "'users' or 'email' parameters must be set"; assertEquals(expectedMsg, e.getOriginalMessage()); verifyZeroInteractions(userManager); } }
Source:
<code>public Environment(DataFetchingEnvironment environment) { Map<String, Object> args = environment.getArguments(); requestScope = (GraphQLRequestScope) environment.getContext(); filters = Optional.ofNullable((String) args.get(ModelBuilder.ARGUMENT_FILTER)); offset = Optional.ofNullable((String) args.get(ModelBuilder.ARGUMENT_AFTER)); first = Optional.ofNullable((String) args.get(ModelBuilder.ARGUMENT_FIRST)); sort = Optional.ofNullable((String) args.get(ModelBuilder.ARGUMENT_SORT)); parentType = environment.getParentType(); outputType = environment.getFieldType(); rawSource = environment.getSource(); if (rawSource instanceof PersistentResourceContainer) { parentResource = ((PersistentResourceContainer) rawSource).getPersistentResource(); <START> } else if (rawSource instanceof PersistentResource) { <END> parentResource = (PersistentResource) rawSource; } else { parentResource = null; } field = environment.getFields().get(0); this.ids = Optional.ofNullable((List<String>) args.get(ModelBuilder.ARGUMENT_IDS)); List<Map<String, Object>> data = (List<Map<String, Object>>) args.get(ModelBuilder.ARGUMENT_DATA); this.data = Optional.ofNullable(data); }</code><technical_language>this true anymore</technical_language>

Target:
public Environment(DataFetchingEnvironment environment) { Map<String, Object> args = environment.getArguments(); requestScope = (GraphQLRequestScope) environment.getContext(); filters = Optional.ofNullable((String) args.get(ModelBuilder.ARGUMENT_FILTER)); offset = Optional.ofNullable((String) args.get(ModelBuilder.ARGUMENT_AFTER)); first = Optional.ofNullable((String) args.get(ModelBuilder.ARGUMENT_FIRST)); sort = Optional.ofNullable((String) args.get(ModelBuilder.ARGUMENT_SORT)); parentType = environment.getParentType(); outputType = environment.getFieldType(); rawSource = environment.getSource(); container = isRoot() ? new RootContainer() : (GraphQLContainer) rawSource; if (rawSource instanceof PersistentResourceContainer) { parentResource = ((PersistentResourceContainer) rawSource).getPersistentResource(); } else { parentResource = null; } field = environment.getFields().get(0); this.ids = Optional.ofNullable((List<String>) args.get(ModelBuilder.ARGUMENT_IDS)); List<Map<String, Object>> data = (List<Map<String, Object>>) args.get(ModelBuilder.ARGUMENT_DATA); this.data = Optional.ofNullable(data); }
Source:
<code>public void testSingleQueryWithJoins() throws Exception { Properties props = PropertiesUtil.deepCopy(TestUtil.TEST_PROPERTIES); Connection conn = DriverManager.getConnection(getUrl(), props); try { prepareTableWithValues(conn, 100); <START> String query = "SELECT count(*) FROM " + tableName +" as A tablesample (45), "+joinedTableName+" as B tablesample (75) where A.i1=B.i1"; <END> System.out.println(query); ResultSet rs = conn.createStatement().executeQuery(query); assertTrue(rs.next()); assertEquals(31, rs.getInt(1)); } finally { conn.close(); } }</code><technical_language>this good assert explain plan expected changes made</technical_language>

Target:
public void testSingleQueryWithJoins() throws Exception { Properties props = PropertiesUtil.deepCopy(TestUtil.TEST_PROPERTIES); Connection conn = DriverManager.getConnection(getUrl(), props); try { prepareTableWithValues(conn, 100); String query = "SELECT count(*) FROM " + tableName +" as A tablesample (45), "+joinedTableName+" as B tablesample (75) where A.i1=B.i1"; ResultSet rs = conn.createStatement().executeQuery(query); assertTrue(rs.next()); assertEquals(31, rs.getInt(1)); } finally { conn.close(); } }
Source:
<code>public static boolean isAlive(VirtualChannel channel, int pid, Launcher launcher) throws IOException, InterruptedException { Boolean working = workingLaunchers.get(launcher); if (working == null) { <START> working = !_isAlive(channel, 9999, launcher); <END> workingLaunchers.put(launcher, working); if (!working) { LOGGER.log(Level.WARNING, "{0} on {1} does not seem able to determine whether processes are alive or not", new Object[] {launcher, channel}); } } if (!working) { return true; } return _isAlive(channel, pid, launcher); }</code><technical_language>choose 9999? a valid pid</technical_language>

Target:
public static boolean isAlive(VirtualChannel channel, int pid, Launcher launcher) throws IOException, InterruptedException { Boolean working = workingLaunchers.get(launcher); if (working == null) { working = !_isAlive(channel, 9999, launcher); workingLaunchers.put(launcher, working); if (working) { LOGGER.log(Level.FINE, "{0} on {1} appears to be working", new Object[] {launcher, channel}); } else { LOGGER.log(Level.WARNING, "{0} on {1} does not seem able to determine whether processes are alive or not", new Object[] {launcher, channel}); } } if (!working) { return true; } return _isAlive(channel, pid, launcher); }