auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void handleMaxRetriesExceeded(ExecutionCompletedEvent<HermesResponse> event) { if (event.getResult().isSuccess()) { return; } HermesMessage message = event.getResult().getHermesMessage(); if (shouldPublishMetrics()) { String prefix = MetricsUtils.getMetricsPrefix(message.getTopic()); metrics.counter(prefix + ".failure.unsent").inc(); } LOGGER.error(MessageFormat.format("Failed to send message to topic {0} after {1} attempts", message.getTopic(), event.getAttemptCount())); }

Target:
private void handleMaxRetriesExceeded(ExecutionCompletedEvent<HermesResponse> event) { if (event.getResult().isSuccess()) { return; } HermesMessage message = event.getResult().getHermesMessage(); messageDeliveryListeners.forEach(l -> l.onMaxRetriesExceeded(message, event.getAttemptCount())); logger.error("Failed to send message to topic after attempts", message.getTopic(), event.getAttemptCount()); }
Source:
private Map<ICompilationUnit, ArrayList<IType>> createAffectedTypesMap(final IProgressMonitor monitor) throws JavaModelException { if ((!fCreateMethodStubs || (getAbstractMethods().length <= 0))) return new HashMap<>(0); final Set<IType> affected= getAffectedSubTypes(getDestinationTypeHierarchy(monitor), getDestinationType()); final Map<ICompilationUnit, ArrayList<IType>> result= new HashMap<>(); for (IType type : affected) { final ICompilationUnit unit= type.getCompilationUnit(); if (!result.containsKey(unit)) result.put(unit, new ArrayList<IType>(1)); result.get(unit).add(type); } return result; }

Target:
private Map<ICompilationUnit, ArrayList<IType>> createAffectedTypesMap(final IProgressMonitor monitor) throws JavaModelException { if (!fCreateMethodStubs || (getAbstractMethods().length <= 0)) return new HashMap<>(0); final Set<IType> affected= getAffectedSubTypes(getDestinationTypeHierarchy(monitor), getDestinationType()); final Map<ICompilationUnit, ArrayList<IType>> result= new HashMap<>(); for (IType type : affected) { final ICompilationUnit unit= type.getCompilationUnit(); if (!result.containsKey(unit)) result.put(unit, new ArrayList<IType>(1)); result.get(unit).add(type); } return result; }
Source:
private void checkCurrentTaskState() throws ExecutionException, InterruptedException, TimeoutException { List<ListenableFuture<?>> futures = Lists.newArrayList(); Iterator<Map.Entry<Integer, TaskGroup>> iTaskGroups = taskGroups.entrySet().iterator(); while (iTaskGroups.hasNext()) { Map.Entry<Integer, TaskGroup> taskGroupEntry = iTaskGroups.next(); Integer groupId = taskGroupEntry.getKey(); TaskGroup taskGroup = taskGroupEntry.getValue(); log.debug("Task group [%d] pre-pruning: %s", groupId, taskGroup.taskIds()); Iterator<Map.Entry<String, TaskData>> iTasks = taskGroup.tasks.entrySet().iterator(); while (iTasks.hasNext()) { Map.Entry<String, TaskData> task = iTasks.next(); String taskId = task.getKey(); TaskData taskData = task.getValue(); if (!isTaskCurrent(groupId, taskId)) { log.info("Stopping task [%s] which does not match the expected offset range and ingestion spec", taskId); futures.add(stopTask(taskId, false)); iTasks.remove(); continue; } Preconditions.checkNotNull(taskData.status, "task[%s] has a null status", taskId); if (taskData.status.isFailure()) { iTasks.remove(); continue; } if (taskData.status.isSuccess()) { futures.add(stopTasksInGroup(taskGroup)); iTaskGroups.remove(); break; } } log.debug("Task group [%d] post-pruning: %s", groupId, taskGroup.taskIds()); } Futures.successfulAsList(futures).get(futureTimeoutInSeconds, TimeUnit.SECONDS); }

Target:
private void checkCurrentTaskState() throws ExecutionException, InterruptedException, TimeoutException { List<ListenableFuture<?>> futures = Lists.newArrayList(); Iterator<Map.Entry<Integer, TaskGroup>> iTaskGroups = taskGroups.entrySet().iterator(); while (iTaskGroups.hasNext()) { Map.Entry<Integer, TaskGroup> taskGroupEntry = iTaskGroups.next(); Integer groupId = taskGroupEntry.getKey(); TaskGroup taskGroup = taskGroupEntry.getValue(); log.debug("Task group [%d] pre-pruning: %s", groupId, taskGroup.taskIds()); Iterator<Map.Entry<String, TaskData>> iTasks = taskGroup.tasks.entrySet().iterator(); while (iTasks.hasNext()) { Map.Entry<String, TaskData> task = iTasks.next(); String taskId = task.getKey(); TaskData taskData = task.getValue(); if (!isTaskCurrent(groupId, taskId)) { log.info("Stopping task [%s] which does not match the expected offset range and ingestion spec", taskId); futures.add(stopTask(taskId, false)); iTasks.remove(); continue; } Preconditions.checkNotNull(taskData.status, "WTH? task[%s] has a null status", taskId); if (taskData.status.isFailure()) { iTasks.remove(); continue; } if (taskData.status.isSuccess()) { futures.add(stopTasksInGroup(taskGroup)); iTaskGroups.remove(); break; } } log.debug("Task group [%d] post-pruning: %s", groupId, taskGroup.taskIds()); } Futures.successfulAsList(futures).get(futureTimeoutInSeconds, TimeUnit.SECONDS); }
Source:
protected View getView() { EditPart host = getHost(); if (host == null) { return null; } Object hostView = host.getModel(); if (hostView instanceof View) { if (((View) getHost().getModel()) instanceof View) { return (View) ((View) getHost().getModel()); } return null; } return null; }

Target:
protected View getView() { EditPart host = getHost(); if (host == null) { return null; } Object hostView = host.getModel(); if (hostView instanceof View) { return (View) hostView; } return null; }
Source:
private String convertLegacySyntaxToBooleanFormula(String input) throws OptionsParsingException { return input.replaceAll(" *, *", " or ").replace("-", " not ").trim(); }

Target:
private String convertLegacySyntaxToBooleanFormula(String input) throws OptionsParsingException { return input.replaceAll(" *, *-", " and not ") .replaceAll(" *, *", " or ") .replace("-", " not ").trim(); }
Source:
public void respondWithGetAllRefunds(String transactionId, RefundTransactionFromLedgerFixture... refunds) { JsonStringBuilder jsonStringBuilder = new JsonStringBuilder() .add("parent_transaction_id", transactionId) .add("transactions", refunds); System.out.println(jsonStringBuilder.build()); ledgerMock.stubFor(get(urlPathEqualTo(format("/v1/transaction/%s/transaction", transactionId))) .willReturn(aResponse() .withStatus(OK_200) .withHeader(CONTENT_TYPE, APPLICATION_JSON) .withBody(jsonStringBuilder.build()))); }

