auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void returnsNotFoundWhenClientDoesNotExist() throws Exception { when(aclDAO.getBatchSanitizedSecretsFor(client, ImmutableList.of(secret.getName()))).thenReturn(ImmutableList.<SanitizedSecret>of()); when(clientDAO.getClientByName(client.getName())).thenReturn(Optional.empty()); when(secretController.getSecretsByName(ImmutableList.of(secret.getName()))) .thenReturn(ImmutableList.<Secret>of()); batchSecretDeliveryResource.getBatchSecret(client, BatchSecretRequest.create(ImmutableList.of(secret.getName()))); }

Target:
public void returnsNotFoundWhenClientDoesNotExist() throws Exception { when(aclDAO.getBatchSanitizedSecretsFor(client, ImmutableList.of(secret.getName()))).thenReturn(ImmutableList.of()); when(clientDAO.getClientByName(client.getName())).thenReturn(Optional.empty()); when(secretController.getSecretsByName(ImmutableList.of(secret.getName()))) .thenReturn(ImmutableList.of(secret)); batchSecretDeliveryResource.getBatchSecret(client, BatchSecretRequest.create(ImmutableList.of(secret.getName()))); }
Source:
protected boolean checkIfImageDiskCanBeAdded(VM vm, DiskVmElementValidator diskVmElementValidator) { if (Guid.Empty.equals(getStorageDomainId())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_SPECIFIED); } boolean returnValue; StorageDomainValidator storageDomainValidator = createStorageDomainValidator(); returnValue = (getParameters().isSkipDomainCheck() || validate(storageDomainValidator.isDomainExistAndActive())) && validateShareableDiskOnGlusterDomain() && checkImageConfiguration() && validate(storageDomainValidator.hasSpaceForNewDisk(getDiskImageInfo())) && validate(storageDomainValidator.isDomainWithinThresholds()) && checkExceedingMaxBlockDiskSize() && canAddShareableDisk() && validate(diskVmElementValidator.isVirtIoScsiValid(vm)) && validate(diskVmElementValidator.isDiskInterfaceSupported(getVm())); if (returnValue && vm != null) { StoragePool sp = getStoragePool(); returnValue = validate(new StoragePoolValidator(sp).existsAndUp()) && isStoragePoolMatching(vm) && validate(new VmValidator(getVm()).vmNotLocked()) && isVmNotInPreviewSnapshot(); } return returnValue; }

Target:
protected boolean checkIfImageDiskCanBeAdded(VM vm, DiskVmElementValidator diskVmElementValidator) { if (Guid.Empty.equals(getStorageDomainId())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_SPECIFIED); } boolean returnValue; StorageDomainValidator storageDomainValidator = createStorageDomainValidator(); returnValue = (getParameters().isSkipDomainCheck() || validate(storageDomainValidator.isDomainExistAndActive())) && validateShareableDiskOnGlusterDomain() && checkImageConfiguration() && validate(storageDomainValidator.domainIsValidDestination()) && validate(storageDomainValidator.hasSpaceForNewDisk(getDiskImageInfo())) && validate(storageDomainValidator.isDomainWithinThresholds()) && checkExceedingMaxBlockDiskSize() && canAddShareableDisk() && validate(diskVmElementValidator.isVirtIoScsiValid(vm)) && validate(diskVmElementValidator.isDiskInterfaceSupported(getVm())); if (returnValue && vm != null) { StoragePool sp = getStoragePool(); returnValue = validate(new StoragePoolValidator(sp).existsAndUp()) && isStoragePoolMatching(vm) && validate(new VmValidator(getVm()).vmNotLocked()) && isVmNotInPreviewSnapshot(); } return returnValue; }
Source:
public ZoomThread(long startTime, long endTime, long resolution) { super(AbstractTimeGraphView.this.getName() + " zoom"); fZoomStartTime = startTime; fZoomEndTime = endTime; fResolution = resolution; fMonitor = new NullProgressMonitor(); synchronized (fLastZoomThreadId) { fInstanceId = ++fLastZoomThreadId; } }

Target:
public ZoomThread(long startTime, long endTime, long resolution) { super(AbstractTimeGraphView.this.getName() + " zoom"); fZoomStartTime = startTime; fZoomEndTime = endTime; fResolution = resolution; fMonitor = new NullProgressMonitor(); }
Source:
public PreparedOperationWithReactiveStream<List<T>> prepare() { if (getResolver == null) { getResolver = DefaultGetResolver.INSTANCE; } Checks.checkNotNull(mapFunc, "Please specify map function"); if (query != null) { return new PreparedGetListOfObjects<>(storIOSQLiteDb, query, getResolver, mapFunc); } else if (rawQuery != null) { return new PreparedGetListOfObjects<>(storIOSQLiteDb, rawQuery, getResolver, mapFunc); } else { throw new IllegalStateException("Please specify query"); } }

Target:
public PreparedOperationWithReactiveStream<List<T>> prepare() { if (getResolver == null) { getResolver = DefaultGetResolver.INSTANCE; } checkNotNull(mapFunc, "Please specify map function"); if (query != null) { return new PreparedGetListOfObjects<>(storIOSQLiteDb, query, getResolver, mapFunc); } else if (rawQuery != null) { return new PreparedGetListOfObjects<>(storIOSQLiteDb, rawQuery, getResolver, mapFunc); } else { throw new IllegalStateException("Please specify query"); } }
Source:
public void beforeClass(final @Optional Boolean usingEncryption, final @Optional String testType) throws IOException { if (testType.equals("buckets")) { throw new SkipException("Skipping tests since snaplinks are disabled in Manta Buckets"); } ConfigContext config = new IntegrationTestConfigContext(usingEncryption); final String testName = this.getClass().getSimpleName(); mantaClient = new MantaClient(config); testPathPrefix = IntegrationTestHelper.setupTestPath(config, mantaClient, testName, testType); IntegrationTestHelper.createTestBucketOrDirectory(mantaClient, testPathPrefix, testType); }

