idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
111,096 | public boolean matchesName(char[] pattern, char[] name) {<NEW_LINE>// null is as if it was "*"<NEW_LINE>if (pattern == null)<NEW_LINE>return true;<NEW_LINE>if (name != null) {<NEW_LINE>boolean isCaseSensitive = (this.matchRule & R_CASE_SENSITIVE) != 0;<NEW_LINE>int matchMode = this.matchRule & MODE_MASK;<NEW_LINE>boolean emptyPattern = pattern.length == 0;<NEW_LINE>if (emptyPattern && (this.matchRule & R_PREFIX_MATCH) != 0)<NEW_LINE>return true;<NEW_LINE>boolean sameLength = pattern.length == name.length;<NEW_LINE>boolean canBePrefix = name.length >= pattern.length;<NEW_LINE>boolean matchFirstChar = !isCaseSensitive || emptyPattern || (name.length > 0 && pattern[0] == name[0]);<NEW_LINE>if ((matchMode & R_SUBSTRING_MATCH) != 0) {<NEW_LINE>if (CharOperation.substringMatch(pattern, name))<NEW_LINE>return true;<NEW_LINE>matchMode &= ~R_SUBSTRING_MATCH;<NEW_LINE>}<NEW_LINE>if ((matchMode & SearchPattern.R_SUBWORD_MATCH) != 0) {<NEW_LINE>if (CharOperation.subWordMatch(pattern, name))<NEW_LINE>return true;<NEW_LINE>matchMode &= ~SearchPattern.R_SUBWORD_MATCH;<NEW_LINE>}<NEW_LINE>switch(matchMode) {<NEW_LINE>case R_EXACT_MATCH:<NEW_LINE>if (sameLength && matchFirstChar) {<NEW_LINE>return CharOperation.equals(pattern, name, isCaseSensitive);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case R_PREFIX_MATCH:<NEW_LINE>if (canBePrefix && matchFirstChar) {<NEW_LINE>return CharOperation.prefixEquals(pattern, name, isCaseSensitive);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case R_PATTERN_MATCH:<NEW_LINE>if (!isCaseSensitive)<NEW_LINE>pattern = CharOperation.toLowerCase(pattern);<NEW_LINE>return CharOperation.<MASK><NEW_LINE>case SearchPattern.R_CAMELCASE_MATCH:<NEW_LINE>if (matchFirstChar && CharOperation.camelCaseMatch(pattern, name, false)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// only test case insensitive as CamelCase already verified prefix case sensitive<NEW_LINE>if (!isCaseSensitive && matchFirstChar && CharOperation.prefixEquals(pattern, name, false)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case SearchPattern.R_CAMELCASE_SAME_PART_COUNT_MATCH:<NEW_LINE>return matchFirstChar && CharOperation.camelCaseMatch(pattern, name, true);<NEW_LINE>case R_REGEXP_MATCH:<NEW_LINE>return Pattern.matches(new String(pattern), new String(name));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | match(pattern, name, isCaseSensitive); |
680,355 | private void recordAttributes(SpanEventRecorder recorder, MethodDescriptor methodDescriptor, Object[] args) {<NEW_LINE>if (methodDescriptor.getMethodName().equals("execute")) {<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_URL_ANNOTATION_KEY, args[0]);<NEW_LINE>if (recordDsl) {<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_DSL_ANNOTATION_KEY, chunkDsl((String) args[1]));<NEW_LINE>}<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_ACTION_ANNOTATION_KEY, "POST");<NEW_LINE>if (recordResponseHandler) {<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_RESPONSEHANDLE_ANNOTATION_KEY, args[2]);<NEW_LINE>}<NEW_LINE>} else if (methodDescriptor.getMethodName().equals("executeHttp")) {<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_URL_ANNOTATION_KEY, args[0]);<NEW_LINE>if (recordDsl) {<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_DSL_ANNOTATION_KEY, chunkDsl((String) args[1]));<NEW_LINE>}<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_ACTION_ANNOTATION_KEY, args[2]);<NEW_LINE>if (recordResponseHandler) {<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants<MASK><NEW_LINE>}<NEW_LINE>} else if (methodDescriptor.getMethodName().equals("executeSimpleRequest")) {<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_URL_ANNOTATION_KEY, args[0]);<NEW_LINE>if (recordDsl) {<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_DSL_ANNOTATION_KEY, chunkDsl((String) args[1]));<NEW_LINE>}<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_ACTION_ANNOTATION_KEY, "POST");<NEW_LINE>if (recordResponseHandler) {<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_RESPONSEHANDLE_ANNOTATION_KEY, args[2]);<NEW_LINE>}<NEW_LINE>} else if (methodDescriptor.getMethodName().equals("executeRequest")) {<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_URL_ANNOTATION_KEY, args[0]);<NEW_LINE>if (recordDsl) {<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_DSL_ANNOTATION_KEY, chunkDsl((String) args[1]));<NEW_LINE>}<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_ACTION_ANNOTATION_KEY, args[2]);<NEW_LINE>if (recordResponseHandler) {<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_RESPONSEHANDLE_ANNOTATION_KEY, args[3]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .ARGS_RESPONSEHANDLE_ANNOTATION_KEY, args[3]); |
296,658 | // Writes a .SF file with a digest to the manifest.<NEW_LINE>private static void writeSignatureFile(SignatureOutputStream out, Manifest manifest) throws IOException, GeneralSecurityException {<NEW_LINE>Manifest sf = new Manifest();<NEW_LINE>Attributes main = sf.getMainAttributes();<NEW_LINE>main.putValue("Signature-Version", "1.0");<NEW_LINE>main.putValue("Created-By", "1.0 (Android)");<NEW_LINE>Base64.Encoder base64 = Base64.getEncoder();<NEW_LINE>MessageDigest md = MessageDigest.getInstance(DIGEST_ALGORITHM);<NEW_LINE>PrintStream print = new PrintStream(new DigestOutputStream(new ByteArrayOutputStream(), md), true, "UTF-8");<NEW_LINE>// Digest of the entire manifest<NEW_LINE>manifest.write(print);<NEW_LINE>print.flush();<NEW_LINE>main.putValue(DIGEST_MANIFEST_ATTR, base64.encodeToString(md.digest()));<NEW_LINE>Map<String, Attributes> entries = manifest.getEntries();<NEW_LINE>for (Map.Entry<String, Attributes> entry : entries.entrySet()) {<NEW_LINE>// Digest of the manifest stanza for this entry.<NEW_LINE>print.print("Name: " + entry.getKey() + "\r\n");<NEW_LINE>for (Map.Entry<Object, Object> att : entry.getValue().entrySet()) {<NEW_LINE>print.print(att.getKey() + ": " + att.getValue() + "\r\n");<NEW_LINE>}<NEW_LINE>print.print("\r\n");<NEW_LINE>print.flush();<NEW_LINE>Attributes sfAttr = new Attributes();<NEW_LINE>sfAttr.putValue(DIGEST_ATTR, base64.encodeToString<MASK><NEW_LINE>sf.getEntries().put(entry.getKey(), sfAttr);<NEW_LINE>}<NEW_LINE>sf.write(out);<NEW_LINE>// A bug in the java.util.jar implementation of Android platforms<NEW_LINE>// up to version 1.6 will cause a spurious IOException to be thrown<NEW_LINE>// if the length of the signature file is a multiple of 1024 bytes.<NEW_LINE>// As a workaround, add an extra CRLF in this case.<NEW_LINE>if ((out.size() % 1024) == 0) {<NEW_LINE>out.write('\r');<NEW_LINE>out.write('\n');<NEW_LINE>}<NEW_LINE>} | (md.digest())); |
1,224,642 | final ListDataIntegrationAssociationsResult executeListDataIntegrationAssociations(ListDataIntegrationAssociationsRequest listDataIntegrationAssociationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listDataIntegrationAssociationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListDataIntegrationAssociationsRequest> request = null;<NEW_LINE>Response<ListDataIntegrationAssociationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListDataIntegrationAssociationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listDataIntegrationAssociationsRequest));<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, "AppIntegrations");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListDataIntegrationAssociations");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListDataIntegrationAssociationsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListDataIntegrationAssociationsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
629,753 | public List<ExpressInfo> query(ExpressCompany company, String num) {<NEW_LINE>String appId = JPressOptions.get("express_api_appid");<NEW_LINE>String <MASK><NEW_LINE>String param = "{\"com\":\"" + company.getCode() + "\",\"num\":\"" + num + "\"}";<NEW_LINE>String sign = HashKit.md5(param + appSecret + appId).toUpperCase();<NEW_LINE>HashMap params = new HashMap();<NEW_LINE>params.put("param", param);<NEW_LINE>params.put("sign", sign);<NEW_LINE>params.put("customer", appId);<NEW_LINE>String result = HttpUtil.httpPost("http://poll.kuaidi100.com/poll/query.do", params);<NEW_LINE>if (StrUtil.isBlank(result)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>JSONObject jsonObject = JSON.parseObject(result);<NEW_LINE>JSONArray jsonArray = jsonObject.getJSONArray("data");<NEW_LINE>if (jsonArray != null && jsonArray.size() > 0) {<NEW_LINE>List<ExpressInfo> list = new ArrayList<>();<NEW_LINE>for (int i = 0; i < jsonArray.size(); i++) {<NEW_LINE>JSONObject expObject = jsonArray.getJSONObject(i);<NEW_LINE>ExpressInfo ei = new ExpressInfo();<NEW_LINE>ei.setInfo(expObject.getString("context"));<NEW_LINE>ei.setTime(expObject.getString("time"));<NEW_LINE>list.add(ei);<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>LOG.error(ex.toString(), ex);<NEW_LINE>}<NEW_LINE>LOG.error(result);<NEW_LINE>return null;<NEW_LINE>} | appSecret = JPressOptions.get("express_api_appsecret"); |
1,809,201 | public PollState poll(final Handler<T> eventHandler) throws Exception {<NEW_LINE>final <MASK><NEW_LINE>long nextSequence = currentSequence + 1;<NEW_LINE>final long availableSequence = sequencer.getHighestPublishedSequence(nextSequence, gatingSequence.get());<NEW_LINE>if (nextSequence <= availableSequence) {<NEW_LINE>boolean processNextEvent;<NEW_LINE>long processedSequence = currentSequence;<NEW_LINE>try {<NEW_LINE>do {<NEW_LINE>final T event = dataProvider.get(nextSequence);<NEW_LINE>processNextEvent = eventHandler.onEvent(event, nextSequence, nextSequence == availableSequence);<NEW_LINE>processedSequence = nextSequence;<NEW_LINE>nextSequence++;<NEW_LINE>} while (nextSequence <= availableSequence && processNextEvent);<NEW_LINE>} finally {<NEW_LINE>sequence.set(processedSequence);<NEW_LINE>}<NEW_LINE>return PollState.PROCESSING;<NEW_LINE>} else if (sequencer.getCursor() >= nextSequence) {<NEW_LINE>return PollState.GATING;<NEW_LINE>} else {<NEW_LINE>return PollState.IDLE;<NEW_LINE>}<NEW_LINE>} | long currentSequence = sequence.get(); |
733,150 | protected Object doNoClosure(VirtualFrame frame, PFunction callee, @SuppressWarnings("unused") PythonObject globals, @SuppressWarnings("unused") PCell[] closure, Object[] arguments, @Cached ConditionProfile generatorFunctionProfile) {<NEW_LINE>RootCallTarget ct = (RootCallTarget) callNode.getCurrentCallTarget();<NEW_LINE>optionallySetGeneratorFunction(arguments, ct, generatorFunctionProfile, callee);<NEW_LINE>// If the frame is 'null', we expect the execution state (i.e. caller info and exception<NEW_LINE>// state) in the context. There are two common reasons for having a 'null' frame:<NEW_LINE>// 1. This node is the first invoke node used via interop.<NEW_LINE>// 2. This invoke node is (indirectly) used behind a TruffleBoundary.<NEW_LINE>// This is preferably prepared using 'IndirectCallContext.enter'.<NEW_LINE>if (profileIsNullFrame(frame == null)) {<NEW_LINE>PythonThreadState threadState = PythonContext.get(this).getThreadState(PythonLanguage.get(this));<NEW_LINE>Object state = IndirectCalleeContext.<MASK><NEW_LINE>try {<NEW_LINE>return callNode.call(arguments);<NEW_LINE>} finally {<NEW_LINE>IndirectCalleeContext.exit(threadState, state);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>callContext.prepareCall(frame, arguments, ct, this);<NEW_LINE>return callNode.call(arguments);<NEW_LINE>}<NEW_LINE>} | enter(threadState, arguments, ct); |
12,451 | public Request<DescribeSpotFleetRequestHistoryRequest> marshall(DescribeSpotFleetRequestHistoryRequest describeSpotFleetRequestHistoryRequest) {<NEW_LINE>if (describeSpotFleetRequestHistoryRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<DescribeSpotFleetRequestHistoryRequest> request = new DefaultRequest<DescribeSpotFleetRequestHistoryRequest>(describeSpotFleetRequestHistoryRequest, "AmazonEC2");<NEW_LINE>request.addParameter("Action", "DescribeSpotFleetRequestHistory");<NEW_LINE>request.addParameter("Version", "2016-11-15");<NEW_LINE><MASK><NEW_LINE>if (describeSpotFleetRequestHistoryRequest.getEventType() != null) {<NEW_LINE>request.addParameter("EventType", StringUtils.fromString(describeSpotFleetRequestHistoryRequest.getEventType()));<NEW_LINE>}<NEW_LINE>if (describeSpotFleetRequestHistoryRequest.getMaxResults() != null) {<NEW_LINE>request.addParameter("MaxResults", StringUtils.fromInteger(describeSpotFleetRequestHistoryRequest.getMaxResults()));<NEW_LINE>}<NEW_LINE>if (describeSpotFleetRequestHistoryRequest.getNextToken() != null) {<NEW_LINE>request.addParameter("NextToken", StringUtils.fromString(describeSpotFleetRequestHistoryRequest.getNextToken()));<NEW_LINE>}<NEW_LINE>if (describeSpotFleetRequestHistoryRequest.getSpotFleetRequestId() != null) {<NEW_LINE>request.addParameter("SpotFleetRequestId", StringUtils.fromString(describeSpotFleetRequestHistoryRequest.getSpotFleetRequestId()));<NEW_LINE>}<NEW_LINE>if (describeSpotFleetRequestHistoryRequest.getStartTime() != null) {<NEW_LINE>request.addParameter("StartTime", StringUtils.fromDate(describeSpotFleetRequestHistoryRequest.getStartTime()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | request.setHttpMethod(HttpMethodName.POST); |
1,821,530 | public Void visitFunctionCall(final FunctionCall functionCall, final Void context) {<NEW_LINE>final FunctionName functionName = functionCall.getName();<NEW_LINE>final boolean isTableFunction = metaStore.isTableFunction(functionName);<NEW_LINE>if (isTableFunction) {<NEW_LINE>if (tableFunctionName.isPresent()) {<NEW_LINE>throw new KsqlException("Table functions cannot be nested: " + tableFunctionName.get() + "(" + functionName + "())");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (analysis.getGroupBy().isPresent()) {<NEW_LINE>throw new KsqlException("Table functions cannot be used with aggregations.");<NEW_LINE>}<NEW_LINE>if (searchedCaseExpression.isPresent()) {<NEW_LINE>throw new KsqlException("Table functions cannot be used in CASE: " + ExpressionFormatter.formatExpression(searchedCaseExpression.get()));<NEW_LINE>}<NEW_LINE>analysis.addTableFunction(functionCall);<NEW_LINE>}<NEW_LINE>super.visitFunctionCall(functionCall, context);<NEW_LINE>if (isTableFunction) {<NEW_LINE>tableFunctionName = Optional.empty();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | tableFunctionName = Optional.of(functionName); |
620,665 | public void marshall(RegisterDomainRequest registerDomainRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (registerDomainRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(registerDomainRequest.getIdnLangCode(), IDNLANGCODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(registerDomainRequest.getDurationInYears(), DURATIONINYEARS_BINDING);<NEW_LINE>protocolMarshaller.marshall(registerDomainRequest.getAutoRenew(), AUTORENEW_BINDING);<NEW_LINE>protocolMarshaller.marshall(registerDomainRequest.getAdminContact(), ADMINCONTACT_BINDING);<NEW_LINE>protocolMarshaller.marshall(registerDomainRequest.getRegistrantContact(), REGISTRANTCONTACT_BINDING);<NEW_LINE>protocolMarshaller.marshall(registerDomainRequest.getTechContact(), TECHCONTACT_BINDING);<NEW_LINE>protocolMarshaller.marshall(registerDomainRequest.getPrivacyProtectAdminContact(), PRIVACYPROTECTADMINCONTACT_BINDING);<NEW_LINE>protocolMarshaller.marshall(registerDomainRequest.getPrivacyProtectRegistrantContact(), PRIVACYPROTECTREGISTRANTCONTACT_BINDING);<NEW_LINE>protocolMarshaller.marshall(registerDomainRequest.getPrivacyProtectTechContact(), PRIVACYPROTECTTECHCONTACT_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | registerDomainRequest.getDomainName(), DOMAINNAME_BINDING); |
193,548 | // algo.scc.iterative<NEW_LINE>@Procedure(value = "algo.scc.iterative", mode = Mode.WRITE)<NEW_LINE>@Description("CALL algo.scc.iterative(label:String, relationship:String, config:Map<String, Object>) YIELD " + "loadMillis, computeMillis, writeMillis, setCount, maxSetSize, minSetSize")<NEW_LINE>public Stream<SCCResult> sccIterativeTarjan(@Name(value = "label", defaultValue = "") String label, @Name(value = "relationship", defaultValue = "") String relationship, @Name(value = "config", defaultValue = "{}") Map<String, Object> config) {<NEW_LINE>final ProcedureConfiguration configuration = ProcedureConfiguration.create(config);<NEW_LINE>final SCCResult.Builder builder = SCCResult.builder();<NEW_LINE>final ProgressTimer loadTimer = builder.timeLoad();<NEW_LINE>final Graph graph = new GraphLoader(api, Pools.DEFAULT).init(log, label, relationship, configuration).withoutRelationshipWeights().withDirection(Direction.OUTGOING).load(configuration.getGraphImpl());<NEW_LINE>loadTimer.stop();<NEW_LINE>if (graph.nodeCount() == 0) {<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>final AllocationTracker tracker = AllocationTracker.create();<NEW_LINE>final TerminationFlag terminationFlag = TerminationFlag.wrap(transaction);<NEW_LINE>final SCCAlgorithm tarjan = SCCAlgorithm.iterativeTarjan(graph, tracker).withProgressLogger(ProgressLogger.wrap(log, "SCC(IterativeTarjan)")).withTerminationFlag(terminationFlag);<NEW_LINE>builder.timeEval(tarjan::compute);<NEW_LINE>if (configuration.isWriteFlag()) {<NEW_LINE>builder.withWrite(true);<NEW_LINE>String partitionProperty = configuration.get(CONFIG_WRITE_PROPERTY, CONFIG_OLD_WRITE_PROPERTY, CONFIG_CLUSTER);<NEW_LINE>builder.withPartitionProperty(partitionProperty).withWriteProperty(partitionProperty);<NEW_LINE>builder.timeWrite(() -> write(configuration, graph, terminationFlag, tarjan, partitionProperty));<NEW_LINE>}<NEW_LINE>if (graph instanceof HugeGraph) {<NEW_LINE>final HugeLongArray connectedComponents = tarjan.getConnectedComponents();<NEW_LINE>return Stream.of(builder.build(graph.nodeCount(), connectedComponents::get));<NEW_LINE>}<NEW_LINE>final int[] connectedComponents = tarjan.getConnectedComponents();<NEW_LINE>tarjan.release();<NEW_LINE>return Stream.of(builder.build(graph.nodeCount(), l -> (long) connectedComponents[((int) l)]));<NEW_LINE>} | Stream.of(SCCResult.EMPTY); |
587,443 | public static void fhirResourceListHistory(String resourceName) throws IOException, URISyntaxException {<NEW_LINE>// String resourceName =<NEW_LINE>// String.format(<NEW_LINE>// FHIR_NAME, "project-id", "region-id", "dataset-id", "store-id", "resource-type",<NEW_LINE>// "resource-id");<NEW_LINE>// Initialize the client, which will be used to interact with the service.<NEW_LINE>CloudHealthcare client = createClient();<NEW_LINE>HttpClient httpClient = HttpClients.createDefault();<NEW_LINE>String uri = String.format("%sv1/%s/_history", <MASK><NEW_LINE>URIBuilder uriBuilder = new URIBuilder(uri).setParameter("access_token", getAccessToken());<NEW_LINE>HttpUriRequest request = RequestBuilder.get().setUri(uriBuilder.build()).addHeader("Content-Type", "application/fhir+json").addHeader("Accept-Charset", "utf-8").addHeader("Accept", "application/fhir+json; charset=utf-8").build();<NEW_LINE>// Execute the request and process the results.<NEW_LINE>HttpResponse response = httpClient.execute(request);<NEW_LINE>HttpEntity responseEntity = response.getEntity();<NEW_LINE>if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {<NEW_LINE>System.err.print(String.format("Exception retrieving FHIR history: %s\n", response.getStatusLine().toString()));<NEW_LINE>responseEntity.writeTo(System.err);<NEW_LINE>throw new RuntimeException();<NEW_LINE>}<NEW_LINE>System.out.println("FHIR resource history retrieved: ");<NEW_LINE>responseEntity.writeTo(System.out);<NEW_LINE>} | client.getRootUrl(), resourceName); |
1,602,084 | final DeleteTapeResult executeDeleteTape(DeleteTapeRequest deleteTapeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteTapeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteTapeRequest> request = null;<NEW_LINE>Response<DeleteTapeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteTapeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteTapeRequest));<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, "Storage Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteTape");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteTapeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | false), new DeleteTapeResultJsonUnmarshaller()); |
13,651 | public void onError(java.lang.Exception e) {<NEW_LINE>byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;<NEW_LINE>org.apache.thrift.TSerializable msg;<NEW_LINE>closeMultiScan_result result = new closeMultiScan_result();<NEW_LINE>if (e instanceof NoSuchScanIDException) {<NEW_LINE>result.nssi = (NoSuchScanIDException) e;<NEW_LINE>result.setNssiIsSet(true);<NEW_LINE>msg = result;<NEW_LINE>} else if (e instanceof org.apache.thrift.transport.TTransportException) {<NEW_LINE>_LOGGER.error("TTransportException inside handler", e);<NEW_LINE>fb.close();<NEW_LINE>return;<NEW_LINE>} else if (e instanceof org.apache.thrift.TApplicationException) {<NEW_LINE>_LOGGER.error("TApplicationException inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = (org.apache.thrift.TApplicationException) e;<NEW_LINE>} else {<NEW_LINE>_LOGGER.error("Exception inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.<MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>fcall.sendResponse(fb, msg, msgType, seqid);<NEW_LINE>} catch (java.lang.Exception ex) {<NEW_LINE>_LOGGER.error("Exception writing to internal frame buffer", ex);<NEW_LINE>fb.close();<NEW_LINE>}<NEW_LINE>} | INTERNAL_ERROR, e.getMessage()); |
808,081 | private void loadAcceleratorPreset(final String shortcutKey, final String keystrokeString, Properties allPresets) {<NEW_LINE>if (!shortcutKey.startsWith(SHORTCUT_PROPERTY_PREFIX)) {<NEW_LINE>LogUtils.warn("wrong property key " + shortcutKey);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int pos = shortcutKey.indexOf("/", SHORTCUT_PROPERTY_PREFIX.length());<NEW_LINE>if (pos <= 0) {<NEW_LINE>LogUtils.warn("wrong property key " + shortcutKey);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String modeName = shortcutKey.substring(SHORTCUT_PROPERTY_PREFIX.length(), pos);<NEW_LINE>final String itemKey = shortcutKey.substring(pos + 1);<NEW_LINE>Controller controller = Controller.getCurrentController();<NEW_LINE>final ModeController modeController = controller.getModeController(modeName);<NEW_LINE>if (modeController != null) {<NEW_LINE>final KeyStroke keyStroke;<NEW_LINE>if (!keystrokeString.equals("")) {<NEW_LINE>keyStroke = UITools.getKeyStroke(keystrokeString);<NEW_LINE>final AFreeplaneAction oldAction = accelerators.get(key(modeController, keyStroke));<NEW_LINE>if (!acceleratorIsDefinedByUserProperties(oldAction, modeController, allPresets))<NEW_LINE>setAccelerator(modeController, oldAction, null);<NEW_LINE>} else {<NEW_LINE>keyStroke = null;<NEW_LINE>}<NEW_LINE>final AFreeplaneAction action = modeController.getAction(itemKey);<NEW_LINE>if (action != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>setKeysetProperty(shortcutKey, keystrokeString);<NEW_LINE>} | setAccelerator(modeController, action, keyStroke); |
1,092,998 | Node processObjectLiteral(ObjectLiteralExpressionTree objTree) {<NEW_LINE>Node node = newNode(Token.OBJECTLIT);<NEW_LINE><MASK><NEW_LINE>boolean maybeWarn = false;<NEW_LINE>for (ParseTree el : objTree.propertyNameAndValues) {<NEW_LINE>if (el.type == ParseTreeType.DEFAULT_PARAMETER) {<NEW_LINE>// (e.g. var o = { x=4 };) This is only parsed for compatibility with object patterns.<NEW_LINE>errorReporter.error("Default value cannot appear at top level of an object literal.", sourceName, lineno(el), 0);<NEW_LINE>continue;<NEW_LINE>} else if (el.type == ParseTreeType.GET_ACCESSOR && maybeReportGetter(el)) {<NEW_LINE>continue;<NEW_LINE>} else if (el.type == ParseTreeType.SET_ACCESSOR && maybeReportSetter(el)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Node key = transform(el);<NEW_LINE>if (!key.isComputedProp() && !key.isQuotedString() && !key.isSpread() && !currentFileIsExterns) {<NEW_LINE>maybeWarnKeywordProperty(key);<NEW_LINE>}<NEW_LINE>if (key.isShorthandProperty()) {<NEW_LINE>maybeWarn = true;<NEW_LINE>}<NEW_LINE>node.addChildToBack(key);<NEW_LINE>}<NEW_LINE>if (maybeWarn) {<NEW_LINE>maybeWarnForFeature(objTree, Feature.EXTENDED_OBJECT_LITERALS);<NEW_LINE>}<NEW_LINE>return node;<NEW_LINE>} | node.setTrailingComma(objTree.hasTrailingComma); |
108,766 | public synchronized TermuxSession createTermuxSession(ExecutionCommand executionCommand, String sessionName) {<NEW_LINE>if (executionCommand == null)<NEW_LINE>return null;<NEW_LINE>Logger.logDebug(LOG_TAG, "Creating \"" + <MASK><NEW_LINE>if (!Runner.TERMINAL_SESSION.equalsRunner(executionCommand.runner)) {<NEW_LINE>Logger.logDebug(LOG_TAG, "Ignoring wrong runner \"" + executionCommand.runner + "\" command passed to createTermuxSession()");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (Logger.getLogLevel() >= Logger.LOG_LEVEL_VERBOSE)<NEW_LINE>Logger.logVerboseExtended(LOG_TAG, executionCommand.toString());<NEW_LINE>// If the execution command was started for a plugin, only then will the stdout be set<NEW_LINE>// Otherwise if command was manually started by the user like by adding a new terminal session,<NEW_LINE>// then no need to set stdout<NEW_LINE>executionCommand.terminalTranscriptRows = mProperties.getTerminalTranscriptRows();<NEW_LINE>TermuxSession newTermuxSession = TermuxSession.execute(this, executionCommand, getTermuxTerminalSessionClient(), this, new TermuxShellEnvironmentClient(), sessionName, executionCommand.isPluginExecutionCommand);<NEW_LINE>if (newTermuxSession == null) {<NEW_LINE>Logger.logError(LOG_TAG, "Failed to execute new TermuxSession command for:\n" + executionCommand.getCommandIdAndLabelLogString());<NEW_LINE>// If the execution command was started for a plugin, then process the error<NEW_LINE>if (executionCommand.isPluginExecutionCommand)<NEW_LINE>PluginUtils.processPluginExecutionCommandError(this, LOG_TAG, executionCommand, false);<NEW_LINE>else<NEW_LINE>Logger.logErrorExtended(LOG_TAG, executionCommand.toString());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>mTermuxSessions.add(newTermuxSession);<NEW_LINE>// Remove the execution command from the pending plugin execution commands list since it has<NEW_LINE>// now been processed<NEW_LINE>if (executionCommand.isPluginExecutionCommand)<NEW_LINE>mPendingPluginExecutionCommands.remove(executionCommand);<NEW_LINE>// Notify {@link TermuxSessionsListViewController} that sessions list has been updated if<NEW_LINE>// activity in is foreground<NEW_LINE>if (mTermuxTerminalSessionClient != null)<NEW_LINE>mTermuxTerminalSessionClient.termuxSessionListNotifyUpdated();<NEW_LINE>updateNotification();<NEW_LINE>// No need to recreate the activity since it likely just started and theme should already have applied<NEW_LINE>TermuxActivity.updateTermuxActivityStyling(this, false);<NEW_LINE>return newTermuxSession;<NEW_LINE>} | executionCommand.getCommandIdAndLabelLogString() + "\" TermuxSession"); |
768,959 | protected DatadogReporter createInstance() {<NEW_LINE>final DatadogReporter.Builder reporter = <MASK><NEW_LINE>final Transport transport;<NEW_LINE>String transportName = getProperty(TRANSPORT);<NEW_LINE>if ("http".equalsIgnoreCase(transportName)) {<NEW_LINE>HttpTransport.Builder builder = new HttpTransport.Builder();<NEW_LINE>builder.withApiKey(getProperty(API_KEY));<NEW_LINE>if (hasProperty(CONNECT_TIMEOUT)) {<NEW_LINE>builder.withConnectTimeout(getProperty(CONNECT_TIMEOUT, Integer.class));<NEW_LINE>}<NEW_LINE>if (hasProperty(SOCKET_TIMEOUT)) {<NEW_LINE>builder.withSocketTimeout(getProperty(SOCKET_TIMEOUT, Integer.class));<NEW_LINE>}<NEW_LINE>transport = builder.build();<NEW_LINE>} else if ("udp".equalsIgnoreCase(transportName) || "statsd".equalsIgnoreCase(transportName)) {<NEW_LINE>UdpTransport.Builder builder = new UdpTransport.Builder();<NEW_LINE>if (hasProperty(STATSD_HOST)) {<NEW_LINE>builder.withStatsdHost(getProperty(STATSD_HOST));<NEW_LINE>}<NEW_LINE>if (hasProperty(STATSD_PORT)) {<NEW_LINE>builder.withPort(getProperty(STATSD_PORT, Integer.class));<NEW_LINE>}<NEW_LINE>if (hasProperty(STATSD_PREFIX)) {<NEW_LINE>builder.withPrefix(getProperty(STATSD_PREFIX));<NEW_LINE>}<NEW_LINE>transport = builder.build();<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Invalid Datadog Transport: " + transportName);<NEW_LINE>}<NEW_LINE>reporter.withTransport(transport);<NEW_LINE>if (hasProperty(TAGS)) {<NEW_LINE>reporter.withTags(asList(StringUtils.tokenizeToStringArray(getProperty(TAGS), ",", true, true)));<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(getProperty(HOST))) {<NEW_LINE>reporter.withHost(getProperty(HOST));<NEW_LINE>} else if ("true".equalsIgnoreCase(getProperty(EC2_HOST))) {<NEW_LINE>try {<NEW_LINE>reporter.withEC2Host();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new IllegalStateException("DatadogReporter.Builder.withEC2Host threw an exception", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasProperty(EXPANSION)) {<NEW_LINE>String configString = getProperty(EXPANSION).trim().toUpperCase(Locale.ENGLISH);<NEW_LINE>final EnumSet<Expansion> expansions;<NEW_LINE>if ("ALL".equals(configString)) {<NEW_LINE>expansions = Expansion.ALL;<NEW_LINE>} else {<NEW_LINE>expansions = EnumSet.noneOf(Expansion.class);<NEW_LINE>for (String expandedMetricStr : StringUtils.tokenizeToStringArray(configString, ",", true, true)) {<NEW_LINE>expansions.add(Expansion.valueOf(expandedMetricStr.replace(' ', '_')));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reporter.withExpansions(expansions);<NEW_LINE>}<NEW_LINE>if (hasProperty(DYNAMIC_TAG_CALLBACK_REF)) {<NEW_LINE>reporter.withDynamicTagCallback(getPropertyRef(DYNAMIC_TAG_CALLBACK_REF, DynamicTagsCallback.class));<NEW_LINE>}<NEW_LINE>if (hasProperty(METRIC_NAME_FORMATTER_REF)) {<NEW_LINE>reporter.withMetricNameFormatter(getPropertyRef(METRIC_NAME_FORMATTER_REF, MetricNameFormatter.class));<NEW_LINE>}<NEW_LINE>if (hasProperty(PREFIX)) {<NEW_LINE>reporter.withPrefix(getProperty(PREFIX));<NEW_LINE>}<NEW_LINE>if (hasProperty(DURATION_UNIT)) {<NEW_LINE>reporter.convertDurationsTo(getProperty(DURATION_UNIT, TimeUnit.class));<NEW_LINE>}<NEW_LINE>if (hasProperty(RATE_UNIT)) {<NEW_LINE>reporter.convertRatesTo(getProperty(RATE_UNIT, TimeUnit.class));<NEW_LINE>}<NEW_LINE>if (hasProperty(CLOCK_REF)) {<NEW_LINE>reporter.withClock(getPropertyRef(CLOCK_REF, Clock.class));<NEW_LINE>}<NEW_LINE>reporter.filter(getMetricFilter());<NEW_LINE>return reporter.build();<NEW_LINE>} | DatadogReporter.forRegistry(getMetricRegistry()); |
1,483,061 | private MatOfPoint2f findImagePoints(Mat mat) {<NEW_LINE>MatOfPoint2f imagePoints = new MatOfPoint2f();<NEW_LINE>boolean found = false;<NEW_LINE>switch(pattern) {<NEW_LINE>case Chessboard:<NEW_LINE>int chessBoardFlags = Calib3d.CALIB_CB_ADAPTIVE_THRESH | Calib3d.CALIB_CB_NORMALIZE_IMAGE;<NEW_LINE>if (lensModel != LensModel.Fisheye) {<NEW_LINE>// fast check erroneously fails with high distortions like fisheye<NEW_LINE>chessBoardFlags |= Calib3d.CALIB_CB_FAST_CHECK;<NEW_LINE>}<NEW_LINE>found = Calib3d.findChessboardCorners(<MASK><NEW_LINE>if (found) {<NEW_LINE>// improve the found corners' coordinate accuracy for chessboard<NEW_LINE>Mat matGray = new Mat();<NEW_LINE>Imgproc.cvtColor(mat, matGray, Imgproc.COLOR_BGR2GRAY);<NEW_LINE>Imgproc.cornerSubPix(matGray, imagePoints, new Size(11, 11), new Size(-1, -1), new TermCriteria(TermCriteria.EPS + TermCriteria.COUNT, 30, 0.1));<NEW_LINE>matGray.release();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case CirclesGrid:<NEW_LINE>found = Calib3d.findCirclesGrid(mat, patternSize, imagePoints);<NEW_LINE>break;<NEW_LINE>case AsymmetricCirclesGrid:<NEW_LINE>found = Calib3d.findCirclesGrid(mat, patternSize, imagePoints, Calib3d.CALIB_CB_ASYMMETRIC_GRID);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (found) {<NEW_LINE>return imagePoints;<NEW_LINE>} else {<NEW_LINE>imagePoints.release();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | mat, patternSize, imagePoints, chessBoardFlags); |
724,690 | public static DescribeDomainCertificateInfoResponse unmarshall(DescribeDomainCertificateInfoResponse describeDomainCertificateInfoResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDomainCertificateInfoResponse.setRequestId(_ctx.stringValue("DescribeDomainCertificateInfoResponse.RequestId"));<NEW_LINE>List<CertInfo> certInfos = new ArrayList<CertInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDomainCertificateInfoResponse.CertInfos.Length"); i++) {<NEW_LINE>CertInfo certInfo = new CertInfo();<NEW_LINE>certInfo.setDomainName(_ctx.stringValue("DescribeDomainCertificateInfoResponse.CertInfos[" + i + "].DomainName"));<NEW_LINE>certInfo.setCertName(_ctx.stringValue("DescribeDomainCertificateInfoResponse.CertInfos[" + i + "].CertName"));<NEW_LINE>certInfo.setCertDomainName(_ctx.stringValue("DescribeDomainCertificateInfoResponse.CertInfos[" + i + "].CertDomainName"));<NEW_LINE>certInfo.setCertExpireTime(_ctx.stringValue("DescribeDomainCertificateInfoResponse.CertInfos[" + i + "].CertExpireTime"));<NEW_LINE>certInfo.setCertLife(_ctx.stringValue("DescribeDomainCertificateInfoResponse.CertInfos[" + i + "].CertLife"));<NEW_LINE>certInfo.setCertOrg(_ctx.stringValue("DescribeDomainCertificateInfoResponse.CertInfos[" + i + "].CertOrg"));<NEW_LINE>certInfo.setCertType(_ctx.stringValue("DescribeDomainCertificateInfoResponse.CertInfos[" + i + "].CertType"));<NEW_LINE>certInfo.setServerCertificateStatus(_ctx.stringValue("DescribeDomainCertificateInfoResponse.CertInfos[" + i + "].ServerCertificateStatus"));<NEW_LINE>certInfo.setStatus(_ctx.stringValue<MASK><NEW_LINE>certInfo.setServerCertificate(_ctx.stringValue("DescribeDomainCertificateInfoResponse.CertInfos[" + i + "].ServerCertificate"));<NEW_LINE>certInfo.setCertUpdateTime(_ctx.stringValue("DescribeDomainCertificateInfoResponse.CertInfos[" + i + "].CertUpdateTime"));<NEW_LINE>certInfo.setCertStartTime(_ctx.stringValue("DescribeDomainCertificateInfoResponse.CertInfos[" + i + "].CertStartTime"));<NEW_LINE>certInfo.setCertCommonName(_ctx.stringValue("DescribeDomainCertificateInfoResponse.CertInfos[" + i + "].CertCommonName"));<NEW_LINE>certInfo.setDomainCnameStatus(_ctx.stringValue("DescribeDomainCertificateInfoResponse.CertInfos[" + i + "].DomainCnameStatus"));<NEW_LINE>certInfos.add(certInfo);<NEW_LINE>}<NEW_LINE>describeDomainCertificateInfoResponse.setCertInfos(certInfos);<NEW_LINE>return describeDomainCertificateInfoResponse;<NEW_LINE>} | ("DescribeDomainCertificateInfoResponse.CertInfos[" + i + "].Status")); |
786,493 | public void save() {<NEW_LINE>if (hasItem() && !mLoading) {<NEW_LINE>R820TTunerConfiguration config = getConfiguration();<NEW_LINE>config.setName(mConfigurationName.getText());<NEW_LINE>double value = ((SpinnerNumberModel) mFrequencyCorrection.getModel()).getNumber().doubleValue();<NEW_LINE>config.setFrequencyCorrection(value);<NEW_LINE>config.setAutoPPMCorrectionEnabled(mAutoPPMEnabled.isSelected());<NEW_LINE>config.setSampleRate((SampleRate) mComboSampleRate.getSelectedItem());<NEW_LINE>R820TGain gain = (R820TGain) mComboMasterGain.getSelectedItem();<NEW_LINE>config.setMasterGain(gain);<NEW_LINE>R820TMixerGain mixerGain = (R820TMixerGain) mComboMixerGain.getSelectedItem();<NEW_LINE>config.setMixerGain(mixerGain);<NEW_LINE>R820TLNAGain lnaGain = <MASK><NEW_LINE>config.setLNAGain(lnaGain);<NEW_LINE>R820TVGAGain vgaGain = (R820TVGAGain) mComboVGAGain.getSelectedItem();<NEW_LINE>config.setVGAGain(vgaGain);<NEW_LINE>getTunerConfigurationModel().broadcast(new TunerConfigurationEvent(getConfiguration(), TunerConfigurationEvent.Event.CHANGE));<NEW_LINE>}<NEW_LINE>} | (R820TLNAGain) mComboLNAGain.getSelectedItem(); |
1,099,652 | public void process(Supplier<Context> context) {<NEW_LINE>Context ctx = context.get();<NEW_LINE>if (ctx.getDirection().getReceptionSide() == LogicalSide.SERVER) {<NEW_LINE>ServerPlayer player = ctx.getSender();<NEW_LINE>assert player != null;<NEW_LINE>UUID playerId = player.getUUID();<NEW_LINE>ctx.enqueueWork(() -> {<NEW_LINE>if (key == MessageType.SYNC) {<NEW_LINE>Collection<ResourceLocation> received = ShaderRegistry.receivedShaders.get(playerId);<NEW_LINE>ResourceLocation[] ss = received.toArray(new ResourceLocation[0]);<NEW_LINE>ImmersiveEngineering.packetHandler.send(PacketDistributor.PLAYER.with(() -> player), new MessageShaderManual(MessageType.SYNC, ss));<NEW_LINE>} else if (key == MessageType.UNLOCK && args.length > 0) {<NEW_LINE>ShaderRegistry.receivedShaders.put<MASK><NEW_LINE>} else if (key == MessageType.SPAWN && args.length > 0) {<NEW_LINE>if (!player.abilities.instabuild)<NEW_LINE>IngredientUtils.consumePlayerIngredient(player, ShaderRegistry.shaderRegistry.get(args[0]).replicationCost.get());<NEW_LINE>ItemStack shaderStack = new ItemStack(ShaderRegistry.itemShader);<NEW_LINE>ItemNBTHelper.putString(shaderStack, "shader_name", args[0].toString());<NEW_LINE>ItemEntity entityitem = player.drop(shaderStack, false);<NEW_LINE>if (entityitem != null) {<NEW_LINE>entityitem.setNoPickUpDelay();<NEW_LINE>entityitem.setOwner(player.getUUID());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else<NEW_LINE>ctx.enqueueWork(() -> {<NEW_LINE>if (key == MessageType.SYNC) {<NEW_LINE>Player player = ImmersiveEngineering.proxy.getClientPlayer();<NEW_LINE>if (player != null) {<NEW_LINE>UUID name = player.getUUID();<NEW_LINE>for (ResourceLocation shader : args) if (shader != null)<NEW_LINE>ShaderRegistry.receivedShaders.put(name, shader);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | (playerId, args[0]); |
1,011,044 | public void loadAttachments() {<NEW_LINE>log.<MASK><NEW_LINE>if (!canHaveAttachment())<NEW_LINE>return;<NEW_LINE>String SQL = "SELECT AD_Attachment_ID, Record_ID FROM AD_Attachment " + "WHERE AD_Table_ID=?";<NEW_LINE>try {<NEW_LINE>if (m_Attachments == null)<NEW_LINE>m_Attachments = new HashMap<Integer, Integer>();<NEW_LINE>else<NEW_LINE>m_Attachments.clear();<NEW_LINE>PreparedStatement pstmt = DB.prepareStatement(SQL, null);<NEW_LINE>pstmt.setInt(1, m_vo.AD_Table_ID);<NEW_LINE>ResultSet rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>Integer key = new Integer(rs.getInt(2));<NEW_LINE>Integer value = new Integer(rs.getInt(1));<NEW_LINE>m_Attachments.put(key, value);<NEW_LINE>}<NEW_LINE>rs.close();<NEW_LINE>pstmt.close();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.log(Level.SEVERE, "loadAttachments", e);<NEW_LINE>}<NEW_LINE>log.config("#" + m_Attachments.size());<NEW_LINE>} | fine("#" + m_vo.TabNo); |
1,588,661 | protected final void postStateChange(AtmosphereResourceEvent event) {<NEW_LINE>if (event.isCancelled() || event.isResuming())<NEW_LINE>return;<NEW_LINE>AtmosphereResourceImpl r = AtmosphereResourceImpl.class.cast(event.getResource());<NEW_LINE>// Between event.isCancelled and resource, the connection has been remotly closed.<NEW_LINE>if (r == null) {<NEW_LINE>logger.trace("Event {} returned a null AtmosphereResource", event);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Boolean resumeOnBroadcast = r.resumeOnBroadcast();<NEW_LINE>if (!resumeOnBroadcast) {<NEW_LINE>// For legacy reason, check the attribute as well<NEW_LINE>Object o = r.getRequest(false<MASK><NEW_LINE>if (o != null && Boolean.class.isAssignableFrom(o.getClass())) {<NEW_LINE>resumeOnBroadcast = Boolean.class.cast(o);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (resumeOnBroadcast != null && resumeOnBroadcast) {<NEW_LINE>r.resume();<NEW_LINE>}<NEW_LINE>} | ).getAttribute(ApplicationConfig.RESUME_ON_BROADCAST); |
327,020 | final DeleteMemberResult executeDeleteMember(DeleteMemberRequest deleteMemberRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteMemberRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DeleteMemberRequest> request = null;<NEW_LINE>Response<DeleteMemberResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteMemberRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteMemberRequest));<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, "Macie2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteMember");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteMemberResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteMemberResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
661,322 | private NonLazyDafnySequence<T> computeElements() {<NEW_LINE>// Somewhat arbitrarily, the copier will be created by the leftmost<NEW_LINE>// sequence. This is fine unless native Java code is uncareful and has<NEW_LINE>// has created ArrayDafnySequences of boxed primitive types.<NEW_LINE>Copier<T> copier;<NEW_LINE>// Treat this instance as the root of a tree, where a<NEW_LINE>// ConcatDafnySequence is an internal node (with its left and right<NEW_LINE>// fields as children) and any other DafnySequence is a leaf node,<NEW_LINE>// and prepare to perform a non-recursive in-order traversal. (We could<NEW_LINE>// use recursion, but there could easily be enough sequences being<NEW_LINE>// concatenated to exhaust the system stack.)<NEW_LINE>Deque<DafnySequence<T>> toVisit = new ArrayDeque<>();<NEW_LINE>toVisit.push(right);<NEW_LINE>DafnySequence<T> first = left;<NEW_LINE>while (first instanceof ConcatDafnySequence<?> && ((ConcatDafnySequence<T>) first).ans == null) {<NEW_LINE>toVisit.push(((ConcatDafnySequence<T>) first).right);<NEW_LINE>first = ((ConcatDafnySequence<T>) first).left;<NEW_LINE>}<NEW_LINE>toVisit.push(first);<NEW_LINE>copier = first.newCopier(this.length);<NEW_LINE>while (!toVisit.isEmpty()) {<NEW_LINE>DafnySequence<T> seq = toVisit.pop();<NEW_LINE>if (seq instanceof ConcatDafnySequence<?>) {<NEW_LINE>ConcatDafnySequence<T> cseq <MASK><NEW_LINE>if (cseq.ans != null) {<NEW_LINE>copier.copyFrom(cseq.ans);<NEW_LINE>} else {<NEW_LINE>toVisit.push(cseq.right);<NEW_LINE>toVisit.push(cseq.left);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>copier.copyFrom(seq);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return copier.result();<NEW_LINE>} | = (ConcatDafnySequence<T>) seq; |
1,191,742 | ASTNode clone0(AST target) {<NEW_LINE>MethodDeclaration result = new MethodDeclaration(target);<NEW_LINE>result.setSourceRange(getStartPosition(), getLength());<NEW_LINE>result.setJavadoc((Javadoc) ASTNode.copySubtree(target, getJavadoc()));<NEW_LINE>if (this.ast.apiLevel == AST.JLS2_INTERNAL) {<NEW_LINE>result.internalSetModifiers(getModifiers());<NEW_LINE>result.setReturnType((Type) ASTNode.copySubtree(target, getReturnType()));<NEW_LINE>}<NEW_LINE>if (this.ast.apiLevel >= AST.JLS3_INTERNAL) {<NEW_LINE>result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers()));<NEW_LINE>result.typeParameters().addAll(ASTNode.copySubtrees<MASK><NEW_LINE>result.setReturnType2((Type) ASTNode.copySubtree(target, getReturnType2()));<NEW_LINE>}<NEW_LINE>result.setConstructor(isConstructor());<NEW_LINE>result.setName((SimpleName) getName().clone(target));<NEW_LINE>if (this.ast.apiLevel >= AST.JLS8_INTERNAL) {<NEW_LINE>result.setReceiverType((Type) ASTNode.copySubtree(target, getReceiverType()));<NEW_LINE>result.setReceiverQualifier((SimpleName) ASTNode.copySubtree(target, getReceiverQualifier()));<NEW_LINE>}<NEW_LINE>result.parameters().addAll(ASTNode.copySubtrees(target, parameters()));<NEW_LINE>if (this.ast.apiLevel >= AST.JLS8_INTERNAL) {<NEW_LINE>result.extraDimensions().addAll(ASTNode.copySubtrees(target, extraDimensions()));<NEW_LINE>} else {<NEW_LINE>result.setExtraDimensions(getExtraDimensions());<NEW_LINE>}<NEW_LINE>if (this.ast.apiLevel() >= AST.JLS8_INTERNAL) {<NEW_LINE>result.thrownExceptionTypes().addAll(ASTNode.copySubtrees(target, thrownExceptionTypes()));<NEW_LINE>} else {<NEW_LINE>result.thrownExceptions().addAll(ASTNode.copySubtrees(target, thrownExceptions()));<NEW_LINE>}<NEW_LINE>if (DOMASTUtil.isRecordDeclarationSupported(this.ast)) {<NEW_LINE>result.setCompactConstructor(isCompactConstructor());<NEW_LINE>}<NEW_LINE>result.setBody((Block) ASTNode.copySubtree(target, getBody()));<NEW_LINE>return result;<NEW_LINE>} | (target, typeParameters())); |
747,274 | private static Consumer<List<StreamedRow>> streamedRowsHandler(final KsqlNode owner, final PullQueryQueue pullQueryQueue, final BiFunction<List<?>, LogicalSchema, PullQueryRow> rowFactory, final LogicalSchema outputSchema, final Optional<ConsistencyOffsetVector> consistencyOffsetVector) {<NEW_LINE>final AtomicInteger processedRows = new AtomicInteger(0);<NEW_LINE>final AtomicReference<Header> header = new AtomicReference<>();<NEW_LINE>return streamedRows -> {<NEW_LINE>try {<NEW_LINE>if (streamedRows == null || streamedRows.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final List<PullQueryRow> rows = new ArrayList<>();<NEW_LINE>// If this is the first row overall, skip the header<NEW_LINE>final int previousProcessedRows = processedRows.getAndAdd(streamedRows.size());<NEW_LINE>for (int i = 0; i < streamedRows.size(); i++) {<NEW_LINE>final StreamedRow row = streamedRows.get(i);<NEW_LINE>if (i == 0 && previousProcessedRows == 0) {<NEW_LINE>final Optional<Header> optionalHeader = row.getHeader();<NEW_LINE>optionalHeader.ifPresent(h -> validateSchema(outputSchema, h<MASK><NEW_LINE>optionalHeader.ifPresent(header::set);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (row.getErrorMessage().isPresent()) {<NEW_LINE>// If we receive an error that's not a network error, we let that bubble up.<NEW_LINE>throw new KsqlException(row.getErrorMessage().get().getMessage());<NEW_LINE>}<NEW_LINE>if (!row.getRow().isPresent()) {<NEW_LINE>parseNonDataRows(row, i, consistencyOffsetVector);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final List<?> r = row.getRow().get().getColumns();<NEW_LINE>Preconditions.checkNotNull(header.get());<NEW_LINE>rows.add(rowFactory.apply(r, header.get().getSchema()));<NEW_LINE>}<NEW_LINE>if (!pullQueryQueue.acceptRows(rows)) {<NEW_LINE>LOG.error("Failed to queue all rows");<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new KsqlException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | .getSchema(), owner)); |
354,954 | public static void print(@Nonnull BuildTextConsoleView consoleView, @Nonnull String group, @Nonnull BuildIssue buildIssue) {<NEW_LINE>Project project = consoleView.getProject();<NEW_LINE>Map<String, NotificationListener> <MASK><NEW_LINE>for (BuildIssueQuickFix quickFix : buildIssue.getQuickFixes()) {<NEW_LINE>listenerMap.put(quickFix.getId(), (notification, event) -> {<NEW_LINE>BuildView buildView = findBuildView(consoleView);<NEW_LINE>quickFix.runQuickFix(project, buildView == null ? consoleView : buildView);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>NotificationListener listener = new NotificationListener.Adapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void hyperlinkActivated(@Nonnull Notification notification, @Nonnull HyperlinkEvent event) {<NEW_LINE>if (event.getEventType() != HyperlinkEvent.EventType.ACTIVATED)<NEW_LINE>return;<NEW_LINE>final NotificationListener notificationListener = listenerMap.get(event.getDescription());<NEW_LINE>if (notificationListener != null) {<NEW_LINE>notificationListener.hyperlinkUpdate(notification, event);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>Notification notification = new Notification(group, buildIssue.getTitle(), buildIssue.getDescription(), NotificationType.WARNING, listener);<NEW_LINE>print(consoleView, notification, buildIssue.getDescription());<NEW_LINE>} | listenerMap = new LinkedHashMap<>(); |
680,754 | public boolean validateObject(WorkerKey key, PooledObject<Worker> p) {<NEW_LINE>Worker worker = p.getObject();<NEW_LINE>Optional<Integer<MASK><NEW_LINE>if (exitValue.isPresent()) {<NEW_LINE>if (reporter != null && worker.diedUnexpectedly()) {<NEW_LINE>String msg = String.format("%s %s (id %d) has unexpectedly died with exit code %d.", key.getMnemonic(), key.getWorkerTypeName(), worker.getWorkerId(), exitValue.get());<NEW_LINE>ErrorMessage errorMessage = ErrorMessage.builder().message(msg).logFile(worker.getLogFile()).logSizeLimit(4096).build();<NEW_LINE>reporter.handle(Event.warn(errorMessage.toString()));<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean filesChanged = !key.getWorkerFilesCombinedHash().equals(worker.getWorkerFilesCombinedHash());<NEW_LINE>if (reporter != null && filesChanged) {<NEW_LINE>StringBuilder msg = new StringBuilder();<NEW_LINE>msg.append(String.format("%s %s (id %d) can no longer be used, because its files have changed on disk:", key.getMnemonic(), key.getWorkerTypeName(), worker.getWorkerId()));<NEW_LINE>TreeSet<PathFragment> files = new TreeSet<>();<NEW_LINE>files.addAll(key.getWorkerFilesWithDigests().keySet());<NEW_LINE>files.addAll(worker.getWorkerFilesWithDigests().keySet());<NEW_LINE>for (PathFragment file : files) {<NEW_LINE>byte[] oldDigest = worker.getWorkerFilesWithDigests().get(file);<NEW_LINE>byte[] newDigest = key.getWorkerFilesWithDigests().get(file);<NEW_LINE>if (!Arrays.equals(oldDigest, newDigest)) {<NEW_LINE>msg.append("\n").append(file.getPathString()).append(": ").append(hexStringForDebugging(oldDigest)).append(" -> ").append(hexStringForDebugging(newDigest));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reporter.handle(Event.warn(msg.toString()));<NEW_LINE>}<NEW_LINE>return !filesChanged;<NEW_LINE>} | > exitValue = worker.getExitValue(); |
1,320,690 | private void doInsertData(T data, QuadRect box, Node<T> n, int depth) {<NEW_LINE>if (++depth >= maxDepth) {<NEW_LINE>if (n.data == null) {<NEW_LINE>n.data = new ArrayList<T>();<NEW_LINE>}<NEW_LINE>n.data.add(data);<NEW_LINE>} else {<NEW_LINE>QuadRect[] ext = new QuadRect[4];<NEW_LINE>splitBox(n.bounds, ext);<NEW_LINE>for (int i = 0; i < 4; ++i) {<NEW_LINE>if (ext[i].contains(box)) {<NEW_LINE>if (n.children[i] == null) {<NEW_LINE>n.children[i] = new Node<T>(ext[i]);<NEW_LINE>}<NEW_LINE>doInsertData(data, box, n<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (n.data == null) {<NEW_LINE>n.data = new ArrayList<T>();<NEW_LINE>}<NEW_LINE>n.data.add(data);<NEW_LINE>}<NEW_LINE>} | .children[i], depth); |
791,984 | private void evaluateExpression(RequestContainer request, ResponseContainer response, ContentEditor contentView, String qry) {<NEW_LINE>var aspect = response.getAspect(RestResponseBodyAspect.class);<NEW_LINE>CompletableFuture<String> body = aspect.map(b -> b.getBody()).map(b -> {<NEW_LINE>var buffer = new StringBuffer();<NEW_LINE>var f <MASK><NEW_LINE>b.subscribe(value -> buffer.append(new String(value, StandardCharsets.UTF_8)), buffer::append, () -> f.complete(buffer.toString()));<NEW_LINE>return f;<NEW_LINE>}).orElse(CompletableFuture.completedFuture(""));<NEW_LINE>String executeQry = StringUtils.isBlank(qry) ? "@" : qry;<NEW_LINE>body.thenAccept(b -> executeJmesQuery(executeQry, b).ifPresent(jmesRes -> {<NEW_LINE>addToQueryHistory(qry, jmesRes, request);<NEW_LINE>Platform.runLater(() -> contentView.setContent(() -> jmesRes, s -> {<NEW_LINE>}));<NEW_LINE>}));<NEW_LINE>} | = new CompletableFuture<String>(); |
564,996 | protected void onSizeChanged(final int w, final int h, int oldw, int oldh) {<NEW_LINE>super.onSizeChanged(w, h, oldw, oldh);<NEW_LINE>if (getChildCount() > 0) {<NEW_LINE>if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {<NEW_LINE>getChildAt(0).layout(getChildAt(0).getLeft(), getChildAt(0).getTop(), getChildAt(0).getLeft() + w, getChildAt(0<MASK><NEW_LINE>}<NEW_LINE>HippyInstanceContext hippyInstanceContext = (HippyInstanceContext) getContext();<NEW_LINE>if (hippyInstanceContext != null && hippyInstanceContext.getEngineContext() != null) {<NEW_LINE>final HippyEngineContext engineContext = hippyInstanceContext.getEngineContext();<NEW_LINE>if (engineContext.getThreadExecutor() != null) {<NEW_LINE>final int id = getChildAt(0).getId();<NEW_LINE>engineContext.getThreadExecutor().postOnDomThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>if (engineContext.getDomManager() != null) {<NEW_LINE>engineContext.getDomManager().updateNodeSize(id, w, h);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ).getTop() + h); |
102,073 | final DescribeConfigurationAggregatorSourcesStatusResult executeDescribeConfigurationAggregatorSourcesStatus(DescribeConfigurationAggregatorSourcesStatusRequest describeConfigurationAggregatorSourcesStatusRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeConfigurationAggregatorSourcesStatusRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeConfigurationAggregatorSourcesStatusRequest> request = null;<NEW_LINE>Response<DescribeConfigurationAggregatorSourcesStatusResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeConfigurationAggregatorSourcesStatusRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeConfigurationAggregatorSourcesStatusRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Config Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeConfigurationAggregatorSourcesStatus");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeConfigurationAggregatorSourcesStatusResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeConfigurationAggregatorSourcesStatusResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
1,781,322 | private TreeNode visitGraphStep(GraphStep step) {<NEW_LINE>if (step instanceof MaxGraphStep) {<NEW_LINE>Map<String, Object> queryConfig = ((MaxGraphStep) step).getQueryConfig();<NEW_LINE>if (null != queryConfig) {<NEW_LINE>this.queryConfig.putAll(queryConfig);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Object[] ids = step.getIds();<NEW_LINE>SourceTreeNode sourceTreeNode;<NEW_LINE>if (step.returnsVertex()) {<NEW_LINE>if (null == ids || ids.length == 0) {<NEW_LINE>sourceTreeNode = new SourceVertexTreeNode(schema);<NEW_LINE>} else {<NEW_LINE>sourceTreeNode = new SourceVertexTreeNode(ids, schema);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (null == ids || ids.length == 0) {<NEW_LINE>sourceTreeNode = new SourceEdgeTreeNode(schema);<NEW_LINE>} else {<NEW_LINE>sourceTreeNode = new SourceEdgeTreeNode(ids, schema);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Supplier<?> supplier = step.getTraversal().getSideEffects().getSackInitialValue();<NEW_LINE>if (null != supplier) {<NEW_LINE>sourceTreeNode.<MASK><NEW_LINE>}<NEW_LINE>return sourceTreeNode;<NEW_LINE>} | setInitialSackValue(supplier.get()); |
1,155,984 | public Object calculate(Context ctx) {<NEW_LINE>if (param == null || !param.isLeaf()) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("pdate" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>Object result = param.getLeafExpression().calculate(ctx);<NEW_LINE>if (result == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (result instanceof String) {<NEW_LINE>result = Variant.parseDate((String) result);<NEW_LINE>}<NEW_LINE>if (!(result instanceof Date)) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("pdate" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>Date date = (Date) result;<NEW_LINE>if (option != null) {<NEW_LINE>if (option.indexOf('w') != -1) {<NEW_LINE>if (option.indexOf('e') == -1) {<NEW_LINE>return DateFactory.get().weekBegin(date);<NEW_LINE>} else {<NEW_LINE>return DateFactory.get().weekEnd(date);<NEW_LINE>}<NEW_LINE>} else if (option.indexOf('m') != -1) {<NEW_LINE>if (option.indexOf('e') == -1) {<NEW_LINE>return DateFactory.<MASK><NEW_LINE>} else {<NEW_LINE>return DateFactory.get().monthEnd(date);<NEW_LINE>}<NEW_LINE>} else if (option.indexOf('q') != -1) {<NEW_LINE>if (option.indexOf('e') == -1) {<NEW_LINE>return DateFactory.get().quaterBegin(date);<NEW_LINE>} else {<NEW_LINE>return DateFactory.get().quaterEnd(date);<NEW_LINE>}<NEW_LINE>} else if (option.indexOf('y') != -1) {<NEW_LINE>if (option.indexOf('e') == -1) {<NEW_LINE>return DateFactory.get().yearBegin(date);<NEW_LINE>} else {<NEW_LINE>return DateFactory.get().yearEnd(date);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return DateFactory.get().weekBegin(date);<NEW_LINE>} | get().monthBegin(date); |
729,574 | public void processServerKeyExchange(InputStream input) throws IOException {<NEW_LINE>this.psk_identity_hint = TlsUtils.readOpaque16(input);<NEW_LINE>if (this.keyExchange == KeyExchangeAlgorithm.DHE_PSK) {<NEW_LINE>this.dhConfig = TlsDHUtils.receiveDHConfig(context, dhGroupVerifier, input);<NEW_LINE>byte[] y = TlsUtils.readOpaque16(input, 1);<NEW_LINE>this.agreement = context.getCrypto().<MASK><NEW_LINE>processEphemeralDH(y);<NEW_LINE>} else if (this.keyExchange == KeyExchangeAlgorithm.ECDHE_PSK) {<NEW_LINE>this.ecConfig = TlsECCUtils.receiveECDHConfig(context, input);<NEW_LINE>byte[] point = TlsUtils.readOpaque8(input, 1);<NEW_LINE>this.agreement = context.getCrypto().createECDomain(ecConfig).createECDH();<NEW_LINE>processEphemeralECDH(point);<NEW_LINE>}<NEW_LINE>} | createDHDomain(dhConfig).createDH(); |
977,137 | public BuiltInScalarFunctionImplementation specialize(BoundVariables boundVariables, int arity, FunctionAndTypeManager functionAndTypeManager) {<NEW_LINE>Type keyType = boundVariables.getTypeVariable("K");<NEW_LINE>Type inputValueType1 = boundVariables.getTypeVariable("V1");<NEW_LINE>Type inputValueType2 = boundVariables.getTypeVariable("V2");<NEW_LINE>Type outputValueType = boundVariables.getTypeVariable("V3");<NEW_LINE>Type outputMapType = functionAndTypeManager.getParameterizedType(StandardTypes.MAP, ImmutableList.of(TypeSignatureParameter.of(keyType.getTypeSignature()), TypeSignatureParameter.of(outputValueType.getTypeSignature())));<NEW_LINE>MethodHandle keyNativeHashCode = functionAndTypeManager.getJavaScalarFunctionImplementation(functionAndTypeManager.resolveOperator(OperatorType.HASH_CODE, fromTypes(keyType))).getMethodHandle();<NEW_LINE>MethodHandle keyBlockHashCode = compose(keyNativeHashCode, nativeValueGetter(keyType));<NEW_LINE>MethodHandle keyNativeEquals = functionAndTypeManager.getJavaScalarFunctionImplementation(functionAndTypeManager.resolveOperator(OperatorType.EQUAL, fromTypes(keyType, keyType))).getMethodHandle();<NEW_LINE>MethodHandle keyBlockNativeEquals = compose(keyNativeEquals, nativeValueGetter(keyType));<NEW_LINE>MethodHandle keyBlockEquals = compose(keyNativeEquals, nativeValueGetter(<MASK><NEW_LINE>return new BuiltInScalarFunctionImplementation(false, ImmutableList.of(valueTypeArgumentProperty(RETURN_NULL_ON_NULL), valueTypeArgumentProperty(RETURN_NULL_ON_NULL), functionTypeArgumentProperty(MapZipWithLambda.class)), METHOD_HANDLE.bindTo(keyType).bindTo(inputValueType1).bindTo(inputValueType2).bindTo(outputMapType).bindTo(keyNativeHashCode).bindTo(keyBlockNativeEquals).bindTo(keyBlockHashCode));<NEW_LINE>} | keyType), nativeValueGetter(keyType)); |
1,281,886 | public void showAtNotifications(final RequestContext context) {<NEW_LINE>final Request request = context.getRequest();<NEW_LINE>final JSONObject currentUser = Sessions.getUser();<NEW_LINE>if (null == currentUser) {<NEW_LINE>context.sendError(403);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final AbstractFreeMarkerRenderer renderer = new SkinRenderer(context, "home/notifications/at.ftl");<NEW_LINE>final Map<String, Object> dataModel = renderer.getDataModel();<NEW_LINE>final String userId = currentUser.optString(Keys.OBJECT_ID);<NEW_LINE>final int pageNum = Paginator.getPage(request);<NEW_LINE>final int pageSize = Symphonys.NOTIFICATION_LIST_CNT;<NEW_LINE>final int windowSize = Symphonys.NOTIFICATION_LIST_WIN_SIZE;<NEW_LINE>final JSONObject result = notificationQueryService.getAtNotifications(userId, pageNum, pageSize);<NEW_LINE>final List<JSONObject> atNotifications = (List<JSONObject>) result.get(Keys.RESULTS);<NEW_LINE>dataModel.put(Common.AT_NOTIFICATIONS, atNotifications);<NEW_LINE>final List<JSONObject> articleFollowAndWatchNotifications = new ArrayList<>();<NEW_LINE>for (final JSONObject notification : atNotifications) {<NEW_LINE>if (Notification.DATA_TYPE_C_AT != notification.optInt(Notification.NOTIFICATION_DATA_TYPE)) {<NEW_LINE>articleFollowAndWatchNotifications.add(notification);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>notificationMgmtService.makeRead(articleFollowAndWatchNotifications);<NEW_LINE>fillNotificationCount(userId, dataModel);<NEW_LINE>final int recordCnt = result.getInt(Pagination.PAGINATION_RECORD_COUNT);<NEW_LINE>final int pageCount = (int) Math.ceil((double) recordCnt / (double) pageSize);<NEW_LINE>final List<Integer> pageNums = Paginator.paginate(pageNum, pageSize, pageCount, windowSize);<NEW_LINE>if (!pageNums.isEmpty()) {<NEW_LINE>dataModel.put(Pagination.PAGINATION_FIRST_PAGE_NUM, pageNums.get(0));<NEW_LINE>dataModel.put(Pagination.PAGINATION_LAST_PAGE_NUM, pageNums.get(pageNums.size() - 1));<NEW_LINE>}<NEW_LINE>dataModel.<MASK><NEW_LINE>dataModel.put(Pagination.PAGINATION_PAGE_COUNT, pageCount);<NEW_LINE>dataModel.put(Pagination.PAGINATION_PAGE_NUMS, pageNums);<NEW_LINE>dataModelService.fillHeaderAndFooter(context, dataModel);<NEW_LINE>} | put(Pagination.PAGINATION_CURRENT_PAGE_NUM, pageNum); |
1,372,709 | private MultiPatternMatcher<CoreMap> createPatternMatcher(Map<SequencePattern<CoreMap>, Entry> patternToEntry) {<NEW_LINE>// Convert to tokensregex pattern<NEW_LINE>List<TokenSequencePattern> patterns = new ArrayList<>(entries.size());<NEW_LINE>for (Entry entry : entries) {<NEW_LINE>TokenSequencePattern pattern;<NEW_LINE>Boolean ignoreCaseEntry = ignoreCaseList.get(entryToMappingFileNumber.get(entry));<NEW_LINE>int patternFlags = ignoreCaseEntry ? Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE : 0;<NEW_LINE>int stringMatchFlags = ignoreCaseEntry ? (NodePattern.CASE_INSENSITIVE | NodePattern.UNICODE_CASE) : 0;<NEW_LINE>Env env = TokenSequencePattern.getNewEnv();<NEW_LINE>env.setDefaultStringPatternFlags(patternFlags);<NEW_LINE>env.setDefaultStringMatchFlags(stringMatchFlags);<NEW_LINE>NodePattern<String> posTagPattern = (validPosPatternList.get(entryToMappingFileNumber.get(entry)) != null && PosMatchType.MATCH_ALL_TOKENS.equals(posMatchType)) ? new CoreMapNodePattern.StringAnnotationRegexPattern(validPosPatternList.get(entryToMappingFileNumber.get(entry))) : null;<NEW_LINE>if (entry.tokensRegex != null) {<NEW_LINE>// TODO: posTagPatterns...<NEW_LINE>pattern = TokenSequencePattern.compile(env, entry.tokensRegex);<NEW_LINE>} else {<NEW_LINE>List<SequencePattern.PatternExpr> nodePatterns = new ArrayList<>(entry.regex.length);<NEW_LINE>for (String p : entry.regex) {<NEW_LINE>CoreMapNodePattern c = CoreMapNodePattern.valueOf(p, patternFlags);<NEW_LINE>if (posTagPattern != null) {<NEW_LINE>c.add(<MASK><NEW_LINE>}<NEW_LINE>nodePatterns.add(new SequencePattern.NodePatternExpr(c));<NEW_LINE>}<NEW_LINE>if (nodePatterns.size() == 1) {<NEW_LINE>nodePatterns = Collections.singletonList(nodePatterns.get(0));<NEW_LINE>}<NEW_LINE>pattern = TokenSequencePattern.compile(new SequencePattern.SequencePatternExpr(nodePatterns));<NEW_LINE>}<NEW_LINE>if (entry.annotateGroup < 0 || entry.annotateGroup > pattern.getTotalGroups()) {<NEW_LINE>throw new RuntimeException("Invalid match group for entry " + entry);<NEW_LINE>}<NEW_LINE>pattern.setPriority(entry.priority);<NEW_LINE>pattern.setWeight(entry.weight);<NEW_LINE>patterns.add(pattern);<NEW_LINE>patternToEntry.put(pattern, entry);<NEW_LINE>}<NEW_LINE>return TokenSequencePattern.getMultiPatternMatcher(patterns);<NEW_LINE>} | CoreAnnotations.PartOfSpeechAnnotation.class, posTagPattern); |
449,189 | static int longest_bitonic_subsequence(int[] v, int n) {<NEW_LINE>// v_increase tracks the longest increasing subsequence<NEW_LINE>int[] v_increase <MASK><NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>v_increase[i] = 1;<NEW_LINE>}<NEW_LINE>for (int i = 1; i < n; i++) {<NEW_LINE>for (int j = 0; j < i; j++) {<NEW_LINE>if (v[i] > v[j]) {<NEW_LINE>if (v_increase[i] <= v_increase[j]) {<NEW_LINE>v_increase[i] = v_increase[j] + 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// v_decrease tracks the longest decreasing subsequence<NEW_LINE>int[] v_decrease = new int[n];<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>v_decrease[i] = 1;<NEW_LINE>}<NEW_LINE>for (int i = n - 2; i >= 0; i--) {<NEW_LINE>for (int j = n - 1; j > i; j--) {<NEW_LINE>if (v[i] > v[j]) {<NEW_LINE>if (v_decrease[i] <= v_decrease[j]) {<NEW_LINE>v_decrease[i] = v_decrease[j] + 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int max = 0;<NEW_LINE>for (int i = 1; i < n; i++) {<NEW_LINE>int temp = v_increase[i] + v_decrease[i] - 1;<NEW_LINE>if (temp > max) {<NEW_LINE>max = temp;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return max;<NEW_LINE>} | = new int[n + 1]; |
464,470 | /* GRECLIPSE edit<NEW_LINE>private boolean checkIfLastStatementIsReturnOrThrow(Statement code) {<NEW_LINE>if (code instanceof BlockStatement) {<NEW_LINE>BlockStatement blockStatement = (BlockStatement) code;<NEW_LINE>List<Statement> statementList = blockStatement.getStatements();<NEW_LINE>int statementCnt = statementList.size();<NEW_LINE>if (statementCnt > 0) {<NEW_LINE>Statement lastStatement = statementList.get(statementCnt - 1);<NEW_LINE>if (lastStatement instanceof ReturnStatement || lastStatement instanceof ThrowStatement) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>*/<NEW_LINE>void visitAnnotationDefaultExpression(AnnotationVisitor av, ClassNode type, Expression exp) {<NEW_LINE>if (exp instanceof ClosureExpression) {<NEW_LINE>ClassNode closureClass = controller.getClosureWriter().getOrAddClosureClass((ClosureExpression) exp, ACC_PUBLIC);<NEW_LINE>Type t = Type.getType(BytecodeHelper.getTypeDescription(closureClass));<NEW_LINE>av.visit(null, t);<NEW_LINE>} else if (type.isArray()) {<NEW_LINE>AnnotationVisitor <MASK><NEW_LINE>ClassNode componentType = type.getComponentType();<NEW_LINE>if (exp instanceof ListExpression) {<NEW_LINE>ListExpression list = (ListExpression) exp;<NEW_LINE>for (Expression lExp : list.getExpressions()) {<NEW_LINE>visitAnnotationDefaultExpression(avl, componentType, lExp);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>visitAnnotationDefaultExpression(avl, componentType, exp);<NEW_LINE>}<NEW_LINE>} else if (ClassHelper.isPrimitiveType(type) || type.equals(ClassHelper.STRING_TYPE)) {<NEW_LINE>ConstantExpression constExp = (ConstantExpression) exp;<NEW_LINE>av.visit(null, constExp.getValue());<NEW_LINE>} else if (ClassHelper.CLASS_Type.equals(type)) {<NEW_LINE>ClassNode clazz = exp.getType();<NEW_LINE>Type t = Type.getType(BytecodeHelper.getTypeDescription(clazz));<NEW_LINE>av.visit(null, t);<NEW_LINE>} else if (type.isDerivedFrom(ClassHelper.Enum_Type)) {<NEW_LINE>PropertyExpression pExp = (PropertyExpression) exp;<NEW_LINE>ClassExpression cExp = (ClassExpression) pExp.getObjectExpression();<NEW_LINE>String desc = BytecodeHelper.getTypeDescription(cExp.getType());<NEW_LINE>String name = pExp.getPropertyAsString();<NEW_LINE>av.visitEnum(null, desc, name);<NEW_LINE>} else if (type.implementsInterface(ClassHelper.Annotation_TYPE)) {<NEW_LINE>AnnotationConstantExpression avExp = (AnnotationConstantExpression) exp;<NEW_LINE>AnnotationNode value = (AnnotationNode) avExp.getValue();<NEW_LINE>AnnotationVisitor avc = av.visitAnnotation(null, BytecodeHelper.getTypeDescription(avExp.getType()));<NEW_LINE>visitAnnotationAttributes(value, avc);<NEW_LINE>} else {<NEW_LINE>throw new GroovyBugError("unexpected annotation type " + type.getName());<NEW_LINE>}<NEW_LINE>av.visitEnd();<NEW_LINE>} | avl = av.visitArray(null); |
1,002,434 | public static void processRanges(@Nullable PsiElement element, CharSequence text, int cursorOffset, Editor editor, Processor<TextRange> consumer) {<NEW_LINE>if (element == null)<NEW_LINE>return;<NEW_LINE><MASK><NEW_LINE>FileViewProvider viewProvider = file.getViewProvider();<NEW_LINE>processInFile(element, consumer, text, cursorOffset, editor);<NEW_LINE>for (PsiFile psiFile : viewProvider.getAllFiles()) {<NEW_LINE>if (psiFile == file)<NEW_LINE>continue;<NEW_LINE>FileASTNode fileNode = psiFile.getNode();<NEW_LINE>if (fileNode == null)<NEW_LINE>continue;<NEW_LINE>ASTNode nodeAt = fileNode.findLeafElementAt(element.getTextOffset());<NEW_LINE>if (nodeAt == null)<NEW_LINE>continue;<NEW_LINE>PsiElement elementAt = nodeAt.getPsi();<NEW_LINE>while (!(elementAt instanceof PsiFile) && elementAt != null) {<NEW_LINE>if (elementAt.getTextRange().contains(element.getTextRange()))<NEW_LINE>break;<NEW_LINE>elementAt = elementAt.getParent();<NEW_LINE>}<NEW_LINE>if (elementAt == null)<NEW_LINE>continue;<NEW_LINE>processInFile(elementAt, consumer, text, cursorOffset, editor);<NEW_LINE>}<NEW_LINE>} | PsiFile file = element.getContainingFile(); |
1,081,438 | private static VirtualMachine prepareSpecializedUnmanagedVirtualMachine(AzureResourceManager azureResourceManager, Region region, String rgName) {<NEW_LINE>final String userName = "tirekicker";<NEW_LINE>final String sshPublicKey = Utils.sshPublicKey();<NEW_LINE>final String linuxVMName1 = Utils.randomResourceName(azureResourceManager, "vm" + "-", 10);<NEW_LINE>final String publicIpDnsLabel = Utils.randomResourceName(azureResourceManager, "pip" + "-", 20);<NEW_LINE>VirtualMachine linuxVM = azureResourceManager.virtualMachines().define(linuxVMName1).withRegion(region).withNewResourceGroup(rgName).withNewPrimaryNetwork("10.0.0.0/28").withPrimaryPrivateIPAddressDynamic().withNewPrimaryPublicIPAddress(publicIpDnsLabel).withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS).withRootUsername(userName).withSsh(sshPublicKey).withUnmanagedDisks().defineUnmanagedDataDisk("disk-1").withNewVhd(100).withLun(1).attach().defineUnmanagedDataDisk("disk-2").withNewVhd(50).withLun(2).attach().withSize(VirtualMachineSizeTypes.fromString("Standard_D2a_v4")).create();<NEW_LINE>// De-provision the virtual machine<NEW_LINE>deprovisionAgentInLinuxVM(linuxVM);<NEW_LINE>System.out.println("Deallocate VM: " + linuxVM.id());<NEW_LINE>linuxVM.deallocate();<NEW_LINE>System.out.println("Deallocated VM: " + linuxVM.id() + "; state = " + linuxVM.powerState());<NEW_LINE>System.out.println(<MASK><NEW_LINE>linuxVM.generalize();<NEW_LINE>System.out.println("Generalized VM: " + linuxVM.id());<NEW_LINE>return linuxVM;<NEW_LINE>} | "Generalize VM: " + linuxVM.id()); |
908,050 | public List<IBlockState> mapBlockRender(@Nonnull IBlockStateWrapper state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, BlockRenderLayer blockLayer, @Nonnull QuadCollector quadCollector) {<NEW_LINE>for (BlockSlab.EnumBlockHalf half : BlockSlab.EnumBlockHalf.values()) {<NEW_LINE>if (isDouble() || half == state.getValue(HALF)) {<NEW_LINE>boolean isTop <MASK><NEW_LINE>IBlockState paintSource = isTop ? getPaintSource2(state, world, pos) : getPaintSource(state, world, pos);<NEW_LINE>if (blockLayer == null || PaintUtil.canRenderInLayer(paintSource, blockLayer)) {<NEW_LINE>quadCollector.addFriendlybakedModel(blockLayer, PaintRegistry.getModel(IBakedModel.class, isTop ? "slab_hi" : "slab_lo", paintSource, null), paintSource, MathHelper.getPositionRandom(pos));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | = half == BlockSlab.EnumBlockHalf.TOP; |
1,363,639 | private static void validateReferenceField(MessageOrBuilder message, FieldDescriptor field, String baseName) throws InvalidFhirException {<NEW_LINE>Descriptor descriptor = field.getMessageType();<NEW_LINE>OneofDescriptor oneof = descriptor.getOneofs().get(0);<NEW_LINE>for (int i = 0; i < ProtoUtils.fieldSize(message, field); i++) {<NEW_LINE>MessageOrBuilder reference = ProtoUtils.getAtIndex(message, field, i);<NEW_LINE>FieldDescriptor referenceField = reference.getOneofFieldDescriptor(oneof);<NEW_LINE>if (referenceField == null) {<NEW_LINE>// Note: getAllFields only returns those fields that are set :/<NEW_LINE>for (FieldDescriptor setField : reference.getAllFields().keySet()) {<NEW_LINE>if (OTHER_REFERENCE_FIELDS.contains(setField.getName())) {<NEW_LINE>// There's no reference field, but there is other data. That's valid.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>throw new InvalidFhirException("empty-reference-" + baseName + "." + setField.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (field.getOptions().getExtensionCount(Annotations.validReferenceType) == 0) {<NEW_LINE>// The reference field does not have restrictions, so any value is fine.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!referenceField.getOptions().hasExtension(Annotations.referencedFhirType)) {<NEW_LINE>// This is either a Uri, or a Fragment, which are untyped, and therefore valid.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String referenceType = referenceField.getOptions(<MASK><NEW_LINE>boolean isAllowed = false;<NEW_LINE>for (String validType : field.getOptions().getExtension(Annotations.validReferenceType)) {<NEW_LINE>if (validType.equals(referenceType) || validType.equals("Resource")) {<NEW_LINE>isAllowed = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!isAllowed) {<NEW_LINE>throw new InvalidFhirException("invalid-reference" + "-disallowed-type-" + referenceType + "-at-" + baseName + "." + field.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ).getExtension(Annotations.referencedFhirType); |
530,866 | public void notifyStickyShow(WXCell component) {<NEW_LINE>if (component == null)<NEW_LINE>return;<NEW_LINE>mHeaderComps.put(component.getRef(), component);<NEW_LINE>if (mCurrentStickyRef != null) {<NEW_LINE>WXCell cell = mHeaderComps.get(mCurrentStickyRef);<NEW_LINE>if (cell == null || component.getScrollPositon() > cell.getScrollPositon()) {<NEW_LINE>mCurrentStickyRef = component.getRef();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>mCurrentStickyRef = component.getRef();<NEW_LINE>}<NEW_LINE>{<NEW_LINE>if (mCurrentStickyRef == null) {<NEW_LINE>WXLogUtils.e("Current Sticky ref is null.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>WXCell headComponent = mHeaderComps.get(mCurrentStickyRef);<NEW_LINE>final View headerView = headComponent.getRealView();<NEW_LINE>if (headerView == null) {<NEW_LINE>WXLogUtils.e("Sticky header's real view is null.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>View header = mHeaderViews.get(headComponent.getRef());<NEW_LINE>if (header != null) {<NEW_LINE>// already there<NEW_LINE>header.bringToFront();<NEW_LINE>} else {<NEW_LINE>mHeaderViews.put(headComponent.getRef(), headerView);<NEW_LINE>// record translation, it should not change after transformation<NEW_LINE>final float translationX = headerView.getTranslationX();<NEW_LINE>final float translationY = headerView.getTranslationY();<NEW_LINE>headComponent.removeSticky();<NEW_LINE>ViewGroup existedParent;<NEW_LINE>if ((existedParent = (ViewGroup) headerView.getParent()) != null) {<NEW_LINE>existedParent.removeView(headerView);<NEW_LINE>}<NEW_LINE>headerView.<MASK><NEW_LINE>ViewGroup.MarginLayoutParams mlp = new ViewGroup.MarginLayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);<NEW_LINE>mParent.addView(headerView, mlp);<NEW_LINE>headerView.setTag(this);<NEW_LINE>if (headComponent.getStickyOffset() > 0) {<NEW_LINE>ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) headerView.getLayoutParams();<NEW_LINE>if (headComponent.getStickyOffset() != params.topMargin) {<NEW_LINE>params.topMargin = headComponent.getStickyOffset();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// recover translation, sometimes it will be changed on fling<NEW_LINE>headerView.setTranslationX(translationX);<NEW_LINE>headerView.setTranslationY(translationY);<NEW_LINE>}<NEW_LINE>changeFrontStickyVisible();<NEW_LINE>if (headComponent.getEvents().contains("sticky")) {<NEW_LINE>headComponent.fireEvent("sticky");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | setTag(headComponent.getRef()); |
637,473 | public static void main(String[] args) throws Throwable {<NEW_LINE>String cp = System.getProperty("java.class.path", null);<NEW_LINE>JarFile mainJar = new JarFile(cp);<NEW_LINE>Manifest manifest = mainJar.getManifest();<NEW_LINE>if (manifest == null) {<NEW_LINE>System.err.println("JAR file is missing manifest; cannot start JVM.");<NEW_LINE>} else {<NEW_LINE>String mainClassName = manifest.getMainAttributes().getValue(Attributes.Name.MAIN_CLASS);<NEW_LINE>if (mainClassName == null) {<NEW_LINE>System.err.println("JAR file manifest does not specify a main class; cannot start JVM.");<NEW_LINE>} else {<NEW_LINE>// Fetch the main class using the system's class loader.<NEW_LINE>ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();<NEW_LINE>Class<?> mainCls = Class.forName(mainClassName, true, systemClassLoader);<NEW_LINE>Method mainMethod = mainCls.getMethod("main", new Class[] <MASK><NEW_LINE>mainMethod.invoke(null, new Object[] { args });<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | { String[].class }); |
946,071 | private /* return: ((in^2)^2)*m */<NEW_LINE>short gf_sq2mul(short in, short m) {<NEW_LINE>int i;<NEW_LINE>long x;<NEW_LINE>long t0;<NEW_LINE>long t1;<NEW_LINE>long t;<NEW_LINE>long[] M = { 0x1FF0000000000000L, 0x000FF80000000000L, 0x000007FC00000000L, 0x00000003FE000000L, 0x0000000001FE0000L, 0x000000000001E000L };<NEW_LINE>t0 = in;<NEW_LINE>t1 = m;<NEW_LINE>x = (t1 << 18) * (t0 & (1 << 6));<NEW_LINE>t0 ^= (t0 << 21);<NEW_LINE>x ^= (t1 * (t0 & (0x010000001L)));<NEW_LINE>x ^= (t1 * (t0 <MASK><NEW_LINE>x ^= (t1 * (t0 & (0x040000004L))) << 6;<NEW_LINE>x ^= (t1 * (t0 & (0x080000008L))) << 9;<NEW_LINE>x ^= (t1 * (t0 & (0x100000010L))) << 12;<NEW_LINE>x ^= (t1 * (t0 & (0x200000020L))) << 15;<NEW_LINE>for (i = 0; i < 6; i++) {<NEW_LINE>t = x & M[i];<NEW_LINE>x ^= (t >> 9) ^ (t >> 10) ^ (t >> 12) ^ (t >> 13);<NEW_LINE>}<NEW_LINE>return (short) (x & GFMASK);<NEW_LINE>} | & (0x020000002L))) << 3; |
23,204 | private static void processSideBars(Map sideBars, JComponent ec, JScrollPane scroller) {<NEW_LINE>// Remove all existing sidebars<NEW_LINE>ec.removeAll();<NEW_LINE>// Add the scroller and the new sidebars<NEW_LINE>ec.add(scroller);<NEW_LINE>scroller.setRowHeader(null);<NEW_LINE>scroller.setColumnHeaderView(null);<NEW_LINE>// final MouseDispatcher mouse = new MouseDispatcher((JTextComponent) ec.getClientProperty(JTextComponent.class));<NEW_LINE>for (Iterator entries = sideBars.entrySet().iterator(); entries.hasNext(); ) {<NEW_LINE>Map.Entry entry = (Map<MASK><NEW_LINE>SideBarPosition position = (SideBarPosition) entry.getKey();<NEW_LINE>JComponent sideBar = (JComponent) entry.getValue();<NEW_LINE>// if (position.getPosition() == SideBarPosition.WEST) {<NEW_LINE>// JPanel p = new JPanel(new BorderLayout()) {<NEW_LINE>//<NEW_LINE>// @Override<NEW_LINE>// public void addNotify() {<NEW_LINE>// super.addNotify();<NEW_LINE>// infiltrateContainer(this, mouse, true);<NEW_LINE>// }<NEW_LINE>//<NEW_LINE>// @Override<NEW_LINE>// public void removeNotify() {<NEW_LINE>// infiltrateContainer(this, mouse, false);<NEW_LINE>// super.removeNotify();<NEW_LINE>// }<NEW_LINE>//<NEW_LINE>// };<NEW_LINE>// p.add(sideBar, BorderLayout.CENTER);<NEW_LINE>// sideBar = p;<NEW_LINE>// }<NEW_LINE>if (position.isScrollable()) {<NEW_LINE>if (position.getPosition() == SideBarPosition.WEST) {<NEW_LINE>scroller.setRowHeaderView(sideBar);<NEW_LINE>} else {<NEW_LINE>if (position.getPosition() == SideBarPosition.NORTH) {<NEW_LINE>scroller.setColumnHeaderView(sideBar);<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>throw new IllegalArgumentException("Unsupported side bar position, scrollable = true, position=" + position.getBorderLayoutPosition());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ec.add(sideBar, position.getBorderLayoutPosition());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .Entry) entries.next(); |
1,163,764 | public static UserRepresentation toRepresentation(KeycloakSession session, RealmModel realm, UserModel user) {<NEW_LINE>UserRepresentation rep = new UserRepresentation();<NEW_LINE>rep.setId(user.getId());<NEW_LINE>String providerId = StorageId.resolveProviderId(user);<NEW_LINE>rep.setOrigin(providerId);<NEW_LINE>rep.setUsername(user.getUsername());<NEW_LINE>rep.setCreatedTimestamp(user.getCreatedTimestamp());<NEW_LINE>rep.setLastName(user.getLastName());<NEW_LINE>rep.setFirstName(user.getFirstName());<NEW_LINE>rep.setEmail(user.getEmail());<NEW_LINE>rep.setEnabled(user.isEnabled());<NEW_LINE>rep.setEmailVerified(user.isEmailVerified());<NEW_LINE>rep.setTotp(session.userCredentialManager().isConfiguredFor(realm, user, OTPCredentialModel.TYPE));<NEW_LINE>rep.setDisableableCredentialTypes(session.userCredentialManager().getDisableableCredentialTypesStream(realm, user).collect(Collectors.toSet()));<NEW_LINE>rep.<MASK><NEW_LINE>rep.setNotBefore(session.users().getNotBeforeOfUser(realm, user));<NEW_LINE>rep.setRequiredActions(user.getRequiredActionsStream().collect(Collectors.toList()));<NEW_LINE>Map<String, List<String>> attributes = user.getAttributes();<NEW_LINE>Map<String, List<String>> copy = null;<NEW_LINE>if (attributes != null) {<NEW_LINE>copy = new HashMap<>(attributes);<NEW_LINE>copy.remove(UserModel.LAST_NAME);<NEW_LINE>copy.remove(UserModel.FIRST_NAME);<NEW_LINE>copy.remove(UserModel.EMAIL);<NEW_LINE>copy.remove(UserModel.USERNAME);<NEW_LINE>}<NEW_LINE>if (attributes != null && !copy.isEmpty()) {<NEW_LINE>Map<String, List<String>> attrs = new HashMap<>(copy);<NEW_LINE>rep.setAttributes(attrs);<NEW_LINE>}<NEW_LINE>return rep;<NEW_LINE>} | setFederationLink(user.getFederationLink()); |
577,541 | final CreateResolverEndpointResult executeCreateResolverEndpoint(CreateResolverEndpointRequest createResolverEndpointRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createResolverEndpointRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateResolverEndpointRequest> request = null;<NEW_LINE>Response<CreateResolverEndpointResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateResolverEndpointRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createResolverEndpointRequest));<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, "Route53Resolver");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateResolverEndpoint");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateResolverEndpointResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateResolverEndpointResultJsonUnmarshaller());<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); |
1,116,667 | private void refreshSettings() {<NEW_LINE>int size = cache.getJadxSettings().getSrhResourceSkipSize() * 1048576;<NEW_LINE>if (size != sizeLimit || !cache.getJadxSettings().getSrhResourceFileExt().equals(fileExts)) {<NEW_LINE>clear();<NEW_LINE>sizeLimit = size;<NEW_LINE>fileExts = cache.getJadxSettings().getSrhResourceFileExt();<NEW_LINE>String[] exts = fileExts.split("\\|");<NEW_LINE>for (String ext : exts) {<NEW_LINE>ext = ext.trim();<NEW_LINE>if (!ext.isEmpty()) {<NEW_LINE>anyExt = ext.equals("*");<NEW_LINE>if (anyExt) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>extSet.add(ext);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try (ZipFile zipFile = getZipFile(cache.getJRoot())) {<NEW_LINE>// reindex<NEW_LINE>traverseTree(cache.getJRoot(), zipFile);<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | LOG.error("Failed to apply settings to resource index", e); |
754,184 | public <T> T convert(DataTable dataTable, Type type, boolean transposed) {<NEW_LINE>requireNonNull(dataTable, "dataTable may not be null");<NEW_LINE>requireNonNull(type, "type may not be null");<NEW_LINE>if (transposed) {<NEW_LINE>dataTable = dataTable.transpose();<NEW_LINE>}<NEW_LINE>JavaType javaType = TypeFactory.constructType(type);<NEW_LINE>DataTableType <MASK><NEW_LINE>if (tableType != null) {<NEW_LINE>return (T) tableType.transform(dataTable.cells());<NEW_LINE>}<NEW_LINE>if (type.equals(DataTable.class)) {<NEW_LINE>return (T) dataTable;<NEW_LINE>}<NEW_LINE>if (javaType instanceof MapType) {<NEW_LINE>MapType mapType = (MapType) javaType;<NEW_LINE>return (T) toMap(dataTable, mapType.getKeyType(), mapType.getValueType());<NEW_LINE>}<NEW_LINE>if (javaType instanceof OptionalType) {<NEW_LINE>OptionalType optionalType = (OptionalType) javaType;<NEW_LINE>Object singleton = toSingleton(dataTable, optionalType.getElementType());<NEW_LINE>return (T) Optional.ofNullable(singleton);<NEW_LINE>}<NEW_LINE>if (javaType instanceof OtherType) {<NEW_LINE>return toSingleton(dataTable, javaType);<NEW_LINE>}<NEW_LINE>assert javaType instanceof ListType;<NEW_LINE>ListType listType = (ListType) javaType;<NEW_LINE>JavaType listElementType = listType.getElementType();<NEW_LINE>if (listElementType instanceof MapType) {<NEW_LINE>MapType mapElement = (MapType) listElementType;<NEW_LINE>return (T) toMaps(dataTable, mapElement.getKeyType(), mapElement.getValueType());<NEW_LINE>}<NEW_LINE>if (listElementType instanceof ListType) {<NEW_LINE>ListType listElement = (ListType) listElementType;<NEW_LINE>return (T) toLists(dataTable, listElement.getElementType());<NEW_LINE>}<NEW_LINE>assert listElementType instanceof OtherType || listElementType instanceof OptionalType;<NEW_LINE>return (T) toList(dataTable, listElementType);<NEW_LINE>} | tableType = registry.lookupTableTypeByType(javaType); |
1,198,129 | private void writeColumns(Element table, Table def, DesignContext context) {<NEW_LINE>Object[] columns = getVisibleColumns();<NEW_LINE>if (columns.length == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Element colgroup = table.appendElement("colgroup");<NEW_LINE>for (Object id : columns) {<NEW_LINE>Element col = colgroup.appendElement("col");<NEW_LINE>col.attr("property-id", id.toString());<NEW_LINE>if (getColumnAlignment(id) == Align.CENTER) {<NEW_LINE>col.attr("center", true);<NEW_LINE>} else if (getColumnAlignment(id) == Align.RIGHT) {<NEW_LINE>col.attr("right", true);<NEW_LINE>}<NEW_LINE>DesignAttributeHandler.writeAttribute("width", col.attributes(), getColumnWidth(id), def.getColumnWidth(null), int.class, context);<NEW_LINE>DesignAttributeHandler.writeAttribute("expand", col.attributes(), getColumnExpandRatio(id), def.getColumnExpandRatio(null), float.class, context);<NEW_LINE>DesignAttributeHandler.writeAttribute("collapsible", col.attributes(), isColumnCollapsible(id), def.isColumnCollapsible(null), boolean.class, context);<NEW_LINE>DesignAttributeHandler.writeAttribute("collapsed", col.attributes(), isColumnCollapsed(id), def.isColumnCollapsed(null<MASK><NEW_LINE>}<NEW_LINE>} | ), boolean.class, context); |
889,698 | private void moveUnusedtoUsedImport(LineRange lineRange, ImportDeclarationNode importDeclarationNode) {<NEW_LINE>Optional<Symbol> symbol = semanticModel.symbol(importDeclarationNode);<NEW_LINE>if (symbol.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<Location> locations = this.semanticModel.references(symbol.get());<NEW_LINE>boolean availableOutSideDeleteRange = false;<NEW_LINE>for (Location location : locations) {<NEW_LINE>if (isWithinLineRange(importDeclarationNode.lineRange(), location.lineRange())) {<NEW_LINE>if (locations.size() == 1) {<NEW_LINE>availableOutSideDeleteRange = true;<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>LineRange deleteRange = getDeleteRange(location.lineRange());<NEW_LINE>if (deleteRange == null) {<NEW_LINE>availableOutSideDeleteRange = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If import has the prefix `_` then treat is as an used import.<NEW_LINE>if (importDeclarationNode.prefix().isPresent() && "_".equals(importDeclarationNode.prefix().get().prefix().text())) {<NEW_LINE>availableOutSideDeleteRange = true;<NEW_LINE>}<NEW_LINE>if (availableOutSideDeleteRange) {<NEW_LINE>this.unusedImports.remove(getImportModuleName(importDeclarationNode.orgName().isPresent() ? importDeclarationNode.orgName().get() : null, importDeclarationNode.moduleName()));<NEW_LINE>this.usedImports.put(getImportModuleName(importDeclarationNode.orgName().isPresent() ? importDeclarationNode.orgName().get() : null, importDeclarationNode<MASK><NEW_LINE>}<NEW_LINE>} | .moduleName()), importDeclarationNode); |
826,891 | private Mono<Response<Void>> deleteWithResponseAsync(String resourceGroupName, String namespaceName, String eventHubName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (namespaceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (eventHubName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter eventHubName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), resourceGroupName, namespaceName, eventHubName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); |
1,664,879 | public static SearchRequest<Amenity> buildSearchPoiRequest(List<Location> route, double radius, SearchPoiTypeFilter poiTypeFilter, ResultMatcher<Amenity> resultMatcher) {<NEW_LINE>SearchRequest<Amenity> request = new SearchRequest<Amenity>();<NEW_LINE>float coeff = (float) (radius / MapUtils.getTileDistanceWidth(SearchRequest.ZOOM_TO_SEARCH_POI));<NEW_LINE>TLongObjectHashMap<List<Location>> zooms = new TLongObjectHashMap<List<Location>>();<NEW_LINE>for (int i = 1; i < route.size(); i++) {<NEW_LINE>Location cr = route.get(i);<NEW_LINE>Location pr = route.get(i - 1);<NEW_LINE>double tx = MapUtils.getTileNumberX(SearchRequest.ZOOM_TO_SEARCH_POI, cr.getLongitude());<NEW_LINE>double ty = MapUtils.getTileNumberY(SearchRequest.ZOOM_TO_SEARCH_POI, cr.getLatitude());<NEW_LINE>double px = MapUtils.getTileNumberX(SearchRequest.ZOOM_TO_SEARCH_POI, pr.getLongitude());<NEW_LINE>double py = MapUtils.getTileNumberY(SearchRequest.ZOOM_TO_SEARCH_POI, pr.getLatitude());<NEW_LINE>double topLeftX = Math.min(tx, px) - coeff;<NEW_LINE>double topLeftY = Math.min(ty, py) - coeff;<NEW_LINE>double bottomRightX = Math.max(tx, px) + coeff;<NEW_LINE>double bottomRightY = Math.max(ty, py) + coeff;<NEW_LINE>for (int x = (int) topLeftX; x <= bottomRightX; x++) {<NEW_LINE>for (int y = (int) topLeftY; y <= bottomRightY; y++) {<NEW_LINE>long hash = (((long) x) << SearchRequest.ZOOM_TO_SEARCH_POI) + y;<NEW_LINE>if (!zooms.containsKey(hash)) {<NEW_LINE>zooms.put(hash, new LinkedList<Location>());<NEW_LINE>}<NEW_LINE>List<Location> ll = zooms.get(hash);<NEW_LINE>ll.add(pr);<NEW_LINE>ll.add(cr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int sleft = Integer.MAX_VALUE, sright = 0, stop = Integer.MAX_VALUE, sbottom = 0;<NEW_LINE>for (long vl : zooms.keys()) {<NEW_LINE>long x = (vl >> SearchRequest.ZOOM_TO_SEARCH_POI) <MASK><NEW_LINE>long y = (vl & ((1 << SearchRequest.ZOOM_TO_SEARCH_POI) - 1)) << (31 - SearchRequest.ZOOM_TO_SEARCH_POI);<NEW_LINE>sleft = (int) Math.min(x, sleft);<NEW_LINE>stop = (int) Math.min(y, stop);<NEW_LINE>sbottom = (int) Math.max(y, sbottom);<NEW_LINE>sright = (int) Math.max(x, sright);<NEW_LINE>}<NEW_LINE>request.radius = radius;<NEW_LINE>request.left = sleft;<NEW_LINE>request.zoom = -1;<NEW_LINE>request.right = sright;<NEW_LINE>request.top = stop;<NEW_LINE>request.bottom = sbottom;<NEW_LINE>request.tiles = zooms;<NEW_LINE>request.poiTypeFilter = poiTypeFilter;<NEW_LINE>request.resultMatcher = resultMatcher;<NEW_LINE>return request;<NEW_LINE>} | << (31 - SearchRequest.ZOOM_TO_SEARCH_POI); |
437,831 | public Mono<ShouldRetryResult> shouldRetry(Exception exception) {<NEW_LINE>Duration backoffTime;<NEW_LINE>Duration timeout;<NEW_LINE>if (!(exception instanceof RetryWithException)) {<NEW_LINE>logger.debug("Operation will NOT be retried. Current attempt {}, Exception: ", this.attemptCount, exception);<NEW_LINE>return Mono.just(ShouldRetryResult.noRetryOnNonRelatedException());<NEW_LINE>}<NEW_LINE>RetryWithException lastRetryWithException = (RetryWithException) exception;<NEW_LINE>GoneAndRetryWithRetryPolicy.this.lastRetryWithException = lastRetryWithException;<NEW_LINE>long remainingMilliseconds = (this.waitTimeInSeconds * 1_000L) - GoneAndRetryWithRetryPolicy.this<MASK><NEW_LINE>int currentRetryAttemptCount = this.attemptCount++;<NEW_LINE>if (remainingMilliseconds <= 0) {<NEW_LINE>logger.warn("Received RetryWithException after backoff/retry. Will fail the request.", lastRetryWithException);<NEW_LINE>return Mono.just(ShouldRetryResult.error(lastRetryWithException));<NEW_LINE>}<NEW_LINE>backoffTime = Duration.ofMillis(Math.min(Math.min(this.currentBackoffMilliseconds + random.nextInt(RANDOM_SALT_IN_MS), remainingMilliseconds), RetryWithRetryPolicy.MAXIMUM_BACKOFF_TIME_IN_MS));<NEW_LINE>this.currentBackoffMilliseconds *= RetryWithRetryPolicy.BACK_OFF_MULTIPLIER;<NEW_LINE>logger.debug("BackoffTime: {} ms.", backoffTime.toMillis());<NEW_LINE>// Calculate the remaining time based after accounting for the backoff that we<NEW_LINE>// will perform<NEW_LINE>long timeoutInMillSec = remainingMilliseconds - backoffTime.toMillis();<NEW_LINE>timeout = timeoutInMillSec > 0 ? Duration.ofMillis(timeoutInMillSec) : Duration.ofMillis(RetryWithRetryPolicy.MAXIMUM_BACKOFF_TIME_IN_MS);<NEW_LINE>logger.debug("Received RetryWithException, will retry, ", exception);<NEW_LINE>// For RetryWithException, prevent the caller<NEW_LINE>// from refreshing any caches.<NEW_LINE>return Mono.just(ShouldRetryResult.retryAfter(backoffTime, Quadruple.with(false, true, timeout, currentRetryAttemptCount)));<NEW_LINE>} | .getElapsedTime().toMillis(); |
1,608,947 | private void removeUsedPages(final int pageIndex, final Set<Integer> pages, final OAtomicOperation atomicOperation) throws IOException {<NEW_LINE>final OCacheEntry cacheEntry = loadPageForRead(atomicOperation, fileId, pageIndex, true);<NEW_LINE>try {<NEW_LINE>final CellBTreeSingleValueBucketV3<K> bucket = new CellBTreeSingleValueBucketV3<>(cacheEntry);<NEW_LINE>if (bucket.isLeaf()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int bucketSize = bucket.size();<NEW_LINE>final List<Integer> pagesToExplore = new ArrayList<>(bucketSize);<NEW_LINE>if (bucketSize > 0) {<NEW_LINE>final int leftPage = bucket.getLeft(0);<NEW_LINE>pages.remove(leftPage);<NEW_LINE>pagesToExplore.add(leftPage);<NEW_LINE>for (int i = 0; i < bucketSize; i++) {<NEW_LINE>final int rightPage = bucket.getRight(i);<NEW_LINE>pages.remove(rightPage);<NEW_LINE>pagesToExplore.add(rightPage);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (final int pageToExplore : pagesToExplore) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>releasePageFromRead(atomicOperation, cacheEntry);<NEW_LINE>}<NEW_LINE>} | removeUsedPages(pageToExplore, pages, atomicOperation); |
1,106,616 | private boolean isUnlockable(String pipelineName, OperationResult result) {<NEW_LINE>if (!goConfigService.isLockable(pipelineName)) {<NEW_LINE>String msg = format("No lock exists within the pipeline configuration for %s", pipelineName);<NEW_LINE>result.conflict(msg, msg, HealthStateType<MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>StageIdentifier stageIdentifier = pipelineLockService.lockedPipeline(pipelineName);<NEW_LINE>if (stageIdentifier == null) {<NEW_LINE>String msg = "Lock exists within the pipeline configuration but no pipeline instance is currently in progress";<NEW_LINE>result.conflict(msg, msg, HealthStateType.general(HealthStateScope.GLOBAL));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (stageService.isAnyStageActiveForPipeline(stageIdentifier.pipelineIdentifier())) {<NEW_LINE>String message = "Locked pipeline instance is currently running (one of the stages is in progress)";<NEW_LINE>result.conflict(message, message, HealthStateType.general(HealthStateScope.GLOBAL));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | .general(HealthStateScope.GLOBAL)); |
1,552,497 | private void testAccessAfterCancel(String info, Timer timer) {<NEW_LINE>try {<NEW_LINE>svTimerStartedLatch.countDown();<NEW_LINE>svLogger.info("testAccessAfterCancel: waiting for cancel to complete");<NEW_LINE>svTimerCancelLatch.await(LATCH_AWAIT_TIME, TimeUnit.MILLISECONDS);<NEW_LINE>svLogger.info("testAccessAfterCancel: attempting timer access from timeout");<NEW_LINE>assertEquals("Timer.getInfo() returned unexpected value", info, timer.getInfo());<NEW_LINE>timer.getNextTimeout();<NEW_LINE>assertFalse("Timer is persistent, should be non-persistent", timer.isPersistent());<NEW_LINE>timer.cancel();<NEW_LINE>// Now that cancel has also been called from this timeout; verify the timer<NEW_LINE>// methods now throw a NoSuchObjectLocalException<NEW_LINE>try {<NEW_LINE>Object timerInfo = timer.getInfo();<NEW_LINE>fail("Timer.getInfo() returned unexpected value : " + timerInfo);<NEW_LINE>} catch (NoSuchObjectLocalException ex) {<NEW_LINE>svLogger.info("Caught excpected exception : " + ex);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Date next = timer.getNextTimeout();<NEW_LINE>fail("Timer.getNextTimeout() returned unexpected value : " + next);<NEW_LINE>} catch (NoSuchObjectLocalException ex) {<NEW_LINE>svLogger.info("Caught excpected exception : " + ex);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>boolean persistent = timer.isPersistent();<NEW_LINE>fail("Timer.isPersistent() returned unexpected value : " + persistent);<NEW_LINE>} catch (NoSuchObjectLocalException ex) {<NEW_LINE>svLogger.info("Caught excpected exception : " + ex);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>timer.cancel();<NEW_LINE>fail("Timer.persistent() returned without exception");<NEW_LINE>} catch (NoSuchObjectLocalException ex) {<NEW_LINE>svLogger.info("Caught excpected exception : " + ex);<NEW_LINE>}<NEW_LINE>svAccessAfterCreateResult = info;<NEW_LINE>} catch (Throwable ex) {<NEW_LINE><MASK><NEW_LINE>svAccessAfterCreateResult = ex;<NEW_LINE>}<NEW_LINE>} | svLogger.info("Unexpected Exception : " + ex); |
1,213,296 | private void refreshKeys() {<NEW_LINE>List<String> newVisibleFiles = new ArrayList<String>();<NEW_LINE>Iterator<String> it = FILES.keySet().iterator();<NEW_LINE>Set<FileObject> files = new HashSet<FileObject>();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>String loc = it.next();<NEW_LINE>String locEval = project.getEvaluator().evaluate(loc);<NEW_LINE>if (locEval == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>FileObject file = project.<MASK><NEW_LINE>if (file != null) {<NEW_LINE>newVisibleFiles.add(loc);<NEW_LINE>files.add(file);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!isInitialized() || !newVisibleFiles.equals(visibleFiles)) {<NEW_LINE>visibleFiles = newVisibleFiles;<NEW_LINE>getNodesSyncRP().post(new // #72471<NEW_LINE>Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>setKeys(visibleFiles);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// #72439<NEW_LINE>((ImportantFilesNode) getNode()).setFiles(files);<NEW_LINE>}<NEW_LINE>} | getHelper().resolveFileObject(locEval); |
1,394,250 | final CreateByteMatchSetResult executeCreateByteMatchSet(CreateByteMatchSetRequest createByteMatchSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createByteMatchSetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<CreateByteMatchSetRequest> request = null;<NEW_LINE>Response<CreateByteMatchSetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateByteMatchSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createByteMatchSetRequest));<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, "WAF");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateByteMatchSet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateByteMatchSetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateByteMatchSetResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
1,619,072 | private static void loadProperties(String propertiesFile) throws IOException {<NEW_LINE>FileInputStream inputStream = new FileInputStream(propertiesFile);<NEW_LINE>Properties properties = new Properties();<NEW_LINE>try {<NEW_LINE>properties.load(inputStream);<NEW_LINE>} finally {<NEW_LINE>inputStream.close();<NEW_LINE>}<NEW_LINE>String appNameOverride = properties.getProperty(ConfigKeys.APPLICATION_NAME_KEY);<NEW_LINE>if (appNameOverride != null) {<NEW_LINE>applicationName = appNameOverride;<NEW_LINE>}<NEW_LINE>LOG.info("Using application name " + applicationName);<NEW_LINE>String streamNameOverride = properties.getProperty(ConfigKeys.STREAM_NAME_KEY);<NEW_LINE>if (streamNameOverride != null) {<NEW_LINE>streamName = streamNameOverride;<NEW_LINE>}<NEW_LINE>LOG.info("Using stream name " + streamName);<NEW_LINE>String kinesisEndpointOverride = properties.getProperty(ConfigKeys.KINESIS_ENDPOINT_KEY);<NEW_LINE>if (kinesisEndpointOverride != null) {<NEW_LINE>kinesisEndpoint = kinesisEndpointOverride;<NEW_LINE>}<NEW_LINE>LOG.info("Using Kinesis endpoint " + kinesisEndpoint);<NEW_LINE>String initialPositionOverride = properties.getProperty(ConfigKeys.INITIAL_POSITION_IN_STREAM_KEY);<NEW_LINE>if (initialPositionOverride != null) {<NEW_LINE>initialPositionInStream = InitialPositionInStream.valueOf(initialPositionOverride);<NEW_LINE>}<NEW_LINE>LOG.info("Using initial position " + <MASK><NEW_LINE>String redisEndpointOverride = properties.getProperty(ConfigKeys.REDIS_ENDPOINT);<NEW_LINE>if (redisEndpointOverride != null) {<NEW_LINE>redisEndpoint = redisEndpointOverride;<NEW_LINE>}<NEW_LINE>LOG.info("Using Redis endpoint " + redisEndpoint);<NEW_LINE>String redisPortOverride = properties.getProperty(ConfigKeys.REDIS_PORT);<NEW_LINE>if (redisPortOverride != null) {<NEW_LINE>try {<NEW_LINE>redisPort = Integer.parseInt(redisPortOverride);<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOG.info("Using Redis port " + redisPort);<NEW_LINE>} | initialPositionInStream.toString() + " (if a checkpoint is not found)."); |
712,724 | public ResponseEntity<Object> report(@RequestParam(name = "AD_Process_ID", required = false) final int processId, @RequestParam(name = "AD_PInstance_ID", required = false) final int pinstanceId, @RequestParam(name = "AD_Language", required = false) final String adLanguage, @RequestParam(name = "output", required = false) final String outputStr) {<NEW_LINE>try (final MDCCloseable ignored = MDC.putCloseable("AD_Process_ID", String.valueOf(processId));<NEW_LINE>final MDCCloseable ignored1 = MDC.putCloseable("AD_PInstance_ID", String.valueOf(pinstanceId));<NEW_LINE>final MDCCloseable ignored2 = MDC.putCloseable("output", String.valueOf(outputStr))) {<NEW_LINE>final OutputType outputType = outputStr == null ? IReportServer.DEFAULT_OutputType : OutputType.valueOf(outputStr);<NEW_LINE>final ReportResult report = server.report(processId, pinstanceId, adLanguage, outputType);<NEW_LINE><MASK><NEW_LINE>final HttpHeaders headers = new HttpHeaders();<NEW_LINE>headers.setContentType(MediaType.APPLICATION_JSON);<NEW_LINE>headers.set(HttpHeaders.CONTENT_DISPOSITION, "inline; filename=\"" + reportFilename + "\"");<NEW_LINE>headers.setCacheControl("must-revalidate, post-check=0, pre-check=0");<NEW_LINE>return ResponseEntity.ok().headers(headers).body(report);<NEW_LINE>} catch (final Throwable ex) {<NEW_LINE>logger.error("Failed creating report for processId={}, pinstanceId={}, adLanguage={}, outputType={}", processId, pinstanceId, adLanguage, outputStr, ex);<NEW_LINE>return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(toJsonReportError(ex, adLanguage));<NEW_LINE>}<NEW_LINE>} | final String reportFilename = extractReportFilename(report); |
1,646,766 | protected void onNotSnappingToPageInFreeScroll() {<NEW_LINE>int finalPos = mScroller.getFinalX();<NEW_LINE>if (!showAsGrid() && finalPos > mMinScroll && finalPos < mMaxScroll) {<NEW_LINE>int firstPageScroll = getScrollForPage(!mIsRtl ? 0 : getPageCount() - 1);<NEW_LINE>int lastPageScroll = getScrollForPage(!mIsRtl ? getPageCount() - 1 : 0);<NEW_LINE>// If scrolling ends in the half of the added space that is closer to<NEW_LINE>// the end, settle to the end. Otherwise snap to the nearest page.<NEW_LINE>// If flinging past one of the ends, don't change the velocity as it<NEW_LINE>// will get stopped at the end anyway.<NEW_LINE>int pageSnapped = finalPos < (firstPageScroll + mMinScroll) / 2 ? mMinScroll : finalPos > (lastPageScroll + mMaxScroll) / 2 ? mMaxScroll : getScrollForPage(mNextPage);<NEW_LINE><MASK><NEW_LINE>// Ensure the scroll/snap doesn't happen too fast;<NEW_LINE>int extraScrollDuration = OVERSCROLL_PAGE_SNAP_ANIMATION_DURATION - mScroller.getDuration();<NEW_LINE>if (extraScrollDuration > 0) {<NEW_LINE>OverScrollerCompat.extendDuration(mScroller, extraScrollDuration);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | OverScrollerCompat.setFinalX(mScroller, pageSnapped); |
1,423,673 | public Completable sendMessageWithImage(final File imageFile, final Thread thread) {<NEW_LINE>MessageSendRig rig = new MessageSendRig(new MessageType(MessageType.Base64Image), thread, message -> {<NEW_LINE>// Get the image and set the image text dimensions<NEW_LINE>final Bitmap image = BitmapFactory.decodeFile(imageFile.getPath(), null);<NEW_LINE>int height = Math.round((float) image.getHeight() * (float) this.width / (float) image.getWidth());<NEW_LINE>Bitmap scaled = Bitmap.createScaledBitmap(<MASK><NEW_LINE>// Convert to JPEG<NEW_LINE>ByteArrayOutputStream out = new ByteArrayOutputStream();<NEW_LINE>scaled.compress(Bitmap.CompressFormat.JPEG, this.jpegQuality, out);<NEW_LINE>String encoded = Base64.encodeToString(out.toByteArray(), Base64.DEFAULT);<NEW_LINE>message.setValueForKey(encoded, Keys.MessageImageData);<NEW_LINE>message.setValueForKey(this.width, Keys.MessageImageWidth);<NEW_LINE>message.setValueForKey(height, Keys.MessageImageHeight);<NEW_LINE>});<NEW_LINE>return rig.run();<NEW_LINE>} | image, width, height, false); |
2,168 | public GenericRecord parse(ByteBuffer bytes) {<NEW_LINE>int length = bytes.limit() - 1 - 4;<NEW_LINE>if (length < 0) {<NEW_LINE>throw new ParseException(null, "Failed to decode avro message, not enough bytes to decode (%s)", bytes.limit());<NEW_LINE>}<NEW_LINE>// ignore first \0 byte<NEW_LINE>bytes.get();<NEW_LINE>// extract schema registry id<NEW_LINE>int id = bytes.getInt();<NEW_LINE>int offset = bytes.position() + bytes.arrayOffset();<NEW_LINE>Schema schema;<NEW_LINE>try {<NEW_LINE>ParsedSchema parsedSchema = registry.getSchemaById(id);<NEW_LINE>schema = parsedSchema instanceof AvroSchema ? ((AvroSchema) parsedSchema).rawSchema() : null;<NEW_LINE>} catch (IOException | RestClientException ex) {<NEW_LINE>throw new ParseException(null, "Failed to get Avro schema: %s", id);<NEW_LINE>}<NEW_LINE>if (schema == null) {<NEW_LINE>throw new ParseException(null, "Failed to find Avro schema: %s", id);<NEW_LINE>}<NEW_LINE>DatumReader<GenericRecord> reader = new GenericDatumReader<>(schema);<NEW_LINE>try {<NEW_LINE>return reader.read(null, DecoderFactory.get().binaryDecoder(bytes.array(), offset, length, null));<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ParseException(<MASK><NEW_LINE>}<NEW_LINE>} | null, e, "Fail to decode Avro message for schema: %s!", id); |
1,509,379 | private Component buildComponent(Disposable uiDisposable) {<NEW_LINE>myUserNameEntered = false;<NEW_LINE>myUserPathEntered = false;<NEW_LINE>FormBuilder formBuilder = FormBuilder.create();<NEW_LINE>myNameTextBox = TextBox.create();<NEW_LINE>formBuilder.addLabeled(myContext.isNewProject() ? IdeLocalize.labelProjectName() : IdeLocalize.labelModuleName(), myNameTextBox);<NEW_LINE>FileChooserTextBoxBuilder builder = FileChooserTextBoxBuilder.create(myContext.getProject());<NEW_LINE>builder.uiDisposable(uiDisposable);<NEW_LINE>builder.textBoxAccessor(new TextComponentAccessor<TextBox>() {<NEW_LINE><NEW_LINE>@RequiredUIAccess<NEW_LINE>@Override<NEW_LINE>public String getValue(TextBox component) {<NEW_LINE>return component.getValueOrError();<NEW_LINE>}<NEW_LINE><NEW_LINE>@RequiredUIAccess<NEW_LINE>@Override<NEW_LINE>public void setValue(TextBox component, String path, boolean fireListeners) {<NEW_LINE><MASK><NEW_LINE>if (fireListeners) {<NEW_LINE>myUserPathEntered = true;<NEW_LINE>if (!myUserNameEntered) {<NEW_LINE>final int lastSeparatorIndex = path.lastIndexOf(File.separator);<NEW_LINE>if (lastSeparatorIndex >= 0 && (lastSeparatorIndex + 1) < path.length()) {<NEW_LINE>myNameTextBox.setValue(path.substring(lastSeparatorIndex + 1), false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>builder.fileChooserDescriptor(FileChooserDescriptorFactory.createSingleFolderDescriptor());<NEW_LINE>myFileChooserController = builder.build();<NEW_LINE>formBuilder.addLabeled(myContext.isNewProject() ? IdeLocalize.labelProjectFilesLocation() : IdeLocalize.labelModuleContentRoot(), myFileChooserController.getComponent());<NEW_LINE>final String projectOrModuleName = myContext.getName();<NEW_LINE>final String projectOrModulePath = myContext.getPath();<NEW_LINE>myNameTextBox.setValue(projectOrModuleName);<NEW_LINE>myFileChooserController.setValue(projectOrModulePath, false);<NEW_LINE>myNameTextBox.addValueListener(event -> {<NEW_LINE>if (myUserPathEntered) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String name = myNameTextBox.getValue();<NEW_LINE>final String path = myFileChooserController.getValue().trim();<NEW_LINE>final int lastSeparatorIndex = path.lastIndexOf(File.separator);<NEW_LINE>if (lastSeparatorIndex >= 0) {<NEW_LINE>String newPath = path.substring(0, lastSeparatorIndex + 1) + name;<NEW_LINE>// do not fire events<NEW_LINE>myFileChooserController.setValue(newPath, false);<NEW_LINE>myUserNameEntered = true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>extend(formBuilder, uiDisposable);<NEW_LINE>return formBuilder.build();<NEW_LINE>} | component.setValue(path, fireListeners); |
826,064 | final PutReplicationConfigurationResult executePutReplicationConfiguration(PutReplicationConfigurationRequest putReplicationConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putReplicationConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutReplicationConfigurationRequest> request = null;<NEW_LINE>Response<PutReplicationConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutReplicationConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putReplicationConfigurationRequest));<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, "ECR");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutReplicationConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutReplicationConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutReplicationConfigurationResultJsonUnmarshaller());<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.endEvent(Field.RequestMarshallTime); |
1,635,465 | public PackageSet createPackageSet(final PackageDependenciesNode node, final boolean recursively) {<NEW_LINE>if (node instanceof ModuleGroupNode) {<NEW_LINE>if (!recursively)<NEW_LINE>return null;<NEW_LINE>@NonNls<NEW_LINE>final String modulePattern = "group:" + ((ModuleGroupNode) node)<MASK><NEW_LINE>return new FilePatternPackageSet(modulePattern, "*//*");<NEW_LINE>} else if (node instanceof ModuleNode) {<NEW_LINE>if (!recursively)<NEW_LINE>return null;<NEW_LINE>final String modulePattern = ((ModuleNode) node).getModuleName();<NEW_LINE>return new FilePatternPackageSet(modulePattern, "*/");<NEW_LINE>} else if (node instanceof DirectoryNode) {<NEW_LINE>String pattern = ((DirectoryNode) node).getFQName();<NEW_LINE>if (pattern != null) {<NEW_LINE>if (pattern.length() > 0) {<NEW_LINE>pattern += recursively ? "//*" : "/*";<NEW_LINE>} else {<NEW_LINE>pattern += recursively ? "*/" : "*";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new FilePatternPackageSet(getModulePattern(node), pattern);<NEW_LINE>} else if (node instanceof FileNode) {<NEW_LINE>if (recursively)<NEW_LINE>return null;<NEW_LINE>FileNode fNode = (FileNode) node;<NEW_LINE>final PsiFile file = (PsiFile) fNode.getPsiElement();<NEW_LINE>if (file == null)<NEW_LINE>return null;<NEW_LINE>final VirtualFile virtualFile = file.getVirtualFile();<NEW_LINE>LOG.assertTrue(virtualFile != null);<NEW_LINE>final VirtualFile contentRoot = ProjectRootManager.getInstance(file.getProject()).getFileIndex().getContentRootForFile(virtualFile);<NEW_LINE>if (contentRoot == null)<NEW_LINE>return null;<NEW_LINE>final String fqName = VfsUtilCore.getRelativePath(virtualFile, contentRoot, '/');<NEW_LINE>if (fqName != null)<NEW_LINE>return new FilePatternPackageSet(getModulePattern(node), fqName);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | .getModuleGroup().toString(); |
415,618 | private void runNoop() throws IOException, InterruptedException, TimeoutException {<NEW_LINE>long jobId = mJobMasterClient.run(new NoopPlanConfig());<NEW_LINE>// TODO(jianjian): refactor JobTestUtils<NEW_LINE>ImmutableSet<Status> statuses = ImmutableSet.of(Status.COMPLETED, Status.CANCELED, Status.FAILED);<NEW_LINE>final AtomicReference<JobInfo> singleton = new AtomicReference<>();<NEW_LINE>CommonUtils.waitFor(String.format("job %d to be one of status %s", jobId, Arrays.toString(statuses.toArray())), () -> {<NEW_LINE>JobInfo info;<NEW_LINE>try {<NEW_LINE>info = mJobMasterClient.getJobStatus(jobId);<NEW_LINE>if (statuses.contains(info.getStatus())) {<NEW_LINE>singleton.set(info);<NEW_LINE>}<NEW_LINE>return statuses.contains(info.getStatus());<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw Throwables.propagate(e);<NEW_LINE>}<NEW_LINE>}, WaitForOptions.defaults().setTimeoutMs(30 * Constants.SECOND_MS));<NEW_LINE>JobInfo jobInfo = singleton.get();<NEW_LINE>if (jobInfo.getStatus().equals(Status.FAILED)) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>} | IOException(jobInfo.getErrorMessage()); |
999,875 | final UpdateSourceServerReplicationTypeResult executeUpdateSourceServerReplicationType(UpdateSourceServerReplicationTypeRequest updateSourceServerReplicationTypeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateSourceServerReplicationTypeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateSourceServerReplicationTypeRequest> request = null;<NEW_LINE>Response<UpdateSourceServerReplicationTypeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateSourceServerReplicationTypeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateSourceServerReplicationTypeRequest));<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, "mgn");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateSourceServerReplicationType");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateSourceServerReplicationTypeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | false), new UpdateSourceServerReplicationTypeResultJsonUnmarshaller()); |
318,130 | private void generateMetaFile(final String keyspace, final String columnFamily, final File backupDir) throws Exception {<NEW_LINE>File snapshotDir = getValidSnapshot(backupDir, snapshotName);<NEW_LINE>// Process this snapshot folder for the given columnFamily<NEW_LINE>if (snapshotDir == null) {<NEW_LINE>logger.warn("{} folder does not contain {} snapshots", backupDir, snapshotName);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>logger.debug("Scanning for all SSTables in: {}", snapshotDir.getAbsolutePath());<NEW_LINE>ImmutableSetMultimap.Builder<String, AbstractBackupPath> builder = ImmutableSetMultimap.builder();<NEW_LINE>builder.putAll(getSSTables(snapshotDir, AbstractBackupPath.BackupFileType.SST_V2));<NEW_LINE>ImmutableSetMultimap<String, AbstractBackupPath> sstables = builder.build();<NEW_LINE>logger.debug("Processing {} sstables from {}.{}", keyspace, columnFamily, sstables.size());<NEW_LINE>dataStep.addColumnfamilyResult(keyspace, columnFamily, sstables);<NEW_LINE>logger.<MASK><NEW_LINE>} | debug("Finished processing KS: {}, CF: {}", keyspace, columnFamily); |
1,826,704 | final UpdateStackResult executeUpdateStack(UpdateStackRequest updateStackRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateStackRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateStackRequest> request = null;<NEW_LINE>Response<UpdateStackResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateStackRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateStackRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "AppStream");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateStack");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateStackResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateStackResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
1,037,019 | public static void patch(final Emulator<?> emulator, InlineHook inlineHook, final ThreadJoinVisitor visitor) {<NEW_LINE>Memory memory = emulator.getMemory();<NEW_LINE>Module libc = memory.findModule("libc.so");<NEW_LINE>Symbol clone = libc.findSymbolByName("clone", false);<NEW_LINE>Symbol pthread_join = libc.findSymbolByName("pthread_join", false);<NEW_LINE>if (clone == null || pthread_join == null) {<NEW_LINE>throw new IllegalStateException("clone=" + clone + ", pthread_join=" + pthread_join);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>inlineHook.replace(pthread_join, new ReplaceCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public HookStatus onCall(Emulator<?> emulator, HookContext context, long originFunction) {<NEW_LINE>Pointer ptr = context.getPointerArg(1);<NEW_LINE>if (ptr != null) {<NEW_LINE>if (emulator.is64Bit()) {<NEW_LINE>ptr.setLong(0, value_ptr.get());<NEW_LINE>} else {<NEW_LINE>ptr.setInt(0, (int) value_ptr.get());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return HookStatus.LR(emulator, 0);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>inlineHook.replace(clone, emulator.is32Bit() ? new ClonePatcher32(visitor, value_ptr) : new ClonePatcher64(visitor, value_ptr));<NEW_LINE>} | final AtomicLong value_ptr = new AtomicLong(); |
1,431,085 | public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException {<NEW_LINE>HttpServletRequest request = (HttpServletRequest) req;<NEW_LINE>HttpServletResponse response = (HttpServletResponse) resp;<NEW_LINE>String appId = accessKeyUtil.extractAppIdFromRequest(request);<NEW_LINE>if (StringUtils.isBlank(appId)) {<NEW_LINE>response.<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<String> availableSecrets = accessKeyUtil.findAvailableSecret(appId);<NEW_LINE>if (!CollectionUtils.isEmpty(availableSecrets)) {<NEW_LINE>String timestamp = request.getHeader(Signature.HTTP_HEADER_TIMESTAMP);<NEW_LINE>String authorization = request.getHeader(HttpHeaders.AUTHORIZATION);<NEW_LINE>// check timestamp, valid within 1 minute<NEW_LINE>if (!checkTimestamp(timestamp)) {<NEW_LINE>logger.warn("Invalid timestamp. appId={},timestamp={}", appId, timestamp);<NEW_LINE>response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "RequestTimeTooSkewed");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// check signature<NEW_LINE>String uri = request.getRequestURI();<NEW_LINE>String query = request.getQueryString();<NEW_LINE>if (!checkAuthorization(authorization, availableSecrets, timestamp, uri, query)) {<NEW_LINE>logger.warn("Invalid authorization. appId={},authorization={}", appId, authorization);<NEW_LINE>response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Unauthorized");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>chain.doFilter(request, response);<NEW_LINE>} | sendError(HttpServletResponse.SC_BAD_REQUEST, "InvalidAppId"); |
727,284 | private final int insertString() {<NEW_LINE>short match;<NEW_LINE>final int hash = ((ins_h << HASH_SHIFT) ^ window[strstart + (MIN_MATCH - 1)]) & HASH_MASK;<NEW_LINE>if (DEBUGGING) {<NEW_LINE>if (hash != (((window[strstart] << (2 * HASH_SHIFT)) ^ (window[strstart + 1] << HASH_SHIFT) ^ (window[strstart + 2])) & HASH_MASK)) {<NEW_LINE>throw new InternalError("hash inconsistent: " + hash + "/" + window[strstart] + "," + window[strstart + 1] + "," + window[strstart + 2] + "," + HASH_SHIFT);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>prev[strstart & WMASK] = match = head[hash];<NEW_LINE>head<MASK><NEW_LINE>ins_h = hash;<NEW_LINE>return match & 0xffff;<NEW_LINE>} | [hash] = (short) strstart; |
1,245,731 | public Optional<PluginImplementation<?>> load(@Nonnull PluginIdLookupCacheKey key) {<NEW_LINE>PluginId pluginId = key.getId();<NEW_LINE>ClassLoader classLoader = key.getClassLoader();<NEW_LINE>PluginDescriptorLocator locator = new ClassloaderBackedPluginDescriptorLocator(classLoader);<NEW_LINE>PluginDescriptor pluginDescriptor = locator.findPluginDescriptor(pluginId.toString());<NEW_LINE>if (pluginDescriptor == null) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (!GUtil.isTrue(implClassName)) {<NEW_LINE>throw new InvalidPluginException(String.format("No implementation class specified for plugin '%s' in %s.", pluginId, pluginDescriptor));<NEW_LINE>}<NEW_LINE>final Class<?> implClass;<NEW_LINE>try {<NEW_LINE>implClass = classLoader.loadClass(implClassName);<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>throw new InvalidPluginException(String.format("Could not find implementation class '%s' for plugin '%s' specified in %s.", implClassName, pluginId, pluginDescriptor), e);<NEW_LINE>}<NEW_LINE>PotentialPlugin<?> potentialPlugin = pluginInspector.inspect(implClass);<NEW_LINE>PluginImplementation<Object> withId = new RegistryAwarePluginImplementation(classLoader, pluginId, potentialPlugin);<NEW_LINE>return Optional.of(withId);<NEW_LINE>} | String implClassName = pluginDescriptor.getImplementationClassName(); |
893,657 | private void maybeInitializeOsXApplication() {<NEW_LINE>Throwable ex;<NEW_LINE>try {<NEW_LINE>Class<?> applicationClass = Class.forName("com.apple.eawt.Application");<NEW_LINE>topLogger.log(TreeLogger.SPAM, "Got Application class, on OS X");<NEW_LINE>Object application = applicationClass.getMethod("getApplication").invoke(null);<NEW_LINE>assert application != null : "application";<NEW_LINE>// Remove the about menu entry<NEW_LINE>applicationClass.getMethod("removeAboutMenuItem").invoke(application);<NEW_LINE>// Remove the preferences menu entry<NEW_LINE>applicationClass.getMethod("removePreferencesMenuItem").invoke(application);<NEW_LINE>// Make the Dock icon pretty<NEW_LINE>applicationClass.getMethod("setDockIconImage", Image.class).invoke(application, loadImageIcon<MASK><NEW_LINE>return;<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>// Nothing to do here, this is expected on non-Apple JVMs.<NEW_LINE>return;<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>ex = e;<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>ex = e;<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>ex = e;<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>ex = e;<NEW_LINE>}<NEW_LINE>topLogger.log(TreeLogger.WARN, "Unable to initialize some OS X UI support", ex);<NEW_LINE>} | ("icon128.png").getImage()); |
1,369,469 | public int processBytes(byte[] in, int inOff, int len, byte[] out, int outOff) throws DataLengthException, IllegalStateException {<NEW_LINE>if (len < 0) {<NEW_LINE>throw new IllegalArgumentException("Can't have a negative input length!");<NEW_LINE>}<NEW_LINE>int blockSize = getBlockSize();<NEW_LINE>int length = getUpdateOutputSize(len);<NEW_LINE>if (length > 0) {<NEW_LINE>if ((outOff + length) > out.length) {<NEW_LINE>throw new DataLengthException("output buffer too short");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int resultLen = 0;<NEW_LINE>int gapLen = buf.length - bufOff;<NEW_LINE>if (len > gapLen) {<NEW_LINE>System.arraycopy(in, inOff, buf, bufOff, gapLen);<NEW_LINE>resultLen += cipher.processBlock(<MASK><NEW_LINE>bufOff = 0;<NEW_LINE>len -= gapLen;<NEW_LINE>inOff += gapLen;<NEW_LINE>while (len > buf.length) {<NEW_LINE>resultLen += cipher.processBlock(in, inOff, out, outOff + resultLen);<NEW_LINE>len -= blockSize;<NEW_LINE>inOff += blockSize;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.arraycopy(in, inOff, buf, bufOff, len);<NEW_LINE>bufOff += len;<NEW_LINE>if (bufOff == buf.length) {<NEW_LINE>resultLen += cipher.processBlock(buf, 0, out, outOff + resultLen);<NEW_LINE>bufOff = 0;<NEW_LINE>}<NEW_LINE>return resultLen;<NEW_LINE>} | buf, 0, out, outOff); |
1,134,393 | public void configure(Binder binder) {<NEW_LINE>binder.bind(DatabaseConfig.class).toProvider(DatabaseConfigProvider.class).in(Scopes.SINGLETON);<NEW_LINE>binder.bind(DataSource.class).toProvider(DataSourceProvider.class<MASK><NEW_LINE>binder.bind(AutoMigrator.class);<NEW_LINE>// don't make this singleton because DBI.registerMapper is called for each StoreManager<NEW_LINE>binder.bind(DBI.class).toProvider(DbiProvider.class);<NEW_LINE>binder.bind(TransactionManager.class).to(ThreadLocalTransactionManager.class).in(Scopes.SINGLETON);<NEW_LINE>binder.bind(ConfigMapper.class).in(Scopes.SINGLETON);<NEW_LINE>binder.bind(DatabaseMigrator.class).in(Scopes.SINGLETON);<NEW_LINE>binder.bind(ProjectStoreManager.class).to(DatabaseProjectStoreManager.class).in(Scopes.SINGLETON);<NEW_LINE>binder.bind(QueueSettingStoreManager.class).to(DatabaseQueueSettingStoreManager.class).in(Scopes.SINGLETON);<NEW_LINE>binder.bind(SessionStoreManager.class).to(DatabaseSessionStoreManager.class).in(Scopes.SINGLETON);<NEW_LINE>binder.bind(ScheduleStoreManager.class).to(DatabaseScheduleStoreManager.class).in(Scopes.SINGLETON);<NEW_LINE>if (withTaskQueueServer) {<NEW_LINE>binder.bind(DatabaseTaskQueueConfig.class).in(Scopes.SINGLETON);<NEW_LINE>binder.bind(DatabaseTaskQueueServer.class).in(Scopes.SINGLETON);<NEW_LINE>}<NEW_LINE>} | ).in(Scopes.SINGLETON); |
768,018 | public Request<ModifyCacheParameterGroupRequest> marshall(ModifyCacheParameterGroupRequest modifyCacheParameterGroupRequest) {<NEW_LINE>if (modifyCacheParameterGroupRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<ModifyCacheParameterGroupRequest> request = new DefaultRequest<ModifyCacheParameterGroupRequest>(modifyCacheParameterGroupRequest, "AmazonElastiCache");<NEW_LINE>request.addParameter("Action", "ModifyCacheParameterGroup");<NEW_LINE>request.addParameter("Version", "2015-02-02");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (modifyCacheParameterGroupRequest.getCacheParameterGroupName() != null) {<NEW_LINE>request.addParameter("CacheParameterGroupName", StringUtils.fromString(modifyCacheParameterGroupRequest.getCacheParameterGroupName()));<NEW_LINE>}<NEW_LINE>if (!modifyCacheParameterGroupRequest.getParameterNameValues().isEmpty() || !((com.amazonaws.internal.SdkInternalList<ParameterNameValue>) modifyCacheParameterGroupRequest.getParameterNameValues()).isAutoConstruct()) {<NEW_LINE>com.amazonaws.internal.SdkInternalList<ParameterNameValue> parameterNameValuesList = (com.amazonaws.internal.SdkInternalList<ParameterNameValue>) modifyCacheParameterGroupRequest.getParameterNameValues();<NEW_LINE>int parameterNameValuesListIndex = 1;<NEW_LINE>for (ParameterNameValue parameterNameValuesListValue : parameterNameValuesList) {<NEW_LINE>if (parameterNameValuesListValue != null) {<NEW_LINE>if (parameterNameValuesListValue.getParameterName() != null) {<NEW_LINE>request.addParameter("ParameterNameValues.ParameterNameValue." + parameterNameValuesListIndex + ".ParameterName", StringUtils.fromString(parameterNameValuesListValue.getParameterName()));<NEW_LINE>}<NEW_LINE>if (parameterNameValuesListValue.getParameterValue() != null) {<NEW_LINE>request.addParameter("ParameterNameValues.ParameterNameValue." + parameterNameValuesListIndex + ".ParameterValue", StringUtils.fromString<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>parameterNameValuesListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | (parameterNameValuesListValue.getParameterValue())); |
1,750,739 | public void beginSelectiveKeyRestore() {<NEW_LINE>KeyVaultBackupClient client = createClient();<NEW_LINE>// BEGIN: com.azure.security.keyvault.administration.keyVaultBackupClient.beginSelectiveKeyRestore#String-String-String<NEW_LINE>String folderUrl = "https://myaccount.blob.core.windows.net/myContainer/mhsm-myaccount-2020090117323313";<NEW_LINE>String sasToken = "sv=2020-02-10&ss=b&srt=o&sp=rwdlactfx&se=2021-06-17T07:13:07Z&st=2021-06-16T23:13:07Z" + "&spr=https&sig=n5V6fnlkViEF9b7ij%2FttTHNwO2BdFIHKHppRxGAyJdc%3D";<NEW_LINE>String keyName = "myKey";<NEW_LINE>SyncPoller<KeyVaultSelectiveKeyRestoreOperation, KeyVaultSelectiveKeyRestoreResult> backupPoller = client.beginSelectiveKeyRestore(folderUrl, sasToken, keyName);<NEW_LINE>PollResponse<KeyVaultSelectiveKeyRestoreOperation> pollResponse = backupPoller.poll();<NEW_LINE>System.out.printf("The current status of the operation is: %s.%n", pollResponse.getStatus());<NEW_LINE>PollResponse<KeyVaultSelectiveKeyRestoreOperation> finalPollResponse = backupPoller.waitForCompletion();<NEW_LINE>if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>KeyVaultSelectiveKeyRestoreOperation operation = backupPoller.poll().getValue();<NEW_LINE>System.out.printf("Key restore failed with error: %s.%n", operation.getError().getMessage());<NEW_LINE>}<NEW_LINE>// END: com.azure.security.keyvault.administration.keyVaultBackupClient.beginSelectiveKeyRestore#String-String-String<NEW_LINE>} | System.out.printf("Key restored successfully.%n"); |
6,427 | private void deleteCommits() throws IOException {<NEW_LINE>int size = commitsToDelete.size();<NEW_LINE>if (size > 0) {<NEW_LINE>// First decref all files that had been referred to by<NEW_LINE>// the now-deleted commits:<NEW_LINE>Throwable firstThrowable = null;<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>CommitPoint commit = commitsToDelete.get(i);<NEW_LINE>if (infoStream.isEnabled("IFD")) {<NEW_LINE>infoStream.message("IFD", "deleteCommits: now decRef commit \"" + commit.getSegmentsFileName() + "\"");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>decRef(commit.files);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>firstThrowable = IOUtils.useOrSuppress(firstThrowable, t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>commitsToDelete.clear();<NEW_LINE>// Now compact commits to remove deleted ones (preserving the sort):<NEW_LINE>size = commits.size();<NEW_LINE>int readFrom = 0;<NEW_LINE>int writeTo = 0;<NEW_LINE>while (readFrom < size) {<NEW_LINE>CommitPoint commit = commits.get(readFrom);<NEW_LINE>if (!commit.deleted) {<NEW_LINE>if (writeTo != readFrom) {<NEW_LINE>commits.set(writeTo, commits.get(readFrom));<NEW_LINE>}<NEW_LINE>writeTo++;<NEW_LINE>}<NEW_LINE>readFrom++;<NEW_LINE>}<NEW_LINE>while (size > writeTo) {<NEW_LINE><MASK><NEW_LINE>size--;<NEW_LINE>}<NEW_LINE>if (firstThrowable != null) {<NEW_LINE>throw IOUtils.rethrowAlways(firstThrowable);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | commits.remove(size - 1); |
1,522,833 | public void calculateWeights() {<NEW_LINE>distribution.clear();<NEW_LINE><MASK><NEW_LINE>int indicesCount = mesh.getNumIndices();<NEW_LINE>int vertexCount = mesh.getNumVertices();<NEW_LINE>int vertexSize = (short) (attributes.vertexSize / 4), positionOffset = (short) (attributes.findByUsage(Usage.Position).offset / 4);<NEW_LINE>float[] vertices = new float[vertexCount * vertexSize];<NEW_LINE>mesh.getVertices(vertices);<NEW_LINE>if (indicesCount > 0) {<NEW_LINE>short[] indices = new short[indicesCount];<NEW_LINE>mesh.getIndices(indices);<NEW_LINE>// Calculate the Area<NEW_LINE>for (int i = 0; i < indicesCount; i += 3) {<NEW_LINE>int p1Offset = indices[i] * vertexSize + positionOffset, p2Offset = indices[i + 1] * vertexSize + positionOffset, p3Offset = indices[i + 2] * vertexSize + positionOffset;<NEW_LINE>float x1 = vertices[p1Offset], y1 = vertices[p1Offset + 1], z1 = vertices[p1Offset + 2], x2 = vertices[p2Offset], y2 = vertices[p2Offset + 1], z2 = vertices[p2Offset + 2], x3 = vertices[p3Offset], y3 = vertices[p3Offset + 1], z3 = vertices[p3Offset + 2];<NEW_LINE>float area = Math.abs((x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)) / 2f);<NEW_LINE>distribution.add(new Triangle(x1, y1, z1, x2, y2, z2, x3, y3, z3), area);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Calculate the Area<NEW_LINE>for (int i = 0; i < vertexCount; i += vertexSize) {<NEW_LINE>int p1Offset = i + positionOffset, p2Offset = p1Offset + vertexSize, p3Offset = p2Offset + vertexSize;<NEW_LINE>float x1 = vertices[p1Offset], y1 = vertices[p1Offset + 1], z1 = vertices[p1Offset + 2], x2 = vertices[p2Offset], y2 = vertices[p2Offset + 1], z2 = vertices[p2Offset + 2], x3 = vertices[p3Offset], y3 = vertices[p3Offset + 1], z3 = vertices[p3Offset + 2];<NEW_LINE>float area = Math.abs((x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)) / 2f);<NEW_LINE>distribution.add(new Triangle(x1, y1, z1, x2, y2, z2, x3, y3, z3), area);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Generate cumulative distribution<NEW_LINE>distribution.generateNormalized();<NEW_LINE>} | VertexAttributes attributes = mesh.getVertexAttributes(); |
1,217,756 | private void uncompress(final File file) {<NEW_LINE>final byte[] buffer = new byte[1024];<NEW_LINE>GZIPInputStream gzis = null;<NEW_LINE>OutputStream out = null;<NEW_LINE>try {<NEW_LINE>LOGGER.info("Uncompressing " + file.getName());<NEW_LINE>gzis = new GZIPInputStream(Files.newInputStream(file.toPath()));<NEW_LINE>final File uncompressedFile = new File(file.getAbsolutePath().replaceAll(".gz", ""));<NEW_LINE>out = Files.newOutputStream(uncompressedFile.toPath());<NEW_LINE>int len;<NEW_LINE>while ((len = gzis.read(buffer)) > 0) {<NEW_LINE>out.write(buffer, 0, len);<NEW_LINE>}<NEW_LINE>final long start = System.currentTimeMillis();<NEW_LINE><MASK><NEW_LINE>parser.parse(uncompressedFile);<NEW_LINE>file.setLastModified(start);<NEW_LINE>final long end = System.currentTimeMillis();<NEW_LINE>metricParseTime += end - start;<NEW_LINE>} catch (IOException ex) {<NEW_LINE>mirroredWithoutErrors = false;<NEW_LINE>LOGGER.error("An error occurred uncompressing EPSS payload", ex);<NEW_LINE>} finally {<NEW_LINE>close(gzis);<NEW_LINE>close(out);<NEW_LINE>}<NEW_LINE>} | final EpssParser parser = new EpssParser(); |
1,595,902 | private void mapRequestOptions(CassandraProperties properties, CassandraDriverOptions options) {<NEW_LINE>PropertyMapper map = PropertyMapper.get().alwaysApplyingWhenNonNull();<NEW_LINE>Request requestProperties = properties.getRequest();<NEW_LINE>map.from(requestProperties::getTimeout).asInt(Duration::toMillis).to(((timeout) -> options.add(DefaultDriverOption.REQUEST_TIMEOUT, timeout)));<NEW_LINE>map.from(requestProperties::getConsistency).to(((consistency) -> options.add(DefaultDriverOption.REQUEST_CONSISTENCY, consistency)));<NEW_LINE>map.from(requestProperties::getSerialConsistency).to((serialConsistency) -> options.add(DefaultDriverOption.REQUEST_SERIAL_CONSISTENCY, serialConsistency));<NEW_LINE>map.from(requestProperties::getPageSize).to((pageSize) -> options.add(DefaultDriverOption.REQUEST_PAGE_SIZE, pageSize));<NEW_LINE>Throttler throttlerProperties = requestProperties.getThrottler();<NEW_LINE>map.from(throttlerProperties::getType).as(ThrottlerType::type).to((type) -> options.add(DefaultDriverOption.REQUEST_THROTTLER_CLASS, type));<NEW_LINE>map.from(throttlerProperties::getMaxQueueSize).to((maxQueueSize) -> options.add(DefaultDriverOption.REQUEST_THROTTLER_MAX_QUEUE_SIZE, maxQueueSize));<NEW_LINE>map.from(throttlerProperties::getMaxConcurrentRequests).to((maxConcurrentRequests) -> options.add(DefaultDriverOption.REQUEST_THROTTLER_MAX_CONCURRENT_REQUESTS, maxConcurrentRequests));<NEW_LINE>map.from(throttlerProperties::getMaxRequestsPerSecond).to((maxRequestsPerSecond) -> options.add(DefaultDriverOption.REQUEST_THROTTLER_MAX_REQUESTS_PER_SECOND, maxRequestsPerSecond));<NEW_LINE>map.from(throttlerProperties::getDrainInterval).asInt(Duration::toMillis).to((drainInterval) -> options.add<MASK><NEW_LINE>} | (DefaultDriverOption.REQUEST_THROTTLER_DRAIN_INTERVAL, drainInterval)); |
1,291,283 | protected void onSelectedChanged(@Nullable EpoxyViewHolder viewHolder, int actionState) {<NEW_LINE>super.onSelectedChanged(viewHolder, actionState);<NEW_LINE>if (viewHolder != null) {<NEW_LINE>EpoxyModel<?> model = viewHolder.getModel();<NEW_LINE>if (!isTouchableModel(model)) {<NEW_LINE>throw new IllegalStateException(<MASK><NEW_LINE>}<NEW_LINE>markRecyclerViewHasSelection((RecyclerView) viewHolder.itemView.getParent());<NEW_LINE>if (actionState == ItemTouchHelper.ACTION_STATE_SWIPE) {<NEW_LINE>holderBeingSwiped = viewHolder;<NEW_LINE>// noinspection unchecked<NEW_LINE>onSwipeStarted((T) model, viewHolder.itemView, viewHolder.getAdapterPosition());<NEW_LINE>} else if (actionState == ItemTouchHelper.ACTION_STATE_DRAG) {<NEW_LINE>holderBeingDragged = viewHolder;<NEW_LINE>// noinspection unchecked<NEW_LINE>onDragStarted((T) model, viewHolder.itemView, viewHolder.getAdapterPosition());<NEW_LINE>}<NEW_LINE>} else if (holderBeingDragged != null) {<NEW_LINE>// noinspection unchecked<NEW_LINE>onDragReleased((T) holderBeingDragged.getModel(), holderBeingDragged.itemView);<NEW_LINE>holderBeingDragged = null;<NEW_LINE>} else if (holderBeingSwiped != null) {<NEW_LINE>// noinspection unchecked<NEW_LINE>onSwipeReleased((T) holderBeingSwiped.getModel(), holderBeingSwiped.itemView);<NEW_LINE>holderBeingSwiped = null;<NEW_LINE>}<NEW_LINE>} | "A model was selected that is not a valid target: " + model.getClass()); |
127,320 | private void createOrReplaceViewQuery(List<DBEPersistAction> actions, MySQLView view) {<NEW_LINE>StringBuilder decl = new StringBuilder(200);<NEW_LINE>final String lineSeparator = GeneralUtils.getDefaultLineSeparator();<NEW_LINE>String viewDDL = view.getAdditionalInfo().getDefinition();<NEW_LINE>if (viewDDL == null) {<NEW_LINE>viewDDL = "";<NEW_LINE>}<NEW_LINE>if (!view.isPersisted() && SQLSemanticProcessor.isSelectQuery(view.getDataSource().getSQLDialect(), viewDDL)) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>// $NON-NLS-1$<NEW_LINE>decl.append("CREATE OR REPLACE VIEW ").append(view.getFullyQualifiedName(DBPEvaluationContext.DDL)).append(lineSeparator).// $NON-NLS-1$<NEW_LINE>append("AS ");<NEW_LINE>}<NEW_LINE>final MySQLView.CheckOption checkOption = view.getAdditionalInfo().getCheckOption();<NEW_LINE>if (checkOption != null && checkOption != MySQLView.CheckOption.NONE) {<NEW_LINE>if (viewDDL.endsWith(";")) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>viewDDL = viewDDL.substring(0, viewDDL.length() - 1);<NEW_LINE>}<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>decl.append(viewDDL).append(lineSeparator).append("WITH ").append(checkOption.getDefinitionName()).append(" CHECK OPTION");<NEW_LINE>} else {<NEW_LINE>decl.append(viewDDL);<NEW_LINE>}<NEW_LINE>actions.add(new SQLDatabasePersistAction("Create view", decl.toString()) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void beforeExecute(DBCSession session) throws DBCException {<NEW_LINE>MySQLView schemaView;<NEW_LINE>try {<NEW_LINE>schemaView = DBUtils.findObject(view.getParentObject().getViews(session.getProgressMonitor()<MASK><NEW_LINE>} catch (DBException e) {<NEW_LINE>throw new DBCException(e, session.getExecutionContext());<NEW_LINE>}<NEW_LINE>if (schemaView != view) {<NEW_LINE>throw new DBCException("View with name '" + view.getName() + "' already exists. Choose another name");<NEW_LINE>}<NEW_LINE>super.beforeExecute(session);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | ), view.getName()); |
1,756,641 | private boolean sendToNextHop() {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceEntry(this, "sendToNextHop");<NEW_LINE>}<NEW_LINE>boolean isNewDestination = false;<NEW_LINE>SIPUri nextDestination = null;<NEW_LINE>// we loop the results till we find a destination different from previous one<NEW_LINE>// or till no result is found<NEW_LINE>while (_naptrResults.size() > 0 && !isNewDestination) {<NEW_LINE>// get the next destination<NEW_LINE>nextDestination = _naptrResults.remove(0);<NEW_LINE>// checking if the next destination is new<NEW_LINE>isNewDestination = checkIfNewDestination(nextDestination, _messageContext.getSipConnection());<NEW_LINE>}<NEW_LINE>// if no next destination was found, we report the error<NEW_LINE>if (nextDestination == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Set in the target received information about<NEW_LINE>// host, port and transport<NEW_LINE>try {<NEW_LINE>_latestDestination.setHost(nextDestination.getHost());<NEW_LINE>_latestDestination.setPort(nextDestination.getPortInt());<NEW_LINE>String transport = nextDestination.getTransport();<NEW_LINE>if (transport != null) {<NEW_LINE>_latestDestination.setTransport(transport);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>SipStackUtil.setDestinationHeader(_latestDestination, _messageContext.getSipMessage());<NEW_LINE>} catch (SipParseException e) {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>StringBuffer buff = new StringBuffer();<NEW_LINE>buff.append("error setting destination " + "header for message ");<NEW_LINE>buff.append(_messageContext);<NEW_LINE>c_logger.traceDebug(this, "sendToNextDestination", buff.toString(), e);<NEW_LINE>}<NEW_LINE>// if we failed to set the correct destination<NEW_LINE>// we must report an error to sender<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// return the message to the sender so the message will be sent<NEW_LINE>_sender.sendMessage(_messageContext, _target.getTransport());<NEW_LINE>} catch (SipParseException e) {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "sendToNextDestination", "error in URI [" + nextDestination + ']', e);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | c_logger.traceDebug("calling static method setDestinationHeader to - " + _latestDestination); |
440,207 | public void updateServices() {<NEW_LINE>if (bundleContext == null) {<NEW_LINE>// do nothing; not really in a running system (unit tests etc.)<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Set<String> installedSymbolicNames = new HashSet<String>();<NEW_LINE>for (String featureName : installedFeatures) {<NEW_LINE>String symbolicName = publicFeatureNameToSymbolicName.get(lowerFeature(featureName));<NEW_LINE>if (symbolicName != null) {<NEW_LINE>installedSymbolicNames.add(symbolicName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Set<String> removedFactories = new HashSet<String>(featureServiceFactories.keySet());<NEW_LINE>removedFactories.removeAll(installedSymbolicNames);<NEW_LINE>for (String currentFactorySymbolicName : removedFactories) {<NEW_LINE>LibertyFeatureServiceFactory factory = featureServiceFactories.remove(currentFactorySymbolicName);<NEW_LINE>if (factory != null) {<NEW_LINE>factory.unregisterService();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String currentFactorySymbolicName : installedSymbolicNames) {<NEW_LINE>SubsystemFeatureDefinitionImpl <MASK><NEW_LINE>if (featureDef != null) {<NEW_LINE>LibertyFeatureServiceFactory factory = new LibertyFeatureServiceFactory();<NEW_LINE>LibertyFeatureServiceFactory previous = featureServiceFactories.putIfAbsent(currentFactorySymbolicName, factory);<NEW_LINE>factory = previous != null ? previous : factory;<NEW_LINE>factory.update(featureDef, bundleContext);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | featureDef = cachedFeatures.get(currentFactorySymbolicName); |
959,297 | // DO NOT MODIFY THIS CODE, GENERATED AUTOMATICALLY<NEW_LINE>public static com.sun.jdi.Method method(com.sun.jdi.event.MethodExitEvent a) throws org.netbeans.modules.debugger.jpda.jdi.InternalExceptionWrapper, org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallStart("com.sun.jdi.event.MethodExitEvent", "method", "JDI CALL: com.sun.jdi.event.MethodExitEvent({0}).method()", new Object[] { a });<NEW_LINE>}<NEW_LINE>Object retValue = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>ret = a.method();<NEW_LINE>retValue = ret;<NEW_LINE>return ret;<NEW_LINE>} catch (com.sun.jdi.InternalException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.report(ex);<NEW_LINE>throw new org.netbeans.modules.debugger.jpda.jdi.InternalExceptionWrapper(ex);<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>if (a instanceof com.sun.jdi.Mirror) {<NEW_LINE>com.sun.jdi.VirtualMachine vm = ((com.sun.jdi.Mirror) a).virtualMachine();<NEW_LINE>try {<NEW_LINE>vm.dispose();<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException vmdex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper(ex);<NEW_LINE>} catch (Error err) {<NEW_LINE>retValue = err;<NEW_LINE>throw err;<NEW_LINE>} catch (RuntimeException rex) {<NEW_LINE>retValue = rex;<NEW_LINE>throw rex;<NEW_LINE>} finally {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallEnd("com.sun.jdi.event.MethodExitEvent", "method", retValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | com.sun.jdi.Method ret; |
1,120,281 | private void updateEntityClient() {<NEW_LINE>boolean markForUpdate = false;<NEW_LINE>if (clientUpdated) {<NEW_LINE>// TODO: This is not the correct solution here but just marking the block for a render update server side<NEW_LINE>// seems to get out of sync with the client sometimes so connections are not rendered correctly<NEW_LINE>markForUpdate = true;<NEW_LINE>clientUpdated = false;<NEW_LINE>}<NEW_LINE>FacadeRenderState curRS = getFacadeRenderedAs();<NEW_LINE>FacadeRenderState rs = ConduitUtil.getRequiredFacadeRenderState(this, NullHelper.notnull(EnderIO.proxy.getClientPlayer(), "Proxy#getClientPlayer"));<NEW_LINE>if (ConduitConfig.updateLightingWhenHidingFacades.get()) {<NEW_LINE>int shouldBeLO = rs == FacadeRenderState.FULL ? -1 : 0;<NEW_LINE>if (lightOpacityOverride != shouldBeLO) {<NEW_LINE>setLightOpacityOverride(shouldBeLO);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (curRS != rs) {<NEW_LINE>setFacadeRenderAs(rs);<NEW_LINE>if (!ConduitUtil.forceSkylightRecalculation(world, getPos())) {<NEW_LINE>markForUpdate = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ConduitDisplayMode curMode = ConduitDisplayMode.getDisplayMode(EnderIO.proxy.getClientPlayer().getHeldItemMainhand());<NEW_LINE>if (curMode != lastMode && !(lastMode.isAll() && curMode.isAll())) {<NEW_LINE>markForUpdate = true;<NEW_LINE>}<NEW_LINE>lastMode = curMode;<NEW_LINE>if (markForUpdate) {<NEW_LINE>updateBlock();<NEW_LINE>}<NEW_LINE>} | world.checkLight(getPos()); |
1,603,042 | private String recalculate() {<NEW_LINE>MProduct product = MProduct.get(<MASK><NEW_LINE>MAcctSchema as = MClient.get(getCtx()).getAcctSchema();<NEW_LINE>MCostType ct = MCostType.getByMethodCosting(as, as.getCostingMethod());<NEW_LINE>String costingLevel = product.getCostingLevel(as);<NEW_LINE>if (!as.getM_CostType().getCostingMethod().equals(MCostType.COSTINGMETHOD_StandardCosting))<NEW_LINE>return "";<NEW_LINE>int AD_Org_ID = costingLevel.equals(MAcctSchema.COSTINGLEVEL_Organization) ? getAD_Org_ID() : 0;<NEW_LINE>int M_Warehouse_ID = costingLevel.equals(MAcctSchema.COSTINGLEVEL_Warehouse) ? getM_Locator().getM_Warehouse_ID() : 0;<NEW_LINE>if (!as.getM_CostType().getCostingMethod().equals(MCostType.COSTINGMETHOD_StandardCosting))<NEW_LINE>return "";<NEW_LINE>ProcessInfo processInfo = ProcessBuilder.create(getCtx()).process(53062).withRecordId(MProduction.Table_ID, getM_Product_ID()).withParameter("C_AcctSchema_ID", as.getC_AcctSchema_ID()).withParameter("S_Resource_ID", as.getC_AcctSchema_ID()).withParameter("", as.getCostingMethod()).withParameter("M_CostType_ID", ct.getM_CostType_ID()).withParameter("ADOrg_ID", AD_Org_ID).withParameter("M_Warehouse_ID", M_Warehouse_ID).withParameter("CostingMethod", as.getCostingMethod()).withoutTransactionClose().execute(get_TrxName());<NEW_LINE>if (processInfo.isError())<NEW_LINE>throw new AdempiereException(processInfo.getSummary());<NEW_LINE>// Log<NEW_LINE>log.info(processInfo.getSummary());<NEW_LINE>return "";<NEW_LINE>} | getCtx(), getM_Product_ID()); |
449,093 | public void showHint(int color) {<NEW_LINE>final int[] screenPos = new int[2];<NEW_LINE>final Rect displayFrame = new Rect();<NEW_LINE>getLocationOnScreen(screenPos);<NEW_LINE>getWindowVisibleDisplayFrame(displayFrame);<NEW_LINE>final Context context = getContext();<NEW_LINE>final int width = getWidth();<NEW_LINE>final int height = getHeight();<NEW_LINE>final int midy = screenPos[1] + height / 2;<NEW_LINE>int referenceX = screenPos[0] + width / 2;<NEW_LINE>if (ViewCompat.getLayoutDirection(this) == ViewCompat.LAYOUT_DIRECTION_LTR) {<NEW_LINE>final int screenWidth = context.getResources<MASK><NEW_LINE>// mirror<NEW_LINE>referenceX = screenWidth - referenceX;<NEW_LINE>}<NEW_LINE>Toast cheatSheet = Toast.makeText(context, String.format("#%06X", 0xFFFFFF & color), Toast.LENGTH_SHORT);<NEW_LINE>if (midy < displayFrame.height()) {<NEW_LINE>// Show along the top; follow action buttons<NEW_LINE>cheatSheet.setGravity(Gravity.TOP | GravityCompat.END, referenceX, screenPos[1] + height - displayFrame.top);<NEW_LINE>} else {<NEW_LINE>// Show along the bottom center<NEW_LINE>cheatSheet.setGravity(Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL, 0, height);<NEW_LINE>}<NEW_LINE>cheatSheet.show();<NEW_LINE>} | ().getDisplayMetrics().widthPixels; |
1,374,936 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>MageObject sourceObject = game.getObject(source);<NEW_LINE>Integer life = (<MASK><NEW_LINE>if (controller != null && sourceObject != null && life != null) {<NEW_LINE>for (Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) {<NEW_LINE>if (permanent != null && permanent.isCreature(game)) {<NEW_LINE>permanent.addCounters(CounterType.P1P1.createInstance(life), source.getControllerId(), source, game);<NEW_LINE>if (!game.isSimulation()) {<NEW_LINE>game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " puts " + life + " +1/+1 counters on " + permanent.getLogName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | Integer) this.getValue("gainedLife"); |
1,580,406 | final DescribeConfigRuleEvaluationStatusResult executeDescribeConfigRuleEvaluationStatus(DescribeConfigRuleEvaluationStatusRequest describeConfigRuleEvaluationStatusRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeConfigRuleEvaluationStatusRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeConfigRuleEvaluationStatusRequest> request = null;<NEW_LINE>Response<DescribeConfigRuleEvaluationStatusResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeConfigRuleEvaluationStatusRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeConfigRuleEvaluationStatusRequest));<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, "DescribeConfigRuleEvaluationStatus");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeConfigRuleEvaluationStatusResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeConfigRuleEvaluationStatusResultJsonUnmarshaller());<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, "Config Service"); |
665,235 | public BackupDTO backupWorkDirectory(List<String> options) {<NEW_LINE>if (CollectionUtils.isEmpty(options)) {<NEW_LINE>throw new BadRequestException("The options parameter is missing, at least one.");<NEW_LINE>}<NEW_LINE>// Zip work directory to temporary file<NEW_LINE>try {<NEW_LINE>// Create zip path for halo zip<NEW_LINE>String haloZipFileName = HALO_BACKUP_PREFIX + DateTimeUtils.format(LocalDateTime.now(), HORIZONTAL_LINE_DATETIME_FORMATTER) + HaloUtils.simpleUUID().hashCode() + ".zip";<NEW_LINE>// Create halo zip file<NEW_LINE>Path haloZipFilePath = Paths.get(<MASK><NEW_LINE>if (!Files.exists(haloZipFilePath.getParent())) {<NEW_LINE>Files.createDirectories(haloZipFilePath.getParent());<NEW_LINE>}<NEW_LINE>Path haloZipPath = Files.createFile(haloZipFilePath);<NEW_LINE>// Zip halo<NEW_LINE>run.halo.app.utils.FileUtils.zip(Paths.get(this.haloProperties.getWorkDir()), haloZipPath, path -> {<NEW_LINE>for (String itemToBackup : options) {<NEW_LINE>Path backupItemPath = Paths.get(this.haloProperties.getWorkDir()).resolve(itemToBackup);<NEW_LINE>if (path.startsWith(backupItemPath)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>});<NEW_LINE>// Build backup dto<NEW_LINE>return buildBackupDto(BACKUP_RESOURCE_BASE_URI, haloZipPath);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new ServiceException("Failed to backup halo", e);<NEW_LINE>}<NEW_LINE>} | haloProperties.getBackupDir(), haloZipFileName); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.