auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void registerCustomCredential(final Props props, final Credentials hadoopCred, final String userToProxy) { String credentialClassName = "unknown class"; try { if (!props.containsKey(Constants.ConfigurationKeys.CUSTOM_CREDENTIAL_NAME)) { throw new Exception("can not find settings for credential class"); } credentialClassName = props .get(Constants.ConfigurationKeys.CUSTOM_CREDENTIAL_NAME); logger.info("custom credential class name: " + credentialClassName); final Class metricsClass = Class.forName(credentialClassName); final Constructor[] constructors = metricsClass.getConstructors(); final CredentialProvider customCredential = (CredentialProvider) constructors[0] .newInstance(hadoopCred, props); customCredential.register(userToProxy); } catch (final Exception e) { logger.error("Encountered error while loading and instantiating " + credentialClassName, e); throw new IllegalStateException("Encountered error while loading and instantiating " + credentialClassName, e); } }

Target:
private void registerCustomCredential(final Props props, final Credentials hadoopCred, final String userToProxy) { String credentialClassName = "unknown class"; try { credentialClassName = props .getString(Constants.ConfigurationKeys.CUSTOM_CREDENTIAL_NAME); logger.info("custom credential class name: " + credentialClassName); final Class metricsClass = Class.forName(credentialClassName); final Constructor[] constructors = metricsClass.getConstructors(); final CredentialProvider customCredential = (CredentialProvider) constructors[0] .newInstance(hadoopCred, props); customCredential.register(userToProxy); } catch (final Exception e) { logger.error("Encountered error while loading and instantiating " + credentialClassName, e); throw new IllegalStateException("Encountered error while loading and instantiating " + credentialClassName, e); } }
Source:
public void onCancelled(DatabaseError error) { }

Target:
public void onCancelled(DatabaseError error) { Log.e(TAG, "A fatal error occurred retrieving the necessary keys to populate your adapter."); super.onCancelled(error); }
Source:
void HttpCookie(String domain) { HttpCookie myCookie = new Cookie("name", "val"); myCookie.setDomain(".com"); myCookie.setDomain(".myDomain.com"); myCookie.setDomain(domain); }

Target:
void HttpCookie(String domain) { HttpCookie myCookie = new HttpCookie("name", "val"); myCookie.setDomain(".com"); myCookie.setDomain(".myDomain.com"); myCookie.setDomain(domain); }
Source:
private static boolean isLocalhost(String host) { return "localhost".equals(host) || "127.0.0.1".equals(host) || "0.0.0.0".equals(host); }

Target:
private static boolean isLocalhost(String host) { return "localhost".equals(host) || "127.0.0.1".equals(host); }
Source:
private void updateDataSize() { retainedSizeInBytes = INSTANCE_SIZE + sizeOf(valueIsNull) + sizeOf(values) + NULL_VALUE_BLOCK.getRetainedSizeInBytes(); if (blockBuilderStatus != null) { retainedSizeInBytes += BlockBuilderStatus.INSTANCE_SIZE; } }

Target:
private void updateDataSize() { retainedSizeInBytes = INSTANCE_SIZE + sizeOf(valueIsNull) + sizeOf(values); if (blockBuilderStatus != null) { retainedSizeInBytes += BlockBuilderStatus.INSTANCE_SIZE; } }
Source:
ListenableFuture<Void> start() { Context ctx = Context.current(); ProgressiveBackoff progressiveBackoff = new ProgressiveBackoff(retrier::newBackoff); AtomicLong committedOffset = new AtomicLong(0); ListenableFuture<Void> callFuture = callAndQueryOnFailureWithRetrier(ctx, committedOffset, progressiveBackoff); callFuture = Futures.catchingAsync( callFuture, Exception.class, (e) -> { Status status = Status.fromThrowable(e); if (status != null && status.getCode() == Code.UNAUTHENTICATED) { callCredentialsProvider.refresh(); return callAndQueryOnFailureWithRetrier(ctx, committedOffset, progressiveBackoff); } else { return Futures.immediateFailedFuture(e); } }, MoreExecutors.directExecutor() ); return Futures.transformAsync( callFuture, (result) -> { long committedSize = committedOffset.get(); long expected = chunker.getSize(); if (committedSize != expected) { String message = format( "write incomplete: committed_size %d for %d total", committedSize, expected); return Futures.immediateFailedFuture(new IOException(message)); } return Futures.immediateFuture(null); }, MoreExecutors.directExecutor()); }

Target:
ListenableFuture<Void> start() { Context ctx = Context.current(); ProgressiveBackoff progressiveBackoff = new ProgressiveBackoff(retrier::newBackoff); AtomicLong committedOffset = new AtomicLong(0); ListenableFuture<Void> callFuture = callAndQueryOnFailureWithRetrier(ctx, committedOffset, progressiveBackoff); callFuture = Futures.catchingAsync( callFuture, Exception.class, (e) -> { Status status = Status.fromThrowable(e); if (status != null && (status.getCode() == Code.UNAUTHENTICATED || status.getCode() == Code.PERMISSION_DENIED)) { try { callCredentialsProvider.refresh(); } catch (IOException ioe) { e.addSuppressed(ioe); return Futures.immediateFailedFuture(e); } return callAndQueryOnFailureWithRetrier(ctx, committedOffset, progressiveBackoff); } else { return Futures.immediateFailedFuture(e); } }, MoreExecutors.directExecutor() ); return Futures.transformAsync( callFuture, (result) -> { long committedSize = committedOffset.get(); long expected = chunker.getSize(); if (committedSize != expected) { String message = format( "write incomplete: committed_size %d for %d total", committedSize, expected); return Futures.immediateFailedFuture(new IOException(message)); } return Futures.immediateFuture(null); }, MoreExecutors.directExecutor()); }
Source:
private int getKeySize(X509Certificate cert){ PublicKey publicKey = cert.getPublicKey(); if (publicKey instanceof RSAPublicKey){ return ((RSAPublicKey)publicKey).getModulus().bitLength(); } return -1; }

Target:
private static int getKeySize(X509Certificate cert){ PublicKey publicKey = cert.getPublicKey(); if (publicKey instanceof RSAPublicKey){ return ((RSAPublicKey)publicKey).getModulus().bitLength(); } return -1; }
Source:
protected void execute(TaskListener listener) throws IOException, InterruptedException { LOGGER.info("Docker Container Watchdog has been triggered"); this.csmMerged = new ContainerNodeNameMapping(); this.loadNodeMap(); for (Cloud c : this.getAllClouds()) { if (!(c instanceof DockerCloud)) { continue; } DockerCloud dc = (DockerCloud) c; LOGGER.info("Checking Docker Cloud '{}'", dc.getDisplayName()); listener.getLogger().println(String.format("Checking Docker Cloud %s", dc.getDisplayName())); this.checkCloud(dc); } this.checkForSuperfluousComputer(); LOGGER.info("Docker Container Watchdog check has been completed"); }

