auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void checkMaxEnvironmentRam(@Nullable String workspaceId, WorkspaceConfig config) throws ServerException { if (maxRamPerEnvMB < 0) { return; } if (config.getEnvironments().isEmpty()) { return; } if (SidecarToolingWorkspaceUtil.isSidecarBasedWorkspace(config.getAttributes())) { LOG.warn( "Can not estimate memory needed for sidecar based workspace{}. Set environment memory limits may work incorrectly", workspaceId == null ? "" : ' ' + workspaceId); } for (Map.Entry<String, ? extends Environment> envEntry : config.getEnvironments().entrySet()) { Environment env = envEntry.getValue(); final long workspaceRam = environmentRamCalculator.calculate(env); if (workspaceRam > maxRamPerEnvMB) { throw new LimitExceededException( format("You are only allowed to use %d mb. RAM per workspace.", maxRamPerEnvMB), ImmutableMap.of( "environment_max_ram", Long.toString(maxRamPerEnvMB), "environment_max_ram_unit", "mb", "environment_ram", Long.toString(workspaceRam), "environment_ram_unit", "mb")); } } }

Target:
void checkMaxEnvironmentRam(@Nullable String workspaceId, WorkspaceConfig config) throws ServerException { if (maxRamPerEnvMB < 0) { return; } if (config.getEnvironments().isEmpty()) { return; } if (SidecarToolingWorkspaceUtil.isSidecarBasedWorkspace(config.getAttributes())) { LOG.warn( "Cannot estimate the memory requirements of a devfile-based workspace `{}`." + " The memory limits may not be applied correctly.", workspaceId == null ? "" : ' ' + workspaceId); } for (Map.Entry<String, ? extends Environment> envEntry : config.getEnvironments().entrySet()) { Environment env = envEntry.getValue(); final long workspaceRam = environmentRamCalculator.calculate(env); if (workspaceRam > maxRamPerEnvMB) { throw new LimitExceededException( format("You are only allowed to use %d mb. RAM per workspace.", maxRamPerEnvMB), ImmutableMap.of( "environment_max_ram", Long.toString(maxRamPerEnvMB), "environment_max_ram_unit", "mb", "environment_ram", Long.toString(workspaceRam), "environment_ram_unit", "mb")); } } }
Source:
public void setUpWindow() { MenuBar menuBar = new MenuBar(this); BorderPane pane = new BorderPane(); Scene scene = new PlayOnLinuxScene(pane, 780, 400); VBox topContainer = new VBox(); toolBar = new ToolBar(this); topContainer.getChildren().add(menuBar); topContainer.getChildren().add(toolBar); pane.setTop(topContainer); statusBar = new StatusBar(this, scene); pane.setBottom(statusBar); GridPane mainContent = new GridPane(); ColumnConstraints columnConstraint = new ColumnConstraints(); columnConstraint.setPercentWidth(30); ColumnConstraints columnConstraint2 = new ColumnConstraints(); columnConstraint2.setPercentWidth(70); RowConstraints rowConstraint = new RowConstraints(); rowConstraint.setPercentHeight(100); mainContent.getColumnConstraints().add(columnConstraint); mainContent.getColumnConstraints().add(columnConstraint2); mainContent.getRowConstraints().add(rowConstraint); mainContent.setVgap(2.0); mainContent.add(new MenuLeft(), 0, 0); this.applicationListWidget = new ApplicationListWidget(); mainContent.add(applicationListWidget, 1, 0); pane.setCenter(mainContent); this.setScene(scene); this.setTitle(translate("${application.name}")); this.show(); scene.getWindow().setOnCloseRequest(new EventHandler<WindowEvent>() { @Override public void handle(WindowEvent event) { Alert alert = new Alert(Alert.AlertType.CONFIRMATION); alert.setTitle(translate("Would you like to exit?")); alert.setHeaderText(translate("Are You Sure?")); Optional<ButtonType> result = alert.showAndWait(); if (result.get() == ButtonType.OK){ Platform.exit(); } else { event.consume(); } } }); }

Target:
public void setUpWindow() { MenuBar menuBar = new MenuBar(this); BorderPane pane = new BorderPane(); Scene scene = new PlayOnLinuxScene(pane, 780, 400); VBox topContainer = new VBox(); toolBar = new ToolBar(this); topContainer.getChildren().add(menuBar); topContainer.getChildren().add(toolBar); pane.setTop(topContainer); statusBar = new StatusBar(this, scene); pane.setBottom(statusBar); GridPane mainContent = new GridPane(); ColumnConstraints columnConstraint = new ColumnConstraints(); columnConstraint.setPercentWidth(30); ColumnConstraints columnConstraint2 = new ColumnConstraints(); columnConstraint2.setPercentWidth(70); RowConstraints rowConstraint = new RowConstraints(); rowConstraint.setPercentHeight(100); mainContent.getColumnConstraints().add(columnConstraint); mainContent.getColumnConstraints().add(columnConstraint2); mainContent.getRowConstraints().add(rowConstraint); mainContent.setVgap(2.0); mainContent.add(new MenuLeft(), 0, 0); this.applicationListWidget = new ApplicationListWidget(); mainContent.add(applicationListWidget, 1, 0); pane.setCenter(mainContent); this.setScene(scene); this.setTitle(translate("${application.name}")); this.show(); scene.getWindow().setOnCloseRequest(event -> { Alert alert = new Alert(Alert.AlertType.CONFIRMATION); alert.setTitle(translate("${application.name}")); alert.setHeaderText(translate("Are you sure you want to close all ${application.name} windows?")); Optional<ButtonType> result = alert.showAndWait(); if (result.get() == ButtonType.OK){ Platform.exit(); } else { event.consume(); } }); }
Source:
public ColumnFilter build() { if (built) { return null; } String columnName = "potOwner"; UserGroupCallback userGroupCallback = UserDataServiceProvider.getUserGroupCallback(); List<String> potOwners = (List<String>)parameters.get(columnName); List<String> potOwnersList = new ArrayList<String>(); for(String potOwner: potOwners) { potOwnersList.add(potOwner); if(userGroupCallback.getGroupsForUser(potOwner) != null) { potOwnersList.addAll(userGroupCallback.getGroupsForUser(potOwner)); } } ColumnFilter filter = FilterFactory.AND( FilterFactory.in(columnName,potOwnersList)); filter.setColumnId(columnName); built = true; return filter; }

