auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static double estimateMinorAlleleFraction(final int a, final int r, final double bias) { final double altFraction = (double) a / (a + r); final double initialEstimate = altFraction < 0.5 ? altFraction : 1. - altFraction; final Function<Double, Double> objective = f -> { final double logf = Math.log(f); final double logOneMinusf = Math.log(1. - f); final double logBias = Math.log(bias); final double logAltMinorDenominatorTerm = Math.log(f + (1. - f)*bias); final double logRefMinorDenominatorTerm = Math.log(1. - f + f*bias); final double altMinorLogLikelihood = a * logf + r * (logOneMinusf + logBias) - (a + r) * logAltMinorDenominatorTerm; final double refMinorLogLikelihood = r * (logf + logBias) + a * logOneMinusf - (a + r) * logRefMinorDenominatorTerm; return GATKProtectedMathUtils.logSumExp(altMinorLogLikelihood, refMinorLogLikelihood); }; try { return OptimizationUtils.argmax(objective, AlleleFractionState.MIN_MINOR_FRACTION, AlleleFractionState.MAX_MINOR_FRACTION, initialEstimate); }catch (final TooManyArgumentsException ex){ return initialEstimate; } }

Target:
private static double estimateMinorAlleleFraction(final int a, final int r, final double bias) { final double altFraction = (double) a / (a + r); final double initialEstimate = altFraction < 0.5 ? altFraction : 1. - altFraction; final Function<Double, Double> objective = f -> { final double logf = Math.log(f); final double logOneMinusf = Math.log(1. - f); final double logBias = Math.log(bias); final double logAltMinorDenominatorTerm = Math.log(f + (1. - f)*bias); final double logRefMinorDenominatorTerm = Math.log(1. - f + f*bias); final double altMinorLogLikelihood = a * logf + r * (logOneMinusf + logBias) - (a + r) * logAltMinorDenominatorTerm; final double refMinorLogLikelihood = r * (logf + logBias) + a * logOneMinusf - (a + r) * logRefMinorDenominatorTerm; return GATKProtectedMathUtils.logSumExp(altMinorLogLikelihood, refMinorLogLikelihood); }; try { return OptimizationUtils.argmax(objective, AlleleFractionState.MIN_MINOR_FRACTION, AlleleFractionState.MAX_MINOR_FRACTION, initialEstimate); } catch (final TooManyEvaluationsException ex){ return initialEstimate; } }
Source:
public Void uploadFile(final File localTempFile, final String remotePath) { try { return retryExecutor() .withRetryLimit(maxConnectionRetry) .withInitialRetryWait(500) .withMaxRetryWait(30 * 1000) .runInterruptible(new Retryable<Void>() { @Override public Void call() throws IOException { FileObject remoteFile = newSftpFile(getSftpFileUri(remotePath)); logger.info("new sftp file: {}", remoteFile.getPublicURIString()); try (BufferedOutputStream outputStream = new BufferedOutputStream(remoteFile.getContent().getOutputStream())) { try (BufferedInputStream inputStream = new BufferedInputStream(new FileInputStream(localTempFile))) { IOUtils.copy(inputStream, outputStream); } } remoteFile.close(); return null; } @Override public boolean isRetryableException(Exception exception) { return true; } @Override public void onRetry(Exception exception, int retryCount, int retryLimit, int retryWait) throws RetryGiveupException { String message = String.format("SFTP output failed. Retrying %d/%d after %d seconds. Message: %s", retryCount, retryLimit, retryWait / 1000, exception.getMessage()); if (retryCount % 3 == 0) { logger.warn(message, exception); } else { logger.warn(message); } } @Override public void onGiveup(Exception firstException, Exception lastException) throws RetryGiveupException { } }); } catch (RetryGiveupException ex) { throw Throwables.propagate(ex.getCause()); } catch (InterruptedException ex) { throw Throwables.propagate(ex); } }

Target:
public Void uploadFile(final File localTempFile, final String remotePath) { try { return retryExecutor() .withRetryLimit(maxConnectionRetry) .withInitialRetryWait(500) .withMaxRetryWait(30 * 1000) .runInterruptible(new Retryable<Void>() { @Override public Void call() throws IOException { try (FileObject remoteFile = newSftpFile(getSftpFileUri(remotePath)); BufferedOutputStream outputStream = new BufferedOutputStream(remoteFile.getContent().getOutputStream()); BufferedInputStream inputStream = new BufferedInputStream(new FileInputStream(localTempFile)) ) { logger.info("new sftp file: {}", remoteFile.getPublicURIString()); IOUtils.copy(inputStream, outputStream); } return null; } @Override public boolean isRetryableException(Exception exception) { return true; } @Override public void onRetry(Exception exception, int retryCount, int retryLimit, int retryWait) throws RetryGiveupException { String message = String.format("SFTP output failed. Retrying %d/%d after %d seconds. Message: %s", retryCount, retryLimit, retryWait / 1000, exception.getMessage()); if (retryCount % 3 == 0) { logger.warn(message, exception); } else { logger.warn(message); } } @Override public void onGiveup(Exception firstException, Exception lastException) throws RetryGiveupException { } }); } catch (RetryGiveupException ex) { throw Throwables.propagate(ex.getCause()); } catch (InterruptedException ex) { throw Throwables.propagate(ex); } }
Source:
void shutdown() { if (m_isShutdown) { return; } m_isShutdown = true; try { int waitFor = 1 - Math.min(m_inFlight.availablePermits(), -4); for (int i = 0; i < waitFor; ++i) { try { if (m_inFlight.tryAcquire(1, TimeUnit.SECONDS)) { m_inFlight.release(); break; } } catch (InterruptedException e) { break; } } m_ecryptgw.die(); EncryptedMessages messages = null; while ((messages = m_encryptedQueue.poll()) != null) { messages.m_messages.release(); } if (m_inflightMessages != null && m_inflightMessages.m_messages != null && m_inflightMessages.m_messages.refCnt() > 0) { m_inflightMessages.m_messages.release(); } } finally { m_inFlight.drainPermits(); m_inFlight.release(); } }

Target:
void shutdown() { if (m_isShutdown) { return; } m_isShutdown = true; try { int waitFor = 1 - Math.min(m_inFlight.availablePermits(), -4); for (int i = 0; i < waitFor; ++i) { try { if (m_inFlight.tryAcquire(1, TimeUnit.SECONDS)) { m_inFlight.release(); break; } } catch (InterruptedException e) { break; } } m_ecryptgw.die(); EncryptedMessages messages = null; while ((messages = m_encryptedQueue.poll()) != null) { messages.m_messages.release(); } if (m_inflightMessages != null) { assert (m_inflightMessages.m_messages != null && m_inflightMessages.m_messages.refCnt() > 0); m_inflightMessages.m_messages.release(); } } finally { m_inFlight.drainPermits(); m_inFlight.release(); } }
Source:
public String version() { if (version == "") { this.version = ping().getVersion(); } return this.version; }