Target:
protected void execute(TaskListener listener) throws IOException, InterruptedException { if (!JenkinsUtils.getSystemPropertyBoolean(DockerContainerWatchdog.class.getName()+".enabled", true)) { LOGGER.info("Docker Container Watchdog is disabled based on system configuration"); return; } LOGGER.info("Docker Container Watchdog has been triggered"); executionStatistics.writeStatisticsToLog(); executionStatistics.addExecution(); Instant start = clock.instant(); try { ContainerNodeNameMap csmMerged = new ContainerNodeNameMap(); Instant snapshotInstance = clock.instant(); Map<String, Node> nodeMap = loadNodeMap(); try { for (DockerCloud dc : getAllClouds()) { LOGGER.info("Checking Docker Cloud at {}", dc.getDisplayName(), dc.getDockerApi().getDockerHost().getUri()); listener.getLogger().println(String.format("Checking Docker Cloud %s", dc.getDisplayName())); csmMerged = processCloud(dc, nodeMap, csmMerged, snapshotInstance); } if (csmMerged.isContainerListIncomplete()) { LOGGER.info("Not checking the list of nodes, as list of containers is known to be incomplete"); } else { cleanUpSuperfluousComputer(nodeMap, csmMerged, snapshotInstance); } } catch (WatchdogProcessingTimeout timeout) { LOGGER.warn("Processing of cleanup watchdog took too long; current timeout value: ms, " + "watchdog started on {}", PROCESSING_TIMEOUT_IN_MS, start.toString(), timeout); executionStatistics.addProcessingTimeout(); executionStatistics.addOverallRuntime(Duration.between(start, clock.instant()).toMillis()); return; } } finally { Instant stop = clock.instant(); executionStatistics.addOverallRuntime(Duration.between(start, stop).toMillis()); } LOGGER.info("Docker Container Watchdog check has been completed"); }
Source:
protected PageRec doCreatePage(IWorkbenchPart part) { Page page = createPage(part); PageSite site = new PageSite(this.getViewSite()); page.init(site); page.createControl(this.getPageBook()); return new PageBookView.PageRec(part, page); }

Target:
protected PageRec doCreatePage(IWorkbenchPart part) { Page page = createMinimapPage(part); PageSite site = new PageSite(this.getViewSite()); page.init(site); page.createControl(this.getPageBook()); return new PageBookView.PageRec(part, page); }
Source:
public void getBlobTestFailure() { blobStore.containerExists(CONTAINER_TEMP); blobStore.createContainerInLocation(null, CONTAINER_TEMP); Blob blob = blobStore.blobBuilder(smallFile.getName()) .payload(new FilePayload(smallFile)) .build(); blobStore.putBlob(CONTAINER, blob); blobStore.getBlob(CONTAINER, smallFile.getName()); blobStore.clearContainer(CONTAINER_TEMP); blobStore.deleteContainer(CONTAINER_TEMP); }

Target:
public void getBlobTestFailure() { blobStore.containerExists(CONTAINER_TEMP); blobStore.createContainerInLocation(null, CONTAINER_TEMP); Blob blob = blobStore.blobBuilder(smallFile.getName()) .payload(new FilePayload(smallFile)) .build(); blobStore.putBlob(CONTAINER_TEMP, blob); blobStore.getBlob(CONTAINER_TEMP, smallFile.getName()); blobStore.clearContainer(CONTAINER_TEMP); blobStore.deleteContainer(CONTAINER_TEMP); }
Source:
public void testWrongParams() throws CorruptObjectException, UnmergedPathException, IOException { Git git = new Git(db); try { git.commit().setAuthor(author).run(); fail("Didn't got the expected exception"); } catch (IllegalArgumentException e) { } }

Target:
public void testWrongParams() throws CorruptObjectException, UnmergedPathException, IOException { final Git git = new Git(db); try { git.commit().setAuthor(author).call(); fail("Didn't get the expected exception"); } catch (final IllegalArgumentException e) { assertEquals(e.getMessage(), CommitCommand.COMMIT_MESSAGE_NOT_SPECIFIED); } }
Source:
protected Toolbar createMainToolbar() { toolbar_ = new Toolbar("Tutorial Tab"); toolbar_.addLeftWidget(homeButton_ = commands_.tutorialHome().createToolbarButton()); toolbar_.addLeftWidget(commands_.tutorialPopout().createToolbarButton()); toolbar_.addLeftWidget(commands_.tutorialStop().createToolbarButton()); toolbar_.addRightWidget(commands_.tutorialRefresh().createToolbarButton()); return toolbar_; }

Target:
protected Toolbar createMainToolbar() { toolbar_ = new Toolbar("Tutorial Tab"); toolbar_.addLeftWidget(commands_.tutorialHome().createToolbarButton()); toolbar_.addLeftWidget(commands_.tutorialPopout().createToolbarButton()); toolbar_.addLeftWidget(commands_.tutorialStop().createToolbarButton()); toolbar_.addRightWidget(commands_.tutorialRefresh().createToolbarButton()); return toolbar_; }
Source:
public RelationTypeSchemaDescriptor( int relTypeId, int... propertyIds ) { this.relTypeId = relTypeId; this.propertyIds = propertyIds; }

Target:
RelationTypeSchemaDescriptor( int relTypeId, int... propertyIds ) { this.relTypeId = relTypeId; this.propertyIds = propertyIds; }
Source:
private void buildErrataDetailPanel() { errataDetailPanel.clear(); errataDetailFormPanel = new GeneralFormPanel(); errataTitle = new Span(); errataTitle.setStyleName(style.errataTitleLabel()); FlowPanel errataTitlePanel = new FlowPanel(); errataTitlePanel.setStyleName(style.errataTitlePanel()); errataTitlePanel.add(errataTitle); errataDetailPanel.add(errataTitlePanel); errataDetailPanel.setStyleName("testtest"); errataDetailPanel.add(errataDetailFormPanel); }

