idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
693,114
public static FetchLibrariesResponse unmarshall(FetchLibrariesResponse fetchLibrariesResponse, UnmarshallerContext context) {<NEW_LINE>fetchLibrariesResponse.setRequestId(context.stringValue("FetchLibrariesResponse.RequestId"));<NEW_LINE>fetchLibrariesResponse.setCode(context.stringValue("FetchLibrariesResponse.Code"));<NEW_LINE>fetchLibrariesResponse.setMessage(context.stringValue("FetchLibrariesResponse.Message"));<NEW_LINE>fetchLibrariesResponse.setTotalCount(context.integerValue("FetchLibrariesResponse.TotalCount"));<NEW_LINE>fetchLibrariesResponse.setAction(context.stringValue("FetchLibrariesResponse.Action"));<NEW_LINE>List<Library> libraries = new ArrayList<Library>();<NEW_LINE>for (int i = 0; i < context.lengthValue("FetchLibrariesResponse.Libraries.Length"); i++) {<NEW_LINE>Library library = new Library();<NEW_LINE>library.setLibraryId(context.stringValue<MASK><NEW_LINE>library.setCtime(context.longValue("FetchLibrariesResponse.Libraries[" + i + "].Ctime"));<NEW_LINE>libraries.add(library);<NEW_LINE>}<NEW_LINE>fetchLibrariesResponse.setLibraries(libraries);<NEW_LINE>return fetchLibrariesResponse;<NEW_LINE>}
("FetchLibrariesResponse.Libraries[" + i + "].LibraryId"));
1,734,007
public Request<AnalyzeIDRequest> marshall(AnalyzeIDRequest analyzeIDRequest) {<NEW_LINE>if (analyzeIDRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(AnalyzeIDRequest)");<NEW_LINE>}<NEW_LINE>Request<AnalyzeIDRequest> request = new DefaultRequest<AnalyzeIDRequest>(analyzeIDRequest, "AmazonTextract");<NEW_LINE>String target = "Textract.AnalyzeID";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (analyzeIDRequest.getDocumentPages() != null) {<NEW_LINE>java.util.List<Document> documentPages = analyzeIDRequest.getDocumentPages();<NEW_LINE>jsonWriter.name("DocumentPages");<NEW_LINE>jsonWriter.beginArray();<NEW_LINE>for (Document documentPagesItem : documentPages) {<NEW_LINE>if (documentPagesItem != null) {<NEW_LINE>DocumentJsonMarshaller.getInstance().marshall(documentPagesItem, jsonWriter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jsonWriter.endArray();<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] <MASK><NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
content = snippet.getBytes(UTF8);
488,807
public TFImportStatus merge(@NonNull TFImportStatus other) {<NEW_LINE>List<String> newModelPaths = new ArrayList<>(modelPaths);<NEW_LINE>newModelPaths.addAll(other.modelPaths);<NEW_LINE>List<String> newCantImportModelPaths = new ArrayList<>(cantImportModelPaths);<NEW_LINE>newCantImportModelPaths.addAll(other.cantImportModelPaths);<NEW_LINE>List<String> newReadErrorModelPaths = new ArrayList<>(readErrorModelPaths);<NEW_LINE>newReadErrorModelPaths.addAll(other.readErrorModelPaths);<NEW_LINE>Set<String> newOpNames = new HashSet<>(opNames);<NEW_LINE>newOpNames.addAll(other.opNames);<NEW_LINE>Map<String, Integer> newOpCounts = new HashMap<>(opCounts);<NEW_LINE>for (Map.Entry<String, Integer> e : other.opCounts.entrySet()) {<NEW_LINE>newOpCounts.put(e.getKey(), (newOpCounts.containsKey(e.getKey()) ? newOpCounts.get(e.getKey()) : 0) + e.getValue());<NEW_LINE>}<NEW_LINE>Set<String> newImportSupportedOpNames = new HashSet<>(importSupportedOpNames);<NEW_LINE>newImportSupportedOpNames.addAll(other.importSupportedOpNames);<NEW_LINE>Set<String> newUnsupportedOpNames = new HashSet<>(unsupportedOpNames);<NEW_LINE>newUnsupportedOpNames.addAll(other.unsupportedOpNames);<NEW_LINE>int countUnique = newImportSupportedOpNames.size() + newUnsupportedOpNames.size();<NEW_LINE>Map<String, Set<String>> newUnsupportedOpModels = new HashMap<>();<NEW_LINE>if (unsupportedOpModels != null)<NEW_LINE>newUnsupportedOpModels.putAll(unsupportedOpModels);<NEW_LINE>if (other.unsupportedOpModels != null) {<NEW_LINE>for (Map.Entry<String, Set<String>> e : other.unsupportedOpModels.entrySet()) {<NEW_LINE>if (!newUnsupportedOpModels.containsKey(e.getKey())) {<NEW_LINE>newUnsupportedOpModels.put(e.getKey(), e.getValue());<NEW_LINE>} else {<NEW_LINE>newUnsupportedOpModels.get(e.getKey()).addAll(e.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new TFImportStatus(newModelPaths, newCantImportModelPaths, newReadErrorModelPaths, totalNumOps + other.totalNumOps, countUnique, newOpNames, <MASK><NEW_LINE>}
newOpCounts, newImportSupportedOpNames, newUnsupportedOpNames, newUnsupportedOpModels);
1,389,099
public static CharSequence generateHorIconText(CharSequence text, int leftPadding, Drawable iconLeft, int iconLeftTintAttr, int rightPadding, Drawable iconRight, int iconRightTintAttr, int iconOffsetY, @Nullable View skinFollowView) {<NEW_LINE>if (iconLeft == null && iconRight == null) {<NEW_LINE>return text;<NEW_LINE>}<NEW_LINE>String iconTag = "[icon]";<NEW_LINE>SpannableStringBuilder builder = new SpannableStringBuilder();<NEW_LINE>int start, end;<NEW_LINE>if (iconLeft != null) {<NEW_LINE>iconLeft.setBounds(0, 0, iconLeft.getIntrinsicWidth(<MASK><NEW_LINE>start = 0;<NEW_LINE>builder.append(iconTag);<NEW_LINE>end = builder.length();<NEW_LINE>QMUIMarginImageSpan imageSpan = new QMUIMarginImageSpan(iconLeft, QMUIAlignMiddleImageSpan.ALIGN_MIDDLE, 0, leftPadding, iconOffsetY);<NEW_LINE>imageSpan.setSkinSupportWithTintColor(skinFollowView, iconLeftTintAttr);<NEW_LINE>imageSpan.setAvoidSuperChangeFontMetrics(true);<NEW_LINE>builder.setSpan(imageSpan, start, end, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);<NEW_LINE>}<NEW_LINE>builder.append(text);<NEW_LINE>if (iconRight != null) {<NEW_LINE>iconRight.setBounds(0, 0, iconRight.getIntrinsicWidth(), iconRight.getIntrinsicHeight());<NEW_LINE>start = builder.length();<NEW_LINE>builder.append(iconTag);<NEW_LINE>end = builder.length();<NEW_LINE>QMUIMarginImageSpan imageSpan = new QMUIMarginImageSpan(iconRight, QMUIAlignMiddleImageSpan.ALIGN_MIDDLE, rightPadding, 0, iconOffsetY);<NEW_LINE>imageSpan.setSkinSupportWithTintColor(skinFollowView, iconRightTintAttr);<NEW_LINE>imageSpan.setAvoidSuperChangeFontMetrics(true);<NEW_LINE>builder.setSpan(imageSpan, start, end, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);<NEW_LINE>}<NEW_LINE>return builder;<NEW_LINE>}
), iconLeft.getIntrinsicHeight());
925,937
final CreatePrefetchScheduleResult executeCreatePrefetchSchedule(CreatePrefetchScheduleRequest createPrefetchScheduleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createPrefetchScheduleRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreatePrefetchScheduleRequest> request = null;<NEW_LINE>Response<CreatePrefetchScheduleResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreatePrefetchScheduleRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createPrefetchScheduleRequest));<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, "MediaTailor");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreatePrefetchSchedule");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreatePrefetchScheduleResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreatePrefetchScheduleResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
1,268,978
protected void paintComponent(Graphics g) {<NEW_LINE>super.paintComponent(g);<NEW_LINE>Graphics2D g2 = (Graphics2D) g;<NEW_LINE>page.setLocation(getInsets().left, getInsets().top);<NEW_LINE>Point mousePos = component.getMousePosition();<NEW_LINE>if (mousePos != null) {<NEW_LINE>int pageRelativeX = mousePos.x - page.getX() - getX();<NEW_LINE>int pageRelativeY = mousePos.y - page.getY() - getY();<NEW_LINE>// page.handleMouseMoved(new MouseEvent(component, 0, System.currentTimeMillis(), 0, pageRelativeX, pageRelativeY, 0, false, 0));<NEW_LINE>}<NEW_LINE>page.draw(g2);<NEW_LINE>Rectangle clip = g.getClipBounds();<NEW_LINE>clip.translate(getX(), getY());<NEW_LINE>manager.clear(clip);<NEW_LINE>manager.setCurrentPage(page, getX(), getY());<NEW_LINE>for (LinkBox pageLink : page.getLinks()) {<NEW_LINE>manager.add(pageLink.translate(getX<MASK><NEW_LINE>}<NEW_LINE>}
(), getY()));
144,865
private void parseResourceStatement(ShapeId id, SourceLocation location) {<NEW_LINE>ws();<NEW_LINE>ResourceShape.Builder builder = ResourceShape.builder().id(id).source(location);<NEW_LINE>modelFile.onShape(builder);<NEW_LINE>ObjectNode shapeNode = IdlNodeParser.parseObjectNode(this, id.toString());<NEW_LINE>LoaderUtils.checkForAdditionalProperties(shapeNode, id, RESOURCE_PROPERTY_NAMES, modelFile.events());<NEW_LINE>optionalId(shapeNode, PUT_KEY, builder::put);<NEW_LINE>optionalId(shapeNode, CREATE_KEY, builder::create);<NEW_LINE>optionalId(shapeNode, READ_KEY, builder::read);<NEW_LINE>optionalId(shapeNode, UPDATE_KEY, builder::update);<NEW_LINE>optionalId(<MASK><NEW_LINE>optionalId(shapeNode, LIST_KEY, builder::list);<NEW_LINE>optionalIdList(shapeNode, OPERATIONS_KEY, builder::addOperation);<NEW_LINE>optionalIdList(shapeNode, RESOURCES_KEY, builder::addResource);<NEW_LINE>optionalIdList(shapeNode, COLLECTION_OPERATIONS_KEY, builder::addCollectionOperation);<NEW_LINE>// Load identifiers and resolve forward references.<NEW_LINE>shapeNode.getObjectMember(IDENTIFIERS_KEY).ifPresent(ids -> {<NEW_LINE>for (Map.Entry<StringNode, Node> entry : ids.getMembers().entrySet()) {<NEW_LINE>String name = entry.getKey().getValue();<NEW_LINE>StringNode target = entry.getValue().expectStringNode();<NEW_LINE>modelFile.addForwardReference(target.getValue(), targetId -> builder.addIdentifier(name, targetId));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
shapeNode, DELETE_KEY, builder::delete);
266,429
public Payment createCredit(final boolean isApiPayment, @Nullable final UUID attemptId, final Account account, @Nullable final UUID paymentMethodId, @Nullable final UUID paymentId, final BigDecimal amount, final Currency currency, @Nullable final DateTime effectiveDate, @Nullable final String paymentExternalKey, @Nullable final String paymentTransactionExternalKey, @Nullable final UUID paymentIdForNewPayment, @Nullable final UUID paymentTransactionIdForNewPaymentTransaction, final boolean shouldLockAccountAndDispatch, final Iterable<PluginProperty> properties, final CallContext callContext, final InternalCallContext internalCallContext) throws PaymentApiException {<NEW_LINE>return performOperation(isApiPayment, attemptId, TransactionType.CREDIT, account, paymentMethodId, paymentId, null, amount, currency, effectiveDate, paymentExternalKey, paymentTransactionExternalKey, paymentIdForNewPayment, paymentTransactionIdForNewPaymentTransaction, shouldLockAccountAndDispatch, <MASK><NEW_LINE>}
null, properties, callContext, internalCallContext);
1,614,987
// parses the payment schedule<NEW_LINE>private PaymentSchedule parseSwapPaymentSchedule(XmlElement legEl, XmlElement calcEl, FpmlDocument document) {<NEW_LINE>// supported elements:<NEW_LINE>// 'paymentDates/paymentFrequency'<NEW_LINE>// 'paymentDates/payRelativeTo'<NEW_LINE>// 'paymentDates/paymentDaysOffset?'<NEW_LINE>// 'paymentDates/paymentDatesAdjustments'<NEW_LINE>// 'calculationPeriodAmount/calculation/compoundingMethod'<NEW_LINE>// 'paymentDates/firstPaymentDate?'<NEW_LINE>// 'paymentDates/lastRegularPaymentDate?'<NEW_LINE>// ignored elements:<NEW_LINE>// 'paymentDates/calculationPeriodDatesReference'<NEW_LINE>// 'paymentDates/resetDatesReference'<NEW_LINE>// 'paymentDates/valuationDatesReference'<NEW_LINE>PaymentSchedule.Builder paymentScheduleBuilder = PaymentSchedule.builder();<NEW_LINE>// payment dates<NEW_LINE>XmlElement paymentDatesEl = legEl.getChild("paymentDates");<NEW_LINE>// frequency<NEW_LINE>paymentScheduleBuilder.paymentFrequency(document.parseFrequency(paymentDatesEl.getChild("paymentFrequency")));<NEW_LINE>// default for IRS is pay relative to period end; Strata model will apply the defaulting but the values is needed<NEW_LINE>// here for first and last payment date checks<NEW_LINE>PaymentRelativeTo payRelativeTo = paymentDatesEl.findChild("payRelativeTo").map(el -> parsePayRelativeTo(el)).orElse(PaymentRelativeTo.PERIOD_END);<NEW_LINE>paymentScheduleBuilder.paymentRelativeTo(payRelativeTo);<NEW_LINE>// dates<NEW_LINE>if (payRelativeTo == PaymentRelativeTo.PERIOD_END) {<NEW_LINE>// ignore data if not PeriodEnd and hope schedule is worked out correctly by other means<NEW_LINE>// this provides compatibility for old code that ignored these FpML fields<NEW_LINE>paymentDatesEl.findChild("firstPaymentDate").map(el -> document.parseDate(el)).ifPresent(date -> paymentScheduleBuilder.firstRegularStartDate(date));<NEW_LINE>paymentDatesEl.findChild("lastRegularPaymentDate").map(el -> document.parseDate(el)).ifPresent(date -> paymentScheduleBuilder.lastRegularEndDate(date));<NEW_LINE>}<NEW_LINE>// offset<NEW_LINE>Optional<XmlElement> paymentOffsetEl = paymentDatesEl.findChild("paymentDaysOffset");<NEW_LINE>BusinessDayAdjustment payAdjustment = document.parseBusinessDayAdjustments(paymentDatesEl.getChild("paymentDatesAdjustments"));<NEW_LINE>if (paymentOffsetEl.isPresent()) {<NEW_LINE>Period period = document.parsePeriod(paymentOffsetEl.get());<NEW_LINE>if (period.toTotalMonths() != 0) {<NEW_LINE>throw new FpmlParseException("Invalid 'paymentDatesAdjustments' value, expected days-based period: " + period);<NEW_LINE>}<NEW_LINE>Optional<XmlElement> dayTypeEl = paymentOffsetEl.get().findChild("dayType");<NEW_LINE>boolean fixingCalendarDays = period.isZero() || (dayTypeEl.isPresent() && dayTypeEl.get().getContent().equals("Calendar"));<NEW_LINE>if (fixingCalendarDays) {<NEW_LINE>paymentScheduleBuilder.paymentDateOffset(DaysAdjustment.ofCalendarDays(period.getDays(), payAdjustment));<NEW_LINE>} else {<NEW_LINE>paymentScheduleBuilder.paymentDateOffset(DaysAdjustment.ofBusinessDays(period.getDays(), payAdjustment.getCalendar()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>paymentScheduleBuilder.paymentDateOffset(DaysAdjustment<MASK><NEW_LINE>}<NEW_LINE>// compounding<NEW_LINE>calcEl.findChild("compoundingMethod").ifPresent(compoundingEl -> {<NEW_LINE>paymentScheduleBuilder.compoundingMethod(CompoundingMethod.of(compoundingEl.getContent()));<NEW_LINE>});<NEW_LINE>return paymentScheduleBuilder.build();<NEW_LINE>}
.ofCalendarDays(0, payAdjustment));
1,201,409
protected synchronized void processGcEvent(CompositeData lastGc) throws JMException, IOException {<NEW_LINE>long id = along(lastGc.get("id"));<NEW_LINE>if (lastReportedEvent == id) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>lastReportedEvent = id;<NEW_LINE>long dur = along<MASK><NEW_LINE>long startTs = along(lastGc.get("startTime")) + jvmStartTime;<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Map<List<?>, CompositeData> beforeGC = (Map<List<?>, CompositeData>) lastGc.get("memoryUsageBeforeGc");<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Map<List<?>, CompositeData> afterGC = (Map<List<?>, CompositeData>) lastGc.get("memoryUsageAfterGc");<NEW_LINE>GcSummary summary = new GcSummary();<NEW_LINE>summary.name = collectorName;<NEW_LINE>summary.timestamp = startTs;<NEW_LINE>summary.durationMs = dur;<NEW_LINE>summary.collectionCount = id;<NEW_LINE>summary.collectionTotalTime = totalTime(id);<NEW_LINE>for (Entry<List<?>, CompositeData> e : beforeGC.entrySet()) {<NEW_LINE>String pool = (String) e.getKey().get(0);<NEW_LINE>String spaceId = toSpaceId(pool);<NEW_LINE>MemoryUsage membefore = MemoryUsage.from((CompositeData) e.getValue().get("value"));<NEW_LINE>MemUsage mu = new MemUsage(pool, membefore);<NEW_LINE>summary.before.put(spaceId, mu);<NEW_LINE>}<NEW_LINE>for (Entry<List<?>, CompositeData> e : afterGC.entrySet()) {<NEW_LINE>String pool = (String) e.getKey().get(0);<NEW_LINE>String spaceId = toSpaceId(pool);<NEW_LINE>MemUsage memafter = new MemUsage(pool, MemoryUsage.from((CompositeData) e.getValue().get("value")));<NEW_LINE>MemUsage mu = memafter;<NEW_LINE>summary.after.put(spaceId, mu);<NEW_LINE>}<NEW_LINE>eventSink.consume(summary);<NEW_LINE>}
(lastGc.get("duration"));
164,260
public void driverFinished(DriverContext driverContext) {<NEW_LINE>requireNonNull(driverContext, "driverContext is null");<NEW_LINE>if (!drivers.remove(driverContext)) {<NEW_LINE>throw new IllegalArgumentException("Unknown driver " + driverContext);<NEW_LINE>}<NEW_LINE>// always update last execution end time<NEW_LINE>lastExecutionEndTime.set(DateTime.now());<NEW_LINE>DriverStats driverStats = driverContext.getDriverStats();<NEW_LINE>completedDrivers.getAndIncrement();<NEW_LINE>if (partitioned) {<NEW_LINE>completedSplitsWeight.addAndGet(driverContext.getSplitWeight());<NEW_LINE>}<NEW_LINE>queuedTime.add(driverStats.getQueuedTime().roundTo(NANOSECONDS));<NEW_LINE>elapsedTime.add(driverStats.getElapsedTime().roundTo(NANOSECONDS));<NEW_LINE>totalScheduledTime.getAndAdd(driverStats.getTotalScheduledTime().roundTo(NANOSECONDS));<NEW_LINE>totalCpuTime.getAndAdd(driverStats.getTotalCpuTime().roundTo(NANOSECONDS));<NEW_LINE>totalBlockedTime.getAndAdd(driverStats.getTotalBlockedTime().roundTo(NANOSECONDS));<NEW_LINE>// merge the operator stats into the operator summary<NEW_LINE>List<OperatorStats> operators = driverStats.getOperatorStats();<NEW_LINE>for (OperatorStats operator : operators) {<NEW_LINE>operatorSummaries.merge(operator.getOperatorId(), operator, OperatorStats::add);<NEW_LINE>}<NEW_LINE>physicalInputDataSize.update(driverStats.getPhysicalInputDataSize().toBytes());<NEW_LINE>physicalInputPositions.update(driverStats.getPhysicalInputPositions());<NEW_LINE>physicalInputReadTime.getAndAdd(driverStats.getPhysicalInputReadTime<MASK><NEW_LINE>internalNetworkInputDataSize.update(driverStats.getInternalNetworkInputDataSize().toBytes());<NEW_LINE>internalNetworkInputPositions.update(driverStats.getInternalNetworkInputPositions());<NEW_LINE>rawInputDataSize.update(driverStats.getRawInputDataSize().toBytes());<NEW_LINE>rawInputPositions.update(driverStats.getRawInputPositions());<NEW_LINE>processedInputDataSize.update(driverStats.getProcessedInputDataSize().toBytes());<NEW_LINE>processedInputPositions.update(driverStats.getProcessedInputPositions());<NEW_LINE>inputBlockedTime.getAndAdd(driverStats.getInputBlockedTime().roundTo(NANOSECONDS));<NEW_LINE>outputDataSize.update(driverStats.getOutputDataSize().toBytes());<NEW_LINE>outputPositions.update(driverStats.getOutputPositions());<NEW_LINE>outputBlockedTime.getAndAdd(driverStats.getOutputBlockedTime().roundTo(NANOSECONDS));<NEW_LINE>physicalWrittenDataSize.getAndAdd(driverStats.getPhysicalWrittenDataSize().toBytes());<NEW_LINE>}
().roundTo(NANOSECONDS));
1,739,977
public void read(ReadContext context, Double maxAge, TimestampsToReturn timestamps, List<ReadValueId> readValueIds) {<NEW_LINE>List<DataValue> results = Lists.newArrayListWithCapacity(readValueIds.size());<NEW_LINE>for (ReadValueId readValueId : readValueIds) {<NEW_LINE>UaServerNode node = nodeManager.get(readValueId.getNodeId());<NEW_LINE>if (node != null) {<NEW_LINE>DataValue value = node.readAttribute(new AttributeContext(context), readValueId.getAttributeId(), timestamps, readValueId.getIndexRange(), readValueId.getDataEncoding());<NEW_LINE>logger.debug("Read value {} from attribute {} of {}", value.getValue().getValue(), AttributeId.from(readValueId.getAttributeId()).map(Object::toString).orElse("unknown"<MASK><NEW_LINE>results.add(value);<NEW_LINE>} else {<NEW_LINE>results.add(new DataValue(StatusCodes.Bad_NodeIdUnknown));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>context.success(results);<NEW_LINE>}
), node.getNodeId());
1,125,015
private void onJoin(Session session, SessionDetails details) {<NEW_LINE>System.out.println("Joined...");<NEW_LINE>mWasConnected = true;<NEW_LINE>SharedPreferences.Editor editor = mPrefs.edit();<NEW_LINE><MASK><NEW_LINE>editor.putString("xbr_realm", mRealm);<NEW_LINE>editor.apply();<NEW_LINE>session.call("xbr.marketmaker.get_config", Map.class).thenCompose(config -> {<NEW_LINE>String marketMaker = (String) config.get("marketmaker");<NEW_LINE>mBuyer = new SimpleBuyer(marketMaker, DELEGATE_ETH_KEY, Util.toXBR(50));<NEW_LINE>return mBuyer.start(session, details.authid);<NEW_LINE>}).thenCompose(balance -> {<NEW_LINE>mRemainingBalance = balance;<NEW_LINE>return session.subscribe("xbr.myapp.example", this::actuallyBuy);<NEW_LINE>}).thenAccept(subscription -> {<NEW_LINE>System.out.println("We are ready to buy.");<NEW_LINE>mButtonBuy.setText("Stop buying");<NEW_LINE>mStatus.setText("Ready");<NEW_LINE>}).exceptionally(throwable -> {<NEW_LINE>throwable.printStackTrace();<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>}
editor.putString("xbr_uri", mURI);
1,190,927
final DeletePipelineResult executeDeletePipeline(DeletePipelineRequest deletePipelineRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deletePipelineRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeletePipelineRequest> request = null;<NEW_LINE>Response<DeletePipelineResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeletePipelineRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deletePipelineRequest));<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, "CodePipeline");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeletePipeline");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeletePipelineResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeletePipelineResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
195,312
final CreatePrivateDnsNamespaceResult executeCreatePrivateDnsNamespace(CreatePrivateDnsNamespaceRequest createPrivateDnsNamespaceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createPrivateDnsNamespaceRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreatePrivateDnsNamespaceRequest> request = null;<NEW_LINE>Response<CreatePrivateDnsNamespaceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreatePrivateDnsNamespaceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createPrivateDnsNamespaceRequest));<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, "ServiceDiscovery");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreatePrivateDnsNamespace");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreatePrivateDnsNamespaceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreatePrivateDnsNamespaceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,640,122
private static void testCrossPackageOverrides_independentOverrideChains() {<NEW_LINE>// This is the pattern<NEW_LINE>//<NEW_LINE>// package a package b<NEW_LINE>// class M1 { m() {} }<NEW_LINE>// |<NEW_LINE>// V class M2 extends M1 { m() {} }<NEW_LINE>// class M3 extends M2 { m() {} } |<NEW_LINE>// V<NEW_LINE>// class M4 extends M3 { m() {} }<NEW_LINE>// calls through m_a<NEW_LINE>assertEquals("a.M1.m", M1.callM_a(new M1()));<NEW_LINE>assertEquals("a.M1.m", M1.callM_a(new M2()));<NEW_LINE>assertEquals("a.M3.m", M1.callM_a(new M3()));<NEW_LINE>// javac/jvm incorrectly dispatches this one b.M4.m but b.M4.m does NOT override a.M1.m.<NEW_LINE>assertEquals("a.M3.m", M1.callM_a(new M4()));<NEW_LINE>// calls through m_b<NEW_LINE>assertEquals("b.M2.m", M2.<MASK><NEW_LINE>assertEquals("b.M2.m", M2.callM_b(new M3()));<NEW_LINE>assertEquals("b.M4.m", M2.callM_b(new M4()));<NEW_LINE>}
callM_b(new M2()));
72,024
public static void vertical3(Kernel1D_F32 kernel, GrayF32 src, GrayF32 dst) {<NEW_LINE>final float[] dataSrc = src.data;<NEW_LINE>final float[] dataDst = dst.data;<NEW_LINE>final float k1 = kernel.data[0];<NEW_LINE>final float k2 = kernel.data[1];<NEW_LINE>final float k3 = kernel.data[2];<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int imgWidth = dst.getWidth();<NEW_LINE>final int imgHeight = dst.getHeight();<NEW_LINE>final int yEnd = imgHeight - radius;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(radius, yEnd, y -> {<NEW_LINE>for (int y = radius; y < yEnd; y++) {<NEW_LINE>int indexDst = dst.startIndex + y * dst.stride;<NEW_LINE>int i = src.startIndex + (y - radius) * src.stride;<NEW_LINE>final int iEnd = i + imgWidth;<NEW_LINE>for (; i < iEnd; i++) {<NEW_LINE>int indexSrc = i;<NEW_LINE>float total = (dataSrc[indexSrc]) * k1;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += <MASK><NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k3;<NEW_LINE>dataDst[indexDst++] = total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
(dataSrc[indexSrc]) * k2;
1,009,798
public static QueryDeviceBySQLResponse unmarshall(QueryDeviceBySQLResponse queryDeviceBySQLResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryDeviceBySQLResponse.setRequestId(_ctx.stringValue("QueryDeviceBySQLResponse.RequestId"));<NEW_LINE>queryDeviceBySQLResponse.setSuccess(_ctx.booleanValue("QueryDeviceBySQLResponse.Success"));<NEW_LINE>queryDeviceBySQLResponse.setCode<MASK><NEW_LINE>queryDeviceBySQLResponse.setErrorMessage(_ctx.stringValue("QueryDeviceBySQLResponse.ErrorMessage"));<NEW_LINE>queryDeviceBySQLResponse.setTotalCount(_ctx.longValue("QueryDeviceBySQLResponse.TotalCount"));<NEW_LINE>List<SimpleDeviceSearchInfo> data = new ArrayList<SimpleDeviceSearchInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryDeviceBySQLResponse.Data.Length"); i++) {<NEW_LINE>SimpleDeviceSearchInfo simpleDeviceSearchInfo = new SimpleDeviceSearchInfo();<NEW_LINE>simpleDeviceSearchInfo.setProductKey(_ctx.stringValue("QueryDeviceBySQLResponse.Data[" + i + "].ProductKey"));<NEW_LINE>simpleDeviceSearchInfo.setDeviceName(_ctx.stringValue("QueryDeviceBySQLResponse.Data[" + i + "].DeviceName"));<NEW_LINE>simpleDeviceSearchInfo.setNickname(_ctx.stringValue("QueryDeviceBySQLResponse.Data[" + i + "].Nickname"));<NEW_LINE>simpleDeviceSearchInfo.setStatus(_ctx.stringValue("QueryDeviceBySQLResponse.Data[" + i + "].Status"));<NEW_LINE>simpleDeviceSearchInfo.setActiveTime(_ctx.stringValue("QueryDeviceBySQLResponse.Data[" + i + "].ActiveTime"));<NEW_LINE>simpleDeviceSearchInfo.setIotId(_ctx.stringValue("QueryDeviceBySQLResponse.Data[" + i + "].IotId"));<NEW_LINE>simpleDeviceSearchInfo.setGmtCreate(_ctx.stringValue("QueryDeviceBySQLResponse.Data[" + i + "].GmtCreate"));<NEW_LINE>simpleDeviceSearchInfo.setGmtModified(_ctx.stringValue("QueryDeviceBySQLResponse.Data[" + i + "].GmtModified"));<NEW_LINE>List<SimpleDeviceGroupInfo> groups = new ArrayList<SimpleDeviceGroupInfo>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("QueryDeviceBySQLResponse.Data[" + i + "].Groups.Length"); j++) {<NEW_LINE>SimpleDeviceGroupInfo simpleDeviceGroupInfo = new SimpleDeviceGroupInfo();<NEW_LINE>simpleDeviceGroupInfo.setGroupId(_ctx.stringValue("QueryDeviceBySQLResponse.Data[" + i + "].Groups[" + j + "].GroupId"));<NEW_LINE>groups.add(simpleDeviceGroupInfo);<NEW_LINE>}<NEW_LINE>simpleDeviceSearchInfo.setGroups(groups);<NEW_LINE>List<TagInfo> tags = new ArrayList<TagInfo>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("QueryDeviceBySQLResponse.Data[" + i + "].Tags.Length"); j++) {<NEW_LINE>TagInfo tagInfo = new TagInfo();<NEW_LINE>tagInfo.setTagName(_ctx.stringValue("QueryDeviceBySQLResponse.Data[" + i + "].Tags[" + j + "].TagName"));<NEW_LINE>tagInfo.setTagValue(_ctx.stringValue("QueryDeviceBySQLResponse.Data[" + i + "].Tags[" + j + "].TagValue"));<NEW_LINE>tags.add(tagInfo);<NEW_LINE>}<NEW_LINE>simpleDeviceSearchInfo.setTags(tags);<NEW_LINE>List<OTAModuleInfo> oTAModules = new ArrayList<OTAModuleInfo>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("QueryDeviceBySQLResponse.Data[" + i + "].OTAModules.Length"); j++) {<NEW_LINE>OTAModuleInfo oTAModuleInfo = new OTAModuleInfo();<NEW_LINE>oTAModuleInfo.setModuleName(_ctx.stringValue("QueryDeviceBySQLResponse.Data[" + i + "].OTAModules[" + j + "].ModuleName"));<NEW_LINE>oTAModuleInfo.setFirmwareVersion(_ctx.stringValue("QueryDeviceBySQLResponse.Data[" + i + "].OTAModules[" + j + "].FirmwareVersion"));<NEW_LINE>oTAModules.add(oTAModuleInfo);<NEW_LINE>}<NEW_LINE>simpleDeviceSearchInfo.setOTAModules(oTAModules);<NEW_LINE>data.add(simpleDeviceSearchInfo);<NEW_LINE>}<NEW_LINE>queryDeviceBySQLResponse.setData(data);<NEW_LINE>return queryDeviceBySQLResponse;<NEW_LINE>}
(_ctx.stringValue("QueryDeviceBySQLResponse.Code"));
1,520,522
public Timesheet createTimesheet(User user, LocalDate fromDate, LocalDate toDate) {<NEW_LINE>Timesheet timesheet = new Timesheet();<NEW_LINE>timesheet.setUser(user);<NEW_LINE>Company company = null;<NEW_LINE>Employee employee = user.getEmployee();<NEW_LINE>if (employee != null && employee.getMainEmploymentContract() != null) {<NEW_LINE>company = employee.getMainEmploymentContract().getPayCompany();<NEW_LINE>} else {<NEW_LINE>company = user.getActiveCompany();<NEW_LINE>}<NEW_LINE>String timeLoggingPreferenceSelect = employee == null <MASK><NEW_LINE>timesheet.setTimeLoggingPreferenceSelect(timeLoggingPreferenceSelect);<NEW_LINE>timesheet.setCompany(company);<NEW_LINE>timesheet.setFromDate(fromDate);<NEW_LINE>timesheet.setStatusSelect(TimesheetRepository.STATUS_DRAFT);<NEW_LINE>timesheet.setFullName(computeFullName(timesheet));<NEW_LINE>return timesheet;<NEW_LINE>}
? null : employee.getTimeLoggingPreferenceSelect();
93,084
public static Collection<AbstractTreeNode> doGetDirectoryChildren(final PsiDirectory psiDirectory, final ViewSettings settings, final boolean withSubDirectories) {<NEW_LINE>final List<AbstractTreeNode> children = new ArrayList<>();<NEW_LINE>final Project project = psiDirectory.getProject();<NEW_LINE>final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();<NEW_LINE>final Module module = fileIndex.getModuleForFile(psiDirectory.getVirtualFile());<NEW_LINE>final ModuleFileIndex moduleFileIndex = module == null ? null : ModuleRootManager.getInstance(module).getFileIndex();<NEW_LINE>if (!settings.isFlattenPackages() || skipDirectory(psiDirectory)) {<NEW_LINE>processPsiDirectoryChildren(psiDirectory, directoryChildrenInProject(psiDirectory, settings), children, fileIndex, null, settings, withSubDirectories);<NEW_LINE>} else {<NEW_LINE>// source directory in "flatten packages" mode<NEW_LINE>final <MASK><NEW_LINE>if (parentDir == null || skipDirectory(parentDir) && /*|| !rootDirectoryFound(parentDir)*/<NEW_LINE>withSubDirectories) {<NEW_LINE>addAllSubpackages(children, psiDirectory, moduleFileIndex, settings);<NEW_LINE>}<NEW_LINE>PsiDirectory[] subdirs = psiDirectory.getSubdirectories();<NEW_LINE>for (PsiDirectory subdir : subdirs) {<NEW_LINE>if (!skipDirectory(subdir)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>VirtualFile directoryFile = subdir.getVirtualFile();<NEW_LINE>if (FileTypeRegistry.getInstance().isFileIgnored(directoryFile))<NEW_LINE>continue;<NEW_LINE>if (withSubDirectories) {<NEW_LINE>children.add(new PsiDirectoryNode(project, subdir, settings));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>processPsiDirectoryChildren(psiDirectory, psiDirectory.getFiles(), children, fileIndex, moduleFileIndex, settings, withSubDirectories);<NEW_LINE>}<NEW_LINE>return children;<NEW_LINE>}
PsiDirectory parentDir = psiDirectory.getParentDirectory();
765,817
public void visitInvokeCallMember(InvokeCallMemberNode irInvokeCallMemberNode, Consumer<ExpressionNode> scope) {<NEW_LINE>for (int i = 0; i < irInvokeCallMemberNode.getArgumentNodes().size(); i++) {<NEW_LINE>int j = i;<NEW_LINE>irInvokeCallMemberNode.getArgumentNodes().get(i).visit(this, (e) -> irInvokeCallMemberNode.getArgumentNodes()<MASK><NEW_LINE>}<NEW_LINE>PainlessMethod method = irInvokeCallMemberNode.getDecorationValue(IRDMethod.class);<NEW_LINE>if (method != null && method.annotations().containsKey(CompileTimeOnlyAnnotation.class)) {<NEW_LINE>replaceCallWithConstant(irInvokeCallMemberNode, scope, method.javaMethod(), null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PainlessInstanceBinding instanceBinding = irInvokeCallMemberNode.getDecorationValue(IRDInstanceBinding.class);<NEW_LINE>if (instanceBinding != null && instanceBinding.annotations().containsKey(CompileTimeOnlyAnnotation.class)) {<NEW_LINE>replaceCallWithConstant(irInvokeCallMemberNode, scope, instanceBinding.javaMethod(), instanceBinding.targetInstance());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}
.set(j, e));
694,320
private void loadArmor(String armorType, List<Material> materialList) {<NEW_LINE>if (needsUpdate) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ConfigurationSection armorSection = config.getConfigurationSection(armorType);<NEW_LINE>if (armorSection == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Set<String> armorConfigSet = armorSection.getKeys(false);<NEW_LINE>for (String armorName : armorConfigSet) {<NEW_LINE>if (config.contains(armorType + "." + armorName + "." + ".ID")) {<NEW_LINE>needsUpdate = true;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Material armorMaterial = Material.matchMaterial(armorName);<NEW_LINE>if (armorMaterial == null) {<NEW_LINE>mcMMO.p.getLogger().warning("Invalid material name. This item will be skipped. - " + armorName);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>boolean repairable = config.getBoolean(armorType + "." + armorName + ".Repairable");<NEW_LINE>Material repairMaterial = Material.matchMaterial(config.getString(armorType + "." + armorName + ".Repair_Material", ""));<NEW_LINE>if (repairable && (repairMaterial == null)) {<NEW_LINE>mcMMO.p.getLogger().warning("Incomplete repair information. This item will be unrepairable. - " + armorName);<NEW_LINE>repairable = false;<NEW_LINE>}<NEW_LINE>if (repairable) {<NEW_LINE>String repairItemName = config.getString(armorType + "." + armorName + ".Repair_Material_Pretty_Name");<NEW_LINE>int repairMinimumLevel = config.getInt(armorType + "." + armorName + ".Repair_MinimumLevel", 0);<NEW_LINE>double repairXpMultiplier = config.getDouble(armorType + <MASK><NEW_LINE>short durability = armorMaterial.getMaxDurability();<NEW_LINE>if (durability == 0) {<NEW_LINE>durability = (short) config.getInt(armorType + "." + armorName + ".Durability", 70);<NEW_LINE>}<NEW_LINE>repairables.add(RepairableFactory.getRepairable(armorMaterial, repairMaterial, repairItemName, repairMinimumLevel, durability, ItemType.ARMOR, MaterialType.OTHER, repairXpMultiplier));<NEW_LINE>}<NEW_LINE>materialList.add(armorMaterial);<NEW_LINE>}<NEW_LINE>}
"." + armorName + ".Repair_XpMultiplier", 1);
293,789
final CreateOriginEndpointResult executeCreateOriginEndpoint(CreateOriginEndpointRequest createOriginEndpointRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createOriginEndpointRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateOriginEndpointRequest> request = null;<NEW_LINE>Response<CreateOriginEndpointResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new CreateOriginEndpointRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createOriginEndpointRequest));<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");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateOriginEndpoint");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateOriginEndpointResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateOriginEndpointResultJsonUnmarshaller());<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,508,165
public static TakeBreakResponse unmarshall(TakeBreakResponse takeBreakResponse, UnmarshallerContext _ctx) {<NEW_LINE>takeBreakResponse.setRequestId(_ctx.stringValue("TakeBreakResponse.RequestId"));<NEW_LINE>takeBreakResponse.setCode(_ctx.stringValue("TakeBreakResponse.Code"));<NEW_LINE>takeBreakResponse.setHttpStatusCode(_ctx.integerValue("TakeBreakResponse.HttpStatusCode"));<NEW_LINE>takeBreakResponse.setMessage(_ctx.stringValue("TakeBreakResponse.Message"));<NEW_LINE>List<String> params = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("TakeBreakResponse.Params.Length"); i++) {<NEW_LINE>params.add(_ctx.stringValue("TakeBreakResponse.Params[" + i + "]"));<NEW_LINE>}<NEW_LINE>takeBreakResponse.setParams(params);<NEW_LINE>Data data = new Data();<NEW_LINE>data.setExtension(_ctx.stringValue("TakeBreakResponse.Data.Extension"));<NEW_LINE>data.setHeartbeat(_ctx.longValue("TakeBreakResponse.Data.Heartbeat"));<NEW_LINE>data.setWorkMode<MASK><NEW_LINE>data.setDeviceId(_ctx.stringValue("TakeBreakResponse.Data.DeviceId"));<NEW_LINE>data.setUserId(_ctx.stringValue("TakeBreakResponse.Data.UserId"));<NEW_LINE>data.setReserved(_ctx.longValue("TakeBreakResponse.Data.Reserved"));<NEW_LINE>data.setBreakCode(_ctx.stringValue("TakeBreakResponse.Data.BreakCode"));<NEW_LINE>data.setInstanceId(_ctx.stringValue("TakeBreakResponse.Data.InstanceId"));<NEW_LINE>data.setOutboundScenario(_ctx.booleanValue("TakeBreakResponse.Data.OutboundScenario"));<NEW_LINE>data.setMobile(_ctx.stringValue("TakeBreakResponse.Data.Mobile"));<NEW_LINE>data.setJobId(_ctx.stringValue("TakeBreakResponse.Data.JobId"));<NEW_LINE>data.setUserState(_ctx.stringValue("TakeBreakResponse.Data.UserState"));<NEW_LINE>List<String> signedSkillGroupIdList = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("TakeBreakResponse.Data.SignedSkillGroupIdList.Length"); i++) {<NEW_LINE>signedSkillGroupIdList.add(_ctx.stringValue("TakeBreakResponse.Data.SignedSkillGroupIdList[" + i + "]"));<NEW_LINE>}<NEW_LINE>data.setSignedSkillGroupIdList(signedSkillGroupIdList);<NEW_LINE>takeBreakResponse.setData(data);<NEW_LINE>return takeBreakResponse;<NEW_LINE>}
(_ctx.stringValue("TakeBreakResponse.Data.WorkMode"));
1,130,723
public Request<ListGroupsForUserRequest> marshall(ListGroupsForUserRequest listGroupsForUserRequest) {<NEW_LINE>if (listGroupsForUserRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<ListGroupsForUserRequest> request = new DefaultRequest<ListGroupsForUserRequest>(listGroupsForUserRequest, "AmazonIdentityManagement");<NEW_LINE><MASK><NEW_LINE>request.addParameter("Version", "2010-05-08");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (listGroupsForUserRequest.getUserName() != null) {<NEW_LINE>request.addParameter("UserName", StringUtils.fromString(listGroupsForUserRequest.getUserName()));<NEW_LINE>}<NEW_LINE>if (listGroupsForUserRequest.getMarker() != null) {<NEW_LINE>request.addParameter("Marker", StringUtils.fromString(listGroupsForUserRequest.getMarker()));<NEW_LINE>}<NEW_LINE>if (listGroupsForUserRequest.getMaxItems() != null) {<NEW_LINE>request.addParameter("MaxItems", StringUtils.fromInteger(listGroupsForUserRequest.getMaxItems()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.addParameter("Action", "ListGroupsForUser");
306,310
public static CodegenMethod codegenMethod(ExprNode[] expressionNodes, MultiKeyClassRef multiKeyClassRef, CodegenMethodScope parent, CodegenClassScope classScope) {<NEW_LINE>CodegenMethod eventUnpackMethod = parent.makeChildWithScope(EPTypePremade.OBJECT.getEPType(), CodegenLegoMethodExpression.class, CodegenSymbolProviderEmpty.INSTANCE, classScope).addParam(ExprForgeCodegenNames.PARAMS);<NEW_LINE>ExprForgeCodegenSymbol exprSymbol = new ExprForgeCodegenSymbol(true, null);<NEW_LINE>CodegenMethod exprMethod = eventUnpackMethod.makeChildWithScope(EPTypePremade.OBJECT.getEPType(), CodegenLegoMethodExpression.class, exprSymbol, classScope).addParam(ExprForgeCodegenNames.PARAMS);<NEW_LINE>CodegenExpression[] expressions = new CodegenExpression[expressionNodes.length];<NEW_LINE>for (int i = 0; i < expressionNodes.length; i++) {<NEW_LINE>ExprForge forge = expressionNodes[i].getForge();<NEW_LINE>EPType type = multiKeyClassRef.getMKTypes()[i];<NEW_LINE>expressions[i] = codegenExpressionMayCoerce(forge, type, exprMethod, exprSymbol, classScope);<NEW_LINE>}<NEW_LINE>exprSymbol.derivedSymbolsCodegen(eventUnpackMethod, <MASK><NEW_LINE>exprMethod.getBlock().methodReturn(newInstance(multiKeyClassRef.getClassNameMK(), expressions));<NEW_LINE>eventUnpackMethod.getBlock().methodReturn(localMethod(exprMethod, REF_EPS, REF_ISNEWDATA, REF_EXPREVALCONTEXT));<NEW_LINE>return eventUnpackMethod;<NEW_LINE>}
exprMethod.getBlock(), classScope);
134,165
public void run() throws IOException {<NEW_LINE>if (this.isStarted() || this.isComplete()) {<NEW_LINE>throw new IllegalStateException("The process can only be used once.");<NEW_LINE>}<NEW_LINE>final ProcessBuilder builder = new ProcessBuilder(this.cmd);<NEW_LINE>builder.directory(new File(this.workingDir));<NEW_LINE>builder.environment().putAll(this.env);<NEW_LINE>builder.redirectErrorStream(true);<NEW_LINE>this.process = builder.start();<NEW_LINE>try {<NEW_LINE>this.processId = processId(this.process);<NEW_LINE>if (this.processId == 0) {<NEW_LINE>this.logger.info("Spawned process with unknown process id");<NEW_LINE>} else {<NEW_LINE>this.logger.<MASK><NEW_LINE>}<NEW_LINE>this.startupLatch.countDown();<NEW_LINE>final LogGobbler outputGobbler = new LogGobbler(new InputStreamReader(this.process.getInputStream(), StandardCharsets.UTF_8), this.logger, Level.INFO, 30);<NEW_LINE>final LogGobbler errorGobbler = new LogGobbler(new InputStreamReader(this.process.getErrorStream(), StandardCharsets.UTF_8), this.logger, Level.ERROR, 30);<NEW_LINE>outputGobbler.start();<NEW_LINE>errorGobbler.start();<NEW_LINE>int exitCode = -1;<NEW_LINE>try {<NEW_LINE>exitCode = this.process.waitFor();<NEW_LINE>} catch (final InterruptedException e) {<NEW_LINE>this.logger.info("Process interrupted. Exit code is " + exitCode, e);<NEW_LINE>}<NEW_LINE>this.completeLatch.countDown();<NEW_LINE>// try to wait for everything to get logged out before exiting<NEW_LINE>outputGobbler.awaitCompletion(5000);<NEW_LINE>errorGobbler.awaitCompletion(5000);<NEW_LINE>if (exitCode != 0) {<NEW_LINE>throw new ProcessFailureException(exitCode);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>IOUtils.closeQuietly(this.process.getInputStream());<NEW_LINE>IOUtils.closeQuietly(this.process.getOutputStream());<NEW_LINE>IOUtils.closeQuietly(this.process.getErrorStream());<NEW_LINE>}<NEW_LINE>}
info("Spawned process with id " + this.processId);
1,731,122
public void loadImage(final int requestId, final Uri uri, final Callback callback) {<NEW_LINE>final boolean[] cacheMissed = new boolean[1];<NEW_LINE>ImageDownloadTarget target = new ImageDownloadTarget(uri.toString()) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResourceReady(@NonNull File resource, Transition<? super File> transition) {<NEW_LINE>super.onResourceReady(resource, transition);<NEW_LINE>if (cacheMissed[0]) {<NEW_LINE>callback.onCacheMiss(ImageInfoExtractor.getImageType(resource), resource);<NEW_LINE>} else {<NEW_LINE>callback.onCacheHit(ImageInfoExtractor.getImageType(resource), resource);<NEW_LINE>}<NEW_LINE>callback.onSuccess(resource);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onLoadFailed(final Drawable errorDrawable) {<NEW_LINE>super.onLoadFailed(errorDrawable);<NEW_LINE>callback.<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onDownloadStart() {<NEW_LINE>cacheMissed[0] = true;<NEW_LINE>callback.onStart();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onProgress(int progress) {<NEW_LINE>callback.onProgress(progress);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onDownloadFinish() {<NEW_LINE>callback.onFinish();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>cancel(requestId);<NEW_LINE>rememberTarget(requestId, target);<NEW_LINE>downloadImageInto(uri, target);<NEW_LINE>}
onFail(new GlideLoaderException(errorDrawable));
371,798
final ListClustersResult executeListClusters(ListClustersRequest listClustersRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listClustersRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListClustersRequest> request = null;<NEW_LINE>Response<ListClustersResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListClustersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listClustersRequest));<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, "ECS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListClusters");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListClustersResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListClustersResultJsonUnmarshaller());<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);
836,883
protected void doExecute(MultiSearchTemplateRequest request, ActionListener<MultiSearchTemplateResponse> listener) {<NEW_LINE>List<Integer> originalSlots = new ArrayList<>();<NEW_LINE>MultiSearchRequest multiSearchRequest = new MultiSearchRequest();<NEW_LINE>multiSearchRequest.<MASK><NEW_LINE>if (request.maxConcurrentSearchRequests() != 0) {<NEW_LINE>multiSearchRequest.maxConcurrentSearchRequests(request.maxConcurrentSearchRequests());<NEW_LINE>}<NEW_LINE>MultiSearchTemplateResponse.Item[] items = new MultiSearchTemplateResponse.Item[request.requests().size()];<NEW_LINE>for (int i = 0; i < items.length; i++) {<NEW_LINE>SearchTemplateRequest searchTemplateRequest = request.requests().get(i);<NEW_LINE>SearchTemplateResponse searchTemplateResponse = new SearchTemplateResponse();<NEW_LINE>SearchRequest searchRequest;<NEW_LINE>try {<NEW_LINE>searchRequest = convert(searchTemplateRequest, searchTemplateResponse, scriptService, xContentRegistry);<NEW_LINE>} catch (Exception e) {<NEW_LINE>items[i] = new MultiSearchTemplateResponse.Item(null, e);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>items[i] = new MultiSearchTemplateResponse.Item(searchTemplateResponse, null);<NEW_LINE>if (searchRequest != null) {<NEW_LINE>multiSearchRequest.add(searchRequest);<NEW_LINE>originalSlots.add(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>multiSearchAction.execute(multiSearchRequest, ActionListener.wrap(r -> {<NEW_LINE>for (int i = 0; i < r.getResponses().length; i++) {<NEW_LINE>MultiSearchResponse.Item item = r.getResponses()[i];<NEW_LINE>int originalSlot = originalSlots.get(i);<NEW_LINE>if (item.isFailure()) {<NEW_LINE>items[originalSlot] = new MultiSearchTemplateResponse.Item(null, item.getFailure());<NEW_LINE>} else {<NEW_LINE>items[originalSlot].getResponse().setResponse(item.getResponse());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>listener.onResponse(new MultiSearchTemplateResponse(items));<NEW_LINE>}, listener::onFailure));<NEW_LINE>}
indicesOptions(request.indicesOptions());
1,490,426
private void genWorkerReceiveIns(BIRTerminator.WorkerReceive ins, int localVarOffset) {<NEW_LINE>this.mv.visitVarInsn(ALOAD, localVarOffset);<NEW_LINE>if (!ins.isSameStrand) {<NEW_LINE>this.mv.visitFieldInsn(GETFIELD, STRAND_CLASS, "parent", GET_STRAND);<NEW_LINE>}<NEW_LINE>this.mv.visitFieldInsn(GETFIELD, STRAND_CLASS, "wdChannels", GET_WD_CHANNELS);<NEW_LINE>this.mv.visitLdcInsn(ins.workerName.value);<NEW_LINE>this.mv.visitMethodInsn(INVOKEVIRTUAL, WD_CHANNELS, "getWorkerDataChannel", GET_WORKER_DATA_CHANNEL, false);<NEW_LINE>this.mv.visitVarInsn(ALOAD, localVarOffset);<NEW_LINE>this.mv.visitMethodInsn(INVOKEVIRTUAL, WORKER_DATA_CHANNEL, "tryTakeData", TRY_TAKE_DATA, false);<NEW_LINE>BIRNode.BIRVariableDcl tempVar = new BIRNode.BIRVariableDcl(symbolTable.anyType, new Name("wrkMsg"), VarScope.FUNCTION, VarKind.ARG);<NEW_LINE>int wrkResultIndex = this.getJVMIndexOfVarRef(tempVar);<NEW_LINE>this.mv.visitVarInsn(ASTORE, wrkResultIndex);<NEW_LINE>Label jumpAfterReceive = new Label();<NEW_LINE>this.mv.visitVarInsn(ALOAD, wrkResultIndex);<NEW_LINE>this.mv.visitJumpInsn(IFNULL, jumpAfterReceive);<NEW_LINE>Label withinReceiveSuccess = new Label();<NEW_LINE>this.mv.visitLabel(withinReceiveSuccess);<NEW_LINE>this.mv.visitVarInsn(ALOAD, wrkResultIndex);<NEW_LINE>jvmCastGen.addUnboxInsn(this.mv, <MASK><NEW_LINE>this.storeToVar(ins.lhsOp.variableDcl);<NEW_LINE>this.mv.visitLabel(jumpAfterReceive);<NEW_LINE>}
ins.lhsOp.variableDcl.type);
1,378,428
private static String findInstallArea() {<NEW_LINE>// NOI18N<NEW_LINE>String ia = System.getProperty("netbeans.home");<NEW_LINE>LOG.log(Level.FINE, "Home is {0}", ia);<NEW_LINE>// NOI18N<NEW_LINE>String <MASK><NEW_LINE>if (rest != null) {<NEW_LINE>for (String c : rest.split(File.pathSeparator)) {<NEW_LINE>File cf = new File(c);<NEW_LINE>if (!cf.isAbsolute() || !cf.exists()) {<NEW_LINE>LOG.log(Level.FINE, "Skipping non-existent {0}", c);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int prefix = findCommonPrefix(ia, c);<NEW_LINE>if (prefix == ia.length()) {<NEW_LINE>LOG.log(Level.FINE, "No change to prefix by {0}", c);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (prefix <= 3) {<NEW_LINE>LOG.log(Level.WARNING, "Cannot compute install area. No common prefix between {0} and {1}", new Object[] { ia, c });<NEW_LINE>} else {<NEW_LINE>LOG.log(Level.FINE, "Prefix shortened by {0} to {1} chars", new Object[] { c, prefix });<NEW_LINE>ia = ia.substring(0, prefix);<NEW_LINE>LOG.log(Level.FINE, "New prefix {0}", ia);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOG.fine("No dirs");<NEW_LINE>}<NEW_LINE>return ia;<NEW_LINE>}
rest = System.getProperty("netbeans.dirs");
1,153,456
public static Object extractDorisLiteral(Expr expr) {<NEW_LINE>if (!expr.isLiteral()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (expr instanceof BoolLiteral) {<NEW_LINE>BoolLiteral boolLiteral = (BoolLiteral) expr;<NEW_LINE>return boolLiteral.getValue();<NEW_LINE>} else if (expr instanceof DateLiteral) {<NEW_LINE>DateLiteral dateLiteral = (DateLiteral) expr;<NEW_LINE><MASK><NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append(dateLiteral.getYear()).append(dateLiteral.getMonth()).append(dateLiteral.getDay()).append(dateLiteral.getHour()).append(dateLiteral.getMinute()).append(dateLiteral.getSecond());<NEW_LINE>Date date;<NEW_LINE>try {<NEW_LINE>date = formatter.parse(sb.toString());<NEW_LINE>} catch (ParseException e) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return date.getTime();<NEW_LINE>} else if (expr instanceof DecimalLiteral) {<NEW_LINE>DecimalLiteral decimalLiteral = (DecimalLiteral) expr;<NEW_LINE>return decimalLiteral.getValue();<NEW_LINE>} else if (expr instanceof FloatLiteral) {<NEW_LINE>FloatLiteral floatLiteral = (FloatLiteral) expr;<NEW_LINE>return floatLiteral.getValue();<NEW_LINE>} else if (expr instanceof IntLiteral) {<NEW_LINE>IntLiteral intLiteral = (IntLiteral) expr;<NEW_LINE>return intLiteral.getValue();<NEW_LINE>} else if (expr instanceof StringLiteral) {<NEW_LINE>StringLiteral stringLiteral = (StringLiteral) expr;<NEW_LINE>return stringLiteral.getStringValue();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
1,619,474
public Scriptable loadModule(Context cx, String moduleName, Scriptable loadingScope) throws IOException {<NEW_LINE>Repository local = engine.getParentRepository(loadingScope);<NEW_LINE>ReloadableScript script = engine.getScript(moduleName, local);<NEW_LINE>// check if we already came across the module in the current context/request<NEW_LINE>if (checkedModules.containsKey(script.resource)) {<NEW_LINE>return checkedModules.get(script.resource);<NEW_LINE>}<NEW_LINE>// check if module has been loaded before<NEW_LINE>Scriptable module = <MASK><NEW_LINE>ReloadableScript parent = currentScript;<NEW_LINE>RingoWorker previous = acquireWorker();<NEW_LINE>try {<NEW_LINE>currentScript = script;<NEW_LINE>module = script.load(engine.getScope(), cx, module, this);<NEW_LINE>modules.put(script.resource, module);<NEW_LINE>} finally {<NEW_LINE>currentScript = parent;<NEW_LINE>releaseWorker(previous);<NEW_LINE>if (parent != null) {<NEW_LINE>parent.addDependency(script);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return module;<NEW_LINE>}
modules.get(script.resource);
1,661,382
public void testSingletonAnnMethod() throws Exception {<NEW_LINE>long currentThreadId = Thread.currentThread().getId();<NEW_LINE>BasicMixedLocal bean = lookupBasicSingletonMixedBean();<NEW_LINE>assertNotNull("Bean created successfully", bean);<NEW_LINE>// initialize latch<NEW_LINE>BasicSingletonMixedBean<MASK><NEW_LINE>// call the method that should be asynchronous<NEW_LINE>bean.test_asyncMethAnnOnly("The Beatles");<NEW_LINE>// Wait for test_asyncMethAnnOnly() to complete<NEW_LINE>BasicSingletonMixedBean.svBasicLatch.await(BasicSingletonMixedBean.MAX_ASYNC_WAIT, TimeUnit.MILLISECONDS);<NEW_LINE>svLogger.info("--> BasicSingletonMixedBean.asyncMeth2ThreadId = " + BasicSingletonMixedBean.asyncMeth2ThreadId + ", currentThreadId = " + currentThreadId);<NEW_LINE>// compare the thread the method was run in and the current thread; they should be different since the method was asynchronous<NEW_LINE>assertTrue("The asynchronous bean method should run on a different thread than the test: asyncMeth2ThreadId = " + BasicSingletonMixedBean.asyncMeth2ThreadId + ", currentThreadId = " + currentThreadId, (BasicSingletonMixedBean.asyncMeth2ThreadId != currentThreadId));<NEW_LINE>}
.svBasicLatch = new CountDownLatch(1);
683,353
private Blob cipheredBlob(String container, Blob blob, InputStream payload, long contentLength, boolean addEncryptedMetadata) {<NEW_LINE>// make a copy of the blob with the new payload stream<NEW_LINE>BlobMetadata blobMeta = blob.getMetadata();<NEW_LINE>ContentMetadata contentMeta = blob.getMetadata().getContentMetadata();<NEW_LINE>Map<String, String> userMetadata = blobMeta.getUserMetadata();<NEW_LINE>String contentType = contentMeta.getContentType();<NEW_LINE>// suffix the content type with -s3enc if we need to encrypt<NEW_LINE>if (addEncryptedMetadata) {<NEW_LINE>blobMeta = setEncryptedSuffix(blobMeta);<NEW_LINE>} else {<NEW_LINE>// remove the -s3enc suffix while decrypting<NEW_LINE>// but not if it contains a multipart meta<NEW_LINE>if (!blobMeta.getUserMetadata().containsKey(Constants.METADATA_IS_ENCRYPTED_MULTIPART)) {<NEW_LINE>blobMeta = removeEncryptedSuffix(blobMeta);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// we do not set contentMD5 as it will not match due to the encryption<NEW_LINE>Blob cipheredBlob = blobBuilder(container).name(blobMeta.getName()).type(blobMeta.getType()).tier(blobMeta.getTier()).userMetadata(userMetadata).payload(payload).cacheControl(contentMeta.getCacheControl()).contentDisposition(contentMeta.getContentDisposition()).contentEncoding(contentMeta.getContentEncoding()).contentLanguage(contentMeta.getContentLanguage()).contentLength(contentLength).contentType(contentType).build();<NEW_LINE>cipheredBlob.getMetadata().<MASK><NEW_LINE>cipheredBlob.getMetadata().setETag(blobMeta.getETag());<NEW_LINE>cipheredBlob.getMetadata().setLastModified(blobMeta.getLastModified());<NEW_LINE>cipheredBlob.getMetadata().setSize(blobMeta.getSize());<NEW_LINE>cipheredBlob.getMetadata().setPublicUri(blobMeta.getPublicUri());<NEW_LINE>cipheredBlob.getMetadata().setContainer(blobMeta.getContainer());<NEW_LINE>return cipheredBlob;<NEW_LINE>}
setUri(blobMeta.getUri());
1,026,165
private void rollingUpdate(final BigInteger oldHash) {<NEW_LINE>final var newNode = getCurrentNode();<NEW_LINE>final <MASK><NEW_LINE>BigInteger resultNew;<NEW_LINE>// go the path to the root<NEW_LINE>do {<NEW_LINE>final Node node = pageTrx.prepareRecordForModification(getCurrentNode().getNodeKey(), IndexType.DOCUMENT, -1);<NEW_LINE>if (node.getNodeKey() == newNode.getNodeKey()) {<NEW_LINE>resultNew = Node.to128BitsAtMaximumBigInteger(node.getHash().subtract(oldHash));<NEW_LINE>resultNew = Node.to128BitsAtMaximumBigInteger(resultNew.add(hash));<NEW_LINE>} else {<NEW_LINE>resultNew = Node.to128BitsAtMaximumBigInteger(node.getHash().subtract(oldHash.multiply(PRIME)));<NEW_LINE>resultNew = Node.to128BitsAtMaximumBigInteger(resultNew.add(hash.multiply(PRIME)));<NEW_LINE>}<NEW_LINE>node.setHash(resultNew);<NEW_LINE>} while (nodeReadOnlyTrx.moveTo(getCurrentNode().getParentKey()).hasMoved());<NEW_LINE>setCurrentNode(newNode);<NEW_LINE>}
BigInteger hash = newNode.computeHash();
1,370,298
final ListTemplateVersionsResult executeListTemplateVersions(ListTemplateVersionsRequest listTemplateVersionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTemplateVersionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTemplateVersionsRequest> request = null;<NEW_LINE>Response<ListTemplateVersionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTemplateVersionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTemplateVersionsRequest));<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, "QuickSight");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTemplateVersionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTemplateVersionsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTemplateVersions");
77,603
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see com.ibm.ws.sib.processor.impl.interfaces.MessageEventListener#messageEventOccurred(int, com.ibm.ws.sib.processor.impl.interfaces.SIMPMessage,<NEW_LINE>* com.ibm.ws.sib.msgstore.Transaction)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void messageEventOccurred(int event, SIMPMessage msg, TransactionCommon tran) throws SIDiscriminatorSyntaxException, SIResourceException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "messageEventOccurred", new Object[] { new Integer(event), msg, tran });<NEW_LINE>if (// 183715.1<NEW_LINE>event == MessageEvents.PRE_PREPARE_TRANSACTION) {<NEW_LINE>eventPrecommitAdd(msg, tran);<NEW_LINE>} else if (event == MessageEvents.POST_COMMIT_ADD) {<NEW_LINE>eventPostAdd(msg, tran, false);<NEW_LINE>} else if (event == MessageEvents.POST_ROLLBACK_ADD) {<NEW_LINE>eventPostAdd(msg, tran, true);<NEW_LINE>} else if (event == MessageEvents.POST_COMMITTED_TRANSACTION) {<NEW_LINE>eventPostCommit(msg);<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE><MASK><NEW_LINE>}
SibTr.exit(tc, "messageEventOccurred");
74,566
private void replaceFunctionnalType(DeclarationContainer container, TypedDeclaration currentTypedElement, TypeReference currentType, ParameterDeclaration[] parameters, TypeReference returnType) {<NEW_LINE>if (parameters.length <= 3) {<NEW_LINE>TypeReference functionType = new TypeReference(null, "unamed", null);<NEW_LINE>if (!"void".equals(returnType.getName())) {<NEW_LINE>switch(parameters.length) {<NEW_LINE>case 0:<NEW_LINE>functionType.setName(SUPPLIER);<NEW_LINE>functionType.setTypeArguments(new TypeReference[] { returnType });<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>functionType.setName(FUNCTION);<NEW_LINE>functionType.setTypeArguments(new TypeReference[] { parameters[0].getType(), returnType });<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>functionType.setName(BI_FUNCTION);<NEW_LINE>functionType.setTypeArguments(new TypeReference[] { parameters[0].getType(), parameters[1].getType(), returnType });<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>functionType.setName(TRI_FUNCTION);<NEW_LINE>functionType.setTypeArguments(new TypeReference[] { parameters[0].getType(), parameters[1].getType(), parameters[2].getType(), returnType });<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>switch(parameters.length) {<NEW_LINE>case 0:<NEW_LINE>functionType.setName(RUNNABLE);<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>functionType.setName(CONSUMER);<NEW_LINE>functionType.setTypeArguments(new TypeReference[] { parameters[0].getType() });<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>functionType.setName(BI_CONSUMER);<NEW_LINE>functionType.setTypeArguments(new TypeReference[] { parameters[0].getType(), parameters[1].getType() });<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>functionType.setName(TRI_CONSUMER);<NEW_LINE>functionType.setTypeArguments(new TypeReference[] { parameters[0].getType(), parameters[1].getType(), parameters[2].getType() });<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Util.substituteTypeReference(this, currentTypedElement, currentType, functionType);<NEW_LINE>} else {<NEW_LINE>// TODO: generate functions with more than 3 parameters in the<NEW_LINE>// util.function package so that we don't loose override links.<NEW_LINE>// At the moment we choose not to support functions with more than 3<NEW_LINE>// parameteres<NEW_LINE>TypeDeclaration t = getOrCreateFunctionalType(parameters, returnType);<NEW_LINE>TypeReference[] typeArgs = new TypeReference[parameters.length];<NEW_LINE>for (int i = 0; i < parameters.length; i++) {<NEW_LINE>typeArgs[i] = <MASK><NEW_LINE>}<NEW_LINE>if (!"void".equals(returnType.getName())) {<NEW_LINE>typeArgs = ArrayUtils.add(typeArgs, returnType);<NEW_LINE>}<NEW_LINE>Util.substituteTypeReference(this, currentTypedElement, currentType, new TypeReference(null, t, typeArgs));<NEW_LINE>// // recursively apply to the generated functional interface<NEW_LINE>// scan(newInterface);<NEW_LINE>}<NEW_LINE>}
parameters[i].getType();
699,500
private static long findFirstHoleByDichotomy(Long[] allocatedIps) {<NEW_LINE>if (isConsecutiveRange(allocatedIps)) {<NEW_LINE>String[] ips = longToIpv4String(allocatedIps);<NEW_LINE>List<String> dips = new ArrayList<String>(allocatedIps.length);<NEW_LINE>Collections.addAll(dips, ips);<NEW_LINE>String err = "You can not ask me to find a hole in consecutive range!!! " + dips;<NEW_LINE>assert false : err;<NEW_LINE>}<NEW_LINE>if (allocatedIps.length == 2) {<NEW_LINE>return allocatedIps[0] + 1;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>Long[] part1 = Arrays.copyOfRange(allocatedIps, 0, mIndex);<NEW_LINE>Long[] part2 = Arrays.copyOfRange(allocatedIps, mIndex, allocatedIps.length);<NEW_LINE>if (part1.length == 1) {<NEW_LINE>if (isConsecutiveRange(part2)) {<NEW_LINE>Long[] tmp = new Long[] { part1[0], part2[0] };<NEW_LINE>if (!isConsecutiveRange(tmp)) {<NEW_LINE>return part1[0] + 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int mIndex = allocatedIps.length / 2;
1,335,036
public static CloneModelFromCommitResponse unmarshall(CloneModelFromCommitResponse cloneModelFromCommitResponse, UnmarshallerContext _ctx) {<NEW_LINE>cloneModelFromCommitResponse.setRequestId(_ctx.stringValue("CloneModelFromCommitResponse.RequestId"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setAppId(_ctx.stringValue("CloneModelFromCommitResponse.Data.AppId"));<NEW_LINE>data.setContent(_ctx.mapValue("CloneModelFromCommitResponse.Data.Content"));<NEW_LINE>data.setCreateTime(_ctx.stringValue("CloneModelFromCommitResponse.Data.CreateTime"));<NEW_LINE>data.setDescription(_ctx.stringValue("CloneModelFromCommitResponse.Data.Description"));<NEW_LINE>data.setId(_ctx.stringValue("CloneModelFromCommitResponse.Data.Id"));<NEW_LINE>data.setLinkModelId(_ctx.stringValue("CloneModelFromCommitResponse.Data.LinkModelId"));<NEW_LINE>data.setLinkModuleId(_ctx.stringValue("CloneModelFromCommitResponse.Data.LinkModuleId"));<NEW_LINE>data.setLinked(_ctx.booleanValue("CloneModelFromCommitResponse.Data.Linked"));<NEW_LINE>data.setModelId(_ctx.stringValue("CloneModelFromCommitResponse.Data.ModelId"));<NEW_LINE>data.setModifiedTime(_ctx.stringValue("CloneModelFromCommitResponse.Data.ModifiedTime"));<NEW_LINE>data.setModuleId(_ctx.stringValue("CloneModelFromCommitResponse.Data.ModuleId"));<NEW_LINE>data.setModelName(_ctx.stringValue("CloneModelFromCommitResponse.Data.ModelName"));<NEW_LINE>data.setProps(_ctx.mapValue("CloneModelFromCommitResponse.Data.Props"));<NEW_LINE>data.setRevision(_ctx.integerValue("CloneModelFromCommitResponse.Data.Revision"));<NEW_LINE>data.setSchemaVersion<MASK><NEW_LINE>data.setModelStatus(_ctx.stringValue("CloneModelFromCommitResponse.Data.ModelStatus"));<NEW_LINE>data.setSubType(_ctx.stringValue("CloneModelFromCommitResponse.Data.SubType"));<NEW_LINE>data.setModelType(_ctx.stringValue("CloneModelFromCommitResponse.Data.ModelType"));<NEW_LINE>data.setVisibility(_ctx.stringValue("CloneModelFromCommitResponse.Data.Visibility"));<NEW_LINE>List<Map<Object, Object>> attributes = _ctx.listMapValue("CloneModelFromCommitResponse.Data.Attributes");<NEW_LINE>data.setAttributes(attributes);<NEW_LINE>cloneModelFromCommitResponse.setData(data);<NEW_LINE>return cloneModelFromCommitResponse;<NEW_LINE>}
(_ctx.stringValue("CloneModelFromCommitResponse.Data.SchemaVersion"));
1,090
public void run(FlowTrigger trigger, Map data) {<NEW_LINE>new SQLBatch() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void scripts() {<NEW_LINE>// Do a swap to keep volume uuid ...<NEW_LINE>sql(VolumeVO.class).eq(VolumeVO_.uuid, transientVolume.getUuid()).set(VolumeVO_.installPath, volume.getInstallPath()).set(VolumeVO_.size, volume.getSize()).set(VolumeVO_.rootImageUuid, volume.getRootImageUuid()).set(VolumeVO_.primaryStorageUuid, volume.getPrimaryStorageUuid()).set(VolumeVO_.actualSize, volume.<MASK><NEW_LINE>sql(VolumeVO.class).eq(VolumeVO_.uuid, volume.getUuid()).set(VolumeVO_.installPath, transientVolume.getInstallPath()).set(VolumeVO_.size, transientVolume.getSize()).set(VolumeVO_.rootImageUuid, transientVolume.getRootImageUuid()).set(VolumeVO_.primaryStorageUuid, transientVolume.getPrimaryStorageUuid()).set(VolumeVO_.actualSize, transientVolume.getActualSize()).update();<NEW_LINE>flush();<NEW_LINE>}<NEW_LINE>}.execute();<NEW_LINE>trigger.next();<NEW_LINE>}
getActualSize()).update();
462,076
public static String formatCallStack(List<StarlarkThread.CallStackEntry> callstack, String message, SourceReader src) {<NEW_LINE>StringBuilder buf = new StringBuilder();<NEW_LINE>// n > 0<NEW_LINE>int n = callstack.size();<NEW_LINE>String prefix = "Error: ";<NEW_LINE>// If the topmost frame is a built-in, don't show it.<NEW_LINE>// Instead just prefix the name of the built-in onto the error message.<NEW_LINE>StarlarkThread.CallStackEntry leaf = callstack.get(n - 1);<NEW_LINE>if (leaf.location.equals(Location.BUILTIN)) {<NEW_LINE>prefix <MASK><NEW_LINE>n--;<NEW_LINE>}<NEW_LINE>if (n > 0) {<NEW_LINE>buf.append("Traceback (most recent call last):\n");<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>StarlarkThread.CallStackEntry fr = callstack.get(i);<NEW_LINE>// 'File "file.bzl", line 1, column 2, in fn'<NEW_LINE>buf.append(String.format("\tFile \"%s\", ", fr.location.file()));<NEW_LINE>if (fr.location.line() != 0) {<NEW_LINE>buf.append("line ").append(fr.location.line()).append(", ");<NEW_LINE>if (fr.location.column() != 0) {<NEW_LINE>buf.append("column ").append(fr.location.column()).append(", ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>buf.append("in ").append(fr.name).append('\n');<NEW_LINE>// source line<NEW_LINE>String line = src.readline(fr.location);<NEW_LINE>if (line != null) {<NEW_LINE>buf.append("\t\t").append(line.trim()).append('\n');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>buf.append(prefix).append(message);<NEW_LINE>return buf.toString();<NEW_LINE>}
= "Error in " + leaf.name + ": ";
1,290,527
private void recalculateScoresFromVector(Vulnerability vuln) {<NEW_LINE>// Recalculate V2 score based on vector passed to resource and normalize vector<NEW_LINE>final Cvss v2 = Cvss.fromVector(vuln.getCvssV2Vector());<NEW_LINE>if (v2 != null) {<NEW_LINE>final Score score = v2.calculateScore();<NEW_LINE>vuln.setCvssV2BaseScore(BigDecimal.valueOf(score.getBaseScore()));<NEW_LINE>vuln.setCvssV2ImpactSubScore(BigDecimal.valueOf(score.getImpactSubScore()));<NEW_LINE>vuln.setCvssV2ExploitabilitySubScore(BigDecimal.valueOf<MASK><NEW_LINE>vuln.setCvssV2Vector(v2.getVector());<NEW_LINE>}<NEW_LINE>// Recalculate V3 score based on vector passed to resource and normalize vector<NEW_LINE>final Cvss v3 = Cvss.fromVector(vuln.getCvssV3Vector());<NEW_LINE>if (v3 != null) {<NEW_LINE>final Score score = v3.calculateScore();<NEW_LINE>vuln.setCvssV3BaseScore(BigDecimal.valueOf(score.getBaseScore()));<NEW_LINE>vuln.setCvssV3ImpactSubScore(BigDecimal.valueOf(score.getImpactSubScore()));<NEW_LINE>vuln.setCvssV3ExploitabilitySubScore(BigDecimal.valueOf(score.getExploitabilitySubScore()));<NEW_LINE>vuln.setCvssV3Vector(v3.getVector());<NEW_LINE>}<NEW_LINE>}
(score.getExploitabilitySubScore()));
249,455
public NpmPackageMetadataJson loadPackageMetadata(String thePackageId) {<NEW_LINE>NpmPackageMetadataJson retVal = new NpmPackageMetadataJson();<NEW_LINE>Optional<NpmPackageEntity> pkg = myPackageDao.findByPackageId(thePackageId);<NEW_LINE>if (!pkg.isPresent()) {<NEW_LINE>throw new ResourceNotFoundException(Msg.code<MASK><NEW_LINE>}<NEW_LINE>List<NpmPackageVersionEntity> packageVersions = new ArrayList<>(myPackageVersionDao.findByPackageId(thePackageId));<NEW_LINE>packageVersions.sort(new ReverseComparator<>((o1, o2) -> PackageVersionComparator.INSTANCE.compare(o1.getVersionId(), o2.getVersionId())));<NEW_LINE>for (NpmPackageVersionEntity next : packageVersions) {<NEW_LINE>if (next.isCurrentVersion()) {<NEW_LINE>retVal.setDistTags(new NpmPackageMetadataJson.DistTags().setLatest(next.getVersionId()));<NEW_LINE>}<NEW_LINE>NpmPackageMetadataJson.Version version = new NpmPackageMetadataJson.Version();<NEW_LINE>version.setFhirVersion(next.getFhirVersionId());<NEW_LINE>version.setDescription(next.getDescription());<NEW_LINE>version.setName(next.getPackageId());<NEW_LINE>version.setVersion(next.getVersionId());<NEW_LINE>version.setBytes(next.getPackageSizeBytes());<NEW_LINE>retVal.addVersion(version);<NEW_LINE>}<NEW_LINE>return retVal;<NEW_LINE>}
(1306) + "Unknown package ID: " + thePackageId);
142,062
public static // ////////////////////////////////////////////////////////////////////<NEW_LINE>String // ////////////////////////////////////////////////////////////////////<NEW_LINE>encode(// ////////////////////////////////////////////////////////////////////<NEW_LINE>final byte[] octetString) {<NEW_LINE>int bits24;<NEW_LINE>int bits6;<NEW_LINE>final char[] out = new char[((octetString.length - 1) / 3 + 1) * 4];<NEW_LINE>int outIndex = 0;<NEW_LINE>int i = 0;<NEW_LINE>while ((i + 3) <= octetString.length) {<NEW_LINE>// store the octets<NEW_LINE>bits24 = (octetString[i++] & 0xFF) << 16;<NEW_LINE>bits24 |= (octetString[i++] & 0xFF) << 8;<NEW_LINE>bits24 |= (octetString[i++] & 0xFF);<NEW_LINE>bits6 = (bits24 & 0x00FC0000) >> 18;<NEW_LINE>out[outIndex++] = alphabet[bits6];<NEW_LINE>bits6 = (bits24 & 0x0003F000) >> 12;<NEW_LINE>out[outIndex++] = alphabet[bits6];<NEW_LINE>bits6 = <MASK><NEW_LINE>out[outIndex++] = alphabet[bits6];<NEW_LINE>bits6 = (bits24 & 0x0000003F);<NEW_LINE>out[outIndex++] = alphabet[bits6];<NEW_LINE>}<NEW_LINE>if (octetString.length - i == 2) {<NEW_LINE>// store the octets<NEW_LINE>bits24 = (octetString[i] & 0xFF) << 16;<NEW_LINE>bits24 |= (octetString[i + 1] & 0xFF) << 8;<NEW_LINE>bits6 = (bits24 & 0x00FC0000) >> 18;<NEW_LINE>out[outIndex++] = alphabet[bits6];<NEW_LINE>bits6 = (bits24 & 0x0003F000) >> 12;<NEW_LINE>out[outIndex++] = alphabet[bits6];<NEW_LINE>bits6 = (bits24 & 0x00000FC0) >> 6;<NEW_LINE>out[outIndex++] = alphabet[bits6];<NEW_LINE>// padding<NEW_LINE>out[outIndex++] = '=';<NEW_LINE>} else if (octetString.length - i == 1) {<NEW_LINE>// store the octets<NEW_LINE>bits24 = (octetString[i] & 0xFF) << 16;<NEW_LINE>bits6 = (bits24 & 0x00FC0000) >> 18;<NEW_LINE>out[outIndex++] = alphabet[bits6];<NEW_LINE>bits6 = (bits24 & 0x0003F000) >> 12;<NEW_LINE>out[outIndex++] = alphabet[bits6];<NEW_LINE>// padding<NEW_LINE>out[outIndex++] = '=';<NEW_LINE>out[outIndex++] = '=';<NEW_LINE>}<NEW_LINE>return new String(out);<NEW_LINE>}
(bits24 & 0x00000FC0) >> 6;
1,428,301
public void fillCompletionVariants(@NotNull CompletionParameters parameters, @NotNull CompletionResultSet result) {<NEW_LINE>PsiElement position = parameters.getPosition();<NEW_LINE>PsiFile file = parameters.getOriginalFile();<NEW_LINE>ASTNode node = position.getNode();<NEW_LINE>if (file instanceof GoFile && position.getParent() instanceof GoPackageClause && node.getElementType() == GoTypes.IDENTIFIER) {<NEW_LINE>boolean <MASK><NEW_LINE>PsiDirectory directory = file.getParent();<NEW_LINE>String currentPackageName = ((GoFile) file).getPackageName();<NEW_LINE>Collection<String> packagesInDirectory = GoPackageUtil.getAllPackagesInDirectory(directory, null, true);<NEW_LINE>for (String packageName : packagesInDirectory) {<NEW_LINE>if (!packageName.equals(currentPackageName)) {<NEW_LINE>result.addElement(packageLookup(packageName, GoCompletionUtil.PACKAGE_PRIORITY - 1));<NEW_LINE>}<NEW_LINE>if (isTestFile) {<NEW_LINE>result.addElement(packageLookup(packageName + GoConstants.TEST_SUFFIX, GoCompletionUtil.PACKAGE_PRIORITY));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (directory != null && ContainerUtil.filter(directory.getFiles(), Conditions.instanceOf(GoFile.class)).size() == 1) {<NEW_LINE>String packageFromDirectory = GoPsiImplUtil.getLocalPackageName(directory.getName());<NEW_LINE>if (!packageFromDirectory.isEmpty()) {<NEW_LINE>result.addElement(packageLookup(packageFromDirectory, GoCompletionUtil.PACKAGE_PRIORITY - 1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.addElement(packageLookup(GoConstants.MAIN, GoCompletionUtil.PACKAGE_PRIORITY - 2));<NEW_LINE>}<NEW_LINE>super.fillCompletionVariants(parameters, result);<NEW_LINE>}
isTestFile = GoTestFinder.isTestFile(file);
1,063,724
private void processRunAs(Servlet servlet) {<NEW_LINE>String servletName = servlet.getServletName();<NEW_LINE>Map<String, ConfigItem<String>> runAsMap = this.configurator.getConfigItemMap(RUN_AS_KEY);<NEW_LINE>ConfigItem<String> <MASK><NEW_LINE>RunAs runAs = servlet.getRunAs();<NEW_LINE>String roleName = (runAs != null) ? runAs.getRoleName() : null;<NEW_LINE>if (runAs != null) {<NEW_LINE>if (existingRunAs == null) {<NEW_LINE>runAsMap.put(servletName, this.configurator.createConfigItem(roleName));<NEW_LINE>if (roleName != null)<NEW_LINE>this.servletNameToRunAsRole.put(servletName, roleName);<NEW_LINE>} else {<NEW_LINE>this.configurator.validateDuplicateKeyValueConfiguration(SERVLET_KEY, SERVLET_NAME_KEY, servletName, RUN_AS_KEY, roleName, existingRunAs);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ((TraceComponent.isAnyTracingEnabled()) && (SecurityServletConfiguratorHelper.tc.isDebugEnabled()))<NEW_LINE>Tr.debug(SecurityServletConfiguratorHelper.tc, "servletNameToRunAsRole: " + this.servletNameToRunAsRole, new Object[0]);<NEW_LINE>}
existingRunAs = runAsMap.get(servletName);
992,761
private void invokeSimpleImplProviderService(String msg, String warName, String serviceName, PrintWriter writer) {<NEW_LINE>StringBuilder sBuilder = new StringBuilder("http://").append(hostname).append(":").append(port).append("/").append(warName).append("/").append(serviceName).append("?wsdl");<NEW_LINE>// System.out.println(sBuilder.toString());<NEW_LINE>try {<NEW_LINE>QName qname = new QName(NAMESPACE, serviceName);<NEW_LINE>URL wsdlLocation = new URL(sBuilder.toString());<NEW_LINE>Service service = Service.create(wsdlLocation, qname);<NEW_LINE>QName portType = new QName(NAMESPACE, "SimpleImplProviderPort");<NEW_LINE>Dispatch<SOAPMessage> dispatch = service.createDispatch(portType, SOAPMessage.class, Service.Mode.MESSAGE);<NEW_LINE>MessageFactory messageFactory = MessageFactory.newInstance();<NEW_LINE>SOAPMessage message = messageFactory.createMessage();<NEW_LINE>SOAPPart soappart = message.getSOAPPart();<NEW_LINE>// <soapenv:Body><NEW_LINE>// <tns2:invoke><NEW_LINE>// <arg0><NEW_LINE>// <contentDescription>strfgsdfg</contentDescription><NEW_LINE>// </arg0><NEW_LINE>// </tns2:invoke><NEW_LINE>// </soapenv:Body><NEW_LINE>SOAPEnvelope envelope = soappart.getEnvelope();<NEW_LINE>envelope.setAttribute("xmlns:tns", "http://impl.service.cdi.jaxws.ws.ibm.com/");<NEW_LINE>SOAPBody body = envelope.getBody();<NEW_LINE>SOAPElement element = body.addChildElement(body.createQName("invoke", "tns"));<NEW_LINE>element.addChildElement(new QName("arg0")).setTextContent(msg);<NEW_LINE>message.writeTo(System.out);<NEW_LINE>SOAPMessage msgRtn = dispatch.invoke(message);<NEW_LINE><MASK><NEW_LINE>String rtnStr = msgRtn.getSOAPBody().getTextContent();<NEW_LINE>writer.println(rtnStr);<NEW_LINE>} catch (Exception e) {<NEW_LINE>writer.println(e.getMessage());<NEW_LINE>} finally {<NEW_LINE>writer.flush();<NEW_LINE>writer.close();<NEW_LINE>}<NEW_LINE>}
msgRtn.writeTo(System.out);
704,299
public int executeUpdate(String sql, String[] columnNames) throws SQLException {<NEW_LINE>final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.entry(this, tc, "executeUpdate", sql, Arrays.toString(columnNames));<NEW_LINE>int numUpdates;<NEW_LINE>try {<NEW_LINE>if (childWrapper != null) {<NEW_LINE>closeAndRemoveResultSet();<NEW_LINE>}<NEW_LINE>if (childWrappers != null && !childWrappers.isEmpty()) {<NEW_LINE>closeAndRemoveResultSets();<NEW_LINE>}<NEW_LINE>parentWrapper.beginTransactionIfNecessary();<NEW_LINE>enforceStatementProperties();<NEW_LINE>numUpdates = stmtImpl.executeUpdate(sql, columnNames);<NEW_LINE>} catch (SQLException ex) {<NEW_LINE>// No FFDC code needed. Might be an application error.<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.exit(<MASK><NEW_LINE>throw WSJdbcUtil.mapException(this, ex);<NEW_LINE>} catch (NullPointerException nullX) {<NEW_LINE>// No FFDC code needed; we might be closed.<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "executeUpdate", "Exception");<NEW_LINE>throw runtimeXIfNotClosed(nullX);<NEW_LINE>}<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "executeUpdate", numUpdates);<NEW_LINE>return numUpdates;<NEW_LINE>}
this, tc, "executeUpdate", ex);
819,197
public Asset Open(String path, AccessMode mode) {<NEW_LINE>CHECK(zip_handle_ != null);<NEW_LINE>String name = path;<NEW_LINE>ZipEntryRO entry;<NEW_LINE>entry = zipFileRO.findEntryByName(name);<NEW_LINE>// int result = FindEntry(zip_handle_.get(), name, &entry);<NEW_LINE>// if (result != 0) {<NEW_LINE>// LOG(ERROR) + "No entry '" + path + "' found in APK '" + path_ + "'";<NEW_LINE>// return {};<NEW_LINE>// }<NEW_LINE>if (entry == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (entry.entry.getMethod() == kCompressDeflated) {<NEW_LINE>// FileMap map = new FileMap();<NEW_LINE>// if (!map.create(path_, .GetFileDescriptor(zip_handle_), entry.offset,<NEW_LINE>// entry.getCompressedSize(), true /*readOnly*/)) {<NEW_LINE>// LOG(ERROR) + "Failed to mmap file '" + path + "' in APK '" + path_ + "'";<NEW_LINE>// return {};<NEW_LINE>// }<NEW_LINE>FileMap map = zipFileRO.createEntryFileMap(entry);<NEW_LINE>Asset asset = Asset.createFromCompressedMap(map, (int) entry.entry.getSize(), mode);<NEW_LINE>if (asset == null) {<NEW_LINE>System.err.println("Failed to decompress '" + path + "'.");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return asset;<NEW_LINE>} else {<NEW_LINE>FileMap <MASK><NEW_LINE>// if (!map.create(path_, .GetFileDescriptor(zip_handle_.get()), entry.offset,<NEW_LINE>// entry.uncompressed_length, true /*readOnly*/)) {<NEW_LINE>// System.err.println("Failed to mmap file '" + path + "' in APK '" + path_ + "'");<NEW_LINE>// return null;<NEW_LINE>// }<NEW_LINE>Asset asset = Asset.createFromUncompressedMap(map, mode);<NEW_LINE>if (asset == null) {<NEW_LINE>System.err.println("Failed to mmap file '" + path + "' in APK '" + path_ + "'");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return asset;<NEW_LINE>}<NEW_LINE>}
map = zipFileRO.createEntryFileMap(entry);
76,149
public List<AbstractRecord> parseRecordsSoftly(byte[] rawRecordData) {<NEW_LINE>List<AbstractRecord> records = new LinkedList<>();<NEW_LINE>int dataPointer = 0;<NEW_LINE>while (dataPointer != rawRecordData.length) {<NEW_LINE>try {<NEW_LINE>RecordParser parser = new RecordParser(dataPointer, rawRecordData, tlsContext.getChooser().getSelectedProtocolVersion());<NEW_LINE><MASK><NEW_LINE>records.add(record);<NEW_LINE>if (dataPointer == parser.getPointer()) {<NEW_LINE>throw new ParserException("Ran into infinite Loop while parsing Records");<NEW_LINE>}<NEW_LINE>dataPointer = parser.getPointer();<NEW_LINE>} catch (ParserException e) {<NEW_LINE>LOGGER.debug("Could not parse Record, parsing as Blob");<NEW_LINE>LOGGER.trace(e);<NEW_LINE>BlobRecordParser blobParser = new BlobRecordParser(dataPointer, rawRecordData, tlsContext.getChooser().getSelectedProtocolVersion());<NEW_LINE>AbstractRecord record = blobParser.parse();<NEW_LINE>records.add(record);<NEW_LINE>if (dataPointer == blobParser.getPointer()) {<NEW_LINE>throw new ParserException("Ran into infinite Loop while parsing BlobRecords");<NEW_LINE>}<NEW_LINE>dataPointer = blobParser.getPointer();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOGGER.debug("The protocol message(s) were collected from {} record(s). ", records.size());<NEW_LINE>return records;<NEW_LINE>}
Record record = parser.parse();
1,329,913
final GetDomainResult executeGetDomain(GetDomainRequest getDomainRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getDomainRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetDomainRequest> request = null;<NEW_LINE>Response<GetDomainResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetDomainRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getDomainRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Lightsail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDomain");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetDomainResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDomainResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,551,786
void populateCommonInterfaceProperties(InterfacesInterface vsIface, org.batfish.datamodel.Interface viIface) {<NEW_LINE>// addresses<NEW_LINE>if (!vsIface.getAddresses().isEmpty()) {<NEW_LINE>List<ConcreteInterfaceAddress> addresses = vsIface.getAddresses();<NEW_LINE>ImmutableList.Builder<ConcreteInterfaceAddress> ownedAddressesBuilder = ImmutableList.builder();<NEW_LINE>String vrf = firstNonNull(vsIface.getVrf(), DEFAULT_VRF_NAME);<NEW_LINE>for (ConcreteInterfaceAddress address : addresses) {<NEW_LINE>Prefix prefix = address.getPrefix();<NEW_LINE>if (ownedPrefixesByVrf().containsEntry(vrf, prefix)) {<NEW_LINE>viIface.setAdditionalArpIps(AclIpSpace.union(viIface.getAdditionalArpIps(), address.getIp().toIpSpace()));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ownedPrefixesByVrf().put(vrf, prefix);<NEW_LINE>ownedAddressesBuilder.add(address);<NEW_LINE>}<NEW_LINE>List<ConcreteInterfaceAddress> ownedAddresses = ownedAddressesBuilder.build();<NEW_LINE>if (!ownedAddresses.isEmpty()) {<NEW_LINE>viIface.setAddress(ownedAddresses.get(0));<NEW_LINE>viIface.setAllAddresses(ownedAddresses);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// description<NEW_LINE>viIface.setDescription(vsIface.getDescription());<NEW_LINE>// mtu<NEW_LINE>if (vsIface.getMtu() != null) {<NEW_LINE>viIface.setMtu(vsIface.getMtu());<NEW_LINE>}<NEW_LINE>// speed<NEW_LINE>if (vsIface.getLinkSpeed() != null) {<NEW_LINE>double speed <MASK><NEW_LINE>viIface.setSpeed(speed);<NEW_LINE>viIface.setBandwidth(speed);<NEW_LINE>}<NEW_LINE>}
= vsIface.getLinkSpeed() * SPEED_CONVERSION_FACTOR;
278,986
public com.amazonaws.services.simplesystemsmanagement.model.UnsupportedInventorySchemaVersionException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.simplesystemsmanagement.model.UnsupportedInventorySchemaVersionException unsupportedInventorySchemaVersionException = new com.amazonaws.services.simplesystemsmanagement.model.UnsupportedInventorySchemaVersionException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 unsupportedInventorySchemaVersionException;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
91,013
// Take a DNS queue + admin registrar id as input so that it can be called from the mapper as well<NEW_LINE>private static void softDeleteDomain(DomainBase domain, String registryAdminRegistrarId, DnsQueue localDnsQueue) {<NEW_LINE>DomainBase deletedDomain = domain.asBuilder().setDeletionTime(tm().getTransactionTime()).<MASK><NEW_LINE>DomainHistory historyEntry = new DomainHistory.Builder().setDomain(domain).setType(DOMAIN_DELETE).setModificationTime(tm().getTransactionTime()).setBySuperuser(true).setReason("Deletion of prober data").setRegistrarId(registryAdminRegistrarId).build();<NEW_LINE>// Note that we don't bother handling grace periods, billing events, pending transfers, poll<NEW_LINE>// messages, or auto-renews because those will all be hard-deleted the next time the job runs<NEW_LINE>// anyway.<NEW_LINE>tm().putAllWithoutBackup(ImmutableList.of(deletedDomain, historyEntry));<NEW_LINE>// updating foreign keys is a no-op in SQL<NEW_LINE>updateForeignKeyIndexDeletionTime(deletedDomain);<NEW_LINE>localDnsQueue.addDomainRefreshTask(deletedDomain.getDomainName());<NEW_LINE>}
setStatusValues(null).build();
1,066,043
private TreeMap<Long, Double> metricDivide(NavigableMap<Long, Double> metricsNum, NavigableMap<Long, Double> metricsDenom) {<NEW_LINE>TreeMap<Long, Double> <MASK><NEW_LINE>for (Entry<Long, Double> entry : metricsNum.entrySet()) {<NEW_LINE>Entry<Long, Double> entry2 = metricsDenom.floorEntry(entry.getKey());<NEW_LINE>if (entry2 != null && Math.abs(entry.getKey() - entry2.getKey()) < TIMESTAMP_RANGE_SECS) {<NEW_LINE>Double val = entry.getValue() / entry2.getValue();<NEW_LINE>// Due to the metrics being written and read into/from a user table, we get<NEW_LINE>// some rpcs when no workload is running. This causes the latency<NEW_LINE>// graph to be jittery. The following code can be uncommented if we want<NEW_LINE>// to get rid of the jitters/mark the values only when the RPC count is<NEW_LINE>// significant.<NEW_LINE>timeToVal.put(entry2.getKey(), val);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return timeToVal;<NEW_LINE>}
timeToVal = new TreeMap<>();
1,344,312
private void onIntentProcessed() {<NEW_LINE>List<ShareInfo> infos = filePreparedInfos;<NEW_LINE>if (getIntent() != null && getIntent().getAction() != ACTION_PROCESSED) {<NEW_LINE>getIntent().setAction(ACTION_PROCESSED);<NEW_LINE>}<NEW_LINE>if (statusDialog != null) {<NEW_LINE>try {<NEW_LINE>statusDialog.dismiss();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logDebug("intent processed!");<NEW_LINE>if (folderSelected) {<NEW_LINE>if (infos == null) {<NEW_LINE>showSnackbar(getString(R.string.upload_can_not_open));<NEW_LINE>} else {<NEW_LINE>if (app.getStorageState() == STORAGE_STATE_PAYWALL) {<NEW_LINE>showOverDiskQuotaPaywallWarning();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long parentHandle;<NEW_LINE>if (cDriveExplorer != null) {<NEW_LINE>parentHandle = cDriveExplorer.getParentHandle();<NEW_LINE>} else {<NEW_LINE>parentHandle = parentHandleCloud;<NEW_LINE>}<NEW_LINE>MegaNode parentNode = megaApi.getNodeByHandle(parentHandle);<NEW_LINE>if (parentNode == null) {<NEW_LINE>parentNode = megaApi.getRootNode();<NEW_LINE>}<NEW_LINE>backToCloud(parentNode.getHandle(), infos.size());<NEW_LINE>for (ShareInfo info : infos) {<NEW_LINE>Intent intent = new Intent(this, UploadService.class);<NEW_LINE>intent.putExtra(UploadService.EXTRA_FILEPATH, info.getFileAbsolutePath());<NEW_LINE>intent.putExtra(UploadService.EXTRA_NAME, info.getTitle());<NEW_LINE>if (nameFiles != null && nameFiles.get(info.getTitle()) != null && !nameFiles.get(info.getTitle()).equals(info.getTitle())) {<NEW_LINE>intent.putExtra(UploadService.EXTRA_NAME_EDITED, nameFiles.get(info.getTitle()));<NEW_LINE>}<NEW_LINE>intent.putExtra(UploadService.EXTRA_PARENT_HASH, parentNode.getHandle());<NEW_LINE>intent.putExtra(UploadService.<MASK><NEW_LINE>startService(intent);<NEW_LINE>}<NEW_LINE>filePreparedInfos = null;<NEW_LINE>logDebug("finish!!!");<NEW_LINE>finishActivity();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
EXTRA_SIZE, info.getSize());
1,029,653
private void initMethods() {<NEW_LINE>Method[] methodsToExport <MASK><NEW_LINE>for (Method method : methodsToExport) {<NEW_LINE>method.setAccessible(true);<NEW_LINE>MethodDescriptor methodDescriptor = new ReflectionMethodDescriptor(method);<NEW_LINE>List<MethodDescriptor> methodModels = methods.computeIfAbsent(method.getName(), (k) -> new ArrayList<>(1));<NEW_LINE>methodModels.add(methodDescriptor);<NEW_LINE>}<NEW_LINE>methods.forEach((methodName, methodList) -> {<NEW_LINE>Map<String, MethodDescriptor> descMap = descToMethods.computeIfAbsent(methodName, k -> new HashMap<>());<NEW_LINE>methodList.forEach(methodModel -> descMap.put(methodModel.getParamDesc(), methodModel));<NEW_LINE>// Map<Class<?>[], MethodModel> typesMap = typeToMethods.computeIfAbsent(methodName, k -> new HashMap<>());<NEW_LINE>// methodList.forEach(methodModel -> typesMap.put(methodModel.getParameterClasses(), methodModel));<NEW_LINE>});<NEW_LINE>}
= this.serviceInterfaceClass.getMethods();
1,341,431
public void handle(AnnotationValues<NonNull> annotation, JCAnnotation ast, JavacNode annotationNode) {<NEW_LINE>handleFlagUsage(annotationNode, ConfigurationKeys.NON_NULL_FLAG_USAGE, "@NonNull");<NEW_LINE>if (annotationNode.up().getKind() == Kind.FIELD) {<NEW_LINE>// This is meaningless unless the field is used to generate a method (@Setter, @RequiredArgsConstructor, etc),<NEW_LINE>// but in that case those handlers will take care of it. However, we DO check if the annotation is applied to<NEW_LINE>// a primitive, because those handlers trigger on any annotation named @NonNull and we only want the warning<NEW_LINE>// behaviour on _OUR_ 'lombok.NonNull'.<NEW_LINE>try {<NEW_LINE>if (isPrimitive(((JCVariableDecl) annotationNode.up().get()).vartype)) {<NEW_LINE>annotationNode.addWarning("@NonNull is meaningless on a primitive.");<NEW_LINE>}<NEW_LINE>} catch (Exception ignore) {<NEW_LINE>}<NEW_LINE>JCVariableDecl fDecl = (JCVariableDecl) annotationNode.up().get();<NEW_LINE>if ((fDecl.mods.flags & RECORD) != 0) {<NEW_LINE>// well, these kinda double as parameters (of the compact constructor), so we do some work here.<NEW_LINE>List<JCMethodDecl> compactConstructors = addCompactConstructorIfNeeded(annotationNode.up(<MASK><NEW_LINE>for (JCMethodDecl ctr : compactConstructors) {<NEW_LINE>addNullCheckIfNeeded(ctr, annotationNode.up(), annotationNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JCMethodDecl declaration;<NEW_LINE>JavacNode paramNode;<NEW_LINE>switch(annotationNode.up().getKind()) {<NEW_LINE>case ARGUMENT:<NEW_LINE>paramNode = annotationNode.up();<NEW_LINE>break;<NEW_LINE>case TYPE_USE:<NEW_LINE>JavacNode typeNode = annotationNode.directUp();<NEW_LINE>paramNode = typeNode.directUp();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (paramNode.getKind() != Kind.ARGUMENT)<NEW_LINE>return;<NEW_LINE>try {<NEW_LINE>declaration = (JCMethodDecl) paramNode.up().get();<NEW_LINE>} catch (Exception e) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (declaration.body == null) {<NEW_LINE>// This used to be a warning, but as @NonNull also has a documentary purpose, better to not warn about this. Since 1.16.7<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if ((declaration.mods.flags & (GENERATED_MEMBER | COMPACT_RECORD_CONSTRUCTOR)) != 0) {<NEW_LINE>// The 'real' annotations are on the `record Foo(@NonNull Obj x)` part and we just see these<NEW_LINE>// syntax-sugared over. We deal with it on the field declaration variant, as those are always there,<NEW_LINE>// not dependent on whether you write out the compact constructor or not.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>addNullCheckIfNeeded(declaration, paramNode, annotationNode);<NEW_LINE>}
).up(), annotationNode);
960,329
public static <T> PersistentResource<T> createObject(PersistentResource<?> parent, String parentRelationship, Type<T> entityClass, RequestScope requestScope, Optional<String> uuid) {<NEW_LINE>T obj = requestScope.getTransaction().createNewObject(entityClass, requestScope);<NEW_LINE>String id = uuid.orElse(null);<NEW_LINE>PersistentResource<T> newResource = new PersistentResource<>(obj, parent, parentRelationship, id, requestScope);<NEW_LINE>// The ID must be assigned before we add it to the new resources set. Persistent resource<NEW_LINE>// hashcode and equals are only based on the ID/UUID & type.<NEW_LINE>assignId(newResource, id);<NEW_LINE>// Keep track of new resources for non-transferable resources<NEW_LINE>requestScope.getNewPersistentResources().add(newResource);<NEW_LINE>checkPermission(CreatePermission.class, newResource);<NEW_LINE>newResource.auditClass(Audit.Action.CREATE, new ChangeSpec(newResource, null, null<MASK><NEW_LINE>requestScope.publishLifecycleEvent(newResource, CREATE);<NEW_LINE>requestScope.setUUIDForObject(newResource.type, id, newResource.getObject());<NEW_LINE>// Initialize null ToMany collections<NEW_LINE>requestScope.getDictionary().getRelationships(entityClass).stream().filter(relationName -> newResource.getRelationshipType(relationName).isToMany() && newResource.getValueUnchecked(relationName) == null).forEach(relationName -> newResource.setValue(relationName, new LinkedHashSet<>()));<NEW_LINE>newResource.markDirty();<NEW_LINE>return newResource;<NEW_LINE>}
, newResource.getObject()));
416,351
private TypeProto generateTypeProto(Color color) {<NEW_LINE>final TypeProto.<MASK><NEW_LINE>if (color.isUnion()) {<NEW_LINE>typeProtoBuilder.getUnionBuilder().addAllUnionMember(addColors(color.getUnionElements()));<NEW_LINE>} else {<NEW_LINE>final ObjectTypeProto.Builder objectTypeProtoBuilder = typeProtoBuilder.getObjectBuilder();<NEW_LINE>objectTypeProtoBuilder.setIsInvalidating(color.isInvalidating()).setUuid(color.getId().asByteString()).setPropertiesKeepOriginalName(color.getPropertiesKeepOriginalName()).addAllInstanceType(addColors(color.getInstanceColors())).addAllPrototype(addColors(color.getPrototypes())).setMarkedConstructor(color.isConstructor()).addAllOwnProperty(getOwnPropertyStringPoolOffsets(color)).setClosureAssert(color.isClosureAssert());<NEW_LINE>if (serializationMode != SerializationOptions.SKIP_DEBUG_INFO) {<NEW_LINE>final String compositeTypename = color.getDebugInfo().getCompositeTypename();<NEW_LINE>if (!compositeTypename.isEmpty()) {<NEW_LINE>// Color objects always have a DebugInfo field, but it will have an empty type<NEW_LINE>// name when we don't actually have a type name to store.<NEW_LINE>objectTypeProtoBuilder.getDebugInfoBuilder().addTypename(compositeTypename);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return typeProtoBuilder.build();<NEW_LINE>}
Builder typeProtoBuilder = TypeProto.newBuilder();
641,805
public static void changeTableMeta(Connection metaDbConnection, String schemaName, String logicalTableName, String dbIndex, String phyTableName, List<String> addedColumns, List<String> droppedColumns) {<NEW_LINE>TableInfoManager.PhyInfoSchemaContext phyInfoSchemaContext = CommonMetaChanger.getPhyInfoSchemaContext(<MASK><NEW_LINE>TableInfoManager tableInfoManager = new TableInfoManager();<NEW_LINE>tableInfoManager.setConnection(metaDbConnection);<NEW_LINE>Map<String, Map<String, Object>> columnJdbcExtInfo = tableInfoManager.fetchColumnJdbcExtInfo(phyInfoSchemaContext.phyTableSchema, phyInfoSchemaContext.phyTableName, phyInfoSchemaContext.dataSource);<NEW_LINE>// Remove dropped column meta if exist.<NEW_LINE>if (GeneralUtil.isNotEmpty(droppedColumns)) {<NEW_LINE>tableInfoManager.removeColumns(schemaName, logicalTableName, droppedColumns);<NEW_LINE>}<NEW_LINE>// Add new column meta if exist.<NEW_LINE>if (GeneralUtil.isNotEmpty(addedColumns)) {<NEW_LINE>tableInfoManager.addColumns(phyInfoSchemaContext, columnJdbcExtInfo, addedColumns);<NEW_LINE>}<NEW_LINE>tableInfoManager.showTable(schemaName, logicalTableName, phyInfoSchemaContext.sequenceRecord);<NEW_LINE>}
schemaName, logicalTableName, dbIndex, phyTableName);
1,706,133
private void addGroupUser(Group group, String userId, List<String> sourceIds) {<NEW_LINE>String id = group.getId();<NEW_LINE>String type = group.getType();<NEW_LINE>if (StringUtils.equals(type, UserGroupType.SYSTEM)) {<NEW_LINE>UserGroup userGroup = new UserGroup();<NEW_LINE>userGroup.setId(UUID.randomUUID().toString());<NEW_LINE>userGroup.setUserId(userId);<NEW_LINE>userGroup.setGroupId(id);<NEW_LINE>userGroup.setSourceId("system");<NEW_LINE>userGroup.setCreateTime(System.currentTimeMillis());<NEW_LINE>userGroup.<MASK><NEW_LINE>userGroupMapper.insertSelective(userGroup);<NEW_LINE>} else {<NEW_LINE>SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH);<NEW_LINE>UserGroupMapper mapper = sqlSession.getMapper(UserGroupMapper.class);<NEW_LINE>for (String sourceId : sourceIds) {<NEW_LINE>UserGroup userGroup = new UserGroup();<NEW_LINE>userGroup.setId(UUID.randomUUID().toString());<NEW_LINE>userGroup.setUserId(userId);<NEW_LINE>userGroup.setGroupId(id);<NEW_LINE>userGroup.setSourceId(sourceId);<NEW_LINE>userGroup.setCreateTime(System.currentTimeMillis());<NEW_LINE>userGroup.setUpdateTime(System.currentTimeMillis());<NEW_LINE>mapper.insertSelective(userGroup);<NEW_LINE>}<NEW_LINE>sqlSession.flushStatements();<NEW_LINE>if (sqlSession != null && sqlSessionFactory != null) {<NEW_LINE>SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
setUpdateTime(System.currentTimeMillis());
890,272
public boolean onNodeChildren(FactoryBuilderSupport builder, Object node, Closure content) {<NEW_LINE>Xpp3Dom dom = (Xpp3Dom) node;<NEW_LINE>NodeBuilder nodes = new NodeBuilder() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void setClosureDelegate(final Closure c, final Object o) {<NEW_LINE>c.setDelegate(this);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void setProperty(final String name, final Object value) {<NEW_LINE>this.invokeMethod(name, value);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>content.setDelegate(nodes);<NEW_LINE>content.setResolveStrategy(Closure.DELEGATE_FIRST);<NEW_LINE>Node root = (Node) nodes.invokeMethod(getName(), content);<NEW_LINE>for (Node child : (List<Node>) root.children()) {<NEW_LINE>dom.addChild(nodeToXpp3(child));<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
c.setResolveStrategy(Closure.DELEGATE_FIRST);
899,410
private Object decodeNtcb(Channel channel, SocketAddress remoteAddress, ByteBuf buf) {<NEW_LINE>prefix = buf.toString(buf.readerIndex(), 4, StandardCharsets.US_ASCII);<NEW_LINE>// prefix @NTC by default<NEW_LINE>buf.skipBytes(prefix.length());<NEW_LINE>serverId = buf.readUnsignedIntLE();<NEW_LINE>deviceUniqueId = buf.readUnsignedIntLE();<NEW_LINE>int length = buf.readUnsignedShortLE();<NEW_LINE>// header and data XOR checksum<NEW_LINE>buf.skipBytes(2);<NEW_LINE>if (length == 0) {<NEW_LINE>// keep alive message<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String type = buf.toString(buf.readerIndex(), 3, StandardCharsets.US_ASCII);<NEW_LINE>buf.skipBytes(type.length());<NEW_LINE>if (type.equals("*>S")) {<NEW_LINE>return processHandshake(channel, remoteAddress, buf);<NEW_LINE>} else {<NEW_LINE>DeviceSession <MASK><NEW_LINE>if (deviceSession != null) {<NEW_LINE>switch(type) {<NEW_LINE>case "*>A":<NEW_LINE>return processNtcbArray(deviceSession, channel, buf);<NEW_LINE>case "*>T":<NEW_LINE>return processNtcbSingle(deviceSession, channel, buf);<NEW_LINE>case "*>F":<NEW_LINE>buf.skipBytes(3);<NEW_LINE>return processFlexNegotiation(channel, buf);<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
deviceSession = getDeviceSession(channel, remoteAddress);
901,381
private void doOperation(final SplitStoreFromIterable<String> operation, final AccumuloStore store) throws OperationException {<NEW_LINE>if (null == operation.getInput()) {<NEW_LINE>throw new OperationException("Operation input is required.");<NEW_LINE>}<NEW_LINE>final SortedSet<Text> splits = new TreeSet<>();<NEW_LINE>for (final String split : operation.getInput()) {<NEW_LINE>splits.add(new Text(Base64.decodeBase64(split)));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>store.getConnection().tableOperations().addSplits(store.getTableName(), splits);<NEW_LINE>LOGGER.info("Added {} splits to table {}", splits.size(<MASK><NEW_LINE>} catch (final TableNotFoundException | AccumuloException | AccumuloSecurityException | StoreException e) {<NEW_LINE>LOGGER.error("Failed to add {} split points to table {}", splits.size(), store.getTableName());<NEW_LINE>throw new RuntimeException("Failed to add split points: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
), store.getTableName());
1,357,340
public static BaseRippleDrawable bindView(final View view, AttributeSet attrs, int defStyleAttr, int defStyleRes) {<NEW_LINE>final BaseRippleDrawable drawable;<NEW_LINE>if (attrs == null && defStyleAttr == 0 && defStyleRes == 0) {<NEW_LINE>drawable = initRippleDrawable(view);<NEW_LINE>} else {<NEW_LINE>drawable = new BaseRippleDrawable(view.getContext(), attrs, defStyleAttr, defStyleRes);<NEW_LINE>}<NEW_LINE>view.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onPreDraw() {<NEW_LINE>view.getViewTreeObserver().removeOnPreDrawListener(this);<NEW_LINE>drawable.setMaxRidiusByView(view);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>drawable.viewRef = <MASK><NEW_LINE>view.setClickable(true);<NEW_LINE>return drawable;<NEW_LINE>}
new WeakReference<View>(view);
976,543
private void initRowPredict() {<NEW_LINE>final TableSchema dataSchema = getDataSchema();<NEW_LINE>final TableSchema modelSchema = getModelSchema();<NEW_LINE>String[] categoricalColNames = null;<NEW_LINE>if (treeModel.meta.contains(HasCategoricalCols.CATEGORICAL_COLS)) {<NEW_LINE>categoricalColNames = treeModel.meta.get(HasCategoricalCols.CATEGORICAL_COLS);<NEW_LINE>}<NEW_LINE>if (treeModel.stringIndexerModelSerialized != null) {<NEW_LINE>final Params stringIndexerModelPredictorParams = new Params().set(HasSelectedCols.SELECTED_COLS, categoricalColNames).set(MultiStringIndexerPredictParams.HANDLE_INVALID, HasHandleInvalid.HandleInvalid.SKIP);<NEW_LINE>stringIndexerModelPredictor = new MultiStringIndexerModelMapper(modelSchema, dataSchema, stringIndexerModelPredictorParams);<NEW_LINE>stringIndexerModelPredictor.loadModel(treeModel.stringIndexerModelSerialized);<NEW_LINE>stringIndexerModelPredictorInputIndex = TableUtil.findColIndicesWithAssertAndHint(dataSchema, stringIndexerModelPredictorParams.get(HasSelectedCols.SELECTED_COLS));<NEW_LINE>stringIndexerModelPredictorOutputIndex = TableUtil.findColIndicesWithAssertAndHint(dataSchema, stringIndexerModelPredictor.getResultCols());<NEW_LINE>final Params stringIndexerModelNumericalTypeCastMapperParams = new Params().set(NumericalTypeCastParams.SELECTED_COLS, categoricalColNames).set(NumericalTypeCastParams.TARGET_TYPE, NumericalTypeCastParams.TargetType.valueOf("INT"));<NEW_LINE>stringIndexerModelNumericalTypeCastMapper = new NumericalTypeCastMapper(getDataSchema(), stringIndexerModelNumericalTypeCastMapperParams);<NEW_LINE>stringIndexerModelNumericalTypeCastMapperInputIndex = TableUtil.findColIndicesWithAssertAndHint(dataSchema, stringIndexerModelNumericalTypeCastMapperParams.get(NumericalTypeCastParams.SELECTED_COLS));<NEW_LINE>stringIndexerModelNumericalTypeCastMapperOutputIndex = TableUtil.findColIndicesWithAssertAndHint(dataSchema, stringIndexerModelNumericalTypeCastMapper.getResultCols());<NEW_LINE>}<NEW_LINE>final Params numericalTypeCastMapperParams = new Params().set(NumericalTypeCastParams.SELECTED_COLS, ArrayUtils.removeElements(treeModel.meta.get(HasFeatureCols.FEATURE_COLS), categoricalColNames)).set(NumericalTypeCastParams.TARGET_TYPE, NumericalTypeCastParams.TargetType.valueOf("DOUBLE"));<NEW_LINE>numericalTypeCastMapper = new NumericalTypeCastMapper(dataSchema, numericalTypeCastMapperParams);<NEW_LINE>numericalTypeCastMapperInputIndex = TableUtil.findColIndicesWithAssertAndHint(dataSchema, numericalTypeCastMapperParams.get(NumericalTypeCastParams.SELECTED_COLS));<NEW_LINE>numericalTypeCastMapperOutputIndex = TableUtil.findColIndicesWithAssertAndHint(dataSchema, numericalTypeCastMapper.getResultCols());<NEW_LINE><MASK><NEW_LINE>}
initFeatureIndices(treeModel.meta, dataSchema);
1,256,791
public void read(org.apache.thrift.protocol.TProtocol prot, checkTableClass_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet incoming = iprot.readBitSet(5);<NEW_LINE>if (incoming.get(0)) {<NEW_LINE>struct.tinfo = new org.apache.accumulo.core.trace.thrift.TInfo();<NEW_LINE>struct.tinfo.read(iprot);<NEW_LINE>struct.setTinfoIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(1)) {<NEW_LINE>struct.credentials = new org.apache.accumulo.core.securityImpl.thrift.TCredentials();<NEW_LINE>struct.credentials.read(iprot);<NEW_LINE>struct.setCredentialsIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(2)) {<NEW_LINE>struct.tableId = iprot.readString();<NEW_LINE>struct.setTableIdIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(3)) {<NEW_LINE>struct<MASK><NEW_LINE>struct.setClassNameIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(4)) {<NEW_LINE>struct.interfaceMatch = iprot.readString();<NEW_LINE>struct.setInterfaceMatchIsSet(true);<NEW_LINE>}<NEW_LINE>}
.className = iprot.readString();
1,357,178
public void respondWithError(final ErrorInformation errorInformation, final Flag... flags) throws IOException, ServletException, PwmUnrecoverableException {<NEW_LINE>LOGGER.error(pwmRequest.getLabel(), errorInformation);<NEW_LINE>pwmRequest.setAttribute(PwmRequestAttribute.PwmErrorInfo, errorInformation);<NEW_LINE>if (JavaHelper.enumArrayContainsValue(flags, Flag.ForceLogout)) {<NEW_LINE>LOGGER.debug(pwmRequest, () -> <MASK><NEW_LINE>pwmRequest.getPwmSession().unauthenticateUser(pwmRequest);<NEW_LINE>}<NEW_LINE>if (getResponseFlags().contains(PwmResponseFlag.ERROR_RESPONSE_SENT)) {<NEW_LINE>LOGGER.debug(pwmRequest, () -> "response error has been previously set, disregarding new error: " + errorInformation.toDebugStr());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (isCommitted()) {<NEW_LINE>final String msg = "cannot respond with error '" + errorInformation.toDebugStr() + "', response is already committed";<NEW_LINE>LOGGER.warn(pwmRequest.getLabel(), () -> ExceptionUtils.getStackTrace(new Throwable(msg)));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (pwmRequest.isJsonRequest()) {<NEW_LINE>outputJsonResult(RestResultBean.fromError(errorInformation, pwmRequest));<NEW_LINE>} else if (pwmRequest.isHtmlRequest()) {<NEW_LINE>try {<NEW_LINE>forwardToJsp(JspUrl.ERROR);<NEW_LINE>} catch (final PwmUnrecoverableException e) {<NEW_LINE>LOGGER.error(() -> "unexpected error sending user to error page: " + e.toString());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final boolean showDetail = pwmRequest.getPwmDomain().determineIfDetailErrorMsgShown();<NEW_LINE>final String errorStatusText = showDetail ? errorInformation.toDebugStr() : errorInformation.toUserStr(pwmRequest.getPwmSession(), pwmRequest.getDomainConfig());<NEW_LINE>getHttpServletResponse().sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, errorStatusText);<NEW_LINE>}<NEW_LINE>setResponseFlag(PwmResponseFlag.ERROR_RESPONSE_SENT);<NEW_LINE>}
"forcing logout due to error " + errorInformation.toDebugStr());
920,022
final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(tagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TagResourceRequest> request = null;<NEW_LINE>Response<TagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(tagResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "ECR");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TagResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
366,874
final CancelJobExecutionResult executeCancelJobExecution(CancelJobExecutionRequest cancelJobExecutionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(cancelJobExecutionRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CancelJobExecutionRequest> request = null;<NEW_LINE>Response<CancelJobExecutionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CancelJobExecutionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(cancelJobExecutionRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CancelJobExecution");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CancelJobExecutionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CancelJobExecutionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,626,192
public ImmutableSortedMap<K, V> buildOrThrow() {<NEW_LINE>switch(size) {<NEW_LINE>case 0:<NEW_LINE>return emptyMap(comparator);<NEW_LINE>case 1:<NEW_LINE>// requireNonNull is safe because the first `size` elements have been filled in.<NEW_LINE>return of(comparator, (K) requireNonNull(keys[0]), (V) requireNonNull(values[0]));<NEW_LINE>default:<NEW_LINE>Object[] sortedKeys = Arrays.copyOf(keys, size);<NEW_LINE>Arrays.sort((K[]) sortedKeys, comparator);<NEW_LINE>Object[] sortedValues = new Object[size];<NEW_LINE>// We might, somehow, be able to reorder values in-place. But it doesn't seem like<NEW_LINE>// there's a way around creating the separate sortedKeys array, and if we're allocating<NEW_LINE>// one array of size n, we might as well allocate two -- to say nothing of the allocation<NEW_LINE>// done in Arrays.sort.<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>if (i > 0 && comparator.compare((K) sortedKeys[i - 1], (K) sortedKeys[i]) == 0) {<NEW_LINE>throw new IllegalArgumentException("keys required to be distinct but compared as equal: " + sortedKeys[i - 1] + " and " + sortedKeys[i]);<NEW_LINE>}<NEW_LINE>// requireNonNull is safe because the first `size` elements have been filled in.<NEW_LINE>int index = Arrays.binarySearch((K[]) sortedKeys, (K) requireNonNull(keys[i]), comparator);<NEW_LINE>sortedValues[index] = requireNonNull(values[i]);<NEW_LINE>}<NEW_LINE>return new ImmutableSortedMap<K, V>(new RegularImmutableSortedSet<K>(ImmutableList.<K>asImmutableList(sortedKeys), comparator), ImmutableList.<MASK><NEW_LINE>}<NEW_LINE>}
<V>asImmutableList(sortedValues));
678,026
private Map<String, Map<String, Long>> buildGroupNeedAdjustDomains(Map<String, Map<Server, Long>> gaps, Map<String, Map<String, Machine>> statistics) {<NEW_LINE>Map<String, Map<String, Long>> results = new HashMap<String, Map<String, Long>>();<NEW_LINE>Map<String, Map<String, Long>> datas = new HashMap<String, Map<String, Long>>();<NEW_LINE>for (Entry<String, Map<Server, Long>> entry : gaps.entrySet()) {<NEW_LINE>String group = entry.getKey();<NEW_LINE>Map<String, Long> domains = buildNeedAdjustDomains(group, statistics.get(group), entry.getValue());<NEW_LINE>datas.put(group, domains);<NEW_LINE>}<NEW_LINE>for (Entry<String, Map<String, Long>> data : datas.entrySet()) {<NEW_LINE>String group = data.getKey();<NEW_LINE>Map<String, Long> ds = SortHelper.sortMap(data.getValue(), new Comparator<Entry<String, Long>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(Entry<String, Long> o1, Entry<String, Long> o2) {<NEW_LINE>if (o2.getValue() > o1.getValue()) {<NEW_LINE>return 1;<NEW_LINE>} else if (o2.getValue() < o1.getValue()) {<NEW_LINE>return -1;<NEW_LINE>} else {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>}
results.put(group, ds);
607,007
private void addFixedRecipe(int index, PositionedItemStack[] recipe) {<NEW_LINE>int height = 0;<NEW_LINE>for (PositionedItemStack stack : recipe) if (stack.y > height)<NEW_LINE>height = stack.y;<NEW_LINE>height += 18;<NEW_LINE>if (this.heightPixels[index] < height) {<NEW_LINE>int offset = (height - heightPixels[index]) / 2;<NEW_LINE>this.heightPixels[index] = height;<NEW_LINE>for (int prevId = 0; prevId <= index; ++prevId) for (PositionedItemStack[] oldStacks : recipeLayout[prevId]) for (PositionedItemStack oldStack : oldStacks) oldStack.y += offset;<NEW_LINE>} else {<NEW_LINE>int offset = (heightPixels[index] - height) / 2;<NEW_LINE>for (PositionedItemStack stack : recipe) stack.y += offset;<NEW_LINE>}<NEW_LINE>recipeLayout<MASK><NEW_LINE>}
[index].add(recipe);
793,840
public void evaluateInstanceList(TransducerTrainer trainer, InstanceList instances, String description) {<NEW_LINE>@Var<NEW_LINE>int numCorrectTokens;<NEW_LINE>@Var<NEW_LINE>int totalTokens;<NEW_LINE>Transducer transducer = trainer.getTransducer();<NEW_LINE>totalTokens = numCorrectTokens = 0;<NEW_LINE>for (int i = 0; i < instances.size(); i++) {<NEW_LINE>Instance instance = instances.get(i);<NEW_LINE>Sequence input = (Sequence) instance.getData();<NEW_LINE>Sequence trueOutput = (Sequence) instance.getTarget();<NEW_LINE>assert (input.size() == trueOutput.size());<NEW_LINE>// System.err.println ("TokenAccuracyEvaluator "+i+" length="+input.size());<NEW_LINE>Sequence predOutput = transducer.transduce(input);<NEW_LINE>assert (predOutput.size() == trueOutput.size());<NEW_LINE>for (int j = 0; j < trueOutput.size(); j++) {<NEW_LINE>totalTokens++;<NEW_LINE>if (trueOutput.get(j).equals(predOutput.get(j)))<NEW_LINE>numCorrectTokens++;<NEW_LINE>}<NEW_LINE>// System.err.println ("TokenAccuracyEvaluator "+i+" numCorrectTokens="+numCorrectTokens+" totalTokens="+totalTokens+" accuracy="+((double)numCorrectTokens)/totalTokens);<NEW_LINE>}<NEW_LINE>double acc = <MASK><NEW_LINE>// System.err.println ("TokenAccuracyEvaluator accuracy="+acc);<NEW_LINE>accuracy.put(description, acc);<NEW_LINE>logger.info(description + " accuracy=" + acc);<NEW_LINE>}
((double) numCorrectTokens) / totalTokens;
908,996
public static RubyDateTime to_datetime(ThreadContext context, IRubyObject self) {<NEW_LINE><MASK><NEW_LINE>DateTime dt = ((RubyTime) self).getDateTime();<NEW_LINE>long subMillisNum = 0, subMillisDen = 1;<NEW_LINE>if (time.getNSec() != 0) {<NEW_LINE>IRubyObject subMillis = RubyRational.newRationalCanonicalize(context, time.getNSec(), 1_000_000);<NEW_LINE>if (subMillis instanceof RubyRational) {<NEW_LINE>subMillisNum = ((RubyRational) subMillis).getNumerator().getLongValue();<NEW_LINE>subMillisDen = ((RubyRational) subMillis).getDenominator().getLongValue();<NEW_LINE>} else {<NEW_LINE>subMillisNum = ((RubyInteger) subMillis).getLongValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final int off = dt.getZone().getOffset(dt.getMillis()) / 1000;<NEW_LINE>// JODA's Julian chronology (no year 0)<NEW_LINE>int year = dt.getYear();<NEW_LINE>// JODA's Julian chronology (no year 0)<NEW_LINE>if (year <= 0)<NEW_LINE>year--;<NEW_LINE>if (year == 1582) {<NEW_LINE>// take the "slow" path - JODA isn't adjusting for missing (reform) dates<NEW_LINE>return calcAjdFromCivil(context, dt, off, subMillisNum, subMillisDen);<NEW_LINE>}<NEW_LINE>dt = new DateTime(year, dt.getMonthOfYear(), dt.getDayOfMonth(), dt.getHourOfDay(), dt.getMinuteOfHour(), dt.getSecondOfMinute(), dt.getMillisOfSecond(), getChronology(context, ITALY, dt.getZone()));<NEW_LINE>return new RubyDateTime(context.runtime, getDateTime(context.runtime), dt, off, ITALY, subMillisNum, subMillisDen);<NEW_LINE>}
final RubyTime time = (RubyTime) self;
1,599,278
Object py_dl_open(VirtualFrame frame, String name_str, int m, @Cached PyObjectHashNode hashNode, @Cached AuditNode auditNode) {<NEW_LINE>int mode = m != Integer.MIN_VALUE ? m : RTLD_LOCAL.getValueIfDefined();<NEW_LINE>mode |= RTLD_NOW.getValueIfDefined();<NEW_LINE>auditNode.audit("ctypes.dlopen", name_str);<NEW_LINE>CtypesThreadState ctypes = CtypesThreadState.get(getContext(), getLanguage());<NEW_LINE>DLHandler handle;<NEW_LINE>Exception exception = null;<NEW_LINE>try {<NEW_LINE>if (PString.endsWith(name_str, getContext().getSoAbi())) {<NEW_LINE>Object handler = loadLLVMLibrary(getContext(), name_str);<NEW_LINE>long adr = hashNode.execute(frame, handler);<NEW_LINE>handle = new DLHandler(handler, adr, name_str, true);<NEW_LINE>registerAddress(getContext(), handle.adr, handle);<NEW_LINE>return factory().createNativeVoidPtr(handle);<NEW_LINE>} else {<NEW_LINE>if (!PString.equals(name_str, MACOS_Security_LIB) && !PString.equals(name_str, MACOS_CoreFoundation_LIB)) {<NEW_LINE>handle = loadNFILibrary(getContext(), ctypes.backendType, name_str, mode);<NEW_LINE>registerAddress(getContext(), handle.adr, handle);<NEW_LINE>return factory().createNativeVoidPtr(handle, handle.adr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>exception = e;<NEW_LINE>}<NEW_LINE>throw raise<MASK><NEW_LINE>}
(OSError, getErrMsg(exception));
1,063,388
final GetFileUploadURLResult executeGetFileUploadURL(GetFileUploadURLRequest getFileUploadURLRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getFileUploadURLRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<GetFileUploadURLRequest> request = null;<NEW_LINE>Response<GetFileUploadURLResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetFileUploadURLRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getFileUploadURLRequest));<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, "MTurk");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetFileUploadURL");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetFileUploadURLResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetFileUploadURLResultJsonUnmarshaller());<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);
558,394
@Consumes(MediaType.APPLICATION_JSON)<NEW_LINE>@Produces(MediaType.APPLICATION_JSON)<NEW_LINE>@ApiOperation(value = "Removes the username from the specified team.", response = UserPrincipal.class)<NEW_LINE>@ApiResponses(value = { @ApiResponse(code = 304, message = "The user was not a member of the specified team"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 404, message = "The user or team could not be found") })<NEW_LINE>@PermissionRequired(Permissions.Constants.ACCESS_MANAGEMENT)<NEW_LINE>public Response removeTeamFromUser(@ApiParam(value = "A valid username", required = true) @PathParam("username") String username, @ApiParam(value = "The UUID of the team to un-associate username from", required = true) IdentifiableObject identifiableObject) {<NEW_LINE>try (QueryManager qm = new QueryManager()) {<NEW_LINE>final Team team = qm.getObjectByUuid(Team.class, identifiableObject.getUuid());<NEW_LINE>if (team == null) {<NEW_LINE>return Response.status(Response.Status.NOT_FOUND).entity("The team could not be found.").build();<NEW_LINE>}<NEW_LINE>UserPrincipal principal = qm.getUserPrincipal(username);<NEW_LINE>if (principal == null) {<NEW_LINE>return Response.status(Response.Status.NOT_FOUND).<MASK><NEW_LINE>}<NEW_LINE>final boolean modified = qm.removeUserFromTeam(principal, team);<NEW_LINE>principal = qm.getObjectById(principal.getClass(), principal.getId());<NEW_LINE>if (modified) {<NEW_LINE>super.logSecurityEvent(LOGGER, SecurityMarkers.SECURITY_AUDIT, "Removed team membership for: " + principal.getName() + " / team: " + team.getName());<NEW_LINE>return Response.ok(principal).build();<NEW_LINE>} else {<NEW_LINE>return Response.status(Response.Status.NOT_MODIFIED).entity("The user was not a member of the specified team.").build();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
entity("The user could not be found.").build();
517,318
public void serialize(T collection, JsonGenerator jgen, SerializerProvider provider) throws IOException {<NEW_LINE>jgen.writeStartObject();<NEW_LINE>if (collection.getKeyMatchStyle() != null && collection.getKeyMatchStyle() != KeyMatchStyle.SUB_SET) {<NEW_LINE>jgen.writeObjectField(<MASK><NEW_LINE>}<NEW_LINE>ArrayList<NottableString> keys = new ArrayList<>(collection.keySet());<NEW_LINE>Collections.sort(keys);<NEW_LINE>for (NottableString key : keys) {<NEW_LINE>jgen.writeFieldName(serialiseNottableString(key));<NEW_LINE>if (key.getParameterStyle() != null) {<NEW_LINE>jgen.writeStartObject();<NEW_LINE>jgen.writeObjectField("parameterStyle", key.getParameterStyle());<NEW_LINE>jgen.writeFieldName("values");<NEW_LINE>writeValuesArray(collection, jgen, key);<NEW_LINE>jgen.writeEndObject();<NEW_LINE>} else {<NEW_LINE>writeValuesArray(collection, jgen, key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jgen.writeEndObject();<NEW_LINE>}
"keyMatchStyle", collection.getKeyMatchStyle());
1,001,808
protected void doCODESIZE() {<NEW_LINE>if (computeGas) {<NEW_LINE>if (op == OpCode.EXTCODESIZE) {<NEW_LINE>gasCost = GasCost.EXT_CODE_SIZE;<NEW_LINE>}<NEW_LINE>spendOpCodeGas();<NEW_LINE>}<NEW_LINE>// EXECUTION PHASE<NEW_LINE>DataWord codeLength;<NEW_LINE>if (op == OpCode.CODESIZE) {<NEW_LINE>// during initialization it will return the initialization code size<NEW_LINE>codeLength = DataWord.valueOf(program.getCode().length);<NEW_LINE>} else {<NEW_LINE>DataWord address = program.stackPop();<NEW_LINE>codeLength = DataWord.valueOf(program.getCodeLengthAt(address));<NEW_LINE>ActivationConfig.ForBlock activations = program.getActivations();<NEW_LINE>if (activations.isActive(RSKIP90)) {<NEW_LINE>PrecompiledContracts.PrecompiledContract precompiledContract = <MASK><NEW_LINE>if (precompiledContract != null) {<NEW_LINE>codeLength = DataWord.valueOf(BigIntegers.asUnsignedByteArray(DataWord.MAX_VALUE));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isLogEnabled) {<NEW_LINE>hint = "size: " + codeLength;<NEW_LINE>}<NEW_LINE>program.stackPush(codeLength);<NEW_LINE>program.step();<NEW_LINE>}
precompiledContracts.getContractForAddress(activations, address);
1,802,660
public ApiResponse<List<String>> usersGetUserGroupsWithHttpInfo(String id) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'id' is set<NEW_LINE>if (id == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'id' when calling usersGetUserGroups");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/users/{id}/groups".replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.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, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[<MASK><NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>GenericType<List<String>> localVarReturnType = new GenericType<List<String>>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>}
] localVarAccepts = { "application/json", "text/json" };
1,100,808
public void handleMessage(Message msg) {<NEW_LINE>WorkerArgs <MASK><NEW_LINE>switch(msg.arg1) {<NEW_LINE>case EVENT_LOAD_IMAGE:<NEW_LINE>// if the image has been loaded then display it, otherwise set default.<NEW_LINE>// in either case, make sure the image is visible.<NEW_LINE>if (args.result != null) {<NEW_LINE>args.view.setVisibility(View.VISIBLE);<NEW_LINE>args.view.setImageDrawable((Drawable) args.result);<NEW_LINE>} else if (args.defaultResource != -1) {<NEW_LINE>args.view.setVisibility(View.VISIBLE);<NEW_LINE>args.view.setImageResource(args.defaultResource);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case EVENT_LOAD_DRAWABLE:<NEW_LINE>if (args.result != null) {<NEW_LINE>args.item.mBadge = (Drawable) args.result;<NEW_LINE>if (args.callback != null) {<NEW_LINE>args.callback.run();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>}
args = (WorkerArgs) msg.obj;
1,415,058
private void writeJunitReportToFile() {<NEW_LINE>try {<NEW_LINE>final String directory = String.valueOf(targetDirectory) + "/surefire-reports";<NEW_LINE>FileUtils.forceMkdir(new File(directory));<NEW_LINE>final StringBuilder b = new StringBuilder(directory).append("/TEST-").append<MASK><NEW_LINE>if (StringUtils.isNotBlank(reportSuffix)) {<NEW_LINE>// Safety first<NEW_LINE>b.append(reportSuffix.replace("/", "").replace("\\", ""));<NEW_LINE>}<NEW_LINE>final File reportFile = new File(b.append(".xml").toString());<NEW_LINE>final JAXBContext jaxbContext = JAXBContext.newInstance(ObjectFactory.class);<NEW_LINE>final Marshaller marshaller = jaxbContext.createMarshaller();<NEW_LINE>marshaller.marshal(report, reportFile);<NEW_LINE>getLog().info(deviceLogLinePrefix + "Report file written to " + reportFile.getAbsolutePath());<NEW_LINE>} catch (IOException e) {<NEW_LINE>threwException = true;<NEW_LINE>exceptionMessages.append("Failed to write test report file");<NEW_LINE>exceptionMessages.append(e.getMessage());<NEW_LINE>} catch (JAXBException e) {<NEW_LINE>threwException = true;<NEW_LINE>exceptionMessages.append("Failed to create jaxb context");<NEW_LINE>exceptionMessages.append(e.getMessage());<NEW_LINE>}<NEW_LINE>}
(DeviceHelper.getDescriptiveName(device));
1,124,893
public void invoke(PHPRuleContext context, List<Hint> hints) {<NEW_LINE>PHPParseResult phpParseResult = (PHPParseResult) context.parserResult;<NEW_LINE>if (phpParseResult.getProgram() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>FileScope fileScope = context.fileScope;<NEW_LINE>fileObject = phpParseResult.getSnapshot().getSource().getFileObject();<NEW_LINE>if (fileScope != null && fileObject != null) {<NEW_LINE>if (CancelSupport.getDefault().isCancelled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>CheckVisitor checkVisitor = new CheckVisitor();<NEW_LINE>phpParseResult.getProgram().accept(checkVisitor);<NEW_LINE>for (NamedArgument argument : checkVisitor.getDuplicateNames()) {<NEW_LINE>if (CancelSupport.getDefault().isCancelled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>addHint(argument, Bundle.IncorrectNamedArguments_desc_duplicate_name(argument.getParameterName().getName()), hints);<NEW_LINE>}<NEW_LINE>for (Map.Entry<NamedArgument, Variadic> entry : checkVisitor.getCombinedNamedArgumentsWithArgumentUnpacking().entrySet()) {<NEW_LINE>if (CancelSupport.getDefault().isCancelled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>addHint(entry.getKey(), Bundle.IncorrectNamedArguments_desc_combine_named_argument_and_argument_unpacking(), hints);<NEW_LINE>addHint(entry.getValue(), <MASK><NEW_LINE>}<NEW_LINE>for (Expression argument : checkVisitor.getArgumentsAfterNamedArgument()) {<NEW_LINE>if (CancelSupport.getDefault().isCancelled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>addHint(argument, Bundle.IncorrectNamedArguments_desc_positional_arguments_after_named_argument(), hints);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Bundle.IncorrectNamedArguments_desc_combine_named_argument_and_argument_unpacking(), hints);
992,965
public List<OpenIncident> readOpenIncidents(String agentRollupId) throws Exception {<NEW_LINE>BoundStatement boundStatement = readOpenIncidentsPS.bind();<NEW_LINE><MASK><NEW_LINE>ResultSet results = session.read(boundStatement);<NEW_LINE>List<OpenIncident> openIncidents = new ArrayList<>();<NEW_LINE>for (Row row : results) {<NEW_LINE>int i = 0;<NEW_LINE>AlertCondition condition = AlertCondition.parseFrom(checkNotNull(row.getBytes(i++)));<NEW_LINE>AlertSeverity severity = AlertSeverity.valueOf(checkNotNull(row.getString(i++)).toUpperCase(Locale.ENGLISH));<NEW_LINE>AlertNotification notification = AlertNotification.parseFrom(checkNotNull(row.getBytes(i++)));<NEW_LINE>long openTime = checkNotNull(row.getTimestamp(i++)).getTime();<NEW_LINE>openIncidents.add(ImmutableOpenIncident.builder().agentRollupId(agentRollupId).condition(condition).severity(severity).notification(notification).openTime(openTime).build());<NEW_LINE>}<NEW_LINE>return openIncidents;<NEW_LINE>}
boundStatement.setString(0, agentRollupId);
771,841
// https://tools.ietf.org/html/rfc8017#section-9.2.<NEW_LINE>private byte[] emsaPkcs1(byte[] m, int emLen, HashType hash) throws GeneralSecurityException {<NEW_LINE>Validators.validateSignatureHash(hash);<NEW_LINE>MessageDigest digest = EngineFactory.MESSAGE_DIGEST.getInstance(SubtleUtil.toDigestAlgo(this.hash));<NEW_LINE>digest.update(m);<NEW_LINE>byte[] h = digest.digest();<NEW_LINE>byte[] asnPrefix = toAsnPrefix(hash);<NEW_LINE>int tLen = asnPrefix.length + h.length;<NEW_LINE>if (emLen < tLen + 11) {<NEW_LINE>throw new GeneralSecurityException("intended encoded message length too short");<NEW_LINE>}<NEW_LINE>byte[] em = new byte[emLen];<NEW_LINE>int offset = 0;<NEW_LINE>em[offset++] = 0x00;<NEW_LINE>em[offset++] = 0x01;<NEW_LINE>for (int i = 0; i < emLen - tLen - 3; i++) {<NEW_LINE>em[<MASK><NEW_LINE>}<NEW_LINE>em[offset++] = 0x00;<NEW_LINE>System.arraycopy(asnPrefix, 0, em, offset, asnPrefix.length);<NEW_LINE>System.arraycopy(h, 0, em, offset + asnPrefix.length, h.length);<NEW_LINE>return em;<NEW_LINE>}
offset++] = (byte) 0xff;
1,177,061
private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String hostGroupName, String hostname, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><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 (hostGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (hostname == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-11-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), resourceGroupName, hostGroupName, hostname, apiVersion, this.client.getSubscriptionId(), accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
974,752
private void parseConfig(File file) throws JAXBException {<NEW_LINE>if (!file.getName().endsWith("xml")) {<NEW_LINE>logger.warn(String.format("file[%s] in global config folder is not end with .xml, skip it", file.getAbsolutePath()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Unmarshaller unmarshaller = context.createUnmarshaller();<NEW_LINE>org.zstack.core.config.schema.GlobalConfig gb = (org.zstack.core.config.schema.GlobalConfig) unmarshaller.unmarshal(file);<NEW_LINE>for (org.zstack.core.config.schema.GlobalConfig.Config c : gb.getConfig()) {<NEW_LINE>String category = c.getCategory();<NEW_LINE>category = category == null ? OTHER_CATEGORY : category;<NEW_LINE>c.setCategory(category);<NEW_LINE>// substitute system properties in value and defaultValue<NEW_LINE>if (c.getDefaultValue() == null) {<NEW_LINE>throw new IllegalArgumentException(String.format("GlobalConfig[category:%s, name:%s] must have a default value", c.getCategory(), c.getName()));<NEW_LINE>} else {<NEW_LINE>c.setDefaultValue(StringTemplate.substitute(c.getDefaultValue(), propertiesMap));<NEW_LINE>}<NEW_LINE>if (c.getValue() == null) {<NEW_LINE>c.setValue(c.getDefaultValue());<NEW_LINE>} else {<NEW_LINE>c.setValue(StringTemplate.substitute(c.getValue(), propertiesMap));<NEW_LINE>}<NEW_LINE>GlobalConfig config = GlobalConfig.valueOf(c);<NEW_LINE>if (configsFromXml.containsKey(config.getIdentity())) {<NEW_LINE>throw new IllegalArgumentException(String.format("duplicate GlobalConfig[category: %s, name: %s]", config.getCategory(), config.getName()));<NEW_LINE>}<NEW_LINE>configsFromXml.put(<MASK><NEW_LINE>}<NEW_LINE>}
config.getIdentity(), config);
1,703,901
public void create() {<NEW_LINE>if (spriteBatch != null)<NEW_LINE>return;<NEW_LINE>customShading = new CustomShading();<NEW_LINE>spriteBatch = new SpriteBatch();<NEW_LINE>shapeRenderer = new ShapeRenderer();<NEW_LINE>lineColor = com.badlogic.gdx.<MASK><NEW_LINE>worldCamera = new OrthographicCamera();<NEW_LINE>textCamera = new OrthographicCamera();<NEW_LINE>pixelsPerMeter = new NumericValue();<NEW_LINE>pixelsPerMeter.setValue(1.0f);<NEW_LINE>pixelsPerMeter.setAlwaysActive(true);<NEW_LINE>zoomLevel = new NumericValue();<NEW_LINE>zoomLevel.setValue(1.0f);<NEW_LINE>zoomLevel.setAlwaysActive(true);<NEW_LINE>deltaMultiplier = new NumericValue();<NEW_LINE>deltaMultiplier.setValue(1.0f);<NEW_LINE>deltaMultiplier.setAlwaysActive(true);<NEW_LINE>backgroundColor = new GradientColorValue();<NEW_LINE>backgroundColor.setColors(new float[] { 0f, 0f, 0f });<NEW_LINE>font = new BitmapFont(Gdx.files.getFileHandle("default.fnt", FileType.Internal), Gdx.files.getFileHandle("default.png", FileType.Internal), true);<NEW_LINE>effectPanel.newExampleEmitter("Untitled", true);<NEW_LINE>// if (resources.openFile("/editor-bg.png") != null) bgImage = new Image(gl, "/editor-bg.png");<NEW_LINE>OrthoCamController orthoCamController = new OrthoCamController(worldCamera);<NEW_LINE>Gdx.input.setInputProcessor(new InputMultiplexer(orthoCamController, this));<NEW_LINE>resize(lwjglCanvas.getWidth(), lwjglCanvas.getHeight());<NEW_LINE>}
graphics.Color.valueOf("636363");
577,857
public Result importLiveStreams2Stalker() {<NEW_LINE>String stalkerDBServer = getAppSettings().getStalkerDBServer();<NEW_LINE>String stalkerDBUsername = getAppSettings().getStalkerDBUsername();<NEW_LINE>String stalkerDBPassword = getAppSettings().getStalkerDBPassword();<NEW_LINE>boolean result = false;<NEW_LINE>String message = "";<NEW_LINE>int errorId = -1;<NEW_LINE>if (stalkerDBServer != null && stalkerDBServer.length() > 0 && stalkerDBUsername != null && stalkerDBUsername.length() > 0 && stalkerDBPassword != null && stalkerDBPassword.length() > 0) {<NEW_LINE>long broadcastCount = getDataStore().getBroadcastCount();<NEW_LINE>int pageCount = (int) broadcastCount / DataStore.MAX_ITEM_IN_ONE_LIST + ((broadcastCount % DataStore.MAX_ITEM_IN_ONE_LIST != 0) ? 1 : 0);<NEW_LINE>List<Broadcast> broadcastList = new ArrayList<>();<NEW_LINE>for (int i = 0; i < pageCount; i++) {<NEW_LINE>broadcastList.addAll(getDataStore().getBroadcastList(i * DataStore.MAX_ITEM_IN_ONE_LIST, DataStore.MAX_ITEM_IN_ONE_LIST, null, null, null, null));<NEW_LINE>}<NEW_LINE>StringBuilder insertQueryString = new StringBuilder();<NEW_LINE>insertQueryString.append("DELETE FROM stalker_db.ch_links;");<NEW_LINE>insertQueryString.append("DELETE FROM stalker_db.itv;");<NEW_LINE>String fqdn = getServerSettings().getServerName();<NEW_LINE>if (fqdn == null || fqdn.length() == 0) {<NEW_LINE>fqdn = getServerSettings().getHostAddress();<NEW_LINE>}<NEW_LINE>int number = 1;<NEW_LINE>for (Broadcast broadcast : broadcastList) {<NEW_LINE>String cmd = "ffmpeg http://" + fqdn + ":" + serverSettings.getDefaultHttpPort() + "/" + getScope().getName() + "/streams/" + broadcast.getStreamId() + ".m3u8";<NEW_LINE>insertQueryString.append("INSERT INTO stalker_db.itv(name, number, tv_genre_id, base_ch, cmd, languages)" + " VALUES ('" + broadcast.getName() + "' , " + number + ", 2, 1, '" + cmd + "', '');");<NEW_LINE>insertQueryString.append("SET @last_id=LAST_INSERT_ID();" + "INSERT INTO stalker_db.ch_links(ch_id, url)" + " VALUES(@last_id, '" + cmd + "');");<NEW_LINE>number++;<NEW_LINE>}<NEW_LINE>result = runStalkerImportQuery(insertQueryString.toString(), stalkerDBServer, stalkerDBUsername, stalkerDBPassword);<NEW_LINE>} else {<NEW_LINE>message = "Portal DB info is missing";<NEW_LINE>errorId = 404;<NEW_LINE>}<NEW_LINE>return new <MASK><NEW_LINE>}
Result(result, message, errorId);
816,995
public void addArrow(UUID gameId, int startX, int startY, int endX, int endY, Color color, Type type) {<NEW_LINE>JPanel p = getArrowsPanel(gameId);<NEW_LINE>Arrow arrow = new Arrow();<NEW_LINE>arrow.setColor(color);<NEW_LINE>arrow.setArrowLocation(startX, startY, endX, endY);<NEW_LINE>// 30 is offset for arrow heads (being cut otherwise)<NEW_LINE>arrow.setBounds(0, 0, Math.max(startX, endX) + 40, Math.max(startY, endY) + 30);<NEW_LINE>synchronized (map) {<NEW_LINE>p.add(arrow);<NEW_LINE>Map<Type, java.util.List<Arrow>> innerMap = map.computeIfAbsent(gameId, k -> new HashMap<>());<NEW_LINE>java.util.List<Arrow> arrows = innerMap.computeIfAbsent(type, k <MASK><NEW_LINE>arrows.add(arrow);<NEW_LINE>}<NEW_LINE>p.revalidate();<NEW_LINE>p.repaint();<NEW_LINE>}
-> new ArrayList<>());
1,699,388
private static List<ConfigChangeAction> validateContentCluster(ContentCluster currentCluster, ContentCluster nextCluster) {<NEW_LINE>List<ConfigChangeAction> actions = new ArrayList<>();<NEW_LINE>ContentSearchCluster currentSearchCluster = currentCluster.getSearch();<NEW_LINE><MASK><NEW_LINE>findDocumentTypesWithActionableIndexingModeChange(actions, nextCluster, toDocumentTypeNames(currentSearchCluster.getDocumentTypesWithStreamingCluster()), toDocumentTypeNames(nextSearchCluster.getDocumentTypesWithIndexedCluster()), "streaming", "indexed");<NEW_LINE>findDocumentTypesWithActionableIndexingModeChange(actions, nextCluster, toDocumentTypeNames(currentSearchCluster.getDocumentTypesWithIndexedCluster()), toDocumentTypeNames(nextSearchCluster.getDocumentTypesWithStreamingCluster()), "indexed", "streaming");<NEW_LINE>findDocumentTypesWithActionableIndexingModeChange(actions, nextCluster, toDocumentTypeNames(currentSearchCluster.getDocumentTypesWithStoreOnly()), toDocumentTypeNames(nextSearchCluster.getDocumentTypesWithIndexedCluster()), "store-only", "indexed");<NEW_LINE>findDocumentTypesWithActionableIndexingModeChange(actions, nextCluster, toDocumentTypeNames(currentSearchCluster.getDocumentTypesWithIndexedCluster()), toDocumentTypeNames(nextSearchCluster.getDocumentTypesWithStoreOnly()), "indexed", "store-only");<NEW_LINE>return actions;<NEW_LINE>}
ContentSearchCluster nextSearchCluster = nextCluster.getSearch();
454,834
private int distance(TagSet base, TagSet set, TagSetEncoder encoder) {<NEW_LINE>int cost = 0;<NEW_LINE>int nb = 0;<NEW_LINE>int ns = 0;<NEW_LINE>while (nb < base.tags.length && ns < set.tags.length) {<NEW_LINE>int c = base.tags[nb].compareTo(set.tags[ns]);<NEW_LINE>if (c == 0) {<NEW_LINE>++nb;<NEW_LINE>++ns;<NEW_LINE>} else if (c < 0) {<NEW_LINE>cost += encoder.cost(base.tags[nb].key, base.tags[nb].tag);<NEW_LINE>++nb;<NEW_LINE>} else {<NEW_LINE>cost += encoder.cost(set.tags[ns].key, set.tags[ns].tag);<NEW_LINE>++ns;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>while (nb < base.tags.length) {<NEW_LINE>cost += encoder.cost(base.tags[nb].key, base.tags[nb].tag);<NEW_LINE>++nb;<NEW_LINE>}<NEW_LINE>while (ns < set.tags.length) {<NEW_LINE>cost += encoder.cost(set.tags[ns].key, set<MASK><NEW_LINE>++ns;<NEW_LINE>}<NEW_LINE>return cost;<NEW_LINE>}
.tags[ns].tag);
1,741,154
private Map<ServerInstance, DataTable> gatherServerResponses(boolean ignoreEmptyResponses, Map<org.apache.pinot.core.transport.ServerInstance, List<String>> routingTable, AsyncQueryResponse asyncQueryResponse, String tableNameWithType) {<NEW_LINE>try {<NEW_LINE>Map<ServerRoutingInstance, ServerResponse> queryResponses = asyncQueryResponse.getResponse();<NEW_LINE>if (!ignoreEmptyResponses) {<NEW_LINE>if (queryResponses.size() != routingTable.size()) {<NEW_LINE>Map<String, String> routingTableForLogging = new HashMap<>();<NEW_LINE>routingTable.entrySet().forEach(entry -> {<NEW_LINE>String valueToPrint = entry.getValue().size() > 10 ? String.format("%d segments", entry.getValue().size()) : entry.getValue().toString();<NEW_LINE>routingTableForLogging.put(entry.getKey().toString(), valueToPrint);<NEW_LINE>});<NEW_LINE>throw new PinotException(ErrorCode.PINOT_INSUFFICIENT_SERVER_RESPONSE, String.format("%d of %d servers responded with routing table servers: %s, query stats: %s", queryResponses.size(), routingTable.size(), routingTableForLogging, asyncQueryResponse.getStats()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<ServerInstance, DataTable> <MASK><NEW_LINE>queryResponses.entrySet().forEach(entry -> serverResponseMap.put(new ServerInstance(new InstanceConfig(String.format("Server_%s_%d", entry.getKey().getHostname(), entry.getKey().getPort()))), entry.getValue().getDataTable()));<NEW_LINE>return serverResponseMap;<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>throw new PinotException(ErrorCode.PINOT_UNCLASSIFIED_ERROR, String.format("Caught exception while fetching responses for table: %s", tableNameWithType), e);<NEW_LINE>}<NEW_LINE>}
serverResponseMap = new HashMap<>();
1,846,212
final BatchAssociateResourcesToCustomLineItemResult executeBatchAssociateResourcesToCustomLineItem(BatchAssociateResourcesToCustomLineItemRequest batchAssociateResourcesToCustomLineItemRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(batchAssociateResourcesToCustomLineItemRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<BatchAssociateResourcesToCustomLineItemRequest> request = null;<NEW_LINE>Response<BatchAssociateResourcesToCustomLineItemResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new BatchAssociateResourcesToCustomLineItemRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(batchAssociateResourcesToCustomLineItemRequest));<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, "billingconductor");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<BatchAssociateResourcesToCustomLineItemResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new BatchAssociateResourcesToCustomLineItemResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "BatchAssociateResourcesToCustomLineItem");
726,564
public static void main(String[] args) throws Exception {<NEW_LINE>// Create and configure HTTPS client<NEW_LINE>Client client = new Client(new Context(), Protocol.HTTPS);<NEW_LINE>Series<Parameter> parameters = client.getContext().getParameters();<NEW_LINE>parameters.add("truststorePath", "src/org/restlet/example/book/restlet/ch05/clientTrust.jks");<NEW_LINE>parameters.add("truststorePassword", "password");<NEW_LINE>parameters.add("truststoreType", "JKS");<NEW_LINE>// Create and configure client resource<NEW_LINE><MASK><NEW_LINE>clientResource.setNext(client);<NEW_LINE>MailResource mailClient = clientResource.wrap(MailResource.class);<NEW_LINE>try {<NEW_LINE>// Obtain the authentication options via the challenge requests<NEW_LINE>mailClient.retrieve();<NEW_LINE>} catch (ResourceException re) {<NEW_LINE>if (Status.CLIENT_ERROR_UNAUTHORIZED.equals(re.getStatus())) {<NEW_LINE>// Retrieve the HTTP Digest hints from the server<NEW_LINE>ChallengeRequest digestChallenge = null;<NEW_LINE>for (ChallengeRequest challengeRequest : clientResource.getChallengeRequests()) {<NEW_LINE>if (ChallengeScheme.HTTP_DIGEST.equals(challengeRequest.getScheme())) {<NEW_LINE>digestChallenge = challengeRequest;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Configure the authentication credentials<NEW_LINE>ChallengeResponse authentication = new ChallengeResponse(digestChallenge, clientResource.getResponse(), "chunkylover53", "pwd");<NEW_LINE>clientResource.setChallengeResponse(authentication);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Communicate with remote resource<NEW_LINE>mailClient.store(mailClient.retrieve());<NEW_LINE>// Store HTTPS client<NEW_LINE>client.stop();<NEW_LINE>}
ClientResource clientResource = new ClientResource("https://localhost:8183/accounts/chunkylover53/mails/123");