Target:
public ColumnFilter build() { if (built) { return null; } String columnName = "potOwner"; UserGroupCallback userGroupCallback = UserDataServiceProvider.getUserGroupCallback(); List<String> potOwners = (List<String>)parameters.get(columnName); List<String> potOwnersList = new ArrayList<String>(); for(String potOwner: potOwners) { potOwnersList.add(potOwner); List<String> groups = userGroupCallback.getGroupsForUser(potOwner); if(groups != null) { potOwnersList.addAll(groups); } } ColumnFilter filter = FilterFactory.AND( FilterFactory.in(columnName,potOwnersList)); filter.setColumnId(columnName); built = true; return filter; }
Source:
public InputFormatBuilder.InputFormatOptions<T> addIterator(IteratorSetting cfg) { Objects.requireNonNull(cfg, "IteratorSetting must not be null."); this.iterators.put(cfg.getName(), cfg); tableConfigMap.get(currentTable).setIterators(new ArrayList<>(this.iterators.values())); return this; }

Target:
public InputFormatBuilder.InputFormatOptions<T> addIterator(IteratorSetting cfg) { Objects.requireNonNull(cfg, "IteratorSetting must not be null."); tableConfigMap.get(currentTable).addIterator(cfg); return this; }
Source:
public PropertyConstraint computeSpecific( LabelSchemaDescriptor schema ) { switch ( descriptor.type() ) { case UNIQUE: final int labelId = schema.getLabelId(); final int[] propertyKeyIds = new int[]{schema.getPropertyId()}; return new UniquenessConstraint( SchemaDescriptorFactory.forLabel( labelId, propertyKeyIds ) ); case EXISTS: final int labelId1 = schema.getLabelId(); final int[] propertyKeyIds1 = new int[]{schema.getPropertyId()}; return new NodePropertyExistenceConstraint( SchemaDescriptorFactory.forLabel( labelId1, propertyKeyIds1 ) ); default: throw new UnsupportedOperationException( "Although we cannot get here, this has not been implemented." ); } }

Target:
public PropertyConstraint computeSpecific( LabelSchemaDescriptor schema ) { switch ( descriptor.type() ) { case UNIQUE: return new UniquenessConstraint( schema ); case EXISTS: return new NodePropertyExistenceConstraint( schema ); default: throw new UnsupportedOperationException( "Although we cannot get here, this has not been implemented." ); } }
Source:
private Map<String, String> getTagFor(TableReference tableRef) { if (LoggingArgs.tableRef(tableRef).isSafeForLogging()) { return ImmutableMap.of("tableName", tableRef.getQualifiedName()); } else { return ImmutableMap.of("tableName", "suppressed"); } }

Target:
private Map<String, String> getTagFor(TableReference tableRef) { return ImmutableMap.of("tableName", LoggingArgs.safeTableOrPlaceholder(tableRef).getQualifiedName()); }
Source:
public GroupIdPage(GroupByIdBlock groupByIdBlock, Page page) { this.page = page; this.groupByIdBlock = groupByIdBlock; }

Target:
public GroupIdPage(GroupByIdBlock groupByIdBlock, Page page) { this.page = requireNonNull(page, "page is null"); this.groupByIdBlock = requireNonNull(groupByIdBlock, "groupByIdBlock is null"); }
Source:
public static Date parse(String date) { SimpleDateFormat format = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); format.setTimeZone(TimeZone.getTimeZone("ZULU")); Date ret; try { ret = format.parse(date); return ret; } catch (ParseException ex) { format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.getDefault()); try { return format.parse(date); } catch (ParseException e) { format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()); try { return format.parse(date); } catch (ParseException e1) { format = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()); try { return format.parse(date); } catch (ParseException e2) { format = new SimpleDateFormat("yyyy-MM", Locale.getDefault()); try { return format.parse(date); } catch (ParseException e3) { format = new SimpleDateFormat("yyyy", Locale.getDefault()); try { return format.parse(date); } catch (ParseException e4) { log.error(e4.getMessage(), e); } } } } } } return new Date(); }

Target:
public static Date parse(String date) { SimpleDateFormat format = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); format.setTimeZone(TimeZone.getTimeZone("ZULU")); Date ret; try { ret = format.parse(date); return ret; } catch (ParseException ex) { format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); format.setTimeZone(TimeZone.getTimeZone("ZULU")); try { return format.parse(date); } catch (ParseException e) { format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()); try { return format.parse(date); } catch (ParseException e1) { format = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()); try { return format.parse(date); } catch (ParseException e2) { format = new SimpleDateFormat("yyyy-MM", Locale.getDefault()); try { return format.parse(date); } catch (ParseException e3) { format = new SimpleDateFormat("yyyy", Locale.getDefault()); try { return format.parse(date); } catch (ParseException e4) { log.error(e4.getMessage(), e); } } } } } } return new Date(); }
Source:
private void refill() { long now = System.currentTimeMillis(); if (now - this.lastRefillTime >= this.refillPeriod) { this.remainingTokens = (int) Math.min(this.capacity, this.remainingTokens + (now - this.lastRefillTime) / this.refillPeriod); this.remainingTokens = Math.max(1, this.remainingTokens); this.lastRefillTime = now; } }

Target:
private void refill() { long now = System.currentTimeMillis(); if (now - this.lastRefillTime >= this.refillPeriod) { this.remainingTokens = (int) Math.min(this.capacity, this.remainingTokens + (now - this.lastRefillTime) / this.refillPeriod); this.remainingTokens = Math.max(1, this.remainingTokens); this.lastRefillTime += ((now - lastRefillTime) / refillPeriod) * refillPeriod; } }
Source:
public void showSingleOfficeObjectInOfficeView(String uri) { if (uri.isEmpty()) return; String filePath = CapraOfficeObject.getFilePathFromUri(uri); String objectID = CapraOfficeObject.getIdFromUri(uri); if (new File(filePath).exists()) parseFile(filePath, objectID); else showMessage(viewer.getControl().getShell(), SWT.ERROR, "Error", "Resource not found."); viewer.refresh(); }