Target:
public String version() { if (version == null) { this.version = ping().getVersion(); } return this.version; }
Source:
private static List<Double> buildVariableStatistics( PlanNodeStatsEstimate left, PlanNodeStatsEstimate right, PlanNodeStatsEstimate.Builder statsBuilder, double estimatedRowCount, RangeAdditionStrategy rangeAdder) { List<Double> allRowCounts = new LinkedList<>(); concat(left.getVariablesWithKnownStatistics().stream(), right.getVariablesWithKnownStatistics().stream()) .distinct() .forEach(symbol -> { VariableStatsEstimate symbolStats = VariableStatsEstimate.zero(); if (estimatedRowCount > 0) { symbolStats = addColumnStats( left.getVariableStatistics(symbol), left.getOutputRowCount(), right.getVariableStatistics(symbol), right.getOutputRowCount(), estimatedRowCount, rangeAdder); } statsBuilder.addVariableStatistics(symbol, symbolStats); allRowCounts.add(symbolStats.getDistinctValuesCount()); }); return allRowCounts; }

Target:
private static void buildVariableStatistics( PlanNodeStatsEstimate left, PlanNodeStatsEstimate right, PlanNodeStatsEstimate.Builder statsBuilder, double estimatedRowCount, RangeAdditionStrategy rangeAdder) { concat(left.getVariablesWithKnownStatistics().stream(), right.getVariablesWithKnownStatistics().stream()) .distinct() .forEach(symbol -> { VariableStatsEstimate symbolStats = VariableStatsEstimate.zero(); if (estimatedRowCount > 0) { symbolStats = addColumnStats( left.getVariableStatistics(symbol), left.getOutputRowCount(), right.getVariableStatistics(symbol), right.getOutputRowCount(), estimatedRowCount, rangeAdder); } statsBuilder.addVariableStatistics(symbol, symbolStats); }); }
Source:
public static void init() { client = new ResteasyClientBuilder().build(); StringBuilder sb = new StringBuilder(); for (int i = 1; i <= 10 * 1024 * 1024; i++) { sb.append("A"); } original = sb.toString(); StringBuilder sb2 = new StringBuilder(); for (int i = 1; i <= 256; i++) { sb2.append("A"); } trimmed = sb2.toString(); }

Target:
public static void init() { client = new ResteasyClientBuilder().build(); StringBuilder sb = new StringBuilder(); for (int i = 1; i <= 1024; i++) { sb.append("A"); } original = sb.toString(); StringBuilder sb2 = new StringBuilder(); for (int i = 1; i <= 256; i++) { sb2.append("A"); } trimmed = sb2.toString(); }
Source:
public void createRetentionPolicy(final String rpName, final String database, final String duration, final String shardDuration, final int replicationFactor, final boolean isDefault) { Preconditions.checkNonEmptyString(rpName, "retentionPolicyName"); Preconditions.checkNonEmptyString(database, "database"); Preconditions.checkNonEmptyString(duration, "retentionDuration"); Preconditions.checkDuration(duration, "retentionDuration"); if (shardDuration != null && !shardDuration.isEmpty()) { Preconditions.checkDuration(shardDuration, "shardDuration"); } Preconditions.checkPositiveNumber(replicationFactor, "replicationFactor"); StringBuilder queryBuilder = new StringBuilder("CREATE RETENTION POLICY \""); queryBuilder.append(rpName).append("\" ON \"").append(database).append("\" DURATION ").append(duration) .append(" REPLICATION ").append(replicationFactor); if (shardDuration != null && !shardDuration.isEmpty()) { queryBuilder.append(" SHARD DURATION "); queryBuilder.append(shardDuration); } if (isDefault) { queryBuilder.append(" DEFAULT"); } execute(this.influxDBService.postQuery(this.username, this.password, Query.encode(queryBuilder.toString()))); }

Target:
public void createRetentionPolicy(final String rpName, final String database, final String duration, final String shardDuration, final int replicationFactor, final boolean isDefault) { Preconditions.checkNonEmptyString(rpName, "retentionPolicyName"); Preconditions.checkNonEmptyString(database, "database"); Preconditions.checkNonEmptyString(duration, "retentionDuration"); Preconditions.checkDuration(duration, "retentionDuration"); if (shardDuration != null && !shardDuration.isEmpty()) { Preconditions.checkDuration(shardDuration, "shardDuration"); } Preconditions.checkPositiveNumber(replicationFactor, "replicationFactor"); StringBuilder queryBuilder = new StringBuilder("CREATE RETENTION POLICY \""); queryBuilder.append(rpName) .append("\" ON \"") .append(database) .append("\" DURATION ") .append(duration) .append(" REPLICATION ") .append(replicationFactor); if (shardDuration != null && !shardDuration.isEmpty()) { queryBuilder.append(" SHARD DURATION "); queryBuilder.append(shardDuration); } if (isDefault) { queryBuilder.append(" DEFAULT"); } executeQuery(this.influxDBService.postQuery(this.username, this.password, Query.encode(queryBuilder.toString()))); }
Source:
public void changeMode( @QueryParam("mode") String mode, @QueryParam("reason") String reason) { Mode m = Mode.valueOf(mode); modeManager.enterMode(m, reason); }

Target:
public void changeMode( @QueryParam("mode") String mode, @QueryParam("reason") String reason) { Mode m = Mode.valueOf(mode); Reason r = Reason.valueOf(reason); modeManager.enterMode(m, r); }
Source:
public String getDisplayName() { return "Other Jenkins Configuration Files (secrets are filtered out unless saved in clear in the .xml files)"; }

