auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void addEmail(Player player, String email) { String playerName = player.getName().toLowerCase(); if (playerCache.isAuthenticated(playerName)) { PlayerAuth auth = playerCache.getAuth(playerName); final String currentEmail = auth.getEmail(); if (!Utils.isEmailEmpty(currentEmail)) { service.send(player, MessageKey.USAGE_CHANGE_EMAIL); } else if (!validationService.validateEmail(email)) { service.send(player, MessageKey.INVALID_EMAIL); } else if (!validationService.isEmailFreeForRegistration(email, player)) { service.send(player, MessageKey.EMAIL_ALREADY_USED_ERROR); } else { EmailChangedEvent event = bukkitService.createAndCallEvent(isAsync -> new EmailChangedEvent(player, null, email, isAsync)); if (event.isCancelled()) { <START> sendFailedMessage(player); <END> return; } auth.setEmail(email); if (dataSource.updateEmail(auth)) { playerCache.updatePlayer(auth); bungeeSender.sendAuthMeBungeecordMessage(MessageType.REFRESH_EMAIL, playerName); service.send(player, MessageKey.EMAIL_ADDED_SUCCESS); } else { sendFailedMessage(player); } } } else { sendUnloggedMessage(player); } }</code><technical_language>In opinion, this hard track errors. dataSource.updateEmail print exception if error occurrs, if event is cancelled get a abstract error message. suggestion is a error message for console event cancelled</technical_language>

Target:
public void addEmail(Player player, String email) { String playerName = player.getName().toLowerCase(); if (playerCache.isAuthenticated(playerName)) { PlayerAuth auth = playerCache.getAuth(playerName); final String currentEmail = auth.getEmail(); if (!Utils.isEmailEmpty(currentEmail)) { service.send(player, MessageKey.USAGE_CHANGE_EMAIL); } else if (!validationService.validateEmail(email)) { service.send(player, MessageKey.INVALID_EMAIL); } else if (!validationService.isEmailFreeForRegistration(email, player)) { service.send(player, MessageKey.EMAIL_ALREADY_USED_ERROR); } else { EmailChangedEvent event = bukkitService.createAndCallEvent(isAsync -> new EmailChangedEvent(player, null, email, isAsync)); if (event.isCancelled()) { ConsoleLogger.info("Could not add email to player '" + player + "' – event was cancelled"); service.send(player, MessageKey.EMAIL_ADD_NOT_ALLOWED); return; } auth.setEmail(email); if (dataSource.updateEmail(auth)) { playerCache.updatePlayer(auth); bungeeSender.sendAuthMeBungeecordMessage(MessageType.REFRESH_EMAIL, playerName); service.send(player, MessageKey.EMAIL_ADDED_SUCCESS); } else { ConsoleLogger.warning("Could not save email for player '" + player + "'"); service.send(player, MessageKey.ERROR); } } } else { sendUnloggedMessage(player); } }
Source:
<code>public void testGodMode() throws IOException { System.clearProperty("godmode"); assertNull(System.getProperty("godmode")); ______TS("test verifyHtml"); <START> testGodMode(true); <END> ______TS("test verifyHtmlMainContent"); testGodMode(false); }</code><technical_language>I this false next true</technical_language>

Target:
public void testGodMode() throws Exception { System.clearProperty("godmode"); assertNull(System.getProperty("godmode")); ______TS("test verifyHtml"); testGodMode(false); ______TS("test verifyHtmlMainContent"); testGodMode(true); }
Source:
<code>public void testSingletonServicePluginsAddedHandling() { @SuppressWarnings("rawtypes") PluginInfo<Converter> converterInfo = new PluginInfo<>( DummyStringConverter.class, Converter.class); <START> converterInfo.setPluginClass(DummyStringConverter.class); <END> pluginService.addPlugin(converterInfo); assertNotNull(pluginService.getPlugin(DummyStringConverter.class)); assertTrue(convertService.supports("StringInput", Number.class)); }</code><technical_language>Is necessary call setPluginClass here? constructor do it</technical_language>

Target:
public void testSingletonServicePluginsAddedHandling() { @SuppressWarnings("rawtypes") PluginInfo<Converter> converterInfo = new PluginInfo<>( FoodConverter.class, Converter.class); pluginService.addPlugin(converterInfo); assertNotNull(pluginService.getPlugin(FoodConverter.class)); assertTrue(convertService.supports(new Apple() {}, Peach.class)); }
Source:
<code>public Snapshot getSnapshot() { long now = System.nanoTime(); cacheLock.readLock().lock(); try { <START> if (now < cachedHistogramTimestampNanos + refreshIntervalNanos) { <END> return cachedSnapshot; } } finally { cacheLock.readLock().unlock(); } cacheLock.writeLock().lock(); try { if (now >= cachedHistogramTimestampNanos + refreshIntervalNanos) { LOG.debug("Cached snapshot is too old, refreshing"); cachedHistogram = recorder.getIntervalHistogram(cachedHistogram); cachedSnapshot = new HdrSnapshot(cachedHistogram); cachedHistogramTimestampNanos = now; } return cachedSnapshot; } finally { cacheLock.writeLock().unlock(); } }</code><technical_language>This overflow I recommended approach is (now - cachedHistogramTimestampNanos) > refreshIntervalNanos</technical_language>

Target:
public Snapshot getSnapshot() { long now = System.nanoTime(); cacheLock.readLock().lock(); try { if (now - cachedHistogramTimestampNanos < refreshIntervalNanos) { return cachedSnapshot; } } finally { cacheLock.readLock().unlock(); } cacheLock.writeLock().lock(); try { if (now - cachedHistogramTimestampNanos >= refreshIntervalNanos) { LOG.debug("Cached snapshot is too old, refreshing"); cachedHistogram = recorder.getIntervalHistogram(cachedHistogram); cachedSnapshot = new HdrSnapshot(cachedHistogram); cachedHistogramTimestampNanos = now; } return cachedSnapshot; } finally { cacheLock.writeLock().unlock(); } }
Source:
<code>public void testRollupModeEnabled() { Configuration config = Configuration.getInstance(); config.setProperty(CoreConfig.ROLLUP_MODE, "true"); String[] args = new String[0]; BluefloodServiceStarterException ex = null; try { BluefloodServiceStarter.main(args); } catch (BluefloodServiceStarterException e) { ex = e; } <START> assertNull(ex); <END> }</code><technical_language>simplify this test method this way: @Test public void testRollupModeEnabledShouldNotFail() throws Exception { Configuration config = Configuration.getInstance(); config.setProperty(CoreConfig.ROLLUP_MODE, "true"); String[] args = new String[0]; BluefloodServiceStarter.main(args); }</technical_language>