Target:
public void showSingleOfficeObjectInOfficeView(String uri) { if (uri.isEmpty()) return; File officeFile = new File(CapraOfficeObject.getFilePathFromUri(uri)); String objectID = CapraOfficeObject.getIdFromUri(uri); if (officeFile.exists()) parseFile(officeFile, objectID); else showMessage(viewer.getControl().getShell(), SWT.ERROR, "Error", "Resource not found."); viewer.refresh(); }
Source:
public double leftExtrapolate(double xValue) { throw new IllegalArgumentException("Extrapolation is not permitted"); }

Target:
public double leftExtrapolate(double xValue) { throw new UnsupportedOperationException("Extrapolation is not permitted"); }
Source:
private void setupSearchMenuItem(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.media_search, menu); MenuItem searchMenuItem = menu.findItem(R.id.action_search); if (searchMenuItem != null) { searchView = (SearchView) MenuItemCompat.getActionView(searchMenuItem); searchView.setOnQueryTextListener(this); searchView.setQueryHint(getString(R.string.action_search)); if (!TextUtils.isEmpty(savedSearchFilter)) { searchMenuItem.expandActionView(); searchView.setQuery(savedSearchFilter, false); searchView.clearFocus(); } MenuItemCompat.setOnActionExpandListener(searchMenuItem, new MenuItemCompat.OnActionExpandListener() { @Override public boolean onMenuItemActionExpand(MenuItem item) { return true; } @Override public boolean onMenuItemActionCollapse(MenuItem item) { searchFilter = savedSearchFilter = null; restartLoader(); return true; } }); } View view = searchView.findViewById(R.id.search_close_btn); if (view != null) { view.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { EditText editText = (EditText) searchView.findViewById(R.id.search_src_text); editText.setText(""); searchView.setQuery("", false); searchFilter = savedSearchFilter = ""; restartLoader(); } }); } }

Target:
private void setupSearchMenuItem(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.media_search, menu); MenuItem searchMenuItem = menu.findItem(R.id.action_search); if (searchMenuItem != null) { searchView = (SearchView) MenuItemCompat.getActionView(searchMenuItem); searchView.setOnQueryTextListener(this); searchView.setQueryHint(getString(R.string.action_search)); if (!TextUtils.isEmpty(savedSearchFilter)) { searchMenuItem.expandActionView(); searchView.setQuery(savedSearchFilter, false); searchView.clearFocus(); } MenuItemCompat.setOnActionExpandListener(searchMenuItem, new MenuItemCompat.OnActionExpandListener() { @Override public boolean onMenuItemActionExpand(MenuItem item) { return true; } @Override public boolean onMenuItemActionCollapse(MenuItem item) { searchFilter = savedSearchFilter = null; refreshList(); return true; } }); } View view = searchView.findViewById(R.id.search_close_btn); if (view != null) { view.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { EditText editText = (EditText) searchView.findViewById(R.id.search_src_text); editText.setText(""); searchView.setQuery("", false); searchFilter = savedSearchFilter = ""; refreshList(); } }); } }
Source:
private void verifyInvalidValueSize(IndexValue value, String logSegmentName) { try { int capacity = TestUtils.RANDOM.nextInt(value.getBytes().capacity()); ByteBuffer invalidValue = ByteBuffer.allocate(capacity); invalidValue.put(value.getBytes().array(), 0, capacity); new IndexValue(logSegmentName, invalidValue, version); fail( "Contruction of IndexValue expected to fail with invalid byte buffer capacity of " + invalidValue.capacity()); } catch (IllegalArgumentException e) { } }

Target:
private void verifyInvalidValueSize(IndexValue value, String logSegmentName) { int capacity = TestUtils.RANDOM.nextInt(value.getBytes().capacity()); ByteBuffer invalidValue = ByteBuffer.allocate(capacity); invalidValue.put(value.getBytes().array(), 0, capacity); try { new IndexValue(logSegmentName, invalidValue, version); fail( "Contruction of IndexValue expected to fail with invalid byte buffer capacity of " + invalidValue.capacity()); } catch (IllegalArgumentException e) { } }
Source:
public long getProducerTimestamp() { return producerId << 16 >> 16; }

Target:
public long getProducerTimestamp() { return producerTimestamp; }
Source:
public DefaultNmsService(final NmsEntity entity, BlockingQueue<Optional<Message>> incomingMessageQueue, Consumer<Message> sink) { this.entity = Objects.requireNonNull(entity); this.incomingMessageQueue = incomingMessageQueue; this.entity.registerMessageListener(Message.class, message -> { LOGGER.trace("onMessage({})", message); switch (message.getType()) { case "MANAGEMENT_CALL_RETURN": String managementCallIdentifier = ((ManagementCallMessage) message).getManagementCallIdentifier(); ContextualReturn<?> contextualReturn = message.unwrap(ContextualReturn.class).get(0); getManagementAnswerFor(managementCallIdentifier).complete(contextualReturn); break; case "NOTIFICATION": case "STATISTICS": boolean offered = incomingMessageQueue.offer(Optional.of(message)); if (!offered) { sink.accept(message); } break; default: LOGGER.warn("Received unsupported message: " + message); } }); }

Target:
public DefaultNmsService(final NmsEntity entity, BlockingQueue<Optional<Message>> incomingMessageQueue, Consumer<Message> sink) { Objects.requireNonNull(sink); this.entity = Objects.requireNonNull(entity); this.incomingMessageQueue = Objects.requireNonNull(incomingMessageQueue); this.entity.registerMessageListener(Message.class, message -> { LOGGER.trace("onMessage({})", message); switch (message.getType()) { case "MANAGEMENT_CALL_RETURN": String managementCallIdentifier = ((ManagementCallMessage) message).getManagementCallIdentifier(); ContextualReturn<?> contextualReturn = message.unwrap(ContextualReturn.class).get(0); getManagementAnswerFor(managementCallIdentifier).complete(contextualReturn); break; case "NOTIFICATION": case "STATISTICS": boolean offered = incomingMessageQueue.offer(Optional.of(message)); if (!offered) { sink.accept(message); } break; default: LOGGER.warn("Received unsupported message: " + message); } }); }
Source:
protected int[] makeDimValSelector(PooledTopNParams params, int numProcessed, int numToProcess) { final TopNMetricSpecBuilder<int[]> arrayProvider = params.getArrayProvider(); if (query.getDimensionSpec().preservesOrdering()) { return arrayProvider.build(); } arrayProvider.ignoreFirstN(numProcessed); arrayProvider.keepOnlyN(numToProcess); return query.getTopNMetricSpec().configureOptimizer(arrayProvider).build(); }