Target:
private void buildErrataDetailPanel() { errataDetailPanel.clear(); errataDetailFormPanel = new GeneralFormPanel(); errataTitle = new Span(); errataTitle.setStyleName(style.errataTitleLabel()); FlowPanel errataTitlePanel = new FlowPanel(); errataTitlePanel.setStyleName(style.errataTitlePanel()); errataTitlePanel.add(errataTitle); errataDetailPanel.add(errataTitlePanel); errataDetailPanel.add(errataDetailFormPanel); }
Source:
private AudioStream getDefaultAudioStream() { int streamIndex = ListHelper.getDefaultAudioFormat(activity, currentInfo.getAudioStreams()); return currentInfo.getAudioStreams().get(streamIndex); }

Target:
private AudioStream getDefaultAudioStream() { final List<AudioStream> audioStreams = currentInfo.getAudioStreams(); final int streamIndex = ListHelper.getDefaultAudioFormat(activity, audioStreams); return audioStreams.get(streamIndex); }
Source:
public void cellValue(ByteString newValue) { if (newValue == null || newValue.isEmpty()) { return; } if (nextValueIndex == -1) { this.value = newValue.toByteArray(); nextValueIndex = newValue.size(); } else { int newValueSize = newValue.size(); Preconditions.checkState( Integer.MAX_VALUE - nextValueIndex > newValueSize, "value would be too large to contain"); this.value = Arrays.copyOf(this.value, nextValueIndex + newValueSize); System.arraycopy(newValue.toByteArray(), 0, this.value, nextValueIndex, newValueSize); nextValueIndex += newValueSize; } }

Target:
public void cellValue(ByteString newValue) { if (nextValueIndex == -1) { this.value = ByteStringer.extract(newValue); nextValueIndex = newValue.size(); return; } Preconditions.checkState( nextValueIndex + newValue.size() <= value.length, "Cell value is larger than expected"); newValue.copyTo(this.value, this.nextValueIndex); nextValueIndex += newValue.size(); }
Source:
public List<String> getLabels() { return null; }

Target:
public List<String> getLabels() { throw new UnsupportedOperationException(); }
Source:
private SymbolProviderManager(@NonNull List<@NonNull SymbolProviderFactoryWrapper> providers) { fProviders = ImmutableList.<SymbolProviderFactoryWrapper> copyOf(providers); }

Target:
private SymbolProviderManager(@NonNull List<@NonNull SymbolProviderFactoryWrapper> providers) { fProviders = ImmutableList.copyOf(providers); }
Source:
public void dispose() { GitProjectData.removeRepositoryChangeListener(repoChangeListener); Activator.getDefault().getIndexDiffCache().removeIndexDiffChangedListener(indexDiffChangeListener); super.dispose(); }

Target:
public void dispose() { GitProjectData.removeRepositoryChangeListener(repoChangeListener); IndexDiffCache indexDiffCache = Activator.getDefault() .getIndexDiffCache(); if (indexDiffCache != null) indexDiffCache .removeIndexDiffChangedListener(indexDiffChangeListener); super.dispose(); }
Source:
private StateLogComponents createLogComponentsForServer( DataSource dataSource, NamespaceAndUseCase namespaceAndUseCase) { Client client = namespaceAndUseCase.namespace(); String paxosUseCase = namespaceAndUseCase.useCase(); PaxosStateLog<PaxosValue> learnerLog = SqlitePaxosStateLog.create( ImmutableNamespaceAndUseCase.of( client, LearnerUseCase.createLearnerUseCase(paxosUseCase).value()), dataSource); PaxosStateLog<PaxosAcceptorState> acceptorLog = SqlitePaxosStateLog.create( ImmutableNamespaceAndUseCase.of( client, AcceptorUseCase.createAcceptorUseCase(paxosUseCase).value()), dataSource); return StateLogComponents.builder() .dataSource(dataSource) .learnerLog(learnerLog) .acceptorLog(acceptorLog) .build(); }

Target:
private static StateLogComponents createLogComponentsForServer( DataSource dataSource, NamespaceAndUseCase namespaceAndUseCase) { Client client = namespaceAndUseCase.namespace(); String paxosUseCase = namespaceAndUseCase.useCase(); PaxosStateLog<PaxosValue> learnerLog = SqlitePaxosStateLog.create( ImmutableNamespaceAndUseCase.of( client, LearnerUseCase.createLearnerUseCase(paxosUseCase).value()), dataSource); PaxosStateLog<PaxosAcceptorState> acceptorLog = SqlitePaxosStateLog.create( ImmutableNamespaceAndUseCase.of( client, AcceptorUseCase.createAcceptorUseCase(paxosUseCase).value()), dataSource); return StateLogComponents.builder() .dataSource(dataSource) .learnerLog(learnerLog) .acceptorLog(acceptorLog) .build(); }
Source:
public void testWhereColumnEqualsValues() throws Exception { indexBulkDocuments(INDEX_NAME, 10); try (DataSet ds = dataContext .query() .from(DEFAULT_TABLE_NAME) .select("user") .and("message") .where("user") .isEquals("user4") .execute()) { assertEquals(ElasticSearchRestDataSet.class, ds.getClass()); assertTrue(ds.next()); assertEquals("Row[values=[user4, 4]]", ds.getRow().toString()); assertFalse(ds.next()); } }

Target:
public void testWhereColumnEqualsValues() throws Exception { indexBulkDocuments(INDEX_NAME, 10); try (final DataSet dataSet = dataContext .query() .from(DEFAULT_TABLE_NAME) .select("user") .and("message") .where("user") .isEquals("user4") .execute()) { assertEquals(ElasticSearchRestDataSet.class, dataSet.getClass()); assertTrue(dataSet.next()); assertEquals("Row[values=[user4, 4]]", dataSet.getRow().toString()); assertFalse(dataSet.next()); } }
Source:
Map<String, Long> getCompactionProgress(String partitionPath) throws BlobStorageException { ByteArrayOutputStream baos = new ByteArrayOutputStream(64); boolean hasCheckpoint = azureBlobDataAccessor.downloadFile(CHECKPOINT_CONTAINER, partitionPath, baos, false); if (!hasCheckpoint) { return emptyCheckpoints; } try { ObjectNode jsonNode = (ObjectNode) objectMapper.readTree(baos.toString()); Map<String, Long> checkpoints = new HashMap<>(); for (String fieldName : new String[]{CloudBlobMetadata.FIELD_DELETION_TIME, CloudBlobMetadata.FIELD_EXPIRATION_TIME}) { checkpoints.put(fieldName, jsonNode.has(fieldName) ? jsonNode.get(fieldName).longValue() : DEFAULT_TIME); } return checkpoints; } catch (IOException e) { logger.error("Could not retrieve compaction progress for {}", partitionPath, e); azureMetrics.compactionProgressReadErrorCount.inc(); return emptyCheckpoints; } }