Target:
public void testRollupModeEnabled() { Configuration config = Configuration.getInstance(); config.setProperty(CoreConfig.ROLLUP_MODE, "true"); BluefloodServiceStarter.run(); }
Source:
<code><START> private short toShort(int value) { <END> return (short) value; }</code><technical_language>minor: static</technical_language>

Target:
private static short toShort(int value) { return (short) value; }
Source:
<code>public void setUp(HttpRequestBuilderFactory httpRequestBuilderFactory, UrlUtils urlUtils) { <START> requestBuilder = mock(RequestBuilder.class); <END> given(httpRequestBuilderFactory.create(any(Method.class), anyString())).willReturn(requestBuilder); given(urlUtils.encodeQueryString(DECODED_VALUE_1)).willReturn(ENCODED_VALUE_1); given(urlUtils.encodeQueryString(DECODED_VALUE_2)).willReturn(ENCODED_VALUE_2); given(urlUtils.encodeQueryString(DECODED_VALUE_3)).willReturn(ENCODED_VALUE_3); }</code><technical_language>forceMock(RequestBuilder.class @Inject a field of DefaultRestRequestBuilderFactoryTest</technical_language>

Target:
public void setUp(HttpRequestBuilderFactory httpRequestBuilderFactory, UrlUtils urlUtils) { given(httpRequestBuilderFactory.create(any(Method.class), anyString())).willReturn(requestBuilder); given(urlUtils.encodeQueryString(DECODED_VALUE_1)).willReturn(ENCODED_VALUE_1); given(urlUtils.encodeQueryString(DECODED_VALUE_2)).willReturn(ENCODED_VALUE_2); given(urlUtils.encodeQueryString(DECODED_VALUE_3)).willReturn(ENCODED_VALUE_3); }
Source:
<code><START> protected boolean canDoAction() { <END> getDiskImage(); return true; }</code><technical_language>need check storage space</technical_language>

Target:
protected boolean canDoAction() { if (!validate(new StoragePoolValidator(getStoragePool()).isUp())) { return false; } DiskImage diskImage = null; try { diskImage = getDiskImage(); } catch (Exception e) { log.error("Unable to get the disk image from the provider proxy", e); } if (diskImage == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST); } return true; }
Source:
<code>private void initContentEventHandlers() { btnRevealrootcontentevent.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { <START> btnRevealcontentevent.setSelected(false); <END> btnRevealrootcontentevent.setSelected(true); btnRevealrootlayoutcontentevent.setSelected(false); contentSlot.setEnabled(false); btnSelectContentSlot.setEnabled(false); presenterConfigModel.setRevealInRoot(true); presenterConfigModel.setRevealInRootLayout(false); presenterConfigModel.setRevealInSlot(false); } }); btnRevealrootlayoutcontentevent.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnRevealcontentevent.setSelected(false); btnRevealrootcontentevent.setSelected(false); btnRevealrootlayoutcontentevent.setSelected(true); contentSlot.setEnabled(false); btnSelectContentSlot.setEnabled(false); presenterConfigModel.setRevealInRoot(false); presenterConfigModel.setRevealInRootLayout(true); presenterConfigModel.setRevealInSlot(false); } }); btnRevealcontentevent.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btnRevealcontentevent.setSelected(true); btnRevealrootcontentevent.setSelected(false); btnRevealrootlayoutcontentevent.setSelected(false); contentSlot.setEnabled(true); btnSelectContentSlot.setEnabled(true); presenterConfigModel.setRevealInRoot(false); presenterConfigModel.setRevealInRootLayout(false); presenterConfigModel.setRevealInSlot(true); } }); }</code><technical_language>revealContentEvent</technical_language>

Target:
private void initContentEventHandlers() { radioContentRoot.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { radioContentSlot.setSelected(false); radioContentRoot.setSelected(true); radioContentRootLayout.setSelected(false); contentSlot.setEnabled(false); selectContentSlot.setEnabled(false); presenterConfigModel.setRevealInRoot(true); presenterConfigModel.setRevealInRootLayout(false); presenterConfigModel.setRevealInSlot(false); } }); radioContentRootLayout.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { radioContentSlot.setSelected(false); radioContentRoot.setSelected(false); radioContentRootLayout.setSelected(true); contentSlot.setEnabled(false); selectContentSlot.setEnabled(false); presenterConfigModel.setRevealInRoot(false); presenterConfigModel.setRevealInRootLayout(true); presenterConfigModel.setRevealInSlot(false); } }); radioContentSlot.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { radioContentSlot.setSelected(true); radioContentRoot.setSelected(false); radioContentRootLayout.setSelected(false); contentSlot.setEnabled(true); selectContentSlot.setEnabled(true); presenterConfigModel.setRevealInRoot(false); presenterConfigModel.setRevealInRootLayout(false); presenterConfigModel.setRevealInSlot(true); } }); }
Source:
<code>public ProcessingDirective heartbeat() { <START> final long timeMillis = System.currentTimeMillis(); <END> return currentTrackedFile.map(trackedFile -> { return handleHeartbeatWithHealthyFileSystem(timeMillis); }).orElseGet(() -> { return timeMillis - lastFixAttempt > reconnectDelay ? attemptRecovery(timeMillis) : PAUSE; }); }</code><technical_language>For correctness this System.nanoTime() is intended for this use-case</technical_language>

Target:
public ProcessingDirective heartbeat() { final long nanoTime = System.nanoTime(); return currentTrackedFile .map(trackedFile -> handleHeartbeatWithHealthyFileSystem(nanoTime)) .orElseGet(() -> nanoTime - lastFixAttemptNanoTime > reconnectDelayNanos ? attemptRecovery(nanoTime) : PAUSE); }
Source:
<code>private void replyEof() { mSerializingExecutor.execute(() -> { try { Preconditions.checkState(!mContext.isDoneUnsafe()); if (!mContext.isDoneUnsafe()) { mContext.setDoneUnsafe(true); mResponse.onCompleted(); } else { <START> LOG.warn("Tried to replyEof when stream was already finished. context: {}", mContext); <END> } } catch (StatusRuntimeException e) { if (e.getStatus().getCode() != Status.Code.CANCELLED) { throw e; } } }); }</code><technical_language>this happen? chatty log</technical_language>

