idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
88,423
public ListElasticsearchInstanceTypesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListElasticsearchInstanceTypesResult listElasticsearchInstanceTypesResult = new ListElasticsearchInstanceTypesResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listElasticsearchInstanceTypesResult;<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("ElasticsearchInstanceTypes", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listElasticsearchInstanceTypesResult.setElasticsearchInstanceTypes(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listElasticsearchInstanceTypesResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listElasticsearchInstanceTypesResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,023,014
final CreateSolutionVersionResult executeCreateSolutionVersion(CreateSolutionVersionRequest createSolutionVersionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createSolutionVersionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateSolutionVersionRequest> request = null;<NEW_LINE>Response<CreateSolutionVersionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateSolutionVersionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createSolutionVersionRequest));<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, "Personalize");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateSolutionVersionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateSolutionVersionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateSolutionVersion");
1,187,765
final StartExperimentResult executeStartExperiment(StartExperimentRequest startExperimentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(startExperimentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StartExperimentRequest> request = null;<NEW_LINE>Response<StartExperimentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StartExperimentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startExperimentRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartExperiment");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StartExperimentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartExperimentResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "fis");
348,856
static Fix createSuppressWarningsFix(CompilationInfo compilationInfo, TreePath treePath, String... keys) {<NEW_LINE><MASK><NEW_LINE>Parameters.notNull("treePath", treePath);<NEW_LINE>Parameters.notNull("keys", keys);<NEW_LINE>if (keys.length == 0) {<NEW_LINE>// NOI18N<NEW_LINE>throw new IllegalArgumentException("key must not be empty");<NEW_LINE>}<NEW_LINE>if (!isSuppressWarningsSupported(compilationInfo)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (treePath.getLeaf().getKind() != Kind.COMPILATION_UNIT && !DECLARATION.contains(treePath.getLeaf().getKind())) {<NEW_LINE>treePath = treePath.getParentPath();<NEW_LINE>}<NEW_LINE>if (treePath.getLeaf().getKind() != Kind.COMPILATION_UNIT) {<NEW_LINE>return new FixImpl(TreePathHandle.create(treePath, compilationInfo), compilationInfo.getFileObject(), keys);<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
Parameters.notNull("compilationInfo", compilationInfo);
77,899
public void run(RegressionEnvironment env) {<NEW_LINE>EPCompiled type = env.compile("@name('s0') @public @buseventtype create schema MyEvent(p string)");<NEW_LINE>EPCompiled selectMyEvent = env.compile("@name('s0') select * from MyEvent", new RegressionPath<MASK><NEW_LINE>EPCompiled selectSB = env.compile("@name('s0') select * from SupportBean");<NEW_LINE>EPCompiled selectSBParameterized = env.compile("@name('s0') select * from SupportBean(theString = ?::string)");<NEW_LINE>env.compileDeploy("@name('s1') select * from SupportBean");<NEW_LINE>// dependency not found<NEW_LINE>String msg = "A precondition is not satisfied: Required dependency event type 'MyEvent' cannot be found";<NEW_LINE>tryInvalidRollout(env, msg, 1, EPDeployPreconditionException.class, selectSB, selectMyEvent);<NEW_LINE>tryInvalidRollout(env, msg, 0, EPDeployPreconditionException.class, selectMyEvent);<NEW_LINE>tryInvalidRollout(env, msg, 2, EPDeployPreconditionException.class, selectSB, selectSB, selectMyEvent);<NEW_LINE>tryInvalidRollout(env, msg, 1, EPDeployPreconditionException.class, selectSB, selectMyEvent, selectSB, selectSB);<NEW_LINE>// already defined<NEW_LINE>tryInvalidRollout(env, "Event type by name 'MyEvent' already registered", 1, EPDeployException.class, type, type);<NEW_LINE>// duplicate deployment id<NEW_LINE>tryInvalidRollout(env, "Deployment id 'a' occurs multiple times in the rollout", 1, EPDeployException.class, new EPDeploymentRolloutCompiled(selectSB, new DeploymentOptions().setDeploymentId("a")), new EPDeploymentRolloutCompiled(selectSB, new DeploymentOptions().setDeploymentId("a")));<NEW_LINE>// deployment id exists<NEW_LINE>tryInvalidRollout(env, "Deployment by id '" + env.deploymentId("s1") + "' already exists", 1, EPDeployDeploymentExistsException.class, new EPDeploymentRolloutCompiled(selectSB, new DeploymentOptions().setDeploymentId("a")), new EPDeploymentRolloutCompiled(selectSB, new DeploymentOptions().setDeploymentId(env.deploymentId("s1"))));<NEW_LINE>// substitution param problem<NEW_LINE>tryInvalidRollout(env, "Substitution parameters have not been provided: Statement 's0' has 1 substitution parameters", 1, EPDeploySubstitutionParameterException.class, selectSB, selectSBParameterized);<NEW_LINE>env.undeployAll();<NEW_LINE>}
().add(type));
356,443
public void addTriple(@Name("subject") String subject, @Name("predicate") String predicate, @Name("object") String object, @Name("isLiteral") Boolean isLiteral, @Name("literalType") String literalType, @Name("literalLang") String literalLang, @Name(value = "sspo", defaultValue = "null") List<String> sspo) {<NEW_LINE>Resource s;<NEW_LINE>if (sspo == null) {<NEW_LINE>s = (subject.indexOf(58) < 0 ? vf.createBNode(subject) : vf.createIRI(subject));<NEW_LINE>} else {<NEW_LINE>// if sspo does not contain exactly three items [s,p,o] or the object is literal and cannot be converted<NEW_LINE>// to uri this will fail and an exception will be thrown<NEW_LINE>s = vf.createTriple(sspo.get(0).indexOf(58) < 0 ? vf.createBNode(sspo.get(0)) : vf.createIRI(sspo.get(0)), vf.createIRI(sspo.get(1)), sspo.get(2).indexOf(58) < 0 ? vf.createBNode(sspo.get(2)) : vf.createIRI(<MASK><NEW_LINE>}<NEW_LINE>IRI p = vf.createIRI(predicate);<NEW_LINE>if (isLiteral) {<NEW_LINE>Literal o;<NEW_LINE>if (literalType.equals(RDF.LANGSTRING.stringValue())) {<NEW_LINE>o = vf.createLiteral(object, literalLang);<NEW_LINE>} else {<NEW_LINE>o = vf.createLiteral(object, vf.createIRI(literalType));<NEW_LINE>}<NEW_LINE>// TODO: lang is lost here<NEW_LINE>m.add(s, p, o);<NEW_LINE>} else {<NEW_LINE>Resource o = (object.indexOf(58) < 0 ? vf.createBNode(object) : vf.createIRI(object));<NEW_LINE>m.add(s, p, o);<NEW_LINE>}<NEW_LINE>}
sspo.get(2)));
1,745,345
protected void load(String fileName, boolean tryMemoryMapping) throws IOException, BufferUnderflowException, MaryConfigurationException, NullPointerException {<NEW_LINE>requireNonNull(fileName, "filename is null");<NEW_LINE>RandomAccessFile file = new RandomAccessFile(fileName, "r");<NEW_LINE>FileChannel fc = file.getChannel();<NEW_LINE>// Expect header to be no bigger than 64k bytes<NEW_LINE>ByteBuffer headerBB = ByteBuffer.allocate(0x10000);<NEW_LINE>fc.read(headerBB);<NEW_LINE>headerBB.limit(headerBB.position());<NEW_LINE>headerBB.position(0);<NEW_LINE>maryHdr = new MaryHeader(headerBB);<NEW_LINE>if (maryHdr.getType() != MaryHeader.TIMELINE) {<NEW_LINE>throw new MaryConfigurationException("File is not a valid timeline file.");<NEW_LINE>}<NEW_LINE>sampleRate = headerBB.getInt();<NEW_LINE>numDatagrams = headerBB.getLong();<NEW_LINE>if (sampleRate <= 0 || numDatagrams < 0) {<NEW_LINE>throw new MaryConfigurationException("Illegal values in timeline file.");<NEW_LINE>}<NEW_LINE>fc.position(timeIdxBytePos);<NEW_LINE>ByteBuffer indexBB = ByteBuffer.allocate((int) (fc.size() - timeIdxBytePos));<NEW_LINE>fc.read(indexBB);<NEW_LINE>indexBB.limit(indexBB.position());<NEW_LINE>indexBB.position(0);<NEW_LINE>idx = new Index(indexBB);<NEW_LINE>if (tryMemoryMapping) {<NEW_LINE>// Try if we can use a mapped byte buffer:<NEW_LINE>try {<NEW_LINE>mappedBB = fc.map(FileChannel.MapMode.READ_ONLY, datagramsBytePos, timeIdxBytePos - datagramsBytePos);<NEW_LINE>// if map() succeeded, we don't need the file anymore.<NEW_LINE>file.close();<NEW_LINE>} catch (IOException ome) {<NEW_LINE>MaryUtils.getLogger("Timeline").warn("Cannot use memory mapping for timeline file '" + fileName + "' -- falling back to piecewise reading");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!tryMemoryMapping || mappedBB == null) {<NEW_LINE>// use piecewise reading<NEW_LINE>fileChannel = fc;<NEW_LINE>assert fileChannel != null;<NEW_LINE>// and leave file open<NEW_LINE>}<NEW_LINE>// postconditions:<NEW_LINE>assert idx != null;<NEW_LINE>assert procHdr != null;<NEW_LINE>assert fileChannel == null && mappedBB != null <MASK><NEW_LINE>}
|| fileChannel != null && mappedBB == null;
1,040,518
private synchronized Optional<InternalNode> tryAcquireNode(NodeRequirements requirements) {<NEW_LINE>NodeSelector nodeSelector = nodeSelectorCache.computeIfAbsent(requirements.getCatalogName(), catalogName -> nodeScheduler.createNodeSelector(session, catalogName));<NEW_LINE>List<InternalNode> nodes = nodeSelector.allNodes();<NEW_LINE>if (nodes.isEmpty()) {<NEW_LINE>throw new TrinoException(NO_NODES_AVAILABLE, "No nodes available to run query");<NEW_LINE>}<NEW_LINE>List<InternalNode> nodesMatchingRequirements = nodes.stream().filter(node -> requirements.getAddresses().isEmpty() || requirements.getAddresses().contains(node.getHostAndPort())).collect(toImmutableList());<NEW_LINE>if (nodesMatchingRequirements.isEmpty()) {<NEW_LINE>throw new TrinoException(NO_NODES_AVAILABLE, "No nodes available to run query");<NEW_LINE>}<NEW_LINE>Optional<InternalNode> selectedNode = nodesMatchingRequirements.stream().filter(node -> allocationCountMap.getOrDefault(node, 0) < maximumAllocationsPerNode).min(comparing(node -> allocationCountMap.getOrDefault(node, 0)));<NEW_LINE>if (selectedNode.isEmpty()) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>allocationCountMap.compute(selectedNode.get(), (key, value) -> value == <MASK><NEW_LINE>return selectedNode;<NEW_LINE>}
null ? 1 : value + 1);
637,540
public static void main(String[] args) {<NEW_LINE>final String USAGE = "\n" + "Usage:\n" + " <clusterId> <masterUsername> <masterUserPassword> \n\n" + "Where:\n" + " clusterId - the id of the cluster to create. \n" + " masterUsername - the master user name. \n" + " masterUserPassword - the password that corresponds to the master user name. \n";<NEW_LINE>if (args.length != 3) {<NEW_LINE><MASK><NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>String clusterId = args[0];<NEW_LINE>String masterUsername = args[1];<NEW_LINE>String masterUserPassword = args[2];<NEW_LINE>Region region = Region.US_WEST_2;<NEW_LINE>RedshiftClient redshiftClient = RedshiftClient.builder().region(region).build();<NEW_LINE>createCluster(redshiftClient, clusterId, masterUsername, masterUserPassword);<NEW_LINE>waitForClusterReady(redshiftClient, clusterId);<NEW_LINE>modifyCluster(redshiftClient, clusterId);<NEW_LINE>redshiftClient.close();<NEW_LINE>}
System.out.println(USAGE);
616,777
int process(SharpStream out, SharpStream... sources) throws IOException {<NEW_LINE>// check if the subtitle is already in srt and copy, this should never happen<NEW_LINE>String format = getArgumentAt(0, null);<NEW_LINE>boolean ignoreEmptyFrames = getArgumentAt(1, "true").equals("true");<NEW_LINE>if (format == null || format.equals("ttml")) {<NEW_LINE>SrtFromTtmlWriter writer = new SrtFromTtmlWriter(out, ignoreEmptyFrames);<NEW_LINE>try {<NEW_LINE>writer.build(sources[0]);<NEW_LINE>} catch (Exception err) {<NEW_LINE>Log.<MASK><NEW_LINE>return err instanceof IOException ? 1 : 8;<NEW_LINE>}<NEW_LINE>return OK_RESULT;<NEW_LINE>} else if (format.equals("srt")) {<NEW_LINE>byte[] buffer = new byte[8 * 1024];<NEW_LINE>int read;<NEW_LINE>while ((read = sources[0].read(buffer)) > 0) {<NEW_LINE>out.write(buffer, 0, read);<NEW_LINE>}<NEW_LINE>return OK_RESULT;<NEW_LINE>}<NEW_LINE>throw new UnsupportedOperationException("Can't convert this subtitle, unimplemented format: " + format);<NEW_LINE>}
e(TAG, "subtitle parse failed", err);
1,258,419
private Conflict registerConflict(Collection<K> targets, K replacedBy) {<NEW_LINE>assert !targets.isEmpty();<NEW_LINE>// replacement candidates are the only important candidates<NEW_LINE>Collection<? extends T> candidates = elements.get(replacedBy);<NEW_LINE>assert candidates != null;<NEW_LINE>Set<K> participants = new LinkedHashSet<>(targets);<NEW_LINE>participants.add(replacedBy);<NEW_LINE>// We need to ensure that the conflict is orderly injected to the list of conflicts<NEW_LINE>// Brand new conflict goes to the end<NEW_LINE>// If we find any matching conflict we have to hook up with it<NEW_LINE>// Find an existing matching conflict<NEW_LINE>for (K participant : participants) {<NEW_LINE>Conflict c = conflictsByParticipant.get(participant);<NEW_LINE>if (c != null) {<NEW_LINE>// there is already registered conflict with at least one matching participant, hook up to this conflict<NEW_LINE>c.candidates = candidates;<NEW_LINE><MASK><NEW_LINE>return c;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// No conflict with matching participants found, create new<NEW_LINE>Conflict c = new Conflict(participants, candidates);<NEW_LINE>conflicts.add(c);<NEW_LINE>for (K participant : participants) {<NEW_LINE>conflictsByParticipant.put(participant, c);<NEW_LINE>}<NEW_LINE>return c;<NEW_LINE>}
c.participants.addAll(participants);
336,515
private I_C_Invoice_Candidate createCand(final Properties ctx, final I_C_Flatrate_Term term, final I_C_Flatrate_DataEntry dataEntry, final int productId, final BigDecimal priceActual, final String trxName) {<NEW_LINE>final I_C_Invoice_Candidate newCand = InterfaceWrapperHelper.create(ctx, I_C_Invoice_Candidate.class, trxName);<NEW_LINE>Check.assume(newCand.getAD_Client_ID() == dataEntry.getAD_Client_ID(), "ctx contains the correct AD_Client_ID");<NEW_LINE>final OrgId orgId = OrgId.ofRepoId(dataEntry.getAD_Org_ID());<NEW_LINE>newCand.setAD_Org_ID(orgId.getRepoId());<NEW_LINE>final I_C_Flatrate_Conditions fc = term.getC_Flatrate_Conditions();<NEW_LINE>newCand.setM_PricingSystem_ID(fc.getM_PricingSystem_ID());<NEW_LINE>newCand.setM_Product_ID(productId);<NEW_LINE>newCand.setQtyOrdered(BigDecimal.ONE);<NEW_LINE>// to be computed<NEW_LINE>newCand.setQtyToInvoice(BigDecimal.ZERO);<NEW_LINE>newCand.setPriceActual(priceActual);<NEW_LINE>// 07090 when we set PiceActual, we shall also set PriceUOM.<NEW_LINE>newCand.setPrice_UOM_ID(term.getC_UOM_ID());<NEW_LINE>// cg : task 04917 -- same as price actual<NEW_LINE>newCand.setPriceEntered(priceActual);<NEW_LINE>newCand.setDiscount(BigDecimal.ZERO);<NEW_LINE>newCand.setInvoiceRule(fc.getInvoiceRule());<NEW_LINE>newCand.setC_Currency_ID(term.getC_Currency_ID());<NEW_LINE>InvoiceCandidateLocationAdapterFactory.billLocationAdapter(newCand).setFrom(ContractLocationHelper.extractBillLocation(term));<NEW_LINE>newCand.setDateOrdered(dataEntry.getC_Period().getEndDate());<NEW_LINE>newCand.setAD_Table_ID(adTableDAO.retrieveTableId(I_C_Flatrate_DataEntry.Table_Name));<NEW_LINE>newCand.setRecord_ID(dataEntry.getC_Flatrate_DataEntry_ID());<NEW_LINE>// 07442 activity and tax<NEW_LINE>final ActivityId activityId = findActivityIdOrNull(term, productId);<NEW_LINE>newCand.setC_Activity_ID(ActivityId.toRepoId(activityId));<NEW_LINE>newCand.setIsTaxIncluded(term.isTaxIncluded());<NEW_LINE>final TaxCategoryId taxCategoryId = TaxCategoryId.ofRepoIdOrNull(term.getC_TaxCategory_ID());<NEW_LINE>final BPartnerLocationAndCaptureId shipToLocationId = CoalesceUtil.coalesceSuppliers(() -> ContractLocationHelper.extractDropshipLocationId(term), () <MASK><NEW_LINE>final TaxId taxId = // shipDate<NEW_LINE>Services.get(ITaxBL.class).// shipDate<NEW_LINE>getTaxNotNull(// shipDate<NEW_LINE>term, // shipDate<NEW_LINE>taxCategoryId, // shipDate<NEW_LINE>productId, dataEntry.getDate_Reported(), orgId, null, shipToLocationId, SOTrx.SALES);<NEW_LINE>newCand.setC_Tax_ID(taxId.getRepoId());<NEW_LINE>setILCandHandler(ctx, newCand);<NEW_LINE>InterfaceWrapperHelper.save(newCand);<NEW_LINE>return newCand;<NEW_LINE>}
-> ContractLocationHelper.extractBillToLocationId(term));
11,377
private static <K, V> LoadingCache<K, V> buildCache(OptionalLong expiresAfterWriteMillis, OptionalLong refreshMillis, Optional<Executor> refreshExecutor, long maximumSize, StatsRecording statsRecording, com.google.common.base.Function<K, V> loader) {<NEW_LINE>CacheLoader<K, V> cacheLoader = CacheLoader.from(loader);<NEW_LINE>EvictableCacheBuilder<Object, Object> cacheBuilder = EvictableCacheBuilder.newBuilder();<NEW_LINE>if (expiresAfterWriteMillis.isPresent()) {<NEW_LINE>cacheBuilder.expireAfterWrite(expiresAfterWriteMillis.getAsLong(), MILLISECONDS);<NEW_LINE>}<NEW_LINE>checkArgument(refreshMillis.isEmpty() || refreshExecutor.isPresent(), "refreshMillis is provided but refreshExecutor is not");<NEW_LINE>if (refreshMillis.isPresent() && (expiresAfterWriteMillis.isEmpty() || expiresAfterWriteMillis.getAsLong() > refreshMillis.getAsLong())) {<NEW_LINE>cacheBuilder.refreshAfterWrite(refreshMillis.getAsLong(), MILLISECONDS);<NEW_LINE>cacheLoader = asyncReloading(cacheLoader, refreshExecutor.orElseThrow(() <MASK><NEW_LINE>}<NEW_LINE>cacheBuilder.maximumSize(maximumSize);<NEW_LINE>if (statsRecording == StatsRecording.ENABLED) {<NEW_LINE>cacheBuilder.recordStats();<NEW_LINE>}<NEW_LINE>return cacheBuilder.build(cacheLoader);<NEW_LINE>}
-> new IllegalArgumentException("Executor not provided")));
1,404,702
public void updateReservation(String reservationId, CustomerName customerName, String email, String billingAddressCompany, String billingAddressLine1, String billingAddressLine2, String billingAddressZip, String billingAddressCity, String billingAddressState, String vatCountryCode, String customerReference, String vatNr, boolean isInvoiceRequested, boolean addCompanyBillingDetails, boolean skipVatNr, boolean validated, Locale locale, Principal principal) {<NEW_LINE>String completeBillingAddress = buildCompleteBillingAddress(customerName, billingAddressCompany, billingAddressLine1, billingAddressLine2, billingAddressZip, <MASK><NEW_LINE>ticketReservationRepository.updateTicketReservationWithValidation(reservationId, customerName.getFullName(), customerName.getFirstName(), customerName.getLastName(), email, billingAddressCompany, billingAddressLine1, billingAddressLine2, billingAddressZip, billingAddressCity, billingAddressState, completeBillingAddress, vatCountryCode, vatNr, isInvoiceRequested, addCompanyBillingDetails, skipVatNr, customerReference, validated);<NEW_LINE>if (principal != null && configurationManager.isPublicOpenIdEnabled()) {<NEW_LINE>ticketReservationRepository.setReservationOwner(reservationId, retrievePublicUserId(principal));<NEW_LINE>}<NEW_LINE>}
billingAddressCity, billingAddressState, vatCountryCode, locale);
1,263,217
protected void lcsEqualMatching(MappingStore mappings, Tree src, Tree dst) {<NEW_LINE>List<Tree> unmappedSrcChildren = new ArrayList<>();<NEW_LINE>for (Tree c : src.getChildren()) if (!mappings.isSrcMapped(c))<NEW_LINE>unmappedSrcChildren.add(c);<NEW_LINE>List<Tree> unmappedDstChildren = new ArrayList<>();<NEW_LINE>for (Tree c : dst.getChildren()) if (!mappings.isDstMapped(c))<NEW_LINE>unmappedDstChildren.add(c);<NEW_LINE>List<int[]> lcs = SequenceAlgorithms.longestCommonSubsequenceWithIsomorphism(unmappedSrcChildren, unmappedDstChildren);<NEW_LINE>for (int[] x : lcs) {<NEW_LINE>var t1 = unmappedSrcChildren.get(x[0]);<NEW_LINE>var t2 = unmappedDstChildren.get(x[1]);<NEW_LINE>if (mappings.areSrcsUnmapped(TreeUtils.preOrder(t1)) && mappings.areDstsUnmapped(TreeUtils.preOrder(t2)))<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
mappings.addMappingRecursively(t1, t2);
1,594,718
public static <In extends ImageBase<In>, Out extends ImageBase<Out>, K extends Kernel2D, B extends ImageBorder<In>> void convolve(K kernel, In input, Out output, B border) {<NEW_LINE>switch(input.getImageType().getFamily()) {<NEW_LINE>case GRAY -><NEW_LINE>{<NEW_LINE>if (input instanceof GrayF32) {<NEW_LINE>ConvolveImage.convolve((Kernel2D_F32) kernel, (GrayF32) input, (GrayF32<MASK><NEW_LINE>} else if (input instanceof GrayU8) {<NEW_LINE>if (GrayI16.class.isAssignableFrom(output.getClass()))<NEW_LINE>ConvolveImage.convolve((Kernel2D_S32) kernel, (GrayU8) input, (GrayI16) output, (ImageBorder_S32) border);<NEW_LINE>else<NEW_LINE>ConvolveImage.convolve((Kernel2D_S32) kernel, (GrayU8) input, (GrayS32) output, (ImageBorder_S32) border);<NEW_LINE>} else if (input instanceof GrayS16) {<NEW_LINE>ConvolveImage.convolve((Kernel2D_S32) kernel, (GrayS16) input, (GrayI16) output, (ImageBorder_S32) border);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unknown image type: " + input.getClass().getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>case INTERLEAVED -><NEW_LINE>{<NEW_LINE>if (input instanceof InterleavedF32) {<NEW_LINE>ConvolveImage.convolve((Kernel2D_F32) kernel, (InterleavedF32) input, (InterleavedF32) output, (ImageBorder_IL_F32) border);<NEW_LINE>} else if (input instanceof InterleavedU8) {<NEW_LINE>if (InterleavedI16.class.isAssignableFrom(output.getClass()))<NEW_LINE>ConvolveImage.convolve((Kernel2D_S32) kernel, (InterleavedU8) input, (InterleavedI16) output, (ImageBorder_IL_S32) border);<NEW_LINE>else<NEW_LINE>ConvolveImage.convolve((Kernel2D_S32) kernel, (InterleavedU8) input, (InterleavedS32) output, (ImageBorder_IL_S32) border);<NEW_LINE>} else if (input instanceof InterleavedS16) {<NEW_LINE>ConvolveImage.convolve((Kernel2D_S32) kernel, (InterleavedS16) input, (InterleavedU16) output, (ImageBorder_IL_S32) border);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unknown image type: " + input.getClass().getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>case PLANAR -><NEW_LINE>{<NEW_LINE>Planar inp = (Planar) input;<NEW_LINE>Planar outp = (Planar) output;<NEW_LINE>for (int i = 0; i < inp.getNumBands(); i++) {<NEW_LINE>convolve(kernel, inp.getBand(i), outp.getBand(i), (ImageBorder) border);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
) output, (ImageBorder_F32) border);
418,706
public void show(final RootPaneContainer frame) {<NEW_LINE>if (title == null) {<NEW_LINE>title = TextUtils.getText("edit_long_node");<NEW_LINE>}<NEW_LINE>final EditDialog editor = new LongNodeDialog(frame, title, getBackground());<NEW_LINE>redispatchKeyEvents(textComponent, firstEvent);<NEW_LINE>if (firstEvent == null) {<NEW_LINE>textComponent.setCaretPosition(textComponent.getDocument().getLength());<NEW_LINE>}<NEW_LINE>final JDialog dialog = editor.getDialog();<NEW_LINE>getEditControl().getEditType().installHolder(node, dialog);<NEW_LINE>configureDialog(dialog);<NEW_LINE>restoreDialogSize(dialog);<NEW_LINE>dialog.pack();<NEW_LINE>Controller.getCurrentModeController().getController().<MASK><NEW_LINE>if (ResourceController.getResourceController().getBooleanProperty("el__position_window_below_node")) {<NEW_LINE>UITools.setDialogLocationUnder(dialog, getNode());<NEW_LINE>} else {<NEW_LINE>UITools.setDialogLocationRelativeTo(dialog, getNode());<NEW_LINE>}<NEW_LINE>editor.show();<NEW_LINE>dialog.addComponentListener(new ComponentListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void componentShown(final ComponentEvent e) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void componentResized(final ComponentEvent e) {<NEW_LINE>saveDialogSize(dialog);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void componentMoved(final ComponentEvent e) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void componentHidden(final ComponentEvent e) {<NEW_LINE>editor.dispose();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
getMapViewManager().scrollNodeToVisible(node);
1,236,927
protected boolean drawChild(Canvas canvas, View child, long drawingTime) {<NEW_LINE>final LayoutParams lp = (LayoutParams) child.getLayoutParams();<NEW_LINE>boolean result;<NEW_LINE>final int save = canvas.save();<NEW_LINE>boolean drawScrim = false;<NEW_LINE>if (mCanSlide && !lp.slideable && mSlideableView != null) {<NEW_LINE>// Clip against the slider; no sense drawing what will immediately be covered,<NEW_LINE>// Unless the panel is set to overlay content<NEW_LINE>if (!mOverlayContent) {<NEW_LINE>canvas.getClipBounds(mTmpRect);<NEW_LINE>if (mIsSlidingUp) {<NEW_LINE>mTmpRect.bottom = Math.min(mTmpRect.bottom, mSlideableView.getTop());<NEW_LINE>} else {<NEW_LINE>mTmpRect.top = Math.max(mTmpRect.top, mSlideableView.getBottom());<NEW_LINE>}<NEW_LINE>canvas.clipRect(mTmpRect);<NEW_LINE>}<NEW_LINE>if (mSlideOffset < 1) {<NEW_LINE>drawScrim = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result = super.drawChild(canvas, child, drawingTime);<NEW_LINE>canvas.restoreToCount(save);<NEW_LINE>if (drawScrim) {<NEW_LINE>final int baseAlpha = (mCoveredFadeColor & 0xff000000) >>> 24;<NEW_LINE>final int imag = (int) (<MASK><NEW_LINE>final int color = imag << 24 | (mCoveredFadeColor & 0xffffff);<NEW_LINE>mCoveredFadePaint.setColor(color);<NEW_LINE>canvas.drawRect(mTmpRect, mCoveredFadePaint);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
baseAlpha * (1 - mSlideOffset));
558,081
public DescribeProvisionedProductResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeProvisionedProductResult describeProvisionedProductResult = new DescribeProvisionedProductResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return describeProvisionedProductResult;<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("ProvisionedProductDetail", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeProvisionedProductResult.setProvisionedProductDetail(ProvisionedProductDetailJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("CloudWatchDashboards", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeProvisionedProductResult.setCloudWatchDashboards(new ListUnmarshaller<CloudWatchDashboard>(CloudWatchDashboardJsonUnmarshaller.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 describeProvisionedProductResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
312,100
private STNode mergeQualifiedNameWithTypeDesc(STNode qualifiedName, STNode typeDesc) {<NEW_LINE>switch(typeDesc.kind) {<NEW_LINE>case SIMPLE_NAME_REFERENCE:<NEW_LINE>return qualifiedName;<NEW_LINE>case ARRAY_TYPE_DESC:<NEW_LINE>STArrayTypeDescriptorNode arrayTypeDesc = (STArrayTypeDescriptorNode) typeDesc;<NEW_LINE>STNode newMemberType = mergeQualifiedNameWithTypeDesc(qualifiedName, arrayTypeDesc.memberTypeDesc);<NEW_LINE>return STNodeFactory.createArrayTypeDescriptorNode(newMemberType, arrayTypeDesc.dimensions);<NEW_LINE>case UNION_TYPE_DESC:<NEW_LINE>STUnionTypeDescriptorNode unionTypeDesc = (STUnionTypeDescriptorNode) typeDesc;<NEW_LINE>STNode newlhsType = mergeQualifiedNameWithTypeDesc(qualifiedName, unionTypeDesc.leftTypeDesc);<NEW_LINE>return mergeTypesWithUnion(newlhsType, unionTypeDesc.pipeToken, unionTypeDesc.rightTypeDesc);<NEW_LINE>case INTERSECTION_TYPE_DESC:<NEW_LINE>STIntersectionTypeDescriptorNode intersectionTypeDesc = (STIntersectionTypeDescriptorNode) typeDesc;<NEW_LINE>newlhsType = mergeQualifiedNameWithTypeDesc(qualifiedName, intersectionTypeDesc.leftTypeDesc);<NEW_LINE>return mergeTypesWithIntersection(newlhsType, intersectionTypeDesc.bitwiseAndToken, intersectionTypeDesc.rightTypeDesc);<NEW_LINE>case OPTIONAL_TYPE_DESC:<NEW_LINE>STOptionalTypeDescriptorNode optionalType = (STOptionalTypeDescriptorNode) typeDesc;<NEW_LINE>newMemberType = <MASK><NEW_LINE>return STNodeFactory.createOptionalTypeDescriptorNode(newMemberType, optionalType.questionMarkToken);<NEW_LINE>default:<NEW_LINE>return typeDesc;<NEW_LINE>}<NEW_LINE>}
mergeQualifiedNameWithTypeDesc(qualifiedName, optionalType.typeDescriptor);
447,166
public Mono<Response<Void>> validateMoveWithResponseAsync(String resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (moveResourceEnvelope == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter moveResourceEnvelope is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>moveResourceEnvelope.validate();<NEW_LINE>}<NEW_LINE>return FluxUtil.withContext(context -> service.validateMove(this.client.getEndpoint(), resourceGroupName, this.client.getSubscriptionId(), this.client.getApiVersion(), moveResourceEnvelope, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));
823,645
public void caseIdentityStmt(IdentityStmt stmt) {<NEW_LINE>Value l = stmt.getLeftOp();<NEW_LINE>Value r = stmt.getRightOp();<NEW_LINE>if (l instanceof Local) {<NEW_LINE>TypeVariableBV left = resolver.typeVariable((Local) l);<NEW_LINE>if (!(r instanceof CaughtExceptionRef)) {<NEW_LINE>TypeVariableBV right = resolver.<MASK><NEW_LINE>right.addParent(left);<NEW_LINE>} else {<NEW_LINE>List<RefType> exceptionTypes = TrapManager.getExceptionTypesOf(stmt, stmtBody);<NEW_LINE>Iterator<RefType> typeIt = exceptionTypes.iterator();<NEW_LINE>while (typeIt.hasNext()) {<NEW_LINE>Type t = typeIt.next();<NEW_LINE>resolver.typeVariable(t).addParent(left);<NEW_LINE>}<NEW_LINE>if (uses) {<NEW_LINE>left.addParent(resolver.typeVariable(RefType.v("java.lang.Throwable")));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
typeVariable(r.getType());
1,467,478
public void run() {<NEW_LINE>super.run();<NEW_LINE>if (parent.isDirty()) {<NEW_LINE>try {<NEW_LINE>Object value = parent.extractEditorValue();<NEW_LINE>if (value instanceof Date) {<NEW_LINE>editor.setValue((Date) value);<NEW_LINE>}<NEW_LINE>} catch (DBException e) {<NEW_LINE>DBWorkbench.getPlatformUI().showError(ResultSetMessages.dialog_value_view_dialog_error_updating_title, ResultSetMessages.dialog_value_view_dialog_error_updating_message, e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Object value = parent.extractEditorValue();<NEW_LINE>if (!(value instanceof Date)) {<NEW_LINE>DBWorkbench.getPlatformUI().showWarningMessageBox(ResultSetMessages.dialog_value_view_error_parsing_date_title, NLS.bind(ResultSetMessages.dialog_value_view_error_parsing_date_message, value));<NEW_LINE>ModelPreferences.getPreferences().setValue(ModelPreferences.RESULT_SET_USE_DATETIME_EDITOR, false);<NEW_LINE>this.setChecked(false);<NEW_LINE>parent.textMode.setChecked(true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>editor.setToDateComposite();<NEW_LINE>} catch (DBException e) {<NEW_LINE>DBWorkbench.getPlatformUI().showError(ResultSetMessages.<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ModelPreferences.getPreferences().setValue(ModelPreferences.RESULT_SET_USE_DATETIME_EDITOR, true);<NEW_LINE>}
dialog_value_view_dialog_error_updating_title, ResultSetMessages.dialog_value_view_dialog_error_updating_message, e);
1,732,384
final GetKeyspaceResult executeGetKeyspace(GetKeyspaceRequest getKeyspaceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getKeyspaceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetKeyspaceRequest> request = null;<NEW_LINE>Response<GetKeyspaceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetKeyspaceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getKeyspaceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Keyspaces");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetKeyspace");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetKeyspaceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetKeyspaceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
188,906
private int[] computeVisibleSpan() {<NEW_LINE>Component parent = pane.getParent();<NEW_LINE>if (parent instanceof JLayeredPane) {<NEW_LINE>parent = parent.getParent();<NEW_LINE>}<NEW_LINE>if (parent instanceof JViewport) {<NEW_LINE>JViewport vp = (JViewport) parent;<NEW_LINE><MASK><NEW_LINE>Dimension size = vp.getExtentSize();<NEW_LINE>Point end = new Point((int) (start.getX() + size.getWidth()), (int) (start.getY() + size.getHeight()));<NEW_LINE>int startPosition = pane.viewToModel(start);<NEW_LINE>int endPosition = pane.viewToModel(end);<NEW_LINE>if (parentWithListener != vp) {<NEW_LINE>vp.addChangeListener(WeakListeners.change(this, vp));<NEW_LINE>parentWithListener = vp;<NEW_LINE>}<NEW_LINE>return new int[] { startPosition, endPosition };<NEW_LINE>}<NEW_LINE>return new int[] { 0, pane.getDocument().getLength() };<NEW_LINE>}
Point start = vp.getViewPosition();
173,614
public void load(final TreeNode parent, int level) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Enumeration<DefaultMutableTreeNode> children = (Enumeration<DefaultMutableTreeNode>) parent.children();<NEW_LINE>while (children.hasMoreElements()) {<NEW_LINE>final DefaultMutableTreeNode child = children.nextElement();<NEW_LINE>final IPropertyControlCreator userObject = (IPropertyControlCreator) child.getUserObject();<NEW_LINE>if (userObject != null) {<NEW_LINE>final String propertyName = userObject.getPropertyName();<NEW_LINE>final String translatedText = HtmlUtils.htmlToPlain(userObject.getTranslatedText());<NEW_LINE>if (!propertyName.isEmpty()) {<NEW_LINE>String tooltipText = HtmlUtils.htmlToPlain(userObject.getTranslatedTooltipText());<NEW_LINE>String currentTabTranslated = path.get(0);<NEW_LINE>if (path.size() > 1) {<NEW_LINE>String currentSeparatorTranslated = path.get(1);<NEW_LINE>// System.out.println(currentTabTranslated + ITEM_PATH_SEPARATOR + currentSeparatorTranslated + ITEM_PATH_SEPARATOR + translatedText);<NEW_LINE>if (parent.getChildCount() < 20) {<NEW_LINE>String prefPath = currentSeparatorTranslated + ITEM_PATH_SEPARATOR + translatedText;<NEW_LINE>prefs.add(new PreferencesItem(currentTabTranslated, propertyName, prefPath, tooltipText));<NEW_LINE>} else {<NEW_LINE>prefs.add(new PreferencesItem(currentTabTranslated, propertyName, translatedText, tooltipText));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>prefs.add(new PreferencesItem(currentTabTranslated, propertyName, translatedText, tooltipText));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>path.add(translatedText);<NEW_LINE>}<NEW_LINE>if (level < 2) {<NEW_LINE>load(child, level + 1);<NEW_LINE>}<NEW_LINE>if (propertyName.isEmpty()) {<NEW_LINE>path.remove(<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>load(child, level);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
path.size() - 1);
438,330
private static Vector combineServerLongFloatRowSplits(List<ServerRow> rowSplits, MatrixMeta matrixMeta, int rowIndex) {<NEW_LINE>long colNum = matrixMeta.getColNum();<NEW_LINE>int elemNum = 0;<NEW_LINE>int size = rowSplits.size();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>elemNum += rowSplits.get(i).size();<NEW_LINE>}<NEW_LINE>LongFloatVector row = VFactory.sparseLongKeyFloatVector(colNum, elemNum);<NEW_LINE>row.setMatrixId(matrixMeta.getId());<NEW_LINE>row.setRowId(rowIndex);<NEW_LINE>Collections.sort(rowSplits, serverRowComp);<NEW_LINE>int clock = Integer.MAX_VALUE;<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>if (rowSplits.get(i) == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (rowSplits.get(i).getClock() < clock) {<NEW_LINE>clock = rowSplits.<MASK><NEW_LINE>}<NEW_LINE>((ServerLongFloatRow) rowSplits.get(i)).mergeTo(row);<NEW_LINE>}<NEW_LINE>row.setClock(clock);<NEW_LINE>return row;<NEW_LINE>}
get(i).getClock();
1,212,417
// handle accessor aggregation (direct data window by-group access to properties)<NEW_LINE>public static AggregationMultiFunctionAnalysisResult analyzeAccessAggregations(List<AggregationServiceAggExpressionDesc> aggregations, ExprNode[] groupByNodes, boolean join) {<NEW_LINE>int currentSlot = 0;<NEW_LINE>Deque<AggregationMFIdentifier> accessProviderSlots = new ArrayDeque<AggregationMFIdentifier>();<NEW_LINE>List<AggregationAccessorSlotPairForge> accessorPairsForges = new ArrayList<>();<NEW_LINE>List<AggregationStateFactoryForge> <MASK><NEW_LINE>for (AggregationServiceAggExpressionDesc aggregation : aggregations) {<NEW_LINE>ExprAggregateNode aggregateNode = aggregation.getAggregationNode();<NEW_LINE>if (!aggregateNode.getFactory().isAccessAggregation()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>AggregationMultiFunctionStateKey providerKey = aggregateNode.getFactory().getAggregationStateKey(false);<NEW_LINE>AggregationMFIdentifier existing = findExisting(accessProviderSlots, providerKey, aggregateNode.getOptionalLocalGroupBy(), groupByNodes);<NEW_LINE>int slot;<NEW_LINE>if (existing == null) {<NEW_LINE>accessProviderSlots.add(new AggregationMFIdentifier(providerKey, aggregateNode.getOptionalLocalGroupBy(), currentSlot));<NEW_LINE>slot = currentSlot++;<NEW_LINE>AggregationStateFactoryForge providerForge = aggregateNode.getFactory().getAggregationStateFactory(false, join);<NEW_LINE>stateFactoryForges.add(providerForge);<NEW_LINE>} else {<NEW_LINE>slot = existing.getSlot();<NEW_LINE>}<NEW_LINE>AggregationAccessorForge accessorForge = aggregateNode.getFactory().getAccessorForge();<NEW_LINE>accessorPairsForges.add(new AggregationAccessorSlotPairForge(slot, accessorForge));<NEW_LINE>}<NEW_LINE>AggregationAccessorSlotPairForge[] forges = accessorPairsForges.toArray(new AggregationAccessorSlotPairForge[accessorPairsForges.size()]);<NEW_LINE>AggregationStateFactoryForge[] accessForges = stateFactoryForges.toArray(new AggregationStateFactoryForge[stateFactoryForges.size()]);<NEW_LINE>return new AggregationMultiFunctionAnalysisResult(forges, accessForges);<NEW_LINE>}
stateFactoryForges = new ArrayList<>();
439,885
public Queue<T> insertAll(int index, Iterable<? extends T> elements) {<NEW_LINE>Objects.requireNonNull(elements, "elements is null");<NEW_LINE>if (index < 0) {<NEW_LINE>throw new IndexOutOfBoundsException("insertAll(" + index + ", elements)");<NEW_LINE>}<NEW_LINE>final int length = front.length();<NEW_LINE>if (index <= length) {<NEW_LINE>if (isEmpty() && elements instanceof Queue) {<NEW_LINE>return (Queue<T>) elements;<NEW_LINE>} else {<NEW_LINE>final io.vavr.collection.List<T> newFront = front.insertAll(index, elements);<NEW_LINE>return (newFront == front) ? this : new Queue<>(newFront, rear);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final int rearIndex = index - length;<NEW_LINE>final int rearLength = rear.length();<NEW_LINE>if (rearIndex <= rearLength) {<NEW_LINE>final int reverseRearIndex = rearLength - rearIndex;<NEW_LINE>final io.vavr.collection.List<T> newRear = rear.insertAll(reverseRearIndex, io.vavr.collection.List.ofAll<MASK><NEW_LINE>return (newRear == rear) ? this : new Queue<>(front, newRear);<NEW_LINE>} else {<NEW_LINE>throw new IndexOutOfBoundsException("insertAll(" + index + ", elements) on Queue of length " + length());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(elements).reverse());
435,896
private List<BaseMessage> deserializeBaseMessage(ByteBuf input) {<NEW_LINE>if (input.readableBytes() == 0)<NEW_LINE>return Collections.emptyList();<NEW_LINE>List<BaseMessage> result = Lists.newArrayList();<NEW_LINE>long pullLogOffset = input.readLong();<NEW_LINE>// ignore consumer offset<NEW_LINE>input.readLong();<NEW_LINE>while (input.isReadable()) {<NEW_LINE>BaseMessage message = new BaseMessage();<NEW_LINE>byte flag = input.readByte();<NEW_LINE><MASK><NEW_LINE>String subject = PayloadHolderUtils.readString(input);<NEW_LINE>String messageId = PayloadHolderUtils.readString(input);<NEW_LINE>readTags(input, message, flag);<NEW_LINE>int bodyLen = input.readInt();<NEW_LINE>ByteBuf body = input.readSlice(bodyLen);<NEW_LINE>HashMap<String, Object> attrs = deserializeMapWrapper(subject, messageId, body);<NEW_LINE>message.setMessageId(messageId);<NEW_LINE>message.setSubject(subject);<NEW_LINE>message.setAttrs(attrs);<NEW_LINE>message.setProperty(BaseMessage.keys.qmq_pullOffset, pullLogOffset);<NEW_LINE>result.add(message);<NEW_LINE>pullLogOffset++;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
input.skipBytes(8 + 8);
1,391,202
private static void sanityCheck(File file, int expectedSize) throws IOException {<NEW_LINE>FileInputStream fis = new FileInputStream(file);<NEW_LINE>CheckpointManager manager;<NEW_LINE>try {<NEW_LINE>manager = new CheckpointManager(params, fis);<NEW_LINE>} finally {<NEW_LINE>fis.close();<NEW_LINE>}<NEW_LINE>checkState(manager.numCheckpoints() == expectedSize);<NEW_LINE>if (params.getId().equals(NetworkParameters.ID_MAINNET)) {<NEW_LINE>// Thu Jan 23 19:00:00 CET 2014<NEW_LINE>StoredBlock test = manager.getCheckpointBefore(1390500000);<NEW_LINE>checkState(test.getHeight() == 280224);<NEW_LINE>checkState(test.getHeader().getHashAsString().equals("00000000000000000b5d59a15f831e1c45cb688a4db6b0a60054d49a9997fa34"));<NEW_LINE>} else if (params.getId().equals(NetworkParameters.ID_TESTNET)) {<NEW_LINE>// Thu Jan 23 19:00:00 CET 2014<NEW_LINE>StoredBlock test = manager.getCheckpointBefore(1390500000);<NEW_LINE>checkState(test.getHeight() == 167328);<NEW_LINE>checkState(test.getHeader().getHashAsString().equals("0000000000035ae7d5025c2538067fe7adb1cf5d5d9c31b024137d9090ed13a9"));<NEW_LINE>} else if (params.getId().equals(NetworkParameters.ID_SIGNET)) {<NEW_LINE>// 2022-01-12<NEW_LINE>StoredBlock test = manager.getCheckpointBefore(1642000000);<NEW_LINE>checkState(<MASK><NEW_LINE>checkState(test.getHeader().getHashAsString().equals("0000008f763bdf23bd159a21ccf211098707671d2ca9aa72d0f586c24505c5e7"));<NEW_LINE>}<NEW_LINE>}
test.getHeight() == 72576);
1,007,375
public void init() {<NEW_LINE><MASK><NEW_LINE>Font boldFont = FontUtils.getSansBoldFont();<NEW_LINE>Font regularFont = FontUtils.getSansFont();<NEW_LINE>workCoordinateFont.add(font.deriveFont(Font.PLAIN, 18));<NEW_LINE>workCoordinateFont.add(font.deriveFont(Font.PLAIN, 24));<NEW_LINE>workCoordinateFont.add(font.deriveFont(Font.PLAIN, 32));<NEW_LINE>machineCoordinateFont.add(font.deriveFont(Font.PLAIN, 14));<NEW_LINE>machineCoordinateFont.add(font.deriveFont(Font.PLAIN, 18));<NEW_LINE>machineCoordinateFont.add(font.deriveFont(Font.PLAIN, 24));<NEW_LINE>speedValueFont.add(font.deriveFont(Font.PLAIN, 14));<NEW_LINE>speedValueFont.add(font.deriveFont(Font.PLAIN, 16));<NEW_LINE>speedValueFont.add(font.deriveFont(Font.PLAIN, 20));<NEW_LINE>activeStateFont.add(boldFont.deriveFont(Font.PLAIN, 20));<NEW_LINE>activeStateFont.add(boldFont.deriveFont(Font.PLAIN, 24));<NEW_LINE>activeStateFont.add(boldFont.deriveFont(Font.PLAIN, 30));<NEW_LINE>axisResetFont.add(regularFont.deriveFont(Font.PLAIN, 20));<NEW_LINE>axisResetFont.add(regularFont.deriveFont(Font.PLAIN, 24));<NEW_LINE>axisResetFont.add(regularFont.deriveFont(Font.PLAIN, 30));<NEW_LINE>axisResetZeroFont.add(regularFont.deriveFont(Font.PLAIN, 12));<NEW_LINE>axisResetZeroFont.add(regularFont.deriveFont(Font.PLAIN, 14));<NEW_LINE>axisResetZeroFont.add(regularFont.deriveFont(Font.PLAIN, 18));<NEW_LINE>propertyLabelFont.add(regularFont.deriveFont(Font.PLAIN, 12));<NEW_LINE>propertyLabelFont.add(regularFont.deriveFont(Font.PLAIN, 14));<NEW_LINE>propertyLabelFont.add(regularFont.deriveFont(Font.PLAIN, 17));<NEW_LINE>}
Font font = FontUtils.getLcdFont();
1,847,521
public static void createInstanceTemplateWithDiskType(String projectId, String templateName) throws IOException, ExecutionException, InterruptedException {<NEW_LINE>try (InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.create();<NEW_LINE>GlobalOperationsClient globalOperationsClient = GlobalOperationsClient.create()) {<NEW_LINE>AttachedDisk disk = AttachedDisk.newBuilder().setInitializeParams(AttachedDiskInitializeParams.newBuilder().setDiskSizeGb(10).setSourceImage("projects/debian-cloud/global/images/family/debian-10").build()).setAutoDelete(true).setBoot(true).setType(AttachedDisk.Type.PERSISTENT.toString()).build();<NEW_LINE>InstanceTemplate instanceTemplate = InstanceTemplate.newBuilder().setName(templateName).setProperties(InstanceProperties.newBuilder().setMachineType("n1-standard-1").addDisks(disk).addNetworkInterfaces(NetworkInterface.newBuilder().setName("global/networks/default").build()).build()).build();<NEW_LINE>InsertInstanceTemplateRequest insertInstanceTemplateRequest = InsertInstanceTemplateRequest.newBuilder().setProject(projectId).setInstanceTemplateResource(instanceTemplate).build();<NEW_LINE>Operation response = instanceTemplatesClient.insertAsync(insertInstanceTemplateRequest).get();<NEW_LINE>if (response.hasError()) {<NEW_LINE>System.<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>System.out.printf("Instance Template Operation Status %s: %s", templateName, response.getStatus());<NEW_LINE>}<NEW_LINE>}
out.println("Instance Template creation failed ! ! " + response);
307,272
protected MeasureValue[][][] retrieveTotals(List<Bucket> vals, List<BucketMap> bucketMaps) {<NEW_LINE>MeasureValue[][][] totals = new MeasureValue[rowBucketCount + 1][colBucketCount + 1][];<NEW_LINE>for (int row = rowRetrTotalMax; row >= rowRetrTotalMin; --row) {<NEW_LINE>if (!rowRetrTotals[row]) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>BucketMap rowMap = bucketMaps.get(row);<NEW_LINE>for (int i = row; rowMap != null && i < rowBucketCount; ++i) {<NEW_LINE>MapEntry totalEntry = rowMap.getTotalEntry();<NEW_LINE>rowMap = totalEntry == null ? null : <MASK><NEW_LINE>}<NEW_LINE>for (int col = 0; col <= rowRetrColMax[row]; ++col) {<NEW_LINE>BucketMap colMap = rowMap;<NEW_LINE>if (col < colBucketCount - 1) {<NEW_LINE>if (row == rowBucketCount) {<NEW_LINE>rowMap = bucketMaps.get(rowBucketCount + col + 1);<NEW_LINE>} else if (rowMap != null) {<NEW_LINE>rowMap = (BucketMap) rowMap.get(vals.get(rowBucketCount + col));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!retrieveTotal[row][col]) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (int i = col + 1; colMap != null && i < colBucketCount; ++i) {<NEW_LINE>colMap = (BucketMap) colMap.getTotalEntry().getValue();<NEW_LINE>}<NEW_LINE>if (colMap != null) {<NEW_LINE>if (col == colBucketCount) {<NEW_LINE>MeasureValue[] measureValues = (MeasureValue[]) colMap.get(vals.get(rowBucketCount + colBucketCount - 1));<NEW_LINE>if (measureValues != null) {<NEW_LINE>totals[row][col] = getUserMeasureValues(measureValues);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>MapEntry totalEntry = colMap.getTotalEntry();<NEW_LINE>if (totalEntry != null) {<NEW_LINE>MeasureValue[] totalValues = (MeasureValue[]) totalEntry.getValue();<NEW_LINE>totals[row][col] = getUserMeasureValues(totalValues);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (totals[row][col] == null) {<NEW_LINE>totals[row][col] = zeroUserMeasureValues;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return totals;<NEW_LINE>}
(BucketMap) totalEntry.getValue();
245,189
// Explicitly checking for named null.<NEW_LINE>@SuppressWarnings("ReferenceEquality")<NEW_LINE>@Override<NEW_LINE>@Nullable<NEW_LINE>public File dumpHeap() {<NEW_LINE>File heapDumpFile = leakDirectoryProvider.newHeapDumpFile();<NEW_LINE>if (heapDumpFile == RETRY_LATER) {<NEW_LINE>return RETRY_LATER;<NEW_LINE>}<NEW_LINE>FutureResult<Toast> waitingForToast = new FutureResult<>();<NEW_LINE>showToast(waitingForToast);<NEW_LINE>if (!waitingForToast.wait(5, SECONDS)) {<NEW_LINE>CanaryLog.d("Did not dump heap, too much time waiting for Toast.");<NEW_LINE>return RETRY_LATER;<NEW_LINE>}<NEW_LINE>Notification.Builder builder = new Notification.Builder(context).setContentTitle(context.getString(R.string.leak_canary_notification_dumping));<NEW_LINE>Notification notification = <MASK><NEW_LINE>NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);<NEW_LINE>int notificationId = (int) SystemClock.uptimeMillis();<NEW_LINE>notificationManager.notify(notificationId, notification);<NEW_LINE>Toast toast = waitingForToast.get();<NEW_LINE>try {<NEW_LINE>Debug.dumpHprofData(heapDumpFile.getAbsolutePath());<NEW_LINE>cancelToast(toast);<NEW_LINE>notificationManager.cancel(notificationId);<NEW_LINE>return heapDumpFile;<NEW_LINE>} catch (Exception e) {<NEW_LINE>CanaryLog.d(e, "Could not dump heap");<NEW_LINE>// Abort heap dump<NEW_LINE>return RETRY_LATER;<NEW_LINE>}<NEW_LINE>}
LeakCanaryInternals.buildNotification(context, builder);
274,797
public void startAdminHttpService() {<NEW_LINE>try {<NEW_LINE>Properties properties = new Properties();<NEW_LINE>properties.load(this.getClass().getResource("build.properties").openStream());<NEW_LINE>LOG.info("build.properties build_revision: {}", properties<MASK><NEW_LINE>} catch (Throwable t) {<NEW_LINE>LOG.warn("Failed to load properties from build.properties", t);<NEW_LINE>}<NEW_LINE>Duration[] defaultLatchIntervals = { Duration.apply(1, TimeUnit.MINUTES) };<NEW_LINE>Iterator<Duration> durationIterator = Arrays.asList(defaultLatchIntervals).iterator();<NEW_LINE>@SuppressWarnings("deprecation")<NEW_LINE>AdminServiceFactory adminServiceFactory = new AdminServiceFactory(this.port, 20, List$.MODULE$.empty(), Option.empty(), List$.MODULE$.empty(), Map$.MODULE$.empty(), JavaConversions.asScalaIterator(durationIterator).toList());<NEW_LINE>RuntimeEnvironment runtimeEnvironment = new RuntimeEnvironment(this);<NEW_LINE>AdminHttpService service = adminServiceFactory.apply(runtimeEnvironment);<NEW_LINE>for (Map.Entry<String, CustomHttpHandler> entry : this.customHttpHandlerMap.entrySet()) {<NEW_LINE>service.httpServer().createContext(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>}
.getProperty("build_revision", "unknown"));
1,760,955
private void showHintInEditor(AbstractPopup hint, Editor editor, Context context) {<NEW_LINE>closeHint();<NEW_LINE>myMouseMovementTracker.reset();<NEW_LINE>myKeepPopupOnMouseMove = false;<NEW_LINE>editor.putUserData(PopupFactoryImpl.ANCHOR_POPUP_POSITION<MASK><NEW_LINE>try {<NEW_LINE>PopupPositionManager.positionPopupInBestPosition(hint, editor, null);<NEW_LINE>} finally {<NEW_LINE>editor.putUserData(PopupFactoryImpl.ANCHOR_POPUP_POSITION, null);<NEW_LINE>}<NEW_LINE>Window window = hint.getPopupWindow();<NEW_LINE>if (window != null) {<NEW_LINE>window.setFocusableWindowState(true);<NEW_LINE>IdeEventQueue.getInstance().addDispatcher(e -> {<NEW_LINE>if (e.getID() == MouseEvent.MOUSE_PRESSED && e.getSource() == window) {<NEW_LINE>myKeepPopupOnMouseMove = true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}, hint);<NEW_LINE>}<NEW_LINE>}
, context.getPopupPosition(editor));
913,612
public StringBuffer printStatement(int indent, StringBuffer output) {<NEW_LINE>int length = this.resources.length;<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$<NEW_LINE>printIndent(indent, output).append("try" + (length == 0 ? "\n" : " ("));<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>Statement stmt = this.resources[i];<NEW_LINE>if (stmt instanceof LocalDeclaration) {<NEW_LINE>((LocalDeclaration) stmt).printAsExpression(0, output);<NEW_LINE>} else if (stmt instanceof Reference) {<NEW_LINE>((Reference) stmt).printExpression(0, output);<NEW_LINE>} else<NEW_LINE>continue;<NEW_LINE>if (i != length - 1) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>output.append(";\n");<NEW_LINE>printIndent(indent + 2, output);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (length > 0) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>output.append(")\n");<NEW_LINE>}<NEW_LINE>this.tryBlock.<MASK><NEW_LINE>// catches<NEW_LINE>if (this.catchBlocks != null)<NEW_LINE>for (int i = 0; i < this.catchBlocks.length; i++) {<NEW_LINE>output.append('\n');<NEW_LINE>// $NON-NLS-1$<NEW_LINE>printIndent(indent, output).append("catch (");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>this.catchArguments[i].print(0, output).append(")\n");<NEW_LINE>this.catchBlocks[i].printStatement(indent + 1, output);<NEW_LINE>}<NEW_LINE>// finally<NEW_LINE>if (this.finallyBlock != null) {<NEW_LINE>output.append('\n');<NEW_LINE>// $NON-NLS-1$<NEW_LINE>printIndent(indent, output).append("finally\n");<NEW_LINE>this.finallyBlock.printStatement(indent + 1, output);<NEW_LINE>}<NEW_LINE>return output;<NEW_LINE>}
printStatement(indent + 1, output);
620,477
public FactLine balanceSource() {<NEW_LINE>if (!m_acctSchema.isSuspenseBalancing() || m_doc.isMultiCurrency())<NEW_LINE>return null;<NEW_LINE>BigDecimal diff = getSourceBalance();<NEW_LINE>log.finer("Diff=" + diff);<NEW_LINE>// new line<NEW_LINE>FactLine line = new FactLine(m_doc.getCtx(), m_doc.get_Table_ID(), m_doc.get_ID(), 0, m_trxName);<NEW_LINE>line.setDocumentInfo(m_doc, null);<NEW_LINE>line.setPostingType(m_postingType);<NEW_LINE>// Account<NEW_LINE>line.setAccount(<MASK><NEW_LINE>// Amount<NEW_LINE>if (// negative balance => DR<NEW_LINE>diff.signum() < 0)<NEW_LINE>line.setAmtSource(m_doc.getC_Currency_ID(), diff.abs(), Env.ZERO);<NEW_LINE>else<NEW_LINE>// positive balance => CR<NEW_LINE>line.setAmtSource(m_doc.getC_Currency_ID(), Env.ZERO, diff);<NEW_LINE>// Convert<NEW_LINE>line.convert();<NEW_LINE>//<NEW_LINE>log.fine(line.toString());<NEW_LINE>m_lines.add(line);<NEW_LINE>return line;<NEW_LINE>}
m_acctSchema, m_acctSchema.getSuspenseBalancing_Acct());
373,312
private void loadNode85() {<NEW_LINE>UaObjectTypeNode node = new UaObjectTypeNode(this.context, Identifiers.ConditionType, new QualifiedName(0, "ConditionType"), new LocalizedText("en", "ConditionType"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), true);<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType, Identifiers.HasProperty, Identifiers.ConditionType_ConditionClassId.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType, Identifiers.HasProperty, Identifiers.ConditionType_ConditionClassName.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType, Identifiers.HasProperty, Identifiers.ConditionType_ConditionName.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType, Identifiers.HasProperty, Identifiers.ConditionType_BranchId.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType, Identifiers.HasProperty, Identifiers.ConditionType_Retain.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType, Identifiers.HasComponent, Identifiers.ConditionType_EnabledState.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType, Identifiers.HasComponent, Identifiers.ConditionType_Quality.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType, Identifiers.HasComponent, Identifiers.ConditionType_LastSeverity.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType, Identifiers.HasComponent, Identifiers.ConditionType_Comment.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType, Identifiers.HasProperty, Identifiers.ConditionType_ClientUserId.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType, Identifiers.HasComponent, Identifiers.ConditionType_Disable<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType, Identifiers.HasComponent, Identifiers.ConditionType_Enable.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType, Identifiers.HasComponent, Identifiers.ConditionType_AddComment.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType, Identifiers.HasComponent, Identifiers.ConditionType_ConditionRefresh.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType, Identifiers.HasComponent, Identifiers.ConditionType_ConditionRefresh2.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType, Identifiers.HasSubtype, Identifiers.BaseEventType.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), true));
367,115
public void compute(ActionRequest request, ActionResponse response) throws AxelorException {<NEW_LINE>Context context = request.getContext();<NEW_LINE>InvoiceLine invoiceLine = context.asType(InvoiceLine.class);<NEW_LINE>Invoice invoice = this.getInvoice(context);<NEW_LINE>if (invoice == null || invoiceLine.getPrice() == null || invoiceLine.getInTaxPrice() == null || invoiceLine.getQty() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>InvoiceLineService invoiceLineService = Beans.get(InvoiceLineService.class);<NEW_LINE>BigDecimal exTaxTotal;<NEW_LINE>BigDecimal companyExTaxTotal;<NEW_LINE>BigDecimal inTaxTotal;<NEW_LINE>BigDecimal companyInTaxTotal;<NEW_LINE>BigDecimal priceDiscounted = invoiceLineService.computeDiscount(invoiceLine, invoice.getInAti());<NEW_LINE>response.setValue("priceDiscounted", priceDiscounted);<NEW_LINE>response.setAttr("priceDiscounted", "hidden", priceDiscounted.compareTo(invoice.getInAti() ? invoiceLine.getInTaxPrice() : invoiceLine.getPrice()) == 0);<NEW_LINE>BigDecimal taxRate = BigDecimal.ZERO;<NEW_LINE>if (invoiceLine.getTaxLine() != null) {<NEW_LINE>taxRate = invoiceLine.getTaxLine().getValue();<NEW_LINE>response.setValue("taxRate", taxRate);<NEW_LINE>response.setValue("taxCode", invoiceLine.getTaxLine().getTax().getCode());<NEW_LINE>}<NEW_LINE>if (!invoice.getInAti()) {<NEW_LINE>exTaxTotal = InvoiceLineManagement.computeAmount(invoiceLine.getQty(), priceDiscounted);<NEW_LINE>inTaxTotal = exTaxTotal.add(exTaxTotal.multiply(taxRate));<NEW_LINE>} else {<NEW_LINE>inTaxTotal = InvoiceLineManagement.computeAmount(invoiceLine.getQty(), priceDiscounted);<NEW_LINE>exTaxTotal = inTaxTotal.divide(taxRate.add(BigDecimal.ONE), 2, BigDecimal.ROUND_HALF_UP);<NEW_LINE>}<NEW_LINE>companyExTaxTotal = invoiceLineService.getCompanyExTaxTotal(exTaxTotal, invoice);<NEW_LINE>companyInTaxTotal = invoiceLineService.getCompanyExTaxTotal(inTaxTotal, invoice);<NEW_LINE>response.setValue("exTaxTotal", exTaxTotal);<NEW_LINE>response.setValue("inTaxTotal", inTaxTotal);<NEW_LINE>response.setValue("companyInTaxTotal", companyInTaxTotal);<NEW_LINE><MASK><NEW_LINE>}
response.setValue("companyExTaxTotal", companyExTaxTotal);
889,679
public NetworkAclAssociation unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>NetworkAclAssociation networkAclAssociation = new NetworkAclAssociation();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>int xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent == XmlPullParser.END_DOCUMENT)<NEW_LINE>return networkAclAssociation;<NEW_LINE>if (xmlEvent == XmlPullParser.START_TAG) {<NEW_LINE>if (context.testExpression("networkAclAssociationId", targetDepth)) {<NEW_LINE>networkAclAssociation.setNetworkAclAssociationId(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("networkAclId", targetDepth)) {<NEW_LINE>networkAclAssociation.setNetworkAclId(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("subnetId", targetDepth)) {<NEW_LINE>networkAclAssociation.setSubnetId(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent == XmlPullParser.END_TAG) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return networkAclAssociation;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().unmarshall(context));
500,043
public boolean createEdgeFirewall(String tenantName, String publicIp, String insideIp, String publicSubnet, String insideSubnet) throws ExecutionException {<NEW_LINE>String xml = VnmcXml.CREATE_EDGE_FIREWALL.getXml();<NEW_LINE>String service = VnmcXml.CREATE_EDGE_FIREWALL.getService();<NEW_LINE>xml = replaceXmlValue(xml, "cookie", _cookie);<NEW_LINE>xml = replaceXmlValue(xml, "edgefwdescr", "Edge Firewall for Tenant VDC " + tenantName);<NEW_LINE>xml = replaceXmlValue(xml<MASK><NEW_LINE>xml = replaceXmlValue(xml, "edgefwdn", getDnForEdgeFirewall(tenantName));<NEW_LINE>xml = replaceXmlValue(xml, "insideintfname", getNameForEdgeInsideIntf(tenantName));<NEW_LINE>xml = replaceXmlValue(xml, "outsideintfname", getNameForEdgeOutsideIntf(tenantName));<NEW_LINE>xml = replaceXmlValue(xml, "insideintfdn", getDnForInsideIntf(tenantName));<NEW_LINE>xml = replaceXmlValue(xml, "outsideintfdn", getDnForOutsideIntf(tenantName));<NEW_LINE>xml = replaceXmlValue(xml, "deviceserviceprofiledn", getDnForEdgeFirewall(tenantName) + "/device-service-profile");<NEW_LINE>xml = replaceXmlValue(xml, "outsideintfsp", getDnForOutsideIntf(tenantName) + "/interface-service-profile");<NEW_LINE>xml = replaceXmlValue(xml, "secprofileref", getNameForEdgeDeviceSecurityProfile(tenantName));<NEW_LINE>xml = replaceXmlValue(xml, "deviceserviceprofile", getNameForEdgeDeviceServiceProfile(tenantName));<NEW_LINE>xml = replaceXmlValue(xml, "insideip", insideIp);<NEW_LINE>xml = replaceXmlValue(xml, "publicip", publicIp);<NEW_LINE>xml = replaceXmlValue(xml, "insidesubnet", insideSubnet);<NEW_LINE>xml = replaceXmlValue(xml, "outsidesubnet", publicSubnet);<NEW_LINE>String response = sendRequest(service, xml);<NEW_LINE>return verifySuccess(response);<NEW_LINE>}
, "edgefwname", getNameForEdgeFirewall(tenantName));
1,800,018
final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(tagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><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 TagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(tagResourceRequest));<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, "drs");<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>HttpResponseHandler<AmazonWebServiceResponse<TagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TagResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
644,960
final ListProjectsResult executeListProjects(ListProjectsRequest listProjectsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listProjectsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListProjectsRequest> request = null;<NEW_LINE>Response<ListProjectsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListProjectsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listProjectsRequest));<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, "DataBrew");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListProjects");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListProjectsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListProjectsResultJsonUnmarshaller());<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());
829,842
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {<NEW_LINE>if (state() == State.HEADER) {<NEW_LINE>int nLoc = in.bytesBefore((byte) '\n');<NEW_LINE>ByteBuf headerBuf = in.readBytes(nLoc + 1);<NEW_LINE>String headerLine = headerBuf.toString(UTF8).trim();<NEW_LINE>nLoc = in.bytesBefore((byte) '\n');<NEW_LINE>in.readBytes(nLoc);<NEW_LINE>in.readByte();<NEW_LINE>if (headerLine.startsWith(CONTENT_LENGTH)) {<NEW_LINE>String lenStr = headerLine.substring(CONTENT_LENGTH.length()).trim();<NEW_LINE>this.length = Integer.parseInt(lenStr);<NEW_LINE>state(State.BODY);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (state() == State.BODY) {<NEW_LINE>JsonNode node = mapper.readTree(new ByteBufInputStream(in, this.length));<NEW_LINE>String type = node.get("type").asText();<NEW_LINE>if ("request".equals(type)) {<NEW_LINE>String commandStr = node.<MASK><NEW_LINE>AbstractCommand command = this.debugger.getCommand(commandStr);<NEW_LINE>if (command != null) {<NEW_LINE>Request request = command.newRequest();<NEW_LINE>request.setSeq(node.get("seq").asInt());<NEW_LINE>ObjectReader reader = mapper.reader().withValueToUpdate(request);<NEW_LINE>if (node.has("arguments")) {<NEW_LINE>reader.readValue(node.get("arguments"));<NEW_LINE>} else if (request instanceof NoArgumentsRequest) {<NEW_LINE>reader.readValue(node);<NEW_LINE>}<NEW_LINE>out.add(request);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>state(State.HEADER);<NEW_LINE>this.length = -1;<NEW_LINE>}<NEW_LINE>}
get("command").asText();
1,072,237
final DeleteFrameworkResult executeDeleteFramework(DeleteFrameworkRequest deleteFrameworkRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteFrameworkRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteFrameworkRequest> request = null;<NEW_LINE>Response<DeleteFrameworkResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteFrameworkRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteFrameworkRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Backup");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteFrameworkResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteFrameworkResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteFramework");
1,698,324
private // is thrown.<NEW_LINE>Trait loadOrDeriveProtocolTrait(Model model, ServiceShape service) {<NEW_LINE>ServiceIndex serviceIndex = ServiceIndex.of(model);<NEW_LINE>Set<ShapeId> serviceProtocols = serviceIndex.getProtocols(service).keySet();<NEW_LINE>if (config.getProtocol() != null) {<NEW_LINE>ShapeId protocolTraitId = config.getProtocol();<NEW_LINE>return service.findTrait(protocolTraitId).orElseThrow(() -> {<NEW_LINE>return new OpenApiException(String.format("Unable to find protocol `%s` on service `%s`. This service supports the following " + "protocols: %s", protocolTraitId, service.getId(), serviceProtocols));<NEW_LINE>});<NEW_LINE>} else if (serviceProtocols.isEmpty()) {<NEW_LINE>throw new OpenApiException(String.format("No Smithy protocol was configured and `%s` does not define any protocols.", service.getId()));<NEW_LINE>} else if (serviceProtocols.size() > 1) {<NEW_LINE>throw new OpenApiException(String.format("No Smithy protocol was configured and `%s` defines multiple protocols: %s", service<MASK><NEW_LINE>} else {<NEW_LINE>// Get the first and only service protocol trait.<NEW_LINE>return serviceIndex.getProtocols(service).values().iterator().next();<NEW_LINE>}<NEW_LINE>}
.getId(), serviceProtocols));
837,411
public static NbPlatform addPlatform(final String id, final File destdir, final File harness, final String label) throws IOException {<NEW_LINE>try {<NEW_LINE>ProjectManager.mutex().writeAccess(new Mutex.ExceptionAction<Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void run() throws IOException {<NEW_LINE>if (getPlatformByID(id) != null) {<NEW_LINE>throw new IOException("ID " + id + " already taken");<NEW_LINE>}<NEW_LINE>EditableProperties props = PropertyUtils.getGlobalProperties();<NEW_LINE>String plafDestDir = PLATFORM_PREFIX + id + PLATFORM_DEST_DIR_SUFFIX;<NEW_LINE>props.setProperty(plafDestDir, destdir.getAbsolutePath());<NEW_LINE>if (!destdir.isDirectory()) {<NEW_LINE>throw new FileNotFoundException(destdir.getAbsolutePath());<NEW_LINE>}<NEW_LINE>storeHarnessLocation(id, destdir, harness, props);<NEW_LINE>props.setProperty(PLATFORM_PREFIX + id + PLATFORM_LABEL_SUFFIX, label);<NEW_LINE>PropertyUtils.putGlobalProperties(props);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (MutexException e) {<NEW_LINE>throw (IOException) e.getException();<NEW_LINE>}<NEW_LINE>NbPlatform plaf = new NbPlatform(id, label, FileUtil.normalizeFile(destdir), harness, ApisupportAntUtils.findURLs(null), ApisupportAntUtils.findURLs(null));<NEW_LINE>getPlatformsInternal().add(plaf);<NEW_LINE>LOG.log(<MASK><NEW_LINE>return plaf;<NEW_LINE>}
Level.FINE, "NbPlatform added: {0}", plaf);
575,103
private Mono<PagedResponse<VirtualMachineSizeInner>> listAvailableSizesSinglePageAsync(String resourceGroupName, String vmName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (vmName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2020-06-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listAvailableSizes(this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, this.client.getSubscriptionId(), accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null));<NEW_LINE>}
error(new IllegalArgumentException("Parameter vmName is required and cannot be null."));
117,541
public static GetDBListFromAgentResponse unmarshall(GetDBListFromAgentResponse getDBListFromAgentResponse, UnmarshallerContext _ctx) {<NEW_LINE>getDBListFromAgentResponse.setRequestId(_ctx.stringValue("GetDBListFromAgentResponse.RequestId"));<NEW_LINE>getDBListFromAgentResponse.setSuccess(_ctx.booleanValue("GetDBListFromAgentResponse.Success"));<NEW_LINE>getDBListFromAgentResponse.setErrCode<MASK><NEW_LINE>getDBListFromAgentResponse.setErrMessage(_ctx.stringValue("GetDBListFromAgentResponse.ErrMessage"));<NEW_LINE>getDBListFromAgentResponse.setHttpStatusCode(_ctx.integerValue("GetDBListFromAgentResponse.HttpStatusCode"));<NEW_LINE>List<String> dbList = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetDBListFromAgentResponse.DbList.Length"); i++) {<NEW_LINE>dbList.add(_ctx.stringValue("GetDBListFromAgentResponse.DbList[" + i + "]"));<NEW_LINE>}<NEW_LINE>getDBListFromAgentResponse.setDbList(dbList);<NEW_LINE>return getDBListFromAgentResponse;<NEW_LINE>}
(_ctx.stringValue("GetDBListFromAgentResponse.ErrCode"));
1,763,940
private static Builder createPackingInstructionFieldBuilder() {<NEW_LINE>return //<NEW_LINE>DocumentFieldDescriptor.builder(IForecastLineQuickInput.COLUMNNAME_M_HU_PI_Item_Product_ID).setCaption(Services.get(IMsgBL.class).translatable(IForecastLineQuickInput.COLUMNNAME_M_HU_PI_Item_Product_ID)).setWidgetType(DocumentFieldWidgetType.Lookup).setLookupDescriptorProvider(// ctxTableName<NEW_LINE>SqlLookupDescriptor.builder().// ctxTableName<NEW_LINE>setCtxTableName(null).setCtxColumnName(IForecastLineQuickInput.COLUMNNAME_M_HU_PI_Item_Product_ID).setDisplayType(// FIXME: hardcoded "M_HU_PI_Item_Product_For_Org_and_Product_and_DatePromised"<NEW_LINE>DisplayType.TableDir).// FIXME: hardcoded "M_HU_PI_Item_Product_For_Org_and_Product_and_DatePromised"<NEW_LINE>setAD_Val_Rule_ID(540365).buildProvider()).setValueClass(IntegerLookupValue.class).setReadonlyLogic(ConstantLogicExpression.FALSE).setAlwaysUpdateable(true).setMandatoryLogic(ConstantLogicExpression.FALSE).setDisplayLogic(ConstantLogicExpression.TRUE<MASK><NEW_LINE>}
).addCharacteristic(Characteristic.PublicField);
1,016,689
public void onStartup(Set<Class<?>> setOfClassesInterestedIn, ServletContext context) throws ServletException {<NEW_LINE>System.out.println("--- Servlet A CONTAINER INITIALIZER! ---");<NEW_LINE>// going to add a context attribute to show the set of classes that were passed in<NEW_LINE>if (setOfClassesInterestedIn != null) {<NEW_LINE>String sciName = "SCI A";<NEW_LINE>// Unique attribute for each SCI. Intended to show that this SCI ran.<NEW_LINE>context.<MASK><NEW_LINE>// All SCIs set this attribute. Value will only stick if this SCI runs last.<NEW_LINE>context.setAttribute("SciLastOneToRun", "Last SCI to run is [" + sciName + "]!!! ");<NEW_LINE>String sciOrder = (String) (context.getAttribute("sciOrder"));<NEW_LINE>context.setAttribute("sciOrder", (sciOrder == null ? "" : sciOrder) + "A");<NEW_LINE>// context.setRequestCharacterEncoding("KSC5601");<NEW_LINE>// context.setResponseCharacterEncoding("KSC5601");<NEW_LINE>context.setAttribute("SET_OF_SERVLETS_IN_APP", setOfClassesInterestedIn);<NEW_LINE>} else {<NEW_LINE>context.setAttribute("SET_OF_SERVLETS_IN_APP", "null");<NEW_LINE>}<NEW_LINE>System.out.println("--- Servlet A CONTAINER INITIALIZER! --- EXIT");<NEW_LINE>}
setAttribute("Sci_A_RanMsg", sciName + " actually ran! ");
640,391
protected Map<Object, Object> convertToParameters(Object... iArgs) {<NEW_LINE>final Map<Object, Object> params;<NEW_LINE>if (iArgs.length == 1 && iArgs[0] instanceof Map) {<NEW_LINE>params = (Map<Object, Object>) iArgs[0];<NEW_LINE>} else {<NEW_LINE>if (iArgs.length == 1 && iArgs[0] != null && iArgs[0].getClass().isArray() && iArgs[0] instanceof Object[])<NEW_LINE>iArgs = (<MASK><NEW_LINE>params = new HashMap<Object, Object>(iArgs.length);<NEW_LINE>for (int i = 0; i < iArgs.length; ++i) {<NEW_LINE>Object par = iArgs[i];<NEW_LINE>if (par instanceof OIdentifiable && ((OIdentifiable) par).getIdentity().isValid())<NEW_LINE>// USE THE RID ONLY<NEW_LINE>par = ((OIdentifiable) par).getIdentity();<NEW_LINE>params.put(i, par);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return params;<NEW_LINE>}
Object[]) iArgs[0];
1,396,027
private static long triggerNotification() {<NEW_LINE>long maxMemory = tenuredGenPool.getUsage().getMax();<NEW_LINE>long usedMemory = tenuredGenPool.getUsage().getUsed();<NEW_LINE><MASK><NEW_LINE>long usedMem = runtime.totalMemory() - runtime.freeMemory();<NEW_LINE>synchronized (warningSystems) {<NEW_LINE>Iterator<MemoryWarningSystem> it = warningSystems.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>MemoryWarningSystem ws = it.next();<NEW_LINE>if (ws.threshold <= usedMemory) {<NEW_LINE>logger.info("Triggering memory warning at " + (usedMem / 1000 / 1000) + " MB (" + (maxMemory / 1000 / 1000) + " MB max, " + (usedMemory / 1000 / 1000) + " in watched memory pool)...");<NEW_LINE>for (OnMemoryThresholdReached listener : ws.listeners) listener.onThresholdReached(usedMemory, maxMemory);<NEW_LINE>it.remove();<NEW_LINE>} else {<NEW_LINE>// At least one warning systme has a higher threshold<NEW_LINE>tenuredGenPool.setUsageThreshold(ws.threshold);<NEW_LINE>return ws.threshold;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>}
Runtime runtime = Runtime.getRuntime();
536,364
private void processDeletion(SortByVcsRoots<FilePath> sortByVcsRoots) {<NEW_LINE>final MultiMap<VcsRoot, FilePath> map = sortByVcsRoots.sort(myDeleted);<NEW_LINE>myPreparedDeletion = new MultiMap<>();<NEW_LINE>for (VcsRoot vcsRoot : map.keySet()) {<NEW_LINE>if (vcsRoot != null && vcsRoot.getVcs() != null) {<NEW_LINE>final CheckinEnvironment localChangesProvider = vcsRoot.getVcs().getCheckinEnvironment();<NEW_LINE>if (localChangesProvider == null)<NEW_LINE>continue;<NEW_LINE>final boolean takeDirs = vcsRoot.getVcs().areDirectoriesVersionedItems();<NEW_LINE>final Collection<FilePath> <MASK><NEW_LINE>final List<FilePath> toBeDeleted = new LinkedList<>();<NEW_LINE>for (FilePath file : files) {<NEW_LINE>final FilePath parent = file.getParentPath();<NEW_LINE>if ((takeDirs || (!file.isDirectory())) && parent != null && parent.getIOFile().exists()) {<NEW_LINE>toBeDeleted.add(file);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (toBeDeleted.isEmpty())<NEW_LINE>return;<NEW_LINE>if (!vcsRoot.getVcs().fileListenerIsSynchronous()) {<NEW_LINE>for (FilePath filePath : toBeDeleted) {<NEW_LINE>myVcsFileListenerContextHelper.ignoreDeleted(filePath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>myPreparedDeletion.put(vcsRoot, toBeDeleted);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
files = map.get(vcsRoot);
1,310,095
public Forwardable<? extends ThingVertex, Order.Asc> branch(GraphManager graphMgr, Vertex<?, ?> fromVertex, Traversal.Parameters params) {<NEW_LINE>assert fromVertex.isThing() && fromVertex.asThing().isAttribute();<NEW_LINE>Forwardable<ThingVertex, Order.Asc> iter;<NEW_LINE>AttributeVertex<?> att = fromVertex.asThing().asAttribute();<NEW_LINE>if (to.props().hasIID()) {<NEW_LINE>iter = backwardBranchToIIDFiltered(graphMgr, att, HAS, params.getIID(to.id().asVariable()), to.props().types());<NEW_LINE>} else {<NEW_LINE>Set<TypeVertex> owners = graphMgr.schema().ownersOfAttributeType(att.type());<NEW_LINE>iter = iterate(owners).filter(owner -> to.props().types().contains(owner.properLabel())).mergeMap(t -> att.ins().edge(HAS, PrefixIID.of(t.encoding().instance()), t.iid()<MASK><NEW_LINE>}<NEW_LINE>if (to.props().predicates().isEmpty())<NEW_LINE>return iter;<NEW_LINE>else<NEW_LINE>return to.filterPredicates(mapToAttributes(iter), params);<NEW_LINE>}
).from(), ASC);
1,352,112
public Result uploadFile(Http.Request request, Long petId) throws Exception {<NEW_LINE>String[] valueadditionalMetadata = request.body().asMultipartFormData().asFormUrlEncoded().get("additionalMetadata");<NEW_LINE>String additionalMetadata;<NEW_LINE>if (valueadditionalMetadata != null) {<NEW_LINE>additionalMetadata = valueadditionalMetadata[0];<NEW_LINE>} else {<NEW_LINE>additionalMetadata = null;<NEW_LINE>}<NEW_LINE>Http.MultipartFormData<TemporaryFile> body_file = request.body().asMultipartFormData();<NEW_LINE>Http.MultipartFormData.FilePart<TemporaryFile> _file = body_file.getFile("file");<NEW_LINE>if (!securityAPIUtils.isRequestTokenValid(request, "petstore_auth")) {<NEW_LINE>return unauthorized();<NEW_LINE>}<NEW_LINE>ModelApiResponse obj = imp.uploadFile(request, petId, additionalMetadata, _file);<NEW_LINE>if (configuration.getBoolean("useOutputBeanValidation")) {<NEW_LINE>OpenAPIUtils.validate(obj);<NEW_LINE>}<NEW_LINE>JsonNode <MASK><NEW_LINE>return ok(result);<NEW_LINE>}
result = mapper.valueToTree(obj);
1,537,432
private void removeSingleRefFromNodeMap(Ref ref) {<NEW_LINE>Node refNode = checkNotNull(<MASK><NEW_LINE>if (ref.getTwin() != null) {<NEW_LINE>removeTwinRefsFromNodeMap(ref);<NEW_LINE>Ref twinRef = ref.getTwin();<NEW_LINE>// break the twin relationship<NEW_LINE>ref.twin = null;<NEW_LINE>twinRef.twin = null;<NEW_LINE>// put twin back alone, since we're not really removing it<NEW_LINE>refsForNodeMap.put(refNode, ImmutableList.of(twinRef));<NEW_LINE>} else {<NEW_LINE>ImmutableList<Ref> refsForNode = refsForNodeMap.get(refNode);<NEW_LINE>checkState(refsForNode.size() == 1 && refsForNode.get(0) == ref, "Unexpected Refs for Node: %s: when removing Ref: %s", refsForNode, ref);<NEW_LINE>refsForNodeMap.remove(refNode);<NEW_LINE>}<NEW_LINE>}
ref.getNode(), ref);
454,558
public Builder mergeFrom(voldemort.client.protocol.pb.VAdminProto.RebalanceStateChangeRequest other) {<NEW_LINE>if (other == voldemort.client.protocol.pb.VAdminProto.RebalanceStateChangeRequest.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (!other.rebalanceTaskList_.isEmpty()) {<NEW_LINE>if (result.rebalanceTaskList_.isEmpty()) {<NEW_LINE>result.rebalanceTaskList_ = new java.util.ArrayList<voldemort.client.protocol.pb.VAdminProto.RebalanceTaskInfoMap>();<NEW_LINE>}<NEW_LINE>result.rebalanceTaskList_.addAll(other.rebalanceTaskList_);<NEW_LINE>}<NEW_LINE>if (other.hasClusterString()) {<NEW_LINE>setClusterString(other.getClusterString());<NEW_LINE>}<NEW_LINE>if (other.hasStoresString()) {<NEW_LINE>setStoresString(other.getStoresString());<NEW_LINE>}<NEW_LINE>if (other.hasSwapRo()) {<NEW_LINE>setSwapRo(other.getSwapRo());<NEW_LINE>}<NEW_LINE>if (other.hasChangeClusterMetadata()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (other.hasChangeRebalanceState()) {<NEW_LINE>setChangeRebalanceState(other.getChangeRebalanceState());<NEW_LINE>}<NEW_LINE>if (other.hasRollback()) {<NEW_LINE>setRollback(other.getRollback());<NEW_LINE>}<NEW_LINE>this.mergeUnknownFields(other.getUnknownFields());<NEW_LINE>return this;<NEW_LINE>}
setChangeClusterMetadata(other.getChangeClusterMetadata());
1,094,446
void cleanup(PassThroughThenCleanup.ContextContainer c) throws Exception {<NEW_LINE>PipelineOptions options = c.getPipelineOptions();<NEW_LINE>BigQueryOptions bqOptions = <MASK><NEW_LINE>String jobUuid = c.getJobId();<NEW_LINE>final String extractDestinationDir = resolveTempLocation(bqOptions.getTempLocation(), "BigQueryExtractTemp", jobUuid);<NEW_LINE>final String executingProject = bqOptions.getBigQueryProject() == null ? bqOptions.getProject() : bqOptions.getBigQueryProject();<NEW_LINE>JobReference jobRef = new JobReference().setProjectId(executingProject).setJobId(BigQueryResourceNaming.createJobIdPrefix(bqOptions.getJobName(), jobUuid, JobType.EXPORT));<NEW_LINE>Job extractJob = getBigQueryServices().getJobService(bqOptions).getJob(jobRef);<NEW_LINE>if (extractJob != null) {<NEW_LINE>List<ResourceId> extractFiles = getExtractFilePaths(extractDestinationDir, extractJob);<NEW_LINE>if (extractFiles != null && !extractFiles.isEmpty()) {<NEW_LINE>FileSystems.delete(extractFiles, MoveOptions.StandardMoveOptions.IGNORE_MISSING_FILES);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
options.as(BigQueryOptions.class);
889,355
public static CheckLoaFillResponse unmarshall(CheckLoaFillResponse checkLoaFillResponse, UnmarshallerContext _ctx) {<NEW_LINE>checkLoaFillResponse.setRequestId(_ctx.stringValue("CheckLoaFillResponse.RequestId"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setStampFill(_ctx.booleanValue("CheckLoaFillResponse.Data.StampFill"));<NEW_LINE>data.setAddressFill(_ctx.booleanValue("CheckLoaFillResponse.Data.AddressFill"));<NEW_LINE>data.setTradeMarkNameFill(_ctx.booleanValue("CheckLoaFillResponse.Data.TradeMarkNameFill"));<NEW_LINE>data.setCountryFill<MASK><NEW_LINE>data.setNationalityFill(_ctx.booleanValue("CheckLoaFillResponse.Data.NationalityFill"));<NEW_LINE>data.setMaterialNameFill(_ctx.booleanValue("CheckLoaFillResponse.Data.MaterialNameFill"));<NEW_LINE>data.setTemplateUrl(_ctx.stringValue("CheckLoaFillResponse.Data.TemplateUrl"));<NEW_LINE>List<String> errorMsgs = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("CheckLoaFillResponse.Data.ErrorMsgs.Length"); i++) {<NEW_LINE>errorMsgs.add(_ctx.stringValue("CheckLoaFillResponse.Data.ErrorMsgs[" + i + "]"));<NEW_LINE>}<NEW_LINE>data.setErrorMsgs(errorMsgs);<NEW_LINE>checkLoaFillResponse.setData(data);<NEW_LINE>return checkLoaFillResponse;<NEW_LINE>}
(_ctx.booleanValue("CheckLoaFillResponse.Data.CountryFill"));
165,276
private static Structure transformToStruct(final ContentType type) throws DotStateException {<NEW_LINE>final Structure struct = new Structure();<NEW_LINE>struct.setDefaultStructure(type.defaultType());<NEW_LINE>struct.setDescription(type.description());<NEW_LINE>struct.setDetailPage(type.detailPage());<NEW_LINE>struct.setInode(type.inode());<NEW_LINE>struct.setFixed(type.fixed());<NEW_LINE>struct.setFolder(type.folder());<NEW_LINE>struct.setHost(type.host());<NEW_LINE>struct.setiDate(type.iDate());<NEW_LINE>struct.setIdentifier(type.inode());<NEW_LINE>struct.setModDate(type.modDate());<NEW_LINE>struct.setName(type.name());<NEW_LINE>struct.setOwner(type.owner());<NEW_LINE>struct.<MASK><NEW_LINE>struct.setExpireDateVar(type.expireDateVar());<NEW_LINE>struct.setStructureType(type.baseType().getType());<NEW_LINE>struct.setSystem(type.system());<NEW_LINE>struct.setUrlMapPattern(type.urlMapPattern());<NEW_LINE>struct.setVelocityVarName(type.variable());<NEW_LINE>struct.setIcon(type.icon());<NEW_LINE>struct.setSortOrder(type.sortOrder());<NEW_LINE>return struct;<NEW_LINE>}
setPublishDateVar(type.publishDateVar());
1,169,300
public TransferResult<CFValue, CFStore> visitNumericalAddition(NumericalAdditionNode n, TransferInput<CFValue, CFStore> in) {<NEW_LINE>// type of leftNode + rightNode is glb(t, s) where<NEW_LINE>// t = minusOffset(type(leftNode), rightNode) and<NEW_LINE>// s = minusOffset(type(rightNode), leftNode)<NEW_LINE>UBQualifier left = getUBQualifierForAddition(n.getLeftOperand(), in);<NEW_LINE>UBQualifier t = left.minusOffset(n.getRightOperand(), atypeFactory);<NEW_LINE>UBQualifier right = getUBQualifierForAddition(n.getRightOperand(), in);<NEW_LINE>UBQualifier s = right.minusOffset(n.getLeftOperand(), atypeFactory);<NEW_LINE>UBQualifier glb = t.glb(s);<NEW_LINE>if (left.isLessThanLengthQualifier() && right.isLessThanLengthQualifier()) {<NEW_LINE>// If expression i has type @LTLengthOf(value = "f2", offset = "f1.length") int and expression<NEW_LINE>// j is less than or equal to the length of f1, then the type of i + j is @LTLengthOf("f2").<NEW_LINE>UBQualifier r = removeSequenceLengths((LessThanLengthOf<MASK><NEW_LINE>glb = glb.glb(r);<NEW_LINE>UBQualifier l = removeSequenceLengths((LessThanLengthOf) right, (LessThanLengthOf) left);<NEW_LINE>glb = glb.glb(l);<NEW_LINE>}<NEW_LINE>return createTransferResult(n, in, glb);<NEW_LINE>}
) left, (LessThanLengthOf) right);
12,271
private List<WrapProcess> listProcess(Business business, Application application, Wi wi) throws Exception {<NEW_LINE>List<WrapProcess> wos = new ArrayList<>();<NEW_LINE>for (String id : ListTools.trim(wi.listProcessId(), true, true)) {<NEW_LINE>Process process = business.entityManagerContainer().find(id, Process.class);<NEW_LINE>if (null == process) {<NEW_LINE>throw new ExceptionEntityNotExist(id, Process.class);<NEW_LINE>}<NEW_LINE>WrapProcess wo = WrapProcess.outCopier.copy(process);<NEW_LINE>wo.setAgentList(WrapAgent.outCopier.copy(business.entityManagerContainer().listEqual(Agent.class, Agent.process_FIELDNAME, process.getId())));<NEW_LINE>List<Begin> begins = business.entityManagerContainer().listEqual(Begin.class, Begin.process_FIELDNAME, process.getId());<NEW_LINE>if (ListTools.isNotEmpty(begins)) {<NEW_LINE>wo.setBegin(WrapBegin.outCopier.copy(begins.get(0)));<NEW_LINE>}<NEW_LINE>wo.setCancelList(WrapCancel.outCopier.copy(business.entityManagerContainer().listEqual(Cancel.class, Cancel.process_FIELDNAME, process.getId())));<NEW_LINE>wo.setChoiceList(WrapChoice.outCopier.copy(business.entityManagerContainer().listEqual(Choice.class, Choice.process_FIELDNAME, process.getId())));<NEW_LINE>wo.setDelayList(WrapDelay.outCopier.copy(business.entityManagerContainer().listEqual(Delay.class, Delay.process_FIELDNAME, process.getId())));<NEW_LINE>wo.setEmbedList(WrapEmbed.outCopier.copy(business.entityManagerContainer().listEqual(Embed.class, Embed.process_FIELDNAME, process.getId())));<NEW_LINE>wo.setEndList(WrapEnd.outCopier.copy(business.entityManagerContainer().listEqual(End.class, End.process_FIELDNAME, process.getId())));<NEW_LINE>wo.setInvokeList(WrapInvoke.outCopier.copy(business.entityManagerContainer().listEqual(Invoke.class, Invoke.process_FIELDNAME, process.getId())));<NEW_LINE>wo.setManualList(WrapManual.outCopier.copy(business.entityManagerContainer().listEqual(Manual.class, Manual.process_FIELDNAME, process.getId())));<NEW_LINE>wo.setMergeList(WrapMerge.outCopier.copy(business.entityManagerContainer().listEqual(Merge.class, Merge.process_FIELDNAME, process.getId())));<NEW_LINE>wo.setParallelList(WrapParallel.outCopier.copy(business.entityManagerContainer().listEqual(Parallel.class, Parallel.process_FIELDNAME, process.getId())));<NEW_LINE>wo.setServiceList(WrapService.outCopier.copy(business.entityManagerContainer().listEqual(Service.class, Service.process_FIELDNAME, <MASK><NEW_LINE>wo.setSplitList(WrapSplit.outCopier.copy(business.entityManagerContainer().listEqual(Split.class, Split.process_FIELDNAME, process.getId())));<NEW_LINE>wo.setRouteList(WrapRoute.outCopier.copy(business.entityManagerContainer().listEqual(Route.class, Route.process_FIELDNAME, process.getId())));<NEW_LINE>wos.add(wo);<NEW_LINE>}<NEW_LINE>return wos;<NEW_LINE>}
process.getId())));
1,674,359
public Map<PackageIdentifier, Package> bulkGetPackages(Iterable<PackageIdentifier> pkgIds) throws NoSuchPackageException, InterruptedException {<NEW_LINE>Set<SkyKey> pkgKeys = ImmutableSet.copyOf(PackageValue.keys(pkgIds));<NEW_LINE>ImmutableMap.Builder<PackageIdentifier, Package> pkgResults = ImmutableMap.builder();<NEW_LINE>Map<SkyKey, SkyValue> packages = graph.getSuccessfulValues(pkgKeys);<NEW_LINE>for (Map.Entry<SkyKey, SkyValue> pkgEntry : packages.entrySet()) {<NEW_LINE>PackageIdentifier pkgId = (PackageIdentifier) pkgEntry.getKey().argument();<NEW_LINE>PackageValue pkgValue = (PackageValue) pkgEntry.getValue();<NEW_LINE>pkgResults.put(pkgId, Preconditions.checkNotNull(pkgValue.getPackage(), pkgId));<NEW_LINE>}<NEW_LINE>SetView<SkyKey> unknownKeys = Sets.difference(<MASK><NEW_LINE>if (!Iterables.isEmpty(unknownKeys)) {<NEW_LINE>logger.atWarning().log("Unable to find %s in the batch lookup of %s. Successfully looked up %s", unknownKeys, pkgKeys, packages.keySet());<NEW_LINE>}<NEW_LINE>for (Map.Entry<SkyKey, Exception> missingOrExceptionEntry : graph.getMissingAndExceptions(unknownKeys).entrySet()) {<NEW_LINE>PackageIdentifier pkgIdentifier = (PackageIdentifier) missingOrExceptionEntry.getKey().argument();<NEW_LINE>Exception exception = missingOrExceptionEntry.getValue();<NEW_LINE>if (exception == null) {<NEW_LINE>// If the package key does not exist in the graph, then it must not correspond to any<NEW_LINE>// package, because the SkyQuery environment has already loaded the universe.<NEW_LINE>throw new BuildFileNotFoundException(pkgIdentifier, "Package not found");<NEW_LINE>}<NEW_LINE>Throwables.propagateIfInstanceOf(exception, NoSuchPackageException.class);<NEW_LINE>Throwables.propagate(exception);<NEW_LINE>}<NEW_LINE>return pkgResults.buildOrThrow();<NEW_LINE>}
pkgKeys, packages.keySet());
886,008
protected String createConfigFileIfNeeded(String serverDir, String[] commandLine, String xmlSnippet) {<NEW_LINE>String utilityName = this.scriptName;<NEW_LINE>String taskName = this.getTaskName();<NEW_LINE>final String MAGICAL_SENTINEL = "@!$#%$#%32543265k425k4/3nj5k43n?m2|5k4\\n5k2345";<NEW_LINE>String targetFilepath = getArgumentValue(ARG_CREATE_CONFIG_FILE, commandLine, MAGICAL_SENTINEL);<NEW_LINE>if (targetFilepath == MAGICAL_SENTINEL) {<NEW_LINE>// the config file is not needed<NEW_LINE>return xmlSnippet;<NEW_LINE>}<NEW_LINE>// note that generateConfigFileName() will handle the case where targetFilepath == null<NEW_LINE>File outputFile = generateConfigFileName(<MASK><NEW_LINE>String xmlTemplate = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" + NL + "<server description=\"This file was generated by the ''{0} {1}'' command on {2,date,yyyy-MM-dd HH:mm:ss z}.\">" + NL + "{3}" + NL + "</server>" + NL;<NEW_LINE>String xmlData = MessageFormat.format(xmlTemplate, utilityName, taskName, Calendar.getInstance().getTime(), xmlSnippet);<NEW_LINE>fileUtility.createParentDirectory(stdout, outputFile);<NEW_LINE>fileUtility.writeToFile(stderr, xmlData, outputFile);<NEW_LINE>String includeSnippet = " <include location=\"" + outputFile.getAbsolutePath() + "\" />" + NL;<NEW_LINE>return includeSnippet;<NEW_LINE>}
utilityName, taskName, serverDir, targetFilepath);
1,667,010
private void configureDataSources(List<DataSource> dataSources) {<NEW_LINE>Map<String, ConfigItem<DataSource>> dataSourceConfigItemMap = configurator.getConfigItemMap("data-source");<NEW_LINE>for (DataSource dataSource : dataSources) {<NEW_LINE><MASK><NEW_LINE>if (name == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ConfigItem<DataSource> existedDataSource = dataSourceConfigItemMap.get(name);<NEW_LINE>if (existedDataSource == null) {<NEW_LINE>dataSourceConfigItemMap.put(name, createConfigItem(dataSource, DATA_SOURCE_COMPARATOR));<NEW_LINE>webAppConfiguration.addRef(JNDIEnvironmentRefType.DataSource, dataSource);<NEW_LINE>} else {<NEW_LINE>if (existedDataSource.getSource() == ConfigSource.WEB_XML && configurator.getConfigSource() == ConfigSource.WEB_FRAGMENT) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "{0}.{1} with value {2} is configured in web.xml, the value {3} from web-fragment.xml in {4} is ignored", "data-source", "name", existedDataSource.getValue(), name, configurator.getLibraryURI());<NEW_LINE>}<NEW_LINE>} else if (existedDataSource.getSource() == ConfigSource.WEB_FRAGMENT && configurator.getConfigSource() == ConfigSource.WEB_FRAGMENT && !existedDataSource.compareValue(dataSource)) {<NEW_LINE>configurator.addErrorMessage(nls.getFormattedMessage("CONFLICT_DATASOURCE_REFERENCE_BETWEEN_WEB_FRAGMENT_XML", new Object[] { name, existedDataSource.getLibraryURI(), configurator.getLibraryURI() }, "Two data-source configurations with the same name {0} found in the web-fragment.xml of {1} and {2}."));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
String name = dataSource.getName();
1,057,161
private void readBadges(String url, Map<String, Map<String, Badge>> badgeMap) {<NEW_LINE>try {<NEW_LINE>JSONObject globalBadgeSets = new JSONObject(Service.urlToJSONString(url)).getJSONObject("badge_sets");<NEW_LINE>for (Iterator<String> it = globalBadgeSets.keys(); it.hasNext(); ) {<NEW_LINE><MASK><NEW_LINE>Map<String, Badge> versionMap = new HashMap<>();<NEW_LINE>badgeMap.put(badgeSet, versionMap);<NEW_LINE>JSONObject versions = globalBadgeSets.getJSONObject(badgeSet).getJSONObject("versions");<NEW_LINE>for (Iterator<String> iter = versions.keys(); iter.hasNext(); ) {<NEW_LINE>String version = iter.next();<NEW_LINE>JSONObject versionObject = versions.getJSONObject(version);<NEW_LINE>SparseArray<String> urls = new SparseArray<>();<NEW_LINE>urls.put(1, versionObject.getString("image_url_1x"));<NEW_LINE>urls.put(2, versionObject.getString("image_url_2x"));<NEW_LINE>urls.put(4, versionObject.getString("image_url_4x"));<NEW_LINE>versionMap.put(version, new Badge(badgeSet, urls));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (JSONException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
String badgeSet = it.next();
1,329,884
private boolean fetchCallbackUrl(final String callbackUrl) {<NEW_LINE>// Do not handle redirects as we must expect that the passed<NEW_LINE>// in callback url on meeting create must be working.<NEW_LINE>// String finalUrl = followRedirect(callbackUrl, 0, callbackUrl);<NEW_LINE>// log.info("Calling callback url {}", finalUrl);<NEW_LINE>// if (finalUrl == null) return false;<NEW_LINE>boolean success = false;<NEW_LINE>CloseableHttpAsyncClient httpclient = HttpAsyncClients.createDefault();<NEW_LINE>try {<NEW_LINE>httpclient.start();<NEW_LINE>HttpGet request = new HttpGet(callbackUrl);<NEW_LINE>Future<HttpResponse> future = httpclient.execute(request, null);<NEW_LINE>HttpResponse response = future.get();<NEW_LINE>// Consider 2xx response code as success.<NEW_LINE>success = (response.getStatusLine().getStatusCode() >= 200 && response.getStatusLine(<MASK><NEW_LINE>} catch (java.lang.InterruptedException ex) {<NEW_LINE>log.error("Interrupted exception while calling url {}", callbackUrl);<NEW_LINE>} catch (java.util.concurrent.ExecutionException ex) {<NEW_LINE>log.error("ExecutionException exception while calling url {}", callbackUrl);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>httpclient.close();<NEW_LINE>} catch (java.io.IOException ex) {<NEW_LINE>log.error("IOException exception while closing http client for url {}", callbackUrl);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return success;<NEW_LINE>}
).getStatusCode() < 300);
1,786,202
final boolean doOpenProject(ProjectLocator projectLocator) {<NEW_LINE>String status = "Opened project: " + projectLocator.getName();<NEW_LINE>Project project = null;<NEW_LINE>boolean openStatus = false;<NEW_LINE>try {<NEW_LINE>// first close the active project (if there is one)<NEW_LINE>// but if user cancels operation, don't continue<NEW_LINE>if (!closeProject(false)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>ProjectManager pm = plugin.getProjectManager();<NEW_LINE>project = pm.openProject(projectLocator, true, false);<NEW_LINE>if (project == null) {<NEW_LINE>status = "Error opening project: " + projectLocator.toString();<NEW_LINE>} else {<NEW_LINE>firingProjectOpened = true;<NEW_LINE>tool.setActiveProject(project);<NEW_LINE>openProjectAndNotify(project);<NEW_LINE>openStatus = true;<NEW_LINE>firingProjectOpened = false;<NEW_LINE>}<NEW_LINE>} catch (NotFoundException nfe) {<NEW_LINE>status = "Project not found for " + projectLocator.toString();<NEW_LINE>Msg.showInfo(getClass(), tool.getToolFrame(), "Error Opening Project", status);<NEW_LINE>} catch (NotOwnerException e) {<NEW_LINE>status = "Cannot open project: " + e.getMessage();<NEW_LINE>Msg.showError(this, null, "Not Project Owner", "Cannot open project " + projectLocator + "\n" + e.getMessage() + "\n \nEach user must create their own project. If needed, another user's project may be viewed\n" + "and files copied, using the View Other action from your own open project. Alternatively, \n" + "creating a \"Shared Project\" will allow a group of users to use a shared server-based repository.");<NEW_LINE>} catch (LockException e) {<NEW_LINE>status = "Project is already open for update: " + projectLocator.toString();<NEW_LINE>Msg.showError(this, null, "Open Project Failed", status);<NEW_LINE>} catch (Exception e) {<NEW_LINE>status = "Error opening project: " + projectLocator.toString();<NEW_LINE>Msg.showError(this, null, "Open Project Failed", status, e);<NEW_LINE>} finally {<NEW_LINE>// update our list of recent projects<NEW_LINE>plugin.rebuildRecentMenus();<NEW_LINE>}<NEW_LINE>if (!openStatus) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>Msg.info(this, status);<NEW_LINE>}<NEW_LINE>return openStatus;<NEW_LINE>}
Msg.error(this, status);
1,262,912
private static void buildPublicBeanType(BeanEventTypeStemService beanEventTypeStemService, EventTypeRepository repo, String eventTypeName, EPTypeClass clazz, BeanEventTypeFactoryPrivate privateFactory, Map<String, ConfigurationCommonEventTypeBean> configs) {<NEW_LINE>// check existing type<NEW_LINE>EventType existingType = repo.getTypeByName(eventTypeName);<NEW_LINE>if (existingType != null) {<NEW_LINE>if (existingType.getMetadata().getApplicationType() != EventTypeApplicationType.CLASS) {<NEW_LINE>throw new ConfigurationException("Event type named '" + eventTypeName + "' has already been declared with differing underlying type information: Class " + existingType.getUnderlyingType().getName() + " versus " + clazz.getTypeName());<NEW_LINE>}<NEW_LINE>BeanEventType beanEventType = (BeanEventType) existingType;<NEW_LINE>if (beanEventType.getUnderlyingType() != clazz.getType()) {<NEW_LINE>throw new ConfigurationException("Event type named '" + eventTypeName + "' has already been declared with differing underlying type information: Class " + existingType.getUnderlyingType().getName() + <MASK><NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ConfigurationCommonEventTypeBean optionalConfig = configs.get(eventTypeName);<NEW_LINE>// check-allocate bean-stem<NEW_LINE>BeanEventTypeStem stem = beanEventTypeStemService.getCreateStem(clazz, optionalConfig);<NEW_LINE>// metadata<NEW_LINE>long publicId = CRC32Util.computeCRC32(eventTypeName);<NEW_LINE>EventTypeMetadata metadata = new EventTypeMetadata(eventTypeName, null, EventTypeTypeClass.STREAM, EventTypeApplicationType.CLASS, NameAccessModifier.PRECONFIGURED, EventTypeBusModifier.NONBUS, false, new EventTypeIdPair(publicId, -1));<NEW_LINE>// supertypes<NEW_LINE>EventType[] superTypes = getSuperTypes(stem.getSuperTypes(), beanEventTypeStemService, repo, privateFactory, configs);<NEW_LINE>Set<EventType> deepSuperTypes = getDeepSupertypes(stem.getDeepSuperTypes(), beanEventTypeStemService, repo, privateFactory, configs);<NEW_LINE>// bean type<NEW_LINE>String startTS = optionalConfig == null ? null : optionalConfig.getStartTimestampPropertyName();<NEW_LINE>String endTS = optionalConfig == null ? null : optionalConfig.getEndTimestampPropertyName();<NEW_LINE>BeanEventType eventType = privateFactory.getEventTypeFactory().createBeanType(stem, metadata, privateFactory, superTypes, deepSuperTypes, startTS, endTS);<NEW_LINE>repo.addType(eventType);<NEW_LINE>}
" versus " + beanEventType.getUnderlyingType());
864,664
public static boolean update(Map<String, Object> source, Map<String, Object> changes, boolean checkUpdatesAreUnequal) {<NEW_LINE>boolean modified = false;<NEW_LINE>for (Map.Entry<String, Object> changesEntry : changes.entrySet()) {<NEW_LINE>if (!source.containsKey(changesEntry.getKey())) {<NEW_LINE>// safe to copy, change does not exist in source<NEW_LINE>source.put(changesEntry.getKey(), changesEntry.getValue());<NEW_LINE>modified = true;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Object old = source.<MASK><NEW_LINE>if (old instanceof Map && changesEntry.getValue() instanceof Map) {<NEW_LINE>// recursive merge maps<NEW_LINE>modified |= update((Map<String, Object>) source.get(changesEntry.getKey()), (Map<String, Object>) changesEntry.getValue(), checkUpdatesAreUnequal && !modified);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// update the field<NEW_LINE>source.put(changesEntry.getKey(), changesEntry.getValue());<NEW_LINE>if (modified) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!checkUpdatesAreUnequal) {<NEW_LINE>modified = true;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>modified = !Objects.equals(old, changesEntry.getValue());<NEW_LINE>}<NEW_LINE>return modified;<NEW_LINE>}
get(changesEntry.getKey());
1,459,736
private ServiceModuleEnum cover(Business business, Wi wi) throws Exception {<NEW_LINE>List<JpaObject> persistObjects = new ArrayList<>();<NEW_LINE>List<JpaObject> removeObjects = new ArrayList<>();<NEW_LINE>ServiceModuleEnum serviceModuleEnum = ServiceModuleEnum.getEnumByValue(wi.getId());<NEW_LINE>if (null == serviceModuleEnum) {<NEW_LINE>throw new ExceptionAppInfoNotExist(wi.getId());<NEW_LINE>}<NEW_LINE>for (WrapAgent _o : wi.getAgentList()) {<NEW_LINE>Agent obj = business.entityManagerContainer().find(_o.getId(), Agent.class);<NEW_LINE>if (null != obj) {<NEW_LINE>WrapAgent.inCopier.copy(_o, obj);<NEW_LINE>} else {<NEW_LINE>obj = WrapAgent.inCopier.copy(_o);<NEW_LINE>persistObjects.add(obj);<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(obj.getAlias())) {<NEW_LINE>obj.setAlias(this.idleAliasWithEntity(business, obj.getAlias(), Agent.class, obj.getId()));<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(obj.getName())) {<NEW_LINE>obj.setName(this.idleNameWithEntity(business, obj.getName(), Agent.class, obj.getId()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (WrapInvoke _o : wi.getInvokeList()) {<NEW_LINE>Invoke obj = business.entityManagerContainer().find(_o.getId(), Invoke.class);<NEW_LINE>if (null != obj) {<NEW_LINE>WrapInvoke.inCopier.copy(_o, obj);<NEW_LINE>} else {<NEW_LINE>obj = WrapInvoke.inCopier.copy(_o);<NEW_LINE>persistObjects.add(obj);<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(obj.getAlias())) {<NEW_LINE>obj.setAlias(this.idleAliasWithEntity(business, obj.getAlias(), Invoke.class, obj.getId()));<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(obj.getName())) {<NEW_LINE>obj.setName(this.idleNameWithEntity(business, obj.getName(), Invoke.class, obj.getId()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>business.entityManagerContainer().beginTransaction(Invoke.class);<NEW_LINE>business.entityManagerContainer().beginTransaction(Agent.class);<NEW_LINE>for (JpaObject o : removeObjects) {<NEW_LINE>business.<MASK><NEW_LINE>}<NEW_LINE>for (JpaObject o : persistObjects) {<NEW_LINE>business.entityManagerContainer().persist(o);<NEW_LINE>}<NEW_LINE>business.entityManagerContainer().commit();<NEW_LINE>if (!wi.getAgentList().isEmpty()) {<NEW_LINE>CacheManager.notify(Agent.class);<NEW_LINE>}<NEW_LINE>if (!wi.getInvokeList().isEmpty()) {<NEW_LINE>CacheManager.notify(Invoke.class);<NEW_LINE>}<NEW_LINE>return serviceModuleEnum;<NEW_LINE>}
entityManagerContainer().remove(o);
1,396,636
public ValidationResult validateConfig(KeycloakSession session, ValidatorConfig config) {<NEW_LINE>Set<ValidationError> <MASK><NEW_LINE>if (config == null || config == ValidatorConfig.EMPTY || !config.containsKey(CFG_PATTERN)) {<NEW_LINE>errors.add(new ValidationError(ID, CFG_PATTERN, ValidatorConfigValidator.MESSAGE_CONFIG_MISSING_VALUE));<NEW_LINE>} else {<NEW_LINE>Object maybePattern = config.get(CFG_PATTERN);<NEW_LINE>try {<NEW_LINE>Pattern pattern = config.getPattern(CFG_PATTERN);<NEW_LINE>if (pattern == null) {<NEW_LINE>errors.add(new ValidationError(ID, CFG_PATTERN, ValidatorConfigValidator.MESSAGE_CONFIG_INVALID_VALUE, maybePattern));<NEW_LINE>}<NEW_LINE>} catch (PatternSyntaxException pse) {<NEW_LINE>errors.add(new ValidationError(ID, CFG_PATTERN, ValidatorConfigValidator.MESSAGE_CONFIG_INVALID_VALUE, maybePattern, pse.getMessage()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new ValidationResult(errors);<NEW_LINE>}
errors = new LinkedHashSet<>();
174,569
public static Color fromHSV(int h, int s, int v) {<NEW_LINE>if (s == 0) {<NEW_LINE>return new Color(v / 255.0, v / 255.0, v / 255.0);<NEW_LINE>}<NEW_LINE>final int region = h / 30;<NEW_LINE>final int remainder = (h - (region * 30)) * 6;<NEW_LINE>final int p = (v * (255 - s)) >> 8;<NEW_LINE>final int q = (v * (255 - ((s * remainder) ><MASK><NEW_LINE>final int t = (v * (255 - ((s * (255 - remainder)) >> 8))) >> 8;<NEW_LINE>switch(region) {<NEW_LINE>case 0:<NEW_LINE>return new Color(v / 255.0, t / 255.0, p / 255.0);<NEW_LINE>case 1:<NEW_LINE>return new Color(q / 255.0, v / 255.0, p / 255.0);<NEW_LINE>case 2:<NEW_LINE>return new Color(p / 255.0, v / 255.0, t / 255.0);<NEW_LINE>case 3:<NEW_LINE>return new Color(p / 255.0, q / 255.0, v / 255.0);<NEW_LINE>case 4:<NEW_LINE>return new Color(t / 255.0, p / 255.0, v / 255.0);<NEW_LINE>default:<NEW_LINE>return new Color(v / 255.0, p / 255.0, q / 255.0);<NEW_LINE>}<NEW_LINE>}
> 8))) >> 8;
372,637
private static EnumActionResult rotateChest(World world, BlockPos pos, IBlockState state, EnumFacing sideWrenched) {<NEW_LINE>if (state.getBlock() instanceof BlockChest) {<NEW_LINE>BlockPos otherPos = null;<NEW_LINE>for (EnumFacing facing : EnumFacing.Plane.HORIZONTAL) {<NEW_LINE>BlockPos candidate = pos.offset(facing);<NEW_LINE>if (world.getBlockState(candidate).getBlock() == state.getBlock()) {<NEW_LINE>otherPos = candidate;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (otherPos != null) {<NEW_LINE>IBlockState otherState = world.getBlockState(otherPos);<NEW_LINE>EnumFacing facing = state.getValue(BlockChest.FACING);<NEW_LINE>if (otherState.getValue(BlockChest.FACING) == facing) {<NEW_LINE>world.setBlockState(pos, state.withProperty(BlockChest.FACING, facing.getOpposite()));<NEW_LINE>world.setBlockState(otherPos, otherState.withProperty(BlockChest.FACING, facing.getOpposite()));<NEW_LINE>return EnumActionResult.SUCCESS;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return rotateOnce(world, pos, <MASK><NEW_LINE>}<NEW_LINE>return EnumActionResult.PASS;<NEW_LINE>}
state, BlockChest.FACING, ROTATE_HORIZONTAL);
464,232
public Optional<CatalogSchemaTableName> redirectTable(ConnectorSession session, SchemaTableName tableName) {<NEW_LINE>requireNonNull(session, "session is null");<NEW_LINE>requireNonNull(tableName, "tableName is null");<NEW_LINE>if (isHiveSystemSchema(tableName.getSchemaName())) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>// we need to chop off any "$partitions" and similar suffixes from table name while querying the metastore for the Table object<NEW_LINE>TableNameSplitResult tableNameSplit = splitTableName(tableName.getTableName());<NEW_LINE>Optional<Table> table = metastore.getTable(tableName.getSchemaName(<MASK><NEW_LINE>if (table.isEmpty() || VIRTUAL_VIEW.name().equals(table.get().getTableType())) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>Optional<CatalogSchemaTableName> catalogSchemaTableName = tableRedirectionsProvider.redirectTable(session, table.get());<NEW_LINE>// stitch back the suffix we cut off.<NEW_LINE>return catalogSchemaTableName.map(name -> new CatalogSchemaTableName(name.getCatalogName(), new SchemaTableName(name.getSchemaTableName().getSchemaName(), name.getSchemaTableName().getTableName() + tableNameSplit.getSuffix().orElse(""))));<NEW_LINE>}
), tableNameSplit.getBaseTableName());
1,383,203
private Mono<Response<TriggerQueryResponseInner>> queryByFactoryWithResponseAsync(String resourceGroupName, String factoryName, TriggerFilterParameters filterParameters, 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.<MASK><NEW_LINE>}<NEW_LINE>if (factoryName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter factoryName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (filterParameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter filterParameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>filterParameters.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.queryByFactory(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, factoryName, this.client.getApiVersion(), filterParameters, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
1,492,023
public IHarvestResult harvestBlock(@Nonnull IFarmer farm, @Nonnull BlockPos bc, @Nonnull IBlockState state) {<NEW_LINE>setupHarvesting(farm, bc);<NEW_LINE>if (!hasAxe) {<NEW_LINE>farm.setNotification(FarmNotification.NO_AXE);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final World world = farm.getWorld();<NEW_LINE>final HarvestResult res = new HarvestResult();<NEW_LINE>final IHarvestingTarget target = new FarmHarvestingTarget(this, farm, FarmingConfig.treeHarvestRadius.get(), FarmingConfig.treeHarvestHeight.get());<NEW_LINE>TreeHarvester.harvest(world, bc, res, target);<NEW_LINE>Collections.sort(res.getHarvestedBlocks(), getComperator(bc));<NEW_LINE>List<BlockPos> actualHarvests = new ArrayList<BlockPos>();<NEW_LINE>// avoid calling this in a loop<NEW_LINE>for (int i = 0; i < res.getHarvestedBlocks().size() && hasAxe; i++) {<NEW_LINE>final BlockPos coord = res.getHarvestedBlocks().get(i);<NEW_LINE>if (harvestSingleBlock(farm, world, res, coord)) {<NEW_LINE>actualHarvests.add(coord);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>res.getHarvestedBlocks().clear();<NEW_LINE>res.<MASK><NEW_LINE>tryReplanting(farm, world, bc, res);<NEW_LINE>return res;<NEW_LINE>}
getHarvestedBlocks().addAll(actualHarvests);
156,147
public synchronized void open() throws MonopriceAudioException {<NEW_LINE>logger.debug("Opening serial connection on port {}", serialPortName);<NEW_LINE>try {<NEW_LINE>SerialPortIdentifier portIdentifier = serialPortManager.getIdentifier(serialPortName);<NEW_LINE>if (portIdentifier == null) {<NEW_LINE>setConnected(false);<NEW_LINE>throw new MonopriceAudioException("Opening serial connection failed: No Such Port");<NEW_LINE>}<NEW_LINE>SerialPort commPort = portIdentifier.open(this.getClass().getName(), 2000);<NEW_LINE>commPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);<NEW_LINE>commPort.enableReceiveThreshold(1);<NEW_LINE>commPort.enableReceiveTimeout(100);<NEW_LINE>commPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE);<NEW_LINE>InputStream dataIn = commPort.getInputStream();<NEW_LINE>OutputStream dataOut = commPort.getOutputStream();<NEW_LINE>if (dataOut != null) {<NEW_LINE>dataOut.flush();<NEW_LINE>}<NEW_LINE>if (dataIn != null && dataIn.markSupported()) {<NEW_LINE>try {<NEW_LINE>dataIn.reset();<NEW_LINE>} catch (IOException e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Thread thread = new MonopriceAudioReaderThread(this, this.uid, this.serialPortName);<NEW_LINE>setReaderThread(thread);<NEW_LINE>thread.start();<NEW_LINE>this.serialPort = commPort;<NEW_LINE>this.dataIn = dataIn;<NEW_LINE>this.dataOut = dataOut;<NEW_LINE>setConnected(true);<NEW_LINE>logger.debug("Serial connection opened");<NEW_LINE>} catch (PortInUseException e) {<NEW_LINE>setConnected(false);<NEW_LINE>throw new MonopriceAudioException("Opening serial connection failed: Port in Use Exception", e);<NEW_LINE>} catch (UnsupportedCommOperationException e) {<NEW_LINE>setConnected(false);<NEW_LINE><MASK><NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>setConnected(false);<NEW_LINE>throw new MonopriceAudioException("Opening serial connection failed: Unsupported Encoding Exception", e);<NEW_LINE>} catch (IOException e) {<NEW_LINE>setConnected(false);<NEW_LINE>throw new MonopriceAudioException("Opening serial connection failed: IO Exception", e);<NEW_LINE>}<NEW_LINE>}
throw new MonopriceAudioException("Opening serial connection failed: Unsupported Comm Operation Exception", e);
918,088
public void write(DataOutput out) throws IOException {<NEW_LINE>final byte[] integerBuffer = new byte[5];<NEW_LINE>serialize();<NEW_LINE>byte hasValues = (values == null) ? 0 : (byte) 1;<NEW_LINE>if (!replicationSources.isEmpty()) {<NEW_LINE>// Use 2nd least-significant bit for whether or not we have replication sources<NEW_LINE>hasValues = (byte) (0x02 | hasValues);<NEW_LINE>}<NEW_LINE>out.write((byte) (0x80 | hasValues));<NEW_LINE>UnsynchronizedBuffer.writeVInt(out, integerBuffer, row.length);<NEW_LINE>out.write(row);<NEW_LINE>UnsynchronizedBuffer.writeVInt(out, integerBuffer, data.length);<NEW_LINE>out.write(data);<NEW_LINE>UnsynchronizedBuffer.writeVInt(out, integerBuffer, entries);<NEW_LINE>if ((0x01 & hasValues) == 0x01) {<NEW_LINE>UnsynchronizedBuffer.writeVInt(out, integerBuffer, values.size());<NEW_LINE>for (byte[] val : values) {<NEW_LINE>UnsynchronizedBuffer.writeVInt(<MASK><NEW_LINE>out.write(val);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ((0x02 & hasValues) == 0x02) {<NEW_LINE>UnsynchronizedBuffer.writeVInt(out, integerBuffer, replicationSources.size());<NEW_LINE>for (String source : replicationSources) {<NEW_LINE>WritableUtils.writeString(out, source);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
out, integerBuffer, val.length);
1,427,248
public Response<Void> deleteByIdWithResponse(String id, Context context) {<NEW_LINE>String vaultName = Utils.getValueFromIdByName(id, "vaults");<NEW_LINE>if (vaultName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id)));<NEW_LINE>}<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String fabricName = Utils.getValueFromIdByName(id, "backupFabrics");<NEW_LINE>if (fabricName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'backupFabrics'.", id)));<NEW_LINE>}<NEW_LINE>String containerName = Utils.getValueFromIdByName(id, "protectionContainers");<NEW_LINE>if (containerName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'protectionContainers'.", id)));<NEW_LINE>}<NEW_LINE>String protectedItemName = Utils.getValueFromIdByName(id, "protectedItems");<NEW_LINE>if (protectedItemName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.<MASK><NEW_LINE>}<NEW_LINE>return this.deleteWithResponse(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, context);<NEW_LINE>}
format("The resource ID '%s' is not valid. Missing path segment 'protectedItems'.", id)));
1,141,089
private void initData(JSONObject data) {<NEW_LINE>if (data == null)<NEW_LINE>return;<NEW_LINE>JSONObject info = data.optJSONObject("game_info");<NEW_LINE>int size = info.optInt("boardSize", 19);<NEW_LINE>boardSize = size;<NEW_LINE>Lizzie.board.reopen(boardSize, boardSize);<NEW_LINE>// TODO boardSize<NEW_LINE>history = new BoardHistoryList(BoardData.empty(size, size));<NEW_LINE>blackPlayer = info.optString("blackName");<NEW_LINE>whitePlayer = info.optString("whiteName");<NEW_LINE>boolean isEnd = !Utils.isBlank(info.optString("resultDesc"));<NEW_LINE>history = SGFParser.parseSgf(info.optString("sgf"));<NEW_LINE>if (history != null) {<NEW_LINE>double komi = info.optDouble("komi", history.getGameInfo().getKomi());<NEW_LINE>int handicap = info.optInt("handicap", history.getGameInfo().getHandicap());<NEW_LINE>Lizzie.board.getHistory().<MASK><NEW_LINE>Lizzie.board.getHistory().getGameInfo().setHandicap(handicap);<NEW_LINE>Lizzie.leelaz.komi(komi);<NEW_LINE>int diffMove = Lizzie.board.getHistory().sync(history);<NEW_LINE>if (diffMove >= 0) {<NEW_LINE>Lizzie.board.goToMoveNumberBeyondBranch(diffMove > 0 ? diffMove - 1 : 0);<NEW_LINE>while (Lizzie.board.nextMove()) ;<NEW_LINE>}<NEW_LINE>if ("3".equals(info.optString("status"))) {<NEW_LINE>sio.close();<NEW_LINE>String result = info.optString("resultDesc");<NEW_LINE>if (!Utils.isBlank(result)) {<NEW_LINE>Lizzie.board.getHistory().getData().comment = result + "\n" + Lizzie.board.getHistory().getData().comment;<NEW_LINE>Lizzie.board.previousMove();<NEW_LINE>Lizzie.board.nextMove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (history == null || isEnd) {<NEW_LINE>// error(true);<NEW_LINE>sio.close();<NEW_LINE>if (isEnd && type == 1) {<NEW_LINE>try {<NEW_LINE>refresh("(?s).*?(\\\"Content\\\":\\\")(.+)(\\\",\\\")(?s).*", 2, false, false);<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Lizzie.frame.setPlayers(whitePlayer, blackPlayer);<NEW_LINE>Lizzie.board.getHistory().getGameInfo().setPlayerBlack(blackPlayer);<NEW_LINE>Lizzie.board.getHistory().getGameInfo().setPlayerWhite(whitePlayer);<NEW_LINE>}
getGameInfo().setKomi(komi);
1,405,435
private void actOnJoinEvent(PlayerJoinEvent event) {<NEW_LINE>Player player = event.getPlayer();<NEW_LINE>UUID playerUUID = player.getUniqueId();<NEW_LINE>ServerUUID serverUUID = serverInfo.getServerUUID();<NEW_LINE>long time = System.currentTimeMillis();<NEW_LINE>BukkitAFKListener.afkTracker.performedAction(playerUUID, time);<NEW_LINE>String world = player.getWorld().getName();<NEW_LINE>String gm = Optional.ofNullable(player.getGameMode()).map(gameMode -> gameMode.name()).orElse("Unknown");<NEW_LINE>Database database = dbSystem.getDatabase();<NEW_LINE>database.executeTransaction(new WorldNameStoreTransaction(serverUUID, world));<NEW_LINE>InetAddress address = player.getAddress().getAddress();<NEW_LINE>Supplier<String> getHostName = () -> getHostname(player);<NEW_LINE>String playerName = player.getName();<NEW_LINE>String displayName = player.getDisplayName();<NEW_LINE>boolean gatheringGeolocations = <MASK><NEW_LINE>if (gatheringGeolocations) {<NEW_LINE>database.executeTransaction(new GeoInfoStoreTransaction(playerUUID, address, time, geolocationCache::getCountry));<NEW_LINE>}<NEW_LINE>database.executeTransaction(new PlayerServerRegisterTransaction(playerUUID, player::getFirstPlayed, playerName, serverUUID, getHostName));<NEW_LINE>database.executeTransaction(new OperatorStatusTransaction(playerUUID, serverUUID, player.isOp()));<NEW_LINE>ActiveSession session = new ActiveSession(playerUUID, serverUUID, time, world, gm);<NEW_LINE>session.getExtraData().put(PlayerName.class, new PlayerName(playerName));<NEW_LINE>session.getExtraData().put(ServerName.class, new ServerName(serverInfo.getServer().getIdentifiableName()));<NEW_LINE>sessionCache.cacheSession(playerUUID, session).ifPresent(previousSession -> database.executeTransaction(new SessionEndTransaction(previousSession)));<NEW_LINE>database.executeTransaction(new NicknameStoreTransaction(playerUUID, new Nickname(displayName, time, serverUUID), (uuid, name) -> nicknameCache.getDisplayName(playerUUID).map(name::equals).orElse(false)));<NEW_LINE>processing.submitNonCritical(() -> extensionService.updatePlayerValues(playerUUID, playerName, CallEvents.PLAYER_JOIN));<NEW_LINE>if (config.isTrue(ExportSettings.EXPORT_ON_ONLINE_STATUS_CHANGE)) {<NEW_LINE>processing.submitNonCritical(() -> exporter.exportPlayerPage(playerUUID, playerName));<NEW_LINE>}<NEW_LINE>}
config.isTrue(DataGatheringSettings.GEOLOCATIONS);
1,757,591
public boolean exists(AlluxioURI path, ExistsContext context) throws AccessControlException, IOException {<NEW_LINE>try (RpcContext rpcContext = createRpcContext(context);<NEW_LINE>FileSystemMasterAuditContext auditContext = createAuditContext("exists", path, null, null)) {<NEW_LINE>syncMetadata(rpcContext, path, context.getOptions().getCommonOptions(), DescendantType.ONE, auditContext, LockedInodePath::getInodeOrNull, (inodePath, permChecker) -> permChecker.checkPermission(Mode.Bits<MASK><NEW_LINE>try (LockedInodePath inodePath = mInodeTree.lockInodePath(createLockingScheme(path, context.getOptions().getCommonOptions(), LockPattern.READ))) {<NEW_LINE>LoadMetadataContext lmCtx = LoadMetadataContext.create(LoadMetadataPOptions.newBuilder().setCommonOptions(context.getOptions().getCommonOptions()).setLoadType(context.getOptions().getLoadMetadataType()));<NEW_LINE>if (shouldLoadMetadataIfNotExists(inodePath, lmCtx)) {<NEW_LINE>checkLoadMetadataOptions(context.getOptions().getLoadMetadataType(), path);<NEW_LINE>loadMetadataIfNotExist(rpcContext, path, lmCtx, false);<NEW_LINE>}<NEW_LINE>} catch (FileDoesNotExistException e) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>try (LockedInodePath inodePath = mInodeTree.lockInodePath(createLockingScheme(path, context.getOptions().getCommonOptions(), LockPattern.READ))) {<NEW_LINE>auditContext.setSucceeded(true);<NEW_LINE>return inodePath.fullPathExists();<NEW_LINE>}<NEW_LINE>} catch (InvalidPathException e) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
.READ, inodePath), false);
273,917
private static void initContext(DubboSpringInitContext context, BeanDefinitionRegistry registry, ConfigurableListableBeanFactory beanFactory) {<NEW_LINE>context.setRegistry(registry);<NEW_LINE>context.setBeanFactory(beanFactory);<NEW_LINE>// customize context, you can change the bind module model via DubboSpringInitCustomizer SPI<NEW_LINE>customize(context);<NEW_LINE>// init ModuleModel<NEW_LINE>ModuleModel moduleModel = context.getModuleModel();<NEW_LINE>if (moduleModel == null) {<NEW_LINE>ApplicationModel applicationModel;<NEW_LINE>if (findContextForApplication(ApplicationModel.defaultModel()) == null) {<NEW_LINE>// first spring context use default application instance<NEW_LINE>applicationModel = ApplicationModel.defaultModel();<NEW_LINE>logger.info("Use default application: " + safeGetModelDesc(applicationModel));<NEW_LINE>} else {<NEW_LINE>// create an new application instance for later spring context<NEW_LINE>applicationModel = FrameworkModel.defaultModel().newApplication();<NEW_LINE>logger.info("Create new application: " + safeGetModelDesc(applicationModel));<NEW_LINE>}<NEW_LINE>// init ModuleModel<NEW_LINE>moduleModel = applicationModel.getDefaultModule();<NEW_LINE>context.setModuleModel(moduleModel);<NEW_LINE>logger.info<MASK><NEW_LINE>} else {<NEW_LINE>logger.info("Use module model from customizer: " + safeGetModelDesc(moduleModel));<NEW_LINE>}<NEW_LINE>logger.info("Bind " + safeGetModelDesc(moduleModel) + " to spring container: " + ObjectUtils.identityToString(registry));<NEW_LINE>// set module attributes<NEW_LINE>if (context.getModuleAttributes().size() > 0) {<NEW_LINE>context.getModuleModel().getAttributes().putAll(context.getModuleAttributes());<NEW_LINE>}<NEW_LINE>// bind dubbo initialization context to spring context<NEW_LINE>registerContextBeans(beanFactory, context);<NEW_LINE>// mark context as bound<NEW_LINE>context.markAsBound();<NEW_LINE>// register common beans<NEW_LINE>DubboBeanUtils.registerCommonBeans(registry);<NEW_LINE>}
("Use default module model of target application: " + safeGetModelDesc(moduleModel));
1,222,150
public Void execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {<NEW_LINE>ModelCheckerInstance modelCheckerInstance = getDatabaseSession().get(modelCheckerInstanceOid, OldQuery.getDefault());<NEW_LINE>ModelCheckerPlugin modelCheckerPlugin = bimServer.getPluginManager().getModelCheckerPlugin(modelCheckerInstance.getModelCheckerPluginClassName(), true);<NEW_LINE>if (modelCheckerPlugin == null) {<NEW_LINE>throw new UserException("Model Checker Plugin \"" + modelCheckerInstance.getModelCheckerPluginClassName() + "\" not found/enabled");<NEW_LINE>}<NEW_LINE>// ModelChecker modelChecker = modelCheckerPlugin.createModelChecker(null);<NEW_LINE>// try {<NEW_LINE>// byte[] result = modelChecker.compile(modelCheckerInstance.getCode());<NEW_LINE>modelCheckerInstance.setValid(true);<NEW_LINE>// modelCheckerInstance.setCompiled(result);<NEW_LINE><MASK><NEW_LINE>// } catch (ModelCheckException e) {<NEW_LINE>// throw new UserException(e);<NEW_LINE>// }<NEW_LINE>return null;<NEW_LINE>}
getDatabaseSession().store(modelCheckerInstance);
549,268
public static // the local variables exist before the class instance is constructed.<NEW_LINE>EditTemplateDialogModel create(final BootDashModel section) {<NEW_LINE>final RunTargetType type = section.getRunTarget().getType();<NEW_LINE>return new EditTemplateDialogModel() {<NEW_LINE><NEW_LINE>{<NEW_LINE>template.setValue(section.getNameTemplate());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getTitle() {<NEW_LINE>String type = section.getRunTarget().getType().getName();<NEW_LINE>return "Customize Labels for " + type + " Target(s)";<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void performOk() throws Exception {<NEW_LINE>if (applyToAll.getValue()) {<NEW_LINE>section.getRunTarget().getType().<MASK><NEW_LINE>// To *really* apply the template to *all* targets of a given type, we must make sure<NEW_LINE>// that the targets do not override the value individually:<NEW_LINE>for (BootDashModel model : section.getViewModel().getSectionModels().getValue()) {<NEW_LINE>if (model.getRunTarget().getType().equals(type)) {<NEW_LINE>model.setNameTemplate(null);<NEW_LINE>model.notifyModelStateChanged();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>section.setNameTemplate(template.getValue());<NEW_LINE>section.notifyModelStateChanged();<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getHelpText() {<NEW_LINE>return type.getTemplateHelpText();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getDefaultValue() {<NEW_LINE>return type.getDefaultNameTemplate();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getApplyToAllLabel() {<NEW_LINE>return "Apply to all " + type.getName() + " targets";<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean getApplyToAllDefault() {<NEW_LINE>// 'apply to all' is enabled by default, unless there is at least one applicable model which already<NEW_LINE>// has an individually customized label.<NEW_LINE>for (BootDashModel section : section.getViewModel().getSectionModels().getValue()) {<NEW_LINE>if (section.getRunTarget().getType().equals(type) && section.hasCustomNameTemplate()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
setNameTemplate(template.getValue());
586,605
public WebResponse invokeJwtConsumer(String testcase, WebConversation wc, String tokenValue, TestSettings settings, List<validationData> expectations) throws Exception {<NEW_LINE>String thisMethod = "invokeJwtConsumer";<NEW_LINE>msgUtils.printMethodName(thisMethod);<NEW_LINE>WebConversation newWC = (wc == null<MASK><NEW_LINE>WebResponse response = null;<NEW_LINE>try {<NEW_LINE>setMarkToEndOfAllServersLogs();<NEW_LINE>// Build the request object<NEW_LINE>WebRequest request = new PostMethodWebRequest(settings.getJwtConsumerUrl());<NEW_LINE>String configId = settings.getJwtId();<NEW_LINE>if (configId != null) {<NEW_LINE>request.setParameter(Constants.JWT_CONSUMER_PARAM_CLIENT_ID, configId);<NEW_LINE>}<NEW_LINE>if (tokenValue != null) {<NEW_LINE>request.setParameter(Constants.JWT_CONSUMER_PARAM_JWT, tokenValue);<NEW_LINE>}<NEW_LINE>// Execute the request<NEW_LINE>msgUtils.printRequestParts(newWC, request, thisMethod, "Request for " + thisMethod);<NEW_LINE>response = newWC.getResponse(request);<NEW_LINE>msgUtils.printAllCookies(newWC);<NEW_LINE>msgUtils.printResponseParts(response, thisMethod, "Response from consumer app: ");<NEW_LINE>} catch (Exception e) {<NEW_LINE>msgUtils.printAllCookies(newWC);<NEW_LINE>if (response != null) {<NEW_LINE>msgUtils.printResponseParts(response, thisMethod, "Response from failed invocation of consumer app: ");<NEW_LINE>}<NEW_LINE>validationTools.validateException(expectations, Constants.INVOKE_JWT_CONSUMER, e);<NEW_LINE>}<NEW_LINE>validationTools.validateResult(response, Constants.INVOKE_JWT_CONSUMER, expectations, settings);<NEW_LINE>return response;<NEW_LINE>}
) ? new WebConversation() : wc;
524,799
public void run() {<NEW_LINE>try {<NEW_LINE>Universe universe = getUniverse();<NEW_LINE>for (String nodeIp : params().nodeIpList) {<NEW_LINE>List<String> command = new ArrayList<>();<NEW_LINE>command.add("timeout");<NEW_LINE>command.add(String.valueOf(DEFAULT_COMMMAND_TIMEOUT_SEC));<NEW_LINE>command.add("cat /proc/meminfo | grep -i '" + params().memoryType + "'");<NEW_LINE>command.add(" | awk -F' ' '{print $2}'");<NEW_LINE>NodeDetails <MASK><NEW_LINE>ShellResponse response = nodeUniverseManager.runCommand(node, universe, String.join(" ", command));<NEW_LINE>processShellResponse(response);<NEW_LINE>// We will be expecting the response in below format and the retrieved memory will be in KB.<NEW_LINE>// Command output: \n 4044800<NEW_LINE>List<String> cmdOutputList = Arrays.asList(response.getMessage().trim().split("\n", 0));<NEW_LINE>if (cmdOutputList.size() >= 2) {<NEW_LINE>Long availMemory = Long.parseLong(cmdOutputList.get(1).trim());<NEW_LINE>if (availMemory < params().memoryLimitKB) {<NEW_LINE>throw new RuntimeException("Insufficient memory available on node " + nodeIp + " as " + params().memoryLimitKB + " is required but found " + availMemory);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Error while fetching memory from node " + nodeIp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log.info("Validated Enough memory is available for Upgrade.");<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Errored out with: " + e);<NEW_LINE>Throwables.propagate(e);<NEW_LINE>}<NEW_LINE>}
node = universe.getNodeByPrivateIP(nodeIp);
516,489
public static byte[] toImage(String fileName, byte[] bytes, String stamp, Integer page) throws Exception {<NEW_LINE>Config.collect().validate();<NEW_LINE>URL serverUrl = new URL(Config.collect().url() + "/o2_collect_assemble/jaxrs/document/to/image");<NEW_LINE>HttpURLConnection connection = (HttpURLConnection) serverUrl.openConnection();<NEW_LINE>String boundary = "----" + StringTools.uniqueToken();<NEW_LINE>connection.setRequestMethod("POST");<NEW_LINE>connection.setDoOutput(true);<NEW_LINE>connection.setUseCaches(false);<NEW_LINE>connection.addRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary);<NEW_LINE>try (OutputStream out = connection.getOutputStream();<NEW_LINE>BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out))) {<NEW_LINE>writer.write(twoHyphens + boundary);<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write("Content-Disposition: form-data; name=\"file\"; filename=\"" + (StringUtils.isEmpty(fileName) ? StringTools.uniqueToken() : fileName) + "\"");<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write("Content-Type: " + HttpMediaType.APPLICATION_OCTET_STREAM);<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.flush();<NEW_LINE>out.write(bytes);<NEW_LINE>out.flush();<NEW_LINE>writer.write(CRLF);<NEW_LINE><MASK><NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write("Content-Disposition: form-data; name=\"page\"");<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write("Content-Type: " + HttpMediaType.TEXT_PLAIN);<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write("" + ((page == null || page < 0) ? 0 : page));<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write(twoHyphens + boundary);<NEW_LINE>if (StringUtils.isNotEmpty(stamp)) {<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write("Content-Disposition: form-data; name=\"stamp\"");<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write("Content-Type: " + HttpMediaType.TEXT_PLAIN);<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write(stamp);<NEW_LINE>writer.write(CRLF);<NEW_LINE>writer.write(twoHyphens + boundary);<NEW_LINE>}<NEW_LINE>writer.write(twoHyphens);<NEW_LINE>writer.flush();<NEW_LINE>}<NEW_LINE>String respText = null;<NEW_LINE>try (InputStream in = connection.getInputStream()) {<NEW_LINE>respText = IOUtils.toString(in, DefaultCharset.charset_utf_8);<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(respText)) {<NEW_LINE>ActionResponse response = XGsonBuilder.instance().fromJson(respText, ActionResponse.class);<NEW_LINE>WrapString wrap = XGsonBuilder.instance().fromJson(response.getData(), WrapString.class);<NEW_LINE>return Base64.decodeBase64(wrap.getValue());<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
writer.write(twoHyphens + boundary);
489,102
public static PickRay computePerspectivePickRay(double x, double y, boolean fixedEye, double viewWidth, double viewHeight, double fieldOfViewRadians, boolean verticalFieldOfView, Affine3D cameraTransform, double nearClip, double farClip, PickRay pickRay) {<NEW_LINE>if (pickRay == null) {<NEW_LINE>pickRay = new PickRay();<NEW_LINE>}<NEW_LINE>Vec3d direction = pickRay.getDirectionNoClone();<NEW_LINE>double halfViewWidth = viewWidth / 2.0;<NEW_LINE>double halfViewHeight = viewHeight / 2.0;<NEW_LINE><MASK><NEW_LINE>// Distance to projection plane from eye<NEW_LINE>double distanceZ = halfViewDim / Math.tan(fieldOfViewRadians / 2.0);<NEW_LINE>direction.x = x - halfViewWidth;<NEW_LINE>direction.y = y - halfViewHeight;<NEW_LINE>direction.z = distanceZ;<NEW_LINE>Vec3d eye = pickRay.getOriginNoClone();<NEW_LINE>if (fixedEye) {<NEW_LINE>eye.set(0.0, 0.0, 0.0);<NEW_LINE>} else {<NEW_LINE>// set eye at center of viewport and move back so that projection plane<NEW_LINE>// is at Z = 0<NEW_LINE>eye.set(halfViewWidth, halfViewHeight, -distanceZ);<NEW_LINE>}<NEW_LINE>pickRay.nearClip = nearClip * (direction.length() / (fixedEye ? distanceZ : 1.0));<NEW_LINE>pickRay.farClip = farClip * (direction.length() / (fixedEye ? distanceZ : 1.0));<NEW_LINE>pickRay.transform(cameraTransform);<NEW_LINE>return pickRay;<NEW_LINE>}
double halfViewDim = verticalFieldOfView ? halfViewHeight : halfViewWidth;
467,159
public void run(RegressionEnvironment env) {<NEW_LINE>String epl <MASK><NEW_LINE>env.compileDeploy(epl).addListener("s0").addListener("s1");<NEW_LINE>sendManyArray(env, new int[] { 1, 2 }, new int[] { 3, 4 });<NEW_LINE>sendManyArray(env, new int[] { 3, 4 }, new int[] { 1, 2 });<NEW_LINE>sendManyArray(env, new int[] { 1, 2 }, new int[] { 3, 5 });<NEW_LINE>sendManyArray(env, new int[] { 3, 4 }, new int[] { 1, 2 });<NEW_LINE>sendManyArray(env, new int[] { 1, 2 }, new int[] { 3, 4 });<NEW_LINE>env.sendEventBean(new SupportBean_S0(0));<NEW_LINE>env.assertPropsPerRowLastNew("s0", "intOne".split(","), new Object[][] { { new int[] { 1, 2 } }, { new int[] { 3, 4 } } });<NEW_LINE>env.sendEventBean(new SupportBean_S1(0));<NEW_LINE>env.assertPropsPerRowLastNew("s1", "intOne,intTwo".split(","), new Object[][] { { new int[] { 1, 2 }, new int[] { 3, 4 } }, { new int[] { 3, 4 }, new int[] { 1, 2 } }, { new int[] { 1, 2 }, new int[] { 3, 5 } } });<NEW_LINE>env.undeployAll();<NEW_LINE>}
= "@public create window MyWindow#keepall as SupportEventWithManyArray;\n" + "insert into MyWindow select * from SupportEventWithManyArray;\n" + "@name('s0') on SupportBean_S0 select distinct intOne from MyWindow;\n" + "@name('s1') on SupportBean_S1 select distinct intOne, intTwo from MyWindow;\n";
1,312,953
public JSONObject toJSON() {<NEW_LINE>JSONObject json = new JSONObject();<NEW_LINE>if (originalLocation != null) {<NEW_LINE>json.put("lat", String.format(Locale.US, "%.5f", originalLocation.getLatitude()));<NEW_LINE>json.put("lon", String.format(Locale.US, "%.5f", originalLocation.getLongitude()));<NEW_LINE>}<NEW_LINE>if (regionLang != null) {<NEW_LINE>json.put("regionLang", regionLang);<NEW_LINE>}<NEW_LINE>json.put("radiusLevel", radiusLevel);<NEW_LINE><MASK><NEW_LINE>json.put("lang", lang);<NEW_LINE>json.put("transliterateIfMissing", transliterateIfMissing);<NEW_LINE>json.put("emptyQueryAllowed", emptyQueryAllowed);<NEW_LINE>json.put("sortByName", sortByName);<NEW_LINE>if (searchTypes != null && searchTypes.length > 0) {<NEW_LINE>JSONArray searchTypesArr = new JSONArray();<NEW_LINE>for (ObjectType type : searchTypes) {<NEW_LINE>searchTypesArr.put(type.name());<NEW_LINE>}<NEW_LINE>json.put("searchTypes", searchTypes);<NEW_LINE>}<NEW_LINE>return json;<NEW_LINE>}
json.put("totalLimit", totalLimit);
1,285,855
public MergeCartResponse mergeCart(Customer customer, Order anonymousCart, boolean priceOrder) throws PricingException {<NEW_LINE>MergeCartResponse mergeCartResponse = new MergeCartResponse();<NEW_LINE>// reconstruct cart items (make sure they are valid)<NEW_LINE>ReconstructCartResponse reconstructCartResponse = reconstructCart(customer, false);<NEW_LINE>mergeCartResponse.setRemovedItems(reconstructCartResponse.getRemovedItems());<NEW_LINE>Order customerCart = reconstructCartResponse.getOrder();<NEW_LINE>if (anonymousCart != null && customerCart != null && anonymousCart.getId().equals(customerCart.getId())) {<NEW_LINE>mergeCartResponse.setMerged(false);<NEW_LINE>} else {<NEW_LINE>mergeCartResponse.setMerged(customerCart != null && customerCart.getOrderItems().size() > 0);<NEW_LINE>}<NEW_LINE>// add anonymous cart items (make sure they are valid)<NEW_LINE>if (anonymousCart != null && (customerCart == null || !customerCart.getId().equals(anonymousCart.getId()))) {<NEW_LINE>if (anonymousCart != null && anonymousCart.getOrderItems() != null && !anonymousCart.getOrderItems().isEmpty()) {<NEW_LINE>if (customerCart == null) {<NEW_LINE>customerCart = orderService.createNewCartForCustomer(customer);<NEW_LINE>}<NEW_LINE>Map<OrderItem, OrderItem> oldNewItemMap = new HashMap<OrderItem, OrderItem>();<NEW_LINE>customerCart = mergeRegularOrderItems(anonymousCart, mergeCartResponse, customerCart, oldNewItemMap);<NEW_LINE>customerCart = mergeOfferCodes(anonymousCart, customerCart);<NEW_LINE>customerCart = removeExpiredGiftWrapOrderItems(mergeCartResponse, customerCart, oldNewItemMap);<NEW_LINE>customerCart = mergeGiftWrapOrderItems(mergeCartResponse, customerCart, oldNewItemMap);<NEW_LINE>orderService.cancelOrder(anonymousCart);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// copy the customer's email to this order, overriding any previously set email<NEW_LINE>if (customerCart != null && StringUtils.isNotBlank(customer.getEmailAddress())) {<NEW_LINE>customerCart.<MASK><NEW_LINE>customerCart = orderService.save(customerCart, priceOrder);<NEW_LINE>}<NEW_LINE>mergeCartResponse.setOrder(customerCart);<NEW_LINE>return mergeCartResponse;<NEW_LINE>}
setEmailAddress(customer.getEmailAddress());
935,976
void validate(final ParameterContext ctx) {<NEW_LINE>for (final Map.Entry<? extends ExecutableElement, ? extends AnnotationValue> entry : ctx.anno().getElementValues().entrySet()) {<NEW_LINE>if (entry.getKey().getSimpleName().contentEquals("value")) {<NEW_LINE>final TypeElement key = ctx.elements().getTypeElement("org.spongepowered.api.event.EventContextKey");<NEW_LINE>final TypeElement keys = ctx.elements().getTypeElement("org.spongepowered.api.event.EventContextKeys");<NEW_LINE>final Element contained = ProcessorUtils.containingWithNameAndType(keys.getEnclosedElements(), entry.getValue().getValue().toString(), ElementKind.FIELD);<NEW_LINE>if (contained == null) {<NEW_LINE>ctx.logError(<MASK><NEW_LINE>// cannot resolve, not possible to provide more information<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!contained.getModifiers().contains(Modifier.STATIC)) {<NEW_LINE>ctx.logError("The @ContextValue annotation must refer to a static field", entry.getValue());<NEW_LINE>}<NEW_LINE>if (!ctx.types().isSubtype(contained.asType(), ctx.types().erasure(key.asType()))) {<NEW_LINE>ctx.logError("The @ContextValue annotation must refer to a field with type EventContextKey, but got '" + contained.asType() + "' instead", entry.getValue());<NEW_LINE>}<NEW_LINE>// validate field type?<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"Could not find a context key matching the provided name", entry.getValue());
986,154
private static ClassifiedTasks classifyTasks(ImmutableSet<TaskHandle> tasks, ImmutableSet<String> tlds) {<NEW_LINE>ClassifiedTasks.Builder classifiedTasksBuilder = ClassifiedTasks.builder();<NEW_LINE>// Read all tasks on the DNS pull queue and load them into the refresh item multimap.<NEW_LINE>for (TaskHandle task : tasks) {<NEW_LINE>try {<NEW_LINE>Map<String, String> params = ImmutableMap.copyOf(task.extractParams());<NEW_LINE>DateTime creationTime = DateTime.parse(params.get(DNS_TARGET_CREATE_TIME_PARAM));<NEW_LINE>String tld = params.get(PARAM_TLD);<NEW_LINE>if (tld == null) {<NEW_LINE>logger.atSevere().log("Discarding invalid DNS refresh request %s; no TLD specified.", task);<NEW_LINE>} else if (!tlds.contains(tld)) {<NEW_LINE>classifiedTasksBuilder.tasksToKeepBuilder().add(task);<NEW_LINE>classifiedTasksBuilder.unknownTldsBuilder().add(tld);<NEW_LINE>} else if (Registry.get(tld).getDnsPaused()) {<NEW_LINE>classifiedTasksBuilder.tasksToKeepBuilder().add(task);<NEW_LINE>classifiedTasksBuilder.pausedTldsBuilder().add(tld);<NEW_LINE>} else {<NEW_LINE>String <MASK><NEW_LINE>String name = params.get(DNS_TARGET_NAME_PARAM);<NEW_LINE>TargetType type = TargetType.valueOf(typeString);<NEW_LINE>switch(type) {<NEW_LINE>case DOMAIN:<NEW_LINE>case HOST:<NEW_LINE>classifiedTasksBuilder.refreshItemsByTldBuilder().put(tld, RefreshItem.create(type, name, creationTime));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>logger.atSevere().log("Discarding DNS refresh request %s of type %s.", task, typeString);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RuntimeException | UnsupportedEncodingException e) {<NEW_LINE>logger.atSevere().withCause(e).log("Discarding invalid DNS refresh request %s.", task);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return classifiedTasksBuilder.build();<NEW_LINE>}
typeString = params.get(DNS_TARGET_TYPE_PARAM);
872,377
private void decompressNextBlock() throws IOException {<NEW_LINE>outputBufferSize = 0;<NEW_LINE>outputBufferPos = 0;<NEW_LINE>fillInputBuffer();<NEW_LINE>assert (inputBufferPos == 0);<NEW_LINE>if (inputBufferSize != 0) {<NEW_LINE>bgzipHeader = new BGzipHeader(inputBuffer, inputBufferPos, inputBufferSize);<NEW_LINE>} else {<NEW_LINE>bgzipHeader = null;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int bsize = bgzipHeader<MASK><NEW_LINE>inputBufferPos += bsize;<NEW_LINE>if (isize == 0) {<NEW_LINE>decompressNextBlock();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>InputStream decompIS = new GZIPInputStream(new ByteArrayInputStream(inputBuffer, 0, bsize));<NEW_LINE>while (outputBufferSize < isize) {<NEW_LINE>int result = decompIS.read(outputBuffer, outputBufferSize, isize - outputBufferSize);<NEW_LINE>if (result < 0)<NEW_LINE>throw new ZipException(ZIP_EXCEPTION_MESSAGE);<NEW_LINE>outputBufferSize += result;<NEW_LINE>}<NEW_LINE>decompIS.close();<NEW_LINE>}
.bsize, isize = bgzipHeader.isize;
697,081
private void applyState(InetAddressAndPort endpoint, ApplicationState state, VersionedValue value, EndpointState epState) {<NEW_LINE>switch(state) {<NEW_LINE>case RELEASE_VERSION:<NEW_LINE>StargateSystemKeyspace.updatePeerInfo(endpoint, "release_version", value.value);<NEW_LINE>break;<NEW_LINE>case DC:<NEW_LINE>StargateSystemKeyspace.updatePeerInfo(endpoint, "data_center", value.value);<NEW_LINE>break;<NEW_LINE>case RACK:<NEW_LINE>StargateSystemKeyspace.updatePeerInfo(endpoint, "rack", value.value);<NEW_LINE>break;<NEW_LINE>case RPC_ADDRESS:<NEW_LINE>try {<NEW_LINE>StargateSystemKeyspace.updatePeerInfo(endpoint, "rpc_address", InetAddress.getByName(value.value));<NEW_LINE>} catch (UnknownHostException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case NATIVE_ADDRESS_AND_PORT:<NEW_LINE>try {<NEW_LINE>InetAddressAndPort address = InetAddressAndPort.getByName(value.value);<NEW_LINE><MASK><NEW_LINE>} catch (UnknownHostException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case SCHEMA:<NEW_LINE>// Use a fix schema version for all peers (always in agreement) because stargate waits<NEW_LINE>// for DDL queries to reach agreement before returning.<NEW_LINE>StargateSystemKeyspace.updatePeerInfo(endpoint, "schema_version", StargateSystemKeyspace.SCHEMA_VERSION);<NEW_LINE>break;<NEW_LINE>case HOST_ID:<NEW_LINE>StargateSystemKeyspace.updatePeerInfo(endpoint, "host_id", UUID.fromString(value.value));<NEW_LINE>break;<NEW_LINE>case RPC_READY:<NEW_LINE>notifyRpcChange(endpoint, epState.isRpcReady());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>}
StargateSystemKeyspace.updatePeerNativeAddress(endpoint, address);