idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,390,863
private void decorate(SofaTracerSpan span, CommandStartedEvent event) {<NEW_LINE>String command = event.getCommandName();<NEW_LINE>span.setTag(Tags.COMPONENT.getKey(), COMPONENT_NAME);<NEW_LINE>span.setTag(Tags.DB_STATEMENT.getKey(), event.getCommand().toString());<NEW_LINE>span.setTag(Tags.DB_INSTANCE.getKey(), event.getDatabaseName());<NEW_LINE>span.setTag(Tags.PEER_HOSTNAME.getKey(), event.getConnectionDescription().<MASK><NEW_LINE>InetSocketAddress address = event.getConnectionDescription().getServerAddress().getSocketAddress();<NEW_LINE>if (address != null) {<NEW_LINE>span.setTag("peer.host", address.toString());<NEW_LINE>}<NEW_LINE>span.setTag(Tags.PEER_PORT.getKey(), event.getConnectionDescription().getServerAddress().getPort());<NEW_LINE>span.setTag(Tags.DB_TYPE.getKey(), "mongodb");<NEW_LINE>span.setTag(CommonSpanTags.METHOD, command);<NEW_LINE>span.setTag(CommonSpanTags.LOCAL_APP, applicationName);<NEW_LINE>}
getServerAddress().getHost());
1,654,075
final SwapEnvironmentCNAMEsResult executeSwapEnvironmentCNAMEs(SwapEnvironmentCNAMEsRequest swapEnvironmentCNAMEsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(swapEnvironmentCNAMEsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SwapEnvironmentCNAMEsRequest> request = null;<NEW_LINE>Response<SwapEnvironmentCNAMEsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SwapEnvironmentCNAMEsRequestMarshaller().marshall(super.beforeMarshalling(swapEnvironmentCNAMEsRequest));<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, "Elastic Beanstalk");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SwapEnvironmentCNAMEs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>StaxResponseHandler<SwapEnvironmentCNAMEsResult> responseHandler = new StaxResponseHandler<SwapEnvironmentCNAMEsResult>(new SwapEnvironmentCNAMEsResultStaxUnmarshaller());<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,347,745
public CompletableFuture<Boolean> allowTopicPolicyOperationAsync(TopicName topicName, PolicyName policy, PolicyOperation operation, String originalRole, String role, AuthenticationDataSource authData) {<NEW_LINE>try {<NEW_LINE>validateOriginalPrincipal(conf.getProxyRoles(), role, originalRole);<NEW_LINE>} catch (RestException e) {<NEW_LINE>return FutureUtil.failedFuture(e);<NEW_LINE>}<NEW_LINE>if (isProxyRole(role)) {<NEW_LINE>CompletableFuture<Boolean> isRoleAuthorizedFuture = allowTopicPolicyOperationAsync(topicName, policy, operation, role, authData);<NEW_LINE>CompletableFuture<Boolean> isOriginalAuthorizedFuture = allowTopicPolicyOperationAsync(topicName, <MASK><NEW_LINE>return isRoleAuthorizedFuture.thenCombine(isOriginalAuthorizedFuture, (isRoleAuthorized, isOriginalAuthorized) -> isRoleAuthorized && isOriginalAuthorized);<NEW_LINE>} else {<NEW_LINE>return allowTopicPolicyOperationAsync(topicName, policy, operation, role, authData);<NEW_LINE>}<NEW_LINE>}
policy, operation, originalRole, authData);
701,463
final GetRoleResult executeGetRole(GetRoleRequest getRoleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getRoleRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetRoleRequest> request = null;<NEW_LINE>Response<GetRoleResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetRoleRequestMarshaller().marshall(super.beforeMarshalling(getRoleRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IAM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetRole");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GetRoleResult> responseHandler = new StaxResponseHandler<GetRoleResult>(new GetRoleResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
1,479,887
public Object doQuery(Object[] objs) {<NEW_LINE>List<String> ls <MASK><NEW_LINE>if (objs.length != 2) {<NEW_LINE>throw new RQException("redis zrank param size " + objs.length + " is not 2");<NEW_LINE>} else {<NEW_LINE>Object[] os = new Object[1];<NEW_LINE>os[0] = objs[0] + "_" + objs[1];<NEW_LINE>// for columns<NEW_LINE>super.doQuery(os);<NEW_LINE>Long l;<NEW_LINE>if (m_bReverse) {<NEW_LINE>l = m_jedisTool.zReverseRank(objs[0].toString(), objs[1]);<NEW_LINE>} else {<NEW_LINE>l = m_jedisTool.zRank(objs[0].toString(), objs[1].toString());<NEW_LINE>}<NEW_LINE>if (l != null) {<NEW_LINE>ls.add(Long.toString(l));<NEW_LINE>return toTable(ls.toArray());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
= new ArrayList<String>();
904,956
private static void addIntersectionTypeModel(IntersectionTypeDescriptorNode typeDescriptor, String typeName, Optional<MetadataNode> optionalMetadataNode, SemanticModel semanticModel, Module module) {<NEW_LINE>boolean isReadonly = typeDescriptor.leftTypeDesc().kind() == SyntaxKind.READONLY_TYPE_DESC || typeDescriptor.rightTypeDesc().kind() == SyntaxKind.READONLY_TYPE_DESC;<NEW_LINE>if (isReadonly) {<NEW_LINE>Node typeDef = typeDescriptor.leftTypeDesc().kind() == SyntaxKind.READONLY_TYPE_DESC ? typeDescriptor.rightTypeDesc() : typeDescriptor.leftTypeDesc();<NEW_LINE>if (typeDef.kind() == SyntaxKind.RECORD_TYPE_DESC) {<NEW_LINE>Record record = getRecordTypeModel((RecordTypeDescriptorNode) typeDef, typeName, optionalMetadataNode, semanticModel);<NEW_LINE>record.isReadOnly = true;<NEW_LINE>module.records.add(record);<NEW_LINE>return;<NEW_LINE>} else if (typeDef.kind() == SyntaxKind.OBJECT_TYPE_DESC) {<NEW_LINE>BObjectType bObj = getObjectTypeModel((ObjectTypeDescriptorNode) typeDef, typeName, optionalMetadataNode, semanticModel);<NEW_LINE>bObj.isReadOnly = true;<NEW_LINE>module.objectTypes.add(bObj);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<Type> <MASK><NEW_LINE>Type.addIntersectionMemberTypes(typeDescriptor, semanticModel, memberTypes);<NEW_LINE>BType bType = new BType(typeName, getDocFromMetadata(optionalMetadataNode), isDeprecated(optionalMetadataNode), memberTypes);<NEW_LINE>bType.isIntersectionType = true;<NEW_LINE>module.types.add(bType);<NEW_LINE>}
memberTypes = new ArrayList<>();
1,438,611
public SDVariable defineLayer(SameDiff sd, SDVariable layerInput, Map<String, SDVariable> paramTable, SDVariable mask) {<NEW_LINE>SDVariable weights = paramTable.get(DefaultParamInitializer.WEIGHT_KEY);<NEW_LINE>SDVariable logits = sd.tensorMmul(layerInput, weights, new int[] { 2 }, <MASK><NEW_LINE>SDVariable reshapedLogits = sd.reshape(logits, layerInput.getShape()[0], layerInput.getShape()[1]);<NEW_LINE>SDVariable ai = sd.math().exp(reshapedLogits);<NEW_LINE>SDVariable aiSum = sd.sum(ai, 1);<NEW_LINE>SDVariable aiSumEps = sd.expandDims(aiSum.add(EPS), 1);<NEW_LINE>SDVariable attentionWeights = ai.div(aiSumEps);<NEW_LINE>SDVariable weightedInput = layerInput.mul(sd.expandDims(attentionWeights, 2));<NEW_LINE>return sd.sum(weightedInput, 2);<NEW_LINE>}
new int[] { 0 });
41,566
public void run(RegressionEnvironment env) {<NEW_LINE>sendTimeEvent(env, "2002-05-1T08:00:00.000");<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@public create context NineToFive as start (0, 9, *, *, *) end (0, 17, *, *, *)", path);<NEW_LINE>String[] fields = "col1,col2,col3,col4".split(",");<NEW_LINE>env.compileDeploy("@name('s0') context NineToFive " + "select sb.theString as col1, sb.intPrimitive as col2, s0.id as col3, s0.p00 as col4 " + "from SupportBean#keepall as sb full outer join SupportBean_S0#keepall as s0 on p00 = theString", path);<NEW_LINE>env.addListener("s0");<NEW_LINE>env.sendEventBean(new SupportBean("E1", 1));<NEW_LINE>env.milestone(0);<NEW_LINE>env.sendEventBean(new SupportBean_S0(1, "E1"));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.milestone(1);<NEW_LINE>// now started<NEW_LINE>sendTimeEvent(env, "2002-05-1T09:00:00.000");<NEW_LINE>env.sendEventBean(new SupportBean_S0(1, "E1"));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { null, null, 1, "E1" });<NEW_LINE>env.milestone(2);<NEW_LINE>env.sendEventBean(new SupportBean("E1", 5));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "E1"<MASK><NEW_LINE>env.milestone(3);<NEW_LINE>// now gone<NEW_LINE>sendTimeEvent(env, "2002-05-1T17:00:00.000");<NEW_LINE>env.milestone(4);<NEW_LINE>env.sendEventBean(new SupportBean("E1", 1));<NEW_LINE>env.sendEventBean(new SupportBean_S0(1, "E1"));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.milestone(5);<NEW_LINE>// now started<NEW_LINE>sendTimeEvent(env, "2002-05-2T09:00:00.000");<NEW_LINE>sendTimeEvent(env, "2002-05-1T09:00:00.000");<NEW_LINE>env.sendEventBean(new SupportBean("E1", 4));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "E1", 4, null, null });<NEW_LINE>env.milestone(6);<NEW_LINE>env.sendEventBean(new SupportBean_S0(2, "E1"));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "E1", 4, 2, "E1" });<NEW_LINE>env.undeployAll();<NEW_LINE>}
, 5, 1, "E1" });
681,462
private void writeVariable(JRVariable variable, String variableName) {<NEW_LINE>if (variable != null) {<NEW_LINE>String resetGroupName = getGroupName(variable.getResetGroup());<NEW_LINE>String incrementGroupName = getGroupName(variable.getIncrementGroup());<NEW_LINE>write("JRDesignVariable " + variableName + " = new JRDesignVariable();\n");<NEW_LINE>write(variableName + ".setName(\"{0}\");\n", JRStringUtil.escapeJavaStringLiteral(variable.getName()));<NEW_LINE>write(variableName + ".setDescription(\"{0}\");\n", JRStringUtil.escapeJavaStringLiteral(variable.getDescription()));<NEW_LINE>write(variableName + ".setValueClassName(\"{0}\");\n", variable.getValueClassName());<NEW_LINE>write(variableName + ".setResetType({0});\n", variable.getResetTypeValue(), ResetTypeEnum.REPORT);<NEW_LINE>write(variableName + ".setResetGroup({0});\n", resetGroupName);<NEW_LINE>write(variableName + ".setIncrementType({0});\n", variable.getIncrementTypeValue(), IncrementTypeEnum.NONE);<NEW_LINE>write(variableName + ".setIncrementGroup({0});\n", incrementGroupName);<NEW_LINE>write(variableName + ".setCalculation({0});\n", variable.getCalculationValue(), CalculationEnum.NOTHING);<NEW_LINE>write(variableName + ".setIncrementerFactoryClass({0}.class);\n", JRStringUtil.escapeJavaStringLiteral(variable.getIncrementerFactoryClassName()));<NEW_LINE>writeExpression(variable.getExpression(), variableName, "Expression");<NEW_LINE>writeExpression(variable.<MASK><NEW_LINE>flush();<NEW_LINE>}<NEW_LINE>}
getInitialValueExpression(), variableName, "InitialValueExpression");
59,622
final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(tagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TagResourceRequest> request = null;<NEW_LINE>Response<TagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TagResourceRequestMarshaller().marshall<MASK><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, "TagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<TagResourceResult> responseHandler = new StaxResponseHandler<TagResourceResult>(new TagResourceResultStaxUnmarshaller());<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>}
(super.beforeMarshalling(tagResourceRequest));
1,568,656
private boolean parseArgs(List<String> args) {<NEW_LINE>try {<NEW_LINE>while (!args.isEmpty()) {<NEW_LINE>String arg = args.remove(0);<NEW_LINE>if (arg.equals("-h") || arg.equals("--help")) {<NEW_LINE>help();<NEW_LINE>helpOption = true;<NEW_LINE>return false;<NEW_LINE>} else if ("--name".equals(arg)) {<NEW_LINE><MASK><NEW_LINE>} else if ("--sleeptime".equals(arg)) {<NEW_LINE>sleepTime = Long.parseLong(getParam(args, arg));<NEW_LINE>} else if ("--instant".equals(arg)) {<NEW_LINE>instant = true;<NEW_LINE>} else if ("--silent".equals(arg)) {<NEW_LINE>silentNum = Long.parseLong(getParam(args, arg));<NEW_LINE>} else if ("--threads".equals(arg)) {<NEW_LINE>threads = Integer.parseInt(getParam(args, arg));<NEW_LINE>} else if ("--verbose".equals(arg)) {<NEW_LINE>verbose = true;<NEW_LINE>} else {<NEW_LINE>help();<NEW_LINE>helpOption = true;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
name = getParam(args, arg);
1,043,408
private CompletableFuture<List<Wo>> searchForm(final Wi wi, final List<String> appIdList, final List<String> designerIdList) {<NEW_LINE>CompletableFuture<List<Wo>> cf = CompletableFuture.supplyAsync(() -> {<NEW_LINE>List<Wo> resWos = new ArrayList<>();<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>List<String> formIds = designerIdList;<NEW_LINE>if (ListTools.isEmpty(formIds)) {<NEW_LINE>formIds = business.getFormFactory().listByAppIds(appIdList);<NEW_LINE>}<NEW_LINE>for (List<String> partFormIds : ListTools.batch(formIds, 100)) {<NEW_LINE>List<WoForm> woForms = emc.fetchIn(Form.class, WoForm.copier, Form.id_FIELDNAME, partFormIds);<NEW_LINE>for (WoForm woForm : woForms) {<NEW_LINE>Map<String, String> map = PropertyTools.fieldMatchKeyword(WoForm.copier.getCopyFields(), woForm, wi.getKeyword(), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());<NEW_LINE>if (!map.isEmpty()) {<NEW_LINE>Wo wo = new Wo();<NEW_LINE>AppInfo appInfo = emc.fetch(woForm.getAppId(), AppInfo.class, ListTools.toList(AppInfo.id_FIELDNAME, AppInfo.appName_FIELDNAME));<NEW_LINE>if (appInfo != null) {<NEW_LINE>wo.setAppId(appInfo.getId());<NEW_LINE>wo.setAppName(appInfo.getAppName());<NEW_LINE>}<NEW_LINE>wo.<MASK><NEW_LINE>wo.setDesignerName(woForm.getName());<NEW_LINE>wo.setDesignerType(DesignerType.form.toString());<NEW_LINE>wo.setUpdateTime(woForm.getUpdateTime());<NEW_LINE>wo.setPatternList(map);<NEW_LINE>resWos.add(wo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>woForms.clear();<NEW_LINE>woForms = null;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(e);<NEW_LINE>}<NEW_LINE>return resWos;<NEW_LINE>});<NEW_LINE>return cf;<NEW_LINE>}
setDesignerId(woForm.getId());
695,312
public static <T> Message<T> write(Message<T> messageArg, NamedComponent component, MessageBuilderFactory messageBuilderFactory) {<NEW_LINE>Message<T> message = messageArg;<NEW_LINE>Assert.notNull(message, "Message must not be null");<NEW_LINE>Assert.notNull(component, "Component must not be null");<NEW_LINE>Properties metadata = extractMetadata(component);<NEW_LINE>if (!metadata.isEmpty()) {<NEW_LINE>MessageHistory previousHistory = message.getHeaders().<MASK><NEW_LINE>List<Properties> components = previousHistory != null ? new ArrayList<>(previousHistory) : new ArrayList<>();<NEW_LINE>components.add(metadata);<NEW_LINE>MessageHistory history = new MessageHistory(components);<NEW_LINE>if (message instanceof MutableMessage) {<NEW_LINE>message.getHeaders().put(HEADER_NAME, history);<NEW_LINE>} else if (message instanceof ErrorMessage) {<NEW_LINE>IntegrationMessageHeaderAccessor headerAccessor = new IntegrationMessageHeaderAccessor(message);<NEW_LINE>headerAccessor.setHeader(HEADER_NAME, history);<NEW_LINE>Throwable payload = ((ErrorMessage) message).getPayload();<NEW_LINE>ErrorMessage errorMessage = new ErrorMessage(payload, headerAccessor.toMessageHeaders());<NEW_LINE>message = (Message<T>) errorMessage;<NEW_LINE>} else if (message instanceof AdviceMessage) {<NEW_LINE>IntegrationMessageHeaderAccessor headerAccessor = new IntegrationMessageHeaderAccessor(message);<NEW_LINE>headerAccessor.setHeader(HEADER_NAME, history);<NEW_LINE>message = new AdviceMessage<T>(message.getPayload(), headerAccessor.toMessageHeaders(), ((AdviceMessage<?>) message).getInputMessage());<NEW_LINE>} else {<NEW_LINE>if (!(message instanceof GenericMessage) && (messageBuilderFactory instanceof DefaultMessageBuilderFactory || messageBuilderFactory instanceof MutableMessageBuilderFactory) && LOGGER.isWarnEnabled()) {<NEW_LINE>LOGGER.warn("MessageHistory rebuilds the message and produces the result of the [" + messageBuilderFactory + "], not an instance of the provided type [" + message.getClass() + "]. Consider to supply a custom MessageBuilderFactory " + "to retain custom messages during MessageHistory tracking.");<NEW_LINE>}<NEW_LINE>message = messageBuilderFactory.fromMessage(message).setHeader(HEADER_NAME, history).build();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return message;<NEW_LINE>}
get(HEADER_NAME, MessageHistory.class);
428,338
public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>if (request.getHeader("Origin") != null && (getBimServer().getServerInfo().getServerState() != ServerState.MIGRATION_REQUIRED && !getBimServer().getServerSettingsCache().isHostAllowed(request.getHeader("Origin")))) {<NEW_LINE>response.setStatus(403);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin"));<NEW_LINE>response.setHeader("Access-Control-Allow-Headers", "Content-Type");<NEW_LINE>response.setCharacterEncoding("UTF-8");<NEW_LINE>try {<NEW_LINE>ServletInputStream inputStream = request.getInputStream();<NEW_LINE>// Not streaming here, because we want to be able to show the request-data when it's not valid<NEW_LINE>byte[] bytes = IOUtils.toByteArray(inputStream);<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>LOGGER.debug("Incoming JSON " + new String(bytes, Charsets.UTF_8));<NEW_LINE>}<NEW_LINE>ObjectNode parse = OBJECT_MAPPER.readValue(new ByteArrayInputStream(bytes), ObjectNode.class);<NEW_LINE>if (parse instanceof ObjectNode) {<NEW_LINE>ObjectNode jsonRequest = (ObjectNode) parse;<NEW_LINE>response.setHeader("Content-Type", "application/json");<NEW_LINE>getBimServer().getJsonHandler().execute(jsonRequest, request, response.getWriter());<NEW_LINE>} else {<NEW_LINE>LOGGER.error("Invalid JSON request: " + new String<MASK><NEW_LINE>response.setStatus(500);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.error("", e);<NEW_LINE>response.setStatus(500);<NEW_LINE>}<NEW_LINE>}
(bytes, Charsets.UTF_8));
1,452,032
private static double calculateSingleDistance(ImmutableFeatureMap fMap, long numTrainingExamples, int index, double value) {<NEW_LINE>VariableInfo <MASK><NEW_LINE>if (info instanceof CategoricalInfo) {<NEW_LINE>return 1.0;<NEW_LINE>} else if (info instanceof RealInfo) {<NEW_LINE>RealInfo rInfo = (RealInfo) info;<NEW_LINE>// Fudge the distance calculation so it doesn't overpower the categoricals.<NEW_LINE>double curScore = value * value;<NEW_LINE>double range;<NEW_LINE>// This further fudge is because the RealInfo may have observed a zero if it's sparse, but it might not.<NEW_LINE>if (numTrainingExamples != info.getCount()) {<NEW_LINE>range = Math.max(rInfo.getMax(), 0.0) - Math.min(rInfo.getMin(), 0.0);<NEW_LINE>} else {<NEW_LINE>range = rInfo.getMax() - rInfo.getMin();<NEW_LINE>}<NEW_LINE>return curScore / (range * range);<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Unsupported info type, expected CategoricalInfo or RealInfo, found " + info.getClass().getName());<NEW_LINE>}<NEW_LINE>}
info = fMap.get(index);
1,160,001
private void buildCompiledResourceMergingAction(BusyBoxActionBuilder builder) {<NEW_LINE>Preconditions.checkNotNull(primary);<NEW_LINE>createInputsForBuilder(builder).addInput("--primaryData", AndroidDataConverter.COMPILED_RESOURCE_CONVERTER.map(primary), ImmutableList.of(primary.getCompiledSymbols()));<NEW_LINE>if (dependencies != null) {<NEW_LINE>builder.addTransitiveFlag("--directData", dependencies.getDirectResourceContainers(), AndroidDataConverter.COMPILED_RESOURCE_CONVERTER);<NEW_LINE>if (omitTransitiveDependenciesFromAndroidRClasses) {<NEW_LINE>for (ValidatedAndroidResources resources : dependencies.getDirectResourceContainers().toList()) {<NEW_LINE>builder.<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>builder.addTransitiveFlag("--data", dependencies.getTransitiveResourceContainers(), AndroidDataConverter.COMPILED_RESOURCE_CONVERTER).addTransitiveInputValues(dependencies.getTransitiveCompiledSymbols());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>builder.maybeAddFlag("--annotate_r_fields_from_transitive_deps", annotateRFieldsFromTransitiveDeps);<NEW_LINE>builder.buildAndRegister("Merging compiled Android resources", "AndroidCompiledResourceMerger");<NEW_LINE>}
maybeAddInput(resources.getCompiledSymbols());
1,735,587
public com.alipay.sofa.jraft.rpc.CliRequests.AddPeerResponse buildPartial() {<NEW_LINE>com.alipay.sofa.jraft.rpc.CliRequests.AddPeerResponse result = new com.alipay.sofa.jraft.rpc.CliRequests.AddPeerResponse(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>oldPeers_ = oldPeers_.getUnmodifiableView();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>result.oldPeers_ = oldPeers_;<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>newPeers_ = newPeers_.getUnmodifiableView();<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>}<NEW_LINE>result.newPeers_ = newPeers_;<NEW_LINE>if (((from_bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>if (errorResponseBuilder_ == null) {<NEW_LINE>result.errorResponse_ = errorResponse_;<NEW_LINE>} else {<NEW_LINE>result.errorResponse_ = errorResponseBuilder_.build();<NEW_LINE>}<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>}
bitField0_ = (bitField0_ & ~0x00000001);
629,718
public static AuthRequestModifier buildDigest(AuthChallenge aHeader, String user, String password, String method, String requestTarget) {<NEW_LINE>String clientNonce = DigestLib.generateNonce();<NEW_LINE>AtomicLong ncCounter = new AtomicLong(0);<NEW_LINE>return req -> {<NEW_LINE>// Bump nc<NEW_LINE>String nc = String.format("%08X", ncCounter.getAndIncrement());<NEW_LINE>String responseField = DigestLib.calcDigestChallengeResponse(aHeader, user, password, method, requestTarget, clientNonce, nc, "auth");<NEW_LINE>StringBuilder stringBuilder = new StringBuilder();<NEW_LINE>stringBuilder.append("Digest ");<NEW_LINE>field(stringBuilder, <MASK><NEW_LINE>field(stringBuilder, false, "realm", aHeader.realm, true);<NEW_LINE>field(stringBuilder, false, "nonce", aHeader.nonce, true);<NEW_LINE>field(stringBuilder, false, "uri", requestTarget, true);<NEW_LINE>field(stringBuilder, false, "qop", "auth", false);<NEW_LINE>field(stringBuilder, false, "cnonce", clientNonce, true);<NEW_LINE>field(stringBuilder, false, "nc", nc, false);<NEW_LINE>field(stringBuilder, false, "response", responseField, true);<NEW_LINE>field(stringBuilder, false, "opaque", aHeader.opaque, true);<NEW_LINE>String x = stringBuilder.toString();<NEW_LINE>// setHeader - replace previous<NEW_LINE>req.setHeader(HttpNames.hAuthorization, x);<NEW_LINE>return req;<NEW_LINE>};<NEW_LINE>}
true, "username", user, true);
1,123,426
public long spill(long numBytes) throws IOException {<NEW_LINE>synchronized (this) {<NEW_LINE>if (!destructive || dataPages.size() == 1) {<NEW_LINE>return 0L;<NEW_LINE>}<NEW_LINE>long released = 0L;<NEW_LINE>while (dataPages.size() > 0) {<NEW_LINE>MemoryBlock block = dataPages.getLast();<NEW_LINE>// The currentPage is used, cannot be released<NEW_LINE>if (block == currentPage) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>long offset = block.getBaseOffset();<NEW_LINE>int numRecords = Platform.getInt(base, offset);<NEW_LINE>offset += 4;<NEW_LINE>final UnsafeSorterSpillWriter writer = new UnsafeSorterSpillWriter(blockManager, 32 * 1024, numRecords);<NEW_LINE>while (numRecords > 0) {<NEW_LINE>int length = Platform.getInt(base, offset);<NEW_LINE>writer.write(base, offset + 4, length, 0);<NEW_LINE>offset += 4 + length + 8;<NEW_LINE>numRecords--;<NEW_LINE>}<NEW_LINE>writer.close();<NEW_LINE>spillWriters.add(writer);<NEW_LINE>dataPages.removeLast();<NEW_LINE>released += block.size();<NEW_LINE>freePage(block);<NEW_LINE>if (released >= numBytes) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return released;<NEW_LINE>}<NEW_LINE>}
Object base = block.getBaseObject();
1,769,996
public Session load(String id) throws ClassNotFoundException, IOException {<NEW_LINE>// HERCULES:addition<NEW_LINE>// Check to see if it's in our cache first<NEW_LINE>Session sess = sessions.get(id);<NEW_LINE>if (sess != null) {<NEW_LINE>return sess;<NEW_LINE>}<NEW_LINE>// HERCULES:addition<NEW_LINE>// Open an input stream to the specified pathname, if any<NEW_LINE>File file = file(id);<NEW_LINE>if (file == null) {<NEW_LINE>return (null);<NEW_LINE>}<NEW_LINE>if (!file.exists()) {<NEW_LINE>return (null);<NEW_LINE>}<NEW_LINE>if (debug >= 1) {<NEW_LINE>String msg = MessageFormat.format(RESOURCE_BUNDLE.getString(LogFacade.LOADING_SESSION_FROM_FILE), id, file.getAbsolutePath());<NEW_LINE>log(msg);<NEW_LINE>}<NEW_LINE>try (FileInputStream fis = new <MASK><NEW_LINE>BufferedInputStream bis = new BufferedInputStream(fis)) {<NEW_LINE>Container container = manager.getContainer();<NEW_LINE>try (ObjectInputStream ois = createObjectInputStream(container, bis)) {<NEW_LINE>StandardSession session = StandardSession.deserialize(ois, manager);<NEW_LINE>session.setManager(manager);<NEW_LINE>return (session);<NEW_LINE>}<NEW_LINE>// end HERCULES:mod<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>if (debug >= 1)<NEW_LINE>log("No persisted data file found");<NEW_LINE>return (null);<NEW_LINE>}<NEW_LINE>}
FileInputStream(file.getAbsolutePath());
443,664
public void tick() {<NEW_LINE>super.tick();<NEW_LINE>if (level.isClientSide || isDummy())<NEW_LINE>return;<NEW_LINE>boolean update = false;<NEW_LINE>if (energyStorage.getEnergyStored() > 0 && processQueue.size() < this.getProcessQueueMaxLength()) {<NEW_LINE>if (tanks[0].getFluidAmount() > 0 || tanks[1].getFluidAmount() > 0) {<NEW_LINE>RefineryRecipe recipe = RefineryRecipe.findRecipe(tanks[0].getFluid(), tanks[1].getFluid());<NEW_LINE>if (recipe != null) {<NEW_LINE>MultiblockProcessInMachine<RefineryRecipe> process = new MultiblockProcessInMachine<>(recipe).setInputTanks((tanks[0].getFluidAmount() > 0 && tanks[1].getFluidAmount() > 0) ? new int[] { 0, 1 } : tanks[0].getFluidAmount() > 0 ? new int[] { 0 } : new int[] { 1 });<NEW_LINE>if (this.addProcessToQueue(process, true)) {<NEW_LINE>this.addProcessToQueue(process, false);<NEW_LINE>update = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Direction fw = getFacing().getOpposite();<NEW_LINE>update |= FluidUtils.multiblockFluidOutput(level, this.getBlockPos().offset(0, -1, 0).relative(fw), fw, this.tanks[2], OUTPUT_EMPTY, OUTPUT_FILLED, inventory::get, inventory::set);<NEW_LINE>for (int tank = 0; tank < 2; tank++) {<NEW_LINE>final int inputSlot = 2 * tank;<NEW_LINE>final int outputSlot = inputSlot + 1;<NEW_LINE>final int amountPrev = tanks[tank].getFluidAmount();<NEW_LINE>ItemStack outputStack = inventory.get(outputSlot);<NEW_LINE>ItemStack emptyContainer = Utils.drainFluidContainer(tanks[tank], inventory<MASK><NEW_LINE>if (amountPrev != tanks[tank].getFluidAmount()) {<NEW_LINE>if (ItemHandlerHelper.canItemStacksStack(outputStack, emptyContainer))<NEW_LINE>outputStack.grow(emptyContainer.getCount());<NEW_LINE>else if (outputStack.isEmpty())<NEW_LINE>inventory.set(outputSlot, emptyContainer.copy());<NEW_LINE>inventory.get(inputSlot).shrink(outputSlot);<NEW_LINE>update = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (update) {<NEW_LINE>this.setChanged();<NEW_LINE>this.markContainingBlockForUpdate(null);<NEW_LINE>}<NEW_LINE>}
.get(inputSlot), outputStack);
487,169
public void run(RegressionEnvironment env) {<NEW_LINE>String stmtText = "@name('s0') select " + ALL_FIELDS + " from " + " sql:MyDBWithRetain ['select " + ALL_FIELDS + " from mytesttable where ${id} = mytesttable.mybigint'] as s0," + "SupportBean_S0 as s1";<NEW_LINE>env.compileDeploy(stmtText).addListener("s0");<NEW_LINE>env.assertStatement("s0", statement -> {<NEW_LINE>EventType eventType = statement.getEventType();<NEW_LINE>assertEquals(Long.class, eventType.getPropertyType("mybigint"));<NEW_LINE>assertEquals(Integer.class, eventType.getPropertyType("myint"));<NEW_LINE>assertEquals(String.class, eventType.getPropertyType("myvarchar"));<NEW_LINE>assertEquals(String.class, eventType.getPropertyType("mychar"));<NEW_LINE>assertEquals(Boolean.class, eventType.getPropertyType("mybool"));<NEW_LINE>assertEquals(BigDecimal.class, eventType.getPropertyType("mynumeric"));<NEW_LINE>assertEquals(BigDecimal.class<MASK><NEW_LINE>assertEquals(Double.class, eventType.getPropertyType("mydouble"));<NEW_LINE>assertEquals(Double.class, eventType.getPropertyType("myreal"));<NEW_LINE>});<NEW_LINE>sendEventS0(env, 1);<NEW_LINE>assertReceived(env, 1, 10, "A", "Z", true, new BigDecimal(5000), new BigDecimal(100), 1.2, 1.3);<NEW_LINE>env.undeployAll();<NEW_LINE>}
, eventType.getPropertyType("mydecimal"));
1,201,102
final GetEC2RecommendationProjectedMetricsResult executeGetEC2RecommendationProjectedMetrics(GetEC2RecommendationProjectedMetricsRequest getEC2RecommendationProjectedMetricsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getEC2RecommendationProjectedMetricsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetEC2RecommendationProjectedMetricsRequest> request = null;<NEW_LINE>Response<GetEC2RecommendationProjectedMetricsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetEC2RecommendationProjectedMetricsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getEC2RecommendationProjectedMetricsRequest));<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, "Compute Optimizer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetEC2RecommendationProjectedMetrics");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetEC2RecommendationProjectedMetricsResult>> 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 GetEC2RecommendationProjectedMetricsResultJsonUnmarshaller());
1,715,094
public void loadFromXml(EwsServiceXmlReader reader, boolean clear, PropertySet requestedPropertySet, boolean onlySummaryPropertiesRequested) throws Exception {<NEW_LINE>if (clear) {<NEW_LINE>this.clear();<NEW_LINE>}<NEW_LINE>// Put the property bag in "loading" mode. When in loading mode, no<NEW_LINE>// checking is done<NEW_LINE>// when setting property values.<NEW_LINE>this.loading = true;<NEW_LINE>this.requestedPropertySet = requestedPropertySet;<NEW_LINE>this.onlySummaryPropertiesRequested = onlySummaryPropertiesRequested;<NEW_LINE>try {<NEW_LINE>do {<NEW_LINE>reader.read();<NEW_LINE>if (reader.getNodeType().getNodeType() == XmlNodeType.START_ELEMENT) {<NEW_LINE>OutParam<PropertyDefinition> propertyDefinitionOut = new OutParam<PropertyDefinition>();<NEW_LINE>PropertyDefinition propertyDefinition;<NEW_LINE>if (this.getOwner().schema().tryGetPropertyDefinition(reader.getLocalName(), propertyDefinitionOut)) {<NEW_LINE>propertyDefinition = propertyDefinitionOut.getParam();<NEW_LINE>propertyDefinition.loadPropertyValueFromXml(reader, this);<NEW_LINE>this.loadedProperties.add(propertyDefinition);<NEW_LINE>} else {<NEW_LINE>reader.skipCurrentElement();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} while (!reader.isEndElement(XmlNamespace.Types, this.getOwner<MASK><NEW_LINE>this.clearChangeLog();<NEW_LINE>} finally {<NEW_LINE>this.loading = false;<NEW_LINE>}<NEW_LINE>}
().getXmlElementName()));
1,650,932
private void classLeftBracePlacement() {<NEW_LINE>CodeStyle.BracePlacement bracePlacement = cs.getClassDeclBracePlacement();<NEW_LINE><MASK><NEW_LINE>int old = indent = lastIndent;<NEW_LINE>int halfIndent = lastIndent;<NEW_LINE>switch(bracePlacement) {<NEW_LINE>case SAME_LINE:<NEW_LINE>spaces(spaceBeforeLeftBrace ? 1 : 0, tokens.offset() < startOffset);<NEW_LINE>accept(LBRACE);<NEW_LINE>indent = lastIndent + indentSize;<NEW_LINE>break;<NEW_LINE>case NEW_LINE:<NEW_LINE>newline();<NEW_LINE>accept(LBRACE);<NEW_LINE>indent = lastIndent + indentSize;<NEW_LINE>break;<NEW_LINE>case NEW_LINE_HALF_INDENTED:<NEW_LINE>int oldLast = lastIndent;<NEW_LINE>indent = lastIndent + (indentSize >> 1);<NEW_LINE>halfIndent = indent;<NEW_LINE>newline();<NEW_LINE>accept(LBRACE);<NEW_LINE>indent = oldLast + indentSize;<NEW_LINE>break;<NEW_LINE>case NEW_LINE_INDENTED:<NEW_LINE>indent = lastIndent + indentSize;<NEW_LINE>halfIndent = indent;<NEW_LINE>newline();<NEW_LINE>accept(LBRACE);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
boolean spaceBeforeLeftBrace = cs.spaceBeforeClassDeclLeftBrace();
848,614
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see<NEW_LINE>* net.grinder.console.model.SampleListener#update(net.grinder.statistics<NEW_LINE>* .StatisticsSet, net.grinder.statistics.StatisticsSet)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void update(final StatisticsSet intervalStatistics, final StatisticsSet cumulativeStatistics) {<NEW_LINE>try {<NEW_LINE>if (!capture) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>samplingCount++;<NEW_LINE>long currentPeriod = cumulativeStatistics.getValue(getSampleModel().getPeriodIndex());<NEW_LINE>setTpsValue(sampleModel.getTPSExpression().getDoubleValue(intervalStatistics));<NEW_LINE>checkTooLowTps(getTpsValues());<NEW_LINE>updateStatistics(intervalStatistics, cumulativeStatistics);<NEW_LINE>writeIntervalCsvData(intervalStatistics);<NEW_LINE>int interval = getSampleModel().getSampleInterval();<NEW_LINE>long gap = 1;<NEW_LINE>if (samplingCount == 1) {<NEW_LINE>lastSamplingPeriod = currentPeriod;<NEW_LINE>} else {<NEW_LINE>lastSamplingPeriod = lastSamplingPeriod + interval;<NEW_LINE>gap = (<MASK><NEW_LINE>}<NEW_LINE>// Adjust sampling delay.. run write data multiple times... when it<NEW_LINE>// takes longer than 1 sec.<NEW_LINE>samplingLifeCycleListener.apply(listener -> {<NEW_LINE>listener.onSampling(getReportPath(), intervalStatistics, cumulativeStatistics);<NEW_LINE>});<NEW_LINE>for (long index = 0, repeatCounts = gap + 1; index < repeatCounts; index++) {<NEW_LINE>final boolean lastCall = (samplingCount == 1 && index == 0) || (samplingCount != 1 && index == gap);<NEW_LINE>writeIntervalSummaryData(intervalStatistics, lastCall);<NEW_LINE>if (interval >= (MIN_SAMPLING_INTERVAL_TO_ACTIVATE_TPS_PER_TEST)) {<NEW_LINE>writeIntervalSummaryDataPerTest(intervalStatisticMapPerTest, lastCall);<NEW_LINE>}<NEW_LINE>samplingLifeCycleFollowupListener.apply(listener -> {<NEW_LINE>listener.onSampling(getReportPath(), intervalStatistics, cumulativeStatistics, lastCall);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>lastSamplingPeriod = lastSamplingPeriod + (interval * gap);<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>LOGGER.error("Error occurred while updating the statistics : {}", e.getMessage());<NEW_LINE>LOGGER.debug("Details : ", e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}
(currentPeriod - lastSamplingPeriod) / interval);
1,346,682
public static void fixedLagSmoothingDemo() {<NEW_LINE>System.out.println("DEMO: Fixed-Lag-Smoothing");<NEW_LINE>System.out.println("=========================");<NEW_LINE>System.out.println("Lag = 1");<NEW_LINE>System.out.println("-------");<NEW_LINE>FixedLagSmoothing uw = new FixedLagSmoothing(HMMExampleFactory.getUmbrellaWorldModel(), 1);<NEW_LINE>// Day 1 - Lag 1<NEW_LINE>List<AssignmentProposition> e1 = new ArrayList<AssignmentProposition>();<NEW_LINE>e1.add(new AssignmentProposition(ExampleRV.UMBREALLA_t_RV, Boolean.TRUE));<NEW_LINE>CategoricalDistribution smoothed = uw.fixedLagSmoothing(e1);<NEW_LINE>System.out.println("Day 1 (Umbrella_t=true) smoothed:\nday 1=" + smoothed);<NEW_LINE>// Day 2 - Lag 1<NEW_LINE>List<AssignmentProposition> e2 = new ArrayList<AssignmentProposition>();<NEW_LINE>e2.add(new AssignmentProposition(ExampleRV.UMBREALLA_t_RV, Boolean.TRUE));<NEW_LINE>smoothed = uw.fixedLagSmoothing(e2);<NEW_LINE>System.<MASK><NEW_LINE>// Day 3 - Lag 1<NEW_LINE>List<AssignmentProposition> e3 = new ArrayList<AssignmentProposition>();<NEW_LINE>e3.add(new AssignmentProposition(ExampleRV.UMBREALLA_t_RV, Boolean.FALSE));<NEW_LINE>smoothed = uw.fixedLagSmoothing(e3);<NEW_LINE>System.out.println("Day 3 (Umbrella_t=false) smoothed:\nday 2=" + smoothed);<NEW_LINE>System.out.println("-------");<NEW_LINE>System.out.println("Lag = 2");<NEW_LINE>System.out.println("-------");<NEW_LINE>uw = new FixedLagSmoothing(HMMExampleFactory.getUmbrellaWorldModel(), 2);<NEW_LINE>// Day 1 - Lag 2<NEW_LINE>e1 = new ArrayList<AssignmentProposition>();<NEW_LINE>e1.add(new AssignmentProposition(ExampleRV.UMBREALLA_t_RV, Boolean.TRUE));<NEW_LINE>smoothed = uw.fixedLagSmoothing(e1);<NEW_LINE>System.out.println("Day 1 (Umbrella_t=true) smoothed:\nday 1=" + smoothed);<NEW_LINE>// Day 2 - Lag 2<NEW_LINE>e2 = new ArrayList<AssignmentProposition>();<NEW_LINE>e2.add(new AssignmentProposition(ExampleRV.UMBREALLA_t_RV, Boolean.TRUE));<NEW_LINE>smoothed = uw.fixedLagSmoothing(e2);<NEW_LINE>System.out.println("Day 2 (Umbrella_t=true) smoothed:\nday 1=" + smoothed);<NEW_LINE>// Day 3 - Lag 2<NEW_LINE>e3 = new ArrayList<AssignmentProposition>();<NEW_LINE>e3.add(new AssignmentProposition(ExampleRV.UMBREALLA_t_RV, Boolean.FALSE));<NEW_LINE>smoothed = uw.fixedLagSmoothing(e3);<NEW_LINE>System.out.println("Day 3 (Umbrella_t=false) smoothed:\nday 1=" + smoothed);<NEW_LINE>System.out.println("=========================");<NEW_LINE>}
out.println("Day 2 (Umbrella_t=true) smoothed:\nday 1=" + smoothed);
1,213,954
private FeatureVector createDocumentVector(Terms terms, IndexReader reader, boolean tweetsearch) throws IOException {<NEW_LINE>FeatureVector f = new FeatureVector();<NEW_LINE>BytesRef text;<NEW_LINE>int numDocs = reader.numDocs();<NEW_LINE>TermsEnum termsEnum = terms.iterator();<NEW_LINE>while ((text = termsEnum.next()) != null) {<NEW_LINE><MASK><NEW_LINE>// We're using similar heuristics as in the RM3 implementation. See comments there.<NEW_LINE>if (term.length() < 2 || term.length() > 20)<NEW_LINE>continue;<NEW_LINE>int df = reader.docFreq(new Term(IndexArgs.CONTENTS, term));<NEW_LINE>float ratio = (float) df / numDocs;<NEW_LINE>if (tweetsearch) {<NEW_LINE>if (numDocs > 100000000) {<NEW_LINE>if (ratio > 0.007f)<NEW_LINE>continue;<NEW_LINE>} else {<NEW_LINE>if (ratio > 0.01f)<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (ratio > 0.1f)<NEW_LINE>continue;<NEW_LINE>f.addFeatureWeight(term, (float) termsEnum.totalTermFreq());<NEW_LINE>}<NEW_LINE>return f;<NEW_LINE>}
String term = text.utf8ToString();
729,175
public void onClick(View v) {<NEW_LINE>new QMUIDialog.CheckableDialogBuilder(mContext).setCheckedIndex(PixivSearchParamUtil.getSortTypeIndex(Shaft.sSettings.getSearchDefaultSortType())).setSkinManager(QMUISkinManager.defaultInstance(mContext)).addItems(PixivSearchParamUtil.SORT_TYPE_NAME, new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>Shaft.sSettings.setSearchDefaultSortType(PixivSearchParamUtil.SORT_TYPE_VALUE[which]);<NEW_LINE>Common.showToast(getString(R<MASK><NEW_LINE>Local.setSettings(Shaft.sSettings);<NEW_LINE>baseBind.searchDefaultSortType.setText(PixivSearchParamUtil.SORT_TYPE_NAME[which]);<NEW_LINE>dialog.dismiss();<NEW_LINE>}<NEW_LINE>}).create().show();<NEW_LINE>}
.string.string_428), 2);
994,707
public AuthenticationResult createNegotiateHeader(HttpServletResponse resp, SpnegoConfig spnegoConfig) {<NEW_LINE>resp.setStatus(HttpServletResponse.SC_UNAUTHORIZED);<NEW_LINE>resp.setHeader("WWW-Authenticate", "Negotiate");<NEW_LINE>resp.setContentType(spnegoConfig.getErrorPageConfig().getSpnegoNotSupportedPageContentType());<NEW_LINE>String charset = spnegoConfig<MASK><NEW_LINE>if (charset != null) {<NEW_LINE>resp.setCharacterEncoding(charset);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// Add an HTML response indicating SPNEGO is not supported<NEW_LINE>// in case request has come from a Client which does not support SPNEGO.<NEW_LINE>resp.getWriter().println(spnegoConfig.getErrorPageConfig().getSpnegoNotSupportedPage());<NEW_LINE>com.ibm.wsspi.webcontainer.WebContainerRequestState.getInstance(true).setAttribute("spnego.error.page", "true");<NEW_LINE>} catch (IOException ex) {<NEW_LINE>Tr.error(tc, "SPNEGO_FAIL_TO_GET_WRITER", "SpnegoNotSupportedPage", ex.getMessage());<NEW_LINE>}<NEW_LINE>// When we consolidate ChallengeReply and TAIChallengeRely, we can remove the TAI_CHALLENGE<NEW_LINE>AuthenticationResult authResult = new AuthenticationResult(AuthResult.TAI_CHALLENGE, "Create negotiation Http header");<NEW_LINE>return authResult;<NEW_LINE>}
.getErrorPageConfig().getSpnegoNotSupportedPageCharset();
640,667
public static // '[' callback_function_list? ']'<NEW_LINE>boolean optional_callback_functions(PsiBuilder b, int l) {<NEW_LINE>if (!recursion_guard_(b, l, "optional_callback_functions"))<NEW_LINE>return false;<NEW_LINE>if (!nextTokenIs(b, ERL_BRACKET_LEFT))<NEW_LINE>return false;<NEW_LINE>boolean r, p;<NEW_LINE>Marker m = enter_section_(b, l, _NONE_, ERL_OPTIONAL_CALLBACK_FUNCTIONS, null);<NEW_LINE>r = consumeToken(b, ERL_BRACKET_LEFT);<NEW_LINE>// pin = 1<NEW_LINE>p = r;<NEW_LINE>r = r && report_error_(b, optional_callback_functions_1<MASK><NEW_LINE>r = p && consumeToken(b, ERL_BRACKET_RIGHT) && r;<NEW_LINE>exit_section_(b, l, m, r, p, null);<NEW_LINE>return r || p;<NEW_LINE>}
(b, l + 1));
430,986
/*<NEW_LINE>* Given an entry in a Zip archive, create a new Asset object.<NEW_LINE>*<NEW_LINE>* If the entry is uncompressed, we may want to create or share a<NEW_LINE>* slice of shared memory.<NEW_LINE>*/<NEW_LINE>static Asset openAssetFromZipLocked(final ZipFileRO pZipFile, final ZipEntryRO entry, AccessMode mode, final String8 entryName) {<NEW_LINE>Asset pAsset = null;<NEW_LINE>// TODO: look for previously-created shared memory slice?<NEW_LINE>final Ref<Short> method = new Ref<>((short) 0);<NEW_LINE>final Ref<Long> uncompressedLen = new Ref<>(0L);<NEW_LINE>// printf("USING Zip '%s'\n", pEntry.getFileName());<NEW_LINE>if (!pZipFile.getEntryInfo(entry, method, uncompressedLen, null, null, null, null)) {<NEW_LINE>ALOGW("getEntryInfo failed\n");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// return Asset.createFromZipEntry(pZipFile, entry, entryName);<NEW_LINE>FileMap dataMap = pZipFile.createEntryFileMap(entry);<NEW_LINE>// if (dataMap == null) {<NEW_LINE>// ALOGW("create map from entry failed\n");<NEW_LINE>// return null;<NEW_LINE>// }<NEW_LINE>//<NEW_LINE>if (method.get() == ZipFileRO.kCompressStored) {<NEW_LINE>pAsset = <MASK><NEW_LINE>ALOGV("Opened uncompressed entry %s in zip %s mode %s: %s", entryName.string(), pZipFile.mFileName, mode, pAsset);<NEW_LINE>} else {<NEW_LINE>pAsset = Asset.createFromCompressedMap(dataMap, toIntExact(uncompressedLen.get()), mode);<NEW_LINE>ALOGV("Opened compressed entry %s in zip %s mode %s: %s", entryName.string(), pZipFile.mFileName, mode, pAsset);<NEW_LINE>}<NEW_LINE>if (pAsset == null) {
Asset.createFromUncompressedMap(dataMap, mode);
581,532
static String createAuthorizationSignatureV4(HttpServletRequest request, S3AuthorizationHeader authHeader, byte[] payload, String uri, String credential) throws InvalidKeyException, IOException, NoSuchAlgorithmException, S3Exception {<NEW_LINE>String canonicalRequest = createCanonicalRequest(request, uri, payload, authHeader.getHashAlgorithm());<NEW_LINE>String algorithm = authHeader.getHmacAlgorithm();<NEW_LINE>byte[] dateKey = signMessage(authHeader.getDate().getBytes(StandardCharsets.UTF_8), ("AWS4" + credential).getBytes(StandardCharsets.UTF_8), algorithm);<NEW_LINE>byte[] dateRegionKey = signMessage(authHeader.getRegion().getBytes(StandardCharsets<MASK><NEW_LINE>byte[] dateRegionServiceKey = signMessage(authHeader.getService().getBytes(StandardCharsets.UTF_8), dateRegionKey, algorithm);<NEW_LINE>byte[] signingKey = signMessage("aws4_request".getBytes(StandardCharsets.UTF_8), dateRegionServiceKey, algorithm);<NEW_LINE>String date = request.getHeader(AwsHttpHeaders.DATE);<NEW_LINE>if (date == null) {<NEW_LINE>date = request.getParameter("X-Amz-Date");<NEW_LINE>}<NEW_LINE>String signatureString = "AWS4-HMAC-SHA256\n" + date + "\n" + authHeader.getDate() + "/" + authHeader.getRegion() + "/s3/aws4_request\n" + canonicalRequest;<NEW_LINE>byte[] signature = signMessage(signatureString.getBytes(StandardCharsets.UTF_8), signingKey, algorithm);<NEW_LINE>return BaseEncoding.base16().lowerCase().encode(signature);<NEW_LINE>}
.UTF_8), dateKey, algorithm);
1,489,856
public void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {<NEW_LINE>List<JasperPrint> jasperPrintList = BaseHttpServlet.getJasperPrintList(request);<NEW_LINE>if (jasperPrintList == null) {<NEW_LINE>throw new ServletException("No JasperPrint documents found on the HTTP session.");<NEW_LINE>}<NEW_LINE>Boolean isBuffered = Boolean.valueOf(request.getParameter(BaseHttpServlet.BUFFERED_OUTPUT_REQUEST_PARAMETER));<NEW_LINE>if (isBuffered) {<NEW_LINE>FileBufferedOutputStream fbos = new FileBufferedOutputStream();<NEW_LINE>JROdsExporter exporter = new JROdsExporter(DefaultJasperReportsContext.getInstance());<NEW_LINE>exporter.setExporterInput(SimpleExporterInput.getInstance(jasperPrintList));<NEW_LINE>exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(fbos));<NEW_LINE>try {<NEW_LINE>exporter.exportReport();<NEW_LINE>fbos.close();<NEW_LINE>if (fbos.size() > 0) {<NEW_LINE>response.setContentType("application/vnd.oasis.opendocument.spreadsheet");<NEW_LINE>response.setHeader("Content-Disposition", "inline; filename=\"file.ods\"");<NEW_LINE>response.setContentLength(fbos.size());<NEW_LINE>ServletOutputStream outputStream = response.getOutputStream();<NEW_LINE>try {<NEW_LINE>fbos.writeData(outputStream);<NEW_LINE>fbos.dispose();<NEW_LINE>outputStream.flush();<NEW_LINE>} finally {<NEW_LINE>if (outputStream != null) {<NEW_LINE>try {<NEW_LINE>outputStream.close();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (JRException e) {<NEW_LINE>throw new ServletException(e);<NEW_LINE>} finally {<NEW_LINE>fbos.close();<NEW_LINE>fbos.dispose();<NEW_LINE>}<NEW_LINE>// else<NEW_LINE>// {<NEW_LINE>// response.setContentType("text/html");<NEW_LINE>// PrintWriter out = response.getWriter();<NEW_LINE>// out.println("<html>");<NEW_LINE>// out.println("<body bgcolor=\"white\">");<NEW_LINE>// out.println("<span class=\"bold\">Empty response.</span>");<NEW_LINE>// out.println("</body>");<NEW_LINE>// out.println("</html>");<NEW_LINE>// }<NEW_LINE>} else {<NEW_LINE>response.setContentType("application/vnd.oasis.opendocument.spreadsheet");<NEW_LINE>response.setHeader("Content-Disposition", "inline; filename=\"file.ods\"");<NEW_LINE>JROdsExporter exporter = new JROdsExporter(DefaultJasperReportsContext.getInstance());<NEW_LINE>exporter.setExporterInput<MASK><NEW_LINE>OutputStream outputStream = response.getOutputStream();<NEW_LINE>exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(outputStream));<NEW_LINE>try {<NEW_LINE>exporter.exportReport();<NEW_LINE>} catch (JRException e) {<NEW_LINE>throw new ServletException(e);<NEW_LINE>} finally {<NEW_LINE>if (outputStream != null) {<NEW_LINE>try {<NEW_LINE>outputStream.close();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(SimpleExporterInput.getInstance(jasperPrintList));
1,437,379
protected void handleAdditionalDependencies(List<HasDependencies.ClientDependency> dependenciesToAdd, List<Dependency> dependencies, LegacyCommunicationManager manager) {<NEW_LINE>for (HasDependencies.ClientDependency dependency : dependenciesToAdd) {<NEW_LINE>String resourcePath;<NEW_LINE><MASK><NEW_LINE>if (dependencyPath.startsWith(WEB_JAR_PREFIX)) {<NEW_LINE>String resourceUri = processResourceUri(dependencyPath.replace(WEB_JAR_PREFIX, ""));<NEW_LINE>resourcePath = getResourceActualPath(resourceUri, "");<NEW_LINE>} else {<NEW_LINE>resourcePath = dependencyPath;<NEW_LINE>}<NEW_LINE>Dependency.Type type = dependency.getType() != null ? dependency.getType() : resolveTypeFromPath(dependencyPath);<NEW_LINE>// If we can't resolve dependency type, i.e. it might have unsupported type,<NEW_LINE>// then we don't add such dependency<NEW_LINE>if (type != null) {<NEW_LINE>String url = manager.registerDependency(resourcePath, CubaUidlWriter.class);<NEW_LINE>dependencies.add(new Dependency(type, url));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
String dependencyPath = dependency.getPath();
306,390
public com.amazonaws.services.cloudhsmv2.model.CloudHsmTagException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.cloudhsmv2.model.CloudHsmTagException cloudHsmTagException = new com.amazonaws.services.cloudhsmv2.model.CloudHsmTagException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return cloudHsmTagException;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
607,199
public void marshall(ExportJournalToS3Request exportJournalToS3Request, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (exportJournalToS3Request == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(exportJournalToS3Request.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(exportJournalToS3Request.getInclusiveStartTime(), INCLUSIVESTARTTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(exportJournalToS3Request.getExclusiveEndTime(), EXCLUSIVEENDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(exportJournalToS3Request.getS3ExportConfiguration(), S3EXPORTCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(exportJournalToS3Request.getOutputFormat(), OUTPUTFORMAT_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
exportJournalToS3Request.getRoleArn(), ROLEARN_BINDING);
194,578
private void initPersistedCoreDumps() {<NEW_LINE>if (!CoreDumpSupport.storageDirectoryExists())<NEW_LINE>return;<NEW_LINE>File[] files = CoreDumpSupport.getStorageDirectory().listFiles(new FilenameFilter() {<NEW_LINE><NEW_LINE>public boolean accept(File dir, String name) {<NEW_LINE>return name.endsWith(Storage.DEFAULT_PROPERTIES_EXT);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Set<File> unresolvedCoreDumpsF = new HashSet();<NEW_LINE>Set<<MASK><NEW_LINE>Set<CoreDumpImpl> coredumps = new HashSet();<NEW_LINE>for (File file : files) {<NEW_LINE>Storage storage = new Storage(file.getParentFile(), file.getName());<NEW_LINE>String[] propNames = new String[] { Snapshot.PROPERTY_FILE, PROPERTY_JAVA_HOME };<NEW_LINE>String[] propValues = storage.getCustomProperties(propNames);<NEW_LINE>if (propValues[0] == null || propValues[1] == null)<NEW_LINE>continue;<NEW_LINE>CoreDumpImpl persistedCoredump = null;<NEW_LINE>try {<NEW_LINE>persistedCoredump = new CoreDumpImpl(new File(propValues[0]), new File(propValues[1]), storage);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// NOI18N<NEW_LINE>LOGGER.log(Level.INFO, "Error loading persisted coredump", e);<NEW_LINE>unresolvedCoreDumpsF.add(file);<NEW_LINE>unresolvedCoreDumpsS.add(propValues[0]);<NEW_LINE>}<NEW_LINE>if (persistedCoredump != null)<NEW_LINE>coredumps.add(persistedCoredump);<NEW_LINE>}<NEW_LINE>if (!unresolvedCoreDumpsF.isEmpty())<NEW_LINE>notifyUnresolvedCoreDumps(unresolvedCoreDumpsF, unresolvedCoreDumpsS);<NEW_LINE>if (!coredumps.isEmpty())<NEW_LINE>CoreDumpsContainer.sharedInstance().getRepository().addDataSources(coredumps);<NEW_LINE>}
String> unresolvedCoreDumpsS = new HashSet();
786,123
private int checkAugmentedHeads() {<NEW_LINE>logger.debug("S#{} checkAugmentedHeads", system.getId());<NEW_LINE>int modifs = 0;<NEW_LINE>final List<Inter> headChords = sig.inters(HeadChordInter.class);<NEW_LINE>for (Inter hc : headChords) {<NEW_LINE><MASK><NEW_LINE>// Heads, ordered top down<NEW_LINE>final List<? extends Inter> heads = EnsembleHelper.getMembers(chord, Inters.byCenterOrdinate);<NEW_LINE>for (Inter entity : heads) {<NEW_LINE>final Set<Relation> rels = sig.getRelations(entity, AugmentationRelation.class);<NEW_LINE>if (rels.size() > 1) {<NEW_LINE>modifs += reduceHeadAugmentations((HeadInter) entity, rels);<NEW_LINE>if (entity.isVip()) {<NEW_LINE>logger.info("VIP reduced augmentations for {}", entity);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return modifs;<NEW_LINE>}
final HeadChordInter chord = (HeadChordInter) hc;
462,058
public void showAnnotation(FileAnnotation annotation, VirtualFile file, AbstractVcs vcs, int line) {<NEW_LINE>TextEditor textFileEditor;<NEW_LINE>FileEditor fileEditor = FileEditorManager.getInstance(myProject).getSelectedEditor(file);<NEW_LINE>if (fileEditor instanceof TextEditor) {<NEW_LINE>textFileEditor = ((TextEditor) fileEditor);<NEW_LINE>} else {<NEW_LINE>FileEditor[] editors = FileEditorManager.getInstance(myProject).getEditors(file);<NEW_LINE>textFileEditor = ContainerUtil.findInstance(editors, TextEditor.class);<NEW_LINE>}<NEW_LINE>Editor editor;<NEW_LINE>if (textFileEditor != null) {<NEW_LINE>editor = textFileEditor.getEditor();<NEW_LINE>} else {<NEW_LINE>OpenFileDescriptor openFileDescriptor = new OpenFileDescriptor(<MASK><NEW_LINE>editor = FileEditorManager.getInstance(myProject).openTextEditor(openFileDescriptor, true);<NEW_LINE>}<NEW_LINE>if (editor == null) {<NEW_LINE>Messages.showMessageDialog(VcsBundle.message("message.text.cannot.open.editor", file.getPresentableUrl()), VcsBundle.message("message.title.cannot.open.editor"), Messages.getInformationIcon());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>AnnotateToggleAction.doAnnotate(editor, myProject, file, annotation, vcs);<NEW_LINE>}
myProject, file, line, 0);
1,364,462
public ListDeviceResourcesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListDeviceResourcesResult listDeviceResourcesResult = new ListDeviceResourcesResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listDeviceResourcesResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listDeviceResourcesResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("resources", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listDeviceResourcesResult.setResources(new ListUnmarshaller<ResourceSummary>(ResourceSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listDeviceResourcesResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
299,193
public static /*public static ModelSource createModelSource(final FileObject thisFileObj,<NEW_LINE>boolean editable) throws CatalogModelException{<NEW_LINE>assert thisFileObj != null : "Null file object.";<NEW_LINE>final CatalogModel catalogModel = createCatalogModel(thisFileObj);<NEW_LINE>final DataObject dobj;<NEW_LINE>try {<NEW_LINE>dobj = DataObject.find(thisFileObj);<NEW_LINE>} catch (DataObjectNotFoundException ex) {<NEW_LINE>throw new CatalogModelException(ex);<NEW_LINE>}<NEW_LINE><NEW_LINE>ProxyLookup myLookup = new ProxyLookup() {<NEW_LINE>protected void beforeLookup(Lookup.Template template) {<NEW_LINE>if (Document.class.isAssignableFrom(template.getType())) {<NEW_LINE>Lookup l = Lookup.EMPTY;<NEW_LINE>try {<NEW_LINE>Document d = _getDocument(thisFileObj);<NEW_LINE>l = Lookups.singleton(d);<NEW_LINE>} catch (DataObjectNotFoundException ex) {<NEW_LINE>getLogger().log(Level.SEVERE, <MASK><NEW_LINE>} catch (IOException ex) {<NEW_LINE>getLogger().log(Level.SEVERE, ex.getMessage());<NEW_LINE>}<NEW_LINE><NEW_LINE>setLookups(new Lookup[]{l});<NEW_LINE>} else if (Source.class.isAssignableFrom(template.getType())) {<NEW_LINE>setLookups(new Lookup[]{Lookups.singleton(DataObjectAdapters.source(dobj))});<NEW_LINE>} else {<NEW_LINE>Lookup l = Lookups.fixed(new Object[] {<NEW_LINE>thisFileObj,<NEW_LINE>dobj,<NEW_LINE>catalogModel<NEW_LINE>});<NEW_LINE>setLookups(new Lookup[]{l});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE><NEW_LINE>return new ModelSource(myLookup, editable);<NEW_LINE>}*/<NEW_LINE>CatalogModel createCatalogModel(FileObject fo) throws CatalogModelException {<NEW_LINE>return new CatalogModelFactoryImpl().getCatalogModel(fo);<NEW_LINE>}
"Can't load data object from "+thisFileObj.getPath());
1,782,708
String resolvedDestination(String destination, DefaultChannels defaultChannel) {<NEW_LINE>try {<NEW_LINE>BindingServiceProperties channelBindingServiceProperties = this.context.getBean(BindingServiceProperties.class);<NEW_LINE>Map<String, String> <MASK><NEW_LINE>for (Map.Entry<String, BindingProperties> entry : channelBindingServiceProperties.getBindings().entrySet()) {<NEW_LINE>if (destination.equals(entry.getValue().getDestination())) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Found a channel named [" + entry.getKey() + "] with destination [" + destination + "]");<NEW_LINE>}<NEW_LINE>channels.put(entry.getKey(), destination);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (channels.size() == 1) {<NEW_LINE>return channels.keySet().iterator().next();<NEW_LINE>} else if (channels.size() > 0) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Found following channels [" + channels + "] for destination [" + destination + "]. " + "Will pick the one that matches the default channel name or the first one if none is matching");<NEW_LINE>}<NEW_LINE>String defaultChannelName = channels.get(defaultChannel.name().toLowerCase());<NEW_LINE>String matchingChannelName = StringUtils.hasText(defaultChannelName) ? defaultChannel.name().toLowerCase() : channels.keySet().iterator().next();<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Picked channel name is [" + matchingChannelName + "]");<NEW_LINE>}<NEW_LINE>return matchingChannelName;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Exception took place while trying to resolve the destination. Will assume the name [" + destination + "]", e);<NEW_LINE>}<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("No destination named [" + destination + "] was found. Assuming that the destination equals the channel name");<NEW_LINE>}<NEW_LINE>return destination;<NEW_LINE>}
channels = new HashMap<>();
665,187
public static ListProductsResponse unmarshall(ListProductsResponse listProductsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listProductsResponse.setRequestId<MASK><NEW_LINE>listProductsResponse.setTotal(_ctx.integerValue("ListProductsResponse.Total"));<NEW_LINE>listProductsResponse.setUbsmsStatus(_ctx.stringValue("ListProductsResponse.UbsmsStatus"));<NEW_LINE>List<ProductInfo> productInfos = new ArrayList<ProductInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListProductsResponse.ProductInfos.Length"); i++) {<NEW_LINE>ProductInfo productInfo = new ProductInfo();<NEW_LINE>productInfo.setProductId(_ctx.stringValue("ListProductsResponse.ProductInfos[" + i + "].ProductId"));<NEW_LINE>productInfo.setName(_ctx.stringValue("ListProductsResponse.ProductInfos[" + i + "].Name"));<NEW_LINE>productInfo.setEncodedIcon(_ctx.stringValue("ListProductsResponse.ProductInfos[" + i + "].EncodedIcon"));<NEW_LINE>productInfo.setPlatforms(_ctx.stringValue("ListProductsResponse.ProductInfos[" + i + "].Platforms"));<NEW_LINE>productInfo.setReadonly(_ctx.booleanValue("ListProductsResponse.ProductInfos[" + i + "].Readonly"));<NEW_LINE>productInfo.setIndustryId(_ctx.integerValue("ListProductsResponse.ProductInfos[" + i + "].IndustryId"));<NEW_LINE>productInfos.add(productInfo);<NEW_LINE>}<NEW_LINE>listProductsResponse.setProductInfos(productInfos);<NEW_LINE>return listProductsResponse;<NEW_LINE>}
(_ctx.stringValue("ListProductsResponse.RequestId"));
226,132
public void translate(GeyserSession session, ClientboundContainerSetSlotPacket packet) {<NEW_LINE>if (packet.getContainerId() == 255) {<NEW_LINE>// cursor<NEW_LINE>GeyserItemStack newItem = GeyserItemStack.from(packet.getItem());<NEW_LINE>session.getPlayerInventory().setCursor(newItem, session);<NEW_LINE>InventoryUtils.updateCursor(session);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// TODO: support window id -2, should update player inventory<NEW_LINE>Inventory inventory = InventoryUtils.getInventory(session, packet.getContainerId());<NEW_LINE>if (inventory == null)<NEW_LINE>return;<NEW_LINE>// Intentional behavior here below the cursor; Minecraft 1.18.1 also does this.<NEW_LINE>int stateId = packet.getStateId();<NEW_LINE>session.setEmulatePost1_16Logic(stateId > 0 || stateId != inventory.getStateId());<NEW_LINE>inventory.setStateId(stateId);<NEW_LINE><MASK><NEW_LINE>if (translator != null) {<NEW_LINE>if (session.getCraftingGridFuture() != null) {<NEW_LINE>session.getCraftingGridFuture().cancel(false);<NEW_LINE>}<NEW_LINE>updateCraftingGrid(session, packet.getSlot(), packet.getItem(), inventory, translator);<NEW_LINE>GeyserItemStack newItem = GeyserItemStack.from(packet.getItem());<NEW_LINE>if (packet.getContainerId() == 0 && !(translator instanceof PlayerInventoryTranslator)) {<NEW_LINE>// In rare cases, the window ID can still be 0 but Java treats it as valid<NEW_LINE>session.getPlayerInventory().setItem(packet.getSlot(), newItem, session);<NEW_LINE>InventoryTranslator.PLAYER_INVENTORY_TRANSLATOR.updateSlot(session, session.getPlayerInventory(), packet.getSlot());<NEW_LINE>} else {<NEW_LINE>inventory.setItem(packet.getSlot(), newItem, session);<NEW_LINE>translator.updateSlot(session, inventory, packet.getSlot());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
InventoryTranslator translator = session.getInventoryTranslator();
1,586,241
private void handleServerChannel(JsonNode jsonChannel) {<NEW_LINE>long channelId = jsonChannel.get("id").asLong();<NEW_LINE>long guildId = jsonChannel.get("guild_id").asLong();<NEW_LINE>ServerImpl server = api.getPossiblyUnreadyServerById(guildId).map(ServerImpl.class::cast).orElse(null);<NEW_LINE>if (server == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ServerChannelImpl channel = server.getChannelById(channelId).map(ServerChannelImpl.class::cast).orElse(null);<NEW_LINE>if (channel == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String oldName = channel.getName();<NEW_LINE>String newName = jsonChannel.<MASK><NEW_LINE>if (!Objects.deepEquals(oldName, newName)) {<NEW_LINE>channel.setName(newName);<NEW_LINE>ServerChannelChangeNameEvent event = new ServerChannelChangeNameEventImpl(channel, newName, oldName);<NEW_LINE>if (server.isReady()) {<NEW_LINE>api.getEventDispatcher().dispatchServerChannelChangeNameEvent((DispatchQueueSelector) channel.getServer(), channel.getServer(), channel, event);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
get("name").asText();
1,197,340
private int newCorrelationTypeKnownId(CorrelationAttributeInstance.Type newType) throws CentralRepoException {<NEW_LINE>Connection conn = connect();<NEW_LINE>PreparedStatement preparedStatement = null;<NEW_LINE>PreparedStatement preparedStatementQuery = null;<NEW_LINE>ResultSet resultSet = null;<NEW_LINE>int typeId = 0;<NEW_LINE>String insertSql;<NEW_LINE>String querySql;<NEW_LINE>// if we have a known ID, use it, if not (is -1) let the db assign it.<NEW_LINE>insertSql = "INSERT INTO correlation_types(id, display_name, db_table_name, supported, enabled) VALUES (?, ?, ?, ?, ?) " + getConflictClause();<NEW_LINE>querySql = "SELECT * FROM correlation_types WHERE display_name=? AND db_table_name=?";<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>preparedStatement.setInt(1, newType.getId());<NEW_LINE>preparedStatement.setString(2, newType.getDisplayName());<NEW_LINE>preparedStatement.setString(3, newType.getDbTableName());<NEW_LINE>preparedStatement.setInt(4, newType.isSupported() ? 1 : 0);<NEW_LINE>preparedStatement.setInt(5, newType.isEnabled() ? 1 : 0);<NEW_LINE>preparedStatement.executeUpdate();<NEW_LINE>preparedStatementQuery = conn.prepareStatement(querySql);<NEW_LINE>preparedStatementQuery.setString(1, newType.getDisplayName());<NEW_LINE>preparedStatementQuery.setString(2, newType.getDbTableName());<NEW_LINE>resultSet = preparedStatementQuery.executeQuery();<NEW_LINE>if (resultSet.next()) {<NEW_LINE>CorrelationAttributeInstance.Type correlationType = getCorrelationTypeFromResultSet(resultSet);<NEW_LINE>typeId = correlationType.getId();<NEW_LINE>}<NEW_LINE>} catch (SQLException ex) {<NEW_LINE>// NON-NLS<NEW_LINE>throw new CentralRepoException("Error inserting new correlation type.", ex);<NEW_LINE>} finally {<NEW_LINE>CentralRepoDbUtil.closeResultSet(resultSet);<NEW_LINE>CentralRepoDbUtil.closeStatement(preparedStatement);<NEW_LINE>CentralRepoDbUtil.closeStatement(preparedStatementQuery);<NEW_LINE>CentralRepoDbUtil.closeConnection(conn);<NEW_LINE>}<NEW_LINE>return typeId;<NEW_LINE>}
preparedStatement = conn.prepareStatement(insertSql);
1,062,788
public E relaxedPeek() {<NEW_LINE>final int chunkMask = this.chunkMask;<NEW_LINE>final int chunkShift = this.chunkShift;<NEW_LINE>final long cIndex = this.lvConsumerIndex();<NEW_LINE>final int ciChunkOffset = <MASK><NEW_LINE>final long ciChunkIndex = cIndex >> chunkShift;<NEW_LINE>MpmcUnboundedXaddChunk<E> consumerBuffer = this.lvConsumerChunk();<NEW_LINE>final int chunkSize = chunkMask + 1;<NEW_LINE>final boolean firstElementOfNewChunk = ciChunkOffset == 0 && cIndex >= chunkSize;<NEW_LINE>if (firstElementOfNewChunk) {<NEW_LINE>final long expectedChunkIndex = ciChunkIndex - 1;<NEW_LINE>if (expectedChunkIndex != consumerBuffer.lvIndex()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final MpmcUnboundedXaddChunk<E> next = consumerBuffer.lvNext();<NEW_LINE>if (next == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>consumerBuffer = next;<NEW_LINE>}<NEW_LINE>if (consumerBuffer.isPooled()) {<NEW_LINE>if (consumerBuffer.lvSequence(ciChunkOffset) != ciChunkIndex) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (consumerBuffer.lvIndex() != ciChunkIndex) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final E e = consumerBuffer.lvElement(ciChunkOffset);<NEW_LINE>// checking again vs consumerIndex changes is necessary to verify that e is still valid<NEW_LINE>if (cIndex != lvConsumerIndex()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return e;<NEW_LINE>}
(int) (cIndex & chunkMask);
1,539,340
final GetRateBasedRuleManagedKeysResult executeGetRateBasedRuleManagedKeys(GetRateBasedRuleManagedKeysRequest getRateBasedRuleManagedKeysRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getRateBasedRuleManagedKeysRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetRateBasedRuleManagedKeysRequest> request = null;<NEW_LINE>Response<GetRateBasedRuleManagedKeysResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetRateBasedRuleManagedKeysRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getRateBasedRuleManagedKeysRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "WAF");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetRateBasedRuleManagedKeys");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetRateBasedRuleManagedKeysResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetRateBasedRuleManagedKeysResultJsonUnmarshaller());<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,222,024
public void requestPermissions(String[] permissions) {<NEW_LINE>if (component.isService()) {<NEW_LINE>// https://developer.android.com/training/articles/wear-permissions.html<NEW_LINE>// Inspired by PermissionHelper.java from Michael von Glasow:<NEW_LINE>// https://github.com/mvglasow/satstat/blob/master/src/com/vonglasow/michael/satstat/utils/PermissionHelper.java<NEW_LINE>// Example of use:<NEW_LINE>// https://github.com/mvglasow/satstat/blob/master/src/com/vonglasow/michael/satstat/PasvLocListenerService.java<NEW_LINE>final ServiceEngine eng = getEngine();<NEW_LINE>if (eng != null) {<NEW_LINE>// A valid service should have a non-null engine at this point, but just in case<NEW_LINE>ResultReceiver resultReceiver = new ResultReceiver(new Handler(Looper.getMainLooper())) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onReceiveResult(int resultCode, Bundle resultData) {<NEW_LINE>String[] outPermissions = resultData.getStringArray(PermissionRequestor.KEY_PERMISSIONS);<NEW_LINE>int[] grantResults = resultData.getIntArray(PermissionRequestor.KEY_GRANT_RESULTS);<NEW_LINE>eng.onRequestPermissionsResult(resultCode, outPermissions, grantResults);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>final Intent permIntent = new Intent(getContext(), PermissionRequestor.class);<NEW_LINE>permIntent.putExtra(PermissionRequestor.KEY_RESULT_RECEIVER, resultReceiver);<NEW_LINE>permIntent.putExtra(PermissionRequestor.KEY_PERMISSIONS, permissions);<NEW_LINE>permIntent.putExtra(PermissionRequestor.KEY_REQUEST_CODE, REQUEST_PERMISSIONS);<NEW_LINE>// Show the dialog requesting the permissions<NEW_LINE><MASK><NEW_LINE>startActivity(permIntent);<NEW_LINE>}<NEW_LINE>} else if (activity != null) {<NEW_LINE>// Requesting permissions from user when the app resumes.<NEW_LINE>// Nice example on how to handle user response<NEW_LINE>// http://stackoverflow.com/a/35495855<NEW_LINE>// More on permission in Android 23:<NEW_LINE>// https://inthecheesefactory.com/blog/things-you-need-to-know-about-android-m-permission-developer-edition/en<NEW_LINE>ActivityCompat.requestPermissions(activity, permissions, REQUEST_PERMISSIONS);<NEW_LINE>}<NEW_LINE>}
permIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
122,922
public static String toJSONString(Object object, SerializeFilter[] filters, SerializerFeature... features) {<NEW_LINE>JSONWriter.Context context = JSONFactory.createWriteContext();<NEW_LINE>config(context, features);<NEW_LINE>try (JSONWriter writer = JSONWriter.of(context)) {<NEW_LINE>writer.setRootObject(object);<NEW_LINE>configFilter(context, filters);<NEW_LINE>if (object == null) {<NEW_LINE>writer.writeNull();<NEW_LINE>} else {<NEW_LINE>Class<?> valueClass = object.getClass();<NEW_LINE>ObjectWriter objectWriter = <MASK><NEW_LINE>objectWriter.write(writer, object, null, null, 0);<NEW_LINE>}<NEW_LINE>return writer.toString();<NEW_LINE>} catch (com.alibaba.fastjson2.JSONException ex) {<NEW_LINE>Throwable cause = ex.getCause() != null ? ex.getCause() : ex;<NEW_LINE>throw new JSONException("toJSONString error", cause);<NEW_LINE>} catch (RuntimeException ex) {<NEW_LINE>throw new JSONException("toJSONString error", ex);<NEW_LINE>}<NEW_LINE>}
context.getObjectWriter(valueClass, valueClass);
1,813,597
public void openURL(String url) {<NEW_LINE>if (TextUtils.isEmpty(url)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String scheme = Uri.parse(url).getScheme();<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>if ("weex://go/scan".equals(url)) {<NEW_LINE>if (ContextCompat.checkSelfPermission(mWXSDKInstance.getContext(), Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {<NEW_LINE>if (ActivityCompat.shouldShowRequestPermissionRationale((Activity) mWXSDKInstance.getContext(), Manifest.permission.CAMERA)) {<NEW_LINE>showCameraPermissionRationale();<NEW_LINE>} else {<NEW_LINE>ActivityCompat.requestPermissions((Activity) mWXSDKInstance.getContext(), new String[] { Manifest<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>new IntentIntegrator((Activity) mWXSDKInstance.getContext()).setDesiredBarcodeFormats(IntentIntegrator.QR_CODE).setBeepEnabled(false).setCaptureActivity(CustomCaptureActivity.class).initiateScan();<NEW_LINE>// mWXSDKInstance.getContext().startActivity(new Intent(mWXSDKInstance.getContext(), CaptureActivity.class));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (TextUtils.equals("http", scheme) || TextUtils.equals("https", scheme) || TextUtils.equals("file", scheme)) {<NEW_LINE>builder.append(url);<NEW_LINE>} else {<NEW_LINE>builder.append("http:");<NEW_LINE>builder.append(url);<NEW_LINE>}<NEW_LINE>Uri uri = Uri.parse(builder.toString());<NEW_LINE>Intent intent = new Intent(mWXSDKInstance.getContext(), WXPageActivity.class);<NEW_LINE>intent.setAction(WEEX_ACTION);<NEW_LINE>intent.setData(uri);<NEW_LINE>intent.addCategory(WEEX_CATEGORY);<NEW_LINE>mWXSDKInstance.getContext().startActivity(intent);<NEW_LINE>if (mWXSDKInstance.checkModuleEventRegistered("event", this)) {<NEW_LINE>HashMap<String, Object> params = new HashMap<>();<NEW_LINE>params.put("param1", "param1");<NEW_LINE>params.put("param2", "param2");<NEW_LINE>params.put("param3", "param3");<NEW_LINE>mWXSDKInstance.fireModuleEvent("event", this, params);<NEW_LINE>}<NEW_LINE>}
.permission.CAMERA }, CAMERA_PERMISSION_REQUEST_CODE);
1,587,253
final GetFaceSearchResult executeGetFaceSearch(GetFaceSearchRequest getFaceSearchRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getFaceSearchRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetFaceSearchRequest> request = null;<NEW_LINE>Response<GetFaceSearchResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new GetFaceSearchRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getFaceSearchRequest));<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, "Rekognition");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetFaceSearch");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetFaceSearchResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetFaceSearchResultJsonUnmarshaller());<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);
911,303
// To get items having price more than 1000<NEW_LINE>public String[] greaterThanCriteria() {<NEW_LINE>final Session session = HibernateUtil.getHibernateSession();<NEW_LINE>final CriteriaBuilder cb = session.getCriteriaBuilder();<NEW_LINE>final CriteriaQuery<Item> cr = cb.createQuery(Item.class);<NEW_LINE>final Root<Item> root = cr.from(Item.class);<NEW_LINE>cr.select(root).where(cb.gt(root.<MASK><NEW_LINE>// cr.add(Restrictions.gt("itemPrice", 1000));<NEW_LINE>Query<Item> query = session.createQuery(cr);<NEW_LINE>final List<Item> greaterThanItemsList = query.getResultList();<NEW_LINE>final String[] greaterThanItems = new String[greaterThanItemsList.size()];<NEW_LINE>for (int i = 0; i < greaterThanItemsList.size(); i++) {<NEW_LINE>greaterThanItems[i] = greaterThanItemsList.get(i).getItemName();<NEW_LINE>}<NEW_LINE>session.close();<NEW_LINE>return greaterThanItems;<NEW_LINE>}
get("itemPrice"), 1000));
1,324,416
public boolean updateBounds(int lb, int ub, ICause cause) throws ContradictionException {<NEW_LINE>assert cause != null;<NEW_LINE>int olb = this.getLB();<NEW_LINE>int oub = this.getUB();<NEW_LINE>boolean hasChanged = false;<NEW_LINE>if (olb < lb || oub > ub) {<NEW_LINE>IntEventType e = null;<NEW_LINE>if (olb < lb) {<NEW_LINE>model.getSolver().getEventObserver().updateLowerBound(this, lb, getLB(), cause);<NEW_LINE>e = IntEventType.INCLOW;<NEW_LINE>if (doUpdateLowerBoundOfVar(lb)) {<NEW_LINE>hasChanged = true;<NEW_LINE>} else {<NEW_LINE>model.getSolver().getEventObserver().undo();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (oub > ub) {<NEW_LINE>e = e == null ? IntEventType.DECUPP : IntEventType.BOUND;<NEW_LINE>model.getSolver().getEventObserver().updateUpperBound(this, ub, getUB(), cause);<NEW_LINE>if (doUpdateUpperBoundOfVar(ub)) {<NEW_LINE>hasChanged = true;<NEW_LINE>} else {<NEW_LINE>model.getSolver()<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isInstantiated()) {<NEW_LINE>e = IntEventType.INSTANTIATE;<NEW_LINE>}<NEW_LINE>if (hasChanged) {<NEW_LINE>this.notifyPropagators(e, cause);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return hasChanged;<NEW_LINE>}
.getEventObserver().undo();
1,022,104
public static GraphQLInterfaceType createInterfaceType(final String typeName, final Map<String, TypeFetcher> fieldsTypesAndFetchers, final TypeResolver typeResolver) {<NEW_LINE>final GraphQLInterfaceType.Builder builder = GraphQLInterfaceType.newInterface().name(typeName);<NEW_LINE>fieldsTypesAndFetchers.forEach((key, value) -> {<NEW_LINE>Builder fieldDefinitionBuilder = newFieldDefinition();<NEW_LINE>if (UtilMethods.isSet(value.getArguments())) {<NEW_LINE>fieldDefinitionBuilder.name(key).arguments(value.getArguments()).type(value.getType()).<MASK><NEW_LINE>} else {<NEW_LINE>fieldDefinitionBuilder.name(key).type(value.getType()).dataFetcher(value.getDataFetcher());<NEW_LINE>}<NEW_LINE>fieldDefinitionBuilder.argument(GraphQLArgument.newArgument().name("render").type(GraphQLBoolean).defaultValue(null));<NEW_LINE>builder.field(fieldDefinitionBuilder.build());<NEW_LINE>});<NEW_LINE>builder.typeResolver(typeResolver);<NEW_LINE>return builder.build();<NEW_LINE>}
dataFetcher(value.getDataFetcher());
428,176
public void createBip44AccountContext(HDAccountContext context) {<NEW_LINE>_database.beginTransaction();<NEW_LINE>try {<NEW_LINE>// Create accountBacking tables<NEW_LINE>SqliteBtcAccountBacking backing = _backings.get(context.getId());<NEW_LINE>if (backing == null) {<NEW_LINE>createAccountBackingTables(context.getId(), _database);<NEW_LINE>backing = new SqliteBtcAccountBacking(context.getId(), _database);<NEW_LINE>_backings.put(context.getId(), backing);<NEW_LINE>}<NEW_LINE>// Create context<NEW_LINE>_insertOrReplaceBip44Account.bindBlob(1, uuidToBytes(context.getId()));<NEW_LINE>_insertOrReplaceBip44Account.bindLong(2, context.getAccountIndex());<NEW_LINE>_insertOrReplaceBip44Account.bindLong(3, context.isArchived() ? 1 : 0);<NEW_LINE>_insertOrReplaceBip44Account.bindLong(4, context.getBlockHeight());<NEW_LINE>_insertOrReplaceBip44Account.bindString(5, gson.toJson(context.getIndexesMap()));<NEW_LINE>_insertOrReplaceBip44Account.bindLong(6, context.getLastDiscovery());<NEW_LINE>_insertOrReplaceBip44Account.bindLong(7, context.getAccountType());<NEW_LINE>_insertOrReplaceBip44Account.bindLong(8, context.getAccountSubId());<NEW_LINE>_insertOrReplaceBip44Account.bindString(9, gson.toJson<MASK><NEW_LINE>_insertOrReplaceBip44Account.executeInsert();<NEW_LINE>_database.setTransactionSuccessful();<NEW_LINE>} finally {<NEW_LINE>_database.endTransaction();<NEW_LINE>}<NEW_LINE>}
(context.getDefaultAddressType()));
41,025
protected void didBecomeActive(@Nullable Bundle savedInstanceState) {<NEW_LINE>super.didBecomeActive(savedInstanceState);<NEW_LINE>presenter.squareClicks().subscribe(new Consumer<BoardCoordinate>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void accept(BoardCoordinate xy) throws Exception {<NEW_LINE>if (board.cells[xy.getX()][xy.getY()] == null) {<NEW_LINE>if (currentPlayer == MarkerType.CROSS) {<NEW_LINE>board.cells[xy.getX()][xy.<MASK><NEW_LINE>board.currentRow = xy.getX();<NEW_LINE>board.currentCol = xy.getY();<NEW_LINE>presenter.addCross(xy);<NEW_LINE>currentPlayer = MarkerType.NOUGHT;<NEW_LINE>} else {<NEW_LINE>board.cells[xy.getX()][xy.getY()] = MarkerType.NOUGHT;<NEW_LINE>board.currentRow = xy.getX();<NEW_LINE>board.currentCol = xy.getY();<NEW_LINE>presenter.addNought(xy);<NEW_LINE>currentPlayer = MarkerType.CROSS;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (board.hasWon(MarkerType.CROSS)) {<NEW_LINE>presenter.setPlayerWon(playerOne);<NEW_LINE>} else if (board.hasWon(MarkerType.NOUGHT)) {<NEW_LINE>presenter.setPlayerWon(playerTwo);<NEW_LINE>} else if (board.isDraw()) {<NEW_LINE>presenter.setPlayerTie();<NEW_LINE>} else {<NEW_LINE>updateCurrentPlayer();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>updateCurrentPlayer();<NEW_LINE>}
getY()] = MarkerType.CROSS;
1,015,112
public void marshall(GetNetworkTelemetryRequest getNetworkTelemetryRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (getNetworkTelemetryRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(getNetworkTelemetryRequest.getGlobalNetworkId(), GLOBALNETWORKID_BINDING);<NEW_LINE>protocolMarshaller.marshall(getNetworkTelemetryRequest.getCoreNetworkId(), CORENETWORKID_BINDING);<NEW_LINE>protocolMarshaller.marshall(getNetworkTelemetryRequest.getRegisteredGatewayArn(), REGISTEREDGATEWAYARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(getNetworkTelemetryRequest.getAwsRegion(), AWSREGION_BINDING);<NEW_LINE>protocolMarshaller.marshall(getNetworkTelemetryRequest.getAccountId(), ACCOUNTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(getNetworkTelemetryRequest.getResourceType(), RESOURCETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(getNetworkTelemetryRequest.getResourceArn(), RESOURCEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(getNetworkTelemetryRequest.getMaxResults(), MAXRESULTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(getNetworkTelemetryRequest.getNextToken(), NEXTTOKEN_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>}
e.getMessage(), e);
1,083,716
public AuditLogModelDao map(final int index, final ResultSet r, final StatementContext ctx) throws SQLException {<NEW_LINE>final UUID id = getUUID(r, "id");<NEW_LINE>final String tableName = r.getString("table_name");<NEW_LINE>final long targetRecordId = r.getLong("target_record_id");<NEW_LINE>final String changeType = r.getString("change_type");<NEW_LINE>final DateTime createdDate = getDateTime(r, "created_date");<NEW_LINE>final String createdBy = r.getString("created_by");<NEW_LINE>final String <MASK><NEW_LINE>final String comments = r.getString("comments");<NEW_LINE>final UUID userToken = getUUID(r, "user_token");<NEW_LINE>final EntityAudit entityAudit = new EntityAudit(id, TableName.valueOf(tableName), targetRecordId, ChangeType.valueOf(changeType), createdDate);<NEW_LINE>// TODO - we have the tenant_record_id but not the tenant id here<NEW_LINE>final DefaultCallContext callContext = new DefaultCallContext(null, null, createdBy, createdDate, reasonCode, comments, userToken);<NEW_LINE>return new AuditLogModelDao(entityAudit, callContext);<NEW_LINE>}
reasonCode = r.getString("reason_code");
58,618
private static void appendLength(ByteBuffer buffer, int length, boolean masked) {<NEW_LINE>if (length < 0) {<NEW_LINE>throw new IllegalArgumentException("Length cannot be negative");<NEW_LINE>}<NEW_LINE>byte b = (masked ? (byte) 0x80 : 0x00);<NEW_LINE>if (length > 0xFFFF) {<NEW_LINE>buffer.put((byte) (b | 0x7F));<NEW_LINE>buffer.put((byte) 0x00);<NEW_LINE>buffer.put((byte) 0x00);<NEW_LINE>buffer.put((byte) 0x00);<NEW_LINE>buffer.put((byte) 0x00);<NEW_LINE>buffer.put((byte) ((length >> 24) & 0xFF));<NEW_LINE>buffer.put((byte) ((length >> 16) & 0xFF));<NEW_LINE>buffer.put((byte) ((length <MASK><NEW_LINE>buffer.put((byte) (length & 0xFF));<NEW_LINE>} else if (length >= 0x7E) {<NEW_LINE>buffer.put((byte) (b | 0x7E));<NEW_LINE>buffer.put((byte) (length >> 8));<NEW_LINE>buffer.put((byte) (length & 0xFF));<NEW_LINE>} else {<NEW_LINE>buffer.put((byte) (b | length));<NEW_LINE>}<NEW_LINE>}
>> 8) & 0xFF));
816,271
public void removeMarker(BlockPos pos) {<NEW_LINE>if (positions.getFirst().equals(pos)) {<NEW_LINE>positions.removeFirst();<NEW_LINE>loop = false;<NEW_LINE>if (positions.size() < 2) {<NEW_LINE>positions.clear();<NEW_LINE>}<NEW_LINE>subCache.refreshConnection(this);<NEW_LINE>} else if (positions.getLast().equals(pos)) {<NEW_LINE>positions.removeLast();<NEW_LINE>loop = false;<NEW_LINE>if (positions.size() < 2) {<NEW_LINE>positions.clear();<NEW_LINE>}<NEW_LINE>subCache.refreshConnection(this);<NEW_LINE>} else if (positions.contains(pos)) {<NEW_LINE>List<BlockPos> a = new ArrayList<>();<NEW_LINE>List<BlockPos> <MASK><NEW_LINE>boolean hasReached = false;<NEW_LINE>for (BlockPos p : positions) {<NEW_LINE>if (p.equals(pos)) {<NEW_LINE>hasReached = true;<NEW_LINE>} else if (hasReached) {<NEW_LINE>b.add(p);<NEW_LINE>} else {<NEW_LINE>a.add(p);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>loop = false;<NEW_LINE>PathConnection conA = new PathConnection(subCache);<NEW_LINE>PathConnection conB = new PathConnection(subCache);<NEW_LINE>conA.positions.addAll(a);<NEW_LINE>conB.positions.addAll(b);<NEW_LINE>positions.clear();<NEW_LINE>subCache.destroyConnection(this);<NEW_LINE>subCache.addConnection(conA);<NEW_LINE>subCache.addConnection(conB);<NEW_LINE>}<NEW_LINE>}
b = new ArrayList<>();
464,629
// snapshot callback<NEW_LINE>public void cloneWindow() {<NEW_LINE>DecompilerProvider newProvider = plugin.createNewDisconnectedProvider();<NEW_LINE>// invoke later to give the window manage a chance to create the new window<NEW_LINE>// (its done in an invoke later)<NEW_LINE>Swing.runLater(() -> {<NEW_LINE>ViewerPosition myViewPosition = controller<MASK><NEW_LINE>newProvider.doSetProgram(program);<NEW_LINE>// Any change in the HighlightTokens should be delivered to the new panel<NEW_LINE>DecompilerPanel myPanel = getDecompilerPanel();<NEW_LINE>newProvider.setLocation(currentLocation, myPanel.getViewerPosition());<NEW_LINE>// transfer any state after the new decompiler is initialized<NEW_LINE>DecompilerPanel newPanel = newProvider.getDecompilerPanel();<NEW_LINE>newProvider.doWheNotBusy(() -> {<NEW_LINE>newPanel.setViewerPosition(myViewPosition);<NEW_LINE>newPanel.cloneHighlights(myPanel);<NEW_LINE>});<NEW_LINE>});<NEW_LINE>}
.getDecompilerPanel().getViewerPosition();
655,385
void merge(int[][] tabs) {<NEW_LINE>int len = 0;<NEW_LINE>for (int i = 0; i < tabs.length; i++) {<NEW_LINE>len <MASK><NEW_LINE>}<NEW_LINE>this.base = new int[tabs.length];<NEW_LINE>this.check = new int[len];<NEW_LINE>this.tabMerged = new int[len];<NEW_LINE>Arrays.fill(this.base, -1);<NEW_LINE>Arrays.fill(this.check, -1);<NEW_LINE>Arrays.fill(this.tabMerged, this.holeValue);<NEW_LINE>int loc = 0;<NEW_LINE>for (int i = 0; i < tabs.length; i++) {<NEW_LINE>this.base[i] = loc;<NEW_LINE>for (int j = 1; j < tabs[i].length; j++) {<NEW_LINE>// index<NEW_LINE>int k = tabs[i][j++];<NEW_LINE>// value<NEW_LINE>this.tabMerged[k + loc] = tabs[i][j];<NEW_LINE>this.check[k + loc] = loc;<NEW_LINE>}<NEW_LINE>loc += tabs[i][0];<NEW_LINE>// supposing max compression<NEW_LINE>this.size += (tabs[i].length - 1) / 2;<NEW_LINE>}<NEW_LINE>}
+= tabs[i][0];
1,063,757
public ReduceableSearchResult reduce(Collection<Collector> collectors) throws IOException {<NEW_LINE>final Collection<Collector> <MASK><NEW_LINE>for (final Collector collector : collectors) {<NEW_LINE>if (collector instanceof MultiCollectorWrapper) {<NEW_LINE>subs.addAll(((MultiCollectorWrapper) collector).getCollectors());<NEW_LINE>} else {<NEW_LINE>subs.add(collector);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Collection<CollapseTopFieldDocs> topFieldDocs = new ArrayList<CollapseTopFieldDocs>();<NEW_LINE>float maxScore = Float.NaN;<NEW_LINE>for (final Collector collector : subs) {<NEW_LINE>if (collector instanceof CollapsingTopDocsCollector<?>) {<NEW_LINE>topFieldDocs.add(((CollapsingTopDocsCollector<?>) collector).getTopDocs());<NEW_LINE>} else if (collector instanceof MaxScoreCollector) {<NEW_LINE>float score = ((MaxScoreCollector) collector).getMaxScore();<NEW_LINE>if (Float.isNaN(maxScore)) {<NEW_LINE>maxScore = score;<NEW_LINE>} else {<NEW_LINE>maxScore = Math.max(maxScore, score);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return reduceWith(topFieldDocs, maxScore);<NEW_LINE>}
subs = new ArrayList<>();
1,130,294
public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@name('s0') select s1.* as s1 from SupportBean#length(3) as s0, " + "SupportMarketDataBean#keepall as s1";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>env.assertStatement("s0", statement -> {<NEW_LINE>EventType type = statement.getEventType();<NEW_LINE>assertEquals(SupportMarketDataBean.class, type.getPropertyType("s1"));<NEW_LINE>assertEquals(Map.class, type.getUnderlyingType());<NEW_LINE>});<NEW_LINE>sendBeanEvent(env, "E1");<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>Object eventOne = sendMarketEvent(env, "E1");<NEW_LINE>env.assertEventNew("s0", event -> assertSame(eventOne, <MASK><NEW_LINE>env.undeployAll();<NEW_LINE>// reverse streams<NEW_LINE>epl = "@name('s0') select s0.* as szero from SupportBean#length(3) as s0, " + "SupportMarketDataBean#keepall as s1";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>env.assertStatement("s0", statement -> {<NEW_LINE>EventType type = statement.getEventType();<NEW_LINE>assertEquals(SupportBean.class, type.getPropertyType("szero"));<NEW_LINE>assertEquals(Map.class, type.getUnderlyingType());<NEW_LINE>});<NEW_LINE>sendMarketEvent(env, "E1");<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>Object eventTwo = sendBeanEvent(env, "E1");<NEW_LINE>env.assertEventNew("s0", event -> assertSame(eventTwo, event.get("szero")));<NEW_LINE>env.undeployAll();<NEW_LINE>}
event.get("s1")));
1,057,616
private Mono<Response<Void>> deleteWithResponseAsync(String resourceGroupName, String integrationAccountName, String mapName, 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 (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (integrationAccountName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter integrationAccountName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (mapName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter mapName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, integrationAccountName, mapName, this.client.<MASK><NEW_LINE>}
getApiVersion(), accept, context);
1,716,687
public void retain(IndexSet indexSet) {<NEW_LINE>final Map<String, Set<String>> deflectorIndices = indexSet.getAllIndexAliases();<NEW_LINE>final int indexCount = (int) deflectorIndices.keySet().stream().filter(indexName -> !indices.isReopened(indexName)).count();<NEW_LINE>final Optional<Integer> maxIndices = getMaxNumberOfIndices(indexSet);<NEW_LINE>if (!maxIndices.isPresent()) {<NEW_LINE>LOG.warn("No retention strategy configuration found, not running index retention!");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Do we have more indices than the configured maximum?<NEW_LINE>if (indexCount <= maxIndices.get()) {<NEW_LINE>LOG.debug("Number of indices ({}) lower than limit ({}). Not performing any retention actions.", indexCount, maxIndices.get());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// We have more indices than the configured maximum! Remove as many as needed.<NEW_LINE>final int removeCount <MASK><NEW_LINE>final String msg = "Number of indices (" + indexCount + ") higher than limit (" + maxIndices.get() + "). " + "Running retention for " + removeCount + " indices.";<NEW_LINE>LOG.info(msg);<NEW_LINE>activityWriter.write(new Activity(msg, IndexRetentionThread.class));<NEW_LINE>runRetention(indexSet, deflectorIndices, removeCount);<NEW_LINE>}
= indexCount - maxIndices.get();
940,934
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {<NEW_LINE>HttpServletRequest req = (HttpServletRequest) request;<NEW_LINE>HttpServletResponse res = (HttpServletResponse) response;<NEW_LINE>String requestPath = req.getRequestURI();<NEW_LINE>String oldBasePath = null;<NEW_LINE>String newBasePath = null;<NEW_LINE>for (final String path : PATH_REDIRECTIONS_ARRAY) {<NEW_LINE>if (requestPath.startsWith(path)) {<NEW_LINE>oldBasePath = path;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (oldBasePath != null) {<NEW_LINE>newBasePath = PATH_REDIRECTIONS_MAP.get(oldBasePath);<NEW_LINE>String redirectURI = newBasePath + requestPath.substring(oldBasePath.length());<NEW_LINE>StringBuffer redirectURL = new StringBuffer(((HttpServletRequest) request).getRequestURL().toString().replaceFirst(oldBasePath, newBasePath));<NEW_LINE>String logPathEnding = oldBasePath.endsWith("/") ? "**" : "/**";<NEW_LINE>log.warn("Path {} is deprecated. Use path {} instead. Deprecated path will be removed in a future release", <MASK><NEW_LINE>chain.doFilter(new HttpServletRequestWrapper((HttpServletRequest) request) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getRequestURI() {<NEW_LINE>return redirectURI;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public StringBuffer getRequestURL() {<NEW_LINE>return redirectURL;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object getAttribute(String name) {<NEW_LINE>if (WebUtils.INCLUDE_SERVLET_PATH_ATTRIBUTE.equals(name))<NEW_LINE>return redirectURI;<NEW_LINE>return super.getAttribute(name);<NEW_LINE>}<NEW_LINE>}, response);<NEW_LINE>} else {<NEW_LINE>chain.doFilter(req, res);<NEW_LINE>}<NEW_LINE>}
oldBasePath + logPathEnding, newBasePath + logPathEnding);
997,517
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {<NEW_LINE>TriggerSmartContract.Builder build = TriggerSmartContract.newBuilder();<NEW_LINE>TransactionExtention.Builder trxExtBuilder = TransactionExtention.newBuilder();<NEW_LINE>Return.Builder retBuilder = Return.newBuilder();<NEW_LINE>boolean visible = false;<NEW_LINE>try {<NEW_LINE>String contract = request.getReader().lines().collect(Collectors.joining(System.lineSeparator()));<NEW_LINE>Util.checkBodySize(contract);<NEW_LINE>visible = Util.getVisiblePost(contract);<NEW_LINE>validateParameter(contract);<NEW_LINE>JsonFormat.merge(contract, build, visible);<NEW_LINE>JSONObject jsonObject = JSONObject.parseObject(contract);<NEW_LINE>boolean isFunctionSelectorSet = jsonObject.containsKey(functionSelector) && !StringUtil.isNullOrEmpty(jsonObject.getString(functionSelector));<NEW_LINE>String data;<NEW_LINE>if (isFunctionSelectorSet) {<NEW_LINE>String selector = jsonObject.getString(functionSelector);<NEW_LINE>String parameter = jsonObject.getString("parameter");<NEW_LINE>data = Util.parseMethod(selector, parameter);<NEW_LINE>build.setData(ByteString.copyFrom(ByteArray.fromHexString(data)));<NEW_LINE>} else {<NEW_LINE>build.setData(ByteString.copyFrom(new byte[0]));<NEW_LINE>}<NEW_LINE>long feeLimit = Util.getJsonLongValue(jsonObject, "fee_limit");<NEW_LINE>TransactionCapsule trxCap = wallet.createTransactionCapsule(build.build(), ContractType.TriggerSmartContract);<NEW_LINE>Transaction.Builder txBuilder = trxCap.getInstance().toBuilder();<NEW_LINE>Transaction.raw.Builder rawBuilder = trxCap.getInstance().getRawData().toBuilder();<NEW_LINE>rawBuilder.setFeeLimit(feeLimit);<NEW_LINE>txBuilder.setRawData(rawBuilder);<NEW_LINE>Transaction trx = wallet.triggerConstantContract(build.build(), new TransactionCapsule(txBuilder.build<MASK><NEW_LINE>trx = Util.setTransactionPermissionId(jsonObject, trx);<NEW_LINE>trx = Util.setTransactionExtraData(jsonObject, trx, visible);<NEW_LINE>trxExtBuilder.setTransaction(trx);<NEW_LINE>retBuilder.setResult(true).setCode(response_code.SUCCESS);<NEW_LINE>} catch (ContractValidateException e) {<NEW_LINE>retBuilder.setResult(false).setCode(response_code.CONTRACT_VALIDATE_ERROR).setMessage(ByteString.copyFromUtf8(e.getMessage()));<NEW_LINE>} catch (Exception e) {<NEW_LINE>String errString = null;<NEW_LINE>if (e.getMessage() != null) {<NEW_LINE>errString = e.getMessage().replaceAll("[\"]", "\'");<NEW_LINE>}<NEW_LINE>retBuilder.setResult(false).setCode(response_code.OTHER_ERROR).setMessage(ByteString.copyFromUtf8(e.getClass() + " : " + errString));<NEW_LINE>}<NEW_LINE>trxExtBuilder.setResult(retBuilder);<NEW_LINE>response.getWriter().println(Util.printTransactionExtention(trxExtBuilder.build(), visible));<NEW_LINE>}
()), trxExtBuilder, retBuilder);
880,244
// Test that testqueueCapacityRemaining is correct as tasks are queued, run, and the maxQueueSize value is changed.<NEW_LINE>@Test<NEW_LINE>public void testQueueCapacityRemaining() throws Exception {<NEW_LINE>PolicyExecutor executor = provider.create("testqueueCapacityRemaining").maxConcurrency(1).maxQueueSize(5);<NEW_LINE>CountDownLatch blockingBeginLatch = new CountDownLatch(1);<NEW_LINE>CountDownLatch blockingContinueLatch = new CountDownLatch(1);<NEW_LINE>CountDownLatch beginLatch = new CountDownLatch(1);<NEW_LINE>CountDownLatch continueLatch = new CountDownLatch(1);<NEW_LINE>// no tasks in queue<NEW_LINE>assertEquals(5, executor.queueCapacityRemaining());<NEW_LINE>CountDownTask blockingTask = new CountDownTask(blockingBeginLatch, blockingContinueLatch, TimeUnit.HOURS.toNanos(1));<NEW_LINE>// blockingTask should start and block on continueLatch<NEW_LINE>Future<Boolean> <MASK><NEW_LINE>assertTrue(blockingBeginLatch.await(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>// no tasks in queue, maxQueueSize=5<NEW_LINE>assertEquals(5, executor.queueCapacityRemaining());<NEW_LINE>CountDownTask task1 = new CountDownTask(beginLatch, continueLatch, TimeUnit.HOURS.toNanos(1));<NEW_LINE>// should queue<NEW_LINE>Future<Boolean> future1 = executor.submit(task1);<NEW_LINE>// task1 in queue, maxQueueSize=5<NEW_LINE>assertEquals(4, executor.queueCapacityRemaining());<NEW_LINE>executor.maxQueueSize(6);<NEW_LINE>// task 1 in queue, maxQueueSize=6<NEW_LINE>assertEquals(5, executor.queueCapacityRemaining());<NEW_LINE>executor.maxQueueSize(4);<NEW_LINE>// task1 in queue, maxQueueSize=4<NEW_LINE>assertEquals(3, executor.queueCapacityRemaining());<NEW_LINE>CountDownTask task2 = new CountDownTask(new CountDownLatch(1), new CountDownLatch(0), TimeUnit.HOURS.toNanos(1));<NEW_LINE>// should queue<NEW_LINE>Future<Boolean> future2 = executor.submit(task2);<NEW_LINE>// task1 and task2 in queue, maxQueueSize=4<NEW_LINE>assertEquals(2, executor.queueCapacityRemaining());<NEW_LINE>// allow blockingTask to complete<NEW_LINE>blockingContinueLatch.countDown();<NEW_LINE>// wait for task1 to begin running<NEW_LINE>assertTrue(beginLatch.await(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>// task2 in queue, maxQueueSize=4<NEW_LINE>assertEquals(3, executor.queueCapacityRemaining());<NEW_LINE>// allow task1 and task2 to complete<NEW_LINE>continueLatch.countDown();<NEW_LINE>assertTrue(blockingFuture.get(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>assertTrue(future1.get(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>assertTrue(future2.get(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>// no tasks in queue, maxQueueSize=4<NEW_LINE>assertEquals(4, executor.queueCapacityRemaining());<NEW_LINE>executor.shutdown();<NEW_LINE>// should return 0 after shutdown<NEW_LINE>assertEquals(0, executor.queueCapacityRemaining());<NEW_LINE>}
blockingFuture = executor.submit(blockingTask);
1,504,824
private int remove(@CheckForNull Object key, int hash) {<NEW_LINE><MASK><NEW_LINE>int next = table[tableIndex];<NEW_LINE>if (next == UNSET) {<NEW_LINE>// empty bucket<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>int last = UNSET;<NEW_LINE>do {<NEW_LINE>if (getHash(entries[next]) == hash) {<NEW_LINE>if (Objects.equal(key, keys[next])) {<NEW_LINE>int oldValue = values[next];<NEW_LINE>if (last == UNSET) {<NEW_LINE>// we need to update the root link from table[]<NEW_LINE>table[tableIndex] = getNext(entries[next]);<NEW_LINE>} else {<NEW_LINE>// we need to update the link from the chain<NEW_LINE>entries[last] = swapNext(entries[last], getNext(entries[next]));<NEW_LINE>}<NEW_LINE>moveLastEntry(next);<NEW_LINE>size--;<NEW_LINE>modCount++;<NEW_LINE>return oldValue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>last = next;<NEW_LINE>next = getNext(entries[next]);<NEW_LINE>} while (next != UNSET);<NEW_LINE>return 0;<NEW_LINE>}
int tableIndex = hash & hashTableMask();
820,621
private static boolean includeConstraint(SchemaReadCore schemaRead, ConstraintDescriptor constraint) {<NEW_LINE>// If constraint is index backed constraint following rules apply<NEW_LINE>// - Constraint must own index<NEW_LINE>// - Owned index must exist<NEW_LINE>// - Owned index must share name with constraint<NEW_LINE>// - Owned index must be online<NEW_LINE>// - Owned index must have this constraint as owning constraint<NEW_LINE>if (constraint.isIndexBackedConstraint()) {<NEW_LINE>IndexBackedConstraintDescriptor indexBackedConstraint = constraint.asIndexBackedConstraint();<NEW_LINE>if (indexBackedConstraint.indexType() == IndexType.BTREE && indexBackedConstraint.hasOwnedIndexId()) {<NEW_LINE>IndexDescriptor backingIndex = schemaRead.indexGetForName(constraint.getName());<NEW_LINE>if (backingIndex.getId() == indexBackedConstraint.ownedIndexId()) {<NEW_LINE>try {<NEW_LINE>InternalIndexState internalIndexState = schemaRead.indexGetState(backingIndex);<NEW_LINE>OptionalLong owningConstraintId = backingIndex.getOwningConstraintId();<NEW_LINE>return internalIndexState == InternalIndexState.ONLINE && owningConstraintId.orElse(-<MASK><NEW_LINE>} catch (IndexNotFoundKernelException e) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
1) == constraint.getId();
195,704
public Map<String, TasksAndEventsRepository.AppConfig> readPersistedTasks(SharedPreferences preferences) {<NEW_LINE>Map<String, TasksAndEventsRepository.AppConfig> result = new HashMap<>();<NEW_LINE>Map<String, ?> appScopeKeyToAppConfigsMap = preferences.getAll();<NEW_LINE>for (Map.Entry<String, ?> appScopeKeyToConfig : appScopeKeyToAppConfigsMap.entrySet()) {<NEW_LINE>Map<String, Object> appConfig = jsonToMap(appScopeKeyToConfig.getValue().toString());<NEW_LINE>String appUrl = (String) appConfig.get("appUrl");<NEW_LINE>Map<String, Object> tasksConfig = (HashMap<String, Object>) appConfig.get("tasks");<NEW_LINE>if (appUrl != null && tasksConfig != null && tasksConfig.size() > 0) {<NEW_LINE>Map<String, Object> tasksForApp = new HashMap<>();<NEW_LINE>for (String taskName : tasksConfig.keySet()) {<NEW_LINE>tasksForApp.put(taskName<MASK><NEW_LINE>}<NEW_LINE>TasksAndEventsRepository.AppConfig app = new TasksAndEventsRepository.AppConfig();<NEW_LINE>app.appUrl = appUrl;<NEW_LINE>app.tasks = tasksForApp;<NEW_LINE>result.put(appScopeKeyToConfig.getKey(), app);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
, tasksConfig.get(taskName));
311,210
// GEN-LAST:event_removeToken<NEW_LINE>@Messages({ "LBL_ProvidedTokens_T=Provided &Tokens:", "ACS_ProvidedTokensTitle=Required tokens panel", "ACS_LBL_ProvidedTokens=Required tokens", "ACS_CTL_ProvidedTokensVerticalScroll=Required tokens vertical scroll bar", "ACSD_CTL_ProvidedTokensVerticalScroll=Required tokens vertical scroll bar", "ACS_CTL_ProvidedTokensHorizontalScroll=Required tokens horizontal scroll bar", "ACSD_CTL_ProvidedTokensHorizontalScroll=Required tokens horizontal scroll bar", "LBL_ProvidedTokens_NoMnem=Provided Tokens:" })<NEW_LINE>private void addToken(java.awt.event.ActionEvent evt) {<NEW_LINE>// GEN-FIRST:event_addToken<NEW_LINE>// create add panel<NEW_LINE>JPanel panel = new JPanel();<NEW_LINE>panel.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));<NEW_LINE>panel.setLayout(new BorderLayout(0, 2));<NEW_LINE>JList tokenList = new JList(getProperties().getAllTokens());<NEW_LINE>JScrollPane tokenListSP = new JScrollPane(tokenList);<NEW_LINE>JLabel provTokensTxt = new JLabel();<NEW_LINE>provTokensTxt.setLabelFor(tokenList);<NEW_LINE>Mnemonics.setLocalizedText(provTokensTxt, LBL_ProvidedTokens_T());<NEW_LINE>panel.getAccessibleContext().setAccessibleDescription(ACS_ProvidedTokensTitle());<NEW_LINE>tokenList.getAccessibleContext().setAccessibleDescription(ACS_LBL_ProvidedTokens());<NEW_LINE>tokenListSP.getVerticalScrollBar().getAccessibleContext().setAccessibleName(ACS_CTL_ProvidedTokensVerticalScroll());<NEW_LINE>tokenListSP.getVerticalScrollBar().getAccessibleContext().setAccessibleDescription(ACSD_CTL_ProvidedTokensVerticalScroll());<NEW_LINE>tokenListSP.getHorizontalScrollBar().getAccessibleContext().setAccessibleName(ACS_CTL_ProvidedTokensHorizontalScroll());<NEW_LINE>tokenListSP.getHorizontalScrollBar().getAccessibleContext().setAccessibleDescription(ACSD_CTL_ProvidedTokensHorizontalScroll());<NEW_LINE>panel.add(provTokensTxt, BorderLayout.NORTH);<NEW_LINE>panel.add(tokenListSP, BorderLayout.CENTER);<NEW_LINE>DialogDescriptor descriptor = new DialogDescriptor(panel, LBL_ProvidedTokens_NoMnem());<NEW_LINE>Dialog d = DialogDisplayer.getDefault().createDialog(descriptor);<NEW_LINE>d.setVisible(true);<NEW_LINE>d.dispose();<NEW_LINE>if (descriptor.getValue().equals(DialogDescriptor.OK_OPTION)) {<NEW_LINE>Object[] selected = tokenList.getSelectedValues();<NEW_LINE>CustomizerComponentFactory.RequiredTokenListModel model = (CustomizerComponentFactory.RequiredTokenListModel) reqTokenList.getModel();<NEW_LINE>for (int i = 0; i < selected.length; i++) {<NEW_LINE>model.addToken((String) selected[i]);<NEW_LINE>}<NEW_LINE>if (selected.length > 0) {<NEW_LINE>reqTokenList.clearSelection();<NEW_LINE>reqTokenList.setSelectedValue<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>reqTokenList.requestFocusInWindow();<NEW_LINE>}
(selected[0], true);
1,177,137
public boolean insertBranchTransactionDO(BranchTransactionDO branchTransactionDO) {<NEW_LINE>String sql = LogStoreSqlsFactory.getLogStoreSqls(dbType).getInsertBranchTransactionSQL(branchTable);<NEW_LINE>Connection conn = null;<NEW_LINE>PreparedStatement ps = null;<NEW_LINE>try {<NEW_LINE>int index = 1;<NEW_LINE>conn = logStoreDataSource.getConnection();<NEW_LINE>conn.setAutoCommit(true);<NEW_LINE>ps = conn.prepareStatement(sql);<NEW_LINE>ps.setString(index++, branchTransactionDO.getXid());<NEW_LINE>ps.setLong(index++, branchTransactionDO.getTransactionId());<NEW_LINE>ps.setLong(index++, branchTransactionDO.getBranchId());<NEW_LINE>ps.setString(index<MASK><NEW_LINE>ps.setString(index++, branchTransactionDO.getResourceId());<NEW_LINE>ps.setString(index++, branchTransactionDO.getBranchType());<NEW_LINE>ps.setInt(index++, branchTransactionDO.getStatus());<NEW_LINE>ps.setString(index++, branchTransactionDO.getClientId());<NEW_LINE>ps.setString(index++, branchTransactionDO.getApplicationData());<NEW_LINE>return ps.executeUpdate() > 0;<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new StoreException(e);<NEW_LINE>} finally {<NEW_LINE>IOUtil.close(ps, conn);<NEW_LINE>}<NEW_LINE>}
++, branchTransactionDO.getResourceGroupId());
1,275,077
public static IMapEvent createIMapEvent(EventData eventData, EventFilter filter, Member member, SerializationService serializationService) {<NEW_LINE>String source = eventData.getSource();<NEW_LINE>int eventType = eventData.getEventType();<NEW_LINE>if (eventType == EventLostEvent.EVENT_TYPE) {<NEW_LINE>LocalEntryEventData localEventData = (LocalEntryEventData) eventData;<NEW_LINE>int partitionId = localEventData.getPartitionId();<NEW_LINE>return new EventLostEvent(source, null, partitionId);<NEW_LINE>}<NEW_LINE>if (eventType == EntryEventType.CLEAR_ALL.getType() || eventType == EntryEventType.EVICT_ALL.getType()) {<NEW_LINE>LocalCacheWideEventData localCacheWideEventData = (LocalCacheWideEventData) eventData;<NEW_LINE>int numberOfEntriesAffected = localCacheWideEventData.getNumberOfEntriesAffected();<NEW_LINE>return new MapEvent(source, null, eventType, numberOfEntriesAffected);<NEW_LINE>}<NEW_LINE>LocalEntryEventData localEntryEventData = (LocalEntryEventData) eventData;<NEW_LINE>Data dataKey = localEntryEventData.getKeyData();<NEW_LINE>Data dataNewValue = localEntryEventData.getValueData();<NEW_LINE><MASK><NEW_LINE>boolean includeValue = isIncludeValue(filter);<NEW_LINE>return new DataAwareEntryEvent(member, eventType, source, dataKey, (includeValue ? dataNewValue : null), (includeValue ? dataOldValue : null), null, serializationService);<NEW_LINE>}
Data dataOldValue = localEntryEventData.getOldValueData();
37,279
private static String copyNativeLibraryFromClasspath(Platform platform) {<NEW_LINE>Path tmp = null;<NEW_LINE>try {<NEW_LINE>String libName = System.mapLibraryName(NATIVE_LIB_NAME);<NEW_LINE>Path cacheDir = getCacheDir(platform);<NEW_LINE>Path <MASK><NEW_LINE>if (Files.exists(path)) {<NEW_LINE>return path.toAbsolutePath().toString();<NEW_LINE>}<NEW_LINE>Path dlrCacheRoot = Utils.getEngineCacheDir("dlr");<NEW_LINE>Files.createDirectories(dlrCacheRoot);<NEW_LINE>tmp = Files.createTempDirectory(dlrCacheRoot, "tmp");<NEW_LINE>for (String file : platform.getLibraries()) {<NEW_LINE>String libPath = "native/lib/" + file;<NEW_LINE>logger.info("Extracting {} to cache ...", libPath);<NEW_LINE>try (InputStream is = ClassLoaderUtils.getResourceAsStream(libPath)) {<NEW_LINE>Files.copy(is, tmp.resolve(file), StandardCopyOption.REPLACE_EXISTING);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Utils.moveQuietly(tmp, cacheDir);<NEW_LINE>return path.toAbsolutePath().toString();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new IllegalStateException("Failed to extract DLR native library", e);<NEW_LINE>} finally {<NEW_LINE>if (tmp != null) {<NEW_LINE>Utils.deleteQuietly(tmp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
path = cacheDir.resolve(libName);
50,585
public Object hash(DataCommandsParam dataCommandsParam) {<NEW_LINE>AutoCommandResult autoCommandResult = new AutoCommandResult();<NEW_LINE>String command = dataCommandsParam.getCommand();<NEW_LINE>String[] <MASK><NEW_LINE>String cmd = command.toUpperCase();<NEW_LINE>String key = list[1];<NEW_LINE>String type = type(key);<NEW_LINE>long ttl = ttl(key);<NEW_LINE>Object result = null;<NEW_LINE>if (cmd.startsWith(HGETALL)) {<NEW_LINE>result = jedisCluster.hgetAll(key);<NEW_LINE>} else if (cmd.startsWith(HGET)) {<NEW_LINE>result = jedisCluster.hget(key, list[2]);<NEW_LINE>} else if (cmd.startsWith(HMGET)) {<NEW_LINE>String[] items = removeCommandAndKey(list);<NEW_LINE>result = jedisCluster.hmget(key, items);<NEW_LINE>} else if (cmd.startsWith(HKEYS)) {<NEW_LINE>result = jedisCluster.hkeys(key);<NEW_LINE>} else if (cmd.startsWith(HSET)) {<NEW_LINE>Map<String, String> hash = new HashMap<>();<NEW_LINE>String[] items = removeCommandAndKey(list);<NEW_LINE>for (int i = 0; i < items.length; i += 2) {<NEW_LINE>String subKey = items[i];<NEW_LINE>if (!Strings.isNullOrEmpty(subKey)) {<NEW_LINE>hash.put(subKey, items[i + 1]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result = jedisCluster.hset(key, hash);<NEW_LINE>}<NEW_LINE>autoCommandResult.setTtl(ttl);<NEW_LINE>autoCommandResult.setType(type);<NEW_LINE>autoCommandResult.setValue(result);<NEW_LINE>return autoCommandResult;<NEW_LINE>}
list = SignUtil.splitBySpace(command);
1,067,926
public Iterator<Tuple2<TupleTag<?>, WindowedValue<?>>> call(Iterator<WindowedValue<InputT>> iter) throws Exception {<NEW_LINE>if (!wasSetupCalled && iter.hasNext()) {<NEW_LINE>DoFnInvokers.tryInvokeSetupFor(doFn, options.get());<NEW_LINE>wasSetupCalled = true;<NEW_LINE>}<NEW_LINE>DoFnOutputManager outputManager = new DoFnOutputManager();<NEW_LINE>final InMemoryTimerInternals timerInternals;<NEW_LINE>final StepContext context;<NEW_LINE>// Now only implements the StatefulParDo in Batch mode.<NEW_LINE>Object key = null;<NEW_LINE>if (stateful) {<NEW_LINE>if (iter.hasNext()) {<NEW_LINE>WindowedValue<InputT> currentValue = iter.next();<NEW_LINE>key = ((KV) currentValue.getValue()).getKey();<NEW_LINE>iter = Iterators.concat(Iterators.singletonIterator(currentValue), iter);<NEW_LINE>}<NEW_LINE>final InMemoryStateInternals<?> <MASK><NEW_LINE>timerInternals = new InMemoryTimerInternals();<NEW_LINE>context = new StepContext() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public StateInternals stateInternals() {<NEW_LINE>return stateInternals;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public TimerInternals timerInternals() {<NEW_LINE>return timerInternals;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} else {<NEW_LINE>timerInternals = null;<NEW_LINE>context = new SparkProcessContext.NoOpStepContext();<NEW_LINE>}<NEW_LINE>final DoFnRunner<InputT, OutputT> doFnRunner = DoFnRunners.simpleRunner(options.get(), doFn, CachedSideInputReader.of(new SparkSideInputReader(sideInputs)), outputManager, mainOutputTag, additionalOutputTags, context, inputCoder, outputCoders, windowingStrategy, doFnSchemaInformation, sideInputMapping);<NEW_LINE>DoFnRunnerWithMetrics<InputT, OutputT> doFnRunnerWithMetrics = new DoFnRunnerWithMetrics<>(stepName, doFnRunner, metricsAccum);<NEW_LINE>return new SparkProcessContext<>(doFn, doFnRunnerWithMetrics, outputManager, key, stateful ? new TimerDataIterator(timerInternals) : Collections.emptyIterator()).processPartition(iter).iterator();<NEW_LINE>}
stateInternals = InMemoryStateInternals.forKey(key);
434,964
public static void proxyHibernatePersistence(CtClass clazz) throws Exception {<NEW_LINE>LOGGER.debug("Override org.hibernate.ejb.HibernatePersistence#createContainerEntityManagerFactory and createEntityManagerFactory to create a EntityManagerFactoryProxy proxy.");<NEW_LINE>CtMethod oldMethod = clazz.getDeclaredMethod("createContainerEntityManagerFactory");<NEW_LINE>oldMethod.setName("$$ha$createContainerEntityManagerFactory" + clazz.getSimpleName());<NEW_LINE>CtMethod newMethod = CtNewMethod.make("public javax.persistence.EntityManagerFactory createContainerEntityManagerFactory(" + " javax.persistence.spi.PersistenceUnitInfo info, java.util.Map properties) {" + " properties.put(\"PERSISTENCE_CLASS_NAME\", \"" + clazz.getName() + "\");" + " return " + HibernatePersistenceHelper.class.getName() + ".createContainerEntityManagerFactoryProxy(" + " this, info, properties, $$ha$createContainerEntityManagerFactory" + clazz.getSimpleName() + "(info, properties)); " + "}", clazz);<NEW_LINE>clazz.addMethod(newMethod);<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>oldMethod.setName("$$ha$createEntityManagerFactory" + clazz.getSimpleName());<NEW_LINE>newMethod = CtNewMethod.make("public javax.persistence.EntityManagerFactory createEntityManagerFactory(" + " String persistenceUnitName, java.util.Map properties) {" + " return " + HibernatePersistenceHelper.class.getName() + ".createEntityManagerFactoryProxy(" + " this, persistenceUnitName, properties, $$ha$createEntityManagerFactory" + clazz.getSimpleName() + "(persistenceUnitName, properties)); " + "}", clazz);<NEW_LINE>clazz.addMethod(newMethod);<NEW_LINE>} catch (NotFoundException e) {<NEW_LINE>LOGGER.trace("Method createEntityManagerFactory not found on " + clazz.getName() + ". Is Ok for Spring implementation...", e);<NEW_LINE>}<NEW_LINE>}
oldMethod = clazz.getDeclaredMethod("createEntityManagerFactory");
857,380
public Object evaluateRecord(final OIdentifiable iRecord, ODocument iCurrentResult, final OSQLFilterCondition iCondition, Object iLeft, Object iRight, OCommandContext iContext, final ODocumentSerializer serializer) {<NEW_LINE>if (iRight == null || iLeft == null)<NEW_LINE>return null;<NEW_LINE>if (iLeft instanceof Date)<NEW_LINE>iLeft = ((Date) iLeft).getTime();<NEW_LINE>if (iRight instanceof Date)<NEW_LINE>iRight = ((Date) iRight).getTime();<NEW_LINE>if (iLeft instanceof Number && iRight instanceof Number) {<NEW_LINE>final Number l = (Number) iLeft;<NEW_LINE>final Number r = (Number) iRight;<NEW_LINE>Class maxPrecisionClass = getMaxPrecisionClass(l, r);<NEW_LINE>if (Integer.class.equals(maxPrecisionClass))<NEW_LINE>return tryDownscaleToInt(l.longValue() * r.longValue());<NEW_LINE>else if (Long.class.equals(maxPrecisionClass))<NEW_LINE>return l.longValue() * r.longValue();<NEW_LINE>else if (Short.class.equals(maxPrecisionClass))<NEW_LINE>return l.shortValue() * r.shortValue();<NEW_LINE>else if (Float.class.equals(maxPrecisionClass))<NEW_LINE>return l.floatValue<MASK><NEW_LINE>else if (Double.class.equals(maxPrecisionClass))<NEW_LINE>return l.doubleValue() * r.doubleValue();<NEW_LINE>else if (BigDecimal.class.equals(maxPrecisionClass)) {<NEW_LINE>return (toBigDecimal(l)).multiply(toBigDecimal(r));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
() * r.floatValue();
305,884
private void mergeIfNeeded(Text first, Text last, int textLength) {<NEW_LINE>if (first != null && last != null && first != last) {<NEW_LINE>StringBuilder sb = new StringBuilder(textLength);<NEW_LINE>sb.append(first.getLiteral());<NEW_LINE>SourceSpans sourceSpans = null;<NEW_LINE>if (includeSourceSpans) {<NEW_LINE>sourceSpans = new SourceSpans();<NEW_LINE>sourceSpans.<MASK><NEW_LINE>}<NEW_LINE>Node node = first.getNext();<NEW_LINE>Node stop = last.getNext();<NEW_LINE>while (node != stop) {<NEW_LINE>sb.append(((Text) node).getLiteral());<NEW_LINE>if (sourceSpans != null) {<NEW_LINE>sourceSpans.addAll(node.getSourceSpans());<NEW_LINE>}<NEW_LINE>Node unlink = node;<NEW_LINE>node = node.getNext();<NEW_LINE>unlink.unlink();<NEW_LINE>}<NEW_LINE>String literal = sb.toString();<NEW_LINE>first.setLiteral(literal);<NEW_LINE>if (sourceSpans != null) {<NEW_LINE>first.setSourceSpans(sourceSpans.getSourceSpans());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
addAll(first.getSourceSpans());
772,341
private void _createCoreImageAfterParseError(Exception e) {<NEW_LINE>Builder builder = null;<NEW_LINE>if (_stream == null) {<NEW_LINE>// extract directly from the file<NEW_LINE>builder = new Builder(_coreFile, _reader, 0, _fileResolvingAgent);<NEW_LINE>} else {<NEW_LINE>// extract using the data stream<NEW_LINE>builder = new Builder(_coreFile, _stream, 0, _fileResolvingAgent);<NEW_LINE>}<NEW_LINE>_coreFile.extract(builder);<NEW_LINE>String osType = builder.getOSType();<NEW_LINE>String cpuType = builder.getCPUType();<NEW_LINE>String cpuSubType = builder.getCPUSubType();<NEW_LINE><MASK><NEW_LINE>_coreImage = new Image(osType, null, cpuType, cpuSubType, 0, 0, creationTime);<NEW_LINE>Iterator spaces = builder.getAddressSpaces();<NEW_LINE>while (spaces.hasNext()) {<NEW_LINE>ImageAddressSpace addressSpace = (ImageAddressSpace) spaces.next();<NEW_LINE>// Set all processes as having invalid runtimes<NEW_LINE>for (Iterator processes = addressSpace.getProcesses(); processes.hasNext(); ) {<NEW_LINE>ImageProcess process = (ImageProcess) processes.next();<NEW_LINE>process.runtimeExtractionFailed(e);<NEW_LINE>}<NEW_LINE>_coreImage.addAddressSpace(addressSpace);<NEW_LINE>}<NEW_LINE>}
long creationTime = builder.getCreationTime();
1,145,741
public static String requestWTSSWithSSOPost(String url, Map<String, String> params, AppIntegrationService<SSORequestService> service, Workspace workspace) throws Exception {<NEW_LINE>try {<NEW_LINE>FlowScheduleAction flowScheduleAction = new FlowScheduleAction();<NEW_LINE>flowScheduleAction.getFormParams().putAll(params);<NEW_LINE>SSOUrlBuilderOperation ssoUrlBuilderOperation = workspace.getSSOUrlBuilderOperation().copy();<NEW_LINE>ssoUrlBuilderOperation.setAppName(SCHEDULIS_APPCONN_NAME);<NEW_LINE>ssoUrlBuilderOperation.setReqUrl(url);<NEW_LINE>ssoUrlBuilderOperation.setWorkspace(workspace.getWorkspaceName());<NEW_LINE>flowScheduleAction.<MASK><NEW_LINE>SSORequestOperation<HttpAction, HttpResult> ssoRequestOperation = service.getSSORequestService().createSSORequestOperation(SCHEDULIS_APPCONN_NAME);<NEW_LINE>HttpResult previewResult = ssoRequestOperation.requestWithSSO(ssoUrlBuilderOperation, flowScheduleAction);<NEW_LINE>if (previewResult.getStatusCode() == 200 || previewResult.getStatusCode() == 0) {<NEW_LINE>String response = previewResult.getResponseBody();<NEW_LINE>return response;<NEW_LINE>} else {<NEW_LINE>throw new ExternalOperationFailedException(50063, "User sso request failed:" + url);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("requestWTSSPostError-->", e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}
setURL(ssoUrlBuilderOperation.getBuiltUrl());
558,882
private JSType evalMapunion(Node ttlAst, NameResolver nameResolver) {<NEW_LINE>ImmutableList<Node> params = getCallParams(ttlAst);<NEW_LINE>Node unionParam = params.get(0);<NEW_LINE>Node mapFunction = params.get(1);<NEW_LINE>String paramName = getFunctionParameter(mapFunction, 0);<NEW_LINE>// The mapunion variable must not be defined in the environment<NEW_LINE>if (nameResolver.typeVars.containsKey(paramName)) {<NEW_LINE>reportWarning(ttlAst, DUPLICATE_VARIABLE, paramName);<NEW_LINE>return getUnknownType();<NEW_LINE>}<NEW_LINE>Node mapFunctionBody = NodeUtil.getFunctionBody(mapFunction);<NEW_LINE>JSType unionType = evalInternal(unionParam, nameResolver);<NEW_LINE>// If the first parameter does not correspond to a union type then<NEW_LINE>// consider it as a union with a single type and evaluate<NEW_LINE>if (!unionType.isUnionType()) {<NEW_LINE>NameResolver newNameResolver = new NameResolver(addNewEntry(nameResolver.typeVars, paramName, unionType), nameResolver.nameVars);<NEW_LINE>return evalInternal(mapFunctionBody, newNameResolver);<NEW_LINE>}<NEW_LINE>// Otherwise obtain the elements in the union type. Note that the block<NEW_LINE>// above guarantees the casting to be safe<NEW_LINE>Collection<JSType> unionElms = ImmutableList.copyOf(unionType.getUnionMembers());<NEW_LINE>// Evaluate the map function body using each element in the union type<NEW_LINE>int unionSize = unionElms.size();<NEW_LINE>JSType[] newUnionElms = new JSType[unionSize];<NEW_LINE>int i = 0;<NEW_LINE>for (JSType elm : unionElms) {<NEW_LINE>NameResolver newNameResolver = new NameResolver(addNewEntry(nameResolver.typeVars, paramName<MASK><NEW_LINE>newUnionElms[i] = evalInternal(mapFunctionBody, newNameResolver);<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>return createUnionType(newUnionElms);<NEW_LINE>}
, elm), nameResolver.nameVars);
749,271
public GetMemberResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetMemberResult getMemberResult = new GetMemberResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getMemberResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("member", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getMemberResult.setMember(MemberJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getMemberResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
553,519
protected void handleMessage(JsonNode message) {<NEW_LINE>if (message.isArray()) {<NEW_LINE>if (message.size() < 3) {<NEW_LINE>if (message.get(0).asText().equals(HEARTBEAT))<NEW_LINE>return;<NEW_LINE>else if ("1002".equals(message.get(0).asText()))<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int channelId = Integer.parseInt(message.get(0).toString());<NEW_LINE>if (channelId > 0 && channelId < 1000) {<NEW_LINE>JsonNode events = message.get(2);<NEW_LINE>if (events != null && events.isArray()) {<NEW_LINE>JsonNode event = events.get(0);<NEW_LINE>if (event.get(0).toString().equals("\"i\"")) {<NEW_LINE>if (event.get(1).has("orderBook")) {<NEW_LINE>subscribedChannels.compute(String.valueOf(channelId), (key, oldValue) -> {<NEW_LINE>String currencyPair = event.get(1).get("currencyPair").asText();<NEW_LINE>if (oldValue != null && !oldValue.equals(currencyPair)) {<NEW_LINE>throw new RuntimeException("Attempted currency pair channel id reassignment");<NEW_LINE>}<NEW_LINE>if (oldValue == null) {<NEW_LINE>LOG.info("Register {} as {}", channelId, currencyPair);<NEW_LINE>} else {<NEW_LINE>LOG.debug("Order book reinitialization {} {}", channelId, currencyPair);<NEW_LINE>}<NEW_LINE>return currencyPair;<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (message.has("error")) {<NEW_LINE>LOG.error("Error with message: " + message.get<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>super.handleMessage(message);<NEW_LINE>}
("error").asText());
1,287,614
public FormInfo execute(CommandContext commandContext) {<NEW_LINE>CmmnEngineConfiguration cmmnEngineConfiguration = CommandContextUtil.getCmmnEngineConfiguration(commandContext);<NEW_LINE>FormService formService = CommandContextUtil.getFormService(commandContext);<NEW_LINE>if (formService == null) {<NEW_LINE>throw new FlowableIllegalArgumentException("Form engine is not initialized");<NEW_LINE>}<NEW_LINE>FormInfo formInfo = null;<NEW_LINE>CaseDefinition caseDefinition = CaseDefinitionUtil.getCaseDefinition(caseDefinitionId);<NEW_LINE>CmmnModel cmmnModel = CaseDefinitionUtil.getCmmnModel(caseDefinitionId);<NEW_LINE>Case caseModel = cmmnModel.getCaseById(caseDefinition.getKey());<NEW_LINE><MASK><NEW_LINE>if (StringUtils.isNotEmpty(planModel.getFormKey())) {<NEW_LINE>CmmnDeployment deployment = CommandContextUtil.getCmmnDeploymentEntityManager(commandContext).findById(caseDefinition.getDeploymentId());<NEW_LINE>formInfo = formService.getFormInstanceModelByKeyAndParentDeploymentIdAndScopeId(planModel.getFormKey(), deployment.getParentDeploymentId(), caseInstanceId, ScopeTypes.CMMN, null, caseDefinition.getTenantId(), cmmnEngineConfiguration.isFallbackToDefaultTenant());<NEW_LINE>}<NEW_LINE>// If form does not exists, we don't want to leak out this info to just anyone<NEW_LINE>if (formInfo == null) {<NEW_LINE>throw new FlowableObjectNotFoundException("Form model for case definition " + caseDefinitionId + " cannot be found");<NEW_LINE>}<NEW_LINE>FormFieldHandler formFieldHandler = cmmnEngineConfiguration.getFormFieldHandler();<NEW_LINE>formFieldHandler.enrichFormFields(formInfo);<NEW_LINE>return formInfo;<NEW_LINE>}
Stage planModel = caseModel.getPlanModel();
714,102
private void openSession() throws SQLException {<NEW_LINE>TSOpenSessionReq openReq = new TSOpenSessionReq();<NEW_LINE>openReq.setUsername(params.getUsername());<NEW_LINE>openReq.setPassword(params.getPassword());<NEW_LINE>openReq.setZoneId(getTimeZone());<NEW_LINE>openReq.putToConfiguration("version", params.getVersion().toString());<NEW_LINE>TSOpenSessionResp openResp = null;<NEW_LINE>try {<NEW_LINE>openResp = client.openSession(openReq);<NEW_LINE>sessionId = openResp.getSessionId();<NEW_LINE>// validate connection<NEW_LINE>RpcUtils.verifySuccess(openResp.getStatus());<NEW_LINE>if (protocolVersion.getValue() != openResp.getServerProtocolVersion().getValue()) {<NEW_LINE>logger.warn("Protocol differ, Client version is {}}, but Server version is {}", protocolVersion.getValue(), openResp.getServerProtocolVersion().getValue());<NEW_LINE>if (openResp.getServerProtocolVersion().getValue() == 0) {<NEW_LINE>// less than 0.10<NEW_LINE>throw new TException(String.format("Protocol not supported, Client version is %s, but Server version is %s", protocolVersion.getValue(), openResp.getServerProtocolVersion().getValue()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (TException e) {<NEW_LINE>transport.close();<NEW_LINE>if (e.getMessage().contains("Required field 'client_protocol' was not present!")) {<NEW_LINE>// the server is an old version (less than 0.10)<NEW_LINE>throw new SQLException(String.format("Can not establish connection with %s : You may try to connect an old version IoTDB instance using a client with new version: %s. ", params.getJdbcUriString(), e.getMessage()), e);<NEW_LINE>}<NEW_LINE>throw new SQLException(String.format("Can not establish connection with %s : %s. ", params.getJdbcUriString(), e<MASK><NEW_LINE>} catch (StatementExecutionException e) {<NEW_LINE>// failed to connect, disconnect from the server<NEW_LINE>transport.close();<NEW_LINE>throw new IoTDBSQLException(e.getMessage(), openResp.getStatus());<NEW_LINE>}<NEW_LINE>isClosed = false;<NEW_LINE>}
.getMessage()), e);
1,849,781
private static TypeArgument parse(final Parser parser, final String definingClassName) throws ParseException {<NEW_LINE>final char peek = parser.peek();<NEW_LINE>if (peek == '*') {<NEW_LINE>parser.expect('*');<NEW_LINE>return new TypeArgument(Wildcard.ANY, null);<NEW_LINE>} else if (peek == '+') {<NEW_LINE>parser.expect('+');<NEW_LINE>final ReferenceTypeSignature typeSignature = ReferenceTypeSignature.parseReferenceTypeSignature(parser, definingClassName);<NEW_LINE>if (typeSignature == null) {<NEW_LINE>throw new ParseException(parser, "Missing '+' type bound");<NEW_LINE>}<NEW_LINE>return new TypeArgument(Wildcard.EXTENDS, typeSignature);<NEW_LINE>} else if (peek == '-') {<NEW_LINE>parser.expect('-');<NEW_LINE>final ReferenceTypeSignature typeSignature = ReferenceTypeSignature.parseReferenceTypeSignature(parser, definingClassName);<NEW_LINE>if (typeSignature == null) {<NEW_LINE>throw new ParseException(parser, "Missing '-' type bound");<NEW_LINE>}<NEW_LINE>return new <MASK><NEW_LINE>} else {<NEW_LINE>final ReferenceTypeSignature typeSignature = ReferenceTypeSignature.parseReferenceTypeSignature(parser, definingClassName);<NEW_LINE>if (typeSignature == null) {<NEW_LINE>throw new ParseException(parser, "Missing type bound");<NEW_LINE>}<NEW_LINE>return new TypeArgument(Wildcard.NONE, typeSignature);<NEW_LINE>}<NEW_LINE>}
TypeArgument(Wildcard.SUPER, typeSignature);
915,515
public OutlierResult run(Relation<O> relation) {<NEW_LINE>QueryBuilder<O> qb = new QueryBuilder<>(relation, distance);<NEW_LINE>KNNSearcher<DBIDRef> knnQuery = qb.kNNByDBID(kplus);<NEW_LINE>DistanceQuery<O> distFunc = qb.distanceQuery();<NEW_LINE>// track the maximum value for normalization<NEW_LINE>DoubleMinMax ldofminmax = new DoubleMinMax();<NEW_LINE>// compute the ldof values<NEW_LINE>WritableDoubleDataStore ldofs = DataStoreUtil.makeDoubleStorage(relation.getDBIDs(), DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP);<NEW_LINE>// compute LOF_SCORE of each db object<NEW_LINE>if (LOG.isVerbose()) {<NEW_LINE>LOG.verbose("Computing LDOFs");<NEW_LINE>}<NEW_LINE>FiniteProgress progressLDOFs = LOG.isVerbose() ? new FiniteProgress("LDOF for objects", relation.size(), LOG) : null;<NEW_LINE>Mean dxp = new Mean(), Dxp = new Mean();<NEW_LINE>for (DBIDIter iditer = relation.iterDBIDs(); iditer.valid(); iditer.advance()) {<NEW_LINE>KNNList neighbors = knnQuery.getKNN(iditer, kplus);<NEW_LINE>dxp.reset();<NEW_LINE>Dxp.reset();<NEW_LINE>DoubleDBIDListIter neighbor1 = neighbors.iter(), neighbor2 = neighbors.iter();<NEW_LINE>for (; neighbor1.valid(); neighbor1.advance()) {<NEW_LINE>// skip the point itself<NEW_LINE>if (DBIDUtil.equal(neighbor1, iditer)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>dxp.put(neighbor1.doubleValue());<NEW_LINE>for (neighbor2.seek(neighbor1.getOffset() + 1); neighbor2.valid(); neighbor2.advance()) {<NEW_LINE>// skip the point itself<NEW_LINE>if (DBIDUtil.equal(neighbor2, iditer)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Dxp.put(distFunc.distance(neighbor1, neighbor2));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>double ldof = dxp.getMean() / Dxp.getMean();<NEW_LINE>if (Double.isNaN(ldof) || Double.isInfinite(ldof)) {<NEW_LINE>ldof = 1.0;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>// update maximum<NEW_LINE>ldofminmax.put(ldof);<NEW_LINE>LOG.incrementProcessed(progressLDOFs);<NEW_LINE>}<NEW_LINE>LOG.ensureCompleted(progressLDOFs);<NEW_LINE>// Build result representation.<NEW_LINE>DoubleRelation scoreResult = new MaterializedDoubleRelation("LDOF Outlier Score", relation.getDBIDs(), ldofs);<NEW_LINE>OutlierScoreMeta scoreMeta = new QuotientOutlierScoreMeta(ldofminmax.getMin(), ldofminmax.getMax(), 0.0, Double.POSITIVE_INFINITY, LDOF_BASELINE);<NEW_LINE>return new OutlierResult(scoreMeta, scoreResult);<NEW_LINE>}
ldofs.putDouble(iditer, ldof);
849,111
public int[] batchUpdate(List<? extends Model> modelList, int batchSize) {<NEW_LINE>if (modelList == null || modelList.size() == 0)<NEW_LINE>return new int[0];<NEW_LINE>Model model = modelList.get(0);<NEW_LINE>Table table = TableMapping.me().getTable(model.getClass());<NEW_LINE>String[] pKeys = table.getPrimaryKey();<NEW_LINE>Map<String, Object> attrs = model._getAttrs();<NEW_LINE>List<String> attrNames <MASK><NEW_LINE>// the same as the iterator in Dialect.forModelSave() to ensure the order of the attrs<NEW_LINE>for (Entry<String, Object> e : attrs.entrySet()) {<NEW_LINE>String attr = e.getKey();<NEW_LINE>if (config.dialect.isPrimaryKey(attr, pKeys) == false && table.hasColumnLabel(attr))<NEW_LINE>attrNames.add(attr);<NEW_LINE>}<NEW_LINE>for (String pKey : pKeys) attrNames.add(pKey);<NEW_LINE>String columns = StrKit.join(attrNames.toArray(new String[attrNames.size()]), ",");<NEW_LINE>// update all attrs of the model not use the midifyFlag of every single model<NEW_LINE>// model.getModifyFlag();<NEW_LINE>Set<String> modifyFlag = attrs.keySet();<NEW_LINE>StringBuilder sql = new StringBuilder();<NEW_LINE>List<Object> parasNoUse = new ArrayList<Object>();<NEW_LINE>config.dialect.forModelUpdate(TableMapping.me().getTable(model.getClass()), attrs, modifyFlag, sql, parasNoUse);<NEW_LINE>return batch(sql.toString(), columns, modelList, batchSize);<NEW_LINE>}
= new ArrayList<String>();
634,360
private Table buildTable(final RestRequest request, ClusterStateResponse state, Map<String, IndexSegments> indicesSegments) {<NEW_LINE>Table table = getTableWithHeader(request);<NEW_LINE>DiscoveryNodes nodes = state<MASK><NEW_LINE>for (IndexSegments indexSegments : indicesSegments.values()) {<NEW_LINE>Map<Integer, IndexShardSegments> shards = indexSegments.getShards();<NEW_LINE>for (IndexShardSegments indexShardSegments : shards.values()) {<NEW_LINE>ShardSegments[] shardSegments = indexShardSegments.shards();<NEW_LINE>for (ShardSegments shardSegment : shardSegments) {<NEW_LINE>List<Segment> segments = shardSegment.getSegments();<NEW_LINE>for (Segment segment : segments) {<NEW_LINE>table.startRow();<NEW_LINE>table.addCell(shardSegment.getShardRouting().getIndexName());<NEW_LINE>table.addCell(shardSegment.getShardRouting().getId());<NEW_LINE>table.addCell(shardSegment.getShardRouting().primary() ? "p" : "r");<NEW_LINE>table.addCell(nodes.get(shardSegment.getShardRouting().currentNodeId()).getHostAddress());<NEW_LINE>table.addCell(shardSegment.getShardRouting().currentNodeId());<NEW_LINE>table.addCell(segment.getName());<NEW_LINE>table.addCell(segment.getGeneration());<NEW_LINE>table.addCell(segment.getNumDocs());<NEW_LINE>table.addCell(segment.getDeletedDocs());<NEW_LINE>table.addCell(segment.getSize());<NEW_LINE>table.addCell(0L);<NEW_LINE>table.addCell(segment.isCommitted());<NEW_LINE>table.addCell(segment.isSearch());<NEW_LINE>table.addCell(segment.getVersion());<NEW_LINE>table.addCell(segment.isCompound());<NEW_LINE>table.endRow();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return table;<NEW_LINE>}
.getState().nodes();
583,340
public void checkIfCanUpgrade(final VirtualMachine vmInstance, final ServiceOffering newServiceOffering) {<NEW_LINE>if (newServiceOffering == null) {<NEW_LINE>throw new InvalidParameterValueException("Invalid parameter, newServiceOffering can't be null");<NEW_LINE>}<NEW_LINE>if (!(vmInstance.getState().equals(State.Stopped) || vmInstance.getState().equals(State.Running))) {<NEW_LINE>s_logger.warn("Unable to upgrade virtual machine " + vmInstance.toString() + " in state " + vmInstance.getState());<NEW_LINE>throw new InvalidParameterValueException("Unable to upgrade virtual machine " + vmInstance.toString() + " " + " in state " + vmInstance.getState() + "; make sure the virtual machine is stopped/running");<NEW_LINE>}<NEW_LINE>if (!newServiceOffering.isDynamic() && vmInstance.getServiceOfferingId() == newServiceOffering.getId()) {<NEW_LINE>if (s_logger.isInfoEnabled()) {<NEW_LINE>s_logger.info("Not upgrading vm " + vmInstance.toString() + " since it already has the requested " + "service offering (" + newServiceOffering.getName() + ")");<NEW_LINE>}<NEW_LINE>throw new InvalidParameterValueException("Not upgrading vm " + vmInstance.toString() + " since it already " + "has the requested service offering (" + newServiceOffering.getName() + ")");<NEW_LINE>}<NEW_LINE>final ServiceOfferingVO currentServiceOffering = _offeringDao.findByIdIncludingRemoved(vmInstance.getId(<MASK><NEW_LINE>final DiskOfferingVO currentDiskOffering = _diskOfferingDao.findByIdIncludingRemoved(currentServiceOffering.getDiskOfferingId());<NEW_LINE>final DiskOfferingVO newDiskOffering = _diskOfferingDao.findById(newServiceOffering.getDiskOfferingId());<NEW_LINE>checkIfNewOfferingStorageScopeMatchesStoragePool(vmInstance, newDiskOffering);<NEW_LINE>if (currentServiceOffering.isSystemUse() != newServiceOffering.isSystemUse()) {<NEW_LINE>throw new InvalidParameterValueException("isSystem property is different for current service offering and new service offering");<NEW_LINE>}<NEW_LINE>if (!isVirtualMachineUpgradable(vmInstance, newServiceOffering)) {<NEW_LINE>throw new InvalidParameterValueException("Unable to upgrade virtual machine, not enough resources available " + "for an offering of " + newServiceOffering.getCpu() + " cpu(s) at " + newServiceOffering.getSpeed() + " Mhz, and " + newServiceOffering.getRamSize() + " MB of memory");<NEW_LINE>}<NEW_LINE>final List<String> currentTags = StringUtils.csvTagsToList(currentDiskOffering.getTags());<NEW_LINE>final List<String> newTags = StringUtils.csvTagsToList(newDiskOffering.getTags());<NEW_LINE>if (VolumeApiServiceImpl.MatchStoragePoolTagsWithDiskOffering.valueIn(vmInstance.getDataCenterId())) {<NEW_LINE>if (!VolumeApiServiceImpl.doesNewDiskOfferingHasTagsAsOldDiskOffering(currentDiskOffering, newDiskOffering)) {<NEW_LINE>throw new InvalidParameterValueException("Unable to upgrade virtual machine; the current service offering " + " should have tags as subset of " + "the new service offering tags. Current service offering tags: " + currentTags + "; " + "new service " + "offering tags: " + newTags);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
), vmInstance.getServiceOfferingId());
596,618
public String unrelated(@RequestAttribute SysSite site, @SessionAttribute SysUser admin, Long id, HttpServletRequest request, ModelMap model) {<NEW_LINE>CmsContentRelated <MASK><NEW_LINE>if (null != entity) {<NEW_LINE>if (ControllerUtils.verifyCustom("noright", !(admin.isOwnsAllContent() || entity.getUserId() == admin.getId()), model)) {<NEW_LINE>return CommonConstants.TEMPLATE_ERROR;<NEW_LINE>}<NEW_LINE>CmsContent content = service.getEntity(entity.getContentId());<NEW_LINE>if (null == content || site.getId() == content.getSiteId()) {<NEW_LINE>cmsContentRelatedService.delete(id);<NEW_LINE>publish(site, content, admin);<NEW_LINE>logOperateService.save(new LogOperate(site.getId(), admin.getId(), LogLoginService.CHANNEL_WEB_MANAGER, "unrelated.content", RequestUtils.getIpAddress(request), CommonUtils.getDate(), JsonUtils.getString(entity)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return CommonConstants.TEMPLATE_DONE;<NEW_LINE>}
entity = cmsContentRelatedService.getEntity(id);
336,228
public void onClick(DialogInterface dialog, int which) {<NEW_LINE>switch(which) {<NEW_LINE>case (2):<NEW_LINE>{<NEW_LINE>LinkUtil.openExternally(contentUrl);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case (3):<NEW_LINE>{<NEW_LINE>ShareUtil.shareImage(actuallyLoaded, MediaView.this);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case (5):<NEW_LINE>{<NEW_LINE>Reddit.defaultShareText("", StringEscapeUtils.unescapeHtml4<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case (6):<NEW_LINE>{<NEW_LINE>saveFile(contentUrl);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case (15):<NEW_LINE>{<NEW_LINE>new OpenVRedditTask(MediaView.this, subreddit).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, contentUrl);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case (9):<NEW_LINE>{<NEW_LINE>shareGif(contentUrl);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case (4):<NEW_LINE>{<NEW_LINE>doImageSave();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case (16):<NEW_LINE>{<NEW_LINE>doImageSaveForLocation();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(contentUrl), MediaView.this);
1,591,721
public void deleteKeyValueProperties(DeleteKeyValuePropertiesRequest request) {<NEW_LINE>try (var session = modelDBHibernateUtil.getSessionFactory().openSession()) {<NEW_LINE>session.beginTransaction();<NEW_LINE>if (request.getDeleteAll()) {<NEW_LINE>StringBuilder stringQueryBuilder = new StringBuilder("delete from ").append(KeyValuePropertyMappingEntity.class.getSimpleName()).append(" kv WHERE ");<NEW_LINE>stringQueryBuilder.append(" kv.").append(ModelDBConstants.ID).append(".").append(ModelDBConstants.ENTITY_HASH).append(" = :").append(ModelDBConstants.ENTITY_HASH).append(" AND kv.id.").append(ModelDBConstants.PROPERTY_NAME).append(" = :").append(ModelDBConstants.PROPERTY_NAME);<NEW_LINE>Query<LabelsMappingEntity> query = session.createQuery(stringQueryBuilder.toString()).setLockOptions(new LockOptions().setLockMode(LockMode.PESSIMISTIC_WRITE));<NEW_LINE>query.setParameter(ModelDBConstants.ENTITY_HASH, getEntityHash(request.getId()));<NEW_LINE>query.setParameter(ModelDBConstants.PROPERTY_NAME, request.getPropertyName());<NEW_LINE>query.executeUpdate();<NEW_LINE>} else {<NEW_LINE>for (String key : request.getKeysList()) {<NEW_LINE>KeyValuePropertyMappingEntity.KeyValuePropertyMappingId id0 = KeyValuePropertyMappingEntity.createId(request.getId(), key, request.getPropertyName());<NEW_LINE>KeyValuePropertyMappingEntity kvEntity = session.get(KeyValuePropertyMappingEntity.<MASK><NEW_LINE>if (kvEntity != null) {<NEW_LINE>session.delete(kvEntity);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>session.getTransaction().commit();<NEW_LINE>}<NEW_LINE>}
class, id0, LockMode.PESSIMISTIC_WRITE);
1,794,099
private static String parseSoapMethodName(InputStream stream, String charEncoding) {<NEW_LINE>try {<NEW_LINE>// newInstance() et pas newFactory() pour java 1.5 (issue 367)<NEW_LINE>final XMLInputFactory factory = XMLInputFactory.newInstance();<NEW_LINE>// disable DTDs entirely for that factory<NEW_LINE>factory.setProperty(XMLInputFactory.SUPPORT_DTD, false);<NEW_LINE>// disable external entities<NEW_LINE>factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);<NEW_LINE>final XMLStreamReader xmlReader;<NEW_LINE>if (charEncoding != null) {<NEW_LINE>xmlReader = <MASK><NEW_LINE>} else {<NEW_LINE>xmlReader = factory.createXMLStreamReader(stream);<NEW_LINE>}<NEW_LINE>// best-effort parsing<NEW_LINE>// start document, go to first tag<NEW_LINE>xmlReader.nextTag();<NEW_LINE>// expect first tag to be "Envelope"<NEW_LINE>if (!"Envelope".equals(xmlReader.getLocalName())) {<NEW_LINE>LOG.debug("Unexpected first tag of SOAP request: '" + xmlReader.getLocalName() + "' (expected 'Envelope')");<NEW_LINE>// failed<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// scan for body tag<NEW_LINE>if (!scanForChildTag(xmlReader, "Body")) {<NEW_LINE>LOG.debug("Unable to find SOAP 'Body' tag");<NEW_LINE>// failed<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>xmlReader.nextTag();<NEW_LINE>// tag is method name<NEW_LINE>return "." + xmlReader.getLocalName();<NEW_LINE>} catch (final XMLStreamException e) {<NEW_LINE>LOG.debug("Unable to parse SOAP request", e);<NEW_LINE>// failed<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
factory.createXMLStreamReader(stream, charEncoding);
637,761
public HistoricCaseInstanceResponse createHistoricCaseInstanceResponse(HistoricCaseInstance caseInstance, RestUrlBuilder urlBuilder) {<NEW_LINE>HistoricCaseInstanceResponse result = new HistoricCaseInstanceResponse();<NEW_LINE>result.setBusinessKey(caseInstance.getBusinessKey());<NEW_LINE>result.setBusinessStatus(caseInstance.getBusinessStatus());<NEW_LINE>result.setName(caseInstance.getName());<NEW_LINE>result.setEndTime(caseInstance.getEndTime());<NEW_LINE>result.setId(caseInstance.getId());<NEW_LINE>result.setCaseDefinitionId(caseInstance.getCaseDefinitionId());<NEW_LINE>result.setCaseDefinitionUrl(urlBuilder.buildUrl(CmmnRestUrls.URL_CASE_DEFINITION, caseInstance.getCaseDefinitionId()));<NEW_LINE>result.setStartTime(caseInstance.getStartTime());<NEW_LINE>result.setStartUserId(caseInstance.getStartUserId());<NEW_LINE>result.setUrl(urlBuilder.buildUrl(CmmnRestUrls.URL_HISTORIC_CASE_INSTANCE, caseInstance.getId()));<NEW_LINE>if (caseInstance.getCaseVariables() != null) {<NEW_LINE>Map<String, Object> variableMap = caseInstance.getCaseVariables();<NEW_LINE>for (String name : variableMap.keySet()) {<NEW_LINE>result.addVariable(createRestVariable(name, variableMap.get(name), RestVariableScope.LOCAL, caseInstance.getId(), VARIABLE_HISTORY_CASE, false, urlBuilder));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.<MASK><NEW_LINE>result.setState(caseInstance.getState());<NEW_LINE>result.setReferenceId(caseInstance.getReferenceId());<NEW_LINE>result.setReferenceType(caseInstance.getReferenceType());<NEW_LINE>result.setCallbackId(caseInstance.getCallbackId());<NEW_LINE>result.setCallbackType(caseInstance.getCallbackType());<NEW_LINE>return result;<NEW_LINE>}
setTenantId(caseInstance.getTenantId());