Target:
Map<String, Long> getCompactionProgress(String partitionPath) throws CloudStorageException { String payload = requestAgent.doWithRetries( () -> { ByteArrayOutputStream baos = new ByteArrayOutputStream(CHECKPOINT_BUFFER_SIZE); boolean hasCheckpoint = azureBlobDataAccessor.downloadFile(CHECKPOINT_CONTAINER, partitionPath, baos, false); return hasCheckpoint ? baos.toString() : null; }, "Download compaction checkpoint", partitionPath); if (payload == null) { return new HashMap(emptyCheckpoints); } try { ObjectNode jsonNode = (ObjectNode) objectMapper.readTree(payload); Map<String, Long> checkpoints = new HashMap<>(); for (String fieldName : compactionFields) { checkpoints.put(fieldName, jsonNode.has(fieldName) ? jsonNode.get(fieldName).longValue() : DEFAULT_TIME); } return checkpoints; } catch (IOException e) { logger.error("Could not retrieve compaction progress for {}", partitionPath, e); azureMetrics.compactionProgressReadErrorCount.inc(); return new HashMap(emptyCheckpoints); } }
Source:
public void write(CorfuPayloadMsg<WriteRequest> msg, ChannelHandlerContext ctx, IServerRouter r) { log.debug("log write: global: {}, streams: {}", msg.getPayload().getToken(), msg.getPayload().getData().getBackpointerMap()); LogData logData = (LogData) msg.getPayload().getData(); batchWriter.addTask(WRITE, msg) .thenAccept(Void -> { dataCache.put(msg.getPayload().getGlobalAddress(), logData); r.sendResponse(ctx, msg, CorfuMsgType.WRITE_OK.msg()); }).exceptionally(ex -> { handleException(ex, ctx, msg, r); return null; }); }

Target:
public void write(CorfuPayloadMsg<WriteRequest> msg, ChannelHandlerContext ctx, IServerRouter r) { log.debug("log write: global: {}, streams: {}", msg.getPayload().getToken(), msg.getPayload().getData().getBackpointerMap()); LogData logData = (LogData) msg.getPayload().getData(); batchWriter.addTask(WRITE, msg) .thenRunAsync(() -> { dataCache.put(msg.getPayload().getGlobalAddress(), logData); r.sendResponse(ctx, msg, CorfuMsgType.WRITE_OK.msg()); }, executor).exceptionally(ex -> { handleException(ex, ctx, msg, r); return null; }); }
Source:
public void testPostTaskDataWithoutProduct() throws Exception { final TaskMapping taskMappingInit = new TaskMapping() { @Override public String getSummary() { return "The Summary"; } @Override public String getDescription() { return "The Description"; } }; AbstractTaskDataHandler taskDataHandler = connector.getTaskDataHandler(); TaskAttributeMapper mapper = taskDataHandler.getAttributeMapper(actualFixture.repository()); TaskData taskData = new TaskData(mapper, actualFixture.repository().getConnectorKind(), actualFixture.repository().getRepositoryUrl(), ""); taskDataHandler.initializeTaskData(actualFixture.repository(), taskData, taskMappingInit, null); taskData.getRoot().getAttribute("cf_dropdown").setValue("one"); try { connector.getClient(actualFixture.repository()).postTaskData(taskData, null); fail("never reach this!"); } catch (BugzillaRestException e) { String url = actualFixture.getRepositoryUrl(); assertEquals("You must select/enter a product. (status: Bad Request from " + url.substring(url.lastIndexOf('/')) + "/rest.cgi/bug)", e.getMessage()); } }

Target:
public void testPostTaskDataWithoutProduct() throws Exception { final TaskMapping taskMappingInit = new TaskMapping() { @Override public String getSummary() { return "The Summary"; } @Override public String getDescription() { return "The Description"; } }; AbstractTaskDataHandler taskDataHandler = connector.getTaskDataHandler(); TaskAttributeMapper mapper = taskDataHandler.getAttributeMapper(actualFixture.repository()); TaskData taskData = new TaskData(mapper, actualFixture.repository().getConnectorKind(), actualFixture.repository().getRepositoryUrl(), ""); taskDataHandler.initializeTaskData(actualFixture.repository(), taskData, taskMappingInit, null); taskData.getRoot().getAttribute("cf_dropdown").setValue("one"); try { connector.getClient(actualFixture.repository()).postTaskData(taskData, null); fail("BugzillaRestException expected, never reach this!"); } catch (BugzillaRestException e) { String url = actualFixture.getRepositoryUrl(); assertEquals("You must select/enter a product. (status: Bad Request from " + url.substring(url.lastIndexOf('/')) + "/rest.cgi/bug)", e.getMessage()); } }
Source:
private TableStatisticsMetadata getStatisticsCollectionMetadata(List<ColumnMetadata> columns, List<String> partitionedBy, boolean includeRowCount) { Set<ColumnStatisticMetadata> columnStatistics = columns.stream() .filter(column -> !partitionedBy.contains(column.getName())) .filter(column -> !column.isHidden()) .map(this::getColumnStatisticMetadata) .flatMap(List::stream) .collect(toImmutableSet()); if (!includeRowCount) { return new TableStatisticsMetadata(columnStatistics, ImmutableSet.of(), partitionedBy); } return new TableStatisticsMetadata(columnStatistics, ImmutableSet.of(ROW_COUNT), partitionedBy); }

Target:
private TableStatisticsMetadata getStatisticsCollectionMetadata(List<ColumnMetadata> columns, List<String> partitionedBy, boolean includeRowCount) { Set<ColumnStatisticMetadata> columnStatistics = columns.stream() .filter(column -> !partitionedBy.contains(column.getName())) .filter(column -> !column.isHidden()) .map(this::getColumnStatisticMetadata) .flatMap(List::stream) .collect(toImmutableSet()); Set<TableStatisticType> tableStatistics = includeRowCount ? ImmutableSet.of(ROW_COUNT) : ImmutableSet.of(); return new TableStatisticsMetadata(columnStatistics, tableStatistics, partitionedBy); }
Source:
public Mono<Response<String>> acquireLeaseWithResponse(int duration, RequestConditions modifiedRequestConditions) { try { return withContext(context -> acquireLeaseWithResponse(duration, modifiedRequestConditions, context), STORAGE_TRACING_PROPERTIES); } catch (RuntimeException ex) { return monoError(logger, ex); } }

