idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
994,910 | private void deleteDatabaseFile(String fileName) {<NEW_LINE>if (fileName.equalsIgnoreCase(":memory:") || fileName.trim().length() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Log.e(TAG, "Remove database file: " + fileName);<NEW_LINE>if (!mNoCorruptionBackup) {<NEW_LINE>// Save corrupted database for recovery.<NEW_LINE>File originFile = new File(fileName);<NEW_LINE>File corruptedDir = new File(<MASK><NEW_LINE>if (!corruptedDir.mkdirs()) {<NEW_LINE>Log.e(TAG, "Could not create directory for corrupted database. " + "Corruption backup may be unavailable.");<NEW_LINE>}<NEW_LINE>String corruptedPath = corruptedDir.getPath() + "/" + originFile.getName();<NEW_LINE>for (String suffix : SUFFIX_TO_BACKUP) {<NEW_LINE>moveOrDeleteFile(fileName + suffix, corruptedPath + suffix);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (String suffix : SUFFIX_TO_BACKUP) {<NEW_LINE>deleteFile(fileName + suffix);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | originFile.getParentFile(), "corrupted"); |
404,959 | final ModifyTrafficMirrorFilterNetworkServicesResult executeModifyTrafficMirrorFilterNetworkServices(ModifyTrafficMirrorFilterNetworkServicesRequest modifyTrafficMirrorFilterNetworkServicesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(modifyTrafficMirrorFilterNetworkServicesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ModifyTrafficMirrorFilterNetworkServicesRequest> request = null;<NEW_LINE>Response<ModifyTrafficMirrorFilterNetworkServicesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ModifyTrafficMirrorFilterNetworkServicesRequestMarshaller().marshall(super.beforeMarshalling(modifyTrafficMirrorFilterNetworkServicesRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ModifyTrafficMirrorFilterNetworkServices");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ModifyTrafficMirrorFilterNetworkServicesResult> responseHandler = new StaxResponseHandler<<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>} | ModifyTrafficMirrorFilterNetworkServicesResult>(new ModifyTrafficMirrorFilterNetworkServicesResultStaxUnmarshaller()); |
1,068,511 | public final Conditional_expressionContext conditional_expression() throws RecognitionException {<NEW_LINE>Conditional_expressionContext _localctx = new Conditional_expressionContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 46, RULE_conditional_expression);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(213);<NEW_LINE>conditional_term();<NEW_LINE>setState(218);<NEW_LINE>_errHandler.sync(this);<NEW_LINE><MASK><NEW_LINE>while (_la == T__19) {<NEW_LINE>{<NEW_LINE>{<NEW_LINE>setState(214);<NEW_LINE>match(T__19);<NEW_LINE>setState(215);<NEW_LINE>conditional_term();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(220);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>} | _la = _input.LA(1); |
663,979 | public static ListMcubeNebulaTasksResponse unmarshall(ListMcubeNebulaTasksResponse listMcubeNebulaTasksResponse, UnmarshallerContext _ctx) {<NEW_LINE>listMcubeNebulaTasksResponse.setRequestId(_ctx.stringValue("ListMcubeNebulaTasksResponse.RequestId"));<NEW_LINE>listMcubeNebulaTasksResponse.setResultMessage(_ctx.stringValue("ListMcubeNebulaTasksResponse.ResultMessage"));<NEW_LINE>listMcubeNebulaTasksResponse.setResultCode(_ctx.stringValue("ListMcubeNebulaTasksResponse.ResultCode"));<NEW_LINE>ListMcubeNebulaTaskResult listMcubeNebulaTaskResult = new ListMcubeNebulaTaskResult();<NEW_LINE>listMcubeNebulaTaskResult.setRequestId(_ctx.stringValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.RequestId"));<NEW_LINE>listMcubeNebulaTaskResult.setErrorCode(_ctx.stringValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.ErrorCode"));<NEW_LINE>listMcubeNebulaTaskResult.setSuccess(_ctx.booleanValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.Success"));<NEW_LINE>listMcubeNebulaTaskResult.setResultMsg(_ctx.stringValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.ResultMsg"));<NEW_LINE>List<NebulaTaskInfoItem> nebulaTaskInfo = new ArrayList<NebulaTaskInfoItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo.Length"); i++) {<NEW_LINE>NebulaTaskInfoItem nebulaTaskInfoItem = new NebulaTaskInfoItem();<NEW_LINE>nebulaTaskInfoItem.setStatus(_ctx.integerValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].Status"));<NEW_LINE>nebulaTaskInfoItem.setPercent(_ctx.integerValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].Percent"));<NEW_LINE>nebulaTaskInfoItem.setPublishMode(_ctx.integerValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].PublishMode"));<NEW_LINE>nebulaTaskInfoItem.setTaskName(_ctx.stringValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].TaskName"));<NEW_LINE>nebulaTaskInfoItem.setGreyEndtime(_ctx.stringValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].GreyEndtime"));<NEW_LINE>nebulaTaskInfoItem.setGmtModified(_ctx.stringValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].GmtModified"));<NEW_LINE>nebulaTaskInfoItem.setGreyEndtimeStr(_ctx.stringValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].GreyEndtimeStr"));<NEW_LINE>nebulaTaskInfoItem.setCreator(_ctx.stringValue<MASK><NEW_LINE>nebulaTaskInfoItem.setBizType(_ctx.stringValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].BizType"));<NEW_LINE>nebulaTaskInfoItem.setTaskType(_ctx.integerValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].TaskType"));<NEW_LINE>nebulaTaskInfoItem.setModifier(_ctx.stringValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].Modifier"));<NEW_LINE>nebulaTaskInfoItem.setPlatform(_ctx.stringValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].Platform"));<NEW_LINE>nebulaTaskInfoItem.setProductId(_ctx.stringValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].ProductId"));<NEW_LINE>nebulaTaskInfoItem.setReleaseVersion(_ctx.stringValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].ReleaseVersion"));<NEW_LINE>nebulaTaskInfoItem.setGmtModifiedStr(_ctx.stringValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].GmtModifiedStr"));<NEW_LINE>nebulaTaskInfoItem.setTaskVersion(_ctx.longValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].TaskVersion"));<NEW_LINE>nebulaTaskInfoItem.setUpgradeNoticeNum(_ctx.longValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].UpgradeNoticeNum"));<NEW_LINE>nebulaTaskInfoItem.setAppCode(_ctx.stringValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].AppCode"));<NEW_LINE>nebulaTaskInfoItem.setMemo(_ctx.stringValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].Memo"));<NEW_LINE>nebulaTaskInfoItem.setGreyConfigInfo(_ctx.stringValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].GreyConfigInfo"));<NEW_LINE>nebulaTaskInfoItem.setGreyNum(_ctx.integerValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].GreyNum"));<NEW_LINE>nebulaTaskInfoItem.setProductVersion(_ctx.stringValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].ProductVersion"));<NEW_LINE>nebulaTaskInfoItem.setGreyEndtimeData(_ctx.stringValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].GreyEndtimeData"));<NEW_LINE>nebulaTaskInfoItem.setPublishType(_ctx.integerValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].PublishType"));<NEW_LINE>nebulaTaskInfoItem.setGreyUrl(_ctx.stringValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].GreyUrl"));<NEW_LINE>nebulaTaskInfoItem.setTaskStatus(_ctx.integerValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].TaskStatus"));<NEW_LINE>nebulaTaskInfoItem.setSyncResult(_ctx.stringValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].SyncResult"));<NEW_LINE>nebulaTaskInfoItem.setWhitelistIds(_ctx.stringValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].WhitelistIds"));<NEW_LINE>nebulaTaskInfoItem.setGmtCreate(_ctx.stringValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].GmtCreate"));<NEW_LINE>nebulaTaskInfoItem.setPackageId(_ctx.longValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].PackageId"));<NEW_LINE>nebulaTaskInfoItem.setUpgradeProgress(_ctx.stringValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].UpgradeProgress"));<NEW_LINE>nebulaTaskInfoItem.setId(_ctx.longValue("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].Id"));<NEW_LINE>nebulaTaskInfo.add(nebulaTaskInfoItem);<NEW_LINE>}<NEW_LINE>listMcubeNebulaTaskResult.setNebulaTaskInfo(nebulaTaskInfo);<NEW_LINE>listMcubeNebulaTasksResponse.setListMcubeNebulaTaskResult(listMcubeNebulaTaskResult);<NEW_LINE>return listMcubeNebulaTasksResponse;<NEW_LINE>} | ("ListMcubeNebulaTasksResponse.ListMcubeNebulaTaskResult.NebulaTaskInfo[" + i + "].Creator")); |
452,149 | final DeleteTimeSeriesResult executeDeleteTimeSeries(DeleteTimeSeriesRequest deleteTimeSeriesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteTimeSeriesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteTimeSeriesRequest> request = null;<NEW_LINE>Response<DeleteTimeSeriesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteTimeSeriesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteTimeSeriesRequest));<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, "IoTSiteWise");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteTimeSeries");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>String hostPrefix = "api.";<NEW_LINE>String <MASK><NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteTimeSeriesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteTimeSeriesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | resolvedHostPrefix = String.format("api."); |
6,350 | private int writeStartupSection() {<NEW_LINE>int utDataHeaderPos = headerBytes.position();<NEW_LINE>// header; * Eyecatcher, version etc<NEW_LINE>int offset = writeUtDataHeader("XXXX", 0xDEADBEEF);<NEW_LINE>// #define UT_TRACE_STARTUP_SECTION_NAME "UTSO"<NEW_LINE>// struct utStartupSection {<NEW_LINE>// UtDataHeader header; /* Eyecatcher, version etc */<NEW_LINE>// char options[1]; /* Startup options */<NEW_LINE>// };<NEW_LINE>try {<NEW_LINE>// options<NEW_LINE>headerBytes.put(startupOptions.getBytes("UTF-8"));<NEW_LINE>// null terminate.<NEW_LINE>headerBytes.put(new byte[] { (byte) 0 });<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>// UTF-8 will be supported.<NEW_LINE>}<NEW_LINE>int length = headerBytes.position() - utDataHeaderPos;<NEW_LINE>// Now re-write the header at position 0 with the right length.<NEW_LINE>headerBytes.position(utDataHeaderPos);<NEW_LINE>writeUtDataHeader("UTSO", length);<NEW_LINE><MASK><NEW_LINE>return length;<NEW_LINE>} | headerBytes.position(utDataHeaderPos + length); |
383,784 | public static DescribeNvrDevicesResponse unmarshall(DescribeNvrDevicesResponse describeNvrDevicesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeNvrDevicesResponse.setRequestId(_ctx.stringValue("DescribeNvrDevicesResponse.RequestId"));<NEW_LINE>describeNvrDevicesResponse.setCode(_ctx.stringValue("DescribeNvrDevicesResponse.Code"));<NEW_LINE>describeNvrDevicesResponse.setMessage(_ctx.stringValue("DescribeNvrDevicesResponse.Message"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNum(_ctx.longValue("DescribeNvrDevicesResponse.Data.PageNum"));<NEW_LINE>data.setPageSize(_ctx.longValue("DescribeNvrDevicesResponse.Data.PageSize"));<NEW_LINE>data.setTotalCount(_ctx.longValue("DescribeNvrDevicesResponse.Data.TotalCount"));<NEW_LINE>data.setTotalPage(_ctx.longValue("DescribeNvrDevicesResponse.Data.TotalPage"));<NEW_LINE>List<RecordsItem> records = new ArrayList<RecordsItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeNvrDevicesResponse.Data.Records.Length"); i++) {<NEW_LINE>RecordsItem recordsItem = new RecordsItem();<NEW_LINE>recordsItem.setChannel(_ctx.stringValue("DescribeNvrDevicesResponse.Data.Records[" + i + "].Channel"));<NEW_LINE>recordsItem.setCorpId(_ctx.stringValue<MASK><NEW_LINE>recordsItem.setDatasourceType(_ctx.stringValue("DescribeNvrDevicesResponse.Data.Records[" + i + "].DatasourceType"));<NEW_LINE>recordsItem.setDeviceId(_ctx.stringValue("DescribeNvrDevicesResponse.Data.Records[" + i + "].DeviceId"));<NEW_LINE>recordsItem.setDeviceName(_ctx.stringValue("DescribeNvrDevicesResponse.Data.Records[" + i + "].DeviceName"));<NEW_LINE>recordsItem.setDeviceSn(_ctx.stringValue("DescribeNvrDevicesResponse.Data.Records[" + i + "].DeviceSn"));<NEW_LINE>recordsItem.setDeviceStatus(_ctx.stringValue("DescribeNvrDevicesResponse.Data.Records[" + i + "].DeviceStatus"));<NEW_LINE>recordsItem.setDeviceType(_ctx.stringValue("DescribeNvrDevicesResponse.Data.Records[" + i + "].DeviceType"));<NEW_LINE>recordsItem.setCreateTime(_ctx.stringValue("DescribeNvrDevicesResponse.Data.Records[" + i + "].CreateTime"));<NEW_LINE>recordsItem.setModifyTime(_ctx.stringValue("DescribeNvrDevicesResponse.Data.Records[" + i + "].ModifyTime"));<NEW_LINE>recordsItem.setDeviceModel(_ctx.stringValue("DescribeNvrDevicesResponse.Data.Records[" + i + "].DeviceModel"));<NEW_LINE>recordsItem.setProjectName(_ctx.stringValue("DescribeNvrDevicesResponse.Data.Records[" + i + "].ProjectName"));<NEW_LINE>recordsItem.setRegionName(_ctx.stringValue("DescribeNvrDevicesResponse.Data.Records[" + i + "].RegionName"));<NEW_LINE>records.add(recordsItem);<NEW_LINE>}<NEW_LINE>data.setRecords(records);<NEW_LINE>describeNvrDevicesResponse.setData(data);<NEW_LINE>return describeNvrDevicesResponse;<NEW_LINE>} | ("DescribeNvrDevicesResponse.Data.Records[" + i + "].CorpId")); |
961,511 | final ListSubscriptionDefinitionVersionsResult executeListSubscriptionDefinitionVersions(ListSubscriptionDefinitionVersionsRequest listSubscriptionDefinitionVersionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listSubscriptionDefinitionVersionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListSubscriptionDefinitionVersionsRequest> request = null;<NEW_LINE>Response<ListSubscriptionDefinitionVersionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListSubscriptionDefinitionVersionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listSubscriptionDefinitionVersionsRequest));<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, "Greengrass");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListSubscriptionDefinitionVersions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListSubscriptionDefinitionVersionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListSubscriptionDefinitionVersionsResultJsonUnmarshaller());<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,847,958 | public <T extends Object> Map<String, Object> checkForRequiredParameters(String endpoint, @Sensitive Map<String, T> responseValues, String... requiredParams) {<NEW_LINE>if (responseValues == null) {<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "The provided response values map is null, so all required parameters will be determined to be missing");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<String> missingParams <MASK><NEW_LINE>for (String param : requiredParams) {<NEW_LINE>if (responseValues == null || !responseValues.containsKey(param)) {<NEW_LINE>missingParams.add(param);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!missingParams.isEmpty()) {<NEW_LINE>return createErrorResponse("TWITTER_RESPONSE_MISSING_PARAMETER", new Object[] { endpoint, Arrays.toString(missingParams.toArray(new String[0])) });<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | = new ArrayList<String>(); |
1,643,006 | public void afterHookedMethod(XC_MethodHook.MethodHookParam param) {<NEW_LINE>RelativeLayout baseChatItemLayout = (RelativeLayout) param.args[3];<NEW_LINE>ImageView imageView = baseChatItemLayout.findViewById(baseChatItemLayout.getResources().getIdentifier("cfx", "id", HostInfo.getPackageName()));<NEW_LINE>ImageView imageView2 = baseChatItemLayout.findViewById(baseChatItemLayout.getResources().getIdentifier("cfw", "id", HostInfo.getPackageName()));<NEW_LINE>Bitmap repeat = RepeaterIconSettingDialog.getRepeaterIcon();<NEW_LINE>imageView.setImageBitmap(repeat);<NEW_LINE>imageView2.setImageBitmap(repeat);<NEW_LINE>final AppRuntime app = getFirstNSFByType(param.thisObject, _QQAppInterface());<NEW_LINE>final Parcelable session = getFirstNSFByType(<MASK><NEW_LINE>final Object msg = param.args[0];<NEW_LINE>View.OnClickListener r0 = v -> {<NEW_LINE>try {<NEW_LINE>ChatActivityFacade.repeatMessage(app, session, msg);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>traceError(e);<NEW_LINE>Toasts.error(HostInfo.getApplication(), e.toString());<NEW_LINE>}<NEW_LINE>};<NEW_LINE>imageView.setOnClickListener(r0);<NEW_LINE>imageView2.setOnClickListener(r0);<NEW_LINE>} | param.thisObject, _SessionInfo()); |
858,580 | public DoubleMatrix differentiateCross(PiecewisePolynomialResult2D pp, double[] x0Keys, double[] x1Keys) {<NEW_LINE>ArgChecker.notNull(pp, "pp");<NEW_LINE>int order0 = pp.getOrder()[0];<NEW_LINE>int order1 = pp.getOrder()[1];<NEW_LINE>ArgChecker.isFalse(order0 < 2, "polynomial degree of x0 < 1");<NEW_LINE>ArgChecker.isFalse(order1 < 2, "polynomial degree of x1 < 1");<NEW_LINE>DoubleArray knots0 = pp.getKnots0();<NEW_LINE>DoubleArray knots1 = pp.getKnots1();<NEW_LINE>int nKnots0 = knots0.size();<NEW_LINE>int nKnots1 = knots1.size();<NEW_LINE>DoubleMatrix[][] coefs = pp.getCoefs();<NEW_LINE>DoubleMatrix[][] res = <MASK><NEW_LINE>for (int i = 0; i < nKnots0 - 1; ++i) {<NEW_LINE>for (int j = 0; j < nKnots1 - 1; ++j) {<NEW_LINE>DoubleMatrix coef = coefs[i][j];<NEW_LINE>res[i][j] = DoubleMatrix.of(order0 - 1, order1 - 1, (k, l) -> coef.get(k, l) * (order1 - l - 1) * (order0 - k - 1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>PiecewisePolynomialResult2D ppDiff = new PiecewisePolynomialResult2D(knots0, knots1, res, new int[] { order0 - 1, order1 - 1 });<NEW_LINE>return evaluate(ppDiff, x0Keys, x1Keys);<NEW_LINE>} | new DoubleMatrix[nKnots0][nKnots1]; |
367,213 | static double supportCorners(int width, int height, int[] mask, Vector2d dir) {<NEW_LINE>double maxValue = -Double.MAX_VALUE;<NEW_LINE>double centerX = width / 2.0;<NEW_LINE>double centerY = height / 2.0;<NEW_LINE>Vector2d p = new Vector2d();<NEW_LINE>for (int y = height - 1; y >= 0; --y) {<NEW_LINE>for (int x = 0; x < width; ++x) {<NEW_LINE>if (mask[x + (height - y - 1) * width] != 0) {<NEW_LINE>p.x = x + 0 - centerX;<NEW_LINE>p.y = y + 0 - centerY;<NEW_LINE>maxValue = Math.max(maxValue, p.dot(dir));<NEW_LINE>p.x = x + 1 - centerX;<NEW_LINE>p.y = y + 0 - centerY;<NEW_LINE>maxValue = Math.max(maxValue, p.dot(dir));<NEW_LINE>p.x = x + 1 - centerX;<NEW_LINE>p.y = y + 1 - centerY;<NEW_LINE>maxValue = Math.max(maxValue, p.dot(dir));<NEW_LINE>p.x = x + 0 - centerX;<NEW_LINE>p<MASK><NEW_LINE>maxValue = Math.max(maxValue, p.dot(dir));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return maxValue;<NEW_LINE>} | .y = y + 1 - centerY; |
358,124 | private Object queryByRaft(Object query, boolean safeRead, Function<Object, Object> func) {<NEW_LINE>if (!safeRead) {<NEW_LINE>return func.apply(query);<NEW_LINE>}<NEW_LINE>RaftClosure<Object> future = new RaftClosure<>();<NEW_LINE>ReadIndexClosure readIndexClosure = new ReadIndexClosure() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(Status status, long index, byte[] reqCtx) {<NEW_LINE>if (status.isOk()) {<NEW_LINE>future.complete(status, () -> func.apply(query));<NEW_LINE>} else {<NEW_LINE>future.failure(status, new BackendException("Failed to do raft read-index: %s", status));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>this.node().node().<MASK><NEW_LINE>try {<NEW_LINE>return future.waitFinished();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>LOG.warn("Failed to execute query '{}': {}", query, future.status(), e);<NEW_LINE>throw new BackendException("Failed to execute query: %s", e, query);<NEW_LINE>}<NEW_LINE>} | readIndex(BytesUtil.EMPTY_BYTES, readIndexClosure); |
333,710 | public static boolean packJar(String folderName, String jarName, String prefix) {<NEW_LINE>jarName = FileManager.slashify(jarName, false);<NEW_LINE>if (!jarName.endsWith(".jar")) {<NEW_LINE>jarName += ".jar";<NEW_LINE>}<NEW_LINE>folderName = FileManager.slashify(folderName, true);<NEW_LINE>if (!(new File(folderName)).isDirectory()) {<NEW_LINE>log(-1, "packJar: not a directory or does not exist: " + folderName);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>File dir = new File((new File(jarName)).getAbsolutePath()).getParentFile();<NEW_LINE>if (dir != null) {<NEW_LINE>if (!dir.exists()) {<NEW_LINE>dir.mkdirs();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new Exception("workdir is null");<NEW_LINE>}<NEW_LINE>log(lvl, "packJar: %s from %s in workDir %s", jarName, folderName, dir.getAbsolutePath());<NEW_LINE>if (!folderName.startsWith("http://") && !folderName.startsWith("https://")) {<NEW_LINE>folderName = "file://" + (new File(folderName)).getAbsolutePath();<NEW_LINE>}<NEW_LINE>URL src = new URL(folderName);<NEW_LINE>JarOutputStream jout = new JarOutputStream(new FileOutputStream(jarName));<NEW_LINE>addToJar(jout, new File(src<MASK><NEW_LINE>jout.close();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>log(-1, "packJar: " + ex.getMessage());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>log(lvl, "packJar: completed");<NEW_LINE>return true;<NEW_LINE>} | .getFile()), prefix); |
388,440 | private void writeAnswer(String[] strs, String clAnswer, Distribution<String> cntr) {<NEW_LINE>String goldAnswer = globalFlags.goldAnswerColumn < strs.length ? strs[globalFlags.goldAnswerColumn] : "";<NEW_LINE>String printedText = "";<NEW_LINE>if (globalFlags.displayedColumn >= 0) {<NEW_LINE>printedText = strs[globalFlags.displayedColumn];<NEW_LINE>}<NEW_LINE>String results;<NEW_LINE>if (globalFlags.displayAllAnswers) {<NEW_LINE>// sort the labels by probability<NEW_LINE>TreeSet<Pair<Double, String>> <MASK><NEW_LINE>for (String key : cntr.keySet()) {<NEW_LINE>sortedLabels.add(new Pair<>(cntr.probabilityOf(key), key));<NEW_LINE>}<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>for (Pair<Double, String> pair : sortedLabels.descendingSet()) {<NEW_LINE>if (builder.length() > 0) {<NEW_LINE>builder.append('\t');<NEW_LINE>}<NEW_LINE>builder.append(pair.first()).append('\t').append(pair.second());<NEW_LINE>}<NEW_LINE>results = builder.toString();<NEW_LINE>} else {<NEW_LINE>results = clAnswer + '\t' + nf.format(cntr.probabilityOf(clAnswer)) + '\t' + nf.format(cntr.probabilityOf(goldAnswer));<NEW_LINE>}<NEW_LINE>String line;<NEW_LINE>if (printedText.isEmpty()) {<NEW_LINE>line = goldAnswer + '\t' + results;<NEW_LINE>} else {<NEW_LINE>line = printedText + '\t' + goldAnswer + '\t' + results;<NEW_LINE>}<NEW_LINE>System.out.println(line);<NEW_LINE>} | sortedLabels = new TreeSet<>(); |
1,700,168 | protected void configure() {<NEW_LINE>install(new MessagingBinders.MessageBodyProviders(clientRuntimeProperties, RuntimeType.CLIENT)<MASK><NEW_LINE>bindFactory(ReferencingFactory.referenceFactory()).to(new GenericType<Ref<ClientConfig>>() {<NEW_LINE>}).in(RequestScoped.class);<NEW_LINE>bindFactory(RequestContextInjectionFactory.class).to(ClientRequest.class).in(RequestScoped.class);<NEW_LINE>bindFactory(RequestContextInjectionFactory.class).to(HttpHeaders.class).proxy(true).proxyForSameScope(false).in(RequestScoped.class);<NEW_LINE>bindFactory(ReferencingFactory.referenceFactory()).to(new GenericType<Ref<ClientRequest>>() {<NEW_LINE>}).in(RequestScoped.class);<NEW_LINE>bindFactory(PropertiesDelegateFactory.class, Singleton.class).to(PropertiesDelegate.class).in(RequestScoped.class);<NEW_LINE>// ChunkedInput entity support<NEW_LINE>bind(ChunkedInputReader.class).to(MessageBodyReader.class).in(Singleton.class);<NEW_LINE>} | , new MessagingBinders.HeaderDelegateProviders()); |
601,993 | public Entity add(PersistencePackage persistencePackage, DynamicEntityDao dynamicEntityDao, RecordHelper helper) throws ServiceException {<NEW_LINE>Entity entity = persistencePackage.getEntity();<NEW_LINE>try {<NEW_LINE>// Get an instance of SystemProperty with the updated values from the form<NEW_LINE>PersistencePerspective persistencePerspective = persistencePackage.getPersistencePerspective();<NEW_LINE>SystemProperty adminInstance = (SystemProperty) Class.forName(entity.getType()[0]).newInstance();<NEW_LINE>Map<String, FieldMetadata> adminProperties = helper.getSimpleMergedProperties(SystemProperty.class.getName(), persistencePerspective);<NEW_LINE>adminInstance = (SystemProperty) helper.createPopulatedInstance(adminInstance, entity, adminProperties, false);<NEW_LINE>// Verify that the value entered matches up with the type of this property<NEW_LINE>Entity errorEntity = validateTypeAndValueCombo(adminInstance);<NEW_LINE>if (errorEntity != null) {<NEW_LINE>entity.<MASK><NEW_LINE>return entity;<NEW_LINE>}<NEW_LINE>adminInstance = (SystemProperty) dynamicEntityDao.merge(adminInstance);<NEW_LINE>// Fill out the DTO and add in the product option value properties to it<NEW_LINE>return helper.getRecord(adminProperties, adminInstance, null, null);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ServiceException("Unable to perform fetch for entity: " + SystemProperty.class.getName(), e);<NEW_LINE>}<NEW_LINE>} | setPropertyValidationErrors(errorEntity.getPropertyValidationErrors()); |
885,883 | private void handleIndexAsTarget(OSelectExecutionPlan result, OIndexIdentifier indexIdentifier, OCommandContext ctx, boolean profilingEnabled) {<NEW_LINE><MASK><NEW_LINE>final ODatabaseDocumentInternal database = (ODatabaseDocumentInternal) ctx.getDatabase();<NEW_LINE>OIndex index = database.getMetadata().getIndexManagerInternal().getIndex(database, indexName);<NEW_LINE>if (index == null) {<NEW_LINE>throw new OCommandExecutionException("Index not found: " + indexName);<NEW_LINE>}<NEW_LINE>switch(indexIdentifier.getType()) {<NEW_LINE>case INDEX:<NEW_LINE>if (!index.supportsOrderedIterations()) {<NEW_LINE>throw new OCommandExecutionException("Index " + indexName + " does not allow iteration without a condition");<NEW_LINE>}<NEW_LINE>result.chain(new FetchFromIndexStep(index, null, null, ctx, profilingEnabled));<NEW_LINE>result.chain(new GetValueFromIndexEntryStep(ctx, null, profilingEnabled));<NEW_LINE>break;<NEW_LINE>case VALUES:<NEW_LINE>case VALUESASC:<NEW_LINE>if (!index.supportsOrderedIterations()) {<NEW_LINE>throw new OCommandExecutionException("Index " + indexName + " does not allow iteration on values");<NEW_LINE>}<NEW_LINE>result.chain(new FetchFromIndexValuesStep(index, true, ctx, profilingEnabled));<NEW_LINE>result.chain(new GetValueFromIndexEntryStep(ctx, null, profilingEnabled));<NEW_LINE>break;<NEW_LINE>case VALUESDESC:<NEW_LINE>if (!index.supportsOrderedIterations()) {<NEW_LINE>throw new OCommandExecutionException("Index " + indexName + " does not allow iteration on values");<NEW_LINE>}<NEW_LINE>result.chain(new FetchFromIndexValuesStep(index, false, ctx, profilingEnabled));<NEW_LINE>result.chain(new GetValueFromIndexEntryStep(ctx, null, profilingEnabled));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | String indexName = indexIdentifier.getIndexName(); |
1,763,610 | private void init() {<NEW_LINE>// WARNING: called from ctor so must not be overridden (i.e. must be private or final)<NEW_LINE>// $NON-NLS-1$<NEW_LINE>parameterPanel = new ArgumentsPanel(true, JMeterUtils.getResString("function_params"));<NEW_LINE>initializeFunctionList();<NEW_LINE>this.getContentPane().setLayout(new BorderLayout(10, 10));<NEW_LINE>JPanel comboPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));<NEW_LINE>comboPanel.add(functionList);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>JButton helpButton = new JButton(JMeterUtils.getResString("help"));<NEW_LINE>helpButton.addActionListener(new HelpListener());<NEW_LINE>comboPanel.add(helpButton);<NEW_LINE>this.getContentPane().add(comboPanel, BorderLayout.NORTH);<NEW_LINE>this.getContentPane().add(parameterPanel, BorderLayout.CENTER);<NEW_LINE>JPanel resultsPanel = new JPanel(new MigLayout("fillx, wrap 2", "[][fill,grow]"));<NEW_LINE>JPanel generatePanel = new JPanel(new FlowLayout(FlowLayout.CENTER));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>cutPasteFunction = new JLabeledTextField(JMeterUtils.getResString("cut_paste_function"), 35, null, false);<NEW_LINE>cutPasteFunction.setEnabled(false);<NEW_LINE>generatePanel.add(cutPasteFunction);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>JButton generateButton = new JButton(JMeterUtils.getResString("generate"));<NEW_LINE>generateButton.setActionCommand(GENERATE);<NEW_LINE>generateButton.addActionListener(this);<NEW_LINE>generatePanel.add(generateButton);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>JButton resetVarsButton = new JButton(JMeterUtils.getResString("function_helper_reset_vars"));<NEW_LINE>resetVarsButton.setActionCommand(RESET_VARS);<NEW_LINE>resetVarsButton.addActionListener(this);<NEW_LINE>generatePanel.add(resetVarsButton);<NEW_LINE>resultTextArea = JSyntaxTextArea.getInstance(5, 60);<NEW_LINE>resultTextArea.setEditable(false);<NEW_LINE>resultTextArea.setToolTipText(JMeterUtils.getResString("function_helper_dialog_result_warn"));<NEW_LINE>variablesTextArea = JSyntaxTextArea.getInstance(10, 60);<NEW_LINE>variablesTextArea.setEditable(false);<NEW_LINE>resultsPanel.add(generatePanel, "span 2");<NEW_LINE>JTextScrollPane resultTextAreaJSP = JTextScrollPane.getInstance(resultTextArea);<NEW_LINE>resultsPanel.add(JMeterUtils.labelFor(resultTextAreaJSP, "result_function"));<NEW_LINE>resultsPanel.add(resultTextAreaJSP);<NEW_LINE>JTextScrollPane variablesTextAreaJSP = JTextScrollPane.getInstance(variablesTextArea);<NEW_LINE>resultsPanel.add(JMeterUtils<MASK><NEW_LINE>resultsPanel.add(variablesTextAreaJSP);<NEW_LINE>this.getContentPane().add(resultsPanel, BorderLayout.SOUTH);<NEW_LINE>this.pack();<NEW_LINE>ComponentUtil.centerComponentInWindow(this);<NEW_LINE>} | .labelFor(variablesTextAreaJSP, "function_helper_dialog_variables")); |
1,763,573 | // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>private void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>introLabel = new javax.swing.JLabel();<NEW_LINE>explanation = new javax.swing.JTextArea();<NEW_LINE>selectLabel = new javax.swing.JLabel();<NEW_LINE>selectCombo = new javax.swing.JComboBox();<NEW_LINE>setLayout(new java.awt.GridBagLayout());<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(introLabel, org.openide.util.NbBundle.getMessage(UnboundTargetAlert.class, "UTA_LBL_intro", label));<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridwidth = 2;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(0, 0, 12, 0);<NEW_LINE>add(introLabel, gridBagConstraints);<NEW_LINE>explanation.setBackground(javax.swing.UIManager.getDefaults().getColor("Label.background"));<NEW_LINE>explanation.setEditable(false);<NEW_LINE>explanation.setLineWrap(true);<NEW_LINE>// NOI18N<NEW_LINE>explanation.setText(org.openide.util.NbBundle.getMessage(UnboundTargetAlert<MASK><NEW_LINE>explanation.setWrapStyleWord(true);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 1;<NEW_LINE>gridBagConstraints.gridwidth = 2;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(0, 0, 12, 0);<NEW_LINE>add(explanation, gridBagConstraints);<NEW_LINE>// NOI18N<NEW_LINE>explanation.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(UnboundTargetAlert.class, "ASCN_UTA_TEXT_explanation", label));<NEW_LINE>// NOI18N<NEW_LINE>explanation.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(UnboundTargetAlert.class, "ASCD_UTA_TEXT_explanation", label));<NEW_LINE>selectLabel.setLabelFor(selectCombo);<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(selectLabel, org.openide.util.NbBundle.getMessage(UnboundTargetAlert.class, "UTA_LBL_select", label));<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 2;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 6);<NEW_LINE>add(selectLabel, gridBagConstraints);<NEW_LINE>selectCombo.setEditable(true);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 1;<NEW_LINE>gridBagConstraints.gridy = 2;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;<NEW_LINE>add(selectCombo, gridBagConstraints);<NEW_LINE>} | .class, "UTA_TEXT_explanation", label)); |
1,533,364 | private void processPurgeMapTiles(DynmapWorld world, MapType map, ImageVariant var) {<NEW_LINE>String basekey = prefix + "tiles/" + world.getName() + "/" + map.getPrefix() + var.variantSuffix + "/";<NEW_LINE>ListObjectsV2Request req = ListObjectsV2Request.builder().bucketName(bucketname).prefix(basekey).delimiter("").maxKeys(1000).encodingType("url").requestPayer("requester").build();<NEW_LINE>S3Client s3 = getConnection();<NEW_LINE>try {<NEW_LINE>boolean done = false;<NEW_LINE>while (!done) {<NEW_LINE>ListObjectsV2Response result = s3.listObjectsV2(req);<NEW_LINE>List<S3Object<MASK><NEW_LINE>for (S3Object os : objects) {<NEW_LINE>String key = os.getKey();<NEW_LINE>DeleteObjectRequest delreq = DeleteObjectRequest.builder().bucketName(bucketname).key(key).build();<NEW_LINE>s3.deleteObject(delreq);<NEW_LINE>}<NEW_LINE>if (result.isTruncated()) {<NEW_LINE>// If more, build continuiation request<NEW_LINE>req = ListObjectsV2Request.builder().bucketName(bucketname).prefix(basekey).delimiter("").maxKeys(1000).continuationToken(result.getContinuationToken()).encodingType("url").requestPayer("requester").build();<NEW_LINE>} else {<NEW_LINE>// Else, we're done<NEW_LINE>done = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (S3Exception x) {<NEW_LINE>if (!x.getCode().equals("SignatureDoesNotMatch")) {<NEW_LINE>// S3 behavior when no object match....<NEW_LINE>Log.severe("AWS Exception", x);<NEW_LINE>Log.severe("req=" + req);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>releaseConnection(s3);<NEW_LINE>}<NEW_LINE>} | > objects = result.getContents(); |
820,631 | public static DescribeServiceDetailResponse unmarshall(DescribeServiceDetailResponse describeServiceDetailResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeServiceDetailResponse.setRequestId(_ctx.stringValue("DescribeServiceDetailResponse.RequestId"));<NEW_LINE>describeServiceDetailResponse.setCode<MASK><NEW_LINE>describeServiceDetailResponse.setErrMsg(_ctx.stringValue("DescribeServiceDetailResponse.ErrMsg"));<NEW_LINE>describeServiceDetailResponse.setSuccess(_ctx.booleanValue("DescribeServiceDetailResponse.Success"));<NEW_LINE>Result result = new Result();<NEW_LINE>result.setHeadless(_ctx.booleanValue("DescribeServiceDetailResponse.Result.Headless"));<NEW_LINE>result.setAppId(_ctx.longValue("DescribeServiceDetailResponse.Result.AppId"));<NEW_LINE>result.setServiceId(_ctx.longValue("DescribeServiceDetailResponse.Result.ServiceId"));<NEW_LINE>result.setK8sServiceId(_ctx.stringValue("DescribeServiceDetailResponse.Result.K8sServiceId"));<NEW_LINE>result.setServiceType(_ctx.stringValue("DescribeServiceDetailResponse.Result.ServiceType"));<NEW_LINE>result.setEnvId(_ctx.longValue("DescribeServiceDetailResponse.Result.EnvId"));<NEW_LINE>result.setName(_ctx.stringValue("DescribeServiceDetailResponse.Result.Name"));<NEW_LINE>result.setClusterIP(_ctx.stringValue("DescribeServiceDetailResponse.Result.ClusterIP"));<NEW_LINE>List<ServicePortMapping> portMappings = new ArrayList<ServicePortMapping>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeServiceDetailResponse.Result.PortMappings.Length"); i++) {<NEW_LINE>ServicePortMapping servicePortMapping = new ServicePortMapping();<NEW_LINE>servicePortMapping.setTargetPort(_ctx.stringValue("DescribeServiceDetailResponse.Result.PortMappings[" + i + "].TargetPort"));<NEW_LINE>servicePortMapping.setNodePort(_ctx.integerValue("DescribeServiceDetailResponse.Result.PortMappings[" + i + "].NodePort"));<NEW_LINE>servicePortMapping.setPort(_ctx.integerValue("DescribeServiceDetailResponse.Result.PortMappings[" + i + "].Port"));<NEW_LINE>servicePortMapping.setName(_ctx.stringValue("DescribeServiceDetailResponse.Result.PortMappings[" + i + "].Name"));<NEW_LINE>servicePortMapping.setBizProtocol(_ctx.stringValue("DescribeServiceDetailResponse.Result.PortMappings[" + i + "].Protocol"));<NEW_LINE>portMappings.add(servicePortMapping);<NEW_LINE>}<NEW_LINE>result.setPortMappings(portMappings);<NEW_LINE>describeServiceDetailResponse.setResult(result);<NEW_LINE>return describeServiceDetailResponse;<NEW_LINE>} | (_ctx.integerValue("DescribeServiceDetailResponse.Code")); |
1,065,590 | private static void onVideoReturnedFromCamera(Activity activity, @NonNull FilePicker.Callbacks callbacks) {<NEW_LINE>try {<NEW_LINE>String lastVideoUri = PreferenceManager.getDefaultSharedPreferences(activity<MASK><NEW_LINE>if (!TextUtils.isEmpty(lastVideoUri)) {<NEW_LINE>revokeWritePermission(activity, Uri.parse(lastVideoUri));<NEW_LINE>}<NEW_LINE>UploadableFile photoFile = FilePicker.takenCameraVideo(activity);<NEW_LINE>List<UploadableFile> files = new ArrayList<>();<NEW_LINE>files.add(photoFile);<NEW_LINE>if (photoFile == null) {<NEW_LINE>Exception e = new IllegalStateException("Unable to get the video returned from camera");<NEW_LINE>callbacks.onImagePickerError(e, FilePicker.ImageSource.CAMERA_VIDEO, restoreType(activity));<NEW_LINE>} else {<NEW_LINE>if (configuration(activity).shouldCopyTakenPhotosToPublicGalleryAppFolder()) {<NEW_LINE>PickedFiles.copyFilesInSeparateThread(activity, singleFileList(photoFile));<NEW_LINE>}<NEW_LINE>callbacks.onImagesPicked(files, FilePicker.ImageSource.CAMERA_VIDEO, restoreType(activity));<NEW_LINE>}<NEW_LINE>PreferenceManager.getDefaultSharedPreferences(activity).edit().remove(KEY_LAST_CAMERA_VIDEO).remove(KEY_VIDEO_URI).apply();<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>callbacks.onImagePickerError(e, FilePicker.ImageSource.CAMERA_VIDEO, restoreType(activity));<NEW_LINE>}<NEW_LINE>} | ).getString(KEY_VIDEO_URI, null); |
1,483,088 | protected void removeBindings() {<NEW_LINE>amountTextField.textProperty().unbindBidirectional(model.amount);<NEW_LINE>minAmountTextField.textProperty().unbindBidirectional(model.minAmount);<NEW_LINE>priceTextField.textProperty().unbindBidirectional(model.price);<NEW_LINE>volumeTextField.textProperty().unbindBidirectional(model.volume);<NEW_LINE>volumeTextField.promptTextProperty().unbindBidirectional(model.volume);<NEW_LINE>inputAmountTextField.textProperty().unbind();<NEW_LINE>payoutAmountTextField.textProperty().unbind();<NEW_LINE>// Validation<NEW_LINE>amountTextField.validationResultProperty().unbind();<NEW_LINE>minAmountTextField<MASK><NEW_LINE>priceTextField.validationResultProperty().unbind();<NEW_LINE>volumeTextField.validationResultProperty().unbind();<NEW_LINE>nextButton.disableProperty().unbind();<NEW_LINE>actionButton.disableProperty().unbind();<NEW_LINE>cancelButton2.disableProperty().unbind();<NEW_LINE>// trading account<NEW_LINE>paymentAccountTitledGroupBg.managedProperty().unbind();<NEW_LINE>currencyTextFieldBox.managedProperty().unbind();<NEW_LINE>miningPowLabel.visibleProperty().unbind();<NEW_LINE>miningPowLabel.managedProperty().unbind();<NEW_LINE>miningPowBusyAnimation.visibleProperty().unbind();<NEW_LINE>miningPowBusyAnimation.managedProperty().unbind();<NEW_LINE>miningPowBusyAnimation.isRunningProperty().unbind();<NEW_LINE>} | .validationResultProperty().unbind(); |
1,834,039 | protected void extractPKFields(Project project) {<NEW_LINE>FileObject root = MiscUtilities.findSourceRoot(project);<NEW_LINE>if (root != null) {<NEW_LINE>try {<NEW_LINE>final ClasspathInfo cpInfo = ClasspathInfo.create(root);<NEW_LINE>JavaSource pkSource = JavaSource.create(cpInfo);<NEW_LINE>if (pkSource == null) {<NEW_LINE>throw new IllegalArgumentException("No JavaSource object for " + idFieldInfo.getType());<NEW_LINE>}<NEW_LINE>pkSource.runUserActionTask(new AbstractTask<CompilationController>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(CompilationController controller) throws IOException {<NEW_LINE><MASK><NEW_LINE>TypeElement classElement = controller.getElements().getTypeElement(idFieldInfo.getType());<NEW_LINE>extractPKFields(classElement, controller);<NEW_LINE>}<NEW_LINE>}, true);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("No source root for " + project.getProjectDirectory().getName());<NEW_LINE>}<NEW_LINE>} | controller.toPhase(Phase.RESOLVED); |
1,796,703 | @Override<NEW_LINE>protected Component createLayout(PropertyBuilder propertyBuilder, @Nonnull Disposable uiDisposable) {<NEW_LINE>XDebuggerGeneralSettings settings = XDebuggerSettingManagerImpl<MASK><NEW_LINE>VerticalLayout layout = VerticalLayout.create();<NEW_LINE>CheckBox focusAppOnBreakpointCheckbox = CheckBox.create(XDebuggerBundle.message("setting.focus.app.on.breakpoint.label"));<NEW_LINE>layout.add(focusAppOnBreakpointCheckbox);<NEW_LINE>propertyBuilder.add(focusAppOnBreakpointCheckbox, settings::isMayBringFrameToFrontOnBreakpoint, settings::setMayBringFrameToFrontOnBreakpoint);<NEW_LINE>CheckBox showDebugWindowOnBreakpointCheckbox = CheckBox.create(XDebuggerBundle.message("settings.show.window.label"));<NEW_LINE>layout.add(showDebugWindowOnBreakpointCheckbox);<NEW_LINE>propertyBuilder.add(showDebugWindowOnBreakpointCheckbox, settings::isShowDebuggerOnBreakpoint, settings::setShowDebuggerOnBreakpoint);<NEW_LINE>CheckBox hideWindowCheckBox = CheckBox.create(XDebuggerBundle.message("setting.hide.window.label"));<NEW_LINE>layout.add(hideWindowCheckBox);<NEW_LINE>propertyBuilder.add(hideWindowCheckBox, settings::isHideDebuggerOnProcessTermination, settings::setHideDebuggerOnProcessTermination);<NEW_LINE>CheckBox scrollToCenterCheckbox = CheckBox.create(XDebuggerBundle.message("settings.scroll.to.center"));<NEW_LINE>layout.add(scrollToCenterCheckbox);<NEW_LINE>propertyBuilder.add(scrollToCenterCheckbox, settings::isScrollToCenter, settings::setScrollToCenter);<NEW_LINE>return layout;<NEW_LINE>} | .getInstanceImpl().getGeneralSettings(); |
168,000 | public void ready(StatementContext statementContext, ModuleIncidentals moduleIncidentals, boolean recovery) {<NEW_LINE>EventType infraEventType = namedWindow != null ? namedWindow.getRootView().getEventType() : table<MASK><NEW_LINE>factory = setupFactory(infraEventType, namedWindow, table, statementContext);<NEW_LINE>if (queryPlan.getIndexDescs() != null) {<NEW_LINE>EventTableIndexMetadata indexInfo = namedWindow != null ? namedWindow.getEventTableIndexMetadata() : table.getEventTableIndexMetadata();<NEW_LINE>SubordinateQueryPlannerUtil.addIndexMetaAndRef(queryPlan.getIndexDescs(), indexInfo, statementContext.getDeploymentId(), statementContext.getStatementName());<NEW_LINE>statementContext.addFinalizeCallback(new StatementFinalizeCallback() {<NEW_LINE><NEW_LINE>public void statementDestroyed(StatementContext context) {<NEW_LINE>for (int i = 0; i < queryPlan.getIndexDescs().length; i++) {<NEW_LINE>if (namedWindow != null) {<NEW_LINE>boolean last = namedWindow.getEventTableIndexMetadata().removeIndexReference(queryPlan.getIndexDescs()[i].getIndexMultiKey(), statementContext.getDeploymentId());<NEW_LINE>if (last) {<NEW_LINE>namedWindow.getEventTableIndexMetadata().removeIndex(queryPlan.getIndexDescs()[i].getIndexMultiKey());<NEW_LINE>namedWindow.removeAllInstanceIndexes(queryPlan.getIndexDescs()[i].getIndexMultiKey());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>boolean last = table.getEventTableIndexMetadata().removeIndexReference(queryPlan.getIndexDescs()[i].getIndexMultiKey(), statementContext.getDeploymentId());<NEW_LINE>if (last) {<NEW_LINE>table.getEventTableIndexMetadata().removeIndex(queryPlan.getIndexDescs()[i].getIndexMultiKey());<NEW_LINE>table.removeAllInstanceIndexes(queryPlan.getIndexDescs()[i].getIndexMultiKey());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | .getMetaData().getInternalEventType(); |
1,618,388 | public void onMigrate(int toVersion) {<NEW_LINE>switch(toVersion) {<NEW_LINE>case 32:<NEW_LINE>setBoolean(R.string.chats_show_status_change_key, false);<NEW_LINE>break;<NEW_LINE>case 40:<NEW_LINE>String value;<NEW_LINE>try {<NEW_LINE>if (getBoolean(R.string.chats_show_status_change_key, false))<NEW_LINE>value = Application.getInstance().getString(R.string.chats_show_status_change_always_value);<NEW_LINE>else<NEW_LINE>value = Application.getInstance().getString(R.string.chats_show_status_change_muc_value);<NEW_LINE>} catch (ClassCastException e) {<NEW_LINE>value = Application.getInstance().getString(R.string.chats_show_status_change_default);<NEW_LINE>}<NEW_LINE>setString(R.string.chats_show_status_change_key, value);<NEW_LINE>break;<NEW_LINE>case 45:<NEW_LINE>setBoolean(R.string.chats_show_avatars_key, "message".equals(getString(R.string.chats_show_avatars_key, "")));<NEW_LINE>break;<NEW_LINE>case 65:<NEW_LINE>SharedPreferences settings = Application.getInstance().getSharedPreferences("accounts", Context.MODE_PRIVATE);<NEW_LINE>int statusModeIndex = settings.getInt("status_mode", StatusMode.available.ordinal());<NEW_LINE>StatusMode statusMode = <MASK><NEW_LINE>setString(R.string.status_mode_key, statusMode.name());<NEW_LINE>String statusText = settings.getString("status_text", "");<NEW_LINE>setString(R.string.status_text_key, statusText);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | StatusMode.values()[statusModeIndex]; |
1,644,809 | protected void encodeMarkup(FacesContext context, DataList list) throws IOException {<NEW_LINE>if (list.isLazy()) {<NEW_LINE>list.loadLazyData();<NEW_LINE>}<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>String clientId = list.getClientId(context);<NEW_LINE>boolean hasPaginator = list.isPaginator();<NEW_LINE>boolean empty = (list.getRowCount() == 0);<NEW_LINE>String paginatorPosition = list.getPaginatorPosition();<NEW_LINE>String styleClass = getStyleClassBuilder(context).add(DataList.DATALIST_CLASS).add(list.getStyleClass()).build();<NEW_LINE>String style = list.getStyle();<NEW_LINE>if (hasPaginator) {<NEW_LINE>list.calculateFirst();<NEW_LINE>}<NEW_LINE>writer.startElement("div", list);<NEW_LINE>writer.writeAttribute("id", clientId, "id");<NEW_LINE>writer.writeAttribute("class", styleClass, "styleClass");<NEW_LINE>if (style != null) {<NEW_LINE>writer.writeAttribute("style", style, "style");<NEW_LINE>}<NEW_LINE>encodeFacet(context, list, "header", DataList.HEADER_CLASS);<NEW_LINE>if (hasPaginator && !"bottom".equalsIgnoreCase(paginatorPosition)) {<NEW_LINE>encodePaginatorMarkup(context, list, "top");<NEW_LINE>}<NEW_LINE>writer.startElement("div", list);<NEW_LINE>writer.writeAttribute(<MASK><NEW_LINE>writer.writeAttribute("class", DataList.CONTENT_CLASS, "styleClass");<NEW_LINE>if (empty) {<NEW_LINE>writer.startElement("div", list);<NEW_LINE>writer.writeAttribute("class", DataList.DATALIST_EMPTY_MESSAGE_CLASS, null);<NEW_LINE>writer.writeText(list.getEmptyMessage(), "emptyMessage");<NEW_LINE>writer.endElement("div");<NEW_LINE>} else {<NEW_LINE>if (list.getType().equals("none")) {<NEW_LINE>encodeFreeList(context, list);<NEW_LINE>} else {<NEW_LINE>encodeStrictList(context, list);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writer.endElement("div");<NEW_LINE>if (hasPaginator && !"top".equalsIgnoreCase(paginatorPosition)) {<NEW_LINE>encodePaginatorMarkup(context, list, "bottom");<NEW_LINE>}<NEW_LINE>encodeFacet(context, list, "footer", DataList.FOOTER_CLASS);<NEW_LINE>writer.endElement("div");<NEW_LINE>} | "id", clientId + "_content", "id"); |
65,860 | public void listOrder() {<NEW_LINE>String sql = new String("SELECT o.C_Order_ID " + "FROM C_Order o " + "WHERE o.IsSOTrx='Y' " + "AND o.Processed = 'N' " + "AND o.AD_Client_ID = ? " + "AND o.C_POS_ID = ? " + "AND o.SalesRep_ID = ? " + "ORDER BY o.Updated");<NEW_LINE>PreparedStatement preparedStatement = null;<NEW_LINE>ResultSet resultSet = null;<NEW_LINE>orderList = new ArrayList<Integer>();<NEW_LINE>try {<NEW_LINE>// Set Parameter<NEW_LINE>preparedStatement = DB.prepareStatement(sql, null);<NEW_LINE>preparedStatement.setInt(1, Env.getAD_Client_ID(Env.getCtx()));<NEW_LINE>preparedStatement.setInt(2, getC_POS_ID());<NEW_LINE>preparedStatement.setInt(3, getSalesRep_ID());<NEW_LINE>// Execute<NEW_LINE>resultSet = preparedStatement.executeQuery();<NEW_LINE>// Add to List<NEW_LINE>while (resultSet.next()) {<NEW_LINE>orderList.add(resultSet.getInt(1));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.severe("SubOrder.listOrder: " + e + " -> " + sql);<NEW_LINE>} finally {<NEW_LINE>DB.close(resultSet);<NEW_LINE>DB.close(preparedStatement);<NEW_LINE>}<NEW_LINE>// Seek Position<NEW_LINE>if (hasRecord())<NEW_LINE>recordPosition <MASK><NEW_LINE>else<NEW_LINE>recordPosition = -1;<NEW_LINE>} | = orderList.size() - 1; |
1,340,711 | private String multiply(String num1, String num2, int start1, int end1, int start2, int end2) {<NEW_LINE>if (end1 - start1 == 0 || end2 - start2 == 0) {<NEW_LINE>return simpleMultiply(num1.substring(start1, end1 + 1), num2.substring(start2, end2 + 1));<NEW_LINE>}<NEW_LINE>int mid1 = (start1 + end1) / 2;<NEW_LINE>int mid2 = (start2 + end2) / 2;<NEW_LINE>int count1 = end1 - mid1;<NEW_LINE>int count2 = end2 - mid2;<NEW_LINE>String v1 = multiply(num1, num2, start1, mid1, start2, mid2);<NEW_LINE>String v2 = multiply(num1, num2, start1, mid1, mid2 + 1, end2);<NEW_LINE>String v3 = multiply(num1, num2, mid1 + 1, end1, start2, mid2);<NEW_LINE>String v4 = multiply(num1, num2, mid1 + 1, end1, mid2 + 1, end2);<NEW_LINE>v1 = append0s(v1, count1 + count2);<NEW_LINE>v2 = append0s(v2, count1);<NEW_LINE>v3 = append0s(v3, count2);<NEW_LINE>v1 = add(v1.toCharArray(), v2.toCharArray());<NEW_LINE>v3 = add(v3.toCharArray(<MASK><NEW_LINE>return add(v1.toCharArray(), v3.toCharArray());<NEW_LINE>} | ), v4.toCharArray()); |
1,133,226 | public static DescribeSnapshotGroupsResponse unmarshall(DescribeSnapshotGroupsResponse describeSnapshotGroupsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeSnapshotGroupsResponse.setRequestId<MASK><NEW_LINE>describeSnapshotGroupsResponse.setNextToken(_ctx.stringValue("DescribeSnapshotGroupsResponse.NextToken"));<NEW_LINE>List<SnapshotGroup> snapshotGroups = new ArrayList<SnapshotGroup>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSnapshotGroupsResponse.SnapshotGroups.Length"); i++) {<NEW_LINE>SnapshotGroup snapshotGroup = new SnapshotGroup();<NEW_LINE>snapshotGroup.setStatus(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Status"));<NEW_LINE>snapshotGroup.setCreationTime(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].CreationTime"));<NEW_LINE>snapshotGroup.setDescription(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Description"));<NEW_LINE>snapshotGroup.setProgressStatus(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].ProgressStatus"));<NEW_LINE>snapshotGroup.setSnapshotGroupId(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].SnapshotGroupId"));<NEW_LINE>snapshotGroup.setInstanceId(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].InstanceId"));<NEW_LINE>snapshotGroup.setName(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Name"));<NEW_LINE>snapshotGroup.setResourceGroupId(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].ResourceGroupId"));<NEW_LINE>List<Tag> tags = new ArrayList<Tag>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Tags.Length"); j++) {<NEW_LINE>Tag tag = new Tag();<NEW_LINE>tag.setKey(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Tags[" + j + "].Key"));<NEW_LINE>tag.setValue(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Tags[" + j + "].Value"));<NEW_LINE>tags.add(tag);<NEW_LINE>}<NEW_LINE>snapshotGroup.setTags(tags);<NEW_LINE>List<Snapshot> snapshots = new ArrayList<Snapshot>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Snapshots.Length"); j++) {<NEW_LINE>Snapshot snapshot = new Snapshot();<NEW_LINE>snapshot.setSourceDiskId(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Snapshots[" + j + "].SourceDiskId"));<NEW_LINE>snapshot.setProgress(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Snapshots[" + j + "].Progress"));<NEW_LINE>snapshot.setInstantAccessRetentionDays(_ctx.integerValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Snapshots[" + j + "].InstantAccessRetentionDays"));<NEW_LINE>snapshot.setSnapshotId(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Snapshots[" + j + "].SnapshotId"));<NEW_LINE>snapshot.setInstantAccess(_ctx.booleanValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Snapshots[" + j + "].InstantAccess"));<NEW_LINE>snapshot.setSourceDiskType(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Snapshots[" + j + "].SourceDiskType"));<NEW_LINE>List<Tag2> tags1 = new ArrayList<Tag2>();<NEW_LINE>for (int k = 0; k < _ctx.lengthValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Snapshots[" + j + "].Tags.Length"); k++) {<NEW_LINE>Tag2 tag2 = new Tag2();<NEW_LINE>tag2.setKey(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Snapshots[" + j + "].Tags[" + k + "].Key"));<NEW_LINE>tag2.setValue(_ctx.stringValue("DescribeSnapshotGroupsResponse.SnapshotGroups[" + i + "].Snapshots[" + j + "].Tags[" + k + "].Value"));<NEW_LINE>tags1.add(tag2);<NEW_LINE>}<NEW_LINE>snapshot.setTags1(tags1);<NEW_LINE>snapshots.add(snapshot);<NEW_LINE>}<NEW_LINE>snapshotGroup.setSnapshots(snapshots);<NEW_LINE>snapshotGroups.add(snapshotGroup);<NEW_LINE>}<NEW_LINE>describeSnapshotGroupsResponse.setSnapshotGroups(snapshotGroups);<NEW_LINE>return describeSnapshotGroupsResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeSnapshotGroupsResponse.RequestId")); |
1,131,451 | public Stream<CentralityScore> pageRankStream(@Name(value = "label", defaultValue = "") String label, @Name(value = "relationship", defaultValue = "") String relationship, @Name(value = "config", defaultValue = "{}") Map<String, Object> config) {<NEW_LINE>ProcedureConfiguration configuration = ProcedureConfiguration.create(config);<NEW_LINE>final String weightPropertyKey = configuration.getString(CONFIG_WEIGHT_KEY, null);<NEW_LINE>PageRankScore.Stats.Builder statsBuilder = new PageRankScore.Stats.Builder();<NEW_LINE><MASK><NEW_LINE>final Graph graph = load(label, relationship, tracker, configuration.getGraphImpl(), statsBuilder, configuration, weightPropertyKey);<NEW_LINE>if (graph.nodeCount() == 0) {<NEW_LINE>graph.release();<NEW_LINE>return Stream.empty();<NEW_LINE>}<NEW_LINE>TerminationFlag terminationFlag = TerminationFlag.wrap(transaction);<NEW_LINE>CentralityResult scores = runAlgorithm(graph, tracker, terminationFlag, configuration, statsBuilder, weightPropertyKey);<NEW_LINE>log.info("PageRank: overall memory usage: %s", tracker.getUsageString());<NEW_LINE>return CentralityUtils.streamResults(graph, scores);<NEW_LINE>} | AllocationTracker tracker = AllocationTracker.create(); |
1,073,189 | protected void onCreate(@Nullable Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>// authentication with an API key or named user is required to access basemaps and other<NEW_LINE>// location services<NEW_LINE>ArcGISRuntimeEnvironment.setApiKey(BuildConfig.API_KEY);<NEW_LINE>mSceneView = findViewById(R.id.sceneView);<NEW_LINE>// create a scene and add a basemap to it<NEW_LINE>ArcGISScene scene = new ArcGISScene(BasemapStyle.ARCGIS_IMAGERY);<NEW_LINE>// add the scene to the sceneview<NEW_LINE>mSceneView.setScene(scene);<NEW_LINE>// specify the initial camera position<NEW_LINE>Camera camera = new Camera(36.525, -121.80, 300.0, 180, 80.0, 0.0);<NEW_LINE>mSceneView.setViewpointCamera(camera);<NEW_LINE>// raster package file paths<NEW_LINE>ArrayList<String> filePaths = new ArrayList<>();<NEW_LINE>filePaths.add(getExternalFilesDir(null) + getString(R.string.raster_package_location));<NEW_LINE>try {<NEW_LINE>// add an elevation source to the scene by passing the URI of the raster package to the constructor<NEW_LINE>RasterElevationSource rasterElevationSource = new RasterElevationSource(filePaths);<NEW_LINE>// add a listener to perform operations when the load status of the elevation source changes<NEW_LINE>rasterElevationSource.addLoadStatusChangedListener(loadStatusChangedEvent -> {<NEW_LINE>// when elevation source loads<NEW_LINE>if (loadStatusChangedEvent.getNewLoadStatus() == LoadStatus.LOADED) {<NEW_LINE>// add the elevation source to the elevation sources of the scene<NEW_LINE>mSceneView.getScene().getBaseSurface().getElevationSources().add(rasterElevationSource);<NEW_LINE>} else if (loadStatusChangedEvent.getNewLoadStatus() == LoadStatus.FAILED_TO_LOAD) {<NEW_LINE>// notify user that the elevation source has failed to load<NEW_LINE>logErrorToUser(getString(R.string.error_raster_elevation_source_load_failure_message<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>// load the elevation source asynchronously<NEW_LINE>rasterElevationSource.loadAsync();<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>// catch exception thrown by RasterElevationSource when a file is invalid/not found<NEW_LINE>logErrorToUser(getString(R.string.error_raster_elevation_source_load_failure_message, e.getMessage()));<NEW_LINE>}<NEW_LINE>} | , rasterElevationSource.getLoadError())); |
1,487,024 | public void onMethodCall(MethodCall methodCall, MethodChannel.Result result) {<NEW_LINE>String accessToken = methodCall.argument("accessToken");<NEW_LINE>MapBoxUtils.getMapbox(context, accessToken);<NEW_LINE>switch(methodCall.method) {<NEW_LINE>case "installOfflineMapTiles":<NEW_LINE>String tilesDb = methodCall.argument("tilesdb");<NEW_LINE>installOfflineMapTiles(tilesDb);<NEW_LINE>result.success(null);<NEW_LINE>break;<NEW_LINE>case "setOffline":<NEW_LINE>boolean offline = methodCall.argument("offline");<NEW_LINE>ConnectivityReceiver.instance(context).setConnected(offline ? false : null);<NEW_LINE>result.success(null);<NEW_LINE>break;<NEW_LINE>case "mergeOfflineRegions":<NEW_LINE>OfflineManagerUtils.mergeRegions(result, context, methodCall.argument("path"));<NEW_LINE>break;<NEW_LINE>case "setOfflineTileCountLimit":<NEW_LINE>OfflineManagerUtils.setOfflineTileCountLimit(result, context, methodCall.<Number>argument("limit").longValue());<NEW_LINE>break;<NEW_LINE>case "setHttpHeaders":<NEW_LINE>Map<String, String> headers = (Map<String, String>) methodCall.argument("headers");<NEW_LINE>MapboxHttpRequestUtil.setHttpHeaders(headers, result);<NEW_LINE>break;<NEW_LINE>case "downloadOfflineRegion":<NEW_LINE>// Get args from caller<NEW_LINE>Map<String, Object> definitionMap = (Map<String, Object>) methodCall.argument("definition");<NEW_LINE>Map<String, Object> metadataMap = (Map<String, Object>) methodCall.argument("metadata");<NEW_LINE>String channelName = methodCall.argument("channelName");<NEW_LINE>// Prepare args<NEW_LINE>OfflineChannelHandlerImpl channelHandler = new OfflineChannelHandlerImpl(messenger, channelName);<NEW_LINE>// Start downloading<NEW_LINE>OfflineManagerUtils.downloadRegion(result, context, definitionMap, metadataMap, channelHandler);<NEW_LINE>break;<NEW_LINE>case "getListOfRegions":<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>case "updateOfflineRegionMetadata":<NEW_LINE>// Get download region arguments from caller<NEW_LINE>Map<String, Object> metadata = (Map<String, Object>) methodCall.argument("metadata");<NEW_LINE>OfflineManagerUtils.updateRegionMetadata(result, context, methodCall.<Number>argument("id").longValue(), metadata);<NEW_LINE>break;<NEW_LINE>case "deleteOfflineRegion":<NEW_LINE>OfflineManagerUtils.deleteRegion(result, context, methodCall.<Number>argument("id").longValue());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>result.notImplemented();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | OfflineManagerUtils.regionsList(result, context); |
1,554,285 | public Mono<Response<RegistryListCredentialsResultInner>> listCredentialsWithResponseAsync(String resourceGroupName, String registryName) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (registryName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-09-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.listCredentials(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, registryName, accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext(<MASK><NEW_LINE>} | )).readOnly())); |
24,659 | private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>jLabel1 = new javax.swing.JLabel();<NEW_LINE>folderPanel = new javax.swing.JPanel();<NEW_LINE>setBorder(javax.swing.BorderFactory.createEmptyBorder(12, 12, 12, 12));<NEW_LINE>setLayout(new java.awt.GridBagLayout());<NEW_LINE>jLabel1.setLabelFor(folderPanel);<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(BrowseFolders.class, "LBL_Folders"));<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(0, 0, 2, 0);<NEW_LINE>add(jLabel1, gridBagConstraints);<NEW_LINE>// NOI18N<NEW_LINE>jLabel1.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage<MASK><NEW_LINE>// NOI18N<NEW_LINE>jLabel1.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BrowseFolders.class, "BrowseFolders.jLabel1.AccessibleContext.accessibleDescription"));<NEW_LINE>folderPanel.setLayout(new java.awt.BorderLayout());<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.weighty = 1.0;<NEW_LINE>add(folderPanel, gridBagConstraints);<NEW_LINE>// NOI18N<NEW_LINE>folderPanel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(BrowseFolders.class, "BrowseFolders.folderPanel.AccessibleContext.accessibleName"));<NEW_LINE>// NOI18N<NEW_LINE>folderPanel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BrowseFolders.class, "BrowseFolders.folderPanel.AccessibleContext.accessibleDescription"));<NEW_LINE>// NOI18N<NEW_LINE>getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(BrowseFolders.class, "BrowseFolders.AccessibleContext.accessibleName"));<NEW_LINE>// NOI18N<NEW_LINE>getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BrowseFolders.class, "BrowseFolders.AccessibleContext.accessibleDescription"));<NEW_LINE>} | (BrowseFolders.class, "BrowseFolders.jLabel1.AccessibleContext.accessibleName")); |
1,348,885 | private I_PP_Cost_Collector createCollector(@NonNull final CostCollectorCreateRequest request) {<NEW_LINE>trxManager.assertThreadInheritedTrxExists();<NEW_LINE>final I_PP_Order ppOrder = request.getOrder();<NEW_LINE>final DocTypeId docTypeId = docTypeDAO.getDocTypeId(DocTypeQuery.builder().docBaseType(X_C_DocType.DOCBASETYPE_ManufacturingCostCollector).adClientId(ppOrder.getAD_Client_ID()).adOrgId(ppOrder.getAD_Org_ID()).build());<NEW_LINE>final I_PP_Cost_Collector cc = InterfaceWrapperHelper.newInstance(I_PP_Cost_Collector.class);<NEW_LINE>cc.setDocAction(X_PP_Cost_Collector.DOCACTION_Complete);<NEW_LINE>cc.setDocStatus(X_PP_Cost_Collector.DOCSTATUS_Drafted);<NEW_LINE>cc.setPosted(false);<NEW_LINE>cc.setProcessed(false);<NEW_LINE>cc.setProcessing(false);<NEW_LINE>cc.setIsActive(true);<NEW_LINE>updateCostCollectorFromOrder(cc, ppOrder);<NEW_LINE>cc.<MASK><NEW_LINE>cc.setC_DocTypeTarget_ID(docTypeId.getRepoId());<NEW_LINE>cc.setCostCollectorType(request.getCostCollectorType().getCode());<NEW_LINE>cc.setM_Locator_ID(LocatorId.toRepoId(request.getLocatorId()));<NEW_LINE>cc.setM_AttributeSetInstance_ID(request.getAttributeSetInstanceId().getRepoId());<NEW_LINE>cc.setS_Resource_ID(ResourceId.toRepoId(request.getResourceId()));<NEW_LINE>cc.setMovementDate(TimeUtil.asTimestamp(request.getMovementDate()));<NEW_LINE>cc.setDateAcct(TimeUtil.asTimestamp(request.getMovementDate()));<NEW_LINE>cc.setM_Product_ID(ProductId.toRepoId(request.getProductId()));<NEW_LINE>setQuantities(cc, PPCostCollectorQuantities.builder().movementQty(request.getQty()).scrappedQty(request.getQtyScrap()).rejectedQty(request.getQtyReject()).build());<NEW_LINE>final PPOrderRoutingActivity orderActivity = request.getOrderActivity();<NEW_LINE>if (orderActivity != null) {<NEW_LINE>cc.setPP_Order_Node_ID(orderActivity.getId().getRepoId());<NEW_LINE>cc.setIsSubcontracting(orderActivity.isSubcontracting());<NEW_LINE>final WFDurationUnit durationUnit = orderActivity.getDurationUnit();<NEW_LINE>cc.setDurationUnit(durationUnit.getCode());<NEW_LINE>cc.setSetupTimeReal(durationUnit.toBigDecimal(request.getDurationSetup()));<NEW_LINE>cc.setDurationReal(durationUnit.toBigDecimal(request.getDuration()));<NEW_LINE>}<NEW_LINE>// If this is an material issue, we should use BOM Line's UOM<NEW_LINE>if (request.getPpOrderBOMLineId() != null) {<NEW_LINE>cc.setPP_Order_BOMLine_ID(request.getPpOrderBOMLineId().getRepoId());<NEW_LINE>}<NEW_LINE>if (request.getPickingCandidateId() > 0) {<NEW_LINE>cc.setM_Picking_Candidate_ID(request.getPickingCandidateId());<NEW_LINE>}<NEW_LINE>costCollectorDAO.save(cc);<NEW_LINE>//<NEW_LINE>// Process the Cost Collector<NEW_LINE>// expectedDocStatus<NEW_LINE>documentBL.// expectedDocStatus<NEW_LINE>processEx(// expectedDocStatus<NEW_LINE>cc, // expectedDocStatus<NEW_LINE>X_PP_Cost_Collector.DOCACTION_Complete, null);<NEW_LINE>return cc;<NEW_LINE>} | setC_DocType_ID(docTypeId.getRepoId()); |
397,620 | protected long[] readMV4x4(int miCol, int miRow, int blSz, VPXBooleanDecoder decoder, DecodingContext c, int packedRefFrames) {<NEW_LINE>int subMode0 = readInterMode(miCol, miRow, blSz, decoder, c);<NEW_LINE>long mvl0 = readSub0(miCol, miRow, blSz, decoder, c, subMode0, packedRefFrames);<NEW_LINE>int subMode1 = readInterMode(miCol, miRow, blSz, decoder, c);<NEW_LINE>long mvl1 = readSub12(miCol, miRow, blSz, decoder, c, mvl0, subMode1, 1, packedRefFrames);<NEW_LINE>int subMode2 = readInterMode(miCol, <MASK><NEW_LINE>long mvl2 = readSub12(miCol, miRow, blSz, decoder, c, mvl0, subMode2, 2, packedRefFrames);<NEW_LINE>int subMode3 = readInterMode(miCol, miRow, blSz, decoder, c);<NEW_LINE>long mvl3 = readMvSub3(miCol, miRow, blSz, decoder, c, mvl0, mvl1, mvl2, subMode3, packedRefFrames);<NEW_LINE>updateMVLineBuffers(miCol, miRow, blSz, c, mvl3);<NEW_LINE>updateMVLineBuffers4x4(miCol, miRow, blSz, c, mvl1, mvl2);<NEW_LINE>// int subModes = (subMode0 << 24) | (subMode1 << 16) | (subMode2 << 8) | subMode3;<NEW_LINE>return new long[] { mvl0, mvl1, mvl2, mvl3 };<NEW_LINE>} | miRow, blSz, decoder, c); |
875,027 | public static <T> void checkLeak(@Nonnull Object root, @Nonnull Class<T> suspectClass, @javax.annotation.Nullable final Processor<T> isReallyLeak) throws AssertionError {<NEW_LINE>if (SwingUtilities.isEventDispatchThread()) {<NEW_LINE>UIUtil.dispatchAllInvocationEvents();<NEW_LINE>} else {<NEW_LINE>UIUtil.pump();<NEW_LINE>}<NEW_LINE>PersistentEnumerator.clearCacheForTests();<NEW_LINE>toVisit.clear();<NEW_LINE>visited.clear();<NEW_LINE>toVisit.push(new BackLink(root.getClass()<MASK><NEW_LINE>try {<NEW_LINE>walkObjects(suspectClass, new Processor<BackLink>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean process(BackLink backLink) {<NEW_LINE>UserDataHolder leaked = (UserDataHolder) backLink.value;<NEW_LINE>if (((UserDataHolderBase) leaked).replace(REPORTED_LEAKED, null, Boolean.TRUE) && (isReallyLeak == null || isReallyLeak.process((T) leaked))) {<NEW_LINE>String place = leaked instanceof Project ? PlatformTestCase.getCreationPlace((Project) leaked) : "";<NEW_LINE>System.out.println("Leaked object found:" + leaked + "; hash: " + System.identityHashCode(leaked) + "; place: " + place);<NEW_LINE>while (backLink != null) {<NEW_LINE>String valueStr;<NEW_LINE>try {<NEW_LINE>valueStr = String.valueOf(backLink.value);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>valueStr = "(" + e.getMessage() + " while computing .toString())";<NEW_LINE>}<NEW_LINE>System.out.println("-->" + backLink.field + "; Value: " + valueStr + "; " + backLink.aClass);<NEW_LINE>backLink = backLink.backLink;<NEW_LINE>}<NEW_LINE>System.out.println(";-----");<NEW_LINE>throw new AssertionError();<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} finally {<NEW_LINE>visited.clear();<NEW_LINE>toVisit.clear();<NEW_LINE>toVisit.trimToSize();<NEW_LINE>}<NEW_LINE>} | , root, null, null)); |
218,585 | public Response.ResponseBuilder evaluatePreconditions(final Date lastModified, final EntityTag eTag) {<NEW_LINE>if (lastModified == null) {<NEW_LINE>throw new IllegalArgumentException(METHOD_PARAMETER_CANNOT_BE_NULL_LAST_MODIFIED);<NEW_LINE>}<NEW_LINE>if (eTag == null) {<NEW_LINE>throw new IllegalArgumentException(METHOD_PARAMETER_CANNOT_BE_NULL_ETAG);<NEW_LINE>}<NEW_LINE>Response.ResponseBuilder r = evaluateIfMatch(eTag);<NEW_LINE>if (r != null) {<NEW_LINE>return r;<NEW_LINE>}<NEW_LINE>final long lastModifiedTime = lastModified.getTime();<NEW_LINE>r = evaluateIfUnmodifiedSince(lastModifiedTime);<NEW_LINE>if (r != null) {<NEW_LINE>return r;<NEW_LINE>}<NEW_LINE>final boolean isGetOrHead = "GET".equals(getMethod()) || "HEAD".equals(getMethod());<NEW_LINE>final Set<MatchingEntityTag> matchingTags = getIfNoneMatch();<NEW_LINE>if (matchingTags != null) {<NEW_LINE>r = evaluateIfNoneMatch(eTag, matchingTags, isGetOrHead);<NEW_LINE>// If the If-None-Match header is present and there is no<NEW_LINE>// match then the If-Modified-Since header must be ignored<NEW_LINE>if (r == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Otherwise if the If-None-Match header is present and there<NEW_LINE>// is a match then the If-Modified-Since header must be checked<NEW_LINE>// for consistency<NEW_LINE>}<NEW_LINE>final String ifModifiedSinceHeader = getHeaderString(HttpHeaders.IF_MODIFIED_SINCE);<NEW_LINE>if (ifModifiedSinceHeader != null && !ifModifiedSinceHeader.isEmpty() && isGetOrHead) {<NEW_LINE><MASK><NEW_LINE>if (r != null) {<NEW_LINE>r.tag(eTag);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return r;<NEW_LINE>} | r = evaluateIfModifiedSince(lastModifiedTime, ifModifiedSinceHeader); |
523,580 | public void decode16x8(MBlock mBlock, Picture mb, Frame[][] refs, PartPred p0, PartPred p1) {<NEW_LINE>int mbX = mapper.getMbX(mBlock.mbIdx);<NEW_LINE>int mbY = mapper.getMbY(mBlock.mbIdx);<NEW_LINE>boolean leftAvailable = mapper.leftAvailable(mBlock.mbIdx);<NEW_LINE>boolean topAvailable = mapper.topAvailable(mBlock.mbIdx);<NEW_LINE>boolean topLeftAvailable = mapper.topLeftAvailable(mBlock.mbIdx);<NEW_LINE>boolean topRightAvailable = mapper.topRightAvailable(mBlock.mbIdx);<NEW_LINE>int address = mapper.getAddress(mBlock.mbIdx);<NEW_LINE>int xx = mbX << 2;<NEW_LINE>for (int list = 0; list < 2; list++) {<NEW_LINE>predictInter16x8(mBlock, mbb[list], refs, mbX, mbY, leftAvailable, topAvailable, topLeftAvailable, topRightAvailable, xx, mBlock.x, p0, p1, list);<NEW_LINE>}<NEW_LINE>mergePrediction(sh, mBlock.x.mv0R(0), mBlock.x.mv1R(0), p0, 0, mbb[0].getPlaneData(0), mbb[1].getPlaneData(0), 0, 16, 16, 8, mb.getPlaneData<MASK><NEW_LINE>mergePrediction(sh, mBlock.x.mv0R(8), mBlock.x.mv1R(8), p1, 0, mbb[0].getPlaneData(0), mbb[1].getPlaneData(0), 128, 16, 16, 8, mb.getPlaneData(0), refs, poc);<NEW_LINE>mBlock.partPreds[0] = mBlock.partPreds[1] = p0;<NEW_LINE>mBlock.partPreds[2] = mBlock.partPreds[3] = p1;<NEW_LINE>predictChromaInter(refs, mBlock.x, mbX << 3, mbY << 3, 1, mb, mBlock.partPreds);<NEW_LINE>predictChromaInter(refs, mBlock.x, mbX << 3, mbY << 3, 2, mb, mBlock.partPreds);<NEW_LINE>residualInter(mBlock, refs, leftAvailable, topAvailable, mbX, mbY, mapper.getAddress(mBlock.mbIdx));<NEW_LINE>saveMvs(di, mBlock.x, mbX, mbY);<NEW_LINE>mergeResidual(mb, mBlock.ac, mBlock.transform8x8Used ? COMP_BLOCK_8x8_LUT : COMP_BLOCK_4x4_LUT, mBlock.transform8x8Used ? COMP_POS_8x8_LUT : COMP_POS_4x4_LUT);<NEW_LINE>collectPredictors(s, mb, mbX);<NEW_LINE>di.mbTypes[address] = mBlock.curMbType;<NEW_LINE>} | (0), refs, poc); |
1,020,949 | private void findByOwnerFilter(String ownerId, ResourceServer resourceServer, Consumer<Resource> consumer, int firstResult, int maxResult) {<NEW_LINE>boolean pagination = firstResult > -1 && maxResult > -1;<NEW_LINE>String queryName = pagination ? "findResourceIdByOwnerOrdered" : "findResourceIdByOwner";<NEW_LINE>if (resourceServer == null) {<NEW_LINE>queryName = pagination ? "findAnyResourceIdByOwnerOrdered" : "findAnyResourceIdByOwner";<NEW_LINE>}<NEW_LINE>TypedQuery<ResourceEntity> query = entityManager.createNamedQuery(queryName, ResourceEntity.class);<NEW_LINE><MASK><NEW_LINE>query.setParameter("owner", ownerId);<NEW_LINE>if (resourceServer != null) {<NEW_LINE>query.setParameter("serverId", resourceServer.getId());<NEW_LINE>}<NEW_LINE>if (pagination) {<NEW_LINE>query.setFirstResult(firstResult);<NEW_LINE>query.setMaxResults(maxResult);<NEW_LINE>}<NEW_LINE>ResourceStore resourceStore = provider.getStoreFactory().getResourceStore();<NEW_LINE>closing(query.getResultStream().map(id -> resourceStore.findById(resourceServer, id.getId()))).forEach(consumer);<NEW_LINE>} | query.setFlushMode(FlushModeType.COMMIT); |
1,733,911 | private synchronized String[] readAllDocumentNames() throws IOException {<NEW_LINE>if (this.numberOfChunks <= 0)<NEW_LINE>return CharOperation.NO_STRINGS;<NEW_LINE>InputStream stream = this.indexLocation.getInputStream();<NEW_LINE>try {<NEW_LINE>int offset = this.chunkOffsets[0];<NEW_LINE>stream.skip(offset);<NEW_LINE>this.streamBuffer = new byte[BUFFER_READ_SIZE];<NEW_LINE>this.bufferIndex = 0;<NEW_LINE>this.bufferEnd = stream.read(this.streamBuffer, 0, this.streamBuffer.length);<NEW_LINE>int lastIndex = this.numberOfChunks - 1;<NEW_LINE>String[] docNames = new String[lastIndex * CHUNK_SIZE + this.sizeOfLastChunk];<NEW_LINE>for (int i = 0; i < this.numberOfChunks; i++) readChunk(docNames, stream, i * CHUNK_SIZE, i < <MASK><NEW_LINE>return docNames;<NEW_LINE>} finally {<NEW_LINE>stream.close();<NEW_LINE>this.indexLocation.close();<NEW_LINE>this.streamBuffer = null;<NEW_LINE>}<NEW_LINE>} | lastIndex ? CHUNK_SIZE : this.sizeOfLastChunk); |
1,580,288 | public static String[] createHashTable(String[] values) {<NEW_LINE>int tableSize = values.length * 2;<NEW_LINE>int maxTableSize = Math.min(values.length * <MASK><NEW_LINE>String[] bestTable = null;<NEW_LINE>int bestCollisionRatio = 0;<NEW_LINE>while (tableSize <= maxTableSize) {<NEW_LINE>String[] table = new String[tableSize];<NEW_LINE>int maxCollisionRatio = 0;<NEW_LINE>for (String key : values) {<NEW_LINE>int hashCode = key.hashCode();<NEW_LINE>int collisionRatio = 0;<NEW_LINE>while (true) {<NEW_LINE>int index = Integer.remainderUnsigned(hashCode++, table.length);<NEW_LINE>if (table[index] == null) {<NEW_LINE>table[index] = key;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>collisionRatio++;<NEW_LINE>}<NEW_LINE>maxCollisionRatio = Math.max(maxCollisionRatio, collisionRatio);<NEW_LINE>}<NEW_LINE>if (bestTable == null || bestCollisionRatio > maxCollisionRatio) {<NEW_LINE>bestCollisionRatio = maxCollisionRatio;<NEW_LINE>bestTable = table;<NEW_LINE>}<NEW_LINE>tableSize++;<NEW_LINE>}<NEW_LINE>return bestTable;<NEW_LINE>} | 5 / 2, tableSize + 10); |
603,335 | public void annotate(@NotNull PsiElement o, @NotNull AnnotationHolder holder) {<NEW_LINE>if (!o.isValid())<NEW_LINE>return;<NEW_LINE>if (o instanceof GoImportSpec && ((GoImportSpec) o).isDot()) {<NEW_LINE>// noinspection SynchronizationOnLocalVariableOrMethodParameter<NEW_LINE>synchronized (o) {<NEW_LINE>List<PsiElement> importUsers = o.getUserData(GoReferenceBase.IMPORT_USERS);<NEW_LINE>if (importUsers != null) {<NEW_LINE>List<PsiElement> newImportUsers = ContainerUtil.newSmartList();<NEW_LINE>newImportUsers.addAll(importUsers.stream().filter(PsiElement::isValid).collect(Collectors.toList()));<NEW_LINE>o.putUserData(GoReferenceBase.IMPORT_USERS, newImportUsers.isEmpty() ? null : newImportUsers);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (o instanceof GoLiteral) {<NEW_LINE>if (((GoLiteral) o).getHex() != null || ((GoLiteral) o).getOct() != null) {<NEW_LINE>setHighlighting(o, holder, NUMBER);<NEW_LINE>}<NEW_LINE>} else if (o instanceof GoReferenceExpressionBase) {<NEW_LINE>PsiReference reference = o.getReference();<NEW_LINE>highlightRefIfNeeded((GoReferenceExpressionBase) o, reference != null ? reference.resolve() : null, holder);<NEW_LINE>} else if (o instanceof GoTypeSpec) {<NEW_LINE>TextAttributesKey key = getColor((GoTypeSpec) o);<NEW_LINE>setHighlighting(((GoTypeSpec) o).<MASK><NEW_LINE>} else if (o instanceof GoConstDefinition) {<NEW_LINE>setHighlighting(o, holder, getColor((GoConstDefinition) o));<NEW_LINE>} else if (o instanceof GoVarDefinition) {<NEW_LINE>setHighlighting(o, holder, getColor((GoVarDefinition) o));<NEW_LINE>} else if (o instanceof GoFieldDefinition) {<NEW_LINE>setHighlighting(o, holder, getColor((GoFieldDefinition) o));<NEW_LINE>} else if (o instanceof GoParamDefinition) {<NEW_LINE>setHighlighting(o, holder, FUNCTION_PARAMETER);<NEW_LINE>} else if (o instanceof GoReceiver) {<NEW_LINE>PsiElement identifier = ((GoReceiver) o).getIdentifier();<NEW_LINE>if (identifier != null) {<NEW_LINE>setHighlighting(identifier, holder, METHOD_RECEIVER);<NEW_LINE>}<NEW_LINE>} else if (o instanceof GoLabelDefinition || o instanceof GoLabelRef) {<NEW_LINE>setHighlighting(o, holder, LABEL);<NEW_LINE>} else if (o instanceof GoNamedSignatureOwner) {<NEW_LINE>PsiElement identifier = ((GoNamedSignatureOwner) o).getIdentifier();<NEW_LINE>if (identifier != null) {<NEW_LINE>setHighlighting(identifier, holder, getColor((GoNamedSignatureOwner) o));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getIdentifier(), holder, key); |
1,476,400 | private void retryFailCallbackFile() {<NEW_LINE>// valid<NEW_LINE>File callbackLogPath = new File(failCallbackFilePath);<NEW_LINE>if (!callbackLogPath.exists()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (callbackLogPath.isFile()) {<NEW_LINE>callbackLogPath.delete();<NEW_LINE>}<NEW_LINE>if (!(callbackLogPath.isDirectory() && callbackLogPath.list() != null && callbackLogPath.list().length > 0)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// load and clear file, retry<NEW_LINE>for (File callbaclLogFile : callbackLogPath.listFiles()) {<NEW_LINE>byte[] callbackParamList_bytes = FileUtil.readFileContent(callbaclLogFile);<NEW_LINE>// avoid empty file<NEW_LINE>if (callbackParamList_bytes == null || callbackParamList_bytes.length < 1) {<NEW_LINE>callbaclLogFile.delete();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>List<HandleCallbackParam> callbackParamList = (List<HandleCallbackParam>) JdkSerializeTool.<MASK><NEW_LINE>callbaclLogFile.delete();<NEW_LINE>doCallback(callbackParamList);<NEW_LINE>}<NEW_LINE>} | deserialize(callbackParamList_bytes, List.class); |
792,705 | protected void appendComponentSlot(XStringBuilder xsb, JsonStringBuilder jsb, SofaTracerSpan span) {<NEW_LINE>Map<String, String> tagWithStr = span.getTagsWithStr();<NEW_LINE>Map<String, Number> tagWithNum = span.getTagsWithNumber();<NEW_LINE>// protocol<NEW_LINE>xsb.append(tagWithStr.get(CommonSpanTags.PROTOCOL));<NEW_LINE>// service<NEW_LINE>xsb.append(tagWithStr.get(CommonSpanTags.SERVICE));<NEW_LINE>// method<NEW_LINE>xsb.append(tagWithStr.get(CommonSpanTags.METHOD));<NEW_LINE>// invoke type<NEW_LINE>xsb.append(tagWithStr.get(CommonSpanTags.INVOKE_TYPE));<NEW_LINE>// remote host<NEW_LINE>xsb.append(tagWithStr.get(CommonSpanTags.REMOTE_HOST));<NEW_LINE>// remote port<NEW_LINE>xsb.append(tagWithStr.get(CommonSpanTags.REMOTE_PORT));<NEW_LINE>// local port<NEW_LINE>xsb.append(tagWithStr.get(CommonSpanTags.LOCAL_HOST));<NEW_LINE>// client.serialize.time<NEW_LINE>xsb.append(tagWithNum.get(AttachmentKeyConstants.CLIENT_SERIALIZE_TIME) + "");<NEW_LINE>// client.deserialize.time<NEW_LINE>xsb.append(tagWithNum.get(AttachmentKeyConstants.CLIENT_DESERIALIZE_TIME) + "");<NEW_LINE>// client.serialize.size<NEW_LINE>Number reqSizeNum = tagWithNum.get(AttachmentKeyConstants.CLIENT_SERIALIZE_SIZE);<NEW_LINE>xsb.append(reqSizeNum == null ? <MASK><NEW_LINE>// client.deserialize.size<NEW_LINE>Number respSizeNum = tagWithNum.get(AttachmentKeyConstants.CLIENT_DESERIALIZE_SIZE);<NEW_LINE>xsb.append(respSizeNum == null ? 0 : respSizeNum.longValue());<NEW_LINE>// error message<NEW_LINE>xsb.append(StringUtils.isBlank(tagWithStr.get(Tags.ERROR.getKey())) ? "" : tagWithStr.get(Tags.ERROR.getKey()));<NEW_LINE>} | 0 : reqSizeNum.longValue()); |
931,730 | public void updateSession(Song song, int state) {<NEW_LINE>final boolean playing = (<MASK><NEW_LINE>final PlaybackService service = PlaybackService.get(mContext);<NEW_LINE>PlaybackStateCompat playbackState = new PlaybackStateCompat.Builder().setState(playing ? PlaybackStateCompat.STATE_PLAYING : PlaybackStateCompat.STATE_PAUSED, service.getPosition(), 1.0f).setActions(PlaybackStateCompat.ACTION_PLAY | PlaybackStateCompat.ACTION_STOP | PlaybackStateCompat.ACTION_PAUSE | PlaybackStateCompat.ACTION_PLAY_PAUSE | PlaybackStateCompat.ACTION_SEEK_TO | PlaybackStateCompat.ACTION_SKIP_TO_NEXT | PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS).build();<NEW_LINE>if (song != null) {<NEW_LINE>final Bitmap cover = song.getMediumCover(mContext);<NEW_LINE>MediaMetadataCompat.Builder metadataBuilder = new MediaMetadataCompat.Builder().putString(MediaMetadataCompat.METADATA_KEY_ARTIST, song.artist).putString(MediaMetadataCompat.METADATA_KEY_ALBUM, song.album).putString(MediaMetadataCompat.METADATA_KEY_TITLE, song.title).putLong(MediaMetadataCompat.METADATA_KEY_DURATION, song.duration);<NEW_LINE>boolean showCover = SharedPrefHelper.getSettings(mContext).getBoolean(PrefKeys.COVER_ON_LOCKSCREEN, PrefDefaults.COVER_ON_LOCKSCREEN);<NEW_LINE>if (showCover) {<NEW_LINE>metadataBuilder.putBitmap(MediaMetadataCompat.METADATA_KEY_ALBUM_ART, cover);<NEW_LINE>}<NEW_LINE>// logic copied from FullPlaybackActivity.updateQueuePosition()<NEW_LINE>if (PlaybackService.finishAction(service.getState()) != SongTimeline.FINISH_RANDOM) {<NEW_LINE>metadataBuilder.putLong(MediaMetadataCompat.METADATA_KEY_TRACK_NUMBER, service.getTimelinePosition() + 1);<NEW_LINE>metadataBuilder.putLong(MediaMetadataCompat.METADATA_KEY_NUM_TRACKS, service.getTimelineLength());<NEW_LINE>}<NEW_LINE>mMediaSession.setMetadata(metadataBuilder.build());<NEW_LINE>}<NEW_LINE>mMediaSession.setPlaybackState(playbackState);<NEW_LINE>mMediaSession.setActive(true);<NEW_LINE>} | state & PlaybackService.FLAG_PLAYING) != 0; |
884,154 | void contextPropagationExample_WithoutContextPropagator() {<NEW_LINE>ThreadPoolBulkheadConfig config = ThreadPoolBulkheadConfig.custom().maxThreadPoolSize(2).coreThreadPoolSize(1).<MASK><NEW_LINE>ThreadPoolBulkheadRegistry registry = ThreadPoolBulkheadRegistry.of(config);<NEW_LINE>ThreadPoolBulkhead bulkhead = registry.bulkhead("flightSearchService");<NEW_LINE>FlightSearchService service = new FlightSearchService();<NEW_LINE>SearchRequest request = new SearchRequest("NYC", "LAX", "09/30/2020");<NEW_LINE>Supplier<List<Flight>> flightsSupplier = () -> service.searchFlightsTakingOneSecond_PrintCorrelationId(request);<NEW_LINE>Supplier<CompletionStage<List<Flight>>> decoratedFlightsSupplier = ThreadPoolBulkhead.decorateSupplier(bulkhead, flightsSupplier);<NEW_LINE>for (int i = 0; i < 2; i++) {<NEW_LINE>String trackingId = UUID.randomUUID().toString();<NEW_LINE>System.out.println("Setting trackingId " + trackingId + " on parent, main thread before calling flight search");<NEW_LINE>RequestTrackingIdHolder.setRequestTrackingId(trackingId);<NEW_LINE>decoratedFlightsSupplier.get().whenComplete((r, t) -> {<NEW_LINE>if (r != null) {<NEW_LINE>System.out.println("Received results");<NEW_LINE>}<NEW_LINE>if (t != null) {<NEW_LINE>t.printStackTrace();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | queueCapacity(1).build(); |
363,479 | public void onItemClick(View view, Object item, Segment segment) {<NEW_LINE>if (item instanceof Playlist) {<NEW_LINE>String playlistId = ((Playlist) item).getId();<NEW_LINE>if (mQueryArray != null) {<NEW_LINE>ArrayList<PlaylistEntry> entries = new ArrayList<>();<NEW_LINE>for (Query query : mQueryArray) {<NEW_LINE>entries.add(PlaylistEntry.get(playlistId, query, IdGenerator.getLifetimeUniqueStringId()));<NEW_LINE>}<NEW_LINE>CollectionManager.get().addPlaylistEntries(playlistId, entries);<NEW_LINE>// invalidate the current list of entries<NEW_LINE>((Playlist) item).setFilled(false);<NEW_LINE>}<NEW_LINE>Bundle bundle = new Bundle();<NEW_LINE>bundle.putString(TomahawkFragment.PLAYLIST, ((Playlist) item).getCacheKey());<NEW_LINE>if (mUser != null) {<NEW_LINE>bundle.putString(TomahawkFragment.USER, mUser.getId());<NEW_LINE>}<NEW_LINE>bundle.putInt(CONTENT_HEADER_MODE, ContentHeaderFragment.MODE_HEADER_DYNAMIC);<NEW_LINE>FragmentUtils.replace((TomahawkMainActivity) getActivity(), PlaylistEntriesFragment.class, bundle);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>mQueryArray = null;<NEW_LINE>} | getArguments().remove(QUERYARRAY); |
1,272,620 | public okhttp3.Call labelsGetCall(final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/labels";<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "OAuth2Security" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, <MASK><NEW_LINE>} | localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); |
839,588 | protected void doProcess(final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final IElementTagStructureHandler structureHandler) {<NEW_LINE>final Each each = EachUtils.parseEach(context, attributeValue);<NEW_LINE>final IStandardExpression iterVarExpr = each.getIterVar();<NEW_LINE>final Object <MASK><NEW_LINE>final IStandardExpression statusVarExpr = each.getStatusVar();<NEW_LINE>final Object statusVarValue;<NEW_LINE>if (statusVarExpr != null) {<NEW_LINE>statusVarValue = statusVarExpr.execute(context);<NEW_LINE>} else {<NEW_LINE>// Will provoke the default behaviour: iterVarValue + 'Stat'<NEW_LINE>statusVarValue = null;<NEW_LINE>}<NEW_LINE>final IStandardExpression iterableExpr = each.getIterable();<NEW_LINE>final Object iteratedValue = iterableExpr.execute(context);<NEW_LINE>final String iterVarName = (iterVarValue == null ? null : iterVarValue.toString());<NEW_LINE>if (StringUtils.isEmptyOrWhitespace(iterVarName)) {<NEW_LINE>throw new TemplateProcessingException("Iteration variable name expression evaluated as null: \"" + iterVarExpr + "\"");<NEW_LINE>}<NEW_LINE>final String statusVarName = (statusVarValue == null ? null : statusVarValue.toString());<NEW_LINE>if (statusVarExpr != null && StringUtils.isEmptyOrWhitespace(statusVarName)) {<NEW_LINE>throw new TemplateProcessingException("Status variable name expression evaluated as null or empty: \"" + statusVarExpr + "\"");<NEW_LINE>}<NEW_LINE>structureHandler.iterateElement(iterVarName, statusVarName, iteratedValue);<NEW_LINE>} | iterVarValue = iterVarExpr.execute(context); |
462,087 | public void onApplicationEvent(WebServerInitializedEvent event) {<NEW_LINE>if (!discoveryProperties.isAutoRegister()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (StringUtils.isEmpty(register.getIp())) {<NEW_LINE>register.setIp(NetUtils.localIP());<NEW_LINE>}<NEW_LINE>if (register.getPort() == 0) {<NEW_LINE>register.setPort(event.getWebServer().getPort());<NEW_LINE>}<NEW_LINE>register.getMetadata().put("preserved.register.source", "SPRING_BOOT");<NEW_LINE>register.setInstanceId("");<NEW_LINE>String serviceName = register.getServiceName();<NEW_LINE>if (StringUtils.isEmpty(serviceName)) {<NEW_LINE>if (StringUtils.isEmpty(applicationName)) {<NEW_LINE>throw new AutoRegisterException("serviceName notNull");<NEW_LINE>}<NEW_LINE>serviceName = applicationName;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>namingService.registerInstance(serviceName, register.getGroupName(), register);<NEW_LINE>logger.info("Finished auto register service : {}, ip : {}, port : {}", serviceName, register.getIp(), register.getPort());<NEW_LINE>} catch (NacosException e) {<NEW_LINE>throw new AutoRegisterException(e);<NEW_LINE>}<NEW_LINE>} | Register register = discoveryProperties.getRegister(); |
1,725,739 | public LockEntity postLocksPath(String path, LocksPathBody body) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'path' is set<NEW_LINE>if (path == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'path' when calling postLocksPath");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/locks/{path}".replaceAll("\\{" + "path" + "\\}", apiClient.escapeString(path.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new <MASK><NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>GenericType<LockEntity> localVarReturnType = new GenericType<LockEntity>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | HashMap<String, Object>(); |
1,496,523 | private Stream<Observation> convertToObservations(final MetricData metricData) {<NEW_LINE>List<Observation> <MASK><NEW_LINE>MetricCategory category = categoryNameToMetricCategory(metricData.getInstrumentationLibraryInfo().getName());<NEW_LINE>Collection<?> points;<NEW_LINE>switch(metricData.getType()) {<NEW_LINE>case DOUBLE_GAUGE:<NEW_LINE>points = metricData.getDoubleGaugeData().getPoints();<NEW_LINE>break;<NEW_LINE>case DOUBLE_SUM:<NEW_LINE>points = metricData.getDoubleSumData().getPoints();<NEW_LINE>break;<NEW_LINE>case SUMMARY:<NEW_LINE>points = metricData.getDoubleSummaryData().getPoints();<NEW_LINE>break;<NEW_LINE>case LONG_SUM:<NEW_LINE>points = metricData.getLongSumData().getPoints();<NEW_LINE>break;<NEW_LINE>case HISTOGRAM:<NEW_LINE>points = metricData.getDoubleHistogramData().getPoints();<NEW_LINE>break;<NEW_LINE>case LONG_GAUGE:<NEW_LINE>points = metricData.getLongGaugeData().getPoints();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException("Unsupported type " + metricData.getType().name());<NEW_LINE>}<NEW_LINE>for (Object ptObj : points) {<NEW_LINE>PointData point = (PointData) ptObj;<NEW_LINE>List<String> labels = new ArrayList<>();<NEW_LINE>point.getAttributes().forEach((k, v) -> labels.add(v.toString()));<NEW_LINE>observations.add(new Observation(category, metricData.getName(), extractValue(metricData.getType(), point), labels));<NEW_LINE>}<NEW_LINE>return observations.stream();<NEW_LINE>} | observations = new ArrayList<>(); |
337,812 | public com.amazonaws.services.mwaa.model.ValidationException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.mwaa.model.ValidationException validationException = new com.amazonaws.services.mwaa.model.ValidationException(null);<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return validationException;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,103,988 | /* Sorts the data and discards given percentage from the left and right sides each.<NEW_LINE>* E.g. 5% trim implies a total of 10% (2x 5%) of elements discarded.<NEW_LINE>* Used in calculating trimmed mean (and in turn trimmed standard deviation),<NEW_LINE>* which is more robust to outliers than a simple mean.<NEW_LINE>*/<NEW_LINE>private static List<Double> trim(double percentToTrim, List<Double> numbers) {<NEW_LINE>var minPercentToTrim = 0;<NEW_LINE>var maxPercentToTrim = 50;<NEW_LINE>if (minPercentToTrim > percentToTrim || percentToTrim > maxPercentToTrim) {<NEW_LINE>throw new IllegalArgumentException(String.format("The percentage of data points to trim must be in the range [%d,%d].", minPercentToTrim, maxPercentToTrim));<NEW_LINE>}<NEW_LINE>var totalPercentTrim = percentToTrim * 2;<NEW_LINE>if (totalPercentTrim == 0) {<NEW_LINE>return numbers;<NEW_LINE>}<NEW_LINE>if (totalPercentTrim == 100) {<NEW_LINE>return FXCollections.emptyObservableList();<NEW_LINE>}<NEW_LINE>if (numbers.isEmpty()) {<NEW_LINE>return numbers;<NEW_LINE>}<NEW_LINE>var count = numbers.size();<NEW_LINE>// visada >= 0?<NEW_LINE>int countToDropFromEachSide = (int) Math.round((count / 100d) * percentToTrim);<NEW_LINE>if (countToDropFromEachSide == 0) {<NEW_LINE>return numbers;<NEW_LINE>}<NEW_LINE>var sorted = numbers.stream().sorted();<NEW_LINE>var oneSideTrimmed = sorted.skip(countToDropFromEachSide);<NEW_LINE>// Here, having already trimmed the left-side, we are implicitly trimming<NEW_LINE>// the right-side by specifying a limit to the stream's length.<NEW_LINE>// An explicit right-side drop/trim/skip is not supported by the Stream API.<NEW_LINE>// visada > 0? ir <= count?<NEW_LINE>var countAfterTrim = count - (countToDropFromEachSide * 2);<NEW_LINE>var <MASK><NEW_LINE>return bothSidesTrimmed.collect(Collectors.toList());<NEW_LINE>} | bothSidesTrimmed = oneSideTrimmed.limit(countAfterTrim); |
739,012 | public boolean execute(CommandSender sender, String commandLabel, String[] args) {<NEW_LINE>if (!this.testPermission(sender)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>int chunksCollected = 0;<NEW_LINE>int entitiesCollected = 0;<NEW_LINE>int tilesCollected = 0;<NEW_LINE>long memory = Runtime.getRuntime().freeMemory();<NEW_LINE>for (Level level : sender.getServer().getLevels().values()) {<NEW_LINE>int chunksCount = level.getChunks().size();<NEW_LINE>int entitiesCount = level.getEntities().length;<NEW_LINE>int tilesCount = level.getBlockEntities().size();<NEW_LINE>level.doChunkGarbageCollection();<NEW_LINE>level.unloadChunks(true);<NEW_LINE>chunksCollected += chunksCount - level.getChunks().size();<NEW_LINE>entitiesCollected += entitiesCount - level.getEntities().length;<NEW_LINE>tilesCollected += tilesCount - level.getBlockEntities().size();<NEW_LINE>}<NEW_LINE>ThreadCache.clean();<NEW_LINE>System.gc();<NEW_LINE>long freedMemory = Runtime.getRuntime().freeMemory() - memory;<NEW_LINE>sender.sendMessage(TextFormat.GREEN + "---- " + TextFormat.WHITE + "Garbage collection result" + TextFormat.GREEN + " ----");<NEW_LINE>sender.sendMessage(TextFormat.GOLD + "Chunks: " + TextFormat.RED + chunksCollected);<NEW_LINE>sender.sendMessage(TextFormat.GOLD + <MASK><NEW_LINE>sender.sendMessage(TextFormat.GOLD + "Block Entities: " + TextFormat.RED + tilesCollected);<NEW_LINE>sender.sendMessage(TextFormat.GOLD + "Memory freed: " + TextFormat.RED + NukkitMath.round((freedMemory / 1024d / 1024d), 2) + " MB");<NEW_LINE>return true;<NEW_LINE>} | "Entities: " + TextFormat.RED + entitiesCollected); |
591,953 | final CreateDirectConnectGatewayResult executeCreateDirectConnectGateway(CreateDirectConnectGatewayRequest createDirectConnectGatewayRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createDirectConnectGatewayRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateDirectConnectGatewayRequest> request = null;<NEW_LINE>Response<CreateDirectConnectGatewayResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateDirectConnectGatewayRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createDirectConnectGatewayRequest));<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, "Direct Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateDirectConnectGateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateDirectConnectGatewayResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateDirectConnectGatewayResultJsonUnmarshaller());<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,775,403 | public <T> T deserialze(DefaultJSONParser parser, Type clazz, Object fieldName) {<NEW_LINE>final JSONLexer lexer = parser.lexer;<NEW_LINE>Long longObject;<NEW_LINE>try {<NEW_LINE>final int token = lexer.token();<NEW_LINE>if (token == JSONToken.LITERAL_INT) {<NEW_LINE>long longValue = lexer.longValue();<NEW_LINE><MASK><NEW_LINE>longObject = Long.valueOf(longValue);<NEW_LINE>} else if (token == JSONToken.LITERAL_FLOAT) {<NEW_LINE>BigDecimal number = lexer.decimalValue();<NEW_LINE>longObject = TypeUtils.longValue(number);<NEW_LINE>lexer.nextToken(JSONToken.COMMA);<NEW_LINE>} else {<NEW_LINE>if (token == JSONToken.LBRACE) {<NEW_LINE>JSONObject jsonObject = new JSONObject(true);<NEW_LINE>parser.parseObject(jsonObject);<NEW_LINE>longObject = TypeUtils.castToLong(jsonObject);<NEW_LINE>} else {<NEW_LINE>Object value = parser.parse();<NEW_LINE>longObject = TypeUtils.castToLong(value);<NEW_LINE>}<NEW_LINE>if (longObject == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new JSONException("parseLong error, field : " + fieldName, ex);<NEW_LINE>}<NEW_LINE>return //<NEW_LINE>//<NEW_LINE>clazz == AtomicLong.class ? (T) new AtomicLong(longObject.longValue()) : (T) longObject;<NEW_LINE>} | lexer.nextToken(JSONToken.COMMA); |
1,694,467 | private void extractColumns(ResultSet set, Table.Factory table) throws SQLException {<NEW_LINE>String col1 = set.getString(ExtensionTableProviderTable.COL_1);<NEW_LINE>if (col1 != null) {<NEW_LINE>table.columnOne(col1, extractIcon(set, "i1"));<NEW_LINE>table.columnOneFormat(extractFormat(set, ExtensionTableProviderTable.FORMAT_1));<NEW_LINE>}<NEW_LINE>String col2 = set.getString(ExtensionTableProviderTable.COL_2);<NEW_LINE>if (col2 != null) {<NEW_LINE>table.columnTwo(col2, extractIcon(set, "i2"));<NEW_LINE>table.columnTwoFormat(extractFormat(set, ExtensionTableProviderTable.FORMAT_2));<NEW_LINE>}<NEW_LINE>String col3 = set.getString(ExtensionTableProviderTable.COL_3);<NEW_LINE>if (col3 != null) {<NEW_LINE>table.columnThree(col3, extractIcon(set, "i3"));<NEW_LINE>table.columnThreeFormat(extractFormat(set, ExtensionTableProviderTable.FORMAT_3));<NEW_LINE>}<NEW_LINE>String col4 = set.getString(ExtensionTableProviderTable.COL_4);<NEW_LINE>if (col4 != null) {<NEW_LINE>table.columnFour(col4<MASK><NEW_LINE>table.columnFourFormat(extractFormat(set, ExtensionTableProviderTable.FORMAT_4));<NEW_LINE>}<NEW_LINE>String col5 = set.getString(ExtensionTableProviderTable.COL_5);<NEW_LINE>if (col5 != null) {<NEW_LINE>table.columnFive(col5, extractIcon(set, "i5"));<NEW_LINE>table.columnFiveFormat(extractFormat(set, ExtensionTableProviderTable.FORMAT_5));<NEW_LINE>}<NEW_LINE>} | , extractIcon(set, "i4")); |
1,762,438 | public void save() throws Exception {<NEW_LINE>try {<NEW_LINE>class_mon.enter();<NEW_LINE>Map map = new HashMap();<NEW_LINE>List filters = new ArrayList();<NEW_LINE>map.put("ranges", filters);<NEW_LINE>List<Iterator<IpRangeImpl>> iters = Arrays.asList(range_manager_v4.getEntries().iterator(), range_manager_v6.getEntries().iterator());<NEW_LINE>for (Iterator<IpRangeImpl> iter : iters) {<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>IpRangeImpl range = iter.next();<NEW_LINE>if (range.isValid() && !range.isSessionOnly()) {<NEW_LINE>String description = range.getDescription();<NEW_LINE>String startIp = range.getStartIp();<NEW_LINE>String endIp = range.getEndIp();<NEW_LINE>Map mapRange = new HashMap();<NEW_LINE>mapRange.put("description", description.getBytes("UTF-8"));<NEW_LINE>mapRange.put("start", startIp);<NEW_LINE>mapRange.put("end", endIp);<NEW_LINE>if (!range.isV4()) {<NEW_LINE>mapRange.put("type", 2L);<NEW_LINE>}<NEW_LINE>filters.add(mapRange);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>FileOutputStream fos = null;<NEW_LINE>try {<NEW_LINE>// Open the file<NEW_LINE>File filtersFile = FileUtil.getUserFile("filters.config");<NEW_LINE>fos = FileUtil.newFileOutputStream(filtersFile);<NEW_LINE>fos.write<MASK><NEW_LINE>} finally {<NEW_LINE>if (fos != null) {<NEW_LINE>fos.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>class_mon.exit();<NEW_LINE>}<NEW_LINE>} | (BEncoder.encode(map)); |
294,679 | final CreateTransitGatewayVpcAttachmentResult executeCreateTransitGatewayVpcAttachment(CreateTransitGatewayVpcAttachmentRequest createTransitGatewayVpcAttachmentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createTransitGatewayVpcAttachmentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateTransitGatewayVpcAttachmentRequest> request = null;<NEW_LINE>Response<CreateTransitGatewayVpcAttachmentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateTransitGatewayVpcAttachmentRequestMarshaller().marshall(super.beforeMarshalling(createTransitGatewayVpcAttachmentRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateTransitGatewayVpcAttachment");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<CreateTransitGatewayVpcAttachmentResult> responseHandler = new StaxResponseHandler<CreateTransitGatewayVpcAttachmentResult>(new CreateTransitGatewayVpcAttachmentResultStaxUnmarshaller());<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); |
230,447 | private String encodeDecimal() {<NEW_LINE>if (isBasicPlane()) {<NEW_LINE>return encodeDecimalBasic();<NEW_LINE>}<NEW_LINE>int digit;<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>int i = 0;<NEW_LINE>for (Iterator<Integer> iter = newSubsequenceIterator(); iter.hasNext(); i++) {<NEW_LINE>int codePoint = iter.next();<NEW_LINE>if (isPythonSpace(codePoint)) {<NEW_LINE>sb.append(' ');<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>digit = <MASK><NEW_LINE>if (digit >= 0) {<NEW_LINE>sb.append(digit);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (0 < codePoint && codePoint < 256) {<NEW_LINE>sb.appendCodePoint(codePoint);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// All other characters are considered unencodable<NEW_LINE>codecs.encoding_error("strict", "decimal", getString(), i, i + 1, "invalid decimal Unicode string");<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>} | Character.digit(codePoint, 10); |
43,156 | private List<ColumnMetaData> buildGetTablesColumnMetaDataList() {<NEW_LINE>List<ColumnMetaData> columnMetaDataList = new ArrayList<>();<NEW_LINE>// 1. TABLE_CAT<NEW_LINE>columnMetaDataList.add(buildTableCatalogMeta(1));<NEW_LINE>// 2. TABLE_SCHEM<NEW_LINE>columnMetaDataList.add(buildTableSchemaMeta(2));<NEW_LINE>// 3. TABLE_NAME<NEW_LINE>columnMetaDataList.add(buildTableNameMeta(3));<NEW_LINE>// 4. TABLE_TYPE<NEW_LINE>columnMetaDataList.add(buildTableTypeMeta(4));<NEW_LINE>// 5. remarks<NEW_LINE>columnMetaDataList<MASK><NEW_LINE>// 6. TYPE_CAT<NEW_LINE>columnMetaDataList.add(buildTypeCatMeta(6));<NEW_LINE>// 7. TYPE_SCHEM<NEW_LINE>columnMetaDataList.add(buildTypeSchemaMeta(7));<NEW_LINE>// 8. TYPE_NAME<NEW_LINE>columnMetaDataList.add(buildTypeNameMeta(8));<NEW_LINE>// 9. SELF_REFERENCING_COL_NAME<NEW_LINE>columnMetaDataList.add(buildSelfReferencingColName(9));<NEW_LINE>// 10. REF_GENERATION<NEW_LINE>columnMetaDataList.add(buildRefGenerationMeta(10));<NEW_LINE>return columnMetaDataList;<NEW_LINE>} | .add(buildRemarksMeta(5)); |
1,228,718 | // Here's where we do the real work...<NEW_LINE>public static void parseFile(String f, InputStream s) throws Exception {<NEW_LINE>try {<NEW_LINE>// set this File as the currentFileName<NEW_LINE>currentFileName = f;<NEW_LINE>// Create a scanner that reads from the input stream passed to us<NEW_LINE>PascalLexer lexer = new PascalLexer(s);<NEW_LINE>// Create a parser that reads from the scanner<NEW_LINE><MASK><NEW_LINE>// set AST type to PascalAST (has symbol)<NEW_LINE>parser.setASTNodeClass("PascalAST");<NEW_LINE>// start parsing at the program rule<NEW_LINE>parser.program();<NEW_LINE>CommonAST t = (CommonAST) parser.getAST();<NEW_LINE>// do something with the tree<NEW_LINE>parser.doTreeAction(f, parser.getAST(), parser.getTokenNames());<NEW_LINE>// System.out.println(parser.getAST().toStringList());<NEW_LINE>// build symbol table<NEW_LINE>// Get the tree out of the parser<NEW_LINE>AST resultTree1 = parser.getAST();<NEW_LINE>// Make an instance of the tree parser<NEW_LINE>// PascalTreeParserSuper treeParser1 = new PascalTreeParserSuper();<NEW_LINE>SymtabPhase treeParser1 = new SymtabPhase();<NEW_LINE>treeParser1.setASTNodeClass("PascalAST");<NEW_LINE>// Begin tree parser at only rule<NEW_LINE>treeParser1.program(resultTree1);<NEW_LINE>// parser.doTreeAction(f, treeParser1.getAST(), treeParser1.getTokenNames());<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("parser exception: " + e);<NEW_LINE>// so we can get stack trace<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | PascalParser parser = new PascalParser(lexer); |
1,330,537 | public ListContactReferencesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListContactReferencesResult listContactReferencesResult = new ListContactReferencesResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listContactReferencesResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("ReferenceSummaryList", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listContactReferencesResult.setReferenceSummaryList(new ListUnmarshaller<ReferenceSummary>(ReferenceSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listContactReferencesResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listContactReferencesResult;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
321,783 | public static void replaceKEYCLOAKMethodWithBASIC(Archive<?> archive) {<NEW_LINE>if (!archive.contains(DeploymentArchiveProcessorUtils.WEBXML_PATH))<NEW_LINE>return;<NEW_LINE>try {<NEW_LINE>Document webXmlDoc = loadXML(archive.get(DeploymentArchiveProcessorUtils.WEBXML_PATH).getAsset().openStream());<NEW_LINE>LOG.debug("Setting BASIC as auth-method in WEB.XML for " + archive.getName());<NEW_LINE>modifyDocElementValue(webXmlDoc, "auth-method", "KEYCLOAK-SAML", "BASIC");<NEW_LINE>modifyDocElementValue(webXmlDoc, "auth-method", "KEYCLOAK", "BASIC");<NEW_LINE>archive.add(new StringAsset((documentToString(webXmlDoc<MASK><NEW_LINE>} catch (IllegalArgumentException ex) {<NEW_LINE>throw new RuntimeException("Error when processing " + archive.getName(), ex);<NEW_LINE>}<NEW_LINE>} | ))), DeploymentArchiveProcessorUtils.WEBXML_PATH); |
40,441 | public void importDirectory(String tableName, String dir, String failureDir, boolean setTime) throws IOException, AccumuloSecurityException, TableNotFoundException, AccumuloException {<NEW_LINE>EXISTING_TABLE_NAME.validate(tableName);<NEW_LINE>checkArgument(dir != null, "dir is null");<NEW_LINE>checkArgument(failureDir != null, "failureDir is null");<NEW_LINE>// check for table existence<NEW_LINE>context.getTableId(tableName);<NEW_LINE>Path dirPath = checkPath(dir, "Bulk", "");<NEW_LINE>Path failPath = <MASK><NEW_LINE>List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes(UTF_8)), ByteBuffer.wrap(dirPath.toString().getBytes(UTF_8)), ByteBuffer.wrap(failPath.toString().getBytes(UTF_8)), ByteBuffer.wrap((setTime + "").getBytes(UTF_8)));<NEW_LINE>Map<String, String> opts = new HashMap<>();<NEW_LINE>try {<NEW_LINE>doTableFateOperation(tableName, TableNotFoundException.class, FateOperation.TABLE_BULK_IMPORT, args, opts);<NEW_LINE>} catch (TableExistsException e) {<NEW_LINE>// should not happen<NEW_LINE>throw new AssertionError(e);<NEW_LINE>}<NEW_LINE>} | checkPath(failureDir, "Bulk", "failure"); |
618,265 | private Mono<Response<Void>> moveWithResponseAsync(String resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (moveResourceEnvelope == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter moveResourceEnvelope is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>moveResourceEnvelope.validate();<NEW_LINE>}<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.move(this.client.getEndpoint(), resourceGroupName, this.client.getSubscriptionId(), this.client.getApiVersion(), moveResourceEnvelope, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); |
458,619 | public AwsJobPresignedUrlConfig unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AwsJobPresignedUrlConfig awsJobPresignedUrlConfig = new AwsJobPresignedUrlConfig();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("expiresInSec", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>awsJobPresignedUrlConfig.setExpiresInSec(context.getUnmarshaller(Long.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return awsJobPresignedUrlConfig;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,159,697 | final CreateRouteResult executeCreateRoute(CreateRouteRequest createRouteRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createRouteRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateRouteRequest> request = null;<NEW_LINE>Response<CreateRouteResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateRouteRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createRouteRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "ApiGatewayV2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateRoute");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateRouteResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateRouteResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
957,416 | public Socket createSocket(String host, int port) throws IOException {<NEW_LINE>char[] passphrase = null;<NEW_LINE>if (keyStorePassword != null) {<NEW_LINE>passphrase = keyStorePassword.toCharArray();<NEW_LINE>}<NEW_LINE>KeyStore keyStore = null;<NEW_LINE>if (keyStoreLocation != null) {<NEW_LINE>keyStore = loadStore(keyStoreLocation, passphrase, keyStoreType);<NEW_LINE>}<NEW_LINE>KeyStore trustStore;<NEW_LINE>if (trustStoreLocation != null) {<NEW_LINE>trustStore = loadStore(trustStoreLocation, trustStorePassword.toCharArray(), trustStoreType);<NEW_LINE>} else {<NEW_LINE>trustStore = keyStore;<NEW_LINE>}<NEW_LINE>if (alias == null) {<NEW_LINE>throw new IOException("SSL certificate alias cannot be null; MUST be set for SSLServerSocketFactory!");<NEW_LINE>}<NEW_LINE>KeyManagerFactory kmf;<NEW_LINE>SSLContext ctx;<NEW_LINE>try {<NEW_LINE>kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());<NEW_LINE>kmf.init(keyStore, passphrase);<NEW_LINE>ctx = SSLContext.getInstance("TLS");<NEW_LINE>TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());<NEW_LINE>tmf.init(trustStore);<NEW_LINE>ctx.init(AliasKeyManager.wrap(kmf.getKeyManagers(), alias), tmf.getTrustManagers(), null);<NEW_LINE>} catch (GeneralSecurityException e) {<NEW_LINE>throw new IOException(e);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (factory == null) {<NEW_LINE>throw new IOException("Unable to obtain SSLSocketFactory for provided KeyStore");<NEW_LINE>}<NEW_LINE>return factory.createSocket(host, port);<NEW_LINE>} | SSLSocketFactory factory = ctx.getSocketFactory(); |
106,796 | protected void doBalanceSentinel(SentinelGroupModel sentinelGroupModel, List<DcClusterShardTbl> dcClusterShards) {<NEW_LINE>dcClusterShards.forEach(dcClusterShard -> {<NEW_LINE>SentinelGroupModel suitableSentinel = sentinelBalanceService.selectSentinelWithoutCache(dcId, ClusterType.ONE_WAY);<NEW_LINE>if (null == suitableSentinel) {<NEW_LINE>getLogger().info("[doBalanceSentinel]{} none sentinel selected", getName());<NEW_LINE>throw new <MASK><NEW_LINE>} else if (suitableSentinel.getSentinelGroupId() == sentinelGroupModel.getSentinelGroupId()) {<NEW_LINE>getLogger().info("[doBalanceSentinel] no other sentinel to use");<NEW_LINE>throw new NoSentinelsToUseException(getName() + "no other sentinel to use");<NEW_LINE>}<NEW_LINE>dcClusterShard.setSetinelId(suitableSentinel.getSentinelGroupId());<NEW_LINE>try {<NEW_LINE>dcClusterShardService.updateDcClusterShard(dcClusterShard);<NEW_LINE>sentinelGroupModel.setShardCount(sentinelGroupModel.getShardCount() - 1);<NEW_LINE>} catch (DalException e) {<NEW_LINE>getLogger().info("[doBalanceSentinel][fail, skip] {}", dcClusterShard, e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | NoSentinelsToUseException(getName() + "none sentinel selected"); |
269,925 | private void buildHashPattern(Label testEnd, Variable result, Variable deconstructed, HashPatternNode pattern, Operand obj, boolean inAlteration) {<NEW_LINE>Variable d = deconstructHashPatternKeys(testEnd, pattern, result, obj);<NEW_LINE>label(endHashCheck -> {<NEW_LINE>addInstr(new EQQInstr(scope, result, manager.getHashClass(), d, false, true));<NEW_LINE>cond(endHashCheck, result, tru(), () -> type_error("deconstruct_keys must return Hash"));<NEW_LINE>});<NEW_LINE>// rest args destructively deletes elements from deconstruct_keys and the default impl is 'self'.<NEW_LINE>if (pattern.hasRestArg())<NEW_LINE>call(d, d, "dup");<NEW_LINE>if (pattern.hasKeywordArgs()) {<NEW_LINE>List<KeyValuePair<Node, Node>> kwargs = pattern.getKeywordArgs().getPairs();<NEW_LINE>for (KeyValuePair<Node, Node> pair : kwargs) {<NEW_LINE>// FIXME: only build literals (which are guaranteed to build without raising).<NEW_LINE>Operand key = build(pair.getKey());<NEW_LINE>call(result, d, "key?", key);<NEW_LINE>cond_ne(testEnd, result, tru());<NEW_LINE>String method = pattern.hasRestArg() ? "delete" : "[]";<NEW_LINE>Operand value = <MASK><NEW_LINE>buildPatternEach(testEnd, result, deconstructed, value, pair.getValue(), inAlteration);<NEW_LINE>cond_ne(testEnd, result, tru());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>call(result, d, "empty?");<NEW_LINE>cond_ne(testEnd, result, tru());<NEW_LINE>}<NEW_LINE>if (pattern.hasRestArg()) {<NEW_LINE>if (pattern.getRestArg() instanceof NilRestArgNode) {<NEW_LINE>call(result, d, "empty?");<NEW_LINE>cond_ne(testEnd, result, tru());<NEW_LINE>} else if (pattern.isNamedRestArg()) {<NEW_LINE>buildPatternEach(testEnd, result, deconstructed, d, pattern.getRestArg(), inAlteration);<NEW_LINE>cond_ne(testEnd, result, tru());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | call(d, method, key); |
29,799 | /*<NEW_LINE>* (non-Javadoc)<NEW_LINE>* @see<NEW_LINE>* com.aptana.editor.common.contentassist.IUserAgentPreferenceManager#savePreference(org.eclipse.core.resources.<NEW_LINE>* IProject, java.util.Map)<NEW_LINE>*/<NEW_LINE>public void savePreference(IProject project, Map<String, String[]> natureIdToUserAgents) {<NEW_LINE>IEclipsePreferences preferences = null;<NEW_LINE>if (project != null) {<NEW_LINE>// Save to the project scope<NEW_LINE>preferences = new ProjectScope(project).getNode(CommonEditorPlugin.PLUGIN_ID);<NEW_LINE>} else {<NEW_LINE>// Save to the instance scope (plugin)<NEW_LINE>preferences = InstanceScope.INSTANCE.getNode(CommonEditorPlugin.PLUGIN_ID);<NEW_LINE>}<NEW_LINE>// convert active user agents to a string representation<NEW_LINE>List<String> natureEntries = new ArrayList<String>();<NEW_LINE>for (Map.Entry<String, String[]> entry : natureIdToUserAgents.entrySet()) {<NEW_LINE>String natureID = entry.getKey();<NEW_LINE>String userAgentIDs = StringUtil.join(USER_AGENT_DELIMITER, entry.getValue());<NEW_LINE>natureEntries.add(natureID + NAME_VALUE_SEPARATOR + userAgentIDs);<NEW_LINE>}<NEW_LINE>String value = StringUtil.join(ENTRY_DELIMITER, natureEntries);<NEW_LINE>// save value<NEW_LINE>if (preferences != null) {<NEW_LINE>preferences.put(IPreferenceConstants.USER_AGENT_PREFERENCE, value);<NEW_LINE>try {<NEW_LINE>preferences.flush();<NEW_LINE>} catch (BackingStoreException e) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>IdeLog.logWarning(CommonEditorPlugin.<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>IdeLog.// $NON-NLS-1$<NEW_LINE>logError(// $NON-NLS-1$<NEW_LINE>CommonEditorPlugin.getDefault(), "Error saving the user-agent preferences. Preferences node was null");<NEW_LINE>}<NEW_LINE>} | getDefault(), "Error saving the user-agent preferences.", e); |
742,736 | public Neighbor<K, V>[] search(K q, int k) {<NEW_LINE>if (k <= 0) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (k > data.size()) {<NEW_LINE>throw new IllegalArgumentException("Neighbor array length is larger than the data size");<NEW_LINE>}<NEW_LINE>double[] dist = keys.stream().parallel().mapToDouble(x -> distance.d(x, q)).toArray();<NEW_LINE>HeapSelect<NeighborBuilder<K, V>> heap = new HeapSelect<>(NeighborBuilder.class, k);<NEW_LINE>for (int i = 0; i < k; i++) {<NEW_LINE>heap.add(new NeighborBuilder<>());<NEW_LINE>}<NEW_LINE>for (int i = 0; i < dist.length; i++) {<NEW_LINE>NeighborBuilder<K, V> datum = heap.peek();<NEW_LINE>if (dist[i] < datum.distance && q != keys.get(i)) {<NEW_LINE>datum.distance = dist[i];<NEW_LINE>datum.index = i;<NEW_LINE>datum.key = keys.get(i);<NEW_LINE>datum.value = data.get(i);<NEW_LINE>heap.heapify();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>heap.sort();<NEW_LINE>return Arrays.stream(heap.toArray()).map(NeighborBuilder::toNeighbor).toArray(Neighbor[]::new);<NEW_LINE>} | throw new IllegalArgumentException("Invalid k: " + k); |
388,087 | public void rollover() throws RolloverFailure {<NEW_LINE>// when rollover is called the elapsed period's file has<NEW_LINE>// been already closed. This is a working assumption of this method.<NEW_LINE>String elapsedPeriodsFileName = timeBasedFileNamingAndTriggeringPolicy.getElapsedPeriodsFileName();<NEW_LINE>String elapsedPeriodStem = FileFilterUtil.afterLastSlash(elapsedPeriodsFileName);<NEW_LINE>if (compressionMode == CompressionMode.NONE) {<NEW_LINE>if (getParentsRawFileProperty() != null) {<NEW_LINE>renameUtil.rename(getParentsRawFileProperty(), elapsedPeriodsFileName);<NEW_LINE>}<NEW_LINE>// else { nothing to do if CompressionMode == NONE and parentsRawFileProperty == null }<NEW_LINE>} else {<NEW_LINE>if (getParentsRawFileProperty() == null) {<NEW_LINE>compressionFuture = compressor.asyncCompress(elapsedPeriodsFileName, elapsedPeriodsFileName, elapsedPeriodStem);<NEW_LINE>} else {<NEW_LINE>compressionFuture = renameRawAndAsyncCompress(elapsedPeriodsFileName, elapsedPeriodStem);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (archiveRemover != null) {<NEW_LINE>Date now = new Date(timeBasedFileNamingAndTriggeringPolicy.getCurrentTime());<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | cleanUpFuture = archiveRemover.cleanAsynchronously(now); |
553,568 | public static MethodAnnotation fromCalledMethod(DismantleBytecode visitor) {<NEW_LINE>String className = visitor.getDottedClassConstantOperand();<NEW_LINE>String methodName = visitor.getNameConstantOperand();<NEW_LINE>String methodSig = visitor.getSigConstantOperand();<NEW_LINE>if (visitor instanceof OpcodeStackDetector && visitor.getOpcode() != Const.INVOKESTATIC) {<NEW_LINE>int params = PreorderVisitor.getNumberArguments(methodSig);<NEW_LINE>OpcodeStackDetector oVisitor = (OpcodeStackDetector) visitor;<NEW_LINE>if (!oVisitor.getStack().isTop() && oVisitor.getStack().getStackDepth() > params) {<NEW_LINE>OpcodeStack.Item item = oVisitor.<MASK><NEW_LINE>String cName = ClassName.fromFieldSignature(item.getSignature());<NEW_LINE>if (cName != null) {<NEW_LINE>className = cName;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return fromCalledMethod(className, methodName, methodSig, visitor.getOpcode() == Const.INVOKESTATIC);<NEW_LINE>} | getStack().getStackItem(params); |
1,487,115 | Object execute(Object[] arguments, @Cached HPyAsContextNode asContextNode, @Cached FromCharPointerNode fromCharPointerNode, @Cached CastToJavaStringNode castToJavaStringNode, @Cached HPyAsHandleNode asHandleNode, @Cached HPyTransformExceptionToNativeNode transformExceptionToNativeNode, @Exclusive @Cached GilNode gil) throws ArityException {<NEW_LINE>checkArity(arguments, 2);<NEW_LINE>boolean mustRelease = gil.acquire();<NEW_LINE>try {<NEW_LINE>GraalHPyContext context = asContextNode<MASK><NEW_LINE>try {<NEW_LINE>String name = castToJavaStringNode.execute(fromCharPointerNode.execute(arguments[1]));<NEW_LINE>return asHandleNode.execute(context, AbstractImportNode.importModule(name));<NEW_LINE>} catch (CannotCastException e) {<NEW_LINE>throw CompilerDirectives.shouldNotReachHere();<NEW_LINE>} catch (PException e) {<NEW_LINE>transformExceptionToNativeNode.execute(context, e);<NEW_LINE>return GraalHPyHandle.NULL_HANDLE;<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>gil.release(mustRelease);<NEW_LINE>}<NEW_LINE>} | .execute(arguments[0]); |
1,446,671 | static boolean isWindowsWellKnownSid(String sid) {<NEW_LINE>String tempSID = stripWindowsBackupPostfix(sid);<NEW_LINE>if (SPECIAL_SIDS_MAP.containsKey(tempSID)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>for (String specialPrefix : SPECIAL_SID_PREFIXES_MAP.keySet()) {<NEW_LINE>if (tempSID.startsWith(specialPrefix)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Matcher <MASK><NEW_LINE>if (match.find()) {<NEW_LINE>Integer domainIdentifier = Integer.valueOf(match.group(1));<NEW_LINE>// All the prefixes in the range S-1-5-80 to S-1-5-111 are special<NEW_LINE>if (domainIdentifier != null && domainIdentifier >= 80 && domainIdentifier <= 111) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | match = WINDOWS_SPECIAL_ACCOUNT_PREFIX_REGEX.matcher(tempSID); |
842,041 | public void create() {<NEW_LINE>if (array != null) {<NEW_LINE>Object[] newArray = (Object[]) Array.newInstance(getConvertedType(<MASK><NEW_LINE>System.arraycopy(array, 0, newArray, 0, array.length);<NEW_LINE>// throw away the old array!<NEW_LINE>array = newArray;<NEW_LINE>array[array.length - 1] = defaultValue();<NEW_LINE>} else {<NEW_LINE>// throw away the old array!<NEW_LINE>array = (Object[]) Array.newInstance(getConvertedType(), 1);<NEW_LINE>array[0] = defaultValue();<NEW_LINE>}<NEW_LINE>IndexedPropertyEditor.this.firePropertyChange();<NEW_LINE>DisplayIndexedNode din = new DisplayIndexedNode(array.length - 1);<NEW_LINE>getChildren().add(new Node[] { din });<NEW_LINE>Index i = getCookie(Index.class);<NEW_LINE>i.addChangeListener(org.openide.util.WeakListeners.change(din, i));<NEW_LINE>} | ), array.length + 1); |
1,674,020 | public void createDataStream(CreateDataStreamClusterStateUpdateRequest request, ActionListener<AcknowledgedResponse> finalListener) {<NEW_LINE>AtomicReference<String> firstBackingIndexRef = new AtomicReference<>();<NEW_LINE>ActionListener<ClusterStateUpdateResponse> listener = ActionListener.wrap(response -> {<NEW_LINE>if (response.isAcknowledged()) {<NEW_LINE>String firstBackingIndexName = firstBackingIndexRef.get();<NEW_LINE>assert firstBackingIndexName != null;<NEW_LINE>activeShardsObserver.waitForActiveShards(new String[] { firstBackingIndexName }, ActiveShardCount.DEFAULT, request.masterNodeTimeout(), shardsAcked -> {<NEW_LINE>finalListener.onResponse(new AcknowledgedResponse(true));<NEW_LINE>}, finalListener::onFailure);<NEW_LINE>} else {<NEW_LINE>finalListener.<MASK><NEW_LINE>}<NEW_LINE>}, finalListener::onFailure);<NEW_LINE>clusterService.submitStateUpdateTask("create-data-stream [" + request.name + "]", new AckedClusterStateUpdateTask<ClusterStateUpdateResponse>(Priority.HIGH, request, listener) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ClusterState execute(ClusterState currentState) throws Exception {<NEW_LINE>ClusterState clusterState = createDataStream(metadataCreateIndexService, currentState, request);<NEW_LINE>firstBackingIndexRef.set(clusterState.metadata().dataStreams().get(request.name).getIndices().get(0).getName());<NEW_LINE>return clusterState;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected ClusterStateUpdateResponse newResponse(boolean acknowledged) {<NEW_LINE>return new ClusterStateUpdateResponse(acknowledged);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | onResponse(new AcknowledgedResponse(false)); |
614,831 | public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>if (savedInstanceState != null) {<NEW_LINE>String itemFileName = savedInstanceState.getString(KEY_ASK_MAP_DOWNLOAD_ITEM_FILENAME);<NEW_LINE>if (itemFileName != null) {<NEW_LINE>indexItem = getMyApplication().getDownloadThread().getIndexes().getIndexItem(itemFileName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>View view = inflater.inflate(R.layout.ask_map_download_fragment, container, false);<NEW_LINE>((ImageView) view.findViewById(R.id.titleIconImageView)).setImageDrawable(getIcon(R.drawable.ic_map, R.color.osmand_orange));<NEW_LINE>Button actionButtonOk = (Button) view.findViewById(R.id.actionButtonOk);<NEW_LINE>String titleText = null;<NEW_LINE>String descriptionText = null;<NEW_LINE>if (indexItem != null) {<NEW_LINE>if (indexItem.getBasename().equalsIgnoreCase(WorldRegion.WORLD_BASEMAP)) {<NEW_LINE>titleText = <MASK><NEW_LINE>descriptionText = getString(R.string.world_map_download_descr);<NEW_LINE>}<NEW_LINE>actionButtonOk.setText(getString(R.string.shared_string_download) + " (" + indexItem.getSizeDescription(getActivity()) + ")");<NEW_LINE>}<NEW_LINE>if (titleText != null) {<NEW_LINE>((TextView) view.findViewById(R.id.titleTextView)).setText(titleText);<NEW_LINE>}<NEW_LINE>if (descriptionText != null) {<NEW_LINE>((TextView) view.findViewById(R.id.descriptionTextView)).setText(descriptionText);<NEW_LINE>}<NEW_LINE>final ImageButton closeImageButton = (ImageButton) view.findViewById(R.id.closeImageButton);<NEW_LINE>closeImageButton.setImageDrawable(getContentIcon(R.drawable.ic_action_remove_dark));<NEW_LINE>closeImageButton.setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>dismiss();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>actionButtonOk.setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>if (indexItem != null) {<NEW_LINE>((DownloadActivity) getActivity()).startDownload(indexItem);<NEW_LINE>dismiss();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>view.findViewById(R.id.actionButtonCancel).setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>dismiss();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return view;<NEW_LINE>} | getString(R.string.index_item_world_basemap); |
1,669,780 | final DeleteResponseHeadersPolicyResult executeDeleteResponseHeadersPolicy(DeleteResponseHeadersPolicyRequest deleteResponseHeadersPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteResponseHeadersPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteResponseHeadersPolicyRequest> request = null;<NEW_LINE>Response<DeleteResponseHeadersPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteResponseHeadersPolicyRequestMarshaller().marshall(super.beforeMarshalling(deleteResponseHeadersPolicyRequest));<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, "CloudFront");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteResponseHeadersPolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteResponseHeadersPolicyResult> responseHandler = new StaxResponseHandler<DeleteResponseHeadersPolicyResult>(new DeleteResponseHeadersPolicyResultStaxUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
1,428,203 | public void propagateAreaLocations(OverlayEdge nodeEdge, int geomIndex) {<NEW_LINE>if (!inputGeometry.isArea(geomIndex))<NEW_LINE>return;<NEW_LINE>if (nodeEdge.degree() == 1)<NEW_LINE>return;<NEW_LINE>OverlayEdge eStart = findPropagationStartEdge(nodeEdge, geomIndex);<NEW_LINE>// no labelled edge found, so nothing to propagate<NEW_LINE>if (eStart == null)<NEW_LINE>return;<NEW_LINE>// initialize currLoc to location of L side<NEW_LINE>int currLoc = eStart.getLocation(geomIndex, Position.LEFT);<NEW_LINE><MASK><NEW_LINE>// Debug.println("\npropagateSideLabels geomIndex = " + geomIndex + " : " + eStart);<NEW_LINE>// Debug.print("BEFORE: " + toString(eStart));<NEW_LINE>do {<NEW_LINE>OverlayLabel label = e.getLabel();<NEW_LINE>if (!label.isBoundary(geomIndex)) {<NEW_LINE>label.setLocationLine(geomIndex, currLoc);<NEW_LINE>} else {<NEW_LINE>// must be a boundary edge<NEW_LINE>Assert.isTrue(label.hasSides(geomIndex));<NEW_LINE>int locRight = e.getLocation(geomIndex, Position.RIGHT);<NEW_LINE>if (locRight != currLoc) {<NEW_LINE>throw new TopologyException("side location conflict: arg " + geomIndex, e.getCoordinate());<NEW_LINE>}<NEW_LINE>int locLeft = e.getLocation(geomIndex, Position.LEFT);<NEW_LINE>if (locLeft == Location.NONE) {<NEW_LINE>Assert.shouldNeverReachHere("found single null side at " + e);<NEW_LINE>}<NEW_LINE>currLoc = locLeft;<NEW_LINE>}<NEW_LINE>e = e.oNextOE();<NEW_LINE>} while (e != eStart);<NEW_LINE>// Debug.print("AFTER: " + toString(eStart));<NEW_LINE>} | OverlayEdge e = eStart.oNextOE(); |
366,415 | public final void reduce(Object sendbuf, Object recvbuf, int count, Datatype type, Op op, int root) throws MPIException {<NEW_LINE>MPI.check();<NEW_LINE>op.setDatatype(type);<NEW_LINE>int sendoff = 0, recvoff = 0;<NEW_LINE>boolean sdb = false, rdb = false;<NEW_LINE>if (sendbuf instanceof Buffer && !(sdb = ((Buffer) sendbuf).isDirect())) {<NEW_LINE>sendoff = type.getOffset(sendbuf);<NEW_LINE>sendbuf = ((Buffer) sendbuf).array();<NEW_LINE>}<NEW_LINE>if (recvbuf instanceof Buffer && !(rdb = ((Buffer) recvbuf).isDirect())) {<NEW_LINE>recvoff = type.getOffset(recvbuf);<NEW_LINE>recvbuf = ((<MASK><NEW_LINE>}<NEW_LINE>reduce(handle, sendbuf, sdb, sendoff, recvbuf, rdb, recvoff, count, type.handle, type.baseType, op, op.handle, root);<NEW_LINE>} | Buffer) recvbuf).array(); |
994,797 | public static List<EntityDetail> findEntitiesByType(OMRSAPIHelper oMRSAPIHelper, String serverName, String userId, String type, String searchCriteria, Date asOfTime, Integer offset, Integer pageSize, SequencingOrder sequencingOrder, String sequencingProperty, String methodName) throws UserNotAuthorizedException, FunctionNotSupportedException, InvalidParameterException, RepositoryErrorException, PropertyErrorException, TypeErrorException, PagingErrorException {<NEW_LINE>// if offset or pagesize were not supplied then default them, so they can be converted to primitives.<NEW_LINE>if (offset == null) {<NEW_LINE>offset = new Integer(0);<NEW_LINE>}<NEW_LINE>if (pageSize == null) {<NEW_LINE>pageSize = new Integer(0);<NEW_LINE>}<NEW_LINE>if (sequencingProperty != null) {<NEW_LINE>try {<NEW_LINE>sequencingProperty = URLDecoder.decode(sequencingProperty, "UTF-8");<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>// TODO error<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (searchCriteria != null) {<NEW_LINE>try {<NEW_LINE>searchCriteria = URLDecoder.decode(searchCriteria, "UTF-8");<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>// TODO error<NEW_LINE>}<NEW_LINE>}<NEW_LINE>OpenMetadataTypesArchiveAccessor archiveAccessor = OpenMetadataTypesArchiveAccessor.getInstance();<NEW_LINE>TypeDef <MASK><NEW_LINE>String entityTypeGUID = typeDef.getGUID();<NEW_LINE>return // TODO limit by status ?<NEW_LINE>oMRSAPIHelper.// TODO limit by status ?<NEW_LINE>callFindEntitiesByPropertyValue(// TODO limit by status ?<NEW_LINE>userId, // TODO limit by status ?<NEW_LINE>entityTypeGUID, // TODO limit by status ?<NEW_LINE>searchCriteria, // TODO limit by status ?<NEW_LINE>offset.intValue(), // TODO limit by classification ?<NEW_LINE>null, null, asOfTime, sequencingProperty, sequencingOrder, pageSize);<NEW_LINE>} | typeDef = archiveAccessor.getEntityDefByName(type); |
670,863 | public static DeleteModelResponse unmarshall(DeleteModelResponse deleteModelResponse, UnmarshallerContext _ctx) {<NEW_LINE>deleteModelResponse.setRequestId(_ctx.stringValue("DeleteModelResponse.RequestId"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setAppId(_ctx.stringValue("DeleteModelResponse.Data.AppId"));<NEW_LINE>data.setContent(_ctx.mapValue("DeleteModelResponse.Data.Content"));<NEW_LINE>data.setCreateTime(_ctx.stringValue("DeleteModelResponse.Data.CreateTime"));<NEW_LINE>data.setDescription(_ctx.stringValue("DeleteModelResponse.Data.Description"));<NEW_LINE>data.setId(_ctx.stringValue("DeleteModelResponse.Data.Id"));<NEW_LINE>data.setLinkModelId(_ctx.stringValue("DeleteModelResponse.Data.LinkModelId"));<NEW_LINE>data.setLinkModuleId(_ctx.stringValue("DeleteModelResponse.Data.LinkModuleId"));<NEW_LINE>data.setLinked<MASK><NEW_LINE>data.setModelId(_ctx.stringValue("DeleteModelResponse.Data.ModelId"));<NEW_LINE>data.setModifiedTime(_ctx.stringValue("DeleteModelResponse.Data.ModifiedTime"));<NEW_LINE>data.setModuleId(_ctx.stringValue("DeleteModelResponse.Data.ModuleId"));<NEW_LINE>data.setModelName(_ctx.stringValue("DeleteModelResponse.Data.ModelName"));<NEW_LINE>data.setProps(_ctx.mapValue("DeleteModelResponse.Data.Props"));<NEW_LINE>data.setRevision(_ctx.integerValue("DeleteModelResponse.Data.Revision"));<NEW_LINE>data.setSchemaVersion(_ctx.stringValue("DeleteModelResponse.Data.SchemaVersion"));<NEW_LINE>data.setModelStatus(_ctx.stringValue("DeleteModelResponse.Data.ModelStatus"));<NEW_LINE>data.setSubType(_ctx.stringValue("DeleteModelResponse.Data.SubType"));<NEW_LINE>data.setModelType(_ctx.stringValue("DeleteModelResponse.Data.ModelType"));<NEW_LINE>data.setVisibility(_ctx.stringValue("DeleteModelResponse.Data.Visibility"));<NEW_LINE>List<Map<Object, Object>> attributes = _ctx.listMapValue("DeleteModelResponse.Data.Attributes");<NEW_LINE>data.setAttributes(attributes);<NEW_LINE>deleteModelResponse.setData(data);<NEW_LINE>return deleteModelResponse;<NEW_LINE>} | (_ctx.booleanValue("DeleteModelResponse.Data.Linked")); |
464,878 | private int writeFieldPermission(MetaField field, String[] row, int colIndex, String permName) {<NEW_LINE>MetaPermissionRule rule = ruleRepository.all().filter("self.metaPermission.name = ?1 and self.metaPermission.object = ?2 and self.field = ?3", permName, field.getMetaModel().getFullName(), field.getName()).fetchOne();<NEW_LINE>if (rule != null) {<NEW_LINE>row[colIndex++] = !rule.getCanRead() ? "" : "x";<NEW_LINE>row[colIndex++] = !rule.getCanWrite() ? "" : "x";<NEW_LINE>row[colIndex++] = "";<NEW_LINE>row[colIndex++] = "";<NEW_LINE>row[colIndex++] = !rule.getCanExport() ? "" : "x";<NEW_LINE>row[colIndex++] = "";<NEW_LINE>row[colIndex++] = "";<NEW_LINE>// readonly if<NEW_LINE>row[colIndex++] = Strings.isNullOrEmpty(rule.getReadonlyIf()) <MASK><NEW_LINE>// hide if<NEW_LINE>row[colIndex++] = Strings.isNullOrEmpty(rule.getHideIf()) ? "" : rule.getHideIf();<NEW_LINE>}<NEW_LINE>return colIndex;<NEW_LINE>} | ? "" : rule.getReadonlyIf(); |
1,449,397 | final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(untagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UntagResourceRequest> request = null;<NEW_LINE>Response<UntagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UntagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(untagResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "DataBrew");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UntagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UntagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
1,537,156 | protected static NbProcessDescriptor createPatchedExecutable(NbProcessDescriptor p) {<NEW_LINE>NbProcessDescriptor newP = null;<NEW_LINE>String[] args = org.openide.util.Utilities.parseParameters(p.getArguments());<NEW_LINE>if (args.length > 1) {<NEW_LINE>if (ExtWebBrowser.getEM().isLoggable(Level.FINE)) {<NEW_LINE>// NOI18N<NEW_LINE>ExtWebBrowser.getEM().log(Level.FINE, "Old arguments: " + p.getArguments());<NEW_LINE>}<NEW_LINE>StringBuffer newArgs = new StringBuffer();<NEW_LINE>boolean found = false;<NEW_LINE>for (int i = 0; i < args.length - 1; i++) {<NEW_LINE>if (newArgs.length() > 0) {<NEW_LINE>// NOI18N<NEW_LINE>newArgs.append(" ");<NEW_LINE>}<NEW_LINE>if (// NOI18N<NEW_LINE>args[i].indexOf("-remote") >= 0 && args[i + 1].indexOf("openURL(") >= 0) {<NEW_LINE>// NOI18N<NEW_LINE>found = true;<NEW_LINE>// NOI18N<NEW_LINE>newArgs.append("\"{URL}\"");<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>newArgs.append("\"" + args[i] + "\"");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (found) {<NEW_LINE>newP = new NbProcessDescriptor(p.getProcessName(), newArgs.toString(<MASK><NEW_LINE>}<NEW_LINE>if (ExtWebBrowser.getEM().isLoggable(Level.FINE)) {<NEW_LINE>// NOI18N<NEW_LINE>ExtWebBrowser.getEM().log(Level.FINE, "ProcessName: " + p.getProcessName());<NEW_LINE>// NOI18N<NEW_LINE>ExtWebBrowser.getEM().log(Level.FINE, "New arguments: " + newArgs.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newP;<NEW_LINE>} | ), p.getInfo()); |
1,425,474 | private void colourLine(LineStyleEvent event) {<NEW_LINE>if (theme == null)<NEW_LINE>return;<NEW_LINE>if (!mateText.shouldColour())<NEW_LINE>return;<NEW_LINE>int eventLine = mateText.getControl().getLineAtOffset(event.lineOffset);<NEW_LINE>// System.out.printf("c%d, ", eventLine);<NEW_LINE>// ArrayList<Scope> scopes = mateText.parser.root.scopesOnLine(eventLine);<NEW_LINE>int startLineOffset = event.lineOffset;<NEW_LINE>int endLineOffset;<NEW_LINE>if (eventLine >= mateText.getControl().getLineCount() - 1)<NEW_LINE>endLineOffset = mateText.getControl().getCharCount();<NEW_LINE>else<NEW_LINE>endLineOffset = mateText.getControl().getOffsetAtLine(eventLine + 1);<NEW_LINE>ArrayList<Scope> scopes = mateText.parser.<MASK><NEW_LINE>// System.out.printf("[Color] colouring %d (%d-%d) n%d\n", eventLine, startLineOffset, endLineOffset, scopes.size());<NEW_LINE>// System.out.printf("[Color] got to colour %d scopes\n", scopes.size());<NEW_LINE>ArrayList<StyleRange> styleRanges = new ArrayList<StyleRange>();<NEW_LINE>for (Scope scope : scopes) {<NEW_LINE>// System.out.printf("[Color] scope: %s\n", scope.name);<NEW_LINE>if (scope.parent == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (scope.name == null && scope.pattern != null && (scope.pattern instanceof SinglePattern || ((DoublePattern) scope.pattern).contentName == null)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>addStyleRangeForScope(styleRanges, scope, false, event);<NEW_LINE>if (scope.pattern instanceof DoublePattern && ((DoublePattern) scope.pattern).contentName != null && scope.isCapture == false)<NEW_LINE>addStyleRangeForScope(styleRanges, scope, true, event);<NEW_LINE>// printStyleRanges(styleRanges);<NEW_LINE>}<NEW_LINE>int tabWidth = mateText.getControl().getTabs();<NEW_LINE>addMarginColumnStyleRange(styleRanges, event, tabWidth);<NEW_LINE>event.styles = (StyleRange[]) styleRanges.toArray(new StyleRange[0]);<NEW_LINE>} | root.scopesBetween(startLineOffset, endLineOffset); |
336,468 | public Completion interpret(ExecutionContext context, boolean debug) {<NEW_LINE>List<Statement> content = getBlockContent();<NEW_LINE>Object completionValue = Types.UNDEFINED;<NEW_LINE>Statement previousStatement = null;<NEW_LINE>for (Statement each : content) {<NEW_LINE>Position position = each.getPosition();<NEW_LINE>if (position != null) {<NEW_LINE>context.setLineNumber(position.getLine());<NEW_LINE>context.setColumnNumber(position.getColumn());<NEW_LINE>}<NEW_LINE>if (!(each instanceof FunctionDeclaration)) {<NEW_LINE>context.debug(each, previousStatement);<NEW_LINE>}<NEW_LINE>Completion completion = (Completion) <MASK><NEW_LINE>if (!(each instanceof FunctionDeclaration)) {<NEW_LINE>previousStatement = each;<NEW_LINE>}<NEW_LINE>if (completion.type == Completion.Type.NORMAL) {<NEW_LINE>completionValue = completion.value;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (completion.type == Completion.Type.CONTINUE) {<NEW_LINE>return (completion);<NEW_LINE>}<NEW_LINE>if (completion.type == Completion.Type.RETURN) {<NEW_LINE>return (completion);<NEW_LINE>}<NEW_LINE>if (completion.type == Completion.Type.BREAK) {<NEW_LINE>completion.value = completionValue;<NEW_LINE>if (completion.target != null && getLabels().contains(completion.target)) {<NEW_LINE>return (Completion.createNormal(completionValue));<NEW_LINE>} else {<NEW_LINE>return (completion);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (Completion.createNormal(completionValue));<NEW_LINE>} | each.interpret(context, debug); |
926,025 | public void add(JMeterTreeModel treeModel, String comment) {<NEW_LINE>if (!isEnabled()) {<NEW_LINE>log.debug("undo.history.size is set to 0, undo/redo feature is disabled");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// don't add element if we are in the middle of undo/redo or a big loading<NEW_LINE>if (working) {<NEW_LINE>log.debug("Not adding history because of noop");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JMeterTreeNode root = (JMeterTreeNode) treeModel.getRoot();<NEW_LINE>if (root.getChildCount() < 1) {<NEW_LINE>log.debug("Not adding history because of no children");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String name = root.getName();<NEW_LINE>log.debug("Adding history element {}: {}", name, comment);<NEW_LINE>working = true;<NEW_LINE>// get test plan tree<NEW_LINE>HashTree tree = treeModel.getCurrentSubTree((JMeterTreeNode) treeModel.getRoot());<NEW_LINE>// first clone to not convert original tree<NEW_LINE>tree = (HashTree) tree.getTree(tree.getArray()[0]).clone();<NEW_LINE>// cloning is required because we need to immute stored data<NEW_LINE>HashTree <MASK><NEW_LINE>GuiPackage guiPackage = GuiPackage.getInstance();<NEW_LINE>// or maybe a Boolean?<NEW_LINE>boolean dirty = guiPackage != null ? guiPackage.isDirty() : false;<NEW_LINE>addEdit(new UndoHistoryItem(copy, comment, TreeState.from(guiPackage), dirty));<NEW_LINE>working = false;<NEW_LINE>} | copy = UndoCommand.convertAndCloneSubTree(tree); |
1,278,710 | protected void powerFurnaceCartWithFuelFromStorage(Entity riding) {<NEW_LINE>if (!(riding instanceof MinecartFurnace))<NEW_LINE>return;<NEW_LINE>MinecartFurnace furnaceCart = (MinecartFurnace) riding;<NEW_LINE>// Notify to not trigger serialization side-effects<NEW_LINE>isSerializingFurnaceCart = true;<NEW_LINE>CompoundTag nbt = furnaceCart.serializeNBT();<NEW_LINE>isSerializingFurnaceCart = false;<NEW_LINE>int fuel = nbt.getInt("Fuel");<NEW_LINE>int fuelBefore = fuel;<NEW_LINE>double pushX = nbt.getDouble("PushX");<NEW_LINE>double pushZ = nbt.getDouble("PushZ");<NEW_LINE>int i = Mth.floor(furnaceCart.getX());<NEW_LINE>int j = Mth.floor(furnaceCart.getY());<NEW_LINE>int k = Mth.floor(furnaceCart.getZ());<NEW_LINE>if (furnaceCart.level.getBlockState(new BlockPos(i, j - 1, k)).is(BlockTags.RAILS))<NEW_LINE>--j;<NEW_LINE>BlockPos blockpos = new BlockPos(i, j, k);<NEW_LINE>BlockState blockstate = this.level.getBlockState(blockpos);<NEW_LINE>if (furnaceCart.canUseRail() && blockstate.is(BlockTags.RAILS))<NEW_LINE>if (fuel > 1)<NEW_LINE>riding.setDeltaMovement(riding.getDeltaMovement().normalize().scale(1));<NEW_LINE>if (fuel < 5 && contraption != null) {<NEW_LINE>ItemStack coal = ItemHelper.extract(contraption.inventory, FUEL_ITEMS, 1, false);<NEW_LINE>if (!coal.isEmpty())<NEW_LINE>fuel += 3600;<NEW_LINE>}<NEW_LINE>if (fuel != fuelBefore || pushX != 0 || pushZ != 0) {<NEW_LINE><MASK><NEW_LINE>nbt.putDouble("PushX", 0);<NEW_LINE>nbt.putDouble("PushZ", 0);<NEW_LINE>furnaceCart.deserializeNBT(nbt);<NEW_LINE>}<NEW_LINE>} | nbt.putInt("Fuel", fuel); |
1,098,027 | protected void onCreate(final Bundle savedInstanceState) {<NEW_LINE>PrefsUtility.applyTheme(this);<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>if (!isTaskRoot() && getIntent().hasCategory(Intent.CATEGORY_LAUNCHER) && getIntent().getAction() != null && getIntent().getAction().equals(Intent.ACTION_MAIN)) {<NEW_LINE>// Workaround for issue where a new MainActivity is created despite<NEW_LINE>// the app already running<NEW_LINE>finish();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final SharedPrefsWrapper sharedPreferences = General.getSharedPrefs(this);<NEW_LINE>twoPane = General.isTablet(this);<NEW_LINE>setTitle(R.string.app_name);<NEW_LINE>RedditAccountManager.getInstance(this).addUpdateListener(this);<NEW_LINE>final PackageInfo pInfo;<NEW_LINE>try {<NEW_LINE>pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);<NEW_LINE>} catch (final PackageManager.NameNotFoundException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>final int appVersion = pInfo.versionCode;<NEW_LINE>Log.i(TAG, "[Migration] App version: " + appVersion);<NEW_LINE>if (!sharedPreferences.contains(FeatureFlagHandler.PREF_FIRST_RUN_MESSAGE_SHOWN)) {<NEW_LINE>Log.i(TAG, "[Migration] Showing first run message");<NEW_LINE>FeatureFlagHandler.handleFirstInstall(sharedPreferences);<NEW_LINE>new AlertDialog.Builder(this).setTitle(R.string.firstrun_login_title).setMessage(R.string.firstrun_login_message).setPositiveButton(R.string.firstrun_login_button_now, (dialog, which) -> new AccountListDialog().show(this.getSupportFragmentManager(), null)).setNegativeButton(R.string.firstrun_login_button_later, null).show();<NEW_LINE>sharedPreferences.edit().putString(FeatureFlagHandler.PREF_FIRST_RUN_MESSAGE_SHOWN, "true").putInt(FeatureFlagHandler.PREF_LAST_VERSION, appVersion).apply();<NEW_LINE>} else if (sharedPreferences.contains(FeatureFlagHandler.PREF_LAST_VERSION)) {<NEW_LINE>FeatureFlagHandler.handleLegacyUpgrade(this, appVersion, pInfo.versionName);<NEW_LINE>} else {<NEW_LINE>Log.i(TAG, "[Migration] Last version not set.");<NEW_LINE>sharedPreferences.edit().putInt(FeatureFlagHandler.PREF_LAST_VERSION, appVersion).apply();<NEW_LINE>ChangelogDialog.newInstance().<MASK><NEW_LINE>}<NEW_LINE>FeatureFlagHandler.handleUpgrade(this);<NEW_LINE>recreateSubscriptionListener();<NEW_LINE>final boolean startInbox = getIntent().getBooleanExtra("isNewMessage", false);<NEW_LINE>if (startInbox) {<NEW_LINE>startActivity(new Intent(this, InboxListingActivity.class));<NEW_LINE>}<NEW_LINE>doRefresh(RefreshableFragment.MAIN_RELAYOUT, false, null);<NEW_LINE>if (savedInstanceState == null && PrefsUtility.pref_behaviour_skiptofrontpage()) {<NEW_LINE>onSelected(SubredditPostListURL.getFrontPage());<NEW_LINE>}<NEW_LINE>} | show(getSupportFragmentManager(), null); |
1,402,515 | public static List<Tuple2<Double, ConfusionMatrix>> filterCloseEntries(List<Tuple2<Double, ConfusionMatrix>> threshCMs, int limit) {<NEW_LINE>int n = threshCMs.size();<NEW_LINE>if (n <= limit) {<NEW_LINE>return threshCMs;<NEW_LINE>}<NEW_LINE>int toRemove = n - limit;<NEW_LINE>// Maintain a double-linked list to store the prev/next entry when removing<NEW_LINE>int[] prev = new int[n];<NEW_LINE>int[] next = new int[n];<NEW_LINE>boolean[] removed = new boolean[n];<NEW_LINE>for (int i = 0; i < n; i += 1) {<NEW_LINE><MASK><NEW_LINE>next[i] = i + 1;<NEW_LINE>removed[i] = false;<NEW_LINE>}<NEW_LINE>// Use a priority queue to help extract the entry with the smallest threshold difference compared to its previous entry.<NEW_LINE>// The tuple contains current index and its previous index.<NEW_LINE>// If multiple entries have the same smallest value, pick the one with the smallest index.<NEW_LINE>Comparator<Tuple2<Integer, Integer>> comparator = Comparator.<Tuple2<Integer, Integer>, Double>comparing(d -> threshCMs.get(d.f1).f0 - threshCMs.get(d.f0).f0).thenComparingInt(d -> d.f0);<NEW_LINE>PriorityQueue<Tuple2<Integer, Integer>> pq = new PriorityQueue<>(comparator);<NEW_LINE>for (int i = 1; i < n; i += 1) {<NEW_LINE>pq.add(Tuple2.of(i, i - 1));<NEW_LINE>}<NEW_LINE>while (toRemove > 0) {<NEW_LINE>Tuple2<Integer, Integer> cntTuple = pq.remove();<NEW_LINE>// Tuples with same current index could be added multiple times after removal,<NEW_LINE>// so need to check its current predecessor.<NEW_LINE>if (cntTuple.f1 != prev[cntTuple.f0]) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int cntIndex = cntTuple.f0;<NEW_LINE>int prevIndex = cntTuple.f1;<NEW_LINE>int nextIndex = next[cntIndex];<NEW_LINE>if (nextIndex < n) {<NEW_LINE>prev[nextIndex] = prevIndex;<NEW_LINE>}<NEW_LINE>if (prevIndex >= 0) {<NEW_LINE>next[prevIndex] = nextIndex;<NEW_LINE>}<NEW_LINE>if (nextIndex < n) {<NEW_LINE>pq.add(Tuple2.of(nextIndex, prevIndex));<NEW_LINE>}<NEW_LINE>removed[cntIndex] = true;<NEW_LINE>toRemove -= 1;<NEW_LINE>}<NEW_LINE>return IntStream.range(0, n).filter(d -> !removed[d]).mapToObj(threshCMs::get).collect(Collectors.toList());<NEW_LINE>} | prev[i] = i - 1; |
772,432 | public Object count(@PathVariable(value = DB_KEY) final String dbName, @PathVariable(value = TABLE_KEY) final String tblName, HttpServletRequest request, HttpServletResponse response) {<NEW_LINE>executeCheckPassword(request, response);<NEW_LINE>// just allocate 2 slot for top holder map<NEW_LINE>Map<String, Object> resultMap = new HashMap<>(4);<NEW_LINE>try {<NEW_LINE>String fullDbName = getFullDbName(dbName);<NEW_LINE>// check privilege for select, otherwise return HTTP 401<NEW_LINE>checkTblAuth(ConnectContext.get().getCurrentUserIdentity(), fullDbName, tblName, PrivPredicate.SELECT);<NEW_LINE>OlapTable olapTable;<NEW_LINE>try {<NEW_LINE>Database db = Env.getCurrentInternalCatalog().getDbOrMetaException(fullDbName);<NEW_LINE>olapTable = (OlapTable) db.getTableOrMetaException(tblName, Table.TableType.OLAP);<NEW_LINE>} catch (MetaNotFoundException e) {<NEW_LINE>return ResponseEntityBuilder.okWithCommonError(e.getMessage());<NEW_LINE>}<NEW_LINE>olapTable.readLock();<NEW_LINE>try {<NEW_LINE>resultMap.put("status", 200);<NEW_LINE>resultMap.put("size", olapTable.proximateRowCount());<NEW_LINE>} finally {<NEW_LINE>olapTable.readUnlock();<NEW_LINE>}<NEW_LINE>} catch (DorisHttpException e) {<NEW_LINE>// status code should conforms to HTTP semantic<NEW_LINE>resultMap.put("status", e.getCode().code());<NEW_LINE>resultMap.put(<MASK><NEW_LINE>}<NEW_LINE>return ResponseEntityBuilder.ok(resultMap);<NEW_LINE>} | "exception", e.getMessage()); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.