idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,678,810 | private void validateConditions() {<NEW_LINE>this.nodeMap.forEach((name, node) -> {<NEW_LINE>final String condition = node.getCondition();<NEW_LINE>boolean foundConditionOnJobStatus = false;<NEW_LINE>if (condition == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// First, remove all the whitespaces and parenthesis ().<NEW_LINE>final String replacedCondition = condition.replaceAll("\\s+|\\(|\\)", "");<NEW_LINE>// Second, split the condition by operators &&, ||, ==, !=, >, >=, <, <=<NEW_LINE>final String[] operands = replacedCondition.split(DirectoryYamlFlowLoader.VALID_CONDITION_OPERATORS);<NEW_LINE>// Third, check whether all the operands are valid: only conditionOnJobStatus macros, numbers,<NEW_LINE>// strings, and variable substitution ${jobName:param} are allowed.<NEW_LINE>for (int i = 0; i < operands.length; i++) {<NEW_LINE>final Matcher matcher = DirectoryYamlFlowLoader.CONDITION_ON_JOB_STATUS_PATTERN.matcher(operands[i]);<NEW_LINE>if (matcher.matches()) {<NEW_LINE>this.logger.info("Operand " <MASK><NEW_LINE>if (foundConditionOnJobStatus) {<NEW_LINE>this.errors.add("Invalid condition for " + node.getId() + ": cannot combine more than one conditionOnJobStatus macros.");<NEW_LINE>}<NEW_LINE>foundConditionOnJobStatus = true;<NEW_LINE>node.setConditionOnJobStatus(ConditionOnJobStatus.fromString(matcher.group(1)));<NEW_LINE>} else {<NEW_LINE>if (operands[i].startsWith("!")) {<NEW_LINE>// Remove the operator '!' from the operand.<NEW_LINE>operands[i] = operands[i].substring(1);<NEW_LINE>}<NEW_LINE>if (operands[i].equals("")) {<NEW_LINE>this.errors.add("Invalid condition fo" + " " + node.getId() + ": operand is an empty string.");<NEW_LINE>} else if (!DirectoryYamlFlowLoader.DIGIT_STRING_PATTERN.matcher(operands[i]).matches()) {<NEW_LINE>validateVariableSubstitution(operands[i], name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | + operands[i] + " is a condition on job status."); |
128,630 | 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.REQUIRED);<NEW_LINE>error = validator.validate(values.get("tagId"), convLabelName("Tag 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("tagId"), convLabelName("Tag 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("insertUser"), convLabelName("Insert User"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = <MASK><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); |
734,513 | public void call(FullAccessIntArrPointer dst, int stride, ReadOnlyIntArrPointer above, ReadOnlyIntArrPointer left) {<NEW_LINE>PositionableIntArrPointer pLeft = PositionableIntArrPointer.makePositionable(left);<NEW_LINE>PositionableIntArrPointer <MASK><NEW_LINE>final short I = pLeft.getAndInc();<NEW_LINE>final short J = pLeft.getAndInc();<NEW_LINE>final short K = pLeft.getAndInc();<NEW_LINE>final short L = pLeft.getAndInc();<NEW_LINE>final short X = pAbove.getRel(-1);<NEW_LINE>final short A = pAbove.getAndInc();<NEW_LINE>final short B = pAbove.getAndInc();<NEW_LINE>final short C = pAbove.getAndInc();<NEW_LINE>dst.set(dst.setRel(2 + stride, avg2(I, X)));<NEW_LINE>dst.setRel(stride, dst.setRel(2 + 2 * stride, avg2(J, I)));<NEW_LINE>dst.setRel(2 * stride, dst.setRel(2 + 3 * stride, avg2(K, J)));<NEW_LINE>dst.setRel(3 * stride, avg2(L, K));<NEW_LINE>dst.setRel(3, avg3(A, B, C));<NEW_LINE>dst.setRel(2, avg3(X, A, B));<NEW_LINE>dst.setRel(1, dst.setRel(3 + stride, avg3(I, X, A)));<NEW_LINE>dst.setRel(1 + stride, dst.setRel(3 + 2 * stride, avg3(J, I, X)));<NEW_LINE>dst.setRel(1 + 2 * stride, dst.setRel(3 + 3 * stride, avg3(K, J, I)));<NEW_LINE>dst.setRel(1 + 3 * stride, avg3(L, K, J));<NEW_LINE>} | pAbove = PositionableIntArrPointer.makePositionable(above); |
1,234,650 | private T collectReduceUnordered(Function<Batch<T>, T> map, Function2<T, T, T> function2) {<NEW_LINE>LazyIterable<? extends Batch<T>> chunks = this.split();<NEW_LINE>MutableList<Callable<T>> callables = chunks.collect((Function<Batch<T>, Callable<T>>) chunk -> () -> map.valueOf(chunk)).toList();<NEW_LINE>ExecutorCompletionService<T> completionService = new ExecutorCompletionService<>(this.getExecutorService());<NEW_LINE>callables.each(completionService::submit);<NEW_LINE>try {<NEW_LINE>T result = completionService.take().get();<NEW_LINE>int numTasks = callables.size() - 1;<NEW_LINE>while (numTasks > 0) {<NEW_LINE>T next = completionService.take().get();<NEW_LINE>if (next != null) {<NEW_LINE>if (result == null) {<NEW_LINE>result = next;<NEW_LINE>} else {<NEW_LINE>result = function2.value(result, next);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>numTasks--;<NEW_LINE>}<NEW_LINE>if (result == null) {<NEW_LINE>throw new NoSuchElementException();<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>if (e.getCause() instanceof NullPointerException) {<NEW_LINE>throw <MASK><NEW_LINE>}<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} | (NullPointerException) e.getCause(); |
972,013 | public static CodegenExpression codegenStartEnd(DTLocalLongOpsIntervalForge forge, CodegenExpressionRef start, CodegenExpressionRef end, CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) {<NEW_LINE>CodegenExpression timeZoneField = codegenClassScope.addOrGetFieldSharable(RuntimeSettingsTimeZoneField.INSTANCE);<NEW_LINE>CodegenMethod methodNode = codegenMethodScope.makeChild(EPTypePremade.BOOLEANBOXED.getEPType(), DTLocalLongOpsIntervalEval.class, codegenClassScope).addParam(EPTypePremade.LONGPRIMITIVE.getEPType(), "startLong").addParam(EPTypePremade.LONGPRIMITIVE.getEPType(), "endLong");<NEW_LINE>CodegenBlock block = methodNode.getBlock().declareVar(EPTypePremade.CALENDAR.getEPType(), "cal", staticMethod(Calendar.class, "getInstance", timeZoneField)).declareVar(EPTypePremade.LONGPRIMITIVE.getEPType(), "startRemainder", forge.timeAbacus.calendarSetCodegen(ref("startLong"), ref("cal"), methodNode, codegenClassScope));<NEW_LINE>evaluateCalOpsCalendarCodegen(block, forge.calendarForges, ref("cal"), methodNode, exprSymbol, codegenClassScope);<NEW_LINE>block.declareVar(EPTypePremade.LONGPRIMITIVE.getEPType(), "startTime", forge.timeAbacus.calendarGetCodegen(ref("cal"), ref("startRemainder"), codegenClassScope)).declareVar(EPTypePremade.LONGPRIMITIVE.getEPType(), "endTime", op(ref("startTime"), "+", op(ref("endLong"), "-", ref("startLong")))).methodReturn(forge.intervalForge.codegen(ref("startTime"), ref("endTime")<MASK><NEW_LINE>return localMethod(methodNode, start, end);<NEW_LINE>} | , methodNode, exprSymbol, codegenClassScope)); |
700,958 | public void updateAmountCost() {<NEW_LINE>if (movementQuantity.signum() > 0) {<NEW_LINE>costDetail.setCostAmt(costDetail.getAmt().subtract(costDetail.getCostAdjustment()));<NEW_LINE>costDetail.setCostAmtLL(costDetail.getAmtLL().subtract(costDetail.getCostAdjustmentLL()));<NEW_LINE>} else if (movementQuantity.signum() < 0) {<NEW_LINE>costDetail.setCostAmt(costDetail.getAmt().add(adjustCost));<NEW_LINE>costDetail.setCostAmtLL(costDetail.getAmtLL().add(adjustCostLowerLevel));<NEW_LINE>}<NEW_LINE>costDetail.setCumulatedQty(getNewAccumulatedQuantity(lastCostDetail));<NEW_LINE>costDetail.setCumulatedAmt(getNewAccumulatedAmount(lastCostDetail));<NEW_LINE>costDetail.setCumulatedAmtLL(getNewAccumulatedAmountLowerLevel(lastCostDetail));<NEW_LINE>costDetail.setCurrentCostPrice(currentCostPrice);<NEW_LINE>costDetail.setCurrentCostPriceLL(currentCostPriceLowerLevel);<NEW_LINE>// set the id for model<NEW_LINE>final String idColumnName = CostEngine.getIDColumnName(model);<NEW_LINE>costDetail.set_ValueOfColumn(idColumnName, CostEngine.getIDColumn(model));<NEW_LINE>if (model instanceof MInOutLine) {<NEW_LINE>MInOutLine ioLine = (MInOutLine) model;<NEW_LINE>costDetail.setC_OrderLine_ID(ioLine.getC_OrderLine_ID());<NEW_LINE>// IMPORTANT : reset possible provision purchase cost processed<NEW_LINE>costDetail.setC_InvoiceLine_ID(0);<NEW_LINE>}<NEW_LINE>if (model instanceof MMatchInv) {<NEW_LINE>MMatchInv iMatch = (MMatchInv) model;<NEW_LINE>costDetail.setM_MatchInv_ID(model.get_ID());<NEW_LINE>if (costDetail.getM_InOutLine_ID() == 0)<NEW_LINE>costDetail.setM_InOutLine_ID(iMatch.getM_InOutLine_ID());<NEW_LINE>if (costDetail.getC_InvoiceLine_ID() == 0)<NEW_LINE>costDetail.setC_InvoiceLine_ID(iMatch.getM_InOutLine_ID());<NEW_LINE>}<NEW_LINE>if (model instanceof MMatchPO) {<NEW_LINE>MMatchPO poMatch = (MMatchPO) model;<NEW_LINE>costDetail.<MASK><NEW_LINE>if (costDetail.getM_InOutLine_ID() == 0)<NEW_LINE>costDetail.setM_InOutLine_ID(poMatch.getM_InOutLine_ID());<NEW_LINE>}<NEW_LINE>if (model instanceof MLandedCostAllocation) {<NEW_LINE>MLandedCostAllocation allocation = (MLandedCostAllocation) model;<NEW_LINE>costDetail.setM_InOutLine_ID(allocation.getM_InOutLine_ID());<NEW_LINE>costDetail.setC_InvoiceLine_ID(allocation.getC_InvoiceLine_ID());<NEW_LINE>costDetail.setC_LandedCostAllocation_ID(allocation.getC_LandedCostAllocation_ID());<NEW_LINE>costDetail.setProcessed(false);<NEW_LINE>}<NEW_LINE>costDetail.saveEx();<NEW_LINE>} | setM_MatchPO_ID(poMatch.getM_MatchPO_ID()); |
267,221 | public WebResponse invokeProtectedResource(String testcase, WebConversation wc, String accessToken, String where, TestSettings settings, List<validationData> expectations, String currentAction) throws Exception {<NEW_LINE>String thisMethod = "invokeProtectedResource";<NEW_LINE>msgUtils.printMethodName(thisMethod);<NEW_LINE>WebResponse response = null;<NEW_LINE>WebRequest request = null;<NEW_LINE>try {<NEW_LINE>setMarkToEndOfAllServersLogs();<NEW_LINE>// Invoke protected resource<NEW_LINE>request = new GetMethodWebRequest(settings.getProtectedResource());<NEW_LINE>if (accessToken != null && where != null) {<NEW_LINE>if (where.equals(Constants.PARM)) {<NEW_LINE>request.setParameter(Constants.ACCESS_TOKEN_KEY, accessToken);<NEW_LINE>// throw new<NEW_LINE>// Exception("A valid access token was not passed into invokeProtectedResource")<NEW_LINE>// ;<NEW_LINE>} else {<NEW_LINE>request.setHeaderField(Constants.AUTHORIZATION, Constants.BEARER + " " + accessToken);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>msgUtils.printRequestParts(<MASK><NEW_LINE>response = wc.getResponse(request);<NEW_LINE>msgUtils.printResponseParts(response, thisMethod, "Response from protected app: ");<NEW_LINE>} catch (Exception e) {<NEW_LINE>validationTools.validateException(expectations, currentAction, e);<NEW_LINE>}<NEW_LINE>validationTools.validateResult(response, currentAction, expectations, settings);<NEW_LINE>return response;<NEW_LINE>} | request, thisMethod, "Request for " + currentAction); |
291,222 | public String toObfuscatedKey(final PwmApplication pwmApplication) throws PwmUnrecoverableException {<NEW_LINE>// use local cache first.<NEW_LINE>if (StringUtil.notEmpty(obfuscatedValue)) {<NEW_LINE>return obfuscatedValue;<NEW_LINE>}<NEW_LINE>// check app cache. This is used primarily so that keys are static over some meaningful lifetime, allowing browser caching based on keys.<NEW_LINE>final CacheService cacheService = pwmApplication.getCacheService();<NEW_LINE>final CacheKey cacheKey = CacheKey.newKey(this.getClass(), this, "obfuscatedKey");<NEW_LINE>final String cachedValue = cacheService.get(cacheKey, String.class);<NEW_LINE>if (StringUtil.notEmpty(cachedValue)) {<NEW_LINE>obfuscatedValue = cachedValue;<NEW_LINE>return cachedValue;<NEW_LINE>}<NEW_LINE>// generate key<NEW_LINE>try {<NEW_LINE>final String jsonValue = JsonFactory.get().serialize(this);<NEW_LINE>final String localValue = CRYPO_HEADER + pwmApplication.<MASK><NEW_LINE>this.obfuscatedValue = localValue;<NEW_LINE>cacheService.put(cacheKey, CachePolicy.makePolicyWithExpiration(TimeDuration.DAY), localValue);<NEW_LINE>return localValue;<NEW_LINE>} catch (final Exception e) {<NEW_LINE>throw new PwmUnrecoverableException(new ErrorInformation(PwmError.ERROR_INTERNAL, "unexpected error making obfuscated user key: " + e.getMessage()));<NEW_LINE>}<NEW_LINE>} | getSecureService().encryptToString(jsonValue); |
1,073,060 | public Map<K, ValueHolder<V>> bulkComputeIfAbsent(Set<? extends K> keys, final Function<Iterable<? extends K>, Iterable<? extends Map.Entry<? extends K, ? extends V>>> mappingFunction) throws StoreAccessException {<NEW_LINE>Map<K, ValueHolder<V>> result = new HashMap<>();<NEW_LINE>for (final K key : keys) {<NEW_LINE>final ValueHolder<V> newValue = computeIfAbsent(key, keyParam -> {<NEW_LINE>final Iterable<K> <MASK><NEW_LINE>final Iterable<? extends Map.Entry<? extends K, ? extends V>> entries = mappingFunction.apply(keySet);<NEW_LINE>final java.util.Iterator<? extends Map.Entry<? extends K, ? extends V>> iterator = entries.iterator();<NEW_LINE>final Map.Entry<? extends K, ? extends V> next = iterator.next();<NEW_LINE>K computedKey = next.getKey();<NEW_LINE>V computedValue = next.getValue();<NEW_LINE>checkKey(computedKey);<NEW_LINE>if (computedValue == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>checkValue(computedValue);<NEW_LINE>return computedValue;<NEW_LINE>});<NEW_LINE>result.put(key, newValue);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | keySet = Collections.singleton(keyParam); |
67,094 | public BackendEntry writeIndex(HugeIndex index) {<NEW_LINE>BinaryBackendEntry entry;<NEW_LINE>if (index.fieldValues() == null && index.elementIds().size() == 0) {<NEW_LINE>entry = this.formatILDeletion(index);<NEW_LINE>} else {<NEW_LINE>Id id = index.id();<NEW_LINE>HugeType type = index.type();<NEW_LINE>byte[] value = null;<NEW_LINE>if (!type.isNumericIndex() && indexIdLengthExceedLimit(id)) {<NEW_LINE>id = index.hashId();<NEW_LINE>// Save field-values as column value if the key is a hash string<NEW_LINE>value = StringEncoding.encode(index.fieldValues().toString());<NEW_LINE>}<NEW_LINE>entry = newBackendEntry(type, id);<NEW_LINE>if (index.indexLabel().olap()) {<NEW_LINE>entry.olap(true);<NEW_LINE>}<NEW_LINE>entry.column(this<MASK><NEW_LINE>entry.subId(index.elementId());<NEW_LINE>if (index.hasTtl()) {<NEW_LINE>entry.ttl(index.ttl());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return entry;<NEW_LINE>} | .formatIndexName(index), value); |
1,817,905 | public void onBindViewHolder(@NonNull ViewHolder holder, int position) {<NEW_LINE>ListItem listItem = adapterList.get(position);<NEW_LINE>if (listItem.type == LIST_ITEM_GROUP_END) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Set title<NEW_LINE>holder.title.setText(listItem.getTitle());<NEW_LINE>if (listItem.type == LIST_ITEM_GROUP_BEGIN) {<NEW_LINE>holder.itemView.setFocusable(false);<NEW_LINE>holder.title.setTextColor(accentColor);<NEW_LINE>LinearLayoutCompat itemLayout = holder.itemView.findViewById(R.id.item_layout);<NEW_LINE>itemLayout.setPadding(paddingMedium, paddingSmall, paddingMedium, paddingVerySmall);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Set common properties<NEW_LINE>holder.subtitle.setText(listItem.getSubtitle());<NEW_LINE>holder.subtitle.setFocusable(listItem.isSelectable());<NEW_LINE>holder.subtitle.setTextIsSelectable(listItem.isSelectable());<NEW_LINE>holder.subtitle.setBackgroundResource(listItem.isSelectable() ? R.drawable.item_transparent : 0);<NEW_LINE>if (listItem.isMonospace()) {<NEW_LINE>holder.subtitle.setTypeface(Typeface.MONOSPACE);<NEW_LINE>} else<NEW_LINE>holder.subtitle.setTypeface(Typeface.DEFAULT);<NEW_LINE>if (listItem.type == LIST_ITEM_INLINE) {<NEW_LINE>// Inline items aren't focusable if text selection mode is on<NEW_LINE>holder.itemView.setFocusable(!listItem.isSelectable());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (listItem.type == LIST_ITEM_REGULAR) {<NEW_LINE>// Having an action listener makes focusing the whole item redundant<NEW_LINE>holder.itemView.setFocusable(listItem.getOnActionClickListener() == null);<NEW_LINE>if (listItem.getActionIconRes() != 0) {<NEW_LINE>holder.actionIcon.setIconResource(listItem.getActionIconRes());<NEW_LINE>}<NEW_LINE>if (listItem.getActionContentDescription() != null) {<NEW_LINE>holder.actionIcon.setContentDescription(listItem.getActionContentDescription());<NEW_LINE>} else if (listItem.getActionContentDescriptionRes() != 0) {<NEW_LINE>holder.actionIcon.setContentDescription(context.getString(listItem.getActionContentDescriptionRes()));<NEW_LINE>}<NEW_LINE>if (listItem.getOnActionClickListener() != null) {<NEW_LINE>holder.actionIcon.setVisibility(View.VISIBLE);<NEW_LINE>holder.actionIcon.<MASK><NEW_LINE>} else<NEW_LINE>holder.actionIcon.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>} | setOnClickListener(listItem.getOnActionClickListener()); |
1,390,731 | void removeTable(QBNodeComponent selectedNode) {<NEW_LINE>String tableSpec = selectedNode.getTableSpec();<NEW_LINE>// NOI18N<NEW_LINE>Log.getLogger().<MASK><NEW_LINE>// Remove the specified node from the GraphLib scene<NEW_LINE>// First remove all edges<NEW_LINE>Collection edges = _scene.findNodeEdges(selectedNode, true, true);<NEW_LINE>for (Object edge : edges) {<NEW_LINE>// Edge is a JoinNode or CondNode<NEW_LINE>_scene.removeEdge(edge);<NEW_LINE>}<NEW_LINE>// Now remove the node<NEW_LINE>_scene.removeNode(selectedNode);<NEW_LINE>// Update the input table model, by removing all rows that mention this table<NEW_LINE>_queryBuilderInputTable.removeRows(tableSpec);<NEW_LINE>// Now update the QueryModel<NEW_LINE>// Note that we always do this, since the model-driven graph generation never contain deletion<NEW_LINE>_queryBuilder.getQueryModel().removeTable(tableSpec);<NEW_LINE>_queryBuilder.generate();<NEW_LINE>// update the groupby checkbox menu item.<NEW_LINE>setGroupBy(_queryBuilder.getQueryModel().hasGroupBy());<NEW_LINE>} | entering("QueryBuilderGraphFrame", "removeTable", tableSpec); |
1,709,268 | public Completion interpret(ExecutionContext context, boolean debug) {<NEW_LINE>Object exprRef = getRhs(<MASK><NEW_LINE>Object exprValue = getValue(this.rhsGet, context, exprRef);<NEW_LINE>if (exprValue == Types.NULL || exprValue == Types.UNDEFINED) {<NEW_LINE>return (Completion.createNormal());<NEW_LINE>}<NEW_LINE>JSObject obj = Types.toObject(context, exprValue);<NEW_LINE>Object v = null;<NEW_LINE>List<String> names = obj.getAllEnumerablePropertyNames().toList();<NEW_LINE>for (String each : names) {<NEW_LINE>Object lhsRef = getExpr().interpret(context, debug);<NEW_LINE>if (lhsRef instanceof Reference) {<NEW_LINE>((Reference) lhsRef).putValue(context, each);<NEW_LINE>}<NEW_LINE>Completion completion = (Completion) getBlock().interpret(context, debug);<NEW_LINE>if (completion.value != null) {<NEW_LINE>v = completion.value;<NEW_LINE>}<NEW_LINE>if (completion.type == Completion.Type.BREAK) {<NEW_LINE>if (completion.target == null || getLabels().contains(completion.target)) {<NEW_LINE>return (Completion.createNormal(v));<NEW_LINE>} else {<NEW_LINE>return (completion);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (completion.type == Completion.Type.RETURN || completion.type == Completion.Type.BREAK) {<NEW_LINE>return (completion);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (Completion.createNormal(v));<NEW_LINE>} | ).interpret(context, debug); |
88,419 | public void addObserver(final ServiceObserverPrx observer, Ice.Current current) {<NEW_LINE>java.util.List<String> activeServices = new java.util.LinkedList<String>();<NEW_LINE>//<NEW_LINE>// Null observers and duplicate registrations are ignored<NEW_LINE>//<NEW_LINE>synchronized (this) {<NEW_LINE>if (observer != null && _observers.add(observer)) {<NEW_LINE>if (_traceServiceObserver >= 1) {<NEW_LINE>_logger.trace("IceBox.ServiceObserver", "Added service observer " + _communicator.proxyToString(observer));<NEW_LINE>}<NEW_LINE>for (ServiceInfo info : _services) {<NEW_LINE>if (info.status == StatusStarted) {<NEW_LINE>activeServices.add(info.name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (activeServices.size() > 0) {<NEW_LINE>observer.begin_servicesStarted(activeServices.toArray(new <MASK><NEW_LINE>}<NEW_LINE>} | String[0]), _observerCompletedCB); |
261,893 | public ByQueryResponse byQueryResponse(DeleteByQueryResponse response) {<NEW_LINE>List<ByQueryResponse.Failure> failures = response.failures().stream().map(this::byQueryResponseFailureOf).collect(Collectors.toList());<NEW_LINE>ByQueryResponse.ByQueryResponseBuilder builder = ByQueryResponse.builder();<NEW_LINE>if (response.took() != null) {<NEW_LINE>builder.withTook(response.took());<NEW_LINE>}<NEW_LINE>if (response.timedOut() != null) {<NEW_LINE>builder.withTimedOut(response.timedOut());<NEW_LINE>}<NEW_LINE>if (response.total() != null) {<NEW_LINE>builder.withTotal(response.total());<NEW_LINE>}<NEW_LINE>if (response.deleted() != null) {<NEW_LINE>builder.withDeleted(response.deleted());<NEW_LINE>}<NEW_LINE>if (response.batches() != null) {<NEW_LINE>builder.withBatches(Math.toIntExact(response.batches()));<NEW_LINE>}<NEW_LINE>if (response.versionConflicts() != null) {<NEW_LINE>builder.withVersionConflicts(response.versionConflicts());<NEW_LINE>}<NEW_LINE>if (response.noops() != null) {<NEW_LINE>builder.withNoops(response.noops());<NEW_LINE>}<NEW_LINE>if (response.retries() != null) {<NEW_LINE>builder.withBulkRetries(response.<MASK><NEW_LINE>builder.withSearchRetries(response.retries().search());<NEW_LINE>}<NEW_LINE>builder.withFailures(failures);<NEW_LINE>return builder.build();<NEW_LINE>} | retries().bulk()); |
370,661 | public DataStreamSource build(CDCBuilder cdcBuilder, StreamExecutionEnvironment env, CustomTableEnvironment customTableEnvironment, DataStreamSource<String> dataStreamSource) {<NEW_LINE>final List<Schema> schemaList = config.getSchemaList();<NEW_LINE>final String schemaFieldName = config.getSchemaFieldName();<NEW_LINE>if (Asserts.isNotNullCollection(schemaList)) {<NEW_LINE>SingleOutputStreamOperator<Map> mapOperator = deserialize(dataStreamSource);<NEW_LINE>for (Schema schema : schemaList) {<NEW_LINE>for (Table table : schema.getTables()) {<NEW_LINE>SingleOutputStreamOperator<Map> filterOperator = shunt(mapOperator, table, schemaFieldName);<NEW_LINE>List<String> columnNameList = new ArrayList<>();<NEW_LINE>List<LogicalType> columnTypeList = new ArrayList<>();<NEW_LINE>buildColumn(columnNameList, columnTypeList, table.getColumns());<NEW_LINE>DataStream<RowData> rowDataDataStream = buildRowData(filterOperator, columnNameList, columnTypeList);<NEW_LINE>addSink(env, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return dataStreamSource;<NEW_LINE>} | rowDataDataStream, table, columnNameList, columnTypeList); |
194,893 | final DeleteRegistrationCodeResult executeDeleteRegistrationCode(DeleteRegistrationCodeRequest deleteRegistrationCodeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteRegistrationCodeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteRegistrationCodeRequest> request = null;<NEW_LINE>Response<DeleteRegistrationCodeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteRegistrationCodeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteRegistrationCodeRequest));<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, "IoT");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteRegistrationCodeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteRegistrationCodeResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteRegistrationCode"); |
277,848 | public // submit a topology as a group, containers as apps in the group<NEW_LINE>boolean submitTopology(String appConf) {<NEW_LINE>if (this.isVerbose) {<NEW_LINE>LOG.log(Level.INFO, "Topology conf is: " + appConf);<NEW_LINE>}<NEW_LINE>// Marathon atleast till 1.4.x does not allow upper case jobids<NEW_LINE>if (!this.topologyName.equals(this.topologyName.toLowerCase())) {<NEW_LINE>LOG.log(Level.SEVERE, "Marathon scheduler does not allow upper case topologies");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Setup Connection<NEW_LINE>String schedulerURI = String.format("%s/v2/groups", this.marathonURI);<NEW_LINE>HttpURLConnection conn = NetworkUtils.getHttpConnection(schedulerURI);<NEW_LINE>// Attach a token if there is one specified<NEW_LINE>if (this.marathonAuthToken != null) {<NEW_LINE>conn.setRequestProperty("Authorization", String.format<MASK><NEW_LINE>}<NEW_LINE>if (conn == null) {<NEW_LINE>LOG.log(Level.SEVERE, "Failed to find marathon scheduler");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// Send post request with marathon conf for topology<NEW_LINE>if (!NetworkUtils.sendHttpPostRequest(conn, NetworkUtils.JSON_TYPE, appConf.getBytes())) {<NEW_LINE>LOG.log(Level.SEVERE, "Failed to send post request");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Check response<NEW_LINE>boolean success = NetworkUtils.checkHttpResponseCode(conn, HttpURLConnection.HTTP_CREATED);<NEW_LINE>if (success) {<NEW_LINE>LOG.log(Level.INFO, "Topology submitted successfully");<NEW_LINE>return true;<NEW_LINE>} else if (NetworkUtils.checkHttpResponseCode(conn, HttpURLConnection.HTTP_UNAUTHORIZED)) {<NEW_LINE>LOG.log(Level.SEVERE, "Marathon requires authentication");<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>LOG.log(Level.SEVERE, "Failed to submit topology");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>// Disconnect to release resources<NEW_LINE>conn.disconnect();<NEW_LINE>}<NEW_LINE>} | ("token=%s", this.marathonAuthToken)); |
28,976 | /*<NEW_LINE>* We only create cache key (CustomCacheKeyProvider.java) for hashtable login so there is no need to<NEW_LINE>* get the lookup key for userId/pwd and userId only cases.<NEW_LINE>*/<NEW_LINE>private Subject findSubjectBySubjectHashtable(AuthCacheService authCacheService, Subject partialSubject, AuthenticationData hashtableAuthData) {<NEW_LINE>Subject subject = null;<NEW_LINE>if (hashtableAuthData.isEmpty())<NEW_LINE>return subject;<NEW_LINE>String customCacheKey = (String) hashtableAuthData.get(AttributeNameConstants.WSCREDENTIAL_CACHE_KEY);<NEW_LINE>if (customCacheKey != null) {<NEW_LINE>subject = authCacheService.getSubject(customCacheKey);<NEW_LINE>return subject;<NEW_LINE>}<NEW_LINE>// We do not create look up key for hashtable userid/pwd or userid only<NEW_LINE>String userid = (String) hashtableAuthData.get(AttributeNameConstants.WSCREDENTIAL_USERID);<NEW_LINE>String password = (String) hashtableAuthData.get(AttributeNameConstants.WSCREDENTIAL_PASSWORD);<NEW_LINE>String lookupKey;<NEW_LINE>if (password != null) {<NEW_LINE>lookupKey = BasicAuthCacheKeyProvider.createLookupKey(getRealm(), userid, password);<NEW_LINE>} else {<NEW_LINE>lookupKey = BasicAuthCacheKeyProvider.<MASK><NEW_LINE>}<NEW_LINE>subject = authCacheService.getSubject(lookupKey);<NEW_LINE>return subject;<NEW_LINE>} | createLookupKey(getRealm(), userid); |
1,606,274 | private int consumeOneArgument(ArgSpec argSpec, LookBehind lookBehind, boolean alreadyUnquoted, Range arity, int consumed, String arg, Class<?> type, List<Object> result, int index, String argDescription) {<NEW_LINE>if (!lookBehind.isAttached()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>String[] values = unquoteAndSplit(argSpec, lookBehind, alreadyUnquoted, arity, consumed, arg);<NEW_LINE>ITypeConverter<?> converter = getTypeConverter(type, argSpec, 0);<NEW_LINE>for (int j = 0; j < values.length; j++) {<NEW_LINE>Object stronglyTypedValue = tryConvert(argSpec, index, converter, values[j], type);<NEW_LINE>result.add(stronglyTypedValue);<NEW_LINE>if (tracer.isInfo()) {<NEW_LINE>tracer.info("Adding [%s] to %s for %s on %s%n", String.valueOf(result.get(result.size() - 1)), argSpec.toString(), argDescription, argSpec.scopeString());<NEW_LINE>}<NEW_LINE>parseResultBuilder.addStringValue(argSpec, values[j]);<NEW_LINE>}<NEW_LINE>parseResultBuilder.addOriginalStringValue(argSpec, arg);<NEW_LINE>return ++index;<NEW_LINE>} | parseResultBuilder.nowProcessing(argSpec, arg); |
1,493,348 | public static RocksDB openReadOnly(final DBOptions options, final String path, final List<ColumnFamilyDescriptor> columnFamilyDescriptors, final List<ColumnFamilyHandle> columnFamilyHandles) throws RocksDBException {<NEW_LINE>// when non-default Options is used, keeping an Options reference<NEW_LINE>// in RocksDB can prevent Java to GC during the life-time of<NEW_LINE>// the currently-created RocksDB.<NEW_LINE>final byte[][] cfNames = new byte[columnFamilyDescriptors.size()][];<NEW_LINE>final long[] cfOptionHandles = new <MASK><NEW_LINE>for (int i = 0; i < columnFamilyDescriptors.size(); i++) {<NEW_LINE>final ColumnFamilyDescriptor cfDescriptor = columnFamilyDescriptors.get(i);<NEW_LINE>cfNames[i] = cfDescriptor.columnFamilyName();<NEW_LINE>cfOptionHandles[i] = cfDescriptor.columnFamilyOptions().nativeHandle_;<NEW_LINE>}<NEW_LINE>final long[] handles = openROnly(options.nativeHandle_, path, cfNames, cfOptionHandles);<NEW_LINE>final RocksDB db = new RocksDB(handles[0]);<NEW_LINE>db.storeOptionsInstance(options);<NEW_LINE>for (int i = 1; i < handles.length; i++) {<NEW_LINE>columnFamilyHandles.add(new ColumnFamilyHandle(db, handles[i]));<NEW_LINE>}<NEW_LINE>return db;<NEW_LINE>} | long[columnFamilyDescriptors.size()]; |
1,486,921 | private static Set<String> scanBootstrapClasses() throws Exception {<NEW_LINE>int vmVersion = VMUtil.getVmVersion();<NEW_LINE>Set<String> classes = new LinkedHashSet<>(4096, 1F);<NEW_LINE>if (vmVersion < 9) {<NEW_LINE>Method method = ClassLoader.class.getDeclaredMethod("getBootstrapClassPath");<NEW_LINE>method.setAccessible(true);<NEW_LINE>Field field = URLClassLoader.class.getDeclaredField("ucp");<NEW_LINE>field.setAccessible(true);<NEW_LINE>Object bootstrapClasspath = method.invoke(null);<NEW_LINE>URLClassLoader dummyLoader = new URLClassLoader(new URL[0]);<NEW_LINE>Field modifiers = Field.class.getDeclaredField("modifiers");<NEW_LINE>modifiers.setAccessible(true);<NEW_LINE>modifiers.setInt(field, field.getModifiers() & ~Modifier.FINAL);<NEW_LINE>// Change the URLClassPath in the dummy loader to the bootstrap one.<NEW_LINE><MASK><NEW_LINE>URL[] urls = dummyLoader.getURLs();<NEW_LINE>for (URL url : urls) {<NEW_LINE>String protocol = url.getProtocol();<NEW_LINE>JarFile jar = null;<NEW_LINE>if ("jar".equals(protocol)) {<NEW_LINE>jar = ((JarURLConnection) url.openConnection()).getJarFile();<NEW_LINE>} else if ("file".equals(protocol)) {<NEW_LINE>File file = new File(url.toURI());<NEW_LINE>if (!file.isFile())<NEW_LINE>continue;<NEW_LINE>jar = new JarFile(file);<NEW_LINE>}<NEW_LINE>if (jar == null)<NEW_LINE>continue;<NEW_LINE>try {<NEW_LINE>Enumeration<? extends JarEntry> enumeration = jar.entries();<NEW_LINE>while (enumeration.hasMoreElements()) {<NEW_LINE>JarEntry entry = enumeration.nextElement();<NEW_LINE>String name = entry.getName();<NEW_LINE>if (name.endsWith(".class")) {<NEW_LINE>classes.add(name.substring(0, name.length() - 6));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>jar.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return classes;<NEW_LINE>} else {<NEW_LINE>Set<ModuleReference> references = ModuleFinder.ofSystem().findAll();<NEW_LINE>for (ModuleReference ref : references) {<NEW_LINE>try (ModuleReader mr = ref.open()) {<NEW_LINE>mr.list().forEach(s -> {<NEW_LINE>classes.add(s.substring(0, s.length() - 6));<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return classes;<NEW_LINE>} | field.set(dummyLoader, bootstrapClasspath); |
1,383,817 | // ----------------------------------------------------------------<NEW_LINE>static void doFuzz(String verb, String[] args) {<NEW_LINE>if (args.length < 1) {<NEW_LINE>System.err.printf("%s %s: need number of bits to fuzz.\n", PROGNAME, verb);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>int numErrorBits = 0;<NEW_LINE>try {<NEW_LINE>numErrorBits = Integer.parseInt(args[0]);<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>System.err.printf("%s %s: couldn't scan \"%s\" as number of bits to fuzz.\n", PROGNAME, verb, args[0]);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>args = Arrays.copyOfRange(<MASK><NEW_LINE>Vector<Hash256> hashes = new Vector<Hash256>();<NEW_LINE>HashReaderUtil.loadHashesFromFilesOrDie(PROGNAME, args, hashes);<NEW_LINE>for (Hash256 hash : hashes) {<NEW_LINE>hash = hash.fuzz(numErrorBits);<NEW_LINE>System.out.printf("%s\n", hash.toString());<NEW_LINE>}<NEW_LINE>} | args, 1, args.length); |
1,810,691 | public ApiResponse<SearchFileContents> filesGetRecentWithHttpInfo(Integer pageIndex, Integer pageSize, Integer filter, String sortExpression, Boolean reversed) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'pageIndex' is set<NEW_LINE>if (pageIndex == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'pageIndex' when calling filesGetRecent");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'pageSize' is set<NEW_LINE>if (pageSize == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'pageSize' when calling filesGetRecent");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'filter' is set<NEW_LINE>if (filter == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'filter' when calling filesGetRecent");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/files/recent";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "pageIndex", pageIndex));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "pageSize", pageSize));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter", filter));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs<MASK><NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "reversed", reversed));<NEW_LINE>final String[] localVarAccepts = { "application/json", "text/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>GenericType<SearchFileContents> localVarReturnType = new GenericType<SearchFileContents>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | ("", "sortExpression", sortExpression)); |
42,220 | private void makePositions() {<NEW_LINE>// Only recalculate if size has changed<NEW_LINE>if (compHeight == getHeight() && compWidth == getWidth()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>compHeight = getHeight();<NEW_LINE>compWidth = getWidth();<NEW_LINE>int cols = COLS;<NEW_LINE>int rows = ROWS;<NEW_LINE>colorsToDraw.clear();<NEW_LINE>int padding = PADDING;<NEW_LINE>int margin = MARGIN;<NEW_LINE>int marginTop = MARGIN_TOP;<NEW_LINE>int x = margin;<NEW_LINE>int y = marginTop;<NEW_LINE>width = getWidth() - (cols - 1) * padding - margin * 2;<NEW_LINE>height = getHeight() - (rows - 1) * padding - margin - marginTop;<NEW_LINE>elementWidth = width / cols;<NEW_LINE>elementHeight = height / rows;<NEW_LINE>Iterator<NamedColor> it = namedColors.iterator();<NEW_LINE>for (int col = 0; col < cols; col++) {<NEW_LINE>for (int row = 0; row < rows; row++) {<NEW_LINE>if (it.hasNext()) {<NEW_LINE>NamedColor c = it.next();<NEW_LINE>Rectangle r = new Rectangle(x, y, elementWidth, elementHeight);<NEW_LINE>colorsToDraw.add(<MASK><NEW_LINE>}<NEW_LINE>y += elementHeight + padding;<NEW_LINE>}<NEW_LINE>x += elementWidth + padding;<NEW_LINE>y = marginTop;<NEW_LINE>}<NEW_LINE>} | new ColorToDraw(c, r)); |
757,575 | public void processParameter(Parameter parameter) {<NEW_LINE>String $ref = parameter.getRef();<NEW_LINE>if ($ref != null) {<NEW_LINE>RefFormat refFormat = computeRefFormat(parameter.getRef());<NEW_LINE>if (isAnExternalRefFormat(refFormat)) {<NEW_LINE>final String newRef = externalRefProcessor.processRefToExternalParameter($ref, refFormat);<NEW_LINE>if (newRef != null) {<NEW_LINE>parameter.setRef(newRef);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (parameter.getSchema() != null) {<NEW_LINE>schemaProcessor.<MASK><NEW_LINE>}<NEW_LINE>if (parameter.getExamples() != null) {<NEW_LINE>Map<String, Example> examples = parameter.getExamples();<NEW_LINE>for (String exampleName : examples.keySet()) {<NEW_LINE>final Example example = examples.get(exampleName);<NEW_LINE>exampleProcessor.processExample(example);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Schema schema = null;<NEW_LINE>if (parameter.getContent() != null) {<NEW_LINE>Map<String, MediaType> content = parameter.getContent();<NEW_LINE>for (String mediaName : content.keySet()) {<NEW_LINE>MediaType mediaType = content.get(mediaName);<NEW_LINE>if (mediaType.getSchema() != null) {<NEW_LINE>schema = mediaType.getSchema();<NEW_LINE>if (schema != null) {<NEW_LINE>schemaProcessor.processSchema(schema);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | processSchema(parameter.getSchema()); |
146,123 | // two-ended bfs<NEW_LINE>public int shortestPathBinaryMatrix(int[][] grid) {<NEW_LINE>// base condition<NEW_LINE>int maxX = grid.length - 1;<NEW_LINE>int maxY = grid[0].length - 1;<NEW_LINE>if (grid[0][0] == 1 || grid[maxX][maxY] == 1)<NEW_LINE>return -1;<NEW_LINE>if (grid.length == 1)<NEW_LINE>return 1;<NEW_LINE>Set<Cell> beginSet = new HashSet<>(Collections.singleton(new Cell(0, 0)));<NEW_LINE>boolean[][] beginVisited = new boolean[maxX + 1][maxY + 1];<NEW_LINE>beginVisited[0][0] = true;<NEW_LINE>Set<Cell> endSet = new HashSet<>(Collections.singleton(new Cell(maxX, maxY)));<NEW_LINE>boolean[][] endVisited = new boolean[maxX <MASK><NEW_LINE>endVisited[maxX][maxY] = true;<NEW_LINE>// bfs<NEW_LINE>return this.searchBfs(1, beginSet, endSet, grid, beginVisited, endVisited, maxX, maxY);<NEW_LINE>} | + 1][maxY + 1]; |
724,553 | public CompletableFuture<byte[]> readMemory(Address address, int length) {<NEW_LINE>AddressSpace addressSpace = address.getAddressSpace();<NEW_LINE>if (addressSpace.equals(impl.getAddressSpace("ram"))) {<NEW_LINE>byte[] bytes = new byte[length];<NEW_LINE>Method method = impl.getMethodForAddress(address);<NEW_LINE>if (method != null && targetVM.vm.canGetBytecodes()) {<NEW_LINE>byte[] bytecodes = method.bytecodes();<NEW_LINE>int i = 0;<NEW_LINE>for (byte b : bytecodes) {<NEW_LINE>bytes[i++] = b;<NEW_LINE>if (i >= length)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>bytes[i] = (byte) 0xFF;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>listeners.fire.memoryUpdated(this, address, bytes);<NEW_LINE>return CompletableFuture.completedFuture(bytes);<NEW_LINE>}<NEW_LINE>if (addressSpace.equals(impl.getAddressSpace("constantPool"))) {<NEW_LINE>byte[] bytes = constantPool.getPool();<NEW_LINE>listeners.fire.<MASK><NEW_LINE>return CompletableFuture.completedFuture(bytes);<NEW_LINE>}<NEW_LINE>throw new RuntimeException();<NEW_LINE>} | memoryUpdated(this, address, bytes); |
1,560,032 | public void renderSVG(Item item, SVGTarget target, PreviewProperties properties) {<NEW_LINE>Node node = (Node) item.getSource();<NEW_LINE>// Params<NEW_LINE>Float x = item.getData(NodeItem.X);<NEW_LINE>Float y = item.getData(NodeItem.Y);<NEW_LINE>Float size = item.getData(NodeItem.SIZE);<NEW_LINE>size /= 2f;<NEW_LINE>Color color = <MASK><NEW_LINE>Color borderColor = ((DependantColor) properties.getValue(PreviewProperty.NODE_BORDER_COLOR)).getColor(color);<NEW_LINE>float borderSize = properties.getFloatValue(PreviewProperty.NODE_BORDER_WIDTH);<NEW_LINE>float alpha = properties.getBooleanValue(PreviewProperty.NODE_PER_NODE_OPACITY) ? color.getAlpha() / 255f : properties.getFloatValue(PreviewProperty.NODE_OPACITY) / 100f;<NEW_LINE>if (alpha > 1) {<NEW_LINE>alpha = 1;<NEW_LINE>}<NEW_LINE>Element nodeElem = target.createElement("circle");<NEW_LINE>nodeElem.setAttribute("class", SVGUtils.idAsClassAttribute(node.getId()));<NEW_LINE>nodeElem.setAttribute("cx", x.toString());<NEW_LINE>nodeElem.setAttribute("cy", y.toString());<NEW_LINE>nodeElem.setAttribute("r", size.toString());<NEW_LINE>nodeElem.setAttribute("fill", target.toHexString(color));<NEW_LINE>nodeElem.setAttribute("fill-opacity", "" + alpha);<NEW_LINE>if (borderSize > 0) {<NEW_LINE>nodeElem.setAttribute("stroke", target.toHexString(borderColor));<NEW_LINE>nodeElem.setAttribute("stroke-width", Float.toString(borderSize * target.getScaleRatio()));<NEW_LINE>nodeElem.setAttribute("stroke-opacity", "" + alpha);<NEW_LINE>}<NEW_LINE>target.getTopElement(SVGTarget.TOP_NODES).appendChild(nodeElem);<NEW_LINE>} | item.getData(NodeItem.COLOR); |
321,576 | public Map<String, Object> doGetUnparseableEvents(String full) {<NEW_LINE>Map<String, Object> <MASK><NEW_LINE>boolean needsDeterminePartitions = false;<NEW_LINE>boolean needsBuildSegments = false;<NEW_LINE>if (full != null) {<NEW_LINE>needsDeterminePartitions = true;<NEW_LINE>needsBuildSegments = true;<NEW_LINE>} else {<NEW_LINE>switch(ingestionState) {<NEW_LINE>case DETERMINE_PARTITIONS:<NEW_LINE>needsDeterminePartitions = true;<NEW_LINE>break;<NEW_LINE>case BUILD_SEGMENTS:<NEW_LINE>case COMPLETED:<NEW_LINE>needsBuildSegments = true;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (needsDeterminePartitions) {<NEW_LINE>events.put(RowIngestionMeters.DETERMINE_PARTITIONS, IndexTaskUtils.getReportListFromSavedParseExceptions(determinePartitionsParseExceptionHandler.getSavedParseExceptionReports()));<NEW_LINE>}<NEW_LINE>if (needsBuildSegments) {<NEW_LINE>events.put(RowIngestionMeters.BUILD_SEGMENTS, IndexTaskUtils.getReportListFromSavedParseExceptions(buildSegmentsParseExceptionHandler.getSavedParseExceptionReports()));<NEW_LINE>}<NEW_LINE>return events;<NEW_LINE>} | events = new HashMap<>(); |
1,580,759 | public void handleEvent(Event event) {<NEW_LINE>SimpleTextEntryWindow entryWindow = new SimpleTextEntryWindow("max.sr.window.title", "max.sr.window.message");<NEW_LINE><MASK><NEW_LINE>entryWindow.selectPreenteredText(true);<NEW_LINE>entryWindow.prompt(new UIInputReceiverListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void UIInputReceiverClosed(UIInputReceiver receiver) {<NEW_LINE>if (!receiver.hasSubmittedInput()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String text = receiver.getSubmittedInput().trim();<NEW_LINE>int sr = 0;<NEW_LINE>if (text.length() > 0) {<NEW_LINE>try {<NEW_LINE>float f = DisplayFormatters.parseFloat(df, text);<NEW_LINE>sr = (int) (f * 1000);<NEW_LINE>if (sr < 0) {<NEW_LINE>sr = 0;<NEW_LINE>} else if (sr == 0 && f > 0) {<NEW_LINE>sr = 1;<NEW_LINE>}<NEW_LINE>tf_rate_limit.setTagMaxShareRatio(sr);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>MessageBox mb = new MessageBox(Utils.findAnyShell(), SWT.ICON_ERROR | SWT.OK);<NEW_LINE>mb.setText(MessageText.getString("MyTorrentsView.dialog.NumberError.title"));<NEW_LINE>mb.setMessage(MessageText.getString("MyTorrentsView.dialog.NumberError.text"));<NEW_LINE>mb.open();<NEW_LINE>Debug.out(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | entryWindow.setPreenteredText(existing, false); |
1,145,101 | public void saveScreenshot() {<NEW_LINE>// Since ScreenGrabber is initialized before DisplayResolutionDependentFbo (because the latter contains a reference to the former)<NEW_LINE>// on first call on saveScreenshot() displayResolutionDependentFBOs will be null.<NEW_LINE>if (displayResolutionDependentFBOs == null) {<NEW_LINE>displayResolutionDependentFBOs = CoreRegistry.get(DisplayResolutionDependentFbo.class);<NEW_LINE>}<NEW_LINE>FBO sceneFinalFbo = displayResolutionDependentFBOs.get(DisplayResolutionDependentFbo.FINAL_BUFFER);<NEW_LINE>final ByteBuffer buffer = sceneFinalFbo.getColorBufferRawData();<NEW_LINE>if (buffer == null) {<NEW_LINE>logger.error("No screenshot data available. No screenshot will be saved.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int width = sceneFinalFbo.width();<NEW_LINE>int height = sceneFinalFbo.height();<NEW_LINE>Runnable task;<NEW_LINE>if (savingGamePreview) {<NEW_LINE>task = () -> <MASK><NEW_LINE>this.savingGamePreview = false;<NEW_LINE>} else {<NEW_LINE>task = () -> saveScreenshotTask(buffer, width, height);<NEW_LINE>}<NEW_LINE>GameScheduler.scheduleParallel("Write screenshot", task);<NEW_LINE>isTakingScreenshot = false;<NEW_LINE>} | saveGamePreviewTask(buffer, width, height); |
994,943 | final DescribeSecretResult executeDescribeSecret(DescribeSecretRequest describeSecretRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeSecretRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeSecretRequest> request = null;<NEW_LINE>Response<DescribeSecretResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeSecretRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeSecretRequest));<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, "Secrets Manager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeSecret");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeSecretResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeSecretResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
1,288,666 | public void insert(List<String> items) {<NEW_LINE>YAMLValue yamlCompoundValue = argumentsKeyValue.getValue();<NEW_LINE>if (!(yamlCompoundValue instanceof YAMLCompoundValue)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int appendEndOffset = -1;<NEW_LINE>String insertString = null;<NEW_LINE>if (yamlCompoundValue instanceof YAMLArrayImpl) {<NEW_LINE>// [ @foo ]<NEW_LINE>// we wound array<NEW_LINE>List<PsiElement> yamlArguments = YamlHelper.getYamlArrayOnSequenceOrArrayElements((YAMLCompoundValue) yamlCompoundValue);<NEW_LINE>if (yamlArguments != null && yamlArguments.size() > 0) {<NEW_LINE>appendEndOffset = yamlArguments.get(yamlArguments.size() - 1).getTextRange().getEndOffset();<NEW_LINE>List<String> arrayList = new ArrayList<>();<NEW_LINE>for (String item : items) {<NEW_LINE>arrayList.add(String.format("'@%s'", StringUtils.isNotBlank(item) ? item : "?"));<NEW_LINE>}<NEW_LINE>insertString = ", " + StringUtils.join(arrayList, ", ");<NEW_LINE>}<NEW_LINE>} else if (yamlCompoundValue instanceof YAMLSequence) {<NEW_LINE>// - @foo<NEW_LINE>// search indent and EOL value<NEW_LINE>String indent = StringUtil.repeatSymbol(' ', YAMLUtil.getIndentToThisElement(yamlCompoundValue));<NEW_LINE>String eol = TranslationInsertUtil.findEol(yamlKeyValue);<NEW_LINE>List<String> yamlSequences = new ArrayList<>();<NEW_LINE>for (String item : items) {<NEW_LINE>// should be faster then YamlPsiElementFactory.createFromText<NEW_LINE>yamlSequences.add(indent + String.format("- '@%s'", StringUtils.isNotBlank(item) ? item : "?"));<NEW_LINE>}<NEW_LINE>appendEndOffset = yamlCompoundValue.getTextRange().getEndOffset();<NEW_LINE>insertString = eol + <MASK><NEW_LINE>}<NEW_LINE>if (appendEndOffset == -1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PsiDocumentManager manager = PsiDocumentManager.getInstance(project);<NEW_LINE>Document document = manager.getDocument(yamlKeyValue.getContainingFile());<NEW_LINE>if (document == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>document.insertString(appendEndOffset, insertString);<NEW_LINE>manager.doPostponedOperationsAndUnblockDocument(document);<NEW_LINE>manager.commitDocument(document);<NEW_LINE>} | StringUtils.join(yamlSequences, eol); |
243,461 | private static boolean checkFrequencies(List<Integer> seq, int n, double falseNegativeTolerance) {<NEW_LINE>final double avg = (double) seq.size() / n;<NEW_LINE>final int kIndiv = computeDeviationMultiplier(falseNegativeTolerance, n);<NEW_LINE>final double p = 1.0 / n;<NEW_LINE>final double sigmaIndiv = Math.sqrt(seq.size() * p * (1.0 - p));<NEW_LINE>final double kSigmaIndiv = kIndiv * sigmaIndiv;<NEW_LINE>// To make our testing meaningful "sufficiently large", we need to have<NEW_LINE>// enough testing data.<NEW_LINE>if (seq.size() * p < 50 || seq.size() * (1 - p) < 50) {<NEW_LINE>// Sample size is too small so we cannot use normal<NEW_LINE>return true;<NEW_LINE>// approximation<NEW_LINE>}<NEW_LINE>Map<Integer, Integer> indivFreqs = new HashMap<>();<NEW_LINE>for (Integer a : seq) {<NEW_LINE>indivFreqs.put(a, indivFreqs.getOrDefault(a, 0) + 1);<NEW_LINE>}<NEW_LINE>// Check that there are roughly seq.size()/n occurrences of key. By roughly<NEW_LINE>// we mean the difference is less than k_sigma.<NEW_LINE>return indivFreqs.values().stream().allMatch(freq -> Math.abs<MASK><NEW_LINE>} | (avg - freq) <= kSigmaIndiv); |
1,140,565 | public static JFreeChart createBubbleChart(String title, String xAxisLabel, String yAxisLabel, XYZDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) {<NEW_LINE><MASK><NEW_LINE>NumberAxis xAxis = new NumberAxis(xAxisLabel);<NEW_LINE>xAxis.setAutoRangeIncludesZero(false);<NEW_LINE>NumberAxis yAxis = new NumberAxis(yAxisLabel);<NEW_LINE>yAxis.setAutoRangeIncludesZero(false);<NEW_LINE>XYPlot plot = new XYPlot(dataset, xAxis, yAxis, null);<NEW_LINE>XYItemRenderer renderer = new XYBubbleRenderer(XYBubbleRenderer.SCALE_ON_RANGE_AXIS);<NEW_LINE>if (tooltips) {<NEW_LINE>renderer.setDefaultToolTipGenerator(new StandardXYZToolTipGenerator());<NEW_LINE>}<NEW_LINE>if (urls) {<NEW_LINE>renderer.setURLGenerator(new StandardXYZURLGenerator());<NEW_LINE>}<NEW_LINE>plot.setRenderer(renderer);<NEW_LINE>plot.setOrientation(orientation);<NEW_LINE>JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);<NEW_LINE>currentTheme.apply(chart);<NEW_LINE>return chart;<NEW_LINE>} | Args.nullNotPermitted(orientation, "orientation"); |
1,037,319 | // //////////////////////////////////////////////////////////////////////////<NEW_LINE>// Methods //<NEW_LINE>// //////////////////////////////////////////////////////////////////////////<NEW_LINE>Runner newRunner(final GlassFishServer srv, final Command cmd, final Class runnerClass) throws CommandException {<NEW_LINE>final String METHOD = "newRunner";<NEW_LINE>Constructor<Runner> con = null;<NEW_LINE>Runner runner = null;<NEW_LINE>try {<NEW_LINE>con = runnerClass.getConstructor(<MASK><NEW_LINE>} catch (NoSuchMethodException | SecurityException nsme) {<NEW_LINE>throw new CommandException(CommandException.RUNNER_INIT, nsme);<NEW_LINE>}<NEW_LINE>if (con == null) {<NEW_LINE>return runner;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>runner = con.newInstance(srv, cmd);<NEW_LINE>} catch (InstantiationException | IllegalAccessException ie) {<NEW_LINE>throw new CommandException(CommandException.RUNNER_INIT, ie);<NEW_LINE>} catch (InvocationTargetException ite) {<NEW_LINE>LOGGER.log(Level.WARNING, "exceptionMsg", ite.getMessage());<NEW_LINE>Throwable t = ite.getCause();<NEW_LINE>if (t != null) {<NEW_LINE>LOGGER.log(Level.WARNING, "cause", t.getMessage());<NEW_LINE>}<NEW_LINE>throw new CommandException(CommandException.RUNNER_INIT, ite);<NEW_LINE>}<NEW_LINE>return runner;<NEW_LINE>} | GlassFishServer.class, Command.class); |
267,794 | void reset(byte[] bytes, int off, int len) {<NEW_LINE>Objects.checkFromIndexSize(off, len, bytes.length);<NEW_LINE>this.bytes = bytes;<NEW_LINE>this.base = off;<NEW_LINE>this.end = off + len;<NEW_LINE>final int bitsPerOffset;<NEW_LINE>if (len - LAST_LITERALS < 1 << Short.SIZE) {<NEW_LINE>bitsPerOffset = Short.SIZE;<NEW_LINE>} else {<NEW_LINE>bitsPerOffset = Integer.SIZE;<NEW_LINE>}<NEW_LINE>final int bitsPerOffsetLog = 32 - <MASK><NEW_LINE>hashLog = MEMORY_USAGE + 3 - bitsPerOffsetLog;<NEW_LINE>if (hashTable == null || hashTable.size() < 1 << hashLog || hashTable.getBitsPerValue() < bitsPerOffset) {<NEW_LINE>if (bitsPerOffset > Short.SIZE) {<NEW_LINE>assert bitsPerOffset == Integer.SIZE;<NEW_LINE>hashTable = new Table32(1 << hashLog);<NEW_LINE>} else {<NEW_LINE>assert bitsPerOffset == Short.SIZE;<NEW_LINE>hashTable = new Table16(1 << hashLog);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Avoid calling hashTable.clear(), this makes it costly to compress many short sequences<NEW_LINE>// otherwise.<NEW_LINE>// Instead, get() checks that references are less than the current offset.<NEW_LINE>}<NEW_LINE>this.lastOff = off - 1;<NEW_LINE>} | Integer.numberOfLeadingZeros(bitsPerOffset - 1); |
1,702,870 | public Object calculate(Context ctx) {<NEW_LINE>if (left == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("\"|\"" + mm.getMessage("operator.missingLeftOperation"));<NEW_LINE>}<NEW_LINE>if (right == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("\"|\"" + mm.getMessage("operator.missingRightOperation"));<NEW_LINE>}<NEW_LINE>Object o1 = left.calculate(ctx);<NEW_LINE>Object o2 = right.calculate(ctx);<NEW_LINE>Sequence s1, s2;<NEW_LINE>if (o1 instanceof Sequence) {<NEW_LINE>s1 = (Sequence) o1;<NEW_LINE>} else if (o1 == null) {<NEW_LINE>s1 = new Sequence(0);<NEW_LINE>} else {<NEW_LINE>s1 = new Sequence(1);<NEW_LINE>s1.add(o1);<NEW_LINE>}<NEW_LINE>if (o2 instanceof Sequence) {<NEW_LINE>s2 = (Sequence) o2;<NEW_LINE>} else if (o2 == null) {<NEW_LINE>s2 = new Sequence(0);<NEW_LINE>} else {<NEW_LINE>s2 = new Sequence(1);<NEW_LINE>s2.add(o2);<NEW_LINE>}<NEW_LINE>Sequence result = s1.conj(s2, false);<NEW_LINE>return <MASK><NEW_LINE>} | left.assign(result, ctx); |
838,401 | final GetUsageResult executeGetUsage(GetUsageRequest getUsageRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getUsageRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetUsageRequest> request = null;<NEW_LINE>Response<GetUsageResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetUsageRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getUsageRequest));<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, "API Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetUsage");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetUsageResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetUsageResultJsonUnmarshaller());<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()); |
1,022,836 | private String resolveDriver(String dataSourceName, String dbKind, DataSourceJdbcBuildTimeConfig dataSourceJdbcBuildTimeConfig, List<JdbcDriverBuildItem> jdbcDriverBuildItems) {<NEW_LINE>if (dataSourceJdbcBuildTimeConfig.driver.isPresent()) {<NEW_LINE>return dataSourceJdbcBuildTimeConfig.driver.get();<NEW_LINE>}<NEW_LINE>Optional<JdbcDriverBuildItem> matchingJdbcDriver = jdbcDriverBuildItems.stream().filter(i -> dbKind.equals(i.getDbKind())).findFirst();<NEW_LINE>if (matchingJdbcDriver.isPresent()) {<NEW_LINE>if (io.quarkus.agroal.runtime.TransactionIntegration.XA == dataSourceJdbcBuildTimeConfig.transactions) {<NEW_LINE>if (matchingJdbcDriver.get().getDriverXAClass().isPresent()) {<NEW_LINE>return matchingJdbcDriver.get()<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return matchingJdbcDriver.get().getDriverClass();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new ConfigurationException("Unable to find a JDBC driver corresponding to the database kind '" + dbKind + "' for the " + (DataSourceUtil.isDefault(dataSourceName) ? "default datasource" : "datasource '" + dataSourceName + "'") + ". Either provide a suitable JDBC driver extension, define the driver manually, or disable the JDBC datasource by adding " + (DataSourceUtil.isDefault(dataSourceName) ? "'quarkus.datasource.jdbc=false'" : "'quarkus.datasource." + dataSourceName + ".jdbc=false'") + " to your configuration if you don't need it.");<NEW_LINE>} | .getDriverXAClass().get(); |
1,691,421 | private String makeSimpleInsert(List<SQLExpr> columns, String[] fields, String table, boolean isAddEncose) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append(LoadData.loadDataHint).append("insert into ").append(table.toUpperCase());<NEW_LINE>if (columns != null && columns.size() > 0) {<NEW_LINE>sb.append("(");<NEW_LINE>for (int i = 0, columnsSize = columns.size(); i < columnsSize; i++) {<NEW_LINE>SQLExpr <MASK><NEW_LINE>sb.append(column.toString());<NEW_LINE>if (i != columnsSize - 1) {<NEW_LINE>sb.append(",");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sb.append(") ");<NEW_LINE>}<NEW_LINE>sb.append(" values (");<NEW_LINE>for (int i = 0, columnsSize = fields.length; i < columnsSize; i++) {<NEW_LINE>String column = fields[i];<NEW_LINE>if (isAddEncose) {<NEW_LINE>sb.append("'").append(parseFieldString(column, loadData.getEnclose())).append("'");<NEW_LINE>} else {<NEW_LINE>sb.append(column);<NEW_LINE>}<NEW_LINE>if (i != columnsSize - 1) {<NEW_LINE>sb.append(",");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sb.append(")");<NEW_LINE>return sb.toString();<NEW_LINE>} | column = columns.get(i); |
1,489,107 | final CreateRelationalDatabaseFromSnapshotResult executeCreateRelationalDatabaseFromSnapshot(CreateRelationalDatabaseFromSnapshotRequest createRelationalDatabaseFromSnapshotRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createRelationalDatabaseFromSnapshotRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateRelationalDatabaseFromSnapshotRequest> request = null;<NEW_LINE>Response<CreateRelationalDatabaseFromSnapshotResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateRelationalDatabaseFromSnapshotRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createRelationalDatabaseFromSnapshotRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Lightsail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateRelationalDatabaseFromSnapshot");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateRelationalDatabaseFromSnapshotResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateRelationalDatabaseFromSnapshotResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
282,882 | private ObjectGroup unmarshalObjectGroup(Node t) throws Exception {<NEW_LINE>ObjectGroup og = null;<NEW_LINE>try {<NEW_LINE>og = unmarshalClass(t, ObjectGroup.class);<NEW_LINE>} catch (JAXBException e) {<NEW_LINE>// todo: replace with log message<NEW_LINE>e.printStackTrace();<NEW_LINE>return og;<NEW_LINE>}<NEW_LINE>final int offsetX = <MASK><NEW_LINE>final int offsetY = getAttribute(t, "y", 0);<NEW_LINE>og.setOffset(offsetX, offsetY);<NEW_LINE>final int locked = getAttribute(t, "locked", 0);<NEW_LINE>if (locked != 0) {<NEW_LINE>og.setLocked(1);<NEW_LINE>}<NEW_LINE>// Manually parse the objects in object group<NEW_LINE>og.getObjects().clear();<NEW_LINE>NodeList children = t.getChildNodes();<NEW_LINE>for (int i = 0; i < children.getLength(); i++) {<NEW_LINE>Node child = children.item(i);<NEW_LINE>if ("object".equalsIgnoreCase(child.getNodeName())) {<NEW_LINE>og.addObject(readMapObject(child));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return og;<NEW_LINE>} | getAttribute(t, "x", 0); |
523,609 | public void testInvokeInlineWithinSameTransactionAndAppContext() throws Exception {<NEW_LINE>ManagedExecutorService executor = InitialContext.doLookup("java:comp/concurrent/remainingcontextunchangedexecutor");<NEW_LINE>long servletThreadId = Thread<MASK><NEW_LINE>Callable<Boolean> task = () -> {<NEW_LINE>boolean inline = Thread.currentThread().getId() == servletThreadId;<NEW_LINE>if (inline) {<NEW_LINE>// Transaction must remain on thread when running inline:<NEW_LINE>tran.rollback();<NEW_LINE>// Application context must also remain on the thread:<NEW_LINE>assertNotNull(InitialContext.doLookup("java:comp/concurrent/remainingcontextunchangedexecutor"));<NEW_LINE>}<NEW_LINE>return inline;<NEW_LINE>};<NEW_LINE>tran.begin();<NEW_LINE>try {<NEW_LINE>Boolean executedInline = executor.invokeAny(Collections.singleton(task));<NEW_LINE>if (executedInline)<NEW_LINE>assertEquals(Status.STATUS_NO_TRANSACTION, tran.getStatus());<NEW_LINE>} finally {<NEW_LINE>if (tran.getStatus() != Status.STATUS_NO_TRANSACTION)<NEW_LINE>tran.rollback();<NEW_LINE>}<NEW_LINE>} | .currentThread().getId(); |
1,416,291 | private void processDiffs(int threadId, StackTraceElement[] oldElements, StackTraceElement[] newElements, long timestamp, long timediff, Thread.State oldState, Thread.State newState) throws IllegalStateException {<NEW_LINE>// just to be sure<NEW_LINE>assert newState != Thread.State.NEW : "Invalid thread state " + newState.name() + " for taking a stack trace";<NEW_LINE>if (oldState == Thread.State.TERMINATED && newState != Thread.State.TERMINATED) {<NEW_LINE>throw new IllegalStateException("Thread has already been set to " + Thread.State.TERMINATED.name() + " - stack trace can not be taken");<NEW_LINE>}<NEW_LINE>long threadtime = threadtimes.get<MASK><NEW_LINE>// switch (oldState) {<NEW_LINE>// case NEW: {<NEW_LINE>// switch (newState) {<NEW_LINE>// case RUNNABLE: {<NEW_LINE>// processDiffs(threadId, oldElements, newElements, timestamp);<NEW_LINE>// break;<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>// break;<NEW_LINE>// }<NEW_LINE>// case RUNNABLE: {<NEW_LINE>// break;<NEW_LINE>// }<NEW_LINE>// case WAITING:<NEW_LINE>// case TIMED_WAITING: {<NEW_LINE>// ccgb.waitExit(threadId, timestamp, threadtime);<NEW_LINE>// break;<NEW_LINE>// }<NEW_LINE>// case BLOCKED: {<NEW_LINE>// ccgb.monitorExit(threadId, timestamp, threadtime);<NEW_LINE>// break;<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>if (oldState == Thread.State.RUNNABLE) {<NEW_LINE>threadtime += timediff;<NEW_LINE>threadtimes.put(Long.valueOf(threadId), threadtime);<NEW_LINE>}<NEW_LINE>// if (newState == Thread.State.RUNNABLE && newElements.length > 0) {<NEW_LINE>// StackTraceElement top = newElements[0];<NEW_LINE>// if (top.getClassName().equals("java.lang.Object") && top.isNativeMethod() && top.getMethodName().equals("wait")) {<NEW_LINE>// System.out.println("!!!!!!!!!!!!!!!!!!!!!!!");<NEW_LINE>// System.out.println("!!!!!!!!!!!!!!!!!!!!!!!");<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>processDiffs(threadId, oldElements, newElements, timestamp, threadtime);<NEW_LINE>// switch (newState) {<NEW_LINE>// case RUNNABLE: {<NEW_LINE>// break;<NEW_LINE>// }<NEW_LINE>// case WAITING:<NEW_LINE>// case TIMED_WAITING: {<NEW_LINE>// ccgb.waitEntry(threadId, timestamp, threadtime);<NEW_LINE>// break;<NEW_LINE>// }<NEW_LINE>// case BLOCKED: {<NEW_LINE>// ccgb.monitorEntry(threadId, timestamp, threadtime);<NEW_LINE>// break;<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>} | (Long.valueOf(threadId)); |
511,323 | public BExpressionValue evaluate() throws EvaluationException {<NEW_LINE>try {<NEW_LINE>// An annotation access expression is evaluated by first evaluating expression resulting in a typedesc<NEW_LINE>// value t.<NEW_LINE>// If t has an annotation with the tag referenced by annot-tag-reference, then the result of the<NEW_LINE>// annotation access expression is the value of that annotation; otherwise, the result is nil.<NEW_LINE>BExpressionValue result = exprEvaluator.evaluate();<NEW_LINE>Value valueAsObject = getValueAsObject(context, result.getJdiValue());<NEW_LINE>if (result.getType() != BVariableType.TYPE_DESC && result.getType() != BVariableType.UNKNOWN) {<NEW_LINE>throw createEvaluationException(TYPE_MISMATCH, BVariableType.TYPE_DESC.getString(), result.getType().getString(), syntaxNode.toSourceCode());<NEW_LINE>}<NEW_LINE>List<String> <MASK><NEW_LINE>argTypeNames.add(JAVA_OBJECT_CLASS);<NEW_LINE>argTypeNames.add(JAVA_STRING_CLASS);<NEW_LINE>RuntimeStaticMethod getAnnotationValueMethod = getRuntimeMethod(context, B_DEBUGGER_RUNTIME_CLASS, GET_ANNOT_VALUE_METHOD, argTypeNames);<NEW_LINE>List<Value> argValues = new ArrayList<>();<NEW_LINE>argValues.add(valueAsObject);<NEW_LINE>argValues.add(EvaluationUtils.getAsJString(context, syntaxNode.annotTagReference().toSourceCode()));<NEW_LINE>getAnnotationValueMethod.setArgValues(argValues);<NEW_LINE>return new BExpressionValue(context, getAnnotationValueMethod.invokeSafely());<NEW_LINE>} catch (EvaluationException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw createEvaluationException(INTERNAL_ERROR, syntaxNode.toSourceCode().trim());<NEW_LINE>}<NEW_LINE>} | argTypeNames = new ArrayList<>(); |
988,552 | static int upgradeDbToVersion11(SQLiteDatabase db) {<NEW_LINE>Log.i(DatabaseHelper.LOG_TAG, "Upgrading database to version 9");<NEW_LINE>int oldVersion = 10;<NEW_LINE>db.beginTransaction();<NEW_LINE>try {<NEW_LINE>Cursor cursor = db.query(ScheduledActionEntry.TABLE_NAME, null, ScheduledActionEntry.COLUMN_TYPE + "= ?", new String[] { ScheduledAction.ActionType.BACKUP.name() }, null, null, null);<NEW_LINE>Map<String, String> uidToTagMap = new HashMap<>();<NEW_LINE>while (cursor.moveToNext()) {<NEW_LINE>String uid = cursor.getString(cursor.getColumnIndexOrThrow(ScheduledActionEntry.COLUMN_UID));<NEW_LINE>String tag = cursor.getString(cursor.getColumnIndexOrThrow(ScheduledActionEntry.COLUMN_TAG));<NEW_LINE>String[] tokens = tag.split(";");<NEW_LINE>try {<NEW_LINE>Timestamp timestamp = TimestampHelper.getTimestampFromUtcString(tokens[2]);<NEW_LINE>} catch (IllegalArgumentException ex) {<NEW_LINE>tokens[2] = TimestampHelper.getUtcStringFromTimestamp(PreferencesHelper.getLastExportTime());<NEW_LINE>} finally {<NEW_LINE>tag = TextUtils.join(";", tokens);<NEW_LINE>}<NEW_LINE>uidToTagMap.put(uid, tag);<NEW_LINE>}<NEW_LINE>cursor.close();<NEW_LINE>ContentValues contentValues = new ContentValues();<NEW_LINE>for (Map.Entry<String, String> entry : uidToTagMap.entrySet()) {<NEW_LINE>contentValues.clear();<NEW_LINE>contentValues.put(ScheduledActionEntry.COLUMN_TAG, entry.getValue());<NEW_LINE>db.update(ScheduledActionEntry.TABLE_NAME, contentValues, ScheduledActionEntry.COLUMN_UID + " = ?", new String[] <MASK><NEW_LINE>}<NEW_LINE>db.setTransactionSuccessful();<NEW_LINE>oldVersion = 11;<NEW_LINE>} finally {<NEW_LINE>db.endTransaction();<NEW_LINE>}<NEW_LINE>return oldVersion;<NEW_LINE>} | { entry.getKey() }); |
1,216,249 | public void addResourceHandlers(ResourceHandlerRegistry registry) {<NEW_LINE>String[] locations = new String[] { "classpath:/static/" };<NEW_LINE>if (NzbHydra.getDataFolder() != null) {<NEW_LINE>File staticFolderFile = new File(new File(NzbHydra.getDataFolder()).getParentFile(), "static");<NEW_LINE>try {<NEW_LINE>String fileStatic = staticFolderFile.toURI().toURL().toString();<NEW_LINE>locations = (fileStatic != null && staticFolderFile.exists()) ? new String[] { fileStatic, "classpath:/static/" } <MASK><NEW_LINE>logger.info("Found folder {}. Will load UI resources from there", staticFolderFile.getAbsolutePath());<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>logger.error("Unable to build path for local static files");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>registry.addResourceHandler("/static/**").addResourceLocations(locations).setCacheControl(CacheControl.noCache()).resourceChain(false);<NEW_LINE>// Otherwise swagger is not loaded using /swagger-ui/index.html<NEW_LINE>registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/4.5.0/");<NEW_LINE>registry.setOrder(0);<NEW_LINE>} | : new String[] { "classpath:/static/" }; |
388,479 | private OracleConnectOptions toOracleConnectOptions(DataSourceRuntimeConfig dataSourceRuntimeConfig, DataSourceReactiveRuntimeConfig dataSourceReactiveRuntimeConfig, DataSourceReactiveOracleConfig dataSourceReactiveOracleConfig) {<NEW_LINE>OracleConnectOptions oracleConnectOptions;<NEW_LINE>if (dataSourceReactiveRuntimeConfig.url.isPresent()) {<NEW_LINE>String url = dataSourceReactiveRuntimeConfig.url.get();<NEW_LINE>// clean up the URL to make migrations easier<NEW_LINE>if (url.startsWith("vertx-reactive:oracle:")) {<NEW_LINE>url = url.substring("vertx-reactive:".length());<NEW_LINE>}<NEW_LINE>oracleConnectOptions = OracleConnectOptions.fromUri(url);<NEW_LINE>} else {<NEW_LINE>oracleConnectOptions = new OracleConnectOptions();<NEW_LINE>}<NEW_LINE>if (dataSourceRuntimeConfig.username.isPresent()) {<NEW_LINE>oracleConnectOptions.setUser(dataSourceRuntimeConfig.username.get());<NEW_LINE>}<NEW_LINE>if (dataSourceRuntimeConfig.password.isPresent()) {<NEW_LINE>oracleConnectOptions.setPassword(dataSourceRuntimeConfig.password.get());<NEW_LINE>}<NEW_LINE>// credentials provider<NEW_LINE>if (dataSourceRuntimeConfig.credentialsProvider.isPresent()) {<NEW_LINE>String beanName = dataSourceRuntimeConfig.credentialsProviderName.orElse(null);<NEW_LINE>CredentialsProvider credentialsProvider = CredentialsProviderFinder.find(beanName);<NEW_LINE>String name = dataSourceRuntimeConfig.credentialsProvider.get();<NEW_LINE>Map<String, String> credentials = credentialsProvider.getCredentials(name);<NEW_LINE>String <MASK><NEW_LINE>String password = credentials.get(PASSWORD_PROPERTY_NAME);<NEW_LINE>if (user != null) {<NEW_LINE>oracleConnectOptions.setUser(user);<NEW_LINE>}<NEW_LINE>if (password != null) {<NEW_LINE>oracleConnectOptions.setPassword(password);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return oracleConnectOptions;<NEW_LINE>} | user = credentials.get(USER_PROPERTY_NAME); |
860,026 | private void sendAndQueueIfNecessary(final ItemWrapper<W> itemWrapper) {<NEW_LINE>final <MASK><NEW_LINE>try {<NEW_LINE>final ProcessResult processResult = itemProcessor.process(itemWrapper.getWorkItem());<NEW_LINE>if (processResult == ProcessResult.SUCCESS) {<NEW_LINE>logAndStatUpdateForSuccess(itemWrapper, () -> TimeDuration.fromCurrent(processStartTime));<NEW_LINE>} else if (processResult == ProcessResult.RETRY || processResult == ProcessResult.NOOP) {<NEW_LINE>workQueueStats.increment(WorkQueueStat.preQueueFallback);<NEW_LINE>try {<NEW_LINE>submitToQueue(itemWrapper);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>logger.error(() -> "error submitting to work queue after executor returned retry status: " + e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (final PwmOperationalException e) {<NEW_LINE>logger.error(() -> "unexpected error while processing itemWrapper: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | Instant processStartTime = Instant.now(); |
1,327,408 | public Request<StartMetricStreamsRequest> marshall(StartMetricStreamsRequest startMetricStreamsRequest) {<NEW_LINE>if (startMetricStreamsRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<StartMetricStreamsRequest> request = new DefaultRequest<StartMetricStreamsRequest>(startMetricStreamsRequest, "AmazonCloudWatch");<NEW_LINE>request.addParameter("Action", "StartMetricStreams");<NEW_LINE><MASK><NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (!startMetricStreamsRequest.getNames().isEmpty() || !((com.amazonaws.internal.SdkInternalList<String>) startMetricStreamsRequest.getNames()).isAutoConstruct()) {<NEW_LINE>com.amazonaws.internal.SdkInternalList<String> namesList = (com.amazonaws.internal.SdkInternalList<String>) startMetricStreamsRequest.getNames();<NEW_LINE>int namesListIndex = 1;<NEW_LINE>for (String namesListValue : namesList) {<NEW_LINE>if (namesListValue != null) {<NEW_LINE>request.addParameter("Names.member." + namesListIndex, StringUtils.fromString(namesListValue));<NEW_LINE>}<NEW_LINE>namesListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | request.addParameter("Version", "2010-08-01"); |
1,626,488 | protected void updateIndent(int prevMark, int originalOffset, int nodeIndex, TextEditGroup editGroup) {<NEW_LINE>if (prevMark != RewriteEvent.UNCHANGED && prevMark != RewriteEvent.REPLACED)<NEW_LINE>return;<NEW_LINE>// Do not change indent if the previous non removed node is on the same line<NEW_LINE>int previousNonRemovedNodeIndex = nodeIndex - 1;<NEW_LINE>while (previousNonRemovedNodeIndex >= 0 && this.list[previousNonRemovedNodeIndex].getChangeKind() == RewriteEvent.REMOVED) {<NEW_LINE>previousNonRemovedNodeIndex--;<NEW_LINE>}<NEW_LINE>if (previousNonRemovedNodeIndex > -1) {<NEW_LINE>LineInformation lineInformation = getLineInformation();<NEW_LINE>RewriteEvent prevEvent = this.list[previousNonRemovedNodeIndex];<NEW_LINE>int prevKind = prevEvent.getChangeKind();<NEW_LINE>if (prevKind == RewriteEvent.UNCHANGED || prevKind == RewriteEvent.REPLACED) {<NEW_LINE>ASTNode prevNode = (ASTNode) this.list[previousNonRemovedNodeIndex].getOriginalValue();<NEW_LINE>int prevEndPosition = prevNode.getStartPosition() + prevNode.getLength();<NEW_LINE>int <MASK><NEW_LINE>int line = lineInformation.getLineOfOffset(originalOffset);<NEW_LINE>if (prevLine == line) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int total = this.list.length;<NEW_LINE>while (nodeIndex < total && this.list[nodeIndex].getChangeKind() == RewriteEvent.REMOVED) {<NEW_LINE>nodeIndex++;<NEW_LINE>}<NEW_LINE>int originalIndent = getIndent(originalOffset);<NEW_LINE>int newIndent = getNodeIndent(nodeIndex);<NEW_LINE>if (originalIndent != newIndent) {<NEW_LINE>int line = getLineInformation().getLineOfOffset(originalOffset);<NEW_LINE>if (line >= 0) {<NEW_LINE>int lineStart = getLineInformation().getLineOffset(line);<NEW_LINE>// remove previous indentation<NEW_LINE>doTextRemove(lineStart, originalOffset - lineStart, editGroup);<NEW_LINE>// add new indentation<NEW_LINE>doTextInsert(lineStart, createIndentString(newIndent), editGroup);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | prevLine = lineInformation.getLineOfOffset(prevEndPosition); |
1,462,277 | static void runCombinePerKeyExamples(Options options) {<NEW_LINE>Pipeline <MASK><NEW_LINE>// Build the table schema for the output table.<NEW_LINE>List<TableFieldSchema> fields = new ArrayList<>();<NEW_LINE>fields.add(new TableFieldSchema().setName("word").setType("STRING"));<NEW_LINE>fields.add(new TableFieldSchema().setName("all_plays").setType("STRING"));<NEW_LINE>TableSchema schema = new TableSchema().setFields(fields);<NEW_LINE>p.apply(BigQueryIO.readTableRows().from(options.getInput())).apply(new PlaysForWord()).apply(BigQueryIO.writeTableRows().to(options.getOutput()).withSchema(schema).withCreateDisposition(BigQueryIO.Write.CreateDisposition.CREATE_IF_NEEDED).withWriteDisposition(BigQueryIO.Write.WriteDisposition.WRITE_TRUNCATE));<NEW_LINE>p.run().waitUntilFinish();<NEW_LINE>} | p = Pipeline.create(options); |
971,138 | public NotificationRead tryNotification(final Notification notification) {<NEW_LINE>try {<NEW_LINE>final NotificationClient notificationClient = NotificationClient.createNotificationClient(NotificationConverter.toConfig(notification));<NEW_LINE>final String messageFormat = "Hello World! This is a test from Airbyte to try %s notification settings for sync %s";<NEW_LINE>final boolean failureNotified = notificationClient.notifyFailure(String.format(messageFormat, notification.getNotificationType(), "failures"));<NEW_LINE>final boolean successNotified = notificationClient.notifySuccess(String.format(messageFormat, notification.getNotificationType(), "successes"));<NEW_LINE>if (failureNotified || successNotified) {<NEW_LINE>return new NotificationRead().status(StatusEnum.SUCCEEDED);<NEW_LINE>}<NEW_LINE>} catch (final IllegalArgumentException e) {<NEW_LINE>throw new IdNotFoundKnownException(e.getMessage(), notification.getNotificationType().name());<NEW_LINE>} catch (final IOException | InterruptedException e) {<NEW_LINE>return new NotificationRead().status(StatusEnum.FAILED).message(e.getMessage());<NEW_LINE>}<NEW_LINE>return new NotificationRead(<MASK><NEW_LINE>} | ).status(StatusEnum.FAILED); |
511,417 | protected void addEnumConstants(EnumDefinition enumDefinition, JDefinedClass _enum, Schema schema) {<NEW_LINE>JType type = enumDefinition.getBackingType();<NEW_LINE>String nodeName = enumDefinition.getNodeName();<NEW_LINE>JsonNode parentNode = enumDefinition.getEnumNode();<NEW_LINE>for (EnumValueDefinition enumValueDefinition : enumDefinition.values()) {<NEW_LINE>JEnumConstant constant = _enum.enumConstant(enumValueDefinition.getName());<NEW_LINE>String value = enumValueDefinition.getValue();<NEW_LINE>constant.arg(DefaultRule.getDefaultValue(type, value));<NEW_LINE>Annotator annotator = ruleFactory.getAnnotator();<NEW_LINE>annotator.enumConstant(_enum, constant, value);<NEW_LINE>String enumNodeName = nodeName + "#" + value;<NEW_LINE>if (enumValueDefinition.hasTitle()) {<NEW_LINE>JsonNode titleNode = enumValueDefinition.getTitleNode();<NEW_LINE>ruleFactory.getTitleRule().apply(enumNodeName, titleNode, parentNode, constant, schema);<NEW_LINE>}<NEW_LINE>if (enumValueDefinition.hasDescription()) {<NEW_LINE>JsonNode descriptionNode = enumValueDefinition.getDescriptionNode();<NEW_LINE>ruleFactory.getDescriptionRule().apply(enumNodeName, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | descriptionNode, parentNode, constant, schema); |
1,506,607 | public Aggregation toDruidAggregation(final PlannerContext plannerContext, final RowSignature rowSignature, final VirtualColumnRegistry virtualColumnRegistry, final RexBuilder rexBuilder, final String name, final AggregateCall aggregateCall, final Project project, final List<Aggregation> existingAggregations, final boolean finalizeAggregations) {<NEW_LINE>final List<RexNode> rexNodes = aggregateCall.getArgList().stream().map(i -> Expressions.fromFieldAccess(rowSignature, project, i)).collect(Collectors.toList());<NEW_LINE>final List<DruidExpression> args = Expressions.<MASK><NEW_LINE>if (args == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final String aggregatorName = finalizeAggregations ? Calcites.makePrefixedName(name, "a") : name;<NEW_LINE>final ColumnType outputType = Calcites.getColumnTypeForRelDataType(aggregateCall.getType());<NEW_LINE>if (outputType == null) {<NEW_LINE>throw new ISE("Cannot translate output sqlTypeName[%s] to Druid type for aggregator[%s]", aggregateCall.getType().getSqlTypeName(), aggregateCall.getName());<NEW_LINE>}<NEW_LINE>final String fieldName = getColumnName(plannerContext, virtualColumnRegistry, args.get(0), rexNodes.get(0));<NEW_LINE>final AggregatorFactory theAggFactory;<NEW_LINE>switch(args.size()) {<NEW_LINE>case 1:<NEW_LINE>theAggFactory = aggregatorType.createAggregatorFactory(aggregatorName, fieldName, null, outputType, -1);<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>theAggFactory = aggregatorType.createAggregatorFactory(aggregatorName, fieldName, null, outputType, RexLiteral.intValue(rexNodes.get(1)));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IAE("aggregation[%s], Invalid number of arguments[%,d] to [%s] operator", aggregatorName, args.size(), aggregatorType.name());<NEW_LINE>}<NEW_LINE>return Aggregation.create(Collections.singletonList(theAggFactory), finalizeAggregations ? new FinalizingFieldAccessPostAggregator(name, aggregatorName) : null);<NEW_LINE>} | toDruidExpressions(plannerContext, rowSignature, rexNodes); |
680,446 | final ModifyCapacityReservationResult executeModifyCapacityReservation(ModifyCapacityReservationRequest modifyCapacityReservationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(modifyCapacityReservationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ModifyCapacityReservationRequest> request = null;<NEW_LINE>Response<ModifyCapacityReservationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ModifyCapacityReservationRequestMarshaller().marshall(super.beforeMarshalling(modifyCapacityReservationRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ModifyCapacityReservation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ModifyCapacityReservationResult> responseHandler = new StaxResponseHandler<<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | ModifyCapacityReservationResult>(new ModifyCapacityReservationResultStaxUnmarshaller()); |
1,288,517 | public DataType toDataType() throws DuplicateNameException, IOException {<NEW_LINE>Structure structure = new StructureDataType("ext4_inode", 0);<NEW_LINE>structure.add(WORD, "i_mode", null);<NEW_LINE>structure.add(WORD, "i_uid", null);<NEW_LINE>structure.add(DWORD, "i_size_lo", null);<NEW_LINE>structure.add(DWORD, "i_atime", null);<NEW_LINE>structure.add(DWORD, "i_ctime", null);<NEW_LINE>structure.add(DWORD, "i_mtime", null);<NEW_LINE>structure.add(DWORD, "i_dtime", null);<NEW_LINE>structure.add(WORD, "i_gid", null);<NEW_LINE>structure.add(WORD, "i_links_count", null);<NEW_LINE>structure.add(DWORD, "i_blocks_lo", null);<NEW_LINE>structure.add(DWORD, "i_flags", null);<NEW_LINE>structure.add(DWORD, "i_osd1", null);<NEW_LINE>structure.add(new ArrayDataType(BYTE, 60, BYTE.getLength()), "i_block", null);<NEW_LINE>structure.add(DWORD, "i_generation", null);<NEW_LINE>structure.add(DWORD, "i_file_acl_lo", null);<NEW_LINE>structure.add(DWORD, "i_size_high", null);<NEW_LINE>structure.add(DWORD, "i_obso_faddr", null);<NEW_LINE>// 12 bytes long<NEW_LINE>structure.add(new ArrayDataType(BYTE, 12, BYTE.getLength()), "i_osd2", null);<NEW_LINE>structure.add(WORD, "i_extra_isize", null);<NEW_LINE>structure.add(WORD, "i_checksum_hi", null);<NEW_LINE>structure.add(DWORD, "i_ctime_extra", null);<NEW_LINE>structure.add(DWORD, "i_mtime_extra", null);<NEW_LINE>structure.add(DWORD, "i_atime_extra", null);<NEW_LINE>structure.add(DWORD, "i_crtime", null);<NEW_LINE>structure.add(DWORD, "i_crtime_extra", null);<NEW_LINE>structure.<MASK><NEW_LINE>structure.add(DWORD, "i_projid", null);<NEW_LINE>return structure;<NEW_LINE>} | add(DWORD, "i_version_hi", null); |
333,565 | public void testCaptureDebuggerBreakpointMarkerPlugin() throws Throwable {<NEW_LINE>ListingPanel panel = listing.getListingPanel();<NEW_LINE>mb.createTestModel();<NEW_LINE>modelService.addModel(mb.testModel);<NEW_LINE>mb.createTestProcessesAndThreads();<NEW_LINE>TestDebuggerTargetTraceMapper mapper = new TestDebuggerTargetTraceMapper(mb.testProcess1);<NEW_LINE>TraceRecorder recorder = modelService.recordTarget(mb.testProcess1, mapper, ActionSource.AUTOMATIC);<NEW_LINE>Trace trace = recorder.getTrace();<NEW_LINE>traceManager.openTrace(trace);<NEW_LINE>traceManager.activateTrace(trace);<NEW_LINE>tool.getProject().getProjectData().getRootFolder().createFile("WinHelloCPP", program, TaskMonitor.DUMMY);<NEW_LINE>try (UndoableTransaction tid = UndoableTransaction.start(trace, "Add Mapping", true)) {<NEW_LINE>mappingService.addIdentityMapping(trace, program, Range.atLeast(0L), true);<NEW_LINE>}<NEW_LINE>waitForValue(() -> mappingService.getOpenMappedLocation(new DefaultTraceLocation(trace, null, Range.singleton(0L), mb.addr(0x00401c60))));<NEW_LINE>Msg.debug(this, "Placing breakpoint");<NEW_LINE>breakpointService.placeBreakpointAt(program, addr(program, 0x00401c60), 1, Set.of(TraceBreakpointKind.SW_EXECUTE), "");<NEW_LINE>Msg.debug(this, "Disabling breakpoint");<NEW_LINE>LogicalBreakpoint lb = waitForValue(() -> Unique.assertAtMostOne(breakpointService.getBreakpointsAt(program, addr(program, 0x00401c60))));<NEW_LINE>lb.disable();<NEW_LINE>waitForCondition(() -> lb.computeState() == State.DISABLED);<NEW_LINE>Msg.debug(this, "Placing another");<NEW_LINE>breakpointService.placeBreakpointAt(program, addr(program, 0x00401c63), 1, Set.of(TraceBreakpointKind.SW_EXECUTE), "");<NEW_LINE>Msg.debug(this, "Saving program");<NEW_LINE>program.save("Placed breakpoints", TaskMonitor.DUMMY);<NEW_LINE><MASK><NEW_LINE>DebuggerBreakpointMarkerPluginTest.clickListing(panel, addr(program, 0x00401c66), MouseEvent.BUTTON3);<NEW_LINE>waitForSwing();<NEW_LINE>captureProviderWithScreenShot(listing);<NEW_LINE>} | Msg.debug(this, "Clicking and capturing"); |
1,365,220 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>logDebug("onCreate()");<NEW_LINE>requestWindowFeature(Window.FEATURE_NO_TITLE);<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>Display display <MASK><NEW_LINE>outMetrics = new DisplayMetrics();<NEW_LINE>display.getMetrics(outMetrics);<NEW_LINE>dbH = DatabaseHandler.getDbHandler(getApplicationContext());<NEW_LINE>Intent intentReceived = getIntent();<NEW_LINE>if (intentReceived != null) {<NEW_LINE>url = intentReceived.getDataString();<NEW_LINE>}<NEW_LINE>if (dbH.getCredentials() != null && (megaApi == null || megaApi.getRootNode() == null)) {<NEW_LINE>logDebug("Refresh session - sdk or karere");<NEW_LINE>Intent intent = new Intent(this, LoginActivity.class);<NEW_LINE>intent.putExtra(VISIBLE_FRAGMENT, LOGIN_FRAGMENT);<NEW_LINE>intent.setData(Uri.parse(url));<NEW_LINE>intent.setAction(ACTION_OPEN_FILE_LINK_ROOTNODES_NULL);<NEW_LINE>intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);<NEW_LINE>startActivity(intent);<NEW_LINE>finish();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (savedInstanceState != null) {<NEW_LINE>nodeSaver.restoreState(savedInstanceState);<NEW_LINE>}<NEW_LINE>setContentView(R.layout.activity_file_link);<NEW_LINE>fragmentContainer = findViewById(R.id.file_link_fragment_container);<NEW_LINE>appBarLayout = findViewById(R.id.app_bar);<NEW_LINE>collapsingToolbar = findViewById(R.id.file_link_info_collapse_toolbar);<NEW_LINE>if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {<NEW_LINE>collapsingToolbar.setExpandedTitleMarginBottom(scaleHeightPx(60, outMetrics));<NEW_LINE>} else {<NEW_LINE>collapsingToolbar.setExpandedTitleMarginBottom(scaleHeightPx(35, outMetrics));<NEW_LINE>}<NEW_LINE>collapsingToolbar.setExpandedTitleMarginStart((int) getResources().getDimension(R.dimen.bottom_sheet_item_divider_margin_start));<NEW_LINE>tB = findViewById(R.id.toolbar_file_link);<NEW_LINE>setSupportActionBar(tB);<NEW_LINE>aB = getSupportActionBar();<NEW_LINE>if (aB != null) {<NEW_LINE>aB.setDisplayShowTitleEnabled(false);<NEW_LINE>aB.setHomeButtonEnabled(true);<NEW_LINE>aB.setDisplayHomeAsUpEnabled(true);<NEW_LINE>}<NEW_LINE>sizeTextView = findViewById(R.id.file_link_size);<NEW_LINE>buttonPreviewContent = findViewById(R.id.button_preview_content);<NEW_LINE>buttonPreviewContent.setOnClickListener(this);<NEW_LINE>buttonPreviewContent.setEnabled(false);<NEW_LINE>buttonPreviewContent.setVisibility(View.GONE);<NEW_LINE>downloadButton = findViewById(R.id.file_link_button_download);<NEW_LINE>downloadButton.setOnClickListener(this);<NEW_LINE>downloadButton.setVisibility(View.INVISIBLE);<NEW_LINE>importButton = findViewById(R.id.file_link_button_import);<NEW_LINE>importButton.setOnClickListener(this);<NEW_LINE>importButton.setVisibility(View.GONE);<NEW_LINE>setTransfersWidgetLayout(findViewById(R.id.transfers_widget_layout));<NEW_LINE>registerTransfersReceiver();<NEW_LINE>try {<NEW_LINE>statusDialog.dismiss();<NEW_LINE>} catch (Exception e) {<NEW_LINE>logError(e.getMessage());<NEW_LINE>}<NEW_LINE>if (url != null) {<NEW_LINE>importLink(url);<NEW_LINE>} else {<NEW_LINE>logWarning("url NULL");<NEW_LINE>}<NEW_LINE>fragmentContainer.post(() -> cookieDialogHandler.showDialogIfNeeded(this));<NEW_LINE>} | = getWindowManager().getDefaultDisplay(); |
127,629 | private RoaringBitmap compute(long threshold, boolean upper, RoaringBitmap context) {<NEW_LINE>if (context.isEmpty()) {<NEW_LINE>return new RoaringBitmap();<NEW_LINE>}<NEW_LINE>if (Long.numberOfLeadingZeros(threshold) < Long.numberOfLeadingZeros(mask)) {<NEW_LINE>return upper ? RoaringBitmap.bitmapOfRange(0, max) : new RoaringBitmap();<NEW_LINE>}<NEW_LINE>RoaringArray contextArray = context.highLowContainer;<NEW_LINE>int contextPos = 0;<NEW_LINE>int maxContextKey = contextArray.keys[contextArray.size - 1];<NEW_LINE>RoaringArray output = new RoaringArray();<NEW_LINE>long remaining = max;<NEW_LINE>int mPos = masksOffset;<NEW_LINE>for (int prefix = 0; prefix <= maxContextKey && remaining > 0; prefix++) {<NEW_LINE>long containerMask = buffer.getLong(mPos) & mask;<NEW_LINE>if (prefix < contextArray.keys[contextPos]) {<NEW_LINE>for (int i = 0; i < Long.bitCount(containerMask); i++) {<NEW_LINE>skipContainer();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>evaluateHorizontalSlice(remaining, threshold, containerMask);<NEW_LINE>if (!upper) {<NEW_LINE>Util.flipBitmapRange(bits, 0, Math.min(0x10000, (int) remaining));<NEW_LINE>empty = false;<NEW_LINE>}<NEW_LINE>if (!empty) {<NEW_LINE>Container toAppend = new BitmapContainer(bits, -1).iand(contextArray.values[contextPos]).repairAfterLazy().runOptimize();<NEW_LINE>if (!toAppend.isEmpty()) {<NEW_LINE>output.append((char) prefix, toAppend instanceof BitmapContainer ? <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>contextPos++;<NEW_LINE>}<NEW_LINE>remaining -= 0x10000;<NEW_LINE>mPos += bytesPerMask;<NEW_LINE>}<NEW_LINE>return new RoaringBitmap(output);<NEW_LINE>} | toAppend.clone() : toAppend); |
223,950 | private boolean estimateMotion() {<NEW_LINE>CameraModel leftCM = cameraModels.get(CAMERA_LEFT);<NEW_LINE>CameraModel rightCM = cameraModels.get(CAMERA_RIGHT);<NEW_LINE>// Perform motion estimation relative to the most recent key frame<NEW_LINE>previousLeft.frame_to_world.invert(world_to_prev);<NEW_LINE>// Put observation and prior knowledge into a format the model matcher will understand<NEW_LINE>listStereo2D3D.reserve(candidates.size());<NEW_LINE>listStereo2D3D.reset();<NEW_LINE>for (int candidateIdx = 0; candidateIdx < candidates.size(); candidateIdx++) {<NEW_LINE>PointTrack <MASK><NEW_LINE>Stereo2D3D stereo = listStereo2D3D.grow();<NEW_LINE>// Get the track location<NEW_LINE>TrackInfo bt = l.getCookie();<NEW_LINE>PointTrack r = bt.visualRight;<NEW_LINE>// Get the 3D coordinate of the point in the 'previous' frame<NEW_LINE>SePointOps_F64.transform(world_to_prev, bt.worldLoc, prevLoc4);<NEW_LINE>PerspectiveOps.homogenousTo3dPositiveZ(prevLoc4, 1e8, 1e-8, stereo.location);<NEW_LINE>// compute normalized image coordinate for track in left and right image<NEW_LINE>leftCM.pixelToNorm.compute(l.pixel.x, l.pixel.y, stereo.leftObs);<NEW_LINE>rightCM.pixelToNorm.compute(r.pixel.x, r.pixel.y, stereo.rightObs);<NEW_LINE>// TODO Could this transform be done just once?<NEW_LINE>}<NEW_LINE>// Robustly estimate left camera motion<NEW_LINE>if (!matcher.process(listStereo2D3D.toList()))<NEW_LINE>return false;<NEW_LINE>if (modelRefiner != null) {<NEW_LINE>modelRefiner.fitModel(matcher.getMatchSet(), matcher.getModelParameters(), previous_to_current);<NEW_LINE>} else {<NEW_LINE>previous_to_current.setTo(matcher.getModelParameters());<NEW_LINE>}<NEW_LINE>// Convert the found transforms back to world<NEW_LINE>previous_to_current.invert(current_to_previous);<NEW_LINE>current_to_previous.concat(previousLeft.frame_to_world, currentLeft.frame_to_world);<NEW_LINE>right_to_left.concat(currentLeft.frame_to_world, currentRight.frame_to_world);<NEW_LINE>return true;<NEW_LINE>} | l = candidates.get(candidateIdx); |
779,780 | private void addRelated(Object parent, Map<String, Object> pageModel) {<NEW_LINE>final Node<?> node = _relationships.getRelationships(parent);<NEW_LINE>Map<String, ResourceSchema> relatedResources;<NEW_LINE>Map<String, NamedDataSchema> relatedSchemas;<NEW_LINE>synchronized (this) {<NEW_LINE>relatedResources = _relatedResourceCache.get(parent);<NEW_LINE>if (relatedResources == null) {<NEW_LINE>relatedResources = new HashMap<>();<NEW_LINE>final Iterator<Node<ResourceSchema>> resourcesItr = node.getAdjacency(ResourceSchema.class).iterator();<NEW_LINE>while (resourcesItr.hasNext()) {<NEW_LINE>final ResourceSchema currResource = (ResourceSchema) resourcesItr.next().getObject();<NEW_LINE>relatedResources.put(currResource.getName(), currResource);<NEW_LINE>}<NEW_LINE>_relatedResourceCache.put(parent, relatedResources);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (relatedSchemas == null) {<NEW_LINE>relatedSchemas = new HashMap<>();<NEW_LINE>final Iterator<Node<NamedDataSchema>> schemaItr = node.getAdjacency(NamedDataSchema.class).iterator();<NEW_LINE>while (schemaItr.hasNext()) {<NEW_LINE>final NamedDataSchema currResource = (NamedDataSchema) schemaItr.next().getObject();<NEW_LINE>relatedSchemas.put(currResource.getFullName(), currResource);<NEW_LINE>}<NEW_LINE>_relatedSchemaCache.put(parent, relatedSchemas);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>pageModel.put("relatedResources", relatedResources);<NEW_LINE>pageModel.put("relatedSchemas", relatedSchemas);<NEW_LINE>} | relatedSchemas = _relatedSchemaCache.get(parent); |
1,191,834 | public void draw(Batch batch, float parentAlpha) {<NEW_LINE>updateImage();<NEW_LINE>Color fontColor;<NEW_LINE>if (isDisabled() && style.disabledFontColor != null)<NEW_LINE>fontColor = style.disabledFontColor;<NEW_LINE>else if (isPressed() && style.downFontColor != null)<NEW_LINE>fontColor = style.downFontColor;<NEW_LINE>else if (isChecked() && style.checkedFontColor != null)<NEW_LINE>fontColor = (isOver() && style.checkedOverFontColor != null) ? style.checkedOverFontColor : style.checkedFontColor;<NEW_LINE>else if (isOver() && style.overFontColor != null)<NEW_LINE>fontColor = style.overFontColor;<NEW_LINE>else<NEW_LINE>fontColor = style.fontColor;<NEW_LINE>if (fontColor != null)<NEW_LINE>label.getStyle().fontColor = fontColor;<NEW_LINE>super.draw(batch, parentAlpha);<NEW_LINE>if (focusBorderEnabled && drawBorder && style.focusBorder != null)<NEW_LINE>style.focusBorder.draw(batch, getX(), getY(), <MASK><NEW_LINE>} | getWidth(), getHeight()); |
359,192 | public List<List<String>> accountsMerge(List<List<String>> accounts) {<NEW_LINE>int n = accounts.size();<NEW_LINE>p = new int[n];<NEW_LINE>for (int i = 0; i < n; ++i) {<NEW_LINE>p[i] = i;<NEW_LINE>}<NEW_LINE>Map<String, Integer> emailId = new HashMap<>();<NEW_LINE>for (int i = 0; i < n; ++i) {<NEW_LINE>List<String> account = accounts.get(i);<NEW_LINE>String name = account.get(0);<NEW_LINE>for (int j = 1; j < account.size(); ++j) {<NEW_LINE>String email = account.get(j);<NEW_LINE>if (emailId.containsKey(email)) {<NEW_LINE>p[find(i)] = find(emailId.get(email));<NEW_LINE>} else {<NEW_LINE>emailId.put(email, i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<Integer, Set<String>> mp = new HashMap<>();<NEW_LINE>for (int i = 0; i < n; ++i) {<NEW_LINE>List<String> account = accounts.get(i);<NEW_LINE>for (int j = 1; j < account.size(); ++j) {<NEW_LINE>String email = account.get(j);<NEW_LINE>mp.computeIfAbsent(find(i), k -> new HashSet<>()).add(email);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<List<String>> res = new ArrayList<>();<NEW_LINE>for (Map.Entry<Integer, Set<String>> entry : mp.entrySet()) {<NEW_LINE>List<String> <MASK><NEW_LINE>t.addAll(entry.getValue());<NEW_LINE>Collections.sort(t);<NEW_LINE>t.add(0, accounts.get(entry.getKey()).get(0));<NEW_LINE>res.add(t);<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>} | t = new LinkedList<>(); |
1,692,806 | public static ListDesignResponse unmarshall(ListDesignResponse listDesignResponse, UnmarshallerContext _ctx) {<NEW_LINE>listDesignResponse.setRequestId(_ctx.stringValue("ListDesignResponse.RequestId"));<NEW_LINE>listDesignResponse.setSuccess(_ctx.booleanValue("ListDesignResponse.Success"));<NEW_LINE>listDesignResponse.setVersion(_ctx.stringValue("ListDesignResponse.Version"));<NEW_LINE>listDesignResponse.setEnd(_ctx.integerValue("ListDesignResponse.End"));<NEW_LINE>listDesignResponse.setPageNumber(_ctx.integerValue("ListDesignResponse.PageNumber"));<NEW_LINE>listDesignResponse.setDesignVersion<MASK><NEW_LINE>List<Designs> data = new ArrayList<Designs>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListDesignResponse.Data.Length"); i++) {<NEW_LINE>Designs designs = new Designs();<NEW_LINE>designs.setGoodsId(_ctx.stringValue("ListDesignResponse.Data[" + i + "].GoodsId"));<NEW_LINE>List<TemplatesItem> templates = new ArrayList<TemplatesItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListDesignResponse.Data[" + i + "].Templates.Length"); j++) {<NEW_LINE>TemplatesItem templatesItem = new TemplatesItem();<NEW_LINE>templatesItem.setTemplateId(_ctx.stringValue("ListDesignResponse.Data[" + i + "].Templates[" + j + "].TemplateId"));<NEW_LINE>templatesItem.setPreviewUrl(_ctx.stringValue("ListDesignResponse.Data[" + i + "].Templates[" + j + "].PreviewUrl"));<NEW_LINE>templates.add(templatesItem);<NEW_LINE>}<NEW_LINE>designs.setTemplates(templates);<NEW_LINE>data.add(designs);<NEW_LINE>}<NEW_LINE>listDesignResponse.setData(data);<NEW_LINE>return listDesignResponse;<NEW_LINE>} | (_ctx.stringValue("ListDesignResponse.DesignVersion")); |
45,264 | protected void onSizeChanged(int w, int h, int oldw, int oldh) {<NEW_LINE>super.onSizeChanged(w, h, oldw, oldh);<NEW_LINE>if (w != oldw || h != oldh) {<NEW_LINE>getGlobalLayoutListener().checkUpdateDimension(w, h, false, false);<NEW_LINE>if (mEngineContext != null) {<NEW_LINE>HippyModuleManager manager = mEngineContext.getModuleManager();<NEW_LINE>if (manager != null) {<NEW_LINE>HippyMap hippyMap = new HippyMap();<NEW_LINE>hippyMap.pushDouble("width", PixelUtil.px2dp(w));<NEW_LINE>hippyMap.pushDouble("height"<MASK><NEW_LINE>hippyMap.pushDouble("oldWidth", PixelUtil.px2dp(oldw));<NEW_LINE>hippyMap.pushDouble("oldHeight", PixelUtil.px2dp(oldh));<NEW_LINE>manager.getJavaScriptModule(EventDispatcher.class).receiveNativeEvent("onSizeChanged", hippyMap);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mSizeChangListener != null) {<NEW_LINE>mSizeChangListener.onSizeChanged(this, w, h, oldw, oldh);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | , PixelUtil.px2dp(h)); |
1,126,192 | private void muxTrack(MKVMuxerTrack track) {<NEW_LINE>try {<NEW_LINE>track.trackStart = sink.position();<NEW_LINE>EbmlMaster trackEntryElem = (EbmlMaster) createByType(TrackEntry);<NEW_LINE>createLong(trackEntryElem, TrackNumber, track.trackNo);<NEW_LINE>createLong(trackEntryElem, TrackUID, track.trackNo);<NEW_LINE>if (MKVMuxerTrackType.VIDEO.equals(track.type)) {<NEW_LINE>createLong(trackEntryElem, TrackType, (byte) 0x01);<NEW_LINE>createString(trackEntryElem, Name, "Track " + track.trackNo + " Video");<NEW_LINE>createString(<MASK><NEW_LINE>// createChild(trackEntryElem, CodecPrivate, codecMeta.getCodecPrivate());<NEW_LINE>// VideoCodecMeta vcm = (VideoCodecMeta) codecMeta;<NEW_LINE>EbmlMaster trackVideoElem = (EbmlMaster) createByType(Video);<NEW_LINE>createLong(trackVideoElem, PixelWidth, track.videoMeta.getSize().getWidth());<NEW_LINE>createLong(trackVideoElem, PixelHeight, track.videoMeta.getSize().getHeight());<NEW_LINE>trackEntryElem.add(trackVideoElem);<NEW_LINE>} else {<NEW_LINE>createLong(trackEntryElem, TrackType, (byte) 0x02);<NEW_LINE>createString(trackEntryElem, Name, "Track " + track.trackNo + " Audio");<NEW_LINE>createString(trackEntryElem, CodecID, track.codecId);<NEW_LINE>// createChild(trackEntryElem, CodecPrivate, codecMeta.getCodecPrivate());<NEW_LINE>}<NEW_LINE>mkvTracks.add(trackEntryElem);<NEW_LINE>} catch (IOException ioex) {<NEW_LINE>throw new RuntimeException(ioex);<NEW_LINE>}<NEW_LINE>} | trackEntryElem, CodecID, track.codecId); |
1,094,772 | protected void init() {<NEW_LINE>checkArgument(period >= 1 && period <= 9, "Period must be in the range 1-9");<NEW_LINE><MASK><NEW_LINE>ImmutableSet.Builder<String> domainsNonexistentBuilder = new ImmutableSet.Builder<>();<NEW_LINE>ImmutableSet.Builder<String> domainsDeletingBuilder = new ImmutableSet.Builder<>();<NEW_LINE>ImmutableMultimap.Builder<String, StatusValue> domainsWithDisallowedStatusesBuilder = new ImmutableMultimap.Builder<>();<NEW_LINE>ImmutableMap.Builder<String, DateTime> domainsExpiringTooSoonBuilder = new ImmutableMap.Builder<>();<NEW_LINE>for (String domainName : mainParameters) {<NEW_LINE>if (ForeignKeyIndex.load(DomainBase.class, domainName, START_OF_TIME) == null) {<NEW_LINE>domainsNonexistentBuilder.add(domainName);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Optional<DomainBase> domain = loadByForeignKey(DomainBase.class, domainName, now);<NEW_LINE>if (!domain.isPresent() || domain.get().getStatusValues().contains(StatusValue.PENDING_DELETE)) {<NEW_LINE>domainsDeletingBuilder.add(domainName);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>domainsWithDisallowedStatusesBuilder.putAll(domainName, Sets.intersection(domain.get().getStatusValues(), DISALLOWED_STATUSES));<NEW_LINE>if (isBeforeOrAt(leapSafeSubtractYears(domain.get().getRegistrationExpirationTime(), period), now)) {<NEW_LINE>domainsExpiringTooSoonBuilder.put(domainName, domain.get().getRegistrationExpirationTime());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ImmutableSet<String> domainsNonexistent = domainsNonexistentBuilder.build();<NEW_LINE>ImmutableSet<String> domainsDeleting = domainsDeletingBuilder.build();<NEW_LINE>ImmutableMultimap<String, StatusValue> domainsWithDisallowedStatuses = domainsWithDisallowedStatusesBuilder.build();<NEW_LINE>ImmutableMap<String, DateTime> domainsExpiringTooSoon = domainsExpiringTooSoonBuilder.build();<NEW_LINE>boolean foundInvalidDomains = !(domainsNonexistent.isEmpty() && domainsDeleting.isEmpty() && domainsWithDisallowedStatuses.isEmpty() && domainsExpiringTooSoon.isEmpty());<NEW_LINE>if (foundInvalidDomains) {<NEW_LINE>System.err.print("Found domains that cannot be unrenewed for the following reasons:\n\n");<NEW_LINE>}<NEW_LINE>if (!domainsNonexistent.isEmpty()) {<NEW_LINE>System.err.printf("Domains that don't exist: %s\n\n", domainsNonexistent);<NEW_LINE>}<NEW_LINE>if (!domainsDeleting.isEmpty()) {<NEW_LINE>System.err.printf("Domains that are deleted or pending delete: %s\n\n", domainsDeleting);<NEW_LINE>}<NEW_LINE>if (!domainsWithDisallowedStatuses.isEmpty()) {<NEW_LINE>System.err.printf("Domains with disallowed statuses: %s\n\n", domainsWithDisallowedStatuses);<NEW_LINE>}<NEW_LINE>if (!domainsExpiringTooSoon.isEmpty()) {<NEW_LINE>System.err.printf("Domains expiring too soon: %s\n\n", domainsExpiringTooSoon);<NEW_LINE>}<NEW_LINE>checkArgument(!foundInvalidDomains, "Aborting because some domains cannot be unrewed");<NEW_LINE>} | DateTime now = clock.nowUtc(); |
102,511 | final DescribeFargateProfileResult executeDescribeFargateProfile(DescribeFargateProfileRequest describeFargateProfileRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeFargateProfileRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeFargateProfileRequest> request = null;<NEW_LINE>Response<DescribeFargateProfileResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeFargateProfileRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeFargateProfileRequest));<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, "EKS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeFargateProfile");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeFargateProfileResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeFargateProfileResultJsonUnmarshaller());<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,819,727 | public static ListRdsDBInstancesResponse unmarshall(ListRdsDBInstancesResponse listRdsDBInstancesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listRdsDBInstancesResponse.setRequestId(_ctx.stringValue("ListRdsDBInstancesResponse.RequestId"));<NEW_LINE>listRdsDBInstancesResponse.setTotalCount(_ctx.integerValue("ListRdsDBInstancesResponse.TotalCount"));<NEW_LINE>listRdsDBInstancesResponse.setSuccess(_ctx.stringValue("ListRdsDBInstancesResponse.Success"));<NEW_LINE>List<DBInstance> rdsInstances = new ArrayList<DBInstance>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListRdsDBInstancesResponse.RdsInstances.Length"); i++) {<NEW_LINE>DBInstance dBInstance = new DBInstance();<NEW_LINE>dBInstance.setDBInstanceId(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].DBInstanceId"));<NEW_LINE>dBInstance.setDBInstanceDescription(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].DBInstanceDescription"));<NEW_LINE>dBInstance.setRegionId(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].RegionId"));<NEW_LINE>dBInstance.setDBInstanceType(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].DBInstanceType"));<NEW_LINE>dBInstance.setDBInstanceStatus(_ctx.stringValue<MASK><NEW_LINE>dBInstance.setEngine(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].Engine"));<NEW_LINE>dBInstance.setEngineVersion(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].EngineVersion"));<NEW_LINE>dBInstance.setDBInstanceNetType(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].DBInstanceNetType"));<NEW_LINE>dBInstance.setLockMode(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].LockMode"));<NEW_LINE>dBInstance.setInstanceNetworkType(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].InstanceNetworkType"));<NEW_LINE>dBInstance.setVpcCloudInstanceId(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].VpcCloudInstanceId"));<NEW_LINE>dBInstance.setVpcId(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].VpcId"));<NEW_LINE>dBInstance.setVSwitchId(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].VSwitchId"));<NEW_LINE>dBInstance.setZoneId(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].ZoneId"));<NEW_LINE>dBInstance.setMutriORsignle(_ctx.booleanValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].MutriORsignle"));<NEW_LINE>dBInstance.setResourceGroupId(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].ResourceGroupId"));<NEW_LINE>rdsInstances.add(dBInstance);<NEW_LINE>}<NEW_LINE>listRdsDBInstancesResponse.setRdsInstances(rdsInstances);<NEW_LINE>return listRdsDBInstancesResponse;<NEW_LINE>} | ("ListRdsDBInstancesResponse.RdsInstances[" + i + "].DBInstanceStatus")); |
1,474,070 | private BucketSet compare(BucketIdFactory factory, IdNode id, LiteralNode literal, String operator) {<NEW_LINE>String field = id.getField();<NEW_LINE>Object value = literal.getValue();<NEW_LINE>if (field == null) {<NEW_LINE>if (value instanceof String) {<NEW_LINE>String name = (String) value;<NEW_LINE>if ((operator.equals("=") && name.contains("*")) || (operator.equals("=~") && ((name.contains("*") || name.contains("?"))))) {<NEW_LINE>// no idea<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return new BucketSet(factory.getBucketId<MASK><NEW_LINE>}<NEW_LINE>} else if (field.equalsIgnoreCase("user")) {<NEW_LINE>if (value instanceof Long) {<NEW_LINE>return new BucketSet(new BucketId(factory.getLocationBitCount(), (Long) value));<NEW_LINE>}<NEW_LINE>} else if (field.equalsIgnoreCase("group")) {<NEW_LINE>if (value instanceof String) {<NEW_LINE>String name = (String) value;<NEW_LINE>if ((operator.equals("=") && name.contains("*")) || (operator.equals("=~") && ((name.contains("*") || name.contains("?"))))) {<NEW_LINE>// no idea<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return new BucketSet(new BucketId(factory.getLocationBitCount(), IdIdString.makeLocation(name)));<NEW_LINE>}<NEW_LINE>} else if (field.equalsIgnoreCase("bucket")) {<NEW_LINE>if (value instanceof Long) {<NEW_LINE>return new BucketSet(new BucketId((Long) value));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | (new DocumentId(name))); |
171,280 | public static // FIXME: Proxy could just pass the pk index here which is much faster.<NEW_LINE>long createRowWithPrimaryKey(Table table, long primaryKeyColumnIndex, @Nullable Object primaryKeyValue) {<NEW_LINE>RealmFieldType type = table.getColumnType(primaryKeyColumnIndex);<NEW_LINE>final OsSharedRealm sharedRealm = table.getSharedRealm();<NEW_LINE>if (type == RealmFieldType.STRING) {<NEW_LINE>if (primaryKeyValue != null && !(primaryKeyValue instanceof String)) {<NEW_LINE>throw new IllegalArgumentException("Primary key value is not a String: " + primaryKeyValue);<NEW_LINE>}<NEW_LINE>return nativeCreateRowWithStringPrimaryKey(sharedRealm.getNativePtr(), table.getNativePtr(), primaryKeyColumnIndex, (String) primaryKeyValue);<NEW_LINE>} else if (type == RealmFieldType.INTEGER) {<NEW_LINE>long value = primaryKeyValue == null ? 0 : Long.parseLong(primaryKeyValue.toString());<NEW_LINE>return nativeCreateRowWithLongPrimaryKey(sharedRealm.getNativePtr(), table.getNativePtr(), primaryKeyColumnIndex, value, primaryKeyValue == null);<NEW_LINE>} else if (type == RealmFieldType.OBJECT_ID) {<NEW_LINE>if (primaryKeyValue != null && !(primaryKeyValue instanceof ObjectId)) {<NEW_LINE>throw new IllegalArgumentException("Primary key value is not an ObjectId: " + primaryKeyValue);<NEW_LINE>}<NEW_LINE>String objectIdValue = primaryKeyValue == null ? null : primaryKeyValue.toString();<NEW_LINE>return nativeCreateRowWithObjectIdPrimaryKey(sharedRealm.getNativePtr(), table.getNativePtr(), primaryKeyColumnIndex, objectIdValue);<NEW_LINE>} else if (type == RealmFieldType.UUID) {<NEW_LINE>if (primaryKeyValue != null && !(primaryKeyValue instanceof UUID)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>String uuidValue = primaryKeyValue == null ? null : primaryKeyValue.toString();<NEW_LINE>return nativeCreateRowWithUUIDPrimaryKey(sharedRealm.getNativePtr(), table.getNativePtr(), primaryKeyColumnIndex, uuidValue);<NEW_LINE>} else {<NEW_LINE>throw new RealmException("Cannot check for duplicate rows for unsupported primary key type: " + type);<NEW_LINE>}<NEW_LINE>} | throw new IllegalArgumentException("Primary key value is not an UUID: " + primaryKeyValue); |
1,257,656 | public static RequestHeaders toArmeria(ChannelHandlerContext ctx, HttpRequest in, ServerConfig cfg, String scheme) throws URISyntaxException {<NEW_LINE>final String path = in.uri();<NEW_LINE>if (path.charAt(0) != '/' && !"*".equals(path)) {<NEW_LINE>// We support only origin form and asterisk form.<NEW_LINE>throw new URISyntaxException(path, "neither origin form nor asterisk form");<NEW_LINE>}<NEW_LINE>final io.netty.handler.codec.http.HttpHeaders inHeaders = in.headers();<NEW_LINE>final RequestHeadersBuilder out = RequestHeaders.builder();<NEW_LINE>out.sizeHint(inHeaders.size());<NEW_LINE>out.method(HttpMethod.valueOf(in.method().name())).path<MASK><NEW_LINE>// Add the HTTP headers which have not been consumed above<NEW_LINE>toArmeria(inHeaders, out);<NEW_LINE>if (!out.contains(HttpHeaderNames.HOST)) {<NEW_LINE>// The client violates the spec that the request headers must contain a Host header.<NEW_LINE>// But we just add Host header to allow the request.<NEW_LINE>// https://datatracker.ietf.org/doc/html/rfc7230#section-5.4<NEW_LINE>final String defaultHostname = cfg.defaultVirtualHost().defaultHostname();<NEW_LINE>final int port = ((InetSocketAddress) ctx.channel().localAddress()).getPort();<NEW_LINE>out.add(HttpHeaderNames.HOST, defaultHostname + ':' + port);<NEW_LINE>}<NEW_LINE>return out.build();<NEW_LINE>} | (path).scheme(scheme); |
1,486,101 | // -------------------------------------------------------------------------<NEW_LINE>@Override<NEW_LINE>public Trade parseTrade(FpmlDocument document, XmlElement tradeEl) {<NEW_LINE>// supported elements:<NEW_LINE>// 'payerPartyReference'<NEW_LINE>// 'receiverPartyReference'<NEW_LINE>// 'startDate'<NEW_LINE>// 'maturityDate'<NEW_LINE>// 'principal'<NEW_LINE>// 'fixedRate'<NEW_LINE>// 'dayCountFraction'<NEW_LINE>// ignored elements:<NEW_LINE>// 'payerAccountReference?'<NEW_LINE>// 'receiverAccountReference?'<NEW_LINE>// 'interest?'<NEW_LINE>// rejected elements:<NEW_LINE>// 'features?'<NEW_LINE>// 'payment*'<NEW_LINE>TradeInfoBuilder tradeInfoBuilder = document.parseTradeInfo(tradeEl);<NEW_LINE>XmlElement termEl = tradeEl.getChild("termDeposit");<NEW_LINE>document.validateNotPresent(termEl, "features");<NEW_LINE>document.validateNotPresent(termEl, "payment");<NEW_LINE>TermDeposit.Builder termBuilder = TermDeposit.builder();<NEW_LINE>// pay/receive and counterparty<NEW_LINE>PayReceive payReceive = document.parsePayerReceiver(termEl, tradeInfoBuilder);<NEW_LINE>termBuilder.buySell(BuySell.ofBuy(payReceive.isPay()));<NEW_LINE>// start date<NEW_LINE>termBuilder.startDate(document.parseDate(termEl.getChild("startDate")));<NEW_LINE>// maturity date<NEW_LINE>termBuilder.endDate(document.parseDate(termEl.getChild("maturityDate")));<NEW_LINE>// principal<NEW_LINE>CurrencyAmount principal = document.parseCurrencyAmount<MASK><NEW_LINE>termBuilder.currency(principal.getCurrency());<NEW_LINE>termBuilder.notional(principal.getAmount());<NEW_LINE>// fixed rate<NEW_LINE>termBuilder.rate(document.parseDecimal(termEl.getChild("fixedRate")));<NEW_LINE>// day count<NEW_LINE>termBuilder.dayCount(document.parseDayCountFraction(termEl.getChild("dayCountFraction")));<NEW_LINE>return TermDepositTrade.builder().info(tradeInfoBuilder.build()).product(termBuilder.build()).build();<NEW_LINE>} | (termEl.getChild("principal")); |
299,056 | public void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception {<NEW_LINE>if (args.length < 1) {<NEW_LINE>throw new NotEnoughArgumentsException();<NEW_LINE>}<NEW_LINE>String name;<NEW_LINE>try {<NEW_LINE>final User user = getPlayer(server, args, 0, true, true);<NEW_LINE>name = user.getName();<NEW_LINE>ess.getServer().getBanList(BanList.Type.NAME).pardon(name);<NEW_LINE>} catch (final PlayerNotFoundException e) {<NEW_LINE>final OfflinePlayer player = server.getOfflinePlayer(args[0]);<NEW_LINE>name = player.getName();<NEW_LINE>if (!player.isBanned()) {<NEW_LINE>throw new Exception(tl("playerNeverOnServer", args[0]));<NEW_LINE>}<NEW_LINE>ess.getServer().getBanList(BanList.Type.NAME).pardon(name);<NEW_LINE>}<NEW_LINE>final String senderDisplayName = sender.isPlayer() ? sender.getPlayer()<MASK><NEW_LINE>server.getLogger().log(Level.INFO, tl("playerUnbanned", senderDisplayName, name));<NEW_LINE>ess.broadcastMessage("essentials.ban.notify", tl("playerUnbanned", senderDisplayName, name));<NEW_LINE>} | .getDisplayName() : Console.DISPLAY_NAME; |
1,714,638 | public static void nv21ToBoof(byte[] data, int width, int height, ImageBase output) {<NEW_LINE>if (output instanceof Planar) {<NEW_LINE>Planar pl = (Planar) output;<NEW_LINE>if (pl.getBandType() == GrayU8.class) {<NEW_LINE>ConvertNV21.nv21TPlanarRgb_U8(<MASK><NEW_LINE>} else if (pl.getBandType() == GrayF32.class) {<NEW_LINE>ConvertNV21.nv21ToPlanarRgb_F32(data, width, height, pl);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unsupported output band format");<NEW_LINE>}<NEW_LINE>} else if (output instanceof ImageGray) {<NEW_LINE>if (output.getClass() == GrayU8.class) {<NEW_LINE>nv21ToGray(data, width, height, (GrayU8) output);<NEW_LINE>} else if (output.getClass() == GrayF32.class) {<NEW_LINE>nv21ToGray(data, width, height, (GrayF32) output);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unsupported output type");<NEW_LINE>}<NEW_LINE>} else if (output instanceof ImageInterleaved) {<NEW_LINE>if (output.getClass() == InterleavedU8.class) {<NEW_LINE>ConvertNV21.nv21ToInterleaved(data, width, height, (InterleavedU8) output);<NEW_LINE>} else if (output.getClass() == InterleavedF32.class) {<NEW_LINE>ConvertNV21.nv21ToInterleaved(data, width, height, (InterleavedF32) output);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unsupported output type");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Boofcv image type not yet supported");<NEW_LINE>}<NEW_LINE>} | data, width, height, pl); |
884,178 | AuthResponseMessage makeAuthInitiate(AuthInitiateMessage initiate, ECKey key) {<NEW_LINE>initiatorNonce = initiate.nonce;<NEW_LINE>remotePublicKey = initiate.publicKey;<NEW_LINE>BigInteger secretScalar = remotePublicKey.multiply(key.getPrivKey()).normalize().getXCoord().toBigInteger();<NEW_LINE>byte[] token = ByteUtil.bigIntegerToBytes(secretScalar, NONCE_SIZE);<NEW_LINE>byte[] signed = xor(token, initiatorNonce);<NEW_LINE>ECKey ephemeral = Secp256k1.getInstance().recoverFromSignature(recIdFromSignatureV(initiate.getSignature().getV()), initiate.<MASK><NEW_LINE>if (ephemeral == null) {<NEW_LINE>throw new RuntimeException("failed to recover signatue from message");<NEW_LINE>}<NEW_LINE>remoteEphemeralKey = ephemeral.getPubKeyPoint();<NEW_LINE>AuthResponseMessage response = new AuthResponseMessage();<NEW_LINE>response.isTokenUsed = initiate.isTokenUsed;<NEW_LINE>response.ephemeralPublicKey = ephemeralKey.getPubKeyPoint();<NEW_LINE>response.nonce = responderNonce;<NEW_LINE>return response;<NEW_LINE>} | getSignature(), signed, false); |
1,017,945 | public void marshall(CreateBranchRequest createBranchRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createBranchRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createBranchRequest.getAppId(), APPID_BINDING);<NEW_LINE>protocolMarshaller.marshall(createBranchRequest.getBranchName(), BRANCHNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createBranchRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createBranchRequest.getStage(), STAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createBranchRequest.getFramework(), FRAMEWORK_BINDING);<NEW_LINE>protocolMarshaller.marshall(createBranchRequest.getEnableNotification(), ENABLENOTIFICATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createBranchRequest.getEnableAutoBuild(), ENABLEAUTOBUILD_BINDING);<NEW_LINE>protocolMarshaller.marshall(createBranchRequest.getEnvironmentVariables(), ENVIRONMENTVARIABLES_BINDING);<NEW_LINE>protocolMarshaller.marshall(createBranchRequest.getBasicAuthCredentials(), BASICAUTHCREDENTIALS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createBranchRequest.getEnableBasicAuth(), ENABLEBASICAUTH_BINDING);<NEW_LINE>protocolMarshaller.marshall(createBranchRequest.getEnablePerformanceMode(), ENABLEPERFORMANCEMODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createBranchRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createBranchRequest.getBuildSpec(), BUILDSPEC_BINDING);<NEW_LINE>protocolMarshaller.marshall(createBranchRequest.getTtl(), TTL_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createBranchRequest.getEnablePullRequestPreview(), ENABLEPULLREQUESTPREVIEW_BINDING);<NEW_LINE>protocolMarshaller.marshall(createBranchRequest.getPullRequestEnvironmentName(), PULLREQUESTENVIRONMENTNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createBranchRequest.getBackendEnvironmentArn(), BACKENDENVIRONMENTARN_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | createBranchRequest.getDisplayName(), DISPLAYNAME_BINDING); |
1,284,774 | public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception {<NEW_LINE>List<String> tservers;<NEW_LINE>ManagerMonitorInfo stats;<NEW_LINE>ManagerClientService.Iface client = null;<NEW_LINE>ClientContext context = shellState.getContext();<NEW_LINE>while (true) {<NEW_LINE>try {<NEW_LINE>client = ManagerClient.getConnectionWithRetry(context);<NEW_LINE>stats = client.getManagerStats(TraceUtil.traceInfo(), context.rpcCreds());<NEW_LINE>break;<NEW_LINE>} catch (ThriftNotActiveServiceException e) {<NEW_LINE>// Let it loop, fetching a new location<NEW_LINE>sleepUninterruptibly(100, TimeUnit.MILLISECONDS);<NEW_LINE>} finally {<NEW_LINE>if (client != null)<NEW_LINE>ManagerClient.close(client, context);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final boolean paginate = !cl.hasOption(disablePaginationOpt.getOpt());<NEW_LINE>if (cl.hasOption(tserverOption.getOpt())) {<NEW_LINE><MASK><NEW_LINE>tservers.add(cl.getOptionValue(tserverOption.getOpt()));<NEW_LINE>} else {<NEW_LINE>tservers = Collections.emptyList();<NEW_LINE>}<NEW_LINE>shellState.printLines(new BulkImportListIterator(tservers, stats), paginate);<NEW_LINE>return 0;<NEW_LINE>} | tservers = new ArrayList<>(); |
126,065 | /* (non-Javadoc)<NEW_LINE>* @see com.impetus.client.cassandra.index.InvertedIndexHandlerBase#deleteColumn(java.lang.String, java.lang.String, byte[], java.lang.String, org.apache.cassandra.thrift.ConsistencyLevel, byte[])<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>protected void deleteColumn(String indexColumnFamily, String rowKey, byte[] superColumnName, String persistenceUnit, ConsistencyLevel consistencyLevel, byte[] columnName) {<NEW_LINE>ColumnPath cp = new ColumnPath(indexColumnFamily);<NEW_LINE>cp.setSuper_column(superColumnName);<NEW_LINE>Connection conn = thriftClient.getConnection();<NEW_LINE>try {<NEW_LINE>ColumnOrSuperColumn cosc;<NEW_LINE>try {<NEW_LINE>cosc = conn.getClient().get(ByteBuffer.wrap(rowKey.getBytes()), cp, consistencyLevel);<NEW_LINE>} catch (NotFoundException e) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SuperColumn thriftSuperColumn = ThriftDataResultHelper.transformThriftResult(cosc, ColumnFamilyType.SUPER_COLUMN, null);<NEW_LINE>if (thriftSuperColumn != null && thriftSuperColumn.getColumns() != null && thriftSuperColumn.getColumns().size() > 1) {<NEW_LINE>cp.setColumn(columnName);<NEW_LINE>}<NEW_LINE>conn.getClient().remove(ByteBuffer.wrap(rowKey.getBytes()), cp, generator.getTimestamp(), consistencyLevel);<NEW_LINE>} catch (InvalidRequestException e) {<NEW_LINE>log.error("Unable to delete data from inverted index, Caused by: .", e);<NEW_LINE>throw new IndexingException(e);<NEW_LINE>} catch (UnavailableException e) {<NEW_LINE>log.error("Unable to delete data from inverted index, Caused by: .", e);<NEW_LINE>throw new IndexingException(e);<NEW_LINE>} catch (TimedOutException e) {<NEW_LINE>log.error("Unable to delete data from inverted index, Caused by: .", e);<NEW_LINE>throw new IndexingException(e);<NEW_LINE>} catch (TException e) {<NEW_LINE><MASK><NEW_LINE>throw new IndexingException(e);<NEW_LINE>} finally {<NEW_LINE>thriftClient.releaseConnection(conn);<NEW_LINE>}<NEW_LINE>} | log.error("Unable to delete data from inverted index, Caused by: .", e); |
1,349,841 | private Optional<EventStreamInfo> createEventStreamInfo(Model model, OperationShape operation, StructureShape structure, MemberShape member) {<NEW_LINE>Shape eventStreamTarget = model.expectShape(member.getTarget());<NEW_LINE>// Compute the events of the event stream.<NEW_LINE>Map<String, StructureShape> events = new HashMap<>();<NEW_LINE>if (eventStreamTarget.asUnionShape().isPresent()) {<NEW_LINE>for (MemberShape unionMember : eventStreamTarget.asUnionShape().get().getAllMembers().values()) {<NEW_LINE>model.getShape(unionMember.getTarget()).flatMap(Shape::asStructureShape).ifPresent(struct -> {<NEW_LINE>events.put(unionMember.getMemberName(), struct);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} else if (eventStreamTarget.asStructureShape().isPresent()) {<NEW_LINE>events.put(member.getMemberName(), eventStreamTarget.<MASK><NEW_LINE>} else {<NEW_LINE>// If the event target is an invalid type, then we can't create the indexed result.<NEW_LINE>LOGGER.severe(() -> String.format("Skipping event stream info for %s because the %s member target %s is not a structure or union", operation.getId(), member.getMemberName(), member.getTarget()));<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>Map<String, MemberShape> initialMembers = new HashMap<>();<NEW_LINE>Map<String, Shape> initialTargets = new HashMap<>();<NEW_LINE>for (MemberShape structureMember : structure.getAllMembers().values()) {<NEW_LINE>if (!structureMember.getMemberName().equals(member.getMemberName())) {<NEW_LINE>model.getShape(structureMember.getTarget()).ifPresent(shapeTarget -> {<NEW_LINE>initialMembers.put(structureMember.getMemberName(), structureMember);<NEW_LINE>initialTargets.put(structureMember.getMemberName(), shapeTarget);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Optional.of(new EventStreamInfo(operation, eventStreamTarget.expectTrait(StreamingTrait.class), structure, member, eventStreamTarget, initialMembers, initialTargets, events));<NEW_LINE>} | asStructureShape().get()); |
622,658 | public void marshall(UpdateClusterRequest updateClusterRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updateClusterRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(updateClusterRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateClusterRequest.getPreferredMaintenanceWindow(), PREFERREDMAINTENANCEWINDOW_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateClusterRequest.getNotificationTopicArn(), NOTIFICATIONTOPICARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateClusterRequest.getNotificationTopicStatus(), NOTIFICATIONTOPICSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateClusterRequest.getParameterGroupName(), PARAMETERGROUPNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateClusterRequest.getSecurityGroupIds(), SECURITYGROUPIDS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | updateClusterRequest.getClusterName(), CLUSTERNAME_BINDING); |
1,764,050 | public void updateStausIfNeededWhenVoiding(@NonNull final I_C_Flatrate_Term term) {<NEW_LINE>final OrderId <MASK><NEW_LINE>if (orderId == null || !X_C_Flatrate_Term.CONTRACTSTATUS_Voided.equals(term.getContractStatus())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final OrderId parentOrderId = contractOrderService.retrieveLinkedFollowUpContractOrder(orderId);<NEW_LINE>final ImmutableSet<OrderId> orderIds = parentOrderId == null ? ImmutableSet.of(orderId) : ImmutableSet.of(orderId, parentOrderId);<NEW_LINE>final List<I_C_Order> orders = orderDAO.getByIds(orderIds, I_C_Order.class);<NEW_LINE>final I_C_Order contractOrder = orders.get(0);<NEW_LINE>setContractStatusForCurrentOrder(contractOrder, term);<NEW_LINE>setContractStatusForParentOrderIfNeeded(orders);<NEW_LINE>} | orderId = contractOrderService.getContractOrderId(term); |
1,679,929 | public void pasteClipboard() {<NEW_LINE>// FIXME Maybe move editableProperty to the model..<NEW_LINE>List<TablePosition> selectedCells = cellsView.getSelectionModel().getSelectedCells();<NEW_LINE>if (!isEditable() || selectedCells.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>checkFormat();<NEW_LINE>final Clipboard clipboard = Clipboard.getSystemClipboard();<NEW_LINE>if (clipboard.getContent(fmt) != null) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final ArrayList<ClipboardCell> list = (ArrayList<ClipboardCell>) clipboard.getContent(fmt);<NEW_LINE>if (list.size() == 1) {<NEW_LINE>pasteOneValue<MASK><NEW_LINE>} else if (selectedCells.size() > 1) {<NEW_LINE>pasteMixedValues(list);<NEW_LINE>} else {<NEW_LINE>pasteSeveralValues(list);<NEW_LINE>}<NEW_LINE>// To be improved<NEW_LINE>} else if (clipboard.hasString()) {<NEW_LINE>// final TablePosition<?,?> p =<NEW_LINE>// cellsView.getFocusModel().getFocusedCell();<NEW_LINE>//<NEW_LINE>// SpreadsheetCell stringCell =<NEW_LINE>// SpreadsheetCellType.STRING.createCell(0, 0, 1, 1,<NEW_LINE>// clipboard.getString());<NEW_LINE>// getGrid().getRows().get(p.getRow()).get(p.getColumn()).match(stringCell);<NEW_LINE>}<NEW_LINE>} | (list.get(0)); |
263,225 | protected String doIt() throws Exception {<NEW_LINE>// TODO Auto-generated method stub<NEW_LINE>log.info("Applying migrations scripts");<NEW_LINE>String sql = "select ad_migrationscript_id, script, name from ad_migrationscript where isApply = 'Y' and status = 'IP' order by name, created";<NEW_LINE>PreparedStatement pstmt = DB.prepareStatement(sql, this.get_TrxName());<NEW_LINE>ResultSet rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>byte[] scriptArray = rs.getBytes(2);<NEW_LINE>int seqID = rs.getInt(1);<NEW_LINE>boolean execOk = true;<NEW_LINE>try {<NEW_LINE>StringBuffer tmpSql = new StringBuffer();<NEW_LINE>tmpSql = new StringBuffer(new String(scriptArray, StandardCharsets.UTF_8));<NEW_LINE>if (tmpSql.length() > 0) {<NEW_LINE>log.info("Executing script " + rs.getString(3));<NEW_LINE>execOk = executeScript(tmpSql.toString(), rs.getString(3));<NEW_LINE>System.out.println();<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>execOk = false;<NEW_LINE>log.error("Script: " + rs.getString(3) + " - " + e.getMessage(), e);<NEW_LINE>} finally {<NEW_LINE>sql = "UPDATE ad_migrationscript SET status = ? , isApply = 'N' WHERE ad_migrationscript_id = ? ";<NEW_LINE>pstmt = DB.prepareStatement(<MASK><NEW_LINE>if (execOk) {<NEW_LINE>pstmt.setString(1, "CO");<NEW_LINE>pstmt.setInt(2, seqID);<NEW_LINE>} else {<NEW_LINE>pstmt.setString(1, "ER");<NEW_LINE>pstmt.setInt(2, seqID);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>pstmt.executeUpdate();<NEW_LINE>if (!execOk) {<NEW_LINE>pstmt.close();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.error("Script: " + rs.getString(3) + " - " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>rs.close();<NEW_LINE>pstmt.close();<NEW_LINE>return null;<NEW_LINE>} | sql, this.get_TrxName()); |
369,530 | public MethodInvocation parseAndApplyInvocation(JsonArray rpcCall, ApplicationConnection connection) {<NEW_LINE>ConnectorMap connectorMap = ConnectorMap.get(connection);<NEW_LINE>String connectorId = rpcCall.getString(0);<NEW_LINE>String interfaceName = rpcCall.getString(1);<NEW_LINE>String methodName = rpcCall.getString(2);<NEW_LINE>JsonArray parametersJson = rpcCall.getArray(3);<NEW_LINE>ServerConnector connector = connectorMap.getConnector(connectorId);<NEW_LINE>MethodInvocation invocation = new MethodInvocation(connectorId, interfaceName, methodName);<NEW_LINE>if (connector instanceof HasJavaScriptConnectorHelper) {<NEW_LINE>((HasJavaScriptConnectorHelper) connector).getJavascriptConnectorHelper(<MASK><NEW_LINE>} else {<NEW_LINE>if (connector == null) {<NEW_LINE>throw new IllegalStateException("Target connector (" + connector + ") not found for RCC to " + getSignature(invocation));<NEW_LINE>}<NEW_LINE>parseMethodParameters(invocation, parametersJson, connection);<NEW_LINE>getLogger().info("Server to client RPC call: " + invocation);<NEW_LINE>applyInvocation(invocation, connector);<NEW_LINE>}<NEW_LINE>return invocation;<NEW_LINE>} | ).invokeJsRpc(invocation, parametersJson); |
215,235 | int completeInternal(String buffer, int location, List<String> completions) {<NEW_LINE>String truncatedBuffer = buffer.substring(0, location);<NEW_LINE>String[] parsedBuffer = parseCommand(truncatedBuffer);<NEW_LINE>int argumentIndex = parsedBuffer.length - 1;<NEW_LINE>if (argumentIndex < 0 || !truncatedBuffer.endsWith(parsedBuffer[argumentIndex])) {<NEW_LINE>argumentIndex += 1;<NEW_LINE>}<NEW_LINE>// The argument we want to complete (only partially written, might even be empty)<NEW_LINE>String partialArgument = argumentIndex < parsedBuffer.<MASK><NEW_LINE>int argumentStart = location - partialArgument.length();<NEW_LINE>// The command name. Null if we're at the first argument<NEW_LINE>String command = argumentIndex == 0 ? null : parsedBuffer[0];<NEW_LINE>// The previous argument before it - used for context. Null if we're at the first argument<NEW_LINE>String previousArgument = argumentIndex <= 1 ? null : parsedBuffer[argumentIndex - 1];<NEW_LINE>// If it's obviously a file path (starts with something "file path like") - complete as a file<NEW_LINE>if (partialArgument.startsWith("./") || partialArgument.startsWith("~/") || partialArgument.startsWith("/")) {<NEW_LINE>int offset = filenameCompletor.complete(partialArgument, partialArgument.length(), completions);<NEW_LINE>if (offset >= 0) {<NEW_LINE>return argumentStart + offset;<NEW_LINE>}<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>// Complete based on flag data<NEW_LINE>completions.addAll(getCompletions(command, previousArgument, partialArgument));<NEW_LINE>return argumentStart;<NEW_LINE>} | length ? parsedBuffer[argumentIndex] : ""; |
1,155,671 | final DeleteContainerServiceResult executeDeleteContainerService(DeleteContainerServiceRequest deleteContainerServiceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteContainerServiceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteContainerServiceRequest> request = null;<NEW_LINE>Response<DeleteContainerServiceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteContainerServiceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteContainerServiceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Lightsail");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteContainerServiceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteContainerServiceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteContainerService"); |
172,519 | public final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> Record16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> into(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16) {<NEW_LINE>return (Record16) into(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13<MASK><NEW_LINE>} | , field14, field15, field16 }); |
1,373,086 | public Set<org.netbeans.modules.csl.api.Modifier> toModifiers() {<NEW_LINE>@SuppressWarnings("SetReplaceableByEnumSet")<NEW_LINE>Set<org.netbeans.modules.csl.api.Modifier> retval = new LinkedHashSet<>();<NEW_LINE>if ((isPublic() || isImplicitPublic()) && !isStatic()) {<NEW_LINE>retval.add(org.netbeans.modules.<MASK><NEW_LINE>}<NEW_LINE>if (isProtected()) {<NEW_LINE>retval.add(org.netbeans.modules.csl.api.Modifier.PROTECTED);<NEW_LINE>}<NEW_LINE>if (isPrivate()) {<NEW_LINE>retval.add(org.netbeans.modules.csl.api.Modifier.PRIVATE);<NEW_LINE>}<NEW_LINE>if (isStatic()) {<NEW_LINE>retval.add(org.netbeans.modules.csl.api.Modifier.STATIC);<NEW_LINE>}<NEW_LINE>if (isAbstract()) {<NEW_LINE>retval.add(org.netbeans.modules.csl.api.Modifier.ABSTRACT);<NEW_LINE>}<NEW_LINE>return retval;<NEW_LINE>} | csl.api.Modifier.PUBLIC); |
932,274 | public void trigger(CommandContext commandContext, PlanItemInstanceEntity planItemInstance) {<NEW_LINE>if (!PlanItemInstanceState.ACTIVE.equals(planItemInstance.getState())) {<NEW_LINE>throw new FlowableIllegalStateException("Can only trigger a plan item that is in the ACTIVE state");<NEW_LINE>}<NEW_LINE>if (planItemInstance.getReferenceId() == null) {<NEW_LINE>throw new FlowableIllegalStateException("Cannot trigger process task plan item instance : no reference id set");<NEW_LINE>}<NEW_LINE>if (!ReferenceTypes.PLAN_ITEM_CHILD_PROCESS.equals(planItemInstance.getReferenceType())) {<NEW_LINE>throw new FlowableException("Cannot trigger process task plan item instance : reference type '" + <MASK><NEW_LINE>}<NEW_LINE>// Need to be set before planning the complete operation<NEW_LINE>CmmnEngineConfiguration cmmnEngineConfiguration = CommandContextUtil.getCmmnEngineConfiguration(commandContext);<NEW_LINE>CaseInstanceEntity caseInstance = cmmnEngineConfiguration.getCaseInstanceEntityManager().findById(planItemInstance.getCaseInstanceId());<NEW_LINE>handleOutParameters(planItemInstance, caseInstance, cmmnEngineConfiguration.getProcessInstanceService());<NEW_LINE>// Triggering the plan item (as opposed to a regular complete) terminates the process instance<NEW_LINE>CommandContextUtil.getAgenda(commandContext).planCompletePlanItemInstanceOperation(planItemInstance);<NEW_LINE>deleteProcessInstance(commandContext, planItemInstance);<NEW_LINE>} | planItemInstance.getReferenceType() + "' not supported"); |
1,599,568 | protected void jbInit() throws Exception {<NEW_LINE>getContentPane().<MASK><NEW_LINE>JScrollPane dataPane = new JScrollPane();<NEW_LINE>getContentPane().add(dataPane, BorderLayout.CENTER);<NEW_LINE>dataPane.getViewport().add(dataTable, null);<NEW_LINE>AppsAction selectAllAction = new AppsAction(SELECT_ALL, KeyStroke.getKeyStroke(KeyEvent.VK_A, java.awt.event.InputEvent.ALT_MASK), null);<NEW_LINE>CButton selectAllButton = (CButton) selectAllAction.getButton();<NEW_LINE>selectAllButton.setMargin(new Insets(0, 10, 0, 10));<NEW_LINE>selectAllButton.setDefaultCapable(true);<NEW_LINE>selectAllButton.addActionListener(this);<NEW_LINE>confirmPanel.addButton(selectAllButton);<NEW_LINE>CPanel southPanel = new CPanel();<NEW_LINE>getContentPane().add(southPanel, BorderLayout.SOUTH);<NEW_LINE>BorderLayout southLayout = new BorderLayout();<NEW_LINE>southPanel.setLayout(southLayout);<NEW_LINE>southPanel.add(confirmPanel, BorderLayout.CENTER);<NEW_LINE>southPanel.add(statusBar, BorderLayout.SOUTH);<NEW_LINE>dataTable.setMultiSelection(true);<NEW_LINE>} | add(parameterPanel, BorderLayout.NORTH); |
234,769 | protected void registerNativeAlpn(SSLEngine engine) {<NEW_LINE>if (isNativeAlpnActive()) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "registerNativeAlpn entry " + engine);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String[] protocols = new String[] { h2, h1 };<NEW_LINE><MASK><NEW_LINE>nativeAlpnPut.invoke(params, (Object) protocols);<NEW_LINE>engine.setSSLParameters(params);<NEW_LINE>Method m = SSLParameters.class.getMethod("getApplicationProtocols");<NEW_LINE>} catch (InvocationTargetException ie) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "registerNativeAlpn exception: " + ie.getTargetException());<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "registerNativeAlpn exception: " + e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | SSLParameters params = engine.getSSLParameters(); |
53,002 | public void marshall(SolutionConfig solutionConfig, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (solutionConfig == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(solutionConfig.getEventValueThreshold(), EVENTVALUETHRESHOLD_BINDING);<NEW_LINE>protocolMarshaller.marshall(solutionConfig.getHpoConfig(), HPOCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(solutionConfig.getAlgorithmHyperParameters(), ALGORITHMHYPERPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(solutionConfig.getFeatureTransformationParameters(), FEATURETRANSFORMATIONPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(solutionConfig.getOptimizationObjective(), OPTIMIZATIONOBJECTIVE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | solutionConfig.getAutoMLConfig(), AUTOMLCONFIG_BINDING); |
1,546,073 | public static Disposable subscribeChannel(final Context context, final String channelId) {<NEW_LINE>if (channelId != null) {<NEW_LINE>return DatabaseTasks.getChannelInfo(context, channelId, false).observeOn(Schedulers.io()).map(youTubeChannel -> new Pair<>(youTubeChannel, SubscriptionsDb.getSubscriptionsDb().subscribe(youTubeChannel))).observeOn(AndroidSchedulers.mainThread()).subscribe(youTubeChannelWithResult -> {<NEW_LINE>switch(youTubeChannelWithResult.second) {<NEW_LINE>case SUCCESS:<NEW_LINE>{<NEW_LINE>youTubeChannelWithResult.first.setUserSubscribed(true);<NEW_LINE>EventBus.getInstance().notifyMainTabChanged(EventBus.SettingChange.SUBSCRIPTION_LIST_CHANGED);<NEW_LINE>SkyTubeApp.<MASK><NEW_LINE>Toast.makeText(context, R.string.channel_subscribed, Toast.LENGTH_LONG).show();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case NOT_MODIFIED:<NEW_LINE>{<NEW_LINE>Toast.makeText(context, R.string.channel_already_subscribed, Toast.LENGTH_LONG).show();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>Toast.makeText(context, R.string.channel_subscribe_failed, Toast.LENGTH_LONG).show();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>Toast.makeText(context, "Channel is not specified", Toast.LENGTH_LONG).show();<NEW_LINE>return Disposable.empty();<NEW_LINE>}<NEW_LINE>} | getSettings().setRefreshSubsFeedFromCache(true); |
1,757,494 | final StopRxNormInferenceJobResult executeStopRxNormInferenceJob(StopRxNormInferenceJobRequest stopRxNormInferenceJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(stopRxNormInferenceJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StopRxNormInferenceJobRequest> request = null;<NEW_LINE>Response<StopRxNormInferenceJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StopRxNormInferenceJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(stopRxNormInferenceJobRequest));<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, "ComprehendMedical");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StopRxNormInferenceJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StopRxNormInferenceJobResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "StopRxNormInferenceJob"); |
720,650 | private static void copyRequiredLibraries(AntProjectHelper h, ReferenceHelper rh, WebProjectCreateData data) throws IOException {<NEW_LINE>if (!h.isSharableProject()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!data.skipTests() && rh.getProjectLibraryManager().getLibrary("junit") == null) {<NEW_LINE>// NOI18N<NEW_LINE>if (LibraryManager.getDefault().getLibrary("junit") != null) {<NEW_LINE>// NOI18N<NEW_LINE>rh.copyLibrary(LibraryManager.getDefault().getLibrary("junit"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!data.skipTests() && rh.getProjectLibraryManager().getLibrary("junit_4") == null) {<NEW_LINE>// NOI18N<NEW_LINE>if (LibraryManager.getDefault().getLibrary("junit_4") != null) {<NEW_LINE>// NOI18N<NEW_LINE>rh.copyLibrary(LibraryManager.getDefault<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>Profile j2eeProfile = data.getJavaEEProfile();<NEW_LINE>String libraryName = null;<NEW_LINE>if (j2eeProfile.equals(Profile.JAVA_EE_6_FULL) || j2eeProfile.equals(Profile.JAVA_EE_6_WEB)) {<NEW_LINE>libraryName = AntProjectConstants.ENDORSED_LIBRARY_NAME_6;<NEW_LINE>}<NEW_LINE>if (j2eeProfile.equals(Profile.JAVA_EE_7_FULL) || j2eeProfile.equals(Profile.JAVA_EE_7_WEB)) {<NEW_LINE>libraryName = AntProjectConstants.ENDORSED_LIBRARY_NAME_7;<NEW_LINE>}<NEW_LINE>if (libraryName != null) {<NEW_LINE>if (rh.getProjectLibraryManager().getLibrary(libraryName) == null) {<NEW_LINE>// NOI18N<NEW_LINE>Library library = LibraryManager.getDefault().getLibrary(libraryName);<NEW_LINE>if (library != null) {<NEW_LINE>rh.copyLibrary(library);<NEW_LINE>} else {<NEW_LINE>LOGGER.log(Level.INFO, "Library not found for {0}", libraryName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SharabilityUtility.makeSureProjectHasCopyLibsLibrary(h, rh);<NEW_LINE>} | ().getLibrary("junit_4")); |
486,474 | protected void writeClassDescriptor(ObjectStreamClass desc) throws IOException {<NEW_LINE>Class<?> cl = desc.forClass();<NEW_LINE>if (ProxyFactory.isProxyClass(cl)) {<NEW_LINE>writeBoolean(true);<NEW_LINE>Class<?> superClass = cl.getSuperclass();<NEW_LINE>Class<?>[] interfaces = cl.getInterfaces();<NEW_LINE>byte[] signature = ProxyFactory.getFilterSignature(cl);<NEW_LINE><MASK><NEW_LINE>writeObject(name);<NEW_LINE>// we don't write the marker interface ProxyObject<NEW_LINE>writeInt(interfaces.length - 1);<NEW_LINE>for (int i = 0; i < interfaces.length; i++) {<NEW_LINE>Class<?> interfaze = interfaces[i];<NEW_LINE>if (interfaze != ProxyObject.class && interfaze != Proxy.class) {<NEW_LINE>name = interfaces[i].getName();<NEW_LINE>writeObject(name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writeInt(signature.length);<NEW_LINE>write(signature);<NEW_LINE>} else {<NEW_LINE>writeBoolean(false);<NEW_LINE>super.writeClassDescriptor(desc);<NEW_LINE>}<NEW_LINE>} | String name = superClass.getName(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.