Target:
public void respondWithGetAllRefunds(String transactionId, RefundTransactionFromLedgerFixture... refunds) { JsonStringBuilder jsonStringBuilder = new JsonStringBuilder() .add("parent_transaction_id", transactionId) .add("transactions", refunds); ledgerMock.stubFor(get(urlPathEqualTo(format("/v1/transaction/%s/transaction", transactionId))) .willReturn(aResponse() .withStatus(OK_200) .withHeader(CONTENT_TYPE, APPLICATION_JSON) .withBody(jsonStringBuilder.build()))); }
Source:
public void testDateExpressions() throws Exception { Calendar cal = Calendar.getInstance(); cal.set(1974, Calendar.APRIL, 20); exchange.getIn().setHeader("birthday", cal.getTime()); assertExpression("date:header.birthday", cal.getTime()); assertExpression("date:header.birthday:yyyyMMdd", "19740420"); assertExpression("date:header.birthday+24h:yyyyMMdd", "19740421"); }

Target:
public void testDateExpressions() throws Exception { Calendar cal = Calendar.getInstance(); cal.set(1974, Calendar.APRIL, 20); exchange.getIn().setHeader("birthday", cal.getTime()); assertExpression("date:header.birthday", cal.getTime()); assertExpression("date:header.birthday:yyyyMMdd", "19740420"); assertExpression("date:header.birthday+24h:yyyyMMdd", "19740421"); try { assertExpression("date:yyyyMMdd", "19740420"); fail("Should thrown an exception"); } catch (IllegalArgumentException e) { assertEquals("Command not supported for dateExpression: yyyyMMdd", e.getMessage()); } }
Source:
private void drop(ConglomerateDescriptor cd, TableDescriptor td, DataDictionary dd, LanguageConnectionContext lcc) throws StandardException { SpliceTransactionManager userTxnManager = (SpliceTransactionManager)lcc.getTransactionExecute(); dd.dropConglomerateDescriptor(cd,userTxnManager); td.removeConglomerateDescriptor(cd); dd.deletePartitionStatistics(cd.getConglomerateNumber(), userTxnManager); }

Target:
private void drop(ConglomerateDescriptor cd, TableDescriptor td, DataDictionary dd, LanguageConnectionContext lcc) throws StandardException { SpliceTransactionManager userTxnManager = (SpliceTransactionManager)lcc.getTransactionExecute(); dd.dropConglomerateDescriptor(cd,userTxnManager); td.removeConglomerateDescriptor(cd); dd.deletePartitionStatistics(cd.getConglomerateNumber(), userTxnManager); List<TableDescriptor> tds = Collections.singletonList(td); DDLMessage.DDLChange ddlChange = ProtoUtil.alterStats(userTxnManager.getActiveStateTxn().getTxnId(), tds); userTxnManager.prepareDataDictionaryChange(DDLUtils.notifyMetadataChange(ddlChange)); }
Source:
public PushResponse push(PushRequest request) throws GitException, UnauthorizedException { String remoteName = request.getRemote(); String remoteUri = getRepository().getConfig().getString(ConfigConstants.CONFIG_REMOTE_SECTION, remoteName, ConfigConstants.CONFIG_KEY_URL); PushResult pushResult = null; String currentBranch = getCurrentBranch(); try { PushCommand pushCommand = getGit().push(); if (request.getRemote() != null) { pushCommand.setRemote(remoteName); } List<String> refSpec = request.getRefSpec(); if (refSpec != null && refSpec.size() > 0) { List<RefSpec> refSpecInst = new ArrayList<>(refSpec.size()); refSpecInst.addAll(refSpec.stream().map(RefSpec::new).collect(Collectors.toList())); pushCommand.setRefSpecs(refSpecInst); } pushCommand.setForce(request.isForce()); int timeout = request.getTimeout(); if (timeout > 0) { pushCommand.setTimeout(timeout); } Iterable<PushResult> list = (Iterable<PushResult>)executeRemoteCommand(remoteUri, pushCommand); pushResult = list.iterator().next(); } catch (GitAPIException exception) { PushResponse jGitPushResponse = new JGitPushResponse(true); return jGitPushResponse.withCommandOutput(exception.getMessage()); } return new JGitPushResponse(request, pushResult, currentBranch); }

Target:
public PushResponse push(PushRequest request) throws GitException, UnauthorizedException { String remoteName = request.getRemote(); String remoteUri = getRepository().getConfig().getString(ConfigConstants.CONFIG_REMOTE_SECTION, remoteName, ConfigConstants.CONFIG_KEY_URL); PushResponse pushResponseDto = newDto(PushResponse.class); try { PushCommand pushCommand = getGit().push(); if (request.getRemote() != null) { pushCommand.setRemote(remoteName); } List<String> refSpec = request.getRefSpec(); if (!refSpec.isEmpty()) { List<RefSpec> refSpecInst = new ArrayList<>(refSpec.size()); refSpecInst.addAll(refSpec.stream().map(RefSpec::new).collect(Collectors.toList())); pushCommand.setRefSpecs(refSpecInst); } pushCommand.setForce(request.isForce()); int timeout = request.getTimeout(); if (timeout > 0) { pushCommand.setTimeout(timeout); } @SuppressWarnings("unchecked") Iterable<PushResult> pushResults = (Iterable<PushResult>)executeRemoteCommand(remoteUri, pushCommand); PushResult pushResult = pushResults.iterator().next(); return addCommandOutputUpdates(pushResponseDto, request, pushResult); } catch (GitAPIException exception) { if ("origin: not found.".equals(exception.getMessage())) { throw new GitException(ERROR_NO_REMOTE_REPOSITORY, exception); } else { throw new GitException(exception.getMessage(), exception); } } }
Source:
public void MultiPlayerGameUIController() { }

Target:
public void MultiPlayerGameUIController() { Logger.getInstance().log("Created MultiPlayerGameUI Objec", LogEvent.Type.DEBUG); }
Source:
public int compareTo(Vector2d v) { checkNotNull(v); return 0; }