Target:
public String getDisplayName() { return "Other Jenkins Configuration Files (Encrypted secrets are redacted)"; }
Source:
public List<OutputTestResultDto> testOutput(UUID resultId, UUID taskId, MultipartFile[] files) throws IOException { Result result = resultRepository.findOne(resultId); if (result == null) { throw new IllegalArgumentException("result.invalid"); } Task task = taskRepository.findOneWithTests(taskId); if (task == null) { throw new IllegalArgumentException("task.invalid"); } TaskResult taskResult = taskResultService.findByTaskAndResult(taskId, resultId); Submission submission = new Submission(); submission.setTaskResult(taskResult); submission.setSubmissionTime(ZonedDateTime.now()); submission = repository.save(submission); List<OutputTestResultDto> testResults = new ArrayList<>(); boolean green = true; for (MultipartFile file: files){ UUID testId = UUID.fromString(file.getOriginalFilename()); Test test = testRepository.findOneWithRunner(testId); boolean testResult = runOutputTest(submission, test, file); testResults.add(new OutputTestResultDto(testId, testResult)); green = green && testResult; } if (testResults.size() == task.getTests().size() && green){ submission.setGreen(true); repository.save(submission); taskResultService.finishTaskResult(taskResult, submission.getSubmissionTime(), true); } return testResults; }

Target:
public List<OutputTestResultDto> testOutput(UUID resultId, UUID taskId, MultipartFile[] files) throws IOException { Result result = resultRepository.findOne(resultId); if (result == null) { throw new IllegalArgumentException("result.invalid"); } Task task = taskRepository.findOneWithTests(taskId); if (task == null) { throw new IllegalArgumentException("task.invalid"); } TaskResult taskResult = taskResultService.findByTaskAndResult(taskId, resultId); Submission submission = new Submission(); submission.setTaskResult(taskResult); submission.setSubmissionTime(ZonedDateTime.now()); submission = repository.save(submission); List<OutputTestResultDto> testResults = new ArrayList<>(files.length); boolean green = true; for (MultipartFile file : files) { UUID testId = UUID.fromString(file.getOriginalFilename()); Test test = testRepository.findOneWithRunner(testId); OutputTestResultDto testResult = runOutputTest(submission, test, file); testResults.add(testResult); green = green && testResult.isGreen(); } if (testResults.size() == task.getTests().size() && green) { submission.setGreen(true); repository.save(submission); taskResultService.finishTaskResult(taskResult, submission.getSubmissionTime(), true); } return testResults; }
Source:
protected String getAuthorizationBaseUrl() { throw new UnsupportedOperationException("use getAuthorizationUrl instead"); }

Target:
protected String getAuthorizationBaseUrl() { return "<LINK_0>"; }
Source:
public boolean supportsFormat(String format) { if (format == null || format.length() == 0) { return false; } return serviceMetadata.getSupportedFormats().stream() .anyMatch(f -> format.equals(f)); }

Target:
public boolean supportsFormat(String format) { if (format == null || format.isEmpty()) { return false; } return serviceMetadata.getSupportedFormats().stream() .anyMatch(f -> format.equals(f)); }
Source:
public FragmentationDuplexConnection( DuplexConnection delegate, ByteBufAllocator allocator, int mtu, boolean encodeLength) { Objects.requireNonNull(delegate, "delegate must not be null"); Objects.requireNonNull(allocator, "byteBufAllocator must not be null"); if (mtu < MIN_MTU_SIZE) { throw new IllegalArgumentException("smallest allowed mtu size is 64 bytes"); } this.encodeLength = encodeLength; this.allocator = allocator; this.delegate = delegate; this.mtu = mtu; this.frameReassembler = new FrameReassembler(allocator); delegate.onClose().doFinally(s -> frameReassembler.dispose()).subscribe(); }

Target:
public FragmentationDuplexConnection( DuplexConnection delegate, ByteBufAllocator allocator, int mtu, boolean encodeLength) { Objects.requireNonNull(delegate, "delegate must not be null"); Objects.requireNonNull(allocator, "byteBufAllocator must not be null"); if (mtu < MIN_MTU_SIZE) { throw new IllegalArgumentException("smallest allowed mtu size is " + MIN_MTU_SIZE + " bytes"); } this.encodeLength = encodeLength; this.allocator = allocator; this.delegate = delegate; this.mtu = mtu; this.frameReassembler = new FrameReassembler(allocator); delegate.onClose().doFinally(s -> frameReassembler.dispose()).subscribe(); }
Source:
public List<CourseGroup> getLecturing() { String userId = proxy.getCurrentUser().getDisplayName(); List <CourseGroupDAO> groupDaos = dao.findLecturingCourseGroups(userId); List<CourseGroup> groups = new ArrayList<CourseGroup>(groupDaos.size()); for(CourseGroupDAO groupDao : groupDaos) { groups.add(new CourseGroupImpl(groupDao, this)); } return groups; }

Target:
public List<CourseGroup> getLecturing() { String userId = proxy.getCurrentUser().getId(); List <CourseGroupDAO> groupDaos = dao.findLecturingCourseGroups(userId); List<CourseGroup> groups = new ArrayList<CourseGroup>(groupDaos.size()); for(CourseGroupDAO groupDao : groupDaos) { groups.add(new CourseGroupImpl(groupDao, this)); } return groups; }
Source:
private UserEx getUserFromTwitterLinkage(PartakeConnection con, IPartakeDAOs daos, UserTwitterLink twitterLinkage) throws DAOException, TwitterException { String userId = twitterLinkage.getUserId(); User user = daos.getUserAccess().find(con, userId); if (user == null) { user = new User(userId, twitterLinkage.getScreenName(), twitterLinkage.getProfileImageURL(), TimeUtil.getCurrentDateTime(), null); } else if (!verifyUserProfiles(user, twitterLinkage)) { user = new User(user); user.setScreenName(twitterLinkage.getScreenName()); user.setProfileImageURL(twitterLinkage.getProfileImageURL()); } daos.getUserAccess().put(con, user); user.freeze(); return new UserEx(user, twitterLinkage); }

Target:
private UserEx getUserFromTwitterLinkage(PartakeConnection con, IPartakeDAOs daos, UserTwitterLink twitterLinkage) throws DAOException, TwitterException { String userId = twitterLinkage.getUserId(); User user = daos.getUserAccess().find(con, userId); if (user == null) { user = new User(userId, twitterLinkage.getScreenName(), twitterLinkage.getProfileImageURL(), TimeUtil.getCurrentDateTime(), null); daos.getUserAccess().put(con, user); user.freeze(); } else { if (!verifyUserProfiles(user, twitterLinkage)) { user = new User(user); user.setScreenName(twitterLinkage.getScreenName()); user.setProfileImageURL(twitterLinkage.getProfileImageURL()); daos.getUserAccess().put(con, user); user.freeze(); } } return new UserEx(user, twitterLinkage); }
Source:
public SleepStatsSample map(int i, ResultSet resultSet, StatementContext statementContext) throws SQLException { final SleepStats stats = new SleepStats( resultSet.getInt("sound_sleep"), resultSet.getInt("light_sleep"), resultSet.getInt("duration"), resultSet.getInt("motion"), resultSet.getTimestamp("sleep_time_utc").getTime(), resultSet.getTimestamp("wake_time_utc").getTime(), resultSet.getInt("fall_asleep_time") ); return new SleepStatsSample(stats, new DateTime(resultSet.getTimestamp("local_utc_date"), DateTimeZone.UTC), resultSet.getInt("offset_millis") ); }

