idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,165,854 | public void run(TaskSource taskSource, Schema schema, FileInput input, PageOutput pageOutput) {<NEW_LINE>final PluginTask task = loadPluginTaskFromTaskSource(taskSource);<NEW_LINE>final ConfigSource originalConfig = task.getOriginalConfig();<NEW_LINE>final int guessParserSampleBufferBytes = task.getGuessParserSampleBufferBytes();<NEW_LINE>// get sample buffer<NEW_LINE>Buffer sample = readSample(input, guessParserSampleBufferBytes);<NEW_LINE>// load guess plugins<NEW_LINE>ImmutableList.Builder<GuessPlugin> builder = ImmutableList.builder();<NEW_LINE>for (PluginType guessType : task.getGuessPluginTypes()) {<NEW_LINE>GuessPlugin guess = ExecInternal.newPlugin(GuessPlugin.class, guessType);<NEW_LINE>builder.add(guess);<NEW_LINE>}<NEW_LINE>List<GuessPlugin> guesses = builder.build();<NEW_LINE>// run guess plugins<NEW_LINE>ConfigSource mergedConfig = originalConfig.deepCopy();<NEW_LINE>ConfigDiff mergedGuessed = Exec.newConfigDiff();<NEW_LINE>for (int i = 0; i < guesses.size(); i++) {<NEW_LINE>ConfigDiff guessed = guesses.get(i).guess(originalConfig, sample);<NEW_LINE><MASK><NEW_LINE>mergedGuessed.merge(guessed);<NEW_LINE>mergedConfig.merge(mergedGuessed);<NEW_LINE>if (!mergedConfig.equals(originalConfig)) {<NEW_LINE>// config updated<NEW_LINE>throw new GuessedNoticeError(mergedGuessed);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new GuessedNoticeError(mergedGuessed);<NEW_LINE>} | guessed = addAssumedDecoderConfigs(originalConfig, guessed); |
1,588,767 | public void rol(AsmMemoryOperand dst, int imm) {<NEW_LINE>int code;<NEW_LINE>if (imm == 1) {<NEW_LINE>if (dst.size == MemoryOperandSize.QWORD) {<NEW_LINE>code = Code.ROL_RM64_1;<NEW_LINE>} else if (dst.size == MemoryOperandSize.DWORD) {<NEW_LINE>code = Code.ROL_RM32_1;<NEW_LINE>} else if (dst.size == MemoryOperandSize.WORD) {<NEW_LINE>code = Code.ROL_RM16_1;<NEW_LINE>} else if (dst.size == MemoryOperandSize.BYTE) {<NEW_LINE>code = Code.ROL_RM8_1;<NEW_LINE>} else {<NEW_LINE>throw noOpCodeFoundFor(<MASK><NEW_LINE>}<NEW_LINE>} else if (dst.size == MemoryOperandSize.QWORD) {<NEW_LINE>code = Code.ROL_RM64_IMM8;<NEW_LINE>} else if (dst.size == MemoryOperandSize.DWORD) {<NEW_LINE>code = Code.ROL_RM32_IMM8;<NEW_LINE>} else if (dst.size == MemoryOperandSize.WORD) {<NEW_LINE>code = Code.ROL_RM16_IMM8;<NEW_LINE>} else if (dst.size == MemoryOperandSize.BYTE) {<NEW_LINE>code = Code.ROL_RM8_IMM8;<NEW_LINE>} else {<NEW_LINE>throw noOpCodeFoundFor(Mnemonic.ROL, dst, imm);<NEW_LINE>}<NEW_LINE>addInstruction(Instruction.create(code, dst.toMemoryOperand(getBitness()), imm));<NEW_LINE>} | Mnemonic.ROL, dst, imm); |
297,793 | private void put(List<Object[]> args, List<Object[]> overflowArgs) {<NEW_LINE>if (!overflowArgs.isEmpty()) {<NEW_LINE>if (config.overflowMigrationState() == OverflowMigrationState.UNSTARTED) {<NEW_LINE>conns.get().insertManyUnregisteredQuery("/* INSERT_OVERFLOW */" + " INSERT INTO " + config.singleOverflowTable() + " (id, val) VALUES (?, ?) ", overflowArgs);<NEW_LINE>} else {<NEW_LINE>String shortOverflowTableName = getShortOverflowTableName();<NEW_LINE>conns.get().insertManyUnregisteredQuery("/* INSERT_OVERFLOW (" + shortOverflowTableName + ") */" + " INSERT INTO " + shortOverflowTableName + " (id, val) VALUES (?, ?) ", overflowArgs);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String shortTableName = oraclePrefixedTableNames.get(tableRef, conns);<NEW_LINE>conns.get().insertManyUnregisteredQuery("/* INSERT_ONE (" + shortTableName + ") */" + " INSERT INTO " + shortTableName + " (row_name, col_name, ts, val, overflow) " + " VALUES (?, ?, ?, ?, ?) ", args);<NEW_LINE>} catch (PalantirSqlException e) {<NEW_LINE>if (ExceptionCheck.isUniqueConstraintViolation(e)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>} | throw new KeyAlreadyExistsException("primary key violation", e); |
357,481 | public List<AppListModel> load(@NonNull CategoryIndex index) {<NEW_LINE>AppListItemDescriptionComposer composer = new AppListItemDescriptionComposer(context);<NEW_LINE>ThanosManager thanos = ThanosManager.from(context);<NEW_LINE>if (!thanos.isServiceInstalled()) {<NEW_LINE>return Lists.newArrayListWithCapacity(0);<NEW_LINE>}<NEW_LINE>PrivacyManager priv = thanos.getPrivacyManager();<NEW_LINE>List<AppInfo> installed = thanos.getPkgManager().getInstalledPkgsByPackageSetId(index.pkgSetId);<NEW_LINE>List<AppListModel> <MASK><NEW_LINE>CollectionUtils.consumeRemaining(installed, appInfo -> {<NEW_LINE>Fields f = priv.getSelectedFieldsProfileForPackage(appInfo.getPkgName(), PrivacyOp.OP_NO_OP);<NEW_LINE>appInfo.setObj(f);<NEW_LINE>res.add(new AppListModel(appInfo, f == null ? null : f.getLabel(), null, composer.getAppItemDescription(appInfo)));<NEW_LINE>});<NEW_LINE>res.sort((o1, o2) -> {<NEW_LINE>boolean o1Selected = o1.appInfo.getObj() != null;<NEW_LINE>boolean o2Selected = o2.appInfo.getObj() != null;<NEW_LINE>if (o1Selected == o2Selected) {<NEW_LINE>return o1.appInfo.compareTo(o2.appInfo);<NEW_LINE>}<NEW_LINE>return o1Selected ? -1 : 1;<NEW_LINE>});<NEW_LINE>return res;<NEW_LINE>} | res = new ArrayList<>(); |
244,844 | public void initVariableTypes() {<NEW_LINE>if (variableTypes == null) {<NEW_LINE>variableTypes = new DefaultVariableTypes();<NEW_LINE>if (customPreVariableTypes != null) {<NEW_LINE>for (VariableType customVariableType : customPreVariableTypes) {<NEW_LINE>variableTypes.addType(customVariableType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>variableTypes.addType(new NullType());<NEW_LINE>variableTypes.addType(new StringType(getMaxLengthString()));<NEW_LINE>variableTypes.addType(new LongStringType(getMaxLengthString() + 1));<NEW_LINE>variableTypes.addType(new BooleanType());<NEW_LINE>variableTypes.addType(new ShortType());<NEW_LINE>variableTypes.addType(new IntegerType());<NEW_LINE>variableTypes.addType(new LongType());<NEW_LINE>variableTypes.addType(new DateType());<NEW_LINE>variableTypes.addType(new InstantType());<NEW_LINE>variableTypes.addType(new LocalDateType());<NEW_LINE>variableTypes.addType(new LocalDateTimeType());<NEW_LINE>variableTypes.addType(new JodaDateType());<NEW_LINE>variableTypes.addType(new JodaDateTimeType());<NEW_LINE>variableTypes<MASK><NEW_LINE>variableTypes.addType(new UUIDType());<NEW_LINE>variableTypes.addType(new JsonType(getMaxLengthString(), objectMapper, jsonVariableTypeTrackObjects));<NEW_LINE>// longJsonType only needed for reading purposes<NEW_LINE>variableTypes.addType(JsonType.longJsonType(getMaxLengthString(), objectMapper, jsonVariableTypeTrackObjects));<NEW_LINE>variableTypes.addType(new ByteArrayType());<NEW_LINE>variableTypes.addType(new EmptyCollectionType());<NEW_LINE>variableTypes.addType(new SerializableType(serializableVariableTypeTrackDeserializedObjects));<NEW_LINE>if (customPostVariableTypes != null) {<NEW_LINE>for (VariableType customVariableType : customPostVariableTypes) {<NEW_LINE>variableTypes.addType(customVariableType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .addType(new DoubleType()); |
640,478 | public long offer(final DirectBufferVector[] vectors, final ReservedValueSupplier reservedValueSupplier) {<NEW_LINE>final int length = DirectBufferVector.validateAndComputeLength(vectors);<NEW_LINE>long newPosition = CLOSED;<NEW_LINE>if (!isClosed) {<NEW_LINE>final long limit = positionLimit.getVolatile();<NEW_LINE>final int termCount = activeTermCount(logMetaDataBuffer);<NEW_LINE>final TermAppender termAppender = termAppenders[indexByTermCount(termCount)];<NEW_LINE>final long rawTail = termAppender.rawTailVolatile();<NEW_LINE>final long termOffset = rawTail & 0xFFFF_FFFFL;<NEW_LINE>final int termId = termId(rawTail);<NEW_LINE>final long position = computeTermBeginPosition(termId, positionBitsToShift, initialTermId) + termOffset;<NEW_LINE>if (termCount != (termId - initialTermId)) {<NEW_LINE>return ADMIN_ACTION;<NEW_LINE>}<NEW_LINE>if (position < limit) {<NEW_LINE>final int resultingOffset;<NEW_LINE>if (length <= maxPayloadLength) {<NEW_LINE>resultingOffset = termAppender.appendUnfragmentedMessage(headerWriter, vectors, length, reservedValueSupplier, termId);<NEW_LINE>} else {<NEW_LINE>checkMaxMessageLength(length);<NEW_LINE>resultingOffset = termAppender.appendFragmentedMessage(headerWriter, vectors, <MASK><NEW_LINE>}<NEW_LINE>newPosition = newPosition(termCount, (int) termOffset, termId, position, resultingOffset);<NEW_LINE>} else {<NEW_LINE>newPosition = backPressureStatus(position, length);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newPosition;<NEW_LINE>} | length, maxPayloadLength, reservedValueSupplier, termId); |
850,455 | final UpdateVPCEConfigurationResult executeUpdateVPCEConfiguration(UpdateVPCEConfigurationRequest updateVPCEConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateVPCEConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateVPCEConfigurationRequest> request = null;<NEW_LINE>Response<UpdateVPCEConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateVPCEConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateVPCEConfigurationRequest));<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, "Device Farm");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateVPCEConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateVPCEConfigurationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateVPCEConfiguration"); |
851,037 | private QueryDataSet constructDataSet(List<AggregateResult> aggregateResultList, AggregationPlan plan) {<NEW_LINE>SingleDataSet dataSet;<NEW_LINE>RowRecord record = new RowRecord(0);<NEW_LINE>if (plan.isGroupByLevel()) {<NEW_LINE>Map<String, AggregateResult> groupPathsResultMap = plan.groupAggResultByLevel(aggregateResultList);<NEW_LINE>List<PartialPath> paths = new ArrayList<>();<NEW_LINE>List<TSDataType> dataTypes = new ArrayList<>();<NEW_LINE>for (AggregateResult resultData : groupPathsResultMap.values()) {<NEW_LINE>dataTypes.add(resultData.getResultDataType());<NEW_LINE>record.addField(resultData.getResult(<MASK><NEW_LINE>}<NEW_LINE>dataSet = new SingleDataSet(paths, dataTypes);<NEW_LINE>} else {<NEW_LINE>for (AggregateResult resultData : aggregateResultList) {<NEW_LINE>TSDataType dataType = resultData.getResultDataType();<NEW_LINE>record.addField(resultData.getResult(), dataType);<NEW_LINE>}<NEW_LINE>dataSet = new SingleDataSet(selectedSeries, dataTypes);<NEW_LINE>}<NEW_LINE>dataSet.setRecord(record);<NEW_LINE>return dataSet;<NEW_LINE>} | ), resultData.getResultDataType()); |
281,929 | final ListBackupPlansResult executeListBackupPlans(ListBackupPlansRequest listBackupPlansRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listBackupPlansRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListBackupPlansRequest> request = null;<NEW_LINE>Response<ListBackupPlansResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListBackupPlansRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listBackupPlansRequest));<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, "Backup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListBackupPlans");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListBackupPlansResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | false), new ListBackupPlansResultJsonUnmarshaller()); |
1,827,742 | static URI normalizeSyntax(final URI uri) throws URISyntaxException {<NEW_LINE>if (uri.isOpaque() || uri.getAuthority() == null) {<NEW_LINE>// opaque and file: URIs<NEW_LINE>return uri;<NEW_LINE>}<NEW_LINE>Args.check(uri.isAbsolute(), "Base URI must be absolute");<NEW_LINE>final URIBuilder builder = new URIBuilder(uri);<NEW_LINE>final String path = builder.getPath();<NEW_LINE>if (path != null && !path.equals("/")) {<NEW_LINE>final String[] inputSegments = path.split("/");<NEW_LINE>final Stack<String> outputSegments = new Stack<>();<NEW_LINE>for (final String inputSegment : inputSegments) {<NEW_LINE>if ((inputSegment.isEmpty()) || (".".equals(inputSegment))) {<NEW_LINE>// Do nothing<NEW_LINE>} else if ("..".equals(inputSegment)) {<NEW_LINE>if (!outputSegments.isEmpty()) {<NEW_LINE>outputSegments.pop();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>outputSegments.push(inputSegment);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final StringBuilder outputBuffer = new StringBuilder();<NEW_LINE>for (final String outputSegment : outputSegments) {<NEW_LINE>outputBuffer.append('/').append(outputSegment);<NEW_LINE>}<NEW_LINE>if (path.lastIndexOf('/') == path.length() - 1) {<NEW_LINE>// path.endsWith("/") || path.equals("")<NEW_LINE>outputBuffer.append('/');<NEW_LINE>}<NEW_LINE>builder.setPath(outputBuffer.toString());<NEW_LINE>}<NEW_LINE>if (builder.getScheme() != null) {<NEW_LINE>builder.setScheme(builder.getScheme().toLowerCase(Locale.ROOT));<NEW_LINE>}<NEW_LINE>if (builder.getHost() != null) {<NEW_LINE>builder.setHost(builder.getHost()<MASK><NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>} | .toLowerCase(Locale.ROOT)); |
1,738,919 | final UpdateAutoScalingGroupResult executeUpdateAutoScalingGroup(UpdateAutoScalingGroupRequest updateAutoScalingGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateAutoScalingGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateAutoScalingGroupRequest> request = null;<NEW_LINE>Response<UpdateAutoScalingGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateAutoScalingGroupRequestMarshaller().marshall(super.beforeMarshalling(updateAutoScalingGroupRequest));<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, "Auto Scaling");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<UpdateAutoScalingGroupResult> responseHandler = new StaxResponseHandler<UpdateAutoScalingGroupResult>(new UpdateAutoScalingGroupResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateAutoScalingGroup"); |
701,639 | private void convertSetting(final StoredConfiguration inputConfig, final StoredConfigurationModifier modifier, final StoredConfigKey key) {<NEW_LINE>final PwmSetting pwmSetting = key.toPwmSetting();<NEW_LINE>final List<String> targetProfiles = StoredConfigurationUtil.profilesForSetting(key.getDomainID(), pwmSetting, inputConfig);<NEW_LINE>final StoredValue value = inputConfig.readStoredValue(key).orElseThrow();<NEW_LINE>final Optional<ValueMetaData> valueMetaData = inputConfig.readMetaData(key);<NEW_LINE>for (final String destProfile : targetProfiles) {<NEW_LINE>LOGGER.info(() -> "moving setting " + key.toString() + " without profile attribute to profile \"" + destProfile + "\".");<NEW_LINE>{<NEW_LINE>try {<NEW_LINE>final var newKey = StoredConfigKey.forSetting(pwmSetting, destProfile, key.getDomainID());<NEW_LINE>modifier.writeSettingAndMetaData(newKey, value<MASK><NEW_LINE>} catch (final PwmUnrecoverableException e) {<NEW_LINE>LOGGER.warn(() -> "error moving setting " + pwmSetting.getKey() + " without profile attribute to profile \"" + destProfile + "\", error: " + e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>LOGGER.info(() -> "removing setting " + key.toString() + " without profile");<NEW_LINE>modifier.deleteKey(key);<NEW_LINE>} catch (final PwmUnrecoverableException e) {<NEW_LINE>LOGGER.warn(() -> "error deleting setting " + pwmSetting.getKey() + " after adding profile settings: " + e.getMessage());<NEW_LINE>}<NEW_LINE>} | , valueMetaData.orElse(null)); |
1,361,160 | ActionResult<Wo> execute(HttpServletRequest request, HttpServletResponse response, EffectivePerson effectivePerson) throws Exception {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wo wo = new Wo();<NEW_LINE>if (BooleanUtils.isFalse(Config.collect().getEnable())) {<NEW_LINE>throw new ExceptionDisable();<NEW_LINE>}<NEW_LINE>if (BooleanUtils.isNotTrue(this.connect())) {<NEW_LINE>throw new ExceptionUnableConnect();<NEW_LINE>}<NEW_LINE>String url = Config.collect().url(Collect.ADDRESS_COLLECT_LOGIN);<NEW_LINE>Map<String, String> map = new HashMap<>();<NEW_LINE>map.put("credential", Config.collect().getName());<NEW_LINE>map.put("password", Config.collect().getPassword());<NEW_LINE>ActionResponse resp = ConnectionAction.<MASK><NEW_LINE>LoginWo loginWo = resp.getData(LoginWo.class);<NEW_LINE>HttpToken httpToken = new HttpToken();<NEW_LINE>httpToken.setResponseToken(request, response, C_Token, loginWo.getToken());<NEW_LINE>wo.setCollectToken(loginWo.getToken());<NEW_LINE>wo.setCollectTokenType(loginWo.getTokenType());<NEW_LINE>wo.setCollectUrl(Config.collect().url());<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>} | post(url, null, map); |
1,071,642 | private String createBody(String prefix) {<NEW_LINE>variable = stmt.getVariable();<NEW_LINE>dataSource = stmt.getDataSource();<NEW_LINE>if (variable.equals("")) {<NEW_LINE>// NOI18N<NEW_LINE>variable = JspPaletteUtilities.CARET;<NEW_LINE>} else if (dataSource.equals("")) {<NEW_LINE>// NOI18N<NEW_LINE>dataSource = JspPaletteUtilities.CARET;<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>String strVariable = " var=\"\"";<NEW_LINE>if (variable.length() > 0) {<NEW_LINE>// NOI18N<NEW_LINE>strVariable = " var=\"" + variable + "\"";<NEW_LINE>}<NEW_LINE>scopeIndex = stmt.getScopeIndex();<NEW_LINE>// NOI18N<NEW_LINE>String strScope = "";<NEW_LINE>if (scopeIndex != SQLStmt.SCOPE_DEFAULT) {<NEW_LINE>// NOI18N<NEW_LINE>strScope = " scope=\"" + <MASK><NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>String strDS = " dataSource=\"\"";<NEW_LINE>if (strDS.length() > 0) {<NEW_LINE>// NOI18N<NEW_LINE>strDS = " dataSource=\"" + dataSource + "\"";<NEW_LINE>}<NEW_LINE>query = stmt.getStmt();<NEW_LINE>String strQuery = query;<NEW_LINE>if (query.length() > 0) {<NEW_LINE>// NOI18N<NEW_LINE>strQuery += "\n";<NEW_LINE>}<NEW_LINE>return "<" + prefix + ":query" + strVariable + strScope + strDS + ">\n" + strQuery + "</" + prefix + ":query>";<NEW_LINE>} | SQLStmt.scopes[scopeIndex] + "\""; |
77,549 | public static int[] stringToGradientPalette(String str, String gradientScaleType) {<NEW_LINE>boolean isSlope = "gradient_slope_color".equals(gradientScaleType);<NEW_LINE>if (Algorithms.isBlank(str)) {<NEW_LINE>return isSlope ? RouteColorize.SLOPE_COLORS : RouteColorize.COLORS;<NEW_LINE>}<NEW_LINE>String[] arr = str.split(" ");<NEW_LINE>if (arr.length < 2) {<NEW_LINE>return isSlope ? RouteColorize.SLOPE_COLORS : RouteColorize.COLORS;<NEW_LINE>}<NEW_LINE>int[] colors = new int[arr.length];<NEW_LINE>try {<NEW_LINE>for (int i = 0; i < arr.length; i++) {<NEW_LINE>colors[i] = Algorithms<MASK><NEW_LINE>}<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>return isSlope ? RouteColorize.SLOPE_COLORS : RouteColorize.COLORS;<NEW_LINE>}<NEW_LINE>return colors;<NEW_LINE>} | .parseColor(arr[i]); |
1,185,910 | public static AsymmetricKeyParameter generatePublicKeyParameter(PublicKey key) throws InvalidKeyException {<NEW_LINE>if (key instanceof ECPublicKey) {<NEW_LINE>ECPublicKey k = (ECPublicKey) key;<NEW_LINE>ECParameterSpec s = k.getParameters();<NEW_LINE>return new ECPublicKeyParameters(k.getQ(), new ECDomainParameters(s.getCurve(), s.getG(), s.getN(), s.getH()<MASK><NEW_LINE>} else if (key instanceof java.security.interfaces.ECPublicKey) {<NEW_LINE>java.security.interfaces.ECPublicKey pubKey = (java.security.interfaces.ECPublicKey) key;<NEW_LINE>ECParameterSpec s = EC5Util.convertSpec(pubKey.getParams());<NEW_LINE>return new ECPublicKeyParameters(EC5Util.convertPoint(pubKey.getParams(), pubKey.getW()), new ECDomainParameters(s.getCurve(), s.getG(), s.getN(), s.getH(), s.getSeed()));<NEW_LINE>} else {<NEW_LINE>// see if we can build a key from key.getEncoded()<NEW_LINE>try {<NEW_LINE>byte[] bytes = key.getEncoded();<NEW_LINE>if (bytes == null) {<NEW_LINE>throw new InvalidKeyException("no encoding for EC public key");<NEW_LINE>}<NEW_LINE>PublicKey publicKey = BouncyCastleProvider.getPublicKey(SubjectPublicKeyInfo.getInstance(bytes));<NEW_LINE>if (publicKey instanceof java.security.interfaces.ECPublicKey) {<NEW_LINE>return ECUtil.generatePublicKeyParameter(publicKey);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new InvalidKeyException("cannot identify EC public key: " + e.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new InvalidKeyException("cannot identify EC public key.");<NEW_LINE>} | , s.getSeed())); |
818,634 | private void processValidator(ServletContext sc, NodeList validator, TagLibraryImpl taglibrary, String name) {<NEW_LINE>if (validator != null && validator.getLength() > 0) {<NEW_LINE>String validatorId = null;<NEW_LINE>String handlerClass = null;<NEW_LINE>for (int i = 0, ilen = validator.getLength(); i < ilen; i++) {<NEW_LINE>Node n = validator.item(i);<NEW_LINE>if (VALIDATOR_ID.equals(n.getLocalName())) {<NEW_LINE>validatorId = getNodeText(n);<NEW_LINE>} else if (HANDLER_CLASS.equals(n.getLocalName())) {<NEW_LINE>handlerClass = getNodeText(n);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (handlerClass != null) {<NEW_LINE>Class<?> clazz = loadClass(sc, handlerClass, this, null);<NEW_LINE>taglibrary.<MASK><NEW_LINE>} else {<NEW_LINE>taglibrary.putValidator(name, validatorId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | putValidator(name, validatorId, clazz); |
1,238,752 | private Optional<SimpleTransformation> computeSnatTransformation(Snat snat) {<NEW_LINE>// // Perform SNAT if source IP is in range<NEW_LINE>// Retrieve pool of addresses to which sourceIP may be translated<NEW_LINE>String snatPoolName = snat.getSnatpool();<NEW_LINE>if (snatPoolName == null) {<NEW_LINE>// Cannot translate without pool<NEW_LINE>_w.redFlag(String.format("Cannot SNAT for snat '%s' without snatpool", snat.getName()));<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>SnatPool <MASK><NEW_LINE>if (snatPool == null) {<NEW_LINE>// Cannot translate without pool<NEW_LINE>_w.redFlag(String.format("Cannot SNAT for snat '%s' using missing snatpool: '%s'", snat.getName(), snatPoolName));<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>if (!snat.getIpv6Origins().isEmpty()) {<NEW_LINE>// IPv6, so nothing to do<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>if (snat.getIpv4Origins().isEmpty()) {<NEW_LINE>_w.redFlag(String.format("Cannot SNAT for snat '%s' without origins", snat.getName()));<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>// Compute matching headers<NEW_LINE>IpSpace sourceIpSpace = AclIpSpace.union(snat.getIpv4Origins().keySet().stream().map(Prefix::toIpSpace).toArray(IpSpace[]::new));<NEW_LINE>AclLineMatchExpr matchCondition = new MatchHeaderSpace(HeaderSpace.builder().setSrcIps(sourceIpSpace).build(), snat.getName());<NEW_LINE>return computeOutgoingSnatPoolTransformation(snatPool).map(step -> new SimpleTransformation(matchCondition, step));<NEW_LINE>} | snatPool = _snatPools.get(snatPoolName); |
1,631,392 | public static ListFlowResponse unmarshall(ListFlowResponse listFlowResponse, UnmarshallerContext _ctx) {<NEW_LINE>listFlowResponse.setRequestId(_ctx.stringValue("ListFlowResponse.RequestId"));<NEW_LINE>listFlowResponse.setSuccess(_ctx.booleanValue("ListFlowResponse.Success"));<NEW_LINE>listFlowResponse.setCode(_ctx.stringValue("ListFlowResponse.Code"));<NEW_LINE>listFlowResponse.setMessage(_ctx.stringValue("ListFlowResponse.Message"));<NEW_LINE>listFlowResponse.setPageSize(_ctx.integerValue("ListFlowResponse.PageSize"));<NEW_LINE>listFlowResponse.setPageNumber(_ctx.integerValue("ListFlowResponse.PageNumber"));<NEW_LINE>listFlowResponse.setTotal(_ctx.longValue("ListFlowResponse.Total"));<NEW_LINE>List<FlowDTOModel> model = new ArrayList<FlowDTOModel>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListFlowResponse.Model.Length"); i++) {<NEW_LINE>FlowDTOModel flowDTOModel = new FlowDTOModel();<NEW_LINE>flowDTOModel.setType(_ctx.stringValue("ListFlowResponse.Model[" + i + "].Type"));<NEW_LINE>flowDTOModel.setStatus(_ctx.stringValue("ListFlowResponse.Model[" + i + "].Status"));<NEW_LINE>flowDTOModel.setChildStatus(_ctx.stringValue<MASK><NEW_LINE>flowDTOModel.setApplyUserId(_ctx.stringValue("ListFlowResponse.Model[" + i + "].ApplyUserId"));<NEW_LINE>flowDTOModel.setApproveTime(_ctx.longValue("ListFlowResponse.Model[" + i + "].ApproveTime"));<NEW_LINE>flowDTOModel.setFlowId(_ctx.stringValue("ListFlowResponse.Model[" + i + "].FlowId"));<NEW_LINE>flowDTOModel.setExtInfo(_ctx.stringValue("ListFlowResponse.Model[" + i + "].ExtInfo"));<NEW_LINE>flowDTOModel.setGmtModifiedTime(_ctx.longValue("ListFlowResponse.Model[" + i + "].GmtModifiedTime"));<NEW_LINE>flowDTOModel.setOldData(_ctx.stringValue("ListFlowResponse.Model[" + i + "].OldData"));<NEW_LINE>flowDTOModel.setGmtCreateTime(_ctx.longValue("ListFlowResponse.Model[" + i + "].GmtCreateTime"));<NEW_LINE>flowDTOModel.setApproveUserId(_ctx.stringValue("ListFlowResponse.Model[" + i + "].ApproveUserId"));<NEW_LINE>flowDTOModel.setNewData(_ctx.stringValue("ListFlowResponse.Model[" + i + "].NewData"));<NEW_LINE>flowDTOModel.setBusinessKey(_ctx.stringValue("ListFlowResponse.Model[" + i + "].BusinessKey"));<NEW_LINE>flowDTOModel.setReasonType(_ctx.stringValue("ListFlowResponse.Model[" + i + "].ReasonType"));<NEW_LINE>flowDTOModel.setTenantId(_ctx.stringValue("ListFlowResponse.Model[" + i + "].TenantId"));<NEW_LINE>model.add(flowDTOModel);<NEW_LINE>}<NEW_LINE>listFlowResponse.setModel(model);<NEW_LINE>return listFlowResponse;<NEW_LINE>} | ("ListFlowResponse.Model[" + i + "].ChildStatus")); |
1,371,881 | private static void parameters(ParserContext ctx, OperationExt operation, List<Map<String, Object>> parameters) {<NEW_LINE>for (int i = 0; i < parameters.size(); i++) {<NEW_LINE>Map<String, Object> parameterMap = parameters.get(i);<NEW_LINE>String name = (String) parameterMap.get("name");<NEW_LINE>io.swagger.v3.oas.models.parameters.Parameter parameter;<NEW_LINE>if (name != null) {<NEW_LINE>int index = i;<NEW_LINE>parameter = operation.getParameters().stream().filter(it -> it.getName().equals(name)).findFirst().orElseGet(() -> operation.getParameter(index));<NEW_LINE>} else {<NEW_LINE>parameter = operation.getParameter(i);<NEW_LINE>}<NEW_LINE>if (parameter == null) {<NEW_LINE>throw new IllegalArgumentException("Parameter not found: " + name + " at position: " + i + " for annotation: " + parameterMap);<NEW_LINE>}<NEW_LINE>Optional.ofNullable(name).ifPresent(parameter::setName);<NEW_LINE>stringValue(parameterMap, "description", parameter::setDescription);<NEW_LINE>enumValue(parameterMap, "in", in -> parameter.setIn(in.toLowerCase()));<NEW_LINE>boolValue(parameterMap, "required", parameter::setRequired);<NEW_LINE>boolValue(parameterMap, "deprecated", parameter::setDeprecated);<NEW_LINE>boolValue(<MASK><NEW_LINE>boolValue(parameterMap, "allowReserved", parameter::setAllowReserved);<NEW_LINE>// NOTE: Hidden is not present on parameter<NEW_LINE>// boolValue(parameterMap, "hidden", parameter::setHidden);<NEW_LINE>enumValue(parameterMap, "explode", value -> parameter.setExample(Boolean.valueOf(value)));<NEW_LINE>stringValue(parameterMap, "ref", ref -> parameter.set$ref(RefUtils.constructRef(ref)));<NEW_LINE>arrayOrSchema(ctx, parameterMap).ifPresent(parameter::setSchema);<NEW_LINE>examples(parameterMap, parameter::setExample, parameter::setExamples);<NEW_LINE>annotationList(parameterMap, "extensions", values -> extensions(values, parameter::addExtension));<NEW_LINE>}<NEW_LINE>} | parameterMap, "allowEmptyValue", parameter::setAllowEmptyValue); |
584,177 | private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String clusterName, String databaseName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (clusterName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (databaseName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = <MASK><NEW_LINE>return service.delete(this.client.getEndpoint(), resourceGroupName, clusterName, databaseName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context);<NEW_LINE>} | this.client.mergeContext(context); |
1,818,685 | public void changeRoleOfStorageNode(String instanceId, String replica, StorageRole newRole) {<NEW_LINE>assert StringUtils.isNotEmpty(replica);<NEW_LINE>StorageInstHaContext storageNode = null;<NEW_LINE>if (instanceId.equals(metaDbStorageHaCtx.storageInstId)) {<NEW_LINE>storageNode = metaDbStorageHaCtx;<NEW_LINE>} else {<NEW_LINE>storageNode = storageHaCtxCache.get(instanceId);<NEW_LINE>}<NEW_LINE>if (storageNode == null) {<NEW_LINE>throw new TddlRuntimeException(ErrorCode.ERR_GMS_GENERIC, String<MASK><NEW_LINE>}<NEW_LINE>StorageInfoRecord replicaInfo = storageNode.getNodeInfoByAddress(replica);<NEW_LINE>StorageNodeHaInfo replicaHaInfo = storageNode.getNodeHaInfoByAddress(replica);<NEW_LINE>if (replicaInfo == null) {<NEW_LINE>throw new TddlRuntimeException(ErrorCode.ERR_GMS_GENERIC, String.format("replica %s not exists in datanode(%s)", replica, instanceId));<NEW_LINE>}<NEW_LINE>String oldLeaderAddr = storageNode.getLeaderNode().getHostPort();<NEW_LINE>String user = storageNode.getUser();<NEW_LINE>String passwd = PasswdUtil.decrypt(storageNode.getEncPasswd());<NEW_LINE>StorageRole currentRole = replicaHaInfo.getRole();<NEW_LINE>try {<NEW_LINE>if (currentRole.equals(newRole)) {<NEW_LINE>logger.warn(String.format("storage node already %s, no need to change", newRole));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StorageHaChecker.changePaxosRoleOfNode(oldLeaderAddr, user, passwd, replica, currentRole, newRole);<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new TddlRuntimeException(ErrorCode.ERR_GMS_GENERIC, e, String.format("change role of %s@%s from %s to %s failed", replica, instanceId, currentRole, newRole));<NEW_LINE>}<NEW_LINE>} | .format("could not find instance %s", instanceId)); |
215,343 | public void processSyncUnit(SyncUnit syncOrder) {<NEW_LINE>AbstractDocumentComponent targetComponent = <MASK><NEW_LINE>if (targetComponent == null) {<NEW_LINE>throw new IllegalArgumentException("sync unit should not be null");<NEW_LINE>}<NEW_LINE>// skip target component whose some ancestor removed in previous processed syncUnit<NEW_LINE>if (!targetComponent.isInDocumentModel()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Element oldElement = syncOrder.getTarget().getPeer();<NEW_LINE>syncOrder.updateTargetReference();<NEW_LINE>if (syncOrder.isComponentChanged()) {<NEW_LINE>ComponentEvent.EventType changeType = ComponentEvent.EventType.VALUE_CHANGED;<NEW_LINE>if (!syncOrder.hasWhitespaceChangeOnly()) {<NEW_LINE>fireComponentChangedEvent(new ComponentEvent(targetComponent, changeType));<NEW_LINE>}<NEW_LINE>firePropertyChangedEvents(syncOrder, oldElement);<NEW_LINE>}<NEW_LINE>for (DocumentComponent c : syncOrder.getToRemoveList()) {<NEW_LINE>removeChildComponent(c);<NEW_LINE>}<NEW_LINE>for (DocumentComponent c : syncOrder.getToAddList()) {<NEW_LINE>Element childElement = (Element) ((AbstractDocumentComponent) c).getPeer();<NEW_LINE>int index = targetComponent.findDomainIndex(childElement);<NEW_LINE>addChildComponent(targetComponent, c, index);<NEW_LINE>}<NEW_LINE>} | (AbstractDocumentComponent) syncOrder.getTarget(); |
669,113 | private void loadExtensions(IExtensionRegistry registry) {<NEW_LINE>{<NEW_LINE>IConfigurationElement[] extConfigs = registry.getConfigurationElementsFor(WebServiceDescriptor.EXTENSION_ID);<NEW_LINE>for (IConfigurationElement ext : extConfigs) {<NEW_LINE>// Load webServices<NEW_LINE>if (TAG_SERVICE.equals(ext.getName())) {<NEW_LINE>this.webServices.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<DBWServiceBinding> instances = new ArrayList<>();<NEW_LINE>for (WebServiceDescriptor wsd : webServices) {<NEW_LINE>try {<NEW_LINE>DBWServiceBinding instance = wsd.getInstance();<NEW_LINE>instances.add(instance);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Error instantiating web service '" + wsd.getId() + "'", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>webServiceInstances = instances.toArray(new DBWServiceBinding[0]);<NEW_LINE>{<NEW_LINE>IConfigurationElement[] extConfigs = registry.getConfigurationElementsFor(WebValueSerializerDescriptor.EXTENSION_ID);<NEW_LINE>for (IConfigurationElement ext : extConfigs) {<NEW_LINE>WebValueSerializerDescriptor descriptor = new WebValueSerializerDescriptor(ext);<NEW_LINE>valueSerializers.put(descriptor.getValueType(), descriptor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | add(new WebServiceDescriptor(ext)); |
317,128 | public void put(Collection<Map.Entry<Cell, Value>> data) {<NEW_LINE>List<Object[]> args = new ArrayList<>(data.size());<NEW_LINE>List<Object[]> overflowArgs = new ArrayList<>();<NEW_LINE>for (Map.Entry<Cell, Value> entry : data) {<NEW_LINE>Cell cell = entry.getKey();<NEW_LINE><MASK><NEW_LINE>if (val.getContents().length <= AtlasDbConstants.ORACLE_OVERFLOW_THRESHOLD) {<NEW_LINE>args.add(new Object[] { cell.getRowName(), cell.getColumnName(), val.getTimestamp(), val.getContents(), null });<NEW_LINE>} else {<NEW_LINE>long overflowId = config.overflowIds().orElse(overflowSequenceSupplier).get();<NEW_LINE>overflowArgs.add(new Object[] { overflowId, val.getContents() });<NEW_LINE>args.add(new Object[] { cell.getRowName(), cell.getColumnName(), val.getTimestamp(), null, overflowId });<NEW_LINE>}<NEW_LINE>}<NEW_LINE>put(args, overflowArgs);<NEW_LINE>} | Value val = entry.getValue(); |
521,069 | private void checkUfsMode(AlluxioURI alluxioPath, OperationType opType) throws AccessControlException, InvalidPathException {<NEW_LINE>MountTable.Resolution resolution = mMountTable.resolve(alluxioPath);<NEW_LINE>try (CloseableResource<UnderFileSystem> ufsResource = resolution.acquireUfsResource()) {<NEW_LINE>UnderFileSystem ufs = ufsResource.get();<NEW_LINE>UfsMode ufsMode = ufs.getOperationMode(mUfsManager.getPhysicalUfsState<MASK><NEW_LINE>switch(ufsMode) {<NEW_LINE>case NO_ACCESS:<NEW_LINE>throw new AccessControlException(ExceptionMessage.UFS_OP_NOT_ALLOWED.getMessage(opType, resolution.getUri(), UfsMode.NO_ACCESS));<NEW_LINE>case READ_ONLY:<NEW_LINE>if (opType == OperationType.WRITE) {<NEW_LINE>throw new AccessControlException(ExceptionMessage.UFS_OP_NOT_ALLOWED.getMessage(opType, resolution.getUri(), UfsMode.READ_ONLY));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// All operations are allowed<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (ufs.getPhysicalStores())); |
702,608 | public GATKReportTable generateReportTable(final String covariateNames) {<NEW_LINE>GATKReportTable argumentsTable;<NEW_LINE>argumentsTable = new GATKReportTable("Arguments", "Recalibration argument collection values used in this run", 2, GATKReportTable.Sorting.SORT_BY_COLUMN);<NEW_LINE>argumentsTable.addColumn("Argument", "%s");<NEW_LINE>argumentsTable.addColumn(RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, "");<NEW_LINE>argumentsTable.addRowID("covariate", true);<NEW_LINE>argumentsTable.set("covariate", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, covariateNames);<NEW_LINE>argumentsTable.addRowID("no_standard_covs", true);<NEW_LINE>argumentsTable.set("no_standard_covs", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, DO_NOT_USE_STANDARD_COVARIATES);<NEW_LINE>argumentsTable.addRowID("run_without_dbsnp", true);<NEW_LINE>argumentsTable.set("run_without_dbsnp", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, RUN_WITHOUT_DBSNP);<NEW_LINE>argumentsTable.addRowID("solid_recal_mode", true);<NEW_LINE>argumentsTable.set("solid_recal_mode", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, SOLID_RECAL_MODE);<NEW_LINE>argumentsTable.addRowID("solid_nocall_strategy", true);<NEW_LINE>argumentsTable.set("solid_nocall_strategy", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, SOLID_NOCALL_STRATEGY);<NEW_LINE>argumentsTable.addRowID("mismatches_context_size", true);<NEW_LINE>argumentsTable.set("mismatches_context_size", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, MISMATCHES_CONTEXT_SIZE);<NEW_LINE>argumentsTable.addRowID("indels_context_size", true);<NEW_LINE>argumentsTable.set("indels_context_size", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, INDELS_CONTEXT_SIZE);<NEW_LINE>argumentsTable.addRowID("mismatches_default_quality", true);<NEW_LINE>argumentsTable.set("mismatches_default_quality", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, MISMATCHES_DEFAULT_QUALITY);<NEW_LINE><MASK><NEW_LINE>argumentsTable.set("deletions_default_quality", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, DELETIONS_DEFAULT_QUALITY);<NEW_LINE>argumentsTable.addRowID("insertions_default_quality", true);<NEW_LINE>argumentsTable.set("insertions_default_quality", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, INSERTIONS_DEFAULT_QUALITY);<NEW_LINE>argumentsTable.addRowID("maximum_cycle_value", true);<NEW_LINE>argumentsTable.set("maximum_cycle_value", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, MAXIMUM_CYCLE_VALUE);<NEW_LINE>argumentsTable.addRowID("low_quality_tail", true);<NEW_LINE>argumentsTable.set("low_quality_tail", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, LOW_QUAL_TAIL);<NEW_LINE>argumentsTable.addRowID("default_platform", true);<NEW_LINE>argumentsTable.set("default_platform", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, DEFAULT_PLATFORM);<NEW_LINE>argumentsTable.addRowID("force_platform", true);<NEW_LINE>argumentsTable.set("force_platform", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, FORCE_PLATFORM);<NEW_LINE>argumentsTable.addRowID("quantizing_levels", true);<NEW_LINE>argumentsTable.set("quantizing_levels", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, QUANTIZING_LEVELS);<NEW_LINE>argumentsTable.addRowID("recalibration_report", true);<NEW_LINE>argumentsTable.set("recalibration_report", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, existingRecalibrationReport == null ? "null" : existingRecalibrationReport.getAbsolutePath());<NEW_LINE>argumentsTable.addRowID("binary_tag_name", true);<NEW_LINE>argumentsTable.set("binary_tag_name", RecalUtils.ARGUMENT_VALUE_COLUMN_NAME, BINARY_TAG_NAME == null ? "null" : BINARY_TAG_NAME);<NEW_LINE>return argumentsTable;<NEW_LINE>} | argumentsTable.addRowID("deletions_default_quality", true); |
309,588 | private static ArtifactStoreService initializeArtifactStore(MDBArtifactStoreConfig mdbArtifactStoreConfig) throws ModelDBException, IOException {<NEW_LINE>// ------------- Start Initialize Cloud storage base on configuration ------------------<NEW_LINE>ArtifactStoreService artifactStoreService;<NEW_LINE>if (mdbArtifactStoreConfig.getArtifactEndpoint() != null) {<NEW_LINE>System.getProperties().put("artifactEndpoint.storeArtifact", mdbArtifactStoreConfig.getArtifactEndpoint().getStoreArtifact());<NEW_LINE>System.getProperties().put("artifactEndpoint.getArtifact", mdbArtifactStoreConfig.getArtifactEndpoint().getGetArtifact());<NEW_LINE>}<NEW_LINE>if (mdbArtifactStoreConfig.getNFS() != null && mdbArtifactStoreConfig.getNFS().getArtifactEndpoint() != null) {<NEW_LINE>System.getProperties().put("artifactEndpoint.storeArtifact", mdbArtifactStoreConfig.getNFS().<MASK><NEW_LINE>System.getProperties().put("artifactEndpoint.getArtifact", mdbArtifactStoreConfig.getNFS().getArtifactEndpoint().getGetArtifact());<NEW_LINE>}<NEW_LINE>switch(mdbArtifactStoreConfig.getArtifactStoreType()) {<NEW_LINE>case "S3":<NEW_LINE>if (!mdbArtifactStoreConfig.S3.getS3presignedURLEnabled()) {<NEW_LINE>System.setProperty(ModelDBConstants.CLOUD_BUCKET_NAME, mdbArtifactStoreConfig.S3.getCloudBucketName());<NEW_LINE>System.getProperties().put(SCAN_PACKAGES, "ai.verta.modeldb.artifactStore.storageservice.s3");<NEW_LINE>SpringApplication.run(App.class);<NEW_LINE>artifactStoreService = App.getInstance().applicationContext.getBean(S3Service.class);<NEW_LINE>} else {<NEW_LINE>artifactStoreService = new S3Service(mdbArtifactStoreConfig.S3.getCloudBucketName());<NEW_LINE>System.getProperties().put(SCAN_PACKAGES, "dummyPackageName");<NEW_LINE>SpringApplication.run(App.class);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case "NFS":<NEW_LINE>String rootDir = mdbArtifactStoreConfig.getNFS().getNfsRootPath();<NEW_LINE>LOGGER.trace("NFS server root path {}", rootDir);<NEW_LINE>System.getProperties().put("file.upload-dir", rootDir);<NEW_LINE>System.getProperties().put(SCAN_PACKAGES, "ai.verta.modeldb.artifactStore.storageservice.nfs");<NEW_LINE>SpringApplication.run(App.class);<NEW_LINE>artifactStoreService = App.getInstance().applicationContext.getBean(NFSService.class);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new ModelDBException("Configure valid artifact store name in config.yaml file.");<NEW_LINE>}<NEW_LINE>// ------------- Finish Initialize Cloud storage base on configuration ------------------<NEW_LINE>LOGGER.info("ArtifactStore service initialized and resolved storage dependency before server start");<NEW_LINE>return artifactStoreService;<NEW_LINE>} | getArtifactEndpoint().getStoreArtifact()); |
788,206 | public UserVm resetVMSSHKey(ResetVMSSHKeyCmd cmd) throws ResourceUnavailableException, InsufficientCapacityException {<NEW_LINE>Account caller = CallContext.current().getCallingAccount();<NEW_LINE>Account owner = _accountMgr.finalizeOwner(caller, cmd.getAccountName(), cmd.getDomainId(), cmd.getProjectId());<NEW_LINE>Long vmId = cmd.getId();<NEW_LINE>UserVmVO userVm = _vmDao.findById(cmd.getId());<NEW_LINE>if (userVm == null) {<NEW_LINE>throw new InvalidParameterValueException("unable to find a virtual machine by id" + cmd.getId());<NEW_LINE>}<NEW_LINE>VMTemplateVO template = _templateDao.<MASK><NEW_LINE>// Do parameters input validation<NEW_LINE>if (userVm.getState() == State.Error || userVm.getState() == State.Expunging) {<NEW_LINE>s_logger.error("vm is not in the right state: " + vmId);<NEW_LINE>throw new InvalidParameterValueException("Vm with specified id is not in the right state");<NEW_LINE>}<NEW_LINE>if (userVm.getState() != State.Stopped) {<NEW_LINE>s_logger.error("vm is not in the right state: " + vmId);<NEW_LINE>throw new InvalidParameterValueException("Vm " + userVm + " should be stopped to do SSH Key reset");<NEW_LINE>}<NEW_LINE>if (cmd.getNames() == null || cmd.getNames().isEmpty()) {<NEW_LINE>throw new InvalidParameterValueException("'keypair' or 'keyparis' must be specified");<NEW_LINE>}<NEW_LINE>String keypairnames = "";<NEW_LINE>String sshPublicKeys = "";<NEW_LINE>List<SSHKeyPairVO> pairs = new ArrayList<>();<NEW_LINE>pairs = _sshKeyPairDao.findByNames(owner.getAccountId(), owner.getDomainId(), cmd.getNames());<NEW_LINE>if (pairs == null || pairs.size() != cmd.getNames().size()) {<NEW_LINE>throw new InvalidParameterValueException("Not all specified keyparis exist");<NEW_LINE>}<NEW_LINE>sshPublicKeys = pairs.stream().map(p -> p.getPublicKey()).collect(Collectors.joining("\n"));<NEW_LINE>keypairnames = String.join(",", cmd.getNames());<NEW_LINE>_accountMgr.checkAccess(caller, null, true, userVm);<NEW_LINE>boolean result = resetVMSSHKeyInternal(vmId, sshPublicKeys, keypairnames);<NEW_LINE>UserVmVO vm = _vmDao.findById(vmId);<NEW_LINE>_vmDao.loadDetails(vm);<NEW_LINE>if (!result) {<NEW_LINE>throw new CloudRuntimeException("Failed to reset SSH Key for the virtual machine ");<NEW_LINE>}<NEW_LINE>removeEncryptedPasswordFromUserVmVoDetails(vmId);<NEW_LINE>_vmDao.loadDetails(userVm);<NEW_LINE>return userVm;<NEW_LINE>} | findByIdIncludingRemoved(userVm.getTemplateId()); |
652,017 | public void filter() {<NEW_LINE>final String filter = getFilter();<NEW_LINE>if (filter != null && filter.length() > 0) {<NEW_LINE>if (!myExpansionMonitor.isFreeze()) {<NEW_LINE>myExpansionMonitor.freeze();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>IntentionSettingsTree.this.filter<MASK><NEW_LINE>if (myTree != null) {<NEW_LINE>List<TreePath> expandedPaths = TreeUtil.collectExpandedPaths(myTree);<NEW_LINE>((DefaultTreeModel) myTree.getModel()).reload();<NEW_LINE>TreeUtil.restoreExpandedPaths(myTree, expandedPaths);<NEW_LINE>}<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>myTree.setSelectionRow(0);<NEW_LINE>IdeFocusManager.getGlobalInstance().doForceFocusWhenFocusSettlesDown(myTree);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>TreeUtil.expandAll(myTree);<NEW_LINE>if (filter == null || filter.length() == 0) {<NEW_LINE>TreeUtil.collapseAll(myTree, 0);<NEW_LINE>myExpansionMonitor.restore();<NEW_LINE>}<NEW_LINE>} | (filterModel(filter, true)); |
492,280 | public static void showHeadlineDialog(final String headlineFilterPattern, final Activity activity, final EditText text) {<NEW_LINE>SearchOrCustomTextDialog.DialogOptions dopt2 = new SearchOrCustomTextDialog.DialogOptions();<NEW_LINE>baseConf(activity, dopt2);<NEW_LINE>dopt2.positionCallback = (result) -> StringUtils.selectLines(text, result);<NEW_LINE>dopt2.data = Arrays.asList(text.getText().toString().split("\n", -1));<NEW_LINE>dopt2.titleText = R.string.table_of_contents;<NEW_LINE>dopt2.searchHintText = R.string.search;<NEW_LINE>dopt2.extraFilter = headlineFilterPattern;<NEW_LINE>dopt2.isSearchEnabled = true;<NEW_LINE>dopt2.searchIsRegex = false;<NEW_LINE>dopt2.gravity = Gravity.TOP;<NEW_LINE><MASK><NEW_LINE>} | SearchOrCustomTextDialog.showMultiChoiceDialogWithSearchFilterUI(activity, dopt2); |
1,210,145 | private void sendResponse(ChannelHandlerContext ctx, String tableNameWithType, long queryArrivalTimeMs, byte[] serializedDataTable) {<NEW_LINE>long sendResponseStartTimeMs = System.currentTimeMillis();<NEW_LINE>int queryProcessingTimeMs = (int) (sendResponseStartTimeMs - queryArrivalTimeMs);<NEW_LINE>ctx.writeAndFlush(Unpooled.wrappedBuffer(serializedDataTable)).addListener(f -> {<NEW_LINE>long sendResponseEndTimeMs = System.currentTimeMillis();<NEW_LINE>int sendResponseLatencyMs = <MASK><NEW_LINE>_serverMetrics.addMeteredGlobalValue(ServerMeter.NETTY_CONNECTION_RESPONSES_SENT, 1);<NEW_LINE>_serverMetrics.addMeteredGlobalValue(ServerMeter.NETTY_CONNECTION_BYTES_SENT, serializedDataTable.length);<NEW_LINE>_serverMetrics.addTimedTableValue(tableNameWithType, ServerTimer.NETTY_CONNECTION_SEND_RESPONSE_LATENCY, sendResponseLatencyMs, TimeUnit.MILLISECONDS);<NEW_LINE>int totalQueryTimeMs = (int) (sendResponseEndTimeMs - queryArrivalTimeMs);<NEW_LINE>if (totalQueryTimeMs > SLOW_QUERY_LATENCY_THRESHOLD_MS) {<NEW_LINE>LOGGER.info("Slow query: request handler processing time: {}, send response latency: {}, total time to handle " + "request: {}", queryProcessingTimeMs, sendResponseLatencyMs, totalQueryTimeMs);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | (int) (sendResponseEndTimeMs - sendResponseStartTimeMs); |
817,318 | private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>requireCertificateChBox = new javax.swing.JCheckBox();<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(requireCertificateChBox, org.openide.util.NbBundle.getMessage(TransportSecurity.class, "LBL_RequireClientCertificate"));<NEW_LINE>requireCertificateChBox.setMargin(new java.awt.Insets(0<MASK><NEW_LINE>requireCertificateChBox.addActionListener(new java.awt.event.ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>requireCertificateChBoxActionPerformed(evt);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);<NEW_LINE>this.setLayout(layout);<NEW_LINE>layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addComponent(requireCertificateChBox).addContainerGap(40, Short.MAX_VALUE)));<NEW_LINE>layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addComponent(requireCertificateChBox).addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));<NEW_LINE>} | , 0, 0, 0)); |
752,667 | public EntityModel<Command> toModel(final Command command) {<NEW_LINE>final String id = command.getId().orElseThrow(IllegalArgumentException::new);<NEW_LINE>final EntityModel<Command> commandModel = EntityModel.of(command);<NEW_LINE>try {<NEW_LINE>commandModel.add(WebMvcLinkBuilder.linkTo(WebMvcLinkBuilder.methodOn(CommandRestController.class).getCommand(<MASK><NEW_LINE>commandModel.add(WebMvcLinkBuilder.linkTo(WebMvcLinkBuilder.methodOn(CommandRestController.class).getApplicationsForCommand(id)).withRel(APPLICATIONS_LINK));<NEW_LINE>commandModel.add(WebMvcLinkBuilder.linkTo(WebMvcLinkBuilder.methodOn(CommandRestController.class).getClustersForCommand(id, null)).withRel(CLUSTERS_LINK));<NEW_LINE>} catch (final GenieException | GenieCheckedException ge) {<NEW_LINE>// If we can't convert it we might as well force a server exception<NEW_LINE>throw new RuntimeException(ge);<NEW_LINE>}<NEW_LINE>return commandModel;<NEW_LINE>} | id)).withSelfRel()); |
1,233,743 | protected Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {<NEW_LINE>Parser parser = new Parser(PATTERN, (String) msg);<NEW_LINE>if (!parser.matches()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Position position = new Position(getProtocolName());<NEW_LINE>DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());<NEW_LINE>if (deviceSession == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>position.setDeviceId(deviceSession.getDeviceId());<NEW_LINE>position.setTime(parser.nextDateTime());<NEW_LINE>position.setLongitude(parser.nextDouble(0));<NEW_LINE>position.setLatitude(parser.nextDouble(0));<NEW_LINE>position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble(0)));<NEW_LINE>position.setCourse(parser.nextDouble(0));<NEW_LINE>position.setAltitude(parser.nextDouble(0));<NEW_LINE>int satellites = parser.nextInt(0);<NEW_LINE>position.setValid(satellites >= 3);<NEW_LINE>position.set(Position.KEY_SATELLITES, satellites);<NEW_LINE>position.set(Position.KEY_EVENT, parser.next());<NEW_LINE>position.set(Position.KEY_BATTERY_LEVEL, parser.nextInt(0));<NEW_LINE>position.set(Position.PREFIX_TEMP + <MASK><NEW_LINE>return position;<NEW_LINE>} | 1, parser.next()); |
1,659,617 | public static ListContactsResponse unmarshall(ListContactsResponse listContactsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listContactsResponse.setRequestId(_ctx.stringValue("ListContactsResponse.RequestId"));<NEW_LINE>listContactsResponse.setTotalCount(_ctx.integerValue("ListContactsResponse.TotalCount"));<NEW_LINE>listContactsResponse.setNextToken(_ctx.integerValue("ListContactsResponse.NextToken"));<NEW_LINE>listContactsResponse.setSuccess(_ctx.booleanValue("ListContactsResponse.Success"));<NEW_LINE>listContactsResponse.setCode(_ctx.stringValue("ListContactsResponse.Code"));<NEW_LINE>listContactsResponse.setMessage(_ctx.stringValue("ListContactsResponse.Message"));<NEW_LINE>List<Contact> contacts = new ArrayList<Contact>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListContactsResponse.Contacts.Length"); i++) {<NEW_LINE>Contact contact = new Contact();<NEW_LINE>contact.setLastMobileVerificationTimeStamp(_ctx.longValue("ListContactsResponse.Contacts[" + i + "].LastMobileVerificationTimeStamp"));<NEW_LINE>contact.setEmail(_ctx.stringValue("ListContactsResponse.Contacts[" + i + "].Email"));<NEW_LINE>contact.setLastEmailVerificationTimeStamp(_ctx.longValue("ListContactsResponse.Contacts[" + i + "].LastEmailVerificationTimeStamp"));<NEW_LINE>contact.setContactId(_ctx.longValue<MASK><NEW_LINE>contact.setContactName(_ctx.stringValue("ListContactsResponse.Contacts[" + i + "].ContactName"));<NEW_LINE>contact.setIsVerifiedEmail(_ctx.booleanValue("ListContactsResponse.Contacts[" + i + "].IsVerifiedEmail"));<NEW_LINE>contact.setIsObsolete(_ctx.booleanValue("ListContactsResponse.Contacts[" + i + "].IsObsolete"));<NEW_LINE>contact.setPosition(_ctx.stringValue("ListContactsResponse.Contacts[" + i + "].Position"));<NEW_LINE>contact.setAccountUid(_ctx.longValue("ListContactsResponse.Contacts[" + i + "].AccountUid"));<NEW_LINE>contact.setMobile(_ctx.stringValue("ListContactsResponse.Contacts[" + i + "].Mobile"));<NEW_LINE>contact.setIsAccount(_ctx.booleanValue("ListContactsResponse.Contacts[" + i + "].IsAccount"));<NEW_LINE>contact.setIsVerifiedMobile(_ctx.booleanValue("ListContactsResponse.Contacts[" + i + "].IsVerifiedMobile"));<NEW_LINE>contacts.add(contact);<NEW_LINE>}<NEW_LINE>listContactsResponse.setContacts(contacts);<NEW_LINE>return listContactsResponse;<NEW_LINE>} | ("ListContactsResponse.Contacts[" + i + "].ContactId")); |
650,378 | public void increment(String event, Attrs extraDimensions) {<NEW_LINE>Objects.requireNonNull(event);<NEW_LINE>Objects.requireNonNull(extraDimensions);<NEW_LINE>if (counts.containsKey(event)) {<NEW_LINE>// TODO(carl-mastrangelo): make this throw IllegalStateException after verifying this doesn't happen.<NEW_LINE>logger.warn("Duplicate conn counter increment {}", event);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Attrs connDims = chan.attr(Server.CONN_DIMENSIONS).get();<NEW_LINE>Map<String, String> dimTags = new HashMap<>(connDims.size() + extraDimensions.size());<NEW_LINE>connDims.forEach((k, v) -> dimTags.put(k.name(), String.valueOf(v)));<NEW_LINE>extraDimensions.forEach((k, v) -> dimTags.put(k.name(), String.valueOf(v)));<NEW_LINE>dimTags.put("from", lastCountKey != null ? lastCountKey : "nascent");<NEW_LINE>lastCountKey = event;<NEW_LINE>Id id = registry.createId(metricBase.name() + '.' + event).withTags(metricBase.tags<MASK><NEW_LINE>Gauge gauge = registry.gauge(id);<NEW_LINE>synchronized (getLock(id)) {<NEW_LINE>double current = gauge.value();<NEW_LINE>gauge.set(Double.isNaN(current) ? 1 : current + 1);<NEW_LINE>}<NEW_LINE>counts.put(event, gauge);<NEW_LINE>} | ()).withTags(dimTags); |
57,113 | private void launchFile(String filePath) {<NEW_LINE>File file = new File(filePath);<NEW_LINE>if (file.exists()) {<NEW_LINE>Intent intent = new Intent(Intent.ACTION_VIEW);<NEW_LINE>intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);<NEW_LINE>intent.addCategory("android.intent.category.DEFAULT");<NEW_LINE>Uri uri = null;<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {<NEW_LINE>intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);<NEW_LINE>String packageName = this.getPackageName();<NEW_LINE>uri = FileProvider.getUriForFile(this, packageName + ".fileProvider", new File(filePath));<NEW_LINE>} else {<NEW_LINE>uri = Uri.fromFile(file);<NEW_LINE>}<NEW_LINE>if (filePath.contains(".pdf"))<NEW_LINE><MASK><NEW_LINE>else<NEW_LINE>intent.setDataAndType(uri, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");<NEW_LINE>try {<NEW_LINE>this.startActivity(intent);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// Could not launch the file.<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | intent.setDataAndType(uri, "application/pdf"); |
1,691,717 | public static RexProgram createIdentity(RelDataType rowType, RelDataType outputRowType) {<NEW_LINE>if (rowType != outputRowType && !Pair.right(rowType.getFieldList()).equals(Pair.right(outputRowType.getFieldList()))) {<NEW_LINE>throw new IllegalArgumentException("field type mismatch: " + rowType + " vs. " + outputRowType);<NEW_LINE>}<NEW_LINE>final List<RelDataTypeField> fields = rowType.getFieldList();<NEW_LINE>final List<RexLocalRef> <MASK><NEW_LINE>final List<RexInputRef> refs = new ArrayList<>();<NEW_LINE>for (int i = 0; i < fields.size(); i++) {<NEW_LINE>final RexInputRef ref = RexInputRef.of(i, fields);<NEW_LINE>refs.add(ref);<NEW_LINE>projectRefs.add(new RexLocalRef(i, ref.getType()));<NEW_LINE>}<NEW_LINE>return new RexProgram(rowType, refs, projectRefs, null, outputRowType);<NEW_LINE>} | projectRefs = new ArrayList<>(); |
1,167,047 | public void run() {<NEW_LINE>try {<NEW_LINE>logCount %= 10;<NEW_LINE>if (logCount == 0) {<NEW_LINE>Loggers.PERFORMANCE_LOG.info("PERFORMANCE:|serviceCount|ipCount|subscribeCount|maxPushCost|avgPushCost|totalPushCount|failPushCount");<NEW_LINE>Loggers.PERFORMANCE_LOG.info("DISTRO:|V1SyncDone|V1SyncFail|V2SyncDone|V2SyncFail|V2VerifyFail|");<NEW_LINE>}<NEW_LINE>int serviceCount = com.alibaba.nacos.naming.core.v2.ServiceManager.getInstance().size();<NEW_LINE>int ipCount = MetricsMonitor<MASK><NEW_LINE>int subscribeCount = MetricsMonitor.getSubscriberCount().get();<NEW_LINE>long maxPushCost = MetricsMonitor.getMaxPushCostMonitor().get();<NEW_LINE>long avgPushCost = getAvgPushCost();<NEW_LINE>long totalPushCount = MetricsMonitor.getTotalPushMonitor().longValue();<NEW_LINE>long failPushCount = MetricsMonitor.getFailedPushMonitor().longValue();<NEW_LINE>Loggers.PERFORMANCE_LOG.info("PERFORMANCE:|{}|{}|{}|{}|{}|{}|{}", serviceCount, ipCount, subscribeCount, maxPushCost, avgPushCost, totalPushCount, failPushCount);<NEW_LINE>Loggers.PERFORMANCE_LOG.info("Task worker status: \n" + NamingExecuteTaskDispatcher.getInstance().workersStatus());<NEW_LINE>printDistroMonitor();<NEW_LINE>logCount++;<NEW_LINE>MetricsMonitor.getTotalPushCountForAvg().set(0);<NEW_LINE>MetricsMonitor.getTotalPushCostForAvg().set(0);<NEW_LINE>MetricsMonitor.getMaxPushCostMonitor().set(-1);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Loggers.SRV_LOG.warn("[PERFORMANCE] Exception while print performance log.", e);<NEW_LINE>}<NEW_LINE>} | .getIpCountMonitor().get(); |
1,211,226 | private static SnapshotShardFailure constructSnapshotShardFailure(Object[] args) {<NEW_LINE>String index = (String) args[0];<NEW_LINE>String indexUuid = (String) args[1];<NEW_LINE>final String nodeId = (String) args[2];<NEW_LINE>String reason = (String) args[3];<NEW_LINE>Integer intShardId = (Integer) args[4];<NEW_LINE>final String status = (String) args[5];<NEW_LINE>if (index == null) {<NEW_LINE>throw new ElasticsearchParseException("index name was not set");<NEW_LINE>}<NEW_LINE>if (intShardId == null) {<NEW_LINE>throw new ElasticsearchParseException("index shard was not set");<NEW_LINE>}<NEW_LINE>ShardId shardId = new ShardId(index, indexUuid != null ? indexUuid : IndexMetadata.INDEX_UUID_NA_VALUE, intShardId);<NEW_LINE>// Workaround for https://github.com/elastic/elasticsearch/issues/25878<NEW_LINE>// Some old snapshot might still have null in shard failure reasons<NEW_LINE>String nonNullReason;<NEW_LINE>if (reason != null) {<NEW_LINE>nonNullReason = reason;<NEW_LINE>} else {<NEW_LINE>nonNullReason = "";<NEW_LINE>}<NEW_LINE>RestStatus restStatus;<NEW_LINE>if (status != null) {<NEW_LINE>restStatus = RestStatus.valueOf(status);<NEW_LINE>} else {<NEW_LINE>restStatus = RestStatus.INTERNAL_SERVER_ERROR;<NEW_LINE>}<NEW_LINE>return new SnapshotShardFailure(<MASK><NEW_LINE>} | nodeId, shardId, nonNullReason, restStatus); |
344,848 | public void methodThree() {<NEW_LINE>List<StackFrame> stackTrace = StackWalker.getInstance().walk(this::walkExample);<NEW_LINE>printStackTrace(stackTrace);<NEW_LINE>System.out.println("---------------------------------------------");<NEW_LINE>stackTrace = StackWalker.getInstance().walk(this::walkExample2);<NEW_LINE>printStackTrace(stackTrace);<NEW_LINE>System.out.println("---------------------------------------------");<NEW_LINE>String line = StackWalker.getInstance().walk(this::walkExample3);<NEW_LINE>System.out.println(line);<NEW_LINE>System.out.println("---------------------------------------------");<NEW_LINE>stackTrace = StackWalker.getInstance(StackWalker.Option.SHOW_REFLECT_FRAMES<MASK><NEW_LINE>printStackTrace(stackTrace);<NEW_LINE>System.out.println("---------------------------------------------");<NEW_LINE>Runnable r = () -> {<NEW_LINE>List<StackFrame> stackTrace2 = StackWalker.getInstance(StackWalker.Option.SHOW_HIDDEN_FRAMES).walk(this::walkExample);<NEW_LINE>printStackTrace(stackTrace2);<NEW_LINE>};<NEW_LINE>r.run();<NEW_LINE>} | ).walk(this::walkExample); |
1,693,471 | protected void init0() {<NEW_LINE>for (Parameter parameter : info.getParameters()) {<NEW_LINE>Name parameterRoutineName = name(parameter.getSpecificCatalog(), parameter.getSpecificSchema(), parameter.getSpecificPackage(<MASK><NEW_LINE>if (specificName.equals(parameterRoutineName)) {<NEW_LINE>DataTypeDefinition type = new DefaultDataTypeDefinition(getDatabase(), getSchema(), parameter.getDataType(), parameter.getCharacterMaximumLength(), parameter.getNumericPrecision(), parameter.getNumericScale(), null, parameter.getParameterDefault());<NEW_LINE>ParameterDefinition p = new DefaultParameterDefinition(this, parameter.getParameterName(), parameter.getOrdinalPosition(), type, !StringUtils.isBlank(parameter.getParameterDefault()), StringUtils.isBlank(parameter.getParameterName()), parameter.getComment());<NEW_LINE>switch(parameter.getParameterMode()) {<NEW_LINE>case IN:<NEW_LINE>addParameter(InOutDefinition.IN, p);<NEW_LINE>break;<NEW_LINE>case INOUT:<NEW_LINE>addParameter(InOutDefinition.INOUT, p);<NEW_LINE>break;<NEW_LINE>case OUT:<NEW_LINE>addParameter(InOutDefinition.OUT, p);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ), parameter.getSpecificName()); |
1,800,890 | final ListReadinessChecksResult executeListReadinessChecks(ListReadinessChecksRequest listReadinessChecksRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listReadinessChecksRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListReadinessChecksRequest> request = null;<NEW_LINE>Response<ListReadinessChecksResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListReadinessChecksRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listReadinessChecksRequest));<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, "Route53 Recovery Readiness");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListReadinessChecks");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListReadinessChecksResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListReadinessChecksResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
1,853,979 | public static Map<String, Object> createFieldParameters(FileObject targetJspFO, final String entityClass, final String managedBean, final String managedBeanProperty, final boolean collectionComponent, final boolean initValueGetters, JsfLibrariesSupport jls) throws IOException {<NEW_LINE>final Map<String, Object> params = new HashMap<>();<NEW_LINE>JavaSource javaSource = JavaSource.create(EntityClass.createClasspathInfo(targetJspFO));<NEW_LINE>javaSource.runUserActionTask(new Task<CompilationController>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(CompilationController controller) throws IOException {<NEW_LINE>controller.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED);<NEW_LINE>TypeElement typeElement = controller.getElements().getTypeElement(entityClass);<NEW_LINE>enumerateEntityFields(params, controller, typeElement, managedBeanProperty, collectionComponent, initValueGetters);<NEW_LINE>}<NEW_LINE>}, true);<NEW_LINE>// NOI18N<NEW_LINE>params.put("managedBean", managedBean);<NEW_LINE>// NOI18N<NEW_LINE>params.put("managedBeanProperty", managedBeanProperty);<NEW_LINE>String entityName = entityClass;<NEW_LINE>if (entityName.lastIndexOf(".") != -1) {<NEW_LINE>entityName = entityName.substring(entityClass<MASK><NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>params.put("entityName", entityName);<NEW_LINE>if (jls != null) {<NEW_LINE>params.put("prefixResolver", new PrefixResolver(jls));<NEW_LINE>}<NEW_LINE>// namespace location<NEW_LINE>WebModule webModule = WebModule.getWebModule(targetJspFO);<NEW_LINE>// NOI18N<NEW_LINE>params.put("nsLocation", JSFUtils.getNamespaceDomain(webModule));<NEW_LINE>return params;<NEW_LINE>} | .lastIndexOf(".") + 1); |
1,344,140 | public Object calculate(Context ctx) {<NEW_LINE>if (param == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("append" + mm.getMessage("function.missingParam"));<NEW_LINE>} else if (!param.isLeaf()) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("append" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>Object obj = param.getLeafExpression().calculate(ctx);<NEW_LINE>if (obj instanceof ICursor) {<NEW_LINE>try {<NEW_LINE>table.append((ICursor) obj, option);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RQException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} else if (obj == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("append" + mm.getMessage("function.invalidParam"));<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>throw new RQException("append" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>return table;<NEW_LINE>} | MessageManager mm = EngineMessage.get(); |
704,379 | public void flatMap(BaseRow input, Collector<BaseRow> out) throws Exception {<NEW_LINE>GenericRow genericRow = (GenericRow) input;<NEW_LINE>Map<String, Object> inputParams = Maps.newHashMap();<NEW_LINE>for (Integer conValIndex : sideInfo.getEqualValIndex()) {<NEW_LINE>Object equalObj = genericRow.getField(conValIndex);<NEW_LINE>if (equalObj == null) {<NEW_LINE>if (sideInfo.getJoinType() == JoinType.LEFT) {<NEW_LINE>BaseRow data = fillData(input, null);<NEW_LINE>RowDataComplete.collectBaseRow(out, data);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String columnName = sideInfo.getEqualFieldList().get(conValIndex);<NEW_LINE>inputParams.put(<MASK><NEW_LINE>}<NEW_LINE>String key = redisSideReqRow.buildCacheKey(inputParams);<NEW_LINE>Map<String, String> cacheMap = cacheRef.get().get(key);<NEW_LINE>if (cacheMap == null) {<NEW_LINE>if (sideInfo.getJoinType() == JoinType.LEFT) {<NEW_LINE>BaseRow data = fillData(input, null);<NEW_LINE>RowDataComplete.collectBaseRow(out, data);<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BaseRow newRow = fillData(input, cacheMap);<NEW_LINE>RowDataComplete.collectBaseRow(out, newRow);<NEW_LINE>} | columnName, equalObj.toString()); |
351,132 | final RestoreWorkspaceResult executeRestoreWorkspace(RestoreWorkspaceRequest restoreWorkspaceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(restoreWorkspaceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RestoreWorkspaceRequest> request = null;<NEW_LINE>Response<RestoreWorkspaceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RestoreWorkspaceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(restoreWorkspaceRequest));<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, "WorkSpaces");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RestoreWorkspace");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<RestoreWorkspaceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RestoreWorkspaceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
1,077,789 | public void transformReferences(RefTransformer visitor) {<NEW_LINE>// Make sure to rewrite the refMap first so that fixupAttrs works correctly.<NEW_LINE>refMap.ifPresent(m <MASK><NEW_LINE>int offset = 0;<NEW_LINE>while (offset < nodeBuf.limit()) {<NEW_LINE>int type = nodeBuf.getShort(offset);<NEW_LINE>if (type == XML_START_ELEMENT) {<NEW_LINE>int nodeHeaderSize = nodeBuf.getShort(offset + 2);<NEW_LINE>int extOffset = offset + nodeHeaderSize;<NEW_LINE>int attrStart = extOffset + nodeBuf.getShort(extOffset + 8);<NEW_LINE>Preconditions.checkState(attrStart == extOffset + 20);<NEW_LINE>if (DEBUG) {<NEW_LINE>int attrSize = nodeBuf.getShort(extOffset + 10);<NEW_LINE>Preconditions.checkState(attrSize == ATTRIBUTE_SIZE);<NEW_LINE>}<NEW_LINE>int attrCount = nodeBuf.getShort(extOffset + 12);<NEW_LINE>for (int i = 0; i < attrCount; i++) {<NEW_LINE>int attrOffset = attrStart + i * ATTRIBUTE_SIZE;<NEW_LINE>int attrType = nodeBuf.get(attrOffset + 15);<NEW_LINE>switch(attrType) {<NEW_LINE>case RES_REFERENCE:<NEW_LINE>case RES_ATTRIBUTE:<NEW_LINE>transformEntryDataOffset(nodeBuf, attrOffset + 16, visitor);<NEW_LINE>break;<NEW_LINE>case RES_DYNAMIC_ATTRIBUTE:<NEW_LINE>case RES_DYNAMIC_REFERENCE:<NEW_LINE>throw new UnsupportedOperationException();<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>fixupAttrs(attrStart, attrCount);<NEW_LINE>}<NEW_LINE>int chunkSize = nodeBuf.getInt(offset + 4);<NEW_LINE>offset += chunkSize;<NEW_LINE>}<NEW_LINE>} | -> m.visitReferences(visitor)); |
1,188,067 | public MetaContact findMetaContactByContact(Contact protoContact) {<NEW_LINE>// first go through the contacts that are direct children of this method.<NEW_LINE>Iterator<MetaContact> contactsIter = getChildContacts();<NEW_LINE>while (contactsIter.hasNext()) {<NEW_LINE>MetaContact mContact = contactsIter.next();<NEW_LINE>Contact storedProtoContact = mContact.getContact(protoContact.getAddress(<MASK><NEW_LINE>if (storedProtoContact != null)<NEW_LINE>return mContact;<NEW_LINE>}<NEW_LINE>// if we didn't find it here, let's try in the subgroups<NEW_LINE>Iterator<MetaContactGroup> groupsIter = getSubgroups();<NEW_LINE>while (groupsIter.hasNext()) {<NEW_LINE>MetaContactGroupImpl mGroup = (MetaContactGroupImpl) groupsIter.next();<NEW_LINE>MetaContact mContact = mGroup.findMetaContactByContact(protoContact);<NEW_LINE>if (mContact != null)<NEW_LINE>return mContact;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | ), protoContact.getProtocolProvider()); |
584,664 | protected boolean matchesSafely(String content) {<NEW_LINE>try {<NEW_LINE>JsonNode contentAsJsonNode = JsonLoader.fromString(content);<NEW_LINE>JsonSchemaFactory jsonSchemaFactory = instanceSettings.jsonSchemaFactory();<NEW_LINE>Schema loadedSchema = loadSchema(schema, instanceSettings);<NEW_LINE>final JsonSchema jsonSchema;<NEW_LINE>if (loadedSchema.hasType(JsonNode.class)) {<NEW_LINE>jsonSchema = jsonSchemaFactory.getJsonSchema(JsonNode.class.cast(loadedSchema.schema));<NEW_LINE>} else if (loadedSchema.hasType(String.class)) {<NEW_LINE>jsonSchema = jsonSchemaFactory.getJsonSchema(String.class.cast(loadedSchema.schema));<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Internal error when loading schema from factory. Type was " + loadedSchema.schema.<MASK><NEW_LINE>}<NEW_LINE>if (instanceSettings.shouldUseCheckedValidation()) {<NEW_LINE>report = jsonSchema.validate(contentAsJsonNode);<NEW_LINE>} else {<NEW_LINE>report = jsonSchema.validateUnchecked(contentAsJsonNode);<NEW_LINE>}<NEW_LINE>return report.isSuccess();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new JsonSchemaValidationException(e);<NEW_LINE>}<NEW_LINE>} | getClass().getName()); |
1,764,638 | private void resolveParentDependenciesRecursively(List<Pom> pomAncestry) {<NEW_LINE>Pom pom = pomAncestry.get(0);<NEW_LINE>for (Profile profile : pom.getProfiles()) {<NEW_LINE>if (profile.isActive(activeProfiles)) {<NEW_LINE>mergeDependencyManagement(profile.getDependencyManagement(), pom);<NEW_LINE>mergeRequestedDependencies(profile.getDependencies());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mergeDependencyManagement(pom.getDependencyManagement(), pom);<NEW_LINE>mergeRequestedDependencies(pom.getDependencies());<NEW_LINE>if (pom.getParent() != null) {<NEW_LINE>Pom parentPom = downloader.download(getValues(pom.getParent().getGav()), pom.getParent().getRelativePath(), ResolvedPom.this, repositories);<NEW_LINE>for (Pom ancestor : pomAncestry) {<NEW_LINE>if (ancestor.getGav().equals(parentPom.getGav())) {<NEW_LINE>// parent cycle<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>MavenExecutionContextView.view(ctx).getResolutionListener().parent(parentPom, pom);<NEW_LINE><MASK><NEW_LINE>resolveParentDependenciesRecursively(pomAncestry);<NEW_LINE>}<NEW_LINE>} | pomAncestry.add(0, parentPom); |
307,519 | protected CommonFuncToggleAppListFilterViewModel.ListModelLoader onCreateListModelLoader() {<NEW_LINE>return index -> {<NEW_LINE>AppListItemDescriptionComposer composer = new AppListItemDescriptionComposer(thisActivity());<NEW_LINE>ThanosManager thanos = ThanosManager.from(getApplicationContext());<NEW_LINE>if (!thanos.isServiceInstalled())<NEW_LINE>return Lists.newArrayListWithCapacity(0);<NEW_LINE>String runningBadge = getApplicationContext().getString(R.string.badge_app_running);<NEW_LINE>String idleBadge = getApplicationContext().getString(R.string.badge_app_idle);<NEW_LINE>ActivityManager am = thanos.getActivityManager();<NEW_LINE>List<AppInfo> installed = thanos.getPkgManager().getInstalledPkgsByPackageSetId(index.pkgSetId);<NEW_LINE>List<AppListModel> res = new ArrayList<>();<NEW_LINE>CollectionUtils.consumeRemaining(installed, appInfo -> {<NEW_LINE>appInfo.setSelected(am.isPkgSmartStandByEnabled(appInfo.getPkgName()));<NEW_LINE>res.add(new AppListModel(appInfo, thanos.getActivityManager().isPackageRunning(appInfo.getPkgName()) ? runningBadge : null, thanos.getActivityManager().isPackageIdle(appInfo.getPkgName()) ? idleBadge : null, <MASK><NEW_LINE>});<NEW_LINE>Collections.sort(res);<NEW_LINE>return res;<NEW_LINE>};<NEW_LINE>} | composer.getAppItemDescription(appInfo))); |
1,244,469 | public PhotonDoc address(Map<String, String> address) {<NEW_LINE>if (address != null) {<NEW_LINE>extractAddress(address, AddressType.STREET, "street");<NEW_LINE>extractAddress(address, AddressType.CITY, "city");<NEW_LINE>extractAddress(<MASK><NEW_LINE>extractAddress(address, AddressType.LOCALITY, "neighbourhood");<NEW_LINE>extractAddress(address, AddressType.COUNTY, "county");<NEW_LINE>extractAddress(address, AddressType.STATE, "state");<NEW_LINE>String addressPostCode = address.get("postcode");<NEW_LINE>if (addressPostCode != null && !addressPostCode.equals(postcode)) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Replacing postcode " + postcode + " with " + addressPostCode + " for osmId #" + osmId);<NEW_LINE>}<NEW_LINE>postcode = addressPostCode;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>} | address, AddressType.DISTRICT, "suburb"); |
621,404 | final StartLoggingResult executeStartLogging(StartLoggingRequest startLoggingRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(startLoggingRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StartLoggingRequest> request = null;<NEW_LINE>Response<StartLoggingResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new StartLoggingRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startLoggingRequest));<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, "CloudTrail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartLogging");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StartLoggingResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartLoggingResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
568,550 | public static LocalDBLoggerSettings fromConfiguration(final AppConfig appConfig) {<NEW_LINE>final Set<Flag> flags = EnumSet.noneOf(Flag.class);<NEW_LINE>if (appConfig.isDevDebugMode()) {<NEW_LINE>flags.add(Flag.DevDebug);<NEW_LINE>}<NEW_LINE>final int maxEvents = (int) appConfig.readSettingAsLong(PwmSetting.EVENTS_PWMDB_MAX_EVENTS);<NEW_LINE>final long maxAgeMS = 1000 * appConfig.readSettingAsLong(PwmSetting.EVENTS_PWMDB_MAX_AGE);<NEW_LINE>final TimeDuration maxAge = TimeDuration.of(maxAgeMS, TimeDuration.Unit.MILLISECONDS);<NEW_LINE>final int maxBufferSize = Integer.parseInt(appConfig.readAppProperty(AppProperty.LOCALDB_LOGWRITER_BUFFER_SIZE));<NEW_LINE>final TimeDuration maxBufferWaitTime = TimeDuration.of(Long.parseLong(appConfig.readAppProperty(AppProperty.LOCALDB_LOGWRITER_MAX_BUFFER_WAIT_MS)), TimeDuration.Unit.MILLISECONDS);<NEW_LINE>final int maxTrimSize = Integer.parseInt(appConfig<MASK><NEW_LINE>return LocalDBLoggerSettings.builder().maxEvents(maxEvents).maxAge(maxAge).flags(flags).maxBufferSize(maxBufferSize).maxBufferWaitTime(maxBufferWaitTime).maxTrimSize(maxTrimSize).build().applyValueChecks();<NEW_LINE>} | .readAppProperty(AppProperty.LOCALDB_LOGWRITER_MAX_TRIM_SIZE)); |
1,191,327 | final BulkPublishResult executeBulkPublish(BulkPublishRequest bulkPublishRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(bulkPublishRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<BulkPublishRequest> request = null;<NEW_LINE>Response<BulkPublishResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new BulkPublishRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(bulkPublishRequest));<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, "Cognito Sync");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<BulkPublishResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new BulkPublishResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "BulkPublish"); |
724,787 | public static Map<String, Object> generateControllerConf(String zkAddress, String clusterName, String controllerHost, String controllerPort, String dataDir, ControllerConf.ControllerMode controllerMode, boolean tenantIsolation) throws SocketException, UnknownHostException {<NEW_LINE>if (StringUtils.isEmpty(zkAddress)) {<NEW_LINE>throw new RuntimeException("zkAddress cannot be empty.");<NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(clusterName)) {<NEW_LINE>throw new RuntimeException("clusterName cannot be empty.");<NEW_LINE>}<NEW_LINE>Map<String, Object> properties = new HashMap<>();<NEW_LINE>properties.put(ControllerConf.ZK_STR, zkAddress);<NEW_LINE>properties.put(ControllerConf.HELIX_CLUSTER_NAME, clusterName);<NEW_LINE>properties.put(ControllerConf.CONTROLLER_HOST, !StringUtils.isEmpty(controllerHost) ? <MASK><NEW_LINE>properties.put(ControllerConf.CONTROLLER_PORT, !StringUtils.isEmpty(controllerPort) ? controllerPort : getAvailablePort());<NEW_LINE>properties.put(ControllerConf.DATA_DIR, !StringUtils.isEmpty(dataDir) ? dataDir : TMP_DIR + String.format("Controller_%s_%s/controller/data", controllerHost, controllerPort));<NEW_LINE>properties.put(ControllerConf.CONTROLLER_VIP_HOST, controllerHost);<NEW_LINE>properties.put(ControllerConf.CLUSTER_TENANT_ISOLATION_ENABLE, tenantIsolation);<NEW_LINE>properties.put(ControllerPeriodicTasksConf.DEPRECATED_RETENTION_MANAGER_FREQUENCY_IN_SECONDS, 3600 * 6);<NEW_LINE>properties.put(ControllerPeriodicTasksConf.DEPRECATED_OFFLINE_SEGMENT_INTERVAL_CHECKER_FREQUENCY_IN_SECONDS, 3600);<NEW_LINE>properties.put(ControllerPeriodicTasksConf.DEPRECATED_REALTIME_SEGMENT_VALIDATION_FREQUENCY_IN_SECONDS, 3600);<NEW_LINE>properties.put(ControllerPeriodicTasksConf.DEPRECATED_BROKER_RESOURCE_VALIDATION_FREQUENCY_IN_SECONDS, 3600);<NEW_LINE>properties.put(ControllerConf.CONTROLLER_MODE, controllerMode.toString());<NEW_LINE>return properties;<NEW_LINE>} | controllerHost : NetUtils.getHostAddress()); |
591,620 | public static void broadcastEvent(final String name, final String data, final boolean authenticated, final boolean anonymous) {<NEW_LINE>if (anonymous == true && authenticated == true) {<NEW_LINE>broadcastEvent(name, data);<NEW_LINE>} else if (anonymous == true) {<NEW_LINE>// account for multiple open tabs/connections for one sessionIds and save result<NEW_LINE>final Map<String, Boolean> checkedSessionIds = new HashMap<>();<NEW_LINE>for (StructrEventSource es : eventSources) {<NEW_LINE>final String sessionId = es.getSessionId();<NEW_LINE>final Boolean <MASK><NEW_LINE>if (shouldReceive == null) {<NEW_LINE>final Principal user = AuthHelper.getPrincipalForSessionId(sessionId);<NEW_LINE>if (user == null) {<NEW_LINE>checkedSessionIds.put(sessionId, true);<NEW_LINE>es.sendEvent(name, data);<NEW_LINE>} else {<NEW_LINE>checkedSessionIds.put(sessionId, false);<NEW_LINE>}<NEW_LINE>} else if (shouldReceive == true) {<NEW_LINE>es.sendEvent(name, data);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (authenticated == true) {<NEW_LINE>// account for multiple open tabs/connections for one sessionIds and save result<NEW_LINE>final Map<String, Boolean> checkedSessionIds = new HashMap<>();<NEW_LINE>for (StructrEventSource es : eventSources) {<NEW_LINE>final String sessionId = es.getSessionId();<NEW_LINE>final Boolean shouldReceive = checkedSessionIds.get(sessionId);<NEW_LINE>if (shouldReceive == null) {<NEW_LINE>final Principal user = AuthHelper.getPrincipalForSessionId(sessionId);<NEW_LINE>if (user != null) {<NEW_LINE>checkedSessionIds.put(sessionId, true);<NEW_LINE>es.sendEvent(name, data);<NEW_LINE>} else {<NEW_LINE>checkedSessionIds.put(sessionId, false);<NEW_LINE>}<NEW_LINE>} else if (shouldReceive == true) {<NEW_LINE>es.sendEvent(name, data);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | shouldReceive = checkedSessionIds.get(sessionId); |
629,910 | public Node newNode(Object object) {<NEW_LINE>if (object == null) {<NEW_LINE>return new NullNode();<NEW_LINE>} else if (object instanceof Map) {<NEW_LINE>return new ObjectNode((Map<String, Object>) object, this);<NEW_LINE>} else if (object instanceof Number) {<NEW_LINE>return <MASK><NEW_LINE>} else if (object instanceof String) {<NEW_LINE>return new StringNode((String) object);<NEW_LINE>} else if (object instanceof Boolean) {<NEW_LINE>return new BooleanNode((Boolean) object);<NEW_LINE>} else if (object instanceof Object[]) {<NEW_LINE>return new ArrayNode(Arrays.asList((Object[]) object), this);<NEW_LINE>} else if (object instanceof int[]) {<NEW_LINE>return new ArrayNode(toIntList((int[]) object), this);<NEW_LINE>} else if (object instanceof double[]) {<NEW_LINE>return new ArrayNode(toDoubleList((double[]) object), this);<NEW_LINE>} else if (object instanceof boolean[]) {<NEW_LINE>return new ArrayNode(toBoolList((boolean[]) object), this);<NEW_LINE>} else if (object instanceof List) {<NEW_LINE>return new ArrayNode((List<?>) object, this);<NEW_LINE>} else if (object instanceof Node) {<NEW_LINE>return (Node) object;<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unsupported type " + object.getClass());<NEW_LINE>}<NEW_LINE>} | new NumberNode((Number) object); |
823,315 | final SetAlarmStateResult executeSetAlarmState(SetAlarmStateRequest setAlarmStateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(setAlarmStateRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SetAlarmStateRequest> request = null;<NEW_LINE>Response<SetAlarmStateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SetAlarmStateRequestMarshaller().marshall(super.beforeMarshalling(setAlarmStateRequest));<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, "CloudWatch");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SetAlarmState");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>StaxResponseHandler<SetAlarmStateResult> responseHandler = new StaxResponseHandler<SetAlarmStateResult>(new SetAlarmStateResultStaxUnmarshaller());<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,507,231 | protected String accessPageNoChallenge(HttpClient client, String location, int expectedStatusCode, String servletName) {<NEW_LINE>String methodName = "accessPageNoChallenge";<NEW_LINE>Log.info(logClass, methodName, "accessPageNoChallenge: location = " + location + " expectedStatusCode =" + expectedStatusCode);<NEW_LINE>try {<NEW_LINE>// Get method on form login page<NEW_LINE>HttpGet getMethod = new HttpGet(location);<NEW_LINE>HttpResponse response = client.execute(getMethod);<NEW_LINE>Log.info(logClass, methodName, "getMethod status: " + response.getStatusLine());<NEW_LINE>assertEquals("Expected " + expectedStatusCode + " was not returned", expectedStatusCode, response.getStatusLine().getStatusCode());<NEW_LINE>String content = EntityUtils.toString(response.getEntity());<NEW_LINE>Log.info(logClass, methodName, "Servlet full response content: \n" + content);<NEW_LINE>EntityUtils.consume(response.getEntity());<NEW_LINE>// Paranoia check, make sure we hit the right servlet<NEW_LINE>if (response.getStatusLine().getStatusCode() == 200) {<NEW_LINE>assertTrue("Response did not contain expected servlet name (" + servletName + ")"<MASK><NEW_LINE>return content;<NEW_LINE>} else if (expectedStatusCode == 401) {<NEW_LINE>assertTrue("Response was not the expected error page: " + LOGIN_ERROR_PAGE, content.contains(LOGIN_ERROR_PAGE));<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>fail("Caught unexpected exception: " + e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | , content.contains(servletName)); |
1,376,004 | public static void process(GrayU8 orig, GrayS16 derivX, GrayS16 derivY) {<NEW_LINE>final byte[] data = orig.data;<NEW_LINE>final short[] imgX = derivX.data;<NEW_LINE>final short[] imgY = derivY.data;<NEW_LINE>final int width = orig.getWidth();<NEW_LINE>final int height = orig.getHeight() - 1;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(1,height,y->{<NEW_LINE>for (int y = 1; y < height; y++) {<NEW_LINE>int endX = width * y + width - 1;<NEW_LINE>for (int index = width * y + 1; index < endX; index++) {<NEW_LINE>int v = (data[index + width + 1] & 0xFF) - (data[index <MASK><NEW_LINE>int w = (data[index + width - 1] & 0xFF) - (data[index - width + 1] & 0xFF);<NEW_LINE>imgY[index] = (short) (((data[index + width] & 0xFF) - (data[index - width] & 0xFF)) * 2 + v + w);<NEW_LINE>imgX[index] = (short) (((data[index + 1] & 0xFF) - (data[index - 1] & 0xFF)) * 2 + v - w);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} | - width - 1] & 0xFF); |
410,498 | public Dialog onCreateDialog(Bundle savedInstanceBundle) {<NEW_LINE>LayoutInflater inflater = getActivity().getLayoutInflater();<NEW_LINE>nameView = inflater.inflate(R.layout.name_variable_view, null);<NEW_LINE>mNameEditText = (EditText) nameView.findViewById(R.id.name);<NEW_LINE>mNameEditText.setText(mVariable);<NEW_LINE>TextView description = (TextView) nameView.findViewById(R.id.description);<NEW_LINE>if (mIsRename) {<NEW_LINE>description.setText(LangUtils.interpolate("%{BKY_RENAME_VARIABLE_TITLE}").replace("%1", mVariable));<NEW_LINE>} else {<NEW_LINE>description.setText(LangUtils.interpolate("%{BKY_NEW_VARIABLE_TITLE}"));<NEW_LINE>}<NEW_LINE>AlertDialog.Builder bob = new <MASK><NEW_LINE>bob.setTitle(LangUtils.interpolate("%{BKY_IOS_VARIABLES_VARIABLE_NAME}"));<NEW_LINE>bob.setView(nameView);<NEW_LINE>bob.setPositiveButton(LangUtils.interpolate("%{BKY_IOS_OK}"), mListener);<NEW_LINE>bob.setNegativeButton(LangUtils.interpolate("%{BKY_IOS_CANCEL}"), mListener);<NEW_LINE>return bob.create();<NEW_LINE>} | AlertDialog.Builder(getActivity()); |
1,170,491 | private List<Long> listVMInTransitionStateWithRecentReportOnUpHost(final long hostId, final Date cutTime) {<NEW_LINE>final String sql = "SELECT i.* FROM vm_instance as i, host as h WHERE h.status = 'UP' " + "AND h.id = ? AND i.power_state_update_time > ? AND i.host_id = h.id " + "AND (i.state ='Starting' OR i.state='Stopping' OR i.state='Migrating') " + "AND i.id NOT IN (SELECT w.vm_instance_id FROM vm_work_job AS w JOIN async_job AS j ON w.id = j.id WHERE j.job_status = ?)" + "AND i.removed IS NULL";<NEW_LINE>final List<Long> l = new ArrayList<>();<NEW_LINE>try (TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB)) {<NEW_LINE>String cutTimeStr = DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), cutTime);<NEW_LINE>int jobStatusInProgress = JobInfo.Status.IN_PROGRESS.ordinal();<NEW_LINE>try {<NEW_LINE>PreparedStatement <MASK><NEW_LINE>pstmt.setLong(1, hostId);<NEW_LINE>pstmt.setString(2, cutTimeStr);<NEW_LINE>pstmt.setInt(3, jobStatusInProgress);<NEW_LINE>final ResultSet rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>l.add(rs.getLong(1));<NEW_LINE>}<NEW_LINE>} catch (final SQLException e) {<NEW_LINE>s_logger.error(String.format("Unable to execute SQL [%s] with params {\"h.id\": %s, \"i.power_state_update_time\": \"%s\", \"j.job_status\": %s} due to [%s].", sql, hostId, cutTimeStr, jobStatusInProgress, e.getMessage()), e);<NEW_LINE>}<NEW_LINE>return l;<NEW_LINE>}<NEW_LINE>} | pstmt = txn.prepareAutoCloseStatement(sql); |
1,112,217 | public static byte[] encode(Object input) {<NEW_LINE>Value val = new Value(input);<NEW_LINE>if (val.isList()) {<NEW_LINE>List<Object<MASK><NEW_LINE>if (inputArray.isEmpty()) {<NEW_LINE>return encodeLength(inputArray.size(), OFFSET_SHORT_LIST);<NEW_LINE>}<NEW_LINE>byte[] output = ByteUtil.EMPTY_BYTE_ARRAY;<NEW_LINE>for (Object object : inputArray) {<NEW_LINE>output = concatenate(output, encode(object));<NEW_LINE>}<NEW_LINE>byte[] prefix = encodeLength(output.length, OFFSET_SHORT_LIST);<NEW_LINE>return concatenate(prefix, output);<NEW_LINE>} else {<NEW_LINE>byte[] inputAsBytes = toBytes(input);<NEW_LINE>if (inputAsBytes.length == 1 && (inputAsBytes[0] & 0xff) < 0x80) {<NEW_LINE>return inputAsBytes;<NEW_LINE>} else {<NEW_LINE>byte[] firstByte = encodeLength(inputAsBytes.length, OFFSET_SHORT_ITEM);<NEW_LINE>return concatenate(firstByte, inputAsBytes);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | > inputArray = val.asList(); |
1,262,042 | public void apply(ClassVisitor classVisitor, TypeDescription instrumentedType, AnnotationValueFilter annotationValueFilter) {<NEW_LINE>AnnotationAppender annotationAppender = new AnnotationAppender.Default(new AnnotationAppender.Target.OnType(classVisitor));<NEW_LINE>AnnotationAppender.ForTypeAnnotations.ofTypeVariable(annotationAppender, annotationValueFilter, AnnotationAppender.ForTypeAnnotations.VARIABLE_ON_TYPE, typeVariableIndex, instrumentedType.getTypeVariables());<NEW_LINE>TypeList.<MASK><NEW_LINE>int interfaceTypeIndex = this.interfaceTypeIndex;<NEW_LINE>for (TypeDescription.Generic interfaceType : interfaceTypes.subList(this.interfaceTypeIndex, interfaceTypes.size())) {<NEW_LINE>annotationAppender = interfaceType.accept(AnnotationAppender.ForTypeAnnotations.ofInterfaceType(annotationAppender, annotationValueFilter, interfaceTypeIndex++));<NEW_LINE>}<NEW_LINE>AnnotationList declaredAnnotations = instrumentedType.getDeclaredAnnotations();<NEW_LINE>for (AnnotationDescription annotationDescription : declaredAnnotations.subList(annotationIndex, declaredAnnotations.size())) {<NEW_LINE>annotationAppender = annotationAppender.append(annotationDescription, annotationValueFilter);<NEW_LINE>}<NEW_LINE>} | Generic interfaceTypes = instrumentedType.getInterfaces(); |
1,361,970 | Map<String, Object> callWithExecutionId(final String host, final int port, final String action, final Integer executionId, final String user, final DispatchMethod dispatchMethod, final Optional<Integer> httpTimeout, final Pair<String, String>... params) throws ExecutorManagerException {<NEW_LINE>try {<NEW_LINE>final List<Pair<String, String>> paramList = new ArrayList<>();<NEW_LINE>if (params != null) {<NEW_LINE>paramList.addAll<MASK><NEW_LINE>}<NEW_LINE>paramList.add(new Pair<>(ConnectorParams.ACTION_PARAM, action));<NEW_LINE>paramList.add(new Pair<>(ConnectorParams.EXECID_PARAM, String.valueOf(executionId)));<NEW_LINE>paramList.add(new Pair<>(ConnectorParams.USER_PARAM, user));<NEW_LINE>// Ideally we should throw an exception if executionId is null but some existing code<NEW_LINE>// (updateExecutions()) expects to call this method with a null executionId.<NEW_LINE>String executionPath = createExecutionPath(Optional.ofNullable(executionId), dispatchMethod);<NEW_LINE>return callForJsonObjectMap(host, port, executionPath, dispatchMethod, httpTimeout, paramList);<NEW_LINE>} catch (final IOException e) {<NEW_LINE>throw new ExecutorManagerException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | (Arrays.asList(params)); |
1,685,052 | public void createIfNotExistsCodeSnippets() {<NEW_LINE>// BEGIN: com.azure.storage.blob.BlobContainerClient.createIfNotExists<NEW_LINE>boolean result = client.createIfNotExists();<NEW_LINE>System.out.println("Create completed: " + result);<NEW_LINE>// END: com.azure.storage.blob.BlobContainerClient.createIfNotExists<NEW_LINE>// BEGIN: com.azure.storage.blob.BlobContainerClient.createIfNotExistsWithResponse#BlobContainerCreateOptions-Duration-Context<NEW_LINE>Map<String, String> metadata = Collections.singletonMap("metadata", "value");<NEW_LINE>Context context = new Context("Key", "Value");<NEW_LINE>BlobContainerCreateOptions options = new BlobContainerCreateOptions().setMetadata(metadata).setPublicAccessType(PublicAccessType.CONTAINER);<NEW_LINE>Response<Void> response = client.createIfNotExistsWithResponse(options, timeout, context);<NEW_LINE>if (response.getStatusCode() == 409) {<NEW_LINE>System.out.println("Already existed.");<NEW_LINE>} else {<NEW_LINE>System.out.printf(<MASK><NEW_LINE>}<NEW_LINE>// END: com.azure.storage.blob.BlobContainerClient.createIfNotExistsWithResponse#BlobContainerCreateOptions-Duration-Context<NEW_LINE>} | "Create completed with status %d%n", response.getStatusCode()); |
117,712 | private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>descTextArea = <MASK><NEW_LINE>tableScrollPane = new javax.swing.JScrollPane();<NEW_LINE>table = new javax.swing.JTable();<NEW_LINE>// NOI18N<NEW_LINE>setName(NbBundle.getMessage(SAXGeneratorParsletPanel.class, "SAXGeneratorParsletPanel.Form.name"));<NEW_LINE>setPreferredSize(new java.awt.Dimension(480, 350));<NEW_LINE>setLayout(new java.awt.GridBagLayout());<NEW_LINE>descTextArea.setEditable(false);<NEW_LINE>descTextArea.setFont(javax.swing.UIManager.getFont("Label.font"));<NEW_LINE>descTextArea.setForeground(new java.awt.Color(102, 102, 153));<NEW_LINE>descTextArea.setLineWrap(true);<NEW_LINE>// NOI18N<NEW_LINE>java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/netbeans/modules/xml/tools/java/generator/Bundle");<NEW_LINE>// NOI18N<NEW_LINE>descTextArea.setText(bundle.getString("DESC_saxw_convertors"));<NEW_LINE>descTextArea.setWrapStyleWord(true);<NEW_LINE>descTextArea.setDisabledTextColor(javax.swing.UIManager.getColor("Label.foreground"));<NEW_LINE>descTextArea.setEnabled(false);<NEW_LINE>descTextArea.setOpaque(false);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>add(descTextArea, gridBagConstraints);<NEW_LINE>table.setModel(tableModel);<NEW_LINE>tableScrollPane.setViewportView(table);<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>gridBagConstraints.insets = new java.awt.Insets(12, 0, 0, 0);<NEW_LINE>add(tableScrollPane, gridBagConstraints);<NEW_LINE>} | new javax.swing.JTextArea(); |
406,035 | final DescribeDBClusterParametersResult executeDescribeDBClusterParameters(DescribeDBClusterParametersRequest describeDBClusterParametersRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeDBClusterParametersRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeDBClusterParametersRequest> request = null;<NEW_LINE>Response<DescribeDBClusterParametersResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeDBClusterParametersRequestMarshaller().marshall(super.beforeMarshalling(describeDBClusterParametersRequest));<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, "Neptune");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDBClusterParameters");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeDBClusterParametersResult> 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>} | DescribeDBClusterParametersResult>(new DescribeDBClusterParametersResultStaxUnmarshaller()); |
588,526 | public static NeuralNetwork assembleNeuralNetwork() {<NEW_LINE>Layer inputLayer = new Layer();<NEW_LINE>inputLayer.addNeuron(new Neuron());<NEW_LINE>inputLayer.addNeuron(new Neuron());<NEW_LINE>Layer hiddenLayerOne = new Layer();<NEW_LINE>hiddenLayerOne.addNeuron(new Neuron());<NEW_LINE>hiddenLayerOne.addNeuron(new Neuron());<NEW_LINE>hiddenLayerOne.addNeuron(new Neuron());<NEW_LINE>hiddenLayerOne.addNeuron(new Neuron());<NEW_LINE>Layer hiddenLayerTwo = new Layer();<NEW_LINE>hiddenLayerTwo.addNeuron(new Neuron());<NEW_LINE>hiddenLayerTwo.addNeuron(new Neuron());<NEW_LINE>hiddenLayerTwo.addNeuron(new Neuron());<NEW_LINE>hiddenLayerTwo.addNeuron(new Neuron());<NEW_LINE>Layer outputLayer = new Layer();<NEW_LINE>outputLayer.addNeuron(new Neuron());<NEW_LINE>NeuralNetwork ann = new NeuralNetwork();<NEW_LINE>ann.addLayer(0, inputLayer);<NEW_LINE>ann.addLayer(1, hiddenLayerOne);<NEW_LINE>ConnectionFactory.fullConnect(ann.getLayerAt(0), ann.getLayerAt(1));<NEW_LINE>ann.addLayer(2, hiddenLayerTwo);<NEW_LINE>ConnectionFactory.fullConnect(ann.getLayerAt(1), ann.getLayerAt(2));<NEW_LINE>ann.addLayer(3, outputLayer);<NEW_LINE>ConnectionFactory.fullConnect(ann.getLayerAt(2), ann.getLayerAt(3));<NEW_LINE>ConnectionFactory.fullConnect(ann.getLayerAt(0), ann.getLayerAt(ann.getLayersCount() - 1), false);<NEW_LINE>ann.setInputNeurons(inputLayer.getNeurons());<NEW_LINE>ann.setOutputNeurons(outputLayer.getNeurons());<NEW_LINE><MASK><NEW_LINE>return ann;<NEW_LINE>} | ann.setNetworkType(NeuralNetworkType.MULTI_LAYER_PERCEPTRON); |
1,765,363 | private boolean prepareInvocation() {<NEW_LINE>synchronized (this) {<NEW_LINE>if (transformedSubject != null) {<NEW_LINE>// Already have a result, no need to execute<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!artifact.getFileSource().isFinalized()) {<NEW_LINE>// No input artifact yet, should execute<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (!artifact.getFileSource().getValue().isSuccessful()) {<NEW_LINE>synchronized (this) {<NEW_LINE>// Failed to resolve input artifact, no need to execute<NEW_LINE>transformedSubject = Try.failure(artifact.getFileSource().getValue().<MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>CacheableInvocation<TransformationSubject> invocation = createInvocation();<NEW_LINE>synchronized (this) {<NEW_LINE>this.invocation = invocation;<NEW_LINE>if (invocation.getCachedResult().isPresent()) {<NEW_LINE>// Have already executed the transform, no need to execute<NEW_LINE>transformedSubject = invocation.getCachedResult().get();<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>// Have not executed the transform, should execute<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getFailure().get()); |
1,274,481 | final CancelAuditTaskResult executeCancelAuditTask(CancelAuditTaskRequest cancelAuditTaskRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(cancelAuditTaskRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CancelAuditTaskRequest> request = null;<NEW_LINE>Response<CancelAuditTaskResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CancelAuditTaskRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(cancelAuditTaskRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CancelAuditTask");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CancelAuditTaskResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CancelAuditTaskResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT"); |
1,724,629 | public void createInitializrModel(IProgressMonitor monitor) {<NEW_LINE>InitializrModel initializrModel = null;<NEW_LINE>Exception error = null;<NEW_LINE>String url = urlField.getValue();<NEW_LINE>try {<NEW_LINE>writeToMonitor(monitor, "Getting Boot project...");<NEW_LINE>ISpringBootProject bootProject = getBootProject(url);<NEW_LINE>bootVersionField.<MASK><NEW_LINE>writeToMonitor(monitor, "Creating Initializr model...");<NEW_LINE>initializrModel = new InitializrModel(bootProject, preferences);<NEW_LINE>writeToMonitor(monitor, "Fetching starter information from Spring Boot Initializr...");<NEW_LINE>initializrModel.downloadDependencies();<NEW_LINE>} catch (Exception _e) {<NEW_LINE>error = _e;<NEW_LINE>}<NEW_LINE>// FIRST set the model even if there are errors<NEW_LINE>if (initializrModel != null) {<NEW_LINE>this.initializrModel.setValue(initializrModel);<NEW_LINE>}<NEW_LINE>if (error != null) {<NEW_LINE>Throwable e = ExceptionUtil.getDeepestCause(error);<NEW_LINE>if (e instanceof HttpRedirectionException) {<NEW_LINE>urlField.getVariable().setValue(((HttpRedirectionException) e).redirectedTo);<NEW_LINE>} else {<NEW_LINE>handleLoadingError(initializrModel, url, e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>initializrValidator.setValue(ValidationResult.OK);<NEW_LINE>}<NEW_LINE>} | setValue(bootProject.getBootVersion()); |
1,502,671 | public void cacheFile(String type, String key, File file) throws FileCacheException {<NEW_LINE>if (StringUtils.isEmpty(key)) {<NEW_LINE>throw new FileCacheException("cache key is empty ");<NEW_LINE>}<NEW_LINE>File <MASK><NEW_LINE>if (cacheFile.exists()) {<NEW_LINE>throw new FileCacheException("file cache alerady exist:" + cacheFile.getAbsolutePath());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>cacheFile.getParentFile().mkdirs();<NEW_LINE>if (file.isFile()) {<NEW_LINE>FileUtils.copyFile(file, cacheFile);<NEW_LINE>} else {<NEW_LINE>cacheFile.mkdirs();<NEW_LINE>FileLockUtils.lock(cacheFile, new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>FileUtils.copyDirectory(file, cacheFile);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>try {<NEW_LINE>FileUtils.forceDelete(cacheFile);<NEW_LINE>} catch (IOException e1) {<NEW_LINE>e1.printStackTrace();<NEW_LINE>}<NEW_LINE>throw new RuntimeException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw new FileCacheException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | cacheFile = getLocalCacheFile(type, key); |
1,487,553 | public ReferenceBinding[] memberTypes() {<NEW_LINE>if (this.memberTypes == null) {<NEW_LINE>try {<NEW_LINE>// the originalMemberTypes are already sorted by name so there<NEW_LINE>// is no need to sort again in our copy - names are not affected by type parameters<NEW_LINE>ReferenceBinding[] originalMemberTypes <MASK><NEW_LINE>int length = originalMemberTypes.length;<NEW_LINE>ReferenceBinding[] parameterizedMemberTypes = new ReferenceBinding[length];<NEW_LINE>// boolean isRaw = this.isRawType();<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>// substitute all member types, so as to get updated enclosing types<NEW_LINE>parameterizedMemberTypes[i] = originalMemberTypes[i].isStatic() ? originalMemberTypes[i] : this.environment.createParameterizedType(originalMemberTypes[i], null, this);<NEW_LINE>}<NEW_LINE>this.memberTypes = parameterizedMemberTypes;<NEW_LINE>} finally {<NEW_LINE>// if the original fields cannot be retrieved (ex. AbortCompilation), then assume we do not have any fields<NEW_LINE>if (this.memberTypes == null)<NEW_LINE>this.memberTypes = Binding.NO_MEMBER_TYPES;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return this.memberTypes;<NEW_LINE>} | = this.type.memberTypes(); |
777,852 | private BinaryEntry readBinary(IndexInput meta) throws IOException {<NEW_LINE>final BinaryEntry entry = new BinaryEntry();<NEW_LINE>entry.dataOffset = meta.readLong();<NEW_LINE>entry.dataLength = meta.readLong();<NEW_LINE>entry.docsWithFieldOffset = meta.readLong();<NEW_LINE>entry.docsWithFieldLength = meta.readLong();<NEW_LINE>entry.jumpTableEntryCount = meta.readShort();<NEW_LINE>entry.denseRankPower = meta.readByte();<NEW_LINE>entry.numDocsWithField = meta.readInt();<NEW_LINE>entry.minLength = meta.readInt();<NEW_LINE>entry.maxLength = meta.readInt();<NEW_LINE>if (entry.minLength < entry.maxLength) {<NEW_LINE>entry.addressesOffset = meta.readLong();<NEW_LINE>// Old count of uncompressed addresses<NEW_LINE><MASK><NEW_LINE>final int blockShift = meta.readVInt();<NEW_LINE>entry.addressesMeta = DirectMonotonicReader.loadMeta(meta, numAddresses, blockShift);<NEW_LINE>entry.addressesLength = meta.readLong();<NEW_LINE>}<NEW_LINE>return entry;<NEW_LINE>} | long numAddresses = entry.numDocsWithField + 1L; |
1,854,168 | public DataSource createDataSource(Configuration dbConfig) throws PropertyVetoException, SQLException {<NEW_LINE>HikariDataSource ds = new HikariDataSource();<NEW_LINE>ds.setDriverClassName(dbConfig.getProperty("db.driver"));<NEW_LINE>ds.setJdbcUrl(dbConfig.getProperty("db.url"));<NEW_LINE>ds.setUsername(dbConfig.getProperty("db.user"));<NEW_LINE>ds.setPassword<MASK><NEW_LINE>ds.setAutoCommit(false);<NEW_LINE>ds.setConnectionTimeout(parseLong(dbConfig.getProperty("db.pool.timeout", "5000")));<NEW_LINE>ds.setMaximumPoolSize(parseInt(dbConfig.getProperty("db.pool.maxSize", "30")));<NEW_LINE>ds.setMinimumIdle(parseInt(dbConfig.getProperty("db.pool.minSize", "1")));<NEW_LINE>// NB! Now in milliseconds<NEW_LINE>ds.setIdleTimeout(parseLong(dbConfig.getProperty("db.pool.maxIdleTime", "0")));<NEW_LINE>ds.setLeakDetectionThreshold(parseLong(dbConfig.getProperty("db.pool.unreturnedConnectionTimeout", "0")));<NEW_LINE>ds.setValidationTimeout(parseLong(dbConfig.getProperty("db.pool.validationTimeout", "5000")));<NEW_LINE>// in seconds<NEW_LINE>ds.setLoginTimeout(parseInt(dbConfig.getProperty("db.pool.loginTimeout", "0")));<NEW_LINE>// in ms<NEW_LINE>ds.setMaxLifetime(parseLong(dbConfig.getProperty("db.pool.maxConnectionAge", "0")));<NEW_LINE>if (dbConfig.getProperty("db.pool.connectionInitSql") != null) {<NEW_LINE>ds.setConnectionInitSql(dbConfig.getProperty("db.pool.connectionInitSql"));<NEW_LINE>}<NEW_LINE>// not used in HikariCP:<NEW_LINE>// db.pool.initialSize<NEW_LINE>// db.pool.idleConnectionTestPeriod<NEW_LINE>// db.pool.maxIdleTimeExcessConnections<NEW_LINE>// db.pool.acquireIncrement - HikariCP opens connections one at a time, as needed<NEW_LINE>// db.pool.cache.statements - HikariCP does not offer statement caching<NEW_LINE>// db.pool.idle.testInterval - HikariCP tests connections when they're leased, not on a timer<NEW_LINE>// db.pool.connection.threshold - HikariCP doesn't have a percentile idle threshold; db.pool.size.idle can be used to keep a fixed number of connections idle<NEW_LINE>// db.pool.threads - HikariCP does not use extra threads to "aid" connection release<NEW_LINE>// db.pool.maxStatements - HikariCP does not offer PreparedStatement caching<NEW_LINE>// db.pool.maxStatementsPerConnection - HikariCP does not offer PreparedStatement caching<NEW_LINE>// I could not find an analogue for HikariCP:<NEW_LINE>// ds.setAcquireRetryAttempts(parseInt(dbConfig.getProperty("db.pool.acquireRetryAttempts", "10")));<NEW_LINE>// ds.setAcquireRetryDelay(parseInt(dbConfig.getProperty("db.pool.acquireRetryDelay", "1000")));<NEW_LINE>// ds.setBreakAfterAcquireFailure(Boolean.parseBoolean(dbConfig.getProperty("db.pool.breakAfterAcquireFailure", "false")));<NEW_LINE>// ds.setTestConnectionOnCheckin(Boolean.parseBoolean(dbConfig.getProperty("db.pool.testConnectionOnCheckin", "true")));<NEW_LINE>// ds.setTestConnectionOnCheckout(Boolean.parseBoolean(dbConfig.getProperty("db.pool.testConnectionOnCheckout", "false")));<NEW_LINE>// ds.setMaxAdministrativeTaskTime(parseInt(dbConfig.getProperty("db.pool.maxAdministrativeTaskTime", "0")));<NEW_LINE>// ds.setNumHelperThreads(parseInt(dbConfig.getProperty("db.pool.numHelperThreads", "3")));<NEW_LINE>// ds.setDebugUnreturnedConnectionStackTraces(Boolean.parseBoolean(dbConfig.getProperty("db.pool.debugUnreturnedConnectionStackTraces", "false")));<NEW_LINE>// ds.setContextClassLoaderSource("library");<NEW_LINE>// ds.setPrivilegeSpawnedThreads(true);<NEW_LINE>if (dbConfig.getProperty("db.testquery") != null) {<NEW_LINE>ds.setConnectionTestQuery(dbConfig.getProperty("db.testquery"));<NEW_LINE>} else {<NEW_LINE>String driverClass = dbConfig.getProperty("db.driver");<NEW_LINE>if (driverClass.equals("com.mysql.jdbc.Driver")) {<NEW_LINE>ds.setConnectionTestQuery("/* ping */ SELECT 1");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// This check is not required, but here to make it clear that nothing changes for people<NEW_LINE>// that don't set this configuration property. It may be safely removed.<NEW_LINE>if (dbConfig.getProperty("db.isolation") != null) {<NEW_LINE>// TODO not yet migrated from c3p0 to Hikari CP:<NEW_LINE>// ds.setConnectionCustomizerClassName(PlayConnectionCustomizer.class.getName());<NEW_LINE>}<NEW_LINE>return ds;<NEW_LINE>} | (dbConfig.getProperty("db.pass")); |
1,261,991 | private InputStream assembleNextMessage() {<NEW_LINE>InputStream message;<NEW_LINE>int numBlocks = nextCompleteMessageEnd;<NEW_LINE>nextCompleteMessageEnd = 0;<NEW_LINE>int numBytes = 0;<NEW_LINE>if (numBlocks == 1) {<NEW_LINE>// Single block.<NEW_LINE>TransactionData <MASK><NEW_LINE>numBytes = data.numBytes;<NEW_LINE>if (data.stream != null) {<NEW_LINE>message = data.stream;<NEW_LINE>} else {<NEW_LINE>message = new BlockInputStream(data.block);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>byte[][] blocks = new byte[numBlocks][];<NEW_LINE>for (int i = 0; i < numBlocks; i++) {<NEW_LINE>TransactionData data = queuedTransactionData.remove(0);<NEW_LINE>blocks[i] = checkNotNull(data.block);<NEW_LINE>numBytes += blocks[i].length;<NEW_LINE>}<NEW_LINE>message = new BlockInputStream(blocks, numBytes);<NEW_LINE>}<NEW_LINE>firstQueuedTransactionIndex += numBlocks;<NEW_LINE>lookForCompleteMessage();<NEW_LINE>return message;<NEW_LINE>} | data = queuedTransactionData.remove(0); |
102,285 | public static Integer appendGlobalEdgeComment(final AbstractSQLProvider provider, final INaviEdge edge, final String commentText, final Integer userId) throws CouldntSaveDataException {<NEW_LINE>Preconditions.checkNotNull(provider, "IE00482: provider argument can not be null");<NEW_LINE>Preconditions.checkNotNull(edge, "IE00483: edge argument can not be null");<NEW_LINE>Preconditions.checkNotNull(commentText, "IE00484: commentText argument can not be null");<NEW_LINE>Preconditions.checkNotNull(userId, "IE00485: userId argument can not be null");<NEW_LINE>final Connection connection = provider.getConnection().getConnection();<NEW_LINE>final String function = "{ ? = call append_global_edge_comment(?, ?, ?, ?, ?, ?) }";<NEW_LINE>try {<NEW_LINE>final int sourceModuleId = getModuleId(edge.getSource());<NEW_LINE>final int destinationModuleId = getModuleId(edge.getTarget());<NEW_LINE>final IAddress sourceAddress = CViewNodeHelpers.getAddress(edge.getSource());<NEW_LINE>final IAddress destinationAddress = CViewNodeHelpers.getAddress(edge.getTarget());<NEW_LINE>try {<NEW_LINE>final CallableStatement appendCommentFunction = connection.prepareCall(function);<NEW_LINE>try {<NEW_LINE>appendCommentFunction.registerOutParameter(1, Types.INTEGER);<NEW_LINE>appendCommentFunction.setInt(2, sourceModuleId);<NEW_LINE>appendCommentFunction.setInt(3, destinationModuleId);<NEW_LINE>appendCommentFunction.setObject(4, sourceAddress.toBigInteger(), Types.BIGINT);<NEW_LINE>appendCommentFunction.setObject(5, destinationAddress.toBigInteger(), Types.BIGINT);<NEW_LINE><MASK><NEW_LINE>appendCommentFunction.setString(7, commentText);<NEW_LINE>appendCommentFunction.execute();<NEW_LINE>final int commentId = appendCommentFunction.getInt(1);<NEW_LINE>if (appendCommentFunction.wasNull()) {<NEW_LINE>throw new CouldntSaveDataException("Error: Got an comment id of null from the database");<NEW_LINE>}<NEW_LINE>return commentId;<NEW_LINE>} finally {<NEW_LINE>appendCommentFunction.close();<NEW_LINE>}<NEW_LINE>} catch (final SQLException exception) {<NEW_LINE>throw new CouldntSaveDataException(exception);<NEW_LINE>}<NEW_LINE>} catch (final MaybeNullException exception) {<NEW_LINE>throw new CouldntSaveDataException(exception);<NEW_LINE>}<NEW_LINE>} | appendCommentFunction.setInt(6, userId); |
1,635,938 | public void renameElement(String path, String newName) throws Exception {<NEW_LINE>if (path.lastIndexOf('/') == -1) {<NEW_LINE>throw new Exception(mm.getMessage("xmlfile.renameroot", xmlFile));<NEW_LINE>}<NEW_LINE>Node nd = getTerminalNode(path, Node.ELEMENT_NODE);<NEW_LINE>Node pp = nd.getParentNode();<NEW_LINE>NodeList childNodes = pp.getChildNodes();<NEW_LINE>int i;<NEW_LINE>if (childNodes != null) {<NEW_LINE>for (i = 0; i < childNodes.getLength(); i++) {<NEW_LINE>if (newName.equalsIgnoreCase(childNodes.item(i).getNodeName())) {<NEW_LINE>throw new Exception(mm.getMessage("xmlfile.existnode", xmlFile, newName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Element newNode = xmlDocument.createElement(newName);<NEW_LINE>childNodes = nd.getChildNodes();<NEW_LINE>if (childNodes != null) {<NEW_LINE>for (i = 0; i < childNodes.getLength(); i++) {<NEW_LINE>newNode.appendChild(childNodes.item(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>Node tmpNode;<NEW_LINE>if (childAttr != null) {<NEW_LINE>for (i = 0; i < childAttr.getLength(); i++) {<NEW_LINE>tmpNode = childAttr.item(i);<NEW_LINE>newNode.setAttribute(tmpNode.getNodeName(), tmpNode.getNodeValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>pp.replaceChild(newNode, nd);<NEW_LINE>} | NamedNodeMap childAttr = nd.getAttributes(); |
883,794 | public static boolean areEntriesOfLedgerStoredInTheBookie(long ledgerId, BookieId bookieAddress, LedgerManager ledgerManager) {<NEW_LINE>try {<NEW_LINE>LedgerMetadata ledgerMetadata = ledgerManager.readLedgerMetadata(ledgerId)<MASK><NEW_LINE>return areEntriesOfLedgerStoredInTheBookie(ledgerId, bookieAddress, ledgerMetadata);<NEW_LINE>} catch (InterruptedException ie) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>throw new RuntimeException(ie);<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>if (e.getCause() != null && e.getCause().getClass().equals(BKException.BKNoSuchLedgerExistsOnMetadataServerException.class)) {<NEW_LINE>LOG.debug("Ledger: {} has been deleted", ledgerId);<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>LOG.error("Got exception while trying to read LedgerMeatadata of " + ledgerId, e);<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .get().getValue(); |
475,884 | public void processView(EventBean[] newData, EventBean[] oldData, boolean isGenerateSynthetic) {<NEW_LINE>generateRemoveStreamJustOnce(isGenerateSynthetic, false);<NEW_LINE>if (newData != null) {<NEW_LINE>for (EventBean aNewData : newData) {<NEW_LINE>EventBean[] eventsPerStream = new EventBean[] { aNewData };<NEW_LINE>Object mk = processor.generateGroupKeySingle(eventsPerStream, true);<NEW_LINE>groupReps.put(mk, eventsPerStream);<NEW_LINE>if (processor.isSelectRStream() && !groupRepsOutputLastUnordRStream.containsKey(mk)) {<NEW_LINE>EventBean event = processor.generateOutputBatchedNoSortWMap(false, <MASK><NEW_LINE>if (event != null) {<NEW_LINE>groupRepsOutputLastUnordRStream.put(mk, event);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>processor.getAggregationService().applyEnter(eventsPerStream, mk, processor.getExprEvaluatorContext());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (oldData != null) {<NEW_LINE>for (EventBean anOldData : oldData) {<NEW_LINE>EventBean[] eventsPerStream = new EventBean[] { anOldData };<NEW_LINE>Object mk = processor.generateGroupKeySingle(eventsPerStream, true);<NEW_LINE>if (processor.isSelectRStream() && !groupRepsOutputLastUnordRStream.containsKey(mk)) {<NEW_LINE>EventBean event = processor.generateOutputBatchedNoSortWMap(false, mk, eventsPerStream, false, isGenerateSynthetic);<NEW_LINE>if (event != null) {<NEW_LINE>groupRepsOutputLastUnordRStream.put(mk, event);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>processor.getAggregationService().applyLeave(eventsPerStream, mk, processor.getExprEvaluatorContext());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | mk, eventsPerStream, true, isGenerateSynthetic); |
915,292 | private Mono<ResourceResponse<UserDefinedFunction>> createUserDefinedFunctionInternal(String collectionLink, UserDefinedFunction udf, RequestOptions options, DocumentClientRetryPolicy retryPolicyInstance) {<NEW_LINE>// we are using an observable factory here<NEW_LINE>// observable will be created fresh upon subscription<NEW_LINE>// this is to ensure we capture most up to date information (e.g.,<NEW_LINE>// session)<NEW_LINE>try {<NEW_LINE>logger.debug("Creating a UserDefinedFunction. collectionLink [{}], udf id [{}]", <MASK><NEW_LINE>RxDocumentServiceRequest request = getUserDefinedFunctionRequest(collectionLink, udf, options, OperationType.Create);<NEW_LINE>if (retryPolicyInstance != null) {<NEW_LINE>retryPolicyInstance.onBeforeSendRequest(request);<NEW_LINE>}<NEW_LINE>return this.create(request, retryPolicyInstance, getOperationContextAndListenerTuple(options)).map(response -> toResourceResponse(response, UserDefinedFunction.class));<NEW_LINE>} catch (Exception e) {<NEW_LINE>// this is only in trace level to capture what's going on<NEW_LINE>logger.debug("Failure in creating a UserDefinedFunction due to [{}]", e.getMessage(), e);<NEW_LINE>return Mono.error(e);<NEW_LINE>}<NEW_LINE>} | collectionLink, udf.getId()); |
881,978 | public void generateOptimizedBoolean(BlockScope currentScope, CodeStream codeStream, BranchLabel trueLabel, BranchLabel falseLabel, boolean valueRequired) {<NEW_LINE>if ((this.constant != Constant.NotAConstant) && (this.constant.typeID() == TypeIds.T_boolean)) {<NEW_LINE>super.generateOptimizedBoolean(currentScope, codeStream, trueLabel, falseLabel, valueRequired);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>switch((this.bits & ASTNode.OperatorMASK) >> ASTNode.OperatorSHIFT) {<NEW_LINE>case LESS:<NEW_LINE>generateOptimizedLessThan(currentScope, codeStream, trueLabel, falseLabel, valueRequired);<NEW_LINE>return;<NEW_LINE>case LESS_EQUAL:<NEW_LINE>generateOptimizedLessThanOrEqual(currentScope, codeStream, trueLabel, falseLabel, valueRequired);<NEW_LINE>return;<NEW_LINE>case GREATER:<NEW_LINE>generateOptimizedGreaterThan(currentScope, codeStream, trueLabel, falseLabel, valueRequired);<NEW_LINE>return;<NEW_LINE>case GREATER_EQUAL:<NEW_LINE>generateOptimizedGreaterThanOrEqual(currentScope, codeStream, trueLabel, falseLabel, valueRequired);<NEW_LINE>return;<NEW_LINE>case AND:<NEW_LINE>generateOptimizedLogicalAnd(currentScope, codeStream, trueLabel, falseLabel, valueRequired);<NEW_LINE>return;<NEW_LINE>case OR:<NEW_LINE>generateOptimizedLogicalOr(currentScope, codeStream, trueLabel, falseLabel, valueRequired);<NEW_LINE>return;<NEW_LINE>case XOR:<NEW_LINE>generateOptimizedLogicalXor(currentScope, codeStream, trueLabel, falseLabel, valueRequired);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>super.generateOptimizedBoolean(currentScope, <MASK><NEW_LINE>} | codeStream, trueLabel, falseLabel, valueRequired); |
99,492 | private void createActiveDataPort() throws IOException {<NEW_LINE>// create data socket and bind it to free port available<NEW_LINE>this.DataSocketActive = new ServerSocket(0);<NEW_LINE>this.DataSocketActive.setSoTimeout(getTimeout());<NEW_LINE>// read http://www.cisco.com/warp/public/105/38.shtml<NEW_LINE>this.DataSocketActive.setReceiveBufferSize(1440);<NEW_LINE>applyDataSocketTimeout();<NEW_LINE>// get port socket has been bound to<NEW_LINE>final int DataPort = this.DataSocketActive.getLocalPort();<NEW_LINE>// client ip<NEW_LINE>// InetAddress LocalIp = serverCore.publicIP();<NEW_LINE>// InetAddress LocalIp =<NEW_LINE>// DataSocketActive.getInetAddress().getLocalHost();<NEW_LINE>// save ip address in high byte order<NEW_LINE>// byte[] Bytes = LocalIp.getAddress();<NEW_LINE>final byte[] b = Domains.myPublicIPv4().iterator().next().getAddress();<NEW_LINE>// bytes greater than 127 should not be printed as negative<NEW_LINE>final short[] s = new short[4];<NEW_LINE>for (int i = 0; i < 4; i++) {<NEW_LINE>s[i] = b[i];<NEW_LINE>if (s[i] < 0) {<NEW_LINE>s[i] += 256;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// send port command via control socket:<NEW_LINE>// four ip address shorts encoded and two port shorts encoded<NEW_LINE>send(// "127,0,0,1," +<NEW_LINE>"PORT " + s[0] + "," + s[1] + "," + s[2] + "," + s[3] + "," + ((DataPort & 0xff00) >> 8) + <MASK><NEW_LINE>// read status of the command from the control port<NEW_LINE>final String reply = receive();<NEW_LINE>// check status code<NEW_LINE>if (isNotPositiveCompletion(reply)) {<NEW_LINE>throw new IOException(reply);<NEW_LINE>}<NEW_LINE>this.DataSocketPassiveMode = false;<NEW_LINE>} | "," + (DataPort & 0x00ff)); |
462,983 | public static DescribeApiTrafficControlsResponse unmarshall(DescribeApiTrafficControlsResponse describeApiTrafficControlsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeApiTrafficControlsResponse.setRequestId(_ctx.stringValue("DescribeApiTrafficControlsResponse.RequestId"));<NEW_LINE>describeApiTrafficControlsResponse.setTotalCount<MASK><NEW_LINE>describeApiTrafficControlsResponse.setPageSize(_ctx.integerValue("DescribeApiTrafficControlsResponse.PageSize"));<NEW_LINE>describeApiTrafficControlsResponse.setPageNumber(_ctx.integerValue("DescribeApiTrafficControlsResponse.PageNumber"));<NEW_LINE>List<ApiTrafficControlItem> apiTrafficControls = new ArrayList<ApiTrafficControlItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeApiTrafficControlsResponse.ApiTrafficControls.Length"); i++) {<NEW_LINE>ApiTrafficControlItem apiTrafficControlItem = new ApiTrafficControlItem();<NEW_LINE>apiTrafficControlItem.setApiId(_ctx.stringValue("DescribeApiTrafficControlsResponse.ApiTrafficControls[" + i + "].ApiId"));<NEW_LINE>apiTrafficControlItem.setApiName(_ctx.stringValue("DescribeApiTrafficControlsResponse.ApiTrafficControls[" + i + "].ApiName"));<NEW_LINE>apiTrafficControlItem.setTrafficControlId(_ctx.stringValue("DescribeApiTrafficControlsResponse.ApiTrafficControls[" + i + "].TrafficControlId"));<NEW_LINE>apiTrafficControlItem.setTrafficControlName(_ctx.stringValue("DescribeApiTrafficControlsResponse.ApiTrafficControls[" + i + "].TrafficControlName"));<NEW_LINE>apiTrafficControlItem.setBoundTime(_ctx.stringValue("DescribeApiTrafficControlsResponse.ApiTrafficControls[" + i + "].BoundTime"));<NEW_LINE>apiTrafficControls.add(apiTrafficControlItem);<NEW_LINE>}<NEW_LINE>describeApiTrafficControlsResponse.setApiTrafficControls(apiTrafficControls);<NEW_LINE>return describeApiTrafficControlsResponse;<NEW_LINE>} | (_ctx.integerValue("DescribeApiTrafficControlsResponse.TotalCount")); |
782,308 | public Object apply(final ActionContext ctx, final Object caller, final Object[] sources) throws FrameworkException {<NEW_LINE>if (sources != null && sources.length > 0) {<NEW_LINE>final SecurityContext securityContext = ctx.getSecurityContext();<NEW_LINE>final ConfigurationProvider config = StructrApp.getConfiguration();<NEW_LINE>PropertyMap propertyMap;<NEW_LINE>Class type = null;<NEW_LINE>if (sources.length >= 1 && sources[0] != null) {<NEW_LINE>type = config.getNodeEntityClass(sources[0].toString());<NEW_LINE>}<NEW_LINE>if (type == null) {<NEW_LINE>throw new FrameworkException(422, "Unknown type '" + sources[0].toString() + "' in create() method!");<NEW_LINE>}<NEW_LINE>// extension for native javascript objects<NEW_LINE>if (sources.length == 2 && sources[1] instanceof Map) {<NEW_LINE>propertyMap = PropertyMap.inputTypeToJavaType(securityContext, type, (Map) sources[1]);<NEW_LINE>} else if (sources.length == 2 && sources[1] instanceof GraphObjectMap) {<NEW_LINE>propertyMap = PropertyMap.inputTypeToJavaType(securityContext, type, ((GraphObjectMap) sources[1]).toMap());<NEW_LINE>} else {<NEW_LINE>propertyMap = new PropertyMap();<NEW_LINE>final int parameter_count = sources.length;<NEW_LINE>if (parameter_count % 2 == 0) {<NEW_LINE>throw new FrameworkException(400, "Invalid number of parameters: " + parameter_count + ". Should be uneven: " + usage(ctx.isJavaScriptContext()));<NEW_LINE>}<NEW_LINE>for (int c = 1; c < parameter_count; c += 2) {<NEW_LINE>final PropertyKey key = StructrApp.key(type, sources[c].toString());<NEW_LINE>if (key != null) {<NEW_LINE>final PropertyConverter inputConverter = key.inputConverter(securityContext);<NEW_LINE>Object value = sources[c + 1];<NEW_LINE>if (inputConverter != null) {<NEW_LINE>value = inputConverter.convert(value);<NEW_LINE>}<NEW_LINE>propertyMap.put(key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return StructrApp.getInstance(securityContext).create(type, propertyMap);<NEW_LINE>} else {<NEW_LINE>logParameterError(caller, <MASK><NEW_LINE>return usage(ctx.isJavaScriptContext());<NEW_LINE>}<NEW_LINE>} | sources, ctx.isJavaScriptContext()); |
600,498 | public synchronized int recordBootstrapMethod(String slashedClassName, Handle bsm, Object[] bsmArgs) {<NEW_LINE>if (bsmmap == null) {<NEW_LINE>bsmmap = new HashMap<String, BsmInfo[]>();<NEW_LINE>}<NEW_LINE>BsmInfo[] bsminfo = bsmmap.get(slashedClassName);<NEW_LINE>if (bsminfo == null) {<NEW_LINE>bsminfo = new BsmInfo[1];<NEW_LINE>// TODO do we need BsmInfo or can we just use Handle directly?<NEW_LINE>bsminfo[0] = new BsmInfo(bsm, bsmArgs);<NEW_LINE>bsmmap.put(slashedClassName, bsminfo);<NEW_LINE>return 0;<NEW_LINE>} else {<NEW_LINE>int len = bsminfo.length;<NEW_LINE>BsmInfo[] newarray = new BsmInfo[len + 1];<NEW_LINE>System.arraycopy(bsminfo, 0, newarray, 0, len);<NEW_LINE>bsminfo = newarray;<NEW_LINE><MASK><NEW_LINE>bsminfo[len] = new BsmInfo(bsm, bsmArgs);<NEW_LINE>return len;<NEW_LINE>}<NEW_LINE>// TODO [memory] search the existing bsmInfos for a matching one! Reuse!<NEW_LINE>} | bsmmap.put(slashedClassName, bsminfo); |
1,586,140 | static void writeObjects(String elt, XMLWriter writer, java.util.List<ObjectDescriptor> objects, java.util.List<PropertyDescriptor> properties) throws java.io.IOException {<NEW_LINE>for (ObjectDescriptor p : objects) {<NEW_LINE>java.util.List<String[]> attributes = new java.util.LinkedList<>();<NEW_LINE>String strId = com.zeroc.Ice.Util.identityToString(p.id, com.zeroc.Ice.ToStringMode.Unicode);<NEW_LINE>attributes.add(createAttribute("identity", strId));<NEW_LINE>if (p.type.length() > 0) {<NEW_LINE>attributes.add(createAttribute("type", p.type));<NEW_LINE>}<NEW_LINE>if (properties != null) {<NEW_LINE>String prop = lookupName(strId, properties);<NEW_LINE>if (prop != null) {<NEW_LINE>attributes.add(createAttribute("property", prop));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (p.proxyOptions != null && !p.proxyOptions.equals("")) {<NEW_LINE>attributes.add(createAttribute("proxy-options", p.proxyOptions));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | writer.writeElement(elt, attributes); |
731,779 | private Map<String, Object> fillSpecProps(Distribution distribution, Map<String, Object> props, DockerSpec spec) throws PackagerProcessingException {<NEW_LINE>List<Artifact> artifacts = Collections.singletonList(spec.getArtifact());<NEW_LINE>Map<String, Object> newProps = fillProps(distribution, props);<NEW_LINE>newProps.put(KEY_DOCKER_SPEC_NAME, spec.getName());<NEW_LINE>fillDockerProperties(newProps, distribution, spec);<NEW_LINE>verifyAndAddArtifacts(newProps, distribution, artifacts);<NEW_LINE>Path prepareDirectory = (Path) newProps.get(KEY_DISTRIBUTION_PREPARE_DIRECTORY);<NEW_LINE>newProps.put(KEY_DISTRIBUTION_PREPARE_DIRECTORY, prepareDirectory.resolve<MASK><NEW_LINE>Path packageDirectory = (Path) newProps.get(KEY_DISTRIBUTION_PACKAGE_DIRECTORY);<NEW_LINE>newProps.put(KEY_DISTRIBUTION_PACKAGE_DIRECTORY, packageDirectory.resolve(spec.getName()));<NEW_LINE>return newProps;<NEW_LINE>} | (spec.getName())); |
1,101,079 | protected void initScene() {<NEW_LINE>// set the direction<NEW_LINE>mLight = new DirectionalLight(0, -0.2f, -1.0f);<NEW_LINE>mLight.setColor(1.0f, 1.0f, 1.0f);<NEW_LINE>mLight.setPower(2);<NEW_LINE>getCurrentScene().addLight(mLight);<NEW_LINE>getCurrentCamera().setY(1);<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>LoaderMD5Mesh meshParser = new LoaderMD5Mesh(this, R.raw.boblampclean_mesh);<NEW_LINE>meshParser.parse();<NEW_LINE>LoaderMD5Anim animParser = new LoaderMD5Anim("attack2", this, R.raw.boblampclean_anim);<NEW_LINE>animParser.parse();<NEW_LINE>SkeletalAnimationSequence sequence = (SkeletalAnimationSequence) animParser.getParsedAnimationSequence();<NEW_LINE>mObject = (SkeletalAnimationObject3D) meshParser.getParsedAnimationObject();<NEW_LINE>mObject.setAnimationSequence(sequence);<NEW_LINE>mObject.setScale(.04f);<NEW_LINE>mObject.play();<NEW_LINE>getCurrentScene().addChild(mObject);<NEW_LINE>} catch (ParsingException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | getCurrentCamera().setZ(6); |
303,610 | private static synchronized void load(WebAppModel model, IntPredicate action) {<NEW_LINE>captureLatch = new CountDownLatch(1);<NEW_LINE>thrown.set(null);<NEW_LINE>Platform.runLater(() -> {<NEW_LINE>// zoom should only be factored on raster prints<NEW_LINE>pageZoom = model.getZoom();<NEW_LINE>pageWidth = model.getWebWidth();<NEW_LINE>pageHeight = model.getWebHeight();<NEW_LINE>log.trace("Setting starting size {}:{}", pageWidth, pageHeight);<NEW_LINE>adjustSize(pageWidth * pageZoom, pageHeight * pageZoom);<NEW_LINE>if (pageHeight == 0) {<NEW_LINE>webView.setMinHeight(1);<NEW_LINE>webView.setPrefHeight(1);<NEW_LINE>webView.setMaxHeight(1);<NEW_LINE>}<NEW_LINE>autosize(webView);<NEW_LINE>printAction = action;<NEW_LINE>if (model.isPlainText()) {<NEW_LINE>webView.getEngine().loadContent(model.getSource(), "text/html");<NEW_LINE>} else {<NEW_LINE>webView.getEngine().<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | load(model.getSource()); |
763,597 | public void visitProgramClass(ProgramClass programClass) {<NEW_LINE>lambdaExpressionMap.clear();<NEW_LINE>programClass.accept(new LambdaExpressionCollector(lambdaExpressionMap));<NEW_LINE>if (!lambdaExpressionMap.isEmpty()) {<NEW_LINE>logger.debug("LambdaExpressionConverter: converting lambda expressions in [{}]", programClass.getName());<NEW_LINE>for (LambdaExpression lambdaExpression : lambdaExpressionMap.values()) {<NEW_LINE>ProgramClass lambdaClass = createLambdaClass(lambdaExpression);<NEW_LINE>// Add the converted lambda class to the program class pool<NEW_LINE>// and the injected class name map.<NEW_LINE>programClassPool.addClass(lambdaClass);<NEW_LINE><MASK><NEW_LINE>if (extraClassVisitor != null) {<NEW_LINE>extraClassVisitor.visitProgramClass(lambdaClass);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Replace all InvokeDynamic instructions.<NEW_LINE>programClass.accept(new AllMethodVisitor(new AllAttributeVisitor(this)));<NEW_LINE>// Initialize the hierarchy and references of all lambda classes.<NEW_LINE>for (LambdaExpression lambdaExpression : lambdaExpressionMap.values()) {<NEW_LINE>lambdaExpression.lambdaClass.accept(new MultiClassVisitor(new ClassSuperHierarchyInitializer(programClassPool, libraryClassPool), new ClassSubHierarchyInitializer(), new ClassReferenceInitializer(programClassPool, libraryClassPool)));<NEW_LINE>}<NEW_LINE>// Remove deserialization hooks as they are no longer needed.<NEW_LINE>programClass.methodsAccept(this);<NEW_LINE>memberRemover.visitProgramClass(programClass);<NEW_LINE>}<NEW_LINE>} | extraDataEntryNameMap.addExtraClassToClass(programClass, lambdaClass); |
1,573,542 | private void handle(APIDetachEipMsg msg) {<NEW_LINE>final APIDetachEipEvent evt = new APIDetachEipEvent(msg.getId());<NEW_LINE>final EipVO vo = dbf.findByUuid(msg.<MASK><NEW_LINE>VmNicVO nicvo = dbf.findByUuid(vo.getVmNicUuid(), VmNicVO.class);<NEW_LINE>VmNicInventory nicInventory = VmNicInventory.valueOf(nicvo);<NEW_LINE>VipVO vipvo = dbf.findByUuid(vo.getVipUuid(), VipVO.class);<NEW_LINE>VipInventory vipInventory = VipInventory.valueOf(vipvo);<NEW_LINE>EipInventory eip = EipInventory.valueOf(vo);<NEW_LINE>String l3NetworkUuid = getEipL3Network(nicInventory, eip);<NEW_LINE>NetworkServiceProviderType providerType = nwServiceMgr.getTypeOfNetworkServiceProviderForService(l3NetworkUuid, EipConstant.EIP_TYPE);<NEW_LINE>UsedIpInventory guestIp = getEipGuestIp(eip.getUuid());<NEW_LINE>EipStruct struct = generateEipStruct(nicInventory, vipInventory, eip, guestIp);<NEW_LINE>struct.setSnatInboundTraffic(EipGlobalConfig.SNAT_INBOUND_TRAFFIC.value(Boolean.class));<NEW_LINE>detachEipAndUpdateDb(struct, providerType.toString(), DetachEipOperation.DB_UPDATE, true, new Completion(msg) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success() {<NEW_LINE>evt.setInventory(EipInventory.valueOf(dbf.reload(vo)));<NEW_LINE>bus.publish(evt);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode errorCode) {<NEW_LINE>evt.setError(errorCode);<NEW_LINE>bus.publish(evt);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | getUuid(), EipVO.class); |
1,697,518 | public static void generateMov(final ITranslationEnvironment environment, final long baseOffset, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {<NEW_LINE>Preconditions.checkNotNull(environment, "Error: Argument environment can't be null");<NEW_LINE>Preconditions.checkNotNull(instruction, "Error: Argument instruction can't be null");<NEW_LINE><MASK><NEW_LINE>long reilOffset = baseOffset;<NEW_LINE>final List<? extends IOperandTree> operands = instruction.getOperands();<NEW_LINE>// Load source operand.<NEW_LINE>final TranslationResult loadSource = Helpers.translateOperand(environment, reilOffset, operands.get(1), true);<NEW_LINE>instructions.addAll(loadSource.getInstructions());<NEW_LINE>// Adjust the offset of the next REIL instruction.<NEW_LINE>reilOffset = baseOffset + instructions.size();<NEW_LINE>// Load destination operand.<NEW_LINE>final TranslationResult loadDest = Helpers.translateOperand(environment, reilOffset, operands.get(0), false);<NEW_LINE>instructions.addAll(loadDest.getInstructions());<NEW_LINE>// Adjust the offset of the next REIL instruction.<NEW_LINE>reilOffset = baseOffset + instructions.size();<NEW_LINE>// Write the loaded value back into the destination<NEW_LINE>Helpers.writeBack(environment, reilOffset, operands.get(0), loadSource.getRegister(), loadDest.getSize(), loadDest.getAddress(), loadDest.getType(), instructions);<NEW_LINE>} | Preconditions.checkNotNull(instructions, "Error: Argument instructions can't be null"); |
191,013 | protected void handleSmsReceived(Intent intent) {<NEW_LINE>String body;<NEW_LINE>Bundle bundle = intent.getExtras();<NEW_LINE>Message msg = new Message();<NEW_LINE>log("handleSmsReceived() bundle " + bundle);<NEW_LINE>if (bundle != null) {<NEW_LINE>SmsMessage[] messages = getMessagesFromIntent(intent);<NEW_LINE>if (messages != null) {<NEW_LINE>SmsMessage sms = messages[0];<NEW_LINE>// extract message details. phone number and the message body<NEW_LINE>msg.setMessageFrom(sms.getOriginatingAddress());<NEW_LINE>msg.setMessageDate(new Date(sms.getTimestampMillis()));<NEW_LINE>if (messages.length == 1 || sms.isReplace()) {<NEW_LINE>body = sms.getDisplayMessageBody();<NEW_LINE>} else {<NEW_LINE>StringBuilder bodyText = new StringBuilder();<NEW_LINE>for (int i = 0; i < messages.length; i++) {<NEW_LINE>bodyText.append(messages<MASK><NEW_LINE>}<NEW_LINE>body = bodyText.toString();<NEW_LINE>}<NEW_LINE>msg.setMessageBody(body);<NEW_LINE>msg.setMessageUuid(new ProcessSms(mContext).getUuid());<NEW_LINE>msg.setMessageType(Message.Type.PENDING);<NEW_LINE>msg.setStatus(Message.Status.UNCONFIRMED);<NEW_LINE>}<NEW_LINE>// Log received SMS<NEW_LINE>mFileManager.append(getString(R.string.received_msg, msg.getMessageBody(), msg.getMessageFrom()));<NEW_LINE>// Route the SMS<NEW_LINE>if (App.getTwitterInstance().getSessionManager().getActiveSession() != null) {<NEW_LINE>boolean status = mTweetMessage.routeSms(msg);<NEW_LINE>showNotification(status);<NEW_LINE>}<NEW_LINE>boolean status = mPostMessage.routeSms(msg);<NEW_LINE>showNotification(status);<NEW_LINE>}<NEW_LINE>} | [i].getMessageBody()); |
1,776,908 | static DataPack build(@Nonnull List<? extends GraphCommit<Integer>> commits, @Nonnull Map<VirtualFile, CompressedRefs> refs, @Nonnull Map<VirtualFile, VcsLogProvider> providers, @Nonnull final VcsLogStorage hashMap, boolean full) {<NEW_LINE>RefsModel refsModel;<NEW_LINE>PermanentGraph<Integer> permanentGraph;<NEW_LINE>if (commits.isEmpty()) {<NEW_LINE>refsModel = new RefsModel(refs, ContainerUtil.<Integer>newHashSet(), hashMap, providers);<NEW_LINE>permanentGraph = EmptyPermanentGraph.getInstance();<NEW_LINE>} else {<NEW_LINE>refsModel = new RefsModel(refs, getHeads(commits), hashMap, providers);<NEW_LINE>Function<Integer, Hash> hashGetter = createHashGetter(hashMap);<NEW_LINE>GraphColorManagerImpl colorManager = new GraphColorManagerImpl(refsModel, hashGetter, getRefManagerMap(providers));<NEW_LINE>Set<Integer> branches = getBranchCommitHashIndexes(refsModel.getBranches(), hashMap);<NEW_LINE>StopWatch sw = StopWatch.start("building graph");<NEW_LINE>permanentGraph = PermanentGraphImpl.newInstance(commits, colorManager, branches);<NEW_LINE>sw.report();<NEW_LINE>}<NEW_LINE>return new DataPack(<MASK><NEW_LINE>} | refsModel, permanentGraph, providers, full); |
601,208 | public Pair<Integer, Integer> updatePlanManagementInfo(long lastExecuteUnixTime, double executionTimeInSeconds, Throwable ex) {<NEW_LINE>if (!executionContext.getParamManager().getBoolean(ConnectionParams.ENABLE_SPM)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (executionContext.getExplain() != null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (!ConfigDataMode.isMasterMode()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (executionPlan != null && !executionPlan.isDirectShardingKey()) {<NEW_LINE>// only deal with plan not null and not direct sharding point select<NEW_LINE>RelNode plan = executionPlan.getPlan();<NEW_LINE>PlannerContext plannerContext = PlannerContext.getPlannerContext(plan);<NEW_LINE>BaselineInfo baselineInfo = plannerContext.getBaselineInfo();<NEW_LINE>PlanInfo planInfo = plannerContext.getPlanInfo();<NEW_LINE>OptimizerContext optimizerContext = OptimizerContext.getContext(executionContext.getSchemaName());<NEW_LINE>if (optimizerContext == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>PlanManager planManager = optimizerContext.getPlanManager();<NEW_LINE>if (planInfo != null && baselineInfo != null && planManager != null) {<NEW_LINE>synchronized (baselineInfo) {<NEW_LINE>planManager.doEvolution(baselineInfo, planInfo, lastExecuteUnixTime, executionTimeInSeconds, ex);<NEW_LINE>return new Pair<>(baselineInfo.getId(), planInfo.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | ExecutionPlan executionPlan = executionContext.getFinalPlan(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.