Target:
public int compareTo(Vector2d v) { checkNotNull(v); return (int) Math.signum(lengthSquared() - v.lengthSquared()); }
Source:
public List<QuotaTariffVO> listAllTariffPlans(final Date effectiveDate) { final short opendb = TransactionLegacy.currentTxn().getDatabaseId(); List<QuotaTariffVO> tariffs = new ArrayList<QuotaTariffVO>(); try (TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.USAGE_DB)) { final Filter filter = new Filter(QuotaTariffVO.class, "effectiveOn", false, 0L, 1L); final SearchCriteria<QuotaTariffVO> sc = listAllIncludedUsageType.create(); sc.setParameters("onorbefore", effectiveDate); for (Integer quotaType : QuotaTypes.listQuotaTypes().keySet()) { sc.setParameters("quotatype", quotaType); List<QuotaTariffVO> result = search(sc, filter); if (result.size() > 0) { tariffs.add(result.get(0)); s_logger.info("listAllTariffPlans onorbefore" + effectiveDate + "quota type " + result.get(0).getDescription() + " , effective Date=" + result.get(0).getEffectiveOn() + " val=" + result.get(0).getCurrencyValue()); } } } catch (Exception e) { throw new CloudRuntimeException("Unable to list all tariff plans"); } finally { TransactionLegacy.open(opendb).close(); } return tariffs; }

Target:
public List<QuotaTariffVO> listAllTariffPlans(final Date effectiveDate) { return Transaction.execute(TransactionLegacy.USAGE_DB, new TransactionCallback<List<QuotaTariffVO>>() { @Override public List<QuotaTariffVO> doInTransaction(final TransactionStatus status) { List<QuotaTariffVO> tariffs = new ArrayList<QuotaTariffVO>(); final Filter filter = new Filter(QuotaTariffVO.class, "updatedOn", false, 0L, 1L); final SearchCriteria<QuotaTariffVO> sc = listAllIncludedUsageType.create(); sc.setParameters("onorbefore", effectiveDate); for (Integer quotaType : QuotaTypes.listQuotaTypes().keySet()) { sc.setParameters("quotatype", quotaType); List<QuotaTariffVO> result = search(sc, filter); if (result != null && !result.isEmpty()) { tariffs.add(result.get(0)); if (s_logger.isDebugEnabled()) { s_logger.debug("ListAllTariffPlans on or before " + effectiveDate + " quota type " + result.get(0).getDescription() + " , effective Date=" + result.get(0).getEffectiveOn() + " val=" + result.get(0).getCurrencyValue()); } } } return tariffs; } }); }
Source:
public void testReplicateSkipCacheLoad(Method m) { final AdvancedCache<String, String> cache1 = advancedCache(0, cacheName); final AdvancedCache<String, String> cache2 = advancedCache(1, cacheName); assertLoadsAndReset(cache1, 0, cache2, 0); final String v = v(m, 1); final String k = k(m, 1); cache1.withFlags(Flag.SKIP_CACHE_LOAD).put(k, v); Address primaryLocation = cache1.getDistributionManager().getPrimaryLocation(k); AdvancedCache<String, String> primary, backup; if (primaryLocation.equals(cache1.getRpcManager().getAddress())) { primary = cache1; backup = cache2; } else { assertEquals(cache2.getRpcManager().getAddress(), primaryLocation); primary = cache2; backup = cache1; } assertLoadsAndReset(primary, isTxCache() ? 1 : 0, backup, 0); assertCacheValue(cache2, k, v); assertLoadsAndReset(cache1, 0, cache2, 0); }

Target:
public void testReplicateSkipCacheLoad(Method m) { final AdvancedCache<MagicKey, String> cache1 = advancedCache(0, cacheName); final AdvancedCache<MagicKey, String> cache2 = advancedCache(1, cacheName); assertLoadsAndReset(cache1, 0, cache2, 0); final String v = v(m, 1); final MagicKey k = new MagicKey(k(m, 1), cache1); cache1.withFlags(Flag.SKIP_CACHE_LOAD).put(k, v); assertLoadsAndReset(cache1, isTxCache() ? 1 : 0, cache2, 0); assertCacheValue(cache2, k, v); assertLoadsAndReset(cache1, 0, cache2, 0); }
Source:
public void run( Parameters params, TopNResultBuilder resultBuilder, DimValSelector dimValSelector ) { boolean hasDimValSelector = (dimValSelector != null); final int cardinality = params.getCardinality(); int numProcessed = 0; while (numProcessed < cardinality) { int numToProcess = Math.min(params.getNumValuesPerPass(), cardinality - numProcessed); DimValSelector theDimValSelector; if (!hasDimValSelector) { theDimValSelector = makeDimValSelector(params, numProcessed, numToProcess); } else { numToProcess = computeNewLength(dimValSelector, numProcessed, numToProcess); theDimValSelector = updateDimValSelector(dimValSelector, numProcessed, numToProcess); } DimValAggregateStore aggregatesStore = makeDimValAggregateStore(params); scanAndAggregate(params, theDimValSelector, aggregatesStore, numProcessed); updateResults(params, theDimValSelector, aggregatesStore, resultBuilder); closeAggregators(aggregatesStore); numProcessed += numToProcess; params.getCursor().reset(); } }

Target:
public void run( Parameters params, TopNResultBuilder resultBuilder, DimValSelector dimValSelector ) { boolean hasDimValSelector = (dimValSelector != null); final int cardinality = params.getCardinality(); int numProcessed = 0; while (numProcessed < cardinality) { final int numToProcess; int maxNumToProcess = Math.min(params.getNumValuesPerPass(), cardinality - numProcessed); DimValSelector theDimValSelector; if (!hasDimValSelector) { numToProcess = maxNumToProcess; theDimValSelector = makeDimValSelector(params, numProcessed, numToProcess); } else { numToProcess = computeNewLength(dimValSelector, numProcessed, maxNumToProcess); theDimValSelector = updateDimValSelector(dimValSelector, numProcessed, numToProcess); } DimValAggregateStore aggregatesStore = makeDimValAggregateStore(params); scanAndAggregate(params, theDimValSelector, aggregatesStore, numProcessed); updateResults(params, theDimValSelector, aggregatesStore, resultBuilder); closeAggregators(aggregatesStore); numProcessed += numToProcess; params.getCursor().reset(); } }
Source:
public RestView<TopLevelResource> list() { return null; }

Target:
public RestView<TopLevelResource> list() throws ResourceNotFoundException { throw new ResourceNotFoundException(); }
Source:
public void validateParameter(String parameterName, ModelNode value) throws OperationFailedException { super.validateParameter(parameterName, value); if (value.isDefined()) { try { Charset hashCharset = Charset.forName(value.asString()); } catch (IllegalCharsetNameException e) { throw ControllerLogger.ROOT_LOGGER.illegalCharsetName(value.asString()); } catch (UnsupportedCharsetException e) { throw new OperationFailedException(ControllerLogger.ROOT_LOGGER.unsupportedCharset(value.asString())); } } }

