idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,084,542
public StageDeclaration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>StageDeclaration stageDeclaration = new StageDeclaration();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>stageDeclaration.setName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("blockers", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>stageDeclaration.setBlockers(new ListUnmarshaller<BlockerDeclaration>(BlockerDeclarationJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("actions", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>stageDeclaration.setActions(new ListUnmarshaller<ActionDeclaration>(ActionDeclarationJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return stageDeclaration;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
1,226,717
public void restoreWebView() {<NEW_LINE>if (mRhoCustomView != null) {<NEW_LINE>view.removeView(mRhoCustomView.getContainerView());<NEW_LINE>mRhoCustomView.destroyView();<NEW_LINE>mRhoCustomView = null;<NEW_LINE>if (navBar != null) {<NEW_LINE>view.removeView(navBar);<NEW_LINE>}<NEW_LINE>if (toolBar != null) {<NEW_LINE>view.removeView(toolBar);<NEW_LINE>}<NEW_LINE>int index = 0;<NEW_LINE>if (navBar != null) {<NEW_LINE>view.addView(navBar, index);<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>addWebViewToMainView(webView, index, new LinearLayout.LayoutParams<MASK><NEW_LINE>index++;<NEW_LINE>if (toolBar != null) {<NEW_LINE>view.addView(toolBar, index);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mRhoCustomView != null) {<NEW_LINE>mRhoCustomView.destroyView();<NEW_LINE>mRhoCustomView = null;<NEW_LINE>}<NEW_LINE>}
(FILL_PARENT, 0, 1));
1,690,639
ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag, String portalFlag) throws Exception {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wo wo = null;<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>CacheKey cacheKey = new CacheKey(this.getClass(), flag, portalFlag);<NEW_LINE>Optional<?> optional = CacheManager.get(cache, cacheKey);<NEW_LINE>if (optional.isPresent()) {<NEW_LINE>wo = (Wo) optional.get();<NEW_LINE>Portal portal = business.portal().pick(wo.getPortal());<NEW_LINE>if (!business.portal().visible(effectivePerson, portal)) {<NEW_LINE>throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(), portal.getId());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Portal portal = emc.flag(portalFlag, Portal.class);<NEW_LINE>if (null == portal) {<NEW_LINE>throw new ExceptionPortalNotExist(portalFlag);<NEW_LINE>}<NEW_LINE>if (!business.portal().visible(effectivePerson, portal)) {<NEW_LINE>throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(), portal.getId());<NEW_LINE>}<NEW_LINE>Widget widget = emc.restrictFlag(flag, Widget.class, Widget.portal_FIELDNAME, portal.getId());<NEW_LINE>if (null == widget) {<NEW_LINE>throw new ExceptionWidgetNotExist(flag);<NEW_LINE>}<NEW_LINE>wo = <MASK><NEW_LINE>wo.setData(widget.getMobileDataOrData());<NEW_LINE>CacheManager.put(cache, cacheKey, wo);<NEW_LINE>}<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
Wo.copier.copy(widget);
610,645
public BasicMessageContext<InboundMessageType, OutboundMessageType, NameIdentifierType> handleSAMLLogoutRequest(HttpServletRequest req, HttpServletResponse res, SsoSamlService ssoService, String externalRelayState, SsoRequest samlRequest) throws SamlException {<NEW_LINE>BasicMessageContext<InboundMessageType, OutboundMessageType, NameIdentifierType> messageContext = null;<NEW_LINE>@SuppressWarnings("rawtypes")<NEW_LINE>BasicMessageContextBuilder ctxBuilder = BasicMessageContextBuilder.getInstance();<NEW_LINE>messageContext = ctxBuilder.buildSLO(req, res, ssoService, externalRelayState, samlRequest);<NEW_LINE>// get the SAML Request<NEW_LINE>LogoutRequest samlLogoutRequest = <MASK><NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "saml logoutRequest:" + samlLogoutRequest);<NEW_LINE>Tr.debug(tc, "saml logoutRequest ID :" + samlLogoutRequest.getID());<NEW_LINE>Tr.debug(tc, DumpData.dumpXMLObject(null, samlLogoutRequest, 0).toString());<NEW_LINE>}<NEW_LINE>// Status initialization<NEW_LINE>StatusBuilderUtil statusBuilderUtil = new StatusBuilderUtil();<NEW_LINE>messageContext.setSLOResponseStatus(statusBuilderUtil.buildStatus());<NEW_LINE>// validate LogoutRequest<NEW_LINE>ResponseValidator<InboundMessageType, OutboundMessageType, NameIdentifierType> validator = new ResponseValidator<InboundMessageType, OutboundMessageType, NameIdentifierType>(messageContext, samlLogoutRequest);<NEW_LINE>if (validator.validateLogoutRequest()) {<NEW_LINE>statusBuilderUtil.setStatus(messageContext.getSLOResponseStatus(), StatusCode.SUCCESS_URI);<NEW_LINE>}<NEW_LINE>messageContext.setInResponseTo(samlLogoutRequest.getID());<NEW_LINE>return messageContext;<NEW_LINE>}
(LogoutRequest) messageContext.getInboundMessage();
779,905
public static QuerySpeechDeviceResponse unmarshall(QuerySpeechDeviceResponse querySpeechDeviceResponse, UnmarshallerContext _ctx) {<NEW_LINE>querySpeechDeviceResponse.setRequestId(_ctx.stringValue("QuerySpeechDeviceResponse.RequestId"));<NEW_LINE>querySpeechDeviceResponse.setSuccess(_ctx.booleanValue("QuerySpeechDeviceResponse.Success"));<NEW_LINE>querySpeechDeviceResponse.setCode(_ctx.stringValue("QuerySpeechDeviceResponse.Code"));<NEW_LINE>querySpeechDeviceResponse.setErrorMessage(_ctx.stringValue("QuerySpeechDeviceResponse.ErrorMessage"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setTotal(_ctx.integerValue("QuerySpeechDeviceResponse.Data.Total"));<NEW_LINE>data.setPageId(_ctx.integerValue("QuerySpeechDeviceResponse.Data.PageId"));<NEW_LINE>data.setPageSize(_ctx.integerValue("QuerySpeechDeviceResponse.Data.PageSize"));<NEW_LINE>List<Items> list = new ArrayList<Items>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QuerySpeechDeviceResponse.Data.List.Length"); i++) {<NEW_LINE>Items items = new Items();<NEW_LINE>items.setProductKey(_ctx.stringValue("QuerySpeechDeviceResponse.Data.List[" + i + "].ProductKey"));<NEW_LINE>items.setDeviceName(_ctx.stringValue("QuerySpeechDeviceResponse.Data.List[" + i + "].DeviceName"));<NEW_LINE>items.setIotId(_ctx.stringValue("QuerySpeechDeviceResponse.Data.List[" + i + "].IotId"));<NEW_LINE>items.setAvailableSpace(_ctx.floatValue<MASK><NEW_LINE>list.add(items);<NEW_LINE>}<NEW_LINE>data.setList(list);<NEW_LINE>querySpeechDeviceResponse.setData(data);<NEW_LINE>return querySpeechDeviceResponse;<NEW_LINE>}
("QuerySpeechDeviceResponse.Data.List[" + i + "].AvailableSpace"));
1,479,548
public static ListLastMonthInvoiceResponse unmarshall(ListLastMonthInvoiceResponse listLastMonthInvoiceResponse, UnmarshallerContext _ctx) {<NEW_LINE>listLastMonthInvoiceResponse.setRequestId<MASK><NEW_LINE>listLastMonthInvoiceResponse.setAmount(_ctx.stringValue("ListLastMonthInvoiceResponse.Amount"));<NEW_LINE>listLastMonthInvoiceResponse.setCount(_ctx.integerValue("ListLastMonthInvoiceResponse.Count"));<NEW_LINE>List<DataItem> data = new ArrayList<DataItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListLastMonthInvoiceResponse.Data.Length"); i++) {<NEW_LINE>DataItem dataItem = new DataItem();<NEW_LINE>dataItem.setType(_ctx.stringValue("ListLastMonthInvoiceResponse.Data[" + i + "].Type"));<NEW_LINE>dataItem.setAmount(_ctx.stringValue("ListLastMonthInvoiceResponse.Data[" + i + "].Amount"));<NEW_LINE>dataItem.setTaxAndAmount(_ctx.stringValue("ListLastMonthInvoiceResponse.Data[" + i + "].TaxAndAmount"));<NEW_LINE>dataItem.setProductName(_ctx.stringValue("ListLastMonthInvoiceResponse.Data[" + i + "].ProductName"));<NEW_LINE>dataItem.setDate(_ctx.stringValue("ListLastMonthInvoiceResponse.Data[" + i + "].Date"));<NEW_LINE>dataItem.setUrl(_ctx.stringValue("ListLastMonthInvoiceResponse.Data[" + i + "].Url"));<NEW_LINE>dataItem.setOrgName(_ctx.stringValue("ListLastMonthInvoiceResponse.Data[" + i + "].OrgName"));<NEW_LINE>dataItem.setId(_ctx.longValue("ListLastMonthInvoiceResponse.Data[" + i + "].Id"));<NEW_LINE>dataItem.setTax(_ctx.stringValue("ListLastMonthInvoiceResponse.Data[" + i + "].Tax"));<NEW_LINE>dataItem.setIsSaveVoucher(_ctx.booleanValue("ListLastMonthInvoiceResponse.Data[" + i + "].IsSaveVoucher"));<NEW_LINE>data.add(dataItem);<NEW_LINE>}<NEW_LINE>listLastMonthInvoiceResponse.setData(data);<NEW_LINE>return listLastMonthInvoiceResponse;<NEW_LINE>}
(_ctx.stringValue("ListLastMonthInvoiceResponse.RequestId"));
190,622
private void clueLookup(ChatMessage chatMessage, String message) {<NEW_LINE>if (!config.clue()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String search;<NEW_LINE>if (message.equalsIgnoreCase(CLUES_COMMAND_STRING)) {<NEW_LINE>search = "total";<NEW_LINE>} else {<NEW_LINE>search = message.substring(CLUES_COMMAND_STRING.length() + 1);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final Skill hiscoreSkill;<NEW_LINE>final HiscoreLookup lookup = getCorrectLookupFor(chatMessage);<NEW_LINE>final HiscoreResult result = hiscoreClient.lookup(lookup.getName(), lookup.getEndpoint());<NEW_LINE>if (result == null) {<NEW_LINE>log.warn("error looking up clues: not found");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String level = search.toLowerCase();<NEW_LINE>switch(level) {<NEW_LINE>case "beginner":<NEW_LINE>hiscoreSkill = result.getClueScrollBeginner();<NEW_LINE>break;<NEW_LINE>case "easy":<NEW_LINE>hiscoreSkill = result.getClueScrollEasy();<NEW_LINE>break;<NEW_LINE>case "medium":<NEW_LINE>hiscoreSkill = result.getClueScrollMedium();<NEW_LINE>break;<NEW_LINE>case "hard":<NEW_LINE>hiscoreSkill = result.getClueScrollHard();<NEW_LINE>break;<NEW_LINE>case "elite":<NEW_LINE>hiscoreSkill = result.getClueScrollElite();<NEW_LINE>break;<NEW_LINE>case "master":<NEW_LINE>hiscoreSkill = result.getClueScrollMaster();<NEW_LINE>break;<NEW_LINE>case "total":<NEW_LINE>hiscoreSkill = result.getClueScrollAll();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int quantity = hiscoreSkill.getLevel();<NEW_LINE>int rank = hiscoreSkill.getRank();<NEW_LINE>if (quantity == -1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ChatMessageBuilder chatMessageBuilder = new ChatMessageBuilder().append(ChatColorType.NORMAL).append("Clue scroll (" + level + ")").append(": ").append(ChatColorType.HIGHLIGHT).append(String.format("%,d", quantity));<NEW_LINE>if (rank != -1) {<NEW_LINE>chatMessageBuilder.append(ChatColorType.NORMAL).append(" Rank: ").append(ChatColorType.HIGHLIGHT).append(String<MASK><NEW_LINE>}<NEW_LINE>String response = chatMessageBuilder.build();<NEW_LINE>log.debug("Setting response {}", response);<NEW_LINE>final MessageNode messageNode = chatMessage.getMessageNode();<NEW_LINE>messageNode.setRuneLiteFormatMessage(response);<NEW_LINE>client.refreshChat();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>log.warn("error looking up clues", ex);<NEW_LINE>}<NEW_LINE>}
.format("%,d", rank));
1,576,909
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException {<NEW_LINE>builder.startObject();<NEW_LINE>builder.field(DatafeedConfig.ID.getPreferredName(), datafeedId);<NEW_LINE>builder.field(DatafeedState.STATE.getPreferredName(), datafeedState.toString());<NEW_LINE>if (node != null) {<NEW_LINE>builder.startObject("node");<NEW_LINE>builder.field("id", node.getId());<NEW_LINE>builder.field("name", node.getName());<NEW_LINE>builder.field("ephemeral_id", node.getEphemeralId());<NEW_LINE>builder.field("transport_address", node.getTransportAddress());<NEW_LINE>builder.startObject("attributes");<NEW_LINE>for (Map.Entry<String, String> entry : node.getAttributes().entrySet()) {<NEW_LINE>if (entry.getKey().startsWith("ml.")) {<NEW_LINE>builder.field(entry.getKey(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>builder.endObject();<NEW_LINE>}<NEW_LINE>if (assignmentExplanation != null) {<NEW_LINE>builder.field(ASSIGNMENT_EXPLANATION.getPreferredName(), assignmentExplanation);<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>return builder;<NEW_LINE>}
), entry.getValue());
547,952
static StructOrError<Route> parseRoute(io.envoyproxy.envoy.config.route.v3.Route proto, FilterRegistry filterRegistry, boolean parseHttpFilter, Map<String, PluginConfig> pluginConfigMap) {<NEW_LINE>StructOrError<RouteMatch> routeMatch = parseRouteMatch(proto.getMatch());<NEW_LINE>if (routeMatch == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (routeMatch.getErrorDetail() != null) {<NEW_LINE>return StructOrError.fromError("Route [" + proto.getName() + "] contains invalid RouteMatch: " + routeMatch.getErrorDetail());<NEW_LINE>}<NEW_LINE>Map<String, FilterConfig> overrideConfigs = Collections.emptyMap();<NEW_LINE>if (parseHttpFilter) {<NEW_LINE>StructOrError<Map<String, FilterConfig>> overrideConfigsOrError = parseOverrideFilterConfigs(proto.getTypedPerFilterConfigMap(), filterRegistry);<NEW_LINE>if (overrideConfigsOrError.errorDetail != null) {<NEW_LINE>return StructOrError.fromError("Route [" + proto.getName(<MASK><NEW_LINE>}<NEW_LINE>overrideConfigs = overrideConfigsOrError.struct;<NEW_LINE>}<NEW_LINE>switch(proto.getActionCase()) {<NEW_LINE>case ROUTE:<NEW_LINE>StructOrError<RouteAction> routeAction = parseRouteAction(proto.getRoute(), filterRegistry, parseHttpFilter, pluginConfigMap);<NEW_LINE>if (routeAction == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (routeAction.errorDetail != null) {<NEW_LINE>return StructOrError.fromError("Route [" + proto.getName() + "] contains invalid RouteAction: " + routeAction.getErrorDetail());<NEW_LINE>}<NEW_LINE>return StructOrError.fromStruct(Route.forAction(routeMatch.struct, routeAction.struct, overrideConfigs));<NEW_LINE>case NON_FORWARDING_ACTION:<NEW_LINE>return StructOrError.fromStruct(Route.forNonForwardingAction(routeMatch.struct, overrideConfigs));<NEW_LINE>case REDIRECT:<NEW_LINE>case DIRECT_RESPONSE:<NEW_LINE>case FILTER_ACTION:<NEW_LINE>case ACTION_NOT_SET:<NEW_LINE>default:<NEW_LINE>return StructOrError.fromError("Route [" + proto.getName() + "] with unknown action type: " + proto.getActionCase());<NEW_LINE>}<NEW_LINE>}
) + "] contains invalid HttpFilter config: " + overrideConfigsOrError.errorDetail);
1,684,810
public void run() {<NEW_LINE>InsightBuilder insight = new InsightBuilder();<NEW_LINE>stream.appendTimeoutInsight(insight);<NEW_LINE>// DelayedStream.cancel() is safe to call from a thread that is different from where the<NEW_LINE>// stream is created.<NEW_LINE>long seconds = Math.abs(remainingNanos) / <MASK><NEW_LINE>long nanos = Math.abs(remainingNanos) % TimeUnit.SECONDS.toNanos(1);<NEW_LINE>StringBuilder buf = new StringBuilder();<NEW_LINE>buf.append("deadline exceeded after ");<NEW_LINE>if (remainingNanos < 0) {<NEW_LINE>buf.append('-');<NEW_LINE>}<NEW_LINE>buf.append(seconds);<NEW_LINE>buf.append(String.format(Locale.US, ".%09d", nanos));<NEW_LINE>buf.append("s. ");<NEW_LINE>buf.append(insight);<NEW_LINE>stream.cancel(DEADLINE_EXCEEDED.augmentDescription(buf.toString()));<NEW_LINE>}
TimeUnit.SECONDS.toNanos(1);
263,082
public void loadTagMappingFile(String file) {<NEW_LINE>if (file != null) {<NEW_LINE><MASK><NEW_LINE>if (!f.exists()) {<NEW_LINE>throw new IllegalArgumentException("tag mapping file parameter points to a file that does not exist");<NEW_LINE>}<NEW_LINE>if (f.isDirectory()) {<NEW_LINE>throw new IllegalArgumentException("tag mapping file parameter points to a directory, must be a file");<NEW_LINE>} else if (!f.canRead()) {<NEW_LINE>throw new IllegalArgumentException("tag mapping file parameter points to a file we have no read permissions");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>this.tagMapping = OSMTagMapping.getInstance(f.toURI().toURL());<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>this.tagMapping = OSMTagMapping.getInstance();<NEW_LINE>}<NEW_LINE>this.tagMapping.setTagValues(this.tagValues);<NEW_LINE>}
File f = new File(file);
931,073
public net.osmand.binary.OsmandOdb.TransportStopsTree buildPartial() {<NEW_LINE>net.osmand.binary.OsmandOdb.TransportStopsTree result = new net.osmand.binary.OsmandOdb.TransportStopsTree(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>result.left_ = left_;<NEW_LINE>if (((from_bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>to_bitField0_ |= 0x00000002;<NEW_LINE>}<NEW_LINE>result.right_ = right_;<NEW_LINE>if (((from_bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>to_bitField0_ |= 0x00000004;<NEW_LINE>}<NEW_LINE>result.top_ = top_;<NEW_LINE>if (((from_bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>to_bitField0_ |= 0x00000008;<NEW_LINE>}<NEW_LINE>result.bottom_ = bottom_;<NEW_LINE>if (subtreesBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>subtrees_ = java.util.Collections.unmodifiableList(subtrees_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000010);<NEW_LINE>}<NEW_LINE>result.subtrees_ = subtrees_;<NEW_LINE>} else {<NEW_LINE>result.subtrees_ = subtreesBuilder_.build();<NEW_LINE>}<NEW_LINE>if (leafsBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000020) == 0x00000020)) {<NEW_LINE>leafs_ = java.<MASK><NEW_LINE>bitField0_ = (bitField0_ & ~0x00000020);<NEW_LINE>}<NEW_LINE>result.leafs_ = leafs_;<NEW_LINE>} else {<NEW_LINE>result.leafs_ = leafsBuilder_.build();<NEW_LINE>}<NEW_LINE>if (((from_bitField0_ & 0x00000040) == 0x00000040)) {<NEW_LINE>to_bitField0_ |= 0x00000010;<NEW_LINE>}<NEW_LINE>result.baseId_ = baseId_;<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>}
util.Collections.unmodifiableList(leafs_);
958,568
final DescribeOrderableDBInstanceOptionsResult executeDescribeOrderableDBInstanceOptions(DescribeOrderableDBInstanceOptionsRequest describeOrderableDBInstanceOptionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeOrderableDBInstanceOptionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeOrderableDBInstanceOptionsRequest> request = null;<NEW_LINE>Response<DescribeOrderableDBInstanceOptionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeOrderableDBInstanceOptionsRequestMarshaller().marshall(super.beforeMarshalling(describeOrderableDBInstanceOptionsRequest));<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, "DocDB");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeOrderableDBInstanceOptions");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeOrderableDBInstanceOptionsResult> responseHandler = new StaxResponseHandler<DescribeOrderableDBInstanceOptionsResult>(new DescribeOrderableDBInstanceOptionsResultStaxUnmarshaller());<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.ADVANCED_CONFIG, advancedConfig);
504,617
// implement SqlValidator<NEW_LINE>public void declareCursor(SqlSelect select, SqlValidatorScope parentScope) {<NEW_LINE>cursorSet.add(select);<NEW_LINE>// add the cursor to a map that maps the cursor to its select based on<NEW_LINE>// the position of the cursor relative to other cursors in that call<NEW_LINE>FunctionParamInfo funcParamInfo = functionCallStack.peek();<NEW_LINE>Map<Integer, SqlSelect> cursorMap = funcParamInfo.cursorPosToSelectMap;<NEW_LINE>int numCursors = cursorMap.size();<NEW_LINE><MASK><NEW_LINE>// create a namespace associated with the result of the select<NEW_LINE>// that is the argument to the cursor constructor; register it<NEW_LINE>// with a scope corresponding to the cursor<NEW_LINE>SelectScope cursorScope = new SelectScope(parentScope, null, select);<NEW_LINE>cursorScopes.put(select, cursorScope);<NEW_LINE>final SelectNamespace selectNs = createSelectNamespace(select, select);<NEW_LINE>String alias = deriveAlias(select, nextGeneratedId++);<NEW_LINE>registerNamespace(cursorScope, alias, selectNs, false);<NEW_LINE>}
cursorMap.put(numCursors, select);
1,161,216
public void init(IExportDialogAdapter adapter, Composite container, IFigure figure) {<NEW_LINE>setFigure(figure);<NEW_LINE>container.setLayout(new GridLayout(8, false));<NEW_LINE>container.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));<NEW_LINE>fSetViewboxButton = new Button(container, SWT.CHECK);<NEW_LINE>fSetViewboxButton.setText(Messages.SVGExportProvider_0);<NEW_LINE>GridData gd = new GridData();<NEW_LINE>gd.horizontalSpan = 8;<NEW_LINE>fSetViewboxButton.setLayoutData(gd);<NEW_LINE>fSetViewboxButton.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>updateControls();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>int min = -10000;<NEW_LINE>int max = 10000;<NEW_LINE>Label label = new Label(container, SWT.NONE);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>label.setText(" " + Messages.SVGExportProvider_2);<NEW_LINE>fSpinner1 = new Spinner(container, SWT.BORDER);<NEW_LINE>fSpinner1.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));<NEW_LINE>fSpinner1.setMinimum(min);<NEW_LINE>fSpinner1.setMaximum(max);<NEW_LINE>label = new Label(container, SWT.NONE);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>label.setText(" " + Messages.SVGExportProvider_3);<NEW_LINE>fSpinner2 = new Spinner(container, SWT.BORDER);<NEW_LINE>fSpinner2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));<NEW_LINE>fSpinner2.setMinimum(min);<NEW_LINE>fSpinner2.setMaximum(max);<NEW_LINE>label = new Label(container, SWT.NONE);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>label.<MASK><NEW_LINE>fSpinner3 = new Spinner(container, SWT.BORDER);<NEW_LINE>fSpinner3.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));<NEW_LINE>fSpinner3.setMaximum(max);<NEW_LINE>label = new Label(container, SWT.NONE);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>label.setText(" " + Messages.SVGExportProvider_5);<NEW_LINE>fSpinner4 = new Spinner(container, SWT.BORDER);<NEW_LINE>fSpinner4.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));<NEW_LINE>fSpinner4.setMaximum(max);<NEW_LINE>loadPreferences();<NEW_LINE>// Set viewBox width and height to the image size<NEW_LINE>fSpinner3.setSelection(viewPortBounds.width);<NEW_LINE>fSpinner4.setSelection(viewPortBounds.height);<NEW_LINE>}
setText(" " + Messages.SVGExportProvider_4);
1,397,760
public // intervened since the last call to getEncodedLength so we can trust the length field.<NEW_LINE>int encode(byte[] frame, int offset) throws JMFUninitializedAccessException, JMFSchemaViolationException, JMFModelNotImplementedException, JMFMessageCorruptionException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>JmfTr.entry(this, tc, "encode", new Object[] { frame, Integer.valueOf(offset) });<NEW_LINE>ArrayUtil.writeInt(frame, offset, length + 4);<NEW_LINE>ArrayUtil.writeInt(frame, offset + 4, cacheSize);<NEW_LINE>if (contents != null) {<NEW_LINE>System.arraycopy(contents, this.offset, frame, offset + 8, length);<NEW_LINE>int result = offset + 8 + length;<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>JmfTr.exit(this, tc, "encode", Integer.valueOf(result));<NEW_LINE>return result;<NEW_LINE>} else {<NEW_LINE>int next = offset + 8;<NEW_LINE>next = encodeOffsetTable(frame, next);<NEW_LINE>for (int i = 0; i < cacheSize; i++) {<NEW_LINE>Object elem = cache[i];<NEW_LINE>if (elem == null) {<NEW_LINE>throw new JMFUninitializedAccessException("List element " + i + "is missing");<NEW_LINE>}<NEW_LINE>if (elem == nullIndicator) {<NEW_LINE>elem = null;<NEW_LINE>}<NEW_LINE>next = element.encodeValue(frame, <MASK><NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>JmfTr.exit(this, tc, "encode", Integer.valueOf(next));<NEW_LINE>return next;<NEW_LINE>}<NEW_LINE>}
next, elem, indirect, primaryMessage);
320,523
protected void popupShouldSave(ActionEvent e) {<NEW_LINE>log.debug("popupShouldSave");<NEW_LINE>if (GuiPackage.getInstance().getTestPlanFile() == null) {<NEW_LINE>if (// $NON-NLS-1$<NEW_LINE>JOptionPane.// $NON-NLS-1$<NEW_LINE>showConfirmDialog(// $NON-NLS-1$<NEW_LINE>GuiPackage.getInstance().getMainFrame(), // $NON-NLS-1$<NEW_LINE>JMeterUtils.getResString("should_save"), JMeterUtils.getResString("warning"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {<NEW_LINE>ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID<MASK><NEW_LINE>}<NEW_LINE>} else if (GuiPackage.getInstance().shouldSaveBeforeRun()) {<NEW_LINE>ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.SAVE));<NEW_LINE>}<NEW_LINE>}
(), ActionNames.SAVE));
37,250
private void pasteAfterCopy(PsiElement[] elements, Module module, PsiElement target, boolean tryFromFiles) {<NEW_LINE>PsiDirectory targetDirectory = elements.length == 1 && elements[0] == target ? <MASK><NEW_LINE>try {<NEW_LINE>if (CopyHandler.canCopy(elements)) {<NEW_LINE>CopyHandler.doCopy(elements, targetDirectory);<NEW_LINE>} else if (tryFromFiles) {<NEW_LINE>List<File> files = PsiCopyPasteManager.asFileList(elements);<NEW_LINE>if (files != null) {<NEW_LINE>PsiManager manager = elements[0].getManager();<NEW_LINE>PsiFileSystemItem[] items = files.stream().map(file -> LocalFileSystem.getInstance().findFileByIoFile(file)).map(file -> {<NEW_LINE>if (file != null) {<NEW_LINE>return file.isDirectory() ? manager.findDirectory(file) : manager.findFile(file);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}).filter(file -> file != null).toArray(PsiFileSystemItem[]::new);<NEW_LINE>pasteAfterCopy(items, module, target, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (targetDirectory != null) {<NEW_LINE>targetDirectory.putCopyableUserData(SHOW_CHOOSER_KEY, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
null : getTargetDirectory(module, target);
1,244,162
public void open(AudioFormat fmt, int frames) {<NEW_LINE>DataLine.Info info = new DataLine.Info(SourceDataLine.class, fmt);<NEW_LINE>if (!AudioSystem.isLineSupported(info)) {<NEW_LINE>Mixer.Info[] mixers = AudioSystem.getMixerInfo();<NEW_LINE>for (Mixer.Info mixerInfo : mixers) {<NEW_LINE>System.out.println("Found Mixer: " + mixerInfo);<NEW_LINE>Mixer <MASK><NEW_LINE>for (Info li : m.getSourceLineInfo()) {<NEW_LINE>AudioFormat[] formats = ((DataLine.Info) li).getFormats();<NEW_LINE>for (AudioFormat audioFormat : formats) {<NEW_LINE>System.out.println(audioFormat);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new RuntimeException("Line matching " + info + " not supported.");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>line = (SourceDataLine) AudioSystem.getLine(info);<NEW_LINE>line.open(fmt, frames * fmt.getFrameSize());<NEW_LINE>line.start();<NEW_LINE>} catch (LineUnavailableException ex) {<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>}
m = AudioSystem.getMixer(mixerInfo);
959,354
private void handle(APIChangeSecurityGroupStateMsg msg) {<NEW_LINE>SecurityGroupStateEvent sevt = SecurityGroupStateEvent.valueOf(msg.getStateEvent());<NEW_LINE>SecurityGroupVO vo = dbf.findByUuid(msg.getUuid(), SecurityGroupVO.class);<NEW_LINE>if (sevt == SecurityGroupStateEvent.enable) {<NEW_LINE>vo.setState(SecurityGroupState.Enabled);<NEW_LINE>List<SecurityGroupRuleVO> rvos = Q.New(SecurityGroupRuleVO.class).eq(SecurityGroupRuleVO_.securityGroupUuid, msg.getUuid()).list();<NEW_LINE>for (SecurityGroupRuleVO rvo : rvos) {<NEW_LINE>rvo.setState(SecurityGroupRuleState.Enabled);<NEW_LINE>}<NEW_LINE>dbf.updateCollection(rvos);<NEW_LINE>vo = dbf.updateAndRefresh(vo);<NEW_LINE>List<String> sgUuids = Q.New(SecurityGroupRuleVO.class).select(SecurityGroupRuleVO_.securityGroupUuid).eq(SecurityGroupRuleVO_.remoteSecurityGroupUuid, msg.getUuid()).listValues();<NEW_LINE>sgUuids.add(msg.getUuid());<NEW_LINE>RuleCalculator cal = new RuleCalculator();<NEW_LINE>cal.securityGroupUuids = sgUuids;<NEW_LINE>cal.vmStates = asList(VmInstanceState.Running);<NEW_LINE>List<HostRuleTO> htos = cal.calculate();<NEW_LINE>applyRules(htos);<NEW_LINE>HostSecurityGroupMembersTO groupMemberTO = cal.<MASK><NEW_LINE>if (!groupMemberTO.getHostUuids().isEmpty()) {<NEW_LINE>updateGroupMembers(groupMemberTO);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>List<SecurityGroupRuleVO> rvos = Q.New(SecurityGroupRuleVO.class).eq(SecurityGroupRuleVO_.securityGroupUuid, msg.getUuid()).list();<NEW_LINE>for (SecurityGroupRuleVO rvo : rvos) {<NEW_LINE>rvo.setState(SecurityGroupRuleState.Disabled);<NEW_LINE>}<NEW_LINE>dbf.updateCollection(rvos);<NEW_LINE>vo.setState(SecurityGroupState.Disabled);<NEW_LINE>vo = dbf.updateAndRefresh(vo);<NEW_LINE>disableSecurityGroup(msg.getUuid());<NEW_LINE>}<NEW_LINE>APIChangeSecurityGroupStateEvent evt = new APIChangeSecurityGroupStateEvent(msg.getId());<NEW_LINE>evt.setInventory(SecurityGroupInventory.valueOf(vo));<NEW_LINE>bus.publish(evt);<NEW_LINE>}
returnHostSecurityGroupMember(msg.getUuid());
468,318
public ProjectTask updateDiscount(ProjectTask projectTask) {<NEW_LINE>PriceList priceList = projectTask.getProject().getPriceList();<NEW_LINE>if (priceList == null) {<NEW_LINE>this.emptyDiscounts(projectTask);<NEW_LINE>return projectTask;<NEW_LINE>}<NEW_LINE>PriceListLine priceListLine = this.getPriceListLine(projectTask, <MASK><NEW_LINE>Map<String, Object> discounts = priceListService.getReplacedPriceAndDiscounts(priceList, priceListLine, projectTask.getUnitPrice());<NEW_LINE>if (discounts == null) {<NEW_LINE>this.emptyDiscounts(projectTask);<NEW_LINE>} else {<NEW_LINE>projectTask.setDiscountTypeSelect((Integer) discounts.get("discountTypeSelect"));<NEW_LINE>projectTask.setDiscountAmount((BigDecimal) discounts.get("discountAmount"));<NEW_LINE>if (discounts.get("price") != null) {<NEW_LINE>projectTask.setPriceDiscounted((BigDecimal) discounts.get("price"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return projectTask;<NEW_LINE>}
priceList, projectTask.getUnitPrice());
1,048,047
@RequiresPermissions("app:view")<NEW_LINE>public RestResponse list(Application app, RestRequest request) {<NEW_LINE>IPage<Application> applicationList = applicationService.page(app, request);<NEW_LINE>List<Application> appRecords = applicationList.getRecords();<NEW_LINE>List<Long> appIds = appRecords.stream().map(Application::getId).collect(Collectors.toList());<NEW_LINE>Map<Long, PipelineStatus> <MASK><NEW_LINE>// add building pipeline status info and app control info<NEW_LINE>appRecords = appRecords.stream().peek(e -> {<NEW_LINE>if (pipeStates.containsKey(e.getId())) {<NEW_LINE>e.setBuildStatus(pipeStates.get(e.getId()).getCode());<NEW_LINE>}<NEW_LINE>}).peek(e -> e.setAppControl(new AppControl().setAllowBuild(e.getBuildStatus() == null || !PipelineStatus.running.getCode().equals(e.getBuildStatus())).setAllowStart(PipelineStatus.success.getCode().equals(e.getBuildStatus()) && !e.shouldBeTrack()).setAllowStop(e.isRunning()))).collect(Collectors.toList());<NEW_LINE>applicationList.setRecords(appRecords);<NEW_LINE>return RestResponse.success(applicationList);<NEW_LINE>}
pipeStates = appBuildPipeService.listPipelineStatus(appIds);
11,117
public static ListAppResponse unmarshall(ListAppResponse listAppResponse, UnmarshallerContext _ctx) {<NEW_LINE>listAppResponse.setRequestId(_ctx.stringValue("ListAppResponse.RequestId"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNum(_ctx.integerValue("ListAppResponse.Data.PageNum"));<NEW_LINE>data.setPageSize(_ctx.integerValue("ListAppResponse.Data.PageSize"));<NEW_LINE>data.setTotalPages(_ctx.integerValue("ListAppResponse.Data.TotalPages"));<NEW_LINE>data.setTotalElements(_ctx.integerValue("ListAppResponse.Data.TotalElements"));<NEW_LINE>List<Apps> appList = new ArrayList<Apps>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListAppResponse.Data.AppList.Length"); i++) {<NEW_LINE>Apps apps = new Apps();<NEW_LINE>apps.setName(_ctx.stringValue("ListAppResponse.Data.AppList[" + i + "].Name"));<NEW_LINE>apps.setUsageRange(_ctx.stringValue("ListAppResponse.Data.AppList[" + i + "].UsageRange"));<NEW_LINE>apps.set_Package(_ctx.stringValue<MASK><NEW_LINE>apps.setParentType(_ctx.stringValue("ListAppResponse.Data.AppList[" + i + "].ParentType"));<NEW_LINE>apps.setSource(_ctx.stringValue("ListAppResponse.Data.AppList[" + i + "].Source"));<NEW_LINE>List<String> subType = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListAppResponse.Data.AppList[" + i + "].SubType.Length"); j++) {<NEW_LINE>subType.add(_ctx.stringValue("ListAppResponse.Data.AppList[" + i + "].SubType[" + j + "]"));<NEW_LINE>}<NEW_LINE>apps.setSubType(subType);<NEW_LINE>appList.add(apps);<NEW_LINE>}<NEW_LINE>data.setAppList(appList);<NEW_LINE>listAppResponse.setData(data);<NEW_LINE>return listAppResponse;<NEW_LINE>}
("ListAppResponse.Data.AppList[" + i + "].Package"));
1,563,558
public ApiResponse<File> filesCopyWithHttpInfo(String id, CopyFileRequest copyFileRequest) throws ApiException {<NEW_LINE>Object localVarPostBody = copyFileRequest;<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 filesCopy");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'copyFileRequest' is set<NEW_LINE>if (copyFileRequest == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'copyFileRequest' when calling filesCopy");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/files/{id}/copy".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[] localVarAccepts = { "application/json", "text/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json", "text/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>GenericType<File> localVarReturnType = new GenericType<File>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, <MASK><NEW_LINE>}
localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
1,235,742
public void createControl(Composite ancestor) {<NEW_LINE>Font font = ancestor.getFont();<NEW_LINE>Composite parent = SWTFactory.createComposite(ancestor, font, 2, 1, GridData.FILL_BOTH);<NEW_LINE>control = parent;<NEW_LINE>SWTFactory.createLabel(parent, "ngrok Installations:", 2);<NEW_LINE>table = new Table(parent, SWT.CHECK | SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);<NEW_LINE>GridData gd <MASK><NEW_LINE>gd.heightHint = 250;<NEW_LINE>gd.widthHint = 350;<NEW_LINE>table.setLayoutData(gd);<NEW_LINE>table.setFont(font);<NEW_LINE>table.setHeaderVisible(true);<NEW_LINE>table.setLinesVisible(true);<NEW_LINE>TableColumn column = new TableColumn(table, SWT.NULL);<NEW_LINE>column.setText("Location");<NEW_LINE>column.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>sortByLocation();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>ngrokList = new CheckboxTableViewer(table);<NEW_LINE>ngrokList.setLabelProvider(new NGROKLabelProvider());<NEW_LINE>ngrokList.setContentProvider(new NGROKContentProvider());<NEW_LINE>// by default, sort by name<NEW_LINE>sortByLocation();<NEW_LINE>ngrokList.addSelectionChangedListener(new ISelectionChangedListener() {<NEW_LINE><NEW_LINE>public void selectionChanged(SelectionChangedEvent evt) {<NEW_LINE>enableButtons();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>ngrokList.addCheckStateListener(new ICheckStateListener() {<NEW_LINE><NEW_LINE>public void checkStateChanged(CheckStateChangedEvent event) {<NEW_LINE>if (event.getChecked()) {<NEW_LINE>setCheckedNGROK((String) event.getElement());<NEW_LINE>} else {<NEW_LINE>setCheckedNGROK(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>ngrokList.addDoubleClickListener(new IDoubleClickListener() {<NEW_LINE><NEW_LINE>public void doubleClick(DoubleClickEvent e) {<NEW_LINE>if (!ngrokList.getSelection().isEmpty()) {<NEW_LINE>editNGROK();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>table.addKeyListener(new KeyAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void keyPressed(KeyEvent event) {<NEW_LINE>if (event.character == SWT.DEL && event.stateMask == 0) {<NEW_LINE>if (removeButton.isEnabled()) {<NEW_LINE>removeNGROKs();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Composite buttons = SWTFactory.createComposite(parent, font, 1, 1, GridData.VERTICAL_ALIGN_BEGINNING, 0, 0);<NEW_LINE>addButton = SWTFactory.createPushButton(buttons, "Add...", null);<NEW_LINE>addButton.addListener(SWT.Selection, new Listener() {<NEW_LINE><NEW_LINE>public void handleEvent(Event evt) {<NEW_LINE>addNGROK();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>editButton = SWTFactory.createPushButton(buttons, "Edit...", null);<NEW_LINE>editButton.addListener(SWT.Selection, new Listener() {<NEW_LINE><NEW_LINE>public void handleEvent(Event evt) {<NEW_LINE>editNGROK();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>removeButton = SWTFactory.createPushButton(buttons, "Remove...", null);<NEW_LINE>removeButton.addListener(SWT.Selection, new Listener() {<NEW_LINE><NEW_LINE>public void handleEvent(Event evt) {<NEW_LINE>removeNGROKs();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>SWTFactory.createVerticalSpacer(parent, 1);<NEW_LINE>fillWithWorkspaceNGROKs();<NEW_LINE>enableButtons();<NEW_LINE>addButton.setEnabled(true);<NEW_LINE>}
= new GridData(GridData.FILL_BOTH);
1,242,584
// Writes ic_launcher.xml to initialize adaptive icon<NEW_LINE>private boolean writeICLauncher(File adaptiveIconFile, boolean isRound) {<NEW_LINE><MASK><NEW_LINE>String packageName = Signatures.getPackageName(mainClass);<NEW_LINE>try {<NEW_LINE>BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(adaptiveIconFile), "UTF-8"));<NEW_LINE>out.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");<NEW_LINE>out.write("<adaptive-icon " + "xmlns:android=\"http://schemas.android.com/apk/res/android\" " + ">\n");<NEW_LINE>out.write("<background android:drawable=\"@color/ic_launcher_background\" />\n");<NEW_LINE>out.write("<foreground android:drawable=\"@mipmap/ic_launcher_foreground\" />\n");<NEW_LINE>out.write("</adaptive-icon>\n");<NEW_LINE>out.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>userErrors.print(String.format(ERROR_IN_STAGE, "ic launcher"));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
String mainClass = project.getMainClass();
1,671,102
private void removeDefaultCutCopyPaste(InputMap map) {<NEW_LINE>// NOI18N<NEW_LINE>putActionDelegate(map, KeyStroke.getKeyStroke("control C"));<NEW_LINE>// NOI18N<NEW_LINE>map.put(KeyStroke.getKeyStroke("control V"), "none");<NEW_LINE>// NOI18N<NEW_LINE>map.put(KeyStroke.getKeyStroke("control X"), "none");<NEW_LINE>// NOI18N<NEW_LINE>putActionDelegate(map, KeyStroke.getKeyStroke("COPY"));<NEW_LINE>// NOI18N<NEW_LINE>map.put(KeyStroke.getKeyStroke("PASTE"), "none");<NEW_LINE>// NOI18N<NEW_LINE>map.put(KeyStroke.getKeyStroke("CUT"), "none");<NEW_LINE>if (Utilities.isMac()) {<NEW_LINE>// NOI18N<NEW_LINE>putActionDelegate(map, KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.META_MASK));<NEW_LINE>// NOI18N<NEW_LINE>map.put(KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.META_MASK), "none");<NEW_LINE>// NOI18N<NEW_LINE>map.put(KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.META_MASK), "none");<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>putActionDelegate(map, KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_DOWN_MASK));<NEW_LINE>// NOI18N<NEW_LINE>map.put(KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.CTRL_DOWN_MASK), "none");<NEW_LINE>// NOI18N<NEW_LINE>map.put(KeyStroke.getKeyStroke(KeyEvent.VK_V<MASK><NEW_LINE>}<NEW_LINE>}
, InputEvent.CTRL_DOWN_MASK), "none");
827,870
public void doHandle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {<NEW_LINE>ServletHolder servletHolder = (ServletHolder) baseRequest.getUserIdentityScope();<NEW_LINE>FilterChain chain = null;<NEW_LINE>// find the servlet<NEW_LINE>if (servletHolder != null && _filterMappings.size() > 0)<NEW_LINE>chain = getFilterChain(baseRequest, target.startsWith("/") ? target : null, servletHolder);<NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug("chain={}", chain);<NEW_LINE>try {<NEW_LINE>if (servletHolder == null)<NEW_LINE>notFound(baseRequest, request, response);<NEW_LINE>else {<NEW_LINE>// unwrap any tunnelling of base Servlet request/responses<NEW_LINE>ServletRequest req = request;<NEW_LINE>if (req instanceof ServletRequestHttpWrapper)<NEW_LINE>req = ((ServletRequestHttpWrapper) req).getRequest();<NEW_LINE>ServletResponse res = response;<NEW_LINE>if (res instanceof ServletResponseHttpWrapper)<NEW_LINE>res = ((ServletResponseHttpWrapper) res).getResponse();<NEW_LINE>// Do the filter/handling thang<NEW_LINE>servletHolder.prepare(baseRequest, req, res);<NEW_LINE>if (chain != null)<NEW_LINE>chain.doFilter(req, res);<NEW_LINE>else<NEW_LINE>servletHolder.<MASK><NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (servletHolder != null)<NEW_LINE>baseRequest.setHandled(true);<NEW_LINE>}<NEW_LINE>}
handle(baseRequest, req, res);
1,359,640
public Object visitar(NoCaso noCaso) throws ExcecaoVisitaASA {<NEW_LINE>setarPaiDoNo(noCaso);<NEW_LINE>if (noCaso.getExpressao() != null) {<NEW_LINE>TipoDado tipoDado = (TipoDado) noCaso.getExpressao().aceitar(this);<NEW_LINE>if ((tipoDadoEscolha.peek() == TipoDado.INTEIRO) || (tipoDadoEscolha.peek() == TipoDado.CARACTER)) {<NEW_LINE>if (tipoDado != tipoDadoEscolha.peek()) {<NEW_LINE>notificarErroSemantico(new ErroTiposIncompativeis(noCaso, tipoDado, tipoDadoEscolha.peek()));<NEW_LINE>}<NEW_LINE>} else if ((tipoDado != TipoDado.INTEIRO) && (tipoDado != TipoDado.CARACTER)) {<NEW_LINE>notificarErroSemantico(new ErroTiposIncompativeis(noCaso, tipoDado, TipoDado.INTEIRO, TipoDado.CARACTER));<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>return null;<NEW_LINE>}
analisarListaBlocos(noCaso.getBlocos());
1,118,781
void validate() {<NEW_LINE>Collections.sort(positionalParameters, new PositionalParametersSorter());<NEW_LINE>validatePositionalParameters(positionalParameters);<NEW_LINE>List<String> wrongUsageHelpAttr = new ArrayList<String>();<NEW_LINE>List<String> wrongVersionHelpAttr <MASK><NEW_LINE>List<String> usageHelpAttr = new ArrayList<String>();<NEW_LINE>List<String> versionHelpAttr = new ArrayList<String>();<NEW_LINE>for (OptionSpec option : options()) {<NEW_LINE>if (option.usageHelp()) {<NEW_LINE>usageHelpAttr.add(option.longestName());<NEW_LINE>if (!isBoolean(option.type())) {<NEW_LINE>wrongUsageHelpAttr.add(option.longestName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (option.versionHelp()) {<NEW_LINE>versionHelpAttr.add(option.longestName());<NEW_LINE>if (!isBoolean(option.type())) {<NEW_LINE>wrongVersionHelpAttr.add(option.longestName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String wrongType = "Non-boolean options like %s should not be marked as '%s=true'. Usually a command has one %s boolean flag that triggers display of the %s. Alternatively, consider using @Command(mixinStandardHelpOptions = true) on your command instead.";<NEW_LINE>String multiple = "Multiple options %s are marked as '%s=true'. Usually a command has only one %s option that triggers display of the %s. Alternatively, consider using @Command(mixinStandardHelpOptions = true) on your command instead.";<NEW_LINE>if (!wrongUsageHelpAttr.isEmpty()) {<NEW_LINE>throw new InitializationException(String.format(wrongType, wrongUsageHelpAttr, "usageHelp", "--help", "usage help message"));<NEW_LINE>}<NEW_LINE>if (!wrongVersionHelpAttr.isEmpty()) {<NEW_LINE>throw new InitializationException(String.format(wrongType, wrongVersionHelpAttr, "versionHelp", "--version", "version information"));<NEW_LINE>}<NEW_LINE>if (usageHelpAttr.size() > 1) {<NEW_LINE>CommandLine.tracer().warn(multiple, usageHelpAttr, "usageHelp", "--help", "usage help message");<NEW_LINE>}<NEW_LINE>if (versionHelpAttr.size() > 1) {<NEW_LINE>CommandLine.tracer().warn(multiple, versionHelpAttr, "versionHelp", "--version", "version information");<NEW_LINE>}<NEW_LINE>}
= new ArrayList<String>();
1,512,916
protected HyperParameters samplingHyperParameters(HyperParameters hyperParameters, DenseMatrix factors, DenseVector normalMu0, double normalBeta0, DenseMatrix WishartScale0, double WishartNu0) throws LibrecException {<NEW_LINE><MASK><NEW_LINE>int numColumns = factors.columnSize();<NEW_LINE>DenseVector mean = new VectorBasedDenseVector(numFactors);<NEW_LINE>for (int i = 0; i < numColumns; i++) {<NEW_LINE>mean.set(i, factors.column(i).mean());<NEW_LINE>}<NEW_LINE>DenseMatrix populationVariance = factors.covariance();<NEW_LINE>double betaPost = normalBeta0 + numRows;<NEW_LINE>DenseVector muPost = normalMu0.times(normalBeta0).plus(mean.times(numRows)).times(1.0 / betaPost);<NEW_LINE>DenseMatrix WishartScalePost = WishartScale0.plus(populationVariance.times(numRows));<NEW_LINE>DenseVector muError = normalMu0.minus(mean);<NEW_LINE>WishartScalePost = WishartScalePost.plus(muError.outer(muError).times(normalBeta0 * numRows / betaPost));<NEW_LINE>WishartScalePost = WishartScalePost.inverse();<NEW_LINE>WishartScalePost = WishartScalePost.plus(WishartScalePost.transpose()).times(0.5);<NEW_LINE>DenseMatrix variance = Randoms.wishart(WishartScalePost, numRows + numColumns);<NEW_LINE>if (variance != null) {<NEW_LINE>hyperParameters.variance = variance;<NEW_LINE>}<NEW_LINE>DenseMatrix normalVariance = hyperParameters.variance.times(normalBeta0).inverse().cholesky();<NEW_LINE>if (normalVariance != null) {<NEW_LINE>normalVariance = normalVariance.transpose();<NEW_LINE>DenseVector normalRdn = new VectorBasedDenseVector(numColumns);<NEW_LINE>for (int f = 0; f < numFactors; f++) normalRdn.set(f, Randoms.gaussian(0, 1));<NEW_LINE>hyperParameters.mu = normalVariance.times(normalRdn).plus(muPost);<NEW_LINE>}<NEW_LINE>return hyperParameters;<NEW_LINE>}
int numRows = factors.rowSize();
1,118,185
public static void main(String[] args) {<NEW_LINE>Options options = new Options();<NEW_LINE>options.addRequiredOption("p", "port", true, "port number");<NEW_LINE>options.addRequiredOption("l", "loadPath", true, ".jar files path for dynamic loading");<NEW_LINE>CommandLine line = null;<NEW_LINE>try {<NEW_LINE>CommandLineParser parser = new DefaultParser();<NEW_LINE>line = parser.parse(options, args);<NEW_LINE>} catch (ParseException e) {<NEW_LINE>HelpFormatter formatter = new HelpFormatter();<NEW_LINE><MASK><NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ParserGrpcServer server = new ParserGrpcServer(Integer.parseInt(line.getOptionValue("p")), line.getOptionValue("l"));<NEW_LINE>server.start();<NEW_LINE>server.blockUntilShutdown();<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("start server failed");<NEW_LINE>System.err.printf("%s: %s\n", e.getClass(), e.getMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>}
formatter.printHelp("Parser Command Line", options);
249,547
final ResetEbsDefaultKmsKeyIdResult executeResetEbsDefaultKmsKeyId(ResetEbsDefaultKmsKeyIdRequest resetEbsDefaultKmsKeyIdRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(resetEbsDefaultKmsKeyIdRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ResetEbsDefaultKmsKeyIdRequest> request = null;<NEW_LINE>Response<ResetEbsDefaultKmsKeyIdResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new ResetEbsDefaultKmsKeyIdRequestMarshaller().marshall(super.beforeMarshalling(resetEbsDefaultKmsKeyIdRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ResetEbsDefaultKmsKeyId");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ResetEbsDefaultKmsKeyIdResult> responseHandler = new StaxResponseHandler<ResetEbsDefaultKmsKeyIdResult>(new ResetEbsDefaultKmsKeyIdResultStaxUnmarshaller());<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,435,921
public static void down(GrayF64 input, GrayF64 output) {<NEW_LINE>int maxY = input.height - input.height % 2;<NEW_LINE>int maxX = input.width - input.width % 2;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, maxY, 2, y -> {<NEW_LINE>for (int y = 0; y < maxY; y += 2) {<NEW_LINE>int indexOut = output.startIndex + (y / 2) * output.stride;<NEW_LINE>int indexIn0 = input.startIndex + y * input.stride;<NEW_LINE>int indexIn1 = indexIn0 + input.stride;<NEW_LINE>for (int x = 0; x < maxX; x += 2) {<NEW_LINE>double total = input.data[indexIn0++];<NEW_LINE>total += input.data[indexIn0++];<NEW_LINE>total += input.data[indexIn1++];<NEW_LINE>total += input.data[indexIn1++];<NEW_LINE>output.data[indexOut++] = (total / 4);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>if (maxX != input.width) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, maxY, 2, y -> {<NEW_LINE>for (int y = 0; y < maxY; y += 2) {<NEW_LINE>int indexOut = output.startIndex + (y / 2) * output<MASK><NEW_LINE>int indexIn0 = input.startIndex + y * input.stride + maxX;<NEW_LINE>int indexIn1 = indexIn0 + input.stride;<NEW_LINE>double total = input.data[indexIn0];<NEW_LINE>total += input.data[indexIn1];<NEW_LINE>output.data[indexOut] = (total / 2);<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}<NEW_LINE>if (maxY != input.height) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, maxX, 2, x -> {<NEW_LINE>for (int x = 0; x < maxX; x += 2) {<NEW_LINE>int indexOut = output.startIndex + (output.height - 1) * output.stride + x / 2;<NEW_LINE>int indexIn0 = input.startIndex + (input.height - 1) * input.stride + x;<NEW_LINE>double total = input.data[indexIn0++];<NEW_LINE>total += input.data[indexIn0++];<NEW_LINE>output.data[indexOut++] = (total / 2);<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}<NEW_LINE>if (maxX != input.width && maxY != input.height) {<NEW_LINE>int indexOut = output.startIndex + (output.height - 1) * output.stride + output.width - 1;<NEW_LINE>int indexIn = input.startIndex + (input.height - 1) * input.stride + input.width - 1;<NEW_LINE>output.data[indexOut] = input.data[indexIn];<NEW_LINE>}<NEW_LINE>}
.stride + output.width - 1;
1,412,032
private Object processFallbackStage(FaultToleranceInvocation invocation) throws Exception {<NEW_LINE>if (!isFallbackPresent()) {<NEW_LINE>return processRetryStage(invocation);<NEW_LINE>}<NEW_LINE>logger.log(Level.FINER, "Proceeding invocation with fallback semantics");<NEW_LINE>invocation.trace("executeFallbackMethod");<NEW_LINE>try {<NEW_LINE>return processRetryStage(invocation);<NEW_LINE>} catch (Exception | Error ex) {<NEW_LINE>if (!fallback.isFallbackApplied(ex)) {<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>invocation.metrics.incrementFallbackCallsTotal();<NEW_LINE>if (fallback.isHandlerPresent()) {<NEW_LINE>logger.log(Level.FINE, "Using fallback class: {0}", fallback.value.getName());<NEW_LINE>return invocation.context.<MASK><NEW_LINE>}<NEW_LINE>logger.log(Level.FINE, "Using fallback method: {0}", fallback.method.getName());<NEW_LINE>return invocation.context.fallbackInvoke(fallback.method);<NEW_LINE>} finally {<NEW_LINE>invocation.endTrace();<NEW_LINE>}<NEW_LINE>}
fallbackHandle(fallback.value, ex);
1,576,592
public String handleVoiceMessage(String myDom) throws JDOMException, IOException {<NEW_LINE>String mobileNum = "";<NEW_LINE>List<String> listVal = new ArrayList<>();<NEW_LINE>listVal.add("application/json");<NEW_LINE>Map<String, List<String>> values = new HashMap<>();<NEW_LINE><MASK><NEW_LINE>ClientOverrideConfiguration config2 = ClientOverrideConfiguration.builder().headers(values).build();<NEW_LINE>PinpointSmsVoiceClient client = PinpointSmsVoiceClient.builder().overrideConfiguration(config2).region(Region.US_EAST_1).build();<NEW_LINE>SAXBuilder builder = new SAXBuilder();<NEW_LINE>Document jdomDocument = builder.build(new InputSource(new StringReader(myDom)));<NEW_LINE>org.jdom2.Element root = jdomDocument.getRootElement();<NEW_LINE>// get a list of children elements.<NEW_LINE>List<org.jdom2.Element> students = root.getChildren("Student");<NEW_LINE>for (org.jdom2.Element element : students) {<NEW_LINE>mobileNum = element.getChildText("Phone");<NEW_LINE>sendVoiceMsg(client, mobileNum);<NEW_LINE>}<NEW_LINE>client.close();<NEW_LINE>return mobileNum;<NEW_LINE>}
values.put("Content-Type", listVal);
1,211,777
public LiteralExpression visitFilterProjection(FilterProjectionExpression expression) {<NEW_LINE>LiteralExpression leftResult = expression.getLeft().accept(this);<NEW_LINE>// If LHS is not an array or is empty, then just do basic checks on RHS using ANY + ARRAY.<NEW_LINE>if (!leftResult.isArrayValue() || leftResult.expectArrayValue().isEmpty()) {<NEW_LINE>if (!leftResult.isArrayValue() && leftResult.getType() != RuntimeType.ANY) {<NEW_LINE>danger(expression, "Filter projection performed on " + leftResult.getType());<NEW_LINE>}<NEW_LINE>// Check the comparator and RHS.<NEW_LINE>TypeChecker rightVisitor = new TypeChecker(ANY, problems);<NEW_LINE>expression.getComparison().accept(rightVisitor);<NEW_LINE>expression.getRight().accept(rightVisitor);<NEW_LINE>return ARRAY;<NEW_LINE>}<NEW_LINE>// It's a non-empty array, perform the actual filter.<NEW_LINE>List<Object> result = new ArrayList<>();<NEW_LINE>for (Object value : leftResult.expectArrayValue()) {<NEW_LINE>LiteralExpression literalValue = LiteralExpression.from(value);<NEW_LINE>TypeChecker rightVisitor <MASK><NEW_LINE>LiteralExpression comparisonValue = expression.getComparison().accept(rightVisitor);<NEW_LINE>if (comparisonValue.isTruthy()) {<NEW_LINE>LiteralExpression rightValue = expression.getRight().accept(rightVisitor);<NEW_LINE>if (!rightValue.isNullValue()) {<NEW_LINE>result.add(rightValue.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new LiteralExpression(result);<NEW_LINE>}
= new TypeChecker(literalValue, problems);
1,074,554
public ParameterAttribute unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ParameterAttribute parameterAttribute = new ParameterAttribute();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("key", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>parameterAttribute.setKey(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("stringValue", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>parameterAttribute.setStringValue(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return parameterAttribute;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
645,396
public RDSDatabaseCredentials unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>RDSDatabaseCredentials rDSDatabaseCredentials = new RDSDatabaseCredentials();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Username", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>rDSDatabaseCredentials.setUsername(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Password", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>rDSDatabaseCredentials.setPassword(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return rDSDatabaseCredentials;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,434,657
@SaCheckPermission("cms.link.class")<NEW_LINE>public Object data(@Param("searchName") String searchName, @Param("searchKeyword") String searchKeyword, @Param("pageNumber") int pageNumber, @Param("pageSize") int pageSize, @Param("pageOrderName") String pageOrderName, @Param("pageOrderBy") String pageOrderBy) {<NEW_LINE>try {<NEW_LINE>Cnd cnd = Cnd.NEW();<NEW_LINE>if (!Strings.isBlank(searchName) && !Strings.isBlank(searchKeyword)) {<NEW_LINE>cnd.and(searchName, "like", "%" + searchKeyword + "%");<NEW_LINE>}<NEW_LINE>if (Strings.isNotBlank(pageOrderName) && Strings.isNotBlank(pageOrderBy)) {<NEW_LINE>cnd.orderBy(pageOrderName<MASK><NEW_LINE>}<NEW_LINE>return Result.success().addData(cmsLinkClassService.listPage(pageNumber, pageSize, cnd));<NEW_LINE>} catch (Exception e) {<NEW_LINE>return Result.error();<NEW_LINE>}<NEW_LINE>}
, PageUtil.getOrder(pageOrderBy));
1,425,888
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void createPartControl(Composite parent) {<NEW_LINE>WebBrowserEditorInput input = getWebBrowserEditorInput();<NEW_LINE>int style = 0;<NEW_LINE>if (input == null || input.isLocationBarLocal()) {<NEW_LINE>style |= WebBrowserViewer.NAVIGATION_BAR;<NEW_LINE>}<NEW_LINE>if (input == null || input.isToolbarLocal()) {<NEW_LINE>style |= WebBrowserViewer.NAVIGATION_BAR;<NEW_LINE>}<NEW_LINE>webBrowser = new WebBrowserViewer(parent, style);<NEW_LINE>Browser browser = (Browser) webBrowser.getBrowser();<NEW_LINE>browser.addProgressListener(new ProgressListener() {<NEW_LINE><NEW_LINE>public void changed(ProgressEvent event) {<NEW_LINE>if (event.total == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (event.current == 0) {<NEW_LINE>IProgressMonitor progressMonitor = getStatusBarProgressMonitor();<NEW_LINE>progressMonitor.done();<NEW_LINE>progressMonitor.beginTask(StringUtil.EMPTY, event.total);<NEW_LINE>progressWorked = 0;<NEW_LINE>}<NEW_LINE>if (progressWorked < event.current) {<NEW_LINE>getStatusBarProgressMonitor().<MASK><NEW_LINE>progressWorked = event.current;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>public void completed(ProgressEvent event) {<NEW_LINE>getStatusBarProgressMonitor().done();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>browser.addTitleListener(new TitleListener() {<NEW_LINE><NEW_LINE>public void changed(TitleEvent event) {<NEW_LINE>setTitleToolTip(event.title);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>webBrowser.setURL(initialURL);<NEW_LINE>}
worked(event.current - progressWorked);
239,265
private File loadIncludeFile(String includeName) {<NEW_LINE>try {<NEW_LINE>includeName += ".usl";<NEW_LINE>File cacheFile = new File(cacheFolder, includeName);<NEW_LINE>File tmpFile = new File(tmpFolder, includeName);<NEW_LINE>if (cacheFile.exists())<NEW_LINE>return cacheFile;<NEW_LINE>boolean snapshot = includeName.endsWith("-SNAPSHOT.usl");<NEW_LINE>for (String includeSource : includeSources) {<NEW_LINE>if (includeSource.startsWith("https://") || includeSource.startsWith("http://")) {<NEW_LINE>URL url = new URL(includeSource + includeName);<NEW_LINE>HttpURLConnection connection = (HttpURLConnection) url.openConnection();<NEW_LINE>final int responseCode = connection.getResponseCode();<NEW_LINE>if (responseCode != 200) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>System.out.println("Download include file " + includeSource + includeName + "...");<NEW_LINE>ReadableByteChannel rbc = Channels.newChannel(url.openStream());<NEW_LINE>FileOutputStream fos = new FileOutputStream(snapshot ? tmpFile : cacheFile);<NEW_LINE>fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);<NEW_LINE>return snapshot ? tmpFile : cacheFile;<NEW_LINE>} else {<NEW_LINE>File localFile = new File(includeSource, includeName);<NEW_LINE>if (localFile.exists())<NEW_LINE>return localFile;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>StringBuilder exceptionMsg = new StringBuilder();<NEW_LINE>exceptionMsg.append("Could not find '").append(includeName).append("' include. Searched in the following locations:\n");<NEW_LINE>for (String includeSource : includeSources) {<NEW_LINE>exceptionMsg.append("\t").append(includeSource <MASK><NEW_LINE>}<NEW_LINE>throw new IllegalStateException(exceptionMsg.toString());<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new IllegalStateException("Error during include file downloading", e);<NEW_LINE>}<NEW_LINE>}
+ includeName).append("\n");
360,159
private Map<String, Object> toColumnTypeDefault(String defaultValue, String dataType, String dataFormat) {<NEW_LINE>String <MASK><NEW_LINE>String sqlDefault = "";<NEW_LINE>if (defaultValue == null || defaultValue.toUpperCase(Locale.ROOT).equals("NULL")) {<NEW_LINE>sqlType = "null";<NEW_LINE>}<NEW_LINE>// special case for keywords if needed<NEW_LINE>switch(sqlType) {<NEW_LINE>case SqlType.Boolean:<NEW_LINE>case SqlType.Int:<NEW_LINE>case SqlType.Long:<NEW_LINE>case SqlType.Float:<NEW_LINE>case SqlType.Double:<NEW_LINE>case SqlType.Decimal:<NEW_LINE>case SqlType.Text:<NEW_LINE>case SqlType.Varchar:<NEW_LINE>case SqlType.Date:<NEW_LINE>case SqlType.DateTime:<NEW_LINE>sqlDefault = defaultValue;<NEW_LINE>case SqlType.Blob:<NEW_LINE>case SqlType.Json:<NEW_LINE>throw new RuntimeException("The BLOB and JSON data types cannot be assigned a default value");<NEW_LINE>default:<NEW_LINE>sqlDefault = "NULL";<NEW_LINE>}<NEW_LINE>Map<String, Object> args = new HashMap<String, Object>();<NEW_LINE>processTypeArgs(sqlType, null, null, null, args);<NEW_LINE>args.put("defaultValue", sqlDefault);<NEW_LINE>return args;<NEW_LINE>}
sqlType = toColumnType(dataType, dataFormat);
661,524
public void replayDropDb(String dbName, boolean isForceDrop) throws DdlException {<NEW_LINE>tryLock(true);<NEW_LINE>try {<NEW_LINE>Database db = fullNameToDb.get(dbName);<NEW_LINE>db.writeLock();<NEW_LINE>try {<NEW_LINE>Set<String> tableNames = db.getTableNamesWithLock();<NEW_LINE>unprotectDropDb(db, isForceDrop, true);<NEW_LINE>if (!isForceDrop) {<NEW_LINE>Catalog.getCurrentRecycleBin(<MASK><NEW_LINE>} else {<NEW_LINE>Catalog.getCurrentCatalog().onEraseDatabase(db.getId());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>db.writeUnlock();<NEW_LINE>}<NEW_LINE>fullNameToDb.remove(dbName);<NEW_LINE>idToDb.remove(db.getId());<NEW_LINE>final Cluster cluster = nameToCluster.get(db.getClusterName());<NEW_LINE>cluster.removeDb(dbName, db.getId());<NEW_LINE>LOG.info("finish replay drop db, name: {}, id: {}", dbName, db.getId());<NEW_LINE>} finally {<NEW_LINE>unlock();<NEW_LINE>}<NEW_LINE>}
).recycleDatabase(db, tableNames);
867,178
public Result restoreBackup(UUID customerUUID) {<NEW_LINE>Customer customer = Customer.getOrBadRequest(customerUUID);<NEW_LINE>RestoreBackupParams taskParams = parseJsonAndValidate(RestoreBackupParams.class);<NEW_LINE>if (taskParams.newOwner != null) {<NEW_LINE>if (!Pattern.matches(VALID_OWNER_REGEX, taskParams.newOwner)) {<NEW_LINE>throw new PlatformServiceException(BAD_REQUEST, "Invalid owner rename during restore operation");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>taskParams.customerUUID = customerUUID;<NEW_LINE>UUID universeUUID = taskParams.universeUUID;<NEW_LINE>Universe universe = Universe.getOrBadRequest(universeUUID);<NEW_LINE>if (CollectionUtils.isEmpty(taskParams.backupStorageInfoList)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>backupUtil.validateRestoreOverwrites(taskParams.backupStorageInfoList, universe);<NEW_LINE>CustomerConfig customerConfig = customerConfigService.getOrBadRequest(customerUUID, taskParams.storageConfigUUID);<NEW_LINE>if (!customerConfig.getState().equals(ConfigState.Active)) {<NEW_LINE>throw new PlatformServiceException(BAD_REQUEST, "Cannot restore backup as config is queued for deletion.");<NEW_LINE>}<NEW_LINE>List<String> storageLocations = new ArrayList<String>();<NEW_LINE>for (BackupStorageInfo storageInfo : taskParams.backupStorageInfoList) {<NEW_LINE>storageLocations.add(storageInfo.storageLocation);<NEW_LINE>}<NEW_LINE>backupUtil.validateStorageConfigOnLocations(customerConfig, storageLocations);<NEW_LINE>UUID taskUUID = commissioner.submit(TaskType.RestoreBackup, taskParams);<NEW_LINE>CustomerTask.create(customer, universeUUID, taskUUID, CustomerTask.TargetType.Universe, CustomerTask.TaskType.Restore, universe.name);<NEW_LINE>auditService().createAuditEntryWithReqBody(ctx(), Audit.TargetType.Universe, universeUUID.toString(), Audit.ActionType.RestoreBackup, Json.toJson(taskParams), taskUUID);<NEW_LINE>return new YBPTask(taskUUID).asResult();<NEW_LINE>}
throw new PlatformServiceException(BAD_REQUEST, "Backup information not provided");
659,198
public InputClippingSettings unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>InputClippingSettings inputClippingSettings = new InputClippingSettings();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("inputTimecodeSource", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>inputClippingSettings.setInputTimecodeSource(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("startTimecode", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>inputClippingSettings.setStartTimecode(StartTimecodeJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("stopTimecode", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>inputClippingSettings.setStopTimecode(StopTimecodeJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return inputClippingSettings;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,338,538
public static // '(' ('...' | top_type_list?) ')' top_type_clause<NEW_LINE>boolean fun_type_100_t(PsiBuilder b, int l) {<NEW_LINE>if (!recursion_guard_(b, l, "fun_type_100_t"))<NEW_LINE>return false;<NEW_LINE>if (!nextTokenIs(b, "<type>", ERL_PAR_LEFT))<NEW_LINE>return false;<NEW_LINE>boolean r, p;<NEW_LINE>Marker m = enter_section_(b, l, _NONE_, ERL_FUN_TYPE_100_T, "<type>");<NEW_LINE>r = consumeToken(b, ERL_PAR_LEFT);<NEW_LINE>// pin = 1<NEW_LINE>p = r;<NEW_LINE>r = r && report_error_(b, fun_type_100_t_1(b, l + 1));<NEW_LINE>r = p && report_error_(b, consumeToken(b, ERL_PAR_RIGHT)) && r;<NEW_LINE>r = p && top_type_clause(b, l + 1) && r;<NEW_LINE>exit_section_(b, l, <MASK><NEW_LINE>return r || p;<NEW_LINE>}
m, r, p, null);
865,648
final ListUsersResult executeListUsers(ListUsersRequest listUsersRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listUsersRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListUsersRequest> request = null;<NEW_LINE>Response<ListUsersResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListUsersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listUsersRequest));<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, "Chime");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListUsers");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListUsersResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListUsersResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
1,427,816
public void execute() throws ResourceAllocationException, ResourceUnavailableException {<NEW_LINE>HealthCheckPolicy policy = null;<NEW_LINE>boolean success = false;<NEW_LINE>try {<NEW_LINE>CallContext.current().setEventDetails("Load balancer health check policy ID : " + getEntityId());<NEW_LINE>success = _lbService.applyLBHealthCheckPolicy(this);<NEW_LINE>if (success) {<NEW_LINE>// State might be different after the rule is applied, so get new object here<NEW_LINE>policy = _entityMgr.findById(<MASK><NEW_LINE>LoadBalancer lb = _lbService.findById(policy.getLoadBalancerId());<NEW_LINE>LBHealthCheckResponse hcResponse = _responseGenerator.createLBHealthCheckPolicyResponse(policy, lb);<NEW_LINE>setResponseObject(hcResponse);<NEW_LINE>hcResponse.setResponseName(getCommandName());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (!success || (policy == null)) {<NEW_LINE>throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create health check policy");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
HealthCheckPolicy.class, getEntityId());
521,323
private void copyOrUpdateFromSelectionToGivenSchemaAndProduct(@NonNull CopyDiscountSchemaBreaksRequest request) {<NEW_LINE>final PricingConditionsId pPricingConditionsId = request.getPricingConditionsId();<NEW_LINE>final ProductId productId = request.getProductId();<NEW_LINE>final boolean allowCopyToSameSchema = request.isAllowCopyToSameSchema();<NEW_LINE>final IQueryFilter<I_M_DiscountSchemaBreak> filter = request.getFilter();<NEW_LINE>final ICompositeQueryFilter<I_M_DiscountSchemaBreak> breaksFromOtherPricingConditions = queryBL.createCompositeQueryFilter(I_M_DiscountSchemaBreak.class).setJoinAnd().addFilter(filter);<NEW_LINE>if (!allowCopyToSameSchema) {<NEW_LINE>breaksFromOtherPricingConditions.addNotEqualsFilter(I_M_DiscountSchemaBreak.COLUMNNAME_M_DiscountSchema_ID, pPricingConditionsId.getRepoId());<NEW_LINE>}<NEW_LINE>final List<PricingConditionsBreak> sourceDiscountSchemaBreaks = retrieveDiscountSchemaBreakRecords(breaksFromOtherPricingConditions);<NEW_LINE>//<NEW_LINE>// retrieve existent target discount breaks<NEW_LINE>final ICompositeQueryFilter<I_M_DiscountSchemaBreak> breaksForGivenPorductAndPricingConditions = queryBL.createCompositeQueryFilter(I_M_DiscountSchemaBreak.class).setJoinAnd().addEqualsFilter(I_M_DiscountSchemaBreak.COLUMN_M_DiscountSchema_ID, pPricingConditionsId).addEqualsFilter(I_M_DiscountSchemaBreak.COLUMNNAME_M_Product_ID, productId);<NEW_LINE>final List<<MASK><NEW_LINE>//<NEW_LINE>// find records that need to be updated and the records that needs to be copied<NEW_LINE>final Map<PricingConditionsBreak, PricingConditionsBreak> discountSchemaBreaksToUpdate = new HashMap<PricingConditionsBreak, PricingConditionsBreak>();<NEW_LINE>final List<PricingConditionsBreak> discountSchemaBreaksToCopy = new ArrayList<PricingConditionsBreak>();<NEW_LINE>for (final PricingConditionsBreak discountSchemaBreak : sourceDiscountSchemaBreaks) {<NEW_LINE>final PricingConditionsBreak exitentBreak = fetchMatchingPricingConditionBreak(discountSchemaBreak, exitentTargetDiscountBreaks);<NEW_LINE>if (exitentBreak != null) {<NEW_LINE>discountSchemaBreaksToUpdate.put(discountSchemaBreak, exitentBreak);<NEW_LINE>} else {<NEW_LINE>discountSchemaBreaksToCopy.add(discountSchemaBreak);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// copy breaks<NEW_LINE>for (final PricingConditionsBreak schemaBreak : discountSchemaBreaksToCopy) {<NEW_LINE>copyDiscountSchemaBreakWithProductId(schemaBreak.getId(), pPricingConditionsId, productId);<NEW_LINE>}<NEW_LINE>// update breaks<NEW_LINE>for (final PricingConditionsBreak schemaBreak : discountSchemaBreaksToUpdate.keySet()) {<NEW_LINE>updateDiscountSchemaBreakRecords(schemaBreak, discountSchemaBreaksToUpdate.get(schemaBreak));<NEW_LINE>}<NEW_LINE>}
PricingConditionsBreak> exitentTargetDiscountBreaks = retrieveDiscountSchemaBreakRecords(breaksForGivenPorductAndPricingConditions);
1,635,121
private void write(int pdutype, int result, int source, int reason, boolean blocking) throws IOException {<NEW_LINE>if (blocking) {<NEW_LINE>writeLock.lock();<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>int timeout = as.getConnection().getAbortTimeout();<NEW_LINE>Timeout.LOG.debug("{}: start A-ABORT timeout of {}ms", as, timeout);<NEW_LINE>if (!writeLock.tryLock(timeout, TimeUnit.MILLISECONDS)) {<NEW_LINE>Timeout.LOG.info("{}: A-ABORT timeout expired", as);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>if (!writeLock.tryLock()) {<NEW_LINE>Timeout.LOG.info("{}: A-ABORT timeout interrupted: {}", <MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Timeout.LOG.debug("{}: stop A-ABORT timeout", as);<NEW_LINE>}<NEW_LINE>byte[] b = { // pdulen<NEW_LINE>(byte) pdutype, // pdulen<NEW_LINE>0, // pdulen<NEW_LINE>0, // pdulen<NEW_LINE>0, // pdulen<NEW_LINE>0, 4, 0, (byte) result, (byte) source, (byte) reason };<NEW_LINE>try {<NEW_LINE>out.write(b);<NEW_LINE>out.flush();<NEW_LINE>} finally {<NEW_LINE>writeLock.unlock();<NEW_LINE>}<NEW_LINE>}
as, e.getMessage());
999,424
public boolean execute(final OHttpRequest iRequest, OHttpResponse iResponse) throws Exception {<NEW_LINE>checkSyntax(iRequest.getUrl(), 2, "Syntax error: document/<database>");<NEW_LINE>iRequest.getData().commandInfo = "Create document";<NEW_LINE>ODatabaseDocument db = null;<NEW_LINE>ODocument doc;<NEW_LINE>try {<NEW_LINE>db = getProfiledDatabaseInstance(iRequest);<NEW_LINE>doc = new ODocument().<MASK><NEW_LINE>ORecordInternal.setVersion(doc, 0);<NEW_LINE>// ASSURE TO MAKE THE RECORD ID INVALID<NEW_LINE>((ORecordId) doc.getIdentity()).setClusterPosition(ORID.CLUSTER_POS_INVALID);<NEW_LINE>doc.save();<NEW_LINE>iResponse.send(OHttpUtils.STATUS_CREATED_CODE, OHttpUtils.STATUS_CREATED_DESCRIPTION, OHttpUtils.CONTENT_JSON, doc.toJSON(), OHttpUtils.HEADER_ETAG + doc.getVersion());<NEW_LINE>} finally {<NEW_LINE>if (db != null)<NEW_LINE>db.close();<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
fromJSON(iRequest.getContent());
1,511,978
public void testLogViewerInvalidOption() throws Exception {<NEW_LINE>CommonTasks.writeLogMsg(Level.INFO, "executing logViewer on " + server.getServerName());<NEW_LINE>// generate a random option that is between 3 and 15 characters long startServering with "bad".<NEW_LINE>String alphabet = "abcdefghijklmnopqrstuvwxyz";<NEW_LINE>StringBuffer invalidOption = new StringBuffer();<NEW_LINE>// need the option flag first.<NEW_LINE>invalidOption.append("-bad");<NEW_LINE>Random rnd = new Random();<NEW_LINE>for (int i = 1; i <= rnd.nextInt(12); i++) {<NEW_LINE>invalidOption.append(alphabet.charAt(rnd.nextInt(alphabet.length())));<NEW_LINE>}<NEW_LINE>StringBuffer expectedResponse = new StringBuffer();<NEW_LINE>expectedResponse.append("Unknown Argument: ");<NEW_LINE>expectedResponse.append(invalidOption);<NEW_LINE>// match as a regular expression<NEW_LINE>expectedResponse.append("\\s+");<NEW_LINE>expectedResponse.append("Use option -help for usage information.");<NEW_LINE>ProgramOutput lvPrgmOut = exeLogViewer(new String[] { invalidOption.toString() });<NEW_LINE>CommonTasks.writeLogMsg(Level.INFO, "Verifying logViewer std out/err and status return code.");<NEW_LINE>logMsg(" === LogViewer's stdout: === ");<NEW_LINE>logMsg(lvPrgmOut.getStdout());<NEW_LINE>logMsg(" ");<NEW_LINE>if (lvPrgmOut.getStderr().length() > 0) {<NEW_LINE>// LogViewer reported some errors.<NEW_LINE>logMsg(" === LogViewer std.err: ===");<NEW_LINE>logMsg(lvPrgmOut.getStderr());<NEW_LINE>}<NEW_LINE>assertTrue("Failed assertion that logViewer exited with an error return code", (lvPrgmOut.getReturnCode() != 0));<NEW_LINE>assertTrue("Failed assertion that logViewer reported invalid option. Where //s is any number of spaces, expected=" + expectedResponse.toString().trim() + ". result=" + lvPrgmOut.getStdout().trim(), Pattern.matches(expectedResponse.toString(), lvPrgmOut.getStdout<MASK><NEW_LINE>}
().trim()));
133,296
protected Aggregator doCreateInternal(SearchContext searchContext, Aggregator parent, CardinalityUpperBound cardinality, Map<String, Object> metadata) throws IOException {<NEW_LINE>TermsAggregatorSupplier aggregatorSupplier = queryShardContext.getValuesSourceRegistry().getAggregator(TermsAggregationBuilder.REGISTRY_KEY, config);<NEW_LINE>BucketCountThresholds bucketCountThresholds = new BucketCountThresholds(this.bucketCountThresholds);<NEW_LINE>if (InternalOrder.isKeyOrder(order) == false && bucketCountThresholds.getShardSize() == TermsAggregationBuilder.DEFAULT_BUCKET_COUNT_THRESHOLDS.getShardSize()) {<NEW_LINE>// The user has not made a shardSize selection. Use default<NEW_LINE>// heuristic to avoid any wrong-ranking caused by distributed<NEW_LINE>// counting<NEW_LINE>bucketCountThresholds.setShardSize(BucketUtils.suggestShardSideQueueSize(bucketCountThresholds.getRequiredSize()));<NEW_LINE>}<NEW_LINE>bucketCountThresholds.ensureValidity();<NEW_LINE>return aggregatorSupplier.build(name, factories, config.getValuesSource(), order, config.format(), bucketCountThresholds, includeExclude, executionHint, searchContext, parent, <MASK><NEW_LINE>}
collectMode, showTermDocCountError, cardinality, metadata);
1,621,263
public void updateBackground(int x0, int y0, int x1, int y1, T frame) {<NEW_LINE>interpolationInput.setImage(frame);<NEW_LINE>final float minusLearn = 1.0f - learnRate;<NEW_LINE>transform.setModel(worldToCurrent);<NEW_LINE>for (int y = y0; y < y1; y++) {<NEW_LINE>int indexBG = background.startIndex + y * background.stride + x0 * background.numBands;<NEW_LINE>for (int x = x0; x < x1; x++, indexBG += 2) {<NEW_LINE>transform.compute(x, y, pixel);<NEW_LINE>if (!(pixel.x >= 0 && pixel.x < frame.width && pixel.y >= 0 && pixel.y < frame.height)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final float inputValue = interpolationInput.get(pixel.x, pixel.y);<NEW_LINE>final float meanBG = background.data[indexBG];<NEW_LINE>final float varianceBG = background.data[indexBG + 1];<NEW_LINE>if (varianceBG < 0) {<NEW_LINE><MASK><NEW_LINE>background.data[indexBG + 1] = initialVariance;<NEW_LINE>} else {<NEW_LINE>float diff = meanBG - inputValue;<NEW_LINE>background.data[indexBG] = minusLearn * meanBG + learnRate * inputValue;<NEW_LINE>background.data[indexBG + 1] = minusLearn * varianceBG + learnRate * diff * diff;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
background.data[indexBG] = inputValue;
1,198,803
public String generate() {<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>appendPackageAndCommonImports(builder, apiClassname, Arrays.<HollowSchema>asList(schema));<NEW_LINE>builder.append("import " + HollowList.class.getName() + ";\n");<NEW_LINE>builder.append("import " + HollowListSchema.class.getName() + ";\n");<NEW_LINE>builder.append("import " + HollowListDelegate.class.getName() + ";\n");<NEW_LINE>builder.append("import " + GenericHollowRecordHelper.class.getName() + ";\n\n");<NEW_LINE>builder.append("@SuppressWarnings(\"all\")\n");<NEW_LINE>if (parameterize)<NEW_LINE>builder.<MASK><NEW_LINE>else<NEW_LINE>builder.append("public class " + className + " extends HollowList<" + elementClassName + "> {\n\n");<NEW_LINE>appendConstructor(builder);<NEW_LINE>appendInstantiateMethod(builder);<NEW_LINE>appendEqualityMethod(builder);<NEW_LINE>appendAPIAccessor(builder);<NEW_LINE>appendTypeAPIAccessor(builder);<NEW_LINE>builder.append("}");<NEW_LINE>return builder.toString();<NEW_LINE>}
append("public class " + className + "<T> extends HollowList<T> {\n\n");
207,109
public void deleteIfExistsCodeSnippets() {<NEW_LINE>// BEGIN: com.azure.storage.file.datalake.DataLakeFileSystemClient.deleteIfExists<NEW_LINE>client.deleteIfExists();<NEW_LINE>// END: com.azure.storage.file.datalake.DataLakeFileSystemClient.deleteIfExists<NEW_LINE>// BEGIN: com.azure.storage.file.datalake.DataLakeFileSystemClient.deleteIfExistsWithResponse#DataLakePathDeleteOptions-Duration-Context<NEW_LINE>DataLakeRequestConditions requestConditions = new DataLakeRequestConditions().setLeaseId(leaseId).setIfUnmodifiedSince(OffsetDateTime.now().minusDays(3));<NEW_LINE>Context context = new Context("Key", "Value");<NEW_LINE>DataLakePathDeleteOptions options = new DataLakePathDeleteOptions().setIsRecursive(false).setRequestConditions(requestConditions);<NEW_LINE>Response<Void> response = client.<MASK><NEW_LINE>if (response.getStatusCode() == 404) {<NEW_LINE>System.out.println("Does not exist.");<NEW_LINE>} else {<NEW_LINE>System.out.printf("Delete completed with status %d%n", response.getStatusCode());<NEW_LINE>}<NEW_LINE>// END: com.azure.storage.file.datalake.DataLakeFileSystemClient.deleteIfExistsWithResponse#DataLakePathDeleteOptions-Duration-Context<NEW_LINE>}
deleteIfExistsWithResponse(options, timeout, context);
1,015,522
static Bundle jsonFromGoogleUser(@NonNull GoogleSignInAccount acct) {<NEW_LINE>Bundle auth = new Bundle();<NEW_LINE>auth.putString("accessToken", null);<NEW_LINE>auth.putString("accessTokenExpirationDate", null);<NEW_LINE>auth.putString("refreshToken", null);<NEW_LINE>auth.putString("idToken", acct.getIdToken());<NEW_LINE>// auth.putDouble("idTokenExpirationDate", acct.getExpirationTimeSecs());<NEW_LINE>Uri photoUrl = acct.getPhotoUrl();<NEW_LINE>Bundle user = new Bundle();<NEW_LINE>user.putString(<MASK><NEW_LINE>user.putString("displayName", acct.getDisplayName());<NEW_LINE>user.putString("firstName", acct.getGivenName());<NEW_LINE>user.putString("lastName", acct.getFamilyName());<NEW_LINE>user.putString("email", acct.getEmail());<NEW_LINE>user.putString("photoURL", photoUrl != null ? photoUrl.toString() : null);<NEW_LINE>user.putString("serverAuthCode", acct.getServerAuthCode());<NEW_LINE>user.putBundle("auth", auth);<NEW_LINE>// TODO: Bacon: If google ever surfaces this value, we should add it for parity with iOS<NEW_LINE>user.putString("domain", null);<NEW_LINE>ArrayList scopes = new ArrayList();<NEW_LINE>for (Scope scope : acct.getGrantedScopes()) {<NEW_LINE>String scopeString = scope.toString();<NEW_LINE>if (scopeString.startsWith("http")) {<NEW_LINE>scopes.add(scopeString);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>user.putStringArrayList("scopes", scopes);<NEW_LINE>return user;<NEW_LINE>}
"uid", acct.getId());
612,529
private void addNewKeys(ArrayList<String> keys, ParamAttack state, int bucketSize, ParamHolder paramBuckets, ArrayList<String> candidates, Attack paramGuess) {<NEW_LINE>if (!config.getBoolean("dynamic keyload")) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ArrayList<String> discoveredParams = new ArrayList<>();<NEW_LINE>for (String key : keys) {<NEW_LINE>String[] parsed = Keysmith.parseKey(key);<NEW_LINE>if (!(state.valueParams.contains(key) || state.params.contains(key) || candidates.contains(parsed[1]) || candidates.contains(key))) {<NEW_LINE>// || params.contains(parsed[1])<NEW_LINE>Utilities.log("Found new key: " + key);<NEW_LINE>state.valueParams.add(key);<NEW_LINE>// fixme probably adds the key in the wrong format<NEW_LINE>discoveredParams.add(key);<NEW_LINE>paramGrabber.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>paramBuckets.addParams(discoveredParams, true);<NEW_LINE>}
saveParams(paramGuess.getFirstRequest());
1,215,180
public static void checkGremlinConfig(String conf) {<NEW_LINE>YamlConfiguration yamlConfig = new YamlConfiguration();<NEW_LINE>try {<NEW_LINE>yamlConfig.load(conf);<NEW_LINE>} catch (ConfigurationException e) {<NEW_LINE>throw new HugeException("Failed to load yaml config file '%s'", conf);<NEW_LINE>}<NEW_LINE>List<ConfigurationNode> nodes = yamlConfig.getRootNode().getChildren(NODE_GRAPHS);<NEW_LINE>E.checkArgument(nodes == null || nodes.size() == 1, "Not allowed to specify multiple '%s' nodes in " + "config file '%s'", NODE_GRAPHS, conf);<NEW_LINE>if (nodes != null) {<NEW_LINE>List<ConfigurationNode> graphNames = nodes.<MASK><NEW_LINE>E.checkArgument(graphNames.isEmpty(), "Don't allow to fill value for '%s' node in " + "config file '%s'", NODE_GRAPHS, conf);<NEW_LINE>}<NEW_LINE>}
get(0).getChildren();
1,167,314
public static DescribeSagLanListResponse unmarshall(DescribeSagLanListResponse describeSagLanListResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeSagLanListResponse.setRequestId(_ctx.stringValue("DescribeSagLanListResponse.RequestId"));<NEW_LINE>List<TaskState> taskStates = new ArrayList<TaskState>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSagLanListResponse.TaskStates.Length"); i++) {<NEW_LINE>TaskState taskState = new TaskState();<NEW_LINE>taskState.setErrorMessage(_ctx.stringValue("DescribeSagLanListResponse.TaskStates[" + i + "].ErrorMessage"));<NEW_LINE>taskState.setState(_ctx.stringValue("DescribeSagLanListResponse.TaskStates[" + i + "].State"));<NEW_LINE>taskState.setErrorCode(_ctx.stringValue("DescribeSagLanListResponse.TaskStates[" + i + "].ErrorCode"));<NEW_LINE>taskState.setCreateTime(_ctx.stringValue("DescribeSagLanListResponse.TaskStates[" + i + "].CreateTime"));<NEW_LINE>taskStates.add(taskState);<NEW_LINE>}<NEW_LINE>describeSagLanListResponse.setTaskStates(taskStates);<NEW_LINE>List<Lan> lans = new ArrayList<Lan>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSagLanListResponse.Lans.Length"); i++) {<NEW_LINE>Lan lan = new Lan();<NEW_LINE>lan.setLease(_ctx.stringValue<MASK><NEW_LINE>lan.setMask(_ctx.stringValue("DescribeSagLanListResponse.Lans[" + i + "].Mask"));<NEW_LINE>lan.setEndIp(_ctx.stringValue("DescribeSagLanListResponse.Lans[" + i + "].EndIp"));<NEW_LINE>lan.setPortName(_ctx.stringValue("DescribeSagLanListResponse.Lans[" + i + "].PortName"));<NEW_LINE>lan.setStartIp(_ctx.stringValue("DescribeSagLanListResponse.Lans[" + i + "].StartIp"));<NEW_LINE>lan.setIPType(_ctx.stringValue("DescribeSagLanListResponse.Lans[" + i + "].IPType"));<NEW_LINE>lan.setIP(_ctx.stringValue("DescribeSagLanListResponse.Lans[" + i + "].IP"));<NEW_LINE>lans.add(lan);<NEW_LINE>}<NEW_LINE>describeSagLanListResponse.setLans(lans);<NEW_LINE>return describeSagLanListResponse;<NEW_LINE>}
("DescribeSagLanListResponse.Lans[" + i + "].Lease"));
823,611
public void run(RegressionEnvironment env) {<NEW_LINE>// test scalar-collection only<NEW_LINE>String[] fieldsScalarColl = "c2,c3".split(",");<NEW_LINE>String eplScalarColl = "@name('s0') select " + "sc(theString) as c0, " + "sc(intPrimitive) as c1, " + "sc(theString).allOf(v => v = 'E1') as c2, " + "sc(intPrimitive).allOf(v => v = 1) as c3 " + "from SupportBean";<NEW_LINE>env.compileDeploy<MASK><NEW_LINE>Object[][] expectedScalarColl = new Object[][] { { "c0", Collection.class, null, null }, { "c1", Collection.class, null, null }, { "c2", Boolean.class, null, null }, { "c3", Boolean.class, null, null } };<NEW_LINE>env.assertStatement("s0", statement -> SupportEventTypeAssertionUtil.assertEventTypeProperties(expectedScalarColl, statement.getEventType(), SupportEventTypeAssertionEnum.getSetWithFragment()));<NEW_LINE>env.sendEventBean(new SupportBean("E1", 1));<NEW_LINE>env.assertEventNew("s0", event -> {<NEW_LINE>EPAssertionUtil.assertEqualsExactOrder(new Object[] { "E1" }, (Collection) event.get("c0"));<NEW_LINE>EPAssertionUtil.assertEqualsExactOrder(new Object[] { 1 }, (Collection) event.get("c1"));<NEW_LINE>EPAssertionUtil.assertProps(event, fieldsScalarColl, new Object[] { true, true });<NEW_LINE>});<NEW_LINE>env.sendEventBean(new SupportBean("E2", 2));<NEW_LINE>env.assertEventNew("s0", event -> {<NEW_LINE>EPAssertionUtil.assertEqualsExactOrder(new Object[] { "E1", "E2" }, (Collection) event.get("c0"));<NEW_LINE>EPAssertionUtil.assertEqualsExactOrder(new Object[] { 1, 2 }, (Collection) event.get("c1"));<NEW_LINE>EPAssertionUtil.assertProps(event, fieldsScalarColl, new Object[] { false, false });<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>}
(eplScalarColl).addListener("s0");
168,045
public String replaceLanguageInHtml(String from) {<NEW_LINE>if (isEmpty()) {<NEW_LINE>return from;<NEW_LINE>}<NEW_LINE>Matcher <MASK><NEW_LINE>List<String> foundScripts = new ArrayList<>();<NEW_LINE>while (scriptMatcher.find()) {<NEW_LINE>foundScripts.add(scriptMatcher.toMatchResult().group(0));<NEW_LINE>}<NEW_LINE>TranslatedString translated = new TranslatedString(from);<NEW_LINE>// Longest first so that entries that contain each other don't partially replace.<NEW_LINE>Arrays.stream(HtmlLang.values()).sorted((one, two) -> Integer.compare(two.getIdentifier().length(), one.getIdentifier().length())).forEach(lang -> getNonDefault(lang).ifPresent(replacement -> translated.translate(lang.getDefault(), replacement.toString())));<NEW_LINE>StringBuilder complete = new StringBuilder(translated.length());<NEW_LINE>String[] parts = FIND_SCRIPT.split(translated.toString());<NEW_LINE>for (int i = 0; i < parts.length; i++) {<NEW_LINE>complete.append(parts[i]);<NEW_LINE>if (i < parts.length - 1) {<NEW_LINE>complete.append(replaceLanguageInJavascript(foundScripts.get(i)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return complete.toString();<NEW_LINE>}
scriptMatcher = FIND_SCRIPT.matcher(from);
1,746,694
public void serializeRef(Object value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {<NEW_LINE>jgen.writeStartObject();<NEW_LINE>int ref = this.debugger.getReferenceManager().getReference(value);<NEW_LINE>jgen.writeNumberField("ref", ref);<NEW_LINE>if (value == Types.UNDEFINED) {<NEW_LINE>jgen.writeStringField("type", "undefined");<NEW_LINE>} else if (value == Types.NULL) {<NEW_LINE>jgen.writeStringField("type", "null");<NEW_LINE>} else if (value instanceof Boolean) {<NEW_LINE>jgen.writeStringField("type", "boolean");<NEW_LINE>jgen.writeBooleanField("value", (Boolean) value);<NEW_LINE>} else if (value instanceof Double) {<NEW_LINE>jgen.writeStringField("type", "number");<NEW_LINE>jgen.writeNumberField("value", (Double) value);<NEW_LINE>} else if (value instanceof Long) {<NEW_LINE>jgen.writeStringField("type", "number");<NEW_LINE>jgen.writeNumberField("value", (Long) value);<NEW_LINE>} else if (value instanceof String) {<NEW_LINE>jgen.writeStringField("type", "string");<NEW_LINE>jgen.writeStringField("value", (String) value);<NEW_LINE>} else if (value instanceof JSFunction) {<NEW_LINE>jgen.writeStringField("type", "function");<NEW_LINE>Object name = ((JSFunction) value).get(null, "name");<NEW_LINE>if (name != Types.UNDEFINED) {<NEW_LINE>jgen.writeStringField("name", name.toString());<NEW_LINE>} else {<NEW_LINE>jgen.writeStringField("name", "");<NEW_LINE>}<NEW_LINE>jgen.writeStringField("inferredName", "");<NEW_LINE>SourceProvider source = ((<MASK><NEW_LINE>if (source != null) {<NEW_LINE>jgen.writeNumberField("scriptId", source.getId());<NEW_LINE>}<NEW_LINE>} else if (value instanceof JSObject) {<NEW_LINE>jgen.writeStringField("type", "object");<NEW_LINE>} else if (value instanceof SourceProvider) {<NEW_LINE>jgen.writeStringField("type", "script");<NEW_LINE>}<NEW_LINE>jgen.writeEndObject();<NEW_LINE>}
JSFunction) value).getSource();
95,003
public static UUID createHashicorpCAConfig(UUID customerUUID, String label, String storagePath, HashicorpVaultConfigParams hcVaultParams) throws Exception {<NEW_LINE>if (Strings.isNullOrEmpty(hcVaultParams.vaultAddr) || Strings.isNullOrEmpty(hcVaultParams.vaultToken) || Strings.isNullOrEmpty(hcVaultParams.engine) || Strings.isNullOrEmpty(hcVaultParams.mountPath) || Strings.isNullOrEmpty(hcVaultParams.role)) {<NEW_LINE>String message = String.format("Hashicorp Vault parameters provided are not valid - %s", hcVaultParams);<NEW_LINE>throw new PlatformServiceException(BAD_REQUEST, message);<NEW_LINE>}<NEW_LINE>UUID certConfigUUID = UUID.randomUUID();<NEW_LINE>VaultPKI pkiObjValidator = VaultPKI.validateVaultConfigParams(hcVaultParams);<NEW_LINE>Pair<String, String> paths = pkiObjValidator.dumpCACertBundle(storagePath, customerUUID, certConfigUUID);<NEW_LINE>Pair<Date, Date> dates = CertificateHelper.extractDatesFromCertBundle(CertificateHelper.convertStringToX509CertList(FileUtils.readFileToString(new File(paths.getLeft()))));<NEW_LINE>hcVaultParams.vaultToken = maskCertConfigData(customerUUID, hcVaultParams.vaultToken);<NEW_LINE>CertificateInfo cert = CertificateInfo.create(certConfigUUID, customerUUID, label, dates.getLeft(), dates.getRight(), <MASK><NEW_LINE>log.info("Created Root CA for universe {}.", label);<NEW_LINE>if (!CertificateInfo.isCertificateValid(certConfigUUID)) {<NEW_LINE>String errMsg = String.format("The certificate %s needs info. Update the cert and retry.", label);<NEW_LINE>log.error(errMsg);<NEW_LINE>throw new PlatformServiceException(BAD_REQUEST, errMsg);<NEW_LINE>}<NEW_LINE>List<Object> ttlInfo = pkiObjValidator.getTTL();<NEW_LINE>hcVaultParams.ttl = (long) ttlInfo.get(0);<NEW_LINE>hcVaultParams.ttlExpiry = (long) ttlInfo.get(1);<NEW_LINE>CertificateInfo rootCertConfigInfo = CertificateInfo.get(certConfigUUID);<NEW_LINE>rootCertConfigInfo.update(dates.getLeft(), dates.getRight(), paths.getLeft(), hcVaultParams);<NEW_LINE>return cert.uuid;<NEW_LINE>}
paths.getLeft(), hcVaultParams);
358,673
public DeleteMapResult deleteMap(DeleteMapRequest deleteMapRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteMapRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteMapRequest> request = null;<NEW_LINE>Response<DeleteMapResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteMapRequestMarshaller().marshall(deleteMapRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<DeleteMapResult, JsonUnmarshallerContext> unmarshaller = new DeleteMapResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<DeleteMapResult> responseHandler = new JsonResponseHandler<DeleteMapResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(<MASK><NEW_LINE>}<NEW_LINE>}
awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
943,107
public static String xmlFreeText(String documentText, Annotation annotation) {<NEW_LINE>int firstTokenCharIndex = annotation.get(CoreAnnotations.TokensAnnotation.class).get(0).<MASK><NEW_LINE>// add white space for all text before first token<NEW_LINE>String cleanedText = documentText.substring(0, firstTokenCharIndex).replaceAll("\\S", " ");<NEW_LINE>int tokenIndex = 0;<NEW_LINE>List<CoreLabel> tokens = annotation.get(CoreAnnotations.TokensAnnotation.class);<NEW_LINE>for (CoreLabel token : tokens) {<NEW_LINE>// add the current token's text<NEW_LINE>cleanedText += token.originalText();<NEW_LINE>// add whitespace for non-tokens and xml in between these tokens<NEW_LINE>tokenIndex += 1;<NEW_LINE>if (tokenIndex < tokens.size()) {<NEW_LINE>CoreLabel nextToken = tokens.get(tokenIndex);<NEW_LINE>int inBetweenStart = token.get(CoreAnnotations.CharacterOffsetEndAnnotation.class);<NEW_LINE>int inBetweenEnd = nextToken.get(CoreAnnotations.CharacterOffsetBeginAnnotation.class);<NEW_LINE>String inBetweenTokenText = documentText.substring(inBetweenStart, inBetweenEnd);<NEW_LINE>inBetweenTokenText = inBetweenTokenText.replaceAll("\\S", " ");<NEW_LINE>cleanedText += inBetweenTokenText;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// add white space for all non-token content after last token<NEW_LINE>cleanedText += documentText.substring(cleanedText.length()).replaceAll("\\S", " ");<NEW_LINE>return cleanedText;<NEW_LINE>}
get(CoreAnnotations.CharacterOffsetBeginAnnotation.class);
80,332
public static ByteBuffer convertValue(Column storeColumn, BigInteger value) {<NEW_LINE>int precision = storeColumn.getPrecision();<NEW_LINE>int scale = storeColumn.getScale();<NEW_LINE>int bytesNeeded = getDecimalColumnSpace(precision, scale);<NEW_LINE>ByteBuffer result = ByteBuffer.allocateDirect(bytesNeeded);<NEW_LINE>String stringRepresentation = value.toString();<NEW_LINE>int length = stringRepresentation.length();<NEW_LINE>ByteBuffer byteBuffer = ByteBuffer.allocateDirect(length);<NEW_LINE>CharBuffer charBuffer = CharBuffer.wrap(stringRepresentation);<NEW_LINE>// basic encoding<NEW_LINE>charsetEncoder.encode(charBuffer, byteBuffer, true);<NEW_LINE>byteBuffer.flip();<NEW_LINE>int returnCode = Utils.decimal_str2bin(byteBuffer, length, <MASK><NEW_LINE>byteBuffer.flip();<NEW_LINE>if (returnCode != 0) {<NEW_LINE>throw new ClusterJUserException(local.message("ERR_String_To_Binary_Decimal", returnCode, stringRepresentation, storeColumn.getName(), precision, scale));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
precision, scale, result, bytesNeeded);
975,942
private void startTesters(int threads) {<NEW_LINE>// Load and run actual test stub<NEW_LINE>Class<?> testClass;<NEW_LINE>try {<NEW_LINE>testClass = Class.forName(testClassName);<NEW_LINE>threadList.clear();<NEW_LINE>testRunners.clear();<NEW_LINE>for (int i = 0; i < threads; i++) {<NEW_LINE>Tester tester = (Tester) testClass.getDeclaredConstructor().newInstance();<NEW_LINE>TestRunner testRunner = new TestRunner(tester);<NEW_LINE>testRunners.add(testRunner);<NEW_LINE><MASK><NEW_LINE>threadList.add(t);<NEW_LINE>}<NEW_LINE>debug("Starting testers");<NEW_LINE>// Now that all testers have been created, start them<NEW_LINE>for (Thread t : threadList) {<NEW_LINE>debug("Starting thread");<NEW_LINE>t.start();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>debug("error in startTesters");<NEW_LINE>throw new IllegalArgumentException("Unable to load class with name " + testClassName, e);<NEW_LINE>}<NEW_LINE>debug("After starting testers");<NEW_LINE>}
Thread t = new Thread(testRunner);
724,631
private Geometry bufferPolygon_() {<NEW_LINE>if (m_distance == 0)<NEW_LINE>// return input to the output.<NEW_LINE>return m_geometry;<NEW_LINE>OperatorSimplify simplify = (OperatorSimplify) OperatorFactoryLocal.getInstance().getOperator(Operator.Type.Simplify);<NEW_LINE>generateCircleTemplate_();<NEW_LINE>m_geometry = simplify.execute(m_geometry, null, false, m_progress_tracker);<NEW_LINE>if (m_geometry.isEmpty()) {<NEW_LINE>return m_geometry;<NEW_LINE>}<NEW_LINE>if (m_distance < 0) {<NEW_LINE>Polygon poly = (Polygon) (m_geometry);<NEW_LINE>Polygon buffered_result = bufferPolygonImpl_(poly, 0, poly.getPathCount());<NEW_LINE>return simplify.execute(buffered_result, m_spatialReference, false, m_progress_tracker);<NEW_LINE>} else {<NEW_LINE>if (isDegenerateGeometry_(m_geometry)) {<NEW_LINE>Point point = new Point();<NEW_LINE>((MultiVertexGeometry) m_geometry).getPointByVal(0, point);<NEW_LINE>Envelope2D env2D = new Envelope2D();<NEW_LINE>m_geometry.queryEnvelope2D(env2D);<NEW_LINE>point.setXY(env2D.getCenter());<NEW_LINE>return bufferPoint_(point);<NEW_LINE>}<NEW_LINE>// For the positive distance we need to process polygon in the parts<NEW_LINE>// such that each exterior ring with holes is processed separatelly.<NEW_LINE>GeometryCursorForPolygon cursor = new GeometryCursorForPolygon(this);<NEW_LINE>GeometryCursor union_cursor = ((OperatorUnion) OperatorFactoryLocal.getInstance().getOperator(Operator.Type.Union)).execute(cursor, m_spatialReference, m_progress_tracker);<NEW_LINE>Geometry result = union_cursor.next();<NEW_LINE>if (result != null) {<NEW_LINE>return result;<NEW_LINE>} else {<NEW_LINE>// never return empty.<NEW_LINE>return new <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Polygon(m_geometry.getDescription());
1,252,657
public void extract(EmbeddedArtifact embeddedArtifact, Path directory) {<NEW_LINE>final Path extractTo = directory.resolve(embeddedArtifact.getFilename());<NEW_LINE>final Path parent = extractTo.getParent();<NEW_LINE>try {<NEW_LINE>if (parent != null) {<NEW_LINE>Files.createDirectories(parent);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(String.format("Couldn't extract %s, unable to create directory %s", embeddedArtifact.getName(), parent), e);<NEW_LINE>}<NEW_LINE>log.info("Extracting {} bytes of {} to {}", embeddedArtifact.getContent().length, embeddedArtifact.getName(), extractTo);<NEW_LINE>try (SeekableByteChannel byteChannel = Files.newByteChannel(extractTo, EnumSet.of(StandardOpenOption.CREATE_NEW, StandardOpenOption.WRITE))) {<NEW_LINE>byteChannel.write(ByteBuffer.wrap<MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(String.format("Couldn't extract %s", embeddedArtifact.getName()), e);<NEW_LINE>}<NEW_LINE>chmodReadOnly(extractTo);<NEW_LINE>checkMd5(embeddedArtifact, extractTo);<NEW_LINE>}
(embeddedArtifact.getContent()));
1,227
private void rewriteAgentConfigTablePart2() throws Exception {<NEW_LINE>if (!tableExists("agent_config_temp")) {<NEW_LINE>// previously failed mid-upgrade prior to updating schema version<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>dropTableIfExists("agent_config");<NEW_LINE>session.createTableWithLCS("create table if not exists agent_config (agent_rollup_id" + " varchar, config blob, config_update boolean, config_update_token uuid, primary" + " key (agent_rollup_id))");<NEW_LINE>PreparedStatement insertPS = session.prepare("insert into agent_config" + " (agent_rollup_id, config, config_update, config_update_token) values" + " (?, ?, ?, ?)");<NEW_LINE>Map<String, V09AgentRollup> v09AgentRollups = getV09AgentRollupsFromAgentRollupTable();<NEW_LINE>ResultSet results = session.read("select agent_rollup_id, config, config_update," + " config_update_token from agent_config_temp");<NEW_LINE>for (Row row : results) {<NEW_LINE>String v09AgentRollupId = row.getString(0);<NEW_LINE>V09AgentRollup v09AgentRollup = v09AgentRollups.get(v09AgentRollupId);<NEW_LINE>if (v09AgentRollup == null) {<NEW_LINE>// v09AgentRollupId was manually deleted (via the UI) from the agent_rollup<NEW_LINE>// table in which case its parent is no longer known and best to ignore<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>BoundStatement boundStatement = insertPS.bind();<NEW_LINE>boundStatement.setString(0, v09AgentRollup.agentRollupId());<NEW_LINE>boundStatement.setBytes(1, row.getBytes(1));<NEW_LINE>boundStatement.setBool(2, row.getBool(2));<NEW_LINE>boundStatement.setUUID(3<MASK><NEW_LINE>session.write(boundStatement);<NEW_LINE>}<NEW_LINE>dropTableIfExists("agent_config_temp");<NEW_LINE>}
, row.getUUID(3));
1,200,618
private static long calcConcatColumnHeaderAndSize(ArrayList<SerializedColumnHeader> outHeaders, ColumnBufferProvider[] providers) {<NEW_LINE>long totalSize = 0;<NEW_LINE>int numTables = providers.length;<NEW_LINE>long rowCount = 0;<NEW_LINE>long nullCount = 0;<NEW_LINE>for (ColumnBufferProvider provider : providers) {<NEW_LINE>rowCount += provider.getRowCount();<NEW_LINE>nullCount += provider.getNullCount();<NEW_LINE>}<NEW_LINE>if (rowCount > Integer.MAX_VALUE) {<NEW_LINE>throw new IllegalArgumentException("Cannot build a batch larger than " + Integer.MAX_VALUE + " rows");<NEW_LINE>}<NEW_LINE>if (nullCount > 0) {<NEW_LINE>totalSize += padFor64byteAlignment(BitVectorHelper.getValidityLengthInBytes(rowCount));<NEW_LINE>}<NEW_LINE>ColumnBufferProvider firstProvider = providers[0];<NEW_LINE>DType dtype = firstProvider.getType();<NEW_LINE>if (dtype.hasOffsets()) {<NEW_LINE>if (rowCount > 0) {<NEW_LINE>totalSize += padFor64byteAlignment((rowCount + 1) * Integer.BYTES);<NEW_LINE>if (dtype.equals(DType.STRING)) {<NEW_LINE>long stringDataLen = 0;<NEW_LINE>for (ColumnBufferProvider provider : providers) {<NEW_LINE>stringDataLen += getRawStringDataLength(provider, 0, provider.getRowCount());<NEW_LINE>}<NEW_LINE>totalSize += padFor64byteAlignment(stringDataLen);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (dtype.getSizeInBytes() > 0) {<NEW_LINE>totalSize += padFor64byteAlignment(dtype.getSizeInBytes() * rowCount);<NEW_LINE>}<NEW_LINE>SerializedColumnHeader[] children = null;<NEW_LINE>if (dtype.isNestedType()) {<NEW_LINE>int numChildren = firstProvider.getChildProviders().length;<NEW_LINE>ArrayList<SerializedColumnHeader> childHeaders = new ArrayList<>(numChildren);<NEW_LINE>ColumnBufferProvider[] childColumnProviders = new ColumnBufferProvider[numTables];<NEW_LINE>for (int childIdx = 0; childIdx < numChildren; childIdx++) {<NEW_LINE>// collect all the providers for the current child and build the child's header<NEW_LINE>for (int tableIdx = 0; tableIdx < numTables; tableIdx++) {<NEW_LINE>childColumnProviders[tableIdx] = providers[tableIdx].getChildProviders()[childIdx];<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>children = childHeaders.toArray(new SerializedColumnHeader[0]);<NEW_LINE>}<NEW_LINE>outHeaders.add(new SerializedColumnHeader(dtype, rowCount, nullCount, children));<NEW_LINE>return totalSize;<NEW_LINE>}
totalSize += calcConcatColumnHeaderAndSize(childHeaders, childColumnProviders);
1,628,248
protected void tick(Block b) {<NEW_LINE>BlockMenu inv = BlockStorage.getInventory(b);<NEW_LINE>CraftingOperation currentOperation = processor.getOperation(b);<NEW_LINE>if (currentOperation != null) {<NEW_LINE>if (takeCharge(b.getLocation())) {<NEW_LINE>if (!currentOperation.isFinished()) {<NEW_LINE>processor.<MASK><NEW_LINE>currentOperation.addProgress(1);<NEW_LINE>} else {<NEW_LINE>inv.replaceExistingItem(22, new CustomItemStack(Material.BLACK_STAINED_GLASS_PANE, " "));<NEW_LINE>for (ItemStack output : currentOperation.getResults()) {<NEW_LINE>inv.pushItem(output.clone(), getOutputSlots());<NEW_LINE>}<NEW_LINE>processor.endOperation(b);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>MachineRecipe next = findNextRecipe(inv);<NEW_LINE>if (next != null) {<NEW_LINE>processor.startOperation(b, new CraftingOperation(next));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
updateProgressBar(inv, 22, currentOperation);
1,741,136
public boolean execute(final SecurityContext securityContext, final ErrorBuffer errorBuffer) throws FrameworkException {<NEW_LINE>final ConfigurationProvider config = StructrApp.getConfiguration();<NEW_LINE>final Set<String> viewNames = new HashSet<>();<NEW_LINE>// do not create nodes for the internal views<NEW_LINE>viewNames.add(View.INTERNAL_GRAPH_VIEW);<NEW_LINE>viewNames.add(PropertyView.All);<NEW_LINE>final NodeInterface schemaNode = StructrApp.getInstance().getNodeById(node.getUuid());<NEW_LINE>if (schemaNode != null) {<NEW_LINE>final Iterable<SchemaView> views = schemaNode.getProperty(schemaViews);<NEW_LINE>if (views != null) {<NEW_LINE>for (final SchemaView view : views) {<NEW_LINE>viewNames.add(view<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// determine runtime type<NEW_LINE>Class builtinClass = config.getNodeEntityClass(node.getClassName());<NEW_LINE>if (builtinClass == null) {<NEW_LINE>// second try: relationship class name<NEW_LINE>builtinClass = config.getRelationshipEntityClass(node.getClassName());<NEW_LINE>}<NEW_LINE>if (builtinClass != null) {<NEW_LINE>for (final String view : config.getPropertyViewsForType(builtinClass)) {<NEW_LINE>if (!viewNames.contains(view)) {<NEW_LINE>final Set<String> viewPropertyNames = new HashSet<>();<NEW_LINE>final List<SchemaProperty> properties = new LinkedList<>();<NEW_LINE>// collect names of properties in the given view<NEW_LINE>for (final PropertyKey key : config.getPropertySet(builtinClass, view)) {<NEW_LINE>if (key.isPartOfBuiltInSchema()) {<NEW_LINE>viewPropertyNames.add(key.jsonName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// collect schema properties that match the view<NEW_LINE>for (final SchemaProperty schemaProperty : node.getProperty(SchemaNode.schemaProperties)) {<NEW_LINE>final String schemaPropertyName = schemaProperty.getProperty(SchemaProperty.name);<NEW_LINE>if (viewPropertyNames.contains(schemaPropertyName)) {<NEW_LINE>properties.add(schemaProperty);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// create view node<NEW_LINE>StructrApp.getInstance(node.getSecurityContext()).create(SchemaView.class, new NodeAttribute(SchemaView.schemaNode, node), new NodeAttribute(SchemaView.name, view), new NodeAttribute(SchemaView.schemaProperties, properties), new NodeAttribute(SchemaView.isBuiltinView, true));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
.getProperty(AbstractNode.name));
423,995
private void reportStats() {<NEW_LINE>ConcurrentMap<OwnerId, ToUsageStatsServiceMsg.Builder> report = new ConcurrentHashMap<>();<NEW_LINE>for (ApiUsageRecordKey key : ApiUsageRecordKey.values()) {<NEW_LINE>ConcurrentMap<OwnerId, AtomicLong> statsForKey = stats.get(key);<NEW_LINE>statsForKey.forEach((ownerId, statsValue) -> {<NEW_LINE>long value = statsValue.get();<NEW_LINE>if (value == 0)<NEW_LINE>return;<NEW_LINE>ToUsageStatsServiceMsg.Builder statsMsgBuilder = report.computeIfAbsent(ownerId, id -> {<NEW_LINE>ToUsageStatsServiceMsg.Builder newStatsMsgBuilder = ToUsageStatsServiceMsg.newBuilder();<NEW_LINE>TenantId tenantId = ownerId.getTenantId();<NEW_LINE>newStatsMsgBuilder.setTenantIdMSB(tenantId.getId().getMostSignificantBits());<NEW_LINE>newStatsMsgBuilder.setTenantIdLSB(tenantId.getId().getLeastSignificantBits());<NEW_LINE>EntityId entityId = ownerId.getEntityId();<NEW_LINE>if (entityId != null && entityId.getEntityType() == EntityType.CUSTOMER) {<NEW_LINE>newStatsMsgBuilder.setCustomerIdMSB(entityId.getId().getMostSignificantBits());<NEW_LINE>newStatsMsgBuilder.setCustomerIdLSB(entityId.<MASK><NEW_LINE>}<NEW_LINE>return newStatsMsgBuilder;<NEW_LINE>});<NEW_LINE>statsMsgBuilder.addValues(UsageStatsKVProto.newBuilder().setKey(key.name()).setValue(value).build());<NEW_LINE>});<NEW_LINE>statsForKey.clear();<NEW_LINE>}<NEW_LINE>report.forEach(((ownerId, statsMsg) -> {<NEW_LINE>// TODO: figure out how to minimize messages into the queue. Maybe group by 100s of messages?<NEW_LINE>TenantId tenantId = ownerId.getTenantId();<NEW_LINE>EntityId entityId = Optional.ofNullable(ownerId.getEntityId()).orElse(tenantId);<NEW_LINE>TopicPartitionInfo tpi = partitionService.resolve(ServiceType.TB_CORE, tenantId, entityId).newByTopic(msgProducer.getDefaultTopic());<NEW_LINE>msgProducer.send(tpi, new TbProtoQueueMsg<>(UUID.randomUUID(), statsMsg.build()), null);<NEW_LINE>}));<NEW_LINE>if (!report.isEmpty()) {<NEW_LINE>log.debug("Reporting API usage statistics for {} tenants and customers", report.size());<NEW_LINE>}<NEW_LINE>}
getId().getLeastSignificantBits());
1,614,227
protected boolean isValidTemplateFile(File file) throws IOException {<NEW_LINE>if (file == null || !file.exists()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Ensure the template is of the right kind<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String xmlString = ZipUtils.extractZipEntry(file, ZIP_ENTRY_MANIFEST<MASK><NEW_LINE>if (xmlString == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// If the attribute "type" exists then return true if its value is "model".<NEW_LINE>// If the attribute doesn't exist it was from an older version (before 2.1)<NEW_LINE>try {<NEW_LINE>Document doc = JDOMUtils.readXMLString(xmlString);<NEW_LINE>Element root = doc.getRootElement();<NEW_LINE>Attribute attType = root.getAttribute(ITemplateXMLTags.XML_TEMPLATE_ATTRIBUTE_TYPE);<NEW_LINE>if (attType != null) {<NEW_LINE>return ArchimateModelTemplate.XML_TEMPLATE_ATTRIBUTE_TYPE_MODEL.equals(attType.getValue());<NEW_LINE>}<NEW_LINE>} catch (JDOMException ex) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
, Charset.forName("UTF-8"));
1,075,855
public synchronized void highlight(Parent pane, String query) {<NEW_LINE>if (this.parent != null && !boxes.isEmpty()) {<NEW_LINE>clear();<NEW_LINE>}<NEW_LINE>if (query == null || query.isEmpty())<NEW_LINE>return;<NEW_LINE>this.parent = pane;<NEW_LINE>Set<Node> nodes = getTextNodes(pane);<NEW_LINE>ArrayList<Rectangle> allRectangles = new ArrayList<>();<NEW_LINE>for (Node node : nodes) {<NEW_LINE>Text text = ((Text) node);<NEW_LINE>final int beginIndex = text.getText().toLowerCase().indexOf(query.toLowerCase());<NEW_LINE>if (beginIndex > -1 && node.impl_isTreeVisible()) {<NEW_LINE>ArrayList<Bounds> boundingBoxes = getMatchingBounds(query, text);<NEW_LINE>ArrayList<Rectangle> rectangles = new ArrayList<>();<NEW_LINE>for (Bounds boundingBox : boundingBoxes) {<NEW_LINE><MASK><NEW_LINE>rect.setCacheHint(CacheHint.SPEED);<NEW_LINE>rect.setCache(true);<NEW_LINE>rect.setMouseTransparent(true);<NEW_LINE>rect.setBlendMode(BlendMode.MULTIPLY);<NEW_LINE>rect.fillProperty().bind(paintProperty());<NEW_LINE>rect.setManaged(false);<NEW_LINE>rect.setX(boundingBox.getMinX());<NEW_LINE>rect.setY(boundingBox.getMinY());<NEW_LINE>rect.setWidth(boundingBox.getWidth());<NEW_LINE>rect.setHeight(boundingBox.getHeight());<NEW_LINE>rectangles.add(rect);<NEW_LINE>allRectangles.add(rect);<NEW_LINE>}<NEW_LINE>boxes.put(node, rectangles);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>JFXUtilities.runInFXAndWait(() -> getParentChildren(pane).addAll(allRectangles));<NEW_LINE>}
HighLightRectangle rect = new HighLightRectangle(text);
344,449
public synchronized void unfollow(final String followerId, final String followingId, final int followingType) throws RepositoryException {<NEW_LINE>followRepository.removeByFollowerIdAndFollowingId(followerId, followingId, followingType);<NEW_LINE>if (Follow.FOLLOWING_TYPE_C_TAG == followingType) {<NEW_LINE>final JSONObject tag = tagRepository.get(followingId);<NEW_LINE>if (null == tag) {<NEW_LINE>LOGGER.log(Level.ERROR, "Not found tag [id={}] to unfollow", followingId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>tag.put(Tag.TAG_FOLLOWER_CNT, tag.optInt(Tag.TAG_FOLLOWER_CNT) - 1);<NEW_LINE>if (tag.optInt(Tag.TAG_FOLLOWER_CNT) < 0) {<NEW_LINE>tag.put(Tag.TAG_FOLLOWER_CNT, 0);<NEW_LINE>}<NEW_LINE>tag.put(Tag.TAG_RANDOM_DOUBLE, Math.random());<NEW_LINE>tagRepository.update(followingId, tag);<NEW_LINE>} else if (Follow.FOLLOWING_TYPE_C_ARTICLE == followingType) {<NEW_LINE>final JSONObject article = articleRepository.get(followingId);<NEW_LINE>if (null == article) {<NEW_LINE>LOGGER.log(Level.ERROR, "Not found article [id={}] to unfollow", followingId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>article.put(Article.ARTICLE_COLLECT_CNT, article.optInt(Article.ARTICLE_COLLECT_CNT) - 1);<NEW_LINE>if (article.optInt(Article.ARTICLE_COLLECT_CNT) < 0) {<NEW_LINE>article.put(Article.ARTICLE_COLLECT_CNT, 0);<NEW_LINE>}<NEW_LINE>articleRepository.update(followingId, article, Article.ARTICLE_COLLECT_CNT);<NEW_LINE>} else if (Follow.FOLLOWING_TYPE_C_ARTICLE_WATCH == followingType) {<NEW_LINE>final JSONObject <MASK><NEW_LINE>if (null == article) {<NEW_LINE>LOGGER.log(Level.ERROR, "Not found article [id={}] to unwatch", followingId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>article.put(Article.ARTICLE_WATCH_CNT, article.optInt(Article.ARTICLE_WATCH_CNT) - 1);<NEW_LINE>if (article.optInt(Article.ARTICLE_WATCH_CNT) < 0) {<NEW_LINE>article.put(Article.ARTICLE_WATCH_CNT, 0);<NEW_LINE>}<NEW_LINE>articleRepository.update(followingId, article, Article.ARTICLE_WATCH_CNT);<NEW_LINE>}<NEW_LINE>}
article = articleRepository.get(followingId);
634,912
final DisassociateResolverQueryLogConfigResult executeDisassociateResolverQueryLogConfig(DisassociateResolverQueryLogConfigRequest disassociateResolverQueryLogConfigRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disassociateResolverQueryLogConfigRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DisassociateResolverQueryLogConfigRequest> request = null;<NEW_LINE>Response<DisassociateResolverQueryLogConfigResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DisassociateResolverQueryLogConfigRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(disassociateResolverQueryLogConfigRequest));<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, "Route53Resolver");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateResolverQueryLogConfig");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DisassociateResolverQueryLogConfigResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DisassociateResolverQueryLogConfigResultJsonUnmarshaller());<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());
676,922
public List<ItemParam> calcWeaponUpgradeReturnItems(GenshinPlayer player, long targetGuid, List<Long> foodWeaponGuidList, List<ItemParam> itemParamList) {<NEW_LINE>GenshinItem weapon = player.getInventory().getItemByGuid(targetGuid);<NEW_LINE>// Sanity checks<NEW_LINE>if (weapon == null || weapon.getItemType() != ItemType.ITEM_WEAPON) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>WeaponPromoteData promoteData = GenshinData.getWeaponPromoteData(weapon.getItemData().getWeaponPromoteId(), weapon.getPromoteLevel());<NEW_LINE>if (promoteData == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Get exp gain<NEW_LINE>int expGain = 0;<NEW_LINE>for (long guid : foodWeaponGuidList) {<NEW_LINE>GenshinItem food = player.getInventory().getItemByGuid(guid);<NEW_LINE>if (food == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>expGain += food.getItemData().getWeaponBaseExp();<NEW_LINE>if (food.getTotalExp() > 0) {<NEW_LINE>expGain += (int) Math.floor(food.getTotalExp() * .8f);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (ItemParam param : itemParamList) {<NEW_LINE>GenshinItem food = player.getInventory().getInventoryTab(ItemType.ITEM_MATERIAL).getItemById(param.getItemId());<NEW_LINE>if (food == null || food.getItemData().getMaterialType() != MaterialType.MATERIAL_WEAPON_EXP_STONE) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int amount = Math.min(param.getCount(), food.getCount());<NEW_LINE>if (food.getItemId() == WEAPON_ORE_3) {<NEW_LINE>expGain += 10000 * amount;<NEW_LINE>} else if (food.getItemId() == WEAPON_ORE_2) {<NEW_LINE>expGain += 2000 * amount;<NEW_LINE>} else if (food.getItemId() == WEAPON_ORE_1) {<NEW_LINE>expGain += 400 * amount;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Try<NEW_LINE>int maxLevel = promoteData.getUnlockMaxLevel();<NEW_LINE>int level = weapon.getLevel();<NEW_LINE>int exp = weapon.getExp();<NEW_LINE>int reqExp = GenshinData.getWeaponExpRequired(weapon.getItemData().getRankLevel(), level);<NEW_LINE>while (expGain > 0 && reqExp > 0 && level < maxLevel) {<NEW_LINE>// Do calculations<NEW_LINE>int toGain = Math.<MASK><NEW_LINE>exp += toGain;<NEW_LINE>expGain -= toGain;<NEW_LINE>// Level up<NEW_LINE>if (exp >= reqExp) {<NEW_LINE>// Exp<NEW_LINE>exp = 0;<NEW_LINE>level += 1;<NEW_LINE>// Set req exp<NEW_LINE>reqExp = GenshinData.getWeaponExpRequired(weapon.getItemData().getRankLevel(), level);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return getLeftoverOres(expGain);<NEW_LINE>}
min(expGain, reqExp - exp);
88,288
public static DescribeWatchItemsResponse unmarshall(DescribeWatchItemsResponse describeWatchItemsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeWatchItemsResponse.setRequestId(_ctx.stringValue("DescribeWatchItemsResponse.RequestId"));<NEW_LINE>describeWatchItemsResponse.setSuccess<MASK><NEW_LINE>describeWatchItemsResponse.setCode(_ctx.stringValue("DescribeWatchItemsResponse.Code"));<NEW_LINE>describeWatchItemsResponse.setMessage(_ctx.stringValue("DescribeWatchItemsResponse.Message"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setTotalCount(_ctx.longValue("DescribeWatchItemsResponse.Data.TotalCount"));<NEW_LINE>data.setPageSize(_ctx.longValue("DescribeWatchItemsResponse.Data.PageSize"));<NEW_LINE>data.setPageNumber(_ctx.longValue("DescribeWatchItemsResponse.Data.PageNumber"));<NEW_LINE>List<Record> records = new ArrayList<Record>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeWatchItemsResponse.Data.Records.Length"); i++) {<NEW_LINE>Record record = new Record();<NEW_LINE>record.setWatchItemId(_ctx.stringValue("DescribeWatchItemsResponse.Data.Records[" + i + "].WatchItemId"));<NEW_LINE>record.setWatchItemName(_ctx.stringValue("DescribeWatchItemsResponse.Data.Records[" + i + "].WatchItemName"));<NEW_LINE>record.setItemAttributes(_ctx.stringValue("DescribeWatchItemsResponse.Data.Records[" + i + "].ItemAttributes"));<NEW_LINE>record.setItemImageUrl(_ctx.stringValue("DescribeWatchItemsResponse.Data.Records[" + i + "].ItemImageUrl"));<NEW_LINE>records.add(record);<NEW_LINE>}<NEW_LINE>data.setRecords(records);<NEW_LINE>describeWatchItemsResponse.setData(data);<NEW_LINE>return describeWatchItemsResponse;<NEW_LINE>}
(_ctx.booleanValue("DescribeWatchItemsResponse.Success"));
1,812,030
protected static ImmutableList<Integer> parseFrameRange(String frameRange) {<NEW_LINE>Matcher singleFrameMatcher = SINGLE_FRAME_PATTERN.matcher(frameRange);<NEW_LINE>if (singleFrameMatcher.matches()) {<NEW_LINE>return ImmutableList.of(Integer.valueOf(frameRange));<NEW_LINE>}<NEW_LINE>Matcher simpleRangeMatcher = SIMPLE_FRAME_RANGE_PATTERN.matcher(frameRange);<NEW_LINE>if (simpleRangeMatcher.matches()) {<NEW_LINE>Integer startFrame = Integer.valueOf(simpleRangeMatcher.group("sf"));<NEW_LINE>Integer endFrame = Integer.valueOf(simpleRangeMatcher.group("ef"));<NEW_LINE>return getIntRange(startFrame, endFrame, (endFrame >= startFrame ? 1 : -1));<NEW_LINE>}<NEW_LINE>Matcher rangeWithStepMatcher = STEP_PATTERN.matcher(frameRange);<NEW_LINE>if (rangeWithStepMatcher.matches()) {<NEW_LINE>Integer startFrame = Integer.valueOf(rangeWithStepMatcher.group("sf"));<NEW_LINE>Integer endFrame = Integer.valueOf(rangeWithStepMatcher.group("ef"));<NEW_LINE>Integer step = Integer.valueOf<MASK><NEW_LINE>String stepSep = rangeWithStepMatcher.group("stepSep");<NEW_LINE>return getSteppedRange(startFrame, endFrame, step, "y".equals(stepSep));<NEW_LINE>}<NEW_LINE>Matcher rangeWithInterleaveMatcher = INTERLEAVE_PATTERN.matcher(frameRange);<NEW_LINE>if (rangeWithInterleaveMatcher.matches()) {<NEW_LINE>Integer startFrame = Integer.valueOf(rangeWithInterleaveMatcher.group("sf"));<NEW_LINE>Integer endFrame = Integer.valueOf(rangeWithInterleaveMatcher.group("ef"));<NEW_LINE>Integer step = Integer.valueOf(rangeWithInterleaveMatcher.group("step"));<NEW_LINE>return getInterleavedRange(startFrame, endFrame, step);<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException("unrecognized frame range syntax " + frameRange);<NEW_LINE>}
(rangeWithStepMatcher.group("step"));
1,797,979
public void run() {<NEW_LINE>if (delayTimer == null)<NEW_LINE>delayTimer = new Timer("BlueMap-RegionFileWatchService-DelayTimer", true);<NEW_LINE>try {<NEW_LINE>while (!closed) {<NEW_LINE>WatchKey key = this.watchService.take();<NEW_LINE>for (WatchEvent<?> event : key.pollEvents()) {<NEW_LINE>WatchEvent.Kind<?> kind = event.kind();<NEW_LINE>if (kind == StandardWatchEventKinds.OVERFLOW)<NEW_LINE>continue;<NEW_LINE><MASK><NEW_LINE>if (!(fileObject instanceof Path))<NEW_LINE>continue;<NEW_LINE>Path file = (Path) fileObject;<NEW_LINE>String regionFileName = file.toFile().getName();<NEW_LINE>updateRegion(regionFileName);<NEW_LINE>}<NEW_LINE>if (!key.reset())<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (ClosedWatchServiceException ignore) {<NEW_LINE>} catch (InterruptedException iex) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>}<NEW_LINE>if (!closed) {<NEW_LINE>Logger.global.logWarning("Region-file watch-service for map '" + map.getId() + "' stopped unexpectedly! (This map might not update automatically from now on)");<NEW_LINE>}<NEW_LINE>}
Object fileObject = event.context();
633,861
public static DisableApplicationScalingRuleResponse unmarshall(DisableApplicationScalingRuleResponse disableApplicationScalingRuleResponse, UnmarshallerContext _ctx) {<NEW_LINE>disableApplicationScalingRuleResponse.setRequestId(_ctx.stringValue("DisableApplicationScalingRuleResponse.RequestId"));<NEW_LINE>disableApplicationScalingRuleResponse.setCode(_ctx.integerValue("DisableApplicationScalingRuleResponse.Code"));<NEW_LINE>disableApplicationScalingRuleResponse.setMessage(_ctx.stringValue("DisableApplicationScalingRuleResponse.Message"));<NEW_LINE>AppScalingRule appScalingRule = new AppScalingRule();<NEW_LINE>appScalingRule.setAppId(_ctx.stringValue("DisableApplicationScalingRuleResponse.AppScalingRule.AppId"));<NEW_LINE>appScalingRule.setScaleRuleName(_ctx.stringValue("DisableApplicationScalingRuleResponse.AppScalingRule.ScaleRuleName"));<NEW_LINE>appScalingRule.setScaleRuleType(_ctx.stringValue("DisableApplicationScalingRuleResponse.AppScalingRule.ScaleRuleType"));<NEW_LINE>appScalingRule.setScaleRuleEnabled(_ctx.booleanValue("DisableApplicationScalingRuleResponse.AppScalingRule.ScaleRuleEnabled"));<NEW_LINE>appScalingRule.setMinReplicas(_ctx.integerValue("DisableApplicationScalingRuleResponse.AppScalingRule.MinReplicas"));<NEW_LINE>appScalingRule.setMaxReplicas(_ctx.integerValue("DisableApplicationScalingRuleResponse.AppScalingRule.MaxReplicas"));<NEW_LINE>appScalingRule.setCreateTime(_ctx.longValue("DisableApplicationScalingRuleResponse.AppScalingRule.CreateTime"));<NEW_LINE>appScalingRule.setUpdateTime(_ctx.longValue("DisableApplicationScalingRuleResponse.AppScalingRule.UpdateTime"));<NEW_LINE>appScalingRule.setLastDisableTime(_ctx.longValue("DisableApplicationScalingRuleResponse.AppScalingRule.LastDisableTime"));<NEW_LINE>Metric metric = new Metric();<NEW_LINE>metric.setMaxReplicas(_ctx.integerValue("DisableApplicationScalingRuleResponse.AppScalingRule.Metric.MaxReplicas"));<NEW_LINE>metric.setMinReplicas<MASK><NEW_LINE>List<Metric1> metrics = new ArrayList<Metric1>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DisableApplicationScalingRuleResponse.AppScalingRule.Metric.Metrics.Length"); i++) {<NEW_LINE>Metric1 metric1 = new Metric1();<NEW_LINE>metric1.setMetricType(_ctx.stringValue("DisableApplicationScalingRuleResponse.AppScalingRule.Metric.Metrics[" + i + "].MetricType"));<NEW_LINE>metric1.setMetricTargetAverageUtilization(_ctx.integerValue("DisableApplicationScalingRuleResponse.AppScalingRule.Metric.Metrics[" + i + "].MetricTargetAverageUtilization"));<NEW_LINE>metrics.add(metric1);<NEW_LINE>}<NEW_LINE>metric.setMetrics(metrics);<NEW_LINE>appScalingRule.setMetric(metric);<NEW_LINE>Trigger trigger = new Trigger();<NEW_LINE>trigger.setMaxReplicas(_ctx.integerValue("DisableApplicationScalingRuleResponse.AppScalingRule.Trigger.MaxReplicas"));<NEW_LINE>trigger.setMinReplicas(_ctx.integerValue("DisableApplicationScalingRuleResponse.AppScalingRule.Trigger.MinReplicas"));<NEW_LINE>List<Trigger2> triggers = new ArrayList<Trigger2>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DisableApplicationScalingRuleResponse.AppScalingRule.Trigger.Triggers.Length"); i++) {<NEW_LINE>Trigger2 trigger2 = new Trigger2();<NEW_LINE>trigger2.setType(_ctx.stringValue("DisableApplicationScalingRuleResponse.AppScalingRule.Trigger.Triggers[" + i + "].Type"));<NEW_LINE>trigger2.setName(_ctx.stringValue("DisableApplicationScalingRuleResponse.AppScalingRule.Trigger.Triggers[" + i + "].Name"));<NEW_LINE>trigger2.setMetaData(_ctx.stringValue("DisableApplicationScalingRuleResponse.AppScalingRule.Trigger.Triggers[" + i + "].MetaData"));<NEW_LINE>triggers.add(trigger2);<NEW_LINE>}<NEW_LINE>trigger.setTriggers(triggers);<NEW_LINE>appScalingRule.setTrigger(trigger);<NEW_LINE>disableApplicationScalingRuleResponse.setAppScalingRule(appScalingRule);<NEW_LINE>return disableApplicationScalingRuleResponse;<NEW_LINE>}
(_ctx.integerValue("DisableApplicationScalingRuleResponse.AppScalingRule.Metric.MinReplicas"));
1,790,204
private int transitionsBetween(ResultPoint from, ResultPoint to) {<NEW_LINE>// See QR Code Detector, sizeOfBlackWhiteBlackRun()<NEW_LINE>int fromX = (int) from.getX();<NEW_LINE>int fromY = (int) from.getY();<NEW_LINE>int toX = (int) to.getX();<NEW_LINE>int toY = Math.min(image.getHeight() - 1, (int) to.getY());<NEW_LINE>boolean steep = Math.abs(toY - fromY) > Math.abs(toX - fromX);<NEW_LINE>if (steep) {<NEW_LINE>int temp = fromX;<NEW_LINE>fromX = fromY;<NEW_LINE>fromY = temp;<NEW_LINE>temp = toX;<NEW_LINE>toX = toY;<NEW_LINE>toY = temp;<NEW_LINE>}<NEW_LINE>int dx = Math.abs(toX - fromX);<NEW_LINE>int dy = Math.abs(toY - fromY);<NEW_LINE>int error = -dx / 2;<NEW_LINE>int ystep = fromY < toY ? 1 : -1;<NEW_LINE>int xstep = fromX < toX ? 1 : -1;<NEW_LINE>int transitions = 0;<NEW_LINE>boolean inBlack = image.get(steep ? fromY : <MASK><NEW_LINE>for (int x = fromX, y = fromY; x != toX; x += xstep) {<NEW_LINE>boolean isBlack = image.get(steep ? y : x, steep ? x : y);<NEW_LINE>if (isBlack != inBlack) {<NEW_LINE>transitions++;<NEW_LINE>inBlack = isBlack;<NEW_LINE>}<NEW_LINE>error += dy;<NEW_LINE>if (error > 0) {<NEW_LINE>if (y == toY) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>y += ystep;<NEW_LINE>error -= dx;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return transitions;<NEW_LINE>}
fromX, steep ? fromX : fromY);
1,246,301
private void startRoutePlanningWithDestination(LatLon latLon, PointDescription pointDescription, TargetPointsHelper targets) {<NEW_LINE>MapActivity mapActivity = getMapActivity();<NEW_LINE>MapActions mapActions = mapActivity != null ? mapActivity.getMapActions() : app<MASK><NEW_LINE>boolean hasPointToStart = settings.restorePointToStart();<NEW_LINE>targets.navigateToPoint(latLon, true, -1, pointDescription);<NEW_LINE>if (!hasPointToStart) {<NEW_LINE>mapActions.enterRoutePlanningModeGivenGpx(null, null, null, true, true, MenuState.HEADER_ONLY);<NEW_LINE>} else {<NEW_LINE>TargetPoint start = targets.getPointToStart();<NEW_LINE>if (start != null) {<NEW_LINE>mapActions.enterRoutePlanningModeGivenGpx(null, start.point, start.getOriginalPointDescription(), true, true, MenuState.HEADER_ONLY);<NEW_LINE>} else {<NEW_LINE>mapActions.enterRoutePlanningModeGivenGpx(null, null, null, true, true, MenuState.HEADER_ONLY);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getOsmandMap().getMapActions();
1,130,143
final CreateDatasetResult executeCreateDataset(CreateDatasetRequest createDatasetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createDatasetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateDatasetRequest> request = null;<NEW_LINE>Response<CreateDatasetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateDatasetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createDatasetRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateDataset");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateDatasetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateDatasetResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "DataBrew");
1,154,966
private void parse(InputStream in, boolean recurse) throws IOException, MessagingException {<NEW_LINE>mHeader.clear();<NEW_LINE>mFrom = null;<NEW_LINE>mTo = null;<NEW_LINE>mCc = null;<NEW_LINE>mBcc = null;<NEW_LINE>mReplyTo = null;<NEW_LINE>xOriginalTo = null;<NEW_LINE>deliveredTo = null;<NEW_LINE>xEnvelopeTo = null;<NEW_LINE>mMessageId = null;<NEW_LINE>mReferences = null;<NEW_LINE>mInReplyTo = null;<NEW_LINE>mSentDate = null;<NEW_LINE>mBody = null;<NEW_LINE>MimeConfig parserConfig = // The default is a mere 10k<NEW_LINE>new MimeConfig.Builder().setMaxHeaderLen(// The default is 1000 characters. Some MUAs generate REALLY long References: headers<NEW_LINE>-1).setMaxLineLen(// Disable the check for header count.<NEW_LINE>-1).setMaxHeaderCount(-1).build();<NEW_LINE><MASK><NEW_LINE>parser.setContentHandler(new MimeMessageBuilder(new DefaultBodyFactory()));<NEW_LINE>if (recurse) {<NEW_LINE>parser.setRecurse();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>parser.parse(new EOLConvertingInputStream(in));<NEW_LINE>} catch (MimeException me) {<NEW_LINE>throw new MessagingException(me.getMessage(), me);<NEW_LINE>}<NEW_LINE>}
MimeStreamParser parser = new MimeStreamParser(parserConfig);
1,808,204
protected String call() throws TSSException {<NEW_LINE>checkInputs();<NEW_LINE>List<Utils.IOSVersion> iosVersions = getIOSVersions();<NEW_LINE>System.out.println("iosVersions = " + iosVersions);<NEW_LINE>ArrayList<String> args = constructArgs();<NEW_LINE>final int urlIndex = args.size() - 1;<NEW_LINE>StringBuilder responseBuilder = new StringBuilder("Successfully saved blobs in\n").append(savePath);<NEW_LINE>if (manualIpswURL == null) {<NEW_LINE>responseBuilder.append(iosVersions.size() == 1 ? "\n\nFor version " : "\n\nFor versions ");<NEW_LINE>}<NEW_LINE>// can't use forEach() because exception won't be caught<NEW_LINE>for (Utils.IOSVersion iosVersion : iosVersions) {<NEW_LINE>try {<NEW_LINE>args.set(urlIndex, extractBuildManifest(iosVersion.ipswURL()).toString());<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new TSSException("Unable to extract BuildManifest.", true, e);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>System.out.println("Running: " + args);<NEW_LINE>String tssLog = executeProgram(args);<NEW_LINE>parseTSSLog(tssLog);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>if (iosVersion.versionString() != null) {<NEW_LINE>responseBuilder.append(iosVersion.versionString());<NEW_LINE>if (iosVersion != iosVersions.get(iosVersions.size() - 1))<NEW_LINE>responseBuilder.append(", ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (saveToTSSSaver || saveToSHSHHost) {<NEW_LINE>responseBuilder.append("\n\n");<NEW_LINE>}<NEW_LINE>if (saveToTSSSaver) {<NEW_LINE>saveBlobsTSSSaver(responseBuilder);<NEW_LINE>}<NEW_LINE>if (saveToSHSHHost) {<NEW_LINE>saveBlobsSHSHHost(responseBuilder);<NEW_LINE>}<NEW_LINE>Analytics.saveBlobs();<NEW_LINE>return responseBuilder.toString();<NEW_LINE>}
TSSException("There was an error starting tsschecker.", true, e);
1,231,773
public void addJaxWsExtension(AntBuildExtender ext) throws IOException {<NEW_LINE>TransformerUtils.transformClients(project.<MASK><NEW_LINE>FileObject jaxws_build = project.getProjectDirectory().getFileObject(TransformerUtils.JAXWS_BUILD_XML_PATH);<NEW_LINE>assert jaxws_build != null;<NEW_LINE>AntBuildExtender.Extension extension = ext.getExtension(JAXWS_EXTENSION);<NEW_LINE>if (extension == null) {<NEW_LINE>extension = ext.addExtension(JAXWS_EXTENSION, jaxws_build);<NEW_LINE>int clientsLength = 0;<NEW_LINE>int fromWsdlServicesLength = 0;<NEW_LINE>JaxWsModel jaxWsModel = project.getLookup().lookup(JaxWsModel.class);<NEW_LINE>if (jaxWsModel != null) {<NEW_LINE>clientsLength = jaxWsModel.getClients().length;<NEW_LINE>for (Service service : jaxWsModel.getServices()) {<NEW_LINE>if (service.getWsdlUrl() != null) {<NEW_LINE>fromWsdlServicesLength++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// adding dependencies<NEW_LINE>if (clientsLength > 0) {<NEW_LINE>// NOI18N<NEW_LINE>extension.addDependency("-pre-pre-compile", "wsimport-client-generate");<NEW_LINE>}<NEW_LINE>if (fromWsdlServicesLength > 0) {<NEW_LINE>// NOI18N<NEW_LINE>extension.addDependency("-pre-pre-compile", "wsimport-service-generate");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getProjectDirectory(), JAX_WS_STYLESHEET_RESOURCE, true);
579,959
public static ClientMessage encodeRequest(java.lang.String name, java.util.UUID txnId, long threadId, com.hazelcast.internal.serialization.Data key) {<NEW_LINE>ClientMessage clientMessage = ClientMessage.createForEncode();<NEW_LINE>clientMessage.setRetryable(false);<NEW_LINE>clientMessage.setOperationName("TransactionalMap.Remove");<NEW_LINE>ClientMessage.Frame initialFrame = new ClientMessage.Frame(<MASK><NEW_LINE>encodeInt(initialFrame.content, TYPE_FIELD_OFFSET, REQUEST_MESSAGE_TYPE);<NEW_LINE>encodeInt(initialFrame.content, PARTITION_ID_FIELD_OFFSET, -1);<NEW_LINE>encodeUUID(initialFrame.content, REQUEST_TXN_ID_FIELD_OFFSET, txnId);<NEW_LINE>encodeLong(initialFrame.content, REQUEST_THREAD_ID_FIELD_OFFSET, threadId);<NEW_LINE>clientMessage.add(initialFrame);<NEW_LINE>StringCodec.encode(clientMessage, name);<NEW_LINE>DataCodec.encode(clientMessage, key);<NEW_LINE>return clientMessage;<NEW_LINE>}
new byte[REQUEST_INITIAL_FRAME_SIZE], UNFRAGMENTED_MESSAGE);
188,951
private static UpdatedBodyAndMentions update(@Nullable CharSequence body, @NonNull List<Mention> mentions, @NonNull Function<Mention, CharSequence> replacementTextGenerator) {<NEW_LINE>if (body == null || mentions.isEmpty()) {<NEW_LINE>return new UpdatedBodyAndMentions(body, mentions);<NEW_LINE>}<NEW_LINE>SortedSet<Mention> sortedMentions = new TreeSet<>(mentions);<NEW_LINE>SpannableStringBuilder updatedBody = new SpannableStringBuilder();<NEW_LINE>List<Mention> <MASK><NEW_LINE>int bodyIndex = 0;<NEW_LINE>for (Mention mention : sortedMentions) {<NEW_LINE>if (invalidMention(body, mention)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>updatedBody.append(body.subSequence(bodyIndex, mention.getStart()));<NEW_LINE>CharSequence replaceWith = replacementTextGenerator.apply(mention);<NEW_LINE>Mention updatedMention = new Mention(mention.getRecipientId(), updatedBody.length(), replaceWith.length());<NEW_LINE>updatedBody.append(replaceWith);<NEW_LINE>updatedMentions.add(updatedMention);<NEW_LINE>bodyIndex = mention.getStart() + mention.getLength();<NEW_LINE>}<NEW_LINE>if (bodyIndex < body.length()) {<NEW_LINE>updatedBody.append(body.subSequence(bodyIndex, body.length()));<NEW_LINE>}<NEW_LINE>return new UpdatedBodyAndMentions(updatedBody.toString(), updatedMentions);<NEW_LINE>}
updatedMentions = new ArrayList<>();
979,932
public static DescribeMonitorGroupInstanceAttributeResponse unmarshall(DescribeMonitorGroupInstanceAttributeResponse describeMonitorGroupInstanceAttributeResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeMonitorGroupInstanceAttributeResponse.setRequestId(_ctx.stringValue("DescribeMonitorGroupInstanceAttributeResponse.RequestId"));<NEW_LINE>describeMonitorGroupInstanceAttributeResponse.setSuccess(_ctx.booleanValue("DescribeMonitorGroupInstanceAttributeResponse.Success"));<NEW_LINE>describeMonitorGroupInstanceAttributeResponse.setCode(_ctx.integerValue("DescribeMonitorGroupInstanceAttributeResponse.Code"));<NEW_LINE>describeMonitorGroupInstanceAttributeResponse.setMessage(_ctx.stringValue("DescribeMonitorGroupInstanceAttributeResponse.Message"));<NEW_LINE>describeMonitorGroupInstanceAttributeResponse.setPageNumber(_ctx.integerValue("DescribeMonitorGroupInstanceAttributeResponse.PageNumber"));<NEW_LINE>describeMonitorGroupInstanceAttributeResponse.setPageSize(_ctx.integerValue("DescribeMonitorGroupInstanceAttributeResponse.PageSize"));<NEW_LINE>describeMonitorGroupInstanceAttributeResponse.setTotal(_ctx.integerValue("DescribeMonitorGroupInstanceAttributeResponse.Total"));<NEW_LINE>List<Resource> resources = new ArrayList<Resource>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeMonitorGroupInstanceAttributeResponse.Resources.Length"); i++) {<NEW_LINE>Resource resource = new Resource();<NEW_LINE>resource.setInstanceName(_ctx.stringValue("DescribeMonitorGroupInstanceAttributeResponse.Resources[" + i + "].InstanceName"));<NEW_LINE>resource.setDimension(_ctx.stringValue("DescribeMonitorGroupInstanceAttributeResponse.Resources[" + i + "].Dimension"));<NEW_LINE>resource.setCategory(_ctx.stringValue("DescribeMonitorGroupInstanceAttributeResponse.Resources[" + i + "].Category"));<NEW_LINE>resource.setInstanceId(_ctx.stringValue("DescribeMonitorGroupInstanceAttributeResponse.Resources[" + i + "].InstanceId"));<NEW_LINE>resource.setNetworkType(_ctx.stringValue("DescribeMonitorGroupInstanceAttributeResponse.Resources[" + i + "].NetworkType"));<NEW_LINE>resource.setDesc(_ctx.stringValue("DescribeMonitorGroupInstanceAttributeResponse.Resources[" + i + "].Desc"));<NEW_LINE>Region region = new Region();<NEW_LINE>region.setAvailabilityZone(_ctx.stringValue("DescribeMonitorGroupInstanceAttributeResponse.Resources[" + i + "].Region.AvailabilityZone"));<NEW_LINE>region.setRegionId(_ctx.stringValue("DescribeMonitorGroupInstanceAttributeResponse.Resources[" + i + "].Region.RegionId"));<NEW_LINE>resource.setRegion(region);<NEW_LINE>Vpc vpc = new Vpc();<NEW_LINE>vpc.setVswitchInstanceId(_ctx.stringValue("DescribeMonitorGroupInstanceAttributeResponse.Resources[" + i + "].Vpc.VswitchInstanceId"));<NEW_LINE>vpc.setVpcInstanceId(_ctx.stringValue("DescribeMonitorGroupInstanceAttributeResponse.Resources[" + i + "].Vpc.VpcInstanceId"));<NEW_LINE>resource.setVpc(vpc);<NEW_LINE>List<Tag> tags = new ArrayList<Tag>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeMonitorGroupInstanceAttributeResponse.Resources[" + i + "].Tags.Length"); j++) {<NEW_LINE>Tag tag = new Tag();<NEW_LINE>tag.setKey(_ctx.stringValue("DescribeMonitorGroupInstanceAttributeResponse.Resources[" + i + "].Tags[" + j + "].Key"));<NEW_LINE>tag.setValue(_ctx.stringValue("DescribeMonitorGroupInstanceAttributeResponse.Resources[" + i <MASK><NEW_LINE>tags.add(tag);<NEW_LINE>}<NEW_LINE>resource.setTags(tags);<NEW_LINE>resources.add(resource);<NEW_LINE>}<NEW_LINE>describeMonitorGroupInstanceAttributeResponse.setResources(resources);<NEW_LINE>return describeMonitorGroupInstanceAttributeResponse;<NEW_LINE>}
+ "].Tags[" + j + "].Value"));
1,241,590
public void initialize() {<NEW_LINE>m_statisticsServices = StatisticsServicesImplementation.getInstance();<NEW_LINE>List<Instrumenter> list = new ArrayList<>();<NEW_LINE>DCRContextImplementation context = DCRContextImplementation.create(LOGGER);<NEW_LINE>if (context == null) {<NEW_LINE>String file = ExposeInstrumentation.class.getProtectionDomain().getCodeSource().getLocation().getPath();<NEW_LINE>file = new File(file).getAbsolutePath();<NEW_LINE>throw new RuntimeException("Please add \r\n-javaagent:" + file + "\r\nin 'Run As JUnit' vm argument.");<NEW_LINE>}<NEW_LINE>list.<MASK><NEW_LINE>final Instrumenter instrumenter = new MasterInstrumenter(list);<NEW_LINE>TestStatisticsHelperImplementation m_testStatisticsHelper = new TestStatisticsHelperImplementation(m_statisticsServices.getStatisticsIndexMap());<NEW_LINE>TestRegistryImplementation m_testRegistryImplementation = new TestRegistryImplementation(m_threadContexts, m_statisticsServices.getStatisticsSetFactory(), m_testStatisticsHelper, m_times.getTimeAuthority());<NEW_LINE>m_testRegistryImplementation.setInstrumenter(instrumenter);<NEW_LINE>final Logger externalLogger = new ExternalLogger(LOGGER, m_threadContexts);<NEW_LINE>Sleeper m_sleeper = new SleeperImplementation(m_times.getTimeAuthority(), externalLogger, 1.0d, 0.2d);<NEW_LINE>final Statistics scriptStatistics = new ScriptStatisticsImplementation(m_threadContexts, m_statisticsServices, new NullSender());<NEW_LINE>final InternalScriptContext scriptContext = new ScriptContextImplementation(new SimpleWorkerIdentity("unit-test", 0), new SimpleWorkerIdentity("unit-test", 0), m_threadContexts, null, externalLogger, m_sleeper, new SSLControlImplementation(m_threadContexts), scriptStatistics, m_testRegistryImplementation, null, null, null, null);<NEW_LINE>Grinder.grinder = scriptContext;<NEW_LINE>new PluginRegistryImplementation(externalLogger, scriptContext, m_threadContexts, m_statisticsServices, m_times.getTimeAuthority());<NEW_LINE>}
add(new JavaDCRInstrumenterEx(context));
196,680
public String rma(final ICalloutField calloutField) {<NEW_LINE>final I_M_InOut inout = calloutField.getModel(I_M_InOut.class);<NEW_LINE>final <MASK><NEW_LINE>if (rma == null) {<NEW_LINE>return NO_ERROR;<NEW_LINE>}<NEW_LINE>// No Callout Active to fire dependent values<NEW_LINE>if (isCalloutActive()) {<NEW_LINE>return NO_ERROR;<NEW_LINE>}<NEW_LINE>// Get Details<NEW_LINE>final I_M_InOut originalReceipt = rma.getInOut();<NEW_LINE>if (originalReceipt != null) {<NEW_LINE>inout.setDateOrdered(originalReceipt.getDateOrdered());<NEW_LINE>inout.setPOReference(originalReceipt.getPOReference());<NEW_LINE>inout.setAD_Org_ID(originalReceipt.getAD_Org_ID());<NEW_LINE>inout.setAD_OrgTrx_ID(originalReceipt.getAD_OrgTrx_ID());<NEW_LINE>inout.setC_Activity_ID(originalReceipt.getC_Activity_ID());<NEW_LINE>inout.setC_Campaign_ID(originalReceipt.getC_Campaign_ID());<NEW_LINE>inout.setC_Project_ID(originalReceipt.getC_Project_ID());<NEW_LINE>inout.setUser1_ID(originalReceipt.getUser1_ID());<NEW_LINE>inout.setUser2_ID(originalReceipt.getUser2_ID());<NEW_LINE>inout.setM_Warehouse_ID(originalReceipt.getM_Warehouse_ID());<NEW_LINE>//<NEW_LINE>inout.setDeliveryRule(originalReceipt.getDeliveryRule());<NEW_LINE>inout.setDeliveryViaRule(originalReceipt.getDeliveryViaRule());<NEW_LINE>inout.setM_Shipper_ID(originalReceipt.getM_Shipper_ID());<NEW_LINE>inout.setFreightCostRule(originalReceipt.getFreightCostRule());<NEW_LINE>inout.setFreightAmt(originalReceipt.getFreightAmt());<NEW_LINE>inout.setC_Incoterms_ID(originalReceipt.getC_Incoterms_ID());<NEW_LINE>inout.setIncotermLocation(originalReceipt.getIncotermLocation());<NEW_LINE>inout.setEMail(originalReceipt.getEMail());<NEW_LINE>InOutDocumentLocationAdapterFactory.locationAdapter(inout).setFrom(originalReceipt);<NEW_LINE>}<NEW_LINE>return NO_ERROR;<NEW_LINE>}
I_M_RMA rma = inout.getM_RMA();
1,210,445
// Cleanup: default<NEW_LINE>@Nullable<NEW_LINE>public List<ChannelFeed> createMultipleChannels(@NonNull List<ChannelInfo> channels) {<NEW_LINE>List<ChannelFeed> channelFeeds = null;<NEW_LINE>try {<NEW_LINE>String jsonFromObject = GsonUtils.getJsonFromObject(channels, new TypeToken<List<ChannelInfo>>() {<NEW_LINE>}.getType());<NEW_LINE>String createChannelResponse = httpRequestUtils.postData(getCreateMultipleChannelUrl(), "application/json", "application/json", jsonFromObject);<NEW_LINE>Utils.printLog(context, TAG, "Create Multiple channel Response :" + createChannelResponse);<NEW_LINE>MultipleChannelFeedApiResponse channelFeedApiResponse = (MultipleChannelFeedApiResponse) GsonUtils.<MASK><NEW_LINE>if (channelFeedApiResponse != null && channelFeedApiResponse.isSuccess()) {<NEW_LINE>channelFeeds = channelFeedApiResponse.getResponse();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return channelFeeds;<NEW_LINE>}
getObjectFromJson(createChannelResponse, MultipleChannelFeedApiResponse.class);
136,469
public static String prettifyModel(Model model) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>List<Integer<MASK><NEW_LINE>Collections.sort(states);<NEW_LINE>sb.append("Model(states=").append(states).append(", ").append("successors={");<NEW_LINE>for (int state : states) {<NEW_LINE>for (int next : model.getSuccessors(state)) {<NEW_LINE>sb.append(state).append("->").append(next).append(", ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sb.delete(sb.length() - 2, sb.length());<NEW_LINE>sb.append("}, labels={");<NEW_LINE>for (int state : states) {<NEW_LINE>if (model.getLabels(state).size() > 0) {<NEW_LINE>sb.append(state).append(": [");<NEW_LINE>for (Label label : model.getLabels(state)) {<NEW_LINE>sb.append(label.toString()).append(", ");<NEW_LINE>}<NEW_LINE>sb.delete(sb.length() - 2, sb.length());<NEW_LINE>sb.append("], ");<NEW_LINE>} else {<NEW_LINE>sb.append(state).append(": [], ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sb.delete(sb.length() - 2, sb.length());<NEW_LINE>sb.append("})");<NEW_LINE>return sb.toString();<NEW_LINE>}
> states = model.getStates();
204,282
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see<NEW_LINE>* org.springframework.web.servlet.HandlerExceptionResolver#resolveException<NEW_LINE>* (javax.servlet.http.HttpServletRequest,<NEW_LINE>* javax.servlet.http.HttpServletResponse, java.lang.Object,<NEW_LINE>* java.lang.Exception)<NEW_LINE>*/<NEW_LINE>@SuppressWarnings("NullableProblems")<NEW_LINE>@Override<NEW_LINE>public ModelAndView resolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {<NEW_LINE>if (!(handler instanceof HandlerMethod)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>boolean isRestControllerPresent = ((HandlerMethod) handler).getMethod().getDeclaringClass().isAnnotationPresent(RestController.class);<NEW_LINE>boolean isResponseBodyPresent = ((HandlerMethod) handler).getMethodAnnotation(ResponseBody.class) != null;<NEW_LINE>if (!isRestControllerPresent && !isResponseBodyPresent) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// noinspection ThrowableResultOfMethodCallIgnored<NEW_LINE>Throwable throwable = ExceptionUtils.sanitize(ex);<NEW_LINE>StringWriter out = new StringWriter();<NEW_LINE>try (PrintWriter printWriter = new PrintWriter(out)) {<NEW_LINE>throwable.printStackTrace(printWriter);<NEW_LINE>}<NEW_LINE>Map<String, Object> jsonResponse = buildMap(JSON_SUCCESS, false, JSON_CAUSE, ex.getMessage(), JSON_STACKTRACE, out.toString());<NEW_LINE>try {<NEW_LINE>response.setStatus(500);<NEW_LINE>response.setContentType("application/json; charset=UTF-8");<NEW_LINE>response.addHeader("Cache-control", "no-cache");<NEW_LINE>objectMapper.writeValue(<MASK><NEW_LINE>response.flushBuffer();<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.error("Exception was occurred while processing api exception.", e);<NEW_LINE>}<NEW_LINE>return new ModelAndView();<NEW_LINE>}
response.getWriter(), jsonResponse);
335,062
private void addAnchorUrls(Document html, HTTPSampleResult result, HTTPSamplerBase config, List<HTTPSamplerBase> potentialLinks) {<NEW_LINE>String base = "";<NEW_LINE>// $NON-NLS-1$<NEW_LINE>NodeList baseList = html.getElementsByTagName("base");<NEW_LINE>if (baseList.getLength() > 0) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>base = baseList.item(0).getAttributes().<MASK><NEW_LINE>}<NEW_LINE>// $NON-NLS-1$<NEW_LINE>NodeList nodeList = html.getElementsByTagName("a");<NEW_LINE>for (int i = 0; i < nodeList.getLength(); i++) {<NEW_LINE>Node tempNode = nodeList.item(i);<NEW_LINE>NamedNodeMap nnm = tempNode.getAttributes();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Node namedItem = nnm.getNamedItem("href");<NEW_LINE>if (namedItem == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String hrefStr = namedItem.getNodeValue();<NEW_LINE>if (hrefStr.startsWith("javascript:")) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>// No point trying these<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>HTTPSamplerBase newUrl = HtmlParsingUtils.createUrlFromAnchor(hrefStr, ConversionUtils.makeRelativeURL(result.getURL(), base));<NEW_LINE>newUrl.setMethod(HTTPConstants.GET);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Potential <a href> match: " + newUrl);<NEW_LINE>}<NEW_LINE>if (HtmlParsingUtils.isAnchorMatched(newUrl, config)) {<NEW_LINE>log.debug("Matched!");<NEW_LINE>potentialLinks.add(newUrl);<NEW_LINE>}<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>log.warn("Bad URL " + e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getNamedItem("href").getNodeValue();