Target:
public Mono<Response<String>> acquireLeaseWithResponse(int duration, RequestConditions modifiedRequestConditions) { try { return withContext(context -> acquireLeaseWithResponse(duration, modifiedRequestConditions, context)); } catch (RuntimeException ex) { return monoError(logger, ex); } }
Source:
public void ProximityChanged(float distance) { this.distance = distance; notifyDataObservers(null, distance); EventDispatcher.dispatchEvent(this, "ProximityChanged", this.distance); }

Target:
public void ProximityChanged(float distance) { this.distance = distance; notifyDataObservers("distance", distance); EventDispatcher.dispatchEvent(this, "ProximityChanged", this.distance); }
Source:
protected Builder() { id("softlayer") .name("SoftLayer") .apiMetadata(new SoftLayerApiMetadata()) .homepage(URI.create("<LINK_1>")) .console(URI.create("<LINK_0>")) .iso3166Codes("SG","US-CA","US-TX","US-VA","US-WA","US-TX", "NL") .endpoint("<LINK_2>") .defaultProperties(SoftLayerProviderMetadata.defaultProperties()); }

Target:
protected Builder() { id("softlayer") .name("SoftLayer") .apiMetadata(new SoftLayerApiMetadata()) .homepage(URI.create("<LINK_1>")) .console(URI.create("<LINK_0>")) .iso3166Codes("SG","US-CA","US-TX","US-VA","US-WA","US-TX") .endpoint("<LINK_2>") .defaultProperties(SoftLayerProviderMetadata.defaultProperties()); }
Source:
public void startParsing() { BackgroundTask.wrap(() -> currentCitationfetcher.performSearch(inputTextProperty.getValue())) .onRunning(() -> dialogService.notify(Localization.lang("Your text is being parsed..."))) .onFailure((e) -> { if (e instanceof UncheckedIOException) { String msg = Localization.lang("There are connection issues with the %0 server. Detailed information: %1.", currentCitationfetcher.getServerUrl(), e.getMessage()); dialogService.notify(msg); } else { LOGGER.warn("Missing exception handling.", e); } }) .onSuccess(parsedEntries -> { dialogService.notify(Localization.lang("%0 entries were parsed from your query.", String.valueOf(parsedEntries.size()))); importHandler.importEntries(parsedEntries); for (BibEntry bibEntry : parsedEntries) { trackNewEntry(bibEntry); } }).executeWith(taskExecutor); }

Target:
public void startParsing() { BackgroundTask.wrap(() -> currentCitationfetcher.performSearch(inputTextProperty.getValue())) .onRunning(() -> dialogService.notify(Localization.lang("Your text is being parsed..."))) .onFailure((e) -> { if (e instanceof FetcherException) { String msg = Localization.lang("There are connection issues with a JabRef server. Detailed information: %0.", e.getMessage()); dialogService.notify(msg); } else { LOGGER.warn("Missing exception handling.", e); } }) .onSuccess(parsedEntries -> { dialogService.notify(Localization.lang("%0 entries were parsed from your query.", String.valueOf(parsedEntries.size()))); importHandler.importEntries(parsedEntries); for (BibEntry bibEntry : parsedEntries) { trackNewEntry(bibEntry); } }).executeWith(taskExecutor); }
Source:
public InfinispanResponse deleteCacheValue(InfinispanRequest request) throws RestResponseException { try { String cacheName = request.getCacheName().get(); String key = request.getKey().orElseThrow(NoKeyException::new); Optional<Boolean> useAsync = request.getUseAsync(); CacheEntry<String, Object> entry = restCacheManager.getInternalEntry(cacheName, key); InfinispanResponse response = InfinispanResponse.inReplyTo(request); response.status(HttpResponseStatus.NOT_FOUND); if (entry instanceof InternalCacheEntry) { InternalCacheEntry<String, Object> ice = (InternalCacheEntry<String, Object>) entry; Optional<String> clientEtag = request.getEtagIfNoneMatch(); if (clientEtag.isPresent()) { Metadata meta = entry.getMetadata(); if (meta instanceof MimeMetadata) { String etag = calcETAG(ice.getValue(), ((MimeMetadata) meta).contentType()); if (clientEtag.map(t -> t.equals(etag)).orElse(true)) { response.status(HttpResponseStatus.OK); deleteCacheValue(cacheName, key, useAsync); } else { response.status(HttpResponseStatus.PRECONDITION_FAILED); } } } else { response.status(HttpResponseStatus.OK); deleteCacheValue(cacheName, key, useAsync); } } return response; } catch (CacheException cacheException) { throw new NoCacheFoundException(cacheException.getLocalizedMessage()); } }

Target:
public InfinispanResponse deleteCacheValue(InfinispanRequest request) throws RestResponseException { try { String cacheName = request.getCacheName().get(); String key = request.getKey().orElseThrow(NoKeyException::new); Optional<Boolean> useAsync = request.getUseAsync(); CacheEntry<String, Object> entry = restCacheManager.getInternalEntry(cacheName, key); InfinispanResponse response = InfinispanResponse.inReplyTo(request); response.status(HttpResponseStatus.NOT_FOUND); if (entry instanceof InternalCacheEntry) { InternalCacheEntry<String, Object> ice = (InternalCacheEntry<String, Object>) entry; Optional<String> clientEtag = request.getEtagIfNoneMatch(); if (clientEtag.isPresent()) { Metadata meta = entry.getMetadata(); if (meta instanceof MimeMetadata) { String etag = calcETAG(ice.getValue(), ((MimeMetadata) meta).contentType()); if (clientEtag.get().equals(etag)) { response.status(HttpResponseStatus.OK); deleteCacheValue(cacheName, key, useAsync); } else { response.status(HttpResponseStatus.PRECONDITION_FAILED); } } } else { response.status(HttpResponseStatus.OK); deleteCacheValue(cacheName, key, useAsync); } } return response; } catch (CacheException cacheException) { throw new NoCacheFoundException(cacheException.getLocalizedMessage()); } }
Source:
public void isLeader() { LOG.info("We are the leader! Starting BaragonStatePersisterWorker..."); if (statePersisterWorkerFuture != null) { statePersisterWorkerFuture.cancel(false); } statePersisterWorkerFuture = scheduledExecutorService.scheduleAtFixedRate( baragonStatePersisterWorker, baragonConfiguration.getWorkerConfiguration().getInitialDelayMs(), baragonConfiguration.getWorkerConfiguration().getIntervalMs(), TimeUnit.MILLISECONDS); }