Target:
public void validateParameter(String parameterName, ModelNode value) throws OperationFailedException { super.validateParameter(parameterName, value); if (value.isDefined()) { try { Charset hashCharset = Charset.forName(value.asString()); } catch (IllegalCharsetNameException e) { throw ControllerLogger.ROOT_LOGGER.illegalCharsetName(value.asString()); } catch (UnsupportedCharsetException e) { throw ControllerLogger.ROOT_LOGGER.unsupportedCharset(value.asString()); } } }
Source:
public void completion2() throws Exception { FreeStyleProject foo = j.createFreeStyleProject("foo"); MatrixProject bar = j.jenkins.createProject(MatrixProject.class, "bar"); bar.setAxes(new AxisList(new TextAxis("x","1","2","3"))); MatrixConfiguration x3 = bar.getItem("x=3"); AutoCompletionCandidates c; c = AutoCompletionCandidates.ofJobNames("", j.jenkins); assertContains(c, "foo", "bar", "bar/x=1", "bar/x=2", "bar/x=3"); c = AutoCompletionCandidates.ofJobNames("ba", j.jenkins); assertContains(c, "bar", "bar/x=1", "bar/x=2", "bar/x=3"); c = AutoCompletionCandidates.ofJobNames("bar/", j.jenkins); assertContains(c, "bar/x=1", "bar/x=2", "bar/x=3"); c = AutoCompletionCandidates.ofJobNames( "", x3.getParent()); assertContains(c, "../foo", "../bar", "x=1", "x=2", "x=3"); c = AutoCompletionCandidates.ofJobNames(Item.class, "../", x3, x3.getParent()); assertContains(c, "../bar", "../foo"); }

Target:
public void completion2() throws Exception { FreeStyleProject foo = j.createFreeStyleProject("foo"); MatrixProject bar = j.jenkins.createProject(MatrixProject.class, "bar"); bar.setAxes(new AxisList(new TextAxis("x","1","2","3"))); MatrixConfiguration x3 = bar.getItem("x=3"); AutoCompletionCandidates c; c = AutoCompletionCandidates.ofJobNames("", j.jenkins); assertContains(c, "foo", "bar", "bar/x=1", "bar/x=2", "bar/x=3"); c = AutoCompletionCandidates.ofJobNames("ba", j.jenkins); assertContains(c, "bar", "bar/x=1", "bar/x=2", "bar/x=3"); c = AutoCompletionCandidates.ofJobNames("bar/", j.jenkins); assertContains(c, "bar/x=1", "bar/x=2", "bar/x=3"); c = AutoCompletionCandidates.ofJobNames("", x3.getParent()); assertContains(c, "../foo", "../bar", "x=1", "x=2", "x=3"); c = AutoCompletionCandidates.ofJobNames("../", x3.getParent()); assertContains(c, "../bar", "../foo"); }
Source:
public void updateCameraBearing(float bearing) { return; }

Target:
public void updateCameraBearing(float bearing) { final BaiduMap map = getBaiduMap(); if (map == null) return; final MapStatus.Builder camera = new MapStatus.Builder(map.getMapStatus()); camera.rotate(bearing); map.animateMapStatus(MapStatusUpdateFactory.newMapStatus(camera.build())); }
Source:
public void compileTest() { CompilationRequest req = new DefaultCompilationRequest(mavenRepo.toAbsolutePath().toString(), info, new String[]{ MavenCLIArgs.INSTALL, MavenCLIArgs.ALTERNATE_USER_SETTINGS + alternateSettingsAbsPath }, Boolean.FALSE); ClasspathDepsAfterDecorator decorator = new ClasspathDepsAfterDecorator(new BaseMavenCompiler()); CompilationResponse res = decorator.compile(req); SoftAssertions.assertSoftly(softly -> { softly.assertThat(res.isSuccessful()).isTrue(); softly.assertThat(res.getDependencies().size()).isEqualTo(4); }); }

Target:
public void compileTest() { CompilationRequest req = new DefaultCompilationRequest(mavenRepo.toAbsolutePath().toString(), info, new String[]{ MavenCLIArgs.INSTALL, MavenCLIArgs.ALTERNATE_USER_SETTINGS + alternateSettingsAbsPath }, Boolean.FALSE); ClasspathDepsAfterDecorator decorator = new ClasspathDepsAfterDecorator(new BaseMavenCompiler()); CompilationResponse res = decorator.compile(req); SoftAssertions.assertSoftly(softly -> { softly.assertThat(res.isSuccessful()).isTrue(); softly.assertThat(res.getDependencies()).hasSize(4); }); }
Source:
private boolean hostEmulationModeMatchesTheConfigValues(VDS vds) { String matchedEmulatedMachine = ListUtils.firstMatch( Config.<List<String>> getValue(ConfigValues.ClusterEmulatedMachines, vds.getVdsGroupCompatibilityVersion().getValue()), vds.getSupportedEmulatedMachines().split(",")); if (matchedEmulatedMachine != null && !matchedEmulatedMachine.isEmpty() && vds.getStatus() != VDSStatus.NonOperational) { setClusterEmulatedMachine(vds, matchedEmulatedMachine); return true; } return false; }

Target:
private boolean hostEmulationModeMatchesTheConfigValues(VDS vds) { String matchedEmulatedMachine = ListUtils.firstMatch( Config.<List<String>> getValue(ConfigValues.ClusterEmulatedMachines, vds.getVdsGroupCompatibilityVersion().getValue()), vds.getSupportedEmulatedMachines().split(",")); boolean isValidStatus = (vds.getStatus() == VDSStatus.Up || vds.getStatus() == VDSStatus.Maintenance); if (matchedEmulatedMachine != null && !matchedEmulatedMachine.isEmpty() && isValidStatus) { setClusterEmulatedMachine(vds, matchedEmulatedMachine); return true; } return false; }
Source:
private void refreshNotifications() { list.setVisibility(View.GONE); getPageAndNext(1).subscribe(new Observer<Page<NotificationThread>>() { List<NotificationThread> threads = new ArrayList<>(); @Override public void onSubscribe(Disposable d) { progressBar.setVisibility(View.VISIBLE); } @Override public void onNext(Page<NotificationThread> notificationThreadPage) { threads.addAll(notificationThreadPage.items()); } @Override public void onError(Throwable e) { ToastUtils.show(getActivity(), R.string.error_notifications_load); } @Override public void onComplete() { adapter.setItems(threads); progressBar.setVisibility(View.GONE); list.setVisibility(View.VISIBLE); emptyText.setVisibility(threads.size() == 0 ? View.VISIBLE : View.GONE); refreshLayout.setRefreshing(false); } }); }