Target:
public SleepStatsSample map(int i, ResultSet resultSet, StatementContext statementContext) throws SQLException { final DateTime sleepTime = new DateTime(resultSet.getTimestamp("sleep_time_utc"), DateTimeZone.UTC); final DateTime wakeTime = new DateTime(resultSet.getTimestamp("wake_time_utc"), DateTimeZone.UTC); final SleepStats stats = new SleepStats( resultSet.getInt("sound_sleep"), resultSet.getInt("light_sleep"), resultSet.getInt("duration"), resultSet.getInt("motion"), sleepTime.getMillis(), wakeTime.getMillis(), resultSet.getInt("fall_asleep_time") ); return new SleepStatsSample(stats, new DateTime(resultSet.getTimestamp("local_utc_date"), DateTimeZone.UTC), resultSet.getInt("offset_millis") ); }
Source:
public void testEquals() throws Exception { final RevCommit a1 = commit(); final RevCommit b1 = commit(); assertEquals(a1, a1); assertEquals(a1, a1); assertFalse(a1.equals(b1)); assertEquals(a1, a1); assertEquals(a1, a1); assertFalse(a1.equals("")); final RevWalk rw2 = new RevWalk(db); final RevCommit a2 = rw2.parseCommit(a1); final RevCommit b2 = rw2.parseCommit(b1); assertNotSame(a1, a2); assertNotSame(b1, b2); assertEquals(a2, a1); assertEquals(b2, b1); assertEquals(a1.hashCode(), a2.hashCode()); assertEquals(b1.hashCode(), b2.hashCode()); assertTrue(AnyObjectId.equals(a1, a2)); assertTrue(AnyObjectId.equals(b1, b2)); }

Target:
public void testEquals() throws Exception { final RevCommit a1 = commit(); final RevCommit b1 = commit(); assertTrue(a1.equals(a1)); assertTrue(a1.equals((Object) a1)); assertFalse(a1.equals(b1)); assertTrue(a1.equals(a1)); assertTrue(a1.equals((Object) a1)); assertFalse(a1.equals("")); final RevWalk rw2 = new RevWalk(db); final RevCommit a2 = rw2.parseCommit(a1); final RevCommit b2 = rw2.parseCommit(b1); assertNotSame(a1, a2); assertNotSame(b1, b2); assertTrue(a1.equals(a2)); assertTrue(b1.equals(b2)); assertEquals(a1.hashCode(), a2.hashCode()); assertEquals(b1.hashCode(), b2.hashCode()); assertTrue(AnyObjectId.equals(a1, a2)); assertTrue(AnyObjectId.equals(b1, b2)); }
Source:
public final ResultIterator iterator(final List<SQLCloseable> dependencies) throws SQLException { if (context.getScanRanges() == ScanRanges.NOTHING) { return ResultIterator.EMPTY_ITERATOR; } Scan scan = context.getScan(); PhoenixConnection connection = context.getConnection(); Long scn = connection.getSCN(); ScanUtil.setTimeRange(scan, scn == null ? context.getCurrentTime() : scn); ScanUtil.setTenantId(scan, connection.getTenantId() == null ? null : connection.getTenantId().getBytes()); ResultIterator iterator = newIterator(); return dependencies == null || dependencies.isEmpty() ? iterator : new DelegateResultIterator(iterator) { @Override public void close() throws SQLException { super.close(); SQLCloseables.closeAll(dependencies); } }; }

Target:
public final ResultIterator iterator(final List<SQLCloseable> dependencies) throws SQLException { if (context.getScanRanges() == ScanRanges.NOTHING) { return ResultIterator.EMPTY_ITERATOR; } Scan scan = context.getScan(); PhoenixConnection connection = context.getConnection(); Long scn = connection.getSCN(); ScanUtil.setTimeRange(scan, scn == null ? context.getCurrentTime() : scn); ScanUtil.setTenantId(scan, connection.getTenantId() == null ? null : connection.getTenantId().getBytes()); ResultIterator iterator = newIterator(); return dependencies.isEmpty() ? iterator : new DelegateResultIterator(iterator) { @Override public void close() throws SQLException { try { super.close(); } finally { SQLCloseables.closeAll(dependencies); } } }; }
Source:
public void withDataImportSAV(String userAction, final Command command) { withDependencies( "Preparing Import from SAV", userAction, dataImportSavDependenciesArray(), false, new CommandWithArg<Boolean>() { @Override public void execute(Boolean succeeded) { if (succeeded) command.execute(); } } ); }

Target:
public void withDataImportSAV(String userAction, final Command command) { withDependencies( "Preparing Import from SPSS, SAS and Stata", userAction, dataImportSavDependenciesArray(), false, new CommandWithArg<Boolean>() { @Override public void execute(Boolean succeeded) { if (succeeded) command.execute(); } } ); }
Source:
public Client createWithDropwizardClient(PaymentGatewayName gateway, Optional<GatewayOperation> operation, MetricRegistry metricRegistry) { JerseyClientConfiguration clientConfiguration = conf.getClientConfiguration(); JerseyClientBuilder defaultClientBuilder = new JerseyClientBuilder(environment) .using(new ApacheConnectorProvider()) .using(clientConfiguration); if (operation.isPresent()) { defaultClientBuilder .withProperty(READ_TIMEOUT, getReadTimeoutInMillis(operation.get(), gateway)) .withProperty(CONNECTION_MANAGER, createConnectionManager(gateway.getName(), operation.get().getConfigKey(), metricRegistry)); } else { defaultClientBuilder .withProperty(READ_TIMEOUT, getDefaultTimeout()) .withProperty(CONNECTION_MANAGER, createConnectionManager(gateway.getName(), "all", metricRegistry)); } if (conf.getCustomJerseyClient().isProxyEnabled()) { defaultClientBuilder .withProperty(ClientProperties.PROXY_URI, proxyUrl(clientConfiguration.getProxyConfiguration())); } Client client = defaultClientBuilder.build(gateway.getName()); client.register(RestClientLoggingFilter.class); if (conf.isXrayEnabled()) client.register(XRayHttpClientFilter.class); return client; }