Target:
public void isLeader() { LOG.info("We are the leader! Starting BaragonStatePersisterWorker..."); if (statePersisterWorkerFuture != null) { statePersisterWorkerFuture.cancel(false); } statePersisterWorkerFuture = scheduledExecutorService.scheduleAtFixedRate( baragonStatePersisterWorker, config.getInitialDelayMs(), config.getIntervalMs(), TimeUnit.MILLISECONDS); }
Source:
@Override public String toString() { boolean first = true; StringBuilder builder = new StringBuilder("SetBinding["); for (SetBinding<T> setBinding = this; setBinding != null; setBinding = setBinding.parent) { for (Binding<?> contributor : setBinding.contributors) { if (!first) { builder.append(","); } builder.append(contributor); first = false; } } builder.append("]"); return builder.toString(); }

Target:
@Override public String toString() { boolean first = true; StringBuilder builder = new StringBuilder("SetBinding["); for (SetBinding<T> setBinding = this; setBinding != null; setBinding = setBinding.parent) { for (int i = 0, size = setBinding.contributors.size(); i < size; i++) { if (!first) { builder.append(","); } builder.append(setBinding.contributors.get(i)); first = false; } } builder.append("]"); return builder.toString(); }
Source:
public void addPlayers() { retrieveTeam(team -> { try { tm.begin(); String playerName; while (!(playerName = con.readLine("Enter player's name (to stop adding, type \"q\"): ")).equals("q")) { team.addPlayer(playerName); String country = con.readLine("Enter player's country: "); players.put(playerName, country); } teams.put(team.getName(), team); tm.commit(); } catch (Exception e) { con.printf("Exception message %s", e.getMessage()); } }); }

Target:
public void addPlayers() { retrieveTeam(team -> { String playerName; while (!(playerName = con.readLine("Enter player's name (to stop adding, type \"q\"): ")).equals("q")) { team.addPlayer(playerName); String country = con.readLine("Enter player's country: "); players.put(playerName, country); } teams.put(team.getName(), team); }); }
Source:
public LongInputStreamV1(OrcInputStream input, boolean signed) { this.input = input; this.signed = signed; lastReadInputCheckpoint = input.getCheckpoint(); }

Target:
public LongInputStreamV1(OrcInputStream input, boolean signed) { this.input = input; this.signed = signed; }
Source:
public boolean visit(final UserdataPwdRules userdata) throws ResourceUnavailableException { final VirtualRouter router = userdata.getRouter(); final Commands commands = new Commands(Command.OnError.Stop); final VirtualMachineProfile profile = userdata.getProfile(); final NicVO nicVo = userdata.getNicVo(); final UserVmVO userVM = userdata.getUserVM(); if (router.getRedundantState() == VirtualRouter.RedundantState.MASTER) { _commandSetupHelper.createPasswordCommand(router, profile, nicVo, commands); } _commandSetupHelper.createVmDataCommand(router, userVM, nicVo, userVM.getDetail("SSH.PublicKey"), commands); return _networkGeneralHelper.sendCommandsToRouter(router, commands); }

Target:
public boolean visit(final UserdataPwdRules userdata) throws ResourceUnavailableException { final VirtualRouter router = userdata.getRouter(); final Commands commands = new Commands(Command.OnError.Stop); final VirtualMachineProfile profile = userdata.getProfile(); final NicVO nicVo = userdata.getNicVo(); final UserVmVO userVM = userdata.getUserVM(); if (router.getIsRedundantRouter() && router.getVpcId() == null && router.getRedundantState() == VirtualRouter.RedundantState.MASTER) { _commandSetupHelper.createPasswordCommand(router, profile, nicVo, commands); }else if (!router.getIsRedundantRouter() || router.getVpcId()!= null){ _commandSetupHelper.createPasswordCommand(router, profile, nicVo, commands); } _commandSetupHelper.createVmDataCommand(router, userVM, nicVo, userVM.getDetail("SSH.PublicKey"), commands); return _networkGeneralHelper.sendCommandsToRouter(router, commands); }
Source:
public void setPostLogoutRedirectUri(URI postLogoutRedirectUri) { Assert.notNull(postLogoutRedirectUri, "postLogoutRedirectUri cannot be empty"); this.postLogoutRedirectUriTemplate = postLogoutRedirectUri.toASCIIString(); }

Target:
public void setPostLogoutRedirectUri(URI postLogoutRedirectUri) { Assert.notNull(postLogoutRedirectUri, "postLogoutRedirectUri cannot be empty"); this.postLogoutRedirectUri = postLogoutRedirectUri.toASCIIString(); }
Source:
protected boolean verify(@NonNull List<AuthScope> grantedScopes, @NonNull final String objectId) { if (grantedScopes.stream().anyMatch(AuthScope::allowAllProjects)) { log.info("Access granted to blanket scope"); return true; } val projectCodes = getAuthorizedProjectCodes(grantedScopes); val projCd = fetchProjectCode(objectId); val result = projectCodes.contains(projCd); log.info("checking for permission to project for object id ({})", projCd, objectId, result); return result; }

Target:
protected boolean verify(@NonNull List<AuthScope> grantedScopes, @NonNull final String objectId) { if (grantedScopes.stream().anyMatch(AuthScope::allowAllProjects)) { log.info("Access granted to blanket scope"); return true; } val projectCodes = getAuthorizedProjectCodes(grantedScopes); val requiredProjectCode = fetchProjectCode(objectId); val result = projectCodes.contains(requiredProjectCode); log.info("checking for permission to project for object id ({})", requiredProjectCode, objectId, result); return result; }
Source:
public int compareTo(AvroReplacementDescriptor o) { if (priority != o.priority) { return Integer.compare(priority, o.priority); } else { return forbidden == null ? o.forbidden == null ? 0 : 1 : forbidden.compareTo(o.forbidden); } }

Target:
public int compareTo(AvroReplacementDescriptor o) { if (priority != o.priority) { return Integer.compare(priority, o.priority); } else { return Objects.compare(forbidden, o.forbidden, String::compareTo); } }
Source:
public void testPostRequest() throws IOException { final TestMessage message = new TestMessage("messagetest", "12345"); HttpWebResponse httpResponse = null; WebRequestHandler request = new WebRequestHandler(); String json = new Gson().toJson(message); try { httpResponse = request.sendPost(getUrl(TEST_WEBAPI_URL), null, json.getBytes(ENCODING_UTF8), "application/json"); } catch (final IOException e) { Assert.fail("Encounter unexpected IOException."); } assertTrue("status is 200", httpResponse.getStatusCode() == 200); String responseMsg = new String(httpResponse.getBody()); assertTrue("request body check", responseMsg.contains(message.getAccessToken() + message.getUserName())); }