Target:
private void refreshNotifications() { list.setVisibility(View.GONE); progressBar.setVisibility(View.VISIBLE); getPageAndNext(1) .flatMap(page -> Observable.fromIterable(page.items())) .toList() .subscribe(threads -> { adapter.setItems(threads); progressBar.setVisibility(View.GONE); list.setVisibility(View.VISIBLE); emptyText.setVisibility(threads.size() == 0 ? View.VISIBLE : View.GONE); refreshLayout.setRefreshing(false); }, e -> ToastUtils.show(getActivity(), R.string.error_notifications_load)); }
Source:
public void testListSecurityGroups() { HttpRequest list = HttpRequest.builder().method("GET").endpoint( URI.create("<LINK_0>")).headers( ImmutableMultimap.<String, String> builder().put("Accept", "application/json").put("X-Auth-Token", authToken).build()).build(); HttpResponse listResponse = HttpResponse.builder().statusCode(200).payload( payloadFromResource("/securitygroup_list.json")).build(); Builder<HttpRequest, HttpResponse> requestResponseMap = ImmutableMap.<HttpRequest, HttpResponse> builder(); requestResponseMap.put(keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess); requestResponseMap.put(extensionsOfNovaRequest, extensionsOfNovaResponse); requestResponseMap.put(list, listResponse).build(); SecurityGroupExtension extension = requestsSendResponses(requestResponseMap.build()).getSecurityGroupExtension().get(); Set<SecurityGroup> groups = extension.listSecurityGroups(); assertEquals(1, groups.size()); }

Target:
public void testListSecurityGroups() { HttpRequest list = HttpRequest.builder().method("GET").endpoint( URI.create("<LINK_0>")).headers( ImmutableMultimap.<String, String> builder().put("Accept", "application/json").put("X-Auth-Token", authToken).build()).build(); HttpResponse listResponse = HttpResponse.builder().statusCode(200).payload( payloadFromResource("/securitygroup_list.json")).build(); Builder<HttpRequest, HttpResponse> requestResponseMap = ImmutableMap.<HttpRequest, HttpResponse> builder(); requestResponseMap.put(keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess); requestResponseMap.put(extensionsOfNovaRequest, extensionsOfNovaResponse); requestResponseMap.put(list, listResponse).build(); SecurityGroupExtension extension = requestsSendResponses(requestResponseMap.build()).getSecurityGroupExtension().get(); Set<SecurityGroup> groups = extension.listSecurityGroups(); assertEquals(groups.size(), 1); }
Source:
private int iterate() { if (cursor < attributePath.length()) { while (attributePath.charAt(cursor) == '[' || attributePath.charAt(cursor) == '.') { cursor++; } } else { current = null; return -1; } for (int i = cursor; i < attributePath.length(); i++) { switch (attributePath.charAt(i)) { case '.': case '[': return i; case ']': isArray = true; return i; default: } } return attributePath.length(); }

Target:
private int iterate() { if (cursor < attributePath.length()) { try { while (attributePath.charAt(cursor) == '[' || attributePath.charAt(cursor) == '.') { cursor++; } } catch (IndexOutOfBoundsException e) { throw createIllegalArgumentException(); } } else { current = null; return -1; } for (int i = cursor; i < attributePath.length(); i++) { switch (attributePath.charAt(i)) { case '.': case '[': return i; case ']': isArray = true; return i; default: } } return attributePath.length(); }
Source:
public void start() { statsAggregator = scheduler.scheduleAtFixedRate(new StatsAggregator(), 0, publishPeriodInSecs, TimeUnit.SECONDS); }

Target:
public void start() { scheduler = Utils.newScheduler(1, false); statsAggregator = new StatsAggregator(); scheduler.scheduleAtFixedRate(statsAggregator, ThreadLocalRandom.current().nextInt(540) + 60, publishPeriodInSecs, TimeUnit.SECONDS); }
Source:
public void testClientDiscoveryNodesLeave() throws Exception { startGrids(MAX_CLUSTER_SIZE); awaitPartitionMapExchange(); initClient(getClientConfigurationWithDiscovery(), 0, 1, 2, 3); detectTopologyChange(); for (int i = MAX_CLUSTER_SIZE - 1; i != 0; i--) { int[] workChannels = IntStream.range(0, i).toArray(); channels[i] = null; stopGrid(i); awaitPartitionMapExchange(); detectTopologyChange(); awaitChannelsInit(workChannels); testPartitionAwareness(workChannels); } }

Target:
public void testClientDiscoveryNodesLeave() throws Exception { startGrids(MAX_CLUSTER_SIZE); awaitPartitionMapExchange(); initClient(getClientConfigurationWithDiscovery(), 0, 1, 2, 3); detectTopologyChange(); for (int i = MAX_CLUSTER_SIZE - 1; i != 0; i--) { int[] workChannels = IntStream.range(0, i).toArray(); channels[i] = null; stopGrid(i); awaitPartitionMapExchange(); detectTopologyChange(); testPartitionAwareness(workChannels); } }
Source:
private boolean addGitHubCommitters(Channel channel, User sender, List<String> collaborators, String justForThisRepo) { if (!isSenderAuthorized(channel,sender)) { insufficientPermissionError(channel); return false; } OutputChannel out = channel.send(); if (justForThisRepo == null) { out.message("I'm not longer managing the Everyone team. Please add committers to specific repos."); return false; } int passCount = 0; try { GitHub github = GitHub.connect(); GHOrganization o = github.getOrganization(IrcBotConfig.GITHUB_ORGANIZATION); GHRepository forThisRepo = o.getRepository(justForThisRepo); if (forThisRepo == null) { out.message("Could not find repository: " + justForThisRepo); return false; } for (String collaborator : collaborators) { try { GHUser c = github.getUser(collaborator); final GHTeam t; t = getOrCreateRepoLocalTeam(o, forThisRepo); if (t == null) { out.message("No team for " + justForThisRepo); continue; } t.add(c); out.message("Added "+collaborator+" as a GitHub committer for repository "+justForThisRepo); passCount++; } catch (IOException e) { out.message("Failed to add user '" + collaborator + "' to team: " + e.getMessage()); } } } catch(IOException e) { out.message("Error communicating with GitHub: "+e.getMessage()); } return passCount == collaborators.size(); }