Target:
public void beforeClass(final @Optional Boolean usingEncryption, final @Optional String testType) throws IOException { if ("buckets".equals(testType)) { throw new SkipException("Skipping tests since snaplinks are disabled in Manta Buckets"); } ConfigContext config = new IntegrationTestConfigContext(usingEncryption); final String testName = this.getClass().getSimpleName(); mantaClient = new MantaClient(config); testPathPrefix = IntegrationTestHelper.setupTestPath(config, mantaClient, testName, testType); IntegrationTestHelper.createTestBucketOrDirectory(mantaClient, testPathPrefix, testType); }
Source:
public Collection<Locator> getLocators(long shard) throws IOException { Timer.Context ctx = Instrumentation.getReadTimerContext(CassandraModel.CF_METRICS_LOCATOR_NAME); try { RowQuery<Long, Locator> query = AstyanaxIO.getKeyspace() .prepareQuery(CassandraModel.CF_METRICS_LOCATOR) .getKey(shard); LOG.debug("ALocatorIO.getLocators() executing: select * from \"" + CassandraModel.KEYSPACE + "\"." + CassandraModel.CF_METRICS_LOCATOR + " where key=" + Long.toString(shard)); return query.execute().getResult().getColumnNames(); } catch (NotFoundException e) { Instrumentation.markNotFound(CassandraModel.CF_METRICS_LOCATOR_NAME); return Collections.emptySet(); } catch (ConnectionException ex) { Instrumentation.markReadError(ex); LOG.error("Connection exception during getLocators(" + Long.toString(shard) + ")", ex); throw new IOException("Error reading locators", ex); } finally { ctx.stop(); } }

Target:
public Collection<Locator> getLocators(long shard) throws IOException { Timer.Context ctx = Instrumentation.getReadTimerContext(CassandraModel.CF_METRICS_LOCATOR_NAME); try { RowQuery<Long, Locator> query = AstyanaxIO.getKeyspace() .prepareQuery(CassandraModel.CF_METRICS_LOCATOR) .getKey(shard); if (LOG.isTraceEnabled()) LOG.trace("ALocatorIO.getLocators() executing: select * from \"" + CassandraModel.KEYSPACE + "\"." + CassandraModel.CF_METRICS_LOCATOR_NAME + " where key=" + Long.toString(shard)); return query.execute().getResult().getColumnNames(); } catch (NotFoundException e) { Instrumentation.markNotFound(CassandraModel.CF_METRICS_LOCATOR_NAME); return Collections.emptySet(); } catch (ConnectionException ex) { Instrumentation.markReadError(ex); LOG.error("Connection exception during getLocators(" + Long.toString(shard) + ")", ex); throw new IOException("Error reading locators", ex); } finally { ctx.stop(); } }
Source:
@Before public void setUp() { client = new LostApiClient.Builder(application).build(); FusedLocationProviderService.FusedLocationProviderBinder stubBinder = mock( FusedLocationProviderService.FusedLocationProviderBinder.class); when(stubBinder.getService()).thenReturn(mock(FusedLocationProviderService.class)); shadowOf(application).setComponentNameAndServiceForBindService( new ComponentName("com.mapzen.lost", "FusedLocationProviderService"), stubBinder); }

Target:
@Before public void setUp() throws Exception { client = new LostApiClient.Builder(application).build(); FusedLocationProviderService.FusedLocationProviderBinder stubBinder = mock( FusedLocationProviderService.FusedLocationProviderBinder.class); when(stubBinder.getService()).thenReturn(mock(FusedLocationProviderService.class)); shadowOf(application).setComponentNameAndServiceForBindService( new ComponentName("com.mapzen.lost", "FusedLocationProviderService"), stubBinder); }
Source:
private synchronized Graph buildGraph() { String implementationVersion = IntegrationGraphServer.class.getPackage().getImplementationVersion(); if (implementationVersion == null) { implementationVersion = "unknown - is Spring Integration running from the distribution jar?"; } Map<String, Object> descriptor = new HashMap<String, Object>(); descriptor.put("provider", "spring-integration"); descriptor.put("providerVersion", implementationVersion); descriptor.put("providerFormatVersion", GRAPH_VERSION); if (this.applicationContext.containsBean("applicationNameAndVersion")) { descriptor.put("name", this.applicationContext.getBean("applicationNameAndVersion")); } this.nodeFactory.reset(); Collection<IntegrationNode> nodes = new ArrayList<IntegrationNode>(); Collection<LinkNode> links = new ArrayList<LinkNode>(); Map<String, MessageChannelNode> channelNodes = channels(nodes); pollingAdapters(nodes, links, channelNodes); gateways(nodes, links, channelNodes); producers(nodes, links, channelNodes); consumers(nodes, links, channelNodes); this.graph = new Graph(descriptor, nodes, links); return this.graph; }

Target:
private synchronized Graph buildGraph() { String implementationVersion = IntegrationGraphServer.class.getPackage().getImplementationVersion(); if (implementationVersion == null) { implementationVersion = "unknown - is Spring Integration running from the distribution jar?"; } Map<String, Object> descriptor = new HashMap<String, Object>(); descriptor.put("provider", "spring-integration"); descriptor.put("providerVersion", implementationVersion); descriptor.put("providerFormatVersion", GRAPH_VERSION); String name = this.applicationName; if (name == null) { name = this.applicationContext.getEnvironment().getProperty("spring.application.name"); } if (name != null) { descriptor.put("name", name); } this.nodeFactory.reset(); Collection<IntegrationNode> nodes = new ArrayList<IntegrationNode>(); Collection<LinkNode> links = new ArrayList<LinkNode>(); Map<String, MessageChannelNode> channelNodes = channels(nodes); pollingAdapters(nodes, links, channelNodes); gateways(nodes, links, channelNodes); producers(nodes, links, channelNodes); consumers(nodes, links, channelNodes); this.graph = new Graph(descriptor, nodes, links); return this.graph; }
Source:
private void saveAttachedHost(VmDevice vmDevice, Guid vdsId, boolean isLiveMigration) { TransactionSupport.executeInNewTransaction(() -> { Map<String, Object> specParams = new HashMap<>(); if (!isLiveMigration) { specParams.put(ManagedBlockStorageDisk.ATTACHED_VDS_ID, vdsId); } else { specParams.put(ManagedBlockStorageDisk.DEST_VDS_ID, vdsId); } if (vmDevice.getSpecParams() != null) { vmDevice.getSpecParams().putAll(specParams); } else { vmDevice.setSpecParams(specParams); } vmDeviceDao.update(vmDevice); return null; }); }