Target:
public void testPostRequest() throws IOException { final TestMessage message = new TestMessage("messagetest", "12345"); HttpWebResponse httpResponse = null; WebRequestHandler request = new WebRequestHandler(); String json = new Gson().toJson(message); httpResponse = request.sendPost(getUrl(TEST_WEBAPI_URL), null, json.getBytes(ENCODING_UTF8), "application/json"); assertTrue("status is 200", httpResponse.getStatusCode() == 200); String responseMsg = new String(httpResponse.getBody()); assertTrue("request body check", responseMsg.contains(message.getAccessToken() + message.getUserName())); }
Source:
public void apply(OnlineCommandContext ctx) throws IOException { Operations ops = new Operations(ctx.client); String socketBindingGroup = ctx.client.options().isDomain ? "full-sockets" : "standard-sockets"; Address socketBindingAddress = Address.of("socket-binding-group", socketBindingGroup) .and("socket-binding", socketBindingName); if (replaceExisting) { try { ops.removeIfExists(socketBindingAddress); } catch (OperationException e) { throw new IOException("Failed to remove existing socket binding " + socketBindingName, e); } } ops.add(socketBindingAddress, Values.empty() .andListOptional(String.class, "client-mappings", clientMappings) .andOptional("fixed-port", fixedPort) .andOptional("interface", interfaceName) .andOptional("multicast-address", multicastAddress) .andOptional("multicast-port", multicastPort) .andOptional("port", port)); }

Target:
public void apply(OnlineCommandContext ctx) throws CommandFailedException, IOException { Operations ops = new Operations(ctx.client); String contextSocketBindingGroup; if (socketBindingGroup == null) { contextSocketBindingGroup = ctx.client.options().isDomain ? "full-sockets" : "standard-sockets"; } else { contextSocketBindingGroup = socketBindingGroup; } Address socketBindingAddress = Address.of("socket-binding-group", contextSocketBindingGroup) .and("socket-binding", socketBindingName); if (replaceExisting) { try { ops.removeIfExists(socketBindingAddress); } catch (OperationException e) { throw new CommandFailedException("Failed to remove existing socket binding " + socketBindingName, e); } } ops.add(socketBindingAddress, Values.empty() .andListOptional(String.class, "client-mappings", clientMappings) .andOptional("fixed-port", fixedPort) .andOptional("interface", interfaceName) .andOptional("multicast-address", multicastAddress) .andOptional("multicast-port", multicastPort) .andOptional("port", port)); }
Source:
private void initUI() { ArrayList<Integer> tableNumbers = new ArrayList<Integer>(); for (int i = 1; i <= getTablesCount(); i++) { tableNumbers.add(i); } mTableStatus = getTableStatus(); GridViewAdapter imagesItem = new GridViewAdapter(this, tableNumbers, R.layout.table_item, mTableStatus); GridView tablesView = (GridView) findViewById(R.id.tables); tablesView.setAdapter(imagesItem); tablesView.setOnItemClickListener(new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { OrderManager.getInstance().setTableId(position + 1); if (mTableStatus.get(position) == true) { OrderManager.getInstance().setTableId(position + 1); Intent intent = new Intent(SelectTableActivity.this, MainListActivity.class); startActivity(intent); } else { } } }); registerForContextMenu(tablesView); }

Target:
private void initUI() { GridViewAdapter imagesItem = new GridViewAdapter(this, R.layout.table_item, mTablesList); GridView tablesView = (GridView) findViewById(R.id.tables); tablesView.setAdapter(imagesItem); tablesView.setOnItemClickListener(new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { OrderManager.getInstance().setTableId(position + 1); if (mTablesList.get(position).isFree()) { Intent intent = new Intent(SelectTableActivity.this, MainListActivity.class); startActivity(intent); } else { } } }); registerForContextMenu(tablesView); }
Source:
public List<CertificateSerialDto> getEntitlementCertificateSerials( @PathParam("consumer_uuid") @Verify(Consumer.class) String consumerUuid) { log.debug("Getting client certificate serials for consumer: {}", consumerUuid); Consumer consumer = consumerCurator.verifyAndLookupConsumer(consumerUuid); poolManager.regenerateDirtyEntitlements(consumer); List<CertificateSerialDto> allCerts = new LinkedList<CertificateSerialDto>(); for (Long id : entCertService.listEntitlementSerialIds(consumer)) { allCerts.add(new CertificateSerialDto(id)); } if (!StringUtils.isEmpty(consumer.getOwner().getContentAccessMode())) { ContentAccessCertificate cac = consumer.getContentAccessCert(); if (cac != null) { allCerts.add(new CertificateSerialDto(cac.getSerial().getId())); } } return allCerts; }

Target:
public List<CertificateSerialDto> getEntitlementCertificateSerials( @PathParam("consumer_uuid") @Verify(Consumer.class) String consumerUuid) { log.debug("Getting client certificate serials for consumer: {}", consumerUuid); Consumer consumer = consumerCurator.verifyAndLookupConsumer(consumerUuid); checkForGuestMigration(consumer); poolManager.regenerateDirtyEntitlements(consumer); List<CertificateSerialDto> allCerts = new LinkedList<CertificateSerialDto>(); for (Long id : entCertService.listEntitlementSerialIds(consumer)) { allCerts.add(new CertificateSerialDto(id)); } if (!consumer.getOwner().contentAccessMode() .equals(ContentAccessCertServiceAdapter.DEFAULT_CONTENT_ACCESS_MODE)) { try { ContentAccessCertificate cac = contentAccessCertService.getCertificate(consumer); if (cac != null) { allCerts.add(new CertificateSerialDto(cac.getSerial().getId())); } } catch (IOException ioe) { throw new BadRequestException(i18n.tr("Cannot retrieve content access certificate"), ioe); } catch (GeneralSecurityException gse) { throw new BadRequestException(i18n.tr("Cannot retrieve content access certificate", gse)); } } return allCerts; }
Source:
public ServerInfoResource(NodeVersion nodeVersion, NodeInfo nodeInfo, ServerConfig serverConfig, GracefulShutdownHandler shutdownHandler) { this.version = requireNonNull(nodeVersion, "nodeVersion is null"); this.environment = requireNonNull(nodeInfo, "nodeInfo is null").getEnvironment(); this.isCoordinator = requireNonNull(requireNonNull(serverConfig, "serverConfig is null").isCoordinator()); this.shutdownHandler = requireNonNull(shutdownHandler, "shutdownHandler is null"); this.startTime = System.nanoTime(); }