Target:
private boolean addGitHubCommitters(Channel channel, User sender, List<String> collaborators, String justForThisRepo) { if (!isSenderAuthorized(channel,sender)) { insufficientPermissionError(channel); return false; } OutputChannel out = channel.send(); if (justForThisRepo == null) { out.message("I'm no longer managing the Everyone team. Please add committers to specific repos."); return false; } int passCount = 0; try { GitHub github = GitHub.connect(); GHOrganization o = github.getOrganization(IrcBotConfig.GITHUB_ORGANIZATION); GHRepository forThisRepo = o.getRepository(justForThisRepo); if (forThisRepo == null) { out.message("Could not find repository: " + justForThisRepo); return false; } for (String collaborator : collaborators) { try { GHUser c = github.getUser(collaborator); final GHTeam t; t = getOrCreateRepoLocalTeam(o, forThisRepo); if (t == null) { out.message("No team for " + justForThisRepo); continue; } t.add(c); out.message("Added "+collaborator+" as a GitHub committer for repository "+justForThisRepo); passCount++; } catch (IOException e) { out.message("Failed to add user '" + collaborator + "' to team: " + e.getMessage()); } } } catch(IOException e) { out.message("Error communicating with GitHub: "+e.getMessage()); } return passCount == collaborators.size(); }
Source:
private void writeResponse( Exchange exchange, Object response ) { if (response instanceof ServiceResponse ) { ServiceResponse serviceResponse = (ServiceResponse) response; Message message = getResultMessage(exchange); message.setBody( serviceResponse.getResult() ); message.setHeader( KIE_HEADERS_PREFIX + "response.type", serviceResponse.getType() ); message.setHeader( KIE_HEADERS_PREFIX + "response.message", serviceResponse.getMsg() ); } else { getResultMessage(exchange).setBody( response ); } }

Target:
private void writeResponse( Exchange exchange, Object response ) { if (response instanceof ServiceResponse ) { ServiceResponse serviceResponse = (ServiceResponse) response; Message message = getResultMessage(exchange); message.setBody( serviceResponse.getResult() ); message.setHeader( RESPONSE_TYPE, serviceResponse.getType() ); message.setHeader( RESPONSE_MESSAGE, serviceResponse.getMsg() ); } else { getResultMessage(exchange).setBody( response ); } }
Source:
public SpongeMod() { super(new ModMetadata()); ModContainerFactory.instance().registerContainerType(Type.getType(Plugin.class), SpongePluginContainer.class); this.getMetadata().name = "SpongeAPIMod"; this.getMetadata().modId = "SpongeAPIMod"; SpongeMod.instance = this; this.game = new SpongeGame(); }

Target:
public SpongeMod() { super(new ModMetadata()); ModContainerFactory.instance().registerContainerType(Type.getType(Plugin.class), SpongePluginContainer.class); this.getMetadata().name = "SpongeAPIMod"; this.getMetadata().modId = "SpongeAPIMod"; SpongeMod.instance = this; game = new SpongeGame(); }
Source:
public String getQuestionTypeChoiceOption() { return "<li data-questionType = \"CONTRIB\"><a>" + Const.FeedbackQuestionTypeNames.CONTRIB + "</a></li>"; }

Target:
public String getQuestionTypeChoiceOption() { return "<li data-questiontype = \"CONTRIB\"><a>" + Const.FeedbackQuestionTypeNames.CONTRIB + "</a></li>"; }
Source:
public Properties getProperties() { return new Properties(properties); }

Target:
public Properties getProperties() { return (Properties) properties.clone(); }
Source:
public MambuAPIModule(Protocol protocol, String domain, String username, String password) { this.domain = Preconditions.checkNotNull(domain, "domain cannot be null"); this.username = Preconditions.checkNotNull(username, "username cannot be null"); this.password = Preconditions.checkNotNull(password, "password cannot be null"); this.protocol = Preconditions.checkNotNull(protocol, "protocol cannot be null").name(); }

Target:
public MambuAPIModule(Protocol protocol, String domain, String username, String password) { this.protocol = Preconditions.checkNotNull(protocol, "protocol cannot be null").name(); this.domain = Preconditions.checkNotNull(domain, "domain cannot be null"); this.username = Preconditions.checkNotNull(username, "username cannot be null"); this.password = Preconditions.checkNotNull(password, "password cannot be null"); }
Source:
public void testUnmarshallSubprocessLevelEventEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_START_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); StartMessageEvent emptySubprocess = getStartNodeById(diagram, EMPTY_SUBPROCESS_LEVEL_EVENT_ID, StartMessageEvent.class); assertGeneralSet(emptySubprocess.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertMessageEventExecutionSet(emptySubprocess.getExecutionSet(), EMPTY_VALUE, NON_INTERRUPTING, ""); assertDataIOSet(emptySubprocess.getDataIOSet(), EMPTY_VALUE); }

Target:
public void testUnmarshallSubprocessLevelEventEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_START_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); StartMessageEvent emptySubprocess = getStartNodeById(diagram, EMPTY_SUBPROCESS_LEVEL_EVENT_ID, StartMessageEvent.class); assertGeneralSet(emptySubprocess.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertMessageEventExecutionSet(emptySubprocess.getExecutionSet(), EMPTY_VALUE, NON_INTERRUPTING, EMPTY_VALUE); assertDataIOSet(emptySubprocess.getDataIOSet(), EMPTY_VALUE); }
Source:
public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getUpsertRuntime(IDataSource<String> dataSource, IOperatorSchema inputSchema, IVariableTypeEnvironment typeEnv, List<LogicalVariable> keys, LogicalVariable payLoadVar, List<LogicalVariable> additionalFilterFields, List<LogicalVariable> additionalNonFilteringFields, RecordDescriptor recordDesc, JobGenContext context, JobSpecification jobSpec) throws AlgebricksException { return null; }

Target:
public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getUpsertRuntime(IDataSource<String> dataSource, IOperatorSchema inputSchema, IVariableTypeEnvironment typeEnv, List<LogicalVariable> keys, LogicalVariable payLoadVar, List<LogicalVariable> additionalFilterFields, List<LogicalVariable> additionalNonFilteringFields, RecordDescriptor recordDesc, JobGenContext context, JobSpecification jobSpec) throws AlgebricksException { throw new UnsupportedOperationException(); }
Source:
EventFnRoute(Function<E, I> fn) { checkNotNull(fn); this.fn = (e, ctx) -> fn.apply(e); }

Target:
EventFnRoute(Function<E, I> fn) { this((e, ctx) -> fn.apply(e)); }
Source:
public List<String> getHeaderFiles() { return Collections.unmodifiableList(Arrays.asList("<unistd.h>")); }