Target:
private Client createWithDropwizardClient(PaymentGatewayName gateway, Optional<GatewayOperation> operation, MetricRegistry metricRegistry) { JerseyClientConfiguration clientConfiguration = conf.getClientConfiguration(); JerseyClientBuilder defaultClientBuilder = new JerseyClientBuilder(environment) .using(new ApacheConnectorProvider()) .using(clientConfiguration); if (operation.isPresent()) { defaultClientBuilder .withProperty(READ_TIMEOUT, getReadTimeoutInMillis(operation.get(), gateway)) .withProperty(CONNECTION_MANAGER, createConnectionManager(gateway.getName(), operation.get().getConfigKey(), metricRegistry)); } else { defaultClientBuilder .withProperty(READ_TIMEOUT, getDefaultTimeout()) .withProperty(CONNECTION_MANAGER, createConnectionManager(gateway.getName(), "all", metricRegistry)); } if (conf.getCustomJerseyClient().isProxyEnabled()) { defaultClientBuilder .withProperty(ClientProperties.PROXY_URI, proxyUrl(clientConfiguration.getProxyConfiguration())); } Client client = defaultClientBuilder.build(gateway.getName()); client.register(RestClientLoggingFilter.class); if (conf.isXrayEnabled()) client.register(XRayHttpClientFilter.class); return client; }
Source:
private void inspectGetCommand() { String parentPath = "."; if (!m_voltdbRoot.exists()) { try { parentPath = m_voltdbRoot.getCanonicalFile().getParent(); } catch (IOException io) System.err.println("FATAL: " + parentPath + " does not contain a " + "valid database root directory. Use the --dir option to specify the path to the root."); referToDocAndExit(); } File configInfoDir = new VoltFile(m_voltdbRoot, Constants.CONFIG_DIR); switch (m_getOption) { case DEPLOYMENT: { File depFH = new VoltFile(configInfoDir, "deployment.xml"); if (!depFH.exists()) { System.out.println("FATAL: Deployment file \"" + depFH.getAbsolutePath() + "\" not found."); referToDocAndExit(); } m_pathToDeployment = depFH.getAbsolutePath(); return; } case SCHEMA: case CLASSES: { File catalogFH = new VoltFile(configInfoDir, "catalog.jar"); if (!catalogFH.exists()) { try { parentPath = m_voltdbRoot.getCanonicalFile().getParent(); } catch (IOException io) System.out.println("FATAL: "+ m_getOption.name().toUpperCase() + " not found in the provided database directory " + parentPath + ". Make sure the database has been started "); referToDocAndExit(); } m_pathToCatalog = catalogFH.getAbsolutePath(); return; } } }

Target:
private void inspectGetCommand() { String parentPath = m_voltdbRoot.getParent(); if (!m_voltdbRoot.exists()) { try { parentPath = m_voltdbRoot.getCanonicalFile().getParent(); } catch (IOException io) System.err.println("FATAL: " + parentPath + " does not contain a " + "valid database root directory. Use the --dir option to specify the path to the root."); referToDocAndExit(); } File configInfoDir = new VoltFile(m_voltdbRoot, Constants.CONFIG_DIR); switch (m_getOption) { case DEPLOYMENT: { File depFH = new VoltFile(configInfoDir, "deployment.xml"); if (!depFH.exists()) { System.out.println("FATAL: Deployment file \"" + depFH.getAbsolutePath() + "\" not found."); referToDocAndExit(); } m_pathToDeployment = depFH.getAbsolutePath(); return; } case SCHEMA: case CLASSES: { File catalogFH = new VoltFile(configInfoDir, "catalog.jar"); if (!catalogFH.exists()) { try { parentPath = m_voltdbRoot.getCanonicalFile().getParent(); } catch (IOException io) System.err.println("FATAL: "+ m_getOption.name().toUpperCase() + " not found in the provided database directory " + parentPath + ". Make sure the database has been started "); referToDocAndExit(); } m_pathToCatalog = catalogFH.getAbsolutePath(); return; } } }
Source:
public void testMultipleClients() throws Throwable { try (Connection clientA = CLUSTER.newConnection()) { VoltronReadWriteLock lockA = new VoltronReadWriteLock(clientA, "test"); Hold hold = lockA.writeLock(); try (Connection clientB = CLUSTER.newConnection()) { Future<Void> waiter = async(() -> { new VoltronReadWriteLock(clientB, "test").writeLock().unlock(); return null; }); try { waiter.get(100, TimeUnit.MILLISECONDS); fail("TimeoutException expected"); } catch (TimeoutException e) { } CLUSTER.getClusterControl().terminateActive(); CLUSTER.getClusterControl().startOneServer(); try { waiter.get(100, TimeUnit.MILLISECONDS); fail("TimeoutException expected"); } catch (TimeoutException e) { } hold.unlock(); waiter.get(); } } }

Target:
public void testMultipleClients() throws Throwable { try (Connection clientA = CLUSTER.newConnection(); Connection clientB = CLUSTER.newConnection()) { VoltronReadWriteLock lockA = new VoltronReadWriteLock(clientA, "test"); Hold hold = lockA.writeLock(); Future<Void> waiter = async(() -> { new VoltronReadWriteLock(clientB, "test").writeLock().unlock(); return null; }); try { waiter.get(100, TimeUnit.MILLISECONDS); fail("TimeoutException expected"); } catch (TimeoutException e) { } CLUSTER.getClusterControl().terminateActive(); CLUSTER.getClusterControl().startOneServer(); try { waiter.get(100, TimeUnit.MILLISECONDS); fail("TimeoutException expected"); } catch (TimeoutException e) { } hold.unlock(); waiter.get(); } }
Source:
public static String toString(final Integer code, final String label) { return new StringBuffer() .append(String.format("[%04d]", code)) .append(" - ") .append(label) .toString(); }

Target:
public static String toString(final Integer code, final String label) { return new StringBuffer() .append(String.format("["+CODE_FORMAT+"]", code)) .append(" - ") .append(label) .toString(); }
Source:
public CloudCheckrWrapper getCloudCheckrWrapper(String startDate, String endDate, String masterAccountName) throws URISyntaxException, IOException { String cloudCheckrURL = findCloudCheckrEndPoint(); String formattedUrl = MessageFormat.format(cloudCheckrURL, startDate, endDate, masterAccountName); Response response = null; try { Invocation request = buildReportDetailsClientRequest(formattedUrl); response = request.invoke(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(CloudCheckrWrapper.class); } else { LOG.error("getCloudCheckrWrapper, error calling enpoint. The HTTP response was " + response.getStatus()); throw new IOException("Invalid response code: " + response.getStatus()); } } finally { CURestClientUtils.closeQuietly(response); } }