Target:
protected int[] makeDimValSelector(PooledTopNParams params, int numProcessed, int numToProcess) { final TopNMetricSpecBuilder<int[]> arrayProvider = params.getArrayProvider(); if (!query.getDimensionSpec().preservesOrdering()) { return arrayProvider.build(); } arrayProvider.ignoreFirstN(numProcessed); arrayProvider.keepOnlyN(numToProcess); return query.getTopNMetricSpec().configureOptimizer(arrayProvider).build(); }
Source:
public static void main(String[] args) { Class<?>[] testClasses; try { testClasses = new Class<?>[]{ Class.forName(ReceiveAndDeleteMessageTest.class.getName()), Class.forName(ReceiveAndLockMessageTest.class.getName()), Class.forName(SendMessageTest.class.getName()), Class.forName(SendMessagesTest.class.getName()) }; } catch (ClassNotFoundException e) { throw new RuntimeException(e); } PerfStressProgram.run(testClasses, args); }

Target:
public static void main(String[] args) { Class<?>[] testClasses; testClasses = new Class<?>[]{ ReceiveAndDeleteMessageTest.class, ReceiveAndLockMessageTest.class, SendMessageTest.class, SendMessagesTest.class }; PerfStressProgram.run(testClasses, args); }
Source:
private void zoom(final double zoomFactor) { scale = scale * zoomFactor; repaintNow = true; repaint(); }

Target:
private void zoom(final double zoomFactor) { scale *= zoomFactor; repaintNow = true; repaint(); }
Source:
private void populateAuthorsAndMingleCards(List<StageFeedEntry> stageEntries, String pipelineName, Username username) { List<Long> pipelineIds = new ArrayList<>(); for (StageFeedEntry stageEntry : stageEntries) { pipelineIds.add(stageEntry.getPipelineId()); } CruiseConfig config = goConfigService.currentCruiseConfig(); Map<Long, List<ModificationForPipeline>> revisionsPerPipeline = changesetService.modificationsOfPipelines(pipelineIds, pipelineName, username); for (StageFeedEntry stageEntry : stageEntries) { List<ModificationForPipeline> revs = revisionsPerPipeline.get(stageEntry.getPipelineId()); for (ModificationForPipeline rev : revs) { Author author = rev.getAuthor(); if (author != null) { stageEntry.addAuthor(author); } String pipelineForRev = rev.getPipelineId().getPipelineName(); if (config.hasPipelineNamed(new CaseInsensitiveString(pipelineForRev))) { PipelineConfig pipelineConfig = config.pipelineConfigByName(new CaseInsensitiveString(pipelineForRev)); MingleConfig mingleConfig = pipelineConfig.getMingleConfig(); Set<String> cardNos = rev.getCardNumbersFromComments(); if (mingleConfig.isDefined()) { for (String cardNo : cardNos) { stageEntry.addCard(new MingleCard(mingleConfig, cardNo)); } } } else { LOGGER.debug("pipeline not found: " + pipelineForRev); } } } }

Target:
private void populateAuthorsAndMingleCards(List<StageFeedEntry> stageEntries, String pipelineName, Username username) { List<Long> pipelineIds = new ArrayList<>(); for (StageFeedEntry stageEntry : stageEntries) { pipelineIds.add(stageEntry.getPipelineId()); } CruiseConfig config = goConfigService.currentCruiseConfig(); Map<Long, List<ModificationForPipeline>> revisionsPerPipeline = changesetService.modificationsOfPipelines(pipelineIds, pipelineName, username); for (StageFeedEntry stageEntry : stageEntries) { List<ModificationForPipeline> revs = revisionsPerPipeline.get(stageEntry.getPipelineId()); for (ModificationForPipeline rev : revs) { Author author = rev.getAuthor(); if (author != null) { stageEntry.addAuthor(author); } String pipelineForRev = rev.getPipelineId().getPipelineName(); if (config.hasPipelineNamed(new CaseInsensitiveString(pipelineForRev))) { PipelineConfig pipelineConfig = config.pipelineConfigByName(new CaseInsensitiveString(pipelineForRev)); MingleConfig mingleConfig = pipelineConfig.getMingleConfig(); Set<String> cardNos = rev.getCardNumbersFromComments(); if (mingleConfig.isDefined()) { for (String cardNo : cardNos) { stageEntry.addCard(new MingleCard(mingleConfig, cardNo)); } } } else { LOGGER.debug("pipeline not found: {}", pipelineForRev); } } } }
Source:
public void testUavg() throws IOException, ProcCallException { String[] columnNames = {"Number"}; String[] columnValues = {"1", "2", "3", "4"}; testFunction("Uavg(Number)", 2.5, VoltType.FLOAT, columnNames, columnValues); }

Target:
public void testUavg() throws IOException, ProcCallException { String[] columnNames = {"NUM"}; String[][] columnValues = {{"1", "2", "3", "4"}}; Object[] expected = {2.5D}; testFunction("uavg(NUM)", expected, VoltType.FLOAT, columnNames, columnValues); }
Source:
public BufferAggregator factorizeBuffered(ColumnSelectorFactory metricFactory) { final BaseObjectColumnValueSelector selector = metricFactory.makeColumnValueSelector(getName()); return new StringFirstBufferAggregator(null, null, maxStringBytes) { @Override public void aggregate(ByteBuffer buf, int position) { SerializablePairLongString pair = (SerializablePairLongString) selector.getObject(); if (pair != null && pair.rhs != null) { ByteBuffer mutationBuffer = buf.duplicate(); mutationBuffer.position(position); long lastTime = mutationBuffer.getLong(position); if (pair.lhs < lastTime) { mutationBuffer.putLong(position, pair.lhs); byte[] valueBytes = StringUtils.toUtf8(pair.rhs); mutationBuffer.putInt(position + Long.BYTES, valueBytes.length); mutationBuffer.position(position + Long.BYTES + Integer.BYTES); mutationBuffer.put(valueBytes); } } } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("selector", selector); } }; }