Target:
private void saveAttachedHost(VmDevice vmDevice, Guid vdsId, boolean isLiveMigration) { TransactionSupport.executeInNewTransaction(() -> { Map<String, Object> specParams = new HashMap<>(); if (isLiveMigration) { specParams.put(ManagedBlockStorageDisk.DEST_VDS_ID, vdsId); } else { specParams.put(ManagedBlockStorageDisk.ATTACHED_VDS_ID, vdsId); } if (vmDevice.getSpecParams() != null) { vmDevice.getSpecParams().putAll(specParams); } else { vmDevice.setSpecParams(specParams); } vmDeviceDao.update(vmDevice); return null; }); }
Source:
private boolean buildMicroservicePath(String pa_home, String microservices_path) { String microservice_file = pa_home + separator + microservices_path + separator + microservice_name; if (new File(microservice_file).exists()) { command.add(microservice_file); return true; } else { System.out.println("IAM microservice is not deployed"); return false; } }

Target:
private static boolean buildMicroservicePath(String pa_home, String microservices_path) { String microservice_file = pa_home + SEPARATOR + microservices_path + SEPARATOR + MICROSERVICE_NAME; if (new File(microservice_file).exists()) { command.add(microservice_file); return true; } else { System.out.println("IAM microservice is not deployed"); return false; } }
Source:
private static Coordinate[] readCoordinates(SliceInput input, int count) { requireNonNull(input, "input is null"); Coordinate[] coordinates = new Coordinate[count]; for (int j = 0; j < count; j++) { coordinates[j] = readCoordinate(input); } return coordinates; }

Target:
private static Coordinate[] readCoordinates(SliceInput input, int count) { requireNonNull(input, "input is null"); verify(count > 0); Coordinate[] coordinates = new Coordinate[count]; for (int i = 0; i < count; i++) { coordinates[i] = readCoordinate(input); } return coordinates; }
Source:
private Table createSimpleTable(SchemaTableName schemaTableName, List<Column> columns, ConnectorSession session, Path targetPath, String queryId) { String tableOwner = session.getUser(); String schemaName = schemaTableName.getSchemaName(); String tableName = schemaTableName.getTableName(); Table.Builder tableBuilder = Table.builder() .setDatabaseName(schemaName) .setTableName(tableName) .setOwner(tableOwner) .setTableType(TableType.MANAGED_TABLE.name()) .setParameters(ImmutableMap.of( PRESTO_VERSION_NAME, TEST_SERVER_VERSION, PRESTO_QUERY_ID_NAME, queryId)) .setDataColumns(columns); tableBuilder.getStorageBuilder() .setLocation(targetPath.toString()) .setStorageFormat(StorageFormat.create(ORC.getSerDe(), ORC.getInputFormat(), ORC.getOutputFormat())) .setSerdeParameters(ImmutableMap.of()); return tableBuilder.build(); }

Target:
private Table createSimpleTable(SchemaTableName schemaTableName, List<Column> columns, ConnectorSession session, Path targetPath, String queryId) { String tableOwner = session.getUser(); String schemaName = schemaTableName.getSchemaName(); String tableName = schemaTableName.getTableName(); return Table.builder() .setDatabaseName(schemaName) .setTableName(tableName) .setOwner(tableOwner) .setTableType(TableType.MANAGED_TABLE.name()) .setParameters(ImmutableMap.of( PRESTO_VERSION_NAME, TEST_SERVER_VERSION, PRESTO_QUERY_ID_NAME, queryId)) .setDataColumns(columns) .withStorage(storage -> storage .setLocation(targetPath.toString()) .setStorageFormat(fromHiveStorageFormat(ORC)) .setSerdeParameters(ImmutableMap.of())) .build(); }
Source:
public MantaObjectResponse put(final String rawPath, final InputStream source, final long contentLength, final MantaHttpHeaders headers, final MantaMetadata metadata) throws IOException { Validate.notBlank(rawPath, "rawPath must not be blank"); Validate.notNull(source, "Input stream must not be null"); final String path = formatPath(rawPath); final ContentType contentType; if (BooleanUtils.isTrue(config.isContentTypeDetectionEnabled())) { contentType = ContentTypeLookup.findOrDefaultContentType(headers, ContentType.APPLICATION_OCTET_STREAM); } else { contentType = ContentType.APPLICATION_OCTET_STREAM; } final int preLoadSize = config.getUploadBufferSize(); final HttpEntity entity; if (contentLength < 0) { if (source.getClass().equals(FileInputStream.class)) { FileInputStream fsin = (FileInputStream)source; entity = new InputStreamEntity(fsin, fsin.getChannel().size(), contentType); } else { byte[] preLoad = new byte[preLoadSize]; int read = IOUtils.read(source, preLoad); if (read < preLoadSize) { entity = new ExposedByteArrayEntity(preLoad, 0, read, contentType); } else { ByteArrayInputStream bin = new ByteArrayInputStream(preLoad); SequenceInputStream sin = new SequenceInputStream(bin, source); entity = new InputStreamEntity(sin, contentType); } } } else { if (contentLength <= preLoadSize && contentLength <= Integer.MAX_VALUE) { byte[] preLoad = new byte[(int)contentLength]; IOUtils.read(source, preLoad); entity = new ExposedByteArrayEntity(preLoad, contentType); } else { entity = new InputStreamEntity(source, contentLength, contentType); } } return httpHelper.httpPut(path, headers, entity, metadata); }

Target:
public MantaObjectResponse put(final String rawPath, final InputStream source, final long contentLength, final MantaHttpHeaders headers, final MantaMetadata metadata) throws IOException { Validate.notBlank(rawPath, "rawPath must not be blank"); Validate.notNull(source, "Input stream must not be null"); final String path = formatPath(rawPath); final ContentType contentType = ContentTypeLookup.findOrDefaultContentType(headers, ContentType.APPLICATION_OCTET_STREAM); final int preLoadSize = config.getUploadBufferSize(); final HttpEntity entity; if (contentLength < 0) { if (source.getClass().equals(FileInputStream.class)) { FileInputStream fsin = (FileInputStream)source; entity = new InputStreamEntity(fsin, fsin.getChannel().size(), contentType); } else { byte[] preLoad = new byte[preLoadSize]; int read = IOUtils.read(source, preLoad); if (read < preLoadSize) { entity = new ExposedByteArrayEntity(preLoad, 0, read, contentType); } else { ByteArrayInputStream bin = new ByteArrayInputStream(preLoad); SequenceInputStream sin = new SequenceInputStream(bin, source); entity = new InputStreamEntity(sin, contentType); } } } else { if (contentLength <= preLoadSize && contentLength <= Integer.MAX_VALUE) { byte[] preLoad = new byte[(int)contentLength]; IOUtils.read(source, preLoad); entity = new ExposedByteArrayEntity(preLoad, contentType); } else { entity = new InputStreamEntity(source, contentLength, contentType); } } return httpHelper.httpPut(path, headers, entity, metadata); }
Source:
public void checkTest3() { projectExplorer.openItemByPath(PROJECT_NAME + "/src/main/java/test3"); projectExplorer.openItemByPath(PROJECT_NAME + "/src/main/java/test3/fred"); projectExplorer.openItemByPath(PROJECT_NAME + "/src/main/java/test3/fred/A.java"); editor.waitActive(); editor.waitTextNotPresentIntoEditor(TEST3_R_OUT); projectExplorer.waitAndSelectItem(PROJECT_NAME + "/src/main/java/test3/fred"); projectExplorer.launchRefactorByKeyboard(); refactor.waitRenamePackageFormIsOpen(); refactor.sendKeysIntoField("test3.r"); refactor.waitTextIntoNewNameField("test3.r"); loader.waitOnClosed(); refactor.setAndWaitStateUpdateReferencesCheckbox(true); refactor.setAndWaitStateRenameSubpackagesCheckbox(false); refactor.setAndWaitStateUpdateNonJavaFilesCheckbox(false); refactor.waitTextInErrorMessage("Package already exists"); refactor.clickCancelButtonRefactorForm(); refactor.waitRenameFieldFormIsClosed(); projectExplorer.openItemByPath(PROJECT_NAME + "/src/main/java/test3/r/r"); projectExplorer.openItemByPath(PROJECT_NAME + "/src/main/java/test3/r/r/B.java"); editor.waitTextIntoEditor(TEST3_R_R_OUT); editor.closeFileByNameWithSaving("B"); }