Target:
public CloudCheckrWrapper getCloudCheckrWrapper(String startDate, String endDate, String masterAccountName) throws URISyntaxException, IOException { String cloudCheckrURL = findCloudCheckrEndPoint(); String formattedUrl = MessageFormat.format(cloudCheckrURL, startDate, endDate, masterAccountName); Response response = null; try { Invocation request = buildReportDetailsClientRequest(formattedUrl); response = request.invoke(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(CloudCheckrWrapper.class); } else { LOG.error("getCloudCheckrWrapper, error calling endpoint. The HTTP response was " + response.getStatus()); throw new IOException("Invalid response code: " + response.getStatus()); } } finally { CURestClientUtils.closeQuietly(response); } }
Source:
private void doAuthManagerLogin() { final String username = usernameText.getText().toString(); final String password = passwordText.getText().toString(); new AMLoginTask(username, password) { @Override public void onBeforeExecute() { progressDialog.show(); } @Override public void onCatch(Throwable caught) { L.d("Caught " + caught.toString()); if (!progressDialog.isShowing()) { return; } progressDialog.dismiss(); FeedbackUtil.showError(LoginActivity.this, caught); } @Override public void onFinish(AMLoginResult result) { super.onFinish(result); if (!progressDialog.isShowing()) { return; } progressDialog.dismiss(); if ("PASS".equals(result.getStatus())) { funnel.logSuccess(); Bundle extras = getIntent().getExtras(); AccountAuthenticatorResponse response = extras == null ? null : extras.<AccountAuthenticatorResponse>getParcelable(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE); AccountUtil.createAccount(response, username, password); hideSoftKeyboard(LoginActivity.this); setResult(RESULT_LOGIN_SUCCESS); finish(); } else if ("FAIL".equals(result.getStatus())) { funnel.logError(result.getMessage()); handleAuthManagerError(result.getMessage()); } } }.execute(); }

Target:
private void doAuthManagerLogin() { final String username = usernameText.getText().toString(); final String password = passwordText.getText().toString(); new AMLoginTask(username, password) { @Override public void onBeforeExecute() { progressDialog.show(); } @Override public void onCatch(Throwable caught) { if (!progressDialog.isShowing()) { return; } progressDialog.dismiss(); FeedbackUtil.showError(LoginActivity.this, caught); } @Override public void onFinish(AMLoginResult result) { super.onFinish(result); if (!progressDialog.isShowing()) { return; } progressDialog.dismiss(); if (result.pass()) { funnel.logSuccess(); Bundle extras = getIntent().getExtras(); AccountAuthenticatorResponse response = extras == null ? null : extras.<AccountAuthenticatorResponse>getParcelable(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE); AccountUtil.createAccount(response, username, password); hideSoftKeyboard(LoginActivity.this); setResult(RESULT_LOGIN_SUCCESS); finish(); } else if (result.fail()) { funnel.logError(result.getMessage()); handleAuthManagerError(result.getMessage()); } } }.execute(); }
Source:
private void onExit() { int s = exitTasks.size(); for (int i = 0; i < s; i ++) { if (exitTasks.size() <= i) { break; } exitTasks.get(i).run(); } }

Target:
private void onExit() { int s = exitTasks.size(); for (int i = 0; i < s; i++) { if (terminateAllExitTasks) { break; } exitTasks.get(i).run(); } terminateAllExitTasks = false; }
Source:
public void run() { final List<CucumberFeature> features = featureSupplier.get(); bus.send(new TestRunStarted(bus.getTime(), bus.getTimeMillis())); for (CucumberFeature feature : features) { feature.sendTestSourceRead(bus); } final StepDefinitionReporter stepDefinitionReporter = plugins.stepDefinitionReporter(); runnerSupplier.get().reportStepDefinitions(stepDefinitionReporter); final List<PickleEvent> filteredEvents = new ArrayList<>(); for (CucumberFeature feature : features) { for (final PickleEvent pickleEvent : feature.getPickles()) { if (filters.matchesFilters(pickleEvent)) { filteredEvents.add(pickleEvent); } } } final List<Future<?>> executingPickles = new ArrayList<>(); for(final PickleEvent pickleEvent : runtimeOptions.getOrderType().orderPickleEvents(filteredEvents)) { executingPickles.add(executor.submit(new Runnable() { @Override public void run() { runnerSupplier.get().runPickle(pickleEvent); } })); } executor.shutdown(); List<Throwable> thrown = new ArrayList<>(); for (Future executingPickle : executingPickles) { try { executingPickle.get(); } catch (ExecutionException e){ log.error("Exception while executing pickle", e); thrown.add(e.getCause()); } catch (InterruptedException e){ executor.shutdownNow(); throw new CucumberException(e); } } if(thrown.size() == 1){ throw new CucumberException(thrown.get(0)); } else if (thrown.size() > 1){ throw new CompositeCucumberException(thrown); } bus.send(new TestRunFinished(bus.getTime(), bus.getTimeMillis())); }

Target:
public void run() { final List<CucumberFeature> features = featureSupplier.get(); bus.send(new TestRunStarted(bus.getTime(), bus.getTimeMillis())); for (CucumberFeature feature : features) { feature.sendTestSourceRead(bus); } final StepDefinitionReporter stepDefinitionReporter = plugins.stepDefinitionReporter(); runnerSupplier.get().reportStepDefinitions(stepDefinitionReporter); final List<PickleEvent> filteredEvents = new ArrayList<>(); for (CucumberFeature feature : features) { for (final PickleEvent pickleEvent : feature.getPickles()) { if (filters.matchesFilters(pickleEvent)) { filteredEvents.add(pickleEvent); } } } final List<PickleEvent> orderedEvents = pickleOrder.orderPickleEvents(filteredEvents); final List<PickleEvent> limitedEvents = filters.limitPickleEvents(orderedEvents); final List<Future<?>> executingPickles = new ArrayList<>(); for(final PickleEvent pickleEvent : limitedEvents) { executingPickles.add(executor.submit(new Runnable() { @Override public void run() { runnerSupplier.get().runPickle(pickleEvent); } })); } executor.shutdown(); List<Throwable> thrown = new ArrayList<>(); for (Future executingPickle : executingPickles) { try { executingPickle.get(); } catch (ExecutionException e){ log.error("Exception while executing pickle", e); thrown.add(e.getCause()); } catch (InterruptedException e){ executor.shutdownNow(); throw new CucumberException(e); } } if(thrown.size() == 1){ throw new CucumberException(thrown.get(0)); } else if (thrown.size() > 1){ throw new CompositeCucumberException(thrown); } bus.send(new TestRunFinished(bus.getTime(), bus.getTimeMillis())); }
Source:
public void throwsExceptionIfUnknownAliasKicked() throws Exception { final User user = this.rule.get(); final Alias alias = user.aliases().iterate().iterator().next(); final Inbox inbox = alias.inbox(); final Bout bout = inbox.bout(inbox.start()); final String friend = "jim"; bout.friends().kick(friend); }

