idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
544,514
public SNSAction unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>SNSAction sNSAction = new SNSAction();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 2;<NEW_LINE>while (true) {<NEW_LINE><MASK><NEW_LINE>if (xmlEvent == XmlPullParser.END_DOCUMENT)<NEW_LINE>break;<NEW_LINE>if (xmlEvent == XmlPullParser.START_TAG) {<NEW_LINE>if (context.testExpression("TopicArn", targetDepth)) {<NEW_LINE>sNSAction.setTopicArn(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Encoding", targetDepth)) {<NEW_LINE>sNSAction.setEncoding(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent == XmlPullParser.END_TAG) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sNSAction;<NEW_LINE>}
int xmlEvent = context.nextEvent();
364,146
public static boolean stop(final long id, final Context context) {<NEW_LINE>if (null == context) {<NEW_LINE>Log.e(TAG, "context==null");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>synchronized (alarm_waiting_set) {<NEW_LINE>if (null == wakerlock) {<NEW_LINE>wakerlock = new WakerLock(context);<NEW_LINE>Log.i(TAG, "stop new wakerlock");<NEW_LINE>}<NEW_LINE>if (null == bc_alarm) {<NEW_LINE>bc_alarm = new Alarm();<NEW_LINE>IntentFilter filter = new IntentFilter();<NEW_LINE>context.registerReceiver(bc_alarm, filter);<NEW_LINE>Log.i(TAG, "stop new Alarm");<NEW_LINE>}<NEW_LINE>Iterator<Object[]> it = alarm_waiting_set.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Object[] next = it.next();<NEW_LINE>if ((Long) (next[TSetData.ID.ordinal()]) == id) {<NEW_LINE>cancelAlarmMgr(context, (PendingIntent) (next[TSetData.<MASK><NEW_LINE>it.remove();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
PENDINGINTENT.ordinal()]));
183,170
private boolean listVoices() {<NEW_LINE>// list all known voices<NEW_LINE>for (Voice v : Voice.getAvailableVoices()) {<NEW_LINE>if (v instanceof InterpolatingVoice) {<NEW_LINE>// do not list interpolating voice<NEW_LINE>} else if (v instanceof UnitSelectionVoice) {<NEW_LINE>clientOut.println(v.getName() + " " + v.getLocale() + " " + v.gender().toString() + " " + "unitselection" + " " + ((UnitSelectionVoice<MASK><NEW_LINE>} else if (v instanceof HMMVoice) {<NEW_LINE>clientOut.println(v.getName() + " " + v.getLocale() + " " + v.gender().toString() + " " + "hmm");<NEW_LINE>} else {<NEW_LINE>clientOut.println(v.getName() + " " + v.getLocale() + " " + v.gender().toString() + " " + "other");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Empty line marks end of info:<NEW_LINE>clientOut.println();<NEW_LINE>return true;<NEW_LINE>}
) v).getDomain());
1,534,008
private void loadAndEvaluateESRImportFile0(@NonNull final I_ESR_Import esrImport) {<NEW_LINE>final ImmutableList<I_ESR_ImportFile> esrImportFiles = esrImportDAO.retrieveActiveESRImportFiles(esrImport);<NEW_LINE>for (final I_ESR_ImportFile esrImportFile : esrImportFiles) {<NEW_LINE>//<NEW_LINE>// Fetch data to be imported from attachment<NEW_LINE>final AttachmentEntryId attachmentEntryId = AttachmentEntryId.ofRepoIdOrNull(esrImportFile.getAD_AttachmentEntry_ID());<NEW_LINE>final byte[] <MASK><NEW_LINE>// there is no actual data<NEW_LINE>if (data == null || data.length == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ByteArrayInputStream in = new ByteArrayInputStream(data);<NEW_LINE>loadAndEvaluateESRImportStream(esrImportFile, in);<NEW_LINE>}<NEW_LINE>esrImportDAO.validateEsrImport(esrImport);<NEW_LINE>}
data = attachmentEntryService.retrieveData(attachmentEntryId);
1,135,366
static Node[] performPaste(PasteType type, Node targetFolder) {<NEW_LINE>// System.out.println("performing drop...."+type); // NOI18N<NEW_LINE>try {<NEW_LINE>if (targetFolder == null) {<NEW_LINE>// call paste action<NEW_LINE>type.paste();<NEW_LINE>return new Node[] {};<NEW_LINE>}<NEW_LINE>Node[] preNodes = targetFolder.getChildren().getNodes(true);<NEW_LINE>// call paste action<NEW_LINE>type.paste();<NEW_LINE>Node[] postNodes = targetFolder.getChildren().getNodes(true);<NEW_LINE>// calculate new nodes<NEW_LINE>List<Node> pre = Arrays.asList(preNodes);<NEW_LINE>List<Node> post = Arrays.asList(postNodes);<NEW_LINE>Iterator<Node> it = post.iterator();<NEW_LINE>List<Node> diff = new ArrayList<Node>();<NEW_LINE>while (it.hasNext()) {<NEW_LINE><MASK><NEW_LINE>if (!pre.contains(n)) {<NEW_LINE>diff.add(n);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return diff.toArray(new Node[diff.size()]);<NEW_LINE>} catch (UserCancelException exc) {<NEW_LINE>// ignore - user just pressed cancel in some dialog....<NEW_LINE>return new Node[] {};<NEW_LINE>} catch (IOException e) {<NEW_LINE>Exceptions.printStackTrace(e);<NEW_LINE>return new Node[] {};<NEW_LINE>}<NEW_LINE>}
Node n = it.next();
81,359
/*<NEW_LINE>getFormattedDate(event, start.withZoneSameInstant(target), "date.extended.pattern", messageSource),<NEW_LINE>getFormattedDate(event, start.withZoneSameInstant(target), "time.extended.pattern", messageSource),<NEW_LINE>getFormattedDate(event, end.withZoneSameInstant(target), "date.extended.pattern", messageSource),<NEW_LINE>getFormattedDate(event, end.withZoneSameInstant(target), "time.extended.pattern", messageSource)<NEW_LINE>*/<NEW_LINE>public static OnlineCheckInInfo fromJoinLink(JoinLink joinLink, EventWithCheckInInfo event, ZoneId targetTz, MessageSource messageSource) {<NEW_LINE>var start = joinLink.getValidFrom().atZone(event.getZoneId());<NEW_LINE>var end = joinLink.getValidFrom().<MASK><NEW_LINE>return fromDates(event, start, end, targetTz, messageSource);<NEW_LINE>}
atZone(event.getZoneId());
259,492
public static IMethod findMethod(IType type, char[] selector, String[] paramTypeSignatures, boolean isConstructor) throws JavaModelException {<NEW_LINE>IMethod method = null;<NEW_LINE>int startingIndex = 0;<NEW_LINE>String[] args;<NEW_LINE>IType enclosingType = type.getDeclaringType();<NEW_LINE>// If the method is a constructor of a non-static inner type, add the enclosing type as an<NEW_LINE>// additional parameter to the constructor<NEW_LINE>if (enclosingType != null && isConstructor && !Flags.isStatic(type.getFlags())) {<NEW_LINE>args = new String[paramTypeSignatures.length + 1];<NEW_LINE>startingIndex = 1;<NEW_LINE>args[0] = Signature.createTypeSignature(enclosingType.getFullyQualifiedName(), true);<NEW_LINE>} else {<NEW_LINE>args = new String[paramTypeSignatures.length];<NEW_LINE>}<NEW_LINE>int length = args.length;<NEW_LINE>for (int i = startingIndex; i < length; i++) {<NEW_LINE>args[i] = paramTypeSignatures[i - startingIndex];<NEW_LINE>}<NEW_LINE>method = type.getMethod(new String(selector), args);<NEW_LINE>IMethod[] <MASK><NEW_LINE>if (methods != null && methods.length > 0) {<NEW_LINE>method = methods[0];<NEW_LINE>}<NEW_LINE>return method;<NEW_LINE>}
methods = type.findMethods(method);
413,004
private void registerSetLocationReceiver(@NonNull MapActivity mapActivity) {<NEW_LINE>BroadcastReceiver setLocationReceiver = new BroadcastReceiver() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onReceive(Context context, Intent intent) {<NEW_LINE>String packName = intent.getStringExtra(AIDL_PACKAGE_NAME);<NEW_LINE>ALocation <MASK><NEW_LINE>long timeToNotUseOtherGPS = intent.getLongExtra(AIDL_TIME_TO_NOT_USE_OTHER_GPS, 0);<NEW_LINE>if (!Algorithms.isEmpty(packName) && aLocation != null && !Double.isNaN(aLocation.getLatitude()) && !Double.isNaN(aLocation.getLongitude())) {<NEW_LINE>Location location = new Location(packName);<NEW_LINE>location.setLatitude(aLocation.getLatitude());<NEW_LINE>location.setLongitude(aLocation.getLongitude());<NEW_LINE>location.setTime(aLocation.getTime());<NEW_LINE>if (aLocation.hasAltitude()) {<NEW_LINE>location.setAltitude(aLocation.getAltitude());<NEW_LINE>}<NEW_LINE>if (aLocation.hasSpeed()) {<NEW_LINE>location.setSpeed(aLocation.getSpeed());<NEW_LINE>}<NEW_LINE>if (aLocation.hasBearing()) {<NEW_LINE>location.setBearing(aLocation.getBearing());<NEW_LINE>}<NEW_LINE>if (aLocation.hasAccuracy()) {<NEW_LINE>location.setAccuracy(aLocation.getAccuracy());<NEW_LINE>}<NEW_LINE>if (aLocation.hasVerticalAccuracy()) {<NEW_LINE>location.setVerticalAccuracy(aLocation.getVerticalAccuracy());<NEW_LINE>}<NEW_LINE>app.getLocationProvider().setCustomLocation(location, timeToNotUseOtherGPS);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>registerReceiver(setLocationReceiver, mapActivity, AIDL_SET_LOCATION);<NEW_LINE>}
aLocation = intent.getParcelableExtra(AIDL_LOCATION);
1,267,741
protected void doStop() {<NEW_LINE>ExecutorService indicesStopExecutor = Executors.newFixedThreadPool(5, EsExecutors<MASK><NEW_LINE>// Copy indices because we modify it asynchronously in the body of the loop<NEW_LINE>final Set<Index> indices = this.indices.values().stream().map(s -> s.index()).collect(Collectors.toSet());<NEW_LINE>final CountDownLatch latch = new CountDownLatch(indices.size());<NEW_LINE>for (final Index index : indices) {<NEW_LINE>indicesStopExecutor.execute(() -> {<NEW_LINE>try {<NEW_LINE>removeIndex(index, IndexRemovalReason.NO_LONGER_ASSIGNED, "shutdown");<NEW_LINE>} finally {<NEW_LINE>latch.countDown();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (latch.await(shardsClosedTimeout.seconds(), TimeUnit.SECONDS) == false) {<NEW_LINE>logger.warn("Not all shards are closed yet, waited {}sec - stopping service", shardsClosedTimeout.seconds());<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>// ignore<NEW_LINE>} finally {<NEW_LINE>indicesStopExecutor.shutdown();<NEW_LINE>}<NEW_LINE>}
.daemonThreadFactory(settings, "indices_shutdown"));
999,995
private Description describe(MethodInvocationTree methodInvocationTree, VisitorState state) {<NEW_LINE>// Find the root of the field access chain, i.e. a.intern().trim() ==> a.<NEW_LINE>ExpressionTree identifierExpr = ASTHelpers.getRootAssignable(methodInvocationTree);<NEW_LINE>String identifierStr = null;<NEW_LINE>Type identifierType = null;<NEW_LINE>if (identifierExpr != null) {<NEW_LINE>identifierStr = state.getSourceForNode(identifierExpr);<NEW_LINE>if (identifierExpr instanceof JCIdent) {<NEW_LINE>identifierType = ((JCIdent) identifierExpr).sym.type;<NEW_LINE>} else if (identifierExpr instanceof JCFieldAccess) {<NEW_LINE>identifierType = ((JCFieldAccess) identifierExpr).sym.type;<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Expected a JCIdent or a JCFieldAccess");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Type returnType = getReturnType(((JCMethodInvocation) methodInvocationTree).getMethodSelect());<NEW_LINE>Fix fix;<NEW_LINE>if (identifierStr != null && !"this".equals(identifierStr) && returnType != null && state.getTypes().isAssignable(returnType, identifierType)) {<NEW_LINE>// Fix by assigning the assigning the result of the call to the root receiver reference.<NEW_LINE>fix = SuggestedFix.prefixWith(methodInvocationTree, identifierStr + " = ");<NEW_LINE>} else {<NEW_LINE>// Unclear what the programmer intended. Delete since we don't know what else to do.<NEW_LINE>Tree parent = state.getPath()<MASK><NEW_LINE>fix = SuggestedFix.delete(parent);<NEW_LINE>}<NEW_LINE>return describeMatch(methodInvocationTree, fix);<NEW_LINE>}
.getParentPath().getLeaf();
98,560
public List<CandidateCellForSweeping> next() {<NEW_LINE>Preconditions.checkState(hasNext());<NEW_LINE>List<CellTsPairInfo> cellTsBatch = cellTsIterator.next();<NEW_LINE>List<CandidateCellForSweeping> candidates = new ArrayList<>();<NEW_LINE>for (CellTsPairInfo cellTs : cellTsBatch) {<NEW_LINE>checkCurrentCellAndUpdateIfNecessary(cellTs).ifPresent(candidates::add);<NEW_LINE>if (currentCellTimestamps.size() > 0) {<NEW_LINE>// We expect the timestamps in ascending order. This check costs us a few CPU cycles<NEW_LINE>// but it's worth it for paranoia reasons - mistaking a cell with data for an empty one<NEW_LINE>// can cause data corruption.<NEW_LINE>Preconditions.checkArgument(cellTs.ts > currentCellTimestamps.get(currentCellTimestamps.size<MASK><NEW_LINE>}<NEW_LINE>updateStateAfterSingleCellTsPairProcessed(cellTs);<NEW_LINE>}<NEW_LINE>if (!cellTsIterator.hasNext()) {<NEW_LINE>getCurrentCandidate().ifPresent(candidates::add);<NEW_LINE>}<NEW_LINE>return candidates;<NEW_LINE>}
() - 1), "Timestamps for each cell must be fed in strictly increasing order");
846,994
private static void testStringMethods() {<NEW_LINE>String string1 = "string1";<NEW_LINE>String whitespaceString = string1 + " ";<NEW_LINE>assertTrue(whitespaceString.trim().equals(string1));<NEW_LINE>whitespaceString = " " + string1 + " ";<NEW_LINE>assertTrue(whitespaceString.trim().equals(string1));<NEW_LINE>// substring (start)<NEW_LINE>assertTrue(string1.substring(0).equals("string1"));<NEW_LINE>assertTrue(string1.substring(1).equals("tring1"));<NEW_LINE>assertTrue(string1.substring(2).equals("ring1"));<NEW_LINE>assertTrue(string1.substring(3).equals("ing1"));<NEW_LINE>assertTrue(string1.substring(4).equals("ng1"));<NEW_LINE>assertTrue(string1.substring(<MASK><NEW_LINE>assertTrue(string1.substring(6).equals("1"));<NEW_LINE>assertTrue(string1.substring(7).equals(""));<NEW_LINE>// substring (start, end)<NEW_LINE>assertTrue(string1.substring(0, 2).equals("st"));<NEW_LINE>assertTrue(string1.substring(1, 5).equals("trin"));<NEW_LINE>}
5).equals("g1"));
545,938
public ProcessInstance execute(CommandContext commandContext) {<NEW_LINE>if (messageName == null) {<NEW_LINE>throw new ActivitiIllegalArgumentException("Cannot start process instance by message: message name is null");<NEW_LINE>}<NEW_LINE>MessageEventSubscriptionEntity messageEventSubscription = commandContext.getEventSubscriptionEntityManager().findMessageStartEventSubscriptionByName(messageName, tenantId);<NEW_LINE>if (messageEventSubscription == null) {<NEW_LINE>throw new ActivitiObjectNotFoundException("Cannot start process instance by message: no subscription to message with name '" + messageName + "' found.", MessageEventSubscriptionEntity.class);<NEW_LINE>}<NEW_LINE>String processDefinitionId = messageEventSubscription.getConfiguration();<NEW_LINE>if (processDefinitionId == null) {<NEW_LINE>throw new ActivitiException("Cannot start process instance by message: subscription to message with name '" + messageName + "' is not a message start event.");<NEW_LINE>}<NEW_LINE>DeploymentManager deploymentManager = commandContext.getProcessEngineConfiguration().getDeploymentManager();<NEW_LINE>ProcessDefinitionEntity processDefinition = (<MASK><NEW_LINE>if (processDefinition == null) {<NEW_LINE>throw new ActivitiObjectNotFoundException("No process definition found for id '" + processDefinitionId + "'", ProcessDefinition.class);<NEW_LINE>}<NEW_LINE>// Do not start process a process instance if the process definition is suspended<NEW_LINE>if (deploymentManager.isProcessDefinitionSuspended(processDefinition.getId())) {<NEW_LINE>throw new ActivitiException("Cannot start process instance. Process definition " + processDefinition.getName() + " (id = " + processDefinition.getId() + ") is suspended");<NEW_LINE>}<NEW_LINE>ActivityImpl startActivity = processDefinition.findActivity(messageEventSubscription.getActivityId());<NEW_LINE>ExecutionEntity processInstance = processDefinition.createProcessInstance(businessKey, startActivity);<NEW_LINE>if (processVariables != null) {<NEW_LINE>processInstance.setVariables(processVariables);<NEW_LINE>}<NEW_LINE>if (transientVariables != null) {<NEW_LINE>processInstance.setTransientVariables(transientVariables);<NEW_LINE>}<NEW_LINE>processInstance.start();<NEW_LINE>return processInstance;<NEW_LINE>}
ProcessDefinitionEntity) deploymentManager.findDeployedProcessDefinitionById(processDefinitionId);
1,573,570
protected List<Expense> processExpenses() {<NEW_LINE>List<Expense> doneList = new ArrayList<>();<NEW_LINE>// Can't pass an empty collection to the query<NEW_LINE>List<Long> anomalyList = Lists.newArrayList(0L);<NEW_LINE><MASK><NEW_LINE>boolean manageMultiBanks = appAccountService.getAppBase().getManageMultiBanks();<NEW_LINE>String filter = "self.ventilated = true " + "AND self.paymentStatusSelect = :paymentStatusSelect " + "AND self.company = :company " + "AND self.user.partner.outPaymentMode = :paymentMode " + "AND self.id NOT IN (:anomalyList)";<NEW_LINE>if (manageMultiBanks) {<NEW_LINE>filter += " AND self.bankDetails IN (:bankDetailsSet)";<NEW_LINE>}<NEW_LINE>Query<Expense> query = expenseRepo.all().filter(filter).bind("paymentStatusSelect", InvoicePaymentRepository.STATUS_DRAFT).bind("company", accountingBatch.getCompany()).bind("paymentMode", accountingBatch.getPaymentMode()).bind("anomalyList", anomalyList);<NEW_LINE>if (manageMultiBanks) {<NEW_LINE>Set<BankDetails> bankDetailsSet = Sets.newHashSet(accountingBatch.getBankDetails());<NEW_LINE>if (accountingBatch.getIncludeOtherBankAccounts()) {<NEW_LINE>bankDetailsSet.addAll(accountingBatch.getCompany().getBankDetailsList());<NEW_LINE>}<NEW_LINE>query.bind("bankDetailsSet", bankDetailsSet);<NEW_LINE>}<NEW_LINE>for (List<Expense> expenseList; !(expenseList = query.fetch(FETCH_LIMIT)).isEmpty(); JPA.clear()) {<NEW_LINE>for (Expense expense : expenseList) {<NEW_LINE>try {<NEW_LINE>addPayment(expense, accountingBatch.getBankDetails());<NEW_LINE>doneList.add(expense);<NEW_LINE>incrementDone();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>incrementAnomaly();<NEW_LINE>anomalyList.add(expense.getId());<NEW_LINE>query.bind("anomalyList", anomalyList);<NEW_LINE>TraceBackService.trace(ex, ExceptionOriginRepository.CREDIT_TRANSFER, batch.getId());<NEW_LINE>ex.printStackTrace();<NEW_LINE>log.error(String.format("Credit transfer batch for expense payment: anomaly for expense %s", expense.getExpenseSeq()));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return doneList;<NEW_LINE>}
AccountingBatch accountingBatch = batch.getAccountingBatch();
1,413,999
public void initialize(AccessServiceConfig accessServiceConfig, OMRSTopicConnector enterpriseOMRSTopicConnector, OMRSRepositoryConnector repositoryConnector, AuditLog auditLog, String serverUserName) {<NEW_LINE>final String actionDescription = "initialize Glossary View OMAS";<NEW_LINE>this.auditLog = auditLog;<NEW_LINE>GlossaryViewAuditCode auditCode;<NEW_LINE>try {<NEW_LINE>auditCode = GlossaryViewAuditCode.SERVICE_INITIALIZING;<NEW_LINE>AuditLogMessageDefinition messageDefinition = new AuditLogMessageDefinition(auditCode.getLogMessageId(), auditCode.getSeverity(), auditCode.getFormattedLogMessage(serverName), auditCode.getSystemAction(), auditCode.getUserAction());<NEW_LINE>auditLog.logMessage(actionDescription, messageDefinition);<NEW_LINE>instance = new GlossaryViewServiceInstance(repositoryConnector, auditLog, serverUserName, repositoryConnector.getMaxPageSize());<NEW_LINE>serverName = instance.getServerName();<NEW_LINE>auditCode = GlossaryViewAuditCode.SERVICE_INITIALIZED;<NEW_LINE>messageDefinition = new AuditLogMessageDefinition(auditCode.getLogMessageId(), auditCode.getSeverity(), auditCode.getFormattedLogMessage(serverName), auditCode.getSystemAction(<MASK><NEW_LINE>auditLog.logMessage(actionDescription, messageDefinition);<NEW_LINE>} catch (Exception error) {<NEW_LINE>auditCode = GlossaryViewAuditCode.SERVICE_INSTANCE_FAILURE;<NEW_LINE>AuditLogMessageDefinition messageDefinition = new AuditLogMessageDefinition(auditCode.getLogMessageId(), auditCode.getSeverity(), auditCode.getFormattedLogMessage(error.getMessage()), auditCode.getSystemAction(), auditCode.getUserAction());<NEW_LINE>auditLog.logException(actionDescription, messageDefinition, error);<NEW_LINE>}<NEW_LINE>}
), auditCode.getUserAction());
1,699,160
public void detectAndSendChanges(IGrid network) {<NEW_LINE>final ICraftingService cc = network.getCraftingService();<NEW_LINE>final ImmutableSet<ICraftingCPU> cpuSet = cc.getCpus();<NEW_LINE>int matches = 0;<NEW_LINE>boolean changed = !initialDataSent;<NEW_LINE>initialDataSent = true;<NEW_LINE>for (ICraftingCPU c : cpuSet) {<NEW_LINE>boolean found = false;<NEW_LINE>for (CraftingCPURecord ccr : this.cpus) {<NEW_LINE>if (ccr.getCpu() == c) {<NEW_LINE>found = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final boolean matched = this.cpuFilter.test(c);<NEW_LINE>if (matched) {<NEW_LINE>matches++;<NEW_LINE>}<NEW_LINE>if (found != matched) {<NEW_LINE>changed = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (changed || this.cpus.size() != matches) {<NEW_LINE>this.cpus.clear();<NEW_LINE>for (ICraftingCPU c : cpuSet) {<NEW_LINE>if (this.cpuFilter.test(c)) {<NEW_LINE>this.cpus.add(new CraftingCPURecord(c.getAvailableStorage(), c.getCoProcessors(), c));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Sort and assign numeric IDs in case they have no names<NEW_LINE>Collections.sort(this.cpus);<NEW_LINE>for (int i = 0; i < this.cpus.size(); i++) {<NEW_LINE>CraftingCPURecord <MASK><NEW_LINE>if (cpu.getName() == null) {<NEW_LINE>cpu.setName(new TextComponent("#" + (i + 1)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.notifyListener();<NEW_LINE>}<NEW_LINE>}
cpu = cpus.get(i);
1,717,069
public boolean execute(WorkflowModel workflow, TaskModel task, WorkflowExecutor workflowExecutor) {<NEW_LINE>boolean allDone = true;<NEW_LINE>boolean hasFailures = false;<NEW_LINE>StringBuilder failureReason = new StringBuilder();<NEW_LINE>List<String> joinOn = (List<String>) task.getInputData().get("joinOn");<NEW_LINE>if (task.isLoopOverTask()) {<NEW_LINE>// If join is part of loop over task, wait for specific iteration to get complete<NEW_LINE>joinOn = joinOn.stream().map(name -> TaskUtils.appendIteration(name, task.getIteration())).collect(Collectors.toList());<NEW_LINE>}<NEW_LINE>for (String joinOnRef : joinOn) {<NEW_LINE>TaskModel forkedTask = workflow.getTaskByRefName(joinOnRef);<NEW_LINE>if (forkedTask == null) {<NEW_LINE>// Task is not even scheduled yet<NEW_LINE>allDone = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>TaskModel.Status taskStatus = forkedTask.getStatus();<NEW_LINE>hasFailures = !taskStatus.isSuccessful() && !forkedTask.getWorkflowTask().isOptional();<NEW_LINE>if (hasFailures) {<NEW_LINE>failureReason.append(forkedTask.getReasonForIncompletion<MASK><NEW_LINE>}<NEW_LINE>task.addOutput(joinOnRef, forkedTask.getOutputData());<NEW_LINE>if (!taskStatus.isTerminal()) {<NEW_LINE>allDone = false;<NEW_LINE>}<NEW_LINE>if (hasFailures) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (allDone || hasFailures) {<NEW_LINE>if (hasFailures) {<NEW_LINE>task.setReasonForIncompletion(failureReason.toString());<NEW_LINE>task.setStatus(TaskModel.Status.FAILED);<NEW_LINE>} else {<NEW_LINE>task.setStatus(TaskModel.Status.COMPLETED);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
()).append(" ");
928,561
public void onViewCreated(View v, Bundle savedInstanceState) {<NEW_LINE>SharedPreferences themePrefs = getActivity().getSharedPreferences("THEME", 0);<NEW_LINE>Boolean isDark = themePrefs.getBoolean("isDark", false);<NEW_LINE>if (isDark) {<NEW_LINE>getActivity().setTheme(R.style.DarkTheme);<NEW_LINE>v.setBackgroundColor(ContextCompat.getColor(getActivity(), R.color.background_window_dark));<NEW_LINE>} else {<NEW_LINE>getActivity().setTheme(R.style.AppTheme);<NEW_LINE>v.setBackgroundColor(ContextCompat.getColor(getActivity(), R.color.background_window));<NEW_LINE>}<NEW_LINE>mWifiManager = (WifiManager) getActivity().getSystemService(Context.WIFI_SERVICE);<NEW_LINE>mClipboard = (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE);<NEW_LINE>mWifiMatcher = new WirelessMatcher(getResources().openRawResource(R.raw.alice));<NEW_LINE>mScanReceiver = new ScanReceiver();<NEW_LINE>mConnectionReceiver = new ConnectionReceiver();<NEW_LINE>mStatusText = (TextView) v.findViewById(R.id.scanStatusText);<NEW_LINE>mAdapter = new ScanAdapter();<NEW_LINE>mKeyList = new ArrayList<>();<NEW_LINE>getListView().setAdapter(mAdapter);<NEW_LINE>mStatusText.setText(getString(R.string.wifi_initializing));<NEW_LINE>if (!mWifiManager.isWifiEnabled()) {<NEW_LINE>mStatusText.setText(getString(R.string.wifi_activating_iface));<NEW_LINE>mWifiManager.setWifiEnabled(true);<NEW_LINE>mStatusText.setText(getString<MASK><NEW_LINE>}<NEW_LINE>mScanReceiver.register(getActivity());<NEW_LINE>if (mMenu != null) {<NEW_LINE>MenuItem menuScan = mMenu.findItem(R.id.scan);<NEW_LINE>MenuItemCompat.setActionView(menuScan, new ProgressBar(getActivity()));<NEW_LINE>}<NEW_LINE>mStatusText.setText(getString(R.string.wifi_scanning));<NEW_LINE>mScanning = true;<NEW_LINE>mWifiManager.startScan();<NEW_LINE>}
(R.string.wifi_activated));
584,473
public ImmutableList<Issue> fetchIssues(@NonNull final RetrieveIssuesRequest retrieveIssuesRequest) {<NEW_LINE>final ImmutableList<Issue> issueList;<NEW_LINE>final List<String> pathVariables = Arrays.asList(REPOS.getValue(), retrieveIssuesRequest.getRepositoryOwner(), retrieveIssuesRequest.getRepositoryId(), ISSUES.getValue());<NEW_LINE>final LinkedMultiValueMap<String, String> queryParams = new LinkedMultiValueMap<>();<NEW_LINE>queryParams.add(STATE.getValue(), ResourceState.ALL.getValue());<NEW_LINE>queryParams.add(PAGE.getValue(), String.valueOf(retrieveIssuesRequest.getPageIndex()));<NEW_LINE>queryParams.add(PER_PAGE.getValue(), String.valueOf(retrieveIssuesRequest.getPageSize()));<NEW_LINE>if (retrieveIssuesRequest.getDateFrom() != null) {<NEW_LINE>final String since = DateTimeFormatter.ISO_ZONED_DATE_TIME.format(retrieveIssuesRequest.getDateFrom()<MASK><NEW_LINE>queryParams.add(SINCE.getValue(), since);<NEW_LINE>}<NEW_LINE>final GetRequest getRequest = GetRequest.builder().baseURL(GITHUB_BASE_URI).pathVariables(pathVariables).queryParameters(queryParams).oAuthToken(retrieveIssuesRequest.getOAuthToken()).build();<NEW_LINE>issueList = ImmutableList.copyOf(restService.performGet(getRequest, Issue[].class).getBody());<NEW_LINE>return issueList.stream().filter(issue -> !issue.isPullRequest()).collect(ImmutableList.toImmutableList());<NEW_LINE>}
.atStartOfDay(ZoneOffset.UTC));
418,375
private void loadNode158() {<NEW_LINE>BaseDataVariableTypeNode node = new BaseDataVariableTypeNode(this.context, Identifiers.SessionDiagnosticsArrayType_SessionDiagnostics_SessionName, new QualifiedName(0, "SessionName"), new LocalizedText("en", "SessionName"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.String, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsArrayType_SessionDiagnostics_SessionName, Identifiers.HasTypeDefinition, Identifiers.BaseDataVariableType<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsArrayType_SessionDiagnostics_SessionName, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsArrayType_SessionDiagnostics_SessionName, Identifiers.HasComponent, Identifiers.SessionDiagnosticsArrayType_SessionDiagnostics.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), true));
1,562,390
static CompletableFuture<CoreMessageSender> create(final MessagingFactory factory, final String clientId, final MessagingEntityType entityType, final SenderLinkSettings linkSettings) {<NEW_LINE>TRACE_LOGGER.info("Creating core message sender to '{}'", linkSettings.linkPath);<NEW_LINE>final Connection connection = factory.getActiveConnectionCreateIfNecessary();<NEW_LINE>final String sendLinkNamePrefix = "Sender".concat(TrackingUtil.TRACKING_ID_TOKEN_SEPARATOR).concat(StringUtil.getShortRandomString());<NEW_LINE>linkSettings.linkName = !StringUtil.isNullOrEmpty(connection.getRemoteContainer()) ? sendLinkNamePrefix.concat(TrackingUtil.TRACKING_ID_TOKEN_SEPARATOR).concat(connection.getRemoteContainer()) : sendLinkNamePrefix;<NEW_LINE>final CoreMessageSender msgSender = new CoreMessageSender(factory, clientId, entityType, linkSettings);<NEW_LINE>TimeoutTracker openLinkTracker = TimeoutTracker.create(factory.getOperationTimeout());<NEW_LINE>msgSender.initializeLinkOpen(openLinkTracker);<NEW_LINE>CompletableFuture<Void> authenticationFuture = null;<NEW_LINE>if (linkSettings.requiresAuthentication) {<NEW_LINE>authenticationFuture = msgSender.sendTokenAndSetRenewTimer(false);<NEW_LINE>} else {<NEW_LINE>authenticationFuture = CompletableFuture.completedFuture(null);<NEW_LINE>}<NEW_LINE>authenticationFuture.handleAsync((v, sasTokenEx) -> {<NEW_LINE>if (sasTokenEx != null) {<NEW_LINE>Throwable cause = ExceptionUtil.extractAsyncCompletionCause(sasTokenEx);<NEW_LINE>TRACE_LOGGER.info("Sending SAS Token to '{}' failed.", msgSender.sendPath, cause);<NEW_LINE>msgSender.linkFirstOpen.completeExceptionally(cause);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>msgSender.underlyingFactory.scheduleOnReactorThread(new DispatchHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onEvent() {<NEW_LINE>msgSender.createSendLink(msgSender.linkSettings);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (IOException ioException) {<NEW_LINE>msgSender.cancelSASTokenRenewTimer();<NEW_LINE>msgSender.linkFirstOpen.completeExceptionally(new ServiceBusException<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}, MessagingFactory.INTERNAL_THREAD_POOL);<NEW_LINE>return msgSender.linkFirstOpen;<NEW_LINE>}
(false, "Failed to create Sender, see cause for more details.", ioException));
81,007
<T> void addSchedule(CronJob cronJob, Map<String, Object> map) {<NEW_LINE>final Object scheduleConfig = map.get(CronJob.CRON);<NEW_LINE>String[] schedules = null;<NEW_LINE>if (scheduleConfig instanceof String[]) {<NEW_LINE><MASK><NEW_LINE>} else if (scheduleConfig instanceof String) {<NEW_LINE>schedules = new String[] { (String) scheduleConfig };<NEW_LINE>}<NEW_LINE>if (schedules == null || schedules.length == 0) {<NEW_LINE>logger.info("No schedules in map with key '" + CronJob.CRON + "'. Nothing scheduled");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>synchronized (crons) {<NEW_LINE>for (String schedule : schedules) {<NEW_LINE>try {<NEW_LINE>final Cron cron = new Cron(cronJob, schedule(cronJob, map, schedule));<NEW_LINE>crons.add(cron);<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>logger.warn("Invalid cron expression {} from {}", schedule, map, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
schedules = (String[]) scheduleConfig;
1,823,394
private Function createFunction(DWARFFunction dfunc, DIEAggregate diea) {<NEW_LINE>try {<NEW_LINE>// create a new symbol if one does not exist (symbol table will figure this out)<NEW_LINE>SymbolTable symbolTable = currentProgram.getSymbolTable();<NEW_LINE>symbolTable.createLabel(dfunc.address, dfunc.dni.getName(), dfunc.namespace, SourceType.IMPORTED);<NEW_LINE>// force new label to become primary (if already a function it will become function name)<NEW_LINE>SetLabelPrimaryCmd cmd = new SetLabelPrimaryCmd(dfunc.address, dfunc.dni.getName(), dfunc.namespace);<NEW_LINE>cmd.applyTo(currentProgram);<NEW_LINE>setExternalEntryPoint(dfunc.isExternal, dfunc.address);<NEW_LINE>Function function = currentProgram.getListing().getFunctionAt(dfunc.address);<NEW_LINE>if (function == null) {<NEW_LINE>// TODO: If not contained within program memory should they be considered external?<NEW_LINE>if (!currentProgram.getMemory().getLoadedAndInitializedAddressSet().contains(dfunc.address)) {<NEW_LINE>Msg.warn(this, "Unable to create function not contained within loaded memory (" + dfunc.address + ") " + dfunc.namespace + "/" + dfunc.dni.getName());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// create 1-byte function if one does not exist - primary label will become function names<NEW_LINE>function = currentProgram.getFunctionManager().createFunction(null, dfunc.address, new AddressSet(dfunc.address), SourceType.IMPORTED);<NEW_LINE>}<NEW_LINE>DWARFSourceInfo sourceInfo = DWARFSourceInfo.create(diea);<NEW_LINE>if (sourceInfo != null) {<NEW_LINE>// Move the function into the program tree of the file<NEW_LINE>moveIntoFragment(function.getName(), dfunc.address, dfunc.highAddress != null ? dfunc.highAddress : dfunc.address.add(1), sourceInfo.getFilename());<NEW_LINE>if (importOptions.isOutputSourceLocationInfo()) {<NEW_LINE>appendComment(dfunc.address, CodeUnit.PLATE_COMMENT, sourceInfo.getDescriptionStr(), "\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (importOptions.isOutputDIEInfo()) {<NEW_LINE>appendComment(dfunc.address, CodeUnit.PLATE_COMMENT, "DWARF DIE: " + diea.getHexOffset(), "\n");<NEW_LINE>}<NEW_LINE>DWARFNameInfo dni = prog.getName(diea);<NEW_LINE>if (dni.isNameModified()) {<NEW_LINE>appendComment(dfunc.address, CodeUnit.PLATE_COMMENT, "Original name: " + <MASK><NEW_LINE>}<NEW_LINE>return function;<NEW_LINE>} catch (OverlappingFunctionException e) {<NEW_LINE>throw new AssertException(e);<NEW_LINE>} catch (InvalidInputException e) {<NEW_LINE>Msg.error(this, "Failed to create function " + dfunc.namespace + "/" + dfunc.dni.getName() + ": " + e.getMessage());<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
dni.getOriginalName(), "\n");
169,392
private void addCrusherRedRockRecipes(Consumer<FinishedRecipe> consumer, String basePath) {<NEW_LINE>// Chiseled Red Rock -> Red Rock Bricks<NEW_LINE>crushing(consumer, BYGBlocks.CHISELED_RED_ROCK_BRICKS, BYGBlocks.RED_ROCK_BRICKS, basePath + "chiseled_to_brick");<NEW_LINE>crushing(consumer, BYGBlocks.CHISELED_RED_ROCK_BRICK_SLAB, BYGBlocks.RED_ROCK_BRICK_SLAB, basePath + "chiseled_slabs_to_brick_slabs");<NEW_LINE>crushing(consumer, BYGBlocks.CHISELED_RED_ROCK_BRICK_STAIRS, BYGBlocks.RED_ROCK_BRICK_STAIRS, basePath + "chiseled_stairs_to_brick_stairs");<NEW_LINE>crushing(consumer, BYGBlocks.CHISELED_RED_ROCK_BRICK_WALL, BYGBlocks.RED_ROCK_BRICK_WALL, basePath + "chiseled_walls_to_brick_walls");<NEW_LINE>// Red Rock Bricks -> Cracked Red Rock Bricks<NEW_LINE>crushing(consumer, BYGBlocks.RED_ROCK_BRICKS, BYGBlocks.CRACKED_RED_ROCK_BRICKS, basePath + "bricks_to_cracked_bricks");<NEW_LINE>crushing(consumer, BYGBlocks.RED_ROCK_BRICK_SLAB, BYGBlocks.CRACKED_RED_ROCK_BRICK_SLAB, basePath + "brick_slabs_to_cracked_brick_slabs");<NEW_LINE>crushing(consumer, BYGBlocks.RED_ROCK_BRICK_STAIRS, <MASK><NEW_LINE>crushing(consumer, BYGBlocks.RED_ROCK_BRICK_WALL, BYGBlocks.CRACKED_RED_ROCK_BRICK_WALL, basePath + "brick_walls_to_cracked_brick_walls");<NEW_LINE>// Cracked Red Rock Bricks -> Red Rock<NEW_LINE>crushing(consumer, BYGBlocks.CRACKED_RED_ROCK_BRICKS, BYGBlocks.RED_ROCK, basePath + "from_cracked_bricks");<NEW_LINE>crushing(consumer, BYGBlocks.CRACKED_RED_ROCK_BRICK_SLAB, BYGBlocks.RED_ROCK_SLAB, basePath + "brick_slabs_to_slabs");<NEW_LINE>crushing(consumer, BYGBlocks.CRACKED_RED_ROCK_BRICK_STAIRS, BYGBlocks.RED_ROCK_STAIRS, basePath + "brick_stairs_to_stairs");<NEW_LINE>crushing(consumer, BYGBlocks.CRACKED_RED_ROCK_BRICK_WALL, BYGBlocks.RED_ROCK_WALL, basePath + "brick_walls_to_walls");<NEW_LINE>}
BYGBlocks.CRACKED_RED_ROCK_BRICK_STAIRS, basePath + "brick_stairs_to_cracked_brick_stairs");
1,055,041
public void onAcceptMediationResult(Trade trade, ResultHandler resultHandler, ErrorMessageHandler errorMessageHandler) {<NEW_LINE>String tradeId = trade.getId();<NEW_LINE>Optional<Dispute> optionalDispute = findDispute(tradeId);<NEW_LINE>checkArgument(optionalDispute.isPresent(), "dispute must be present");<NEW_LINE>DisputeResult disputeResult = optionalDispute.get().getDisputeResultProperty().get();<NEW_LINE>Coin buyerPayoutAmount = disputeResult.getBuyerPayoutAmount();<NEW_LINE>Coin sellerPayoutAmount = disputeResult.getSellerPayoutAmount();<NEW_LINE><MASK><NEW_LINE>processModel.setBuyerPayoutAmountFromMediation(buyerPayoutAmount.value);<NEW_LINE>processModel.setSellerPayoutAmountFromMediation(sellerPayoutAmount.value);<NEW_LINE>DisputeProtocol tradeProtocol = (DisputeProtocol) tradeManager.getTradeProtocol(trade);<NEW_LINE>trade.setMediationResultState(MediationResultState.MEDIATION_RESULT_ACCEPTED);<NEW_LINE>tradeManager.requestPersistence();<NEW_LINE>// If we have not got yet the peers signature we sign and send to the peer our signature.<NEW_LINE>// Otherwise we sign and complete with the peers signature the payout tx.<NEW_LINE>if (processModel.getTradePeer().getMediatedPayoutTxSignature() == null) {<NEW_LINE>tradeProtocol.onAcceptMediationResult(() -> {<NEW_LINE>if (trade.getPayoutTx() != null) {<NEW_LINE>tradeManager.closeDisputedTrade(tradeId, Trade.DisputeState.MEDIATION_CLOSED);<NEW_LINE>}<NEW_LINE>resultHandler.handleResult();<NEW_LINE>}, errorMessageHandler);<NEW_LINE>} else {<NEW_LINE>tradeProtocol.onFinalizeMediationResultPayout(() -> {<NEW_LINE>if (trade.getPayoutTx() != null) {<NEW_LINE>tradeManager.closeDisputedTrade(tradeId, Trade.DisputeState.MEDIATION_CLOSED);<NEW_LINE>}<NEW_LINE>resultHandler.handleResult();<NEW_LINE>}, errorMessageHandler);<NEW_LINE>}<NEW_LINE>}
ProcessModel processModel = trade.getProcessModel();
1,639,354
final UpdatePoolResult executeUpdatePool(UpdatePoolRequest updatePoolRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updatePoolRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdatePoolRequest> request = null;<NEW_LINE>Response<UpdatePoolResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdatePoolRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updatePoolRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Pinpoint SMS Voice V2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdatePool");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdatePoolResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdatePoolResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,256,476
public void screenshot(long jobId, List<ImageContent> imageContents, Integer imageWidth) {<NEW_LINE>scheduleLogger.info("Start screenshot for job({})", jobId);<NEW_LINE>try {<NEW_LINE>int contentsSize = imageContents.size();<NEW_LINE>List<Future> futures = new ArrayList<>(contentsSize);<NEW_LINE>final AtomicInteger index = new AtomicInteger(1);<NEW_LINE>imageContents.forEach(content -> futures.add(executorService.submit(() -> {<NEW_LINE>scheduleLogger.info("Cronjob({}) thread({}) for screenshot start, type:{}, id:{}, total:{}", jobId, index.get(), content.getDesc(), content.getCId(), contentsSize);<NEW_LINE>try {<NEW_LINE>File image = doScreenshot(jobId, content.getUrl(), imageWidth);<NEW_LINE>content.setContent(image);<NEW_LINE>} catch (Exception e) {<NEW_LINE>scheduleLogger.error("Cronjob({}) thread({}) screenshot error", jobId, index.get());<NEW_LINE>scheduleLogger.error(<MASK><NEW_LINE>} finally {<NEW_LINE>scheduleLogger.info("Cronjob({}) thread({}) for screenshot finish, type:{}, id:{}, total:{}", jobId, index.get(), content.getDesc(), content.getCId(), contentsSize);<NEW_LINE>index.incrementAndGet();<NEW_LINE>}<NEW_LINE>})));<NEW_LINE>try {<NEW_LINE>for (Future future : futures) {<NEW_LINE>future.get();<NEW_LINE>}<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>scheduleLogger.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>imageContents.sort(Comparator.comparing(ImageContent::getOrder));<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>scheduleLogger.error(e.getMessage(), e);<NEW_LINE>} finally {<NEW_LINE>scheduleLogger.info("Cronjob({}) finish screenshot", jobId);<NEW_LINE>}<NEW_LINE>}
e.getMessage(), e);
894,559
public static boolean testMatch(ICpe left, ICpe right) {<NEW_LINE>boolean result = true;<NEW_LINE>result &= compareAttributes(left.getPart(), right.getPart());<NEW_LINE>result &= compareAttributes(left.getWellFormedVendor(), right.getWellFormedVendor());<NEW_LINE>result &= compareAttributes(left.getWellFormedProduct(), right.getWellFormedProduct());<NEW_LINE>if (right instanceof VulnerableSoftware) {<NEW_LINE>final VulnerableSoftware vs = (VulnerableSoftware) right;<NEW_LINE>result &= vs.vulnerable;<NEW_LINE>result &= compareVersions(<MASK><NEW_LINE>} else if (left instanceof VulnerableSoftware) {<NEW_LINE>final VulnerableSoftware vs = (VulnerableSoftware) left;<NEW_LINE>result &= vs.vulnerable;<NEW_LINE>result &= compareVersions(vs, right.getVersion());<NEW_LINE>} else {<NEW_LINE>result &= compareAttributes(left.getWellFormedVersion(), right.getWellFormedVersion());<NEW_LINE>}<NEW_LINE>// todo - if the vulnerablity has an update we are might not be collecting it correctly...<NEW_LINE>// as such, this check might cause FN if the CVE has an update in the data set<NEW_LINE>result &= compareUpdateAttributes(left.getWellFormedUpdate(), right.getWellFormedUpdate());<NEW_LINE>result &= compareAttributes(left.getWellFormedEdition(), right.getWellFormedEdition());<NEW_LINE>result &= compareAttributes(left.getWellFormedLanguage(), right.getWellFormedLanguage());<NEW_LINE>result &= compareAttributes(left.getWellFormedSwEdition(), right.getWellFormedSwEdition());<NEW_LINE>result &= compareAttributes(left.getWellFormedTargetSw(), right.getWellFormedTargetSw());<NEW_LINE>result &= compareAttributes(left.getWellFormedTargetHw(), right.getWellFormedTargetHw());<NEW_LINE>result &= compareAttributes(left.getWellFormedOther(), right.getWellFormedOther());<NEW_LINE>return result;<NEW_LINE>}
vs, left.getVersion());
1,043,131
final GetSnapshotsResult executeGetSnapshots(GetSnapshotsRequest getSnapshotsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getSnapshotsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetSnapshotsRequest> request = null;<NEW_LINE>Response<GetSnapshotsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetSnapshotsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getSnapshotsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "kendra");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetSnapshotsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetSnapshotsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetSnapshots");
775,558
public Destination unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Destination destination = new Destination();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("bucketName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>destination.setBucketName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("keyPrefix", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>destination.setKeyPrefix(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("kmsKeyArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>destination.setKmsKeyArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return destination;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
431,802
private void loadNode47() throws IOException, SAXException {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.TrustListType_OpenWithMasks_InputArguments, new QualifiedName(0, "InputArguments"), new LocalizedText("en", "InputArguments"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Argument, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.TrustListType_OpenWithMasks_InputArguments, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.TrustListType_OpenWithMasks_InputArguments, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.TrustListType_OpenWithMasks_InputArguments, Identifiers.HasProperty, Identifiers.TrustListType_OpenWithMasks.expanded(), false));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<ListOfExtensionObject xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\"><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>Masks</Name><DataType><Identifier>i=7</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/> </Argument> </Body> </ExtensionObject> </ListOfExtensionObject>");<NEW_LINE>String xml = sb.toString();<NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));<NEW_LINE>Object o = decoder.readVariantValue();<NEW_LINE>DataValue value = new DataValue(new Variant(o));<NEW_LINE>node.setValue(value);<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
(1), 0.0, false);
1,666,441
private static void apply(CompLongLongVector v1, CompLongIntVector v2, Binary op, CompLongLongVector result, int start, int end) {<NEW_LINE>if (v1.isCompatable(v2)) {<NEW_LINE>LongLongVector[] v1Parts = v1.getPartitions();<NEW_LINE>LongIntVector[] v2Parts = v2.getPartitions();<NEW_LINE>if (op.isInplace()) {<NEW_LINE>for (int i = start; i <= end; i++) {<NEW_LINE>BinaryExecutor.apply(v1Parts[i]<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LongLongVector[] resParts = result.getPartitions();<NEW_LINE>for (int i = start; i <= end; i++) {<NEW_LINE>resParts[i] = (LongLongVector) BinaryExecutor.apply(v1Parts[i], v2Parts[i], op);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new AngelException("Operation is not support!");<NEW_LINE>}<NEW_LINE>}
, v2Parts[i], op);
794,379
public void check(CommonReturnValue commonReturnValue) throws JRException {<NEW_LINE>VariableReturnValue returnValue = (VariableReturnValue) commonReturnValue;<NEW_LINE>String subreportVariableName = returnValue.getFromVariable();<NEW_LINE>JRVariable subrepVariable = getFromVariable(subreportVariableName);<NEW_LINE>if (subrepVariable == null) {<NEW_LINE>throw new JRException(EXCEPTION_MESSAGE_KEY_SOURCE_NOT_FOUND, new Object[] { subreportVariableName, returnValue.getToVariable() });<NEW_LINE>}<NEW_LINE>JRVariable variable = getToVariable(returnValue.getToVariable());<NEW_LINE>if (returnValue.getCalculation() == CalculationEnum.COUNT || returnValue.getCalculation() == CalculationEnum.DISTINCT_COUNT) {<NEW_LINE>if (!Number.class.isAssignableFrom(variable.getValueClass())) {<NEW_LINE>throw new JRException(EXCEPTION_MESSAGE_KEY_NUMERIC_TYPE_REQUIRED, new Object[] <MASK><NEW_LINE>}<NEW_LINE>} else if (!variable.getValueClass().isAssignableFrom(subrepVariable.getValueClass()) && !(Number.class.isAssignableFrom(variable.getValueClass()) && Number.class.isAssignableFrom(subrepVariable.getValueClass()))) {<NEW_LINE>throw new JRException(EXCEPTION_MESSAGE_KEY_VARIABLE_NOT_ASSIGNABLE, new Object[] { returnValue.getToVariable(), subreportVariableName });<NEW_LINE>}<NEW_LINE>}
{ returnValue.getToVariable() });
786,594
protected SQLShowTablesStatement parseShowTables() {<NEW_LINE>SQLShowTablesStatement stmt = new SQLShowTablesStatement();<NEW_LINE>if (lexer.identifierEquals(FnvHash.Constants.SHOW)) {<NEW_LINE>lexer.nextToken();<NEW_LINE>}<NEW_LINE>if (lexer.identifierEquals(FnvHash.Constants.TABLES)) {<NEW_LINE>lexer.nextToken();<NEW_LINE>}<NEW_LINE>if (lexer.identifierEquals(Constants.EXTENDED)) {<NEW_LINE>lexer.nextToken();<NEW_LINE>stmt.setExtended(true);<NEW_LINE>}<NEW_LINE>if (lexer.token == Token.FROM || lexer.token == Token.IN) {<NEW_LINE>lexer.nextToken();<NEW_LINE>SQLName database = exprParser.name();<NEW_LINE>if (lexer.token == Token.SUB && database instanceof SQLIdentifierExpr) {<NEW_LINE>lexer.mark();<NEW_LINE>lexer.nextToken();<NEW_LINE><MASK><NEW_LINE>lexer.nextToken();<NEW_LINE>if (database instanceof SQLIdentifierExpr) {<NEW_LINE>SQLIdentifierExpr ident = (SQLIdentifierExpr) database;<NEW_LINE>database = new SQLIdentifierExpr(ident.getName() + "-" + strVal);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>stmt.setDatabase(database);<NEW_LINE>}<NEW_LINE>if (lexer.token == Token.LIKE) {<NEW_LINE>lexer.nextToken();<NEW_LINE>SQLExpr like = exprParser.expr();<NEW_LINE>stmt.setLike(like);<NEW_LINE>}<NEW_LINE>if (lexer.token == Token.WHERE) {<NEW_LINE>lexer.nextToken();<NEW_LINE>SQLExpr where = exprParser.expr();<NEW_LINE>stmt.setWhere(where);<NEW_LINE>}<NEW_LINE>return stmt;<NEW_LINE>}
String strVal = lexer.stringVal();
520,284
public void alarm(Object arg0) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.<MASK><NEW_LINE>synchronized (this) {<NEW_LINE>// Reset the alarm<NEW_LINE>reattachAlarm = null;<NEW_LINE>final Iterator it = unreachableMEs.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>final SIBUuid8 meUuid = (SIBUuid8) it.next();<NEW_LINE>final AnycastInputHandler aih = support.getAnycastInputHandler(meUuid, null, definition, true);<NEW_LINE>try {<NEW_LINE>aih.getRCD().reachabilityChange(true);<NEW_LINE>reattachRemoteCD(aih.getRCD());<NEW_LINE>// If attach succeeded then add the CD back into the list<NEW_LINE>addRemoteCD(meUuid, aih.getRCD());<NEW_LINE>// Remove the uuid from the unreachable list<NEW_LINE>it.remove();<NEW_LINE>} catch (SIException e) {<NEW_LINE>// no FFDC code needed<NEW_LINE>SibTr.exception(tc, e);<NEW_LINE>// We were told the remote ME was now up but were unable to reconnect to it. We therefore<NEW_LINE>// kick off a timer to retry the attach. Leave the uuid in the unreachable list.<NEW_LINE>if (reattachAlarm == null) {<NEW_LINE>reattachAlarm = _messageProcessor.getAlarmManager().create(retryInterval, this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "GatheringChangeListener.alarm", this);<NEW_LINE>}
entry(tc, "GatheringChangeListener.alarm", arg0);
886,961
public void run() {<NEW_LINE>final String[] names = suggestNames(replaceAllOccurrences, getLocalVariable());<NEW_LINE>final V variable = createFieldToStartTemplateOn(replaceAllOccurrences, names);<NEW_LINE>boolean started = false;<NEW_LINE>if (variable != null) {<NEW_LINE>int caretOffset = getCaretOffset();<NEW_LINE>myEditor.getCaretModel().moveToOffset(caretOffset);<NEW_LINE>myEditor.getScrollingModel(<MASK><NEW_LINE>final LinkedHashSet<String> nameSuggestions = new LinkedHashSet<String>();<NEW_LINE>nameSuggestions.add(variable.getName());<NEW_LINE>nameSuggestions.addAll(Arrays.asList(names));<NEW_LINE>initOccurrencesMarkers();<NEW_LINE>setElementToRename(variable);<NEW_LINE>updateTitle(getVariable());<NEW_LINE>started = AbstractInplaceIntroducer.super.performInplaceRefactoring(nameSuggestions);<NEW_LINE>if (started) {<NEW_LINE>myDocumentAdapter = new DocumentAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void documentChanged(DocumentEvent e) {<NEW_LINE>if (myPreview == null)<NEW_LINE>return;<NEW_LINE>final TemplateState templateState = TemplateManagerImpl.getTemplateState(myEditor);<NEW_LINE>if (templateState != null) {<NEW_LINE>final TextResult value = templateState.getVariableValue(InplaceRefactoring.PRIMARY_VARIABLE_NAME);<NEW_LINE>if (value != null) {<NEW_LINE>updateTitle(getVariable(), value.getText());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>myEditor.getDocument().addDocumentListener(myDocumentAdapter);<NEW_LINE>updateTitle(getVariable());<NEW_LINE>if (TemplateManagerImpl.getTemplateState(myEditor) != null) {<NEW_LINE>myEditor.putUserData(ACTIVE_INTRODUCE, AbstractInplaceIntroducer.this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.set(started);<NEW_LINE>if (!started) {<NEW_LINE>finish(true);<NEW_LINE>}<NEW_LINE>}
).scrollToCaret(ScrollType.MAKE_VISIBLE);
1,257,615
public static DescribeGroupMonitoringAgentProcessResponse unmarshall(DescribeGroupMonitoringAgentProcessResponse describeGroupMonitoringAgentProcessResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeGroupMonitoringAgentProcessResponse.setRequestId(_ctx.stringValue("DescribeGroupMonitoringAgentProcessResponse.RequestId"));<NEW_LINE>describeGroupMonitoringAgentProcessResponse.setSuccess(_ctx.booleanValue("DescribeGroupMonitoringAgentProcessResponse.Success"));<NEW_LINE>describeGroupMonitoringAgentProcessResponse.setCode(_ctx.stringValue("DescribeGroupMonitoringAgentProcessResponse.Code"));<NEW_LINE>describeGroupMonitoringAgentProcessResponse.setMessage(_ctx.stringValue("DescribeGroupMonitoringAgentProcessResponse.Message"));<NEW_LINE>describeGroupMonitoringAgentProcessResponse.setPageNumber(_ctx.stringValue("DescribeGroupMonitoringAgentProcessResponse.PageNumber"));<NEW_LINE>describeGroupMonitoringAgentProcessResponse.setPageSize(_ctx.stringValue("DescribeGroupMonitoringAgentProcessResponse.PageSize"));<NEW_LINE>describeGroupMonitoringAgentProcessResponse.setTotal(_ctx.stringValue("DescribeGroupMonitoringAgentProcessResponse.Total"));<NEW_LINE>List<Process> processes = new ArrayList<Process>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeGroupMonitoringAgentProcessResponse.Processes.Length"); i++) {<NEW_LINE>Process process = new Process();<NEW_LINE>process.setProcessName(_ctx.stringValue("DescribeGroupMonitoringAgentProcessResponse.Processes[" + i + "].ProcessName"));<NEW_LINE>process.setMatchExpressFilterRelation(_ctx.stringValue("DescribeGroupMonitoringAgentProcessResponse.Processes[" + i + "].MatchExpressFilterRelation"));<NEW_LINE>process.setGroupId(_ctx.stringValue("DescribeGroupMonitoringAgentProcessResponse.Processes[" + i + "].GroupId"));<NEW_LINE>process.setId(_ctx.stringValue("DescribeGroupMonitoringAgentProcessResponse.Processes[" + i + "].Id"));<NEW_LINE>List<MatchExpressItem> matchExpress = new ArrayList<MatchExpressItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeGroupMonitoringAgentProcessResponse.Processes[" + i + "].MatchExpress.Length"); j++) {<NEW_LINE>MatchExpressItem matchExpressItem = new MatchExpressItem();<NEW_LINE>matchExpressItem.setValue(_ctx.stringValue("DescribeGroupMonitoringAgentProcessResponse.Processes[" + i + "].MatchExpress[" + j + "].Value"));<NEW_LINE>matchExpressItem.setName(_ctx.stringValue("DescribeGroupMonitoringAgentProcessResponse.Processes[" + i + "].MatchExpress[" + j + "].Name"));<NEW_LINE>matchExpressItem.setFunction(_ctx.stringValue("DescribeGroupMonitoringAgentProcessResponse.Processes[" + i + "].MatchExpress[" + j + "].Function"));<NEW_LINE>matchExpress.add(matchExpressItem);<NEW_LINE>}<NEW_LINE>process.setMatchExpress(matchExpress);<NEW_LINE>List<AlertConfigItem> alertConfig = new ArrayList<AlertConfigItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeGroupMonitoringAgentProcessResponse.Processes[" + i + "].AlertConfig.Length"); j++) {<NEW_LINE>AlertConfigItem alertConfigItem = new AlertConfigItem();<NEW_LINE>alertConfigItem.setComparisonOperator(_ctx.stringValue("DescribeGroupMonitoringAgentProcessResponse.Processes[" + i + "].AlertConfig[" + j + "].ComparisonOperator"));<NEW_LINE>alertConfigItem.setSilenceTime(_ctx.stringValue("DescribeGroupMonitoringAgentProcessResponse.Processes[" + i + "].AlertConfig[" + j + "].SilenceTime"));<NEW_LINE>alertConfigItem.setWebhook(_ctx.stringValue("DescribeGroupMonitoringAgentProcessResponse.Processes[" + i <MASK><NEW_LINE>alertConfigItem.setTimes(_ctx.stringValue("DescribeGroupMonitoringAgentProcessResponse.Processes[" + i + "].AlertConfig[" + j + "].Times"));<NEW_LINE>alertConfigItem.setEscalationsLevel(_ctx.stringValue("DescribeGroupMonitoringAgentProcessResponse.Processes[" + i + "].AlertConfig[" + j + "].EscalationsLevel"));<NEW_LINE>alertConfigItem.setNoEffectiveInterval(_ctx.stringValue("DescribeGroupMonitoringAgentProcessResponse.Processes[" + i + "].AlertConfig[" + j + "].NoEffectiveInterval"));<NEW_LINE>alertConfigItem.setEffectiveInterval(_ctx.stringValue("DescribeGroupMonitoringAgentProcessResponse.Processes[" + i + "].AlertConfig[" + j + "].EffectiveInterval"));<NEW_LINE>alertConfigItem.setThreshold(_ctx.stringValue("DescribeGroupMonitoringAgentProcessResponse.Processes[" + i + "].AlertConfig[" + j + "].Threshold"));<NEW_LINE>alertConfigItem.setStatistics(_ctx.stringValue("DescribeGroupMonitoringAgentProcessResponse.Processes[" + i + "].AlertConfig[" + j + "].Statistics"));<NEW_LINE>alertConfig.add(alertConfigItem);<NEW_LINE>}<NEW_LINE>process.setAlertConfig(alertConfig);<NEW_LINE>processes.add(process);<NEW_LINE>}<NEW_LINE>describeGroupMonitoringAgentProcessResponse.setProcesses(processes);<NEW_LINE>return describeGroupMonitoringAgentProcessResponse;<NEW_LINE>}
+ "].AlertConfig[" + j + "].Webhook"));
74,321
public static void main(final String[] args) throws IOException {<NEW_LINE>String executionPath = ReactAndroidCodeTransformer.class.getProtectionDomain().getCodeSource().getLocation().getPath();<NEW_LINE>String projectRoot = new File(executionPath + "../../../../../../").getCanonicalPath() + '/';<NEW_LINE>String sdkVersion;<NEW_LINE>try {<NEW_LINE>sdkVersion = args[0];<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IllegalArgumentException("Invalid args passed in, expected one argument -- SDK version.");<NEW_LINE>}<NEW_LINE>// Don't want to mess up our original copy of ReactCommon and ReactAndroid if something goes wrong.<NEW_LINE>File reactCommonDestRoot = new File(projectRoot + REACT_COMMON_DEST_ROOT);<NEW_LINE>File reactAndroidDestRoot = new File(projectRoot + REACT_ANDROID_DEST_ROOT);<NEW_LINE>// Always remove<NEW_LINE>FileUtils.deleteDirectory(reactCommonDestRoot);<NEW_LINE>reactCommonDestRoot = new File(projectRoot + REACT_COMMON_DEST_ROOT);<NEW_LINE>FileUtils.deleteDirectory(reactAndroidDestRoot);<NEW_LINE>reactAndroidDestRoot = new File(projectRoot + REACT_ANDROID_DEST_ROOT);<NEW_LINE>FileUtils.copyDirectory(new File(projectRoot + REACT_COMMON_SOURCE_ROOT), reactCommonDestRoot);<NEW_LINE>FileUtils.copyDirectory(new File(projectRoot + REACT_ANDROID_SOURCE_ROOT), reactAndroidDestRoot);<NEW_LINE>// Update maven publish information<NEW_LINE>replaceInFile(new File(projectRoot + REACT_ANDROID_DEST_ROOT + "/build.gradle"), "def AAR_OUTPUT_URL = \"file://${projectDir}/../android\"", "def AAR_OUTPUT_URL = \"file:${System.env.HOME}/.m2/repository\"");<NEW_LINE>replaceInFile(new File(projectRoot + REACT_ANDROID_DEST_ROOT + "/build.gradle"), "group = GROUP", "group = 'com.facebook.react'");<NEW_LINE>// This version also gets updated in android-tasks.js<NEW_LINE>replaceInFile(new File(projectRoot + REACT_ANDROID_DEST_ROOT + "/build.gradle"), "version = VERSION_NAME", "version = '" + sdkVersion + "'");<NEW_LINE>// RN uses a weird directory structure for soloader to build with Buck. Change this so that Android Studio doesn't complain.<NEW_LINE>replaceInFile(new File(projectRoot + REACT_ANDROID_DEST_ROOT + "/build.gradle"), "'src/main/libraries/soloader'", "'src/main/libraries/soloader/java'");<NEW_LINE>// Actually modify the files<NEW_LINE>String path <MASK><NEW_LINE>for (String fileName : FILES_TO_MODIFY.keySet()) {<NEW_LINE>try {<NEW_LINE>updateFile(path + fileName, FILES_TO_MODIFY.get(fileName));<NEW_LINE>} catch (ParseException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= projectRoot + REACT_ANDROID_DEST_ROOT + '/' + SOURCE_PATH;
797,261
protected void initGroupTreeActions() {<NEW_LINE>groupCreateAction = new CreateAction(groupsTree);<NEW_LINE>groupCreateAction.setAfterCommitHandler(entity -> groupsTree.expandTree());<NEW_LINE>groupsTree.addAction(groupCreateAction);<NEW_LINE>groupCreateAction.setCaption(getMessage("action.create"));<NEW_LINE>groupCreateAction.setOpenType(OpenType.DIALOG);<NEW_LINE>EditAction groupEditAction = new EditAction(groupsTree);<NEW_LINE>groupEditAction.setEditorCloseListener(actionId -> {<NEW_LINE>groupsDs.refresh();<NEW_LINE>groupsTree.expandTree();<NEW_LINE>});<NEW_LINE>groupEditAction.setOpenType(OpenType.DIALOG);<NEW_LINE>groupsTree.addAction(groupEditAction);<NEW_LINE>groupCreateButton.addAction(groupCreateAction);<NEW_LINE>groupCreateButton.addAction(groupCopyAction);<NEW_LINE>groupsTree.addAction(new RemoveAction(groupsTree) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected boolean isApplicable() {<NEW_LINE>Group group = groupsDs.getItem();<NEW_LINE>if (group != null) {<NEW_LINE>return groupsDs.getChildren(group.getId()).isEmpty() && isNotPredefinedGroup();<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>final boolean hasPermissionsToCreateGroup = security.isEntityOpPermitted(<MASK><NEW_LINE>groupsDs.refresh();<NEW_LINE>groupsTree.expandTree();<NEW_LINE>final Collection<UUID> itemIds = groupsDs.getRootItemIds();<NEW_LINE>if (!itemIds.isEmpty()) {<NEW_LINE>groupsTree.setSelected(groupsDs.getItem(itemIds.iterator().next()));<NEW_LINE>}<NEW_LINE>groupCreateButton.setEnabled(hasPermissionsToCreateGroup);<NEW_LINE>groupCopyAction.setEnabled(hasPermissionsToCreateGroup);<NEW_LINE>}
Group.class, EntityOp.CREATE);
271,464
/*<NEW_LINE>* Copies the given classpath entry replacing its path with the destination path<NEW_LINE>* if it is a source folder or a library.<NEW_LINE>*/<NEW_LINE>protected IClasspathEntry copy(IClasspathEntry entry) throws JavaModelException {<NEW_LINE>switch(entry.getEntryKind()) {<NEW_LINE>case IClasspathEntry.CPE_CONTAINER:<NEW_LINE>return JavaCore.newContainerEntry(entry.getPath(), entry.getAccessRules(), entry.getExtraAttributes(), entry.isExported());<NEW_LINE>case IClasspathEntry.CPE_LIBRARY:<NEW_LINE>try {<NEW_LINE>return JavaCore.newLibraryEntry(this.destination, entry.getSourceAttachmentPath(), entry.getSourceAttachmentRootPath(), entry.getAccessRules(), entry.getExtraAttributes(), entry.isExported());<NEW_LINE>} catch (ClasspathEntry.AssertionFailedException e) {<NEW_LINE>IJavaModelStatus status = new JavaModelStatus(IJavaModelStatusConstants.INVALID_PATH, e.getMessage());<NEW_LINE>throw new JavaModelException(status);<NEW_LINE>}<NEW_LINE>case IClasspathEntry.CPE_PROJECT:<NEW_LINE>return JavaCore.newProjectEntry(entry.getPath(), entry.getAccessRules(), entry.combineAccessRules(), entry.getExtraAttributes(), entry.isExported());<NEW_LINE>case IClasspathEntry.CPE_SOURCE:<NEW_LINE>return JavaCore.newSourceEntry(this.destination, entry.getInclusionPatterns(), entry.getExclusionPatterns(), entry.getOutputLocation(), entry.getExtraAttributes());<NEW_LINE>case IClasspathEntry.CPE_VARIABLE:<NEW_LINE>try {<NEW_LINE>return JavaCore.newVariableEntry(entry.getPath(), entry.getSourceAttachmentPath(), entry.getSourceAttachmentRootPath(), entry.getAccessRules(), entry.getExtraAttributes(<MASK><NEW_LINE>} catch (ClasspathEntry.AssertionFailedException e) {<NEW_LINE>IJavaModelStatus status = new JavaModelStatus(IJavaModelStatusConstants.INVALID_PATH, e.getMessage());<NEW_LINE>throw new JavaModelException(status);<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.ELEMENT_DOES_NOT_EXIST, getElementToProcess()));<NEW_LINE>}<NEW_LINE>}
), entry.isExported());
126,563
final GetFindingsReportStatusResult executeGetFindingsReportStatus(GetFindingsReportStatusRequest getFindingsReportStatusRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getFindingsReportStatusRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetFindingsReportStatusRequest> request = null;<NEW_LINE>Response<GetFindingsReportStatusResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetFindingsReportStatusRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getFindingsReportStatusRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Inspector2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetFindingsReportStatus");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetFindingsReportStatusResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new GetFindingsReportStatusResultJsonUnmarshaller());
817,784
public void visitMethodInsn(int opcode, String owner, String name, String descriptor, boolean isInterface) {<NEW_LINE>super.visitMethodInsn(opcode, owner, name, descriptor, isInterface);<NEW_LINE>if (isCorePublisher(owner)) {<NEW_LINE>if ("checkpoint".equals(name)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String returnType = Type.getReturnType(descriptor).getInternalName();<NEW_LINE>// Note this is the default path. If the return type is not lift-compatible (eg. MonoProcessor) then we shouldn't instrument it / wrap it<NEW_LINE>if (!isLiftCompatiblePublisher(returnType)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>changed.set(true);<NEW_LINE>String callSite = String.format("\t%s.%s\n\t%s.%s(%s:%d)\n", owner.replace("/", "."), name, currentClassName.replace("/", "."), currentMethod, currentSource, currentLine);<NEW_LINE>super.visitLdcInsn(callSite);<NEW_LINE>super.visitMethodInsn(Opcodes.INVOKESTATIC, <MASK><NEW_LINE>super.visitTypeInsn(Opcodes.CHECKCAST, returnType);<NEW_LINE>}<NEW_LINE>}
"reactor/core/publisher/Hooks", "addCallSiteInfo", ADD_CALLSITE_INFO_METHOD, false);
580,562
void decode(Decoder decoder, Instruction instruction) {<NEW_LINE>if ((decoder.state_vvvv_invalidCheck & decoder.invalidCheckMask) != 0)<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE>instruction.setCode(code);<NEW_LINE>instruction.setOp0Register(decoder.state_reg + decoder.state_zs_extraRegisterBase + decoder.state_extraRegisterBaseEVEX + Register.ZMM0);<NEW_LINE>int sss = decoder.getSss();<NEW_LINE>if (decoder.state_mod == 3) {<NEW_LINE>instruction.setOp1Register(decoder.state_rm + decoder.state_extraBaseRegisterBaseEVEX + Register.ZMM0);<NEW_LINE>if ((decoder.state_zs_flags & StateFlags.MVEX_EH) != 0) {<NEW_LINE>if (MvexInfo.canUseSuppressAllExceptions(code)) {<NEW_LINE>if ((sss & 4) != 0)<NEW_LINE>instruction.setSuppressAllExceptions(true);<NEW_LINE>if (MvexInfo.canUseRoundingControl(code)) {<NEW_LINE>instruction.setRoundingControl((sss <MASK><NEW_LINE>}<NEW_LINE>} else if (MvexInfo.getNoSaeRc(code) && (sss & decoder.invalidCheckMask) != 0)<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE>} else {<NEW_LINE>if ((MvexInfo.getInvalidSwizzleFns(code) & (1 << sss) & decoder.invalidCheckMask) != 0)<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE>assert Integer.compareUnsigned(sss, 7) <= 0 : sss;<NEW_LINE>instruction.setMvexRegMemConv(MvexRegMemConv.REG_SWIZZLE_NONE + sss);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>instruction.setOp1Kind(OpKind.MEMORY);<NEW_LINE>if ((decoder.state_zs_flags & StateFlags.MVEX_EH) != 0)<NEW_LINE>instruction.setMvexEvictionHint(true);<NEW_LINE>if ((MvexInfo.getInvalidConvFns(code) & (1 << sss) & decoder.invalidCheckMask) != 0)<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE>instruction.setMvexRegMemConv(MvexRegMemConv.MEM_CONV_NONE + sss);<NEW_LINE>decoder.readOpMem(instruction, MvexInfo.getTupleType(code, sss));<NEW_LINE>}<NEW_LINE>}
& 3) + RoundingControl.ROUND_TO_NEAREST);
1,512,969
public R apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7) throws Exception {<NEW_LINE>if (t1 == null) {<NEW_LINE>throw new NullPointerException("t1 is null, tag = " + tag);<NEW_LINE>}<NEW_LINE>if (t2 == null) {<NEW_LINE>throw new NullPointerException("t2 is null, tag = " + tag);<NEW_LINE>}<NEW_LINE>if (t3 == null) {<NEW_LINE>throw new NullPointerException("t3 is null, tag = " + tag);<NEW_LINE>}<NEW_LINE>if (t4 == null) {<NEW_LINE>throw new NullPointerException("t4 is null, tag = " + tag);<NEW_LINE>}<NEW_LINE>if (t5 == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (t6 == null) {<NEW_LINE>throw new NullPointerException("t6 is null, tag = " + tag);<NEW_LINE>}<NEW_LINE>if (t7 == null) {<NEW_LINE>throw new NullPointerException("t7 is null, tag = " + tag);<NEW_LINE>}<NEW_LINE>R v;<NEW_LINE>try {<NEW_LINE>v = actual.apply(t1, t2, t3, t4, t5, t6, t7);<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>throw FunctionTagging.<Exception>justThrow(new FunctionTaggingException(tag).appendLast(ex));<NEW_LINE>}<NEW_LINE>if (v == null) {<NEW_LINE>throw new NullPointerException("The BiFunction returned null, tag = " + tag);<NEW_LINE>}<NEW_LINE>return v;<NEW_LINE>}
throw new NullPointerException("t5 is null, tag = " + tag);
281,317
private boolean checkMatchIndex(int index) throws LeaderUnknownException, TException, InterruptedException {<NEW_LINE>Log log = logs.get(index);<NEW_LINE>synchronized (raftMember.getTerm()) {<NEW_LINE>// make sure this node is still a leader<NEW_LINE>if (raftMember.getCharacter() != NodeCharacter.LEADER) {<NEW_LINE>throw new LeaderUnknownException(raftMember.getAllNodes());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long prevLogIndex = log.getCurrLogIndex() - 1;<NEW_LINE>long prevLogTerm = getPrevLogTerm(index);<NEW_LINE>if (prevLogTerm == -1) {<NEW_LINE>// prev log cannot be found, we cannot know whether is matches if it is not the first log<NEW_LINE>return prevLogIndex == -1;<NEW_LINE>}<NEW_LINE>boolean matched = checkLogIsMatch(prevLogIndex, prevLogTerm);<NEW_LINE>raftMember.getLastCatchUpResponseTime().put(<MASK><NEW_LINE>logger.info("{} check {}'s matchIndex {} with log [{}]", raftMember.getName(), node, matched ? "succeed" : "failed", log);<NEW_LINE>return matched;<NEW_LINE>}
node, System.currentTimeMillis());
1,257,238
protected void updateState(Screen screen, Map<String, String> urlParams, boolean pushState) {<NEW_LINE>NavigationState currentState = getState();<NEW_LINE>NavigationState newState = buildNavState(screen, urlParams);<NEW_LINE>// do not push copy-pasted requested state to avoid double state pushing into browser history<NEW_LINE>if (!pushState || externalNavigation(currentState, newState) || isNotFoundScreen(screen)) {<NEW_LINE>urlTools.replaceState(newState.asRoute(), ui);<NEW_LINE>lastHistoryOperation = CubaUIConstants.HISTORY_REPLACE_OP;<NEW_LINE>} else {<NEW_LINE>urlTools.pushState(newState.asRoute(), ui);<NEW_LINE>lastHistoryOperation = CubaUIConstants.HISTORY_PUSH_OP;<NEW_LINE>}<NEW_LINE>((WebWindow) screen.getWindow()).setResolvedState(newState);<NEW_LINE>if (pushState) {<NEW_LINE>ui.<MASK><NEW_LINE>} else {<NEW_LINE>ui.getHistory().replace(newState);<NEW_LINE>}<NEW_LINE>}
getHistory().forward(newState);
1,067,707
private void initialiseScalarConverters(BootupClasses bootupClasses) {<NEW_LINE>for (Class<? extends ScalarTypeConverter<?, ?>> foundType : bootupClasses.getScalarConverters()) {<NEW_LINE>try {<NEW_LINE>Class<?>[] paramTypes = TypeReflectHelper.<MASK><NEW_LINE>if (paramTypes.length != 2) {<NEW_LINE>throw new IllegalStateException("Expected 2 generics paramtypes but got: " + Arrays.toString(paramTypes));<NEW_LINE>}<NEW_LINE>Class<?> logicalType = paramTypes[0];<NEW_LINE>Class<?> persistType = paramTypes[1];<NEW_LINE>ScalarType<?> wrappedType = getScalarType(persistType);<NEW_LINE>if (wrappedType == null) {<NEW_LINE>throw new IllegalStateException("Could not find ScalarType for: " + paramTypes[1]);<NEW_LINE>}<NEW_LINE>ScalarTypeConverter converter = foundType.getDeclaredConstructor().newInstance();<NEW_LINE>ScalarTypeWrapper stw = new ScalarTypeWrapper(logicalType, wrappedType, converter);<NEW_LINE>log.debug("Register ScalarTypeWrapper from {} -> {} using:{}", logicalType, persistType, foundType);<NEW_LINE>add(stw);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Error registering ScalarTypeConverter [" + foundType.getName() + "]", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getParams(foundType, ScalarTypeConverter.class);
43,272
public final SortField sortField(NumericType targetNumericType, Object missingValue, MultiValueMode sortMode, Nested nested, boolean reverse) {<NEW_LINE>XFieldComparatorSource source = comparatorSource(targetNumericType, missingValue, sortMode, nested);<NEW_LINE>if (sortRequiresCustomComparator() || nested != null || (sortMode != MultiValueMode.MAX && sortMode != MultiValueMode.MIN) || targetNumericType != getNumericType()) {<NEW_LINE>return new SortField(<MASK><NEW_LINE>}<NEW_LINE>SortedNumericSelector.Type selectorType = sortMode == MultiValueMode.MAX ? SortedNumericSelector.Type.MAX : SortedNumericSelector.Type.MIN;<NEW_LINE>SortField sortField = new SortedNumericSortField(getFieldName(), getNumericType().sortFieldType, reverse, selectorType);<NEW_LINE>sortField.setMissingValue(source.missingObject(missingValue, reverse));<NEW_LINE>// todo: remove since deprecated<NEW_LINE>sortField.setOptimizeSortWithPoints(false);<NEW_LINE>return sortField;<NEW_LINE>}
getFieldName(), source, reverse);
1,443,375
public void toggleVisibility(final JComponent owner) {<NEW_LINE>final JPopupMenu popupMenu = getPopupMenu();<NEW_LINE>final JPanel panel = getPanelMenu();<NEW_LINE>if (popupMenu.isVisible()) {<NEW_LINE>popupMenu.setVisible(false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Update popup only if it's staled<NEW_LINE>// refresh=false<NEW_LINE>populatePopup(false);<NEW_LINE>// No components, nothing to display<NEW_LINE>if (panel.getComponentCount() <= 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final JScrollPane scroller = getScroller();<NEW_LINE>panel.validate();<NEW_LINE>Dimension pSize = table.getParent().getSize();<NEW_LINE>Dimension size = panel.getPreferredSize();<NEW_LINE>if (size.height >= pSize.height) {<NEW_LINE>scroller.setPreferredSize(new Dimension(size.width, pSize.height - 30));<NEW_LINE>} else {<NEW_LINE>scroller.setPreferredSize(size);<NEW_LINE>}<NEW_LINE>popupMenu.setPopupSize(new Dimension(scroller.getPreferredSize().width + 20, scroller.getPreferredSize().height - 20));<NEW_LINE>Dimension buttonSize = owner.getSize();<NEW_LINE>int xPos = owner.getComponentOrientation().isLeftToRight() ? buttonSize.width - popupMenu.getPreferredSize().width : 0;<NEW_LINE>popupMenu.show(<MASK><NEW_LINE>}
owner, xPos, buttonSize.height);
1,056,810
private StreamObserver<T> biStreamImperative(StreamObserver<T> responseObserver, ServerCallStreamObserver<T> serverCallStreamObserver, AtomicBoolean wasReady) {<NEW_LINE>return new StreamObserver<T>() {<NEW_LINE><NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>@Override<NEW_LINE>public void onNext(T request) {<NEW_LINE>try {<NEW_LINE>Message<byte[]> message = toSpringMessage(request);<NEW_LINE>FunctionInvocationWrapper function = resolveFunction(message.getHeaders());<NEW_LINE>Message<byte[]> replyMessage = (Message<byte[]>) function.apply(message);<NEW_LINE>T reply = toGrpcMessage(replyMessage, (Class<T<MASK><NEW_LINE>responseObserver.onNext(reply);<NEW_LINE>// Check the provided ServerCallStreamObserver to see if it is still<NEW_LINE>// ready to accept more messages.<NEW_LINE>if (serverCallStreamObserver.isReady()) {<NEW_LINE>serverCallStreamObserver.request(1);<NEW_LINE>} else {<NEW_LINE>wasReady.set(false);<NEW_LINE>}<NEW_LINE>} catch (Throwable throwable) {<NEW_LINE>throwable.printStackTrace();<NEW_LINE>responseObserver.onError(Status.UNKNOWN.withDescription("Error handling request").withCause(throwable).asException());<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(Throwable t) {<NEW_LINE>t.printStackTrace();<NEW_LINE>responseObserver.onCompleted();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onCompleted() {<NEW_LINE>logger.info("gRPC Server has finished receiving data.");<NEW_LINE>responseObserver.onCompleted();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
>) request.getClass());
1,268,072
private static boolean isLookupGsiSide(RelNode relNode) {<NEW_LINE>if (relNode instanceof LogicalTableLookup) {<NEW_LINE>// before expand<NEW_LINE>RelNode input = ((LogicalTableLookup) relNode).getInput();<NEW_LINE>if (input instanceof Gather) {<NEW_LINE>input = ((Gather) input).getInput();<NEW_LINE>}<NEW_LINE>if (input instanceof LogicalIndexScan) {<NEW_LINE>return ((LogicalIndexScan) <MASK><NEW_LINE>}<NEW_LINE>} else if (relNode instanceof LogicalProject) {<NEW_LINE>// after expand<NEW_LINE>RelNode input = ((LogicalProject) relNode).getInput();<NEW_LINE>if (input instanceof BKAJoin) {<NEW_LINE>BKAJoin bkaJoin = (BKAJoin) input;<NEW_LINE>if (bkaJoin.getJoinType() == JoinRelType.INNER) {<NEW_LINE>RelNode bkaJoinLeftInput = bkaJoin.getLeft();<NEW_LINE>if (bkaJoinLeftInput instanceof Gather) {<NEW_LINE>bkaJoinLeftInput = ((Gather) bkaJoinLeftInput).getInput();<NEW_LINE>}<NEW_LINE>if (bkaJoinLeftInput instanceof LogicalIndexScan) {<NEW_LINE>return ((LogicalIndexScan) bkaJoinLeftInput).getJoin() != null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
input).getJoin() != null;
822,069
private SparseVector sparsePE(SparseVector vec, int degree) {<NEW_LINE>int[] indices = vec.getIndices();<NEW_LINE>double[<MASK><NEW_LINE>int size = vec.size();<NEW_LINE>int nnz = vec.getValues().length;<NEW_LINE>int nnzPolySize = getPolySize(nnz, degree);<NEW_LINE>Tuple2<Integer, int[]> polyIndices = Tuple2.of(0, new int[nnzPolySize - 1]);<NEW_LINE>Tuple2<Integer, double[]> polyValues = Tuple2.of(0, new double[nnzPolySize - 1]);<NEW_LINE>expandSparse(indices, values, nnz - 1, size - 1, degree, 1.0, polyIndices, polyValues, -1);<NEW_LINE>return new SparseVector(getPolySize(size, degree) - 1, polyIndices.f1, polyValues.f1);<NEW_LINE>}
] values = vec.getValues();
1,157,088
final GetTimelineEventResult executeGetTimelineEvent(GetTimelineEventRequest getTimelineEventRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getTimelineEventRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetTimelineEventRequest> request = null;<NEW_LINE>Response<GetTimelineEventResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetTimelineEventRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getTimelineEventRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SSM Incidents");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetTimelineEvent");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetTimelineEventResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetTimelineEventResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
624,084
public Object visit(Object context, NewOperatorExpression expr, boolean strict) {<NEW_LINE>Scope scope = (Scope) context;<NEW_LINE>// We can statically replace an attempt at calls to illegal member types with an exception<NEW_LINE>// raise. This should eliminate needing to actually check this within the runtime.<NEW_LINE>if (expr.getExpr() instanceof IllegalFunctionMemberExpression) {<NEW_LINE>scope.addInstruction(new Raise("TypeError", expr.getExpr() + " is not callable"));<NEW_LINE>return Undefined.UNDEFINED;<NEW_LINE>}<NEW_LINE>Operand memberExpression = (Operand) expr.getExpr().<MASK><NEW_LINE>Variable tmp = scope.createTemporaryVariable();<NEW_LINE>List<Expression> argumentExpressions = expr.getArgumentExpressions();<NEW_LINE>Operand[] args = new Operand[argumentExpressions.size()];<NEW_LINE>for (int i = 0; i < args.length; i++) {<NEW_LINE>args[i] = (Operand) argumentExpressions.get(i).accept(context, this, strict);<NEW_LINE>}<NEW_LINE>scope.addInstruction(new Constructor(tmp, memberExpression, args));<NEW_LINE>return tmp;<NEW_LINE>}
accept(context, this, strict);
610,618
public ImageStoreVO createImageStore(Map<String, Object> params) {<NEW_LINE>ImageStoreVO store = imageStoreDao.findByName((String) params.get("name"));<NEW_LINE>if (store != null) {<NEW_LINE>return store;<NEW_LINE>}<NEW_LINE>store = new ImageStoreVO();<NEW_LINE>store.setProtocol((String) params.get("protocol"));<NEW_LINE>store.setProviderName((String) params.get("providerName"));<NEW_LINE>store.setScope((ScopeType) params.get("scope"));<NEW_LINE>store.setDataCenterId((Long) params.get("zoneId"));<NEW_LINE>String uuid = (String) params.get("uuid");<NEW_LINE>if (uuid != null) {<NEW_LINE>store.setUuid(uuid);<NEW_LINE>} else {<NEW_LINE>store.setUuid(UUID.randomUUID().toString());<NEW_LINE>}<NEW_LINE>store.setName((String) params.get("name"));<NEW_LINE>if (store.getName() == null) {<NEW_LINE>store.setName(store.getUuid());<NEW_LINE>}<NEW_LINE>store.setUrl((String) params.get("url"));<NEW_LINE>store.setRole((DataStoreRole) params.get("role"));<NEW_LINE><MASK><NEW_LINE>return store;<NEW_LINE>}
store = imageStoreDao.persist(store);
1,295,756
final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(untagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UntagResourceRequest> request = null;<NEW_LINE>Response<UntagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UntagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(untagResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Cognito Identity");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UntagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UntagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,782,959
private void initStandardActions() {<NEW_LINE>// NOI18N<NEW_LINE>final String RELOAD = "RELOAD_BROWSER";<NEW_LINE>// NOI18N<NEW_LINE>final String BACK = "NAVIGATE_BACK";<NEW_LINE>// NOI18N<NEW_LINE>final String FORWARD = "NAVIGATE_FORWARD";<NEW_LINE>ActionMap am = getActionMap();<NEW_LINE>InputMap im = getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);<NEW_LINE>am.put(RELOAD, new AbstractAction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>getBrowserImpl().reloadDocument();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>im.put(KeyStroke.getKeyStroke(KeyEvent<MASK><NEW_LINE>im.put(KeyStroke.getKeyStroke(KeyEvent.VK_R, KeyEvent.CTRL_DOWN_MASK), RELOAD);<NEW_LINE>am.put(BACK, new AbstractAction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>getBrowserImpl().backward();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>am.put(FORWARD, new AbstractAction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>getBrowserImpl().forward();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>im.put(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0), BACK);<NEW_LINE>im.put(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, KeyEvent.SHIFT_DOWN_MASK), FORWARD);<NEW_LINE>}
.VK_F5, 0), RELOAD);
1,281,377
public File findArtifact(String groupId, String artifactId, String baseVersion, String extension, String classifier) {<NEW_LINE>File f = mappings.get(groupId + <MASK><NEW_LINE>if (f != null) {<NEW_LINE>if ("pom".equals(extension)) {<NEW_LINE>logger.debug("[NETBEANS] linking artifact to workspace POM:" + new File(f, "pom.xml"));<NEW_LINE>return new File(f, "pom.xml");<NEW_LINE>}<NEW_LINE>if ("jar".equals(extension) && "".equals(classifier)) {<NEW_LINE>logger.debug("[NETBEANS] linking artifact to workspace output folder:" + new File(f, "target/classes"));<NEW_LINE>return new File(new File(f, "target"), "classes");<NEW_LINE>}<NEW_LINE>if ("jar".equals(extension) && "tests".equals(classifier)) {<NEW_LINE>logger.debug("[NETBEANS] linking artifact to workspace output folder:" + new File(f, "target/test-classes"));<NEW_LINE>return new File(new File(f, "target"), "test-classes");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
":" + artifactId + ":" + baseVersion);
633,034
final AllocatePrivateVirtualInterfaceResult executeAllocatePrivateVirtualInterface(AllocatePrivateVirtualInterfaceRequest allocatePrivateVirtualInterfaceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(allocatePrivateVirtualInterfaceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AllocatePrivateVirtualInterfaceRequest> request = null;<NEW_LINE>Response<AllocatePrivateVirtualInterfaceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AllocatePrivateVirtualInterfaceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(allocatePrivateVirtualInterfaceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Direct Connect");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AllocatePrivateVirtualInterfaceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AllocatePrivateVirtualInterfaceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "AllocatePrivateVirtualInterface");
336,806
public TitleAggregationResponse unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>TitleAggregationResponse titleAggregationResponse = new TitleAggregationResponse();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("accountId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>titleAggregationResponse.setAccountId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("severityCounts", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>titleAggregationResponse.setSeverityCounts(SeverityCountsJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("title", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>titleAggregationResponse.setTitle(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("vulnerabilityId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>titleAggregationResponse.setVulnerabilityId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return titleAggregationResponse;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
201,899
// -----------------------------------------------------<NEW_LINE>// Details<NEW_LINE>// -------<NEW_LINE>@Execute<NEW_LINE>@Secured({ ROLE, ROLE + VIEW })<NEW_LINE>public HtmlResponse details(final int crudMode, final String id) {<NEW_LINE>verifyCrudMode(crudMode, CrudMode.DETAILS);<NEW_LINE>saveToken();<NEW_LINE>return asHtml(path_AdminScheduler_AdminSchedulerDetailsJsp).renderWith(data -> {<NEW_LINE>RenderDataUtil.register(data, "systemJobId", fessConfig.isSystemJobId(id));<NEW_LINE>}).useForm(EditForm.class, op -> {<NEW_LINE>op.setup(form -> {<NEW_LINE>scheduledJobService.getScheduledJob(id).ifPresent(entity -> {<NEW_LINE>loadScheduledJob(form, entity);<NEW_LINE>form.crudMode = crudMode;<NEW_LINE>LaRequestUtil.getOptionalRequest().ifPresent(request -> {<NEW_LINE>request.setAttribute(<MASK><NEW_LINE>request.setAttribute("enabled", entity.isEnabled());<NEW_LINE>});<NEW_LINE>}).orElse(() -> {<NEW_LINE>throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), this::asListHtml);<NEW_LINE>});<NEW_LINE>});<NEW_LINE>});<NEW_LINE>}
"running", entity.isRunning());
1,032,593
public boolean replaceEvent(GameEvent event, Ability source, Game game) {<NEW_LINE>Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget();<NEW_LINE>Player player = game.getPlayer(source.getControllerId());<NEW_LINE>if (creature == null || player == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (player.chooseUse(outcome, "Have " + creature.getLogName() + " enter the battlefield with a +1/+1 counter on it or with haste?", null, "+1/+1 counter", "Haste", source, game)) {<NEW_LINE>game.informPlayers(player.getLogName() + <MASK><NEW_LINE>creature.addCounters(CounterType.P1P1.createInstance(), source.getControllerId(), source, game, event.getAppliedEffects());<NEW_LINE>} else {<NEW_LINE>ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom);<NEW_LINE>effect.setTargetPointer(new FixedTarget(creature.getId(), creature.getZoneChangeCounter(game) + 1));<NEW_LINE>game.addEffect(effect, source);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
" choose to put a +1/+1 counter on " + creature.getName());
1,184,711
public void logout() {<NEW_LINE>final ServletRequestContext servletRequestContext = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY);<NEW_LINE>HttpServletRequest req = <MASK><NEW_LINE>req.removeAttribute(KeycloakUndertowAccount.class.getName());<NEW_LINE>req.removeAttribute(KeycloakSecurityContext.class.getName());<NEW_LINE>HttpSession session = req.getSession(false);<NEW_LINE>if (session == null)<NEW_LINE>return;<NEW_LINE>try {<NEW_LINE>KeycloakUndertowAccount account = (KeycloakUndertowAccount) session.getAttribute(KeycloakUndertowAccount.class.getName());<NEW_LINE>if (account == null)<NEW_LINE>return;<NEW_LINE>session.removeAttribute(KeycloakSecurityContext.class.getName());<NEW_LINE>session.removeAttribute(KeycloakUndertowAccount.class.getName());<NEW_LINE>} catch (IllegalStateException ise) {<NEW_LINE>// Session may be already logged-out in case that app has adminUrl<NEW_LINE>log.debugf("Session %s logged-out already", session.getId());<NEW_LINE>}<NEW_LINE>}
(HttpServletRequest) servletRequestContext.getServletRequest();
718,693
private long initMillis(final ThreadContext context, IRubyObject ajd) {<NEW_LINE>final Ruby runtime = context.runtime;<NEW_LINE>// cannot use DateTimeUtils.fromJulianDay since we need to keep ajd as a Rational for precision<NEW_LINE>// millis, @sub_millis = ((ajd - UNIX_EPOCH_IN_AJD) * 86400000).divmod(1)<NEW_LINE>IRubyObject val;<NEW_LINE>if (ajd instanceof RubyFixnum) {<NEW_LINE>val = ((RubyFixnum) ajd).op_minus(context, 4881175 / 2);<NEW_LINE>val = ((RubyFixnum) val).op_mul(context, DAY_MS);<NEW_LINE>// missing 1/2<NEW_LINE>val = ((RubyInteger) val).op_plus(context, RubyFixnum.newFixnum(runtime, DAY_MS / 2));<NEW_LINE>} else {<NEW_LINE>// -(1970-01-01)<NEW_LINE>RubyRational _UNIX_EPOCH_IN_AJD = RubyRational.newRational(runtime, -4881175, 2);<NEW_LINE>val = _UNIX_EPOCH_IN_AJD.op_plus(context, ajd);<NEW_LINE>val = DAY_MS(context).op_mul(context, val);<NEW_LINE>}<NEW_LINE>if (val instanceof RubyFixnum) {<NEW_LINE>return ((RubyFixnum) val).getLongValue();<NEW_LINE>}<NEW_LINE>// fallback<NEW_LINE>val = ((RubyNumeric) val).divmod(context, RubyFixnum.one(context.runtime));<NEW_LINE>IRubyObject millis = ((RubyArray) val).eltInternal(0);<NEW_LINE>if (!(millis instanceof RubyFixnum)) {<NEW_LINE>// > java.lang.Long::MAX_VALUE<NEW_LINE>throw runtime.newArgumentError("Date out of range: millis=" + millis + " (" + millis.getMetaClass() + ")");<NEW_LINE>}<NEW_LINE>IRubyObject subMillis = ((RubyArray) val).eltInternal(1);<NEW_LINE>this.subMillisNum = ((RubyNumeric) subMillis).numerator(context).convertToInteger().getLongValue();<NEW_LINE>this.subMillisDen = ((RubyNumeric) subMillis).denominator(context)<MASK><NEW_LINE>return ((RubyFixnum) millis).getLongValue();<NEW_LINE>}
.convertToInteger().getLongValue();
1,485,275
protected void prepare() {<NEW_LINE>for (ProcessInfoParameter para : getParameter()) {<NEW_LINE>String name = para.getParameterName();<NEW_LINE>if (para.getParameter() == null)<NEW_LINE>;<NEW_LINE>else // BR [ 264 ] Parameter Name Changed<NEW_LINE>if (name.equals("M_Product_ID"))<NEW_LINE>p_M_Product_ID = para.getParameterAsInt();<NEW_LINE>else if (name.equals("ValidTo"))<NEW_LINE>p_ValidTo = ((Timestamp) para.getParameter());<NEW_LINE>else if (name.equals("ValidFrom"))<NEW_LINE>p_ValidFrom = ((Timestamp) para.getParameter());<NEW_LINE>else if (name.equals("Action"))<NEW_LINE>p_Action = ((<MASK><NEW_LINE>else if (name.equals("M_Product_To_ID"))<NEW_LINE>p_New_M_Product_ID = para.getParameterAsInt();<NEW_LINE>else if (name.equals("Qty"))<NEW_LINE>p_Qty = ((BigDecimal) para.getParameter());<NEW_LINE>else if (name.equals("M_ChangeNotice_ID"))<NEW_LINE>p_M_ChangeNotice_ID = para.getParameterAsInt();<NEW_LINE>else<NEW_LINE>log.log(Level.SEVERE, "prepare - Unknown Parameter: " + name);<NEW_LINE>}<NEW_LINE>}
String) para.getParameter());
402,669
public static boolean isValidExpression(String string) {<NEW_LINE>String trimmed = string.trim();<NEW_LINE>if ("".equals(trimmed)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>StringBuilder cuBuff = new StringBuilder();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>cuBuff.append(CONST_CLASS_DECL).// $NON-NLS-1$<NEW_LINE>append<MASK><NEW_LINE>int offset = cuBuff.length();<NEW_LINE>cuBuff.append(trimmed).append(CONST_CLOSE);<NEW_LINE>ASTParser p = ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL);<NEW_LINE>p.setSource(cuBuff.toString().toCharArray());<NEW_LINE>CompilationUnit cu = (CompilationUnit) p.createAST(null);<NEW_LINE>Selection selection = Selection.createFromStartLength(offset, trimmed.length());<NEW_LINE>SelectionAnalyzer analyzer = new SelectionAnalyzer(selection, false);<NEW_LINE>cu.accept(analyzer);<NEW_LINE>ASTNode selected = analyzer.getFirstSelectedNode();<NEW_LINE>return (selected instanceof Expression) && trimmed.equals(cuBuff.substring(cu.getExtendedStartPosition(selected), cu.getExtendedStartPosition(selected) + cu.getExtendedLength(selected)));<NEW_LINE>}
("Object").append(CONST_ASSIGN);
812,612
protected Sheet createSheet() {<NEW_LINE>Sheet sheet = super.createSheet();<NEW_LINE>Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES);<NEW_LINE>if (sheetSet == null) {<NEW_LINE>sheetSet = Sheet.createPropertiesSet();<NEW_LINE>sheet.put(sheetSet);<NEW_LINE>}<NEW_LINE>final BlackboardArtifact artifact = getArtifact();<NEW_LINE>BlackboardArtifact.ARTIFACT_TYPE fromID = BlackboardArtifact.ARTIFACT_TYPE.fromID(artifact.getArtifactTypeID());<NEW_LINE>if (null != fromID && fromID != TSK_CALLLOG) {<NEW_LINE>return sheet;<NEW_LINE>}<NEW_LINE>long duration = -1;<NEW_LINE>try {<NEW_LINE>duration = getCallDuration(artifact);<NEW_LINE>} catch (TskCoreException ex) {<NEW_LINE>logger.log(Level.WARNING, String.format("Unable to get calllog duration for artifact: %d", artifact.getArtifactID()), ex);<NEW_LINE>}<NEW_LINE>sheetSet.put(createNode(TSK_DATETIME_START, artifact));<NEW_LINE>sheetSet.put(createNode(TSK_DIRECTION, artifact));<NEW_LINE>String phoneNumber = getPhoneNumber(artifact);<NEW_LINE>Account account = null;<NEW_LINE>try {<NEW_LINE>account = artifact.getSleuthkitCase().getCommunicationsManager().getAccount(<MASK><NEW_LINE>} catch (TskCoreException ex) {<NEW_LINE>logger.log(Level.SEVERE, "Failed to get instance of communications manager", ex);<NEW_LINE>}<NEW_LINE>sheetSet.put(new AccountNodeProperty<>(TSK_PHONE_NUMBER.getLabel(), TSK_PHONE_NUMBER.getDisplayName(), phoneNumber, account));<NEW_LINE>if (duration != -1) {<NEW_LINE>sheetSet.put(new NodeProperty<>("duration", "Duration", "", Long.toString(duration)));<NEW_LINE>}<NEW_LINE>return sheet;<NEW_LINE>}
Account.Type.PHONE, phoneNumber);
633,347
private FieldDeclaration createNewFieldDeclaration(ASTRewrite rewrite) throws CoreException {<NEW_LINE>AST ast = fCURewrite.getAST();<NEW_LINE>VariableDeclarationFragment fragment = ast.newVariableDeclarationFragment();<NEW_LINE>SimpleName <MASK><NEW_LINE>fragment.setName(variableName);<NEW_LINE>if (fLinkedProposalModel != null) {<NEW_LINE>fLinkedProposalModel.getPositionGroup(KEY_NAME, true).addPosition(rewrite.track(variableName), false);<NEW_LINE>}<NEW_LINE>if (fInitializeIn == INITIALIZE_IN_FIELD) {<NEW_LINE>Expression initializer = getSelectedExpression().createCopyTarget(fCURewrite.getASTRewrite(), true);<NEW_LINE>fragment.setInitializer(initializer);<NEW_LINE>}<NEW_LINE>FieldDeclaration fieldDeclaration = ast.newFieldDeclaration(fragment);<NEW_LINE>fieldDeclaration.setType(createFieldType());<NEW_LINE>fieldDeclaration.modifiers().addAll(ASTNodeFactory.newModifiers(ast, getModifiers()));<NEW_LINE>return fieldDeclaration;<NEW_LINE>}
variableName = ast.newSimpleName(fFieldName);
810,253
public static SparseMatrix text(Path path) throws IOException {<NEW_LINE>try (InputStream <MASK><NEW_LINE>Scanner scanner = new Scanner(stream)) {<NEW_LINE>int nrow = scanner.nextInt();<NEW_LINE>int ncol = scanner.nextInt();<NEW_LINE>int nz = scanner.nextInt();<NEW_LINE>int[] colIndex = new int[ncol + 1];<NEW_LINE>int[] rowIndex = new int[nz];<NEW_LINE>float[] data = new float[nz];<NEW_LINE>for (int i = 0; i <= ncol; i++) {<NEW_LINE>colIndex[i] = scanner.nextInt() - 1;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < nz; i++) {<NEW_LINE>rowIndex[i] = scanner.nextInt() - 1;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < nz; i++) {<NEW_LINE>data[i] = scanner.nextFloat();<NEW_LINE>}<NEW_LINE>return new SparseMatrix(nrow, ncol, data, rowIndex, colIndex);<NEW_LINE>}<NEW_LINE>}
stream = Files.newInputStream(path);
864,350
public void received(NetworkInterface network_interface, InetAddress local_address, InetSocketAddress originator, byte[] data, int length) {<NEW_LINE>try {<NEW_LINE>Map map = BDecoder.<MASK><NEW_LINE>long version = ((Long) map.get("ver")).longValue();<NEW_LINE>long type = ((Long) map.get("type")).longValue();<NEW_LINE>InetAddress originator_address = originator.getAddress();<NEW_LINE>if (map.get("explicit") != null) {<NEW_LINE>addInstanceSupport(originator_address, false);<NEW_LINE>}<NEW_LINE>ClientOtherInstanceImpl instance = ClientOtherInstanceImpl.decode(originator_address, (Map) map.get("orig"));<NEW_LINE>if (instance != null) {<NEW_LINE>if (type == MT_ALIVE) {<NEW_LINE>checkAdd(instance);<NEW_LINE>} else if (type == MT_BYE) {<NEW_LINE>checkRemove(instance);<NEW_LINE>} else {<NEW_LINE>checkAdd(instance);<NEW_LINE>Map body = (Map) map.get("body");<NEW_LINE>if (type == MT_REQUEST) {<NEW_LINE>String originator_id = instance.getID();<NEW_LINE>if (!originator_id.equals(my_instance.getID())) {<NEW_LINE>Map reply = requestReceived(instance, body);<NEW_LINE>if (reply != null) {<NEW_LINE>reply.put("oid", originator_id.getBytes());<NEW_LINE>reply.put("rid", body.get("rid"));<NEW_LINE>sendMessage(MT_REPLY, reply, originator);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (type == MT_REPLY) {<NEW_LINE>String originator_id = new String((byte[]) body.get("oid"));<NEW_LINE>if (originator_id.equals(my_instance.getID())) {<NEW_LINE>long req_id = ((Long) body.get("rid")).longValue();<NEW_LINE>try {<NEW_LINE>this_mon.enter();<NEW_LINE>for (int i = 0; i < requests.size(); i++) {<NEW_LINE>Request req = (Request) requests.get(i);<NEW_LINE>if (req.getID() == req_id) {<NEW_LINE>req.addReply(instance, body);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>this_mon.exit();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Debug.out("Invalid packet received from " + originator, e);<NEW_LINE>}<NEW_LINE>}
decode(data, 0, length);
1,590,602
public static Patch<String> create(String deltasJson) {<NEW_LINE>List<Delta> deltas = JsonUtils.jsonToObject(deltasJson, new TypeReference<>() {<NEW_LINE>});<NEW_LINE>Patch<String> patch = new Patch<>();<NEW_LINE>for (Delta delta : deltas) {<NEW_LINE>StringChunk sourceChunk = delta.getSource();<NEW_LINE>StringChunk targetChunk = delta.getTarget();<NEW_LINE>Chunk<String> orgChunk = new Chunk<>(sourceChunk.getPosition(), sourceChunk.getLines(), sourceChunk.getChangePosition());<NEW_LINE>Chunk<String> revChunk = new Chunk<>(targetChunk.getPosition(), targetChunk.getLines(), targetChunk.getChangePosition());<NEW_LINE>switch(delta.getType()) {<NEW_LINE>case DELETE:<NEW_LINE>patch.addDelta(new DeleteDelta<>(orgChunk, revChunk));<NEW_LINE>break;<NEW_LINE>case INSERT:<NEW_LINE>patch.addDelta(new InsertDelta<>(orgChunk, revChunk));<NEW_LINE>break;<NEW_LINE>case CHANGE:<NEW_LINE>patch.addDelta(new ChangeDelta<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Unsupported delta type.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return patch;<NEW_LINE>}
<>(orgChunk, revChunk));
973,401
protected static void addStandardConverters() {<NEW_LINE>addConverter(void.class, new VoidConverter());<NEW_LINE>addConverter(String.class, new StringConverter());<NEW_LINE>addConverter(Date.class, new DateConverter());<NEW_LINE>addConverter(Double.class, new DoubleConverter());<NEW_LINE>addConverter(double.class, new PrimitiveDoubleConverter());<NEW_LINE>addConverter(Long.class, new LongConverter());<NEW_LINE>addConverter(long.class, new PrimitiveLongConverter());<NEW_LINE>addConverter(Integer.class, new IntConverter());<NEW_LINE>addConverter(int.class, new PrimitiveIntConverter());<NEW_LINE>addConverter(Character.class, new CharConverter());<NEW_LINE>addConverter(char.class, new PrimitiveCharConverter());<NEW_LINE>addConverter(Boolean.class, new BooleanConverter());<NEW_LINE>addConverter(boolean<MASK><NEW_LINE>try {<NEW_LINE>addConverter(Map.class, new MapConverter());<NEW_LINE>} catch (NoClassDefFoundError e) {<NEW_LINE>System.err.println("Slim Map converter not loaded: could not find class " + e.getMessage());<NEW_LINE>}<NEW_LINE>}
.class, new PrimitiveBooleanConverter());
1,514,259
public void marshall(UpdateAuthorizerRequest updateAuthorizerRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updateAuthorizerRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(updateAuthorizerRequest.getApiId(), APIID_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAuthorizerRequest.getAuthorizerCredentialsArn(), AUTHORIZERCREDENTIALSARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAuthorizerRequest.getAuthorizerId(), AUTHORIZERID_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAuthorizerRequest.getAuthorizerPayloadFormatVersion(), AUTHORIZERPAYLOADFORMATVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAuthorizerRequest.getAuthorizerResultTtlInSeconds(), AUTHORIZERRESULTTTLINSECONDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAuthorizerRequest.getAuthorizerType(), AUTHORIZERTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAuthorizerRequest.getAuthorizerUri(), AUTHORIZERURI_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAuthorizerRequest.getEnableSimpleResponses(), ENABLESIMPLERESPONSES_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(updateAuthorizerRequest.getIdentityValidationExpression(), IDENTITYVALIDATIONEXPRESSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAuthorizerRequest.getJwtConfiguration(), JWTCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAuthorizerRequest.getName(), NAME_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
updateAuthorizerRequest.getIdentitySource(), IDENTITYSOURCE_BINDING);
440,661
protected void initModel(IContainer parent, String text, Image image) {<NEW_LINE>this.nodeStyle |= parent.getGraph().getNodeStyle();<NEW_LINE>this.parent = parent;<NEW_LINE>this.sourceConnections = new ArrayList();<NEW_LINE>this.targetConnections = new ArrayList();<NEW_LINE>this.foreColor <MASK><NEW_LINE>this.backColor = parent.getGraph().LIGHT_BLUE;<NEW_LINE>this.highlightColor = parent.getGraph().HIGHLIGHT_COLOR;<NEW_LINE>// @tag ADJACENT : Removed highlight adjacent<NEW_LINE>// this.highlightAdjacentColor = ColorConstants.orange;<NEW_LINE>this.nodeStyle = SWT.NONE;<NEW_LINE>this.borderColor = ColorConstants.lightGray;<NEW_LINE>this.borderHighlightColor = ColorConstants.blue;<NEW_LINE>this.borderWidth = 1;<NEW_LINE>this.currentLocation = new PrecisionPoint(0, 0);<NEW_LINE>this.size = new Dimension(-1, -1);<NEW_LINE>this.font = Display.getDefault().getSystemFont();<NEW_LINE>this.graph = parent.getGraph();<NEW_LINE>this.cacheLabel = false;<NEW_LINE>this.setText(text);<NEW_LINE>this.layoutEntity = new LayoutGraphNode();<NEW_LINE>if (image != null) {<NEW_LINE>this.setImage(image);<NEW_LINE>}<NEW_LINE>if (font == null) {<NEW_LINE>font = Display.getDefault().getSystemFont();<NEW_LINE>}<NEW_LINE>}
= parent.getGraph().DARK_BLUE;
1,749,335
public byte[] marshall(DeleteVersionsRequest request) {<NEW_LINE>StringBuffer xmlBody = new StringBuffer();<NEW_LINE><MASK><NEW_LINE>List<KeyVersion> keysToDelete = request.getKeys();<NEW_LINE>xmlBody.append("<Delete>");<NEW_LINE>xmlBody.append("<Quiet>" + quiet + "</Quiet>");<NEW_LINE>for (int i = 0; i < keysToDelete.size(); i++) {<NEW_LINE>KeyVersion key = keysToDelete.get(i);<NEW_LINE>xmlBody.append("<Object>");<NEW_LINE>xmlBody.append("<Key>" + escapeKey(key.getKey()) + "</Key>");<NEW_LINE>if (key.getVersion() != null) {<NEW_LINE>xmlBody.append("<VersionId>" + key.getVersion() + "</VersionId>");<NEW_LINE>}<NEW_LINE>xmlBody.append("</Object>");<NEW_LINE>}<NEW_LINE>xmlBody.append("</Delete>");<NEW_LINE>byte[] rawData = null;<NEW_LINE>try {<NEW_LINE>rawData = xmlBody.toString().getBytes(DEFAULT_CHARSET_NAME);<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>throw new ClientException("Unsupported encoding " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>return rawData;<NEW_LINE>}
boolean quiet = request.getQuiet();
332,614
public void report(SortedMap<String, Gauge> gauges, SortedMap<String, Counter> counters, SortedMap<String, Histogram> histograms, SortedMap<String, Meter> meters, SortedMap<String, Timer> timers) {<NEW_LINE>final long timestamp = TimeUnit.MILLISECONDS.<MASK><NEW_LINE>for (Map.Entry<String, Gauge> entry : gauges.entrySet()) {<NEW_LINE>reportGauge(timestamp, entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, Counter> entry : counters.entrySet()) {<NEW_LINE>reportCounter(timestamp, entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, Histogram> entry : histograms.entrySet()) {<NEW_LINE>reportHistogram(timestamp, entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, Meter> entry : meters.entrySet()) {<NEW_LINE>reportMeter(timestamp, entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, Timer> entry : timers.entrySet()) {<NEW_LINE>reportTimer(timestamp, entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>}
toSeconds(clock.getTime());
1,517,749
public PrivateKey parse() throws GeneralSecurityException, IOException {<NEW_LINE>Path path = pemFile.toPath();<NEW_LINE>String privateKeyPem = new String(Files.readAllBytes(path));<NEW_LINE>if (privateKeyPem.contains(PEM_PRIVATE_START)) {<NEW_LINE>// PKCS#8 format<NEW_LINE>privateKeyPem = privateKeyPem.replace(PEM_PRIVATE_START, "").replace(PEM_PRIVATE_END, "").replaceAll("\\s", "");<NEW_LINE>byte[] pkcs8EncodedKey = Base64.getDecoder().decode(privateKeyPem);<NEW_LINE>KeyFactory factory = KeyFactory.getInstance("RSA");<NEW_LINE>return factory.generatePrivate(new PKCS8EncodedKeySpec(pkcs8EncodedKey));<NEW_LINE>} else if (privateKeyPem.contains(PEM_RSA_PRIVATE_START)) {<NEW_LINE>// PKCS#1 format<NEW_LINE>privateKeyPem = privateKeyPem.replace(PEM_RSA_PRIVATE_START, "").replace(PEM_RSA_PRIVATE_END, "").replaceAll("\\s", "");<NEW_LINE>DerParser parser = new DerParser(new ByteArrayInputStream(Base64.getDecoder(<MASK><NEW_LINE>Asn1Object sequence = parser.read();<NEW_LINE>parser = sequence.read();<NEW_LINE>// Skip version<NEW_LINE>parser.read();<NEW_LINE>BigInteger modulus = parser.read().getBigInteger();<NEW_LINE>BigInteger publicExp = parser.read().getBigInteger();<NEW_LINE>BigInteger privateExp = parser.read().getBigInteger();<NEW_LINE>BigInteger prime1 = parser.read().getBigInteger();<NEW_LINE>BigInteger prime2 = parser.read().getBigInteger();<NEW_LINE>BigInteger exp1 = parser.read().getBigInteger();<NEW_LINE>BigInteger exp2 = parser.read().getBigInteger();<NEW_LINE>BigInteger crtCoef = parser.read().getBigInteger();<NEW_LINE>RSAPrivateCrtKeySpec keySpec = new RSAPrivateCrtKeySpec(modulus, publicExp, privateExp, prime1, prime2, exp1, exp2, crtCoef);<NEW_LINE>KeyFactory factory = KeyFactory.getInstance("RSA");<NEW_LINE>return factory.generatePrivate(keySpec);<NEW_LINE>} else {<NEW_LINE>throw new GeneralSecurityException("The format of the key is not supported");<NEW_LINE>}<NEW_LINE>}
).decode(privateKeyPem)));
1,540,747
final CreateStreamingURLResult executeCreateStreamingURL(CreateStreamingURLRequest createStreamingURLRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createStreamingURLRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateStreamingURLRequest> request = null;<NEW_LINE>Response<CreateStreamingURLResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateStreamingURLRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createStreamingURLRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "AppStream");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateStreamingURL");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateStreamingURLResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new CreateStreamingURLResultJsonUnmarshaller());
1,083,849
private DeleteResult cleanupStaleIndices(Map<String, BlobContainer> foundIndices, Set<String> survivingIndexIds) {<NEW_LINE>DeleteResult deleteResult = DeleteResult.ZERO;<NEW_LINE>for (Map.Entry<String, BlobContainer> indexEntry : foundIndices.entrySet()) {<NEW_LINE>final String indexSnId = indexEntry.getKey();<NEW_LINE>try {<NEW_LINE>if (survivingIndexIds.contains(indexSnId) == false) {<NEW_LINE>logger.debug("[{}] Found stale index [{}]. Cleaning it up", <MASK><NEW_LINE>deleteResult = deleteResult.add(indexEntry.getValue().delete());<NEW_LINE>logger.debug("[{}] Cleaned up stale index [{}]", metadata.name(), indexSnId);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.warn(() -> new ParameterizedMessage("[{}] index {} is no longer part of any snapshot in the repository, " + "but failed to clean up its index folder", metadata.name(), indexSnId), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return deleteResult;<NEW_LINE>}
metadata.name(), indexSnId);
91,525
public Future<Boolean> deployModule(DeployedModuleInfo deployedMod, DeployedAppInfo deployedApp) {<NEW_LINE>this.firstFailure = null;<NEW_LINE>ExtendedModuleInfo moduleInfo = deployedMod.getModuleInfo();<NEW_LINE>ModuleMetaData mmd = moduleInfo.getMetaData();<NEW_LINE>if (mmd == null) {<NEW_LINE>deployedApp.uninstallApp();<NEW_LINE>return futureMonitor.createFutureWithResult(false);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>metaDataService.fireModuleMetaDataCreated(mmd, moduleInfo.getContainer());<NEW_LINE>for (ModuleMetaData nestedMMD : moduleInfo.getNestedMetaData()) {<NEW_LINE>metaDataService.fireModuleMetaDataCreated(nestedMMD, moduleInfo.getContainer());<NEW_LINE>}<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>this.firstFailure = ex;<NEW_LINE>deployedApp.uninstallApp();<NEW_LINE>return futureMonitor.createFutureWithResult(Boolean.class, ex);<NEW_LINE>}<NEW_LINE>deployedMod.setIsStarting();<NEW_LINE>try {<NEW_LINE>stateChangeService.fireModuleStarting(moduleInfo);<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>this.firstFailure = ex;<NEW_LINE>deployedApp.uninstallApp();<NEW_LINE>return futureMonitor.createFutureWithResult(Boolean.class, ex);<NEW_LINE>}<NEW_LINE>Future<Boolean> started;<NEW_LINE>try {<NEW_LINE>started = moduleRuntimeContainer.startModule(moduleInfo);<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>this.firstFailure = ex;<NEW_LINE>deployedApp.uninstallApp();<NEW_LINE>return futureMonitor.<MASK><NEW_LINE>}<NEW_LINE>deployedMod.setIsStarted();<NEW_LINE>try {<NEW_LINE>stateChangeService.fireModuleStarted(moduleInfo);<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>this.firstFailure = ex;<NEW_LINE>deployedApp.uninstallApp();<NEW_LINE>return futureMonitor.createFutureWithResult(Boolean.class, ex);<NEW_LINE>}<NEW_LINE>return started;<NEW_LINE>}
createFutureWithResult(Boolean.class, ex);
639,385
private void createMethodMemoryBlocks(Program program, ByteProvider provider, ClassFileJava classFile, TaskMonitor monitor) {<NEW_LINE>AbstractConstantPoolInfoJava[] constantPool = classFile.getConstantPool();<NEW_LINE>MethodInfoJava[] methods = classFile.getMethods();<NEW_LINE>monitor.setMessage("Processing Methods...");<NEW_LINE>monitor.setProgress(0);<NEW_LINE>monitor.setMaximum(methods.length);<NEW_LINE>Address start = toAddr(program, CODE_OFFSET);<NEW_LINE>try {<NEW_LINE>// program.setImageBase(start, true);<NEW_LINE>// for (MethodInfoJava method : methods) {<NEW_LINE>for (int i = 0, max = methods.length; i < max; ++i) {<NEW_LINE>MethodInfoJava method = methods[i];<NEW_LINE>monitor.incrementProgress(1);<NEW_LINE>CodeAttribute code = method.getCodeAttribute();<NEW_LINE>if (code == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int length = code.getCodeLength();<NEW_LINE>long offset = code.getCodeOffset();<NEW_LINE>Memory memory = program.getMemory();<NEW_LINE>int nameIndex = method.getNameIndex();<NEW_LINE>int descriptorIndex = method.getDescriptorIndex();<NEW_LINE>ConstantPoolUtf8Info methodNameInfo = (ConstantPoolUtf8Info) constantPool[nameIndex];<NEW_LINE>ConstantPoolUtf8Info methodDescriptorInfo = (ConstantPoolUtf8Info) constantPool[descriptorIndex];<NEW_LINE>String methodName = methodNameInfo.getString<MASK><NEW_LINE>MemoryBlock memoryBlock = memory.createInitializedBlock(methodName, start, provider.getInputStream(offset), length, monitor, false);<NEW_LINE>Address methodIndexAddress = JavaClassUtil.toLookupAddress(program, i);<NEW_LINE>program.getMemory().setInt(methodIndexAddress, (int) start.getOffset());<NEW_LINE>program.getListing().createData(methodIndexAddress, PointerDataType.dataType);<NEW_LINE>setAlignmentInfo(program, new AddressSet(memoryBlock.getStart(), memoryBlock.getEnd()));<NEW_LINE>start = start.add(length + 1);<NEW_LINE>while (start.getOffset() % 4 != 0) {<NEW_LINE>start = start.add(1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e1) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>e1.printStackTrace();<NEW_LINE>}<NEW_LINE>}
() + methodDescriptorInfo.getString();
1,270,857
private List<DtlsHandshakeMessageFragment> generateFragments(HandshakeMessage message, byte[] handshakeBytes, int maxFragmentLength, TlsContext context) {<NEW_LINE>List<DtlsHandshakeMessageFragment> fragments = new LinkedList<>();<NEW_LINE>int currentOffset = 0;<NEW_LINE>do {<NEW_LINE>byte[] fragmentBytes = Arrays.copyOfRange(handshakeBytes, currentOffset, Math.min(currentOffset + maxFragmentLength, handshakeBytes.length));<NEW_LINE>int sequence;<NEW_LINE>if (message.getMessageSequence() != null) {<NEW_LINE>sequence = message<MASK><NEW_LINE>} else {<NEW_LINE>// it is possible that not all messages are created under a DTLS context such that they do not have a<NEW_LINE>// message sequence<NEW_LINE>sequence = 0;<NEW_LINE>}<NEW_LINE>DtlsHandshakeMessageFragment fragment = new DtlsHandshakeMessageFragment(message.getHandshakeMessageType(), fragmentBytes, sequence, currentOffset, handshakeBytes.length);<NEW_LINE>SendMessageHelper.prepareMessage(fragment, context);<NEW_LINE>fragments.add(fragment);<NEW_LINE>currentOffset += maxFragmentLength;<NEW_LINE>} while (currentOffset < handshakeBytes.length);<NEW_LINE>return fragments;<NEW_LINE>}
.getMessageSequence().getValue();
295,784
private static List<String> readSql() throws IOException {<NEW_LINE>InputStream resourceAsStream = InitialDb.class.getResourceAsStream("/script/governance_" + databaseType + ".sql");<NEW_LINE>StringBuffer sqlBuffer = new StringBuffer();<NEW_LINE>List<String> sqlList = new ArrayList<>();<NEW_LINE>byte[] buff = new byte[1024];<NEW_LINE>int byteRead = 0;<NEW_LINE>while ((byteRead = resourceAsStream.read(buff)) != -1) {<NEW_LINE>sqlBuffer.append(new String(buff, 0, byteRead<MASK><NEW_LINE>}<NEW_LINE>String[] sqlArr = sqlBuffer.toString().split("(;\\s*\\r\\n)|(;\\s*\\n)");<NEW_LINE>for (String s : sqlArr) {<NEW_LINE>String sql = s.replaceAll("--.*", "").trim();<NEW_LINE>if (!("").equals(sql)) {<NEW_LINE>sqlList.add(sql);<NEW_LINE>}<NEW_LINE>resourceAsStream.close();<NEW_LINE>}<NEW_LINE>return sqlList;<NEW_LINE>}
, Charset.defaultCharset()));
224,676
private static void validateParameters(int ikmSize, int keySizeInBytes, String tagAlgo, int tagSizeInBytes, int ciphertextSegmentSize, int firstSegmentOffset) throws InvalidAlgorithmParameterException {<NEW_LINE>if (ikmSize < 16 || ikmSize < keySizeInBytes) {<NEW_LINE>throw new InvalidAlgorithmParameterException("ikm too short, must be >= " + Math.max(16, keySizeInBytes));<NEW_LINE>}<NEW_LINE>Validators.validateAesKeySize(keySizeInBytes);<NEW_LINE>if (tagSizeInBytes < 10) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if ((tagAlgo.equals("HmacSha1") && tagSizeInBytes > 20) || (tagAlgo.equals("HmacSha256") && tagSizeInBytes > 32) || (tagAlgo.equals("HmacSha512") && tagSizeInBytes > 64)) {<NEW_LINE>throw new InvalidAlgorithmParameterException("tag size too big");<NEW_LINE>}<NEW_LINE>int firstPlaintextSegment = ciphertextSegmentSize - firstSegmentOffset - tagSizeInBytes - keySizeInBytes - NONCE_PREFIX_IN_BYTES - 1;<NEW_LINE>if (firstPlaintextSegment <= 0) {<NEW_LINE>throw new InvalidAlgorithmParameterException("ciphertextSegmentSize too small");<NEW_LINE>}<NEW_LINE>}
throw new InvalidAlgorithmParameterException("tag size too small " + tagSizeInBytes);
436,219
Data pollInternal(long timeout) {<NEW_LINE>QueueItem reservedOffer = offeredQueue.peek();<NEW_LINE>long itemId = reservedOffer == null ? -1 : reservedOffer.getItemId();<NEW_LINE>TxnReservePollOperation operation = new TxnReservePollOperation(name, timeout, <MASK><NEW_LINE>operation.setCallerUuid(tx.getOwnerUuid());<NEW_LINE>try {<NEW_LINE>Future<QueueItem> future = invoke(operation);<NEW_LINE>QueueItem item = future.get();<NEW_LINE>if (item != null) {<NEW_LINE>if (reservedOffer != null && item.getItemId() == reservedOffer.getItemId()) {<NEW_LINE>offeredQueue.poll();<NEW_LINE>removeFromRecord(reservedOffer.getItemId());<NEW_LINE>itemIdSet.remove(reservedOffer.getItemId());<NEW_LINE>return reservedOffer.getSerializedObject();<NEW_LINE>}<NEW_LINE>//<NEW_LINE>if (!itemIdSet.add(item.getItemId())) {<NEW_LINE>throw new TransactionException("Duplicate itemId: " + item.getItemId());<NEW_LINE>}<NEW_LINE>TxnPollOperation txnPollOperation = new TxnPollOperation(name, item.getItemId());<NEW_LINE>putToRecord(txnPollOperation);<NEW_LINE>return item.getSerializedObject();<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw ExceptionUtil.rethrow(t);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
itemId, tx.getTxnId());
1,106,565
final GetDiskSnapshotsResult executeGetDiskSnapshots(GetDiskSnapshotsRequest getDiskSnapshotsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getDiskSnapshotsRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetDiskSnapshotsRequest> request = null;<NEW_LINE>Response<GetDiskSnapshotsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetDiskSnapshotsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getDiskSnapshotsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Lightsail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDiskSnapshots");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetDiskSnapshotsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDiskSnapshotsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,438,536
private List<Object> buildClassPath0(List<Object> classPath0) {<NEW_LINE>final long start = clock();<NEW_LINE>final List<Object> classPath = new ArrayList<>();<NEW_LINE>// The caplets and capsule jars<NEW_LINE>if (!isWrapperOfNonCapsule() && getAttribute(ATTR_CAPSULE_IN_CLASS_PATH))<NEW_LINE>addCapsuleJars(classPath);<NEW_LINE>if (hasAttribute(ATTR_APP_ARTIFACT)) {<NEW_LINE><MASK><NEW_LINE>if (isGlob(artifact))<NEW_LINE>throw new IllegalArgumentException("Glob pattern not allowed in " + ATTR_APP_ARTIFACT + " attribute.");<NEW_LINE>final Object app = lookup((isWrapperOfNonCapsule() && !isDependency(artifact)) ? toAbsolutePath(path(artifact)).toString() : sanitize(artifact), ATTR_APP_ARTIFACT);<NEW_LINE>classPath.add(app);<NEW_LINE>}<NEW_LINE>addAllIfAbsent(classPath, classPath0);<NEW_LINE>classPath.add(lookup("*.jar", ATTR_APP_CLASS_PATH));<NEW_LINE>classPath.addAll(nullToEmpty(getAttribute(ATTR_DEPENDENCIES)));<NEW_LINE>// The caplets and capsule jars<NEW_LINE>if (!isWrapperOfNonCapsule() && isDeepEmpty(classPath))<NEW_LINE>addCapsuleJars(classPath);<NEW_LINE>// Remove duplicate JARs while preserving order<NEW_LINE>final List<Object> ret = new ArrayList<>(new LinkedHashSet<>(classPath));<NEW_LINE>time("buildClassPath", start);<NEW_LINE>return ret;<NEW_LINE>}
final String artifact = getAttribute(ATTR_APP_ARTIFACT);
329,125
public List<List<Integer>> zigzagLevelOrder(TreeNode root) {<NEW_LINE>if (root == null) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>Deque<TreeNode> q = new ArrayDeque<>();<NEW_LINE>q.offer(root);<NEW_LINE>boolean left = false;<NEW_LINE>List<List<Integer>> ans = new ArrayList<>();<NEW_LINE>while (!q.isEmpty()) {<NEW_LINE>List<Integer> <MASK><NEW_LINE>for (int i = 0, n = q.size(); i < n; ++i) {<NEW_LINE>TreeNode node = q.pollFirst();<NEW_LINE>t.add(node.val);<NEW_LINE>if (node.left != null) {<NEW_LINE>q.offer(node.left);<NEW_LINE>}<NEW_LINE>if (node.right != null) {<NEW_LINE>q.offer(node.right);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (left) {<NEW_LINE>Collections.reverse(t);<NEW_LINE>}<NEW_LINE>ans.add(t);<NEW_LINE>left = !left;<NEW_LINE>}<NEW_LINE>return ans;<NEW_LINE>}
t = new ArrayList<>();
686,513
private boolean startDownloadRpc(FileReferenceDownload fileReferenceDownload, int retryCount, Connection connection) {<NEW_LINE>Request request = createRequest(fileReferenceDownload);<NEW_LINE>Duration rpcTimeout = rpcTimeout(retryCount);<NEW_LINE>connection.invokeSync(request, rpcTimeout.getSeconds());<NEW_LINE>Level logLevel = (retryCount > 3 ? Level.INFO : Level.FINE);<NEW_LINE>FileReference fileReference = fileReferenceDownload.fileReference();<NEW_LINE>if (validateResponse(request)) {<NEW_LINE>log.log(Level.FINE, () -> "Request callback, OK. Req: " + request + "\nSpec: " + connection);<NEW_LINE>if (request.returnValues().get(0).asInt32() == 0) {<NEW_LINE>log.log(Level.FINE, () -> "Found " + fileReference + " available at " + connection.getAddress());<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>log.log(logLevel, fileReference + " not found at " + connection.getAddress());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>log.log(logLevel, "Downloading " + fileReference + " from " + connection.getAddress() + " failed:" + " error code " + request.errorCode() + " (" + request.errorMessage() + ")." + " (retry " + <MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
retryCount + ", rpc timeout " + rpcTimeout + ")");
74,234
private Flow convertAzkabanFlowToFlow(final AzkabanFlow azkabanFlow, final String flowName, final File flowFile) {<NEW_LINE>final Flow flow = new Flow(flowName);<NEW_LINE>flow.setAzkabanFlowVersion(Constants.AZKABAN_FLOW_VERSION_2_0);<NEW_LINE>final Props props = azkabanFlow.getProps();<NEW_LINE><MASK><NEW_LINE>String failureAction = props.getString(FAILURE_ACTION_PROPERTY, null);<NEW_LINE>if (failureAction != null) {<NEW_LINE>flow.setFailureAction(failureAction);<NEW_LINE>}<NEW_LINE>props.setSource(flowFile.getName());<NEW_LINE>flow.addAllFlowProperties(ImmutableList.of(ImmutableFlowProps.createFlowProps(props)));<NEW_LINE>// Convert azkabanNodes to nodes inside the flow.<NEW_LINE>azkabanFlow.getNodes().values().stream().map(n -> convertAzkabanNodeToNode(n, flowName, flowFile, azkabanFlow)).forEach(n -> flow.addNode(n));<NEW_LINE>// Add edges for the flow.<NEW_LINE>buildFlowEdges(azkabanFlow, flowName);<NEW_LINE>if (this.edgeMap.containsKey(flowName)) {<NEW_LINE>flow.addAllEdges(this.edgeMap.get(flowName));<NEW_LINE>}<NEW_LINE>// Todo jamiesjc: deprecate startNodes, endNodes and numLevels, and remove below method finally.<NEW_LINE>// Blow method will construct startNodes, endNodes and numLevels for the flow.<NEW_LINE>flow.initialize();<NEW_LINE>return flow;<NEW_LINE>}
FlowLoaderUtils.addEmailPropsToFlow(flow, props);
92,476
private Intent createOpenUrlIntentFrom(KrollInvocation invocation, String url) {<NEW_LINE>// Validate argument.<NEW_LINE>if ((url == null) || url.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Create a URI object from the given string.<NEW_LINE>Uri uri = null;<NEW_LINE>if (TiFileFactory.isLocalScheme(url)) {<NEW_LINE>String resolvedUrl = url;<NEW_LINE>if (invocation != null) {<NEW_LINE>TiUrl tiUrl = TiUrl.createProxyUrl(invocation.getSourceUrl());<NEW_LINE>resolvedUrl = TiUrl.resolve(tiUrl.baseUrl, url, null);<NEW_LINE>}<NEW_LINE>TiBaseFile tiFile = TiFileFactory.createTitaniumFile(resolvedUrl, false);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (uri == null) {<NEW_LINE>uri = Uri.parse(url);<NEW_LINE>if (uri == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Fetch the URL's scheme.<NEW_LINE>String scheme = uri.getScheme();<NEW_LINE>if (scheme == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Create an intent for the given URL.<NEW_LINE>Intent intent = null;<NEW_LINE>if (scheme.equals("tel")) {<NEW_LINE>intent = new Intent(Intent.ACTION_DIAL, uri);<NEW_LINE>} else {<NEW_LINE>intent = new Intent(Intent.ACTION_VIEW, uri);<NEW_LINE>try {<NEW_LINE>String mimeType = null;<NEW_LINE>if (scheme.equals(ContentResolver.SCHEME_CONTENT)) {<NEW_LINE>mimeType = TiApplication.getInstance().getContentResolver().getType(uri);<NEW_LINE>} else if (scheme.equals(ContentResolver.SCHEME_FILE)) {<NEW_LINE>mimeType = TiMimeTypeHelper.getMimeType(uri, null);<NEW_LINE>}<NEW_LINE>if ((mimeType != null) && (mimeType.length() > 0)) {<NEW_LINE>intent.setDataAndType(uri, mimeType);<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return intent;<NEW_LINE>}
uri = TiFileProvider.createUriFrom(tiFile);
1,015,961
private static String md5(final String src, final String charset) {<NEW_LINE>MessageDigest md5;<NEW_LINE>StringBuilder hexValue = new StringBuilder(32);<NEW_LINE>try {<NEW_LINE>md5 = MessageDigest.getInstance("MD5");<NEW_LINE>} catch (NoSuchAlgorithmException e) {<NEW_LINE>throw new ShenyuException("MD5 not supported", e);<NEW_LINE>}<NEW_LINE>byte[<MASK><NEW_LINE>try {<NEW_LINE>byteArray = src.getBytes(charset);<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>LOG.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>byte[] md5Bytes = md5.digest(byteArray);<NEW_LINE>for (byte md5Byte : md5Bytes) {<NEW_LINE>int val = ((int) md5Byte) & 0xff;<NEW_LINE>if (val < 16) {<NEW_LINE>hexValue.append("0");<NEW_LINE>}<NEW_LINE>hexValue.append(Integer.toHexString(val));<NEW_LINE>}<NEW_LINE>return hexValue.toString();<NEW_LINE>}
] byteArray = new byte[0];
281,133
public NodeModel addFreeNode(final Point pt, final boolean newNodeIsLeft) {<NEW_LINE>final ModeController modeController = Controller.getCurrentModeController();<NEW_LINE>final TextController textController = TextController.getController();<NEW_LINE>if (textController instanceof MTextController) {<NEW_LINE>((MTextController) textController).stopInlineEditing();<NEW_LINE>modeController.forceNewTransaction();<NEW_LINE>}<NEW_LINE>final NodeModel target = getRootNode();<NEW_LINE>final NodeModel targetNode = target;<NEW_LINE><MASK><NEW_LINE>if (parentFolded) {<NEW_LINE>unfold(targetNode, modeController.getController().getSelection().getFilter());<NEW_LINE>}<NEW_LINE>if (!isWriteable(target)) {<NEW_LINE>UITools.errorMessage(TextUtils.getText("node_is_write_protected"));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final NodeModel newNode = newNode("", target.getMap());<NEW_LINE>LogicalStyleModel.createExtension(newNode).setStyle(MapStyleModel.FLOATING_STYLE);<NEW_LINE>newNode.addExtension(modeController.getExtension(FreeNode.class));<NEW_LINE>if (!addNewNode(newNode, target, target.getChildCount(), newNodeIsLeft))<NEW_LINE>return null;<NEW_LINE>final Quantity<LengthUnit> x = LengthUnit.pixelsInPt(pt.x);<NEW_LINE>final Quantity<LengthUnit> y = LengthUnit.pixelsInPt(pt.y);<NEW_LINE>((MLocationController) MLocationController.getController(modeController)).moveNodePosition(newNode, x, y);<NEW_LINE>final Component component = Controller.getCurrentController().getMapViewManager().getComponent(newNode);<NEW_LINE>if (component == null)<NEW_LINE>return newNode;<NEW_LINE>component.addFocusListener(new FocusListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void focusLost(FocusEvent e) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void focusGained(FocusEvent e) {<NEW_LINE>e.getComponent().removeFocusListener(this);<NEW_LINE>((MTextController) textController).edit(newNode, targetNode, true, false, false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>select(newNode);<NEW_LINE>return newNode;<NEW_LINE>}
final boolean parentFolded = isFolded(targetNode);
1,628,021
@Path("/{jpaQuery}")<NEW_LINE>public Response executeDeleteJPAQuery(@Context HttpHeaders headers, @Context UriInfo info, String parameters) {<NEW_LINE>String jpaQuery = info.getPathParameters().getFirst("jpaQuery");<NEW_LINE>String params = info.getRequestUri().getQuery();<NEW_LINE>String sessionToken = headers.getRequestHeader(Constants.SESSION_TOKEN_HEADER_NAME).get(0);<NEW_LINE>sessionToken = <MASK><NEW_LINE>String mediaType = headers != null && headers.getRequestHeaders().containsKey("Content-type") ? headers.getRequestHeader("Content-type").get(0) : MediaType.APPLICATION_JSON;<NEW_LINE>mediaType = mediaType.equalsIgnoreCase(MediaType.APPLICATION_XML) ? MediaType.APPLICATION_XML : MediaType.APPLICATION_JSON;<NEW_LINE>if (log.isDebugEnabled())<NEW_LINE>log.debug("GET: sessionToken:" + sessionToken + ", jpaQuery:" + jpaQuery + ", Media Type:" + mediaType);<NEW_LINE>if (!EntityUtils.isValidQuery(jpaQuery, HttpMethod.DELETE)) {<NEW_LINE>log.error("Incorrect HTTP method POST for query:" + jpaQuery);<NEW_LINE>return Response.noContent().build();<NEW_LINE>}<NEW_LINE>int result = executeWrite(jpaQuery, params, sessionToken, parameters, mediaType);<NEW_LINE>if (log.isDebugEnabled())<NEW_LINE>log.debug("GET: Result for JPA Query: " + result);<NEW_LINE>if (result < 0) {<NEW_LINE>return Response.noContent().build();<NEW_LINE>}<NEW_LINE>return Response.ok(result, mediaType).build();<NEW_LINE>}
sessionToken.replaceAll("^\"|\"$", "");
19,057
public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String stmtTextCreateOne = namedWindow ? "@name('create') @public create window MyInfraDC#keepall as (f1 string, f2 int, f3 string, f4 string)" : "@name('create') @public create table MyInfraDC as (f1 string primary key, f2 int primary key, f3 string primary key, f4 string primary key)";<NEW_LINE>env.compileDeploy(stmtTextCreateOne, path);<NEW_LINE>env.compileDeploy("insert into MyInfraDC(f1, f2, f3, f4) select theString, intPrimitive, '>'||theString||'<', '?'||theString||'?' from SupportBean", path);<NEW_LINE>env.compileDeploy("@name('indexOne') create index MyInfraDCIndex1 on MyInfraDC(f1)", path);<NEW_LINE>env.compileDeploy("@name('indexTwo') create index MyInfraDCIndex2 on MyInfraDC(f4)", path);<NEW_LINE>String[] fields = "f1,f2".split(",");<NEW_LINE>env.sendEventBean(new SupportBean("E1", -2));<NEW_LINE>env.undeployModuleContaining("indexOne");<NEW_LINE>EPFireAndForgetQueryResult result = env.compileExecuteFAF("select * from MyInfraDC where f1='E1'", path);<NEW_LINE>EPAssertionUtil.assertPropsPerRow(result.getArray(), fields, new Object[][] { { "E1", -2 } });<NEW_LINE>result = env.compileExecuteFAF("select * from MyInfraDC where f4='?E1?'", path);<NEW_LINE>EPAssertionUtil.assertPropsPerRow(result.getArray(), fields, new Object[][] { { "E1", -2 } });<NEW_LINE>env.undeployModuleContaining("indexTwo");<NEW_LINE>result = env.compileExecuteFAF("select * from MyInfraDC where f1='E1'", path);<NEW_LINE>EPAssertionUtil.assertPropsPerRow(result.getArray(), fields, new Object[][] { { "E1", -2 } });<NEW_LINE>result = env.compileExecuteFAF("select * from MyInfraDC where f4='?E1?'", path);<NEW_LINE>EPAssertionUtil.assertPropsPerRow(result.getArray(), fields, new Object[][] { { "E1", -2 } });<NEW_LINE>path.getCompileds().remove(path.getCompileds().size() - 1);<NEW_LINE><MASK><NEW_LINE>result = env.compileExecuteFAF("select * from MyInfraDC where f1='E1'", path);<NEW_LINE>EPAssertionUtil.assertPropsPerRow(result.getArray(), fields, new Object[][] { { "E1", -2 } });<NEW_LINE>result = env.compileExecuteFAF("select * from MyInfraDC where f4='?E1?'", path);<NEW_LINE>EPAssertionUtil.assertPropsPerRow(result.getArray(), fields, new Object[][] { { "E1", -2 } });<NEW_LINE>env.undeployModuleContaining("IndexThree");<NEW_LINE>assertEquals(namedWindow ? 0 : 1, getIndexCount(env, namedWindow, "create", "MyInfraDC"));<NEW_LINE>env.undeployAll();<NEW_LINE>}
env.compileDeploy("@name('IndexThree') create index MyInfraDCIndex2 on MyInfraDC(f4)", path);
402,223
public static DetectVehicleResponse unmarshall(DetectVehicleResponse detectVehicleResponse, UnmarshallerContext _ctx) {<NEW_LINE>detectVehicleResponse.setRequestId<MASK><NEW_LINE>Data data = new Data();<NEW_LINE>data.setWidth(_ctx.integerValue("DetectVehicleResponse.Data.Width"));<NEW_LINE>data.setHeight(_ctx.integerValue("DetectVehicleResponse.Data.Height"));<NEW_LINE>List<DetectObjectInfo> detectObjectInfoList = new ArrayList<DetectObjectInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DetectVehicleResponse.Data.DetectObjectInfoList.Length"); i++) {<NEW_LINE>DetectObjectInfo detectObjectInfo = new DetectObjectInfo();<NEW_LINE>detectObjectInfo.setType(_ctx.stringValue("DetectVehicleResponse.Data.DetectObjectInfoList[" + i + "].Type"));<NEW_LINE>detectObjectInfo.setScore(_ctx.floatValue("DetectVehicleResponse.Data.DetectObjectInfoList[" + i + "].Score"));<NEW_LINE>detectObjectInfo.setId(_ctx.integerValue("DetectVehicleResponse.Data.DetectObjectInfoList[" + i + "].Id"));<NEW_LINE>List<Integer> boxes = new ArrayList<Integer>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DetectVehicleResponse.Data.DetectObjectInfoList[" + i + "].Boxes.Length"); j++) {<NEW_LINE>boxes.add(_ctx.integerValue("DetectVehicleResponse.Data.DetectObjectInfoList[" + i + "].Boxes[" + j + "]"));<NEW_LINE>}<NEW_LINE>detectObjectInfo.setBoxes(boxes);<NEW_LINE>detectObjectInfoList.add(detectObjectInfo);<NEW_LINE>}<NEW_LINE>data.setDetectObjectInfoList(detectObjectInfoList);<NEW_LINE>detectVehicleResponse.setData(data);<NEW_LINE>return detectVehicleResponse;<NEW_LINE>}
(_ctx.stringValue("DetectVehicleResponse.RequestId"));
160,479
private String renderAfterAuthentication(HttpServletRequest request, HttpServletResponse response, BiFunction<HttpServletRequest, HttpServletResponse, String> renderer) {<NEW_LINE>if (!authToken.isValid()) {<NEW_LINE>response.setStatus(422);<NEW_LINE>return "Please setup business continuity according to the documentation at https://extensions-docs.gocd.org/business-continuity/" + CurrentGoCDVersion.getInstance().goVersion();<NEW_LINE>}<NEW_LINE>HttpSession session = request.getSession();<NEW_LINE>UsernamePassword usernamePassword = extractBasicAuthenticationCredentials(request.getHeader("Authorization"));<NEW_LINE>UsernamePassword credentialsOnDisk = authToken.toUsernamePassword();<NEW_LINE>UsernamePassword existingCredentialsInSession = (UsernamePassword) session.getAttribute(CREDENTIALS_KEY);<NEW_LINE>HashSet<UsernamePassword> submittedPasswords = Sets.newHashSet(usernamePassword, existingCredentialsInSession);<NEW_LINE>submittedPasswords.remove(null);<NEW_LINE>if (submittedPasswords.isEmpty()) {<NEW_LINE>return forceBasicAuth(request, response);<NEW_LINE>}<NEW_LINE>if (submittedPasswords.stream().allMatch(up -> up.equals(credentialsOnDisk))) {<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>if (credentialsOnDisk.equals(usernamePassword)) {<NEW_LINE>session.invalidate();<NEW_LINE>loginCurrentUser(request, request.getSession(true), usernamePassword);<NEW_LINE>return renderer.apply(request, response);<NEW_LINE>}<NEW_LINE>return forceBasicAuth(request, response);<NEW_LINE>}
renderer.apply(request, response);
528,515
public List<T> applyFuzzy(List<T> target, int maxFuzz) throws PatchFailedException {<NEW_LINE>PatchApplyingContext<T> ctx = new PatchApplyingContext<>(new ArrayList<>(target), maxFuzz);<NEW_LINE>// the difference between patch's position and actually applied position<NEW_LINE>int lastPatchDelta = 0;<NEW_LINE>for (AbstractDelta<T> delta : getDeltas()) {<NEW_LINE>ctx.defaultPosition = delta.getSource<MASK><NEW_LINE>int patchPosition = findPositionFuzzy(ctx, delta);<NEW_LINE>if (0 <= patchPosition) {<NEW_LINE>delta.applyFuzzyToAt(ctx.result, ctx.currentFuzz, patchPosition);<NEW_LINE>lastPatchDelta = patchPosition - delta.getSource().getPosition();<NEW_LINE>ctx.lastPatchEnd = delta.getSource().last() + lastPatchDelta;<NEW_LINE>} else {<NEW_LINE>conflictOutput.processConflict(VerifyChunk.CONTENT_DOES_NOT_MATCH_TARGET, delta, ctx.result);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ctx.result;<NEW_LINE>}
().getPosition() + lastPatchDelta;
733,142
protected Control createDialogArea(Composite parent) {<NEW_LINE>Composite parentComposite = (Composite) super.createDialogArea(parent);<NEW_LINE>Composite composite = new Composite(parentComposite, SWT.NULL);<NEW_LINE>GridLayout layout = new GridLayout();<NEW_LINE>layout.marginHeight = 10;<NEW_LINE>layout.marginWidth = 10;<NEW_LINE>layout.numColumns = 2;<NEW_LINE>layout.makeColumnsEqualWidth = false;<NEW_LINE>composite.setLayout(layout);<NEW_LINE>composite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());<NEW_LINE>extensionsList = new TreeViewer(composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);<NEW_LINE>stylers = new Stylers(extensionsList.getTree().getFont());<NEW_LINE>extensionsList.getTree().addDisposeListener(e -> stylers.dispose());<NEW_LINE>extensionsList.setLabelProvider(new ExtensionLabelProvider());<NEW_LINE>extensionsList.setContentProvider(EXTENSIONS_CONTENT_PROVIDER_INSTANCE);<NEW_LINE>extensionsList.getTree().setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());<NEW_LINE>extensionsList.addSelectionChangedListener(selectionEvent -> selectionChanged());<NEW_LINE>Composite actionsComposite = new Composite(composite, SWT.NULL);<NEW_LINE>actionsComposite.setLayout(GridLayoutFactory.fillDefaults().create());<NEW_LINE>actionsComposite.setLayoutData(GridDataFactory.fillDefaults().create());<NEW_LINE>installButton = new Button(actionsComposite, SWT.PUSH);<NEW_LINE>installButton.setText("Install");<NEW_LINE>installButton.setLayoutData(GridDataFactory.fillDefaults().create());<NEW_LINE>installButton.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>if (selected != null) {<NEW_LINE>selected.install();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>uninstallButton = new Button(actionsComposite, SWT.PUSH);<NEW_LINE>uninstallButton.setText("Uninstall");<NEW_LINE>uninstallButton.setLayoutData(GridDataFactory.fillDefaults().create());<NEW_LINE>uninstallButton.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>if (selected != null) {<NEW_LINE>selected.uninstall();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>GridData gridData = GridDataFactory.copyData((GridData) actionsComposite.getLayoutData());<NEW_LINE>gridData.widthHint = actionsComposite.computeSize(SWT.<MASK><NEW_LINE>actionsComposite.setLayoutData(gridData);<NEW_LINE>updateButtons();<NEW_LINE>setTitle("Spring Boot CLI Extensions");<NEW_LINE>if (install instanceof ZippedBootInstall) {<NEW_LINE>setMessage("Read-only list of extensions installed automatically", IMessageProvider.INFORMATION);<NEW_LINE>} else {<NEW_LINE>setMessage("Manage extensions for Spring Boot CLI installations");<NEW_LINE>}<NEW_LINE>loadExtensions();<NEW_LINE>return parentComposite;<NEW_LINE>}
DEFAULT, SWT.DEFAULT).x;
1,008,546
final BatchGetTracesResult executeBatchGetTraces(BatchGetTracesRequest batchGetTracesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(batchGetTracesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<BatchGetTracesRequest> request = null;<NEW_LINE>Response<BatchGetTracesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new BatchGetTracesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(batchGetTracesRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "XRay");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "BatchGetTraces");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<BatchGetTracesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new BatchGetTracesResultJsonUnmarshaller());