Target:
private void replyEof() { mSerializingExecutor.execute(() -> { try { if (!mContext.isDoneUnsafe()) { mContext.setDoneUnsafe(true); mResponse.onCompleted(); } else { LOG.debug("Tried to replyEof when stream was already finished. context: {}", mContext); } } catch (StatusRuntimeException e) { if (e.getStatus().getCode() != Status.Code.CANCELLED) { throw e; } } }); }
Source:
<code>public void testPerformSolrCloudSynchronousRestoreNoCollection() throws Exception { setupSystemProperties(SolrCommands.CLOUD_SOLR_CLIENT_TYPE); RestoreCommand restoreCommand = getSynchronousRestoreCommand(getBackupLocation(), null, miniSolrCloud.getSolrClient()); restoreCommand.execute(); String backupName = getBackupName(consoleOutput.getOutput()); File backupFile = Paths.get(restoreCommand.backupLocation, backupName).toAbsolutePath().toFile(); assertThat( consoleOutput.getOutput(), containsString( String.format( "Restoring collection [%s] from [%s] / [%s", DEFAULT_CORE_NAME, restoreCommand.backupLocation, backupName))); assertThat(consoleOutput.getOutput(), containsString("Restore complete.")); <START> assertThat(backupFile.exists(), is(true)); <END> }</code><technical_language>Typo: _ ]</technical_language>

Target:
public void testPerformSolrCloudSynchronousRestoreNoCollection() throws Exception { setupSystemProperties(SolrCommands.CLOUD_SOLR_CLIENT_TYPE); RestoreCommand restoreCommand = getSynchronousRestoreCommand(getBackupLocation(), null, miniSolrCloud.getSolrClient()); restoreCommand.execute(); assertThat( consoleOutput.getOutput(), containsString( String.format( "Restoring collection [%s] from [%s] / [%s", DEFAULT_CORE_NAME, restoreCommand.backupLocation, backupFile.getName()))); assertThat(consoleOutput.getOutput(), containsString("Restore complete.")); }
Source:
<code>public void testAsyncPrettyPrinterResult() { try { StringWriter out = new StringWriter(); PrintWriter writer = new PrintWriter(out); AsyncPrettyPrinter mAsyncPrettyPrinter = mPrettyPrinterTestFactory.getInstance( TEST_HEADER_NAME, TEST_HEADER_VALUE); mAsyncPrettyPrinter.printTo(writer, mInputStream); assertEquals(PRETTY_PRINT_PREFIX + Arrays.toString(TEST_RESPONSE_BODY), out.toString()); } <START> catch (IOException e) { <END> fail(e.getMessage()); } }</code><technical_language>unnecessary (also extra line is wrong). Instead, declare throws IOException. JUnit auto-fail test if this happens</technical_language>

Target:
public void testAsyncPrettyPrinterResult() throws IOException { StringWriter out = new StringWriter(); PrintWriter writer = new PrintWriter(out); AsyncPrettyPrinter mAsyncPrettyPrinter = mPrettyPrinterTestFactory.getInstance( TEST_HEADER_NAME, TEST_HEADER_VALUE); mAsyncPrettyPrinter.printTo(writer, mInputStream); assertEquals(PRETTY_PRINT_PREFIX + Arrays.toString(TEST_RESPONSE_BODY), out.toString()); }
Source:
<code>public void update() { smoothedTank.tick(getWorld()); if (tank.getFluidAmount() != fluidAmountPrev) { fluidAmountPrev = tank.getFluidAmount(); comparatorLevel = MathUtil.scaledClamp(tank.getFluidAmount(), tank.getCapacity(), 15); markDirty(); <START> } <END> }</code><technical_language>compare previous comparator level previous amount of fluid</technical_language>

Target:
public void update() { smoothedTank.tick(getWorld()); if (tank.getFluidAmount() != fluidAmountPrev) { fluidAmountPrev = tank.getFluidAmount(); markDirty(); } }
Source:
<code>public BucketManager<Object> cloneWithProperties() { <START> return null; <END> }</code><technical_language>throw UnsupportedOperationException if this is a new class want support a deprecated method</technical_language>

Target:
public BucketManager<Object> cloneWithProperties() { throw new UnsupportedOperationException(); }
Source:
<code>protected void executeCommand() { getParameters().setEntityInfo(new EntityInfo(VdcObjectType.VmTemplate, getVmTemplateId())); setSucceeded(true); if (!images.isEmpty()) { for (DiskImage image : images) { <START> ArrayList<Guid> <END> storageIds = new ArrayList<>(); storageIds.add(getParameters().getStorageDomainId()); image.setStorageIds(storageIds); image.setStoragePoolId(getParameters().getStoragePoolId()); } RemoveAllVmImagesParameters removeAllVmImagesParameters = new RemoveAllVmImagesParameters(getVmId(), images); removeAllVmImagesParameters.setParentCommand(getActionType()); removeAllVmImagesParameters.setEntityInfo(getParameters().getEntityInfo()); removeAllVmImagesParameters.setForceDelete(true); removeAllVmImagesParameters.setParentParameters(getParameters()); ActionReturnValue vdcRetValue = runInternalActionWithTasksContext(ActionType.RemoveAllVmImages, removeAllVmImagesParameters); if (vdcRetValue.getSucceeded()) { getReturnValue().getVdsmTaskIdList().addAll(vdcRetValue.getInternalVdsmTaskIdList()); } else { getReturnValue().setFault(vdcRetValue.getFault()); setSucceeded(false); } } List<Guid> guids = new ArrayList<>(); guids.add(ovfEntityData.getEntityId()); vmAndTemplatesGenerationsDao.deleteOvfGenerations(guids); unregisteredOVFDataDao.removeEntity(ovfEntityData.getEntityId(), null); unregisteredDisksDao.removeUnregisteredDiskRelatedToVM(ovfEntityData.getEntityId(), null); }</code><technical_language>"List" for consistency other places ArrayList is created</technical_language>