Target:
public void checkTest3() { projectExplorer.openItemByPath(PROJECT_NAME + "/src/main/java/mine/pack"); projectExplorer.openItemByPath(PROJECT_NAME + "/src/main/java/mine/pack/Textfile.txt"); editor.waitActive(); editor.waitTextIntoEditor(TEST12_RENAME_WITH_RESOURCE_IN); editor.closeFileByNameWithSaving("Textfile.txt"); projectExplorer.waitAndSelectItem(PROJECT_NAME + "/src/main/java/mine/pack"); projectExplorer.launchRefactorByKeyboard(); refactor.waitRenamePackageFormIsOpen(); loader.waitOnClosed(); refactor.sendKeysIntoField("main"); refactor.waitTextIntoNewNameField("main"); refactor.setAndWaitStateUpdateReferencesCheckbox(true); refactor.setAndWaitStateRenameSubpackagesCheckbox(false); refactor.setAndWaitStateUpdateNonJavaFilesCheckbox(true); refactor.typeAndWaitFileNamePatterns("*.txt"); loader.waitOnClosed(); refactor.clickOkButtonRefactorForm(); refactor.waitRenamePackageFormIsClosed(); loader.waitOnClosed(); projectExplorer.waitItem(PROJECT_NAME + "/src/main/java/main"); projectExplorer.openItemByPath(PROJECT_NAME + "/src/main/java/main/Textfile.txt"); editor.waitTextIntoEditor(TEST12_RENAME_WITH_RESOURCE_OUT); editor.closeFileByNameWithSaving("Textfile.txt"); }
Source:
private long doForceInsertNewDocumentWithHistory(DocumentRevision rev, List<String> revHistory) { Log.v(LOG_TAG, "doForceInsertNewDocumentWithHistory()"); assert !this.containsDocument(rev.getId()); long docNumericID = insertDocumentID(rev.getId()); long parentSequence = 0L; for (int i = 0; i < revHistory.size() - 1; i++) { parentSequence = insertStubRevision(docNumericID, revHistory.get(i), parentSequence); } long seq = insertRevision(docNumericID, revHistory.get(revHistory.size() - 1), parentSequence, rev.isDeleted(), true, rev.getBody().asBytes(), true); return seq; }

Target:
private long doForceInsertNewDocumentWithHistory(DocumentRevision rev, List<String> revHistory) { Log.v(LOG_TAG, "doForceInsertNewDocumentWithHistory()"); assert !this.containsDocument(rev.getId()); long docNumericID = insertDocumentID(rev.getId()); long parentSequence = 0L; for (int i = 0; i < revHistory.size() - 1; i++) { parentSequence = insertStubRevision(docNumericID, revHistory.get(i), parentSequence); } long sequence = insertRevision(docNumericID, revHistory.get(revHistory.size() - 1), parentSequence, rev.isDeleted(), true, rev.getBody().asBytes(), true); return sequence; }
Source:
private Object doResumableUpload() throws IOException, InterruptedException { String uploadId = startResumableUpload(); InsertChunkResponseObserver responseObserver; long writeOffset = 0; int retriesAttempted = 0; Hasher objectHasher = Hashing.crc32c().newHasher(); do { ByteString chunkData = ByteString.EMPTY; responseObserver = new InsertChunkResponseObserver( grpcWriteChannel, uploadId, chunkData, writeOffset, objectHasher); stub.withDeadlineAfter(WRITE_STREAM_TIMEOUT.toMillis(), TimeUnit.MILLISECONDS) .insertObject(responseObserver); responseObserver.done.await(); if (responseObserver.hasError()) { this.pushbackPipeSource = new PushbackInputStream(pipeSource, MAX_BYTES_PER_MESSAGE); long commitedSize = getCommittedWriteSize(uploadId); if (commitedSize <= writeOffset) { pushbackPipeSource.unread(pushbackBuffer, 0, pushbackBuffer.length); } else { int missedChunkLength = (int) (pushbackBuffer.length - (commitedSize - writeOffset)); pushbackPipeSource.unread( pushbackBuffer, pushbackBuffer.length - missedChunkLength, missedChunkLength); writeOffset += commitedSize - writeOffset; } ++retriesAttempted; } else { writeOffset += responseObserver.bytesWritten(); retriesAttempted = 0; } if (retriesAttempted == maxRetries) { throw new IOException( String.format("Insert failed for '%s'", resourceId), responseObserver.getError()); } } while (!responseObserver.isFinished()); return responseObserver.getResponse(); }