Target:
public ServerInfoResource(NodeVersion nodeVersion, NodeInfo nodeInfo, ServerConfig serverConfig, GracefulShutdownHandler shutdownHandler) { this.version = requireNonNull(nodeVersion, "nodeVersion is null"); this.environment = requireNonNull(nodeInfo, "nodeInfo is null").getEnvironment(); this.coordinator = requireNonNull(requireNonNull(serverConfig, "serverConfig is null").isCoordinator()); this.shutdownHandler = requireNonNull(shutdownHandler, "shutdownHandler is null"); }
Source:
public T path(String path) { this.path += "/" + encodePath(path); return returnThis(); }

Target:
public T path(String path) { if (path.length() == 0) { this.path += encodePath(path); } else { this.path += "/" + encodePath(path); } return returnThis(); }
Source:
private void writeNumaTune() { NumaTuneMode numaTune = vm.getNumaTuneMode(); if (numaTune == null) { return; } Map<String, Object> numaTuneSetting = NumaSettingFactory.buildVmNumatuneSetting( numaTune, vmNumaNodesSupplier.get()); if (numaTuneSetting.isEmpty()) { return; } String nodeSet = (String) numaTuneSetting.get(VdsProperties.NUMA_TUNE_NODESET); String mode = (String) numaTuneSetting.get(VdsProperties.NUMA_TUNE_MODE); @SuppressWarnings("unchecked") List<Map<String, String>> memNodes = (List<Map<String, String>>) numaTuneSetting.get(VdsProperties.NUMA_TUNE_MEMNODES); if (nodeSet != null || memNodes != null) { writer.writeStartElement("numatune"); if (nodeSet != null) { writer.writeStartElement("memory"); writer.writeAttributeString("mode", mode); writer.writeAttributeString("modeset", nodeSet); writer.writeEndElement(); } if (memNodes != null) { for (Map<String, String> memnode : memNodes) { writer.writeStartElement("memnode"); writer.writeAttributeString("mode", mode); writer.writeAttributeString("cellid", memnode.get(VdsProperties.NUMA_TUNE_VM_NODE_INDEX)); writer.writeAttributeString("nodeset", memnode.get(VdsProperties.NUMA_TUNE_NODESET)); writer.writeEndElement(); } } writer.writeEndElement(); } }

Target:
private void writeNumaTune() { NumaTuneMode numaTune = vm.getNumaTuneMode(); if (numaTune == null) { return; } Map<String, Object> numaTuneSetting = NumaSettingFactory.buildVmNumatuneSetting( numaTune, vmNumaNodesSupplier.get()); if (numaTuneSetting.isEmpty()) { return; } String nodeSet = (String) numaTuneSetting.get(VdsProperties.NUMA_TUNE_NODESET); String mode = (String) numaTuneSetting.get(VdsProperties.NUMA_TUNE_MODE); @SuppressWarnings("unchecked") List<Map<String, String>> memNodes = (List<Map<String, String>>) numaTuneSetting.get(VdsProperties.NUMA_TUNE_MEMNODES); if (nodeSet != null || memNodes != null) { writer.writeStartElement("numatune"); if (nodeSet != null) { writer.writeStartElement("memory"); writer.writeAttributeString("mode", mode); writer.writeAttributeString("modeset", nodeSet); writer.writeEndElement(); } if (memNodes != null) { for (Map<String, String> memnode : memNodes) { writer.writeStartElement("memnode"); writer.writeAttributeString("mode", mode); writer.writeAttributeString("cellid", (String) memnode.get(VdsProperties.NUMA_TUNE_VM_NODE_INDEX)); writer.writeAttributeString("nodeset", (String) memnode.get(VdsProperties.NUMA_TUNE_NODESET)); writer.writeEndElement(); } } writer.writeEndElement(); } }
Source:
public static String generateInitRequestFunctionSignature(final Request request) { final ImmutableList.Builder<String> builder = ImmutableList.builder(); if (request.getClassification() == Classification.amazons3) { final String amazonS3InitParams = getAmazonS3InitParams(request.isResourceRequired(), request.isResourceIdRequired()); if (!amazonS3InitParams.isEmpty()) { builder.add(amazonS3InitParams); } } else { final String spectraS3InitParams = getSpectraS3InitParams(request.isResourceRequired()); if (!spectraS3InitParams.isEmpty()) { builder.add(spectraS3InitParams); } } builder.addAll(request.getRequiredQueryParams().stream() .filter(parm -> !parm.getParameterType().equals("ds3_bool")) .filter(parm -> !parm.getParameterType().equals("operation")) .map(Parameter::toString) .collect(GuavaCollectors.immutableList())); builder.addAll(request.getOptionalQueryParams().stream() .map(Parameter::toString) .collect(GuavaCollectors.immutableList())); if (request.hasRequestPayload()) { if (request.getName().equalsIgnoreCase("put_object_request") || request.getName().equalsIgnoreCase("complete_multi_part_upload_request")) { } else { builder.add(request.getRequestPayload().toString()); } } final ImmutableList<String> allParams = builder.build(); return "ds3_request* init_" + getNameRootUnderscores(request.getName()) + "(" + joinStrings(allParams)+ ")"; }

Target:
public static String generateInitRequestFunctionSignature(final Request request) { final ImmutableList.Builder<String> builder = ImmutableList.builder(); if (request.getClassification() == Classification.amazons3) { final String amazonS3InitParams = getAmazonS3InitParams(request.isResourceRequired(), request.isResourceIdRequired()); if (!amazonS3InitParams.isEmpty()) { builder.add(amazonS3InitParams); } } else { final String spectraS3InitParams = getSpectraS3InitParams(request.isResourceRequired()); if (!spectraS3InitParams.isEmpty()) { builder.add(spectraS3InitParams); } } builder.addAll(request.getRequiredQueryParams().stream() .filter(parm -> !parm.getParameterType().equals("ds3_bool")) .filter(parm -> !parm.getParameterType().equals("operation")) .map(Parameter::toString) .collect(GuavaCollectors.immutableList())); builder.addAll(request.getOptionalQueryParams().stream() .map(Parameter::toString) .collect(GuavaCollectors.immutableList())); if (request.hasRequestPayload() && !request.getName().equalsIgnoreCase("put_object_request") && !request.getName().equalsIgnoreCase("complete_multi_part_upload_request")) { builder.add(request.getRequestPayload().toString()); } final ImmutableList<String> allParams = builder.build(); return "ds3_request* init_" + getNameRootUnderscores(request.getName()) + "(" + joinStrings(allParams)+ ")"; }