idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,158,380
private void rebuildToolbar() {<NEW_LINE>toolbar.removeAll();<NEW_LINE>toolbar.setFocusable(false);<NEW_LINE>// scope buttons<NEW_LINE>List<TaskScanningScope> scopes = ScanningScopeList.getDefault().getTaskScanningScopes();<NEW_LINE>for (TaskScanningScope scope : scopes) {<NEW_LINE>final ScopeButton scopeButton <MASK><NEW_LINE>scopeButton.setSelected(scope.equals(Settings.getDefault().getActiveScanningScope()));<NEW_LINE>toolbar.add(scopeButton);<NEW_LINE>}<NEW_LINE>toolbar.add(new JToolBar.Separator());<NEW_LINE>// filter<NEW_LINE>JToggleButton toggleFilter = new FiltersMenuButton(filters.getActive());<NEW_LINE>toolbar.add(toggleFilter);<NEW_LINE>// grouping & other butons<NEW_LINE>toolbar.addSeparator();<NEW_LINE>// NOI18N<NEW_LINE>final JToggleButton toggleGroups = new JToggleButton(ImageUtilities.loadImageIcon("org/netbeans/modules/tasklist/ui/resources/groups.png", false));<NEW_LINE>toggleGroups.addItemListener(new ItemListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void itemStateChanged(ItemEvent e) {<NEW_LINE>switchTableModel(e.getStateChange() == ItemEvent.SELECTED);<NEW_LINE>Settings.getDefault().setGroupTasksByCategory(toggleGroups.isSelected());<NEW_LINE>toggleGroups.setToolTipText(// NOI18N<NEW_LINE>toggleGroups.isSelected() ? // NOI18N<NEW_LINE>NbBundle.getMessage(TaskListTopComponent.class, "HINT_TasksAsList") : NbBundle.getMessage(TaskListTopComponent.class, "HINT_GrouppedTasks"));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>toggleGroups.setSelected(Settings.getDefault().getGroupTasksByCategory());<NEW_LINE>toggleGroups.setToolTipText(// NOI18N<NEW_LINE>toggleGroups.isSelected() ? // NOI18N<NEW_LINE>NbBundle.getMessage(TaskListTopComponent.class, "HINT_TasksAsList") : NbBundle.getMessage(TaskListTopComponent.class, "HINT_GrouppedTasks"));<NEW_LINE>toggleGroups.setFocusable(false);<NEW_LINE>toolbar.add(toggleGroups);<NEW_LINE>}
= new ScopeButton(taskManager, scope);
1,445,726
public void postInitialize(Python3Core core) {<NEW_LINE>super.postInitialize(core);<NEW_LINE>PythonContext context = core.getContext();<NEW_LINE>PythonModule mod = core.lookupBuiltinModule(__GRAALPYTHON__);<NEW_LINE>PythonLanguage language = context.getLanguage();<NEW_LINE>if (!ImageInfo.inImageBuildtimeCode()) {<NEW_LINE>mod.setAttribute("home", language.getHome());<NEW_LINE>}<NEW_LINE>mod.setAttribute("in_image_buildtime", ImageInfo.inImageBuildtimeCode());<NEW_LINE>mod.setAttribute(<MASK><NEW_LINE>String coreHome = context.getCoreHome();<NEW_LINE>String stdlibHome = context.getStdlibHome();<NEW_LINE>String capiHome = context.getCAPIHome();<NEW_LINE>Env env = context.getEnv();<NEW_LINE>LanguageInfo llvmInfo = env.getInternalLanguages().get(PythonLanguage.LLVM_LANGUAGE);<NEW_LINE>Toolchain toolchain = env.lookup(llvmInfo, Toolchain.class);<NEW_LINE>mod.setAttribute("jython_emulation_enabled", language.getEngineOption(PythonOptions.EmulateJython));<NEW_LINE>mod.setAttribute("host_import_enabled", context.getEnv().isHostLookupAllowed());<NEW_LINE>mod.setAttribute("core_home", coreHome);<NEW_LINE>mod.setAttribute("stdlib_home", stdlibHome);<NEW_LINE>mod.setAttribute("capi_home", capiHome);<NEW_LINE>mod.setAttribute("jni_home", context.getJNIHome());<NEW_LINE>mod.setAttribute("platform_id", toolchain.getIdentifier());<NEW_LINE>Object[] arr = convertToObjectArray(PythonOptions.getExecutableList(context));<NEW_LINE>PList executableList = PythonObjectFactory.getUncached().createList(arr);<NEW_LINE>mod.setAttribute("executable_list", executableList);<NEW_LINE>mod.setAttribute("ForeignType", core.lookupType(PythonBuiltinClassType.ForeignObject));<NEW_LINE>if (!context.getOption(PythonOptions.EnableDebuggingBuiltins)) {<NEW_LINE>mod.setAttribute("dump_truffle_ast", PNone.NO_VALUE);<NEW_LINE>mod.setAttribute("tdebug", PNone.NO_VALUE);<NEW_LINE>mod.setAttribute("set_storage_strategy", PNone.NO_VALUE);<NEW_LINE>mod.setAttribute("dump_heap", PNone.NO_VALUE);<NEW_LINE>}<NEW_LINE>}
"in_image", ImageInfo.inImageCode());
1,181,209
public static IMouseStateChange exitNode(final CStateFactory<?, ?> m_factory, final MouseEvent event, final HitInfo hitInfo, final IMouseState state) {<NEW_LINE>if (hitInfo.hasHitNodeLabels()) {<NEW_LINE>throw new IllegalStateException();<NEW_LINE>} else if (hitInfo.hasHitEdges()) {<NEW_LINE>return CHitEdgesTransformer.enterEdge(m_factory, event, hitInfo);<NEW_LINE>} else if (hitInfo.hasHitEdgeLabels()) {<NEW_LINE>return CHitEdgeLabelsTransformer.enterEdgeLabel(m_factory, event, hitInfo);<NEW_LINE>} else if (hitInfo.hasHitBends()) {<NEW_LINE>return CHitBendsTransformer.enterBend(m_factory, event, hitInfo);<NEW_LINE>} else if (hitInfo.hasHitPorts()) {<NEW_LINE>return new CStateChange(state, true);<NEW_LINE>} else {<NEW_LINE>// TODO @Nils please check if this change does not break BinDiff behavior<NEW_LINE>// It fixes case 4207.<NEW_LINE>// return new CStateChange(m_factory.createDefaultState(), true);<NEW_LINE>return new CStateChange(<MASK><NEW_LINE>}<NEW_LINE>}
m_factory.createDefaultState(), false);
283,960
public Optional<Node<S, A>> findNode(Problem<S, A> problem, Queue<Node<S, A>> frontier) {<NEW_LINE>clearMetrics();<NEW_LINE>this.frontier = frontier;<NEW_LINE>nodeComparator = (frontier instanceof PriorityQueue<?>) ? ((PriorityQueue<Node<S, A>>) frontier).comparator() : null;<NEW_LINE>Node<S, A> root = nodeFactory.createNode(problem.getInitialState());<NEW_LINE>// / frontier <- a queue initially containing one path, for the problem's initial state<NEW_LINE>// / reached <- a table of {state: node}; initially empty<NEW_LINE>// / solution <- failure<NEW_LINE>addToFrontier(root);<NEW_LINE>Hashtable<S, Node<S, A>> reached = new Hashtable<>();<NEW_LINE>Node<MASK><NEW_LINE>// missing in pseudocode...<NEW_LINE>// initial state has been reached!<NEW_LINE>reached.put(root.getState(), root);<NEW_LINE>if (// initial state can be a goal state<NEW_LINE>problem.testSolution(root))<NEW_LINE>return asOptional(root);<NEW_LINE>// / while frontier is not empty and solution can possibly be improved do<NEW_LINE>while (!frontier.isEmpty() && canPossiblyBeImproved(solution) && !Tasks.currIsCancelled()) {<NEW_LINE>// / parent <- some node that we choose to remove from frontier<NEW_LINE>Node<S, A> parent = removeFromFrontier();<NEW_LINE>// missing in pseudocode (a better path might have been found for the state)<NEW_LINE>if (reached.get(parent.getState()) != parent)<NEW_LINE>continue;<NEW_LINE>// / for child in EXPAND(parent) do<NEW_LINE>for (Node<S, A> child : nodeFactory.getSuccessors(parent, problem)) {<NEW_LINE>// / s <- child.state<NEW_LINE>S s = child.getState();<NEW_LINE>// / if s is not in reached or child is a cheaper path than reached[s] then<NEW_LINE>if (isCheaper(child, reached.get(s))) {<NEW_LINE>// / reached[s] <- child<NEW_LINE>reached.put(s, child);<NEW_LINE>// / add child to frontier<NEW_LINE>addToFrontier(child);<NEW_LINE>// / if s is a goal and child is cheaper than solution then<NEW_LINE>if (problem.testSolution(child) && isCheaper(child, solution))<NEW_LINE>// / solution = child<NEW_LINE>solution = child;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// / return solution<NEW_LINE>return asOptional(solution);<NEW_LINE>}
<S, A> solution = null;
268,504
private void handleUnManagedOSDiskContainers() {<NEW_LINE>if (this.innerModel() == null || this.innerModel().virtualMachineProfile() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final VirtualMachineScaleSetStorageProfile storageProfile = innerModel().virtualMachineProfile().storageProfile();<NEW_LINE>if (isManagedDiskEnabled()) {<NEW_LINE>storageProfile.osDisk().withVhdContainers(null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (isOSDiskFromStoredImage(storageProfile)) {<NEW_LINE>// There is a restriction currently that virtual machine's disk cannot be stored in multiple storage<NEW_LINE>// accounts if scale set is based on stored image. Remove this check once azure start supporting it.<NEW_LINE>//<NEW_LINE>storageProfile.osDisk().vhdContainers().clear();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String containerName = null;<NEW_LINE>for (String containerUrl : storageProfile.osDisk().vhdContainers()) {<NEW_LINE>containerName = containerUrl.substring(containerUrl.lastIndexOf("/") + 1);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (containerName == null) {<NEW_LINE>containerName = "vhds";<NEW_LINE>}<NEW_LINE>if (isInCreateMode() && this.creatableStorageAccountKeys.isEmpty() && this.existingStorageAccountsToAssociate.isEmpty()) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalStateException("Expected storage account(s) for VMSS OS disk containers not found"));<NEW_LINE>}<NEW_LINE>for (String storageAccountKey : this.creatableStorageAccountKeys) {<NEW_LINE>StorageAccount storageAccount = this<MASK><NEW_LINE>storageProfile.osDisk().vhdContainers().add(mergePath(storageAccount.endPoints().primary().blob(), containerName));<NEW_LINE>}<NEW_LINE>for (StorageAccount storageAccount : this.existingStorageAccountsToAssociate) {<NEW_LINE>storageProfile.osDisk().vhdContainers().add(mergePath(storageAccount.endPoints().primary().blob(), containerName));<NEW_LINE>}<NEW_LINE>this.creatableStorageAccountKeys.clear();<NEW_LINE>this.existingStorageAccountsToAssociate.clear();<NEW_LINE>}
.<StorageAccount>taskResult(storageAccountKey);
945,916
public List<ValidateError> validate(Map<String, String> values) {<NEW_LINE>List<ValidateError> errors = new ArrayList<>();<NEW_LINE>Validator validator;<NEW_LINE>ValidateError error;<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.REQUIRED);<NEW_LINE>error = validator.validate(values.get("knowledgeId"), convLabelName("Knowledge Id"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(values.get("commentStatus"), convLabelName("Comment Status"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = <MASK><NEW_LINE>error = validator.validate(values.get("anonymous"), convLabelName("Anonymous"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(values.get("insertUser"), convLabelName("Insert User"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(values.get("updateUser"), convLabelName("Update User"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(values.get("deleteFlag"), convLabelName("Delete Flag"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>return errors;<NEW_LINE>}
ValidatorFactory.getInstance(Validator.INTEGER);
144,021
public static final void _idct4x4(int[] block, int[] out) {<NEW_LINE>// Horisontal<NEW_LINE>for (int i = 0; i < 16; i += 4) {<NEW_LINE>int e0 = block[i<MASK><NEW_LINE>int e1 = block[i] - block[i + 2];<NEW_LINE>int e2 = (block[i + 1] >> 1) - block[i + 3];<NEW_LINE>int e3 = block[i + 1] + (block[i + 3] >> 1);<NEW_LINE>out[i] = e0 + e3;<NEW_LINE>out[i + 1] = e1 + e2;<NEW_LINE>out[i + 2] = e1 - e2;<NEW_LINE>out[i + 3] = e0 - e3;<NEW_LINE>}<NEW_LINE>// Vertical<NEW_LINE>for (int i = 0; i < 4; i++) {<NEW_LINE>int g0 = out[i] + out[i + 8];<NEW_LINE>int g1 = out[i] - out[i + 8];<NEW_LINE>int g2 = (out[i + 4] >> 1) - out[i + 12];<NEW_LINE>int g3 = out[i + 4] + (out[i + 12] >> 1);<NEW_LINE>out[i] = g0 + g3;<NEW_LINE>out[i + 4] = g1 + g2;<NEW_LINE>out[i + 8] = g1 - g2;<NEW_LINE>out[i + 12] = g0 - g3;<NEW_LINE>}<NEW_LINE>// scale down<NEW_LINE>for (int i = 0; i < 16; i++) {<NEW_LINE>out[i] = (out[i] + 32) >> 6;<NEW_LINE>}<NEW_LINE>}
] + block[i + 2];
1,568,201
final ListVolumeInitiatorsResult executeListVolumeInitiators(ListVolumeInitiatorsRequest listVolumeInitiatorsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listVolumeInitiatorsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListVolumeInitiatorsRequest> request = null;<NEW_LINE>Response<ListVolumeInitiatorsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListVolumeInitiatorsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listVolumeInitiatorsRequest));<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, "Storage Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListVolumeInitiators");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListVolumeInitiatorsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListVolumeInitiatorsResultJsonUnmarshaller());<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.endEvent(Field.RequestMarshallTime);
1,455,527
// action_fillTree<NEW_LINE>public DefaultMutableTreeNode parent(MPPProductBOMLine bomline) {<NEW_LINE>log.fine("In parent with X_PP_Product_BOMLine");<NEW_LINE>MProduct M_Product = MProduct.get(Env.getCtx(), bomline.getM_Product_ID());<NEW_LINE>MUOM UOM = new MUOM(Env.getCtx(), M_Product.getC_UOM_ID(), null);<NEW_LINE>MPPProductBOM bomproduct = new MPPProductBOM(Env.getCtx(), bomline.getPP_Product_BOM_ID(), null);<NEW_LINE>DefaultMutableTreeNode parent = new DefaultMutableTreeNode(new nodeUserObject(Msg.translate(Env.getCtx(), "M_Product_ID") + Msg.translate(Env.getCtx(), "key") + ": " + M_Product.getValue() + " " + Msg.translate(Env.getCtx(), "Name") + ": " + M_Product.getName() + " " + Msg.translate(Env.getCtx(), "C_UOM_ID") + ": " + UOM.getName(), M_Product, bomproduct, bomline));<NEW_LINE>Vector<Comparable<?>> line = new Vector<Comparable<?>>(17);<NEW_LINE>// 0 Select<NEW_LINE>line.add(new Boolean(false));<NEW_LINE>// 1 IsActive<NEW_LINE>line.add(new Boolean(true));<NEW_LINE>// 2 Line<NEW_LINE>line.add(new Integer(bomline.getLine()));<NEW_LINE>// 3 ValidDrom<NEW_LINE>line.add((Timestamp) bomline.getValidFrom());<NEW_LINE>// 4 ValidTo<NEW_LINE>line.add((<MASK><NEW_LINE>KeyNamePair pp = new KeyNamePair(M_Product.getM_Product_ID(), M_Product.getName());<NEW_LINE>// 5 M_Product_ID<NEW_LINE>line.add(pp);<NEW_LINE>KeyNamePair uom = new KeyNamePair(bomline.getC_UOM_ID(), "");<NEW_LINE>// 6 C_UOM_ID<NEW_LINE>line.add(uom);<NEW_LINE>// 7 IsQtyPorcentage<NEW_LINE>line.add(new Boolean(bomline.isQtyPercentage()));<NEW_LINE>// 8 BatchPercent<NEW_LINE>line.add((BigDecimal) bomline.getQtyBatch());<NEW_LINE>// 9 QtyBOM<NEW_LINE>line.add((BigDecimal) ((bomline.getQtyBOM() != null) ? bomline.getQtyBOM() : new BigDecimal(0)));<NEW_LINE>// 10 IsCritical<NEW_LINE>line.add(new Boolean(bomline.isCritical()));<NEW_LINE>// 11 LTOffSet<NEW_LINE>line.add((Integer) bomline.getLeadTimeOffset());<NEW_LINE>// 12 Assay<NEW_LINE>line.add((BigDecimal) bomline.getAssay());<NEW_LINE>// 13 Scrap<NEW_LINE>line.add((BigDecimal) (bomline.getScrap()));<NEW_LINE>// 14 IssueMethod<NEW_LINE>line.add((String) bomline.getIssueMethod());<NEW_LINE>// 15 BackflushGroup<NEW_LINE>line.add((String) bomline.getBackflushGroup());<NEW_LINE>// 16 Forecast<NEW_LINE>line.add((BigDecimal) bomline.getForecast());<NEW_LINE>dataBOM.add(line);<NEW_LINE>String whereClause = "M_Product_ID=?";<NEW_LINE>List<MPPProductBOM> boms = new Query(Env.getCtx(), MPPProductBOM.Table_Name, whereClause, null).setParameters(new Object[] { bomproduct.getM_Product_ID() }).setOnlyActiveRecords(true).list();<NEW_LINE>for (MPPProductBOM bom : boms) {<NEW_LINE>MProduct component = MProduct.get(Env.getCtx(), bom.getM_Product_ID());<NEW_LINE>return component(component, bom, bomline);<NEW_LINE>}<NEW_LINE>return parent;<NEW_LINE>}
Timestamp) bomline.getValidTo());
249,346
public Request<DescribeHostsRequest> marshall(DescribeHostsRequest describeHostsRequest) {<NEW_LINE>if (describeHostsRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<DescribeHostsRequest> request = new DefaultRequest<DescribeHostsRequest>(describeHostsRequest, "AmazonEC2");<NEW_LINE>request.addParameter("Action", "DescribeHosts");<NEW_LINE>request.addParameter("Version", "2015-10-01");<NEW_LINE>java.util.List<String> hostIdsList = describeHostsRequest.getHostIds();<NEW_LINE>int hostIdsListIndex = 1;<NEW_LINE>for (String hostIdsListValue : hostIdsList) {<NEW_LINE>if (hostIdsListValue != null) {<NEW_LINE>request.addParameter("HostId." + hostIdsListIndex, StringUtils.fromString(hostIdsListValue));<NEW_LINE>}<NEW_LINE>hostIdsListIndex++;<NEW_LINE>}<NEW_LINE>if (describeHostsRequest.getNextToken() != null) {<NEW_LINE>request.addParameter("NextToken", StringUtils.fromString(describeHostsRequest.getNextToken()));<NEW_LINE>}<NEW_LINE>if (describeHostsRequest.getMaxResults() != null) {<NEW_LINE>request.addParameter("MaxResults", StringUtils.fromInteger(describeHostsRequest.getMaxResults()));<NEW_LINE>}<NEW_LINE>java.util.List<Filter> filterList = describeHostsRequest.getFilter();<NEW_LINE>int filterListIndex = 1;<NEW_LINE>for (Filter filterListValue : filterList) {<NEW_LINE>Filter filterMember = filterListValue;<NEW_LINE>if (filterMember != null) {<NEW_LINE>if (filterMember.getName() != null) {<NEW_LINE>request.addParameter("Filter." + filterListIndex + ".Name", StringUtils.fromString(filterMember.getName()));<NEW_LINE>}<NEW_LINE>java.util.List<String<MASK><NEW_LINE>int valuesListIndex = 1;<NEW_LINE>for (String valuesListValue : valuesList) {<NEW_LINE>if (valuesListValue != null) {<NEW_LINE>request.addParameter("Filter." + filterListIndex + ".Value." + valuesListIndex, StringUtils.fromString(valuesListValue));<NEW_LINE>}<NEW_LINE>valuesListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>filterListIndex++;<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
> valuesList = filterMember.getValues();
228,653
public void incrCounter(String group, String counterName, long incr) {<NEW_LINE>PigStatusReporter reporter = PigStatusReporter.getInstance();<NEW_LINE>if (reporter != null) {<NEW_LINE>// common case<NEW_LINE>Counter counter = reporter.getCounter(group, counterName);<NEW_LINE>if (counter != null) {<NEW_LINE>HadoopCompat.incrementCounter(counter, incr);<NEW_LINE>if (counterStringMap_.size() > 0) {<NEW_LINE>for (Map.Entry<Pair<String, String>, Long> entry : counterStringMap_.entrySet()) {<NEW_LINE>HadoopCompat.incrementCounter(reporter.getCounter(entry.getKey().first, entry.getKey().second<MASK><NEW_LINE>}<NEW_LINE>counterStringMap_.clear();<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// In the case when reporter is not available, or we can't get the Counter,<NEW_LINE>// store in the local map.<NEW_LINE>Pair<String, String> key = new Pair<String, String>(group, counterName);<NEW_LINE>Long currentValue = counterStringMap_.get(key);<NEW_LINE>counterStringMap_.put(key, (currentValue == null ? 0 : currentValue) + incr);<NEW_LINE>}
), entry.getValue());
374,784
ActionResult<JsonElement> execute(EffectivePerson effectivePerson, String id, String path0, String path1, String path2, String path3, String path4, String path5, String path6, String path7) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<JsonElement> <MASK><NEW_LINE>Business business = new Business(emc);<NEW_LINE>Work work = emc.find(id, Work.class);<NEW_LINE>if (null == work) {<NEW_LINE>throw new ExceptionEntityNotExist(id, Work.class);<NEW_LINE>}<NEW_LINE>WoControl control = business.getControl(effectivePerson, work, WoControl.class);<NEW_LINE>if (BooleanUtils.isNotTrue(control.getAllowVisit())) {<NEW_LINE>throw new ExceptionWorkAccessDenied(effectivePerson.getDistinguishedName(), work.getTitle(), work.getId());<NEW_LINE>}<NEW_LINE>result.setData(this.getData(business, work.getJob(), path0, path1, path2, path3, path4, path5, path6, path7));<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
result = new ActionResult<>();
1,608,901
public void onEventMainThread(AmazonIapManager.AmazonIapAvailabilityEvent event) {<NEW_LINE>binding.progressBarAmazonBilling.setVisibility(View.GONE);<NEW_LINE>// enable or disable purchase buttons based on what can be purchased<NEW_LINE>binding.buttonAmazonBillingSubscribe.setEnabled(event<MASK><NEW_LINE>binding.buttonAmazonBillingGetPass.setEnabled(event.passAvailable && !event.userHasActivePurchase);<NEW_LINE>// status text<NEW_LINE>if (!event.subscriptionAvailable && !event.passAvailable) {<NEW_LINE>// neither purchase available, probably not signed in<NEW_LINE>binding.textViewAmazonBillingExisting.setText(R.string.subscription_not_signed_in);<NEW_LINE>} else {<NEW_LINE>// subscription or pass available<NEW_LINE>// show message if either one is active<NEW_LINE>binding.textViewAmazonBillingExisting.setText(event.userHasActivePurchase ? getString(R.string.upgrade_success) : null);<NEW_LINE>}<NEW_LINE>}
.subscriptionAvailable && !event.userHasActivePurchase);
1,103,860
public PayResponse pay(PayRequest request) {<NEW_LINE>AliPayTradeCreateRequest payRequest = new AliPayTradeCreateRequest();<NEW_LINE>payRequest.setMethod(AliPayConstants.ALIPAY_TRADE_APP_PAY);<NEW_LINE>payRequest.setAppId(aliPayConfig.getAppId());<NEW_LINE>payRequest.setTimestamp(LocalDateTime.now().format(formatter));<NEW_LINE>payRequest.<MASK><NEW_LINE>AliPayTradeCreateRequest.BizContent bizContent = new AliPayTradeCreateRequest.BizContent();<NEW_LINE>bizContent.setOutTradeNo(request.getOrderId());<NEW_LINE>bizContent.setTotalAmount(request.getOrderAmount());<NEW_LINE>bizContent.setSubject(request.getOrderName());<NEW_LINE>bizContent.setIsAsyncPay(true);<NEW_LINE>payRequest.setBizContent(JsonUtil.toJsonWithUnderscores(bizContent).replaceAll("\\s*", ""));<NEW_LINE>payRequest.setSign(AliPaySignature.sign(MapUtil.object2MapWithUnderline(payRequest), aliPayConfig.getPrivateKey()));<NEW_LINE>PayResponse payResponse = new PayResponse();<NEW_LINE>payResponse.setOrderInfo(MapUtil.toUrlWithSortAndEncode(MapUtil.removeEmptyKeyAndValue(MapUtil.object2MapWithUnderline(payRequest))));<NEW_LINE>return payResponse;<NEW_LINE>}
setNotifyUrl(aliPayConfig.getNotifyUrl());
143,680
public void runSupport() {<NEW_LINE>List<Object[]> to_process;<NEW_LINE>synchronized (share_requests) {<NEW_LINE>to_process = new ArrayList<>(share_requests);<NEW_LINE>}<NEW_LINE>for (Object[] entry : to_process) {<NEW_LINE>try {<NEW_LINE>String key = (String) entry[0];<NEW_LINE>File file = (File) entry[1];<NEW_LINE>String name = (String) entry[2];<NEW_LINE>Tag tag = (Tag) entry[3];<NEW_LINE>log("Auto sharing " + name + " (" + file + ") to tag " + tag.getTagName(true));<NEW_LINE>Map<String, String> properties = new HashMap<>();<NEW_LINE>properties.put(ShareManager.PR_USER_DATA, "device:autoshare");<NEW_LINE>// currently no way for user to explicitly specify the networks to use so use defaults<NEW_LINE>String[] networks = AENetworkClassifier.getDefaultNetworks();<NEW_LINE>String networks_str = "";<NEW_LINE>for (String net : networks) {<NEW_LINE>networks_str += (networks_str.length() == 0 ? "" : ",") + net;<NEW_LINE>}<NEW_LINE>properties.put(ShareManager.PR_NETWORKS, networks_str);<NEW_LINE>properties.put(ShareManager.PR_TAGS, String.valueOf(tag.getTagUID()));<NEW_LINE>PluginInterface pi = PluginInitializer.getDefaultInterface();<NEW_LINE>ShareResourceFile srf = pi.getShareManager().addFile(file, properties);<NEW_LINE>Torrent torrent = srf.getItem().getTorrent();<NEW_LINE>final Download download = pi.getPluginManager().getDefaultPluginInterface().getShortCuts().getDownload(torrent.getHash());<NEW_LINE>if (download == null) {<NEW_LINE>throw (new Exception("Download no longer exists"));<NEW_LINE>}<NEW_LINE>DownloadManager <MASK><NEW_LINE>dm.getDownloadState().setDisplayName(name);<NEW_LINE>download.setAttribute(share_ta, key);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>log("Auto sharing failed", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>synchronized (share_requests) {<NEW_LINE>share_requests.removeAll(to_process);<NEW_LINE>}<NEW_LINE>}
dm = PluginCoreUtils.unwrap(download);
831,096
private Float convertToDegree(String stringDMS) {<NEW_LINE>Float result = null;<NEW_LINE>String[] DMS = stringDMS.split(",", 3);<NEW_LINE>String[] stringD = DMS[0].split("/", 2);<NEW_LINE>Double D0 = Double.valueOf(stringD[0]);<NEW_LINE>Double D1 = Double.valueOf(stringD[1]);<NEW_LINE>double FloatD = D0 / D1;<NEW_LINE>String[] stringM = DMS[1].split("/", 2);<NEW_LINE>Double M0 = Double.valueOf(stringM[0]);<NEW_LINE>Double M1 = Double.valueOf(stringM[1]);<NEW_LINE>double FloatM = M0 / M1;<NEW_LINE>String[] stringS = DMS[2].split("/", 2);<NEW_LINE>Double S0 = Double.valueOf(stringS[0]);<NEW_LINE>Double S1 = Double.valueOf(stringS[1]);<NEW_LINE>double FloatS = S0 / S1;<NEW_LINE>result = (float) (FloatD + (FloatM / 60<MASK><NEW_LINE>return result;<NEW_LINE>}
) + (FloatS / 3600));
1,461,554
private BBSSubjectAttachment concreteAttachment(StorageMapping mapping, BBSSubjectInfo subject, String name, EffectivePerson effectivePerson, String site) throws Exception {<NEW_LINE>BBSSubjectAttachment attachment = new BBSSubjectAttachment();<NEW_LINE>String fileName = UUID.randomUUID().toString();<NEW_LINE>String extension = FilenameUtils.getExtension(name);<NEW_LINE>if (StringUtils.isNotEmpty(extension)) {<NEW_LINE>fileName = fileName + "." + extension;<NEW_LINE>} else {<NEW_LINE>throw new Exception("file extension is empty.");<NEW_LINE>}<NEW_LINE>if (name.indexOf("\\") > 0) {<NEW_LINE>name = <MASK><NEW_LINE>}<NEW_LINE>if (name.indexOf("/") > 0) {<NEW_LINE>name = StringUtils.substringAfterLast(name, "/");<NEW_LINE>}<NEW_LINE>attachment.setExtension(extension);<NEW_LINE>attachment.setName(name);<NEW_LINE>attachment.setFileName(fileName);<NEW_LINE>attachment.setExtension(extension);<NEW_LINE>attachment.setFileHost(mapping.getHost());<NEW_LINE>attachment.setFilePath("");<NEW_LINE>attachment.setStorage(mapping.getName());<NEW_LINE>attachment.setSite(site);<NEW_LINE>attachment.setCreateTime(new Date());<NEW_LINE>attachment.setCreatorUid(effectivePerson.getDistinguishedName());<NEW_LINE>if (subject != null) {<NEW_LINE>attachment.setDescription(subject.getTitle());<NEW_LINE>}<NEW_LINE>attachment.setLastUpdateTime(new Date());<NEW_LINE>attachment.setLength(0L);<NEW_LINE>return attachment;<NEW_LINE>}
StringUtils.substringAfterLast(name, "\\");
1,400,174
public static DescribeDohDomainStatisticsSummaryResponse unmarshall(DescribeDohDomainStatisticsSummaryResponse describeDohDomainStatisticsSummaryResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDohDomainStatisticsSummaryResponse.setRequestId(_ctx.stringValue("DescribeDohDomainStatisticsSummaryResponse.RequestId"));<NEW_LINE>describeDohDomainStatisticsSummaryResponse.setTotalItems(_ctx.integerValue("DescribeDohDomainStatisticsSummaryResponse.TotalItems"));<NEW_LINE>describeDohDomainStatisticsSummaryResponse.setTotalPages(_ctx.integerValue("DescribeDohDomainStatisticsSummaryResponse.TotalPages"));<NEW_LINE>describeDohDomainStatisticsSummaryResponse.setPageSize(_ctx.integerValue("DescribeDohDomainStatisticsSummaryResponse.PageSize"));<NEW_LINE>describeDohDomainStatisticsSummaryResponse.setPageNumber(_ctx.integerValue("DescribeDohDomainStatisticsSummaryResponse.PageNumber"));<NEW_LINE>List<Statistic> statistics = new ArrayList<Statistic>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDohDomainStatisticsSummaryResponse.Statistics.Length"); i++) {<NEW_LINE>Statistic statistic = new Statistic();<NEW_LINE>statistic.setDomainName(_ctx.stringValue("DescribeDohDomainStatisticsSummaryResponse.Statistics[" + i + "].DomainName"));<NEW_LINE>statistic.setV4HttpCount(_ctx.longValue("DescribeDohDomainStatisticsSummaryResponse.Statistics[" + i + "].V4HttpCount"));<NEW_LINE>statistic.setV6HttpCount(_ctx.longValue("DescribeDohDomainStatisticsSummaryResponse.Statistics[" + i + "].V6HttpCount"));<NEW_LINE>statistic.setV4HttpsCount(_ctx.longValue("DescribeDohDomainStatisticsSummaryResponse.Statistics[" + i + "].V4HttpsCount"));<NEW_LINE>statistic.setV6HttpsCount(_ctx.longValue("DescribeDohDomainStatisticsSummaryResponse.Statistics[" + i + "].V6HttpsCount"));<NEW_LINE>statistic.setTotalCount(_ctx.longValue<MASK><NEW_LINE>statistic.setIpCount(_ctx.longValue("DescribeDohDomainStatisticsSummaryResponse.Statistics[" + i + "].IpCount"));<NEW_LINE>statistic.setHttpCount(_ctx.longValue("DescribeDohDomainStatisticsSummaryResponse.Statistics[" + i + "].HttpCount"));<NEW_LINE>statistic.setHttpsCount(_ctx.longValue("DescribeDohDomainStatisticsSummaryResponse.Statistics[" + i + "].HttpsCount"));<NEW_LINE>statistics.add(statistic);<NEW_LINE>}<NEW_LINE>describeDohDomainStatisticsSummaryResponse.setStatistics(statistics);<NEW_LINE>return describeDohDomainStatisticsSummaryResponse;<NEW_LINE>}
("DescribeDohDomainStatisticsSummaryResponse.Statistics[" + i + "].TotalCount"));
300,076
private void writeVersionAccessorClass(ClassNode classNode) throws IOException {<NEW_LINE>boolean isProvider = classNode.isAlsoProvider();<NEW_LINE>String interfaces = isProvider ? " implements VersionNotationSupplier" : "";<NEW_LINE>String versionsClassName = classNode.getClassName();<NEW_LINE>Set<String> versionAliases = classNode.getAliases();<NEW_LINE>writeLn("public static class " + versionsClassName + " extends VersionFactory " + interfaces + " {");<NEW_LINE>writeLn();<NEW_LINE>indent(() -> {<NEW_LINE>writeSubAccessorFieldsOf(classNode, AccessorKind.version);<NEW_LINE><MASK><NEW_LINE>writeLn();<NEW_LINE>if (isProvider) {<NEW_LINE>String path = classNode.getFullAlias();<NEW_LINE>VersionModel vm = config.getVersion(path);<NEW_LINE>String context = vm.getContext();<NEW_LINE>writeSingleVersionAccessor(path, context, vm.getVersion().getDisplayName(), true);<NEW_LINE>}<NEW_LINE>for (String alias : versionAliases) {<NEW_LINE>String childName = leafNodeForAlias(alias);<NEW_LINE>if (!classNode.hasChild(childName)) {<NEW_LINE>VersionModel vm = config.getVersion(alias);<NEW_LINE>String context = vm.getContext();<NEW_LINE>indent(() -> writeSingleVersionAccessor(alias, context, vm.getVersion().getDisplayName(), false));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (ClassNode child : classNode.getChildren()) {<NEW_LINE>writeSubAccessor(child, AccessorKind.version);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>writeLn("}");<NEW_LINE>writeLn();<NEW_LINE>}
writeLn("public " + versionsClassName + "(ProviderFactory providers, DefaultVersionCatalog config) { super(providers, config); }");
1,617,815
public boolean processIt(ProcessInfo pi, Trx trx, boolean managedTrx) {<NEW_LINE>if (pi.getAD_PInstance_ID() == 0) {<NEW_LINE>MPInstance pInstance = new MPInstance(this, pi.getRecord_ID());<NEW_LINE>// Lock<NEW_LINE>pInstance.setIsProcessing(true);<NEW_LINE>pInstance.saveEx();<NEW_LINE>}<NEW_LINE>boolean ok = false;<NEW_LINE>// Java Class<NEW_LINE>String Classname = getClassname();<NEW_LINE>if (Classname != null && Classname.length() > 0 && Classname.toLowerCase().startsWith(MRule.SCRIPT_PREFIX)) {<NEW_LINE>pi.setClassName(Classname);<NEW_LINE>ProcessUtil.startScriptProcess(Env.<MASK><NEW_LINE>} else if (Classname != null && Classname.length() > 0 && !Classname.toLowerCase().startsWith(MRule.SCRIPT_PREFIX)) {<NEW_LINE>pi.setClassName(Classname);<NEW_LINE>ok = startClass(pi, trx, managedTrx);<NEW_LINE>} else {<NEW_LINE>// PL/SQL Procedure<NEW_LINE>String ProcedureName = getProcedureName();<NEW_LINE>if (ProcedureName != null && ProcedureName.length() > 0) {<NEW_LINE>ok = startProcess(ProcedureName, pi, trx, managedTrx);<NEW_LINE>} else {<NEW_LINE>// BF3038385, ADEMPIERE-50<NEW_LINE>if (this.isReport()) {<NEW_LINE>ok = true;<NEW_LINE>} else {<NEW_LINE>String msg = "No Classname or ProcedureName for " + getName();<NEW_LINE>pi.setSummary(msg, ok);<NEW_LINE>log.warning(msg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ok;<NEW_LINE>}
getCtx(), pi, trx);
897,439
protected String buildString() {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>String ls = System.getProperty("line.separator");<NEW_LINE>sb.append("[").append(getHeaderName()).append(" (").append(length()).append(" bytes)]").append(ls);<NEW_LINE>sb.append(" Frame Control:").append(ls).append(frameControl.toString(" "));<NEW_LINE>sb.append(" Duration: ").append(getDurationAsInt()).append(ls);<NEW_LINE>sb.append(" Address1: ").append(address1).append(ls);<NEW_LINE>sb.append(" Address2: ").append<MASK><NEW_LINE>sb.append(" Address3: ").append(address3).append(ls);<NEW_LINE>sb.append(" Sequence Control: ").append(sequenceControl).append(ls);<NEW_LINE>if (htControl != null) {<NEW_LINE>sb.append(" HT Control:").append(ls).append(htControl.toString(" "));<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}
(address2).append(ls);
933,746
private MessageSecurity[] expand(MessageSecurity[] bindingData) {<NEW_LINE>MessageSecurity[] result = new MessageSecurity[0];<NEW_LINE>if (bindingData != null && bindingData.length > 0) {<NEW_LINE>ArrayList bindings = new ArrayList(bindingData.length * 10);<NEW_LINE>for (int i = 0; i < bindingData.length; i++) {<NEW_LINE>MessageSecurity ms = bindingData[i];<NEW_LINE>Message[] messages = ms.getMessage();<NEW_LINE>if (messages != null && messages.length > 0) {<NEW_LINE>if (messages.length == 1) {<NEW_LINE>bindings.add(ms);<NEW_LINE>} else {<NEW_LINE>for (int j = 0; j < messages.length; j++) {<NEW_LINE>MessageSecurity newMS = (MessageSecurity) ms.cloneVersion(asCloneVersion);<NEW_LINE>Message <MASK><NEW_LINE>newMS.setMessage(new Message[] { newMessage });<NEW_LINE>bindings.add(newMS);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result = (MessageSecurity[]) bindings.toArray(result);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
newMessage = newMS.getMessage(j);
1,223,537
private JRFillVariable addVariable(JRVariable parentVariable, List<JRFillVariable> variableList, JRFillObjectFactory factory) {<NEW_LINE>JRFillVariable variable = factory.getVariable(parentVariable);<NEW_LINE>CalculationEnum calculation = variable.getCalculationValue();<NEW_LINE>switch(calculation) {<NEW_LINE>case AVERAGE:<NEW_LINE>case VARIANCE:<NEW_LINE>{<NEW_LINE>JRVariable countVar = createHelperVariable(parentVariable, "_COUNT", CalculationEnum.COUNT);<NEW_LINE>JRFillVariable fillCountVar = addVariable(countVar, variableList, factory);<NEW_LINE>variable.setHelperVariable(fillCountVar, JRCalculable.HELPER_COUNT);<NEW_LINE>JRVariable sumVar = createHelperVariable(parentVariable, "_SUM", CalculationEnum.SUM);<NEW_LINE>JRFillVariable fillSumVar = addVariable(sumVar, variableList, factory);<NEW_LINE>variable.setHelperVariable(fillSumVar, JRCalculable.HELPER_SUM);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case STANDARD_DEVIATION:<NEW_LINE>{<NEW_LINE>JRVariable varianceVar = createHelperVariable(parentVariable, "_VARIANCE", CalculationEnum.VARIANCE);<NEW_LINE>JRFillVariable fillVarianceVar = <MASK><NEW_LINE>variable.setHelperVariable(fillVarianceVar, JRCalculable.HELPER_VARIANCE);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case DISTINCT_COUNT:<NEW_LINE>{<NEW_LINE>JRVariable countVar = createDistinctCountHelperVariable(parentVariable);<NEW_LINE>JRFillVariable fillCountVar = addVariable(countVar, variableList, factory);<NEW_LINE>variable.setHelperVariable(fillCountVar, JRCalculable.HELPER_COUNT);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>variableList.add(variable);<NEW_LINE>return variable;<NEW_LINE>}
addVariable(varianceVar, variableList, factory);
1,341,836
private void checkRequiredProperties(Node parent, MappingNode map, YType type, Map<String, YTypedProperty> beanProperties, DynamicSchemaContext dc) {<NEW_LINE>Set<String> foundProps = NodeUtil.getScalarKeys(map);<NEW_LINE>boolean allPropertiesKnown = beanProperties.keySet().containsAll(foundProps);<NEW_LINE>// Don't check for missing properties if some properties look like they might be spelled incorrectly.<NEW_LINE>if (allPropertiesKnown) {<NEW_LINE>// Check for missing required properties:<NEW_LINE>List<YTypedProperty> missingProps = beanProperties.values().stream().filter(YTypedProperty::isRequired).filter(prop -> !foundProps.contains(prop.getName())).collect(CollectorUtil.toImmutableList());<NEW_LINE>Set<String> missingPropNames = missingProps.stream().map(YTypedProperty::getName).collect(Collectors.toCollection(TreeSet::new));<NEW_LINE>if (!missingPropNames.isEmpty()) {<NEW_LINE>String message;<NEW_LINE>if (missingPropNames.size() == 1) {<NEW_LINE>// slightly more specific message when only one missing property<NEW_LINE>String missing = missingPropNames.stream()<MASK><NEW_LINE>message = "Property '" + missing + "' is required for '" + type + "'";<NEW_LINE>} else {<NEW_LINE>message = "Properties " + missingPropNames + " are required for '" + type + "'";<NEW_LINE>}<NEW_LINE>SchemaBasedSnippetGenerator snippetProvider = new SchemaBasedSnippetGenerator(typeUtil, SnippetBuilder::gimped);<NEW_LINE>Snippet snippet = snippetProvider.getSnippet(missingProps);<NEW_LINE>problems.accept(YamlSchemaProblems.missingProperties(message, dc, missingPropNames, snippet.getSnippet(), snippet.getPlaceHolder(1).getOffset(), parent, map, quickfixes.MISSING_PROP_FIX));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.findFirst().get();
262,948
private VisualSampleEntry createSampleEntry() {<NEW_LINE>VisualSampleEntry visualSampleEntry = new VisualSampleEntry("hvc1");<NEW_LINE>visualSampleEntry.setDataReferenceIndex(1);<NEW_LINE>visualSampleEntry.setDepth(24);<NEW_LINE>visualSampleEntry.setFrameCount(1);<NEW_LINE>visualSampleEntry.setHorizresolution(72);<NEW_LINE>visualSampleEntry.setVertresolution(72);<NEW_LINE>visualSampleEntry.setWidth(640);<NEW_LINE>visualSampleEntry.setHeight(480);<NEW_LINE>visualSampleEntry.setCompressorname("HEVC Coding");<NEW_LINE>HevcConfigurationBox hevcConfigurationBox = new HevcConfigurationBox();<NEW_LINE>HevcDecoderConfigurationRecord.Array spsArray = new HevcDecoderConfigurationRecord.Array();<NEW_LINE>spsArray.array_completeness = true;<NEW_LINE>spsArray.nal_unit_type = NAL_TYPE_SPS_NUT;<NEW_LINE>spsArray.nalUnits = new ArrayList<byte[]>();<NEW_LINE>for (ByteBuffer sp : sps) {<NEW_LINE>spsArray.nalUnits.add(toArray(sp));<NEW_LINE>}<NEW_LINE>HevcDecoderConfigurationRecord.Array <MASK><NEW_LINE>ppsArray.array_completeness = true;<NEW_LINE>ppsArray.nal_unit_type = NAL_TYPE_PPS_NUT;<NEW_LINE>ppsArray.nalUnits = new ArrayList<byte[]>();<NEW_LINE>for (ByteBuffer pp : pps) {<NEW_LINE>ppsArray.nalUnits.add(toArray(pp));<NEW_LINE>}<NEW_LINE>HevcDecoderConfigurationRecord.Array vpsArray = new HevcDecoderConfigurationRecord.Array();<NEW_LINE>vpsArray.array_completeness = true;<NEW_LINE>vpsArray.nal_unit_type = NAL_TYPE_PPS_NUT;<NEW_LINE>vpsArray.nalUnits = new ArrayList<byte[]>();<NEW_LINE>for (ByteBuffer vp : vps) {<NEW_LINE>vpsArray.nalUnits.add(toArray(vp));<NEW_LINE>}<NEW_LINE>hevcConfigurationBox.getArrays().addAll(Arrays.asList(spsArray, vpsArray, ppsArray));<NEW_LINE>visualSampleEntry.addBox(hevcConfigurationBox);<NEW_LINE>return visualSampleEntry;<NEW_LINE>}
ppsArray = new HevcDecoderConfigurationRecord.Array();
1,228,568
protected void encodeDefaultContent(FacesContext context, Chip chip) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>if (chip.getImage() != null) {<NEW_LINE>writer.startElement("img", null);<NEW_LINE>writer.writeAttribute("src", chip.getImage(), null);<NEW_LINE>writer.endElement("img");<NEW_LINE>} else if (chip.getIcon() != null) {<NEW_LINE>String iconStyleClass = getStyleClassBuilder(context).add(Chip.ICON_CLASS).add(chip.getIcon()).build();<NEW_LINE>writer.startElement("span", chip);<NEW_LINE>writer.writeAttribute("class", iconStyleClass, null);<NEW_LINE>writer.endElement("span");<NEW_LINE>}<NEW_LINE>if (chip.getLabel() != null) {<NEW_LINE>writer.startElement("div", chip);<NEW_LINE>writer.writeAttribute("class", Chip.TEXT_CLASS, null);<NEW_LINE>writer.writeText(chip.getLabel(), "label");<NEW_LINE>writer.endElement("div");<NEW_LINE>}<NEW_LINE>if (chip.getRemovable()) {<NEW_LINE>String removeIconStyleClass = getStyleClassBuilder(context).add(Chip.REMOVE_ICON_CLASS).add(chip.getRemoveIcon()).build();<NEW_LINE>writer.startElement("span", chip);<NEW_LINE>writer.writeAttribute("tabindex", "0", null);<NEW_LINE>writer.<MASK><NEW_LINE>writer.endElement("span");<NEW_LINE>}<NEW_LINE>}
writeAttribute("class", removeIconStyleClass, null);
1,365,590
public Object resolve(String key) {<NEW_LINE>switch(key) {<NEW_LINE>case "title":<NEW_LINE>return <MASK><NEW_LINE>case "description":<NEW_LINE>return TaskFieldAdapters.DESCRIPTION.get(mContentSet);<NEW_LINE>case "checklist":<NEW_LINE>return TaskFieldAdapters.CHECKLIST.get(mContentSet);<NEW_LINE>case "location":<NEW_LINE>return TaskFieldAdapters.LOCATION.get(mContentSet);<NEW_LINE>case "start":<NEW_LINE>return TaskFieldAdapters.DTSTART.get(mContentSet);<NEW_LINE>case "due":<NEW_LINE>return TaskFieldAdapters.DUE.get(mContentSet);<NEW_LINE>case "completed":<NEW_LINE>return TaskFieldAdapters.COMPLETED.get(mContentSet);<NEW_LINE>case "priority":<NEW_LINE>Integer priority = TaskFieldAdapters.PRIORITY.get(mContentSet);<NEW_LINE>return priority == null ? null : mModel.getField(R.id.task_field_priority).getChoices().getTitle(priority);<NEW_LINE>case "privacy":<NEW_LINE>Integer classification = TaskFieldAdapters.CLASSIFICATION.get(mContentSet);<NEW_LINE>return classification == null ? null : mModel.getField(R.id.task_field_classification).getChoices().getTitle(classification);<NEW_LINE>case "status":<NEW_LINE>Integer status = TaskFieldAdapters.STATUS.get(mContentSet);<NEW_LINE>return status == null ? null : mModel.getField(R.id.task_field_status).getChoices().getTitle(status);<NEW_LINE>case "url":<NEW_LINE>return TaskFieldAdapters.URL.get(mContentSet);<NEW_LINE>default:<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
TaskFieldAdapters.TITLE.get(mContentSet);
462,709
final CreateAutoPredictorResult executeCreateAutoPredictor(CreateAutoPredictorRequest createAutoPredictorRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createAutoPredictorRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateAutoPredictorRequest> request = null;<NEW_LINE>Response<CreateAutoPredictorResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateAutoPredictorRequestProtocolMarshaller(protocolFactory).marshall<MASK><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, "forecast");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateAutoPredictor");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateAutoPredictorResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateAutoPredictorResultJsonUnmarshaller());<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>}
(super.beforeMarshalling(createAutoPredictorRequest));
1,155,949
public synchronized void updateInfo(HttpServletRequest request, HttpServletResponse response) {<NEW_LINE>HttpSession httpSession = request.getSession();<NEW_LINE>this.lastAccessTime = System.currentTimeMillis();<NEW_LINE>this<MASK><NEW_LINE>this.lastRemoteUserAgent = request.getHeader("User-Agent");<NEW_LINE>this.cacheExpired = false;<NEW_LINE>if (!httpSession.isNew()) {<NEW_LINE>try {<NEW_LINE>// Persist session<NEW_LINE>if (!this.persisted) {<NEW_LINE>// Create new record<NEW_LINE>securityController.createSession(this.id, getUserId(), getSessionParameters());<NEW_LINE>this.persisted = true;<NEW_LINE>} else {<NEW_LINE>if (!application.isConfigurationMode()) {<NEW_LINE>// Update record<NEW_LINE>// TODO use generate id from SMController<NEW_LINE>securityController.updateSession(this.id, getUserId(), getSessionParameters());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>addSessionError(e);<NEW_LINE>log.error("Error persisting web session", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.lastRemoteAddr = request.getRemoteAddr();
1,225,189
// visible for tests<NEW_LINE>static Settings additionalSettings(final Settings settings, final boolean enabled) {<NEW_LINE>if (enabled) {<NEW_LINE>final Settings.Builder builder = Settings.builder();<NEW_LINE>builder.put(SecuritySettings.addTransportSettings(settings));<NEW_LINE>if (NetworkModule.HTTP_TYPE_SETTING.exists(settings)) {<NEW_LINE>final String httpType = <MASK><NEW_LINE>if (httpType.equals(SecurityField.NAME4) || httpType.equals(SecurityField.NIO)) {<NEW_LINE>SecurityHttpSettings.overrideSettings(builder, settings);<NEW_LINE>} else {<NEW_LINE>final String message = String.format(Locale.ROOT, "http type setting [%s] must be [%s] or [%s] but is [%s]", NetworkModule.HTTP_TYPE_KEY, SecurityField.NAME4, SecurityField.NIO, httpType);<NEW_LINE>throw new IllegalArgumentException(message);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// default to security4<NEW_LINE>builder.put(NetworkModule.HTTP_TYPE_KEY, SecurityField.NAME4);<NEW_LINE>SecurityHttpSettings.overrideSettings(builder, settings);<NEW_LINE>}<NEW_LINE>builder.put(SecuritySettings.addUserSettings(settings));<NEW_LINE>return builder.build();<NEW_LINE>} else {<NEW_LINE>return Settings.EMPTY;<NEW_LINE>}<NEW_LINE>}
NetworkModule.HTTP_TYPE_SETTING.get(settings);
141,713
public void assertMutable(String listname, PropertyChangeEvent evt) {<NEW_LINE>if (task.getState().isConfigurable()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String method = null;<NEW_LINE>if (evt instanceof ObservableList.ElementEvent) {<NEW_LINE>switch(((ObservableList.ElementEvent) evt).getChangeType()) {<NEW_LINE>case ADDED:<NEW_LINE>method = String.format("%s.%s", listname, "add()");<NEW_LINE>break;<NEW_LINE>case UPDATED:<NEW_LINE>method = String.format("%s.%s", listname, "set(int, Object)");<NEW_LINE>break;<NEW_LINE>case REMOVED:<NEW_LINE>method = String.format("%s.%s", listname, "remove()");<NEW_LINE>break;<NEW_LINE>case CLEARED:<NEW_LINE>method = String.format("%s.%s", listname, "clear()");<NEW_LINE>break;<NEW_LINE>case MULTI_ADD:<NEW_LINE>method = String.format("%s.%s", listname, "addAll()");<NEW_LINE>break;<NEW_LINE>case MULTI_REMOVE:<NEW_LINE>method = String.<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (method == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>throw new IllegalStateException(format(method));<NEW_LINE>}
format("%s.%s", listname, "removeAll()");
1,546,450
void handleMessage(Message msg) {<NEW_LINE>if (msg instanceof APIIsReadyToGoMsg) {<NEW_LINE>handle((APIIsReadyToGoMsg) msg);<NEW_LINE>} else if (msg instanceof APIGetVersionMsg) {<NEW_LINE>handle((APIGetVersionMsg) msg);<NEW_LINE>} else if (msg instanceof APIGetCurrentTimeMsg) {<NEW_LINE>handle((APIGetCurrentTimeMsg) msg);<NEW_LINE>} else if (msg instanceof APIGetPlatformTimeZoneMsg) {<NEW_LINE>handle((APIGetPlatformTimeZoneMsg) msg);<NEW_LINE>} else if (msg instanceof APIGetManagementNodeArchMsg) {<NEW_LINE>handle((APIGetManagementNodeArchMsg) msg);<NEW_LINE>} else if (msg instanceof APIGetManagementNodeOSMsg) {<NEW_LINE>handle((APIGetManagementNodeOSMsg) msg);<NEW_LINE>} else if (msg instanceof APIMessage) {<NEW_LINE>dispatchMessage((APIMessage) msg);<NEW_LINE>} else {<NEW_LINE>logger.debug(<MASK><NEW_LINE>}<NEW_LINE>}
"Not an APIMessage.Message ID is " + msg.getId());
372,725
public Dependency[] parse(Document document) {<NEW_LINE>if (xpath == null) {<NEW_LINE>xpath = XmlUtils.createXPathExpression("/project/dependencies/dependency");<NEW_LINE>}<NEW_LINE>if (JavaCore.getClasspathVariable(MVN_REPO) == null) {<NEW_LINE>throw new IllegalStateException(Services.getMessage("mvn.repo.not.set", MVN_REPO));<NEW_LINE>}<NEW_LINE>IPath path = new Path(MVN_REPO);<NEW_LINE>NodeList results = null;<NEW_LINE>try {<NEW_LINE>results = (NodeList) xpath.evaluate(document, XPathConstants.NODESET);<NEW_LINE>} catch (XPathExpressionException xpee) {<NEW_LINE>throw new RuntimeException(xpee);<NEW_LINE>}<NEW_LINE>ArrayList<Dependency> dependencies = new ArrayList<Dependency>();<NEW_LINE>for (int ii = 0; ii < results.getLength(); ii++) {<NEW_LINE>Element element = (Element) results.item(ii);<NEW_LINE>NodeList group = element.getElementsByTagName(GROUP_ID);<NEW_LINE>NodeList artifact = element.getElementsByTagName(ARTIFACT_ID);<NEW_LINE>NodeList ver = element.getElementsByTagName(VERSION);<NEW_LINE>if (group == null || group.getLength() < 1 || artifact == null || artifact.getLength() < 1 || ver == null || ver.getLength() < 1) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Node groupId = group.item(0).getFirstChild();<NEW_LINE>Node artifactId = artifact.<MASK><NEW_LINE>Node version = ver.item(0).getFirstChild();<NEW_LINE>if (groupId == null || artifactId == null || version == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String groupIdValue = groupId.getNodeValue().trim();<NEW_LINE>String artifactIdValue = artifactId.getNodeValue().trim();<NEW_LINE>String versionValue = version.getNodeValue().trim();<NEW_LINE>if (groupIdValue.length() == 0 || artifactIdValue.length() == 0 || versionValue.length() == 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Dependency dependency = new MvnDependency(groupIdValue, artifactIdValue, versionValue, path);<NEW_LINE>dependency.setVariable(true);<NEW_LINE>dependencies.add(dependency);<NEW_LINE>}<NEW_LINE>return (Dependency[]) dependencies.toArray(new Dependency[dependencies.size()]);<NEW_LINE>}
item(0).getFirstChild();
751,922
public LaunchTemplatePrivateDnsNameOptionsRequest unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>LaunchTemplatePrivateDnsNameOptionsRequest launchTemplatePrivateDnsNameOptionsRequest = new LaunchTemplatePrivateDnsNameOptionsRequest();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return launchTemplatePrivateDnsNameOptionsRequest;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("HostnameType", targetDepth)) {<NEW_LINE>launchTemplatePrivateDnsNameOptionsRequest.setHostnameType(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("EnableResourceNameDnsARecord", targetDepth)) {<NEW_LINE>launchTemplatePrivateDnsNameOptionsRequest.setEnableResourceNameDnsARecord(BooleanStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("EnableResourceNameDnsAAAARecord", targetDepth)) {<NEW_LINE>launchTemplatePrivateDnsNameOptionsRequest.setEnableResourceNameDnsAAAARecord(BooleanStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return launchTemplatePrivateDnsNameOptionsRequest;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().unmarshall(context));
553,068
public OResultSet syncPull(OCommandContext ctx, int nRecords) throws OTimeoutException {<NEW_LINE>getPrev().ifPresent(x -> x.syncPull(ctx, nRecords));<NEW_LINE>long begin = profilingEnabled ? System.nanoTime() : 0;<NEW_LINE>try {<NEW_LINE>if (found) {<NEW_LINE>return new OInternalResultSet();<NEW_LINE>}<NEW_LINE>ODatabase db = ctx.getDatabase();<NEW_LINE>int clusterId;<NEW_LINE>if (clusterName != null) {<NEW_LINE><MASK><NEW_LINE>} else if (cluster.getClusterName() != null) {<NEW_LINE>clusterId = db.getClusterIdByName(cluster.getClusterName());<NEW_LINE>} else {<NEW_LINE>clusterId = cluster.getClusterNumber();<NEW_LINE>if (db.getClusterNameById(clusterId) == null) {<NEW_LINE>throw new OCommandExecutionException("Cluster not found: " + clusterId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (clusterId < 0) {<NEW_LINE>throw new OCommandExecutionException("Cluster not found: " + clusterName);<NEW_LINE>}<NEW_LINE>OClass clazz = db.getMetadata().getSchema().getClass(targetClass);<NEW_LINE>if (clazz == null) {<NEW_LINE>throw new OCommandExecutionException("Class not found: " + targetClass);<NEW_LINE>}<NEW_LINE>for (int clust : clazz.getPolymorphicClusterIds()) {<NEW_LINE>if (clust == clusterId) {<NEW_LINE>found = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!found) {<NEW_LINE>throw new OCommandExecutionException("Cluster " + clusterId + " does not belong to class " + targetClass);<NEW_LINE>}<NEW_LINE>return new OInternalResultSet();<NEW_LINE>} finally {<NEW_LINE>if (profilingEnabled) {<NEW_LINE>cost += (System.nanoTime() - begin);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
clusterId = db.getClusterIdByName(clusterName);
723,323
public boolean action(Request request, Response response) {<NEW_LINE>if (request.getNettyRequest() instanceof FullHttpRequest) {<NEW_LINE>InputBlacklistRequest inputData = getRequestBody(request.<MASK><NEW_LINE>if (inputData != null && !StringUtil.isNullOrEmpty(inputData.getUserId()) && !StringUtil.isNullOrEmpty(inputData.getTargetUid())) {<NEW_LINE>WFCMessage.BlackUserRequest friendRequest = WFCMessage.BlackUserRequest.newBuilder().setUid(inputData.getTargetUid()).setStatus(inputData.getStatus()).build();<NEW_LINE>sendApiMessage(response, inputData.getUserId(), IMTopic.BlackListUserTopic, friendRequest.toByteArray(), result -> {<NEW_LINE>ByteBuf byteBuf = Unpooled.buffer();<NEW_LINE>byteBuf.writeBytes(result);<NEW_LINE>ErrorCode errorCode = ErrorCode.fromCode(byteBuf.readByte());<NEW_LINE>return new Result(errorCode);<NEW_LINE>});<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>setResponseContent(RestResult.resultOf(ErrorCode.INVALID_PARAMETER), response);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
getNettyRequest(), InputBlacklistRequest.class);
936,850
public Map<String, Object> asMap() {<NEW_LINE>final Map<String, Object> <MASK><NEW_LINE>for (Method method : this.getClass().getMethods()) {<NEW_LINE>if (method.getName().startsWith("get") && method.getParameterTypes().length == 0) {<NEW_LINE>final String fieldName = method.getName().substring(3).toLowerCase(Locale.ENGLISH);<NEW_LINE>try {<NEW_LINE>result.put(fieldName, method.invoke(this));<NEW_LINE>} catch (IllegalAccessException | InvocationTargetException e) {<NEW_LINE>LOG.debug("Error while accessing field", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Field field : this.getClass().getFields()) {<NEW_LINE>if (!result.containsKey(field.getName())) {<NEW_LINE>try {<NEW_LINE>result.put(field.getName(), field.get(this));<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>LOG.debug("Error while accessing field", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
result = new HashMap<>();
5,387
final EventSubscription executeCreateEventSubscription(CreateEventSubscriptionRequest createEventSubscriptionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createEventSubscriptionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateEventSubscriptionRequest> request = null;<NEW_LINE>Response<EventSubscription> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateEventSubscriptionRequestMarshaller().marshall<MASK><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, "Redshift");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateEventSubscription");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<EventSubscription> responseHandler = new StaxResponseHandler<EventSubscription>(new EventSubscriptionStaxUnmarshaller());<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>}
(super.beforeMarshalling(createEventSubscriptionRequest));
1,830,424
public boolean onActivate(Item item, Player player) {<NEW_LINE>if (item.getId() == Item.DYE && item.getDamage() == 0x0F) {<NEW_LINE>if (player != null && (player.gamemode & 0x01) == 0) {<NEW_LINE>item.count--;<NEW_LINE>}<NEW_LINE>this.level.<MASK><NEW_LINE>ObjectTallGrass.growGrass(this.getLevel(), this, new NukkitRandom());<NEW_LINE>return true;<NEW_LINE>} else if (item.isHoe()) {<NEW_LINE>item.useOn(this);<NEW_LINE>this.getLevel().setBlock(this, Block.get(BlockID.FARMLAND));<NEW_LINE>return true;<NEW_LINE>} else if (item.isShovel()) {<NEW_LINE>item.useOn(this);<NEW_LINE>this.getLevel().setBlock(this, Block.get(BlockID.GRASS_PATH));<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
addParticle(new BoneMealParticle(this));
259,680
final DescribeLocationObjectStorageResult executeDescribeLocationObjectStorage(DescribeLocationObjectStorageRequest describeLocationObjectStorageRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeLocationObjectStorageRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeLocationObjectStorageRequest> request = null;<NEW_LINE>Response<DescribeLocationObjectStorageResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeLocationObjectStorageRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeLocationObjectStorageRequest));<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, "DataSync");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeLocationObjectStorage");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeLocationObjectStorageResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeLocationObjectStorageResultJsonUnmarshaller());<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());
188,996
final PutBotAliasResult executePutBotAlias(PutBotAliasRequest putBotAliasRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putBotAliasRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutBotAliasRequest> request = null;<NEW_LINE>Response<PutBotAliasResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new PutBotAliasRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putBotAliasRequest));<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, "Lex Model Building Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutBotAlias");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutBotAliasResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutBotAliasResultJsonUnmarshaller());<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.startEvent(Field.RequestMarshallTime);
307,349
private CombinedStatistics runAnalysis(Runtime runtime, long t0, EngineArguments args, MutationEngine engine) {<NEW_LINE>CoverageDatabase coverageData = coverage().calculateCoverage();<NEW_LINE>HistoryStore history = this.strategies.history();<NEW_LINE>LOG.fine("Used memory after coverage calculation " + ((runtime.totalMemory() - runtime.freeMemory()) / MB) + " mb");<NEW_LINE>LOG.fine("Free Memory after coverage calculation " + (runtime.freeMemory() / MB) + " mb");<NEW_LINE>final MutationStatisticsListener stats = new MutationStatisticsListener();<NEW_LINE>history.initialize();<NEW_LINE>this.timings.registerStart(Timings.Stage.BUILD_MUTATION_TESTS);<NEW_LINE>final List<MutationAnalysisUnit> tus = buildMutationTests(coverageData, history, engine, args, allInterceptors());<NEW_LINE>this.timings.<MASK><NEW_LINE>LOG.info("Created " + tus.size() + " mutation test units");<NEW_LINE>recordClassPath(history, coverageData);<NEW_LINE>LOG.fine("Used memory before analysis start " + ((runtime.totalMemory() - runtime.freeMemory()) / MB) + " mb");<NEW_LINE>LOG.fine("Free Memory before analysis start " + (runtime.freeMemory() / MB) + " mb");<NEW_LINE>final List<MutationResultListener> config = createConfig(t0, coverageData, history, stats, engine);<NEW_LINE>final MutationAnalysisExecutor mae = new MutationAnalysisExecutor(numberOfThreads(), config);<NEW_LINE>this.timings.registerStart(Timings.Stage.RUN_MUTATION_TESTS);<NEW_LINE>mae.run(tus);<NEW_LINE>this.timings.registerEnd(Timings.Stage.RUN_MUTATION_TESTS);<NEW_LINE>LOG.info("Completed in " + timeSpan(t0));<NEW_LINE>CombinedStatistics combined = new CombinedStatistics(stats.getStatistics(), coverageData.createSummary());<NEW_LINE>printStats(combined);<NEW_LINE>return combined;<NEW_LINE>}
registerEnd(Timings.Stage.BUILD_MUTATION_TESTS);
904,075
/*<NEW_LINE>* This method is intended for internal use only, and should only<NEW_LINE>* be called by other classes for unit testing.<NEW_LINE>*/<NEW_LINE>protected void applyOverrides(Alert alert) {<NEW_LINE>if (this.alertOverrides.isEmpty()) {<NEW_LINE>// Nothing to do<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String changedName = this.alertOverrides.getProperty(alert.getPluginId() + ".name");<NEW_LINE>if (changedName != null) {<NEW_LINE>alert.setName(applyOverride(alert.getName(), changedName));<NEW_LINE>}<NEW_LINE>String changedDesc = this.alertOverrides.getProperty(<MASK><NEW_LINE>if (changedDesc != null) {<NEW_LINE>alert.setDescription(applyOverride(alert.getDescription(), changedDesc));<NEW_LINE>}<NEW_LINE>String changedSolution = this.alertOverrides.getProperty(alert.getPluginId() + ".solution");<NEW_LINE>if (changedSolution != null) {<NEW_LINE>alert.setSolution(applyOverride(alert.getSolution(), changedSolution));<NEW_LINE>}<NEW_LINE>String changedOther = this.alertOverrides.getProperty(alert.getPluginId() + ".otherInfo");<NEW_LINE>if (changedOther != null) {<NEW_LINE>alert.setOtherInfo(applyOverride(alert.getOtherInfo(), changedOther));<NEW_LINE>}<NEW_LINE>String changedReference = this.alertOverrides.getProperty(alert.getPluginId() + ".reference");<NEW_LINE>if (changedReference != null) {<NEW_LINE>alert.setReference(applyOverride(alert.getReference(), changedReference));<NEW_LINE>}<NEW_LINE>Map<String, String> tags = new HashMap<>(alert.getTags());<NEW_LINE>for (Map.Entry<Object, Object> e : this.alertOverrides.entrySet()) {<NEW_LINE>String propertyKey = e.getKey().toString();<NEW_LINE>if (propertyKey.startsWith(alert.getPluginId() + ".tag.")) {<NEW_LINE>String tagKey = propertyKey.substring((alert.getPluginId() + ".tag.").length());<NEW_LINE>tags.put(tagKey, applyOverride(alert.getTags().getOrDefault(tagKey, ""), e.getValue().toString()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>alert.setTags(tags);<NEW_LINE>}
alert.getPluginId() + ".description");
70,424
void createOAuth2ClientFilter(BeanReference requestCache, BeanReference authenticationManager, BeanReference authenticationFilterSecurityContextRepositoryRef) {<NEW_LINE>Element oauth2ClientElt = DomUtils.getChildElementByTagName(this.httpElt, Elements.OAUTH2_CLIENT);<NEW_LINE>if (oauth2ClientElt == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.oauth2ClientEnabled = true;<NEW_LINE>OAuth2ClientBeanDefinitionParser parser = new OAuth2ClientBeanDefinitionParser(requestCache, authenticationManager, authenticationFilterSecurityContextRepositoryRef);<NEW_LINE>parser.parse(oauth2ClientElt, this.pc);<NEW_LINE>BeanDefinition defaultAuthorizedClientRepository = parser.getDefaultAuthorizedClientRepository();<NEW_LINE>registerDefaultAuthorizedClientRepositoryIfNecessary(defaultAuthorizedClientRepository);<NEW_LINE>this.authorizationRequestRedirectFilter = parser.getAuthorizationRequestRedirectFilter();<NEW_LINE>String authorizationRequestRedirectFilterId = this.pc.getReaderContext().generateBeanName(this.authorizationRequestRedirectFilter);<NEW_LINE>this.pc.registerBeanComponent(new BeanComponentDefinition(this.authorizationRequestRedirectFilter, authorizationRequestRedirectFilterId));<NEW_LINE>this.authorizationCodeGrantFilter = parser.getAuthorizationCodeGrantFilter();<NEW_LINE>String authorizationCodeGrantFilterId = this.pc.getReaderContext(<MASK><NEW_LINE>this.pc.registerBeanComponent(new BeanComponentDefinition(this.authorizationCodeGrantFilter, authorizationCodeGrantFilterId));<NEW_LINE>BeanDefinition authorizationCodeAuthenticationProvider = parser.getAuthorizationCodeAuthenticationProvider();<NEW_LINE>String authorizationCodeAuthenticationProviderId = this.pc.getReaderContext().generateBeanName(authorizationCodeAuthenticationProvider);<NEW_LINE>this.pc.registerBeanComponent(new BeanComponentDefinition(authorizationCodeAuthenticationProvider, authorizationCodeAuthenticationProviderId));<NEW_LINE>this.authorizationCodeAuthenticationProviderRef = new RuntimeBeanReference(authorizationCodeAuthenticationProviderId);<NEW_LINE>}
).generateBeanName(this.authorizationCodeGrantFilter);
1,678,643
private String generateClientPhaseTimeCostSpan(RpcInvokeContext context) {<NEW_LINE>TreeMap<String, String> resultMap = new TreeMap<>();<NEW_LINE>Long routerTime = (Long) context.get(RpcConstants.INTERNAL_KEY_CLIENT_ROUTER_TIME_NANO);<NEW_LINE>Long connTime = (Long) context.get(RpcConstants.INTERNAL_KEY_CONN_CREATE_TIME_NANO);<NEW_LINE>Long filterTime = (Long) context.get(RpcConstants.INTERNAL_KEY_CLIENT_FILTER_TIME_NANO);<NEW_LINE>Long balancerTime = (Long) context.get(RpcConstants.INTERNAL_KEY_CLIENT_BALANCER_TIME_NANO);<NEW_LINE>Long reqSerializeTime = (Long) <MASK><NEW_LINE>Long respDeSerializeTime = (Long) context.get(RpcConstants.INTERNAL_KEY_RESP_DESERIALIZE_TIME_NANO);<NEW_LINE>resultMap.put(TracerRecord.R1.toString(), calculateNanoTime(routerTime).toString());<NEW_LINE>resultMap.put(TracerRecord.R2.toString(), calculateNanoTime(connTime).toString());<NEW_LINE>resultMap.put(TracerRecord.R3.toString(), calculateNanoTime(filterTime).toString());<NEW_LINE>resultMap.put(TracerRecord.R4.toString(), calculateNanoTime(balancerTime).toString());<NEW_LINE>resultMap.put(TracerRecord.R5.toString(), appendResult(calculateNanoTime(reqSerializeTime).toString(), calculateNanoTime(respDeSerializeTime).toString()));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>for (Map.Entry<String, String> entry : resultMap.entrySet()) {<NEW_LINE>sb.append(entry.getKey());<NEW_LINE>sb.append("=");<NEW_LINE>sb.append(entry.getValue());<NEW_LINE>sb.append("&");<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}
context.get(RpcConstants.INTERNAL_KEY_REQ_SERIALIZE_TIME_NANO);
378,125
public Message merge(Iterable<Message> summaries) {<NEW_LINE>List<PrimitiveVS<Event>> eventsToMerge = new ArrayList<>();<NEW_LINE>List<PrimitiveVS<Machine>> targetsToMerge = new ArrayList<>();<NEW_LINE>List<VectorClockVS> clocksToMerge = new ArrayList<>();<NEW_LINE>Map<Event, UnionVS> newPayload = new HashMap<>();<NEW_LINE>for (Map.Entry<Event, UnionVS> entry : this.payload.entrySet()) {<NEW_LINE>if (!event.getGuardFor(entry.getKey()).isFalse() && entry.getValue() != null) {<NEW_LINE>newPayload.put(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Message summary : summaries) {<NEW_LINE>eventsToMerge.add(summary.event);<NEW_LINE><MASK><NEW_LINE>clocksToMerge.add(summary.clock);<NEW_LINE>for (Map.Entry<Event, UnionVS> entry : summary.payload.entrySet()) {<NEW_LINE>newPayload.computeIfPresent(entry.getKey(), (key, value) -> value.merge(summary.payload.get(key)));<NEW_LINE>if (entry.getValue() != null)<NEW_LINE>newPayload.putIfAbsent(entry.getKey(), entry.getValue());<NEW_LINE>if (newPayload.containsKey(entry.getKey()) && newPayload.get(entry.getKey()) == null) {<NEW_LINE>assert (false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Message(event.merge(eventsToMerge), target.merge(targetsToMerge), newPayload, clock.merge(clocksToMerge));<NEW_LINE>}
targetsToMerge.add(summary.target);
1,835,132
private void parseAdtsHeader() throws ParserException {<NEW_LINE>adtsScratch.setPosition(0);<NEW_LINE>if (!hasOutputFormat) {<NEW_LINE>int audioObjectType = adtsScratch.readBits(2) + 1;<NEW_LINE>if (audioObjectType != 2) {<NEW_LINE>// The stream indicates AAC-Main (1), AAC-SSR (3) or AAC-LTP (4). When the stream indicates<NEW_LINE>// AAC-Main it's more likely that the stream contains HE-AAC (5), which cannot be<NEW_LINE>// represented correctly in the 2 bit audio_object_type field in the ADTS header. In<NEW_LINE>// practice when the stream indicates AAC-SSR or AAC-LTP it more commonly contains AAC-LC or<NEW_LINE>// HE-AAC. Since most Android devices don't support AAC-Main, AAC-SSR or AAC-LTP, and since<NEW_LINE>// indicating AAC-LC works for HE-AAC streams, we pretend that we're dealing with AAC-LC and<NEW_LINE>// hope for the best. In practice this often works.<NEW_LINE>// See: https://github.com/google/ExoPlayer/issues/774<NEW_LINE>// See: https://github.com/google/ExoPlayer/issues/1383<NEW_LINE>Log.w(TAG, "Detected audio object type: " + audioObjectType + ", but assuming AAC LC.");<NEW_LINE>audioObjectType = 2;<NEW_LINE>}<NEW_LINE>adtsScratch.skipBits(5);<NEW_LINE>int channelConfig = adtsScratch.readBits(3);<NEW_LINE>byte[] audioSpecificConfig = AacUtil.buildAudioSpecificConfig(audioObjectType, firstFrameSampleRateIndex, channelConfig);<NEW_LINE>AacUtil.Config aacConfig = AacUtil.parseAudioSpecificConfig(audioSpecificConfig);<NEW_LINE>Format format = new Format.Builder().setId(formatId).setSampleMimeType(MimeTypes.AUDIO_AAC).setCodecs(aacConfig.codecs).setChannelCount(aacConfig.channelCount).setSampleRate(aacConfig.sampleRateHz).setInitializationData(Collections.singletonList(audioSpecificConfig)).setLanguage(language).build();<NEW_LINE>// In this class a sample is an access unit, but the MediaFormat sample rate specifies the<NEW_LINE>// number of PCM audio samples per second.<NEW_LINE>sampleDurationUs = (C.<MASK><NEW_LINE>output.format(format);<NEW_LINE>hasOutputFormat = true;<NEW_LINE>} else {<NEW_LINE>adtsScratch.skipBits(10);<NEW_LINE>}<NEW_LINE>adtsScratch.skipBits(4);<NEW_LINE>int sampleSize = adtsScratch.readBits(13) - 2 - /* the sync word */<NEW_LINE>HEADER_SIZE;<NEW_LINE>if (hasCrc) {<NEW_LINE>sampleSize -= CRC_SIZE;<NEW_LINE>}<NEW_LINE>setReadingSampleState(output, sampleDurationUs, 0, sampleSize);<NEW_LINE>}
MICROS_PER_SECOND * 1024) / format.sampleRate;
1,209,885
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {<NEW_LINE>JsonObject input = InputParser.parseJsonObjectOrThrowError(req);<NEW_LINE>String method = InputParser.parseStringOrThrowError(input, "method", false);<NEW_LINE>String token = InputParser.parseStringOrThrowError(input, "token", false);<NEW_LINE>assert method != null;<NEW_LINE>assert token != null;<NEW_LINE>// used to be according to logic in https://github.com/supertokens/supertokens-core/issues/141<NEW_LINE>// but then changed slightly when extracting this into its own recipe<NEW_LINE>if (!method.equals("token")) {<NEW_LINE>throw new ServletException(new BadRequestException("Unsupported method for email verification"));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>User user = EmailVerification.verifyEmail(super.main, token);<NEW_LINE>JsonObject result = new JsonObject();<NEW_LINE>result.addProperty("status", "OK");<NEW_LINE>result.addProperty("userId", user.id);<NEW_LINE>result.addProperty("email", user.email);<NEW_LINE>super.sendJsonResponse(200, result, resp);<NEW_LINE>} catch (EmailVerificationInvalidTokenException e) {<NEW_LINE>Logging.debug(main<MASK><NEW_LINE>JsonObject result = new JsonObject();<NEW_LINE>result.addProperty("status", "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR");<NEW_LINE>super.sendJsonResponse(200, result, resp);<NEW_LINE>} catch (StorageQueryException | NoSuchAlgorithmException | StorageTransactionLogicException e) {<NEW_LINE>throw new ServletException(e);<NEW_LINE>}<NEW_LINE>}
, Utils.exceptionStacktraceToString(e));
1,173,485
public void dfs(int i, int j, String result, boolean[][] visited, Trie tree, List<String> results, char[][] board) {<NEW_LINE>// System.out.println(result);<NEW_LINE>if (!tree.isPrefix(result)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (tree.search(result) && !set.contains(result)) {<NEW_LINE>results.add(result);<NEW_LINE>set.add(result);<NEW_LINE>// return;<NEW_LINE>}<NEW_LINE>int[][] step = { { 1, 0 }, { -1, 0 }, { 0, 1 }, { 0, -1 } };<NEW_LINE>for (int k = 0; k < step.length; k++) {<NEW_LINE>int x = i + step[k][0];<NEW_LINE>int y = j + step[k][1];<NEW_LINE>if (x >= 0 && x < board.length && y >= 0 && y < board[x].length && !visited[x][y]) {<NEW_LINE>visited[x][y] = true;<NEW_LINE>dfs(x, y, result + board[x][y], <MASK><NEW_LINE>visited[x][y] = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
visited, tree, results, board);
831,151
public String buildGetMeetingsResponse(Collection<Meeting> meetings, String msgKey, String msg, String returnCode) {<NEW_LINE>ArrayList<MeetingResponseDetail> meetingResponseDetails = new ArrayList<MeetingResponseDetail>();<NEW_LINE>for (Meeting meeting : meetings) {<NEW_LINE>String createdOn = formatPrettyDate(meeting.getCreateTime());<NEW_LINE>MeetingResponseDetail details = new MeetingResponseDetail(createdOn, meeting);<NEW_LINE>meetingResponseDetails.add(details);<NEW_LINE>}<NEW_LINE>StringWriter xmlText = new StringWriter();<NEW_LINE>Map<String, Serializable> data = new HashMap<String, Serializable>();<NEW_LINE>data.put("returnCode", returnCode);<NEW_LINE><MASK><NEW_LINE>data.put("msgKey", msgKey);<NEW_LINE>data.put("msg", msg);<NEW_LINE>processData(getTemplate("get-meetings.ftlx"), data, xmlText);<NEW_LINE>return xmlText.toString();<NEW_LINE>}
data.put("meetingDetailsList", meetingResponseDetails);
396,794
public void write(byte[] bytes, int off, int len) throws IOException {<NEW_LINE>// if httpResponse.setContentType(x) has been called with !x.contains("text/html"),<NEW_LINE>// then no need to continue scanning for the beforeTag<NEW_LINE>if (injectionCanceled) {<NEW_LINE>super.write(bytes, off, len);<NEW_LINE>} else {<NEW_LINE>final int index = indexOf(bytes, beforeTag, off, len);<NEW_LINE>if (index == -1) {<NEW_LINE>// beforeTag not found yet<NEW_LINE>super.write(bytes, off, len);<NEW_LINE>} else {<NEW_LINE>// beforeTag found: inject content.<NEW_LINE>super.write(bytes, off, index);<NEW_LINE>final <MASK><NEW_LINE>// HttpServletResponse.getCharacterEncoding() shouldn't return null according the spec<NEW_LINE>super.write(content.getBytes(response.getCharacterEncoding()));<NEW_LINE>super.write(bytes, off + index, len - index);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
String content = htmlToInject.getContent();
1,589,993
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>Bundle args = Preconditions.checkNotNull(getArguments());<NEW_LINE><MASK><NEW_LINE>thumbnail = args.getBoolean(THUMBNAIL_KEY);<NEW_LINE>fullRequest = GlideApp.with(this).asDrawable().centerCrop();<NEW_LINE>thumbnailRequest = GlideApp.with(this).asDrawable().centerCrop().override(Api.SQUARE_THUMB_SIZE);<NEW_LINE>preloadRequest = thumbnail ? thumbnailRequest.clone().priority(Priority.HIGH) : fullRequest;<NEW_LINE>final View result = inflater.inflate(R.layout.flickr_photo_grid, container, false);<NEW_LINE>final int gridMargin = getResources().getDimensionPixelOffset(R.dimen.grid_margin);<NEW_LINE>int spanCount = getResources().getDisplayMetrics().widthPixels / (photoSize + (2 * gridMargin));<NEW_LINE>grid = result.findViewById(R.id.flickr_photo_grid);<NEW_LINE>layoutManager = new GridLayoutManager(getActivity(), spanCount);<NEW_LINE>grid.setLayoutManager(layoutManager);<NEW_LINE>grid.addItemDecoration(new RecyclerView.ItemDecoration() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {<NEW_LINE>outRect.set(gridMargin, gridMargin, gridMargin, gridMargin);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>grid.setRecyclerListener(new RecyclerView.RecyclerListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onViewRecycled(RecyclerView.ViewHolder holder) {<NEW_LINE>PhotoViewHolder photoViewHolder = (PhotoViewHolder) holder;<NEW_LINE>GlideApp.with(FlickrPhotoGrid.this).clear(photoViewHolder.imageView);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>int heightCount = getResources().getDisplayMetrics().heightPixels / photoSize;<NEW_LINE>grid.getRecycledViewPool().setMaxRecycledViews(0, spanCount * heightCount * 2);<NEW_LINE>grid.setItemViewCacheSize(0);<NEW_LINE>adapter = new PhotoAdapter();<NEW_LINE>grid.setAdapter(adapter);<NEW_LINE>FixedPreloadSizeProvider<Photo> preloadSizeProvider = new FixedPreloadSizeProvider<>(photoSize, photoSize);<NEW_LINE>RecyclerViewPreloader<Photo> preloader = new RecyclerViewPreloader<>(Glide.with(this), adapter, preloadSizeProvider, args.getInt(PRELOAD_KEY));<NEW_LINE>grid.addOnScrollListener(preloader);<NEW_LINE>if (currentPhotos != null) {<NEW_LINE>adapter.setPhotos(currentPhotos);<NEW_LINE>}<NEW_LINE>if (savedInstanceState != null) {<NEW_LINE>int index = savedInstanceState.getInt(STATE_POSITION_INDEX);<NEW_LINE>grid.scrollToPosition(index);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
photoSize = args.getInt(IMAGE_SIZE_KEY);
1,155,740
private static void plainValidationInternal(ValidationContext vCxt, Graph data, Node node, Shape shape) {<NEW_LINE>Collection<Node> focusNodes;<NEW_LINE>if (node != null) {<NEW_LINE>if (!VLib.isFocusNode(shape, node, data))<NEW_LINE>return;<NEW_LINE>focusNodes = Collections.singleton(node);<NEW_LINE>} else {<NEW_LINE>focusNodes = VLib.focusNodes(data, shape);<NEW_LINE>}<NEW_LINE>if (vCxt.isVerbose()) {<NEW_LINE>out.println(shape.toString());<NEW_LINE>out.printf("N: FocusNodes(%d): %s\n", focusNodes.size(), focusNodes);<NEW_LINE>out.incIndent();<NEW_LINE>}<NEW_LINE>for (Node focusNode : focusNodes) {<NEW_LINE>if (vCxt.isVerbose())<NEW_LINE>out.println("F: " + focusNode);<NEW_LINE>VLib.validateShape(<MASK><NEW_LINE>}<NEW_LINE>if (vCxt.isVerbose()) {<NEW_LINE>out.decIndent();<NEW_LINE>}<NEW_LINE>}
vCxt, data, shape, focusNode);
531,731
TypeDescriptor replaceInternalTypeDescriptors(TypeReplacer fn, Set<TypeDescriptor> seen) {<NEW_LINE>List<MASK><NEW_LINE>List<TypeDescriptor> newtypeArguments = replaceTypeDescriptors(typeArguments, fn, seen);<NEW_LINE>if (!typeArguments.equals(newtypeArguments)) {<NEW_LINE>return Builder.from(this).setTypeArgumentDescriptors(newtypeArguments).build();<NEW_LINE>}<NEW_LINE>// We should also re-write TypeVariable for the TypeDescriptor however the type model currently<NEW_LINE>// doesn't allow that since they are not part of the key. This leaves edge cases where we may<NEW_LINE>// leave a reference however JavaScript stack will detect that.<NEW_LINE>// Note that this limitation is acceptable since in practice user shouldn't refer to AutoValue<NEW_LINE>// generated classes (this is where this functionality is currently only used) other than a few<NEW_LINE>// trival scenarios. What we have here is already an overkill in practice for well formed code.<NEW_LINE>return this;<NEW_LINE>}
<TypeDescriptor> typeArguments = getTypeArgumentDescriptors();
570,257
public Contributor unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Contributor contributor = new Contributor();<NEW_LINE>int originalDepth = context.getCurrentDepth();<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("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>contributor.setName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Value", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>contributor.setValue(context.getUnmarshaller(Long.<MASK><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 contributor;<NEW_LINE>}
class).unmarshall(context));
1,270,848
protected void checkNeighbors(int cx, int cy, float score, float flowX, float flowY, ImageFlow output) {<NEW_LINE>int x0 = Math.max(0, cx - regionRadius);<NEW_LINE>int x1 = Math.min(output.width, cx + regionRadius + 1);<NEW_LINE>int y0 = Math.max(0, cy - regionRadius);<NEW_LINE>int y1 = Math.min(output.height, cy + regionRadius + 1);<NEW_LINE>for (int i = y0; i < y1; i++) {<NEW_LINE>int index = width * i + x0;<NEW_LINE>for (int j = x0; j < x1; j++, index++) {<NEW_LINE>float s = scores[index];<NEW_LINE>ImageFlow.D f = output.data[index];<NEW_LINE>if (s > score) {<NEW_LINE><MASK><NEW_LINE>scores[index] = score;<NEW_LINE>} else if (s == score) {<NEW_LINE>// Pick solution with the least motion when ambiguous<NEW_LINE>float m0 = f.x * f.x + f.y * f.y;<NEW_LINE>float m1 = flowX * flowX + flowY * flowY;<NEW_LINE>if (m1 < m0) {<NEW_LINE>f.set(flowX, flowY);<NEW_LINE>scores[index] = score;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
f.set(flowX, flowY);
540,914
public void parse(Model target, MPSParser parser, int i) throws Exception {<NEW_LINE>parser.model(target, instance, maximize, <MASK><NEW_LINE>if (i == 0) {<NEW_LINE>Solver solver = target.getSolver();<NEW_LINE>if (target.getNbRealVar() == 0) {<NEW_LINE>target.getSolver().setSearch(Search.intVarSearch(new FirstFail(target), /*new org.chocosolver.parser.mps.IntDomainBest()*/<NEW_LINE>// new IntDomainMin(),<NEW_LINE>new org.chocosolver.solver.search.strategy.selectors.values.IntDomainBest(), target.retrieveIntVars(true)));<NEW_LINE>} else {<NEW_LINE>solver.setSearch(Search.defaultSearch(target));<NEW_LINE>solver.setLubyRestart(500, new FailCounter(target, 0), 5000);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ninf, pinf, ibex, noeq);
1,606,585
public void run(RegressionEnvironment env) {<NEW_LINE>sendTimeEvent(env, "2002-05-1T7:00:00.000");<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String eplTwo = "@public create context NestedContext as start (0, 8, *, *, *) end (0, 9, *, *, *)";<NEW_LINE>env.compileDeploy(eplTwo, path);<NEW_LINE>env.milestone(0);<NEW_LINE>String[] fields = "c1,c2".split(",");<NEW_LINE>env.compileDeploy("@Name('s0') context NestedContext select " + "theString as c1, count(*) as c2 from SupportBean group by theString", path);<NEW_LINE>env.addListener("s0");<NEW_LINE>env.sendEventBean(new SupportBean("E1", 0));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.milestone(1);<NEW_LINE>// start context<NEW_LINE>sendTimeEvent(env, "2002-05-1T8:00:00.000");<NEW_LINE>env.milestone(2);<NEW_LINE>env.sendEventBean(new SupportBean("E2", 0));<NEW_LINE>env.assertPropsNew("s0", fields, new Object<MASK><NEW_LINE>env.milestone(3);<NEW_LINE>env.sendEventBean(new SupportBean("E1", 0));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "E1", 1L });<NEW_LINE>env.milestone(4);<NEW_LINE>env.sendEventBean(new SupportBean("E2", 0));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "E2", 2L });<NEW_LINE>env.milestone(5);<NEW_LINE>// terminate<NEW_LINE>sendTimeEvent(env, "2002-05-1T9:00:00.000");<NEW_LINE>env.milestone(6);<NEW_LINE>env.sendEventBean(new SupportBean("E2", 0));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.milestone(7);<NEW_LINE>// start context<NEW_LINE>sendTimeEvent(env, "2002-05-2T8:00:00.000");<NEW_LINE>env.milestone(8);<NEW_LINE>env.sendEventBean(new SupportBean("E2", 0));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "E2", 1L });<NEW_LINE>env.undeployAll();<NEW_LINE>}
[] { "E2", 1L });
1,843,604
private void refreshUI() {<NEW_LINE>int index = lCategories.getSelectedIndex();<NEW_LINE>if (index < 0) {<NEW_LINE>// no category selected<NEW_LINE>cbForeground.setEnabled(false);<NEW_LINE>cbBackground.setEnabled(false);<NEW_LINE>cbEffectColor.setEnabled(false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>cbForeground.setEnabled(true);<NEW_LINE>cbBackground.setEnabled(true);<NEW_LINE>cbEffectColor.setEnabled(true);<NEW_LINE>listen = false;<NEW_LINE>// set defaults<NEW_LINE>AttributeSet defAs = getDefaultColoring();<NEW_LINE>if (defAs != null) {<NEW_LINE>Color inheritedForeground = (Color) defAs.getAttribute(StyleConstants.Foreground);<NEW_LINE>if (inheritedForeground == null) {<NEW_LINE>inheritedForeground = Color.black;<NEW_LINE>}<NEW_LINE>ColorComboBoxSupport.setInheritedColor((ColorComboBox) cbForeground, inheritedForeground);<NEW_LINE>Color inheritedBackground = (Color) defAs.getAttribute(StyleConstants.Background);<NEW_LINE>if (inheritedBackground == null) {<NEW_LINE>inheritedBackground = Color.white;<NEW_LINE>}<NEW_LINE>ColorComboBoxSupport.setInheritedColor<MASK><NEW_LINE>}<NEW_LINE>// set values<NEW_LINE>List<AttributeSet> annotations = getAnnotations(currentScheme);<NEW_LINE>AttributeSet c = annotations.get(index);<NEW_LINE>ColorComboBoxSupport.setSelectedColor((ColorComboBox) cbForeground, (Color) c.getAttribute(StyleConstants.Foreground));<NEW_LINE>ColorComboBoxSupport.setSelectedColor((ColorComboBox) cbBackground, (Color) c.getAttribute(StyleConstants.Background));<NEW_LINE>if (c.getAttribute(EditorStyleConstants.WaveUnderlineColor) != null) {<NEW_LINE>cbEffects.setSelectedIndex(1);<NEW_LINE>cbEffectColor.setEnabled(true);<NEW_LINE>((ColorComboBox) cbEffectColor).setSelectedColor((Color) c.getAttribute(EditorStyleConstants.WaveUnderlineColor));<NEW_LINE>} else {<NEW_LINE>cbEffects.setSelectedIndex(0);<NEW_LINE>cbEffectColor.setEnabled(false);<NEW_LINE>cbEffectColor.setSelectedIndex(-1);<NEW_LINE>}<NEW_LINE>listen = true;<NEW_LINE>}
((ColorComboBox) cbBackground, inheritedBackground);
1,546,501
final ListFindingsReportsResult executeListFindingsReports(ListFindingsReportsRequest listFindingsReportsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listFindingsReportsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListFindingsReportsRequest> request = null;<NEW_LINE>Response<ListFindingsReportsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListFindingsReportsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listFindingsReportsRequest));<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, "CodeGuruProfiler");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListFindingsReports");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListFindingsReportsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListFindingsReportsResultJsonUnmarshaller());<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,167,409
public Text unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Text text = new Text();<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("Locale", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>text.setLocale(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Value", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>text.setValue(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 text;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
267,590
private HashMap<String, DBObject> loadDBObjects(Class objectClass) {<NEW_LINE>// the return value - an empty hashmap if something goes wrong<NEW_LINE>HashMap<String, DBObject> objectMap = new HashMap<String, DBObject>();<NEW_LINE>// create an object of the class we want to load (just for access to its static members)<NEW_LINE>DBObject dbObject <MASK><NEW_LINE>String objectToLoad = s_logger.localizeMessage("object");<NEW_LINE>String objectsToLoad = s_logger.localizeMessage("objects");<NEW_LINE>String sqlLoadHeaders = null;<NEW_LINE>String sqlLoadContents = null;<NEW_LINE>if (dbObject != null) {<NEW_LINE>objectToLoad = dbObject.getObjectType();<NEW_LINE>objectsToLoad = dbObject.getObjectTypes();<NEW_LINE>sqlLoadHeaders = dbObject.getLoadHeaderSQL();<NEW_LINE>sqlLoadContents = dbObject.getLoadContentSQL();<NEW_LINE>}<NEW_LINE>s_logger.log(Level.FINE, "loadDBObjects", new Object[] { objectsToLoad, getDirection() });<NEW_LINE>// pre-compile sql statement for loading header information<NEW_LINE>PreparedStatementWrapper stmtLoadHeaders = setPreparedStatement(sqlLoadHeaders);<NEW_LINE>// pre-compile sql statement for loading content information<NEW_LINE>PreparedStatementWrapper stmtLoadContents = setPreparedStatement(sqlLoadContents);<NEW_LINE>// actual loading of database objects<NEW_LINE>int counter = 0;<NEW_LINE>if (dbObject != null) {<NEW_LINE>String sql = dbObject.getLoadObjectSQL();<NEW_LINE>Statement stmt = setStatement();<NEW_LINE>ResultSet rs = executeQuery(stmt, sql);<NEW_LINE>while (getResultSetNext(rs)) {<NEW_LINE>String s = getResultSetString(rs, "OBJECT_NAME");<NEW_LINE>if (!objectMap.containsKey(s)) {<NEW_LINE>DBObject obj = new DBObject(this, objectClass, s);<NEW_LINE>obj.populate(stmtLoadHeaders, stmtLoadContents);<NEW_LINE>// only add objects that have been populated<NEW_LINE>if (obj.isPopulated()) {<NEW_LINE>objectMap.put(s.toUpperCase(), obj);<NEW_LINE>counter++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>releaseResultSet(rs);<NEW_LINE>releaseStatement(stmt);<NEW_LINE>}<NEW_LINE>// release prepared statement for loading headers from database<NEW_LINE>releasePreparedStatement(stmtLoadHeaders);<NEW_LINE>// release prepared statement for loading contents from database<NEW_LINE>releasePreparedStatement(stmtLoadContents);<NEW_LINE>if (counter == 1)<NEW_LINE>s_logger.log(Level.FINE, "dbObjectsLoaded", new Object[] { Integer.toString(counter), objectToLoad });<NEW_LINE>else<NEW_LINE>s_logger.log(Level.FINE, "dbObjectsLoaded", new Object[] { Integer.toString(counter), objectsToLoad });<NEW_LINE>s_logger.flush();<NEW_LINE>return objectMap;<NEW_LINE>}
= new DBObject(this, objectClass);
541,050
public Map<File, Properties> processPartsExtended(final Payload.Inbound inboundPayload) throws Exception {<NEW_LINE>if (inboundPayload == null) {<NEW_LINE>return Collections.emptyMap();<NEW_LINE>}<NEW_LINE>final Map<File, Properties> result = new <MASK><NEW_LINE>boolean isReportProcessed = false;<NEW_LINE>Part possibleUnrecognizedReportPart = null;<NEW_LINE>StringBuilder uploadedEntryNames = new StringBuilder();<NEW_LINE>for (Iterator<Payload.Part> partIt = inboundPayload.parts(); partIt.hasNext(); ) {<NEW_LINE>Payload.Part part = partIt.next();<NEW_LINE>DataRequestType drt = DataRequestType.getType(part);<NEW_LINE>if (drt != null) {<NEW_LINE>result.put(drt.processPart(this, part, part.getName()), part.getProperties());<NEW_LINE>isReportProcessed |= (drt == DataRequestType.REPORT);<NEW_LINE>uploadedEntryNames.append(part.getName()).append(" ");<NEW_LINE>} else {<NEW_LINE>if ((!isReportProcessed) && possibleUnrecognizedReportPart == null) {<NEW_LINE>possibleUnrecognizedReportPart = part;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ((!isReportProcessed) && possibleUnrecognizedReportPart != null) {<NEW_LINE>DataRequestType.REPORT.processPart(this, possibleUnrecognizedReportPart, possibleUnrecognizedReportPart.getName());<NEW_LINE>isReportProcessed = true;<NEW_LINE>}<NEW_LINE>postProcessParts();<NEW_LINE>return result;<NEW_LINE>}
LinkedHashMap<File, Properties>();
462,327
public void associateCookie(final AgentIdentifier agentIdentifier, final String cookie) {<NEW_LINE>final String uuid = agentIdentifier.getUuid();<NEW_LINE>final String key = agentCacheKey(uuid);<NEW_LINE>List<String> uuids = singletonList(agentIdentifier.getUuid());<NEW_LINE>AgentMutex <MASK><NEW_LINE>synchronized (mutex) {<NEW_LINE>transactionTemplate.execute(new TransactionCallbackWithoutResult() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void doInTransactionWithoutResult(TransactionStatus status) {<NEW_LINE>Agent agent = fetchAgentFromDBByUUID(uuid);<NEW_LINE>if (agent == null) {<NEW_LINE>throw new UnregisteredAgentException(format("Agent [%s] is not registered.", uuid), uuid);<NEW_LINE>}<NEW_LINE>agent.setCookie(cookie);<NEW_LINE>getHibernateTemplate().saveOrUpdate(agent);<NEW_LINE>final Agent updatedAgent = agent;<NEW_LINE>registerAfterCommitCallback(() -> clearCacheAndNotifyAgentEntityChangeListeners(key, updatedAgent));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>agentMutexes.release(uuids, mutex);<NEW_LINE>}<NEW_LINE>}
mutex = agentMutexes.acquire(uuids);
1,812,731
protected void parseRelations(List<Osmformat.Relation> rels) {<NEW_LINE>if (parsePhase != OsmParserPhase.Relations) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (Osmformat.Relation i : rels) {<NEW_LINE>OSMRelation tmp = new OSMRelation();<NEW_LINE>tmp.setId(i.getId());<NEW_LINE>for (int j = 0; j < i.getKeysCount(); j++) {<NEW_LINE>OSMTag tag = new OSMTag();<NEW_LINE>String key = internalize(getStringById(i.getKeys(j)));<NEW_LINE>String value = internalize(getStringById(i.getVals(j)));<NEW_LINE>tag.setK(key);<NEW_LINE>tag.setV(value);<NEW_LINE>tmp.addTag(tag);<NEW_LINE>}<NEW_LINE>long lastMid = 0;<NEW_LINE>for (int j = 0; j < i.getMemidsCount(); j++) {<NEW_LINE>OSMRelationMember relMember = new OSMRelationMember();<NEW_LINE>long mid = <MASK><NEW_LINE>relMember.setRef(mid);<NEW_LINE>lastMid = mid;<NEW_LINE>relMember.setRole(internalize(getStringById(i.getRolesSid(j))));<NEW_LINE>if (i.getTypes(j) == Osmformat.Relation.MemberType.NODE) {<NEW_LINE>relMember.setType("node");<NEW_LINE>} else if (i.getTypes(j) == Osmformat.Relation.MemberType.WAY) {<NEW_LINE>relMember.setType("way");<NEW_LINE>} else if (i.getTypes(j) == Osmformat.Relation.MemberType.RELATION) {<NEW_LINE>relMember.setType("relation");<NEW_LINE>} else {<NEW_LINE>// TODO; Illegal file?<NEW_LINE>assert false;<NEW_LINE>}<NEW_LINE>tmp.addMember(relMember);<NEW_LINE>}<NEW_LINE>osmdb.addRelation(tmp);<NEW_LINE>}<NEW_LINE>}
lastMid + i.getMemids(j);
1,657,537
static public HashMap<String, String> readSettings(File inputFile) {<NEW_LINE>HashMap<String, String> outgoing = new HashMap<>();<NEW_LINE>// return empty hash<NEW_LINE>if (!inputFile.exists())<NEW_LINE>return outgoing;<NEW_LINE>String[] lines = PApplet.loadStrings(inputFile);<NEW_LINE>for (int i = 0; i < lines.length; i++) {<NEW_LINE>int hash = lines[i].indexOf('#');<NEW_LINE>String line = (hash == -1) ? lines[i].trim() : lines[i].substring(0, hash).trim();<NEW_LINE>if (line.length() == 0)<NEW_LINE>continue;<NEW_LINE>int equals = line.indexOf('=');<NEW_LINE>if (equals == -1) {<NEW_LINE>System.err.println("ignoring illegal line in " + inputFile);<NEW_LINE>System.err.println(" " + line);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String attr = line.substring(0, equals).trim();<NEW_LINE>String valu = line.substring(<MASK><NEW_LINE>outgoing.put(attr, valu);<NEW_LINE>}<NEW_LINE>return outgoing;<NEW_LINE>}
equals + 1).trim();
40,701
public boolean want(Edge e) {<NEW_LINE>String tgtMethod = e.tgt().toString();<NEW_LINE>String tgtClass = e.tgt().getDeclaringClass().toString();<NEW_LINE>String srcMethod = e<MASK><NEW_LINE>String srcClass = e.src().getDeclaringClass().toString();<NEW_LINE>// Remove Deep Library Calls<NEW_LINE>if (tgtClass.startsWith("sun.")) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (tgtClass.startsWith("com.sun.")) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Remove static initializers<NEW_LINE>if (tgtMethod.endsWith("void <clinit>()>")) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Remove calls to equals in the library<NEW_LINE>if ((tgtClass.startsWith("java.") || tgtClass.startsWith("javax.")) && e.tgt().toString().endsWith("boolean equals(java.lang.Object)>")) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Remove anything in java.util<NEW_LINE>// these calls will be treated as a non-transitive RW to the receiving object<NEW_LINE>if (tgtClass.startsWith("java.util") || srcClass.startsWith("java.util")) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Remove anything in java.lang<NEW_LINE>// these calls will be treated as a non-transitive RW to the receiving object<NEW_LINE>if (tgtClass.startsWith("java.lang") || srcClass.startsWith("java.lang")) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (tgtClass.startsWith("java")) {<NEW_LINE>// filter out the rest!<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (e.tgt().isSynchronized()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// I THINK THIS CHUNK IS JUST NOT NEEDED... TODO: REMOVE IT<NEW_LINE>// Remove Calls from within a transaction<NEW_LINE>// one transaction is exempt - so that we may analyze calls within it<NEW_LINE>if (tns != null) {<NEW_LINE>Iterator<CriticalSection> tnIt = tns.iterator();<NEW_LINE>while (tnIt.hasNext()) {<NEW_LINE>CriticalSection tn = tnIt.next();<NEW_LINE>if (// if this method call originates inside a transaction...<NEW_LINE>tn != exemptTn && tn.units.contains(e.srcStmt())) {<NEW_LINE>// ignore it<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
.src().toString();
1,387,069
public Assignment convert(org.eclipse.jdt.internal.compiler.ast.CompoundAssignment expression) {<NEW_LINE>Assignment assignment = new Assignment(this.ast);<NEW_LINE>Expression <MASK><NEW_LINE>assignment.setLeftHandSide(lhs);<NEW_LINE>int start = lhs.getStartPosition();<NEW_LINE>assignment.setSourceRange(start, expression.sourceEnd - start + 1);<NEW_LINE>switch(expression.operator) {<NEW_LINE>case org.eclipse.jdt.internal.compiler.ast.OperatorIds.PLUS:<NEW_LINE>assignment.setOperator(Assignment.Operator.PLUS_ASSIGN);<NEW_LINE>break;<NEW_LINE>case org.eclipse.jdt.internal.compiler.ast.OperatorIds.MINUS:<NEW_LINE>assignment.setOperator(Assignment.Operator.MINUS_ASSIGN);<NEW_LINE>break;<NEW_LINE>case org.eclipse.jdt.internal.compiler.ast.OperatorIds.MULTIPLY:<NEW_LINE>assignment.setOperator(Assignment.Operator.TIMES_ASSIGN);<NEW_LINE>break;<NEW_LINE>case org.eclipse.jdt.internal.compiler.ast.OperatorIds.DIVIDE:<NEW_LINE>assignment.setOperator(Assignment.Operator.DIVIDE_ASSIGN);<NEW_LINE>break;<NEW_LINE>case org.eclipse.jdt.internal.compiler.ast.OperatorIds.AND:<NEW_LINE>assignment.setOperator(Assignment.Operator.BIT_AND_ASSIGN);<NEW_LINE>break;<NEW_LINE>case org.eclipse.jdt.internal.compiler.ast.OperatorIds.OR:<NEW_LINE>assignment.setOperator(Assignment.Operator.BIT_OR_ASSIGN);<NEW_LINE>break;<NEW_LINE>case org.eclipse.jdt.internal.compiler.ast.OperatorIds.XOR:<NEW_LINE>assignment.setOperator(Assignment.Operator.BIT_XOR_ASSIGN);<NEW_LINE>break;<NEW_LINE>case org.eclipse.jdt.internal.compiler.ast.OperatorIds.REMAINDER:<NEW_LINE>assignment.setOperator(Assignment.Operator.REMAINDER_ASSIGN);<NEW_LINE>break;<NEW_LINE>case org.eclipse.jdt.internal.compiler.ast.OperatorIds.LEFT_SHIFT:<NEW_LINE>assignment.setOperator(Assignment.Operator.LEFT_SHIFT_ASSIGN);<NEW_LINE>break;<NEW_LINE>case org.eclipse.jdt.internal.compiler.ast.OperatorIds.RIGHT_SHIFT:<NEW_LINE>assignment.setOperator(Assignment.Operator.RIGHT_SHIFT_SIGNED_ASSIGN);<NEW_LINE>break;<NEW_LINE>case org.eclipse.jdt.internal.compiler.ast.OperatorIds.UNSIGNED_RIGHT_SHIFT:<NEW_LINE>assignment.setOperator(Assignment.Operator.RIGHT_SHIFT_UNSIGNED_ASSIGN);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>assignment.setRightHandSide(convert(expression.expression));<NEW_LINE>if (this.resolveBindings) {<NEW_LINE>recordNodes(assignment, expression);<NEW_LINE>}<NEW_LINE>return assignment;<NEW_LINE>}
lhs = convert(expression.lhs);
208,446
private static int textRunDirectionByContent(String ptext) {<NEW_LINE>if (ptext == null || ptext.length() == 0) {<NEW_LINE>return PdfWriter.RUN_DIRECTION_NO_BIDI;<NEW_LINE>}<NEW_LINE>Bidi bidi = new Bidi();<NEW_LINE>bidi.setPara(ptext, Bidi.LTR, null);<NEW_LINE>byte direction = bidi.getDirection();<NEW_LINE>if (direction == Bidi.LTR) {<NEW_LINE>// This is what OpenPDF uses for LTR<NEW_LINE>// https://github.com/LibrePDF/OpenPDF/blob/1.3.26/openpdf/src/main/java/com/lowagie/text/pdf/TextField.java#L211<NEW_LINE>return PdfWriter.RUN_DIRECTION_NO_BIDI;<NEW_LINE>} else if (direction == Bidi.RTL) {<NEW_LINE>// We can't have RUN_DIRECTION_NO_BIDI for RTL<NEW_LINE>// In RTL texts ending in punctuation this will place the punctuation in the<NEW_LINE>// start of the file.<NEW_LINE>return PdfWriter.RUN_DIRECTION_RTL;<NEW_LINE>}<NEW_LINE>// Bidi.MIXED => Choose LTR/RTL based on which is more prominent<NEW_LINE>int ltrCount = 0;<NEW_LINE>byte[<MASK><NEW_LINE>for (int i = 0; i < levels.length; i++) {<NEW_LINE>if (levels[i] % 2 == 0) {<NEW_LINE>ltrCount++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ltrCount / levels.length >= 0.5) {<NEW_LINE>return PdfWriter.RUN_DIRECTION_LTR;<NEW_LINE>} else {<NEW_LINE>return PdfWriter.RUN_DIRECTION_RTL;<NEW_LINE>}<NEW_LINE>}
] levels = bidi.getLevels();
211,355
private void fillQueue(String filepath, String inputName, InputStream input, ErrorHandler errHandler, boolean closeStream, boolean validate, boolean reallyCreateNoncompliantDeprecated) throws SAXException, IOException {<NEW_LINE>DefaultContentHandlerWrapper contentHandler = new DefaultContentHandlerWrapper(errHandler, reallyCreateNoncompliantDeprecated);<NEW_LINE>try {<NEW_LINE>SAXParserFactory saxParserFactory = XmlUtilities.createSecureSAXParserFactory(false);<NEW_LINE><MASK><NEW_LINE>saxParserFactory.setFeature("http://xml.org/sax/features/validation", validate);<NEW_LINE>SAXParser saxParser = saxParserFactory.newSAXParser();<NEW_LINE>InputSource inputSource = new InputSource(input);<NEW_LINE>// Java needs this path in order to resolve external dtd<NEW_LINE>// documents (to<NEW_LINE>// make them relative to the document being parsed);<NEW_LINE>// otherwise, Java resolves<NEW_LINE>// external documents relative to the current working<NEW_LINE>// directory.<NEW_LINE>inputSource.setSystemId(filepath);<NEW_LINE>saxParser.parse(inputSource, contentHandler);<NEW_LINE>} catch (ParserConfigurationException e) {<NEW_LINE>Msg.error(this, e.getMessage());<NEW_LINE>throw new SAXException(e);<NEW_LINE>} finally {<NEW_LINE>if (closeStream) {<NEW_LINE>try {<NEW_LINE>input.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>// we tried<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
saxParserFactory.setFeature("http://xml.org/sax/features/namespaces", false);
335,138
private List<AddHostMsg> prepareMsgHostName(List<AddKVMHostMsg> msgs) {<NEW_LINE>Map<String, List<AddKVMHostMsg>> nameMsgsMap = new HashMap<>();<NEW_LINE>msgs.forEach(it -> nameMsgsMap.computeIfAbsent(it.getName(), k -> new ArrayList<>()).add(it));<NEW_LINE>List<AddHostMsg> renamed = nameMsgsMap.entrySet().stream().filter(e -> e.getValue().size() > 1 || StringUtils.isEmpty(e.getKey())).flatMap(e -> e.getValue().stream()).peek(msg -> msg.setName((StringUtils.isEmpty(msg.getName()) ? "HOST" : msg.getName()) + "-" + msg.getManagementIp())).<MASK><NEW_LINE>List<AddHostMsg> origins = nameMsgsMap.entrySet().stream().filter(e -> e.getValue().size() == 1 && !StringUtils.isEmpty(e.getKey())).flatMap(e -> e.getValue().stream()).collect(Collectors.toList());<NEW_LINE>renamed.addAll(origins);<NEW_LINE>return renamed;<NEW_LINE>}
collect(Collectors.toList());
1,160,273
public static ExtendedDateTime convertToDateTime(Object val) {<NEW_LINE>requireNonNull(val, "val is null");<NEW_LINE>if (val instanceof DateTime) {<NEW_LINE>return new ExtendedDateTime((DateTime) val);<NEW_LINE>} else if (val instanceof String) {<NEW_LINE>// interpret string as in local timezone<NEW_LINE>try {<NEW_LINE>return new ExtendedDateTime(strToDateTime(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new TypeException(String.format("Error parsing string %s to datetime", val), e);<NEW_LINE>}<NEW_LINE>} else if (val instanceof Long) {<NEW_LINE>return new ExtendedDateTime(new DateTime((long) val));<NEW_LINE>} else if (val instanceof Timestamp) {<NEW_LINE>Timestamp timestamp = (Timestamp) val;<NEW_LINE>DateTime dateTime = DateTime.parse(timestamp.toLocalDateTime().toString());<NEW_LINE>int nanos = timestamp.getNanos();<NEW_LINE>return new ExtendedDateTime(dateTime, (nanos / 1000) % 1000);<NEW_LINE>} else if (val instanceof Date) {<NEW_LINE>return new ExtendedDateTime(strToDateTime(((Date) val).toLocalDate().toString(), localDateFormatter));<NEW_LINE>} else {<NEW_LINE>throw new TypeException("Can not cast Object to LocalDateTime ");<NEW_LINE>}<NEW_LINE>}
(String) val, localDateTimeFormatter));
1,825,950
public CodeGenNode unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CodeGenNode codeGenNode = new CodeGenNode();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><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("Id", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>codeGenNode.setId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NodeType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>codeGenNode.setNodeType(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Args", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>codeGenNode.setArgs(new ListUnmarshaller<CodeGenNodeArg>(CodeGenNodeArgJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("LineNumber", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>codeGenNode.setLineNumber(context.getUnmarshaller(Integer.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 codeGenNode;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,757,624
public T call() throws IOException {<NEW_LINE>URL u = new URL(url);<NEW_LINE>InputStream stream = null;<NEW_LINE>final String protocol = u.getProtocol();<NEW_LINE>if (protocol.equals("http") || protocol.equals("https")) {<NEW_LINE>HttpURLConnection conn = (HttpURLConnection) u.openConnection();<NEW_LINE>conn.setRequestMethod(method);<NEW_LINE>conn.setDoInput(true);<NEW_LINE>for (Map.Entry<String, String> entry : headers.entrySet()) {<NEW_LINE>String key = entry.getKey();<NEW_LINE>String value = entry.getValue();<NEW_LINE>if (value != null && !value.equals(""))<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (outboundContent != null && method.equals("POST")) {<NEW_LINE>conn.setDoOutput(true);<NEW_LINE>byte[] outBytes = outboundContent.getBytes("utf-8");<NEW_LINE>conn.setRequestProperty("Content-Length", String.valueOf(outBytes.length));<NEW_LINE>OutputStream out = conn.getOutputStream();<NEW_LINE>out.write(outBytes);<NEW_LINE>out.close();<NEW_LINE>}<NEW_LINE>conn.connect();<NEW_LINE>fileSize = conn.getContentLength();<NEW_LINE>setProgressMax(fileSize);<NEW_LINE>responseHeaders = conn.getHeaderFields();<NEW_LINE>stream = new ProgressInputStream(conn.getInputStream());<NEW_LINE>} else {<NEW_LINE>// protocol is something other than http...<NEW_LINE>URLConnection con = u.openConnection();<NEW_LINE>setProgressMax(con.getContentLength());<NEW_LINE>stream = new ProgressInputStream(con.getInputStream());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return processStream(stream);<NEW_LINE>} finally {<NEW_LINE>stream.close();<NEW_LINE>}<NEW_LINE>}
conn.setRequestProperty(key, value);
957,064
public Response safeHandle(HttpRequest request) throws JSONException {<NEW_LINE>SelendroidLogger.info("add call log");<NEW_LINE>JSONObject parameters = getPayload(request).getJSONObject("parameters");<NEW_LINE>String callLogJson = parameters.getString("calllogjson");<NEW_LINE>CallLogEntry log = CallLogEntry.fromJson(callLogJson);<NEW_LINE>try {<NEW_LINE>((DefaultSelendroidDriver) getSelendroidDriver(<MASK><NEW_LINE>String response = "Added the number " + log.getNumber() + " with duration of " + log.getDuration() + " to call log.";<NEW_LINE>SelendroidLogger.info("Succesfully added record to call log.");<NEW_LINE>return new SelendroidResponse(getSessionId(request), response);<NEW_LINE>} catch (PermissionDeniedException e) {<NEW_LINE>SelendroidLogger.info("WRITE_CALL_LOG permission must be in a.u.t. to write to call log.");<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}
request)).addCallLog(log);
1,641,805
private Slot tryClaimSlot(TorrentId torrentId, int pieceIndex) {<NEW_LINE>List<Slot> slots = lruSlots.get(torrentId);<NEW_LINE>Iterator<Slot> iter = slots.iterator();<NEW_LINE>Slot slot;<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>slot = iter.next();<NEW_LINE>if (slot.currentUsers == 0) {<NEW_LINE>iter.remove();<NEW_LINE>slot.buffer.clear();<NEW_LINE>slots.add(slot);<NEW_LINE>slotByPieceIndexMap.get(torrentId).put(pieceIndex, slot);<NEW_LINE>if (LOGGER.isTraceEnabled()) {<NEW_LINE>LOGGER.trace("Claimed a free slot {} for requested piece:" + " torrent ID {}, piece index {}", slot.index, torrentId, pieceIndex);<NEW_LINE>}<NEW_LINE>return slot;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (LOGGER.isTraceEnabled()) {<NEW_LINE>LOGGER.trace(<MASK><NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
"Failed to claim a free slot for requested piece:" + " torrent ID {}, piece index {}", torrentId, pieceIndex);
1,028,969
public static void main(String[] args) throws IOException {<NEW_LINE>BufferedReader br = new BufferedReader(new InputStreamReader(System.in));<NEW_LINE>char[] chs = br.readLine().toCharArray();<NEW_LINE>int[] flag = new int[128];<NEW_LINE>for (int i = 0; i < chs.length; i++) {<NEW_LINE>flag[chs[i]]++;<NEW_LINE>}<NEW_LINE>while (flag['P'] > 0 || flag['A'] > 0 || flag['T'] > 0 || flag['e'] > 0 || flag['s'] > 0 || flag['t'] > 0) {<NEW_LINE>if (flag['P']-- > 0) {<NEW_LINE>System.out.print("P");<NEW_LINE>}<NEW_LINE>if (flag['A']-- > 0) {<NEW_LINE>System.out.print("A");<NEW_LINE>}<NEW_LINE>if (flag['T']-- > 0) {<NEW_LINE>System.out.print("T");<NEW_LINE>}<NEW_LINE>if (flag['e']-- > 0) {<NEW_LINE>System.out.print("e");<NEW_LINE>}<NEW_LINE>if (flag['s']-- > 0) {<NEW_LINE>System.out.print("s");<NEW_LINE>}<NEW_LINE>if (flag['t']-- > 0) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
System.out.print("t");
1,029,809
public void addFormForEditAccount() {<NEW_LINE>gridRowFrom = gridRow;<NEW_LINE>addAccountNameTextFieldWithAutoFillToggleButton();<NEW_LINE>addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(australiaPayid.getPaymentMethod().getId()));<NEW_LINE>addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.payid"), australiaPayid.getPayid());<NEW_LINE>TextField field = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), australiaPayid.getBankAccountName()).second;<NEW_LINE>field.setMouseTransparent(false);<NEW_LINE>TradeCurrency singleTradeCurrency = australiaPayid.getSingleTradeCurrency();<NEW_LINE>String nameAndCode = singleTradeCurrency != null <MASK><NEW_LINE>addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);<NEW_LINE>addLimitations(true);<NEW_LINE>}
? singleTradeCurrency.getNameAndCode() : "null";
1,364,883
static ConnectionSpec convertSpec(com.squareup.okhttp.ConnectionSpec spec) {<NEW_LINE>Preconditions.checkArgument(<MASK><NEW_LINE>List<com.squareup.okhttp.TlsVersion> tlsVersionList = spec.tlsVersions();<NEW_LINE>String[] tlsVersions = new String[tlsVersionList.size()];<NEW_LINE>for (int i = 0; i < tlsVersions.length; i++) {<NEW_LINE>tlsVersions[i] = tlsVersionList.get(i).javaName();<NEW_LINE>}<NEW_LINE>List<com.squareup.okhttp.CipherSuite> cipherSuiteList = spec.cipherSuites();<NEW_LINE>CipherSuite[] cipherSuites = new CipherSuite[cipherSuiteList.size()];<NEW_LINE>for (int i = 0; i < cipherSuites.length; i++) {<NEW_LINE>cipherSuites[i] = CipherSuite.valueOf(cipherSuiteList.get(i).name());<NEW_LINE>}<NEW_LINE>return new ConnectionSpec.Builder(spec.isTls()).supportsTlsExtensions(spec.supportsTlsExtensions()).tlsVersions(tlsVersions).cipherSuites(cipherSuites).build();<NEW_LINE>}
spec.isTls(), "plaintext ConnectionSpec is not accepted");
451,885
final DeclineInvitationsResult executeDeclineInvitations(DeclineInvitationsRequest declineInvitationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(declineInvitationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DeclineInvitationsRequest> request = null;<NEW_LINE>Response<DeclineInvitationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeclineInvitationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(declineInvitationsRequest));<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, "SecurityHub");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeclineInvitations");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeclineInvitationsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeclineInvitationsResultJsonUnmarshaller());<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.startEvent(Field.ClientExecuteTime);
1,128,578
public static VmwareContext create(String vCenterAddress, String vCenterUserName, String vCenterPassword) throws Exception {<NEW_LINE>assert (vCenterAddress != null);<NEW_LINE>assert (vCenterUserName != null);<NEW_LINE>assert (vCenterPassword != null);<NEW_LINE>String serviceUrl = "https://" + vCenterAddress + "/sdk/vimService";<NEW_LINE>if (s_logger.isDebugEnabled())<NEW_LINE>s_logger.debug("initialize VmwareContext. url: " + serviceUrl + ", username: " + vCenterUserName + ", password: " + StringUtils.getMaskedPasswordForDisplay(vCenterPassword));<NEW_LINE>VmwareClient vimClient = new VmwareClient(vCenterAddress + "-" + s_seq++);<NEW_LINE>vimClient.setVcenterSessionTimeout(s_vmwareMgr.getVcenterSessionTimeout());<NEW_LINE>vimClient.connect(serviceUrl, vCenterUserName, vCenterPassword);<NEW_LINE>VmwareContext context = new VmwareContext(vimClient, vCenterAddress);<NEW_LINE>context.registerStockObject(VmwareManager.CONTEXT_STOCK_NAME, s_vmwareMgr);<NEW_LINE>context.registerStockObject(<MASK><NEW_LINE>context.registerStockObject("manageportgroup", s_vmwareMgr.getManagementPortGroupName());<NEW_LINE>context.registerStockObject("noderuninfo", String.format("%d-%d", s_clusterMgr.getManagementNodeId(), s_clusterMgr.getCurrentRunId()));<NEW_LINE>context.setPoolInfo(s_pool, VmwareContextPool.composePoolKey(vCenterAddress, vCenterUserName));<NEW_LINE>return context;<NEW_LINE>}
"serviceconsole", s_vmwareMgr.getServiceConsolePortGroupName());
1,486,918
private String[] filter(String[] mimeTypes) {<NEW_LINE>if (mimeTypes.length > 0) {<NEW_LINE>String[] filtered = mimeTypes;<NEW_LINE>if (mimeTypes[0].contains(TEXT_BASE_MIME_TYPE)) {<NEW_LINE>if (mimeTypes.length == 1) {<NEW_LINE>filtered = EMPTY;<NEW_LINE>} else {<NEW_LINE>filtered = new <MASK><NEW_LINE>System.arraycopy(mimeTypes, 1, filtered, 0, mimeTypes.length - 1);<NEW_LINE>}<NEW_LINE>if (LOG.isLoggable(Level.INFO)) {<NEW_LINE>// , new Throwable("Stacktrace") //NOI18N<NEW_LINE>LOG.log(Level.INFO, TEXT_BASE_MIME_TYPE + " has been deprecated, use MimePath.EMPTY instead.");<NEW_LINE>}<NEW_LINE>} else if (mimeTypes[0].startsWith("test")) {<NEW_LINE>filtered = new String[mimeTypes.length];<NEW_LINE>System.arraycopy(mimeTypes, 0, filtered, 0, mimeTypes.length);<NEW_LINE>// NOI18N<NEW_LINE>filtered[0] = mimeTypes[0].substring(mimeTypes[0].indexOf('_') + 1);<NEW_LINE>LOG.log(Level.INFO, "Don't use 'test' mime type to access settings through the editor/settings/storage API!", new Throwable("Stacktrace"));<NEW_LINE>}<NEW_LINE>return filtered;<NEW_LINE>} else {<NEW_LINE>return mimeTypes;<NEW_LINE>}<NEW_LINE>}
String[mimeTypes.length - 1];
983,150
public void call(final Stream stream, final AlertCondition.CheckResult result) throws AlarmCallbackException {<NEW_LINE>final Map<String, Object> event = Maps.newHashMap();<NEW_LINE>event.put("stream", stream);<NEW_LINE>event.put("check_result", result);<NEW_LINE>final byte[] body;<NEW_LINE>try {<NEW_LINE>body = objectMapper.writeValueAsBytes(event);<NEW_LINE>} catch (JsonProcessingException e) {<NEW_LINE>throw new AlarmCallbackException("Unable to serialize alarm", e);<NEW_LINE>}<NEW_LINE>final String url = configuration.getString(CK_URL);<NEW_LINE>final HttpUrl httpUrl = HttpUrl.parse(url);<NEW_LINE>if (httpUrl == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (!whitelistService.isWhitelisted(url)) {<NEW_LINE>throw new AlarmCallbackException("URL <" + url + "> is not whitelisted.");<NEW_LINE>}<NEW_LINE>final Request request = new Request.Builder().url(httpUrl).post(RequestBody.create(CONTENT_TYPE, body)).build();<NEW_LINE>try (final Response r = httpClient.newCall(request).execute()) {<NEW_LINE>if (!r.isSuccessful()) {<NEW_LINE>throw new AlarmCallbackException("Expected successful HTTP response [2xx] but got [" + r.code() + "].");<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new AlarmCallbackException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
throw new AlarmCallbackException("Malformed URL: " + url);
707,524
private void updateComponents() {<NEW_LINE>if (newRadio != null) {<NEW_LINE>boolean createNew = newRadio.isSelected();<NEW_LINE>nameLabel.setEnabled(createNew);<NEW_LINE>nameField.setEnabled(createNew);<NEW_LINE>descriptionLabel.setEnabled(createNew);<NEW_LINE>descriptionArea.setEnabled(createNew);<NEW_LINE>existingLabel.setEnabled(!createNew);<NEW_LINE>if (createNew && existingList.isEnabled()) {<NEW_LINE>lastSelectedValue = existingList.getSelectedValue();<NEW_LINE>existingList.setEnabled(false);<NEW_LINE>existingList.clearSelection();<NEW_LINE>} else if (!createNew && !existingList.isEnabled()) {<NEW_LINE>existingList.setEnabled(true);<NEW_LINE>if (lastSelectedValue == null)<NEW_LINE>lastSelectedValue = existingList.<MASK><NEW_LINE>existingList.setSelectedValue(lastSelectedValue, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (existingRadio != null && existingRadio.isSelected()) {<NEW_LINE>submitComponent.setEnabled(existingList.getSelectedValue() != null);<NEW_LINE>} else {<NEW_LINE>submitComponent.setEnabled(nameField.getText().trim().length() > 0);<NEW_LINE>}<NEW_LINE>}
getModel().getElementAt(0);
1,573,277
public void deleteProjects(DeleteProjects request, StreamObserver<DeleteProjects.Response> responseObserver) {<NEW_LINE>try {<NEW_LINE>final var response = futureProjectDAO.deleteProjects(request.getIdsList()).thenCompose(allowedProjectResources -> {<NEW_LINE>List<InternalFuture<Void>> eventFuture = new ArrayList<>();<NEW_LINE>// Add succeeded event in local DB<NEW_LINE>for (var projectResource : allowedProjectResources) {<NEW_LINE>eventFuture.add(addEvent(projectResource.getResourceId(), projectResource.getWorkspaceId(), DELETE_PROJECT_EVENT_TYPE, Optional.empty(), Collections.emptyMap(), "project deleted successfully"));<NEW_LINE>}<NEW_LINE>return InternalFuture.sequence(eventFuture, executor);<NEW_LINE>}, executor).thenApply(project -> DeleteProjects.Response.newBuilder().setStatus(true<MASK><NEW_LINE>FutureGrpc.ServerResponse(responseObserver, response, executor);<NEW_LINE>} catch (Exception e) {<NEW_LINE>CommonUtils.observeError(responseObserver, e);<NEW_LINE>}<NEW_LINE>}
).build(), executor);
750,392
public ListEndpointsByPlatformApplicationResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>ListEndpointsByPlatformApplicationResult listEndpointsByPlatformApplicationResult = new ListEndpointsByPlatformApplicationResult();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 2;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return listEndpointsByPlatformApplicationResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("Endpoints", targetDepth)) {<NEW_LINE>listEndpointsByPlatformApplicationResult.withEndpoints(new ArrayList<Endpoint>());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Endpoints/member", targetDepth)) {<NEW_LINE>listEndpointsByPlatformApplicationResult.withEndpoints(EndpointStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>listEndpointsByPlatformApplicationResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return listEndpointsByPlatformApplicationResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,737,415
private static IRubyObject convertCoverageToRuby(ThreadContext context, Ruby runtime, Map<String, IntList> coverage, int mode) {<NEW_LINE>// populate a Ruby Hash with coverage data<NEW_LINE>RubyHash covHash = RubyHash.newHash(runtime);<NEW_LINE>for (Map.Entry<String, IntList> entry : coverage.entrySet()) {<NEW_LINE>// ignore our hidden marker<NEW_LINE>if (entry.getKey().equals(CoverageData.STARTED))<NEW_LINE>continue;<NEW_LINE>final IntList val = entry.getValue();<NEW_LINE>boolean oneshot = (mode & CoverageData.ONESHOT_LINES) != 0;<NEW_LINE>RubyArray ary = RubyArray.newArray(runtime, val.size());<NEW_LINE>for (int i = 0; i < val.size(); i++) {<NEW_LINE>int integer = val.get(i);<NEW_LINE>if (oneshot) {<NEW_LINE>ary.push(runtime<MASK><NEW_LINE>} else {<NEW_LINE>ary.store(i, integer == -1 ? context.nil : runtime.newFixnum(integer));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>RubyString key = RubyString.newString(runtime, entry.getKey());<NEW_LINE>IRubyObject value = ary;<NEW_LINE>if (oneshot) {<NEW_LINE>RubyHash oneshotHash = RubyHash.newSmallHash(runtime);<NEW_LINE>oneshotHash.fastASetSmall(runtime.newSymbol("oneshot_lines"), ary);<NEW_LINE>value = oneshotHash;<NEW_LINE>}<NEW_LINE>covHash.fastASetCheckString(runtime, key, value);<NEW_LINE>}<NEW_LINE>return covHash;<NEW_LINE>}
.newFixnum(integer + 1));
797,003
private BigDecimal computeSpreadableQtyOverLogisticalFormLines(StockMoveLine stockMoveLine, List<LogisticalFormLine> logisticalFormLineList) {<NEW_LINE>if (stockMoveLine == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (stockMoveLine.getProduct() == null || !ProductRepository.PRODUCT_TYPE_STORABLE.equals(stockMoveLine.getProduct().getProductTypeSelect())) {<NEW_LINE>return BigDecimal.ZERO;<NEW_LINE>}<NEW_LINE>if (logisticalFormLineList == null) {<NEW_LINE>return stockMoveLine.getRealQty();<NEW_LINE>}<NEW_LINE>BigDecimal qtySpreadOverLogisticalMoveLines = logisticalFormLineList.stream().map(logisticalFormLine -> logisticalFormLine.getQty() != null ? logisticalFormLine.getQty() : BigDecimal.ZERO).reduce(<MASK><NEW_LINE>return stockMoveLine.getRealQty().subtract(qtySpreadOverLogisticalMoveLines);<NEW_LINE>}
BigDecimal.ZERO, BigDecimal::add);
1,454,503
private void start() throws Exception {<NEW_LINE>out("start");<NEW_LINE>SystemConfigsEntity entity = SystemConfigsDao.get().selectOnKey(SystemConfig.RE_INDEXING, AppConfig.<MASK><NEW_LINE>if (entity != null) {<NEW_LINE>String[] values = entity.getConfigValue().split(",");<NEW_LINE>Long start = Long.valueOf(values[0].substring("start=".length()));<NEW_LINE>Long end = Long.valueOf(values[1].substring("end=".length()));<NEW_LINE>out("search knowledge:" + start + "-" + end);<NEW_LINE>KnowledgesDao knowledgesDao = KnowledgesDao.get();<NEW_LINE>List<KnowledgesEntity> knowledgesEntities = knowledgesDao.selectBetween(start, end);<NEW_LINE>for (KnowledgesEntity knowledgesEntity : knowledgesEntities) {<NEW_LINE>out("indexing knowledge: " + knowledgesEntity.getKnowledgeId());<NEW_LINE>KnowledgeLogic.get().reindexing(knowledgesEntity);<NEW_LINE>}<NEW_LINE>SystemConfigsDao.get().physicalDelete(entity);<NEW_LINE>}<NEW_LINE>out("finish");<NEW_LINE>}
get().getSystemName());
924,902
protected void Init() {<NEW_LINE>JPanel mainPanel = new JPanel(new GridBagLayout());<NEW_LINE>mainPanel.add(UISupport.buildDescription(NEW_VERSION_AVAILABLE_MESSAGE, NEW_VERSION_AVAILABLE_MESSAGE_EX, null), new GridBagConstraints(0, 0, 2, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));<NEW_LINE>mainPanel.add(new JLabel("Current version:"), new GridBagConstraints(0, 1, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(4, 4, 4, 4), 0, 0));<NEW_LINE>mainPanel.add(new JLabel(curVersion.toString()), new GridBagConstraints(1, 1, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(4, 4, 4, 4), 0, 0));<NEW_LINE>mainPanel.add(new JLabel("New version:"), new GridBagConstraints(0, 2, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(4, 4, 4, 4), 0, 0));<NEW_LINE>mainPanel.add(new JLabel(newProductVersion.toString()), new GridBagConstraints(1, 2, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(4, 4, 4, 4), 0, 0));<NEW_LINE>JEditorPane releaseNotesPane = createReleaseNotesPane();<NEW_LINE>JScrollPane scb = new JScrollPane(releaseNotesPane);<NEW_LINE>scb.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.black), "Release notes"));<NEW_LINE>mainPanel.add(scb, new GridBagConstraints(0, 3, 2, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(4, 4, 4, 4), 0, 0));<NEW_LINE>JPanel toolbar = buildToolbar(this);<NEW_LINE>mainPanel.add(toolbar, new GridBagConstraints(0, 4, 2, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(4, 4, 4, 4), 0, 0));<NEW_LINE>setTitle("New Version Check");<NEW_LINE>setIconImage((UISupport.createImageIcon("/SoapUI-OS_16-16.png")).getImage());<NEW_LINE>getContentPane().add(mainPanel);<NEW_LINE>setSize(new Dimension(550, 440));<NEW_LINE>setLocation((Toolkit.getDefaultToolkit().getScreenSize().width) / 2 - getWidth() / 2, (Toolkit.getDefaultToolkit().getScreenSize().height) / <MASK><NEW_LINE>}
2 - getHeight() / 2);
912,319
public Map<String, ContainerRegistryConfiguration> convert(String dockerconfigjson) {<NEW_LINE>if (StringUtils.hasText(dockerconfigjson)) {<NEW_LINE>try {<NEW_LINE>Map authsMap = (Map) new ObjectMapper().readValue(dockerconfigjson, Map.class).get("auths");<NEW_LINE>Map<String, ContainerRegistryConfiguration> registryConfigurationMap = new HashMap<>();<NEW_LINE>for (Object registryUrl : authsMap.keySet()) {<NEW_LINE>ContainerRegistryConfiguration rc = new ContainerRegistryConfiguration();<NEW_LINE>rc.setRegistryHost(replaceDefaultDockerRegistryServerUrl(registryUrl.toString()));<NEW_LINE>Map registryMap = (Map) authsMap.get(registryUrl.toString());<NEW_LINE>rc.setUser((String) registryMap.get("username"));<NEW_LINE>rc.setSecret((String) registryMap.get("password"));<NEW_LINE>Optional<String> tokenAccessUrl = getDockerTokenServiceUri(rc.getRegistryHost(), true, this.httpProxyPerHost.getOrDefault(rc.getRegistryHost(), false));<NEW_LINE>if (tokenAccessUrl.isPresent()) {<NEW_LINE>rc.setAuthorizationType(ContainerRegistryConfiguration.AuthorizationType.dockeroauth2);<NEW_LINE>rc.getExtra().put(DockerOAuth2RegistryAuthorizer.DOCKER_REGISTRY_AUTH_URI_KEY, tokenAccessUrl.get());<NEW_LINE>} else {<NEW_LINE>if (StringUtils.isEmpty(rc.getUser()) && StringUtils.isEmpty(rc.getSecret())) {<NEW_LINE>rc.<MASK><NEW_LINE>} else {<NEW_LINE>rc.setAuthorizationType(ContainerRegistryConfiguration.AuthorizationType.basicauth);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.info("Registry Configuration: " + rc.toString());<NEW_LINE>registryConfigurationMap.put(rc.getRegistryHost(), rc);<NEW_LINE>}<NEW_LINE>return registryConfigurationMap;<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Failed to parse the Secrets in dockerconfigjson");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Collections.emptyMap();<NEW_LINE>}
setAuthorizationType(ContainerRegistryConfiguration.AuthorizationType.anonymous);
1,565,942
public static void saveExistingErrors(final File markFile, final AtomicBuffer errorBuffer, final PrintStream logger, final String errorFilePrefix) {<NEW_LINE>try {<NEW_LINE>final ByteArrayOutputStream baos = new ByteArrayOutputStream();<NEW_LINE>final int observations = printErrorLog(errorBuffer, new PrintStream<MASK><NEW_LINE>if (observations > 0) {<NEW_LINE>final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss-SSSZ");<NEW_LINE>final File errorLogFile = new File(markFile.getParentFile(), errorFilePrefix + '-' + dateFormat.format(new Date()) + "-error.log");<NEW_LINE>if (null != logger) {<NEW_LINE>logger.println("WARNING: existing errors saved to: " + errorLogFile);<NEW_LINE>}<NEW_LINE>try (FileOutputStream out = new FileOutputStream(errorLogFile)) {<NEW_LINE>baos.writeTo(out);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (final Exception ex) {<NEW_LINE>LangUtil.rethrowUnchecked(ex);<NEW_LINE>}<NEW_LINE>}
(baos, false, "US-ASCII"));
442,414
public void mergeType(TransactionType old, TransactionType other) {<NEW_LINE>long totalCountSum = old.getTotalCount() + other.getTotalCount();<NEW_LINE>if (totalCountSum > 0) {<NEW_LINE>double line50Values = old.getLine50Value() * old.getTotalCount() + other.getLine50Value() * other.getTotalCount();<NEW_LINE>double line90Values = old.getLine90Value() * old.getTotalCount() + other.getLine90Value() * other.getTotalCount();<NEW_LINE>double line95Values = old.getLine95Value() * old.getTotalCount() + other.getLine95Value() * other.getTotalCount();<NEW_LINE>double line99Values = old.getLine99Value() * old.getTotalCount() + other.getLine99Value() * other.getTotalCount();<NEW_LINE>double line999Values = old.getLine999Value() * old.getTotalCount() + other.getLine999Value() * other.getTotalCount();<NEW_LINE>double line9999Values = old.getLine9999Value() * old.getTotalCount() + other.getLine9999Value() * other.getTotalCount();<NEW_LINE>old.setLine50Value(line50Values / totalCountSum);<NEW_LINE>old.setLine90Value(line90Values / totalCountSum);<NEW_LINE>old.setLine95Value(line95Values / totalCountSum);<NEW_LINE>old.setLine99Value(line99Values / totalCountSum);<NEW_LINE>old.setLine999Value(line999Values / totalCountSum);<NEW_LINE>old.setLine9999Value(line9999Values / totalCountSum);<NEW_LINE>}<NEW_LINE>old.setTotalCount(totalCountSum);<NEW_LINE>old.setFailCount(old.getFailCount(<MASK><NEW_LINE>old.setTps(old.getTps() + other.getTps());<NEW_LINE>if (other.getMin() < old.getMin()) {<NEW_LINE>old.setMin(other.getMin());<NEW_LINE>}<NEW_LINE>if (other.getMax() > old.getMax()) {<NEW_LINE>old.setMax(other.getMax());<NEW_LINE>old.setLongestMessageUrl(other.getLongestMessageUrl());<NEW_LINE>}<NEW_LINE>old.setSum(old.getSum() + other.getSum());<NEW_LINE>old.setSum2(old.getSum2() + other.getSum2());<NEW_LINE>if (old.getTotalCount() > 0) {<NEW_LINE>old.setFailPercent(old.getFailCount() * 100.0 / old.getTotalCount());<NEW_LINE>old.setAvg(old.getSum() / old.getTotalCount());<NEW_LINE>old.setStd(std(old.getTotalCount(), old.getAvg(), old.getSum2(), old.getMax()));<NEW_LINE>}<NEW_LINE>if (old.getSuccessMessageUrl() == null) {<NEW_LINE>old.setSuccessMessageUrl(other.getSuccessMessageUrl());<NEW_LINE>}<NEW_LINE>if (old.getFailMessageUrl() == null) {<NEW_LINE>old.setFailMessageUrl(other.getFailMessageUrl());<NEW_LINE>}<NEW_LINE>}
) + other.getFailCount());
1,137,971
public static Ticker adaptTickerMessage(Instrument instrument, ArrayNode arrayNode) {<NEW_LINE>return Streams.stream(arrayNode.elements()).filter(JsonNode::isObject).map(tickerNode -> {<NEW_LINE>Iterator<JsonNode> askIterator = tickerNode.get("a").iterator();<NEW_LINE>Iterator<JsonNode> bidIterator = tickerNode.get("b").iterator();<NEW_LINE>Iterator<JsonNode> closeIterator = tickerNode.get("c").iterator();<NEW_LINE>Iterator<JsonNode> volumeIterator = tickerNode.get("v").iterator();<NEW_LINE>Iterator<JsonNode> vwapIterator = tickerNode.get("p").iterator();<NEW_LINE>Iterator<JsonNode> lowPriceIterator = tickerNode.get("l").iterator();<NEW_LINE>Iterator<JsonNode> highPriceIterator = tickerNode.get("h").iterator();<NEW_LINE>Iterator<JsonNode> openPriceIterator = tickerNode.get("o").iterator();<NEW_LINE>// Move iterators forward here required, this ignores the first field if the desired<NEW_LINE>// value is in the second element.<NEW_LINE>vwapIterator.next();<NEW_LINE>volumeIterator.next();<NEW_LINE>return new Ticker.Builder().open(nextNodeAsDecimal(openPriceIterator)).ask(nextNodeAsDecimal(askIterator)).bid(nextNodeAsDecimal(bidIterator)).last(nextNodeAsDecimal(closeIterator)).high(nextNodeAsDecimal(highPriceIterator)).low(nextNodeAsDecimal(lowPriceIterator)).vwap(nextNodeAsDecimal(vwapIterator)).volume(nextNodeAsDecimal(volumeIterator)).instrument(instrument).build();<NEW_LINE>}).<MASK><NEW_LINE>}
findFirst().orElse(null);
278,112
public void updateCurrentCost(MCostDetail m_costdetail) {<NEW_LINE>MCostQueue[] cQueue = MCostQueue.getQueue(dimension, m_costdetail.getDateAcct(), m_costdetail.get_TrxName());<NEW_LINE>// TODO: need evaluate this!<NEW_LINE>if (cQueue != null) {<NEW_LINE>MCostType ct = (MCostType) dimension.getM_CostType();<NEW_LINE>if (cQueue.length > 0 && ct.isFifo())<NEW_LINE>dimension.setCurrentCostPrice(cQueue[0].getCurrentCostPrice());<NEW_LINE>else if (cQueue.length > 0 && MCostElement.COSTELEMENTTYPE_LandedCost.equals(dimension.getM_CostElement().getCostElementType()))<NEW_LINE>dimension.setCurrentCostPrice(cQueue[0].getCurrentCostPrice());<NEW_LINE>}<NEW_LINE>dimension.setCurrentQty(dimension.getCurrentQty().add(m_costdetail.getQty()));<NEW_LINE>if (cQueue != null && cQueue.length > 0) {<NEW_LINE>BigDecimal cAmt = cQueue[0].getCurrentCostPrice().multiply(m_costdetail.getQty());<NEW_LINE>dimension.setCumulatedAmt(dimension.getCumulatedAmt<MASK><NEW_LINE>dimension.setCumulatedQty(dimension.getCumulatedQty().add(m_costdetail.getQty()));<NEW_LINE>}<NEW_LINE>log.finer("QtyAdjust - FiFo/Lifo - " + dimension);<NEW_LINE>dimension.saveEx();<NEW_LINE>}
().add(cAmt));
353,518
public InsightHealth unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>InsightHealth insightHealth = new InsightHealth();<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("OpenProactiveInsights", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>insightHealth.setOpenProactiveInsights(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("OpenReactiveInsights", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>insightHealth.setOpenReactiveInsights(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("MeanTimeToRecoverInMilliseconds", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>insightHealth.setMeanTimeToRecoverInMilliseconds(context.getUnmarshaller(Long.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 insightHealth;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
1,016,164
public CurrencyAmount presentValue(CmsPeriod cmsPeriod, RatesProvider provider) {<NEW_LINE>Currency ccy = cmsPeriod.getCurrency();<NEW_LINE>LocalDate valuationDate = provider.getValuationDate();<NEW_LINE>if (valuationDate.isAfter(cmsPeriod.getPaymentDate())) {<NEW_LINE>return CurrencyAmount.zero(ccy);<NEW_LINE>}<NEW_LINE>LocalDate fixingDate = cmsPeriod.getFixingDate();<NEW_LINE>double dfPayment = provider.discountFactor(ccy, cmsPeriod.getPaymentDate());<NEW_LINE>if (!fixingDate.isAfter(valuationDate)) {<NEW_LINE>// Using fixing<NEW_LINE>OptionalDouble fixedRate = provider.timeSeries(cmsPeriod.getIndex()).get(fixingDate);<NEW_LINE>if (fixedRate.isPresent()) {<NEW_LINE>double payoff = 0d;<NEW_LINE>switch(cmsPeriod.getCmsPeriodType()) {<NEW_LINE>case CAPLET:<NEW_LINE>payoff = Math.max(fixedRate.getAsDouble() - <MASK><NEW_LINE>break;<NEW_LINE>case FLOORLET:<NEW_LINE>payoff = Math.max(cmsPeriod.getStrike() - fixedRate.getAsDouble(), 0d);<NEW_LINE>break;<NEW_LINE>case COUPON:<NEW_LINE>payoff = fixedRate.getAsDouble();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("unsupported CMS type");<NEW_LINE>}<NEW_LINE>return CurrencyAmount.of(ccy, payoff * dfPayment * cmsPeriod.getNotional() * cmsPeriod.getYearFraction());<NEW_LINE>} else if (fixingDate.isBefore(valuationDate)) {<NEW_LINE>throw new IllegalArgumentException(Messages.format("Unable to get fixing for {} on date {}, no time-series supplied", cmsPeriod.getIndex(), fixingDate));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!cmsPeriod.getCmsPeriodType().equals(CmsPeriodType.COUPON)) {<NEW_LINE>throw new IllegalArgumentException("Unable to price cap or floor in this pricer");<NEW_LINE>}<NEW_LINE>// Using forward<NEW_LINE>ResolvedSwap swap = cmsPeriod.getUnderlyingSwap();<NEW_LINE>double forward = swapPricer.parRate(swap, provider);<NEW_LINE>return CurrencyAmount.of(ccy, forward * dfPayment * cmsPeriod.getNotional() * cmsPeriod.getYearFraction());<NEW_LINE>}
cmsPeriod.getStrike(), 0d);
658,169
public void init(FilterConfig config) throws ServletException {<NEW_LINE>String associatePeriod = config.getInitParameter("associatePeriod");<NEW_LINE>if (associatePeriod != null)<NEW_LINE>_associatePeriod = Long.parseLong(associatePeriod);<NEW_LINE>String maxAssociations = config.getInitParameter("maxAssociations");<NEW_LINE>if (maxAssociations != null)<NEW_LINE>_maxAssociations = Integer.parseInt(maxAssociations);<NEW_LINE>String hosts = config.getInitParameter("hosts");<NEW_LINE>if (hosts != null)<NEW_LINE>Collections.addAll(_hosts, StringUtil.csvSplit(hosts));<NEW_LINE>String ports = config.getInitParameter("ports");<NEW_LINE>if (ports != null)<NEW_LINE>for (String p : StringUtil.csvSplit(ports)) {<NEW_LINE>_ports.add(Integer.parseInt(p));<NEW_LINE>}<NEW_LINE>_useQueryInKey = Boolean.parseBoolean<MASK><NEW_LINE>// Expose for JMX.<NEW_LINE>config.getServletContext().setAttribute(config.getFilterName(), this);<NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug("period={} max={} hosts={} ports={}", _associatePeriod, _maxAssociations, _hosts, _ports);<NEW_LINE>}
(config.getInitParameter("useQueryInKey"));
1,134,155
protected void onBindView(View view) {<NEW_LINE>super.onBindView(view);<NEW_LINE>ImageView img_root = view.findViewById(R.id.img_root);<NEW_LINE>if (skill instanceof OperationSkill) {<NEW_LINE>PrivilegeUsage privilege = ((<MASK><NEW_LINE>if (privilege == PrivilegeUsage.root_only || privilege == PrivilegeUsage.prefer_root) {<NEW_LINE>img_root.setVisibility(View.VISIBLE);<NEW_LINE>} else {<NEW_LINE>img_root.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>recSetEnabled(view.findViewById(android.R.id.widget_frame), !in_use);<NEW_LINE>btnPermission = view.findViewById(R.id.btn_permission);<NEW_LINE>boolean requiresPermission = redrawPermissionButton();<NEW_LINE>if (requiresPermission) {<NEW_LINE>btnPermission.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>redrawPermissionButton();<NEW_LINE>skill.requestPermissions((Activity) getContext(), REQCODE);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
OperationSkill) skill).privilege();
184,451
public void onCreate(Bundle savedInstanceState) {<NEW_LINE>SharedPreferences themePrefs = getSharedPreferences("THEME", 0);<NEW_LINE>Boolean isDark = themePrefs.getBoolean("isDark", false);<NEW_LINE>if (isDark)<NEW_LINE>setTheme(R.style.DarkTheme);<NEW_LINE>else<NEW_LINE>setTheme(R.style.AppTheme);<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>UIThread = this;<NEW_LINE>if (System.getMsfRpc() == null) {<NEW_LINE>new FinishDialog(getString(R.string.error), "MSF RPC not connected", Sessions.this).show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mResults = System.getCurrentTarget().getSessions();<NEW_LINE>mListView = (ListView) findViewById(<MASK><NEW_LINE>mAdapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, mResults);<NEW_LINE>mListView.setAdapter(mAdapter);<NEW_LINE>mListView.setOnItemClickListener(clickListener);<NEW_LINE>mListView.setOnItemLongClickListener(longClickListener);<NEW_LINE>new Thread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>System.getMsfRpc().updateSessions();<NEW_LINE>runOnUiThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>if (mResults.isEmpty()) {<NEW_LINE>new FinishDialog(getString(R.string.warning), getString(R.string.no_opened_sessions), Sessions.this).show();<NEW_LINE>} else {<NEW_LINE>mAdapter.notifyDataSetChanged();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}).start();<NEW_LINE>}
android.R.id.list);