Target:
protected void executeCommand() { getParameters().setEntityInfo(new EntityInfo(VdcObjectType.VmTemplate, getVmTemplateId())); setSucceeded(true); if (!images.isEmpty()) { List<DiskImage> imageToRemove = new ArrayList<>(); for (DiskImage image : images) { if (image.getStorageIds().get(0).equals(getParameters().getStorageDomainId())) { List<Guid> storageIds = new ArrayList<>(); storageIds.add(getParameters().getStorageDomainId()); image.setStorageIds(storageIds); image.setStoragePoolId(getParameters().getStoragePoolId()); imageToRemove.add(image); } } RemoveAllVmImagesParameters removeAllVmImagesParameters = new RemoveAllVmImagesParameters(getVmId(), imageToRemove); removeAllVmImagesParameters.setParentCommand(getActionType()); removeAllVmImagesParameters.setEntityInfo(getParameters().getEntityInfo()); removeAllVmImagesParameters.setForceDelete(true); removeAllVmImagesParameters.setParentParameters(getParameters()); ActionReturnValue vdcRetValue = runInternalActionWithTasksContext(ActionType.RemoveAllVmImages, removeAllVmImagesParameters); if (vdcRetValue.getSucceeded()) { getReturnValue().getVdsmTaskIdList().addAll(vdcRetValue.getInternalVdsmTaskIdList()); } else { getReturnValue().setFault(vdcRetValue.getFault()); setSucceeded(false); } } List<Guid> guids = new ArrayList<>(); guids.add(ovfEntityData.getEntityId()); vmAndTemplatesGenerationsDao.deleteOvfGenerations(guids); unregisteredOVFDataDao.removeEntity(ovfEntityData.getEntityId(), null); unregisteredDisksDao.removeUnregisteredDiskRelatedToVM(ovfEntityData.getEntityId(), null); }
Source:
<code>private ServerAddress getServerAddress() { ServerAddress address; MongoClient client = client(); address = client.getServerAddressList().get(0); <START> client.close(); <END> return address; }</code><technical_language>try-finally close client</technical_language>

Target:
private ServerAddress getServerAddress() { MongoClient client = client(); try { return client.getServerAddressList().get(0); } finally { client.close(); } }
Source:
<code>public DateDoubleTimeSeries<?> evaluate(DateDoubleTimeSeries<?> ts) { ArgumentChecker.notNull(ts, "time series"); ArgumentChecker.isTrue(ts.size() > _lag, "time series length must be > lag"); final int[] times = ts.timesArrayFast(); final double[] values = ts.valuesArrayFast(); final int n = times.length; final int[] resultTimes = new int[n - _lag]; final double[] percentageChanges = new double[n - _lag]; for (int i = _lag; i < n; i++) { <START> ArgumentChecker.isTrue(values[i - _lag] != 0.0d, "value equal to 0, no relative change can be computed"); <END> resultTimes[i - _lag] = times[i]; percentageChanges[i - _lag] = (values[i] - values[i - _lag]) / values[i - _lag]; } return ImmutableLocalDateDoubleTimeSeries.of(resultTimes, percentageChanges); }</code><technical_language>add more information this validation message? If feeding in thousands of data points, drilling location of zero helpful. date/time some more context</technical_language>

Target:
public DateDoubleTimeSeries<?> evaluate(DateDoubleTimeSeries<?> ts) { ArgumentChecker.notNull(ts, "time series"); ArgumentChecker.isTrue(ts.size() > _lag, "time series length must be > lag"); final int[] times = ts.timesArrayFast(); final double[] values = ts.valuesArrayFast(); final int n = times.length; final int[] resultTimes = new int[n - _lag]; final double[] percentageChanges = new double[n - _lag]; for (int i = _lag; i < n; i++) { ArgumentChecker.isTrue(values[i - _lag] != 0.0d, "value equal to 0 at date {}, no relative change can be computed", times[i - _lag]); resultTimes[i - _lag] = times[i]; percentageChanges[i - _lag] = (values[i] - values[i - _lag]) / values[i - _lag]; } return ImmutableLocalDateDoubleTimeSeries.of(resultTimes, percentageChanges); }
Source:
<code>private void processRegionForCanadaOrUs(AddressEntity addressEntity) { <START> String country = addressEntity.getCountry().toLowerCase(); <END> String normalisedPostalCode = addressEntity.getPostcode().replaceAll("\\s", ""); switch (country) { case "america": case "united states": case "united states of america": case "us": case "usa": Optional.of(UsStateUtils.getState(normalisedPostalCode)); break; case "canada": Optional.of(CanadaProvinceTerritoryUtils.getState(normalisedPostalCode)); break; default: break; } }</code><technical_language>need do this for reasons below</technical_language>

Target:
private void processRegionForCanadaOrUs(AddressEntity addressEntity) { switch (addressEntity.getCountry()) { case "US": Optional.of(UsZipCodeToStateMapper.getState(getNormalisedPostalCode(addressEntity))); break; case "CA": Optional.of(CanadaPostalcodeToProvinceOrTerritoryMapper.getProvinceOrTerritory(getNormalisedPostalCode(addressEntity))); break; default: break; } }
Source:
<code>public HeaderExchangeServer(Server server) { <START> if (server == null) { <END> throw new IllegalArgumentException("server == null"); } this.server = server; this.heartbeat = server.getUrl().getParameter(Constants.HEARTBEAT_KEY, 0); this.idleTimeout = server.getUrl().getParameter(Constants.HEARTBEAT_TIMEOUT_KEY, heartbeat * 3); if (idleTimeout < heartbeat * 2) { throw new IllegalStateException("idleTimeout < heartbeatInterval * 2"); } startIdleCheckTimer(); }</code><technical_language>replace replace Assert.notNull(server, "Server null"); dubbo a util for this</technical_language>

Target:
public HeaderExchangeServer(Server server) { Assert.notNull(server, "server == null"); this.server = server; this.heartbeat = server.getUrl().getParameter(Constants.HEARTBEAT_KEY, 0); this.idleTimeout = server.getUrl().getParameter(Constants.HEARTBEAT_TIMEOUT_KEY, heartbeat * 3); if (idleTimeout < heartbeat * 2) { throw new IllegalStateException("idleTimeout < heartbeatInterval * 2"); } startIdleCheckTask(); }
Source:
<code>public String sendJoinLinkToNewInstructor(InstructorAttributes instructor, String shortName, String institute) throws EntityDoesNotExistException { String joinLink=""; InstructorAttributes instructorData = getInstructorForEmail(instructor.courseId, instructor.email); if (instructorData == null) { throw new EntityDoesNotExistException("Instructor [" + instructor.email + instructor.name + "] does not exist in course [" + instructor.courseId + "]"); } Emails emailMgr = new Emails(); try { List<MimeMessage> emails = emailMgr.generateNewInstructorAccountJoinEmail(instructorData, shortName, institute); emailMgr.sendEmail(emails.get(0)); emailMgr.sendEmail(emails.get(1)); <START> joinLink = emails.get(2).getContent().toString(); <END> } catch (Exception e) { throw new RuntimeException("Unexpected error while sending email",e); } return joinLink; }</code><technical_language>entire emails is join link</technical_language>