Target:
public BufferAggregator factorizeBuffered(ColumnSelectorFactory metricFactory) { final BaseObjectColumnValueSelector selector = metricFactory.makeColumnValueSelector(getName()); return new StringFirstBufferAggregator(null, null, maxStringBytes) { @Override public void aggregate(ByteBuffer buf, int position) { SerializablePairLongString pair = (SerializablePairLongString) selector.getObject(); if (pair != null && pair.lhs != null) { ByteBuffer mutationBuffer = buf.duplicate(); mutationBuffer.position(position); long lastTime = mutationBuffer.getLong(position); if (pair.lhs < lastTime) { mutationBuffer.putLong(position, pair.lhs); if (pair.rhs != null) { byte[] valueBytes = StringUtils.toUtf8(pair.rhs); mutationBuffer.putInt(position + Long.BYTES, valueBytes.length); mutationBuffer.position(position + Long.BYTES + Integer.BYTES); mutationBuffer.put(valueBytes); } else { mutationBuffer.putInt(position + Long.BYTES, 0); } } } } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("selector", selector); } }; }
Source:
public String getProcessFilePath(final HWND hwnd) { final byte[] filePath = new byte[256]; final IntByReference pid = new IntByReference(); User32.INSTANCE.GetWindowThreadProcessId(hwnd, pid); final HANDLE process = Kernel32.INSTANCE.OpenProcess( 0x0400 | 0x0010, false, pid.getValue()); if (process == null && Kernel32.INSTANCE.GetLastError() != 5) throw new Win32Exception(Kernel32.INSTANCE.GetLastError()); final int length = Psapi.INSTANCE.GetModuleFileNameExA(process, null, filePath, filePath.length); if (length == 0 && Kernel32.INSTANCE.GetLastError() != 6) throw new Win32Exception(Kernel32.INSTANCE.GetLastError()); return Native.toString(filePath).trim(); }

Target:
public String getProcessFilePath(final HWND hwnd) { final char[] filePath = new char[1025]; final IntByReference pid = new IntByReference(); User32.INSTANCE.GetWindowThreadProcessId(hwnd, pid); final HANDLE process = Kernel32.INSTANCE.OpenProcess( WinNT.PROCESS_QUERY_INFORMATION | WinNT.PROCESS_VM_READ, false, pid.getValue()); if (process == null && Kernel32.INSTANCE.GetLastError() != WinNT.ERROR_ACCESS_DENIED) throw new Win32Exception(Kernel32.INSTANCE.GetLastError()); final int length = Psapi.INSTANCE.GetModuleFileNameExW(process, null, filePath, filePath.length); if (length == 0 && Kernel32.INSTANCE.GetLastError() != WinNT.ERROR_INVALID_HANDLE) throw new Win32Exception(Kernel32.INSTANCE.GetLastError()); return Native.toString(filePath).trim(); }
Source:
public Double getRowCount(Intersect rel, RelMetadataQuery mq) { Double rowCount = null; for (RelNode input : rel.getInputs()) { Double partialRowCount = mq.getRowCount(input); if (rowCount == null || partialRowCount != null && partialRowCount < rowCount) { rowCount = partialRowCount; } } if (!rel.all) { return rowCount; } else { return rowCount * 2; } }

Target:
public Double getRowCount(Intersect rel, RelMetadataQuery mq) { Double rowCount = null; for (RelNode input : rel.getInputs()) { Double partialRowCount = mq.getRowCount(input); if (rowCount == null || partialRowCount != null && partialRowCount < rowCount) { rowCount = partialRowCount; } } if (!rel.all) { return rowCount; } else { if (rowCount != null) { return rowCount * 2; } else { return rowCount; } } }
Source:
public void executionForDeletionByKey() throws Exception { final String key = randomKey(); final CategoryDraft draft = CategoryDraftBuilder.of(randomSlug(), randomSlug()).key(key).build(); final Category category = client().executeBlocking(CategoryCreateCommand.of(draft)); client().executeBlocking(CategoryDeleteCommand.ofKey(key,category.getVersion())); assertThat(client().executeBlocking(CategoryQuery.of().byId(category.getId())).head()).isEmpty(); }

Target:
public void executionForDeletionByKey() throws Exception { final String key = randomKey(); final CategoryDraft draft = CategoryDraftBuilder.of(randomLocalizedString(), randomSlug()).key(key).build(); final Category category = client().executeBlocking(CategoryCreateCommand.of(draft)); client().executeBlocking(CategoryDeleteCommand.ofKey(key,category.getVersion())); assertThat(client().executeBlocking(CategoryQuery.of().byId(category.getId())).head()).isEmpty(); }
Source:
@Test public void smokeTest() throws Exception { int sleepSeconds = -1; switch (platform) { case NATIVE: sleepSeconds = 0; break; case CENTOS: case UBUNTU: case SIMPLE: sleepSeconds = 10; break; case ALPINE: case SLIM: sleepSeconds = 45; break; default: fail("Unknown enum value: " + platform); break; } String script = String.format("echo hello world; sleep %s", sleepSeconds); Controller c = new BourneShellScript(script).launch(new EnvVars(), ws, launcher, listener); awaitCompletion(c); ByteArrayOutputStream baos = new ByteArrayOutputStream(); c.writeLog(ws,baos); assertEquals(0, c.exitStatus(ws, launcher, listener).intValue()); assertTrue(baos.toString().contains("hello world")); c.cleanup(ws); assertThat(getZombies(), isEmptyString()); }

Target:
@Test public void smokeTest() throws Exception { int sleepSeconds; switch (platform) { case NATIVE: sleepSeconds = 0; break; case CENTOS: case UBUNTU: case NO_INIT: sleepSeconds = 10; break; case ALPINE: case SLIM: sleepSeconds = 45; break; default: throw new AssertionError(platform); } String script = String.format("echo hello world; sleep %s", sleepSeconds); Controller c = new BourneShellScript(script).launch(new EnvVars(), ws, launcher, listener); awaitCompletion(c); ByteArrayOutputStream baos = new ByteArrayOutputStream(); c.writeLog(ws,baos); assertEquals(0, c.exitStatus(ws, launcher, listener).intValue()); assertTrue(baos.toString().contains("hello world")); c.cleanup(ws); assertThat(getZombies(), isEmptyString()); }
Source:
private void verifyPopoverImageUrlWithHoverRetry( final String popoverSelector, final String hoverSelector, final String urlRegex, String taskName) { RetryManager.runUntilNoException(new RetryableTask(taskName) { @Override public void run() { verifyPopoverImageUrl(popoverSelector, urlRegex); } @Override public void beforeRetry() { moveToElement(By.cssSelector(hoverSelector)); } }, WebDriverException.class); }