Target:
private Object doResumableUpload() throws IOException, InterruptedException { String uploadId = startResumableUpload(); InsertChunkResponseObserver responseObserver; long writeOffset = 0; int retriesAttempted = 0; Hasher objectHasher = Hashing.crc32c().newHasher(); do { ByteString chunkData = ByteString.EMPTY; responseObserver = new InsertChunkResponseObserver(uploadId, chunkData, writeOffset, objectHasher); stub.withDeadlineAfter(WRITE_STREAM_TIMEOUT.toMillis(), TimeUnit.MILLISECONDS) .insertObject(responseObserver); responseObserver.done.await(); if (responseObserver.hasError()) { long committedSize = getCommittedWriteSize(uploadId); pipeSource.reset(); if (committedSize > writeOffset) { int uploadedDataChunkSize = Math.toIntExact(committedSize - writeOffset); pipeSource.skip(uploadedDataChunkSize); writeOffset += uploadedDataChunkSize; } ++retriesAttempted; } else { writeOffset += responseObserver.bytesWritten(); retriesAttempted = 0; } if (retriesAttempted >= WRITE_CHUNK_RETRIES) { throw new IOException( String.format("Insert failed for '%s'", resourceId), responseObserver.getError()); } } while (!responseObserver.isFinished()); return responseObserver.getResponse(); }
Source:
public void enableFirewall(boolean enabled) { if(this.enabled != enabled) { logger.info("Setting firewall to {}", enabled); this.enabled = enabled; List<Masked<U64>> changes = new ArrayList<Masked<U64>>(); changes.add(Masked.of(DEFAULT_COOKIE, AppCookie.getAppFieldMask())); routingService.handleRoutingDecisionChange(changes); } }

Target:
public void enableFirewall(boolean enabled) { if(this.enabled != enabled) { logger.info("Setting firewall to {}", enabled); this.enabled = enabled; List<Masked<U64>> changes = ImmutableList.of( Masked.of(DEFAULT_COOKIE, AppCookie.getAppFieldMask()) ); routingService.handleRoutingDecisionChange(changes); } }
Source:
private String serialize(Expression<?> expression) { CollectionAnyVisitor visitor = new CollectionAnyVisitor() { @Override protected Predicate exists(Context c, Predicate condition) { return condition; } }; Expression<?> transformed = expression.accept(visitor, new Context()); return transformed.toString(); }

Target:
private String serialize(Expression<?> expression) { return serialize(expression, new CollectionAnyVisitor()); }
Source:
public AeternityRPCClient(String rpcUrl) throws MalformedURLException { super(CryptoCurrency.AE.getCode(), baseUrl); if (rpcUrl == null) rpcUrl = baseUrl; api = RestProxyFactory.createProxy(AeternityV2API.class, "<LINK_1>"); serviceConf = ServiceConfiguration.configure().baseUrl(rpcUrl).compile(); accountService = new AccountServiceFactory().getService(serviceConf); chainService = new ChainServiceFactory().getService(serviceConf); transactionService = new TransactionServiceFactory().getService(TransactionServiceConfiguration.configure().baseUrl(rpcUrl).network(mainnet).compile()); }

Target:
public AeternityRPCClient(String rpcUrl) throws MalformedURLException { super(CryptoCurrency.AE.getCode(), baseUrl); if (rpcUrl == null) rpcUrl = baseUrl; String sdkUrl = rpcUrl + "/v2"; api = RestProxyFactory.createProxy(AeternityV2API.class, rpcUrl); serviceConf = ServiceConfiguration.configure().baseUrl(sdkUrl).compile(); accountService = new AccountServiceFactory().getService(serviceConf); chainService = new ChainServiceFactory().getService(serviceConf); transactionService = new TransactionServiceFactory().getService(TransactionServiceConfiguration.configure().baseUrl(rpcUrl).network(mainnet).compile()); }
Source:
public void provision(RuntimeIdentity id, InternalEnvironment internalEnvironment) throws InfrastructureException { if (hasInstallers(internalEnvironment)) { for (EnvVarProvider envVarProvider : envVarProviders) { Pair<String, String> envVar = envVarProvider.get(id); if (envVar != null) { LOG.info( "Provisioning legacy environment variables for workspace '{}' from with variable", id.getWorkspaceId(), envVarProvider, envVar.first); internalEnvironment .getMachines() .values() .forEach(m -> m.getEnv().putIfAbsent(envVar.first, envVar.second)); } } LOG.info( "Environment legacy variables provisioning done for workspace '{}'", id.getWorkspaceId()); } else { LOG.debug( "Legacy environment variables not provisioned to workspace '{}'.", id.getWorkspaceId()); } }

Target:
public void provision(RuntimeIdentity id, InternalEnvironment internalEnvironment) throws InfrastructureException { if (!hasInstallers(internalEnvironment)) { LOG.debug( "Legacy environment variables not provisioned to workspace '{}'.", id.getWorkspaceId()); return; } for (EnvVarProvider envVarProvider : envVarProviders) { Pair<String, String> envVar = envVarProvider.get(id); if (envVar != null) { LOG.debug( "Provisioning legacy environment variables for workspace '{}' from with variable", id.getWorkspaceId(), envVarProvider.getClass().getSimpleName(), envVar.first); internalEnvironment .getMachines() .values() .forEach(m -> m.getEnv().putIfAbsent(envVar.first, envVar.second)); } } LOG.info( "Environment legacy variables provisioning done for workspace '{}'", id.getWorkspaceId()); }
Source:
public String getSourceResponseString() { if (srcs != null && srcs.length != 0) { return Arrays.toString(srcs); } else { return src; } }

Target:
public String getSourceResponseString() { if (!CollectionUtils.isEmpty(srcs)) { return String.join(", ", srcs); } else { return src; } }
Source:
public MatchingApplicabilityTagsRule(IAtsClient atsClient) { this.atsClient = atsClient; featureDefinitionData = null; validFeatureValues = null; }

Target:
public MatchingApplicabilityTagsRule(IAtsClient atsClient) { this.atsClient = atsClient; }
Source:
public synchronized boolean generateStructure(World world, Random rand, CubePos cubePos) { this.initializeStructureData(world); int centerX = cubeToCenterBlock(cubePos.getX()); int centerY = cubeToCenterBlock(cubePos.getY()); int centerZ = cubeToCenterBlock(cubePos.getZ()); boolean generated = false; for (ICubicStructureStart cubicStructureStart : this.structureMap) { StructureStart structStart = (StructureStart) cubicStructureStart; if (structStart.isSizeableStructure() && structStart.isValidForPostProcess(cubePos.chunkPos()) && structStart.getBoundingBox().intersectsWith( new StructureBoundingBox(centerX, centerY, centerZ, centerX + 15, centerY + 15, centerZ + 15))) { structStart.generateStructure(world, rand, new StructureBoundingBox(centerX, centerY, centerZ, centerX + 15, centerY + 15, centerZ + 15)); structStart.notifyPostProcessAt(cubePos.chunkPos()); generated = true; this.setStructureStart(structStart.getChunkPosX(), cubicStructureStart.getChunkPosY(), structStart.getChunkPosZ(), structStart); } } return generated; }