Target:
public List<String> getHeaderFiles() { return Collections.unmodifiableList(Collections.singletonList("<unistd.h>")); }
Source:
public void serviceChanged(ServiceEvent event) { ServiceReference serviceRef = event.getServiceReference(); Object service = context.getService(serviceRef); if (service instanceof InjectableAttribute) { int eventType = event.getType(); if (eventType == ServiceEvent.REGISTERED) { registerAttribute(((InjectableAttribute) service).attribute()); } } }

Target:
public void serviceChanged(ServiceEvent event) { ServiceReference serviceRef = event.getServiceReference(); Object service = context.getService(serviceRef); if (service instanceof InjectableAttribute) { if (event.getType() == ServiceEvent.REGISTERED) { registerAttribute(((InjectableAttribute) service).attribute()); } } }
Source:
public void shouldExposeRocksDBMetricsForSegmentedStateStoreBeforeAndAfterFailureWithEmptyStateDir() throws Exception { final Properties streamsConfiguration = streamsConfig(); IntegrationTestUtils.purgeLocalStreamsState(streamsConfiguration); final StreamsBuilder builder = builderForSegmentedStateStore(); final String metricsScope = "rocksdb-window-state-id"; cleanUpStateRunAndVerify( builder, streamsConfiguration, LongDeserializer.class, LongDeserializer.class, this::verifyThatRocksDBMetricsAreExposed, metricsScope ); cleanUpStateRunAndVerify( builder, streamsConfiguration, LongDeserializer.class, LongDeserializer.class, this::verifyThatRocksDBMetricsAreExposed, metricsScope ); }

Target:
public void shouldExposeRocksDBMetricsForSegmentedStateStoreBeforeAndAfterFailureWithEmptyStateDir() throws Exception { final Properties streamsConfiguration = streamsConfig(); IntegrationTestUtils.purgeLocalStreamsState(streamsConfiguration); final StreamsBuilder builder = builderForSegmentedStateStore(); final String metricsScope = "rocksdb-window-state-id"; cleanUpStateRunVerifyAndClose( builder, streamsConfiguration, LongDeserializer.class, LongDeserializer.class, this::verifyThatRocksDBMetricsAreExposed, metricsScope ); cleanUpStateRunVerifyAndClose( builder, streamsConfiguration, LongDeserializer.class, LongDeserializer.class, this::verifyThatRocksDBMetricsAreExposed, metricsScope ); }
Source:
public <R> Observable<R> scalarFlatMap(final Func1<? super T, ? extends Observable<? extends R>> func) { return create(new OnSubscribe<R>() { @Override public void call(final Subscriber<? super R> child) { Observable<? extends R> o = func.call(t); if (o.getClass() == ScalarSynchronousObservable.class) { child.onNext(((ScalarSynchronousObservable<? extends R>)o).t); child.onCompleted(); } else { o.subscribe(new Subscriber<R>(child) { @Override public void onNext(R v) { child.onNext(v); } @Override public void onError(Throwable e) { child.onError(e); } @Override public void onCompleted() { child.onCompleted(); } }); } } }); }

Target:
public <R> Observable<R> scalarFlatMap(final Func1<? super T, ? extends Observable<? extends R>> func) { return create(new OnSubscribe<R>() { @Override public void call(final Subscriber<? super R> child) { Observable<? extends R> o = func.call(t); if (o.getClass() == ScalarSynchronousObservable.class) { child.onNext(((ScalarSynchronousObservable<? extends R>)o).t); child.onCompleted(); } else { o.unsafeSubscribe(new Subscriber<R>(child) { @Override public void onNext(R v) { child.onNext(v); } @Override public void onError(Throwable e) { child.onError(e); } @Override public void onCompleted() { child.onCompleted(); } }); } } }); }
Source:
public void sourceNoLongerAdvertised(AdvertisedDataSource source) { try { for (Pair<OutputStream, InputStream> streams : haplist.values()) { if (m_logger.isDebugEnabled()) { m_logger.debug("Flushing " + streams.getFirst() + " for source " + source); } streams.getFirst().flush(); streams.getFirst().close(); streams.getSecond().close(); } haplist.clear(); } catch (IOException e) { m_logger.error("Failed to close writers for " + source, e); } if (m_es != null) { m_es.shutdown(); try { m_es.awaitTermination(365, TimeUnit.DAYS); } catch (InterruptedException e) { throw new RuntimeException(e); } } }

Target:
public void sourceNoLongerAdvertised(AdvertisedDataSource source) { try { for (Pair<OutputStream, InputStream> streams : haplist.values()) { if (m_logger.isDebugEnabled()) { m_logger.debug("Flushing " + streams.getFirst() + " for source " + source); } try (OutputStream out = streams.getFirst(); InputStream in = streams.getSecond()) { streams.getFirst().flush(); } catch(IOException e) { m_logger.error("Failed to close streams for " + source, e); } } } finally { haplist.clear(); } if (m_es != null) { m_es.shutdown(); try { m_es.awaitTermination(365, TimeUnit.DAYS); } catch (InterruptedException e) { throw new RuntimeException(e); } } }
Source:
public JsonValue getParameters() { return parameters; }

Target:
JsonValue getParameters() { return parameters; }
Source:
private void updateIndex(Page page) { index.addPage(page); if (spillEnabled) { localRevocableMemoryContext.setBytes(index.getEstimatedSize().toBytes()); } else { long currentMemoryUsage = localUserMemoryContext.getBytes(); if (!localUserMemoryContext.trySetBytes(index.getEstimatedSize().toBytes())) { index.compact(); localUserMemoryContext.setBytes(index.getEstimatedSize().toBytes()); } if (enforceBroadcastMemoryLimit) { operatorContext.getDriverContext().getPipelineContext().getTaskContext().getQueryContext() .updateBroadcastMemory(index.getEstimatedSize().toBytes() - currentMemoryUsage); } } operatorContext.recordOutput(page.getSizeInBytes(), page.getPositionCount()); }

Target:
private void updateIndex(Page page) { index.addPage(page); if (spillEnabled) { localRevocableMemoryContext.setBytes(index.getEstimatedSize().toBytes()); } else { if (!localUserMemoryContext.trySetBytes(index.getEstimatedSize().toBytes(), enforceBroadcastMemoryLimit)) { index.compact(); localUserMemoryContext.setBytes(index.getEstimatedSize().toBytes(), enforceBroadcastMemoryLimit); } } operatorContext.recordOutput(page.getSizeInBytes(), page.getPositionCount()); }
Source:
public void distributionTarget(JoinQuery query) { final DataSourceWithSegmentSpec distributionTarget = query.getDistributionTarget(); builder.setDimension( "distributionTarget", distributionTarget == null ? "" : DataSourceUtil.getMetricName(distributionTarget.getDataSource()) ); }

