idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,220,920 | ActionResult<Wo> execute(String id, String path0, String path1, String path2, String path3, String path4, JsonElement jsonElement) throws Exception {<NEW_LINE>Callable<ActionResult<Wo>> callable = new Callable<ActionResult<Wo>>() {<NEW_LINE><NEW_LINE>public ActionResult<Wo> call() throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Business business = new Business(emc);<NEW_LINE>ApplicationDict dict = emc.<MASK><NEW_LINE>if (null == dict) {<NEW_LINE>throw new ExceptionEntityNotExist(id, ApplicationDict.class);<NEW_LINE>}<NEW_LINE>update(business, dict, jsonElement, path0, path1, path2, path3, path4);<NEW_LINE>emc.commit();<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(dict.getId());<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>return ProcessPlatformExecutorFactory.get(id).submit(callable).get(300, TimeUnit.SECONDS);<NEW_LINE>} | find(id, ApplicationDict.class); |
404,321 | public void execute(AdminCommandContext context) {<NEW_LINE>Config config = targetUtil.getConfig(target);<NEW_LINE>if (config == null) {<NEW_LINE>context.getActionReport().setMessage("No such config named: " + target);<NEW_LINE>context.getActionReport().setActionExitCode(ActionReport.ExitCode.FAILURE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MonitoringService monitoringService = config.getMonitoringService();<NEW_LINE>AMXConfiguration amxConfiguration = <MASK><NEW_LINE>final ActionReport actionReport = context.getActionReport();<NEW_LINE>final String[] headers = { "Monitoring Enabled", "AMX Enabled", "MBeans Enabled", "DTrace Enabled" };<NEW_LINE>ColumnFormatter columnFormatter = new ColumnFormatter(headers);<NEW_LINE>columnFormatter.addRow(new Object[] { monitoringService.getMonitoringEnabled(), amxConfiguration.getEnabled(), monitoringService.getMbeanEnabled(), monitoringService.getDtraceEnabled() });<NEW_LINE>actionReport.appendMessage(columnFormatter.toString());<NEW_LINE>Map<String, Object> extraPropertiesMap = new HashMap<>();<NEW_LINE>extraPropertiesMap.put("monitoringEnabled", monitoringService.getMonitoringEnabled());<NEW_LINE>extraPropertiesMap.put("amxEnabled", amxConfiguration.getEnabled());<NEW_LINE>extraPropertiesMap.put("mbeanEnabled", monitoringService.getMbeanEnabled());<NEW_LINE>extraPropertiesMap.put("dtraceEnabled", monitoringService.getDtraceEnabled());<NEW_LINE>Properties extraProperties = new Properties();<NEW_LINE>extraProperties.put("getMonitoringServiceConfiguration", extraPropertiesMap);<NEW_LINE>actionReport.setExtraProperties(extraProperties);<NEW_LINE>actionReport.setMessage(columnFormatter.toString());<NEW_LINE>actionReport.setActionExitCode(ActionReport.ExitCode.SUCCESS);<NEW_LINE>} | config.getExtensionByType(AMXConfiguration.class); |
1,496,923 | public CompletableFuture<Integer> unsubscribe(Subscription subscription) {<NEW_LINE>if (!subscription.isActive()) {<NEW_LINE>throw new IllegalStateException("Subscription is already inactive");<NEW_LINE>}<NEW_LINE>List<Subscription> subscriptions = getOrDefault(<MASK><NEW_LINE>if (subscriptions == null || !subscriptions.contains(subscription)) {<NEW_LINE>throw new IllegalStateException("Subscription is already inactive");<NEW_LINE>}<NEW_LINE>subscriptions.remove(subscription);<NEW_LINE>subscription.setInactive();<NEW_LINE>int remainingCount = subscriptions.size();<NEW_LINE>CompletableFuture<Integer> unsubFuture = new CompletableFuture<>();<NEW_LINE>if (remainingCount == 0) {<NEW_LINE>long requestID = mIDGenerator.next();<NEW_LINE>mUnsubscribeRequests.put(requestID, new UnsubscribeRequest(requestID, unsubFuture, subscription.subscription));<NEW_LINE>send(new Unsubscribe(requestID, subscription.subscription));<NEW_LINE>} else {<NEW_LINE>unsubFuture.complete(remainingCount);<NEW_LINE>}<NEW_LINE>return unsubFuture;<NEW_LINE>} | mSubscriptions, subscription.subscription, null); |
608,043 | private Optional<Double> measure(final Instant now, final BlockedTimeSample current) {<NEW_LINE>final Instant windowStart = now.minus(window);<NEW_LINE>final Instant earliest = now.minus(window.plus(sampleMargin));<NEW_LINE>final Instant latest = now.minus(window.minus(sampleMargin));<NEW_LINE>LOGGER.debug("{}: record and measure with now {}, window {} ({} : {})", threadName, now, windowStart, earliest, latest);<NEW_LINE>samples.add(current);<NEW_LINE>samples.removeIf(s -> s.timestamp.isBefore(earliest));<NEW_LINE>if (!inRange(samples.get(0).timestamp, earliest, latest) && !startTime.isAfter(windowStart)) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>final BlockedTimeSample startSample = samples.get(0);<NEW_LINE>LOGGER.debug("{}: start sample {}", threadName, startSample);<NEW_LINE>double blocked = Math.max(current.totalBlockedTime - startSample.totalBlockedTime, 0);<NEW_LINE>Instant observedStart = samples.get(0).timestamp;<NEW_LINE>if (startTime.isAfter(windowStart)) {<NEW_LINE>LOGGER.debug("{}: start time {} is after window start", threadName, startTime);<NEW_LINE>blocked += Duration.between(windowStart, startTime).toNanos();<NEW_LINE>observedStart = windowStart;<NEW_LINE>}<NEW_LINE>final Duration duration = Duration.between(observedStart, current.timestamp);<NEW_LINE>final double durationNs = duration.toNanos();<NEW_LINE>return Optional.of((durationNs - Math.min(<MASK><NEW_LINE>} | blocked, durationNs)) / durationNs); |
72,600 | private TExecPlanFragmentParams streamLoadPutImpl(TStreamLoadPutRequest request) throws UserException {<NEW_LINE><MASK><NEW_LINE>if (Strings.isNullOrEmpty(cluster)) {<NEW_LINE>cluster = SystemInfoService.DEFAULT_CLUSTER;<NEW_LINE>}<NEW_LINE>Catalog catalog = Catalog.getCurrentCatalog();<NEW_LINE>String fullDbName = ClusterNamespace.getFullName(cluster, request.getDb());<NEW_LINE>Database db = catalog.getDb(fullDbName);<NEW_LINE>if (db == null) {<NEW_LINE>String dbName = fullDbName;<NEW_LINE>if (Strings.isNullOrEmpty(request.getCluster())) {<NEW_LINE>dbName = request.getDb();<NEW_LINE>}<NEW_LINE>throw new UserException("unknown database, database=" + dbName);<NEW_LINE>}<NEW_LINE>long timeoutMs = request.isSetThrift_rpc_timeout_ms() ? request.getThrift_rpc_timeout_ms() : 5000;<NEW_LINE>if (!db.tryReadLock(timeoutMs, TimeUnit.MILLISECONDS)) {<NEW_LINE>throw new UserException("get database read lock timeout, database=" + fullDbName);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Table table = db.getTable(request.getTbl());<NEW_LINE>if (table == null) {<NEW_LINE>throw new UserException("unknown table, table=" + request.getTbl());<NEW_LINE>}<NEW_LINE>if (!(table instanceof OlapTable)) {<NEW_LINE>throw new UserException("load table type is not OlapTable, type=" + table.getClass());<NEW_LINE>}<NEW_LINE>StreamLoadTask streamLoadTask = StreamLoadTask.fromTStreamLoadPutRequest(request, db);<NEW_LINE>StreamLoadPlanner planner = new StreamLoadPlanner(db, (OlapTable) table, streamLoadTask);<NEW_LINE>TExecPlanFragmentParams plan = planner.plan(streamLoadTask.getId());<NEW_LINE>// add table indexes to transaction state<NEW_LINE>TransactionState txnState = Catalog.getCurrentGlobalTransactionMgr().getTransactionState(db.getId(), request.getTxnId());<NEW_LINE>if (txnState == null) {<NEW_LINE>throw new UserException("txn does not exist: " + request.getTxnId());<NEW_LINE>}<NEW_LINE>txnState.addTableIndexes((OlapTable) table);<NEW_LINE>return plan;<NEW_LINE>} finally {<NEW_LINE>db.readUnlock();<NEW_LINE>}<NEW_LINE>} | String cluster = request.getCluster(); |
109,266 | final DescribeScalableTargetsResult executeDescribeScalableTargets(DescribeScalableTargetsRequest describeScalableTargetsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeScalableTargetsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeScalableTargetsRequest> request = null;<NEW_LINE>Response<DescribeScalableTargetsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeScalableTargetsRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Auto Scaling");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeScalableTargets");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeScalableTargetsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeScalableTargetsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | (super.beforeMarshalling(describeScalableTargetsRequest)); |
1,013,833 | private SingularityDeployResult checkCanaryMaybeFinished(SingularityRequest request, SingularityDeploy deploy, SingularityPendingDeploy pendingDeploy, Collection<SingularityTaskId> deployActiveTasks, Optional<SingularityUpdatePendingDeployRequest> updatePendingDeployRequest, Collection<SingularityTaskId> inactiveDeployMatchingTasks, Collection<SingularityTaskId> otherActiveTasks) {<NEW_LINE>if (deploy.getCanaryDeploySettings().isEnableCanaryDeploy()) {<NEW_LINE>if (deployActiveTasks.size() >= request.getInstancesSafe()) {<NEW_LINE>cleanupTasks(pendingDeploy, request, DeployState.SUCCEEDED, otherActiveTasks);<NEW_LINE>updatePendingDeploy(pendingDeploy, DeployState.SUCCEEDED, pendingDeploy.getDeployProgress());<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>return advanceDeployStep(pendingDeploy.getDeployProgress(), request, deploy, pendingDeploy, deployActiveTasks, updatePendingDeployRequest, inactiveDeployMatchingTasks, otherActiveTasks);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return new SingularityDeployResult(DeployState.SUCCEEDED);<NEW_LINE>}<NEW_LINE>} | return new SingularityDeployResult(DeployState.SUCCEEDED); |
1,009,570 | private JPanel control() {<NEW_LINE>final var control = new JPanel();<NEW_LINE>final var gb = new GridBagLayout();<NEW_LINE>final var gc = new GridBagConstraints();<NEW_LINE>control.setLayout(gb);<NEW_LINE>gc.weightx = 1.0;<NEW_LINE>gc.gridwidth = 1;<NEW_LINE>gc.gridy = 0;<NEW_LINE>gc.gridx = 0;<NEW_LINE>gc.fill = GridBagConstraints.VERTICAL;<NEW_LINE>gc.anchor = GridBagConstraints.EAST;<NEW_LINE>gc.insets = new Insets(3, 10, 3, 10);<NEW_LINE>gb.setConstraints(selector.getLabel(), gc);<NEW_LINE>control.add(selector.getLabel());<NEW_LINE>gc.gridy++;<NEW_LINE>gb.setConstraints(formatLabel, gc);<NEW_LINE>control.add(formatLabel);<NEW_LINE>gc.gridy++;<NEW_LINE>gb.setConstraints(styleLabel, gc);<NEW_LINE>control.add(styleLabel);<NEW_LINE>gc.gridy++;<NEW_LINE><MASK><NEW_LINE>control.add(notationLabel);<NEW_LINE>gc.gridx = 1;<NEW_LINE>gc.gridy = 0;<NEW_LINE>gc.anchor = GridBagConstraints.WEST;<NEW_LINE>gb.setConstraints(selector.getComboBox(), gc);<NEW_LINE>control.add(selector.getComboBox());<NEW_LINE>gc.gridy++;<NEW_LINE>gb.setConstraints(formatChoice, gc);<NEW_LINE>control.add(formatChoice);<NEW_LINE>gc.gridy++;<NEW_LINE>gb.setConstraints(formatStyle, gc);<NEW_LINE>control.add(formatStyle);<NEW_LINE>gc.gridy++;<NEW_LINE>gb.setConstraints(notationChoice, gc);<NEW_LINE>control.add(notationChoice);<NEW_LINE>return control;<NEW_LINE>} | gb.setConstraints(notationLabel, gc); |
1,728,473 | private void downloadImage(PodcastChannel channel) {<NEW_LINE>String imageUrl = channel.getImageUrl();<NEW_LINE>if (imageUrl == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>CoverArt art = coverArtService.get(EntityType.MEDIA_FILE, channel.getMediaFileId());<NEW_LINE>// if its already there, no need to download it again<NEW_LINE>if (!CoverArt.NULL_ART.equals(art)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MediaFile channelMediaFile = mediaFileService.<MASK><NEW_LINE>MusicFolder folder = mediaFolderService.getMusicFolderById(channelMediaFile.getFolderId());<NEW_LINE>Path channelDir = channelMediaFile.getFullPath(folder.getPath());<NEW_LINE>HttpGet method = new HttpGet(imageUrl);<NEW_LINE>method.addHeader("User-Agent", "Airsonic/" + versionService.getLocalVersion());<NEW_LINE>try (CloseableHttpClient client = HttpClients.createDefault();<NEW_LINE>CloseableHttpResponse response = client.execute(method);<NEW_LINE>InputStream in = response.getEntity().getContent()) {<NEW_LINE>Path filePath = channelDir.resolve("cover." + getCoverArtSuffix(response));<NEW_LINE>Files.copy(in, filePath, StandardCopyOption.REPLACE_EXISTING);<NEW_LINE>coverArtService.upsert(EntityType.MEDIA_FILE, channelMediaFile.getId(), folder.getPath().relativize(filePath).toString(), channelMediaFile.getFolderId(), false);<NEW_LINE>} catch (Exception x) {<NEW_LINE>LOG.warn("Failed to download cover art for podcast channel '{}'", channel.getTitle(), x);<NEW_LINE>}<NEW_LINE>} | getMediaFile(channel.getMediaFileId()); |
1,331,726 | public void onSizeReady(int width, int height) {<NEW_LINE>stateVerifier.throwIfRecycled();<NEW_LINE>synchronized (requestLock) {<NEW_LINE>if (IS_VERBOSE_LOGGABLE) {<NEW_LINE>logV("Got onSizeReady in " + LogTime.getElapsedMillis(startTime));<NEW_LINE>}<NEW_LINE>if (status != Status.WAITING_FOR_SIZE) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>status = Status.RUNNING;<NEW_LINE>float sizeMultiplier = requestOptions.getSizeMultiplier();<NEW_LINE>this.<MASK><NEW_LINE>this.height = maybeApplySizeMultiplier(height, sizeMultiplier);<NEW_LINE>if (IS_VERBOSE_LOGGABLE) {<NEW_LINE>logV("finished setup for calling load in " + LogTime.getElapsedMillis(startTime));<NEW_LINE>}<NEW_LINE>loadStatus = engine.load(glideContext, model, requestOptions.getSignature(), this.width, this.height, requestOptions.getResourceClass(), transcodeClass, priority, requestOptions.getDiskCacheStrategy(), requestOptions.getTransformations(), requestOptions.isTransformationRequired(), requestOptions.isScaleOnlyOrNoTransform(), requestOptions.getOptions(), requestOptions.isMemoryCacheable(), requestOptions.getUseUnlimitedSourceGeneratorsPool(), requestOptions.getUseAnimationPool(), requestOptions.getOnlyRetrieveFromCache(), this, callbackExecutor);<NEW_LINE>// This is a hack that's only useful for testing right now where loads complete synchronously<NEW_LINE>// even though under any executor running on any thread but the main thread, the load would<NEW_LINE>// have completed asynchronously.<NEW_LINE>if (status != Status.RUNNING) {<NEW_LINE>loadStatus = null;<NEW_LINE>}<NEW_LINE>if (IS_VERBOSE_LOGGABLE) {<NEW_LINE>logV("finished onSizeReady in " + LogTime.getElapsedMillis(startTime));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | width = maybeApplySizeMultiplier(width, sizeMultiplier); |
145,726 | private static List<EnumValueDescriptorProto.Builder> buildEnumValues(CodeSystem codeSystem, String system, List<Filter> filters) {<NEW_LINE>filters = filters.stream().filter(filter -> {<NEW_LINE>if (filter.getOp().getValue() != FilterOperatorCode.Value.IS_A) {<NEW_LINE>System.out.println("Warning: value filters other than is-a are ignored. Found: " + Codes.enumValueToCodeString(filter.getOp().getValue().getValueDescriptor().toProto()));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!filter.getProperty().getValue().equals("concept")) {<NEW_LINE>System.out.println("Warning: value filters by property other than concept are not supported. " + " Found: " + filter.<MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>return toEnumValueList(buildEnumValues(codeSystem.getConceptList(), system, new HashSet<>(), filters));<NEW_LINE>} | getProperty().getValue()); |
897,833 | private static void writeTimestamp(byte[] buffer, int offset, long time) {<NEW_LINE>// Special case: zero means zero.<NEW_LINE>if (time == 0) {<NEW_LINE>Arrays.fill(buffer, offset, offset + 8, (byte) 0x00);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long seconds = time / 1000L;<NEW_LINE>long milliseconds = time - seconds * 1000L;<NEW_LINE>seconds += OFFSET_1900_TO_1970;<NEW_LINE>// Write seconds in big endian format.<NEW_LINE>buffer[offset++] = (byte) (seconds >> 24);<NEW_LINE>buffer[offset++] = (<MASK><NEW_LINE>buffer[offset++] = (byte) (seconds >> 8);<NEW_LINE>buffer[offset++] = (byte) (seconds >> 0);<NEW_LINE>long fraction = milliseconds * 0x100000000L / 1000L;<NEW_LINE>// Write fraction in big endian format.<NEW_LINE>buffer[offset++] = (byte) (fraction >> 24);<NEW_LINE>buffer[offset++] = (byte) (fraction >> 16);<NEW_LINE>buffer[offset++] = (byte) (fraction >> 8);<NEW_LINE>// Low order bits should be random data.<NEW_LINE>buffer[offset++] = (byte) (Math.random() * 255.0);<NEW_LINE>} | byte) (seconds >> 16); |
1,366,913 | protected HttpHost determineProxy(HttpHost target, HttpRequest request, HttpContext context) throws HttpException {<NEW_LINE>if (request.getParams().getBooleanParameter(FORCE_DIRECT_CONNECTION, false)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// ATTENTION: keep old implementation, see ConnRoutePNames.DEFAULT_PROXY usage<NEW_LINE>HttpHost proxy = ConnRouteParams.getDefaultProxy(request.getParams());<NEW_LINE>if (proxySelector != null) {<NEW_LINE>proxy = determineProxyThroughProxySelector(target);<NEW_LINE>}<NEW_LINE>// TODO: replace deprecated ClientContext with new HttpClientContext (string representation of the CREDS_PROVIDER remains the same)<NEW_LINE>if ((proxy != null) && (context != null)) {<NEW_LINE>CredentialsProvider credentialsProvider = (CredentialsProvider) <MASK><NEW_LINE>if ((credentialsProvider != null) && (credentialsProvider instanceof HttpCredentialsProvider)) {<NEW_LINE>boolean autoProxy = SoapUI.getSettings().getBoolean(ProxySettings.AUTO_PROXY);<NEW_LINE>if (autoProxy) {<NEW_LINE>HttpCredentialsProvider httpCredentialsProvider = (HttpCredentialsProvider) credentialsProvider;<NEW_LINE>httpCredentialsProvider.setProxy(proxy.getHostName(), String.valueOf(proxy.getPort()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return proxy;<NEW_LINE>} | context.getAttribute(ClientContext.CREDS_PROVIDER); |
656,853 | public Sequence execute(StaticContext sctx, QueryContext ctx, Sequence[] args) {<NEW_LINE>if (args.length != 2 && args.length != 3) {<NEW_LINE>throw new QueryException(new QNm("No valid arguments specified!"));<NEW_LINE>}<NEW_LINE>final XmlDBNode doc = ((XmlDBNode) args[0]);<NEW_LINE>final <MASK><NEW_LINE>final XmlResourceManager manager = rtx.getResourceManager();<NEW_LINE>final Optional<XmlNodeTrx> optionalWriteTrx = manager.getNodeTrx();<NEW_LINE>final XmlNodeTrx wtx = optionalWriteTrx.orElseGet(() -> manager.beginNodeTrx());<NEW_LINE>if (rtx.getRevisionNumber() < manager.getMostRecentRevisionNumber()) {<NEW_LINE>wtx.revertTo(rtx.getRevisionNumber());<NEW_LINE>}<NEW_LINE>final XmlIndexController controller = wtx.getResourceManager().getWtxIndexController(wtx.getRevisionNumber() - 1);<NEW_LINE>if (controller == null) {<NEW_LINE>throw new QueryException(new QNm("Document not found: " + ((Str) args[1]).stringValue()));<NEW_LINE>}<NEW_LINE>Type type = null;<NEW_LINE>if (args.length > 1 && args[1] != null) {<NEW_LINE>final QNm name = new QNm(Namespaces.XS_NSURI, ((Str) args[1]).stringValue());<NEW_LINE>type = sctx.getTypes().resolveAtomicType(name);<NEW_LINE>}<NEW_LINE>final Set<Path<QNm>> paths = new HashSet<>();<NEW_LINE>if (args.length == 3 && args[2] != null) {<NEW_LINE>final Iter it = args[2].iterate();<NEW_LINE>Item next = it.next();<NEW_LINE>while (next != null) {<NEW_LINE>paths.add(Path.parse(((Str) next).stringValue()));<NEW_LINE>next = it.next();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final IndexDef idxDef = IndexDefs.createCASIdxDef(false, type, paths, controller.getIndexes().getNrOfIndexDefsWithType(IndexType.CAS), IndexDef.DbType.XML);<NEW_LINE>try {<NEW_LINE>controller.createIndexes(ImmutableSet.of(idxDef), wtx);<NEW_LINE>} catch (final SirixIOException e) {<NEW_LINE>throw new QueryException(new QNm("I/O exception: " + e.getMessage()), e);<NEW_LINE>}<NEW_LINE>return idxDef.materialize();<NEW_LINE>} | XmlNodeReadOnlyTrx rtx = doc.getTrx(); |
1,848,424 | public CodegenExpression make(CodegenMethodScope parent, SAIFFInitializeSymbol symbols, CodegenClassScope classScope) {<NEW_LINE>CodegenMethod method = parent.makeChild(PropertyHashedArrayFactoryFactory.EPTYPE, this.getClass(), classScope);<NEW_LINE>method.getBlock().declareVar(EventPropertyValueGetter.EPTYPEARRAY, "getters", newArrayByLength(EventPropertyValueGetter.EPTYPE, constant(propertyNames.length)));<NEW_LINE>for (int i = 0; i < propertyNames.length; i++) {<NEW_LINE>EventPropertyGetterSPI getterSPI = ((EventTypeSPI) eventType).getGetterSPI(propertyNames[i]);<NEW_LINE>CodegenExpression getter = EventTypeUtility.codegenGetterWCoerce(getterSPI, propertyTypes[i], propertyTypes[i], method, this.getClass(), classScope);<NEW_LINE>method.getBlock().assignArrayElement(ref("getters")<MASK><NEW_LINE>}<NEW_LINE>method.getBlock().methodReturn(newInstance(PropertyHashedArrayFactoryFactory.EPTYPE, constant(streamNum), constant(propertyNames), constant(propertyTypes), DataInputOutputSerdeForge.codegenArray(serdes, method, classScope, null), constant(unique), ref("getters"), constant(isFireAndForget), stateMgmtSettings.toExpression()));<NEW_LINE>return localMethod(method);<NEW_LINE>} | , constant(i), getter); |
1,398,862 | final DefineSuggesterResult executeDefineSuggester(DefineSuggesterRequest defineSuggesterRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(defineSuggesterRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DefineSuggesterRequest> request = null;<NEW_LINE>Response<DefineSuggesterResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DefineSuggesterRequestMarshaller().marshall(super.beforeMarshalling(defineSuggesterRequest));<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, "CloudSearch");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DefineSuggester");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DefineSuggesterResult> responseHandler = new StaxResponseHandler<DefineSuggesterResult>(new DefineSuggesterResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
1,853,963 | private void attemptSshKeyDecryption() throws Exception {<NEW_LINE>// Try to decrypt and recover keypair, and failing that, report error.<NEW_LINE>kp = PubkeyUtils.decryptAndRecoverKeyPair(sshPrivKey, passphrase);<NEW_LINE>while (kp == null) {<NEW_LINE>sshKeyDecryptionAttempts++;<NEW_LINE>if (sshKeyDecryptionAttempts > MAX_DECRYPTION_ATTEMPTS) {<NEW_LINE>throw new Exception(context.getString(R.string.error_ssh_keypair_decryption_failure));<NEW_LINE>}<NEW_LINE>userInputLatch = new CountDownLatch(1);<NEW_LINE><MASK><NEW_LINE>handler.sendEmptyMessage(RemoteClientLibConstants.GET_SSH_PASSPHRASE);<NEW_LINE>while (true) {<NEW_LINE>try {<NEW_LINE>userInputLatch.await();<NEW_LINE>break;<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>kp = PubkeyUtils.decryptAndRecoverKeyPair(sshPrivKey, passphrase);<NEW_LINE>}<NEW_LINE>} | Log.i(TAG, "Requesting SSH passphrase from user"); |
1,699,405 | public Message decode(ProtoReader reader) throws IOException {<NEW_LINE>Builder builder = new Builder();<NEW_LINE>long token = reader.beginMessage();<NEW_LINE>for (int tag; (tag = reader.nextTag()) != -1; ) {<NEW_LINE>switch(tag) {<NEW_LINE>case 1:<NEW_LINE>builder.unknownFields(ProtoAdapter.STRING.decode(reader));<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>builder.other(ProtoAdapter.STRING.decode(reader));<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>builder.o(ProtoAdapter.STRING.decode(reader));<NEW_LINE>break;<NEW_LINE>case 4:<NEW_LINE>builder.result(ProtoAdapter.STRING.decode(reader));<NEW_LINE>break;<NEW_LINE>case 5:<NEW_LINE>builder.hashCode(ProtoAdapter.STRING.decode(reader));<NEW_LINE>break;<NEW_LINE>case 6:<NEW_LINE>builder.serialVersionUID_(ProtoAdapter.STRING.decode(reader));<NEW_LINE>break;<NEW_LINE>case 7:<NEW_LINE>builder.ADAPTER_(ProtoAdapter.STRING.decode(reader));<NEW_LINE>break;<NEW_LINE>case 8:<NEW_LINE>builder.MESSAGE_OPTIONS_(ProtoAdapter.STRING.decode(reader));<NEW_LINE>break;<NEW_LINE>case 9:<NEW_LINE>builder.this_(ProtoAdapter.STRING.decode(reader));<NEW_LINE>break;<NEW_LINE>case 10:<NEW_LINE>builder.message(ProtoAdapter<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>reader.readUnknownField(tag);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>builder.addUnknownFields(reader.endMessageAndGetUnknownFields(token));<NEW_LINE>return builder.build();<NEW_LINE>} | .STRING.decode(reader)); |
60,513 | public static MasterSecret generateMasterSecret(Context context, String passphrase) {<NEW_LINE>try {<NEW_LINE>byte[] encryptionSecret = generateEncryptionSecret();<NEW_LINE>byte[] macSecret = generateMacSecret();<NEW_LINE>byte[] masterSecret = <MASK><NEW_LINE>byte[] encryptionSalt = generateSalt();<NEW_LINE>int iterations = generateIterationCount(passphrase, encryptionSalt);<NEW_LINE>byte[] encryptedMasterSecret = encryptWithPassphrase(encryptionSalt, iterations, masterSecret, passphrase);<NEW_LINE>byte[] macSalt = generateSalt();<NEW_LINE>byte[] encryptedAndMacdMasterSecret = macWithPassphrase(macSalt, iterations, encryptedMasterSecret, passphrase);<NEW_LINE>save(context, "encryption_salt", encryptionSalt);<NEW_LINE>save(context, "mac_salt", macSalt);<NEW_LINE>save(context, "passphrase_iterations", iterations);<NEW_LINE>save(context, "master_secret", encryptedAndMacdMasterSecret);<NEW_LINE>save(context, "passphrase_initialized", true);<NEW_LINE>return new MasterSecret(new SecretKeySpec(encryptionSecret, "AES"), new SecretKeySpec(macSecret, "HmacSHA1"));<NEW_LINE>} catch (GeneralSecurityException e) {<NEW_LINE>Log.w(TAG, e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | Util.combine(encryptionSecret, macSecret); |
1,390,183 | private org.opendope.xpaths.Xpaths.Xpath createNewXPathObject(String newPath, org.opendope.xpaths.Xpaths.Xpath xpathObj, int index) {<NEW_LINE>// org.opendope.xpaths.Xpaths.Xpath newXPathObj = XmlUtils<NEW_LINE>// .deepCopy(xpathObj);<NEW_LINE>org.opendope.xpaths.Xpaths.Xpath newXPathObj = new org.opendope.xpaths.Xpaths.Xpath();<NEW_LINE>String newXPathId = xpathObj.getId() + "_" + index;<NEW_LINE>newXPathObj.setId(newXPathId);<NEW_LINE>org.opendope.xpaths.Xpaths.Xpath.DataBinding dataBinding = new org.opendope.xpaths<MASK><NEW_LINE>newXPathObj.setDataBinding(dataBinding);<NEW_LINE>dataBinding.setXpath(newPath);<NEW_LINE>dataBinding.setStoreItemID(xpathObj.getDataBinding().getStoreItemID());<NEW_LINE>dataBinding.setPrefixMappings(xpathObj.getDataBinding().getPrefixMappings());<NEW_LINE>Xpath oldKey = xpathsMap.put(newXPathId, newXPathObj);<NEW_LINE>if (oldKey != null) {<NEW_LINE>if (oldKey.getDataBinding().getXpath().equals(newPath)) {<NEW_LINE>// OK<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("New xpath entry overwrites existing identical xpath " + newXPathId);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// bad<NEW_LINE>log.warn("New xpath entry overwrites existing different xpath " + newXPathId);<NEW_LINE>log.warn("Old: " + oldKey.getDataBinding().getXpath());<NEW_LINE>log.warn("New: " + newPath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newXPathObj;<NEW_LINE>} | .Xpaths.Xpath.DataBinding(); |
1,806,865 | public void draw(Canvas canvas) {<NEW_LINE>canvas.drawRect(mContentBounds, mContentPaint);<NEW_LINE>int saveCount = canvas.save();<NEW_LINE>canvas.clipRect(mContentBounds, Region.Op.DIFFERENCE);<NEW_LINE>canvas.drawRect(mPaddingBounds, mPaddingPaint);<NEW_LINE>canvas.restoreToCount(saveCount);<NEW_LINE>saveCount = canvas.save();<NEW_LINE>canvas.clipRect(<MASK><NEW_LINE>canvas.drawRect(mMarginBounds, mMarginPaint);<NEW_LINE>canvas.restoreToCount(saveCount);<NEW_LINE>drawBoundsDimensions(canvas, mContentBounds);<NEW_LINE>// Disabled for now since Flipper doesn't support options too well at this point in time.<NEW_LINE>// Once options are supported, we should re-enable the calls below<NEW_LINE>// drawCardinalDimensionsBetween(canvas, mContentBounds, mPaddingBounds);<NEW_LINE>// drawCardinalDimensionsBetween(canvas, mPaddingBounds, mMarginBounds);<NEW_LINE>} | mPaddingBounds, Region.Op.DIFFERENCE); |
1,273,386 | private boolean checkValidity() {<NEW_LINE>String pName = packageName.getEditor().getItem() == null ? "" : packageName.getEditor().getItem().toString().trim();<NEW_LINE>if (!Utilities.isJavaIdentifier(getClassName())) {<NEW_LINE>setError(getMessage("MSG_ClassNameMustBeValidJavaIdentifier"));<NEW_LINE>} else if (getDisplayName().trim().length() == 0) {<NEW_LINE>setInfo<MASK><NEW_LINE>} else if (pName.length() == 0 || !WizardUtils.isValidPackageName(pName)) {<NEW_LINE>setError(getMessage("ERR_Package_Invalid"));<NEW_LINE>} else if (classAlreadyExists()) {<NEW_LINE>setError(getMessage("MSG_ClassAlreadyExists"));<NEW_LINE>} else if (data.isToolbarEnabled() && getIconPath() == null) {<NEW_LINE>setError(getMessage("MSG_IconRequiredForToolbar"));<NEW_LINE>} else {<NEW_LINE>String[] invalid = data.getCreatedModifiedFiles().getInvalidPaths();<NEW_LINE>if (invalid.length > 0) {<NEW_LINE>setWarning(WizardUtils.getIconAlreadyExistsWarning(invalid[0]));<NEW_LINE>} else {<NEW_LINE>markValid();<NEW_LINE>checkIconValidity();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | (getMessage("MSG_DisplayNameMustBeEntered"), false); |
1,243,147 | private Mono<PagedResponse<PerformanceTierPropertiesInner>> listSinglePageAsync(String locationName) {<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 (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>if (locationName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String apiVersion = "2017-12-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), locationName, accept, context)).<PagedResponse<PerformanceTierPropertiesInner>>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>} | error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); |
550,615 | public List<Volume> describeVolumes(String... volumeIds) {<NEW_LINE>if (volumeIds == null || volumeIds.length == 0) {<NEW_LINE>LOGGER.info(String.format("Getting all EBS volumes in region %s.", region));<NEW_LINE>} else {<NEW_LINE>LOGGER.info(String.format("Getting EBS volumes for %d ids in region %s."<MASK><NEW_LINE>}<NEW_LINE>AmazonEC2 ec2Client = ec2Client();<NEW_LINE>DescribeVolumesRequest request = new DescribeVolumesRequest();<NEW_LINE>if (volumeIds != null) {<NEW_LINE>request.setVolumeIds(Arrays.asList(volumeIds));<NEW_LINE>}<NEW_LINE>DescribeVolumesResult result = ec2Client.describeVolumes(request);<NEW_LINE>List<Volume> volumes = result.getVolumes();<NEW_LINE>LOGGER.info(String.format("Got %d EBS volumes in region %s.", volumes.size(), region));<NEW_LINE>return volumes;<NEW_LINE>} | , volumeIds.length, region)); |
15,108 | public static DescribeBackupJobsResponse unmarshall(DescribeBackupJobsResponse describeBackupJobsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeBackupJobsResponse.setRequestId(_ctx.stringValue("DescribeBackupJobsResponse.RequestId"));<NEW_LINE>describeBackupJobsResponse.setSuccess(_ctx.booleanValue("DescribeBackupJobsResponse.Success"));<NEW_LINE>describeBackupJobsResponse.setCode(_ctx.stringValue("DescribeBackupJobsResponse.Code"));<NEW_LINE>describeBackupJobsResponse.setMessage(_ctx.stringValue("DescribeBackupJobsResponse.Message"));<NEW_LINE>describeBackupJobsResponse.setTotalCount(_ctx.integerValue("DescribeBackupJobsResponse.TotalCount"));<NEW_LINE>describeBackupJobsResponse.setPageSize(_ctx.integerValue("DescribeBackupJobsResponse.PageSize"));<NEW_LINE>describeBackupJobsResponse.setPageNumber(_ctx.integerValue("DescribeBackupJobsResponse.PageNumber"));<NEW_LINE>List<BackupJob> backupJobs = new ArrayList<BackupJob>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeBackupJobsResponse.BackupJobs.Length"); i++) {<NEW_LINE>BackupJob backupJob = new BackupJob();<NEW_LINE>backupJob.setJobId(_ctx.stringValue("DescribeBackupJobsResponse.BackupJobs[" + i + "].JobId"));<NEW_LINE>backupJob.setJobName(_ctx.stringValue("DescribeBackupJobsResponse.BackupJobs[" + i + "].JobName"));<NEW_LINE>backupJob.setJobStatus(_ctx.stringValue("DescribeBackupJobsResponse.BackupJobs[" + i + "].JobStatus"));<NEW_LINE>backupJob.setSource(_ctx.stringValue("DescribeBackupJobsResponse.BackupJobs[" + i + "].Source"));<NEW_LINE>backupJob.setRetention(_ctx.longValue("DescribeBackupJobsResponse.BackupJobs[" + i + "].Retention"));<NEW_LINE>backupJob.setSchedule(_ctx.stringValue("DescribeBackupJobsResponse.BackupJobs[" + i + "].Schedule"));<NEW_LINE>backupJob.setClientId(_ctx.stringValue("DescribeBackupJobsResponse.BackupJobs[" + i + "].ClientId"));<NEW_LINE>backupJob.setInstanceId(_ctx.stringValue("DescribeBackupJobsResponse.BackupJobs[" + i + "].InstanceId"));<NEW_LINE>backupJob.setInstanceName(_ctx.stringValue("DescribeBackupJobsResponse.BackupJobs[" + i + "].InstanceName"));<NEW_LINE>backupJob.setPercentage(_ctx.integerValue("DescribeBackupJobsResponse.BackupJobs[" + i + "].Percentage"));<NEW_LINE>backupJob.setSpeed(_ctx.longValue<MASK><NEW_LINE>backupJob.setJobOption(_ctx.stringValue("DescribeBackupJobsResponse.BackupJobs[" + i + "].JobOption"));<NEW_LINE>backupJob.setOsType(_ctx.stringValue("DescribeBackupJobsResponse.BackupJobs[" + i + "].OsType"));<NEW_LINE>backupJob.setErrorType(_ctx.stringValue("DescribeBackupJobsResponse.BackupJobs[" + i + "].ErrorType"));<NEW_LINE>backupJob.setVaultId(_ctx.stringValue("DescribeBackupJobsResponse.BackupJobs[" + i + "].VaultId"));<NEW_LINE>backupJob.setGatewayId(_ctx.stringValue("DescribeBackupJobsResponse.BackupJobs[" + i + "].GatewayId"));<NEW_LINE>backupJob.setGatewayName(_ctx.stringValue("DescribeBackupJobsResponse.BackupJobs[" + i + "].GatewayName"));<NEW_LINE>backupJob.setInclude(_ctx.stringValue("DescribeBackupJobsResponse.BackupJobs[" + i + "].Include"));<NEW_LINE>backupJob.setExclude(_ctx.stringValue("DescribeBackupJobsResponse.BackupJobs[" + i + "].Exclude"));<NEW_LINE>backupJobs.add(backupJob);<NEW_LINE>}<NEW_LINE>describeBackupJobsResponse.setBackupJobs(backupJobs);<NEW_LINE>return describeBackupJobsResponse;<NEW_LINE>} | ("DescribeBackupJobsResponse.BackupJobs[" + i + "].Speed")); |
1,232,551 | public static Map<Integer, String> parseSecurityCurveMappings(final String property) {<NEW_LINE>Map<Integer, String> lcurveMapping = new HashMap<>(8);<NEW_LINE>if (property != null && !property.isEmpty()) {<NEW_LINE>// empty will be caught later.<NEW_LINE>String[] cmaps = property.split("[ \t]*:[ \t]*");<NEW_LINE>for (String mape : cmaps) {<NEW_LINE>String[] ep = mape.split("[ \t]*=[ \t]*");<NEW_LINE>if (ep.length != 2) {<NEW_LINE>logger.warn(format<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>int parseInt = Integer.parseInt(ep[0]);<NEW_LINE>lcurveMapping.put(parseInt, ep[1]);<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>logger.warn(format("Bad curve mapping. Integer needed for strength %s for %s in property %s", ep[0], mape, SECURITY_CURVE_MAPPING));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return lcurveMapping;<NEW_LINE>} | ("Bad curve mapping for %s in property %s", mape, SECURITY_CURVE_MAPPING)); |
128,293 | public void validate() throws org.apache.thrift.TException {<NEW_LINE>// check for required fields<NEW_LINE>if (!is_set_topologyMetric()) {<NEW_LINE>throw new org.apache.thrift.protocol.TProtocolException("Required field 'topologyMetric' is unset! Struct:" + toString());<NEW_LINE>}<NEW_LINE>if (!is_set_componentMetric()) {<NEW_LINE>throw new org.apache.thrift.protocol.TProtocolException("Required field 'componentMetric' is unset! Struct:" + toString());<NEW_LINE>}<NEW_LINE>if (!is_set_workerMetric()) {<NEW_LINE>throw new org.apache.thrift.protocol.TProtocolException("Required field 'workerMetric' is unset! Struct:" + toString());<NEW_LINE>}<NEW_LINE>if (!is_set_taskMetric()) {<NEW_LINE>throw new org.apache.thrift.protocol.TProtocolException("Required field 'taskMetric' is unset! Struct:" + toString());<NEW_LINE>}<NEW_LINE>if (!is_set_streamMetric()) {<NEW_LINE>throw new org.apache.thrift.protocol.<MASK><NEW_LINE>}<NEW_LINE>if (!is_set_nettyMetric()) {<NEW_LINE>throw new org.apache.thrift.protocol.TProtocolException("Required field 'nettyMetric' is unset! Struct:" + toString());<NEW_LINE>}<NEW_LINE>// check for sub-struct validity<NEW_LINE>if (topologyMetric != null) {<NEW_LINE>topologyMetric.validate();<NEW_LINE>}<NEW_LINE>if (componentMetric != null) {<NEW_LINE>componentMetric.validate();<NEW_LINE>}<NEW_LINE>if (workerMetric != null) {<NEW_LINE>workerMetric.validate();<NEW_LINE>}<NEW_LINE>if (taskMetric != null) {<NEW_LINE>taskMetric.validate();<NEW_LINE>}<NEW_LINE>if (streamMetric != null) {<NEW_LINE>streamMetric.validate();<NEW_LINE>}<NEW_LINE>if (nettyMetric != null) {<NEW_LINE>nettyMetric.validate();<NEW_LINE>}<NEW_LINE>if (compStreamMetric != null) {<NEW_LINE>compStreamMetric.validate();<NEW_LINE>}<NEW_LINE>} | TProtocolException("Required field 'streamMetric' is unset! Struct:" + toString()); |
784,401 | public void afterReportInit() throws JRScriptletException {<NEW_LINE>try {<NEW_LINE>XYChart xyChart = new XYChartBuilder().width(515).height(400).title("Fruits Order").xAxisTitle("Day of Week").yAxisTitle("Quantity (t)").build();<NEW_LINE>xyChart.addSeries("Apples", new double[] { 1, 3, 5 }, new double[] { 4, 10, 7 });<NEW_LINE>xyChart.addSeries("Bananas", new double[] { 1, 2, 3, 4, 5 }, new double[] { 6, 8<MASK><NEW_LINE>xyChart.addSeries("Cherries", new double[] { 1, 3, 4, 5 }, new double[] { 2, 6, 1, 9 });<NEW_LINE>XYStyler styler = xyChart.getStyler();<NEW_LINE>styler.setLegendPosition(Styler.LegendPosition.InsideNW);<NEW_LINE>styler.setAxisTitlesVisible(true);<NEW_LINE>styler.setDefaultSeriesRenderStyle(XYSeries.XYSeriesRenderStyle.Area);<NEW_LINE>styler.setChartBackgroundColor(Color.WHITE);<NEW_LINE>BufferedImage bufferedImage = BitmapEncoder.getBufferedImage(xyChart);<NEW_LINE>super.setVariableValue("ChartImage", bufferedImage);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new JRScriptletException(e);<NEW_LINE>}<NEW_LINE>} | , 4, 4, 6 }); |
1,390,978 | public com.amazonaws.services.codedeploy.model.InvalidAutoRollbackConfigException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.codedeploy.model.InvalidAutoRollbackConfigException invalidAutoRollbackConfigException = new com.amazonaws.services.codedeploy.model.InvalidAutoRollbackConfigException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 invalidAutoRollbackConfigException;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,735,590 | /* (non-Javadoc)<NEW_LINE>* @see org.eclipse.ui.application.ActionBarAdvisor#fillMenuBar(org.eclipse.jface.action.IMenuManager)<NEW_LINE>*/<NEW_LINE>protected void fillMenuBar(final IMenuManager menuBar) {<NEW_LINE>// File menu<NEW_LINE>final MenuManager fileMenu = new MenuManager("&File", "toolbox.file.menu");<NEW_LINE>fileMenu.add(new Separator("toolbox.file.spec.separator"));<NEW_LINE>fileMenu.add(new Separator("toolbox.file.module.separator"));<NEW_LINE>fileMenu.add(new Separator("toolbox.file.translation.separator"));<NEW_LINE>fileMenu.add(new Separator("toolbox.file.save.separator"));<NEW_LINE>fileMenu.add(saveAction);<NEW_LINE>fileMenu.add(saveAsAction);<NEW_LINE>fileMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));<NEW_LINE>fileMenu.add(preferencesAction);<NEW_LINE>fileMenu.add(new Separator());<NEW_LINE>fileMenu.add(quitAction);<NEW_LINE>// Window Menu<NEW_LINE>final MenuManager windowMenu = new MenuManager("&Window", "toolbox.window.menu");<NEW_LINE>windowMenu.add(new Separator("toolbox.window.open.separator"));<NEW_LINE>windowMenu<MASK><NEW_LINE>windowMenu.add(new Separator("toolbox.window.tools.separator"));<NEW_LINE>windowMenu.add(new Separator());<NEW_LINE>windowMenu.add(new Separator("toolbox.window.view.separator"));<NEW_LINE>windowMenu.add(new Separator());<NEW_LINE>windowMenu.add(backwardHistoryAction);<NEW_LINE>windowMenu.add(forwardHistoryAction);<NEW_LINE>// Menu bar contributions via plugin.xmls<NEW_LINE>final Separator separator = new Separator("toolbox.tools.separator");<NEW_LINE>// @see Bug #27 in general/bugzilla/index.html<NEW_LINE>separator.setVisible(false);<NEW_LINE>// finally add to menu bar<NEW_LINE>menuBar.add(fileMenu);<NEW_LINE>menuBar.add(windowMenu);<NEW_LINE>menuBar.add(separator);<NEW_LINE>} | .add(new Separator()); |
1,073,393 | private static DatasetSortInfo createSortInfo(JRFillDataset dataset) throws JRException {<NEW_LINE>DatasetSortInfo sortInfo = new DatasetSortInfo();<NEW_LINE>sortInfo.setOriginalDataSource(dataset.dataSource);<NEW_LINE>Map<String, JRField> fieldsMap = new HashMap<>();<NEW_LINE>Map<String, Integer> fieldIndexMap = new HashMap<>();<NEW_LINE>JRField[] fields = dataset.getFields();<NEW_LINE>if (fields != null) {<NEW_LINE>for (int i = 0; i < fields.length; i++) {<NEW_LINE>JRField field = fields[i];<NEW_LINE>fieldsMap.put(field.getName(), field);<NEW_LINE>fieldIndexMap.put(field.getName(), i);<NEW_LINE>sortInfo.addRecordField(field.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<String, JRVariable> variablesMap = new HashMap<>();<NEW_LINE>JRVariable[] variables = dataset.getVariables();<NEW_LINE>if (variables != null) {<NEW_LINE>for (int i = 0; i < variables.length; i++) {<NEW_LINE>variablesMap.put(variables[i].getName(), variables[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>JRSortField[] sortFields = getAllSortFields(dataset);<NEW_LINE>if (sortFields != null) {<NEW_LINE>for (int i = 0; i < sortFields.length; i++) {<NEW_LINE>JRSortField sortField = sortFields[i];<NEW_LINE>String sortFieldName = sortField.getName();<NEW_LINE>boolean collatorFlag;<NEW_LINE>int recordIndex;<NEW_LINE>if (sortField.getType() == SortFieldTypeEnum.VARIABLE) {<NEW_LINE>JRVariable variable = variablesMap.get(sortFieldName);<NEW_LINE>if (variable == null) {<NEW_LINE>throw new JRRuntimeException(EXCEPTION_MESSAGE_KEY_SORT_VARIABLE_NOT_FOUND, new Object[] { sortFieldName });<NEW_LINE>}<NEW_LINE>recordIndex = sortInfo.addRecordVariable(variable.getName());<NEW_LINE>collatorFlag = String.class.getName().equals(variable.getValueClassName());<NEW_LINE>} else {<NEW_LINE>JRField <MASK><NEW_LINE>if (field == null) {<NEW_LINE>throw new JRRuntimeException(EXCEPTION_MESSAGE_KEY_SORT_FIELD_NOT_FOUND, new Object[] { sortFieldName });<NEW_LINE>}<NEW_LINE>recordIndex = fieldIndexMap.get(sortField.getName());<NEW_LINE>collatorFlag = String.class.getName().equals(field.getValueClassName());<NEW_LINE>}<NEW_LINE>sortInfo.addSortField(sortField, recordIndex, collatorFlag);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sortInfo;<NEW_LINE>} | field = fieldsMap.get(sortFieldName); |
1,364,867 | public void init(ExtendedProperties configuration) {<NEW_LINE>dataSourceName = StringUtils.nullTrim(configuration.getString("resource.datasource"));<NEW_LINE>tableName = StringUtils.nullTrim(configuration.getString("resource.table"));<NEW_LINE>keyColumn = StringUtils.nullTrim(configuration.getString("resource.keycolumn"));<NEW_LINE>templateColumn = StringUtils.nullTrim(configuration.getString("resource.templatecolumn"));<NEW_LINE>timestampColumn = StringUtils.nullTrim(configuration.getString("resource.timestampcolumn"));<NEW_LINE>if (dataSource != null) {<NEW_LINE>if (Logger.isDebugEnabled(this.getClass())) {<NEW_LINE>Logger.debug(this, "DataSourceResourceLoader: using dataSource instance with table \"" + tableName + "\"");<NEW_LINE>Logger.debug(this, "DataSourceResourceLoader: using columns \"" + keyColumn + "\", \"" + templateColumn + "\" and \"" + timestampColumn + "\"");<NEW_LINE>}<NEW_LINE>Logger.debug(this, "DataSourceResourceLoader initialized.");<NEW_LINE>} else if (dataSourceName != null) {<NEW_LINE>if (Logger.isDebugEnabled(this.getClass())) {<NEW_LINE>Logger.debug(this, "DataSourceResourceLoader: using \"" + dataSourceName + "\" datasource with table \"" + tableName + "\"");<NEW_LINE>Logger.debug(this, "DataSourceResourceLoader: using columns \"" + keyColumn + "\", \"" + templateColumn + "\" and \"" + timestampColumn + "\"");<NEW_LINE>}<NEW_LINE>Logger.debug(this, "DataSourceResourceLoader initialized.");<NEW_LINE>} else {<NEW_LINE>String msg = "DataSourceResourceLoader not properly initialized. No DataSource was identified.";<NEW_LINE><MASK><NEW_LINE>throw new RuntimeException(msg);<NEW_LINE>}<NEW_LINE>} | Logger.error(this, msg); |
702,662 | public void execute() {<NEW_LINE>if (!(target.getItems() instanceof EntityDataUnit)) {<NEW_LINE>throw new IllegalStateException("BulkEditAction target Items is null " + "or does not implement EntityDataUnit");<NEW_LINE>}<NEW_LINE>MetaClass metaClass = ((EntityDataUnit) target.getItems()).getEntityMetaClass();<NEW_LINE>if (metaClass == null) {<NEW_LINE>throw new IllegalStateException("Target is not bound to entity");<NEW_LINE>}<NEW_LINE>if (!security.isSpecificPermitted(BulkEditor.PERMISSION)) {<NEW_LINE>Notifications notifications = getScreenContext(target.getFrame()).getNotifications();<NEW_LINE>notifications.create(NotificationType.ERROR).withCaption(messages.getMainMessage("accessDenied.message")).show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (target.getSelected().isEmpty()) {<NEW_LINE>Notifications notifications = getScreenContext(target.getFrame()).getNotifications();<NEW_LINE>notifications.create(NotificationType.ERROR).withCaption(messages.getMainMessage("actions.BulkEdit.emptySelection")).show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Window <MASK><NEW_LINE>BulkEditors.EditorBuilder builder = bulkEditors.builder(metaClass, target.getSelected(), window.getFrameOwner()).withListComponent(target);<NEW_LINE>if (columnsMode != null) {<NEW_LINE>builder = builder.withColumnsMode(columnsMode);<NEW_LINE>}<NEW_LINE>if (exclude != null) {<NEW_LINE>builder = builder.withExclude(exclude);<NEW_LINE>}<NEW_LINE>if (fieldSorter != null) {<NEW_LINE>builder = builder.withFieldSorter(fieldSorter);<NEW_LINE>}<NEW_LINE>if (includeProperties != null) {<NEW_LINE>builder = builder.withIncludeProperties(includeProperties);<NEW_LINE>}<NEW_LINE>if (openMode != null) {<NEW_LINE>builder = builder.withLaunchMode(openMode);<NEW_LINE>}<NEW_LINE>if (loadDynamicAttributes != null) {<NEW_LINE>builder = builder.withLoadDynamicAttributes(loadDynamicAttributes);<NEW_LINE>}<NEW_LINE>if (useConfirmDialog != null) {<NEW_LINE>builder = builder.withUseConfirmDialog(useConfirmDialog);<NEW_LINE>}<NEW_LINE>builder.create().show();<NEW_LINE>} | window = ComponentsHelper.getWindowNN(target); |
244,716 | private CollectionEventInfo<Document> removeAndCreateEvent(Document document, WriteResultImpl writeResult) {<NEW_LINE>NitriteId nitriteId = document.getId();<NEW_LINE><MASK><NEW_LINE>if (document != null) {<NEW_LINE>long time = System.currentTimeMillis();<NEW_LINE>documentIndexWriter.removeIndexEntry(document);<NEW_LINE>writeResult.addToList(nitriteId);<NEW_LINE>int rev = document.getRevision();<NEW_LINE>document.put(DOC_REVISION, rev + 1);<NEW_LINE>document.put(DOC_MODIFIED, time);<NEW_LINE>log.debug("Document removed {} from {}", document, nitriteMap.getName());<NEW_LINE>CollectionEventInfo<Document> eventInfo = new CollectionEventInfo<>();<NEW_LINE>Document eventDoc = document.clone();<NEW_LINE>eventInfo.setItem(eventDoc);<NEW_LINE>eventInfo.setEventType(EventType.Remove);<NEW_LINE>eventInfo.setTimestamp(time);<NEW_LINE>return eventInfo;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | document = nitriteMap.remove(nitriteId); |
29,871 | private Result resolveSourceLevelImpl(@NonNull final JavaPlatform jp) throws Exception {<NEW_LINE>return ProjectManager.mutex().writeAccess(new Mutex.ExceptionAction<Result>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Result run() throws Exception {<NEW_LINE>final J2SEProject j2sePrj = prj.getLookup().lookup(J2SEProject.class);<NEW_LINE>if (j2sePrj != null) {<NEW_LINE>final EditableProperties props = j2sePrj.getUpdateHelper().getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);<NEW_LINE>props.setProperty(ProjectProperties.JAVAC_SOURCE, jp.getSpecification().getVersion().toString());<NEW_LINE>props.setProperty(ProjectProperties.JAVAC_TARGET, jp.getSpecification().getVersion().toString());<NEW_LINE>final SourceLevelQuery.Profile profile = getPlatformProfile(jp);<NEW_LINE>if (profile == SourceLevelQuery.Profile.DEFAULT) {<NEW_LINE>props.remove(ProjectProperties.JAVAC_PROFILE);<NEW_LINE>} else {<NEW_LINE>props.setProperty(ProjectProperties.JAVAC_PROFILE, profile.getName());<NEW_LINE>}<NEW_LINE>j2sePrj.getUpdateHelper().<MASK><NEW_LINE>ProjectManager.getDefault().saveProject(prj);<NEW_LINE>}<NEW_LINE>return Result.create(Status.UNRESOLVED);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | putProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH, props); |
613,408 | public NewPage updateNewPageWithDefaultResources(NewPage newPage) {<NEW_LINE>DefaultResources defaultResourceIds = newPage.getDefaultResources();<NEW_LINE>if (defaultResourceIds == null || StringUtils.isEmpty(defaultResourceIds.getApplicationId()) || StringUtils.isEmpty(defaultResourceIds.getPageId())) {<NEW_LINE>log.error("Unable to find default ids for page: {}", newPage.getId(), new AppsmithException(AppsmithError.DEFAULT_RESOURCES_UNAVAILABLE, "page", newPage.getId()));<NEW_LINE>if (defaultResourceIds == null) {<NEW_LINE>return newPage;<NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(defaultResourceIds.getApplicationId())) {<NEW_LINE>defaultResourceIds.setApplicationId(newPage.getApplicationId());<NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(defaultResourceIds.getPageId())) {<NEW_LINE>defaultResourceIds.setPageId(newPage.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>newPage.setId(defaultResourceIds.getPageId());<NEW_LINE>newPage.setApplicationId(defaultResourceIds.getApplicationId());<NEW_LINE>if (newPage.getUnpublishedPage() != null) {<NEW_LINE>newPage.setUnpublishedPage(this.updatePageDTOWithDefaultResources(newPage.getUnpublishedPage()));<NEW_LINE>}<NEW_LINE>if (newPage.getPublishedPage() != null) {<NEW_LINE>newPage.setPublishedPage(this.updatePageDTOWithDefaultResources<MASK><NEW_LINE>}<NEW_LINE>return newPage;<NEW_LINE>} | (newPage.getPublishedPage())); |
602,650 | public void revert(final Path file) throws BackgroundException {<NEW_LINE>if (file.isFile()) {<NEW_LINE>try {<NEW_LINE>final S3Object destination = new S3Object(containerService.getKey(file));<NEW_LINE>// Keep same storage class<NEW_LINE>destination.setStorageClass(file.attributes().getStorageClass());<NEW_LINE>final Encryption.Algorithm encryption = file<MASK><NEW_LINE>destination.setServerSideEncryptionAlgorithm(encryption.algorithm);<NEW_LINE>// Set custom key id stored in KMS<NEW_LINE>destination.setServerSideEncryptionKmsKeyId(encryption.key);<NEW_LINE>try {<NEW_LINE>// Apply non standard ACL<NEW_LINE>destination.setAcl(accessControlListFeature.toAcl(accessControlListFeature.getPermission(file)));<NEW_LINE>} catch (AccessDeniedException | InteroperabilityException e) {<NEW_LINE>log.warn(String.format("Ignore failure %s", e));<NEW_LINE>}<NEW_LINE>session.getClient().copyVersionedObject(file.attributes().getVersionId(), containerService.getContainer(file).getName(), containerService.getKey(file), containerService.getContainer(file).getName(), destination, false);<NEW_LINE>if (file.getParent().attributes().getCustom().containsKey(S3VersionedObjectListService.KEY_DELETE_MARKER)) {<NEW_LINE>// revert placeholder<NEW_LINE>session.getClient().deleteVersionedObject(file.getParent().attributes().getVersionId(), containerService.getContainer(file).getName(), containerService.getKey(file.getParent()));<NEW_LINE>}<NEW_LINE>} catch (ServiceException e) {<NEW_LINE>throw new S3ExceptionMappingService().map("Cannot revert file", e, file);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .attributes().getEncryption(); |
1,337,676 | public DescribePlaceIndexResult describePlaceIndex(DescribePlaceIndexRequest describePlaceIndexRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describePlaceIndexRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribePlaceIndexRequest> request = null;<NEW_LINE>Response<DescribePlaceIndexResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribePlaceIndexRequestMarshaller().marshall(describePlaceIndexRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<DescribePlaceIndexResult, JsonUnmarshallerContext> unmarshaller = new DescribePlaceIndexResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<DescribePlaceIndexResult> responseHandler = new JsonResponseHandler<DescribePlaceIndexResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(<MASK><NEW_LINE>}<NEW_LINE>} | awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); |
1,261,904 | public static OnsDLQMessagePageQueryByGroupIdResponse unmarshall(OnsDLQMessagePageQueryByGroupIdResponse onsDLQMessagePageQueryByGroupIdResponse, UnmarshallerContext _ctx) {<NEW_LINE>onsDLQMessagePageQueryByGroupIdResponse.setRequestId(_ctx.stringValue("OnsDLQMessagePageQueryByGroupIdResponse.RequestId"));<NEW_LINE>onsDLQMessagePageQueryByGroupIdResponse.setHelpUrl(_ctx.stringValue("OnsDLQMessagePageQueryByGroupIdResponse.HelpUrl"));<NEW_LINE>MsgFoundDo msgFoundDo = new MsgFoundDo();<NEW_LINE>msgFoundDo.setCurrentPage(_ctx.longValue("OnsDLQMessagePageQueryByGroupIdResponse.MsgFoundDo.CurrentPage"));<NEW_LINE>msgFoundDo.setMaxPageCount(_ctx.longValue("OnsDLQMessagePageQueryByGroupIdResponse.MsgFoundDo.MaxPageCount"));<NEW_LINE>msgFoundDo.setTaskId(_ctx.stringValue("OnsDLQMessagePageQueryByGroupIdResponse.MsgFoundDo.TaskId"));<NEW_LINE>List<OnsRestMessageDo> msgFoundList = new ArrayList<OnsRestMessageDo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("OnsDLQMessagePageQueryByGroupIdResponse.MsgFoundDo.MsgFoundList.Length"); i++) {<NEW_LINE>OnsRestMessageDo onsRestMessageDo = new OnsRestMessageDo();<NEW_LINE>onsRestMessageDo.setOffsetId(_ctx.stringValue("OnsDLQMessagePageQueryByGroupIdResponse.MsgFoundDo.MsgFoundList[" + i + "].OffsetId"));<NEW_LINE>onsRestMessageDo.setStoreSize(_ctx.integerValue("OnsDLQMessagePageQueryByGroupIdResponse.MsgFoundDo.MsgFoundList[" + i + "].StoreSize"));<NEW_LINE>onsRestMessageDo.setReconsumeTimes(_ctx.integerValue("OnsDLQMessagePageQueryByGroupIdResponse.MsgFoundDo.MsgFoundList[" + i + "].ReconsumeTimes"));<NEW_LINE>onsRestMessageDo.setStoreTimestamp(_ctx.longValue("OnsDLQMessagePageQueryByGroupIdResponse.MsgFoundDo.MsgFoundList[" + i + "].StoreTimestamp"));<NEW_LINE>onsRestMessageDo.setBody(_ctx.stringValue("OnsDLQMessagePageQueryByGroupIdResponse.MsgFoundDo.MsgFoundList[" + i + "].Body"));<NEW_LINE>onsRestMessageDo.setInstanceId(_ctx.stringValue("OnsDLQMessagePageQueryByGroupIdResponse.MsgFoundDo.MsgFoundList[" + i + "].InstanceId"));<NEW_LINE>onsRestMessageDo.setMsgId(_ctx.stringValue("OnsDLQMessagePageQueryByGroupIdResponse.MsgFoundDo.MsgFoundList[" + i + "].MsgId"));<NEW_LINE>onsRestMessageDo.setFlag(_ctx.integerValue("OnsDLQMessagePageQueryByGroupIdResponse.MsgFoundDo.MsgFoundList[" + i + "].Flag"));<NEW_LINE>onsRestMessageDo.setStoreHost(_ctx.stringValue<MASK><NEW_LINE>onsRestMessageDo.setTopic(_ctx.stringValue("OnsDLQMessagePageQueryByGroupIdResponse.MsgFoundDo.MsgFoundList[" + i + "].Topic"));<NEW_LINE>onsRestMessageDo.setBornTimestamp(_ctx.longValue("OnsDLQMessagePageQueryByGroupIdResponse.MsgFoundDo.MsgFoundList[" + i + "].BornTimestamp"));<NEW_LINE>onsRestMessageDo.setBodyCRC(_ctx.integerValue("OnsDLQMessagePageQueryByGroupIdResponse.MsgFoundDo.MsgFoundList[" + i + "].BodyCRC"));<NEW_LINE>onsRestMessageDo.setBornHost(_ctx.stringValue("OnsDLQMessagePageQueryByGroupIdResponse.MsgFoundDo.MsgFoundList[" + i + "].BornHost"));<NEW_LINE>List<MessageProperty> propertyList = new ArrayList<MessageProperty>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("OnsDLQMessagePageQueryByGroupIdResponse.MsgFoundDo.MsgFoundList[" + i + "].PropertyList.Length"); j++) {<NEW_LINE>MessageProperty messageProperty = new MessageProperty();<NEW_LINE>messageProperty.setValue(_ctx.stringValue("OnsDLQMessagePageQueryByGroupIdResponse.MsgFoundDo.MsgFoundList[" + i + "].PropertyList[" + j + "].Value"));<NEW_LINE>messageProperty.setName(_ctx.stringValue("OnsDLQMessagePageQueryByGroupIdResponse.MsgFoundDo.MsgFoundList[" + i + "].PropertyList[" + j + "].Name"));<NEW_LINE>propertyList.add(messageProperty);<NEW_LINE>}<NEW_LINE>onsRestMessageDo.setPropertyList(propertyList);<NEW_LINE>msgFoundList.add(onsRestMessageDo);<NEW_LINE>}<NEW_LINE>msgFoundDo.setMsgFoundList(msgFoundList);<NEW_LINE>onsDLQMessagePageQueryByGroupIdResponse.setMsgFoundDo(msgFoundDo);<NEW_LINE>return onsDLQMessagePageQueryByGroupIdResponse;<NEW_LINE>} | ("OnsDLQMessagePageQueryByGroupIdResponse.MsgFoundDo.MsgFoundList[" + i + "].StoreHost")); |
351,599 | public void encodeTableLayout(FacesContext context, PanelGrid grid) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>String clientId = grid.getClientId(context);<NEW_LINE>int columns = grid.getColumns();<NEW_LINE>String style = grid.getStyle();<NEW_LINE>String styleClass = grid.getStyleClass();<NEW_LINE>styleClass = styleClass == null ? PanelGrid.CONTAINER_CLASS : PanelGrid.CONTAINER_CLASS + " " + styleClass;<NEW_LINE>writer.startElement("table", grid);<NEW_LINE>writer.<MASK><NEW_LINE>writer.writeAttribute("class", styleClass, "styleClass");<NEW_LINE>if (style != null) {<NEW_LINE>writer.writeAttribute("style", style, "style");<NEW_LINE>}<NEW_LINE>writer.writeAttribute("role", grid.getRole(), null);<NEW_LINE>encodeTableFacet(context, grid, columns, "header", "thead", PanelGrid.HEADER_CLASS);<NEW_LINE>encodeTableFacet(context, grid, columns, "footer", "tfoot", PanelGrid.FOOTER_CLASS);<NEW_LINE>encodeTableBody(context, grid, columns);<NEW_LINE>writer.endElement("table");<NEW_LINE>} | writeAttribute("id", clientId, "id"); |
202,996 | private boolean S4U2SelfTestCallAPITwice(StringBuffer sb) {<NEW_LINE>boolean pass = false;<NEW_LINE>try {<NEW_LINE>if (krb5conf != null && krb5Keytab != null) {<NEW_LINE>setSystemProperty("KRB5_KTNAME", krb5Keytab);<NEW_LINE>setSystemProperty("java.security.krb5.conf", krb5conf);<NEW_LINE>}<NEW_LINE>String token = SpnegoHelper.buildS4U2ProxyAuthorizationUsingS4U2Self(upn, spn, lifetime, delegate, delegateServiceSpn, jaas, krb5Keytab);<NEW_LINE>writeLine(sb, "We were able to obtain the following spnego token:" + token);<NEW_LINE>String token2 = SpnegoHelper.buildS4U2ProxyAuthorizationUsingS4U2Self(upn, spn, lifetime, <MASK><NEW_LINE>writeLine(sb, "We were able to obtain the following second spnego token:" + token2);<NEW_LINE>if (token.compareToIgnoreCase(token2) != 0) {<NEW_LINE>writeLine(sb, "Spnego Token 1 and Spnego Token 2 are different" + "\n");<NEW_LINE>}<NEW_LINE>pass = true;<NEW_LINE>writeLine(sb, "S4U2Self Call API Twice Test Succeeded ");<NEW_LINE>writeLine(sb, "token:" + token);<NEW_LINE>} catch (GSSException e) {<NEW_LINE>writeLine(sb, "S4U2Self Call API Twice Test failed. Unexpected GSSException thrown Major=" + e.getMajor());<NEW_LINE>} catch (PrivilegedActionException e) {<NEW_LINE>writeLine(sb, "S4U2Self Call API Twice Test failed. Unexpected PrivilegedActionException thrown " + e.getMessage());<NEW_LINE>} catch (Exception e) {<NEW_LINE>writeLine(sb, "S4U2Self Call API Twice Test failed. Unexpected Exception thrown " + e.getMessage());<NEW_LINE>}<NEW_LINE>return pass;<NEW_LINE>} | delegate, delegateServiceSpn, jaas, krb5Keytab); |
1,539,631 | private // via GridRowInfo and GridColumnInfo. This grid uses the percentages<NEW_LINE>GridPane createGridPanePercentage() {<NEW_LINE>GridPane grid = new GridPane();<NEW_LINE>grid.setPadding(new Insets(8, 8, 8, 8));<NEW_LINE>RowConstraints rowinfo3 = new RowConstraints();<NEW_LINE>rowinfo3.setPercentHeight(50);<NEW_LINE>ColumnConstraints colInfo2 = new ColumnConstraints();<NEW_LINE>colInfo2.setPercentWidth(25);<NEW_LINE>ColumnConstraints colInfo3 = new ColumnConstraints();<NEW_LINE>colInfo3.setPercentWidth(50);<NEW_LINE>// 2*50 percent<NEW_LINE>grid.getRowConstraints().add(rowinfo3);<NEW_LINE>grid.getRowConstraints().add(rowinfo3);<NEW_LINE>// 25 percent<NEW_LINE>grid.getColumnConstraints().add(colInfo2);<NEW_LINE>// 50 percent<NEW_LINE>grid.getColumnConstraints().add(colInfo3);<NEW_LINE>// 25 percent<NEW_LINE>grid.getColumnConstraints().add(colInfo2);<NEW_LINE>Label condLabel = new Label(" Member Name:");<NEW_LINE>GridPane.setHalignment(condLabel, HPos.RIGHT);<NEW_LINE>GridPane.setConstraints(condLabel, 0, 0);<NEW_LINE>Label condValue = new Label("MyName");<NEW_LINE>GridPane.setMargin(condValue, new Insets(0, 0, 0, 10));<NEW_LINE>GridPane.setConstraints(condValue, 1, 0);<NEW_LINE>Label acctLabel = new Label("Member Number:");<NEW_LINE>GridPane.setHalignment(acctLabel, HPos.RIGHT);<NEW_LINE>GridPane.setConstraints(acctLabel, 0, 1);<NEW_LINE>TextField textBox = new TextField("Your number");<NEW_LINE>GridPane.setMargin(textBox, new Insets(10<MASK><NEW_LINE>GridPane.setConstraints(textBox, 1, 1);<NEW_LINE>Button button = new Button("Help");<NEW_LINE>GridPane.setConstraints(button, 2, 1);<NEW_LINE>GridPane.setMargin(button, new Insets(10, 10, 10, 10));<NEW_LINE>GridPane.setHalignment(button, HPos.CENTER);<NEW_LINE>GridPane.setConstraints(condValue, 1, 0);<NEW_LINE>grid.getChildren().addAll(condLabel, condValue, button, acctLabel, textBox);<NEW_LINE>return grid;<NEW_LINE>} | , 10, 10, 10)); |
1,677,176 | public SingleMasterChannelEndpointConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SingleMasterChannelEndpointConfiguration singleMasterChannelEndpointConfiguration = new SingleMasterChannelEndpointConfiguration();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Protocols", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>singleMasterChannelEndpointConfiguration.setProtocols(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Role", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>singleMasterChannelEndpointConfiguration.setRole(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return singleMasterChannelEndpointConfiguration;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
476,557 | public static GroupActionResult addMembers(@NonNull Context context, @NonNull GroupId.Push groupId, @NonNull Collection<RecipientId> newMembers) throws GroupChangeFailedException, GroupInsufficientRightsException, IOException, GroupNotAMemberException, GroupChangeBusyException, MembershipNotSuitableForV2Exception {<NEW_LINE>if (groupId.isV2()) {<NEW_LINE>GroupDatabase.GroupRecord groupRecord = SignalDatabase.groups().requireGroup(groupId);<NEW_LINE>try (GroupManagerV2.GroupEditor editor = new GroupManagerV2(context).edit(groupId.requireV2())) {<NEW_LINE>return editor.addMembers(newMembers, groupRecord.requireV2GroupProperties().getBannedMembers());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>GroupDatabase.GroupRecord groupRecord = SignalDatabase.groups().requireGroup(groupId);<NEW_LINE>List<RecipientId> members = groupRecord.getMembers();<NEW_LINE>byte[] avatar = groupRecord.hasAvatar() ? AvatarHelper.getAvatarBytes(context, groupRecord.getRecipientId()) : null;<NEW_LINE>Set<RecipientId> recipientIds <MASK><NEW_LINE>int originalSize = recipientIds.size();<NEW_LINE>recipientIds.addAll(newMembers);<NEW_LINE>return GroupManagerV1.updateGroup(context, groupId, recipientIds, avatar, groupRecord.getTitle(), recipientIds.size() - originalSize);<NEW_LINE>}<NEW_LINE>} | = new HashSet<>(members); |
1,476,965 | private ShardRequestExecutor<ShardUpsertRequest> createExecutor(DependencyCarrier dependencies, PlannerContext plannerContext) {<NEW_LINE><MASK><NEW_LINE>CoordinatorTxnCtx txnCtx = plannerContext.transactionContext();<NEW_LINE>ShardUpsertRequest.Builder requestBuilder = new // missing assignments are for INSERT .. ON DUPLICATE KEY UPDATE<NEW_LINE>ShardUpsertRequest.Builder(// missing assignments are for INSERT .. ON DUPLICATE KEY UPDATE<NEW_LINE>txnCtx.sessionSettings(), // missing assignments are for INSERT .. ON DUPLICATE KEY UPDATE<NEW_LINE>ShardingUpsertExecutor.BULK_REQUEST_TIMEOUT_SETTING.get(clusterService.state().metadata().settings()), // missing assignments are for INSERT .. ON DUPLICATE KEY UPDATE<NEW_LINE>ShardUpsertRequest.DuplicateKeyAction.UPDATE_OR_FAIL, // missing assignments are for INSERT .. ON DUPLICATE KEY UPDATE<NEW_LINE>true, // missing assignments are for INSERT .. ON DUPLICATE KEY UPDATE<NEW_LINE>assignments.targetNames(), null, returnValues, plannerContext.jobId(), false);<NEW_LINE>UpdateRequests updateRequests = new UpdateRequests(requestBuilder, table, assignments);<NEW_LINE>return new ShardRequestExecutor<>(clusterService, txnCtx, dependencies.nodeContext(), table, updateRequests, dependencies.transportActionProvider().transportShardUpsertAction()::execute, docKeys);<NEW_LINE>} | ClusterService clusterService = dependencies.clusterService(); |
1,483,114 | static BigInteger xorNegative(BigInteger val, BigInteger that) {<NEW_LINE>// PRE: val and that are negative<NEW_LINE>// PRE: val has at least as many trailing zero digits as that<NEW_LINE>int resLength = Math.max(val.numberLength, that.numberLength);<NEW_LINE>int[] resDigits = new int[resLength];<NEW_LINE>int iVal = val.getFirstNonzeroDigit();<NEW_LINE>int iThat = that.getFirstNonzeroDigit();<NEW_LINE>int i = iThat;<NEW_LINE>int limit;<NEW_LINE>if (iVal == iThat) {<NEW_LINE>resDigits[i] = -val.digits[i] ^ -that.digits[i];<NEW_LINE>} else {<NEW_LINE>resDigits[i] = -that.digits[i];<NEW_LINE>limit = Math.min(that.numberLength, iVal);<NEW_LINE>for (i++; i < limit; i++) {<NEW_LINE>resDigits[i] <MASK><NEW_LINE>}<NEW_LINE>// Remains digits in that?<NEW_LINE>if (i == that.numberLength) {<NEW_LINE>// Jumping over the remaining zero to the first non one<NEW_LINE>for (; i < iVal; i++) {<NEW_LINE>// resDigits[i] = 0 ^ -1;<NEW_LINE>resDigits[i] = -1;<NEW_LINE>}<NEW_LINE>// resDigits[i] = -val.digits[i] ^ -1;<NEW_LINE>resDigits[i] = val.digits[i] - 1;<NEW_LINE>} else {<NEW_LINE>resDigits[i] = -val.digits[i] ^ ~that.digits[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>limit = Math.min(val.numberLength, that.numberLength);<NEW_LINE>// Perform ^ between that al val until that ends<NEW_LINE>for (i++; i < limit; i++) {<NEW_LINE>// resDigits[i] = ~val.digits[i] ^ ~that.digits[i];<NEW_LINE>resDigits[i] = val.digits[i] ^ that.digits[i];<NEW_LINE>}<NEW_LINE>// Perform ^ between val digits and -1 until val ends<NEW_LINE>for (; i < val.numberLength; i++) {<NEW_LINE>// resDigits[i] = ~val.digits[i] ^ -1 ;<NEW_LINE>resDigits[i] = val.digits[i];<NEW_LINE>}<NEW_LINE>for (; i < that.numberLength; i++) {<NEW_LINE>// resDigits[i] = -1 ^ ~that.digits[i] ;<NEW_LINE>resDigits[i] = that.digits[i];<NEW_LINE>}<NEW_LINE>BigInteger result = new BigInteger(1, resLength, resDigits);<NEW_LINE>result.cutOffLeadingZeroes();<NEW_LINE>return result;<NEW_LINE>} | = ~that.digits[i]; |
914,453 | private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String jobName) {<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 (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>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (jobName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, jobName, accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext(<MASK><NEW_LINE>} | )).readOnly())); |
707,675 | // -------------------------------------------------------------------------<NEW_LINE>// The QueryPart API<NEW_LINE>// -------------------------------------------------------------------------<NEW_LINE>@Override<NEW_LINE>public final void accept(Context<?> ctx) {<NEW_LINE>if (!isExecutable()) {<NEW_LINE>ctx.formatSeparator().start(INSERT_VALUES).visit<MASK><NEW_LINE>} else // Single record inserts can use the standard syntax in any dialect<NEW_LINE>if (rows == 1 && supportsValues(ctx)) {<NEW_LINE>ctx.formatSeparator().start(INSERT_VALUES).visit(K_VALUES).sql(' ');<NEW_LINE>toSQL92Values(ctx);<NEW_LINE>ctx.end(INSERT_VALUES);<NEW_LINE>} else // True SQL92 multi-record inserts aren't always supported<NEW_LINE>{<NEW_LINE>switch(ctx.family()) {<NEW_LINE>// Some dialects don't support multi-record inserts<NEW_LINE>case FIREBIRD:<NEW_LINE>{<NEW_LINE>toSQLInsertSelect(ctx, insertSelect(ctx, GeneratorStatementType.INSERT));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>ctx.formatSeparator().start(INSERT_VALUES).visit(K_VALUES).sql(' ');<NEW_LINE>toSQL92Values(ctx);<NEW_LINE>ctx.end(INSERT_VALUES);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (K_DEFAULT_VALUES).end(INSERT_VALUES); |
1,113,800 | public RestoreOperationResult execute() throws Exception {<NEW_LINE>logger.log(Level.INFO, "");<NEW_LINE>logger.log(Level.INFO, "Running 'Restore' at client " + <MASK><NEW_LINE>logger.log(Level.INFO, "--------------------------------------------");<NEW_LINE>// Find file history<NEW_LINE>FileHistoryId restoreFileHistoryId = findFileHistoryId();<NEW_LINE>if (restoreFileHistoryId == null) {<NEW_LINE>return new RestoreOperationResult(RestoreResultCode.NACK_NO_FILE);<NEW_LINE>}<NEW_LINE>// Find file version<NEW_LINE>FileVersion restoreFileVersion = findRestoreFileVersion(restoreFileHistoryId);<NEW_LINE>if (restoreFileVersion == null) {<NEW_LINE>return new RestoreOperationResult(RestoreResultCode.NACK_NO_FILE);<NEW_LINE>} else if (restoreFileVersion.getType() == FileType.FOLDER) {<NEW_LINE>return new RestoreOperationResult(RestoreResultCode.NACK_INVALID_FILE);<NEW_LINE>}<NEW_LINE>logger.log(Level.INFO, "Restore file identified: " + restoreFileVersion);<NEW_LINE>// Download multichunks<NEW_LINE>downloadMultiChunks(restoreFileVersion);<NEW_LINE>// Restore file<NEW_LINE>logger.log(Level.INFO, "- Restoring: " + restoreFileVersion);<NEW_LINE>RestoreFileSystemAction restoreAction = new RestoreFileSystemAction(config, assembler, restoreFileVersion, options.getRelativeTargetPath());<NEW_LINE>RestoreFileSystemActionResult restoreResult = restoreAction.execute();<NEW_LINE>return new RestoreOperationResult(RestoreResultCode.ACK, restoreResult.getTargetFile());<NEW_LINE>} | config.getMachineName() + " ..."); |
594,616 | protected <T> T fromJson(Object json, JavaType type) throws IOException {<NEW_LINE>if (json instanceof String) {<NEW_LINE>return this.objectMapper.readValue((String) json, type);<NEW_LINE>} else if (json instanceof byte[]) {<NEW_LINE>return this.objectMapper.readValue((byte[]) json, type);<NEW_LINE>} else if (json instanceof File) {<NEW_LINE>return this.objectMapper.readValue((File) json, type);<NEW_LINE>} else if (json instanceof URL) {<NEW_LINE>return this.objectMapper.readValue((URL) json, type);<NEW_LINE>} else if (json instanceof InputStream) {<NEW_LINE>return this.objectMapper.readValue((InputStream) json, type);<NEW_LINE>} else if (json instanceof Reader) {<NEW_LINE>return this.objectMapper.readValue<MASK><NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("'json' argument must be an instance of: " + SUPPORTED_JSON_TYPES + " , but gotten: " + json.getClass());<NEW_LINE>}<NEW_LINE>} | ((Reader) json, type); |
768,943 | final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(untagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<UntagResourceRequest> request = null;<NEW_LINE>Response<UntagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UntagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(untagResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudDirectory");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UntagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UntagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
441,515 | // Convert rgb(51,102,153) to #336699 (this code largely based on YUI code)<NEW_LINE>private String simplifyRGBColours(String contents) {<NEW_LINE>StringBuffer newContents = new StringBuffer();<NEW_LINE>StringBuffer hexColour;<NEW_LINE>String[] rgbColours;<NEW_LINE>int colourValue;<NEW_LINE>Pattern <MASK><NEW_LINE>Matcher matcher = pattern.matcher(contents);<NEW_LINE>while (matcher.find()) {<NEW_LINE>hexColour = new StringBuffer("#");<NEW_LINE>rgbColours = matcher.group(1).split(",");<NEW_LINE>for (String rgbColour : rgbColours) {<NEW_LINE>colourValue = Integer.parseInt(rgbColour);<NEW_LINE>if (colourValue < 16) {<NEW_LINE>hexColour.append("0");<NEW_LINE>}<NEW_LINE>hexColour.append(Integer.toHexString(colourValue));<NEW_LINE>}<NEW_LINE>matcher.appendReplacement(newContents, hexColour.toString());<NEW_LINE>}<NEW_LINE>matcher.appendTail(newContents);<NEW_LINE>return newContents.toString();<NEW_LINE>} | pattern = Pattern.compile("rgb\\s*\\(\\s*([0-9,\\s]+)\\s*\\)"); |
1,672,439 | ContainerInstance parse(DeploymentNodeDslContext context, Tokens tokens) {<NEW_LINE>// containerInstance <identifier> [deploymentGroups] [tags]<NEW_LINE>if (tokens.hasMoreThan(TAGS_INDEX)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (!tokens.includes(IDENTIFIER_INDEX)) {<NEW_LINE>throw new RuntimeException("Expected: " + GRAMMAR);<NEW_LINE>}<NEW_LINE>String containerIdentifier = tokens.get(IDENTIFIER_INDEX);<NEW_LINE>Element element = context.getElement(containerIdentifier);<NEW_LINE>if (element == null) {<NEW_LINE>throw new RuntimeException("The container \"" + containerIdentifier + "\" does not exist");<NEW_LINE>}<NEW_LINE>if (element instanceof Container) {<NEW_LINE>DeploymentNode deploymentNode = context.getDeploymentNode();<NEW_LINE>Set<String> deploymentGroups = new HashSet<>();<NEW_LINE>if (tokens.includes(DEPLOYMENT_GROUPS_TOKEN)) {<NEW_LINE>String token = tokens.get(DEPLOYMENT_GROUPS_TOKEN);<NEW_LINE>String[] deploymentGroupReferences = token.split(",");<NEW_LINE>for (String deploymentGroupReference : deploymentGroupReferences) {<NEW_LINE>Element e = context.getElement(deploymentGroupReference);<NEW_LINE>if (e instanceof DeploymentGroup) {<NEW_LINE>deploymentGroups.add(e.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ContainerInstance containerInstance = deploymentNode.add((Container) element, deploymentGroups.toArray(new String[] {}));<NEW_LINE>if (tokens.includes(TAGS_INDEX)) {<NEW_LINE>String tags = tokens.get(TAGS_INDEX);<NEW_LINE>containerInstance.addTags(tags.split(","));<NEW_LINE>}<NEW_LINE>return containerInstance;<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("The element \"" + containerIdentifier + "\" is not a container");<NEW_LINE>}<NEW_LINE>} | throw new RuntimeException("Too many tokens, expected: " + GRAMMAR); |
249,104 | protected static <T extends StatefulConnection<?, ?>> BoundedAsyncPool<T> doCreatePool(Supplier<CompletionStage<T>> connectionSupplier, BoundedPoolConfig config, boolean wrapConnections) {<NEW_LINE>LettuceAssert.notNull(connectionSupplier, "Connection supplier must not be null");<NEW_LINE>LettuceAssert.notNull(config, "BoundedPoolConfig must not be null");<NEW_LINE>AtomicReference<Origin<T>> <MASK><NEW_LINE>BoundedAsyncPool<T> pool = new BoundedAsyncPool<T>(new RedisPooledObjectFactory<T>(connectionSupplier), config, false) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public CompletableFuture<T> acquire() {<NEW_LINE>CompletableFuture<T> acquire = super.acquire();<NEW_LINE>if (wrapConnections) {<NEW_LINE>return acquire.thenApply(it -> ConnectionWrapping.wrapConnection(it, poolRef.get()));<NEW_LINE>}<NEW_LINE>return acquire;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>public CompletableFuture<Void> release(T object) {<NEW_LINE>if (wrapConnections && object instanceof HasTargetConnection) {<NEW_LINE>return super.release((T) ((HasTargetConnection) object).getTargetConnection());<NEW_LINE>}<NEW_LINE>return super.release(object);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>poolRef.set(new AsyncPoolWrapper<>(pool));<NEW_LINE>return pool;<NEW_LINE>} | poolRef = new AtomicReference<>(); |
723,005 | private void storeTempDir() {<NEW_LINE>String tempDirectoryPath = tempCustomField.getText();<NEW_LINE>if (!UserMachinePreferences.getCustomTempDirectory().equals(tempDirectoryPath)) {<NEW_LINE>try {<NEW_LINE>UserMachinePreferences.setCustomTempDirectory(tempDirectoryPath);<NEW_LINE>} catch (UserMachinePreferencesException ex) {<NEW_LINE>logger.log(Level.<MASK><NEW_LINE>SwingUtilities.invokeLater(() -> {<NEW_LINE>JOptionPane.showMessageDialog(this, String.format("<html>%s</html>", Bundle.AutopsyOptionsPanel_storeTempDir_onError_description(tempDirectoryPath)), Bundle.AutopsyOptionsPanel_storeTempDir_onError_title(), JOptionPane.ERROR_MESSAGE);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TempDirChoice choice;<NEW_LINE>if (tempCaseRadio.isSelected()) {<NEW_LINE>choice = TempDirChoice.CASE;<NEW_LINE>} else if (tempCustomRadio.isSelected()) {<NEW_LINE>choice = TempDirChoice.CUSTOM;<NEW_LINE>} else {<NEW_LINE>choice = TempDirChoice.SYSTEM;<NEW_LINE>}<NEW_LINE>if (!choice.equals(UserMachinePreferences.getTempDirChoice())) {<NEW_LINE>try {<NEW_LINE>UserMachinePreferences.setTempDirChoice(choice);<NEW_LINE>} catch (UserMachinePreferencesException ex) {<NEW_LINE>logger.log(Level.WARNING, "There was an error updating choice to: " + choice.name(), ex);<NEW_LINE>SwingUtilities.invokeLater(() -> {<NEW_LINE>JOptionPane.showMessageDialog(this, String.format("<html>%s</html>", Bundle.AutopsyOptionsPanel_storeTempDir_onChoiceError_description()), Bundle.AutopsyOptionsPanel_storeTempDir_onChoiceError_title(), JOptionPane.ERROR_MESSAGE);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | WARNING, "There was an error creating the temporary directory defined by the user: " + tempDirectoryPath, ex); |
302,667 | public DatasetMetadata unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AwsJsonReader reader = context.getReader();<NEW_LINE>if (!reader.isContainer()) {<NEW_LINE>reader.skipValue();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>DatasetMetadata datasetMetadata = new DatasetMetadata();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE><MASK><NEW_LINE>if (name.equals("CreationTimestamp")) {<NEW_LINE>datasetMetadata.setCreationTimestamp(DateJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("DatasetType")) {<NEW_LINE>datasetMetadata.setDatasetType(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("DatasetArn")) {<NEW_LINE>datasetMetadata.setDatasetArn(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("Status")) {<NEW_LINE>datasetMetadata.setStatus(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("StatusMessage")) {<NEW_LINE>datasetMetadata.setStatusMessage(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("StatusMessageCode")) {<NEW_LINE>datasetMetadata.setStatusMessageCode(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return datasetMetadata;<NEW_LINE>} | String name = reader.nextName(); |
1,238,459 | private List<Mapping> lcs(ArrayList<Tree> list1, ArrayList<Tree> list2, Set<Tree> unmatchedNodes1, Set<Tree> unmatchedNodes2) {<NEW_LINE>int[][] matrix = new int[list1.size() + 1][list2.size() + 1];<NEW_LINE>for (int i = 1; i < list1.size() + 1; i++) {<NEW_LINE>for (int j = 1; j < list2.size() + 1; j++) {<NEW_LINE>if (testCondition(list1.get(i - 1), list2.get(j - 1), unmatchedNodes1, unmatchedNodes2)) {<NEW_LINE>matrix[i][j] = matrix[i - 1<MASK><NEW_LINE>} else {<NEW_LINE>matrix[i][j] = Math.max(matrix[i][j - 1], matrix[i - 1][j]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LinkedList<Mapping> resultList = new LinkedList<>();<NEW_LINE>backtrack(list1, list2, resultList, matrix, list1.size(), list2.size(), unmatchedNodes1, unmatchedNodes2);<NEW_LINE>return resultList;<NEW_LINE>} | ][j - 1] + 1; |
786,570 | public static List<Map<String, Object>> readSelectClause(Expression selectExpression, EntityMetadata m, Boolean useLuceneOrES, KunderaMetadata kunderaMetadata) {<NEW_LINE>List<Map<String, Object>> columnsToOutput = new ArrayList<Map<String, Object>>();<NEW_LINE>if (StateFieldPathExpression.class.isAssignableFrom(selectExpression.getClass())) {<NEW_LINE>Expression sfpExp = selectExpression;<NEW_LINE>addToOutputColumns(<MASK><NEW_LINE>} else if (CollectionExpression.class.isAssignableFrom(selectExpression.getClass())) {<NEW_LINE>CollectionExpression collExp = (CollectionExpression) selectExpression;<NEW_LINE>ListIterator<Expression> itr = collExp.children().iterator();<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>Expression exp = itr.next();<NEW_LINE>if (StateFieldPathExpression.class.isAssignableFrom(exp.getClass())) {<NEW_LINE>addToOutputColumns(exp, m, columnsToOutput, kunderaMetadata);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return columnsToOutput;<NEW_LINE>} | selectExpression, m, columnsToOutput, kunderaMetadata); |
556,766 | final CreateAssetResult executeCreateAsset(CreateAssetRequest createAssetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createAssetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateAssetRequest> request = null;<NEW_LINE>Response<CreateAssetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateAssetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createAssetRequest));<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, "MediaPackage Vod");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateAsset");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateAssetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | false), new CreateAssetResultJsonUnmarshaller()); |
111,667 | private void renderPage(WebContext ctx) {<NEW_LINE>ctx.setVariable(KEY_TITLE, "Features");<NEW_LINE>// Sort natural Order<NEW_LINE>Map<String, Feature> mapOfFeatures = ff4j.getFeatureStore().readAll();<NEW_LINE>List<String> featuresNames = Arrays.asList(mapOfFeatures.keySet().toArray(new String[0]));<NEW_LINE>Collections.sort(featuresNames);<NEW_LINE>List<Feature> orderedFeatures = new ArrayList<Feature>();<NEW_LINE>List<FlippingStrategy> orderedStrategyUsed = new ArrayList<FlippingStrategy>();<NEW_LINE>Map<String, FlippingStrategy> mapOfStrategyUsed = new HashMap<String, FlippingStrategy>();<NEW_LINE>for (String featuName : featuresNames) {<NEW_LINE>Feature feature = mapOfFeatures.get(featuName);<NEW_LINE>orderedFeatures.add(feature);<NEW_LINE>FlippingStrategy strategyTargered = feature.getFlippingStrategy();<NEW_LINE>if (strategyTargered != null) {<NEW_LINE>if (mapOfStrategyUsed.get(strategyTargered.getClass().getSimpleName()) != null) {<NEW_LINE>} else {<NEW_LINE>mapOfStrategyUsed.put(strategyTargered.getClass(<MASK><NEW_LINE>orderedStrategyUsed.add(strategyTargered);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ctx.setVariable("listOfFeatures", orderedFeatures);<NEW_LINE>ctx.setVariable("listOfStrategyUsed", orderedStrategyUsed);<NEW_LINE>// Get Group List<NEW_LINE>List<String> myGroupList = new ArrayList<String>(ff4j.getFeatureStore().readAllGroups());<NEW_LINE>Collections.sort(myGroupList);<NEW_LINE>ctx.setVariable("groupList", myGroupList);<NEW_LINE>} | ).getSimpleName(), strategyTargered); |
888,100 | public void onMessage(Message msg) {<NEW_LINE>String text = null;<NEW_LINE>String messageID = null;<NEW_LINE>results = "";<NEW_LINE>try {<NEW_LINE>text = ((TextMessage) msg).getText();<NEW_LINE><MASK><NEW_LINE>if (text.equalsIgnoreCase("CMT COMMIT")) {<NEW_LINE>testRequiredTx("onMessage()");<NEW_LINE>testSLLaObjectAccess(ejbJndiName1);<NEW_LINE>ctx_getRollbackOnly("onMessage()");<NEW_LINE>testCMTTxCommit();<NEW_LINE>messageID = msg.getJMSMessageID();<NEW_LINE>svLogger.info("Message ID :" + messageID);<NEW_LINE>FATMDBHelper.putQueueMessage(results, replyQueueFactoryName, replyQueueName);<NEW_LINE>svLogger.info("Test results are sent.");<NEW_LINE>} else if (text.equalsIgnoreCase("CMT ROLLBACK")) {<NEW_LINE>testCMTTxRollback();<NEW_LINE>FATMDBHelper.putQueueMessage(results, replyQueueFactoryName, replyQueueName);<NEW_LINE>svLogger.info("Test results are sent.");<NEW_LINE>} else {<NEW_LINE>svLogger.info("*Error : Received unknown message -> " + text);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>svLogger.info("Caught exception: " + e.toString());<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | svLogger.info("senderBean.onMessage(), msg text ->: " + text); |
1,542,948 | private void updateMutables(SubscriptionResult _result, Map<Integer, Object> properties) {<NEW_LINE>Date pub_date = (Date) properties.get(SearchResult.PR_PUB_DATE);<NEW_LINE>if (pub_date == null) {<NEW_LINE>time = _result.getTimeFound();<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>if (pt <= 0) {<NEW_LINE>time = _result.getTimeFound();<NEW_LINE>} else {<NEW_LINE>time = pt;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tags = (String[]) properties.get(SearchResult.PR_TAGS);<NEW_LINE>long seeds = (Long) properties.get(SearchResult.PR_SEED_COUNT);<NEW_LINE>long leechers = (Long) properties.get(SearchResult.PR_LEECHER_COUNT);<NEW_LINE>seed_count = (int) (seeds < 0 ? 0 : seeds);<NEW_LINE>seeds_peers = (seeds < 0 ? "--" : String.valueOf(seeds)) + "/" + (leechers < 0 ? "--" : String.valueOf(leechers));<NEW_LINE>if (seeds < 0) {<NEW_LINE>seeds = 0;<NEW_LINE>} else {<NEW_LINE>seeds++;<NEW_LINE>}<NEW_LINE>if (leechers < 0) {<NEW_LINE>leechers = 0;<NEW_LINE>} else {<NEW_LINE>leechers++;<NEW_LINE>}<NEW_LINE>seeds_peers_sort = ((seeds & 0x7fffffff) << 32) | (leechers & 0xffffffff);<NEW_LINE>long votes = (Long) properties.get(SearchResult.PR_VOTES);<NEW_LINE>long comments = (Long) properties.get(SearchResult.PR_COMMENTS);<NEW_LINE>if (votes < 0 && comments < 0) {<NEW_LINE>votes_comments_sort = 0;<NEW_LINE>votes_comments = null;<NEW_LINE>} else {<NEW_LINE>votes_comments = (votes < 0 ? "--" : String.valueOf(votes)) + "/" + (comments < 0 ? "--" : String.valueOf(comments));<NEW_LINE>if (votes < 0) {<NEW_LINE>votes = 0;<NEW_LINE>} else {<NEW_LINE>votes++;<NEW_LINE>}<NEW_LINE>if (comments < 0) {<NEW_LINE>comments = 0;<NEW_LINE>} else {<NEW_LINE>comments++;<NEW_LINE>}<NEW_LINE>votes_comments_sort = ((votes & 0x7fffffff) << 32) | (comments & 0xffffffff);<NEW_LINE>}<NEW_LINE>rank = ((Long) properties.get(SearchResult.PR_RANK)).intValue();<NEW_LINE>} | long pt = pub_date.getTime(); |
1,325,393 | public static IStatus nativeCopy(IPath source, IPath dest, IProgressMonitor monitor) {<NEW_LINE>// TODO Piping output to the monitor is nice, but if we're copying huge amounts of files, maybe we should limit<NEW_LINE>// how often we pipe the output?<NEW_LINE>// FIXME This will pipe output to the monitor, but won't actually provide real progress in terms of file counts<NEW_LINE>if (PlatformUtil.isWindows()) {<NEW_LINE>IStatus status = new ProcessRunner().run(null, null, null, CollectionsUtil.newList("robocopy", source.toOSString(), dest.toOSString(), "/E", "/DCOPY:T", "/R:0"), monitor);<NEW_LINE>// looks like exit code of 1 here is actually expected for copying any files. 0 means no files copied. See<NEW_LINE>// http://ss64.com/nt/robocopy-exit.html<NEW_LINE>if (status.getCode() == 1) {<NEW_LINE>ProcessStatus ps = (ProcessStatus) status;<NEW_LINE>return new ProcessStatus(0, ps.getStdOut(<MASK><NEW_LINE>}<NEW_LINE>return status;<NEW_LINE>}<NEW_LINE>// We use this call so we pipe output to the monitor.<NEW_LINE>return new ProcessRunner().run(null, null, null, CollectionsUtil.newList("cp", "-f", "-R", source.toOSString(), dest.toOSString()), monitor);<NEW_LINE>} | ), ps.getStdErr()); |
1,170,466 | public List<WorkflowScheme> findSchemesForStruct(final String structId) throws DotDataException {<NEW_LINE>List<WorkflowScheme> schemes = cache.getSchemesByStruct(structId);<NEW_LINE>if (schemes != null) {<NEW_LINE>// checks if any of the schemes has been invalidated (save recently and needs to refresh the schemes for the content type).<NEW_LINE>if (!schemes.stream().filter(scheme -> null == cache.getScheme(scheme.getId())).findFirst().isPresent()) {<NEW_LINE>return schemes;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>db.setSQL(sql.SELECT_SCHEME_BY_STRUCT);<NEW_LINE>db.addParam(structId);<NEW_LINE>try {<NEW_LINE>schemes = this.convertListToObjects(db.loadObjectResults(), WorkflowScheme.class);<NEW_LINE>} catch (final Exception er) {<NEW_LINE>schemes = new ArrayList();<NEW_LINE>}<NEW_LINE>cache.addForStructure(structId, schemes);<NEW_LINE>schemes.stream().forEach(scheme -> cache.add(scheme));<NEW_LINE>return schemes;<NEW_LINE>} | final DotConnect db = new DotConnect(); |
944,051 | public List<String> list(Business business, EffectivePerson effectivePerson, List<String> identities, List<String> units, List<String> groups, Application application, Wi wi) throws Exception {<NEW_LINE>EntityManager em = business.entityManagerContainer().get(Process.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<String> cq = cb.createQuery(String.class);<NEW_LINE>Root<Process> root = cq.from(Process.class);<NEW_LINE>Predicate p = cb.conjunction();<NEW_LINE>if (effectivePerson.isNotManager() && (!BooleanUtils.isTrue(business.organization().person().hasRole(effectivePerson, OrganizationDefinition.Manager, OrganizationDefinition.ProcessPlatformManager)))) {<NEW_LINE>p = cb.and(cb.isEmpty(root.get(Process_.startableIdentityList)), cb.isEmpty(root.get(Process_.startableUnitList)), cb.isEmpty(root.get(Process_.startableGroupList)));<NEW_LINE>p = cb.or(p, cb.equal(root.get(Process_.creatorPerson)<MASK><NEW_LINE>if (ListTools.isNotEmpty(identities)) {<NEW_LINE>p = cb.or(p, root.get(Process_.startableIdentityList).in(identities));<NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(units)) {<NEW_LINE>p = cb.or(p, root.get(Process_.startableUnitList).in(units));<NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(groups)) {<NEW_LINE>p = cb.or(p, root.get(Process_.startableGroupList).in(groups));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>p = cb.and(p, cb.equal(root.get(Process_.application), application.getId()));<NEW_LINE>p = cb.and(p, cb.or(cb.isTrue(root.get(Process_.editionEnable)), cb.isNull(root.get(Process_.editionEnable))));<NEW_LINE>if (StringUtils.equals(wi.getStartableTerminal(), Process.STARTABLETERMINAL_CLIENT)) {<NEW_LINE>p = cb.and(p, cb.or(cb.isNull(root.get(Process_.startableTerminal)), cb.equal(root.get(Process_.startableTerminal), ""), cb.equal(root.get(Process_.startableTerminal), Process.STARTABLETERMINAL_CLIENT), cb.equal(root.get(Process_.startableTerminal), Process.STARTABLETERMINAL_ALL)));<NEW_LINE>} else if (StringUtils.equals(wi.getStartableTerminal(), Process.STARTABLETERMINAL_MOBILE)) {<NEW_LINE>p = cb.and(p, cb.or(cb.isNull(root.get(Process_.startableTerminal)), cb.equal(root.get(Process_.startableTerminal), ""), cb.equal(root.get(Process_.startableTerminal), Process.STARTABLETERMINAL_MOBILE), cb.equal(root.get(Process_.startableTerminal), Process.STARTABLETERMINAL_ALL)));<NEW_LINE>}<NEW_LINE>cq.select(root.get(Process_.id)).where(p);<NEW_LINE>return em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());<NEW_LINE>} | , effectivePerson.getDistinguishedName())); |
1,726,373 | public ClusterMergeHistory run(Relation<O> relation) {<NEW_LINE>final QueryBuilder<O> qb = new QueryBuilder<>(relation, distance);<NEW_LINE>final DistanceQuery<O> distQ = qb.distanceQuery();<NEW_LINE>final KNNSearcher<DBIDRef> knnQ = qb.kNNByDBID(minPts);<NEW_LINE>// We need array addressing later.<NEW_LINE>final ArrayDBIDs ids = DBIDUtil.ensureArray(relation.getDBIDs());<NEW_LINE>// Compute the core distances<NEW_LINE>// minPts + 1: ignore query point.<NEW_LINE>final WritableDoubleDataStore coredists = computeCoreDists(ids, knnQ, minPts);<NEW_LINE>WritableDBIDDataStore pi = DataStoreUtil.makeDBIDStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_STATIC);<NEW_LINE>WritableDoubleDataStore lambda = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_STATIC, Double.POSITIVE_INFINITY);<NEW_LINE>// Temporary storage for m.<NEW_LINE>WritableDoubleDataStore m = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP);<NEW_LINE>FiniteProgress progress = LOG.isVerbose() ? new FiniteProgress("Running HDBSCAN*-SLINK", ids.size(), LOG) : null;<NEW_LINE>// has to be an array for monotonicity reasons!<NEW_LINE>ModifiableDBIDs processedIDs = DBIDUtil.newArray(ids.size());<NEW_LINE>for (DBIDIter id = ids.iter(); id.valid(); id.advance()) {<NEW_LINE>// Steps 1,3,4 are exactly as in SLINK<NEW_LINE>pi.put(id, id);<NEW_LINE>// Step 2 is modified to use a different distance<NEW_LINE>step2(id, processedIDs, distQ, coredists, m);<NEW_LINE>step3(id, pi, lambda, processedIDs, m);<NEW_LINE>step4(id, pi, lambda, processedIDs);<NEW_LINE>processedIDs.add(id);<NEW_LINE>LOG.incrementProcessed(progress);<NEW_LINE>}<NEW_LINE>LOG.ensureCompleted(progress);<NEW_LINE>return //<NEW_LINE>SLINK.convertOutput(new ClusterMergeHistoryBuilder(ids, distance.isSquared()), ids, pi<MASK><NEW_LINE>} | , lambda).complete(coredists); |
1,689,585 | private void findSystemActionsMapByContentType(final ImmutableMap.Builder<String, List<Map<String, Object>>> mappingMapBuilder, final String selectQueryTemplate, final Set<String> notFoundContentTypesSet) throws DotDataException {<NEW_LINE>final List<List<String>> notFoundContentTypesListOfList = // select in does not support more than 100<NEW_LINE>Lists.// select in does not support more than 100<NEW_LINE>partition(// select in does not support more than 100<NEW_LINE>new ArrayList<>(notFoundContentTypesSet), 100);<NEW_LINE>for (final List<String> notFoundContentTypes : notFoundContentTypesListOfList) {<NEW_LINE>final DotConnect dotConnect = new DotConnect().setSQL(String.format(selectQueryTemplate, this.createQueryIn(notFoundContentTypes)));<NEW_LINE>notFoundContentTypes.stream().forEach(dotConnect::addObject);<NEW_LINE>final List<Map<String, Object>> mappingRows = dotConnect.loadObjectResults();<NEW_LINE>if (!mappingRows.isEmpty()) {<NEW_LINE>final Map<String, List<Map<String, Object>>> dbMappingMap = new HashMap<>();<NEW_LINE>for (final Map<String, Object> rowMap : mappingRows) {<NEW_LINE>final String variable = (String) rowMap.get("scheme_or_content_type");<NEW_LINE>dbMappingMap.computeIfAbsent(variable, key -> new ArrayList<>()).add(rowMap);<NEW_LINE>}<NEW_LINE>for (final Map.Entry<String, List<Map<String, Object>>> contentTypeResultsEntry : dbMappingMap.entrySet()) {<NEW_LINE>final String variable = contentTypeResultsEntry.getKey();<NEW_LINE>final List<Map<String, Object><MASK><NEW_LINE>this.cache.addSystemActionsByContentType(variable, UtilMethods.isSet(results) ? results : Collections.emptyList());<NEW_LINE>}<NEW_LINE>mappingMapBuilder.putAll(dbMappingMap);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | > results = contentTypeResultsEntry.getValue(); |
603,771 | public ApiResponse<Void> updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'petId' is set<NEW_LINE>if (petId == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/pet/{petId}".replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>if (name != null)<NEW_LINE>localVarFormParams.put("name", name);<NEW_LINE>if (status != null)<NEW_LINE>localVarFormParams.put("status", status);<NEW_LINE>final String[] localVarAccepts = {};<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/x-www-form-urlencoded" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "petstore_auth" };<NEW_LINE>return apiClient.invokeAPI("PetApi.updatePetWithForm", localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null, false);<NEW_LINE>} | throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm"); |
67,230 | private static Set<String> supportedCiphers(SSLEngine engine) {<NEW_LINE>// Choose the sensible default list of cipher suites.<NEW_LINE>final String[<MASK><NEW_LINE>Set<String> supportedCiphersSet = new LinkedHashSet<String>(supportedCiphers.length);<NEW_LINE>for (int i = 0; i < supportedCiphers.length; ++i) {<NEW_LINE>String supportedCipher = supportedCiphers[i];<NEW_LINE>supportedCiphersSet.add(supportedCipher);<NEW_LINE>// IBM's J9 JVM utilizes a custom naming scheme for ciphers and only returns ciphers with the "SSL_"<NEW_LINE>// prefix instead of the "TLS_" prefix (as defined in the JSSE cipher suite names [1]). According to IBM's<NEW_LINE>// documentation [2] the "SSL_" prefix is "interchangeable" with the "TLS_" prefix.<NEW_LINE>// See the IBM forum discussion [3] and issue on IBM's JVM [4] for more details.<NEW_LINE>// [1] https://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html#ciphersuites<NEW_LINE>// [2] https://www.ibm.com/support/knowledgecenter/en/SSYKE2_8.0.0/com.ibm.java.security.component.80.doc/<NEW_LINE>// security-component/jsse2Docs/ciphersuites.html<NEW_LINE>// [3] https://www.ibm.com/developerworks/community/forums/html/topic?id=9b5a56a9-fa46-4031-b33b-df91e28d77c2<NEW_LINE>// [4] https://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=71770<NEW_LINE>if (supportedCipher.startsWith("SSL_")) {<NEW_LINE>final String tlsPrefixedCipherName = "TLS_" + supportedCipher.substring("SSL_".length());<NEW_LINE>try {<NEW_LINE>engine.setEnabledCipherSuites(new String[] { tlsPrefixedCipherName });<NEW_LINE>supportedCiphersSet.add(tlsPrefixedCipherName);<NEW_LINE>} catch (IllegalArgumentException ignored) {<NEW_LINE>// The cipher is not supported ... move on to the next cipher.<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return supportedCiphersSet;<NEW_LINE>} | ] supportedCiphers = engine.getSupportedCipherSuites(); |
1,037,101 | public LogEventRequestAndResponse deserialize(String jsonHttpRequestAndHttpResponse) {<NEW_LINE>if (isBlank(jsonHttpRequestAndHttpResponse)) {<NEW_LINE>throw new IllegalArgumentException("1 error:" + NEW_LINE + " - a request is required but value was \"" + jsonHttpRequestAndHttpResponse + "\"");<NEW_LINE>} else {<NEW_LINE>LogEventRequestAndResponse httpRequestAndHttpResponse = null;<NEW_LINE>try {<NEW_LINE>LogEventRequestAndResponseDTO httpRequestAndHttpResponseDTO = objectMapper.readValue(jsonHttpRequestAndHttpResponse, LogEventRequestAndResponseDTO.class);<NEW_LINE>if (httpRequestAndHttpResponseDTO != null) {<NEW_LINE>httpRequestAndHttpResponse = httpRequestAndHttpResponseDTO.buildObject();<NEW_LINE>}<NEW_LINE>} catch (Throwable throwable) {<NEW_LINE>mockServerLogger.logEvent(new LogEntry().setLogLevel(Level.ERROR).setMessageFormat("exception while parsing{}for HttpRequestAndHttpResponse " + throwable.getMessage()).setArguments(jsonHttpRequestAndHttpResponse).setThrowable(throwable));<NEW_LINE>throw new IllegalArgumentException(<MASK><NEW_LINE>}<NEW_LINE>return httpRequestAndHttpResponse;<NEW_LINE>}<NEW_LINE>} | "exception while parsing [" + jsonHttpRequestAndHttpResponse + "] for HttpRequestAndHttpResponse", throwable); |
1,146,719 | public static void main(String[] args) throws UnknownFunctionException, UnparsableExpressionException, InvalidCustomFunctionException {<NEW_LINE>// Test 1<NEW_LINE>// ======<NEW_LINE>Calculable calc1 = new ExpressionBuilder("x * y - 2").withVariableNames("x", "y").build();<NEW_LINE>calc1.setVariable(new Variable("x", 1.2));<NEW_LINE>calc1.setVariable(new Variable("y", 2.2));<NEW_LINE>System.out.println(calc1.calculate().toString());<NEW_LINE>// double result = calc1.calculate().getDoubleValue();<NEW_LINE>// System.out.println(result);<NEW_LINE>// Test 2<NEW_LINE>// ======<NEW_LINE>// A function which calculates the mean of an array and scales it<NEW_LINE>CustomFunction meanFn = new CustomFunction("mean", 2) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Variable applyFunction(List<Variable> vars) {<NEW_LINE>double[] vals;<NEW_LINE>double scale;<NEW_LINE>try {<NEW_LINE>vals = vars.<MASK><NEW_LINE>scale = vars.get(1).getDoubleValue();<NEW_LINE>} catch (Exception e) {<NEW_LINE>return new Variable("Invalid");<NEW_LINE>}<NEW_LINE>double subtotal = 0;<NEW_LINE>for (int i = 0; i < vals.length; i++) {<NEW_LINE>subtotal += vals[i];<NEW_LINE>}<NEW_LINE>subtotal = scale * subtotal / vals.length;<NEW_LINE>return new Variable("double MEAN result, ", subtotal);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>ExpressionBuilder b = new ExpressionBuilder("mean(x,y)");<NEW_LINE>b.withCustomFunction(meanFn);<NEW_LINE>b.withVariable(new Variable("x", new double[] { 1.1, 2, 10, 3, 2.4, 10.2 }));<NEW_LINE>b.withVariable(new Variable("y", 2));<NEW_LINE>Calculable calc2 = b.build();<NEW_LINE>System.out.println(calc2.calculate().toString());<NEW_LINE>// Test 3<NEW_LINE>// ======<NEW_LINE>Calculable calc3 = new ExpressionBuilder("x * y - 2").withVariableNames("x", "y").build();<NEW_LINE>calc3.setVariable(new Variable("x", new double[] { 1.2, 10, 20, 15 }));<NEW_LINE>calc3.setVariable(new Variable("y", new double[] { 2.2, 5.2, 12, 9 }));<NEW_LINE>// double result3 = calc3.calculate().getDoubleValue();<NEW_LINE>System.out.println(calc3.calculate().toString());<NEW_LINE>// Test 4<NEW_LINE>// ======<NEW_LINE>Calculable calc4 = new ExpressionBuilder("log10(sqrt(x) * abs(y))").withVariableNames("x", "y").build();<NEW_LINE>calc4.setVariable(new Variable("x", new double[] { 1.2, 10, 10, 15 }));<NEW_LINE>calc4.setVariable(new Variable("y", new double[] { 2.2, -5.2, 5.2, 9 }));<NEW_LINE>// double result3 = calc3.calculate().getDoubleValue();<NEW_LINE>System.out.println(calc4.calculate().toString());<NEW_LINE>} | get(0).getArrayValue(); |
1,015,901 | protected AttachmentResponse createBinaryAttachment(MultipartHttpServletRequest request, Task task, HttpServletResponse response) {<NEW_LINE>String name = null;<NEW_LINE>String description = null;<NEW_LINE>String type = null;<NEW_LINE>Map<String, String[]> paramMap = request.getParameterMap();<NEW_LINE>for (String parameterName : paramMap.keySet()) {<NEW_LINE>if (paramMap.get(parameterName).length > 0) {<NEW_LINE>if ("name".equalsIgnoreCase(parameterName)) {<NEW_LINE>name = paramMap<MASK><NEW_LINE>} else if ("description".equalsIgnoreCase(parameterName)) {<NEW_LINE>description = paramMap.get(parameterName)[0];<NEW_LINE>} else if ("type".equalsIgnoreCase(parameterName)) {<NEW_LINE>type = paramMap.get(parameterName)[0];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (name == null) {<NEW_LINE>throw new FlowableIllegalArgumentException("Attachment name is required.");<NEW_LINE>}<NEW_LINE>if (request.getFileMap().size() == 0) {<NEW_LINE>throw new FlowableIllegalArgumentException("Attachment content is required.");<NEW_LINE>}<NEW_LINE>MultipartFile file = request.getFileMap().values().iterator().next();<NEW_LINE>if (file == null) {<NEW_LINE>throw new FlowableIllegalArgumentException("Attachment content is required.");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Attachment createdAttachment = taskService.createAttachment(type, task.getId(), task.getProcessInstanceId(), name, description, file.getInputStream());<NEW_LINE>response.setStatus(HttpStatus.CREATED.value());<NEW_LINE>return restResponseFactory.createAttachmentResponse(createdAttachment);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new FlowableException("Error creating attachment response", e);<NEW_LINE>}<NEW_LINE>} | .get(parameterName)[0]; |
1,607,532 | // Dump the content of this bean returning it as a String<NEW_LINE>public void dump(StringBuffer str, String indent) {<NEW_LINE>String s;<NEW_LINE>Object o;<NEW_LINE>org.<MASK><NEW_LINE>str.append(indent);<NEW_LINE>// NOI18N<NEW_LINE>str.append("PropertyOne");<NEW_LINE>// NOI18N<NEW_LINE>str.append(indent + "\t");<NEW_LINE>// NOI18N<NEW_LINE>str.append("<");<NEW_LINE>s = this.getPropertyOne();<NEW_LINE>// NOI18N<NEW_LINE>str.append((s == null ? "null" : s.trim()));<NEW_LINE>// NOI18N<NEW_LINE>str.append(">\n");<NEW_LINE>this.dumpAttributes(PROPERTY_ONE, 0, str, indent);<NEW_LINE>str.append(indent);<NEW_LINE>// NOI18N<NEW_LINE>str.append("PropertyTwo");<NEW_LINE>// NOI18N<NEW_LINE>str.append(indent + "\t");<NEW_LINE>// NOI18N<NEW_LINE>str.append("<");<NEW_LINE>s = this.getPropertyTwo();<NEW_LINE>// NOI18N<NEW_LINE>str.append((s == null ? "null" : s.trim()));<NEW_LINE>// NOI18N<NEW_LINE>str.append(">\n");<NEW_LINE>this.dumpAttributes(PROPERTY_TWO, 0, str, indent);<NEW_LINE>str.append(indent);<NEW_LINE>// NOI18N<NEW_LINE>str.append("ChildObjectOne");<NEW_LINE>n = (org.netbeans.modules.schema2beans.BaseBean) this.getChildObjectOne();<NEW_LINE>if (n != null)<NEW_LINE>// NOI18N<NEW_LINE>n.dump(str, indent + "\t");<NEW_LINE>else<NEW_LINE>// NOI18N<NEW_LINE>str.append(indent + "\tnull");<NEW_LINE>this.dumpAttributes(CHILD_OBJECT_ONE, 0, str, indent);<NEW_LINE>str.append(indent);<NEW_LINE>// NOI18N<NEW_LINE>str.append("ChildObjectTwo");<NEW_LINE>n = (org.netbeans.modules.schema2beans.BaseBean) this.getChildObjectTwo();<NEW_LINE>if (n != null)<NEW_LINE>// NOI18N<NEW_LINE>n.dump(str, indent + "\t");<NEW_LINE>else<NEW_LINE>// NOI18N<NEW_LINE>str.append(indent + "\tnull");<NEW_LINE>this.dumpAttributes(CHILD_OBJECT_TWO, 0, str, indent);<NEW_LINE>str.append(indent);<NEW_LINE>// NOI18N<NEW_LINE>str.append("ChildObjectThree[" + this.sizeChildObjectThree() + "]");<NEW_LINE>for (int i = 0; i < this.sizeChildObjectThree(); i++) {<NEW_LINE>str.append(indent + "\t");<NEW_LINE>str.append("#" + i + ":");<NEW_LINE>n = (org.netbeans.modules.schema2beans.BaseBean) this.getChildObjectThree(i);<NEW_LINE>if (n != null)<NEW_LINE>// NOI18N<NEW_LINE>n.dump(str, indent + "\t");<NEW_LINE>else<NEW_LINE>// NOI18N<NEW_LINE>str.append(indent + "\tnull");<NEW_LINE>this.dumpAttributes(CHILD_OBJECT_THREE, i, str, indent);<NEW_LINE>}<NEW_LINE>str.append(indent);<NEW_LINE>// NOI18N<NEW_LINE>str.append("ChildObjectFour[" + this.sizeChildObjectFour() + "]");<NEW_LINE>for (int i = 0; i < this.sizeChildObjectFour(); i++) {<NEW_LINE>str.append(indent + "\t");<NEW_LINE>str.append("#" + i + ":");<NEW_LINE>n = (org.netbeans.modules.schema2beans.BaseBean) this.getChildObjectFour(i);<NEW_LINE>if (n != null)<NEW_LINE>// NOI18N<NEW_LINE>n.dump(str, indent + "\t");<NEW_LINE>else<NEW_LINE>// NOI18N<NEW_LINE>str.append(indent + "\tnull");<NEW_LINE>this.dumpAttributes(CHILD_OBJECT_FOUR, i, str, indent);<NEW_LINE>}<NEW_LINE>} | netbeans.modules.schema2beans.BaseBean n; |
1,703,769 | public static void montecarlo(final int size) {<NEW_LINE>float[] output = new float[size];<NEW_LINE>float[] seq = new float[size];<NEW_LINE>WorkerGrid workerGrid = new WorkerGrid1D(size);<NEW_LINE>GridScheduler gridScheduler = new GridScheduler("s0.t0", workerGrid);<NEW_LINE>KernelContext context = new KernelContext();<NEW_LINE>// [Optional] Set the global work size<NEW_LINE>workerGrid.setGlobalWork(size, 1, 1);<NEW_LINE>// [Optional] Set the local work group to be 1024, 1, 1<NEW_LINE>workerGrid.setLocalWork(1024, 1, 1);<NEW_LINE>TaskSchedule t0 = new TaskSchedule("s0").task("t0", Montecarlo::computeMontecarlo, context, output, size).streamOut(output);<NEW_LINE>long start = System.nanoTime();<NEW_LINE>t0.execute(gridScheduler);<NEW_LINE>long end = System.nanoTime();<NEW_LINE>long tornadoTime = (end - start);<NEW_LINE>float sum = 0;<NEW_LINE>for (int j = 0; j < size; j++) {<NEW_LINE>sum += output[j];<NEW_LINE>}<NEW_LINE>sum *= 4;<NEW_LINE>System.out.<MASK><NEW_LINE>System.out.println("Pi value(Tornado) : " + (sum / size));<NEW_LINE>start = System.nanoTime();<NEW_LINE>computeMontecarlo(seq, size);<NEW_LINE>end = System.nanoTime();<NEW_LINE>long sequentialTime = (end - start);<NEW_LINE>sum = 0;<NEW_LINE>for (int j = 0; j < size; j++) {<NEW_LINE>sum += seq[j];<NEW_LINE>}<NEW_LINE>sum *= 4;<NEW_LINE>System.out.println("Total time (Sequential): " + (sequentialTime));<NEW_LINE>System.out.println("Pi value(seq) : " + (sum / size));<NEW_LINE>double speedup = (double) sequentialTime / (double) tornadoTime;<NEW_LINE>System.out.println("Speedup: " + speedup);<NEW_LINE>} | println("Total time (Tornado) : " + (tornadoTime)); |
1,065,599 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {<NEW_LINE>super.onViewCreated(view, savedInstanceState);<NEW_LINE>// noinspection ConstantConditions<NEW_LINE>mRecyclerView = getView().findViewById(R.id.recycler_view);<NEW_LINE>mLayoutManager = new LinearLayoutManager(requireContext());<NEW_LINE>final Parcelable eimSavedState = (savedInstanceState != null) ? savedInstanceState.getParcelable(SAVED_STATE_EXPANDABLE_ITEM_MANAGER) : null;<NEW_LINE>mRecyclerViewExpandableItemManager = new RecyclerViewExpandableItemManager(eimSavedState);<NEW_LINE>mRecyclerViewExpandableItemManager.setOnGroupExpandListener(this);<NEW_LINE>mRecyclerViewExpandableItemManager.setOnGroupCollapseListener(this);<NEW_LINE>// adapter<NEW_LINE>final AddRemoveExpandableExampleAdapter myItemAdapter = new AddRemoveExpandableExampleAdapter(mRecyclerViewExpandableItemManager, getDataProvider());<NEW_LINE>mAdapter = myItemAdapter;<NEW_LINE>// wrap for expanding<NEW_LINE>mWrappedAdapter = mRecyclerViewExpandableItemManager.createWrappedAdapter(myItemAdapter);<NEW_LINE>final GeneralItemAnimator animator = new RefactoredDefaultItemAnimator();<NEW_LINE>// Change animations are enabled by default since support-v7-recyclerview v22.<NEW_LINE>// Need to disable them when using animation indicator.<NEW_LINE>animator.setSupportsChangeAnimations(false);<NEW_LINE>mRecyclerView.setLayoutManager(mLayoutManager);<NEW_LINE>// requires *wrapped* adapter<NEW_LINE>mRecyclerView.setAdapter(mWrappedAdapter);<NEW_LINE>mRecyclerView.setItemAnimator(animator);<NEW_LINE>mRecyclerView.setHasFixedSize(false);<NEW_LINE>// additional decorations<NEW_LINE>// noinspection StatementWithEmptyBody<NEW_LINE>if (supportsViewElevation()) {<NEW_LINE>// Lollipop or later has native drop shadow feature. ItemShadowDecorator is not required.<NEW_LINE>} else {<NEW_LINE>mRecyclerView.addItemDecoration(new ItemShadowDecorator((NinePatchDrawable) ContextCompat.getDrawable(requireContext(), R.drawable.material_shadow_z1)));<NEW_LINE>}<NEW_LINE>mRecyclerView.addItemDecoration(new SimpleListDividerDecorator(ContextCompat.getDrawable(requireContext(), R.<MASK><NEW_LINE>mRecyclerViewExpandableItemManager.attachRecyclerView(mRecyclerView);<NEW_LINE>} | drawable.list_divider_h), true)); |
1,058,764 | private void shareItems(Set<Recording> selected) {<NEW_LINE>FragmentActivity activity = getActivity();<NEW_LINE>if (activity != null) {<NEW_LINE>ArrayList<Uri> uris = new ArrayList<>();<NEW_LINE>for (Recording rec : selected) {<NEW_LINE>File file = rec == SHARE_LOCATION_FILE ? generateGPXForRecordings(selected) : rec.getFile();<NEW_LINE>if (file != null) {<NEW_LINE>uris.add(AndroidUtils.getUriForFile(activity, file));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Intent intent = new Intent(Intent.ACTION_SEND_MULTIPLE);<NEW_LINE>intent.setType("*/*");<NEW_LINE>intent.putExtra(Intent.EXTRA_STREAM, uris);<NEW_LINE>intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);<NEW_LINE>if (Build.VERSION.SDK_INT > 18) {<NEW_LINE>intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);<NEW_LINE>}<NEW_LINE>Intent chooserIntent = Intent.createChooser(intent, getString<MASK><NEW_LINE>AndroidUtils.startActivityIfSafe(activity, intent, chooserIntent);<NEW_LINE>}<NEW_LINE>} | (R.string.share_note)); |
94,168 | public static void drawPolygon(Polygon2D_F64 polygon, boolean loop, double scale, Color color0, Color colorOthers, Graphics2D g2) {<NEW_LINE>BoofSwingUtil.antialiasing(g2);<NEW_LINE>Path2D path = new Path2D.Double();<NEW_LINE>for (int i = 1; i <= polygon.size(); i++) {<NEW_LINE>Point2D_F64 p = polygon.get(i % polygon.size());<NEW_LINE>if (i == 1) {<NEW_LINE>path.moveTo(scale * p.<MASK><NEW_LINE>} else {<NEW_LINE>path.lineTo(scale * p.x, scale * p.y);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>g2.setColor(colorOthers);<NEW_LINE>g2.draw(path);<NEW_LINE>path.reset();<NEW_LINE>for (int i = 0; i < 2; i++) {<NEW_LINE>Point2D_F64 p = polygon.get(i);<NEW_LINE>if (i == 0) {<NEW_LINE>path.moveTo(scale * p.x, scale * p.y);<NEW_LINE>} else {<NEW_LINE>path.lineTo(scale * p.x, scale * p.y);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>g2.setColor(color0);<NEW_LINE>g2.draw(path);<NEW_LINE>} | x, scale * p.y); |
625,580 | private static void testFullArray() {<NEW_LINE>Object[][] array2d = new HasName[2][2];<NEW_LINE>assertTrue(array2d[0].length == 2);<NEW_LINE>assertTrue(array2d.length == 2);<NEW_LINE>// You can swap out an entire array in an array slot.<NEW_LINE>array2d[0] = new HasName[2];<NEW_LINE>assertTrue(array2d[0].length == 2);<NEW_LINE>// When inserting an array into an array slot you *can* change the length.<NEW_LINE>array2d[0] = new HasName[4];<NEW_LINE>assertTrue(array2d[0].length == 4);<NEW_LINE>// When inserting an array into an array slot you can tighten the leaf type as a class or<NEW_LINE>// interface.<NEW_LINE>array2d[0] = new Person[2];<NEW_LINE>assertTrue(array2d[0].length == 2);<NEW_LINE>array2d[<MASK><NEW_LINE>assertTrue(array2d[0].length == 2);<NEW_LINE>// When inserting an array into an array slot you can NOT broaden the leaf type.<NEW_LINE>assertThrows(ArrayStoreException.class, () -> array2d[0] = new Object[2]);<NEW_LINE>// You can NOT put an object in a slot that expects an array.<NEW_LINE>assertThrows(ArrayStoreException.class, () -> ((Object[]) array2d)[0] = new Object());<NEW_LINE>// When inserting an array into an array slot you can not change the number of dimensions.<NEW_LINE>assertThrows(ArrayStoreException.class, () -> array2d[0] = new HasName[2][2]);<NEW_LINE>} | 0] = new HasFullName[2]; |
1,166,012 | public void onResume() {<NEW_LINE>super.onResume();<NEW_LINE>// TODO [alex] LargeScreenSupport -- Remove these lines.<NEW_LINE>WindowUtil.setLightNavigationBarFromTheme(requireActivity());<NEW_LINE>WindowUtil.setLightStatusBarFromTheme(requireActivity());<NEW_LINE>EventBus.getDefault().register(this);<NEW_LINE>initializeIdentityRecords();<NEW_LINE>composeText.setTransport(sendButton.getSelectedTransport());<NEW_LINE>Recipient recipientSnapshot = recipient.get();<NEW_LINE>titleView.setTitle(glideRequests, recipientSnapshot);<NEW_LINE>setBlockedUserState(recipientSnapshot, isSecureText, isDefaultSms);<NEW_LINE>calculateCharactersRemaining();<NEW_LINE>if (recipientSnapshot.getGroupId().isPresent() && recipientSnapshot.getGroupId().get().isV2() && !recipientSnapshot.isBlocked()) {<NEW_LINE>GroupId.V2 groupId = recipientSnapshot.getGroupId().get().requireV2();<NEW_LINE>ApplicationDependencies.getJobManager().startChain(new RequestGroupV2InfoJob(groupId)).then(GroupV2UpdateSelfProfileKeyJob.withoutLimits<MASK><NEW_LINE>if (viewModel.getArgs().isFirstTimeInSelfCreatedGroup()) {<NEW_LINE>groupViewModel.inviteFriendsOneTimeIfJustSelfInGroup(getChildFragmentManager(), groupId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (groupCallViewModel != null) {<NEW_LINE>groupCallViewModel.peekGroupCall();<NEW_LINE>}<NEW_LINE>setVisibleThread(threadId);<NEW_LINE>ConversationUtil.refreshRecipientShortcuts();<NEW_LINE>if (SignalStore.rateLimit().needsRecaptcha()) {<NEW_LINE>RecaptchaProofBottomSheetFragment.show(getChildFragmentManager());<NEW_LINE>}<NEW_LINE>} | (groupId)).enqueue(); |
834,274 | final GetRelationalDatabaseMasterUserPasswordResult executeGetRelationalDatabaseMasterUserPassword(GetRelationalDatabaseMasterUserPasswordRequest getRelationalDatabaseMasterUserPasswordRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getRelationalDatabaseMasterUserPasswordRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<GetRelationalDatabaseMasterUserPasswordRequest> request = null;<NEW_LINE>Response<GetRelationalDatabaseMasterUserPasswordResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetRelationalDatabaseMasterUserPasswordRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getRelationalDatabaseMasterUserPasswordRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Lightsail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetRelationalDatabaseMasterUserPassword");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetRelationalDatabaseMasterUserPasswordResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetRelationalDatabaseMasterUserPasswordResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
188,151 | public void run(RegressionEnvironment env) {<NEW_LINE>AtomicInteger milestone = new AtomicInteger();<NEW_LINE>String epl = "@name('s0') select symbol as mySymbol from " + "SupportMarketDataBean#length(5) " + "output every 6 events " + "order by mySymbol";<NEW_LINE>SupportUpdateListener listener = new SupportUpdateListener();<NEW_LINE>createAndSend(env, epl, milestone);<NEW_LINE>SymbolPricesVolumes spv = new SymbolPricesVolumes();<NEW_LINE>orderValuesBySymbol(spv);<NEW_LINE>assertValues(env, spv.symbols, "mySymbol");<NEW_LINE>assertOnlyProperties(env, Arrays.asList(new String[] { "mySymbol" }));<NEW_LINE>clearValuesDropStmt(env, spv);<NEW_LINE>epl = "@name('s0') select symbol as mySymbol, price as myPrice from " + "SupportMarketDataBean#length(5) " + "output every 6 events " + "order by myPrice";<NEW_LINE>createAndSend(env, epl, milestone);<NEW_LINE>orderValuesByPrice(spv);<NEW_LINE>assertValues(env, spv.symbols, "mySymbol");<NEW_LINE>assertValues(env, spv.prices, "myPrice");<NEW_LINE>assertOnlyProperties(env, Arrays.asList(new String[] { "mySymbol", "myPrice" }));<NEW_LINE>clearValuesDropStmt(env, spv);<NEW_LINE>epl = "@name('s0') select symbol, price as myPrice from " + "SupportMarketDataBean#length(10) " + "output every 6 events " + "order by (myPrice * 6) + 5, price";<NEW_LINE>createAndSend(env, epl, milestone);<NEW_LINE>orderValuesByPrice(spv);<NEW_LINE>assertValues(env, spv.symbols, "symbol");<NEW_LINE>assertOnlyProperties(env, Arrays.asList(new String[] { "symbol", "myPrice" }));<NEW_LINE>clearValuesDropStmt(env, spv);<NEW_LINE>epl <MASK><NEW_LINE>createAndSend(env, epl, milestone);<NEW_LINE>orderValuesByPrice(spv);<NEW_LINE>assertValues(env, spv.symbols, "symbol");<NEW_LINE>assertOnlyProperties(env, Arrays.asList(new String[] { "symbol", "myVol" }));<NEW_LINE>clearValuesDropStmt(env, spv);<NEW_LINE>} | = "@name('s0') select symbol, 1+volume*23 as myVol from " + "SupportMarketDataBean#length(10) " + "output every 6 events " + "order by (price * 6) + 5, price, myVol"; |
417,405 | public WorkflowDefPb.WorkflowDef toProto(WorkflowDef from) {<NEW_LINE>WorkflowDefPb.WorkflowDef.Builder to = WorkflowDefPb.WorkflowDef.newBuilder();<NEW_LINE>if (from.getName() != null) {<NEW_LINE>to.<MASK><NEW_LINE>}<NEW_LINE>if (from.getDescription() != null) {<NEW_LINE>to.setDescription(from.getDescription());<NEW_LINE>}<NEW_LINE>to.setVersion(from.getVersion());<NEW_LINE>for (WorkflowTask elem : from.getTasks()) {<NEW_LINE>to.addTasks(toProto(elem));<NEW_LINE>}<NEW_LINE>to.addAllInputParameters(from.getInputParameters());<NEW_LINE>for (Map.Entry<String, Object> pair : from.getOutputParameters().entrySet()) {<NEW_LINE>to.putOutputParameters(pair.getKey(), toProto(pair.getValue()));<NEW_LINE>}<NEW_LINE>if (from.getFailureWorkflow() != null) {<NEW_LINE>to.setFailureWorkflow(from.getFailureWorkflow());<NEW_LINE>}<NEW_LINE>to.setSchemaVersion(from.getSchemaVersion());<NEW_LINE>to.setRestartable(from.isRestartable());<NEW_LINE>to.setWorkflowStatusListenerEnabled(from.isWorkflowStatusListenerEnabled());<NEW_LINE>if (from.getOwnerEmail() != null) {<NEW_LINE>to.setOwnerEmail(from.getOwnerEmail());<NEW_LINE>}<NEW_LINE>if (from.getTimeoutPolicy() != null) {<NEW_LINE>to.setTimeoutPolicy(toProto(from.getTimeoutPolicy()));<NEW_LINE>}<NEW_LINE>to.setTimeoutSeconds(from.getTimeoutSeconds());<NEW_LINE>for (Map.Entry<String, Object> pair : from.getVariables().entrySet()) {<NEW_LINE>to.putVariables(pair.getKey(), toProto(pair.getValue()));<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, Object> pair : from.getInputTemplate().entrySet()) {<NEW_LINE>to.putInputTemplate(pair.getKey(), toProto(pair.getValue()));<NEW_LINE>}<NEW_LINE>return to.build();<NEW_LINE>} | setName(from.getName()); |
629,443 | AsyncRpcResult invokeUnary(MethodDescriptor methodDescriptor, Invocation invocation, ClientCall call) {<NEW_LINE>ExecutorService callbackExecutor = getCallbackExecutor(getUrl(), invocation);<NEW_LINE>int timeout = calculateTimeout(invocation, invocation.getMethodName());<NEW_LINE>invocation.setAttachment(TIMEOUT_KEY, timeout);<NEW_LINE>final AsyncRpcResult result;<NEW_LINE>DeadlineFuture future = DeadlineFuture.newFuture(getUrl().getPath(), methodDescriptor.getMethodName(), getUrl().getAddress(), timeout, callbackExecutor);<NEW_LINE>RequestMetadata request = createRequest(methodDescriptor, invocation, timeout);<NEW_LINE>final Object pureArgument;<NEW_LINE>if (methodDescriptor.getParameterClasses().length == 2 && methodDescriptor.getParameterClasses()[1].isAssignableFrom(StreamObserver.class)) {<NEW_LINE>StreamObserver<Object> observer = (StreamObserver<Object>) invocation.getArguments()[1];<NEW_LINE>future.whenComplete((r, t) -> {<NEW_LINE>if (t != null) {<NEW_LINE>observer.onError(t);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (r.hasException()) {<NEW_LINE>observer.onError(r.getException());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>observer.onNext(r.getValue());<NEW_LINE>observer.onCompleted();<NEW_LINE>});<NEW_LINE>pureArgument = invocation.getArguments()[0];<NEW_LINE>result = new AsyncRpcResult(CompletableFuture.completedFuture(new AppResponse()), invocation);<NEW_LINE>} else {<NEW_LINE>if (methodDescriptor instanceof StubMethodDescriptor) {<NEW_LINE>pureArgument = invocation.getArguments()[0];<NEW_LINE>} else {<NEW_LINE>pureArgument = invocation.getArguments();<NEW_LINE>}<NEW_LINE>result = new AsyncRpcResult(future, invocation);<NEW_LINE>result.setExecutor(callbackExecutor);<NEW_LINE>FutureContext.getContext().setCompatibleFuture(future);<NEW_LINE>}<NEW_LINE>ClientCall.Listener callListener = new UnaryClientCallListener(future);<NEW_LINE>final StreamObserver<Object> requestObserver = <MASK><NEW_LINE>requestObserver.onNext(pureArgument);<NEW_LINE>requestObserver.onCompleted();<NEW_LINE>return result;<NEW_LINE>} | call.start(request, callListener); |
234,519 | public Request<DetectStackResourceDriftRequest> marshall(DetectStackResourceDriftRequest detectStackResourceDriftRequest) {<NEW_LINE>if (detectStackResourceDriftRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<DetectStackResourceDriftRequest> request = new DefaultRequest<DetectStackResourceDriftRequest>(detectStackResourceDriftRequest, "AmazonCloudFormation");<NEW_LINE>request.addParameter("Action", "DetectStackResourceDrift");<NEW_LINE>request.addParameter("Version", "2010-05-15");<NEW_LINE><MASK><NEW_LINE>if (detectStackResourceDriftRequest.getStackName() != null) {<NEW_LINE>request.addParameter("StackName", StringUtils.fromString(detectStackResourceDriftRequest.getStackName()));<NEW_LINE>}<NEW_LINE>if (detectStackResourceDriftRequest.getLogicalResourceId() != null) {<NEW_LINE>request.addParameter("LogicalResourceId", StringUtils.fromString(detectStackResourceDriftRequest.getLogicalResourceId()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | request.setHttpMethod(HttpMethodName.POST); |
1,102,420 | public ManagedJobTemplateSummary unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AwsJsonReader reader = context.getReader();<NEW_LINE>if (!reader.isContainer()) {<NEW_LINE>reader.skipValue();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ManagedJobTemplateSummary managedJobTemplateSummary = new ManagedJobTemplateSummary();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>String name = reader.nextName();<NEW_LINE>if (name.equals("templateArn")) {<NEW_LINE>managedJobTemplateSummary.setTemplateArn(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("templateName")) {<NEW_LINE>managedJobTemplateSummary.setTemplateName(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("description")) {<NEW_LINE>managedJobTemplateSummary.setDescription(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("environments")) {<NEW_LINE>managedJobTemplateSummary.setEnvironments(new ListUnmarshaller<String>(StringJsonUnmarshaller.getInstance(<MASK><NEW_LINE>} else if (name.equals("templateVersion")) {<NEW_LINE>managedJobTemplateSummary.setTemplateVersion(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return managedJobTemplateSummary;<NEW_LINE>} | )).unmarshall(context)); |
1,755,331 | /* (non-Javadoc)<NEW_LINE>* @see javax.servlet.ServletInputStream#readLine(byte[], int, int)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public int readLine(byte[] b, int off, int len) throws IOException {<NEW_LINE>// Return -1 here because if we are closed or finished, we're at the end of the stream<NEW_LINE>if (isClosed || isFinished()) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "Nothing to read, stream is closed : " + isClosed + ", or finished : " + isFinished());<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>// We want to prevent readLine calls from going async since they can be unpredictable<NEW_LINE>this.readLineCall = true;<NEW_LINE>int readLineReturn = super.<MASK><NEW_LINE>this.readLineCall = false;<NEW_LINE>return readLineReturn;<NEW_LINE>} | readLine(b, off, len); |
1,162,996 | private <T> void bindRemoteInterfaceToContextRoot(Map<EJBModuleMetaDataImpl, NameSpaceBinder<?>> binders, HomeRecord hr, String interfaceName, int interfaceIndex) {<NEW_LINE>final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.<MASK><NEW_LINE>BeanMetaData bmd = hr.getBeanMetaData();<NEW_LINE>EJBModuleMetaDataImpl mmd = hr.getEJBModuleMetaData();<NEW_LINE>NameSpaceBinder<T> binder = (NameSpaceBinder<T>) binders.get(mmd);<NEW_LINE>if (binder == null) {<NEW_LINE>binder = (NameSpaceBinder<T>) createNameSpaceBinder(mmd);<NEW_LINE>binders.put(mmd, binder);<NEW_LINE>}<NEW_LINE>EJSHome home = hr.getHome();<NEW_LINE>try {<NEW_LINE>HomeWrapperSet homeSet = (home != null) ? home.getWrapperSet() : null;<NEW_LINE>int numRemoteInterfaces = countInterfaces(bmd, false);<NEW_LINE>int numLocalInterfaces = countInterfaces(bmd, true);<NEW_LINE>boolean singleGlobalInterface = (numRemoteInterfaces + numLocalInterfaces) == 1;<NEW_LINE>// Create the object to be bound.<NEW_LINE>T bindingObject = binder.createBindingObject(hr, homeSet, interfaceName, interfaceIndex, false);<NEW_LINE>// Bind the object to configured locations.<NEW_LINE>binder.bindBindings(bindingObject, hr, numRemoteInterfaces, singleGlobalInterface, interfaceIndex, interfaceName, false, (homeSet == null));<NEW_LINE>} catch (Exception ex) {<NEW_LINE>// Don't fail; log FFDC and continue binding the rest of the remote interfaces<NEW_LINE>FFDCFilter.processException(ex, CLASS_NAME + ".bindRemoteInterfaceToContextRoot", "1187", this);<NEW_LINE>if (isTraceOn && tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "Ignoring bind failure : " + ex, ex);<NEW_LINE>}<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "bindRemoteInterfaceToContextRoot");<NEW_LINE>} | entry(tc, "bindRemoteInterfaceToContextRoot : " + interfaceName); |
1,493,191 | private void buildSegment(FSTType fstType) throws Exception {<NEW_LINE>List<<MASK><NEW_LINE>List<FieldConfig> fieldConfigs = new ArrayList<>();<NEW_LINE>fieldConfigs.add(new FieldConfig(DOMAIN_NAMES_COL, FieldConfig.EncodingType.DICTIONARY, FieldConfig.IndexType.FST, null, null));<NEW_LINE>fieldConfigs.add(new FieldConfig(URL_COL, FieldConfig.EncodingType.DICTIONARY, FieldConfig.IndexType.FST, null, null));<NEW_LINE>TableConfig tableConfig = new TableConfigBuilder(TableType.OFFLINE).setTableName(TABLE_NAME).setInvertedIndexColumns(Collections.singletonList(DOMAIN_NAMES_COL)).setFieldConfigList(fieldConfigs).build();<NEW_LINE>Schema schema = new Schema.SchemaBuilder().setSchemaName(TABLE_NAME).addSingleValueDimension(DOMAIN_NAMES_COL, FieldSpec.DataType.STRING).addSingleValueDimension(URL_COL, FieldSpec.DataType.STRING).addSingleValueDimension(NO_INDEX_STRING_COL_NAME, FieldSpec.DataType.STRING).addMetric(INT_COL_NAME, FieldSpec.DataType.INT).build();<NEW_LINE>SegmentGeneratorConfig config = new SegmentGeneratorConfig(tableConfig, schema);<NEW_LINE>config.setOutDir(INDEX_DIR.getPath());<NEW_LINE>config.setTableName(TABLE_NAME);<NEW_LINE>config.setSegmentName(SEGMENT_NAME);<NEW_LINE>config.setFSTIndexType(fstType);<NEW_LINE>SegmentIndexCreationDriverImpl driver = new SegmentIndexCreationDriverImpl();<NEW_LINE>try (RecordReader recordReader = new GenericRowRecordReader(rows)) {<NEW_LINE>driver.init(config, recordReader);<NEW_LINE>driver.build();<NEW_LINE>}<NEW_LINE>} | GenericRow> rows = createTestData(_numRows); |
77,455 | private void orNextIntoBits() {<NEW_LINE>int <MASK><NEW_LINE>position++;<NEW_LINE>int size = buffer.getChar(position) & 0xFFFF;<NEW_LINE>position += Character.BYTES;<NEW_LINE>switch(type) {<NEW_LINE>case ARRAY:<NEW_LINE>{<NEW_LINE>int skip = size << 1;<NEW_LINE>CharBuffer cb = (CharBuffer) ((ByteBuffer) buffer.position(position)).asCharBuffer().limit(skip >>> 1);<NEW_LINE>MappeableArrayContainer array = new MappeableArrayContainer(cb, size);<NEW_LINE>array.orInto(bits);<NEW_LINE>position += skip;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case BITMAP:<NEW_LINE>{<NEW_LINE>LongBuffer lb = (LongBuffer) ((ByteBuffer) buffer.position(position)).asLongBuffer().limit(1024);<NEW_LINE>MappeableBitmapContainer bitmap = new MappeableBitmapContainer(lb, size);<NEW_LINE>bitmap.orInto(bits);<NEW_LINE>position += BITMAP_SIZE;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case RUN:<NEW_LINE>{<NEW_LINE>int skip = size << 2;<NEW_LINE>CharBuffer cb = (CharBuffer) ((ByteBuffer) buffer.position(position)).asCharBuffer().limit(skip >>> 1);<NEW_LINE>MappeableRunContainer run = new MappeableRunContainer(cb, size);<NEW_LINE>run.orInto(bits);<NEW_LINE>position += skip;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Unknown type " + type + " (this is a bug, please report it.)");<NEW_LINE>}<NEW_LINE>} | type = buffer.get(position); |
240,937 | public void initialize() {<NEW_LINE>this.viewModel = new CitationKeyPatternTabViewModel(dialogService, preferencesService);<NEW_LINE>overwriteAllow.selectedProperty().bindBidirectional(viewModel.overwriteAllowProperty());<NEW_LINE>overwriteWarning.selectedProperty().bindBidirectional(viewModel.overwriteWarningProperty());<NEW_LINE>generateOnSave.selectedProperty().bindBidirectional(viewModel.generateOnSaveProperty());<NEW_LINE>letterStartA.selectedProperty().bindBidirectional(viewModel.letterStartAProperty());<NEW_LINE>letterStartB.selectedProperty().<MASK><NEW_LINE>letterAlwaysAdd.selectedProperty().bindBidirectional(viewModel.letterAlwaysAddProperty());<NEW_LINE>keyPatternRegex.textProperty().bindBidirectional(viewModel.keyPatternRegexProperty());<NEW_LINE>keyPatternReplacement.textProperty().bindBidirectional(viewModel.keyPatternReplacementProperty());<NEW_LINE>unwantedCharacters.textProperty().bindBidirectional(viewModel.unwantedCharactersProperty());<NEW_LINE>bibtexKeyPatternTable.patternListProperty().bindBidirectional(viewModel.patternListProperty());<NEW_LINE>bibtexKeyPatternTable.defaultKeyPatternProperty().bindBidirectional(viewModel.defaultKeyPatternProperty());<NEW_LINE>ActionFactory actionFactory = new ActionFactory(Globals.getKeyPrefs());<NEW_LINE>actionFactory.configureIconButton(StandardActions.HELP_KEY_PATTERNS, new HelpAction(HelpFile.CITATION_KEY_PATTERN), keyPatternHelp);<NEW_LINE>} | bindBidirectional(viewModel.letterStartBProperty()); |
707,946 | public WsdlMockService cloneToAnotherProject(WsdlMockService mockService, String targetProjectName, String name, String description) {<NEW_LINE>WorkspaceImpl workspace = mockService.getProject().getWorkspace();<NEW_LINE>WsdlProject targetProject = (<MASK><NEW_LINE>if (targetProject == null) {<NEW_LINE>targetProjectName = UISupport.prompt("Enter name for new Project", "Clone MockService", "");<NEW_LINE>if (targetProjectName == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>targetProject = workspace.createProject(targetProjectName, null);<NEW_LINE>} catch (SoapUIException e) {<NEW_LINE>UISupport.showErrorMessage(e);<NEW_LINE>}<NEW_LINE>if (targetProject == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Set<WsdlInterface> requiredInterfaces = getRequiredInterfaces(mockService, targetProject);<NEW_LINE>if (requiredInterfaces.size() > 0) {<NEW_LINE>String msg = "Target project [" + targetProjectName + "] is missing required interfaces;\r\n\r\n";<NEW_LINE>for (WsdlInterface iface : requiredInterfaces) {<NEW_LINE>msg += iface.getName() + " [" + iface.getTechnicalId() + "]\r\n";<NEW_LINE>}<NEW_LINE>msg += "\r\nThese will be cloned to the targetProject as well";<NEW_LINE>if (!UISupport.confirm(msg, "Clone MockService")) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>for (WsdlInterface iface : requiredInterfaces) {<NEW_LINE>targetProject.importInterface(iface, false, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mockService = targetProject.importMockService(mockService, name, true, description);<NEW_LINE>UISupport.select(mockService);<NEW_LINE>return mockService;<NEW_LINE>} | WsdlProject) workspace.getProjectByName(targetProjectName); |
9,616 | private void newSchema() throws IOException {<NEW_LINE>List<Type> types = new ArrayList<>();<NEW_LINE>for (MaterializedField field : batchSchema) {<NEW_LINE>if (field.getName().equalsIgnoreCase(WriterPrel.PARTITION_COMPARATOR_FIELD)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>types<MASK><NEW_LINE>}<NEW_LINE>schema = new MessageType("root", types);<NEW_LINE>// We don't want this number to be too small, ideally we divide the block equally across the columns.<NEW_LINE>// It is unlikely all columns are going to be the same size.<NEW_LINE>// Its value is likely below Integer.MAX_VALUE (2GB), although rowGroupSize is a long type.<NEW_LINE>// Therefore this size is cast to int, since allocating byte array in under layer needs to<NEW_LINE>// limit the array size in an int scope.<NEW_LINE>int initialBlockBufferSize = this.schema.getColumns().size() > 0 ? max(MINIMUM_BUFFER_SIZE, blockSize / this.schema.getColumns().size() / 5) : MINIMUM_BUFFER_SIZE;<NEW_LINE>// We don't want this number to be too small either. Ideally, slightly bigger than the page size,<NEW_LINE>// but not bigger than the block buffer<NEW_LINE>int initialPageBufferSize = max(MINIMUM_BUFFER_SIZE, min(pageSize + pageSize / 10, initialBlockBufferSize));<NEW_LINE>ValuesWriterFactory valWriterFactory = writerVersion == WriterVersion.PARQUET_1_0 ? new DefaultV1ValuesWriterFactory() : new DefaultV2ValuesWriterFactory();<NEW_LINE>ParquetProperties parquetProperties = ParquetProperties.builder().withPageSize(pageSize).withDictionaryEncoding(enableDictionary).withDictionaryPageSize(initialPageBufferSize).withAllocator(new ParquetDirectByteBufferAllocator(oContext)).withValuesWriterFactory(valWriterFactory).withWriterVersion(writerVersion).build();<NEW_LINE>// TODO: Replace ParquetColumnChunkPageWriteStore with ColumnChunkPageWriteStore from parquet library<NEW_LINE>// once DRILL-7906 (PARQUET-1006) will be resolved<NEW_LINE>pageStore = new ParquetColumnChunkPageWriteStore(codecFactory.getCompressor(codec), schema, parquetProperties.getInitialSlabSize(), pageSize, parquetProperties.getAllocator(), parquetProperties.getColumnIndexTruncateLength(), parquetProperties.getPageWriteChecksumEnabled());<NEW_LINE>store = writerVersion == WriterVersion.PARQUET_1_0 ? new ColumnWriteStoreV1(schema, pageStore, parquetProperties) : new ColumnWriteStoreV2(schema, pageStore, parquetProperties);<NEW_LINE>MessageColumnIO columnIO = new ColumnIOFactory(false).getColumnIO(this.schema);<NEW_LINE>consumer = columnIO.getRecordWriter(store);<NEW_LINE>setUp(schema, consumer);<NEW_LINE>} | .add(getType(field)); |
1,344,619 | private List<String> findApks(List<String> allApksToInstall, File dataDir) {<NEW_LINE>List<String> apks = new ArrayList<>();<NEW_LINE>for (String apkPath : allApksToInstall) {<NEW_LINE>if (!new File(apkPath).isAbsolute()) {<NEW_LINE>File apkFile = new File(dataDir, apkPath);<NEW_LINE>if (apkFile.exists()) {<NEW_LINE>apks.add(apkFile.getPath());<NEW_LINE>} else {<NEW_LINE>String fileNameWithoutExtension = Files.getNameWithoutExtension(apkFile.getName());<NEW_LINE>// If dex2oat_on_cloud was used, the filename generated by bazel contains _dex2oat_signed<NEW_LINE>// So look for the either that file or the actual file name.<NEW_LINE>String filePattern = String.format("%s|%s_dex2oat_signed.apk", apkFile.getName(), fileNameWithoutExtension);<NEW_LINE>List<File> foundApks = new DirectorySearcher(dataDir, filePattern).findMatches();<NEW_LINE>checkState(1 == foundApks.size(), String.format("Must find 1 apk matching %s. Found: %s", apkFile<MASK><NEW_LINE>apks.add(foundApks.get(0).getPath());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>apks.add(apkPath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return apks;<NEW_LINE>} | .getName(), foundApks)); |
1,658,280 | public static void main(String[] argv) {<NEW_LINE>Random ran = new Random();<NEW_LINE>int len = 102;<NEW_LINE>int numBits = 4;<NEW_LINE>double[] dArr = new double[len];<NEW_LINE>float[] fArr = new float[len];<NEW_LINE>for (int i = 0; i < dArr.length; i++) {<NEW_LINE>dArr[i] = ran.nextDouble() - 0.5;<NEW_LINE>}<NEW_LINE>ByteBuf buf1 = Unpooled.buffer(1000);<NEW_LINE>JCompressUtils.Quantification.serializeDouble(buf1, dArr, numBits);<NEW_LINE>JCompressUtils.Quantification.deserializeDouble(buf1);<NEW_LINE>for (int i = 0; i < dArr.length; i++) {<NEW_LINE>fArr[i] = (float) dArr[i];<NEW_LINE>}<NEW_LINE>ByteBuf <MASK><NEW_LINE>JCompressUtils.Quantification.serializeFloat(buf2, fArr, numBits);<NEW_LINE>JCompressUtils.Quantification.deserializeFloat(buf2);<NEW_LINE>} | buf2 = Unpooled.buffer(1000); |
556,137 | public static BackButton parse(Context context, JSONObject json) {<NEW_LINE>BackButton result = new BackButton();<NEW_LINE>if (json == null || json.toString().equals("{}"))<NEW_LINE>return result;<NEW_LINE>result.hasValue = true;<NEW_LINE>result.visible = BoolParser.parse(json, "visible");<NEW_LINE>result.accessibilityLabel = TextParser.parse(json, "accessibilityLabel", BackButton.DEFAULT_ACCESSIBILITY_LABEL);<NEW_LINE>if (json.has("icon"))<NEW_LINE>result.icon = TextParser.parse(json.optJSONObject("icon"), "uri");<NEW_LINE>result.id = json.optString("id", Constants.BACK_BUTTON_ID);<NEW_LINE>result.enabled = BoolParser.parse(json, "enabled");<NEW_LINE>result.disableIconTint = BoolParser.parse(json, "disableIconTint");<NEW_LINE>result.color = ThemeColour.parse(context, json.optJSONObject("color"));<NEW_LINE>result.disabledColor = ThemeColour.parse(context<MASK><NEW_LINE>result.testId = TextParser.parse(json, "testID");<NEW_LINE>result.popStackOnPress = BoolParser.parse(json, "popStackOnPress");<NEW_LINE>return result;<NEW_LINE>} | , json.optJSONObject("disabledColor")); |
659,960 | public URL findResource(String name) {<NEW_LINE>// Specifically for META-INF/services/javax.xml.parsers.SAXParserFactory<NEW_LINE>String checkName = name;<NEW_LINE>if (checkName.startsWith(META_INF_SERVICES)) {<NEW_LINE>checkName = checkName.substring(META_INF_SERVICES.length());<NEW_LINE>}<NEW_LINE>checkName = checkName.replace('/', '.');<NEW_LINE>// For a system path, load from the outside world.<NEW_LINE>// Note: bootstrap has already been searched, so javax. classes should be<NEW_LINE>// tried from the webapp first (except for javax.servlet and javax.el).<NEW_LINE>URL found;<NEW_LINE>if (isSystemClass(checkName) && !systemClassesFromWebappFirst.match(checkName)) {<NEW_LINE>found = systemClassLoader.getResource(name);<NEW_LINE>if (found != null) {<NEW_LINE>return found;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Always check this ClassLoader first.<NEW_LINE><MASK><NEW_LINE>if (found != null) {<NEW_LINE>return found;<NEW_LINE>}<NEW_LINE>// See if the outside world has it.<NEW_LINE>found = systemClassLoader.getResource(name);<NEW_LINE>if (found == null || isServerClass(checkName)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Special-case Jetty/Jasper/etc. resources<NEW_LINE>if (// Jetty-plus reads jndi.properties<NEW_LINE>allowedFromSystemClassLoader.match(checkName) || "jndi.properties".equals(name)) {<NEW_LINE>return found;<NEW_LINE>}<NEW_LINE>// Warn, add containing URL to our own ClassLoader, and retry the call.<NEW_LINE>String warnMessage = "Server resource '" + name + "' could not be found in the web app, but was found on the system classpath";<NEW_LINE>if (!addContainingClassPathEntry(warnMessage, found, name)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return super.findResource(name);<NEW_LINE>} | found = super.findResource(name); |
1,592,017 | static void fillGeoPosition(TokenBuffer buffer, FieldValue positionFieldValue) {<NEW_LINE>Double latitude = null;<NEW_LINE>Double longitude = null;<NEW_LINE>expectObjectStart(buffer.currentToken());<NEW_LINE>int initNesting = buffer.nesting();<NEW_LINE>for (buffer.next(); buffer.nesting() >= initNesting; buffer.next()) {<NEW_LINE><MASK><NEW_LINE>if ("lat".equals(curName) || "latitude".equals(curName)) {<NEW_LINE>latitude = readDouble(buffer) * 1.0e6;<NEW_LINE>} else if ("lng".equals(curName) || "longitude".equals(curName)) {<NEW_LINE>longitude = readDouble(buffer) * 1.0e6;<NEW_LINE>} else if ("x".equals(curName)) {<NEW_LINE>longitude = readDouble(buffer);<NEW_LINE>} else if ("y".equals(curName)) {<NEW_LINE>latitude = readDouble(buffer);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unexpected attribute " + curName + " in geo position field");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>expectObjectEnd(buffer.currentToken());<NEW_LINE>if (latitude == null) {<NEW_LINE>throw new IllegalArgumentException("Missing 'lat' attribute in geo position field");<NEW_LINE>}<NEW_LINE>if (longitude == null) {<NEW_LINE>throw new IllegalArgumentException("Missing 'lng' attribute in geo position field");<NEW_LINE>}<NEW_LINE>int y = (int) Math.round(latitude);<NEW_LINE>int x = (int) Math.round(longitude);<NEW_LINE>var geopos = PositionDataType.valueOf(x, y);<NEW_LINE>positionFieldValue.assign(geopos);<NEW_LINE>} | String curName = buffer.currentName(); |
448,162 | void resetAsCloneOf(final ElementProcessorIterator original) {<NEW_LINE>this.size = original.size;<NEW_LINE>this.last = original.last;<NEW_LINE>this.currentTag = original.currentTag;<NEW_LINE>this.lastToBeRepeated = original.lastToBeRepeated;<NEW_LINE>this.lastWasRepeated = original.lastWasRepeated;<NEW_LINE>if (this.size > 0 && original.processors != null) {<NEW_LINE>// original.visited will also be != null<NEW_LINE>if (this.processors == null || this.processors.length < this.size) {<NEW_LINE>this.processors = new IElementProcessor[this.size];<NEW_LINE>this.visited = new boolean[this.size];<NEW_LINE>}<NEW_LINE>System.arraycopy(original.processors, 0, this.<MASK><NEW_LINE>System.arraycopy(original.visited, 0, this.visited, 0, this.size);<NEW_LINE>}<NEW_LINE>} | processors, 0, this.size); |
1,682,681 | // if the source SR needs to be attached to, do so<NEW_LINE>// take a snapshot of the source VDI (on the source SR)<NEW_LINE>// create an iSCSI SR based on the new back-end volume<NEW_LINE>// copy the snapshot to the new SR<NEW_LINE>// delete the snapshot<NEW_LINE>// detach the new SR<NEW_LINE>// if we needed to perform an attach to the source SR, detach from it<NEW_LINE>@Override<NEW_LINE>public SnapshotAndCopyAnswer snapshotAndCopy(final SnapshotAndCopyCommand cmd) {<NEW_LINE>final Connection conn = hypervisorResource.getConnection();<NEW_LINE>try {<NEW_LINE>SR sourceSr = null;<NEW_LINE>final Map<String, String> sourceDetails = cmd.getSourceDetails();<NEW_LINE>if (sourceDetails != null && sourceDetails.keySet().size() > 0) {<NEW_LINE>final String iScsiName = sourceDetails.get(DiskTO.IQN);<NEW_LINE>final String storageHost = sourceDetails.get(DiskTO.STORAGE_HOST);<NEW_LINE>final String chapInitiatorUsername = sourceDetails.get(DiskTO.CHAP_INITIATOR_USERNAME);<NEW_LINE>final String chapInitiatorSecret = sourceDetails.get(DiskTO.CHAP_INITIATOR_SECRET);<NEW_LINE>sourceSr = hypervisorResource.getIscsiSR(conn, iScsiName, storageHost, iScsiName, chapInitiatorUsername, chapInitiatorSecret, false);<NEW_LINE>}<NEW_LINE>final VDI vdiToSnapshot = VDI.getByUuid(conn, cmd.getUuidOfSourceVdi());<NEW_LINE>final VDI vdiSnapshot = vdiToSnapshot.snapshot(conn, new HashMap<String, String>());<NEW_LINE>final Map<String, String> destDetails = cmd.getDestDetails();<NEW_LINE>final String iScsiName = destDetails.get(DiskTO.IQN);<NEW_LINE>final String storageHost = destDetails.get(DiskTO.STORAGE_HOST);<NEW_LINE>final String chapInitiatorUsername = destDetails.get(DiskTO.CHAP_INITIATOR_USERNAME);<NEW_LINE>final String chapInitiatorSecret = destDetails.get(DiskTO.CHAP_INITIATOR_SECRET);<NEW_LINE>final SR newSr = hypervisorResource.getIscsiSR(conn, iScsiName, storageHost, <MASK><NEW_LINE>final VDI vdiCopy = vdiSnapshot.copy(conn, newSr);<NEW_LINE>final String vdiUuid = vdiCopy.getUuid(conn);<NEW_LINE>vdiSnapshot.destroy(conn);<NEW_LINE>if (sourceSr != null) {<NEW_LINE>hypervisorResource.removeSR(conn, sourceSr);<NEW_LINE>}<NEW_LINE>hypervisorResource.removeSR(conn, newSr);<NEW_LINE>final SnapshotAndCopyAnswer snapshotAndCopyAnswer = new SnapshotAndCopyAnswer();<NEW_LINE>snapshotAndCopyAnswer.setPath(vdiUuid);<NEW_LINE>return snapshotAndCopyAnswer;<NEW_LINE>} catch (final Exception ex) {<NEW_LINE>s_logger.warn("Failed to take and copy snapshot: " + ex.toString(), ex);<NEW_LINE>return new SnapshotAndCopyAnswer(ex.getMessage());<NEW_LINE>}<NEW_LINE>} | iScsiName, chapInitiatorUsername, chapInitiatorSecret, false); |
107,709 | public DescribeResourcePoliciesResult describeResourcePolicies(DescribeResourcePoliciesRequest describeResourcePoliciesRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeResourcePoliciesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeResourcePoliciesRequest> request = null;<NEW_LINE>Response<DescribeResourcePoliciesResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DescribeResourcePoliciesRequestMarshaller().marshall(describeResourcePoliciesRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<DescribeResourcePoliciesResult, JsonUnmarshallerContext> unmarshaller = new DescribeResourcePoliciesResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<DescribeResourcePoliciesResult> responseHandler = new JsonResponseHandler<DescribeResourcePoliciesResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.