Target:
private void verifyPopoverImageUrlWithHoverRetry( final String popoverSelector, final String hoverSelector, final String urlRegex, String taskName) throws MaximumRetriesExceededException { uiRetryManager.runUntilNoRecognizedException(new RetryableTask(taskName) { @Override public void run() { verifyPopoverImageUrl(popoverSelector, urlRegex); } @Override public void beforeRetry() { moveToElement(By.cssSelector(hoverSelector)); } }, WebDriverException.class); }
Source:
public ColumnIndices(ColumnIndices other, boolean mutable) { this(other.schemaVersion, new HashMap<Pair<Class<? extends RealmModel>, String>, ColumnInfo>(other.classesToColumnInfo.size()), mutable); for (Map.Entry<Pair<Class<? extends RealmModel>, String>, ColumnInfo> entry : other.classesToColumnInfo.entrySet()) { ColumnInfo columnInfo = entry.getValue().copy(mutable); Pair<Class<? extends RealmModel>, String> oldKey = entry.getKey(); Pair<Class<? extends RealmModel>, String> newKey = Pair.<Class<? extends RealmModel>, String>create(oldKey.first, oldKey.second); this.classes.put(newKey.first, columnInfo); this.classesByName.put(newKey.second, columnInfo); this.classesToColumnInfo.put(newKey, columnInfo); } }

Target:
public ColumnIndices(ColumnIndices other, boolean mutable) { this(other.schemaVersion, new HashMap<Pair<Class<? extends RealmModel>, String>, ColumnInfo>(other.classesToColumnInfo.size()), mutable); for (Map.Entry<Pair<Class<? extends RealmModel>, String>, ColumnInfo> entry : other.classesToColumnInfo.entrySet()) { ColumnInfo columnInfo = entry.getValue().copy(mutable); Pair<Class<? extends RealmModel>, String> key = entry.getKey(); this.classes.put(key.first, columnInfo); this.classesByName.put(key.second, columnInfo); this.classesToColumnInfo.put(key, columnInfo); } }
Source:
protected ColumnRealName resolveCompoundColumn(ColumnRealName baseRealName, ConditionOption option) { if (option == null || !option.hasCompoundColumn()) { return baseRealName; } if (!option.hasStringConnector()) { String msg = "The option should have string connector when compound column is specified: " + option; throw new IllegalConditionBeanOperationException(msg); } final List<SpecifiedColumn> compoundColumnList = option.getCompoundColumnList(); final List<ColumnRealName> realNameList = new ArrayList<ColumnRealName>(); if (option.treatsCompoundColumnNullAsEmpty()) { realNameList.add(toColumnRealName("coalesce(" + baseRealName + ",\'\')")); for (SpecifiedColumn specifiedColumn : compoundColumnList) { realNameList.add(toColumnRealName("coalesce(" + doResolveCompoundColumn(option, specifiedColumn) + ",\'\')")); } } else { realNameList.add(baseRealName); for (SpecifiedColumn specifiedColumn : compoundColumnList) { ColumnRealName resolvedColumnRealName = doResolveCompoundColumn(option, specifiedColumn); realNameList.add(resolvedColumnRealName); } } final OnQueryStringConnector stringConnector = option.getStringConnector(); final String connected = stringConnector.connect(realNameList.toArray()); return ColumnRealName.create(null, new ColumnSqlName(connected)); }

Target:
protected ColumnRealName resolveCompoundColumn(ColumnRealName baseRealName, ConditionOption option) { if (option == null || !option.hasCompoundColumn()) { return baseRealName; } if (!option.hasStringConnector()) { String msg = "The option should have string connector when compound column is specified: " + option; throw new IllegalConditionBeanOperationException(msg); } final List<SpecifiedColumn> compoundColumnList = option.getCompoundColumnList(); final List<ColumnRealName> realNameList = new ArrayList<ColumnRealName>(); realNameList.add(doResolveCompoundColumnOption(option, baseRealName)); for (SpecifiedColumn specifiedColumn : compoundColumnList) { realNameList.add(doResolveCompoundColumnOption(option, doResolveCompoundColumnCipher(option, specifiedColumn))); } final OnQueryStringConnector stringConnector = option.getStringConnector(); final String connected = stringConnector.connect(realNameList.toArray()); return ColumnRealName.create(null, new ColumnSqlName(connected)); }
Source:
public void handleMinutesSpentInputChange( ChangeEvent event ) { try { Long value = minutesSpentInput.getValue().isEmpty() ? null : Long.parseLong( minutesSpentInput.getValue() ); presenter.onMinutesSpentChange( value ); } catch ( NumberFormatException e ) { } }

Target:
public void handleMinutesSpentInputChange( ChangeEvent event ) { boolean isNumeric = minutesSpentInput.getValue().matches( "\\d+" ); if (isNumeric) { presenter.onMinutesSpentChange( Long.parseLong( minutesSpentInput.getValue() ) ); } else { presenter.onMinutesSpentChange( 0l ); minutesSpentInput.setValue( "0" ); } }
Source:
public void onConnect(String message) { debugView.showPermanently(getString(R.string.connected)); switchableView.setDisplayedChild(1); presenter.startListeningForDirection(); }

Target:
public void onConnect(String message) { debugView.showPermanently(getString(R.string.connected)); switchableView.setDisplayedChild(1); }
Source:
protected Map<ComponentType, Set<DistributionModuleGroup>> buildModuleGroups() { Map<ComponentType, Set<DistributionModuleGroup>> componentsMap = new HashMap<>(); componentsMap.put(ComponentType.HDFS, QuboleHDFSModuleGroup.getModuleGroups()); componentsMap.put(ComponentType.HIVE, QuboleHiveModuleGroup.getModuleGroups()); componentsMap.put(ComponentType.PIG, QubolePigModuleGroup.getModuleGroups()); componentsMap.put(ComponentType.PIGOUTPUT, QubolePigOutputModuleGroup.getModuleGroups()); return componentsMap; }

