idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
681,536
public final boolean allMatch(final Predicate<? super T> c) {<NEW_LINE>Future<Boolean<MASK><NEW_LINE>if (async == Type.NO_BACKPRESSURE) {<NEW_LINE>ReactiveStreamX<T> filtered = (ReactiveStreamX<T>) filter(c.negate());<NEW_LINE>filtered.source.subscribeAll(e -> {<NEW_LINE>result.complete(false);<NEW_LINE>throw new Queue.ClosedQueueException();<NEW_LINE>}, t -> {<NEW_LINE>result.completeExceptionally(t);<NEW_LINE>}, () -> {<NEW_LINE>if (!result.isDone()) {<NEW_LINE>result.complete(true);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>ReactiveStreamX<T> filtered = (ReactiveStreamX<T>) filter(c.negate());<NEW_LINE>filtered.source.subscribe(e -> {<NEW_LINE>result.complete(false);<NEW_LINE>}, t -> {<NEW_LINE>result.completeExceptionally(t);<NEW_LINE>}, () -> {<NEW_LINE>if (!result.isDone()) {<NEW_LINE>result.complete(true);<NEW_LINE>}<NEW_LINE>}).request(1l);<NEW_LINE>}<NEW_LINE>return result.getFuture().join();<NEW_LINE>}
> result = Future.future();
241,739
private void patchConfigmapTrait(JSONArray traits, AppInstance appInstance, AppComponentInstance appComponentInstance) {<NEW_LINE>JSONArray targets = new JSONArray();<NEW_LINE>JSONObject configmaps = new JSONObject();<NEW_LINE>traits.add(JsonUtil.map("name", "configmap.trait.abm.io", "runtime", "pre", "spec", JsonUtil.map("targets", targets, "configmaps", configmaps)));<NEW_LINE>AppComponentInstanceDetail appComponentInstanceDetail = appComponentInstance.detail();<NEW_LINE>List<Config> configs = appComponentInstanceDetail.configs();<NEW_LINE>for (Config config : configs) {<NEW_LINE>String name = UuidUtil.shortUuid();<NEW_LINE>targets.add(JsonUtil.map("type", "volumeMount", "container", appComponentInstance.getName(), "mountPath", config.getParentPath(), "configmap", name));<NEW_LINE>configmaps.put(name, JsonUtil.map(config.getName(), config.getContent()));<NEW_LINE>}<NEW_LINE>List<Long> clusterResourceIdList = appInstance.detail().clusterResourceIdList();<NEW_LINE>if (CollectionUtils.isEmpty(clusterResourceIdList)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (Long clusterResourceId : clusterResourceIdList) {<NEW_LINE>ClusterResource clusterResource = clusterResourceRepository.findFirstById(clusterResourceId);<NEW_LINE>JSONObject usageDetail = clusterResource.usageDetail();<NEW_LINE><MASK><NEW_LINE>targets.add(JsonUtil.map("type", "env", "container", appComponentInstance.getName(), "configmap", name));<NEW_LINE>JSONObject configmap = new JSONObject();<NEW_LINE>configmaps.put(name, configmap);<NEW_LINE>for (String key : usageDetail.keySet()) {<NEW_LINE>Object value = usageDetail.get(key);<NEW_LINE>configmap.put(clusterResource.getName() + "_" + key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
String name = UuidUtil.shortUuid();
1,647,343
public void migrate(Schema schema, DatabaseSession databaseSession) {<NEW_LINE>EClass pluginBundleVersionClass = schema.createEClass("store", "PluginBundleVersion");<NEW_LINE>EEnum pluginBundleType = schema.createEEnum("store", "PluginBundleType");<NEW_LINE>schema.createEEnumLiteral(pluginBundleType, "MAVEN");<NEW_LINE>schema.createEEnumLiteral(pluginBundleType, "GITHUB");<NEW_LINE>schema.createEEnumLiteral(pluginBundleType, "LOCAL");<NEW_LINE>EEnum pluginType = schema.createEEnum("store", "PluginType");<NEW_LINE>schema.createEEnumLiteral(pluginType, "SERIALIZER");<NEW_LINE>schema.createEEnumLiteral(pluginType, "DESERIALIZER");<NEW_LINE>schema.createEEnumLiteral(pluginType, "RENDER_ENGINE");<NEW_LINE>schema.createEEnumLiteral(pluginType, "QUERY_ENGINE");<NEW_LINE>schema.createEEnumLiteral(pluginType, "OBJECT_IDM");<NEW_LINE><MASK><NEW_LINE>schema.createEEnumLiteral(pluginType, "MODEL_MERGER");<NEW_LINE>schema.createEEnumLiteral(pluginType, "MODEL_COMPARE");<NEW_LINE>schema.createEEnumLiteral(pluginType, "MODEL_CHECKER");<NEW_LINE>schema.createEEnumLiteral(pluginType, "STILL_IMAGE_RENDER");<NEW_LINE>schema.createEEnumLiteral(pluginType, "SERVICE");<NEW_LINE>schema.createEAttribute(pluginBundleVersionClass, "version", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEAttribute(pluginBundleVersionClass, "type", pluginBundleType);<NEW_LINE>schema.createEAttribute(pluginBundleVersionClass, "description", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEAttribute(pluginBundleVersionClass, "mismatch", EcorePackage.eINSTANCE.getEBoolean());<NEW_LINE>schema.createEAttribute(pluginBundleVersionClass, "repository", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEAttribute(pluginBundleVersionClass, "groupId", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEAttribute(pluginBundleVersionClass, "artifactId", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEAttribute(pluginBundleVersionClass, "icon", EcorePackage.eINSTANCE.getEByteArray());<NEW_LINE>schema.createEAttribute(pluginBundleVersionClass, "organization", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEAttribute(pluginBundleVersionClass, "name", EcorePackage.eINSTANCE.getEString());<NEW_LINE>EClass pluginBundle = schema.createEClass("store", "PluginBundle");<NEW_LINE>schema.createEAttribute(pluginBundle, "organization", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEAttribute(pluginBundle, "name", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEReference(pluginBundle, "latestVersion", pluginBundleVersionClass, Multiplicity.SINGLE).getEAnnotations().add(createEmbedsReferenceAnnotation());<NEW_LINE>schema.createEReference(pluginBundle, "availableVersions", pluginBundleVersionClass, Multiplicity.MANY).getEAnnotations().add(createEmbedsReferenceAnnotation());<NEW_LINE>schema.createEReference(pluginBundle, "installedVersion", pluginBundleVersionClass, Multiplicity.SINGLE).getEAnnotations().add(createEmbedsReferenceAnnotation());<NEW_LINE>EClass pluginInformation = schema.createEClass("store", "PluginInformation");<NEW_LINE>schema.createEAttribute(pluginInformation, "name", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEAttribute(pluginInformation, "type", pluginType);<NEW_LINE>schema.createEAttribute(pluginInformation, "description", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEAttribute(pluginInformation, "enabled", EcorePackage.eINSTANCE.getEBoolean());<NEW_LINE>schema.createEAttribute(pluginInformation, "identifier", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEAttribute(pluginInformation, "installForAllUsers", EcorePackage.eINSTANCE.getEBoolean());<NEW_LINE>schema.createEAttribute(pluginInformation, "installForNewUsers", EcorePackage.eINSTANCE.getEBoolean());<NEW_LINE>EClass pluginDescriptor = schema.getEClass("store", "PluginDescriptor");<NEW_LINE>schema.createEAttribute(pluginDescriptor, "installForNewUsers", EcorePackage.eINSTANCE.getEBoolean());<NEW_LINE>EClass serverSettingsClass = schema.getEClass("store", "ServerSettings");<NEW_LINE>schema.createEAttribute(serverSettingsClass, "pluginStrictVersionChecking", EcorePackage.eINSTANCE.getEBoolean());<NEW_LINE>schema.createEReference(pluginDescriptor, "pluginBundleVersion", pluginBundleVersionClass, Multiplicity.SINGLE);<NEW_LINE>}
schema.createEEnumLiteral(pluginType, "WEB_MODULE");
1,217,280
private void PropagateLabelPush(IFragment<Long, Long, Long, Double> fragment, ParallelContextBase<Long, Long, Long, Double> context, ParallelMessageManager mm) {<NEW_LINE>WCCContext ctx = (WCCContext) context;<NEW_LINE>VertexRange<Long> innerVertices = fragment.innerVertices();<NEW_LINE>VertexRange<Long> outerVertices = fragment.outerVertices();<NEW_LINE>BiConsumer<Vertex<Long>, Integer> consumer = (vertex, finalTid) -> {<NEW_LINE>long cid = ctx.comp_id.get(vertex);<NEW_LINE>AdjList<Long, Double> adjList = fragment.getOutgoingAdjList(vertex);<NEW_LINE>for (Nbr<Long, Double> nbr : adjList.iterable()) {<NEW_LINE>Vertex<Long> cur = nbr.neighbor();<NEW_LINE>if (Long.compareUnsigned(ctx.comp_id.get(cur), cid) > 0) {<NEW_LINE>ctx.comp_id.compareAndSetMinUnsigned(cur, cid);<NEW_LINE>ctx.nextModified.set(cur);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>forEachVertex(innerVertices, ctx.threadNum, ctx.<MASK><NEW_LINE>BiConsumer<Vertex<Long>, LongMsg> filler = (vertex, msg) -> {<NEW_LINE>msg.setData(ctx.comp_id.get(vertex));<NEW_LINE>};<NEW_LINE>// forEachVertex(outerVertices, ctx.threadNum, ctx.executor, ctx.nextModified, consumer2);<NEW_LINE>BiConsumer<Vertex<Long>, Integer> msgSender = (vertex, finalTid) -> {<NEW_LINE>DoubleMsg msg = FFITypeFactoryhelper.newDoubleMsg(ctx.comp_id.get(vertex));<NEW_LINE>mm.syncStateOnOuterVertex(fragment, vertex, msg, finalTid, 2.0);<NEW_LINE>};<NEW_LINE>forEachVertex(outerVertices, ctx.threadNum, ctx.executor, ctx.nextModified, msgSender);<NEW_LINE>// mm.ParallelSyncStateOnOuterVertex(outerVertices, ctx.nextModified, ctx.threadNum,<NEW_LINE>// ctx.executor, filler);<NEW_LINE>}
executor, ctx.currModified, consumer);
532,928
public static void createTarGzFile(File[] inputFiles, File outputFile) throws IOException {<NEW_LINE>Preconditions.checkArgument(outputFile.getName().endsWith(TAR_GZ_FILE_EXTENSION), "Output file: %s does not have '.tar.gz' file extension", outputFile);<NEW_LINE>try (OutputStream fileOut = Files.newOutputStream(outputFile.toPath());<NEW_LINE>BufferedOutputStream bufferedOut = new BufferedOutputStream(fileOut);<NEW_LINE><MASK><NEW_LINE>TarArchiveOutputStream tarGzOut = new TarArchiveOutputStream(gzipOut)) {<NEW_LINE>tarGzOut.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_STAR);<NEW_LINE>tarGzOut.setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU);<NEW_LINE>for (File inputFile : inputFiles) {<NEW_LINE>addFileToTarGz(tarGzOut, inputFile, "");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
OutputStream gzipOut = new GzipCompressorOutputStream(bufferedOut);
973,417
private String call(byte[] ownerAddressByte, byte[] contractAddressByte, long value, byte[] data) {<NEW_LINE>TransactionExtention.Builder trxExtBuilder = TransactionExtention.newBuilder();<NEW_LINE>Return.Builder retBuilder = Return.newBuilder();<NEW_LINE>TransactionExtention trxExt;<NEW_LINE>try {<NEW_LINE>callTriggerConstantContract(ownerAddressByte, contractAddressByte, value, data, trxExtBuilder, retBuilder);<NEW_LINE>} catch (ContractValidateException | VMIllegalException e) {<NEW_LINE>retBuilder.setResult(false).setCode(response_code.CONTRACT_VALIDATE_ERROR).setMessage(ByteString.copyFromUtf8(CONTRACT_VALIDATE_ERROR + e.getMessage()));<NEW_LINE>trxExtBuilder.setResult(retBuilder);<NEW_LINE>logger.warn(CONTRACT_VALIDATE_EXCEPTION, e.getMessage());<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>retBuilder.setResult(false).setCode(response_code.CONTRACT_EXE_ERROR).setMessage(ByteString.copyFromUtf8(e.getClass() + " : " + e.getMessage()));<NEW_LINE>trxExtBuilder.setResult(retBuilder);<NEW_LINE>logger.warn("When run constant call in VM, have RuntimeException: " + e.getMessage());<NEW_LINE>} catch (Exception e) {<NEW_LINE>retBuilder.setResult(false).setCode(response_code.OTHER_ERROR).setMessage(ByteString.copyFromUtf8(e.getClass() + " : " + e.getMessage()));<NEW_LINE>trxExtBuilder.setResult(retBuilder);<NEW_LINE>logger.warn("Unknown exception caught: " + <MASK><NEW_LINE>} finally {<NEW_LINE>trxExt = trxExtBuilder.build();<NEW_LINE>}<NEW_LINE>String result = "0x";<NEW_LINE>String code = trxExt.getResult().getCode().toString();<NEW_LINE>if ("SUCCESS".equals(code)) {<NEW_LINE>List<ByteString> list = trxExt.getConstantResultList();<NEW_LINE>byte[] listBytes = new byte[0];<NEW_LINE>for (ByteString bs : list) {<NEW_LINE>listBytes = ByteUtil.merge(listBytes, bs.toByteArray());<NEW_LINE>}<NEW_LINE>result = ByteArray.toJsonHex(listBytes);<NEW_LINE>} else {<NEW_LINE>logger.error("trigger contract failed.");<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
e.getMessage(), e);
1,839,161
private final PricingConditionsBreakQuery createPricingConditionsBreakQuery(final I_C_OrderLine salesOrderLine) {<NEW_LINE>final IProductDAO productsRepo = Services.get(IProductDAO.class);<NEW_LINE>final IAttributeDAO attributesRepo = Services.get(IAttributeDAO.class);<NEW_LINE>final ProductId productId = ProductId.<MASK><NEW_LINE>final ProductAndCategoryAndManufacturerId product = productsRepo.retrieveProductAndCategoryAndManufacturerByProductId(productId);<NEW_LINE>final AttributeSetInstanceId asiId = AttributeSetInstanceId.ofRepoIdOrNone(salesOrderLine.getM_AttributeSetInstance_ID());<NEW_LINE>final ImmutableAttributeSet attributes = attributesRepo.getImmutableAttributeSetById(asiId);<NEW_LINE>final BigDecimal qty = salesOrderLine.getQtyOrdered();<NEW_LINE>final BigDecimal price = salesOrderLine.getPriceActual();<NEW_LINE>return PricingConditionsBreakQuery.builder().product(product).attributes(attributes).qty(qty).price(price).build();<NEW_LINE>}
ofRepoId(salesOrderLine.getM_Product_ID());
694,204
private void updateReferences() {<NEW_LINE>for (IdEObject idEObject : newModel.getValues()) {<NEW_LINE>if (idEObject instanceof IfcRoot) {<NEW_LINE>String guid = ((IfcRoot) idEObject).getGlobalId();<NEW_LINE>IfcRoot oldObject = (IfcRoot) resultModel.getByGuid(guid);<NEW_LINE>for (EReference eReference : idEObject.eClass().getEAllReferences()) {<NEW_LINE>Object <MASK><NEW_LINE>if (referencedObject instanceof IfcRoot) {<NEW_LINE>String referencedGuid = ((IfcRoot) referencedObject).getGlobalId();<NEW_LINE>IfcRoot newObject = (IfcRoot) resultModel.getByGuid(referencedGuid);<NEW_LINE>oldObject.eSet(eReference, newObject);<NEW_LINE>// LOGGER.info("Fixing reference from " + guid + " to " + referencedGuid);<NEW_LINE>} else if (referencedObject instanceof List) {<NEW_LINE>List referencedList = (List) referencedObject;<NEW_LINE>List oldReferencedList = (List) oldObject.eGet(eReference);<NEW_LINE>for (Object object : referencedList) {<NEW_LINE>if (object instanceof IfcRoot) {<NEW_LINE>IfcRoot referencedItem = (IfcRoot) object;<NEW_LINE>String itemGuid = referencedItem.getGlobalId();<NEW_LINE>oldReferencedList.add(resultModel.getByGuid(itemGuid));<NEW_LINE>// LOGGER.info("Fixing list reference from " + guid + " to " + itemGuid);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
referencedObject = idEObject.eGet(eReference);
493,372
public Comic parseInfo(String html, Comic comic) throws UnsupportedEncodingException {<NEW_LINE><MASK><NEW_LINE>String title = body.text("div.intro_l > div.title > h1");<NEW_LINE>String cover = body.src("div.intro_l > div.info_cover > p.cover > img");<NEW_LINE>String update = body.text("div.intro_l > div.info > p:eq(0) > span").substring(0, 10);<NEW_LINE>String author = body.text("div.intro_l > div.info > p:eq(1)").substring(5).trim();<NEW_LINE>String intro = body.text("#intro");<NEW_LINE>boolean status = isFinish(body.text("div.intro_l > div.info > p:eq(2)"));<NEW_LINE>comic.setInfo(title, cover, update, intro, author, status);<NEW_LINE>return comic;<NEW_LINE>}
Node body = new Node(html);
1,792,577
public static void onCrafting(ItemCraftedEvent event) {<NEW_LINE>ItemStack result = event.getCrafting();<NEW_LINE>if (!result.isEmpty() && result.getItem() instanceof ItemBlockBin && ItemDataUtils.getBoolean(result, NBTConstants.FROM_RECIPE)) {<NEW_LINE>BinInventorySlot slot = convertToSlot(result);<NEW_LINE><MASK><NEW_LINE>if (!storedStack.isEmpty()) {<NEW_LINE>Container craftingMatrix = event.getInventory();<NEW_LINE>for (int i = 0; i < craftingMatrix.getContainerSize(); ++i) {<NEW_LINE>ItemStack stack = craftingMatrix.getItem(i);<NEW_LINE>// Check remaining items<NEW_LINE>stack = StackUtils.size(stack, stack.getCount() - 1);<NEW_LINE>if (!stack.isEmpty() && ItemHandlerHelper.canItemStacksStack(storedStack, stack)) {<NEW_LINE>ItemStack remaining = slot.insertItem(stack, Action.EXECUTE, AutomationType.MANUAL);<NEW_LINE>craftingMatrix.setItem(i, remaining);<NEW_LINE>} else {<NEW_LINE>craftingMatrix.setItem(i, ItemStack.EMPTY);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ItemDataUtils.removeData(storedStack, NBTConstants.FROM_RECIPE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ItemStack storedStack = slot.getStack();
1,624,452
public void init(Action action, ActionArgumentValue[] presetInputValues) {<NEW_LINE>inputArgumentsTable = new ActionArgumentTable(action, true) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onExpandText(String text) {<NEW_LINE>presenter.onExpandText(text);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>outputArgumentsTable = new ActionArgumentTable(action, false) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onExpandText(String text) {<NEW_LINE>presenter.onExpandText(text);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>if (presetInputValues != null && presetInputValues.length > 0)<NEW_LINE>inputArgumentsTable.getArgumentValuesModel().setValues(presetInputValues);<NEW_LINE>inputArgumentsScrollPane = new JScrollPane(inputArgumentsTable);<NEW_LINE>outputArgumentsScrollPane = new JScrollPane(outputArgumentsTable);<NEW_LINE>JPanel mainPanel = new JPanel(new BorderLayout());<NEW_LINE>mainPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));<NEW_LINE>mainPanel.add(invocationToolBar, BorderLayout.NORTH);<NEW_LINE>if (action.hasInputArguments() && action.hasOutputArguments()) {<NEW_LINE>splitPane.setTopComponent(inputArgumentsScrollPane);<NEW_LINE>splitPane.setBottomComponent(outputArgumentsScrollPane);<NEW_LINE>splitPane.setResizeWeight(0.5);<NEW_LINE>mainPanel.add(splitPane, BorderLayout.CENTER);<NEW_LINE>} else if (action.hasInputArguments()) {<NEW_LINE>mainPanel.add(inputArgumentsScrollPane, BorderLayout.CENTER);<NEW_LINE>} else if (action.hasOutputArguments()) {<NEW_LINE>mainPanel.add(outputArgumentsScrollPane, BorderLayout.CENTER);<NEW_LINE>}<NEW_LINE>add(mainPanel);<NEW_LINE>setTitle(<MASK><NEW_LINE>setPreferredSize(new Dimension(450, (action.getArguments().length * 40) + 120));<NEW_LINE>pack();<NEW_LINE>setVisible(true);<NEW_LINE>}
"Invoking Action: " + action.getName());
1,749,826
public void marshall(AwsIamPolicyDetails awsIamPolicyDetails, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (awsIamPolicyDetails == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(awsIamPolicyDetails.getAttachmentCount(), ATTACHMENTCOUNT_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsIamPolicyDetails.getCreateDate(), CREATEDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsIamPolicyDetails.getDefaultVersionId(), DEFAULTVERSIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsIamPolicyDetails.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(awsIamPolicyDetails.getPath(), PATH_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsIamPolicyDetails.getPermissionsBoundaryUsageCount(), PERMISSIONSBOUNDARYUSAGECOUNT_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsIamPolicyDetails.getPolicyId(), POLICYID_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsIamPolicyDetails.getPolicyName(), POLICYNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsIamPolicyDetails.getPolicyVersionList(), POLICYVERSIONLIST_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsIamPolicyDetails.getUpdateDate(), UPDATEDATE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
awsIamPolicyDetails.getIsAttachable(), ISATTACHABLE_BINDING);
1,571,615
// -------------------------------------------------------------------------<NEW_LINE>@Override<NEW_LINE>public PortfolioItemSummary summarize() {<NEW_LINE>// 2Y Buy USD 1mm INDEX / 1.5% : 21Jan18-21Jan20<NEW_LINE>PeriodicSchedule paymentSchedule = product.getPaymentSchedule();<NEW_LINE><MASK><NEW_LINE>buf.append(SummarizerUtils.datePeriod(paymentSchedule.getStartDate(), paymentSchedule.getEndDate()));<NEW_LINE>buf.append(' ');<NEW_LINE>buf.append(product.getBuySell());<NEW_LINE>buf.append(' ');<NEW_LINE>buf.append(SummarizerUtils.amount(product.getCurrency(), product.getNotional()));<NEW_LINE>buf.append(' ');<NEW_LINE>buf.append(product.getCdsIndexId().getValue());<NEW_LINE>buf.append(" / ");<NEW_LINE>buf.append(SummarizerUtils.percent(product.getFixedRate()));<NEW_LINE>buf.append(" : ");<NEW_LINE>buf.append(SummarizerUtils.dateRange(paymentSchedule.getStartDate(), paymentSchedule.getEndDate()));<NEW_LINE>return SummarizerUtils.summary(this, ProductType.CDS_INDEX, buf.toString(), product.getCurrency());<NEW_LINE>}
StringBuilder buf = new StringBuilder(96);
899,830
public Flux<CommandResponse<ZAggregateCommand, Flux<Tuple>>> zInterWithScores(Publisher<? extends ZAggregateCommand> commands) {<NEW_LINE>return execute(commands, command -> {<NEW_LINE>Assert.notEmpty(command.getSourceKeys(), "Source keys must not be null or empty!");<NEW_LINE>List<Object> args = new ArrayList<>(command.getSourceKeys().size() * 2 + 5);<NEW_LINE>args.add(command.getSourceKeys().size());<NEW_LINE>args.addAll(command.getSourceKeys().stream().map(e -> toByteArray(e)).collect(Collectors.toList()));<NEW_LINE>if (!command.getWeights().isEmpty()) {<NEW_LINE>args.add("WEIGHTS");<NEW_LINE>for (Double weight : command.getWeights()) {<NEW_LINE>args.add(BigDecimal.valueOf<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (command.getAggregateFunction().isPresent()) {<NEW_LINE>args.add("AGGREGATE");<NEW_LINE>args.add(command.getAggregateFunction().get().name());<NEW_LINE>}<NEW_LINE>args.add("WITHSCORES");<NEW_LINE>Mono<Set<Tuple>> m = write(toByteArray(command.getSourceKeys().get(0)), ByteArrayCodec.INSTANCE, ZINTER_SCORE, args.toArray());<NEW_LINE>Flux<Tuple> flux = m.flatMapMany(e -> Flux.fromIterable(e));<NEW_LINE>return Mono.just(new CommandResponse<>(command, flux));<NEW_LINE>});<NEW_LINE>}
(weight).toPlainString());
370,541
Pair<DcMeta, Set<String>> extractOuterDcMetaWithInterestedTypes(OuterClientService.DcMeta outerDcMeta) {<NEW_LINE>DcMeta dcMeta = new DcMeta(outerDcMeta.getDcName());<NEW_LINE>Map<String, OuterClientService.ClusterMeta> outerClusterMetas = outerDcMeta.getClusters();<NEW_LINE>Set<String> filterClusters = new HashSet<>();<NEW_LINE>for (OuterClientService.ClusterMeta outerClusterMeta : outerClusterMetas.values()) {<NEW_LINE>try {<NEW_LINE>if (notInterestedTypes(outerClusterMeta.getClusterType().innerType().name()))<NEW_LINE>continue;<NEW_LINE>if (shouldFilterOuterCluster(outerClusterMeta)) {<NEW_LINE>filterClusters.<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ClusterMeta clusterMeta = outerClusterToInner(outerClusterMeta);<NEW_LINE>if (clusterMeta != null)<NEW_LINE>dcMeta.addCluster(clusterMeta);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>logger.error("[extractOuterDcMetaWithInterestedTypes]: {}", outerClusterMeta.getName(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Pair<>(dcMeta, filterClusters);<NEW_LINE>}
add(outerClusterMeta.getName());
1,645,219
public void actionPerformed(@Nonnull AnActionEvent e) {<NEW_LINE>Project project = e.getData(CommonDataKeys.PROJECT);<NEW_LINE>if (project == null)<NEW_LINE>return;<NEW_LINE>FileEditor fileEditor = e.getData(PlatformDataKeys.FILE_EDITOR);<NEW_LINE>if (fileEditor == null)<NEW_LINE>return;<NEW_LINE>VirtualFile virtualFile = fileEditor.getFile();<NEW_LINE>Editor editor = fileEditor instanceof TextEditor ? ((TextEditor) fileEditor).getEditor() : e.getData(CommonDataKeys.EDITOR);<NEW_LINE>if (editor != null) {<NEW_LINE>PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument());<NEW_LINE>}<NEW_LINE>FeatureUsageTracker.<MASK><NEW_LINE>FileStructurePopup popup = createPopup(project, fileEditor);<NEW_LINE>if (popup == null)<NEW_LINE>return;<NEW_LINE>String title = virtualFile == null ? fileEditor.getName() : virtualFile.getName();<NEW_LINE>popup.setTitle(title);<NEW_LINE>popup.show();<NEW_LINE>}
getInstance().triggerFeatureUsed("navigation.popup.file.structure");
841,474
public Result demoteLocalLeader(long timestamp) {<NEW_LINE>try {<NEW_LINE>Optional<HighAvailabilityConfig> config = HighAvailabilityConfig.getByClusterKey(this.getClusterKey());<NEW_LINE>if (!config.isPresent()) {<NEW_LINE>LOG.warn("No HA configuration configured, skipping request");<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>DemoteInstanceFormData formData = formFactory.getFormDataOrBadRequest(DemoteInstanceFormData.class).get();<NEW_LINE>Optional<PlatformInstance> localInstance = config.get().getLocal();<NEW_LINE>if (!localInstance.isPresent()) {<NEW_LINE>LOG.warn("No local instance configured");<NEW_LINE>return ApiResponse.error(BAD_REQUEST, "No local instance configured");<NEW_LINE>}<NEW_LINE>Date requestLastFailover = new Date(timestamp);<NEW_LINE>Date localLastFailover = config.get().getLastFailover();<NEW_LINE>// Reject the request if coming from a platform instance that was failed over to earlier.<NEW_LINE>if (localLastFailover != null && localLastFailover.after(requestLastFailover)) {<NEW_LINE>LOG.warn("Rejecting demote request due to request lastFailover being stale");<NEW_LINE>return ApiResponse.error(BAD_REQUEST, "Rejecting demote request from stale leader");<NEW_LINE>} else if (localLastFailover == null || localLastFailover.before(requestLastFailover)) {<NEW_LINE>// Otherwise, update the last failover timestamp and proceed with demotion request.<NEW_LINE>config.get().setLastFailover(requestLastFailover);<NEW_LINE>}<NEW_LINE>// Demote the local instance.<NEW_LINE>replicationManager.demoteLocalInstance(localInstance.get(), formData.leader_address);<NEW_LINE>return PlatformResults.withData(localInstance);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Error demoting platform instance", e);<NEW_LINE>return ApiResponse.error(INTERNAL_SERVER_ERROR, "Error demoting platform instance");<NEW_LINE>}<NEW_LINE>}
ApiResponse.error(NOT_FOUND, "Invalid config UUID");
282,889
public List<SortField> guessSortTypes(String name) {<NEW_LINE>FieldInfo finfo = IndexUtils.getFieldInfo(reader, name);<NEW_LINE>if (finfo == null) {<NEW_LINE>throw new LukeException("No such field: " + name, new IllegalArgumentException());<NEW_LINE>}<NEW_LINE>DocValuesType dvType = finfo.getDocValuesType();<NEW_LINE>switch(dvType) {<NEW_LINE>case NONE:<NEW_LINE>return Collections.emptyList();<NEW_LINE>case NUMERIC:<NEW_LINE>return Arrays.stream(new SortField[] { new SortField(name, SortField.Type.INT), new SortField(name, SortField.Type.LONG), new SortField(name, SortField.Type.FLOAT), new SortField(name, SortField.Type.DOUBLE) }).collect(Collectors.toList());<NEW_LINE>case SORTED_NUMERIC:<NEW_LINE>return Arrays.stream(new SortField[] { new SortedNumericSortField(name, SortField.Type.INT), new SortedNumericSortField(name, SortField.Type.LONG), new SortedNumericSortField(name, SortField.Type.FLOAT), new SortedNumericSortField(name, SortField.Type.DOUBLE) }).collect(Collectors.toList());<NEW_LINE>case SORTED:<NEW_LINE>return Arrays.stream(new SortField[] { new SortField(name, SortField.Type.STRING), new SortField(name, SortField.Type.STRING_VAL) }).<MASK><NEW_LINE>case SORTED_SET:<NEW_LINE>return Collections.singletonList(new SortedSetSortField(name, false));<NEW_LINE>case BINARY:<NEW_LINE>default:<NEW_LINE>return Collections.singletonList(new SortField(name, SortField.Type.DOC));<NEW_LINE>}<NEW_LINE>}
collect(Collectors.toList());
870,446
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.location_history);<NEW_LINE>findViewById(R.id.clear_location).setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>// Tell everyone to clear their location history.<NEW_LINE>BusProvider.getInstance().post(new LocationClearEvent());<NEW_LINE>// Post new location event for the default location.<NEW_LINE>lastLatitude = DEFAULT_LAT;<NEW_LINE>lastLongitude = DEFAULT_LON;<NEW_LINE>BusProvider.getInstance(<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>findViewById(R.id.move_location).setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>lastLatitude += (RANDOM.nextFloat() * OFFSET * 2) - OFFSET;<NEW_LINE>lastLongitude += (RANDOM.nextFloat() * OFFSET * 2) - OFFSET;<NEW_LINE>BusProvider.getInstance().post(produceLocationEvent());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
).post(produceLocationEvent());
1,386,502
private TextView generateTextView(String text, Context context, boolean shouldContentCentered, int fontColor, boolean showBulletPoints) {<NEW_LINE>int standardMargin = context.getResources().getDimensionPixelSize(R.dimen.standard_margin);<NEW_LINE>int doubleMargin = context.getResources().getDimensionPixelSize(R.dimen.standard_double_margin);<NEW_LINE>int zeroMargin = context.getResources().getDimensionPixelSize(R.dimen.zero);<NEW_LINE>TextView textView = new TextView(context);<NEW_LINE>LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);<NEW_LINE>layoutParams.setMargins(doubleMargin, standardMargin, doubleMargin, zeroMargin);<NEW_LINE>textView.setTextAppearance(context, R.style.NextcloudTextAppearanceMedium);<NEW_LINE>textView.setLayoutParams(layoutParams);<NEW_LINE>if (showBulletPoints) {<NEW_LINE>BulletSpan bulletSpan = new BulletSpan(standardMargin, fontColor);<NEW_LINE>SpannableString spannableString = new SpannableString(text);<NEW_LINE>spannableString.setSpan(bulletSpan, 0, spannableString.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);<NEW_LINE>textView.setText(spannableString);<NEW_LINE>} else {<NEW_LINE>textView.setText(text);<NEW_LINE>}<NEW_LINE>textView.setTextColor(fontColor);<NEW_LINE>if (!shouldContentCentered) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>textView.setGravity(Gravity.CENTER_HORIZONTAL);<NEW_LINE>}<NEW_LINE>return textView;<NEW_LINE>}
textView.setGravity(Gravity.START);
941,908
private static Map<String, Set<String>> projectDependencies(Set<Project> projects) {<NEW_LINE>Map<String, Set<String>> project2DirectDependencies = new HashMap<>();<NEW_LINE>List<Project> todoList = new LinkedList<>(projects);<NEW_LINE>while (!todoList.isEmpty()) {<NEW_LINE>Project prj = todoList.remove(0);<NEW_LINE>String projectName = prj.getProjectDirectory().getNameExt();<NEW_LINE>if (project2DirectDependencies.containsKey(projectName))<NEW_LINE>continue;<NEW_LINE>SubprojectProvider subProject = prj.getLookup().lookup(SubprojectProvider.class);<NEW_LINE>if (subProject == null) {<NEW_LINE>project2DirectDependencies.put(projectName, Collections.<String>emptySet());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Set<String> deps = new HashSet<>();<NEW_LINE>for (Project dep : subProject.getSubprojects()) {<NEW_LINE>if (// XXX - should be fixed in the provider<NEW_LINE>Objects.equals(projectName, dep.getProjectDirectory().getNameExt()))<NEW_LINE>continue;<NEW_LINE>todoList.add(dep);<NEW_LINE>deps.add(dep.getProjectDirectory().getNameExt());<NEW_LINE>}<NEW_LINE>project2DirectDependencies.put(projectName, deps);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>List<String> sortedProjects = org.openide.util.Utilities.topologicalSort(project2DirectDependencies.keySet(), project2DirectDependencies);<NEW_LINE>Map<String, Set<String>> project2AllDependencies = new HashMap<>();<NEW_LINE>Collections.reverse(sortedProjects);<NEW_LINE>for (String prj : sortedProjects) {<NEW_LINE>Set<String> dependencies = new HashSet<>();<NEW_LINE>for (String dep : project2DirectDependencies.get(prj)) {<NEW_LINE>dependencies.add(dep);<NEW_LINE>dependencies.addAll<MASK><NEW_LINE>}<NEW_LINE>project2AllDependencies.put(prj, dependencies);<NEW_LINE>}<NEW_LINE>return project2AllDependencies;<NEW_LINE>} catch (TopologicalSortException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>return Collections.emptyMap();<NEW_LINE>}<NEW_LINE>}
(project2AllDependencies.get(dep));
1,090,997
public static DescribePodLogResponse unmarshall(DescribePodLogResponse describePodLogResponse, UnmarshallerContext _ctx) {<NEW_LINE>describePodLogResponse.setRequestId(_ctx.stringValue("DescribePodLogResponse.RequestId"));<NEW_LINE>describePodLogResponse.setCode(_ctx.integerValue("DescribePodLogResponse.Code"));<NEW_LINE>describePodLogResponse.setErrMsg(_ctx.stringValue("DescribePodLogResponse.ErrMsg"));<NEW_LINE>describePodLogResponse.setSuccess<MASK><NEW_LINE>Result result = new Result();<NEW_LINE>result.setDeployOrderName(_ctx.stringValue("DescribePodLogResponse.Result.DeployOrderName"));<NEW_LINE>result.setEnvTypeName(_ctx.stringValue("DescribePodLogResponse.Result.EnvTypeName"));<NEW_LINE>List<DeployLogStepRC> deployStepList = new ArrayList<DeployLogStepRC>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribePodLogResponse.Result.DeployStepList.Length"); i++) {<NEW_LINE>DeployLogStepRC deployLogStepRC = new DeployLogStepRC();<NEW_LINE>deployLogStepRC.setStatus(_ctx.stringValue("DescribePodLogResponse.Result.DeployStepList[" + i + "].Status"));<NEW_LINE>deployLogStepRC.setStepName(_ctx.stringValue("DescribePodLogResponse.Result.DeployStepList[" + i + "].StepName"));<NEW_LINE>deployLogStepRC.setStepCode(_ctx.stringValue("DescribePodLogResponse.Result.DeployStepList[" + i + "].StepCode"));<NEW_LINE>deployLogStepRC.setStepLog(_ctx.stringValue("DescribePodLogResponse.Result.DeployStepList[" + i + "].StepLog"));<NEW_LINE>deployStepList.add(deployLogStepRC);<NEW_LINE>}<NEW_LINE>result.setDeployStepList(deployStepList);<NEW_LINE>describePodLogResponse.setResult(result);<NEW_LINE>return describePodLogResponse;<NEW_LINE>}
(_ctx.booleanValue("DescribePodLogResponse.Success"));
1,208,733
public ContentValues generateContentValuesForMultiPartUpload(String bucket, String key, File file, long fileOffset, int partNumber, String uploadId, long bytesTotal, int isLastPart, ObjectMetadata metadata, CannedAccessControlList cannedAcl, TransferUtilityOptions tuOptions) {<NEW_LINE>final ContentValues values = new ContentValues();<NEW_LINE>values.put(TransferTable.COLUMN_TYPE, TransferType.UPLOAD.toString());<NEW_LINE>values.put(TransferTable.COLUMN_STATE, TransferState.WAITING.toString());<NEW_LINE>values.put(TransferTable.COLUMN_BUCKET_NAME, bucket);<NEW_LINE>values.put(TransferTable.COLUMN_KEY, key);<NEW_LINE>values.put(TransferTable.COLUMN_FILE, file.getAbsolutePath());<NEW_LINE>values.put(TransferTable.COLUMN_BYTES_CURRENT, 0L);<NEW_LINE>values.put(TransferTable.COLUMN_BYTES_TOTAL, bytesTotal);<NEW_LINE>values.put(TransferTable.COLUMN_IS_MULTIPART, 1);<NEW_LINE>values.put(TransferTable.COLUMN_PART_NUM, partNumber);<NEW_LINE>values.put(TransferTable.COLUMN_FILE_OFFSET, fileOffset);<NEW_LINE>values.put(TransferTable.COLUMN_MULTIPART_ID, uploadId);<NEW_LINE>values.<MASK><NEW_LINE>values.put(TransferTable.COLUMN_IS_ENCRYPTED, 0);<NEW_LINE>values.putAll(generateContentValuesForObjectMetadata(metadata));<NEW_LINE>if (cannedAcl != null) {<NEW_LINE>values.put(TransferTable.COLUMN_CANNED_ACL, cannedAcl.toString());<NEW_LINE>}<NEW_LINE>if (tuOptions != null) {<NEW_LINE>values.put(TransferTable.COLUMN_TRANSFER_UTILITY_OPTIONS, gson.toJson(tuOptions));<NEW_LINE>}<NEW_LINE>return values;<NEW_LINE>}
put(TransferTable.COLUMN_IS_LAST_PART, isLastPart);
661,807
public void reduce(final IntWritable key, final Iterator<Text> values, final OutputCollector<IntWritable, Text> output, final Reporter reporter) throws IOException {<NEW_LINE>int i, j;<NEW_LINE>long[][] self_bm = new long[block_width][nreplication];<NEW_LINE>long[][] out_vals = new long[block_width][nreplication];<NEW_LINE>char[] prefix = new char[block_width];<NEW_LINE>String[] saved_rad_nh = new String[block_width];<NEW_LINE>for (i = 0; i < block_width; i++) for (j = 0; j < nreplication; j++) out_vals[i][j] = 0;<NEW_LINE>while (values.hasNext()) {<NEW_LINE>String cur_str = values.next().toString();<NEW_LINE>ArrayList<VectorElem<String>> cur_vector = GIMV.parseHADIVector(cur_str);<NEW_LINE>Iterator<VectorElem<String>> vector_iter = cur_vector.iterator();<NEW_LINE>j = 0;<NEW_LINE>while (vector_iter.hasNext()) {<NEW_LINE>VectorElem<String> v_elem = vector_iter.next();<NEW_LINE>out_vals[v_elem.row] = GIMV.updateHADIBitString(out_vals[v_elem.row], v_elem.val, nreplication, encode_bitmask);<NEW_LINE>if (cur_str.charAt(0) == 's') {<NEW_LINE>self_bm[v_elem.row] = GIMV.parseHADIBitString(v_elem.val, nreplication, encode_bitmask);<NEW_LINE>prefix[j] = v_elem.val.charAt(0);<NEW_LINE>int tindex = v_elem.val.indexOf('~');<NEW_LINE>if (tindex >= 2)<NEW_LINE>saved_rad_nh[j] = v_elem.val.substring(1, tindex);<NEW_LINE>j++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ArrayList<VectorElem<String>> new_vector = GIMV.makeHADIBitString(out_vals, block_width, self_bm, prefix, saved_rad_nh, nreplication, cur_radius, encode_bitmask);<NEW_LINE>output.collect(key, GIMV<MASK><NEW_LINE>}
.formatVectorElemOutput("s", new_vector));
758,879
final DescribeScheduledActionsResult executeDescribeScheduledActions(DescribeScheduledActionsRequest describeScheduledActionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeScheduledActionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeScheduledActionsRequest> request = null;<NEW_LINE>Response<DescribeScheduledActionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeScheduledActionsRequestMarshaller().marshall(super.beforeMarshalling(describeScheduledActionsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Redshift");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeScheduledActions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeScheduledActionsResult> responseHandler = new StaxResponseHandler<DescribeScheduledActionsResult>(new DescribeScheduledActionsResultStaxUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
674,098
private String _findTemplate(String val) {<NEW_LINE>// were we given an ordinal number?<NEW_LINE>Integer num = null;<NEW_LINE>try {<NEW_LINE>num = Integer.parseInt(val) - 1;<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>Timber.w(e);<NEW_LINE>num = null;<NEW_LINE>}<NEW_LINE>if (num != null) {<NEW_LINE>return "c.ord = " + num;<NEW_LINE>}<NEW_LINE>// search for template names<NEW_LINE>List<String> lims = new ArrayList<>();<NEW_LINE>for (Model m : mCol.getModels().all()) {<NEW_LINE>JSONArray tmpls = m.getJSONArray("tmpls");<NEW_LINE>for (JSONObject t : tmpls.jsonObjectIterable()) {<NEW_LINE>String templateName = t.getString("name");<NEW_LINE>Normalizer.normalize(templateName, Normalizer.Form.NFC);<NEW_LINE>if (templateName.equalsIgnoreCase(val)) {<NEW_LINE>if (m.isCloze()) {<NEW_LINE>// if the user has asked for a cloze card, we want<NEW_LINE>// to give all ordinals, so we just limit to the<NEW_LINE>// model instead<NEW_LINE>lims.add("(n.mid = " + m<MASK><NEW_LINE>} else {<NEW_LINE>lims.add("(n.mid = " + m.getLong("id") + " and c.ord = " + t.getInt("ord") + ")");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return TextUtils.join(" or ", lims.toArray(new String[lims.size()]));<NEW_LINE>}
.getLong("id") + ")");
1,444,242
public void performReplaceAtributeName(MapModel map, final String oldName, final String newName) {<NEW_LINE>if (oldName.equals("") || newName.equals("") || oldName.equals(newName)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final AttributeRegistry registry = AttributeRegistry.getRegistry(map);<NEW_LINE>final int iOld = registry.getElements().indexOf(oldName);<NEW_LINE>final AttributeRegistryElement oldElement = registry.getElement(iOld);<NEW_LINE>final SortedComboBoxModel values = oldElement.getValues();<NEW_LINE>final IActor registryActor = new RegistryAttributeActor(newName, oldElement.isManual(), oldElement.isVisible(), registry, map);<NEW_LINE>Controller.getCurrentModeController().execute(registryActor, map);<NEW_LINE>final AttributeRegistryElement newElement = registry.getElement(newName);<NEW_LINE>for (int i = 0; i < values.getSize(); i++) {<NEW_LINE>final IActor registryValueActor = new RegistryAttributeValueActor(newElement, values.getElementAt(i).toString(), false);<NEW_LINE>Controller.getCurrentModeController().execute(registryValueActor, map);<NEW_LINE>}<NEW_LINE>final IVisitor replacer <MASK><NEW_LINE>final Iterator iterator = new Iterator(replacer);<NEW_LINE>ModeController modeController = Controller.getCurrentModeController();<NEW_LINE>final NodeModel root = modeController.getMapController().getRootNode();<NEW_LINE>iterator.iterate(root);<NEW_LINE>final IActor unregistryActor = new UnregistryAttributeActor(oldName, registry, map);<NEW_LINE>Controller.getCurrentModeController().execute(unregistryActor, map);<NEW_LINE>}
= new AttributeRenamer(oldName, newName);
1,127,555
private void createDialogBox() {<NEW_LINE>JFrame mainFrame = GuiPackage.getInstance().getMainFrame();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String // $NON-NLS-1$<NEW_LINE>title = // $NON-NLS-1$<NEW_LINE>editable ? // $NON-NLS-1$<NEW_LINE>JMeterUtils.getResString("textbox_title_edit") : JMeterUtils.getResString("textbox_title_view");<NEW_LINE>// modal dialog box<NEW_LINE>dialog = new JDialog(mainFrame, title, true);<NEW_LINE>// Close action dialog box when tapping Escape key<NEW_LINE>JPanel content = (JPanel) dialog.getContentPane();<NEW_LINE>content.registerKeyboardAction(this, KeyStrokes.ESC, JComponent.WHEN_IN_FOCUSED_WINDOW);<NEW_LINE>textBox = new JEditorPane();<NEW_LINE>textBox.setEditable(editable);<NEW_LINE>JScrollPane textBoxScrollPane = GuiUtils.makeScrollPane(textBox);<NEW_LINE>JPanel btnBar = new JPanel();<NEW_LINE>btnBar.setLayout(new FlowLayout(FlowLayout.RIGHT));<NEW_LINE>if (editable) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>JButton cancelBtn = new JButton<MASK><NEW_LINE>cancelBtn.setActionCommand(CANCEL_COMMAND);<NEW_LINE>cancelBtn.addActionListener(this);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>JButton saveBtn = new JButton(JMeterUtils.getResString("textbox_save_close"));<NEW_LINE>saveBtn.setActionCommand(SAVE_CLOSE_COMMAND);<NEW_LINE>saveBtn.addActionListener(this);<NEW_LINE>btnBar.add(cancelBtn);<NEW_LINE>btnBar.add(saveBtn);<NEW_LINE>} else {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>JButton closeBtn = new JButton(JMeterUtils.getResString("textbox_close"));<NEW_LINE>closeBtn.setActionCommand(CLOSE_COMMAND);<NEW_LINE>closeBtn.addActionListener(this);<NEW_LINE>btnBar.add(closeBtn);<NEW_LINE>}<NEW_LINE>// Prepare dialog box<NEW_LINE>Container panel = dialog.getContentPane();<NEW_LINE>dialog.setMinimumSize(new Dimension(400, 250));<NEW_LINE>panel.add(textBoxScrollPane, BorderLayout.CENTER);<NEW_LINE>panel.add(btnBar, BorderLayout.SOUTH);<NEW_LINE>// determine location on screen<NEW_LINE>Point p = mainFrame.getLocationOnScreen();<NEW_LINE>Dimension d1 = mainFrame.getSize();<NEW_LINE>Dimension d2 = dialog.getSize();<NEW_LINE>dialog.setLocation(p.x + (d1.width - d2.width) / 2, p.y + (d1.height - d2.height) / 2);<NEW_LINE>dialog.pack();<NEW_LINE>}
(JMeterUtils.getResString("textbox_cancel"));
1,230,701
private void processMainServer(Map<Server, Long> servers, RouterConfig routerConfig, Map<String, Long> statistics, String group) {<NEW_LINE>for (Entry<String, Long> entry : statistics.entrySet()) {<NEW_LINE>try {<NEW_LINE>String domainName = entry.getKey();<NEW_LINE>Domain defaultDomainConfig = m_configManager.getRouterConfig().findDomain(domainName);<NEW_LINE><MASK><NEW_LINE>if (checkDomainConfig(group, defaultDomainConfig)) {<NEW_LINE>Domain domainConfig = routerConfig.findOrCreateDomain(domainName);<NEW_LINE>Server server = findMinServer(servers);<NEW_LINE>if (server != null) {<NEW_LINE>Group serverGroup = domainConfig.findOrCreateGroup(group);<NEW_LINE>Long oldValue = servers.get(server);<NEW_LINE>serverGroup.addServer(server);<NEW_LINE>servers.put(server, oldValue + value);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Domain domainConfig = routerConfig.findOrCreateDomain(domainName);<NEW_LINE>Group serverGroup = defaultDomainConfig.findGroup(group);<NEW_LINE>domainConfig.addGroup(serverGroup);<NEW_LINE>Server server = serverGroup.getServers().get(0);<NEW_LINE>Long oldValue = servers.get(server);<NEW_LINE>if (oldValue != null) {<NEW_LINE>servers.put(server, oldValue + value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Cat.logError(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Long value = entry.getValue();
521,730
private Collection<? extends TripToTripTransfer<T>> findStandardTransfers(TripStopTime<T> from) {<NEW_LINE>final List<TripToTripTransfer<T>> result = new ArrayList<>();<NEW_LINE>Iterator<? extends RaptorTransfer> transfers = stdTransfers.<MASK><NEW_LINE>while (transfers.hasNext()) {<NEW_LINE>var it = transfers.next();<NEW_LINE>int toStop = it.stop();<NEW_LINE>ConstrainedTransfer tx = transferServiceAdaptor.findTransfer(from, toTrip, toStop);<NEW_LINE>if (tx != null && tx.getTransferConstraint().isNotAllowed()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int earliestDepartureTime = earliestDepartureTime(from.time(), it.durationInSeconds(), tx);<NEW_LINE>int toTripStopPos = toTrip.findDepartureStopPosition(earliestDepartureTime, toStop);<NEW_LINE>if (toTripStopPos < 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>var to = TripStopTime.departure(toTrip, toTripStopPos);<NEW_LINE>boolean boardingPossible = to.trip().pattern().boardingPossibleAt(to.stopPosition());<NEW_LINE>if (boardingPossible) {<NEW_LINE>result.add(new TripToTripTransfer<>(from, to, it, tx));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
getTransfersFromStop(from.stop());
61,784
public CurrencyAmount presentValue(ResolvedFxNdf ndf, RatesProvider provider) {<NEW_LINE><MASK><NEW_LINE>if (provider.getValuationDate().isAfter(ndf.getPaymentDate())) {<NEW_LINE>return CurrencyAmount.zero(ccySettle);<NEW_LINE>}<NEW_LINE>Currency ccyOther = ndf.getNonDeliverableCurrency();<NEW_LINE>CurrencyAmount notionalSettle = ndf.getSettlementCurrencyNotional();<NEW_LINE>double agreedRate = ndf.getAgreedFxRate().fxRate(ccySettle, ccyOther);<NEW_LINE>double forwardRate = provider.fxIndexRates(ndf.getIndex()).rate(ndf.getObservation(), ccySettle);<NEW_LINE>double dfSettle = provider.discountFactor(ccySettle, ndf.getPaymentDate());<NEW_LINE>return notionalSettle.multipliedBy(dfSettle * (1d - agreedRate / forwardRate));<NEW_LINE>}
Currency ccySettle = ndf.getSettlementCurrency();
1,239,543
static Matcher extractPrefixFromOr(Matcher matcher) {<NEW_LINE>if (matcher instanceof OrMatcher) {<NEW_LINE>// Get the prefix for the first condition<NEW_LINE>List<Matcher> matchers = matcher.<OrMatcher>as().matchers();<NEW_LINE>if (matchers.isEmpty()) {<NEW_LINE>return matcher;<NEW_LINE>}<NEW_LINE>Matcher prefix = PatternUtils.getPrefix(matchers.get(0));<NEW_LINE>if (prefix.alwaysMatches()) {<NEW_LINE>return matcher;<NEW_LINE>}<NEW_LINE>List<Matcher> ms = new ArrayList<>();<NEW_LINE>ms.add(PatternUtils.getSuffix(matchers.get(0)));<NEW_LINE>// Verify all OR conditions have the same prefix<NEW_LINE>for (Matcher m : matchers.subList(1, matchers.size())) {<NEW_LINE>Matcher p = PatternUtils.getPrefix(m);<NEW_LINE>if (!prefix.equals(p)) {<NEW_LINE>return matcher;<NEW_LINE>}<NEW_LINE>ms.add<MASK><NEW_LINE>}<NEW_LINE>return SeqMatcher.create(prefix, OrMatcher.create(ms));<NEW_LINE>}<NEW_LINE>return matcher;<NEW_LINE>}
(PatternUtils.getSuffix(m));
1,794,731
private static RuntimeConverter createRuntimeConverter(TypeInformation<?> info) {<NEW_LINE>if (info.equals(Types.VOID)) {<NEW_LINE>return (csvMapper, container, obj) -> container.nullNode();<NEW_LINE>} else if (info.equals(Types.STRING)) {<NEW_LINE>return (csvMapper, container, obj) -> container.textNode((String) obj);<NEW_LINE>} else if (info.equals(Types.BOOLEAN)) {<NEW_LINE>return (csvMapper, container, obj) -> container.booleanNode((Boolean) obj);<NEW_LINE>} else if (info.equals(Types.BYTE)) {<NEW_LINE>return (csvMapper, container, obj) -> container.numberNode((Byte) obj);<NEW_LINE>} else if (info.equals(Types.SHORT)) {<NEW_LINE>return (csvMapper, container, obj) -> container.numberNode((Short) obj);<NEW_LINE>} else if (info.equals(Types.INT)) {<NEW_LINE>return (csvMapper, container, obj) -> container.numberNode((Integer) obj);<NEW_LINE>} else if (info.equals(Types.LONG)) {<NEW_LINE>return (csvMapper, container, obj) -> container.numberNode((Long) obj);<NEW_LINE>} else if (info.equals(Types.FLOAT)) {<NEW_LINE>return (csvMapper, container, obj) -> container.numberNode((Float) obj);<NEW_LINE>} else if (info.equals(Types.DOUBLE)) {<NEW_LINE>return (csvMapper, container, obj) -> container.numberNode((Double) obj);<NEW_LINE>} else if (info.equals(Types.BIG_DEC)) {<NEW_LINE>return (csvMapper, container, obj) -> container.numberNode((BigDecimal) obj);<NEW_LINE>} else if (info.equals(Types.BIG_INT)) {<NEW_LINE>return (csvMapper, container, obj) -> container.numberNode((BigInteger) obj);<NEW_LINE>} else if (info.equals(Types.SQL_DATE)) {<NEW_LINE>return (csvMapper, container, obj) -> container.<MASK><NEW_LINE>} else if (info.equals(Types.SQL_TIME)) {<NEW_LINE>return (csvMapper, container, obj) -> container.textNode(obj.toString());<NEW_LINE>} else if (info.equals(Types.SQL_TIMESTAMP)) {<NEW_LINE>return (csvMapper, container, obj) -> container.textNode(obj.toString());<NEW_LINE>} else if (info instanceof RowTypeInfo) {<NEW_LINE>return createRowRuntimeConverter((RowTypeInfo) info, false);<NEW_LINE>} else if (info instanceof BasicArrayTypeInfo) {<NEW_LINE>return createObjectArrayRuntimeConverter(((BasicArrayTypeInfo) info).getComponentInfo());<NEW_LINE>} else if (info instanceof ObjectArrayTypeInfo) {<NEW_LINE>return createObjectArrayRuntimeConverter(((ObjectArrayTypeInfo) info).getComponentInfo());<NEW_LINE>} else if (info instanceof PrimitiveArrayTypeInfo && ((PrimitiveArrayTypeInfo) info).getComponentType() == Types.BYTE) {<NEW_LINE>return createByteArrayRuntimeConverter();<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Unsupported type information '" + info + "'.");<NEW_LINE>}<NEW_LINE>}
textNode(obj.toString());
839,539
final SetVaultAccessPolicyResult executeSetVaultAccessPolicy(SetVaultAccessPolicyRequest setVaultAccessPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(setVaultAccessPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SetVaultAccessPolicyRequest> request = null;<NEW_LINE>Response<SetVaultAccessPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SetVaultAccessPolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(setVaultAccessPolicyRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SetVaultAccessPolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<SetVaultAccessPolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SetVaultAccessPolicyResultJsonUnmarshaller());<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.SERVICE_ID, "Glacier");
1,258,686
private PerformWorkResult performWork() {<NEW_LINE>final WFNode wfNode = getNode();<NEW_LINE>log.debug("Performing work for {}", wfNode);<NEW_LINE>if (wfNode.getPriority() != 0) {<NEW_LINE>setPriority(wfNode.getPriority());<NEW_LINE>}<NEW_LINE>final WFNodeAction action = wfNode.getAction();<NEW_LINE>if (WFNodeAction.WaitSleep.equals(action)) {<NEW_LINE>return performWork_WaitSleep();<NEW_LINE>} else if (WFNodeAction.DocumentAction.equals(action)) {<NEW_LINE>return performWork_DocumentAction();<NEW_LINE>} else if (WFNodeAction.AppsReport.equals(action)) {<NEW_LINE>performWork_AppsReport();<NEW_LINE>return PerformWorkResult.COMPLETED;<NEW_LINE>} else if (WFNodeAction.AppsProcess.equals(action)) {<NEW_LINE>performWork_AppsProcess();<NEW_LINE>return PerformWorkResult.COMPLETED;<NEW_LINE>} else if (WFNodeAction.EMail.equals(action)) {<NEW_LINE>performWork_EMail();<NEW_LINE>return PerformWorkResult.COMPLETED;<NEW_LINE>} else if (WFNodeAction.SetVariable.equals(action)) {<NEW_LINE>performWork_SetVariable();<NEW_LINE>return PerformWorkResult.COMPLETED;<NEW_LINE>} else if (WFNodeAction.SubWorkflow.equals(action)) {<NEW_LINE>throw new AdempiereException("Starting sub-workflow is not implemented yet");<NEW_LINE>} else if (WFNodeAction.UserChoice.equals(action)) {<NEW_LINE>return performWork_UserChoice();<NEW_LINE>} else if (WFNodeAction.UserForm.equals(action)) {<NEW_LINE>log.debug("Form:AD_Form_ID={}", wfNode.getAdFormId());<NEW_LINE>return PerformWorkResult.SUSPENDED;<NEW_LINE>} else if (WFNodeAction.UserWindow.equals(action)) {<NEW_LINE>log.debug("Window:AD_Window_ID={}", wfNode.getAdWindowId());<NEW_LINE>return PerformWorkResult.SUSPENDED;<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
throw new AdempiereException("Action not handled: " + action);
70,820
void retrieveSupplementalInfo() throws IOException {<NEW_LINE>CharSequence contents = HttpHelper.downloadViaHttp("https://www.googleapis.com/books/v1/volumes?q=isbn:" + <MASK><NEW_LINE>if (contents.length() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String title;<NEW_LINE>String pages;<NEW_LINE>Collection<String> authors = null;<NEW_LINE>try {<NEW_LINE>JSONObject topLevel = (JSONObject) new JSONTokener(contents.toString()).nextValue();<NEW_LINE>JSONArray items = topLevel.optJSONArray("items");<NEW_LINE>if (items == null || items.isNull(0)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JSONObject volumeInfo = ((JSONObject) items.get(0)).getJSONObject("volumeInfo");<NEW_LINE>if (volumeInfo == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>title = volumeInfo.optString("title");<NEW_LINE>pages = volumeInfo.optString("pageCount");<NEW_LINE>JSONArray authorsArray = volumeInfo.optJSONArray("authors");<NEW_LINE>if (authorsArray != null && !authorsArray.isNull(0)) {<NEW_LINE>authors = new ArrayList<String>(authorsArray.length());<NEW_LINE>for (int i = 0; i < authorsArray.length(); i++) {<NEW_LINE>authors.add(authorsArray.getString(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (JSONException e) {<NEW_LINE>throw new IOException(e.toString());<NEW_LINE>}<NEW_LINE>Collection<String> newTexts = new ArrayList<String>();<NEW_LINE>if (title != null && title.length() > 0) {<NEW_LINE>newTexts.add(title);<NEW_LINE>}<NEW_LINE>if (authors != null && !authors.isEmpty()) {<NEW_LINE>boolean first = true;<NEW_LINE>StringBuilder authorsText = new StringBuilder();<NEW_LINE>for (String author : authors) {<NEW_LINE>if (first) {<NEW_LINE>first = false;<NEW_LINE>} else {<NEW_LINE>authorsText.append(", ");<NEW_LINE>}<NEW_LINE>authorsText.append(author);<NEW_LINE>}<NEW_LINE>newTexts.add(authorsText.toString());<NEW_LINE>}<NEW_LINE>if (pages != null && pages.length() > 0) {<NEW_LINE>newTexts.add(pages + "pp.");<NEW_LINE>}<NEW_LINE>String baseBookUri = "http://www.google." + LocaleManager.getBookSearchCountryTLD(context) + "/search?tbm=bks&source=zxing&q=";<NEW_LINE>append(isbn, source, newTexts.toArray(new String[newTexts.size()]), baseBookUri + isbn);<NEW_LINE>}
isbn, HttpHelper.ContentType.JSON);
1,096,623
public void onBindViewHolder(final ViewHolder holder, int position) {<NEW_LINE>holder.textView.setText(items[position]);<NEW_LINE>holder.itemView.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>Intent i = new Intent(activity, LabelActivity.class);<NEW_LINE>i.putExtra(LabelActivity.EXTRA_TEXT, holder.textView.getText().toString() + " has been clicked");<NEW_LINE>activity.startActivity(i);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>holder.yesButton.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>Intent i = new <MASK><NEW_LINE>i.putExtra(LabelActivity.EXTRA_TEXT, "'yes' has been clicked");<NEW_LINE>activity.startActivity(i);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>holder.noButton.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>Intent i = new Intent(activity, LabelActivity.class);<NEW_LINE>i.putExtra(LabelActivity.EXTRA_TEXT, "'no' has been clicked");<NEW_LINE>activity.startActivity(i);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
Intent(activity, LabelActivity.class);
254,654
private void parseTrackFragmentHeader(MpegVersionedSectionInfo tfhd, MpegTrackFragmentHeader.Builder builder) throws IOException {<NEW_LINE>builder.setTrackId(reader.data.readInt());<NEW_LINE>if ((tfhd.flags & 0x000010) != 0) {<NEW_LINE>// Need to read default sample size, but first must skip the fields before it<NEW_LINE>if ((tfhd.flags & 0x000001) != 0) {<NEW_LINE>// Skip baseDataOffset<NEW_LINE>reader.data.readLong();<NEW_LINE>}<NEW_LINE>if ((tfhd.flags & 0x000002) != 0) {<NEW_LINE>// Skip sampleDescriptionIndex<NEW_LINE>reader.data.readInt();<NEW_LINE>}<NEW_LINE>if ((tfhd.flags & 0x000008) != 0) {<NEW_LINE>// Skip defaultSampleDuration<NEW_LINE>reader.data.readInt();<NEW_LINE>}<NEW_LINE>builder.setDefaultSampleSize(<MASK><NEW_LINE>}<NEW_LINE>}
reader.data.readInt());
367,970
public boolean isResource(String uri, User user) throws IOException {<NEW_LINE>uri = stripMapping(uri);<NEW_LINE>Logger.debug(this.getClass(), "In the Method isResource");<NEW_LINE>if (uri.endsWith("/")) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean returnValue = false;<NEW_LINE>// Host<NEW_LINE>String hostName = getHostname(uri);<NEW_LINE>Host host;<NEW_LINE>try {<NEW_LINE>host = hostAPI.findByName(hostName, user, false);<NEW_LINE>} catch (DotDataException e) {<NEW_LINE>Logger.error(DotWebdavHelper.class, e.getMessage(), e);<NEW_LINE>throw new IOException(e.getMessage(), e);<NEW_LINE>} catch (DotSecurityException e) {<NEW_LINE>Logger.error(DotWebdavHelper.class, <MASK><NEW_LINE>throw new IOException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>if (host == null) {<NEW_LINE>Logger.debug(this, "isResource Method: Host is NULL");<NEW_LINE>} else {<NEW_LINE>Logger.debug(this, "isResource Method: host id is " + host.getIdentifier() + " and the host name is " + host.getHostname());<NEW_LINE>}<NEW_LINE>// Folder<NEW_LINE>String path = getPath(uri);<NEW_LINE>String folderName = getFolderName(path);<NEW_LINE>Folder folder;<NEW_LINE>try {<NEW_LINE>folder = folderAPI.findFolderByPath(folderName, host, user, false);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.error(DotWebdavHelper.class, e.getMessage(), e);<NEW_LINE>throw new IOException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>if (folder != null && InodeUtils.isSet(folder.getInode())) {<NEW_LINE>// FileName<NEW_LINE>String fileName = getFileName(path);<NEW_LINE>fileName = deleteSpecialCharacter(fileName);<NEW_LINE>if (InodeUtils.isSet(host.getInode())) {<NEW_LINE>try {<NEW_LINE>returnValue = APILocator.getFileAssetAPI().fileNameExists(host, folder, fileName, "");<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Logger.debug(this, "Error verifying if file already exists", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return returnValue;<NEW_LINE>}
e.getMessage(), e);
383,107
protected Control createDialogArea(Composite parent) {<NEW_LINE>Composite composite = (<MASK><NEW_LINE>Composite editArea = new Composite(composite, SWT.NONE);<NEW_LINE>editArea.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL));<NEW_LINE>editArea.setLayout(new FormLayout());<NEW_LINE>ComboViewer comboURL = SWTHelper.createComboViewer(editArea);<NEW_LINE>comboURL.setContentProvider(ArrayContentProvider.getInstance());<NEW_LINE>comboURL.setLabelProvider(new LabelProvider() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getText(Object element) {<NEW_LINE>return ((RawResponse) element).getUrl();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>comboURL.setInput(rawResponses);<NEW_LINE>comboURL.addSelectionChangedListener(event -> {<NEW_LINE>RawResponse response = (RawResponse) event.getStructuredSelection().getFirstElement();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>rawText.setText(response.getContent() != null ? response.getContent() : "");<NEW_LINE>});<NEW_LINE>rawText = new Text(editArea, SWT.READ_ONLY | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);<NEW_LINE>//<NEW_LINE>FormDataFactory.startingWith(comboURL.getControl()).left(new FormAttachment(0, 10)).right(new FormAttachment(100, -10)).//<NEW_LINE>width(500).thenBelow(rawText, 10).left(new FormAttachment(0, 10)).right(new FormAttachment(100, -10)).width(500).height(300);<NEW_LINE>if (!rawResponses.isEmpty())<NEW_LINE>comboURL.setSelection(new StructuredSelection(rawResponses.get(0)));<NEW_LINE>return composite;<NEW_LINE>}
Composite) super.createDialogArea(parent);
1,300,355
public BaseConnectionParam createConnectionParams(BaseDataSourceParamDTO datasourceParam) {<NEW_LINE>RedshiftDataSourceParamDTO redshiftParam = (RedshiftDataSourceParamDTO) datasourceParam;<NEW_LINE>String address = String.format("%s%s:%s", Constants.JDBC_REDSHIFT, redshiftParam.getHost(), redshiftParam.getPort());<NEW_LINE>String jdbcUrl = address + Constants.SLASH + redshiftParam.getDatabase();<NEW_LINE>RedshiftConnectionParam redshiftConnectionParam = new RedshiftConnectionParam();<NEW_LINE>redshiftConnectionParam.setUser(redshiftParam.getUserName());<NEW_LINE>redshiftConnectionParam.setPassword(PasswordUtils.encodePassword(redshiftParam.getPassword()));<NEW_LINE>redshiftConnectionParam.setOther(transformOther(redshiftParam.getOther()));<NEW_LINE>redshiftConnectionParam.setAddress(address);<NEW_LINE>redshiftConnectionParam.setJdbcUrl(jdbcUrl);<NEW_LINE>redshiftConnectionParam.setDatabase(redshiftParam.getDatabase());<NEW_LINE><MASK><NEW_LINE>redshiftConnectionParam.setValidationQuery(getValidationQuery());<NEW_LINE>redshiftConnectionParam.setProps(redshiftParam.getOther());<NEW_LINE>return redshiftConnectionParam;<NEW_LINE>}
redshiftConnectionParam.setDriverClassName(getDatasourceDriver());
776,811
public static QuerySavingsPlansInstanceResponse unmarshall(QuerySavingsPlansInstanceResponse querySavingsPlansInstanceResponse, UnmarshallerContext _ctx) {<NEW_LINE>querySavingsPlansInstanceResponse.setRequestId(_ctx.stringValue("QuerySavingsPlansInstanceResponse.RequestId"));<NEW_LINE>querySavingsPlansInstanceResponse.setCode(_ctx.stringValue("QuerySavingsPlansInstanceResponse.Code"));<NEW_LINE>querySavingsPlansInstanceResponse.setMessage<MASK><NEW_LINE>querySavingsPlansInstanceResponse.setSuccess(_ctx.booleanValue("QuerySavingsPlansInstanceResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNum(_ctx.integerValue("QuerySavingsPlansInstanceResponse.Data.PageNum"));<NEW_LINE>data.setPageSize(_ctx.integerValue("QuerySavingsPlansInstanceResponse.Data.PageSize"));<NEW_LINE>data.setTotalCount(_ctx.integerValue("QuerySavingsPlansInstanceResponse.Data.TotalCount"));<NEW_LINE>List<SavingsPlansDetailResponse> items = new ArrayList<SavingsPlansDetailResponse>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QuerySavingsPlansInstanceResponse.Data.Items.Length"); i++) {<NEW_LINE>SavingsPlansDetailResponse savingsPlansDetailResponse = new SavingsPlansDetailResponse();<NEW_LINE>savingsPlansDetailResponse.setStatus(_ctx.stringValue("QuerySavingsPlansInstanceResponse.Data.Items[" + i + "].Status"));<NEW_LINE>savingsPlansDetailResponse.setCycle(_ctx.stringValue("QuerySavingsPlansInstanceResponse.Data.Items[" + i + "].Cycle"));<NEW_LINE>savingsPlansDetailResponse.setStartTimestamp(_ctx.longValue("QuerySavingsPlansInstanceResponse.Data.Items[" + i + "].StartTimestamp"));<NEW_LINE>savingsPlansDetailResponse.setSavingsType(_ctx.stringValue("QuerySavingsPlansInstanceResponse.Data.Items[" + i + "].SavingsType"));<NEW_LINE>savingsPlansDetailResponse.setUtilization(_ctx.stringValue("QuerySavingsPlansInstanceResponse.Data.Items[" + i + "].Utilization"));<NEW_LINE>savingsPlansDetailResponse.setPrepayFee(_ctx.stringValue("QuerySavingsPlansInstanceResponse.Data.Items[" + i + "].PrepayFee"));<NEW_LINE>savingsPlansDetailResponse.setInstanceId(_ctx.stringValue("QuerySavingsPlansInstanceResponse.Data.Items[" + i + "].InstanceId"));<NEW_LINE>savingsPlansDetailResponse.setCurrency(_ctx.stringValue("QuerySavingsPlansInstanceResponse.Data.Items[" + i + "].Currency"));<NEW_LINE>savingsPlansDetailResponse.setEndTimestamp(_ctx.longValue("QuerySavingsPlansInstanceResponse.Data.Items[" + i + "].EndTimestamp"));<NEW_LINE>savingsPlansDetailResponse.setEndTime(_ctx.stringValue("QuerySavingsPlansInstanceResponse.Data.Items[" + i + "].EndTime"));<NEW_LINE>savingsPlansDetailResponse.setStartTime(_ctx.stringValue("QuerySavingsPlansInstanceResponse.Data.Items[" + i + "].StartTime"));<NEW_LINE>savingsPlansDetailResponse.setAllocationStatus(_ctx.stringValue("QuerySavingsPlansInstanceResponse.Data.Items[" + i + "].AllocationStatus"));<NEW_LINE>savingsPlansDetailResponse.setInstanceFamily(_ctx.stringValue("QuerySavingsPlansInstanceResponse.Data.Items[" + i + "].InstanceFamily"));<NEW_LINE>savingsPlansDetailResponse.setRegion(_ctx.stringValue("QuerySavingsPlansInstanceResponse.Data.Items[" + i + "].Region"));<NEW_LINE>savingsPlansDetailResponse.setLastBillTotalUsage(_ctx.stringValue("QuerySavingsPlansInstanceResponse.Data.Items[" + i + "].LastBillTotalUsage"));<NEW_LINE>savingsPlansDetailResponse.setLastBillUtilization(_ctx.stringValue("QuerySavingsPlansInstanceResponse.Data.Items[" + i + "].LastBillUtilization"));<NEW_LINE>savingsPlansDetailResponse.setTotalSave(_ctx.stringValue("QuerySavingsPlansInstanceResponse.Data.Items[" + i + "].TotalSave"));<NEW_LINE>savingsPlansDetailResponse.setPoolValue(_ctx.stringValue("QuerySavingsPlansInstanceResponse.Data.Items[" + i + "].PoolValue"));<NEW_LINE>savingsPlansDetailResponse.setPayMode(_ctx.stringValue("QuerySavingsPlansInstanceResponse.Data.Items[" + i + "].PayMode"));<NEW_LINE>List<Tag> tags = new ArrayList<Tag>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("QuerySavingsPlansInstanceResponse.Data.Items[" + i + "].Tags.Length"); j++) {<NEW_LINE>Tag tag = new Tag();<NEW_LINE>tag.setKey(_ctx.stringValue("QuerySavingsPlansInstanceResponse.Data.Items[" + i + "].Tags[" + j + "].Key"));<NEW_LINE>tag.setValue(_ctx.stringValue("QuerySavingsPlansInstanceResponse.Data.Items[" + i + "].Tags[" + j + "].Value"));<NEW_LINE>tags.add(tag);<NEW_LINE>}<NEW_LINE>savingsPlansDetailResponse.setTags(tags);<NEW_LINE>items.add(savingsPlansDetailResponse);<NEW_LINE>}<NEW_LINE>data.setItems(items);<NEW_LINE>querySavingsPlansInstanceResponse.setData(data);<NEW_LINE>return querySavingsPlansInstanceResponse;<NEW_LINE>}
(_ctx.stringValue("QuerySavingsPlansInstanceResponse.Message"));
120,821
public static void unzipStreamToDirectory(InputStream rawIn, String dstDirName) throws IOException {<NEW_LINE>safeMakeDir(dstDirName);<NEW_LINE>File dstDir = new File(dstDirName);<NEW_LINE><MASK><NEW_LINE>ZipEntry ze = zin.getNextEntry();<NEW_LINE>while (ze != null) {<NEW_LINE>String fileName = ze.getName();<NEW_LINE>if (ze.isDirectory()) {<NEW_LINE>new File(dstDir.getAbsolutePath() + File.separator + fileName).mkdirs();<NEW_LINE>} else {<NEW_LINE>File newFile = new File(dstDir.getAbsolutePath() + File.separator + fileName);<NEW_LINE>File ppFile = new File(newFile.getParent());<NEW_LINE>ppFile.mkdirs();<NEW_LINE>FileOutputStream fos = new FileOutputStream(newFile);<NEW_LINE>IOUtils.copyLarge(zin, fos);<NEW_LINE>IOUtils.closeQuietly(fos);<NEW_LINE>}<NEW_LINE>ze = zin.getNextEntry();<NEW_LINE>}<NEW_LINE>zin.closeEntry();<NEW_LINE>zin.close();<NEW_LINE>}
ZipInputStream zin = new ZipInputStream(rawIn);
803,824
public static boolean start(final long id, final int after, final Context context) {<NEW_LINE>long curtime = SystemClock.elapsedRealtime();<NEW_LINE>if (0 > after) {<NEW_LINE>Log.e(TAG, "id:%d, after:%d", id, after);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (null == context) {<NEW_LINE>Log.e(TAG, "null==context, id:%d, after:%d", id, after);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>synchronized (alarm_waiting_set) {<NEW_LINE>if (null == wakerlock) {<NEW_LINE>wakerlock = new WakerLock(context);<NEW_LINE>Log.i(TAG, "start new wakerlock");<NEW_LINE>}<NEW_LINE>if (null == bc_alarm) {<NEW_LINE>bc_alarm = new Alarm();<NEW_LINE>context.registerReceiver(bc_alarm, new IntentFilter("ALARM_ACTION(" + String.valueOf(Process.myPid()) + ")"));<NEW_LINE>}<NEW_LINE>Iterator<Object[]> it = alarm_waiting_set.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>if ((Long) (it.next()[TSetData.ID.ordinal()]) == id) {<NEW_LINE>Log.e(TAG, "id exist=%d", id);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long waittime = after <MASK><NEW_LINE>PendingIntent pendingIntent = setAlarmMgr(id, waittime, context);<NEW_LINE>if (null == pendingIntent)<NEW_LINE>return false;<NEW_LINE>alarm_waiting_set.add(new Object[] { id, waittime, pendingIntent });<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
>= 0 ? curtime + after : curtime;
421,958
public okhttp3.Call readRuntimeClassCall(String name, String pretty, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/node.k8s.io/v1beta1/runtimeclasses/{name}".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (pretty != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "BearerToken" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
final String[] localVarContentTypes = {};
1,661,355
private void rebuildFileRootsCache() {<NEW_LINE>shortcutsRootsPanel.clear();<NEW_LINE>File[<MASK><NEW_LINE>driveCheckerListeners.clear();<NEW_LINE>for (final File root : roots) {<NEW_LINE>DriveCheckerListener listener = new DriveCheckerListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void rootMode(File root, RootMode mode) {<NEW_LINE>if (driveCheckerListeners.removeValue(this, true) == false)<NEW_LINE>return;<NEW_LINE>String initialName = root.toString();<NEW_LINE>if (initialName.equals("/"))<NEW_LINE>initialName = COMPUTER.get();<NEW_LINE>final ShortcutItem item = new ShortcutItem(root, initialName, style.iconDrive);<NEW_LINE>if (OsUtils.isWindows())<NEW_LINE>chooserWinService.addListener(root, item);<NEW_LINE>shortcutsRootsPanel.addActor(item);<NEW_LINE>shortcutsRootsPanel.getChildren().sort(SHORTCUTS_COMPARATOR);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>driveCheckerListeners.add(listener);<NEW_LINE>driveCheckerService.addListener(root, mode == Mode.OPEN ? RootMode.READABLE : RootMode.WRITABLE, listener);<NEW_LINE>}<NEW_LINE>}
] roots = File.listRoots();
66,051
public void onMatch(RelOptRuleCall call) {<NEW_LINE>final Project project = call.rel(0);<NEW_LINE>final DruidQuery query = call.rel(1);<NEW_LINE>final RelOptCluster cluster = project.getCluster();<NEW_LINE>final <MASK><NEW_LINE>if (!DruidQuery.isValidSignature(query.signature() + 'p')) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (canProjectAll(project.getProjects())) {<NEW_LINE>// All expressions can be pushed to Druid in their entirety.<NEW_LINE>final RelNode newProject = project.copy(project.getTraitSet(), ImmutableList.of(Util.last(query.rels)));<NEW_LINE>RelNode newNode = DruidQuery.extendQuery(query, newProject);<NEW_LINE>call.transformTo(newNode);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Pair<List<RexNode>, List<RexNode>> pair = splitProjects(rexBuilder, query, project.getProjects());<NEW_LINE>if (pair == null) {<NEW_LINE>// We can't push anything useful to Druid.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final List<RexNode> above = pair.left;<NEW_LINE>final List<RexNode> below = pair.right;<NEW_LINE>final RelDataTypeFactory.Builder builder = cluster.getTypeFactory().builder();<NEW_LINE>final RelNode input = Util.last(query.rels);<NEW_LINE>for (RexNode e : below) {<NEW_LINE>final String name;<NEW_LINE>if (e instanceof RexInputRef) {<NEW_LINE>name = input.getRowType().getFieldNames().get(((RexInputRef) e).getIndex());<NEW_LINE>} else {<NEW_LINE>name = null;<NEW_LINE>}<NEW_LINE>builder.add(name, e.getType());<NEW_LINE>}<NEW_LINE>final RelNode newProject = project.copy(project.getTraitSet(), input, below, builder.build());<NEW_LINE>final DruidQuery newQuery = DruidQuery.extendQuery(query, newProject);<NEW_LINE>final RelNode newProject2 = project.copy(project.getTraitSet(), newQuery, above, project.getRowType());<NEW_LINE>call.transformTo(newProject2);<NEW_LINE>}
RexBuilder rexBuilder = cluster.getRexBuilder();
127,092
private static List<ProductWithAvailabilityInfo> createProductWithAvailabilityInfos(@NonNull final LookupValue productLookupValue, @NonNull final ImmutableList<Group> availabilityInfoGroups, final boolean displayAvailabilityInfoOnlyIfPositive) {<NEW_LINE>final Set<ProductWithAvailabilityInfo> result = new LinkedHashSet<>();<NEW_LINE>ProductWithAvailabilityInfo productWithAvailabilityInfo_ALL = null;<NEW_LINE>ProductWithAvailabilityInfo productWithAvailabilityInfo_OTHERS = null;<NEW_LINE>for (final Group availabilityInfoGroup : availabilityInfoGroups) {<NEW_LINE>final ProductWithAvailabilityInfo productWithAvailabilityInfo = ProductWithAvailabilityInfo.builder().productId(productLookupValue.getIdAs(ProductId::ofRepoId)).productDisplayName(productLookupValue.getDisplayNameTrl()).qty(availabilityInfoGroup.getQty()).attributesType(availabilityInfoGroup.getType()).attributes(availabilityInfoGroup.<MASK><NEW_LINE>result.add(productWithAvailabilityInfo);<NEW_LINE>if (productWithAvailabilityInfo.getAttributesType() == Group.Type.ALL_STORAGE_KEYS) {<NEW_LINE>productWithAvailabilityInfo_ALL = productWithAvailabilityInfo;<NEW_LINE>} else if (productWithAvailabilityInfo.getAttributesType() == Group.Type.OTHER_STORAGE_KEYS) {<NEW_LINE>productWithAvailabilityInfo_OTHERS = productWithAvailabilityInfo;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// If OTHERS has the same Qty as ALL, remove OTHERS because it's pointless<NEW_LINE>if (productWithAvailabilityInfo_ALL != null && productWithAvailabilityInfo_OTHERS != null && Objects.equals(productWithAvailabilityInfo_OTHERS.getQty(), productWithAvailabilityInfo_ALL.getQty())) {<NEW_LINE>result.remove(productWithAvailabilityInfo_OTHERS);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Remove non-positive quantities if asked<NEW_LINE>if (displayAvailabilityInfoOnlyIfPositive) {<NEW_LINE>result.removeIf(productWithAvailabilityInfo -> productWithAvailabilityInfo.getQty().signum() <= 0);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Make sure we have at least one entry for each product<NEW_LINE>if (result.isEmpty()) {<NEW_LINE>result.add(ProductWithAvailabilityInfo.builder().productId(productLookupValue.getIdAs(ProductId::ofRepoId)).productDisplayName(productLookupValue.getDisplayNameTrl()).qty(null).build());<NEW_LINE>}<NEW_LINE>return ImmutableList.copyOf(result);<NEW_LINE>}
getAttributes()).build();
1,159,261
public boolean initializeRenderer(RenderPatchFactory rpf, String blkname, BitSet blockdatamask, Map<String, String> custparm) {<NEW_LINE>if (!super.initializeRenderer(rpf, blkname, blockdatamask, custparm))<NEW_LINE>return false;<NEW_LINE>// How many defined track IDs<NEW_LINE>String cnt = custparm.get("maxTrackId");<NEW_LINE>if (cnt != null) {<NEW_LINE>maxTrackId = Integer.parseInt(cnt);<NEW_LINE>} else {<NEW_LINE>maxTrackId = 35;<NEW_LINE>}<NEW_LINE>String patchid = custparm.get("patch");<NEW_LINE>if (patchid == null) {<NEW_LINE>Log.severe("Missing patch ID");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>basepatches = new RenderPatch[maxTrackId + 1][];<NEW_LINE>basepatches[0] = new RenderPatch[] { rpf.getNamedPatch(patchid, 0) };<NEW_LINE>if (basepatches[0][0] == null) {<NEW_LINE>Log.severe("Error getting patch : " + patchid);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>for (int i = 1; i <= maxTrackId; i++) {<NEW_LINE>basepatches[i] = new RenderPatch[] { rpf.getRotatedPatch(basepatches[0][0], 0<MASK><NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
, 0, 0, i) };
310,444
public static DynamicConfigAddQueueConfigCodec.RequestParameters decodeRequest(ClientMessage clientMessage) {<NEW_LINE>ClientMessage.ForwardFrameIterator iterator = clientMessage.frameIterator();<NEW_LINE>RequestParameters request = new RequestParameters();<NEW_LINE>ClientMessage.Frame initialFrame = iterator.next();<NEW_LINE>request.backupCount = decodeInt(initialFrame.content, REQUEST_BACKUP_COUNT_FIELD_OFFSET);<NEW_LINE>request.asyncBackupCount = decodeInt(initialFrame.content, REQUEST_ASYNC_BACKUP_COUNT_FIELD_OFFSET);<NEW_LINE>request.maxSize = decodeInt(initialFrame.content, REQUEST_MAX_SIZE_FIELD_OFFSET);<NEW_LINE>request.emptyQueueTtl = decodeInt(initialFrame.content, REQUEST_EMPTY_QUEUE_TTL_FIELD_OFFSET);<NEW_LINE>request.statisticsEnabled = decodeBoolean(initialFrame.content, REQUEST_STATISTICS_ENABLED_FIELD_OFFSET);<NEW_LINE>request.mergeBatchSize = <MASK><NEW_LINE>request.name = StringCodec.decode(iterator);<NEW_LINE>request.listenerConfigs = ListMultiFrameCodec.decodeNullable(iterator, ListenerConfigHolderCodec::decode);<NEW_LINE>request.splitBrainProtectionName = CodecUtil.decodeNullable(iterator, StringCodec::decode);<NEW_LINE>request.queueStoreConfig = CodecUtil.decodeNullable(iterator, QueueStoreConfigHolderCodec::decode);<NEW_LINE>request.mergePolicy = StringCodec.decode(iterator);<NEW_LINE>if (iterator.hasNext()) {<NEW_LINE>request.priorityComparatorClassName = CodecUtil.decodeNullable(iterator, StringCodec::decode);<NEW_LINE>request.isPriorityComparatorClassNameExists = true;<NEW_LINE>} else {<NEW_LINE>request.isPriorityComparatorClassNameExists = false;<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
decodeInt(initialFrame.content, REQUEST_MERGE_BATCH_SIZE_FIELD_OFFSET);
565,186
public static File createSymLink(@Nonnull String target, @Nonnull String link, boolean shouldExist) throws InterruptedException, IOException {<NEW_LINE>assertTrue(SystemInfo.isWindows || SystemInfo.isUnix);<NEW_LINE>final File targetFile = new File<MASK><NEW_LINE>final File linkFile = getFullLinkPath(link);<NEW_LINE>final ProcessBuilder command;<NEW_LINE>if (SystemInfo.isWindows) {<NEW_LINE>command = targetFile.isDirectory() ? new ProcessBuilder("cmd", "/C", "mklink", "/D", linkFile.getPath(), targetFile.getPath()) : new ProcessBuilder("cmd", "/C", "mklink", linkFile.getPath(), targetFile.getPath());<NEW_LINE>} else {<NEW_LINE>command = new ProcessBuilder("ln", "-s", targetFile.getPath(), linkFile.getPath());<NEW_LINE>}<NEW_LINE>final int res = runCommand(command);<NEW_LINE>assertEquals(command.command().toString(), 0, res);<NEW_LINE>shouldExist |= SystemInfo.isWindows && SystemInfo.JAVA_VERSION.startsWith("1.6");<NEW_LINE>assertEquals("target=" + target + ", link=" + linkFile, shouldExist, linkFile.exists());<NEW_LINE>return linkFile;<NEW_LINE>}
(FileUtil.toSystemDependentName(target));
1,046,197
private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String tapName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (tapName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter tapName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-05-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), resourceGroupName, tapName, apiVersion, this.client.<MASK><NEW_LINE>}
getSubscriptionId(), accept, context);
1,552,262
void draw(Graphics g) {<NEW_LINE>setBbox(point1, point2, opheight * 2);<NEW_LINE>setVoltageColor(g, volts[0]);<NEW_LINE>drawThickLine(g, in1p[0], in1p[1]);<NEW_LINE>setVoltageColor(g, volts[1]);<NEW_LINE>drawThickLine(g, in2p[0], in2p[1]);<NEW_LINE>setVoltageColor(g, volts[2]);<NEW_LINE>drawThickLine(g, lead2, point2);<NEW_LINE>setVoltageColor(g, volts[3]);<NEW_LINE>drawThickLine(g, rail1p[0], rail1p[1]);<NEW_LINE>setVoltageColor(g, volts[4]);<NEW_LINE>drawThickLine(g, rail2p[0], rail2p[1]);<NEW_LINE>g.setColor(<MASK><NEW_LINE>setPowerColor(g, true);<NEW_LINE>drawThickPolygon(g, triangle);<NEW_LINE>g.setFont(plusFont);<NEW_LINE>drawCenteredText(g, "-", textp[0].x, textp[0].y - 2, true);<NEW_LINE>drawCenteredText(g, "+", textp[1].x, textp[1].y, true);<NEW_LINE>int i;<NEW_LINE>for (i = 0; i != 5; i++) curCounts[i] = updateDotCount(getCurrentIntoNode(i), curCounts[i]);<NEW_LINE>drawDots(g, in1p[1], in1p[0], curCounts[0]);<NEW_LINE>drawDots(g, in2p[1], in2p[0], curCounts[1]);<NEW_LINE>drawDots(g, lead2, point2, curCounts[2]);<NEW_LINE>// these two segments may not be an event multiple of gridSize so we draw them the other way so the dots line up<NEW_LINE>drawDots(g, rail1p[0], rail1p[1], -curCounts[3]);<NEW_LINE>drawDots(g, rail2p[0], rail2p[1], -curCounts[4]);<NEW_LINE>drawPosts(g);<NEW_LINE>}
needsHighlight() ? selectColor : lightGrayColor);
743,820
@Path("{id}/delete")<NEW_LINE>public Response deletePid(@PathParam("id") String idSupplied) {<NEW_LINE>try {<NEW_LINE>Dataset dataset = findDatasetOrDie(idSupplied);<NEW_LINE>// Restrict to never-published datasets (that should have draft/nonpublic pids). The underlying code will invalidate<NEW_LINE>// pids that have been made public by a pid-specific method, but it's not clear that invalidating such a pid via an api that doesn't<NEW_LINE>// destroy the dataset is a good idea.<NEW_LINE>if (dataset.isReleased()) {<NEW_LINE>return badRequest("Not allowed for Datasets that have been published.");<NEW_LINE>}<NEW_LINE>execCommand(new DeletePidCommand(createDataverseRequest(findUserOrDie()), dataset));<NEW_LINE>return ok(BundleUtil.getStringFromBundle("pids.api.deletePid.success", Arrays.asList(dataset.getGlobalId(<MASK><NEW_LINE>} catch (WrappedResponse ex) {<NEW_LINE>return ex.getResponse();<NEW_LINE>}<NEW_LINE>}
).asString())));
1,664,532
final DeleteVoiceConnectorOriginationResult executeDeleteVoiceConnectorOrigination(DeleteVoiceConnectorOriginationRequest deleteVoiceConnectorOriginationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteVoiceConnectorOriginationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteVoiceConnectorOriginationRequest> request = null;<NEW_LINE>Response<DeleteVoiceConnectorOriginationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteVoiceConnectorOriginationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteVoiceConnectorOriginationRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Chime");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteVoiceConnectorOrigination");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteVoiceConnectorOriginationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteVoiceConnectorOriginationResultJsonUnmarshaller());<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.CLIENT_ENDPOINT, endpoint);
471,150
final DeleteUtterancesResult executeDeleteUtterances(DeleteUtterancesRequest deleteUtterancesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteUtterancesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteUtterancesRequest> request = null;<NEW_LINE>Response<DeleteUtterancesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteUtterancesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteUtterancesRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteUtterances");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteUtterancesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteUtterancesResultJsonUnmarshaller());<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.SERVICE_ID, "Lex Model Building Service");
1,752,035
protected void addSubscriptionToMessage(MESubscription subscription, boolean isLocalBus) {<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "addSubscriptionToMessage", new Object[] { subscription, new Boolean(isLocalBus) });<NEW_LINE>// Add the subscription related information.<NEW_LINE>iTopics.add(subscription.getTopic());<NEW_LINE>if (isLocalBus) {<NEW_LINE>// see defect 267686:<NEW_LINE>// local bus subscriptions expect the subscribing ME's<NEW_LINE>// detination uuid to be set in the iTopicSpaces field<NEW_LINE>iTopicSpaces.add(subscription.getTopicSpaceUuid().toString());<NEW_LINE>} else {<NEW_LINE>// see defect 267686:<NEW_LINE>// foreign bus subscriptions need to set the subscribers's topic space name.<NEW_LINE>// This is because the messages sent to this topic over the link<NEW_LINE>// will need to have a routing destination set, which requires<NEW_LINE>// this value.<NEW_LINE>iTopicSpaces.add(subscription.<MASK><NEW_LINE>}<NEW_LINE>iTopicSpaceMappings.add(subscription.getForeignTSName());<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "addSubscriptionToMessage");<NEW_LINE>}
getTopicSpaceName().toString());
38,817
public void enterS_interface_nve(S_interface_nveContext ctx) {<NEW_LINE>int line = ctx<MASK><NEW_LINE>int first = toInteger(ctx.nverange.iname.first);<NEW_LINE>int last = ctx.nverange.last != null ? toInteger(ctx.nverange.last) : first;<NEW_LINE>// flip first and last if range is backwards<NEW_LINE>if (last < first) {<NEW_LINE>int tmp = last;<NEW_LINE>last = first;<NEW_LINE>first = tmp;<NEW_LINE>}<NEW_LINE>_currentNves = IntStream.range(first, last + 1).mapToObj(i -> {<NEW_LINE>String nveName = "nve" + i;<NEW_LINE>_c.defineStructure(NVE, nveName, ctx);<NEW_LINE>_c.referenceStructure(NVE, nveName, NVE_SELF_REFERENCE, line);<NEW_LINE>return _c.getNves().computeIfAbsent(i, n -> new Nve(n));<NEW_LINE>}).collect(ImmutableList.toImmutableList());<NEW_LINE>}
.getStart().getLine();
373,274
protected void updatePolyBuffers(boolean lit, boolean tex, boolean needNormals, boolean needTexCoords) {<NEW_LINE>createPolyBuffers(PGL.bufferUsageImmediate);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPolyVertex.glId);<NEW_LINE>tessGeo.copyPolyVertices(PGL.bufferUsageImmediate);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPolyColor.glId);<NEW_LINE>tessGeo.copyPolyColors(PGL.bufferUsageImmediate);<NEW_LINE>if (lit) {<NEW_LINE>pgl.bindBuffer(<MASK><NEW_LINE>tessGeo.copyPolyAmbient(PGL.bufferUsageImmediate);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPolySpecular.glId);<NEW_LINE>tessGeo.copyPolySpecular(PGL.bufferUsageImmediate);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPolyEmissive.glId);<NEW_LINE>tessGeo.copyPolyEmissive(PGL.bufferUsageImmediate);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPolyShininess.glId);<NEW_LINE>tessGeo.copyPolyShininess(PGL.bufferUsageImmediate);<NEW_LINE>}<NEW_LINE>if (lit || needNormals) {<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPolyNormal.glId);<NEW_LINE>tessGeo.copyPolyNormals(PGL.bufferUsageImmediate);<NEW_LINE>}<NEW_LINE>if (tex || needTexCoords) {<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPolyTexcoord.glId);<NEW_LINE>tessGeo.copyPolyTexCoords(PGL.bufferUsageImmediate);<NEW_LINE>}<NEW_LINE>for (String name : polyAttribs.keySet()) {<NEW_LINE>VertexAttribute attrib = polyAttribs.get(name);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, attrib.buf.glId);<NEW_LINE>tessGeo.copyPolyAttribs(attrib, PGL.bufferUsageImmediate);<NEW_LINE>}<NEW_LINE>pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, bufPolyIndex.glId);<NEW_LINE>tessGeo.copyPolyIndices(PGL.bufferUsageImmediate);<NEW_LINE>}
PGL.ARRAY_BUFFER, bufPolyAmbient.glId);
567,426
@JSONP<NEW_LINE>@NoCache<NEW_LINE>@Consumes(MediaType.APPLICATION_JSON)<NEW_LINE>@Produces({ MediaType.APPLICATION_JSON, "application/javascript" })<NEW_LINE>public Response deleteVersion(@Context final HttpServletRequest httpRequest, @Context final HttpServletResponse httpResponse, @PathParam("versionableInode") final String versionableInode) throws DotSecurityException, DotDataException {<NEW_LINE>final InitDataObject initData = new WebResource.InitBuilder(this.webResource).requestAndResponse(httpRequest, httpResponse).rejectWhenNoUser(true).init();<NEW_LINE>final <MASK><NEW_LINE>final PageMode mode = PageMode.get(httpRequest);<NEW_LINE>Logger.debug(this, () -> "Deleting the version by inode: " + versionableInode);<NEW_LINE>final String type = Try.of(() -> InodeUtils.getAssetTypeFromDB(versionableInode)).getOrNull();<NEW_LINE>if (null == type) {<NEW_LINE>throw new DoesNotExistException("The versionable inode: " + versionableInode + " does not exists");<NEW_LINE>}<NEW_LINE>this.versionableHelper.getAssetTypeByVersionableDeleteMap().getOrDefault(type, this.versionableHelper.getDefaultVersionableDeleteStrategy()).deleteVersionByInode(versionableInode, user, mode.respectAnonPerms);<NEW_LINE>return Response.ok(new ResponseEntityView("Version " + versionableInode + " deleted successfully")).build();<NEW_LINE>}
User user = initData.getUser();
1,507,155
public Mono<Void> withoutFallback(final ServerWebExchange exchange, final Throwable throwable) {<NEW_LINE>Object error;<NEW_LINE>if (throwable instanceof DegradeException) {<NEW_LINE>exchange.getResponse().setStatusCode(HttpStatus.INTERNAL_SERVER_ERROR);<NEW_LINE>error = ShenyuResultWrap.error(exchange, ShenyuResultEnum.SERVICE_RESULT_ERROR);<NEW_LINE>} else if (throwable instanceof FlowException) {<NEW_LINE>exchange.getResponse().setStatusCode(HttpStatus.TOO_MANY_REQUESTS);<NEW_LINE>error = ShenyuResultWrap.error(exchange, ShenyuResultEnum.TOO_MANY_REQUESTS);<NEW_LINE>} else if (throwable instanceof BlockException) {<NEW_LINE>exchange.getResponse().setStatusCode(HttpStatus.TOO_MANY_REQUESTS);<NEW_LINE>error = ShenyuResultWrap.error(exchange, ShenyuResultEnum.SENTINEL_BLOCK_ERROR);<NEW_LINE>} else {<NEW_LINE>return Mono.error(throwable);<NEW_LINE>}<NEW_LINE>return <MASK><NEW_LINE>}
WebFluxResultUtils.result(exchange, error);
808,598
private static Map<String, Object> defToMap(Map<FieldDef, String> entMap) {<NEW_LINE>Map<String, Object> dataMap = new HashMap<>();<NEW_LINE>dataMap.computeIfAbsent("pub_id", s -> entMap.get(ID));<NEW_LINE>dataMap.computeIfAbsent("pub_api_id", s -> entMap.get(API_ID));<NEW_LINE>dataMap.computeIfAbsent("pub_method", s -> entMap.get(METHOD));<NEW_LINE>dataMap.computeIfAbsent("pub_path", s -> entMap.get(PATH));<NEW_LINE>dataMap.computeIfAbsent("pub_status", s -> entMap.get(STATUS));<NEW_LINE>dataMap.computeIfAbsent("pub_comment", s -> entMap.get(COMMENT));<NEW_LINE>dataMap.computeIfAbsent("pub_type", s -> entMap.get(TYPE));<NEW_LINE>dataMap.computeIfAbsent("pub_script", s -> entMap.get(SCRIPT));<NEW_LINE>dataMap.computeIfAbsent("pub_script_ori", s -> entMap.get(SCRIPT_ORI));<NEW_LINE>//<NEW_LINE>dataMap.computeIfAbsent("pub_schema", s -> {<NEW_LINE>StringBuilder schemaData = new StringBuilder();<NEW_LINE>schemaData.append("{");<NEW_LINE>schemaData.append("\"requestHeader\":" + entMap<MASK><NEW_LINE>schemaData.append("\"requestBody\":" + entMap.get(REQ_BODY_SCHEMA) + ",");<NEW_LINE>schemaData.append("\"responseHeader\":" + entMap.get(RES_HEADER_SCHEMA) + ",");<NEW_LINE>schemaData.append("\"responseBody\":" + entMap.get(RES_BODY_SCHEMA));<NEW_LINE>schemaData.append("}");<NEW_LINE>return schemaData.toString();<NEW_LINE>});<NEW_LINE>//<NEW_LINE>dataMap.computeIfAbsent("pub_sample", s -> {<NEW_LINE>StringBuffer sampleData = new StringBuffer();<NEW_LINE>sampleData.append("{");<NEW_LINE>sampleData.append("\"requestHeader\":" + JSON.toJSONString(entMap.get(REQ_HEADER_SAMPLE)) + ",");<NEW_LINE>sampleData.append("\"requestBody\":" + JSON.toJSONString(entMap.get(REQ_BODY_SAMPLE)) + ",");<NEW_LINE>sampleData.append("\"responseHeader\":" + JSON.toJSONString(entMap.get(RES_HEADER_SAMPLE)) + ",");<NEW_LINE>sampleData.append("\"responseBody\":" + JSON.toJSONString(entMap.get(RES_BODY_SAMPLE)));<NEW_LINE>sampleData.append("}");<NEW_LINE>return sampleData.toString();<NEW_LINE>});<NEW_LINE>//<NEW_LINE>dataMap.computeIfAbsent("pub_option", s -> entMap.get(OPTION));<NEW_LINE>dataMap.computeIfAbsent("pub_release_time", s -> entMap.get(RELEASE_TIME));<NEW_LINE>return dataMap;<NEW_LINE>}
.get(REQ_HEADER_SCHEMA) + ",");
379,103
public void trsm(char Order, char Side, char Uplo, char TransA, char Diag, double alpha, INDArray A, INDArray B) {<NEW_LINE>if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL)<NEW_LINE>OpProfiler.getInstance().processBlasCall(false, A, B);<NEW_LINE>if (A.rows() > Integer.MAX_VALUE || A.columns() > Integer.MAX_VALUE || A.size(0) > Integer.MAX_VALUE || B.size(0) > Integer.MAX_VALUE) {<NEW_LINE>throw new ND4JArraySizeException();<NEW_LINE>}<NEW_LINE>if (A.data().dataType() == DataType.DOUBLE) {<NEW_LINE>DefaultOpExecutioner.validateDataType(DataType.DOUBLE, A, B);<NEW_LINE>dtrsm(Order, Side, Uplo, TransA, Diag, (int) A.rows(), (int) A.columns(), alpha, A, (int) A.size(0), B, (int<MASK><NEW_LINE>} else {<NEW_LINE>DefaultOpExecutioner.validateDataType(DataType.FLOAT, A, B);<NEW_LINE>strsm(Order, Side, Uplo, TransA, Diag, (int) A.rows(), (int) A.columns(), (float) alpha, A, (int) A.size(0), B, (int) B.size(0));<NEW_LINE>}<NEW_LINE>OpExecutionerUtil.checkForAny(B);<NEW_LINE>}
) B.size(0));
1,839,608
private Test createAotTestTask(Project project, SourceSetContainer sourceSets, Jar generatedTestSourcesJar) {<NEW_LINE>Test test = project.getTasks().<MASK><NEW_LINE>test.useJUnitPlatform();<NEW_LINE>test.setTestClassesDirs(sourceSets.findByName(SourceSet.TEST_SOURCE_SET_NAME).getOutput().getClassesDirs());<NEW_LINE>// Prepend the generatedTestSourcesJar to the classpath so that generated code<NEW_LINE>// overrides any types already in the classpath -- for example, the standard<NEW_LINE>// SpringFactoriesLoader implementation in spring-core must be overridden by<NEW_LINE>// the SpringFactoriesLoader implementation that uses StaticSpringFactories.<NEW_LINE>FileCollection classpath = project.files(project.files(generatedTestSourcesJar.getArchiveFile()), test.getClasspath());<NEW_LINE>test.setClasspath(classpath);<NEW_LINE>test.systemProperty("spring.test.context.default.CacheAwareContextLoaderDelegate", "org.springframework.aot.test.AotCacheAwareContextLoaderDelegate");<NEW_LINE>return test;<NEW_LINE>}
create(AOT_TEST_TASK_NAME, Test.class);
137,286
public Dialog create() {<NEW_LINE>// Get resources<NEW_LINE>final WebView webView = createWebView(mContext, mEnableDarkMode);<NEW_LINE>webView.loadDataWithBaseURL(null, mLicensesText, "text/html", "utf-8", null);<NEW_LINE>final AlertDialog.Builder builder;<NEW_LINE>if (mThemeResourceId != 0) {<NEW_LINE>builder = new AlertDialog.Builder(new ContextThemeWrapper(mContext, mThemeResourceId));<NEW_LINE>} else {<NEW_LINE>builder = new AlertDialog.Builder(mContext);<NEW_LINE>}<NEW_LINE>builder.setTitle(mTitleText).setView(webView).setPositiveButton(mCloseText, (dialogInterface, i<MASK><NEW_LINE>final AlertDialog dialog = builder.create();<NEW_LINE>dialog.setOnDismissListener(dialog1 -> {<NEW_LINE>if (mOnDismissListener != null) {<NEW_LINE>mOnDismissListener.onDismiss(dialog1);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>dialog.setOnShowListener(dialogInterface -> {<NEW_LINE>if (mDividerColor != 0) {<NEW_LINE>// Set title divider color<NEW_LINE>final int titleDividerId = mContext.getResources().getIdentifier("titleDivider", "id", "android");<NEW_LINE>final View titleDivider = dialog.findViewById(titleDividerId);<NEW_LINE>if (titleDivider != null) {<NEW_LINE>titleDivider.setBackgroundColor(mDividerColor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return dialog;<NEW_LINE>}
) -> dialogInterface.dismiss());
556,970
public static DescriptorMapping withDefaults() {<NEW_LINE>final DescriptorMapping mapping = new DescriptorMapping();<NEW_LINE>mapping.register(Object.class, new ObjectDescriptor());<NEW_LINE>mapping.register(ApplicationWrapper.class, new ApplicationDescriptor());<NEW_LINE>mapping.register(Activity.class, new ActivityDescriptor());<NEW_LINE>mapping.register(Window.class, new WindowDescriptor());<NEW_LINE>mapping.register(ViewGroup.class, new ViewGroupDescriptor());<NEW_LINE>mapping.register(View.class, new ViewDescriptor());<NEW_LINE>mapping.register(TextView.class, new TextViewDescriptor());<NEW_LINE>mapping.register(ImageView.class, new ImageViewDescriptor());<NEW_LINE>mapping.register(Drawable.class, new DrawableDescriptor());<NEW_LINE>mapping.register(Dialog<MASK><NEW_LINE>mapping.register(android.app.Fragment.class, new FragmentDescriptor());<NEW_LINE>mapping.register(androidx.fragment.app.Fragment.class, new SupportFragmentDescriptor());<NEW_LINE>mapping.register(android.app.DialogFragment.class, new DialogFragmentDescriptor());<NEW_LINE>mapping.register(androidx.fragment.app.DialogFragment.class, new SupportDialogFragmentDescriptor());<NEW_LINE>return mapping;<NEW_LINE>}
.class, new DialogDescriptor());
1,412,133
public void marshall(SendTextMessageRequest sendTextMessageRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (sendTextMessageRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(sendTextMessageRequest.getDestinationPhoneNumber(), DESTINATIONPHONENUMBER_BINDING);<NEW_LINE>protocolMarshaller.marshall(sendTextMessageRequest.getOriginationIdentity(), ORIGINATIONIDENTITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(sendTextMessageRequest.getMessageBody(), MESSAGEBODY_BINDING);<NEW_LINE>protocolMarshaller.marshall(sendTextMessageRequest.getMessageType(), MESSAGETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(sendTextMessageRequest.getConfigurationSetName(), CONFIGURATIONSETNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(sendTextMessageRequest.getMaxPrice(), MAXPRICE_BINDING);<NEW_LINE>protocolMarshaller.marshall(sendTextMessageRequest.getTimeToLive(), TIMETOLIVE_BINDING);<NEW_LINE>protocolMarshaller.marshall(sendTextMessageRequest.getContext(), CONTEXT_BINDING);<NEW_LINE>protocolMarshaller.marshall(sendTextMessageRequest.getDestinationCountryParameters(), DESTINATIONCOUNTRYPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(sendTextMessageRequest.getDryRun(), DRYRUN_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
sendTextMessageRequest.getKeyword(), KEYWORD_BINDING);
842,563
public void deleteById(String id) {<NEW_LINE>String resourceGroupName = <MASK><NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String automationAccountName = Utils.getValueFromIdByName(id, "automationAccounts");<NEW_LINE>if (automationAccountName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'automationAccounts'.", id)));<NEW_LINE>}<NEW_LINE>String connectionName = Utils.getValueFromIdByName(id, "connections");<NEW_LINE>if (connectionName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id)));<NEW_LINE>}<NEW_LINE>this.deleteWithResponse(resourceGroupName, automationAccountName, connectionName, Context.NONE).getValue();<NEW_LINE>}
Utils.getValueFromIdByName(id, "resourceGroups");
320,925
public static QueryMapVersionsResponse unmarshall(QueryMapVersionsResponse queryMapVersionsResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryMapVersionsResponse.setRequestId(_ctx.stringValue("QueryMapVersionsResponse.RequestId"));<NEW_LINE>queryMapVersionsResponse.setMessage(_ctx.stringValue("QueryMapVersionsResponse.Message"));<NEW_LINE>queryMapVersionsResponse.setErrorCode(_ctx.stringValue("QueryMapVersionsResponse.ErrorCode"));<NEW_LINE>queryMapVersionsResponse.setErrorMessage(_ctx.stringValue("QueryMapVersionsResponse.ErrorMessage"));<NEW_LINE>queryMapVersionsResponse.setDynamicMessage(_ctx.stringValue("QueryMapVersionsResponse.DynamicMessage"));<NEW_LINE>queryMapVersionsResponse.setSuccess<MASK><NEW_LINE>queryMapVersionsResponse.setDynamicCode(_ctx.stringValue("QueryMapVersionsResponse.DynamicCode"));<NEW_LINE>queryMapVersionsResponse.setCode(_ctx.stringValue("QueryMapVersionsResponse.Code"));<NEW_LINE>List<EmapVersion> versions = new ArrayList<EmapVersion>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryMapVersionsResponse.Versions.Length"); i++) {<NEW_LINE>EmapVersion emapVersion = new EmapVersion();<NEW_LINE>emapVersion.setVersion(_ctx.stringValue("QueryMapVersionsResponse.Versions[" + i + "].Version"));<NEW_LINE>versions.add(emapVersion);<NEW_LINE>}<NEW_LINE>queryMapVersionsResponse.setVersions(versions);<NEW_LINE>return queryMapVersionsResponse;<NEW_LINE>}
(_ctx.booleanValue("QueryMapVersionsResponse.Success"));
961,662
private boolean handleUnescapedQuote() {<NEW_LINE>unescaped = true;<NEW_LINE>switch(quoteHandling) {<NEW_LINE>case BACK_TO_DELIMITER:<NEW_LINE>int pos;<NEW_LINE>int lastPos = 0;<NEW_LINE>while ((pos = nextDelimiter()) != -1) {<NEW_LINE>lastPos = pos;<NEW_LINE>String value = output.appender.substring(0, pos);<NEW_LINE>if (keepQuotes && output.appender.charAt(pos - 1) == quote) {<NEW_LINE>value += quote;<NEW_LINE>}<NEW_LINE>output.valueParsed(value);<NEW_LINE>if (output.appender.charAt(pos) == newLine) {<NEW_LINE>output.pendingRecords.add(output.rowParsed());<NEW_LINE>output.appender.remove(0, pos + 1);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (multiDelimiter == null) {<NEW_LINE>output.appender.remove(0, pos + 1);<NEW_LINE>} else {<NEW_LINE>output.appender.remove(0, pos + multiDelimiter.length);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (keepQuotes && input.lastIndexOf(quote) > lastPos) {<NEW_LINE>output.appender.append(quote);<NEW_LINE>}<NEW_LINE>output.appender.append(ch);<NEW_LINE>prev = '\0';<NEW_LINE>if (multiDelimiter == null) {<NEW_LINE>parseQuotedValue();<NEW_LINE>} else {<NEW_LINE>parseQuotedValueMultiDelimiter();<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>case STOP_AT_CLOSING_QUOTE:<NEW_LINE>case STOP_AT_DELIMITER:<NEW_LINE><MASK><NEW_LINE>output.appender.append(ch);<NEW_LINE>prev = ch;<NEW_LINE>if (multiDelimiter == null) {<NEW_LINE>parseQuotedValue();<NEW_LINE>} else {<NEW_LINE>parseQuotedValueMultiDelimiter();<NEW_LINE>}<NEW_LINE>// continue;<NEW_LINE>return true;<NEW_LINE>default:<NEW_LINE>handleValueSkipping(true);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
output.appender.append(quote);
1,074,168
public void visit(Plugin target) {<NEW_LINE>Plugin t = target;<NEW_LINE>assert t != null ? t.isInDocumentModel() : true;<NEW_LINE>POMQNames names = parent.getPOMQNames();<NEW_LINE>checkChildString(names.GROUPID, GROUPID(), t != null ? t.getGroupId() : null);<NEW_LINE>checkChildString(names.ARTIFACTID, ARTIFACTID(), t != null ? t.getArtifactId() : null);<NEW_LINE>checkChildString(names.VERSION, VERSION(), t != null ? t.getVersion() : null);<NEW_LINE>checkChildString(names.EXTENSIONS, EXTENSIONS(), t != null ? (t.isExtensions() != null ? t.isExtensions().toString() : null) : null);<NEW_LINE>this.<PluginExecution>checkListObject(names.EXECUTIONS, names.EXECUTION, PluginExecution.class, EXECUTIONS(), t != null ? t.getExecutions() : null, new KeyGenerator<PluginExecution>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object generate(PluginExecution c) {<NEW_LINE>// NOI18N<NEW_LINE>return c.getId();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String createName(PluginExecution c) {<NEW_LINE>return c.getId() != null ? c<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>checkDependencies(t);<NEW_LINE>checkStringListObject(names.GOALS, names.GOAL, GOALS(), GOAL(), t != null ? t.getGoals() : null);<NEW_LINE>checkChildString(names.INHERITED, INHERITED(), t != null ? (t.isInherited() != null ? t.isInherited().toString() : null) : null);<NEW_LINE>checkChildObject(names.CONFIGURATION, Configuration.class, CONFIGURATION(), t != null ? t.getConfiguration() : null);<NEW_LINE>count++;<NEW_LINE>}
.getId() : EXECUTION();
1,224,442
protected Bound createBoundQuery(List<TypedValue> values) {<NEW_LINE>TypedValue[] internalBoundValues = new TypedValue[internalBindMarkers.size()];<NEW_LINE>for (int i = 0; i < internalWhereValues.size(); i++) {<NEW_LINE>Value<?> internalValue = internalWhereValues.get(i);<NEW_LINE>BindMarker internalMarker = internalBindMarkers.get(i);<NEW_LINE>TypedValue v = convertValue(internalValue, internalMarker.receiver(), internalMarker.type(), values);<NEW_LINE>int internalIndex = internalValue.internalIndex();<NEW_LINE>Preconditions.checkState(internalIndex >= 0);<NEW_LINE>internalBoundValues[internalIndex] = v;<NEW_LINE>}<NEW_LINE>WhereProcessor whereProcessor = new WhereProcessor(table, valueCodec()) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected TypedValue handleValue(String name, ColumnType type, Value<?> value) {<NEW_LINE>return convertValue(value, name, type, values);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>OptionalInt optLimit = OptionalInt.empty();<NEW_LINE>if (limit != null) {<NEW_LINE>TypedValue v = convertValue(limit, "[limit]", Type.Int, values);<NEW_LINE>int internalIndex = limit.internalIndex();<NEW_LINE>if (internalIndex >= 0) {<NEW_LINE>internalBoundValues[internalIndex] = v;<NEW_LINE>}<NEW_LINE>if (!v.isUnset()) {<NEW_LINE>Integer lvalue = (Integer) v.javaValue();<NEW_LINE>if (lvalue == null) {<NEW_LINE>throw new IllegalArgumentException("Cannot pass null as bound value for the LIMIT");<NEW_LINE>}<NEW_LINE>optLimit = OptionalInt.of(lvalue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>OptionalInt optPerPartitionLimit = OptionalInt.empty();<NEW_LINE>if (perPartitionLimit != null) {<NEW_LINE>TypedValue v = convertValue(perPartitionLimit, "[per-partition-limit]", Type.Int, values);<NEW_LINE>int internalIndex = perPartitionLimit.internalIndex();<NEW_LINE>if (internalIndex >= 0) {<NEW_LINE>internalBoundValues[internalIndex] = v;<NEW_LINE>}<NEW_LINE>if (!v.isUnset()) {<NEW_LINE>Integer lvalue = (Integer) v.javaValue();<NEW_LINE>if (lvalue == null) {<NEW_LINE>throw new IllegalArgumentException("Cannot pass null as bound value for the PER PARTITION LIMIT");<NEW_LINE>}<NEW_LINE>optPerPartitionLimit = OptionalInt.of(lvalue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Bound(this, values, Arrays.asList(internalBoundValues), whereProcessor.process<MASK><NEW_LINE>}
(whereClause), optLimit, optPerPartitionLimit);
1,020,151
public <T> CosmosPagedFlux<T> queryItemsOnEncryptedProperties(SqlQuerySpecWithEncryption sqlQuerySpecWithEncryption, CosmosQueryRequestOptions options, Class<T> classType) {<NEW_LINE>if (options == null) {<NEW_LINE>options = new CosmosQueryRequestOptions();<NEW_LINE>}<NEW_LINE>if (specWithEncryptionAccessor.getEncryptionParamMap(sqlQuerySpecWithEncryption).size() > 0) {<NEW_LINE>List<Mono<Void>> encryptionSqlParameterMonoList = new ArrayList<>();<NEW_LINE>for (Map.Entry<String, SqlParameter> entry : specWithEncryptionAccessor.getEncryptionParamMap(sqlQuerySpecWithEncryption).entrySet()) {<NEW_LINE>encryptionSqlParameterMonoList.add(specWithEncryptionAccessor.addEncryptionParameterAsync(sqlQuerySpecWithEncryption, entry.getKey(), entry<MASK><NEW_LINE>}<NEW_LINE>Mono<List<Void>> listMono = Flux.mergeSequential(encryptionSqlParameterMonoList).collectList();<NEW_LINE>Mono<SqlQuerySpec> sqlQuerySpecMono = listMono.flatMap(ignoreVoids -> Mono.just(specWithEncryptionAccessor.getSqlQuerySpec(sqlQuerySpecWithEncryption)));<NEW_LINE>return queryItemsHelperWithMonoSqlQuerySpec(sqlQuerySpecMono, sqlQuerySpecWithEncryption, options, classType, false);<NEW_LINE>} else {<NEW_LINE>return queryItemsHelper(specWithEncryptionAccessor.getSqlQuerySpec(sqlQuerySpecWithEncryption), options, classType, false);<NEW_LINE>}<NEW_LINE>}
.getValue(), this));
1,563,456
private List<Column> inferHeader(List<List<Object>> values) {<NEW_LINE>List<Object> typedValues = values.get(0);<NEW_LINE>LinkedList<Column> columns = new LinkedList<>();<NEW_LINE>boolean isHeader = typedValues.stream().allMatch(typedValue -> typedValue instanceof String);<NEW_LINE>if (isHeader) {<NEW_LINE>typedValues = values.size() > 1 ? values.get(1) : typedValues;<NEW_LINE>for (int i = 0; i < typedValues.size(); i++) {<NEW_LINE>Column column = new Column();<NEW_LINE>ValueType valueType = DataTypeUtils.javaType2DataType(typedValues.get(i));<NEW_LINE>column.setType(valueType);<NEW_LINE>String name = values.get(0).get(i).toString();<NEW_LINE>column.setName(StringUtils.isBlank(values.get(0).get(i).toString()) ? "col" + i : name);<NEW_LINE>columns.add(column);<NEW_LINE>}<NEW_LINE>values.remove(0);<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < typedValues.size(); i++) {<NEW_LINE>Column column = new Column();<NEW_LINE>ValueType valueType = DataTypeUtils.javaType2DataType<MASK><NEW_LINE>column.setType(valueType);<NEW_LINE>column.setName("column" + i);<NEW_LINE>columns.add(column);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return columns;<NEW_LINE>}
(typedValues.get(i));
1,386,781
private Mono<PagedResponse<IpGroupInner>> listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-05-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = <MASK><NEW_LINE>return service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null));<NEW_LINE>}
this.client.mergeContext(context);
77,153
private void readAllFields(PageCursor cursor) throws IOException {<NEW_LINE>do {<NEW_LINE>creationTimeField = getRecordValue(cursor, Position.TIME);<NEW_LINE>randomNumberField = getRecordValue(cursor, Position.RANDOM_NUMBER);<NEW_LINE>versionField = getRecordValue(cursor, Position.LOG_VERSION);<NEW_LINE>long lastCommittedTxId = getRecordValue(cursor, Position.LAST_TRANSACTION_ID);<NEW_LINE>lastCommittingTxField.set(lastCommittedTxId);<NEW_LINE>storeVersionField = getRecordValue(cursor, Position.STORE_VERSION);<NEW_LINE>getRecordValue(cursor, Position.FIRST_GRAPH_PROPERTY);<NEW_LINE>latestConstraintIntroducingTxField = getRecordValue(cursor, Position.LAST_CONSTRAINT_TRANSACTION);<NEW_LINE>upgradeTxIdField = getRecordValue(cursor, Position.UPGRADE_TRANSACTION_ID);<NEW_LINE>upgradeTxChecksumField = (int) getRecordValue(cursor, Position.UPGRADE_TRANSACTION_CHECKSUM);<NEW_LINE>upgradeTimeField = getRecordValue(cursor, Position.UPGRADE_TIME);<NEW_LINE>long lastClosedTransactionLogVersion = getRecordValue(cursor, Position.LAST_CLOSED_TRANSACTION_LOG_VERSION);<NEW_LINE>long lastClosedTransactionLogByteOffset = getRecordValue(cursor, Position.LAST_CLOSED_TRANSACTION_LOG_BYTE_OFFSET);<NEW_LINE>lastClosedTx.set(lastCommittedTxId, new long[] { lastClosedTransactionLogVersion, lastClosedTransactionLogByteOffset });<NEW_LINE>highestCommittedTransaction.set(lastCommittedTxId, (int) getRecordValue(cursor, Position.LAST_TRANSACTION_CHECKSUM), getRecordValue(cursor, Position.LAST_TRANSACTION_COMMIT_TIMESTAMP, UNKNOWN_TX_COMMIT_TIMESTAMP));<NEW_LINE>upgradeCommitTimestampField = getRecordValue(cursor, Position.UPGRADE_TRANSACTION_COMMIT_TIMESTAMP, BASE_TX_COMMIT_TIMESTAMP);<NEW_LINE>externalStoreUUID = readExternalStoreUUID(cursor);<NEW_LINE>databaseUUID = readDatabaseUUID(cursor);<NEW_LINE>upgradeTransaction = new TransactionId(upgradeTxIdField, upgradeTxChecksumField, upgradeCommitTimestampField);<NEW_LINE>checkpointLogVersionField = <MASK><NEW_LINE>kernelVersion = getRecordValue(cursor, KERNEL_VERSION);<NEW_LINE>} while (cursor.shouldRetry());<NEW_LINE>if (cursor.checkAndClearBoundsFlag()) {<NEW_LINE>throw new UnderlyingStorageException("Out of page bounds when reading all meta-data fields. The page in question is page " + cursor.getCurrentPageId() + " of file " + storageFile.toAbsolutePath() + ", which is " + cursor.getCurrentPageSize() + " bytes in size");<NEW_LINE>}<NEW_LINE>}
getRecordValue(cursor, CHECKPOINT_LOG_VERSION, 0);
649,112
public void onActivityResult(Activity a, int requestCode, int resultCode, Intent data) {<NEW_LINE>final ActivityEventListener ael = this;<NEW_LINE>mStripe.onSetupResult(requestCode, data, new ApiResultCallback<SetupIntentResult>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(@NonNull SetupIntentResult result) {<NEW_LINE>getReactApplicationContext().removeActivityEventListener(ael);<NEW_LINE>try {<NEW_LINE>switch(result.getIntent().getStatus()) {<NEW_LINE>case Canceled:<NEW_LINE>// The Setup Intent was canceled, so reject the promise with a predefined code.<NEW_LINE>promise.reject(CANCELLED, "The SetupIntent was canceled by the user.");<NEW_LINE>break;<NEW_LINE>case RequiresAction:<NEW_LINE>case RequiresPaymentMethod:<NEW_LINE>promise.reject(AUTHENTICATION_FAILED, "The user failed authentication.");<NEW_LINE>break;<NEW_LINE>case Succeeded:<NEW_LINE>promise<MASK><NEW_LINE>break;<NEW_LINE>case RequiresCapture:<NEW_LINE>case RequiresConfirmation:<NEW_LINE>default:<NEW_LINE>promise.reject(UNEXPECTED, "Unexpected state");<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>promise.reject(UNEXPECTED, "Unexpected error");<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(@NonNull Exception e) {<NEW_LINE>getReactApplicationContext().removeActivityEventListener(ael);<NEW_LINE>e.printStackTrace();<NEW_LINE>promise.reject(toErrorCode(e), e.getMessage());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
.resolve(convertSetupIntentResultToWritableMap(result));
194,213
public PointSensitivityBuilder parSpreadSensitivity(ResolvedSwap swap, RatesProvider provider) {<NEW_LINE>// does the fixed leg of the swap, if it exists, have a future value notional<NEW_LINE>if (!swap.getLegs(SwapLegType.FIXED).isEmpty()) {<NEW_LINE>ResolvedSwapLeg fixedLeg = fixedLeg(swap);<NEW_LINE>Optional<FixedOvernightCompoundedAnnualRateComputation> annualRateCompOpt = findAnnualRateComputation(fixedLeg);<NEW_LINE>if (annualRateCompOpt.isPresent()) {<NEW_LINE>return parRateSensitivity(swap, provider);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ResolvedSwapLeg referenceLeg = swap.getLegs().get(0);<NEW_LINE>Currency ccyReferenceLeg = referenceLeg.getCurrency();<NEW_LINE>double convertedPv = presentValue(swap, ccyReferenceLeg, provider).getAmount();<NEW_LINE>PointSensitivityBuilder convertedPvDr = presentValueSensitivity(swap, ccyReferenceLeg, provider);<NEW_LINE>// try one payment compounding, typically for inflation swaps<NEW_LINE>Triple<Boolean, Integer, Double> fixedCompounded = checkFixedCompounded(referenceLeg);<NEW_LINE>if (fixedCompounded.getFirst()) {<NEW_LINE>double df = provider.discountFactor(ccyReferenceLeg, referenceLeg.getPaymentPeriods().get(0).getPaymentDate());<NEW_LINE>PointSensitivityBuilder dfDr = provider.discountFactors(ccyReferenceLeg).zeroRatePointSensitivity(referenceLeg.getPaymentPeriods().get(0).getPaymentDate());<NEW_LINE>double referenceConvertedPv = legPricer.presentValue(referenceLeg, provider).getAmount();<NEW_LINE>PointSensitivityBuilder referenceConvertedPvDr = legPricer.presentValueSensitivity(referenceLeg, provider);<NEW_LINE>double notional = ((RatePaymentPeriod) referenceLeg.getPaymentPeriods().get(0)).getNotional();<NEW_LINE>PointSensitivityBuilder dParSpreadDr = convertedPvDr.combinedWith(referenceConvertedPvDr.multipliedBy(-1)).multipliedBy(-1.0d / (df * notional)).combinedWith(dfDr.multipliedBy((convertedPv - referenceConvertedPv) / (df * df * notional))).multipliedBy(1.0d / fixedCompounded.getSecond() * Math.pow(-(convertedPv - referenceConvertedPv) / (df * notional) + 1.0d, 1.0d / fixedCompounded.getSecond() - 1.0d));<NEW_LINE>return dParSpreadDr;<NEW_LINE>}<NEW_LINE>double pvbp = legPricer.pvbp(referenceLeg, provider);<NEW_LINE>// Backward sweep<NEW_LINE>double convertedPvBar = -1d / pvbp;<NEW_LINE>double pvbpBar = convertedPv / (pvbp * pvbp);<NEW_LINE>PointSensitivityBuilder pvbpDr = legPricer.pvbpSensitivity(referenceLeg, provider);<NEW_LINE>return convertedPvDr.multipliedBy(convertedPvBar).combinedWith<MASK><NEW_LINE>}
(pvbpDr.multipliedBy(pvbpBar));
1,247,612
private int findFloorIn2LgF(int[] floors) {<NEW_LINE>int key = 1;<NEW_LINE>int searchFloor = 0;<NEW_LINE>// Since N can be much larger than F, we use repeated doubling when searching for higher floors<NEW_LINE>for (int powerOf2 = 1; searchFloor < floors.length; powerOf2++) {<NEW_LINE><MASK><NEW_LINE>if (key == floors[searchFloor]) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>searchFloor = 1 << powerOf2;<NEW_LINE>}<NEW_LINE>// Now we do a normal binary search - O(lg F)<NEW_LINE>int previousFloorWithoutEgg = searchFloor / 2;<NEW_LINE>searchFloor = Math.min(floors.length - 1, searchFloor);<NEW_LINE>int newFloor = findFloorInLgN(floors, previousFloorWithoutEgg + 1, searchFloor - 1);<NEW_LINE>if (newFloor == -1) {<NEW_LINE>return searchFloor;<NEW_LINE>} else {<NEW_LINE>return newFloor;<NEW_LINE>}<NEW_LINE>}
StdOut.println("Debug - current index: " + searchFloor);
990,878
public Configuration extendsFrom(Configuration... extendsFrom) {<NEW_LINE>validateMutation(MutationType.DEPENDENCIES);<NEW_LINE>for (Configuration configuration : extendsFrom) {<NEW_LINE>if (configuration.getHierarchy().contains(this)) {<NEW_LINE>throw new InvalidUserDataException(String.format("Cyclic extendsFrom from %s and %s is not allowed. See existing hierarchy: %s", this, configuration<MASK><NEW_LINE>}<NEW_LINE>if (this.extendsFrom.add(configuration)) {<NEW_LINE>if (inheritedArtifacts != null) {<NEW_LINE>inheritedArtifacts.addCollection(configuration.getAllArtifacts());<NEW_LINE>}<NEW_LINE>if (inheritedDependencies != null) {<NEW_LINE>inheritedDependencies.addCollection(configuration.getAllDependencies());<NEW_LINE>}<NEW_LINE>if (inheritedDependencyConstraints != null) {<NEW_LINE>inheritedDependencyConstraints.addCollection(configuration.getAllDependencyConstraints());<NEW_LINE>}<NEW_LINE>((ConfigurationInternal) configuration).addMutationValidator(parentMutationValidator);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
, configuration.getHierarchy()));
916,137
private void init(CentralProcessor processor) {<NEW_LINE>GridBagConstraints sysConstraints = new GridBagConstraints();<NEW_LINE>sysConstraints.weightx = 1d;<NEW_LINE>sysConstraints.weighty = 1d;<NEW_LINE>sysConstraints.fill = GridBagConstraints.BOTH;<NEW_LINE>GridBagConstraints procConstraints = (GridBagConstraints) sysConstraints.clone();<NEW_LINE>procConstraints.gridx = 1;<NEW_LINE>Date date = Date.from(LocalDateTime.now().atZone(ZoneId.systemDefault()).toInstant());<NEW_LINE>DynamicTimeSeriesCollection sysData = new DynamicTimeSeriesCollection(1, 60, new Second());<NEW_LINE>sysData.setTimeBase(new Second(date));<NEW_LINE>sysData.addSeries(floatArrayPercent(cpuData(processor)), 0, "All cpus");<NEW_LINE>JFreeChart systemCpu = ChartFactory.createTimeSeriesChart("System CPU Usage", "Time", "% CPU", sysData, true, true, false);<NEW_LINE>double[] procUsage = procData(processor);<NEW_LINE>DynamicTimeSeriesCollection procData = new DynamicTimeSeriesCollection(procUsage.length, 60, new Second());<NEW_LINE>procData.setTimeBase(new Second(date));<NEW_LINE>for (int i = 0; i < procUsage.length; i++) {<NEW_LINE>procData.addSeries(floatArrayPercent(procUsage[i]), i, "cpu" + i);<NEW_LINE>}<NEW_LINE>JFreeChart procCpu = ChartFactory.createTimeSeriesChart("Processor CPU Usage", "Time", "% CPU", procData, true, true, false);<NEW_LINE>JPanel cpuPanel = new JPanel();<NEW_LINE>cpuPanel.setLayout(new GridBagLayout());<NEW_LINE>cpuPanel.add(new ChartPanel(systemCpu), sysConstraints);<NEW_LINE>cpuPanel.add(new ChartPanel(procCpu), procConstraints);<NEW_LINE><MASK><NEW_LINE>Timer timer = new Timer(Config.REFRESH_FAST, e -> {<NEW_LINE>sysData.advanceTime();<NEW_LINE>sysData.appendData(floatArrayPercent(cpuData(processor)));<NEW_LINE>procData.advanceTime();<NEW_LINE>int newest = procData.getNewestIndex();<NEW_LINE>double[] procUsageData = procData(processor);<NEW_LINE>for (int i = 0; i < procUsageData.length; i++) {<NEW_LINE>procData.addValue(i, newest, (float) (100 * procUsageData[i]));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>timer.start();<NEW_LINE>}
add(cpuPanel, BorderLayout.CENTER);
1,692,636
private LogSegment checkArgsAndGetFirstSegment(long segmentCapacity, boolean needSwapSegment) throws StoreException {<NEW_LINE>if (capacityInBytes <= 0 || segmentCapacity <= 0) {<NEW_LINE>throw new IllegalArgumentException("One of totalCapacityInBytes [" + capacityInBytes + "] or " + "segmentCapacityInBytes [" + segmentCapacity + "] is <=0");<NEW_LINE>}<NEW_LINE>segmentCapacity = Math.min(capacityInBytes, segmentCapacity);<NEW_LINE>// all segments should be the same size.<NEW_LINE>long numSegments = capacityInBytes / segmentCapacity;<NEW_LINE>if (capacityInBytes % segmentCapacity != 0) {<NEW_LINE>throw new IllegalArgumentException("Capacity of log [" + capacityInBytes + "] should be a multiple of segment capacity [" + segmentCapacity + "]");<NEW_LINE>}<NEW_LINE>Pair<LogSegmentName, String> segmentNameAndFilename = getNextSegmentNameAndFilename();<NEW_LINE>logger.info("Allocating first segment with name [{}], back by file {} and capacity {} bytes. Total number of " + "segments is {}", segmentNameAndFilename.getFirst(), segmentNameAndFilename.<MASK><NEW_LINE>File segmentFile = allocate(segmentNameAndFilename.getSecond(), segmentCapacity, needSwapSegment);<NEW_LINE>// to be backwards compatible, headers are not written for a log segment if it is the only log segment.<NEW_LINE>return new LogSegment(segmentNameAndFilename.getFirst(), segmentFile, segmentCapacity, config, metrics, isLogSegmented);<NEW_LINE>}
getSecond(), segmentCapacity, numSegments);
1,025,172
protected void handleSearchButtonSelected() {<NEW_LINE>IJavaProject project = getJavaProject();<NEW_LINE>IJavaElement[] elements = null;<NEW_LINE>if ((project == null) || !project.exists()) {<NEW_LINE>IJavaModel model = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot());<NEW_LINE>if (model != null) {<NEW_LINE>try {<NEW_LINE>elements = model.getJavaProjects();<NEW_LINE>} catch (JavaModelException e) {<NEW_LINE>JDIDebugUIPlugin.log(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>elements = new IJavaElement[] { project };<NEW_LINE>}<NEW_LINE>if (elements == null) {<NEW_LINE>elements = new IJavaElement[] {};<NEW_LINE>}<NEW_LINE>int constraints = IJavaSearchScope.SOURCES;<NEW_LINE>IJavaSearchScope searchScope = SearchEngine.createJavaSearchScope(elements, constraints);<NEW_LINE>MainMethodSearchEngine engine = new MainMethodSearchEngine();<NEW_LINE>IType[] types = null;<NEW_LINE>try {<NEW_LINE>types = engine.searchMainMethods(owner.getRunnableContext(), searchScope, false);<NEW_LINE>} catch (Exception e) {<NEW_LINE>BootActivator.log(e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DebugTypeSelectionDialog mmsd = new DebugTypeSelectionDialog(owner.getShell(), types, LauncherMessages.JavaMainTab_Choose_Main_Type_11);<NEW_LINE>if (mmsd.open() == Window.CANCEL) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Object[] results = mmsd.getResult();<NEW_LINE>IType type = (IType) results[0];<NEW_LINE>if (type != null) {<NEW_LINE>fMainText.<MASK><NEW_LINE>project().setValue(type.getJavaProject().getProject());<NEW_LINE>}<NEW_LINE>}
setText(type.getFullyQualifiedName());
1,294,349
private static void sendEventOne(RegressionEnvironment env, EventRepresentationChoice eventRepresentationEnum, String id) {<NEW_LINE>if (eventRepresentationEnum.isObjectArrayEvent()) {<NEW_LINE>env.sendEventObjectArray(new Object[] { id }, "EventOne");<NEW_LINE>} else if (eventRepresentationEnum.isMapEvent()) {<NEW_LINE>Map<String, Object> theEvent = new LinkedHashMap<String, Object>();<NEW_LINE><MASK><NEW_LINE>env.sendEventMap(theEvent, "EventOne");<NEW_LINE>} else if (eventRepresentationEnum.isAvroEvent()) {<NEW_LINE>Schema schema = record("name").fields().requiredString("id").endRecord();<NEW_LINE>GenericData.Record record = new GenericData.Record(schema);<NEW_LINE>record.put("id", id);<NEW_LINE>env.sendEventAvro(record, "EventOne");<NEW_LINE>} else if (eventRepresentationEnum.isJsonEvent() || eventRepresentationEnum.isJsonProvidedClassEvent()) {<NEW_LINE>JsonObject object = new JsonObject();<NEW_LINE>object.add("id", id);<NEW_LINE>env.sendEventJson(object.toString(), "EventOne");<NEW_LINE>} else {<NEW_LINE>fail();<NEW_LINE>}<NEW_LINE>}
theEvent.put("id", id);
1,646,388
protected void generateStatementText() {<NEW_LINE>statementText = new StringBuilder();<NEW_LINE>StringBuilder columnList = generateColumnText();<NEW_LINE>StringBuilder constraint = processConstraints();<NEW_LINE>String tableName = ((QueryTable) tableList.get(0)).getTableDesc().getName();<NEW_LINE>// Create the query filling in the column list, table name, etc.<NEW_LINE>switch(action) {<NEW_LINE>case QueryPlan.ACT_UPDATE:<NEW_LINE>// NOI18N<NEW_LINE>statementText.append("update ");<NEW_LINE>appendQuotedText(statementText, tableName);<NEW_LINE>// NOI18N<NEW_LINE>statementText.append(" set ").append(columnList).append<MASK><NEW_LINE>break;<NEW_LINE>case QueryPlan.ACT_DELETE:<NEW_LINE>// NOI18N<NEW_LINE>statementText.append("delete from ");<NEW_LINE>appendQuotedText(statementText, tableName);<NEW_LINE>// NOI18N<NEW_LINE>statementText.append(" where ").append(constraint);<NEW_LINE>break;<NEW_LINE>case QueryPlan.ACT_INSERT:<NEW_LINE>// NOI18N<NEW_LINE>statementText.append("insert into ");<NEW_LINE>appendQuotedText(statementText, tableName);<NEW_LINE>// NOI18N<NEW_LINE>// NOI18N<NEW_LINE>statementText.append("(").append(columnList).append(") values ").append("(").append(values).// NOI18N<NEW_LINE>append(")");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>calculateWhereClauseColumnRefIndexes();<NEW_LINE>}
(" where ").append(constraint);
1,573,000
protected void _addEnumProps(Class<?> propClass, Schema property) {<NEW_LINE>final boolean useIndex = _mapper.isEnabled(SerializationFeature.WRITE_ENUMS_USING_INDEX);<NEW_LINE>final boolean useToString = _mapper.isEnabled(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);<NEW_LINE>Optional<Method> jsonValueMethod = Arrays.stream(propClass.getMethods()).filter(m -> m.isAnnotationPresent(JsonValue.class)).filter(m -> m.getAnnotation(JsonValue.class).value()).findFirst();<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Class<Enum<?>> enumClass = (Class<Enum<?>>) propClass;<NEW_LINE>Enum<?>[] enumConstants = enumClass.getEnumConstants();<NEW_LINE>if (enumConstants != null) {<NEW_LINE>String[] enumValues = _intr.findEnumValues(propClass, enumConstants, new String[enumConstants.length]);<NEW_LINE>for (Enum<?> en : enumConstants) {<NEW_LINE>String n;<NEW_LINE>String enumValue = <MASK><NEW_LINE>String s = jsonValueMethod.flatMap(m -> ReflectionUtils.safeInvoke(m, en)).map(Object::toString).orElse(null);<NEW_LINE>if (s != null) {<NEW_LINE>n = s;<NEW_LINE>} else if (enumValue != null) {<NEW_LINE>n = enumValue;<NEW_LINE>} else if (useIndex) {<NEW_LINE>n = String.valueOf(en.ordinal());<NEW_LINE>} else if (useToString) {<NEW_LINE>n = en.toString();<NEW_LINE>} else {<NEW_LINE>n = _intr.findEnumValue(en);<NEW_LINE>}<NEW_LINE>if (property instanceof StringSchema) {<NEW_LINE>StringSchema sp = (StringSchema) property;<NEW_LINE>sp.addEnumItem(n);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
enumValues[en.ordinal()];
482,086
public void mouseWheelMoved(MouseWheelEvent e) {<NEW_LINE>if (!e.isAltDown()) {<NEW_LINE>super.mouseWheelMoved(e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final MainView view = <MASK><NEW_LINE>final MapView map = (MapView) SwingUtilities.getAncestorOfClass(MapView.class, view);<NEW_LINE>if (map.usesLayoutSpecificMaxNodeWidth())<NEW_LINE>return;<NEW_LINE>final int wheelRotation = e.getWheelRotation();<NEW_LINE>final NodeView nodeView = view.getNodeView();<NEW_LINE>if (!nodeView.isSelected())<NEW_LINE>map.selectAsTheOnlyOneSelected(nodeView);<NEW_LINE>final double factor = e.isControlDown() ? 1 : 6 * LengthUnit.pt.factor();<NEW_LINE>double newZoomedWidth = Math.max((view.getWidth() - wheelRotation * factor) / map.getZoom(), 0);<NEW_LINE>final IMapSelection selection = Controller.getCurrentController().getSelection();<NEW_LINE>Quantity<LengthUnit> newZoomedWidthQuantity = LengthUnit.pixelsInPt(newZoomedWidth);<NEW_LINE>final ModeController modeController = map.getModeController();<NEW_LINE>final MNodeStyleController styleController = (MNodeStyleController) modeController.getExtension(NodeStyleController.class);<NEW_LINE>selection.preserveRootNodeLocationOnScreen();<NEW_LINE>for (final NodeModel node : selection.getSelection()) {<NEW_LINE>styleController.setMinNodeWidth(node, newZoomedWidthQuantity);<NEW_LINE>styleController.setMaxNodeWidth(node, newZoomedWidthQuantity);<NEW_LINE>}<NEW_LINE>}
(MainView) e.getComponent();
178,189
public boolean validateReferer(HttpServletRequest request) {<NEW_LINE>final String uri = request.getRequestURI() == null ? "/" : request.getRequestURI().toLowerCase();<NEW_LINE>final String url = request.getServerName() + uri;<NEW_LINE><MASK><NEW_LINE>final String incomingReferer = (request.getHeader("Origin") != null) ? request.getHeader("Origin") : request.getHeader("referer");<NEW_LINE>final String refererHost = hostFromUrl(incomingReferer);<NEW_LINE>// good: we allow CSS because css @import statements do not send referers<NEW_LINE>if (refererHost == null && uri.endsWith(".css")) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// good: the url host == the refererHost<NEW_LINE>if (urlHost.equalsIgnoreCase(refererHost)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// good: uri is on the ignore list<NEW_LINE>if (this.loadIgnorePaths().stream().anyMatch(path -> (path.endsWith("*") && uri.startsWith(path.substring(0, path.lastIndexOf('*'))) || uri.equals(path)))) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// good: the referer is a host that is being served from dotCMS<NEW_LINE>if (isRefererOneOfOurHosts(refererHost)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// good: if the urlHost should be ignored (this should almost never happen)<NEW_LINE>if (this.loadIgnoreHosts().contains(urlHost)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Try.run(() -> SecurityLogger.logInfo(SecurityUtils.class, "InvalidReferer, ip:" + request.getRemoteAddr() + ", url:" + request.getRequestURL() + ", referer:" + incomingReferer));<NEW_LINE>Try.run(() -> Logger.info(SecurityUtils.class, "InvalidReferer, ip:" + request.getRemoteAddr() + ", url:" + request.getRequestURL() + ", referer:" + incomingReferer));<NEW_LINE>return false;<NEW_LINE>}
final String urlHost = hostFromUrl(url);
586,432
final AssociateAddressResult executeAssociateAddress(AssociateAddressRequest associateAddressRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(associateAddressRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AssociateAddressRequest> request = null;<NEW_LINE>Response<AssociateAddressResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AssociateAddressRequestMarshaller().marshall(super.beforeMarshalling(associateAddressRequest));<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, "AssociateAddress");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<AssociateAddressResult> responseHandler = new StaxResponseHandler<AssociateAddressResult>(new AssociateAddressResultStaxUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
506,657
public void createSmaps(Analyzer analyzer) {<NEW_LINE>Preconditions.checkNotNull(outputTupleDesc_);<NEW_LINE>Preconditions.checkNotNull(intermediateTupleDesc_);<NEW_LINE>List<Expr> exprs = Lists.newArrayListWithCapacity(groupingExprs_.size() + aggregateExprs_.size());<NEW_LINE>exprs.addAll(groupingExprs_);<NEW_LINE>exprs.addAll(aggregateExprs_);<NEW_LINE>for (int i = 0; i < exprs.size(); ++i) {<NEW_LINE>Expr expr = exprs.get(i);<NEW_LINE>outputTupleSmap_.put(expr.clone(), new SlotRef(outputTupleDesc_.getSlots().get(i)));<NEW_LINE>if (!requiresIntermediateTuple()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>intermediateTupleSmap_.put(expr.clone(), new SlotRef(intermediateTupleDesc_.getSlots().get(i)));<NEW_LINE>outputToIntermediateTupleSmap_.put(new SlotRef(outputTupleDesc_.getSlots().get(i)), new SlotRef(intermediateTupleDesc_.getSlots(<MASK><NEW_LINE>}<NEW_LINE>if (!requiresIntermediateTuple()) {<NEW_LINE>intermediateTupleSmap_ = outputTupleSmap_;<NEW_LINE>}<NEW_LINE>if (LOG.isTraceEnabled()) {<NEW_LINE>LOG.trace("output smap=" + outputTupleSmap_.debugString());<NEW_LINE>LOG.trace("intermediate smap=" + intermediateTupleSmap_.debugString());<NEW_LINE>}<NEW_LINE>}
).get(i)));
1,487,470
private void loadNode654() {<NEW_LINE>BaseDataVariableTypeNode node = new BaseDataVariableTypeNode(this.context, Identifiers.SessionDiagnosticsVariableType_BrowseNextCount, new QualifiedName(0, "BrowseNextCount"), new LocalizedText("en", "BrowseNextCount"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.ServiceCounterDataType, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsVariableType_BrowseNextCount, Identifiers.HasTypeDefinition, Identifiers.BaseDataVariableType<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsVariableType_BrowseNextCount, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsVariableType_BrowseNextCount, Identifiers.HasComponent, Identifiers.SessionDiagnosticsVariableType.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), true));
673,283
public Input unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Input input = new Input();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("inputConfiguration", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>input.setInputConfiguration(InputConfigurationJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("inputDefinition", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>input.setInputDefinition(InputDefinitionJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return input;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,009,633
public void onDownloadEmbeddedImagesEvent(DownloadEmbeddedImagesEvent event) {<NEW_LINE>if (event.getStatus().equals(Status.SUCCESS)) {<NEW_LINE>Timber.v("onDownloadEmbeddedImagesEvent %s", event.getStatus());<NEW_LINE>String content = composeMessageViewModel.getMessageDataResult().getContent();<NEW_LINE>String css = AppUtil.readTxt(this, R.raw.css_reset_with_custom_props);<NEW_LINE>String darkCss = "";<NEW_LINE>if (composeMessageViewModel.isAppInDarkMode(this)) {<NEW_LINE>darkCss = AppUtil.readTxt(this, R.raw.css_reset_dark_mode_only);<NEW_LINE>}<NEW_LINE>Transformer contentTransformer = new ViewportTransformer(renderDimensionsProvider.getRenderWidth(this), css, darkCss);<NEW_LINE>Document doc = Jsoup.parse(content);<NEW_LINE>doc.outputSettings().indentAmount(0).prettyPrint(false);<NEW_LINE><MASK><NEW_LINE>content = doc.toString();<NEW_LINE>pmWebViewClient.blockRemoteResources(!composeMessageViewModel.getMessageDataResult().getShowRemoteContent());<NEW_LINE>EmbeddedImagesThread mEmbeddedImagesTask = new EmbeddedImagesThread(new WeakReference<>(ComposeMessageActivity.this.quotedMessageWebView), event, content);<NEW_LINE>mEmbeddedImagesTask.execute();<NEW_LINE>}<NEW_LINE>}
doc = contentTransformer.transform(doc);
1,747,829
private void observation(String personID, String encounterID, Observation observation) throws IOException {<NEW_LINE>if (observation.value == null) {<NEW_LINE>if (observation.observations != null && !observation.observations.isEmpty()) {<NEW_LINE>// just loop through the child observations<NEW_LINE>for (Observation subObs : observation.observations) {<NEW_LINE>observation(personID, encounterID, subObs);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// no value so nothing more to report here<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// DATE,PATIENT,ENCOUNTER,CATEGORY,CODE,DESCRIPTION,VALUE,UNITS<NEW_LINE>StringBuilder s = new StringBuilder();<NEW_LINE>s.append(iso8601Timestamp(observation.start)).append(',');<NEW_LINE>s.append(personID).append(',');<NEW_LINE>s.append(encounterID).append(',');<NEW_LINE>if (observation.category != null) {<NEW_LINE>s.append(observation.category);<NEW_LINE>}<NEW_LINE>s.append(',');<NEW_LINE>Code coding = observation.codes.get(0);<NEW_LINE>s.append(coding.code).append(',');<NEW_LINE>s.append(clean(coding.display)).append(',');<NEW_LINE>String value = ExportHelper.getObservationValue(observation);<NEW_LINE>String <MASK><NEW_LINE>s.append(clean(value)).append(',');<NEW_LINE>s.append(observation.unit).append(',');<NEW_LINE>s.append(type);<NEW_LINE>s.append(NEWLINE);<NEW_LINE>write(s.toString(), observations);<NEW_LINE>}
type = ExportHelper.getObservationType(observation);
524,788
void appPasswordMisConfigurationCheck(OAuth20Provider provider, ClientAuthnData data) {<NEW_LINE>if (appPasswordMisConfigEvaluated == true) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>OidcBaseClient client = null;<NEW_LINE>boolean providerWantsAppPassword = provider.isPasswordGrantRequiresAppPassword();<NEW_LINE>boolean clientSupportsAppPassword = false;<NEW_LINE>// might be client id, or real user name<NEW_LINE>String clientId = data.getUserName();<NEW_LINE>OidcOAuth20ClientProvider clientProvider = provider.getClientProvider();<NEW_LINE>if (clientProvider != null & clientId != null) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (OidcServerException e) {<NEW_LINE>}<NEW_LINE>// ffdc<NEW_LINE>}<NEW_LINE>if (client != null && client.isAppPasswordAllowed()) {<NEW_LINE>clientSupportsAppPassword = true;<NEW_LINE>}<NEW_LINE>if (clientSupportsAppPassword && !providerWantsAppPassword) {<NEW_LINE>Tr.warning(tc, "security.oauth20.apppassword.config.c1p0.warning", new Object[] { client.getClientId(), provider.getID() });<NEW_LINE>}<NEW_LINE>if (!clientSupportsAppPassword && providerWantsAppPassword) {<NEW_LINE>Tr.warning(tc, "security.oauth20.apppassword.config.c0p1.warning", new Object[] { client.getClientId(), provider.getID() });<NEW_LINE>}<NEW_LINE>appPasswordMisConfigEvaluated = true;<NEW_LINE>}
client = clientProvider.get(clientId);
1,804,290
private void insertNewSpacer(int rowIndex, double height) {<NEW_LINE>if (spacerScrollerRegistration == null) {<NEW_LINE>spacerScrollerRegistration = addScrollHandler(spacerScroller);<NEW_LINE>}<NEW_LINE>final SpacerImpl spacer = new SpacerImpl(rowIndex);<NEW_LINE>rowIndexToSpacer.put(rowIndex, spacer);<NEW_LINE>// set the position before adding it to DOM<NEW_LINE>positions.set(spacer.getRootElement(), getScrollLeft(), calculateSpacerTop(rowIndex));<NEW_LINE>TableRowElement spacerRoot = spacer.getRootElement();<NEW_LINE>spacerRoot.getStyle().setWidth(columnConfiguration.<MASK><NEW_LINE>body.getElement().appendChild(spacerRoot);<NEW_LINE>spacer.setupDom(height);<NEW_LINE>// set the deco position, requires that spacer is in the DOM<NEW_LINE>positions.set(spacer.getDecoElement(), 0, spacer.getTop() - spacer.getSpacerDecoTopOffset());<NEW_LINE>spacerDecoContainer.appendChild(spacer.getDecoElement());<NEW_LINE>if (spacerDecoContainer.getParentElement() == null) {<NEW_LINE>getElement().appendChild(spacerDecoContainer);<NEW_LINE>// calculate the spacer deco width, it won't change<NEW_LINE>spacerDecoWidth = WidgetUtil.getRequiredWidthBoundingClientRectDouble(spacer.getDecoElement());<NEW_LINE>}<NEW_LINE>initSpacerContent(spacer);<NEW_LINE>body.sortDomElements();<NEW_LINE>}
calculateRowWidth(), Unit.PX);
121,952
private short nearestColorIndex(final Integer[] palette, final int nMaxColors, final int c) {<NEW_LINE>short k = 0;<NEW_LINE>double curdist, mindist = SHORT_MAX;<NEW_LINE>for (int i = 0; i < nMaxColors; ++i) {<NEW_LINE>int c2 = palette[i];<NEW_LINE>double adist = Math.abs(Color.alpha(c2) - Color.alpha(c));<NEW_LINE>curdist = adist;<NEW_LINE>if (curdist > mindist)<NEW_LINE>continue;<NEW_LINE>double rdist = PR * Math.abs(Color.red(c2) - Color.red(c));<NEW_LINE>curdist += rdist;<NEW_LINE>if (curdist > mindist)<NEW_LINE>continue;<NEW_LINE>double gdist = PG * Math.abs(Color.green(c2) <MASK><NEW_LINE>curdist += gdist;<NEW_LINE>if (curdist > mindist)<NEW_LINE>continue;<NEW_LINE>double bdist = PB * Math.abs(Color.blue(c2) - Color.blue(c));<NEW_LINE>curdist += bdist;<NEW_LINE>if (curdist > mindist)<NEW_LINE>continue;<NEW_LINE>mindist = curdist;<NEW_LINE>k = (short) i;<NEW_LINE>}<NEW_LINE>return k;<NEW_LINE>}
- Color.green(c));
1,825,956
static protected int isSimpleAsFeature(/* const */<NEW_LINE>Geometry geometry, /* const */<NEW_LINE>SpatialReference spatialReference, boolean bForce, NonSimpleResult result, ProgressTracker progressTracker) {<NEW_LINE>if (result != null) {<NEW_LINE>result.m_reason = NonSimpleResult.Reason.NotDetermined;<NEW_LINE>result.m_vertexIndex1 = -1;<NEW_LINE>result.m_vertexIndex2 = -1;<NEW_LINE>}<NEW_LINE>if (geometry.isEmpty())<NEW_LINE>return 1;<NEW_LINE>Geometry.Type gt = geometry.getType();<NEW_LINE>if (gt == Geometry.Type.Point)<NEW_LINE>return 1;<NEW_LINE>double tolerance = InternalUtils.calculateToleranceFromGeometry(spatialReference, geometry, false);<NEW_LINE>if (gt == Geometry.Type.Envelope) {<NEW_LINE>Segment seg = (Segment) geometry;<NEW_LINE>Polyline polyline = new Polyline(seg.getDescription());<NEW_LINE>polyline.addSegment(seg, true);<NEW_LINE>return isSimpleAsFeature(polyline, spatialReference, bForce, result, progressTracker);<NEW_LINE>}<NEW_LINE>// double geomTolerance = 0;<NEW_LINE>int isSimple = ((MultiVertexGeometryImpl) geometry._getImpl<MASK><NEW_LINE>int knownSimpleResult = bForce ? -1 : isSimple;<NEW_LINE>// TODO: need to distinguish KnownSimple between SimpleAsFeature and<NEW_LINE>// SimplePlanar.<NEW_LINE>// From the first sight it seems the SimplePlanar implies<NEW_LINE>// SimpleAsFeature.<NEW_LINE>if (knownSimpleResult != -1)<NEW_LINE>return knownSimpleResult;<NEW_LINE>OperatorSimplifyLocalHelper helper = new OperatorSimplifyLocalHelper(geometry, spatialReference, knownSimpleResult, progressTracker, false);<NEW_LINE>if (gt == Geometry.Type.MultiPoint) {<NEW_LINE>knownSimpleResult = helper.multiPointIsSimpleAsFeature_();<NEW_LINE>} else if (gt == Geometry.Type.Polyline) {<NEW_LINE>knownSimpleResult = helper.polylineIsSimpleAsFeature_();<NEW_LINE>} else if (gt == Geometry.Type.Polygon) {<NEW_LINE>knownSimpleResult = helper.polygonIsSimpleAsFeature_();<NEW_LINE>} else {<NEW_LINE>// what else?<NEW_LINE>throw GeometryException.GeometryInternalError();<NEW_LINE>}<NEW_LINE>((MultiVertexGeometryImpl) (geometry._getImpl())).setIsSimple(knownSimpleResult, tolerance, false);<NEW_LINE>if (result != null && knownSimpleResult == 0)<NEW_LINE>result.Assign(helper.m_nonSimpleResult);<NEW_LINE>return knownSimpleResult;<NEW_LINE>}
()).getIsSimple(tolerance);
1,466,665
// list[-1] = val like a RubyArray<NEW_LINE>@JRubyMethod(name = "[]=")<NEW_LINE>public static IRubyObject aset(final ThreadContext context, final IRubyObject self, final IRubyObject idx, final IRubyObject val) {<NEW_LINE>final java.util.List list = unwrapIfJavaObject(self);<NEW_LINE>final int size = list.size();<NEW_LINE>if (idx instanceof RubyRange) {<NEW_LINE>int first = idx.callMethod(context, "first").convertToInteger().getIntValue();<NEW_LINE>int last = idx.callMethod(context, "last").convertToInteger().getIntValue();<NEW_LINE>if (last < 0)<NEW_LINE>last += size;<NEW_LINE>if (first < 0)<NEW_LINE>first += size;<NEW_LINE>if (((RubyRange) idx).isExcludeEnd())<NEW_LINE>last--;<NEW_LINE>for (int i = last; i >= first; i--) {<NEW_LINE>if (i < size)<NEW_LINE>list.remove(i);<NEW_LINE>else<NEW_LINE>list.add(null);<NEW_LINE>}<NEW_LINE>list.add(last, val.toJava(java.lang.Object.class));<NEW_LINE>return val;<NEW_LINE>}<NEW_LINE>int i = idx.convertToInteger().getIntValue();<NEW_LINE>// -1 ... size - 1<NEW_LINE>if (i < 0)<NEW_LINE>i = size + i;<NEW_LINE>if (i >= size) {<NEW_LINE>for (int t = 0; t < i - size; t++) list.add(null);<NEW_LINE>list.add(val.toJava(java<MASK><NEW_LINE>} else {<NEW_LINE>list.set(i, val.toJava(java.lang.Object.class));<NEW_LINE>}<NEW_LINE>return val;<NEW_LINE>}
.lang.Object.class));
834,336
public Object buildPostIDPInitiatedRequest(String testcase, WebClient webClient, SAMLTestSettings settings, List<validationData> expectations) throws Exception {<NEW_LINE>String thisMethod = "buildPostIDPInitiatedRequest";<NEW_LINE>msgUtils.printMethodName(thisMethod);<NEW_LINE>setMarkEndOfLogs();<NEW_LINE>URL url = AutomationTools.getNewUrl(settings.getIdpChallenge());<NEW_LINE>WebRequest request = new WebRequest(url, HttpMethod.POST);<NEW_LINE>CXFSettings cxfSettings = settings.getCXFSettings();<NEW_LINE>request.setRequestParameters(new ArrayList());<NEW_LINE>// Setup the rest of the HTTP POST signon request to SP<NEW_LINE>updateCXFRequestParms(request, cxfSettings);<NEW_LINE>updateRSSAMLRequestParms(request, settings);<NEW_LINE>request.getRequestParameters().add(new NameValuePair("RequestBinding", "HTTPPost"));<NEW_LINE>setRequestParameterIfSet(request, "providerId", settings.getSpConsumer());<NEW_LINE>setRequestParameterIfSet(request, "target", settings.getRelayState());<NEW_LINE>setRequestParameterIfSet(request, "NameIdFormat", "email");<NEW_LINE>setRequestParameterIfSet(request, "RelayState", encodeString<MASK><NEW_LINE>setRequestParameterIfSet(request, "relayState", settings.getRelayState());<NEW_LINE>msgUtils.printRequestParts(webClient, request, testcase, "Outgoing request");<NEW_LINE>msgUtils.printAllCookies(webClient);<NEW_LINE>Object thePage = webClient.getPage(request);<NEW_LINE>// make sure the page is processed before continuing<NEW_LINE>waitBeforeContinuing(webClient);<NEW_LINE>msgUtils.printResponseParts(thePage, testcase, thisMethod + " response");<NEW_LINE>validationTools.setServers(testSAMLServer, testSAMLOIDCServer, testOIDCServer, testAppServer, testIDPServer);<NEW_LINE>validationTools.validateResult(webClient, thePage, SAMLConstants.BUILD_POST_IDP_INITIATED_REQUEST, expectations, settings);<NEW_LINE>return thePage;<NEW_LINE>}
(settings.getRelayState()));