Target:
public void distributionTarget(JoinQuery query) { final DataSourceWithSegmentSpec distributionTarget = query.getDistributionTarget(); Preconditions.checkNotNull(distributionTarget, "distributionTarget"); builder.setDimension( "distributionTarget", DataSourceUtil.getMetricName(distributionTarget.getDataSource()) ); }
Source:
private List<CodeSystemEntry> fetchCodeSystem(ServiceProvider context, String repositoryId) { return CodeSystemRequests.prepareSearchCodeSystem() .all() .build(repositoryId) .execute(context.service(IEventBus.class)) .getSync() .getItems(); }

Target:
private List<CodeSystemEntry> fetchCodeSystem(ServiceProvider context, String repositoryId) { return CodeSystemRequests.prepareSearchCodeSystem() .all() .build(repositoryId) .getRequest() .execute(context) .getItems(); }
Source:
public RemoteTableDescriptor<K, V> withWriteFunction(TableWriteFunction<K, V> writeFn) { Preconditions.checkNotNull(writeFn, "null write function"); this.writeFn = writeFn; this.writeFn.setTableId(String.format("%s.%s", tableId, WRITE_FN)); return this; }

Target:
public RemoteTableDescriptor<K, V> withWriteFunction(TableWriteFunction<K, V> writeFn) { Preconditions.checkNotNull(writeFn, "null write function"); this.writeFn = writeFn; return this; }
Source:
private boolean canCompactTopOfStack(ReftableConfig cfg) throws IOException { ReftableStack stack = refdb.stack(); List<Reftable> readers = stack.readers(); if (readers.isEmpty()) { return false; } int lastIdx = readers.size() - 1; DfsReftable last = stack.files().get(lastIdx); DfsPackDescription desc = last.getPackDescription(); if (desc.getPackSource() != PackSource.INSERT) { return false; } for (PackExt ext : PackExt.values()) { if (ext != REFTABLE && desc.hasFileExt(ext)) { return false; } } Reftable table = readers.get(lastIdx); int bs = cfg.getRefBlockSize(); return table instanceof ReftableReader && ((ReftableReader) table).size() <= 3 * bs; }

Target:
private boolean canCompactTopOfStack(ReftableConfig cfg) throws IOException { ReftableStack stack = refdb.stack(); List<Reftable> readers = stack.readers(); if (readers.isEmpty()) { return false; } int lastIdx = readers.size() - 1; DfsReftable last = stack.files().get(lastIdx); DfsPackDescription desc = last.getPackDescription(); if (desc.getPackSource() != PackSource.INSERT || !packOnlyContainsReftable(desc)) { return false; } Reftable table = readers.get(lastIdx); int bs = cfg.getRefBlockSize(); return table instanceof ReftableReader && ((ReftableReader) table).size() <= 3 * bs; }
Source:
pushLanguageConnectionContextFromActivation(Activation activation, ContextManager cm) throws StandardException { boolean lccPushed = false; try { LanguageConnectionContext currentLCC = ConnectionUtil.getCurrentLCC(); if (activation != null && activation.getLanguageConnectionContext() != null) { LanguageConnectionContext lcc = activation.getLanguageConnectionContext(); if (lcc != currentLCC) { cm.pushContext(activation.getLanguageConnectionContext()); lccPushed = true; } } } catch (SQLException e) { if (activation != null && activation.getLanguageConnectionContext() != null) { lccPushed = true; cm.pushContext(activation.getLanguageConnectionContext()); } } return lccPushed; }

Target:
pushLanguageConnectionContextFromActivation(Activation activation, ContextManager cm) throws StandardException { boolean lccPushed = false; try { LanguageConnectionContext currentLCC = ConnectionUtil.getCurrentLCC(); if (activation != null && activation.getLanguageConnectionContext() != null) { LanguageConnectionContext lcc = activation.getLanguageConnectionContext(); if (lcc != currentLCC) { cm.pushContext(lcc); lccPushed = true; } } } catch (SQLException e) { if (activation != null && activation.getLanguageConnectionContext() != null) { lccPushed = true; cm.pushContext(activation.getLanguageConnectionContext()); } } return lccPushed; }
Source:
public <T> T flopAndFail(String msg) { try { fail(msg); } catch (Throwable t) { asyncErrors.add(t); fail(msg); } return null; }

Target:
public <T> T flopAndFail(String msg) { try { fail(msg); } catch (Throwable t) { asyncErrors.add(t); fail(msg, t); } return null; }
Source:
private URI toURI(IPath path) { URI baseURI = getWorkingDirectoryURI(); String uriString = path.toString(); if (path.isAbsolute() && uriString.charAt(0) != IPath.SEPARATOR) uriString = IPath.SEPARATOR + uriString; return EFSExtensionManager.getDefault().createNewURIFromPath(baseURI, uriString); }

Target:
private URI toURI(IPath path) { URI baseURI = getWorkingDirectoryURI(); String uriString = path.toString(); if (path.isAbsolute() && uriString.charAt(0) != IPath.SEPARATOR) { uriString = IPath.SEPARATOR + uriString; } return EFSExtensionManager.getDefault().createNewURIFromPath(baseURI, uriString); }
Source:
public void setTaskContext(TaskContext taskContext) { id = taskContext.getParameters() .map( p -> p.get( "id" ) ) .map( Integer.class::cast ) .orElseThrow( () -> new RuntimeException( "missing parameter 'id'" ) ); title = taskContext.getParameters() .map( p -> p.get( "title" ) ) .map( String.class::cast ) .orElseThrow( () -> new RuntimeException( "missing parameter 'title'" ) ); }

Target:
public void setTaskContext(TaskContext taskContext) { cache = (Cache<Object, Object>) taskContext.getCache() .orElseThrow( () -> new RuntimeException( "missing cache" ) ); id = taskContext.getParameters() .map( p -> p.get( "id" ) ) .map( Integer.class::cast ) .orElseThrow( () -> new RuntimeException( "missing parameter 'id'" ) ); title = taskContext.getParameters() .map( p -> p.get( "title" ) ) .map( String.class::cast ) .orElseThrow( () -> new RuntimeException( "missing parameter 'title'" ) ); }
Source:
public void setExcludeFirstHeading() { IncludeMacroParameters parameters = new IncludeMacroParameters(); parameters.setExcludeFirstHeading(true); assertSame(true, parameters.excludeFirstHeading()); }

Target:
public void setExcludeFirstHeading() { IncludeMacroParameters parameters = new IncludeMacroParameters(); parameters.setExcludeFirstHeading(true); assertTrue(parameters.isExcludeFirstHeading()); }