Target:
protected Map<ComponentType, Set<DistributionModuleGroup>> buildModuleGroups() { Map<ComponentType, Set<DistributionModuleGroup>> componentsMap = new HashMap<>(); componentsMap.put(ComponentType.HIVE, QuboleHiveModuleGroup.getModuleGroups()); componentsMap.put(ComponentType.PIG, QubolePigModuleGroup.getModuleGroups()); componentsMap.put(ComponentType.PIGOUTPUT, QubolePigOutputModuleGroup.getModuleGroups()); return componentsMap; }
Source:
public void run() { long currentTime = System.currentTimeMillis(); long purgeTime; Object[] purgeTimes = new Object[1]; List<VariableExpressionExecutor> variableExpressionExecutorList = new ArrayList<>(); Attribute attribute; VariableExpressionExecutor variableExpressionExecutor; ComplexEventChunk<StateEvent> eventChunk = new ComplexEventChunk<>(true); BaseIncrementalDataPurgingValueStore baseIncrementalDataPurgingValueStore = new BaseIncrementalDataPurgingValueStore(currentTime, streamEventPool); attribute = new Attribute(INTERNAL_AGG_TIMESTAMP_FIELD, Attribute.Type.LONG); variableExpressionExecutor = new VariableExpressionExecutor(attribute, 0, 1); variableExpressionExecutorList.add(variableExpressionExecutor); for (Map.Entry<TimePeriod.Duration, Table> entry : aggregationTables.entrySet()) { if (retentionPeriods.get(entry.getKey()) != -1) { Variable leftVariable = new Variable(INTERNAL_AGG_TIMESTAMP_FIELD); leftVariable.setStreamId(entry.getValue().getTableDefinition().getId()); Compare expression = new Compare(leftVariable, Compare.Operator.LESS_THAN, new Variable(INTERNAL_AGG_TIMESTAMP_FIELD)); purgeTime = currentTime - retentionPeriods.get(entry.getKey()); purgeTimes[0] = purgeTime; StateEvent secEvent = baseIncrementalDataPurgingValueStore.createStreamEvent(purgeTimes); eventChunk.add(secEvent); Table table = aggregationTables.get(entry.getKey()); try { CompiledCondition compiledCondition = table.compileCondition(expression, matchingMetaInfoHolder(table, attribute), siddhiAppContext, variableExpressionExecutorList, tableMap, "query1"); LOG.info("Purging has enable for the table: " + table.getTableDefinition().getId() + " with a" + " retention of timestamp : " + purgeTime); table.deleteEvents(eventChunk, compiledCondition, 1); } catch (Exception e) { LOG.error("Exception occurred while deleting events from " + table.getTableDefinition().getId() + " table", e); throw new DataPurgingException("Exception occurred while deleting events from " + table.getTableDefinition().getId() + " table", e); } } } }

Target:
public void run() { long currentTime = System.currentTimeMillis(); long purgeTime; Object[] purgeTimeArray = new Object[1]; for (Map.Entry<TimePeriod.Duration, Table> entry : aggregationTables.entrySet()) { if (!retentionPeriods.get(entry.getKey()).equals(RETAIN_ALL)) { purgeTime = currentTime - retentionPeriods.get(entry.getKey()); purgeTimeArray[0] = purgeTime; StateEvent secEvent = createStreamEvent(purgeTimeArray, currentTime); eventChunk.add(secEvent); Table table = aggregationTables.get(entry.getKey()); try { LOG.info("Purging data of table: " + table.getTableDefinition().getId() + " with a" + " retention of timestamp : " + purgeTime); table.deleteEvents(eventChunk, compiledConditionsHolder.get(entry.getKey()), 1); } catch (RuntimeException e) { LOG.error("Exception occurred while deleting events from " + table.getTableDefinition().getId() + " table", e); throw new DataPurgingException("Exception occurred while deleting events from " + table.getTableDefinition().getId() + " table", e); } } } }
Source:
public void validateSerialNumber(@RequestBody SerialNumberValidationDto params, HttpServletRequest request, HttpServletResponse response, UriComponentsBuilder uriBuilder) throws IOException { String serialNumber = params.getSerialNumber(); String maybeContainerId = params.getContainerId(); if (isStringEmptyOrNull(serialNumber) || isStringEmptyOrNull(maybeContainerId)) { throw new RestException("Serial number and containerID must be provided", Status.BAD_REQUEST); } Long containerId = SequencerPartitionContainerImpl.UNSAVED_ID; if (!maybeContainerId.contains("Unsaved")) { containerId = Long.valueOf(maybeContainerId); } try { List<SequencerPartitionContainer> matchingContainers = (List<SequencerPartitionContainer>) containerService .listByBarcode(serialNumber); if (matchingContainers.isEmpty() || (matchingContainers.size() == 1 && matchingContainers.get(0).getId() == containerId)) { return; } else { throw new RestException("Serial number is already associated with another container", Status.PRECONDITION_FAILED); } } catch (IOException e) { String error = String.format("Error looking up containers by serial number '%s'", serialNumber); log.error(error, e); throw new RestException(error); } }