Target:
public synchronized boolean generateStructure(World world, Random rand, CubePos cubePos) { this.initializeStructureData(world); int centerX = cubeToCenterBlock(cubePos.getX()); int centerY = cubeToCenterBlock(cubePos.getY()); int centerZ = cubeToCenterBlock(cubePos.getZ()); boolean generated = false; for (ICubicStructureStart cubicStructureStart : this.structureMap) { StructureStart structStart = (StructureStart) cubicStructureStart; if (structStart.isSizeableStructure() && structStart.isValidForPostProcess(cubePos.chunkPos()) && structStart.getBoundingBox().intersectsWith( new StructureBoundingBox(centerX, centerY, centerZ, centerX + Cube.SIZE - 1, centerY + Cube.SIZE - 1, centerZ + Cube.SIZE - 1))) { structStart.generateStructure(world, rand, new StructureBoundingBox(centerX, centerY, centerZ, centerX + Cube.SIZE - 1, centerY + Cube.SIZE - 1, centerZ + Cube.SIZE - 1)); structStart.notifyPostProcessAt(cubePos.chunkPos()); generated = true; this.setStructureStart(structStart.getChunkPosX(), cubicStructureStart.getChunkPosY(), structStart.getChunkPosZ(), structStart); } } return generated; }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } OrderedPartitionableRecord<?, ?> that = (OrderedPartitionableRecord<?, ?>) o; return Objects.equals(stream, that.stream) && Objects.equals(partitionId, that.partitionId) && Objects.equals(sequenceNumber, that.sequenceNumber); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } OrderedPartitionableRecord<?, ?> that = (OrderedPartitionableRecord<?, ?>) o; if (data.size() != that.data.size()) { return false; } for (int i = 0; i < data.size(); i++) { if (!Arrays.equals(data.get(i), that.data.get(i))) { return false; } } return Objects.equals(stream, that.stream) && Objects.equals(partitionId, that.partitionId) && Objects.equals(sequenceNumber, that.sequenceNumber); }
Source:
public void testDestroyCacheManagerWithMultipleClients() throws CachePersistenceException { PersistentCacheManager persistentCacheManager1 = clusteredCacheManagerBuilder.build(true); PersistentCacheManager persistentCacheManager2 = clusteredCacheManagerBuilder.build(true); persistentCacheManager1.close(); try { persistentCacheManager1.destroy(); } catch (StateTransitionException e) { assertThat(e.getMessage(), is("Couldn't acquire cluster-wide maintenance lease")); } assertThat(persistentCacheManager1.getStatus(), is(Status.UNINITIALIZED)); assertThat(persistentCacheManager2.getStatus(), is(Status.AVAILABLE)); Cache<Long, String> cache = persistentCacheManager2.createCache("test", CacheConfigurationBuilder.newCacheConfigurationBuilder(Long.class, String.class, ResourcePoolsBuilder.newResourcePoolsBuilder() .with(ClusteredResourcePoolBuilder.fixed("primary-server-resource", 32, MemoryUnit.MB)))); cache.put(1L, "One"); assertThat(cache.get(1L), is("One")); }

Target:
public void testDestroyCacheManagerWithMultipleClients() throws CachePersistenceException { PersistentCacheManager persistentCacheManager1 = clusteredCacheManagerBuilder.build(true); PersistentCacheManager persistentCacheManager2 = clusteredCacheManagerBuilder.build(true); persistentCacheManager1.close(); try { persistentCacheManager1.destroy(); fail("StateTransitionException expected"); } catch (StateTransitionException e) { assertThat(e.getMessage(), is("Couldn't acquire cluster-wide maintenance lease")); } assertThat(persistentCacheManager1.getStatus(), is(Status.UNINITIALIZED)); assertThat(persistentCacheManager2.getStatus(), is(Status.AVAILABLE)); Cache<Long, String> cache = persistentCacheManager2.createCache("test", CacheConfigurationBuilder.newCacheConfigurationBuilder(Long.class, String.class, ResourcePoolsBuilder.newResourcePoolsBuilder() .with(ClusteredResourcePoolBuilder.fixed("primary-server-resource", 32, MemoryUnit.MB)))); cache.put(1L, "One"); assertThat(cache.get(1L), is("One")); }
Source:
public PortfolioItemSummary summarize() { StringBuilder buf = new StringBuilder(96); CurrencyAmount base = product.getUnderlyingOption().getUnderlying().getBaseCurrencyAmount(); CurrencyAmount counter = product.getUnderlyingOption().getUnderlying().getCounterCurrencyAmount(); buf.append(product.getUnderlyingOption().getLongShort()); buf.append(" Barrier "); buf.append(SummarizerUtils.fx(base, counter)); buf.append(" : "); buf.append(SummarizerUtils.date(product.getUnderlyingOption().getExpiryDate())); CurrencyPair currencyPair = product.getCurrencyPair(); return SummarizerUtils.summary( this, ProductType.FX_SINGLE_BARRIER_OPTION, buf.toString(), currencyPair.getBase(), currencyPair.getCounter()); }

Target:
public PortfolioItemSummary summarize() { StringBuilder buf = new StringBuilder(96); CurrencyAmount base = product.getUnderlyingOption().getUnderlying().getBaseCurrencyAmount(); CurrencyAmount counter = product.getUnderlyingOption().getUnderlying().getCounterCurrencyAmount(); buf.append(product.getUnderlyingOption().getLongShort()); buf.append(" Barrier "); buf.append(SummarizerUtils.fx(base, counter)); buf.append(" Premium "); buf.append(SummarizerUtils.amount(premium.getValue().mapAmount(v -> Math.abs(v)))); buf.append(" : "); buf.append(SummarizerUtils.date(product.getUnderlyingOption().getExpiryDate())); CurrencyPair currencyPair = product.getCurrencyPair(); return SummarizerUtils.summary( this, ProductType.FX_SINGLE_BARRIER_OPTION, buf.toString(), currencyPair.getBase(), currencyPair.getCounter()); }
Source:
public static Timestamp getCurrentTimeOnDB( Connection conn, Calendar cal ) throws SQLException, ConnectException { String query; String dbProduct = conn.getMetaData().getDatabaseProductName(); if ("Oracle".equals(dbProduct)) { query = "select CURRENT_TIMESTAMP from dual"; } else if ("Apache Derby".equals(dbProduct) || dbProduct.startsWith("DB2")) { query = "values(CURRENT_TIMESTAMP)"; } else { query = "select CURRENT_TIMESTAMP;"; } try (Statement stmt = conn.createStatement()) { log.debug("executing query " + query + " to get current time from database"); ResultSet rs = stmt.executeQuery(query); if (rs.next()) { return rs.getTimestamp(1, cal); } else { throw new ConnectException( "Unable to get current time from DB using query " + query + " on database " + dbProduct ); } } catch (SQLException e) { log.error( "Failed to get current time from DB using query " + query + " on database " + dbProduct, e ); throw e; } }