Target:
public void throwsExceptionIfUnknownAliasKicked() throws Exception { final Inbox inbox = this.rule.get().aliases() .iterate().iterator().next().inbox(); inbox.bout(inbox.start()).friends().kick("jim"); }
Source:
public void throwsIfConfiguredToBeExistingServiceWithoutDirectory() { File mockFile = getMockFileWith(false, true); assertThatThrownBy(ImmutablePaxosInstallConfiguration.builder() .dataDirectory(mockFile) .isNewService(false) ::build).isInstanceOf(IllegalArgumentException.class); }

Target:
public void throwsIfConfiguredToBeExistingServiceWithoutDirectory() { File mockFile = getMockFileWith(false, true); assertFailsToBuildConfiguration(ImmutablePaxosInstallConfiguration.builder() .dataDirectory(mockFile) .isNewService(false)); }
Source:
private boolean isNoDictionaryColumn(Set<String> noDictionaryColumns, Set<String> invertedIndexColumns, FieldSpec fieldSpec, String column) { FieldSpec.DataType dataType = fieldSpec.getDataType(); if (noDictionaryColumns.contains(column)) { if (fieldSpec instanceof DimensionFieldSpec && _aggregateMetrics && (dataType == FieldSpec.DataType.STRING || dataType == FieldSpec.DataType.BYTES)) { _logger.info("Will create dictionary in consuming segment for column of type {}", column, dataType.toString()); return false; } return fieldSpec.isSingleValueField() && !invertedIndexColumns.contains(column); } return false; }

Target:
private boolean isNoDictionaryColumn(Set<String> noDictionaryColumns, Set<String> invertedIndexColumns, FieldSpec fieldSpec, String column) { FieldSpec.DataType dataType = fieldSpec.getDataType(); if (noDictionaryColumns.contains(column)) { if (fieldSpec instanceof DimensionFieldSpec && _aggregateMetrics && (dataType == FieldSpec.DataType.STRING || dataType == FieldSpec.DataType.BYTES)) { _logger.info("Aggregate metrics is enabled. Will create dictionary in consuming segment for column of type {}", column, dataType.toString()); return false; } return fieldSpec.isSingleValueField() && !invertedIndexColumns.contains(column); } return false; }
Source:
public List<VirtualEdgeIteratorState> getUnfavoredVirtualEdges() { return unfavoredEdges; }

Target:
public Set<EdgeIteratorState> getUnfavoredVirtualEdges() { return new LinkedHashSet<EdgeIteratorState>(unfavoredEdges); }
Source:
public List<Command> transmit(final List<Command> commands) throws DolphinRemotingException { Assert.requireNonNull(commands, "commands"); if (disconnecting.get()) { LOG.warn("Canceled communication based on disconnect"); return Collections.emptyList(); } for (Command command : commands) { if (command instanceof DestroyContextCommand) { disconnecting.set(true); } } try { String data = codec.encode(commands); String receivedContent = client.request(servletUrl, RequestMethod.POST).withContent(data, HttpHeaderConstants.JSON_MIME_TYPE).readString().execute().get().getContent(); return codec.decode(receivedContent); } catch (Exception e) { throw new DolphinRemotingException("Error in remoting layer", e); } }

Target:
public List<Command> transmit(final List<Command> commands) throws DolphinRemotingException { Assert.requireNonNull(commands, "commands"); if (disconnecting.get()) { LOG.warn("Canceled communication based on disconnect"); return Collections.emptyList(); } for (Command command : commands) { if (command instanceof DestroyContextCommand) { disconnecting.set(true); } } try { final String data = codec.encode(commands); final String receivedContent = client.request(servletUrl, RequestMethod.POST).withContent(data, HttpHeaderConstants.JSON_MIME_TYPE).readString().execute().get().getContent(); return codec.decode(receivedContent); } catch (final Exception e) { throw new DolphinRemotingException("Error in remoting layer", e); } }
Source:
public synchronized Marshaller<Key> getKeyMarshaller() { return keyMarshaller; }

Target:
public Marshaller<Key> getKeyMarshaller() { return keyMarshaller; }
Source:
public com.google.cloud.dataflow.sdk.io.BoundedSource.BoundedReader<Result> createReader( PipelineOptions options) throws IOException { return new Source.Reader(this, configuration, null, null); }

Target:
public BoundedSource.BoundedReader<Result> createReader(PipelineOptions options) throws IOException { return new Source.Reader(this, configuration, configuration.getScan()); }
Source:
public Map<String, Object> getSpecificEventStyle(ITimeEvent event) { boolean currentThread = isType(event.getEntry(), Type.CURRENT_THREAD); if (currentThread && event instanceof TimeEvent) { int threadEventValue = ((TimeEvent) event).getValue(); if (threadEventValue == IDLE_THREAD) { return ImmutableMap.of(ITimeEventStyleStrings.fillColor(), 0); } int nbColors = getNbColors(); RGB color = fColors.get((((threadEventValue + COLOR_DIFFERENCIATION_FACTOR) % nbColors) + nbColors) % nbColors); return ImmutableMap.of(ITimeEventStyleStrings.fillColor(), color.red << 24 | color.green << 16 | color.blue << 8 | 0xff, ITimeEventStyleStrings.label(), String.valueOf(threadEventValue)); } return super.getSpecificEventStyle(event); }

Target:
public Map<String, Object> getSpecificEventStyle(ITimeEvent event) { if (isType(event.getEntry(), Type.CURRENT_THREAD) && event instanceof TimeEvent) { int threadEventValue = ((TimeEvent) event).getValue(); if (threadEventValue == IDLE_THREAD) { return ImmutableMap.of(ITimeEventStyleStrings.fillColor(), 0); } RGB color = fColors.get((((threadEventValue + COLOR_DIFFERENCIATION_FACTOR) % NUM_COLORS) + NUM_COLORS) % NUM_COLORS); return ImmutableMap.of(ITimeEventStyleStrings.fillColor(), color.red << 24 | color.green << 16 | color.blue << 8 | 0xff, ITimeEventStyleStrings.label(), String.valueOf(threadEventValue)); } return super.getSpecificEventStyle(event); }
Source:
private void onSendMessage(JsonNode jsonNode) { final RequestDTO requestDTO = MessageConverter.jsonNodeToRequest(jsonNode); final String message = requestDTO.getMessage().toLowerCase(); if("stop".equals(message)) { MessageDTO messageDTO = createMessageDTO("1", "1", "Stop", "Stopping actor"); out.tell(MessageConverter.messageToJsonNode(messageDTO), getSelf()); self().tell(PoisonPill.getInstance(), getSelf()); } else { log.info("Actor received. {}", requestDTO); processMessage(requestDTO); } }