Target:
public void validateSerialNumber(@RequestBody SerialNumberValidationDto params, HttpServletRequest request, HttpServletResponse response, UriComponentsBuilder uriBuilder) throws IOException { String serialNumber = params.getSerialNumber(); String maybeContainerId = params.getContainerId(); if (isStringEmptyOrNull(serialNumber) || isStringEmptyOrNull(maybeContainerId)) { throw new RestException("Serial number and containerID must be provided", Status.BAD_REQUEST); } final Long containerId = (maybeContainerId.contains("Unsaved") ? SequencerPartitionContainerImpl.UNSAVED_ID : Long.valueOf(Integer.valueOf(maybeContainerId))); List<SequencerPartitionContainer> matchingContainers = (List<SequencerPartitionContainer>) containerService .listByBarcode(serialNumber); if (!matchingContainers.isEmpty() && matchingContainers.stream().noneMatch(spc -> spc.getId() == containerId)) { throw new RestException("Serial number is already associated with another container", Status.BAD_REQUEST); } }
Source:
public void testFileBatchInputFormatText() throws Exception { String filePath = "file:/ String testData = "String for testing purposes"; Path textFile = new Path(filePath); Configuration conf = new Configuration(); FileSystem fs = FileSystem.get(conf); FSDataOutputStream writeData = fs.create(textFile); writeData.write(testData.getBytes()); writeData.flush(); writeData.close(); ETLStage source = new ETLStage( "source", new ETLPlugin("File", BatchSource.PLUGIN_TYPE, ImmutableMap.<String, String>builder() .put(Constants.Reference.REFERENCE_NAME, "TestFile") .put(Properties.File.FILESYSTEM, "Text") .put(Properties.File.PATH, filePath) .put(Properties.File.FILE_SOURCE_FORMAT, "text") .put(Properties.File.IGNORE_NON_EXISTING_FOLDERS, "false") .build(), null)); String outputDatasetName = "test-filesource-text"; ETLStage sink = new ETLStage("sink", MockSink.getPlugin(outputDatasetName)); ETLBatchConfig etlConfig = ETLBatchConfig.builder("* * * * *") .addStage(source) .addStage(sink) .addConnection(source.getName(), sink.getName()) .build(); AppRequest<ETLBatchConfig> appRequest = new AppRequest<>(BATCH_ARTIFACT, etlConfig); ApplicationId appId = NamespaceId.DEFAULT.app("FileSourceTextFormat"); ApplicationManager appManager = deployApplication(appId, appRequest); WorkflowManager workflowManager = appManager.getWorkflowManager(SmartWorkflow.NAME); workflowManager.start(); workflowManager.waitForRuns(ProgramRunStatus.COMPLETED, 1, 2, TimeUnit.MINUTES); DataSetManager<Table> outputManager = getDataset(outputDatasetName); List<StructuredRecord> output = MockSink.readOutput(outputManager); Assert.assertEquals(1, output.size()); Assert.assertEquals(testData, output.get(0).get("body")); }

Target:
public void testFileBatchInputFormatText() throws Exception { File fileText = new File(temporaryFolder.newFolder(), "test.txt"); String outputDatasetName = "test-filesource-text"; Schema textSchema = Schema.recordOf("file.record", Schema.Field.of("offset", Schema.of(Schema.Type.LONG)), Schema.Field.of("body", Schema.nullableOf(Schema.of(Schema.Type.STRING))), Schema.Field.of("file", Schema.nullableOf(Schema.of( Schema.Type.STRING)))); ApplicationManager appManager = createSourceAndDeployApp(fileText, "text", outputDatasetName, textSchema); FileUtils.writeStringToFile(fileText, "Hello,World!"); workflowStartAndWait(appManager); List<StructuredRecord> expected = ImmutableList.of( StructuredRecord.builder(textSchema) .set("offset", (long)0) .set("body", "Hello,World!") .set("file", fileText.toURI().toString()) .build() ); DataSetManager<Table> outputManager = getDataset(outputDatasetName); List<StructuredRecord> output = MockSink.readOutput(outputManager); Assert.assertEquals(output, expected); }
Source:
public byte toByte() { switch (this) { case CORE: return 1; case LEAF: return 2; default: throw new IllegalStateException(); } }

Target:
public byte toByte() { return fByte; }
Source:
public GroupedExecutionProperties visitTableScan(TableScanNode node, Void context) { Optional<TablePartitioning> tablePartitioning = metadata.getLayout(session, node.getTable()).getTablePartitioning(); if (!tablePartitioning.isPresent()) { return GroupedExecutionProperties.notCapable(); } List<ConnectorPartitionHandle> partitionHandles = nodePartitioningManager.listPartitionHandles(session, tablePartitioning.get().getPartitioningHandle()); boolean recoveryEligible = metadata.getConnectorCapabilities(session, node.getTable().getConnectorId()).contains(SUPPORTS_REWINDABLE_SPLIT_SOURCE); boolean useful = isGroupedExecutionForAllEligibleTableScansEnabled(session); if (ImmutableList.of(NOT_PARTITIONED).equals(partitionHandles)) { return new GroupedExecutionProperties(false, useful, ImmutableList.of(), 1, recoveryEligible); } else { return new GroupedExecutionProperties(true, useful, ImmutableList.of(node.getId()), partitionHandles.size(), recoveryEligible); } }

Target:
public GroupedExecutionProperties visitTableScan(TableScanNode node, Void context) { Optional<TablePartitioning> tablePartitioning = metadata.getLayout(session, node.getTable()).getTablePartitioning(); if (!tablePartitioning.isPresent()) { return GroupedExecutionProperties.notCapable(); } List<ConnectorPartitionHandle> partitionHandles = nodePartitioningManager.listPartitionHandles(session, tablePartitioning.get().getPartitioningHandle()); boolean recoveryEligible = metadata.getConnectorCapabilities(session, node.getTable().getConnectorId()).contains(SUPPORTS_REWINDABLE_SPLIT_SOURCE); boolean useful = isGroupedExecutionForEligibleTableScansEnabled(session); if (ImmutableList.of(NOT_PARTITIONED).equals(partitionHandles)) { return new GroupedExecutionProperties(false, useful, ImmutableList.of(), 1, recoveryEligible); } else { return new GroupedExecutionProperties(true, useful, ImmutableList.of(node.getId()), partitionHandles.size(), recoveryEligible); } }
Source:
public String toString() { return "MemberCandidate{" + "candidate=" + candidate + ", member=" + member + ", richUser=" + richUser + '}'; }

Target:
public String toString() { return getClass().getSimpleName()+ ":[" + "candidate='" + candidate + "', member='" + member + "', richUser='" + richUser + "']"; }
Source:
public F.Promise<Result> pop() { return cmsService().get(userContext().locale(), "pop").flatMap(cms -> { final ProductOverviewPageContent pageData = new ProductOverviewPageContent(cms); return view().map(view -> ok(view.productOverviewPage(pageData))); }); }

Target:
public F.Promise<Result> pop() { return withCms("pop", cms -> { final ProductOverviewPageContent content = new ProductOverviewPageContent(cms); return render(view -> ok(view.productOverviewPage(content))); }); }
Source:
public <T> Future<T> submit(Callable<T> task) { final Callable<T> callable = doWrapOrThrowException(task, controlPoint); try { return super.submit(doIdentityWrap(callable)); } catch (RejectedExecutionException e) { controlPoint.requestComplete(); throw e; } }

Target:
public <T> Future<T> submit(Callable<T> task) { final Callable<T> callable = doWrap(task, controlPoint); try { return super.submit(doIdentityWrap(callable)); } catch (Exception e) { controlPoint.requestComplete(); throw e; } }