Target:
public static Timestamp getCurrentTimeOnDB( Connection conn, Calendar cal ) throws SQLException, ConnectException { String query; String dbProduct = conn.getMetaData().getDatabaseProductName(); if ("Oracle".equals(dbProduct)) { query = "select CURRENT_TIMESTAMP from dual"; } else if ("Apache Derby".equals(dbProduct) || "DB2 UDB for AS/400".equals(dbProduct)) { query = "values(CURRENT_TIMESTAMP)"; } else { query = "select CURRENT_TIMESTAMP;"; } try (Statement stmt = conn.createStatement()) { log.debug("executing query " + query + " to get current time from database"); ResultSet rs = stmt.executeQuery(query); if (rs.next()) { return rs.getTimestamp(1, cal); } else { throw new ConnectException( "Unable to get current time from DB using query " + query + " on database " + dbProduct ); } } catch (SQLException e) { log.error( "Failed to get current time from DB using query " + query + " on database " + dbProduct, e ); throw e; } }
Source:
public List<ModuleDetails> readAllModulesIncludingThirdPartyIfAny( String... thirdPartyPackages) { final Set<String> standardModuleFileNames = new Reflections("com.puppycrawl.tools.checkstyle.meta", new ResourcesScanner()).getResources(Pattern.compile(".*\\.xml")); final Set<String> allMetadataSources = new HashSet<>(standardModuleFileNames); for (String packageName : thirdPartyPackages) { final Set<String> thirdPartyModuleFileNames = new Reflections(packageName, new ResourcesScanner()) .getResources(Pattern.compile(".*checkstylemeta-.*\\.xml")); allMetadataSources.addAll(thirdPartyModuleFileNames); } final List<ModuleDetails> result = new ArrayList<>(); allMetadataSources.forEach(fileName -> { final ModuleType moduleType; if (fileName.endsWith("FileFilter.xml")) { moduleType = ModuleType.FILEFILTER; } else if (fileName.endsWith("Filter.xml")) { moduleType = ModuleType.FILTER; } else { moduleType = ModuleType.CHECK; } ModuleDetails moduleDetails = null; try { moduleDetails = read(getClass().getResourceAsStream("/" + fileName), moduleType); } catch (ParserConfigurationException | IOException | SAXException ex) { ex.printStackTrace(); } result.add(moduleDetails); }); return result; }

Target:
public static List<ModuleDetails> readAllModulesIncludingThirdPartyIfAny( String... thirdPartyPackages) { final Set<String> standardModuleFileNames = new Reflections("com.puppycrawl.tools.checkstyle.meta", new ResourcesScanner()).getResources(Pattern.compile(".*\\.xml")); final Set<String> allMetadataSources = new HashSet<>(standardModuleFileNames); for (String packageName : thirdPartyPackages) { final Set<String> thirdPartyModuleFileNames = new Reflections(packageName, new ResourcesScanner()) .getResources(Pattern.compile(".*checkstylemeta-.*\\.xml")); allMetadataSources.addAll(thirdPartyModuleFileNames); } final List<ModuleDetails> result = new ArrayList<>(); for (String fileName : allMetadataSources) { final ModuleType moduleType; if (fileName.endsWith("FileFilter.xml")) { moduleType = ModuleType.FILEFILTER; } else if (fileName.endsWith("Filter.xml")) { moduleType = ModuleType.FILTER; } else { moduleType = ModuleType.CHECK; } final ModuleDetails moduleDetails; try { moduleDetails = read(XmlMetaReader.class.getResourceAsStream("/" + fileName), moduleType); } catch (ParserConfigurationException | IOException | SAXException ex) { throw new IllegalStateException("Problem to read all modules including third " + "party if any. Problem detected at file: " + fileName, ex); } result.add(moduleDetails); } return result; }
Source:
private void removeChildren(Guid snapshot) { List<Guid> children = new ArrayList<>(); getImageChildren(snapshot, children); children.stream().sorted(Collections.reverseOrder()).forEach(child -> removeSnapshot(diskImageDao.getSnapshotById(child))); }

Target:
private void removeChildren(Guid snapshot) { List<Guid> children = new ArrayList<>(); getImageChildren(snapshot, children); Collections.reverse(children); children.forEach(child -> removeSnapshot(diskImageDao.getSnapshotById(child))); }
Source:
public RepositoryInputStream getInputStream(RepositoryPath path) throws IOException, NoSuchAlgorithmException, ArtifactTransportException, ProviderImplementationException { Repository repository = path.getFileSystem().getRepository(); Storage storage = repository.getStorage(); String sPath = RepositoryFiles.stringValue(path); artifactOperationsValidator.validate(storage.getId(), repository.getId(), sPath); RepositoryProvider repositoryProvider = repositoryProviderRegistry.getProvider(repository.getType()); RepositoryInputStream is = repositoryProvider.newInputStream(path); if (is == null) { throw new ArtifactResolutionException(String.format("Artifact [%s] not found.", sPath)); } return is; }

Target:
public RepositoryInputStream getInputStream(RepositoryPath path) throws IOException { Repository repository = path.getFileSystem().getRepository(); artifactOperationsValidator.validate(path); RepositoryProvider repositoryProvider = repositoryProviderRegistry.getProvider(repository.getType()); RepositoryInputStream is = repositoryProvider.getInputStream(path); if (is == null) { throw new ArtifactResolutionException(String.format("Artifact [%s] not found.", path)); } return is; }
Source:
public Collection<String> getAvailableServers(String container) throws IOException { List<String> members = (List<String>) parseBody(fetch(() -> client.cacheManager(container).info()), Map.class).get("cluster_members"); return members; }

Target:
public Collection<String> getAvailableServers(String container) throws IOException { return (List<String>) parseBody(fetch(() -> client.cacheManager(container).info()), Map.class).get("cluster_members"); }
Source:
public ReservoirSampler(int numSpots) { this.numSpot = numSpots; this.reservoir = createArray(); this.index = new AtomicInteger(0); rand = new Random(System.nanoTime()); }