Target:
private void onSendMessage(JsonNode jsonNode) { RequestDTO requestDTO = MessageConverter.jsonNodeToRequest(jsonNode); String message = requestDTO.getMessage().toLowerCase(); if("stop".equals(message)) { MessageDTO messageDTO = createMessageDTO("1", "1", "Stop", "Stopping actor"); out.tell(MessageConverter.messageToJsonNode(messageDTO), getSelf()); self().tell(PoisonPill.getInstance(), getSelf()); } else { log.info("Actor received. {}", requestDTO); processMessage(requestDTO); } }
Source:
public void bindTo(MeterRegistry registry) { stopTimer = Timer.builder(workspaceMetric("stop.time")) .description("The time of workspace stop") .tags(withStandardTags("result", "success")) .publishPercentileHistogram() .sla(Duration.ofSeconds(10)) .minimumExpectedValue(Duration.ofSeconds(10)) .maximumExpectedValue(Duration.ofMinutes(15)) .register(registry); eventService.subscribe(this::handleWorkspaceStatusChange, WorkspaceStatusEvent.class); }

Target:
public void bindTo(MeterRegistry registry) { stopTimer = Timer.builder(workspaceMetric("stop.time")) .description("The time of workspace stop") .tags(withStandardTags("result", "success")) .register(registry); eventService.subscribe(this::handleWorkspaceStatusChange, WorkspaceStatusEvent.class); }
Source:
public synchronized void refresh(HelixDataAccessor accessor) { long startTime = System.currentTimeMillis(); Set<HelixConstants.ChangeType> propertyRefreshed = super.doRefresh(accessor); if (propertyRefreshed.contains(HelixConstants.ChangeType.IDEAL_STATE) || propertyRefreshed.contains(HelixConstants.ChangeType.LIVE_INSTANCE) || propertyRefreshed.contains(HelixConstants.ChangeType.INSTANCE_CONFIG) || propertyRefreshed.contains(HelixConstants.ChangeType.RESOURCE_CONFIG)) { clearCachedResourceAssignments(); } refreshCustomizedStateConfig(accessor); _customizedStateCache.refresh(accessor, _liveInstanceCache.getPropertyMap()); refreshExternalViews(accessor); refreshTargetExternalViews(accessor); refreshCustomizedViewMap(accessor); LogUtil.logInfo(logger, getClusterEventId(), String.format( "END: ResourceControllerDataProvider.refresh() for cluster %s, started at %d took %d for %s pipeline", getClusterName(), startTime, System.currentTimeMillis() - startTime, getPipelineName())); dumpDebugInfo(); }

Target:
public synchronized void refresh(HelixDataAccessor accessor) { long startTime = System.currentTimeMillis(); Set<HelixConstants.ChangeType> propertyRefreshed = super.doRefresh(accessor); if (propertyRefreshed.contains(HelixConstants.ChangeType.IDEAL_STATE) || propertyRefreshed.contains(HelixConstants.ChangeType.LIVE_INSTANCE) || propertyRefreshed.contains(HelixConstants.ChangeType.INSTANCE_CONFIG) || propertyRefreshed.contains(HelixConstants.ChangeType.RESOURCE_CONFIG)) { clearCachedResourceAssignments(); } refreshCustomizedStateConfig(accessor); _customizedStateCache.setAggregationEnabledTypes(_aggregationEnabledTypes); _customizedStateCache.refresh(accessor, getLiveInstanceCache().getPropertyMap()); refreshExternalViews(accessor); refreshTargetExternalViews(accessor); refreshCustomizedViewMap(accessor); LogUtil.logInfo(logger, getClusterEventId(), String.format( "END: ResourceControllerDataProvider.refresh() for cluster %s, started at %d took %d for %s pipeline", getClusterName(), startTime, System.currentTimeMillis() - startTime, getPipelineName())); dumpDebugInfo(); }
Source:
public Future<Void> refreshToken() { return (Future<Void>) executor.submit(new Runnable() { @Override public void run() { try { receiveTokenFromKeycloak("grant_type=refresh_token&refresh_token=" + connectResult.getRefresh_token() + "&client_id=" + appName); } catch (IOException e) { throw new DolphinRuntimeException("Error in security", e); } } }); }

Target:
public Future<Void> refreshToken() { return (Future<Void>) executor.submit(() -> { try { receiveTokenFromKeycloak("grant_type=refresh_token&refresh_token=" + connectResult.getRefresh_token() + "&client_id=" + appName); } catch (IOException e) { throw new DolphinRuntimeException("Error in security", e); } }); }
Source:
private static boolean checkOperand(Expression operand, IsExpression isExpr, SubscriptionContext ctx) { Optional<List<Tree>> secondariesOpt = findIssueForOperand(operand); secondariesOpt.ifPresent(secondaryPositions -> { Token notToken = isExpr.notToken(); PreciseIssue preciseIssue = notToken == null ? ctx.addIssue(isExpr.operator(), MESSAGE_IS) : ctx.addIssue(isExpr.operator(), notToken, MESSAGE_IS_NOT); for (Tree secondary : secondaryPositions) { preciseIssue.secondary(secondary, MESSAGE_SECONDARY); } }); return secondariesOpt.isPresent(); }

Target:
private static boolean checkOperand(Expression operand, IsExpression isExpr, SubscriptionContext ctx) { Optional<List<Tree>> secondariesOpt = findIssueForOperand(operand); secondariesOpt.ifPresent(secondaryLocations -> { Token notToken = isExpr.notToken(); PreciseIssue preciseIssue = notToken == null ? ctx.addIssue(isExpr.operator(), MESSAGE_IS) : ctx.addIssue(isExpr.operator(), notToken, MESSAGE_IS_NOT); for (Tree secondary : secondaryLocations) { preciseIssue.secondary(secondary, MESSAGE_SECONDARY); } }); return secondariesOpt.isPresent(); }