Target:
public String sendJoinLinkToNewInstructor(InstructorAttributes instructor, String shortName, String institute) throws EntityDoesNotExistException { String joinLink=""; InstructorAttributes instructorData = getInstructorForEmail(instructor.courseId, instructor.email); if (instructorData == null) { throw new EntityDoesNotExistException("Instructor [" + instructor.email + instructor.name + "] does not exist in course [" + instructor.courseId + "]"); } Emails emailMgr = new Emails(); try { List<MimeMessage> emails = emailMgr.generateNewInstructorAccountJoinEmail(instructorData, shortName, institute); emailMgr.sendEmail(emails.get(0)); emailMgr.sendEmail(emails.get(1)); joinLink = emailMgr.generateNewInstructorAccountJoinLink(instructorData, institute); } catch (Exception e) { throw new RuntimeException("Unexpected error while sending email",e); } return joinLink; }
Source:
<code>protected EntityBinding getEntityBinding(Class<?> entityClass) { <START> Class<?> entitySearched = isMappedInterface(entityClass) ? entityClass : lookupEntityClass(entityClass); <END> return entityBindings.getOrDefault(entitySearched, EntityBinding.EMPTY_BINDING); }</code><technical_language>intent clearer if explicitly return EntityBinding.EMPTY_BINDING if interface is mapped? if (isMappedInterface(entityClass) { return EntityBindings.EMPTY_BNDING; }</technical_language>

Target:
protected EntityBinding getEntityBinding(Class<?> entityClass) { if (isMappedInterface(entityClass)) { return EntityBinding.EMPTY_BINDING; } return entityBindings.getOrDefault(lookupEntityClass(entityClass), EntityBinding.EMPTY_BINDING); }
Source:
<code><START> public AnalyzedStatement analyze(CreateView createView, CoordinatorTxnCtx txnCtx) { <END> RelationName name = RelationName.of(createView.name(), txnCtx.sessionContext().searchPath().currentSchema()); name.ensureValidForRelationCreation(); if (BlobSchemaInfo.NAME.equals(name.schema())) { throw new UnsupportedOperationException("Creating a view in the \"blob\" schema is not supported"); } AnalyzedRelation query; try { String formattedQuery = SqlFormatter.formatSql(createView.query()); query = relationAnalyzer.analyzeUnbound((Query) SqlParser.createStatement(formattedQuery), txnCtx, ParamTypeHints.EMPTY); } catch (Exception e) { throw new UnsupportedOperationException("Query cannot be used in a VIEW: " + createView.query()); } if (query.fields().stream().map(f -> f.path().sqlFqn()).distinct().count() != query.fields().size()) { throw new IllegalArgumentException("Query in CREATE VIEW must not have duplicate column names"); } return new CreateViewStmt( name, query, createView.query(), createView.replaceExisting(), txnCtx.sessionContext().user() ); }</code><technical_language>suggestion public CreateViewStmt analyze(CreateView createView, CoordinatorTxnCtx txnCtx) {</technical_language>

Target:
public CreateViewStmt analyze(CreateView createView, CoordinatorTxnCtx txnCtx) { RelationName name = RelationName.of(createView.name(), txnCtx.sessionContext().searchPath().currentSchema()); name.ensureValidForRelationCreation(); if (BlobSchemaInfo.NAME.equals(name.schema())) { throw new UnsupportedOperationException("Creating a view in the \"blob\" schema is not supported"); } AnalyzedRelation query; try { String formattedQuery = SqlFormatter.formatSql(createView.query()); query = relationAnalyzer.analyzeUnbound((Query) SqlParser.createStatement(formattedQuery), txnCtx, ParamTypeHints.EMPTY); } catch (Exception e) { throw new UnsupportedOperationException("Query cannot be used in a VIEW: " + createView.query()); } if (query.fields().stream().map(f -> f.path().sqlFqn()).distinct().count() != query.fields().size()) { throw new IllegalArgumentException("Query in CREATE VIEW must not have duplicate column names"); } return new CreateViewStmt( name, query, createView.query(), createView.replaceExisting(), txnCtx.sessionContext().user() ); }
Source:
<code>public void testConcurrencyLimit() throws Exception { LimitedExecutor limitedExecutor = new LimitedExecutor(NAME, executor, 1); CountDownLatch latch = new CountDownLatch(1); CompletableFuture<String> cf1 = new CompletableFuture<>(); limitedExecutor.execute(() -> { awaitLatch(latch); cf1.complete("bla"); }); CompletableFuture<String> cf2 = new CompletableFuture<>(); limitedExecutor.execute(() -> cf2.complete("bla")); Thread.sleep(10); assertFalse(cf1.isDone()); assertFalse(cf2.isDone()); latch.countDown(); assertEquals("bla", cf1.get(10, SECONDS)); assertEquals("bla", cf2.get(10, SECONDS)); <START> eventuallyEquals(0, executor::getActiveCount); <END> }</code><technical_language>Do need threads this eventuallyEquals? I move beginning of test method, this line reached test failure (and want fail next test method)</technical_language>

Target:
public void testConcurrencyLimit() throws Exception { eventuallyEquals(0, executor::getActiveCount); LimitedExecutor limitedExecutor = new LimitedExecutor(NAME, executor, 1); CompletableFuture<String> blocker1 = new CompletableFuture<>(); CompletableFuture<String> blocker2 = new CompletableFuture<>(); CompletableFuture<String> cf1 = new CompletableFuture<>(); limitedExecutor.execute(() -> { try { cf1.complete(blocker1.get(10, SECONDS)); } catch (Exception e) { cf1.completeExceptionally(e); } }); CompletableFuture<String> cf2 = new CompletableFuture<>(); limitedExecutor.execute(() -> { try { cf2.complete(cf1.getNow("task 2 ran too early") + " " + blocker2.get(10, SECONDS)); } catch (Exception e) { cf2.completeExceptionally(e); } }); assertFalse(cf1.isDone()); assertFalse(cf2.isDone()); blocker1.complete("value1"); blocker2.complete("value2"); assertEquals("value1", cf1.get(10, SECONDS)); assertEquals("value1 value2", cf2.get(10, SECONDS)); eventuallyEquals(0, executor::getActiveCount); }
Source:
<code>protected JarScheduler(DockerClient dockerClient, ZooKeeper zooKeeperContainer) { super(dockerClient); this.zooKeeperContainer = zooKeeperContainer; <START> docker0AdaptorIpAddress = dockerClient.versionCmd().exec().getVersion().startsWith("1.9.") ? "172.17.0.1" : "172.17.42.1"; <END> }</code><technical_language>![](<LINK_0> A.k.a track this stupid hot fix</technical_language>

Target:
protected JarScheduler(DockerClient dockerClient, ZooKeeper zooKeeperContainer) { super(dockerClient); this.zooKeeperContainer = zooKeeperContainer; docker0AdaptorIpAddress = getDocker0AdaptorIpAddress(dockerClient); }
Source:
<code>public Buffer getNextReceivedBuffer() { <START> synchronized (receivedBuffers) { return receivedBuffers.poll(); } <END> }</code><technical_language>add synchornized section</technical_language>

Target:
public Buffer getNextReceivedBuffer() { return receivedBuffers.poll(); }
Source:
<code>public void apply() { Object thing; if (isValid) { thing = registry.getValue(injectedObject); <START> if (registry.getRegistrySuperType() == Block.class && thing == Blocks.AIR) { <END> thing = null; } } else { thing = null; } if (thing == null) { FMLLog.getLogger().log(Level.DEBUG, "Unable to lookup for {}. This means the object wasn't registered. It's likely just mod options.", injectedObject, field); return; } try { FinalFieldHelper.setField(field, null, thing); } catch (Exception e) { FMLLog.log(Level.WARN, e, "Unable to set %s with value %s (%s)", this.field, thing, this.injectedObject); } }</code><technical_language>This do block type. making return a null instead of default registry. allowing people check if exist in registry a null check instead of air check</technical_language>

Target:
public void apply() { Object thing; if (isValid && registry.containsKey(injectedObject)) { thing = registry.getValue(injectedObject); } else { thing = null; } if (thing == null) { FMLLog.getLogger().log(Level.DEBUG, "Unable to lookup for {}. This means the object wasn't registered. It's likely just mod options.", injectedObject, field); return; } try { FinalFieldHelper.setField(field, null, thing); } catch (Exception e) { FMLLog.log(Level.WARN, e, "Unable to set %s with value %s (%s)", this.field, thing, this.injectedObject); } }
Source:
<code>public Object fromMessage(Message<?> message, Class<?> targetClass) { try { Message<?> mm = MutableMessageBuilder.fromMessage(message).build(); <START> return this.codec.encode(mm); <END> } catch (IOException e) { throw new MessagingException(message, e); } }</code><technical_language>understand reason of this extra MutableMessage creation object encoding..</technical_language>

Target:
public Object fromMessage(Message<?> message, Class<?> targetClass) { try { return this.codec.encode(message); } catch (IOException e) { throw new MessagingException(message, e); } }
Source:
<code>private Map<String, List<Integer>> getRecipientRanksExcludingSelf(List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question) { if (shouldSelfBeExcludedFromRankings(question)) { List<FeedbackResponseAttributes> responsesExcludingSelf = getResponsesExcludingSelf(responses); return generateOptionRanksMapping(responsesExcludingSelf); } else { <START> return new HashMap<>(); <END> } }</code><technical_language>issues here: - Instead of else, move if block: java if (...) { ... return ...; } return ...; - Diamond constructor is preferred in this project</technical_language>

Target:
private Map<String, List<Integer>> getRecipientRanksExcludingSelf(List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question) { if (shouldSelfBeExcludedFromRankings(question)) { List<FeedbackResponseAttributes> responsesExcludingSelf = getResponsesExcludingSelf(responses); return generateOptionRanksMapping(responsesExcludingSelf); } return new HashMap<String, List<Integer>>(); }
Source:
<code>public static LogEntry generateInstanceFromXML(Node wn) { final String METHOD_NAME = "generateInstanceFromXML(Node)"; Date date = null; String desc = null; String type = null; try { NodeList nl = wn.getChildNodes(); for (int x = 0; x < nl.getLength(); x++) { Node node = nl.item(x); String nname = node.getNodeName(); <START> if (nname.equalsIgnoreCase("desc")) { END> desc = MekHqXmlUtil.unEscape(node.getTextContent()); } else if (nname.equalsIgnoreCase("type")) { type = MekHqXmlUtil.unEscape(node.getTextContent()); } else if (nname.equalsIgnoreCase("date")) { date = DATE_FORMAT.parse(node.getTextContent().trim()); } } } catch (Exception ex) { MekHQ.getLogger().error(LogEntry.class, METHOD_NAME, ex); return null; } return new LogEntry(date, desc, type); }</code><technical_language>Minor nit: XML element names case sensitive, equalsIgnoreCase equals. (I realize rest of MekHQ equalsIgnoreCase)</technical_language>

Target:
public static LogEntry generateInstanceFromXML(Node wn) { final String METHOD_NAME = "generateInstanceFromXML(Node)"; Date date = null; String desc = null; String type = null; try { NodeList nl = wn.getChildNodes(); for (int x = 0; x < nl.getLength(); x++) { Node node = nl.item(x); String nname = node.getNodeName(); if (nname.equals("desc")) { desc = MekHqXmlUtil.unEscape(node.getTextContent()); } else if (nname.equals("type")) { type = MekHqXmlUtil.unEscape(node.getTextContent()); } else if (nname.equals("date")) { date = dateFormat().parse(node.getTextContent().trim()); } } } catch (Exception ex) { MekHQ.getLogger().error(LogEntry.class, METHOD_NAME, ex); return null; } return new LogEntry(date, desc, type); }
Source:
<code><START> public RankQuery getRankQuery() { <END> if (luceneQueries.querqyBoostQueries != null && luceneQueries.querqyBoostQueries.size() > 0) { final BooleanQuery.Builder builder = new BooleanQuery.Builder(); for (final Query q : luceneQueries.querqyBoostQueries) { builder.add(q, BooleanClause.Occur.SHOULD); } return new QuerqyReRankQuery(new MatchAllDocsQuery(), maybeWrapQuery(builder.build()), requestAdapter.getReRankNumDocs(), 1.0); } else if (luceneQueries.rankQuery != null && !luceneQueries.isMainQueryBoosted) { return (RankQuery) luceneQueries.rankQuery; } return null; }</code><technical_language>Minor change: this method return Optional instead of +/- null? (this more expressive)</technical_language>

Target:
public Optional<RankQuery> getRankQuery() { if (luceneQueries.querqyBoostQueries != null && luceneQueries.querqyBoostQueries.size() > 0) { final BooleanQuery.Builder builder = new BooleanQuery.Builder(); for (final Query q : luceneQueries.querqyBoostQueries) { builder.add(q, BooleanClause.Occur.SHOULD); } return Optional.of(new QuerqyReRankQuery(new MatchAllDocsQuery(), maybeWrapQuery(builder.build()), requestAdapter.getReRankNumDocs(), 1.0)); } else if (luceneQueries.rankQuery != null && !luceneQueries.isMainQueryBoosted) { return Optional.of((RankQuery) luceneQueries.rankQuery); } return Optional.empty(); }
Source:
<code>public static String toBase64(ByteString string) { String base64 = Base64.getEncoder().encodeToString(string.getBytes()); StringBuilder str = new StringBuilder(base64.length() + base64.length() / 76); int i; if (base64.length() > 76) { <START> for (i = 0; i + 76 < base64.length(); i += 76) { <END> str.append(base64, i, i + 76); str.append("\n"); } str.append(base64, i, base64.length()); return str.toString(); } return base64; }</code><technical_language>is a bit of code duplication toBase64(String) toBase64(ByteString) methods (they're identical). Guava's [Splitter.fixedLength()](<LINK_0></technical_language>

Target:
public static String toBase64(ByteString string) { return toBase64_(string.getBytes()); }
Source:
<code>protected ScheduledReporter(MetricRegistry registry, String name, MetricFilter filter, TimeUnit rateUnit, TimeUnit durationUnit) { ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory(name + '-' + FACTORY_ID.incrementAndGet())); <START> this(registry, name, filter, rateUnit, durationUnit, executor); <END> }</code><technical_language>Build fails ScheduledReporter.java:[72,21] call this statement in constructor, this fix it: java this(registry, name, filter, rateUnit, durationUnit, Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory(name + '-' + FACTORY_ID.incrementAndGet())));</technical_language>

Target:
protected ScheduledReporter(MetricRegistry registry, String name, MetricFilter filter, TimeUnit rateUnit, TimeUnit durationUnit) { this(registry, name, filter, rateUnit, durationUnit, Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory(name + '-' + FACTORY_ID.incrementAndGet()))); }
Source:
<code>public QueryResponse process(QueryResponse input) throws PluginExecutionException, StopProcessingException { <START> if (input != null) { <END> Set<ProcessingDetails> processingDetails = input.getProcessingDetails(); List<Result> results = input.getResults(); Map<String, Serializable> properties = input.getProperties(); processingDetails .stream() .filter(ProcessingDetails::hasException) .map(ProcessingDetails::getSourceId) .forEach( id -> Metrics.counter( METRICS_PREFIX + "." + QUERY_SCOPE + "." + EXCEPTION_TYPE, Tags.of(SOURCE_TAG, id)) .increment()); results .stream() .map(Result::getMetacard) .map(Metacard::getSourceId) .forEach( id -> Metrics.counter( METRICS_PREFIX + "." + QUERY_SCOPE + "." + RESULTS_TYPE, Tags.of(SOURCE_TAG, id)) .increment()); properties .entrySet() .stream() .filter(e -> e.getKey().startsWith(METRICS_SOURCE_ELAPSED_PREFIX)) .forEach(SourceMetricsImpl::updateLatencyMetric); } return input; }</code><technical_language>Reverse predicate, return null early collapse larger nested if? if (input == null ) { LOGGER.trace("EXITING: process (for PostFederatedQueryPlugin)"); return null; } ...</technical_language>

Target:
public QueryResponse process(QueryResponse input) throws PluginExecutionException, StopProcessingException { if (input == null) { LOGGER.debug("Unable to process source metrics due to null input."); return null; } Set<ProcessingDetails> processingDetails = input.getProcessingDetails(); List<Result> results = input.getResults(); Map<String, Serializable> properties = input.getProperties(); processingDetails .stream() .filter(ProcessingDetails::hasException) .map(ProcessingDetails::getSourceId) .forEach( id -> Metrics.counter( METRICS_PREFIX + "." + QUERY_SCOPE + "." + EXCEPTION_TYPE, Tags.of(SOURCE_TAG, id)) .increment()); results .stream() .map(Result::getMetacard) .map(Metacard::getSourceId) .forEach( id -> Metrics.counter( METRICS_PREFIX + "." + QUERY_SCOPE + "." + RESULTS_TYPE, Tags.of(SOURCE_TAG, id)) .increment()); properties .entrySet() .stream() .filter(e -> e.getKey() != null && e.getKey().startsWith(METRICS_SOURCE_ELAPSED_PREFIX)) .forEach(SourceMetricsImpl::updateLatencyMetric); return input; }
Source:
<code>public void run(Timeout timeout) throws Exception { if (timeout.isCancelled()) { return; } <START> if (logger.isInfoEnabled()) { <END> logger.info(taskName + " : " + url); } try { doRetry(url, registry); } catch (Throwable t) { logger.warn("Failed to " + taskName + url + ", waiting for again, cause:" + t.getMessage(), t); reput(timeout, retryPeriod); } }</code><technical_language>Please remove , print log</technical_language>

Target:
public void run(Timeout timeout) throws Exception { if (timeout.isCancelled() || timeout.timer().isStop() || isCancel()) { return; } if (logger.isInfoEnabled()) { logger.info(taskName + " : " + url); } try { doRetry(url, registry, timeout); } catch (Throwable t) { logger.warn("Failed to execute task " + taskName + ", url: " + url + ", waiting for again, cause:" + t.getMessage(), t); reput(timeout, retryPeriod); } }
Source:
<code>SpatialRuleLookupArray(BBox bounds, double resolution, boolean exact) { if (bounds == null) throw new IllegalArgumentException("BBox cannot be null"); <START> if (resolution < 1e-100) <END> throw new IllegalArgumentException("resolution cannot be that high " + resolution); this.bounds = bounds; this.resolution = resolution; this.checkDiff = (resolution / 2) - (resolution / 10); this.exact = exact; lookupArray = new byte[getNumberOfXGrids()][getNumberOfYGrids()]; addSingleRule(EMPTY); ruleContainers.add(new SpatialRuleContainer() { { this.rules.add(EMPTY); } @Override public SpatialRuleContainer addRule(SpatialRule spatialRule) { throw new IllegalArgumentException("Cannot add to empty rule container"); } @Override public SpatialRuleContainer addRules(Collection<SpatialRule> rules) { throw new IllegalArgumentException("Cannot add to empty rule container"); } }); }</code><technical_language>problem is resolution<=0 is want raise this limit a bit IMO</technical_language>

Target:
SpatialRuleLookupArray(BBox bounds, double resolution, boolean exact) { if (bounds == null) throw new IllegalArgumentException("BBox cannot be null"); if (resolution < 1e-100) throw new IllegalArgumentException("resolution cannot be that high " + resolution); this.bounds = bounds; this.resolution = resolution; this.checkDiff = (resolution / 2) - (resolution / 10); this.exact = exact; lookupArray = new byte[getNumberOfXGrids()][getNumberOfYGrids()]; addSingleRule(SpatialRule.EMPTY); ruleContainers.add(new SpatialRuleContainer() { { this.rules.add(SpatialRule.EMPTY); } @Override public SpatialRuleContainer addRule(SpatialRule spatialRule) { throw new IllegalArgumentException("Cannot add to empty rule container"); } @Override public SpatialRuleContainer addRules(Collection<SpatialRule> rules) { throw new IllegalArgumentException("Cannot add to empty rule container"); } }); }
Source:
<code>private void createAndStartServer() throws Exception { <START> createAndStartServer(new DummyServlet(Optional.empty())); <END> }</code><technical_language>default constructor for of</technical_language>

Target:
private void createAndStartServer() throws Exception { createAndStartServer(new DummyServlet()); }
Source:
<code>public static @NonNull Iterable<ITmfEventAspect<?>> generateAspects(CustomTraceDefinition definition) { boolean addExtraFieldAspect = false; List<String> fieldNames = new ArrayList<>(); ImmutableList.Builder<ITmfEventAspect<?>> builder = new ImmutableList.Builder<>(); for (OutputColumn output : definition.outputs) { if (output.tag.equals(Tag.TIMESTAMP) && (definition.timeStampOutputFormat == null || definition.timeStampOutputFormat.isEmpty())) { builder.add(TmfBaseAspects.getTimestampAspect()); fieldNames.add(output.name); } else if (output.tag.equals(Tag.EVENT_TYPE)) { builder.add(TmfBaseAspects.getEventTypeAspect()); fieldNames.add(output.name); } else if (output.tag.equals(Tag.EVENT_FIELDS_NAME)) { continue; } else if (output.tag.equals(Tag.EXTRA_FIELDS_VALUE)) { addExtraFieldAspect = true; } else { builder.add(new TmfContentFieldAspect(output.name, output.name)); fieldNames.add(output.name); } } <START> if (addExtraFieldAspect) { <END> builder.add(new CustomExtraFieldAspect(fieldNames)); } return builder.build(); }</code><technical_language>This disregards order set in wizard's output page. In output page, (Extra field name & Extra field value), in table is (Extra fields). filtered out wizard output page? ideally aspect's name (Extra fields) if is easy do. fieldNames list is mutable stored in aspect (probably a bad design practice...) work if create add extra fields aspect early, finish completing fieldNames black list in iterations of loop..</technical_language>

Target:
public static @NonNull Iterable<ITmfEventAspect<?>> generateAspects(CustomTraceDefinition definition) { List<String> fieldNames = new ArrayList<>(); ImmutableList.Builder<ITmfEventAspect<?>> builder = new ImmutableList.Builder<>(); CustomExtraFieldsAspect extraAspect = null; for (OutputColumn output : definition.outputs) { if (output.tag.equals(Tag.TIMESTAMP) && (definition.timeStampOutputFormat == null || definition.timeStampOutputFormat.isEmpty())) { builder.add(TmfBaseAspects.getTimestampAspect()); fieldNames.add(output.name); } else if (output.tag.equals(Tag.EVENT_TYPE)) { builder.add(TmfBaseAspects.getEventTypeAspect()); fieldNames.add(output.name); } else if (output.tag.equals(Tag.EXTRA_FIELDS_NAME)) { continue; } else if (output.tag.equals(Tag.EXTRA_FIELDS_VALUE)) { if (extraAspect == null) { extraAspect = new CustomExtraFieldsAspect(); builder.add(extraAspect); } } else { builder.add(new TmfContentFieldAspect(output.name, output.name)); fieldNames.add(output.name); } } return builder.build(); }
Source:
<code>public void setUpBeforeClass() { pickTableLayout = new PickTableLayout(tester().getMetadata(), new SqlParser()); connectorId = tester().getCurrentConnectorId(); nationTableHandle = new TableHandle( connectorId, new TpchTableHandle("nation", 1.0), TestingTransactionHandle.create(), <START> Optional.of(TestingHandle.INSTANCE)); <END> ordersTableHandle = new TableHandle( connectorId, new TpchTableHandle("orders", 1.0), TestingTransactionHandle.create(), Optional.of(TestingHandle.INSTANCE)); nationTableLayoutHandle = new TableLayoutHandle( connectorId, TestingTransactionHandle.create(), new TpchTableLayoutHandle((TpchTableHandle) nationTableHandle.getConnectorHandle(), TupleDomain.all())); ordersTableLayoutHandle = new TableLayoutHandle( connectorId, TestingTransactionHandle.create(), new TpchTableLayoutHandle((TpchTableHandle) ordersTableHandle.getConnectorHandle(), TupleDomain.all())); }</code><technical_language>I thinking nationTableLayoutHandle here</technical_language>

Target:
public void setUpBeforeClass() { pickTableLayout = new PickTableLayout(tester().getMetadata(), new SqlParser()); connectorId = tester().getCurrentConnectorId(); TpchTableHandle nationTpchTableHandle = new TpchTableHandle("nation", 1.0); TpchTableHandle orderTpchTableHandle = new TpchTableHandle("orders", 1.0); nationTableHandle = new TableHandle( connectorId, nationTpchTableHandle, TestingTransactionHandle.create(), Optional.of(new TpchTableLayoutHandle(nationTpchTableHandle, TupleDomain.all()))); ordersTableHandle = new TableHandle( connectorId, orderTpchTableHandle, TestingTransactionHandle.create(), Optional.of(new TpchTableLayoutHandle(orderTpchTableHandle, TupleDomain.all()))); }