Target:
public ReservoirSampler(int numSpots) { this.reservoir = createArray(numSpots); this.index = new AtomicInteger(0); random = new Random(System.nanoTime()); }
Source:
private void fetchMetricTags(final String metricName) { PatternsCS.pipe(_kairosDbClient.queryMetricTags( new MetricsQuery.Builder() .setStartTime(Instant.ofEpochMilli(0)) .setMetrics(ImmutableList.of( new Metric.Builder() .setName(metricName) .build() )) .build()).handle((response, failure) -> { if (failure != null) { return new TagNamesMessage.Builder() .setFailure(true) .setMetricName(metricName) .setThrowable(failure) .build(); } else { return new TagNamesMessage.Builder() .setFailure(false) .setMetricName(metricName) .setTagNames(response.getQueries().get(0).getResults().get(0).getTags().keySet()) .build(); } }), getContext().dispatcher()) .to(getSelf()); }

Target:
private void fetchMetricTags(final String metricName) { _metrics.recordCounter("rollup/metric_name/received", 1); final long startTime = System.nanoTime(); PatternsCS.pipe(_kairosDbClient.queryMetricTags( new MetricsQuery.Builder() .setStartTime(Instant.ofEpochMilli(0)) .setMetrics(ImmutableList.of( new Metric.Builder() .setName(metricName) .build() )) .build()).handle((response, failure) -> { final String baseMetricName = "rollup/tag_names"; _metrics.recordCounter(baseMetricName + "/success", failure == null ? 1 : 0); _metrics.recordTimer( baseMetricName + "/request", System.nanoTime() - startTime, Optional.of(Units.NANOSECOND)); if (failure != null) { return new TagNamesMessage.Builder() .setMetricName(metricName) .setFailure(failure) .build(); } else { if (response.getQueries().isEmpty() || response.getQueries().get(0).getResults().isEmpty()) { return new TagNamesMessage.Builder() .setMetricName(metricName) .setFailure(new Exception("Unexpected query result.")) .build(); } else { return new TagNamesMessage.Builder() .setMetricName(metricName) .setTagNames(response.getQueries().get(0).getResults().get(0).getTags().keySet()) .build(); } } }), getContext().dispatcher()) .to(getSelf()); }
Source:
public void stop() throws IOException, TimeoutException { stopping = true; if (channel == null) { return; } if (tag != null && isChannelOpen()) { channel.basicCancel(tag); } try { lock.acquire(); if (isChannelOpen()) { channel.close(); } lock.release(); } catch (TimeoutException e) { log.error("Timeout occured"); throw e; } catch (InterruptedException e1) { log.error("Thread Interrupted!"); } }

Target:
public void stop() throws IOException, TimeoutException { stopping = true; if (channel == null) { return; } if (tag != null && isChannelOpen()) { channel.basicCancel(tag); } try { lock.acquire(); if (isChannelOpen()) { channel.close(); } } catch (TimeoutException e) { log.error("Timeout occured"); throw e; } catch (InterruptedException e1) { log.error("Thread Interrupted!"); } finally { lock.release(); } }
Source:
private void handleAddInput() { int i = 1; }

Target:
private void handleAddInput() { }
Source:
public void createPartControl(Composite parent) { ScrolledComposite container = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL); container.setLayout(new FillLayout(SWT.HORIZONTAL | SWT.VERTICAL)); int panelWidthFromColumns = 0; for (LogMessageFields column : LogMessageFields.COLUMNS) { panelWidthFromColumns += column.getDefaultColumnWidth(); } container.setMinSize(panelWidthFromColumns + TABLE_PADDING, 300); container.setExpandHorizontal(true); container.setExpandVertical(true); LogDisplay logDisplay = new LogDisplay(container, logDisplayModel); container.setContent(logDisplay); }

Target:
public void createPartControl(Composite parent) { parent.setLayout(new FillLayout(SWT.VERTICAL | SWT.HORIZONTAL)); ScrolledComposite container = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL); container.setLayout(new FillLayout(SWT.HORIZONTAL | SWT.VERTICAL)); int panelWidthFromColumns = 0; for (LogMessageFields column : LogMessageFields.COLUMNS) { panelWidthFromColumns += column.getDefaultColumnWidth(); } container.setMinSize(panelWidthFromColumns + TABLE_PADDING, 300); container.setExpandHorizontal(true); container.setExpandVertical(true); LogDisplay logDisplay = new LogDisplay(container, logDisplayModel); container.setContent(logDisplay); }
Source:
public boolean equals(final Object o) { throw new RuntimeException("comparing of SRALazyRecords is not implemented yet"); }

Target:
public boolean equals(final Object o) { if (o instanceof SRALazyRecord) { SRALazyRecord otherRecord = (SRALazyRecord)o; otherRecord.getReferenceIndex(); otherRecord.getAlignmentStart(); } getReferenceIndex(); getAlignmentStart(); return super.equals(o); }
Source:
public CompletionStage<RestResponse> challenge(RestRequest request, ChannelHandlerContext ctx) { String auth = request.getAuthorizationHeader(); if (auth != null && auth.length() > 5) { String type = auth.substring(0, 5); type = type.toLowerCase(); if ("basic".equals(type)) { String cookie = auth.substring(6); cookie = new String(Base64.getDecoder().decode(cookie.getBytes())); String[] split = cookie.split(":"); try { request.setSubject(domain.authenticate(split[0], split[1])); return VOID_RESPONSE; } catch (SecurityException e) { } } } return CompletableFuture.completedFuture(new NettyRestResponse.Builder().status(HttpResponseStatus.UNAUTHORIZED).authenticate(authenticateHeader).build()); }

Target:
public CompletionStage<RestResponse> challenge(RestRequest request, ChannelHandlerContext ctx) { String auth = request.getAuthorizationHeader(); if (auth != null && auth.length() > 5) { String type = auth.substring(0, 5); if ("basic".equalsIgnoreCase(type)) { String cookie = auth.substring(6); cookie = new String(Base64.getDecoder().decode(cookie.getBytes())); String[] split = cookie.split(":"); return CompletableFuture.supplyAsync(() -> { request.setSubject(domain.authenticate(split[0], split[1])); return VOID_RESPONSE; }); } } return CompletableFuture.completedFuture(new NettyRestResponse.Builder().status(HttpResponseStatus.UNAUTHORIZED).authenticate(authenticateHeader).build()); }