idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
118,016
final ListWebhooksResult executeListWebhooks(ListWebhooksRequest listWebhooksRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listWebhooksRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListWebhooksRequest> request = null;<NEW_LINE>Response<ListWebhooksResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListWebhooksRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listWebhooksRequest));<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, "CodePipeline");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListWebhooks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListWebhooksResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListWebhooksResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,536,786
protected void visitDiscrepancies(DiscrepancyCallback discrepancy) {<NEW_LINE>try {<NEW_LINE>Deque<ResourceFile> stack = new ArrayDeque<>();<NEW_LINE>ResourceFile sourceDir = getSourceDirectory();<NEW_LINE>// start in the source directory root<NEW_LINE>stack.add(sourceDir);<NEW_LINE>while (!stack.isEmpty()) {<NEW_LINE>ResourceFile sourceSubdir = stack.pop();<NEW_LINE>String relPath = sourceSubdir.getAbsolutePath().substring(sourceDir.getAbsolutePath().length());<NEW_LINE>if (relPath.startsWith(File.separator)) {<NEW_LINE>relPath = relPath.substring(1);<NEW_LINE>}<NEW_LINE>Path binarySubdir = binaryDir.resolve(relPath);<NEW_LINE><MASK><NEW_LINE>// for each source file, lookup class files by class name<NEW_LINE>for (ResourceFile sourceFile : sourceSubdir.listFiles()) {<NEW_LINE>if (sourceFile.isDirectory()) {<NEW_LINE>stack.push(sourceFile);<NEW_LINE>} else {<NEW_LINE>List<Path> classFiles = mapper.findAndRemove(sourceFile);<NEW_LINE>if (classFiles != null) {<NEW_LINE>discrepancy.found(sourceFile, classFiles);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// any remaining .class files are missing .java files<NEW_LINE>if (mapper.hasExtraClassFiles()) {<NEW_LINE>discrepancy.found(null, mapper.extraClassFiles());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Msg.error(this, "Exception while searching for file system discrepancies ", e);<NEW_LINE>}<NEW_LINE>}
ClassMapper mapper = new ClassMapper(binarySubdir);
1,190,394
private HttpRequest transform(HttpRequest request) {<NEW_LINE>// Strip the prefix from the existing request and forward it.<NEW_LINE>String unprefixed = hasPrefix(request) ? request.getUri().substring(prefix.length(<MASK><NEW_LINE>HttpRequest toForward = new HttpRequest(request.getMethod(), unprefixed);<NEW_LINE>request.getHeaderNames().forEach(name -> {<NEW_LINE>if (name == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>request.getHeaders(name).forEach(value -> toForward.addHeader(name, value));<NEW_LINE>});<NEW_LINE>request.getAttributeNames().forEach(attr -> toForward.setAttribute(attr, request.getAttribute(attr)));<NEW_LINE>// Don't forget to register our prefix<NEW_LINE>Object rawPrefixes = request.getAttribute(ROUTE_PREFIX_KEY);<NEW_LINE>if (!(rawPrefixes instanceof List)) {<NEW_LINE>rawPrefixes = new LinkedList<>();<NEW_LINE>}<NEW_LINE>List<String> prefixes = Stream.concat(((List<?>) rawPrefixes).stream(), Stream.of(prefix)).map(String::valueOf).collect(toImmutableList());<NEW_LINE>toForward.setAttribute(ROUTE_PREFIX_KEY, prefixes);<NEW_LINE>request.getQueryParameterNames().forEach(name -> request.getQueryParameters(name).forEach(value -> toForward.addQueryParameter(name, value)));<NEW_LINE>toForward.setContent(request.getContent());<NEW_LINE>return toForward;<NEW_LINE>}
)) : request.getUri();
608,446
private void pull() {<NEW_LINE>if (inFlight.size() >= MAX_IN_FLIGHT) {<NEW_LINE>// Wait for checkpoint to be finalized before pulling anymore.<NEW_LINE>// There may be lag while checkpoints are persisted and the finalizeCheckpoint method<NEW_LINE>// is invoked. By limiting the in-flight messages we can ensure we don't end up consuming<NEW_LINE>// messages faster than we can checkpoint them.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long requestTimeMsSinceEpoch = now();<NEW_LINE>long deadlineMsSinceEpoch = requestTimeMsSinceEpoch + visibilityTimeoutMs;<NEW_LINE>final ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest(source.getRead().queueUrl());<NEW_LINE>receiveMessageRequest.setMaxNumberOfMessages(MAX_NUMBER_OF_MESSAGES);<NEW_LINE>receiveMessageRequest.setAttributeNames(Arrays.asList(MessageSystemAttributeName.SentTimestamp.toString()));<NEW_LINE>final ReceiveMessageResult receiveMessageResult = sqsClient.receiveMessage(receiveMessageRequest);<NEW_LINE>final List<Message> messages = receiveMessageResult.getMessages();<NEW_LINE>if (messages == null || messages.isEmpty()) {<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>lastReceivedMsSinceEpoch = requestTimeMsSinceEpoch;<NEW_LINE>// Capture the received messages.<NEW_LINE>for (Message message : messages) {<NEW_LINE>// Keep request time as message attribute for later usage<NEW_LINE>MessageAttributeValue reqTime = new MessageAttributeValue().withStringValue(Long.toString(requestTimeMsSinceEpoch));<NEW_LINE>message.setMessageAttributes(ImmutableMap.of(REQUEST_TIME, reqTime));<NEW_LINE>messagesNotYetRead.add(message);<NEW_LINE>notYetReadBytes += message.getBody().getBytes(UTF_8).length;<NEW_LINE>inFlight.put(message.getMessageId(), new InFlightState(message.getReceiptHandle(), requestTimeMsSinceEpoch, deadlineMsSinceEpoch));<NEW_LINE>numReceived++;<NEW_LINE>numReceivedRecently.add(requestTimeMsSinceEpoch, 1L);<NEW_LINE>long timestampMillis = getTimestamp(message).getMillis();<NEW_LINE>minReceivedTimestampMsSinceEpoch.add(requestTimeMsSinceEpoch, timestampMillis);<NEW_LINE>maxReceivedTimestampMsSinceEpoch.add(requestTimeMsSinceEpoch, timestampMillis);<NEW_LINE>minUnreadTimestampMsSinceEpoch.add(requestTimeMsSinceEpoch, timestampMillis);<NEW_LINE>}<NEW_LINE>}
numEmptyReceives.add(requestTimeMsSinceEpoch, 1L);
1,208,070
private boolean postIbexObjectiveFunction(Model model, List<String> vars, List<Number> coefs, Number rhs, Number rng, boolean maximize, boolean foundObj) {<NEW_LINE>if (foundObj) {<NEW_LINE>throw new ParserException("More than one objective function found");<NEW_LINE>} else if (rng != null) {<NEW_LINE>throw new ParserException("Range found for objective function");<NEW_LINE>} else {<NEW_LINE>StringBuilder fct = new StringBuilder();<NEW_LINE>for (int j = 0; j < vars.size(); j++) {<NEW_LINE>if (j > 0)<NEW_LINE>fct.append('+');<NEW_LINE>fct.append('{').append(j).append('}').append("*").append(coefs.get<MASK><NEW_LINE>}<NEW_LINE>RealVar objective = model.realVar("OBJ", NEG_INF, POS_INF, model.getPrecision());<NEW_LINE>model.setObjective(maximize, objective);<NEW_LINE>fct.append('=').append('{').append(vars.size()).append('}').append('+').append(rhs.doubleValue());<NEW_LINE>Variable[] svars = vars.stream().map(s -> decVars.get(s)).toArray(Variable[]::new);<NEW_LINE>model.realIbexGenericConstraint(fct.toString(), ArrayUtils.append(svars, new Variable[] { objective })).post();<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
(j).doubleValue());
1,822,982
public OAIRecord findOAIRecordBySetNameandGlobalId(String setName, String globalId) {<NEW_LINE>OAIRecord oaiRecord = null;<NEW_LINE>String queryString = "SELECT object(h) from OAIRecord h where h.globalId = :globalId";<NEW_LINE>// and h.setName is null";<NEW_LINE>queryString += setName != null ? " and h.setName = :setName" : "";<NEW_LINE>logger.fine("findOAIRecordBySetNameandGlobalId; query: " + queryString + "; globalId: " + globalId + "; setName: " + setName);<NEW_LINE>TypedQuery query = em.createQuery(queryString, OAIRecord.class).setParameter("globalId", globalId);<NEW_LINE>if (setName != null) {<NEW_LINE>query.setParameter("setName", setName);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>oaiRecord = (OAIRecord) query.<MASK><NEW_LINE>} catch (javax.persistence.NoResultException e) {<NEW_LINE>// Do nothing, just return null.<NEW_LINE>}<NEW_LINE>logger.fine("returning oai record.");<NEW_LINE>return oaiRecord;<NEW_LINE>}
setMaxResults(1).getSingleResult();
33,679
public Void visitNewAnonymousClassInstance(NewAnonymousClassInstance naci) {<NEW_LINE>if (naci.qualification != null) {<NEW_LINE>Unparser.this.unparseLhs(naci.qualification, ".");<NEW_LINE>Unparser.this.pw.print('.');<NEW_LINE>}<NEW_LINE>Unparser.this.pw.print("new " + naci.anonymousClassDeclaration.<MASK><NEW_LINE>for (int i = 0; i < naci.arguments.length; ++i) {<NEW_LINE>if (i > 0)<NEW_LINE>Unparser.this.pw.print(", ");<NEW_LINE>Unparser.this.unparseAtom(naci.arguments[i]);<NEW_LINE>}<NEW_LINE>Unparser.this.pw.println(") {");<NEW_LINE>Unparser.this.pw.print(AutoIndentWriter.INDENT);<NEW_LINE>Unparser.this.unparseClassDeclarationBody(naci.anonymousClassDeclaration);<NEW_LINE>Unparser.this.pw.print(AutoIndentWriter.UNINDENT + "}");<NEW_LINE>return null;<NEW_LINE>}
baseType.toString() + '(');
787,078
final ListProfilingGroupsResult executeListProfilingGroups(ListProfilingGroupsRequest listProfilingGroupsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listProfilingGroupsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListProfilingGroupsRequest> request = null;<NEW_LINE>Response<ListProfilingGroupsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListProfilingGroupsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listProfilingGroupsRequest));<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, "CodeGuruProfiler");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListProfilingGroups");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListProfilingGroupsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListProfilingGroupsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,789,016
public StringBuilder appendTo(final StringBuilder builder) {<NEW_LINE>builder.append('(');<NEW_LINE>// Token{signal=BEGIN_FIELD, name='learningRate', description='null', id=401, version=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}}<NEW_LINE>// Token{signal=ENCODING, name='float', description='null', id=-1, version=0, encodedLength=4, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=FLOAT, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}}<NEW_LINE>builder.append("learningRate=");<NEW_LINE>builder.append(learningRate());<NEW_LINE>builder.append('|');<NEW_LINE>// Token{signal=BEGIN_GROUP, name='summaryStat', description='null', id=402, version=0, encodedLength=10, offset=4, componentTokenCount=24, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}}<NEW_LINE>builder.append("summaryStat=[");<NEW_LINE>SummaryStatDecoder summaryStat = summaryStat();<NEW_LINE>if (summaryStat.count() > 0) {<NEW_LINE>while (summaryStat.hasNext()) {<NEW_LINE>summaryStat.next().appendTo(builder);<NEW_LINE>builder.append(',');<NEW_LINE>}<NEW_LINE>builder.setLength(<MASK><NEW_LINE>}<NEW_LINE>builder.append(']');<NEW_LINE>builder.append('|');<NEW_LINE>// Token{signal=BEGIN_GROUP, name='histograms', description='null', id=406, version=0, encodedLength=21, offset=-1, componentTokenCount=32, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}}<NEW_LINE>builder.append("histograms=[");<NEW_LINE>HistogramsDecoder histograms = histograms();<NEW_LINE>if (histograms.count() > 0) {<NEW_LINE>while (histograms.hasNext()) {<NEW_LINE>histograms.next().appendTo(builder);<NEW_LINE>builder.append(',');<NEW_LINE>}<NEW_LINE>builder.setLength(builder.length() - 1);<NEW_LINE>}<NEW_LINE>builder.append(']');<NEW_LINE>builder.append(')');<NEW_LINE>return builder;<NEW_LINE>}
builder.length() - 1);
778,630
void cacheBeanUpdate(String key, Map<String, Object> changes, boolean updateNaturalKey, long version) {<NEW_LINE>ServerCache cache = getBeanCache();<NEW_LINE>CachedBeanData existingData = (<MASK><NEW_LINE>if (existingData != null) {<NEW_LINE>long currentVersion = existingData.getVersion();<NEW_LINE>if (version > 0 && version < currentVersion) {<NEW_LINE>if (beanLog.isDebugEnabled()) {<NEW_LINE>beanLog.debug(" REMOVE {}({}) - version conflict old:{} new:{}", cacheName, key, currentVersion, version);<NEW_LINE>}<NEW_LINE>cache.remove(key);<NEW_LINE>} else {<NEW_LINE>if (version == 0) {<NEW_LINE>version = currentVersion;<NEW_LINE>}<NEW_LINE>CachedBeanData newData = existingData.update(changes, version);<NEW_LINE>if (beanLog.isDebugEnabled()) {<NEW_LINE>beanLog.debug(" UPDATE {}({}) changes:{}", cacheName, key, changes);<NEW_LINE>}<NEW_LINE>cache.put(key, newData);<NEW_LINE>}<NEW_LINE>if (updateNaturalKey) {<NEW_LINE>Object oldKey = calculateNaturalKey(existingData);<NEW_LINE>if (oldKey != null) {<NEW_LINE>if (natLog.isDebugEnabled()) {<NEW_LINE>natLog.debug(".. update {} REMOVE({}) - old key for ({})", cacheName, oldKey, key);<NEW_LINE>}<NEW_LINE>naturalKeyCache.remove(oldKey);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
CachedBeanData) cache.get(key);
1,521,378
public boolean doConnectionCleanup(java.sql.Connection conn) throws SQLException {<NEW_LINE>if (dataStoreHelper != null)<NEW_LINE>return doConnectionCleanupLegacy(conn);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>Tr.entry(this, tc, "doConnectionCleanup");<NEW_LINE>SQLWarning warn = conn.getWarnings();<NEW_LINE>if (warn == null) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>Tr.debug(this, tc, "doConnectionCleanup(): no warnings to cleanup");<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>conn.clearWarnings();<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>Tr.debug(this, tc, "doConnectionCleanup(): cleanup of warnings done");<NEW_LINE>} catch (SQLException se) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>Tr.debug(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "doConnectionCleanup");<NEW_LINE>return false;<NEW_LINE>}
this, tc, "doConnectionCleanup(): cleanup of warnings failed", se);
181,121
private static BufferedImage copy(Image image) {<NEW_LINE>int width = image.getWidth(null);<NEW_LINE>int height = image.getHeight(null);<NEW_LINE>BufferedImage copy;<NEW_LINE>try {<NEW_LINE>PixelGrabber pg = new PixelGrabber(image, 0, 0, 1, 1, false);<NEW_LINE>pg.grabPixels();<NEW_LINE>ColorModel cm = pg.getColorModel();<NEW_LINE>WritableRaster raster = cm.createCompatibleWritableRaster(width, height);<NEW_LINE>boolean isRasterPremultiplied = cm.isAlphaPremultiplied();<NEW_LINE>copy = new BufferedImage(cm, raster, isRasterPremultiplied, null);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>copy = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);<NEW_LINE>}<NEW_LINE>Graphics2D g2 = copy.createGraphics();<NEW_LINE>// Preserves color of<NEW_LINE><MASK><NEW_LINE>// transparent pixels<NEW_LINE>g2.drawImage(image, 0, 0, null);<NEW_LINE>g2.dispose();<NEW_LINE>return copy;<NEW_LINE>}
g2.setComposite(AlphaComposite.Src);
721,370
public CompletableFuture<ExecutionResult> execute(Document document, GraphQLSchema graphQLSchema, ExecutionId executionId, ExecutionInput executionInput, InstrumentationState instrumentationState) {<NEW_LINE>NodeUtil.GetOperationResult getOperationResult = NodeUtil.getOperation(document, executionInput.getOperationName());<NEW_LINE>Map<String, FragmentDefinition> fragmentsByName = getOperationResult.fragmentsByName;<NEW_LINE>OperationDefinition operationDefinition = getOperationResult.operationDefinition;<NEW_LINE>Map<String, Object> inputVariables = executionInput.getVariables();<NEW_LINE>List<VariableDefinition<MASK><NEW_LINE>Map<String, Object> coercedVariables;<NEW_LINE>try {<NEW_LINE>coercedVariables = valuesResolver.coerceVariableValues(graphQLSchema, variableDefinitions, inputVariables);<NEW_LINE>} catch (RuntimeException rte) {<NEW_LINE>if (rte instanceof GraphQLError) {<NEW_LINE>return completedFuture(new ExecutionResultImpl((GraphQLError) rte));<NEW_LINE>}<NEW_LINE>throw rte;<NEW_LINE>}<NEW_LINE>ExecutionContext executionContext = newExecutionContextBuilder().instrumentation(instrumentation).instrumentationState(instrumentationState).executionId(executionId).graphQLSchema(graphQLSchema).queryStrategy(queryStrategy).mutationStrategy(mutationStrategy).subscriptionStrategy(subscriptionStrategy).context(executionInput.getContext()).localContext(executionInput.getLocalContext()).root(executionInput.getRoot()).fragmentsByName(fragmentsByName).variables(coercedVariables).document(document).operationDefinition(operationDefinition).dataLoaderRegistry(executionInput.getDataLoaderRegistry()).cacheControl(executionInput.getCacheControl()).locale(executionInput.getLocale()).valueUnboxer(valueUnboxer).executionInput(executionInput).build();<NEW_LINE>InstrumentationExecutionParameters parameters = new InstrumentationExecutionParameters(executionInput, graphQLSchema, instrumentationState);<NEW_LINE>executionContext = instrumentation.instrumentExecutionContext(executionContext, parameters);<NEW_LINE>return executeOperation(executionContext, executionInput.getRoot(), executionContext.getOperationDefinition());<NEW_LINE>}
> variableDefinitions = operationDefinition.getVariableDefinitions();
1,251,883
private final void updateIfStale() {<NEW_LINE>if (!_stale) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final HUReceiptLinePartAttributes attributes = getAttributes();<NEW_LINE>//<NEW_LINE>// Qty & Quality<NEW_LINE>final Percent qualityDiscountPercent = Percent.of(attributes.getQualityDiscountPercent());<NEW_LINE>final ReceiptQty qtyAndQuality;<NEW_LINE>final Optional<Quantity> weight = attributes.getWeight();<NEW_LINE>if (weight.isPresent()) {<NEW_LINE>qtyAndQuality = ReceiptQty.newWithCatchWeight(productId, weight.<MASK><NEW_LINE>final StockQtyAndUOMQty stockAndCatchQty = StockQtyAndUOMQtys.createConvert(_qty, productId, weight.get());<NEW_LINE>qtyAndQuality.addQtyAndQualityDiscountPercent(stockAndCatchQty, qualityDiscountPercent);<NEW_LINE>} else {<NEW_LINE>qtyAndQuality = ReceiptQty.newWithoutCatchWeight(productId);<NEW_LINE>qtyAndQuality.addQtyAndQualityDiscountPercent(_qty, qualityDiscountPercent);<NEW_LINE>}<NEW_LINE>I_M_QualityNote qualityNote = null;<NEW_LINE>//<NEW_LINE>// Quality Notice (only if we have a discount percentage)<NEW_LINE>if (qualityDiscountPercent.signum() != 0) {<NEW_LINE>qualityNote = attributes.getQualityNote();<NEW_LINE>final String qualityNoticeDisplayName = attributes.getQualityNoticeDisplayName();<NEW_LINE>qtyAndQuality.addQualityNotices(QualityNoticesCollection.valueOfQualityNote(qualityNoticeDisplayName));<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Update values<NEW_LINE>if (_qualityNote == null) {<NEW_LINE>// set the quality note only if it was not set before. Only the first one is needed<NEW_LINE>_qualityNote = qualityNote;<NEW_LINE>}<NEW_LINE>_qtyAndQuality = qtyAndQuality;<NEW_LINE>_subProducerBPartnerId = attributes.getSubProducer_BPartner_ID();<NEW_LINE>_attributeStorageAggregationKey = attributes.getAttributeStorageAggregationKey();<NEW_LINE>// not stale anymore<NEW_LINE>_stale = false;<NEW_LINE>}
get().getUomId());
696,140
public static void checkNull(CheckNullObject ob) {<NEW_LINE>if (ob.getCheckObject() == null) {<NEW_LINE>throw new AppException(AppErrorCode.INVALID_USER_ARGS, String.format("actionName=%s|%s is NULL!", ob.getActionName(), ob.getObjectName()));<NEW_LINE>}<NEW_LINE>if (ob.getFields() != null && ob.getFields().size() > 0) {<NEW_LINE>Class<?> aClass = ob.getCheckObject().getClass();<NEW_LINE>for (String attr : ob.getFields()) {<NEW_LINE>Field declaredField;<NEW_LINE>try {<NEW_LINE>declaredField = aClass.getDeclaredField(attr);<NEW_LINE>} catch (NoSuchFieldException noSuchFieldException) {<NEW_LINE>throw new AppException(AppErrorCode.INVALID_USER_ARGS, String.format("actionName=%s|Object=%s|has no such field Exception: %s !", ob.getActionName(), ob.getObjectName(), attr), noSuchFieldException.getStackTrace());<NEW_LINE>}<NEW_LINE>declaredField.setAccessible(true);<NEW_LINE>Object o;<NEW_LINE>try {<NEW_LINE>o = declaredField.get(ob.getCheckObject());<NEW_LINE>} catch (IllegalAccessException illegalAccessException) {<NEW_LINE>throw new AppException(AppErrorCode.INVALID_USER_ARGS, String.format("actionName=%s|Object=%s|can not access to field:%s!", ob.getActionName(), ob.getObjectName(), attr), illegalAccessException.getStackTrace());<NEW_LINE>}<NEW_LINE>if (o == null) {<NEW_LINE>throw new AppException(AppErrorCode.INVALID_USER_ARGS, String.format("actionName=%s|Object=%s|%s field is NULL!", ob.getActionName(), ob<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getObjectName(), attr));
1,325,818
public void onTrainingEnd(Trainer trainer) {<NEW_LINE>Metrics metrics = trainer.getMetrics();<NEW_LINE>if (metrics == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>float p50;<NEW_LINE>float p90;<NEW_LINE>if (metrics.hasMetric("train")) {<NEW_LINE>// possible no train metrics if only one iteration is executed<NEW_LINE>p50 = metrics.percentile("train", 50).getValue().longValue() / 1_000_000f;<NEW_LINE>p90 = metrics.percentile("train", 90).getValue().longValue() / 1_000_000f;<NEW_LINE>logger.info(String.format("train P50: %.3f ms, P90: %.3f ms", p50, p90));<NEW_LINE>}<NEW_LINE>if (metrics.hasMetric("forward")) {<NEW_LINE>p50 = metrics.percentile("forward", 50).getValue().longValue() / 1_000_000f;<NEW_LINE>p90 = metrics.percentile("forward", 90).getValue().longValue() / 1_000_000f;<NEW_LINE>logger.info(String.format("forward P50: %.3f ms, P90: %.3f ms", p50, p90));<NEW_LINE>}<NEW_LINE>if (metrics.hasMetric("training-metrics")) {<NEW_LINE>p50 = metrics.percentile("training-metrics", 50).getValue().longValue() / 1_000_000f;<NEW_LINE>p90 = metrics.percentile("training-metrics", 90).getValue().longValue() / 1_000_000f;<NEW_LINE>logger.info(String.format("training-metrics P50: %.3f ms, P90: %.3f ms", p50, p90));<NEW_LINE>}<NEW_LINE>if (metrics.hasMetric("backward")) {<NEW_LINE>p50 = metrics.percentile("backward", 50).getValue<MASK><NEW_LINE>p90 = metrics.percentile("backward", 90).getValue().longValue() / 1_000_000f;<NEW_LINE>logger.info(String.format("backward P50: %.3f ms, P90: %.3f ms", p50, p90));<NEW_LINE>}<NEW_LINE>if (metrics.hasMetric("step")) {<NEW_LINE>p50 = metrics.percentile("step", 50).getValue().longValue() / 1_000_000f;<NEW_LINE>p90 = metrics.percentile("step", 90).getValue().longValue() / 1_000_000f;<NEW_LINE>logger.info(String.format("step P50: %.3f ms, P90: %.3f ms", p50, p90));<NEW_LINE>}<NEW_LINE>if (metrics.hasMetric("epoch")) {<NEW_LINE>p50 = metrics.percentile("epoch", 50).getValue().longValue() / 1_000_000_000f;<NEW_LINE>p90 = metrics.percentile("epoch", 90).getValue().longValue() / 1_000_000_000f;<NEW_LINE>logger.info(String.format("epoch P50: %.3f s, P90: %.3f s", p50, p90));<NEW_LINE>}<NEW_LINE>}
().longValue() / 1_000_000f;
1,670,683
protected void initTemplates() {<NEW_LINE>fmConfig = new Configuration();<NEW_LINE>fmConfig.setObjectWrapper(new DefaultObjectWrapper());<NEW_LINE>fmConfig.setClassForTemplateLoading(getClass(), "");<NEW_LINE>try {<NEW_LINE>ClassLoader loader = getClass().getClassLoader();<NEW_LINE>String templatePackage = "org/appcelerator/kroll/annotations/generator/";<NEW_LINE>InputStream v8HeaderStream = loader.getResourceAsStream(templatePackage + "ProxyBindingV8.h.fm");<NEW_LINE>InputStream v8SourceStream = loader.getResourceAsStream(templatePackage + "ProxyBindingV8.cpp.fm");<NEW_LINE>v8HeaderTemplate = new Template("ProxyBindingV8.h.fm", <MASK><NEW_LINE>v8SourceTemplate = new Template("ProxyBindingV8.cpp.fm", new InputStreamReader(v8SourceStream), fmConfig);<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
new InputStreamReader(v8HeaderStream), fmConfig);
386,267
private void initializeData(ImageData<BufferedImage> imageData) {<NEW_LINE>if (this.imageData != imageData) {<NEW_LINE>if (this.imageData != null)<NEW_LINE>this.imageData.getHierarchy().removePathObjectListener(this);<NEW_LINE>this.imageData = imageData;<NEW_LINE>if (imageData != null) {<NEW_LINE>imageData.getHierarchy().addPathObjectListener(this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (imageData == null || imageData.getHierarchy().getTMAGrid() == null) {<NEW_LINE>model.setImageData(null, Collections.emptyList());<NEW_LINE>grid.getItems().clear();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Request all core thumbnails now<NEW_LINE>List<TMACoreObject> cores = imageData.getHierarchy().getTMAGrid().getTMACoreList();<NEW_LINE>ImageServer<BufferedImage> server = imageData.getServer();<NEW_LINE>CountDownLatch latch = new CountDownLatch(cores.size());<NEW_LINE>for (TMACoreObject core : cores) {<NEW_LINE>ROI roi = core.getROI();<NEW_LINE>if (roi != null) {<NEW_LINE>qupath.submitShortTask(() -> {<NEW_LINE>RegionRequest request = createRegionRequest(core);<NEW_LINE>if (cache.containsKey(request)) {<NEW_LINE>latch.countDown();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BufferedImage img;<NEW_LINE>try {<NEW_LINE>img = server.readBufferedImage(request);<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.debug("Unable to get tile for " + request, e);<NEW_LINE>latch.countDown();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Image imageNew = SwingFXUtils.toFXImage(img, null);<NEW_LINE>if (imageNew != null) {<NEW_LINE>cache.put(request, imageNew);<NEW_LINE>// Platform.runLater(() -> updateGridDisplay());<NEW_LINE>}<NEW_LINE>latch.countDown();<NEW_LINE>});<NEW_LINE>} else<NEW_LINE>latch.countDown();<NEW_LINE>}<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>try {<NEW_LINE>latch.<MASK><NEW_LINE>} catch (InterruptedException e1) {<NEW_LINE>if (latch.getCount() > 0)<NEW_LINE>logger.warn("Loaded {} cores in 10 seconds", cores.size() - latch.getCount());<NEW_LINE>}<NEW_LINE>logger.info("Countdown complete in {} seconds", (System.currentTimeMillis() - startTime) / 1000.0);<NEW_LINE>model.setImageData(imageData, cores);<NEW_LINE>backingList.setAll(cores);<NEW_LINE>String m = measurement.getValue();<NEW_LINE>sortCores(backingList, model, m, descending.get());<NEW_LINE>filteredList.setPredicate(p -> {<NEW_LINE>return !(p.isMissing() || Double.isNaN(model.getNumericValue(p, m)));<NEW_LINE>});<NEW_LINE>grid.getItems().setAll(filteredList);<NEW_LINE>}
await(10, TimeUnit.SECONDS);
860,335
public static ListUserHistoryProducesResponse unmarshall(ListUserHistoryProducesResponse listUserHistoryProducesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listUserHistoryProducesResponse.setRequestId(_ctx.stringValue("ListUserHistoryProducesResponse.RequestId"));<NEW_LINE>listUserHistoryProducesResponse.setPageNum(_ctx.integerValue("ListUserHistoryProducesResponse.PageNum"));<NEW_LINE>listUserHistoryProducesResponse.setSuccess(_ctx.booleanValue("ListUserHistoryProducesResponse.Success"));<NEW_LINE>listUserHistoryProducesResponse.setTotalItemNum<MASK><NEW_LINE>listUserHistoryProducesResponse.setPageSize(_ctx.integerValue("ListUserHistoryProducesResponse.PageSize"));<NEW_LINE>listUserHistoryProducesResponse.setTotalPageNum(_ctx.integerValue("ListUserHistoryProducesResponse.TotalPageNum"));<NEW_LINE>List<Produces> data = new ArrayList<Produces>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListUserHistoryProducesResponse.Data.Length"); i++) {<NEW_LINE>Produces produces = new Produces();<NEW_LINE>produces.setSerialNumber(_ctx.stringValue("ListUserHistoryProducesResponse.Data[" + i + "].SerialNumber"));<NEW_LINE>produces.setStatus(_ctx.integerValue("ListUserHistoryProducesResponse.Data[" + i + "].Status"));<NEW_LINE>produces.setOrderPrice(_ctx.stringValue("ListUserHistoryProducesResponse.Data[" + i + "].OrderPrice"));<NEW_LINE>produces.setSolutionBizId(_ctx.stringValue("ListUserHistoryProducesResponse.Data[" + i + "].SolutionBizId"));<NEW_LINE>produces.setUserId(_ctx.stringValue("ListUserHistoryProducesResponse.Data[" + i + "].UserId"));<NEW_LINE>produces.setBizId(_ctx.stringValue("ListUserHistoryProducesResponse.Data[" + i + "].BizId"));<NEW_LINE>produces.setOrderTime(_ctx.stringValue("ListUserHistoryProducesResponse.Data[" + i + "].OrderTime"));<NEW_LINE>produces.setPartnerCode(_ctx.stringValue("ListUserHistoryProducesResponse.Data[" + i + "].PartnerCode"));<NEW_LINE>produces.setExtInfo(_ctx.stringValue("ListUserHistoryProducesResponse.Data[" + i + "].ExtInfo"));<NEW_LINE>produces.setBizType(_ctx.stringValue("ListUserHistoryProducesResponse.Data[" + i + "].BizType"));<NEW_LINE>produces.setIntentionBizId(_ctx.stringValue("ListUserHistoryProducesResponse.Data[" + i + "].IntentionBizId"));<NEW_LINE>produces.setOldOrder(_ctx.booleanValue("ListUserHistoryProducesResponse.Data[" + i + "].OldOrder"));<NEW_LINE>produces.setOrderId(_ctx.stringValue("ListUserHistoryProducesResponse.Data[" + i + "].OrderId"));<NEW_LINE>produces.setModifyTime(_ctx.stringValue("ListUserHistoryProducesResponse.Data[" + i + "].ModifyTime"));<NEW_LINE>data.add(produces);<NEW_LINE>}<NEW_LINE>listUserHistoryProducesResponse.setData(data);<NEW_LINE>return listUserHistoryProducesResponse;<NEW_LINE>}
(_ctx.integerValue("ListUserHistoryProducesResponse.TotalItemNum"));
1,572,628
public static Number aggregate(Collection<Number> source, Expression<?> expr, Operator aggregator) {<NEW_LINE>// This is a number expression<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Class<Number> numberType = (Class<Number>) expr.getType();<NEW_LINE>if (aggregator == Ops.AggOps.AVG_AGG) {<NEW_LINE>Number sum = reduce(source, SUM);<NEW_LINE>return sum.doubleValue() / source.size();<NEW_LINE>} else if (aggregator == Ops.AggOps.COUNT_AGG) {<NEW_LINE>return (long) source.size();<NEW_LINE>} else if (aggregator == Ops.AggOps.COUNT_DISTINCT_AGG) {<NEW_LINE>if (!Set.class.isInstance(source)) {<NEW_LINE>source <MASK><NEW_LINE>}<NEW_LINE>return (long) source.size();<NEW_LINE>} else if (aggregator == Ops.AggOps.MAX_AGG) {<NEW_LINE>return MathUtils.cast(reduce(source, MAX), numberType);<NEW_LINE>} else if (aggregator == Ops.AggOps.MIN_AGG) {<NEW_LINE>return MathUtils.cast(reduce(source, MIN), numberType);<NEW_LINE>} else if (aggregator == Ops.AggOps.SUM_AGG) {<NEW_LINE>return MathUtils.cast(reduce(source, SUM), numberType);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unknown operator " + aggregator);<NEW_LINE>}<NEW_LINE>}
= new HashSet<>(source);
1,626,272
public DataStream addBackingIndex(Metadata clusterMetadata, Index index) {<NEW_LINE>// validate that index is not part of another data stream<NEW_LINE>final var parentDataStream = clusterMetadata.getIndicesLookup().get(index.getName()).getParentDataStream();<NEW_LINE>if (parentDataStream != null) {<NEW_LINE>if (parentDataStream.getDataStream().equals(this)) {<NEW_LINE>return this;<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException(String.format(Locale.ROOT, "cannot add index [%s] to data stream [%s] because it is already a backing index on data stream [%s]", index.getName(), getName()<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// ensure that no aliases reference index<NEW_LINE>IndexMetadata im = clusterMetadata.index(clusterMetadata.getIndicesLookup().get(index.getName()).getWriteIndex());<NEW_LINE>if (im.getAliases().size() > 0) {<NEW_LINE>throw new IllegalArgumentException(String.format(Locale.ROOT, "cannot add index [%s] to data stream [%s] until its alias(es) [%s] are removed", index.getName(), getName(), Strings.collectionToCommaDelimitedString(im.getAliases().keySet().stream().sorted().toList())));<NEW_LINE>}<NEW_LINE>List<Index> backingIndices = new ArrayList<>(indices);<NEW_LINE>backingIndices.add(0, index);<NEW_LINE>assert backingIndices.size() == indices.size() + 1;<NEW_LINE>return new DataStream(name, backingIndices, generation + 1, metadata, hidden, replicated, system, allowCustomRouting, indexMode);<NEW_LINE>}
, parentDataStream.getName()));
1,671,231
public void migrate(Schema schema, DatabaseSession databaseSession) {<NEW_LINE>EClass oAuthServer = schema.createEClass("store", "OAuthServer");<NEW_LINE>schema.createEAttribute(oAuthServer, "registrationUrl", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.addIndex(schema.createEAttribute(oAuthServer, "clientId", EcorePackage.eINSTANCE.getEString()));<NEW_LINE>schema.createEAttribute(oAuthServer, "clientSecret", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEAttribute(oAuthServer, "clientName", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEAttribute(oAuthServer, "clientIcon", EcorePackage.eINSTANCE.getEByteArray());<NEW_LINE>schema.createEAttribute(oAuthServer, "clientUrl", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEAttribute(oAuthServer, "clientDescription", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.addIndex(schema.createEAttribute(oAuthServer, "redirectUrl", EcorePackage.eINSTANCE.getEString()));<NEW_LINE>schema.createEAttribute(oAuthServer, "expiresAt", EcorePackage.eINSTANCE.getEDate());<NEW_LINE>schema.createEAttribute(oAuthServer, "issuedAt", EcorePackage.eINSTANCE.getEDate());<NEW_LINE>schema.createEAttribute(oAuthServer, "incoming", EcorePackage.eINSTANCE.getEBoolean());<NEW_LINE>schema.addIndex(schema.createEAttribute(oAuthServer, "apiUrl", EcorePackage.eINSTANCE.getEString()));<NEW_LINE>schema.addIndex(schema.createEAttribute(oAuthServer, "registrationEndpoint", EcorePackage.eINSTANCE.getEString()));<NEW_LINE>EClass serverSettings = schema.getEClass("store", "ServerSettings");<NEW_LINE>schema.createEAttribute(serverSettings, "name", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEAttribute(serverSettings, "description", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEAttribute(serverSettings, "icon", EcorePackage.eINSTANCE.getEString());<NEW_LINE>EClass oauthAuthorizationCode = schema.createEClass("store", "OAuthAuthorizationCode");<NEW_LINE>schema.createEReference(oauthAuthorizationCode, "oauthServer", oAuthServer, Multiplicity.SINGLE);<NEW_LINE>schema.addIndex(schema.createEAttribute(oauthAuthorizationCode, "code", EcorePackage.eINSTANCE.getEString()));<NEW_LINE>EClass user = schema.getEClass("store", "User");<NEW_LINE>schema.createEReference(user, "oAuthAuthorizationCodes", oauthAuthorizationCode, Multiplicity.MANY);<NEW_LINE>schema.createEReference(user, "oAuthIssuedAuthorizationCodes", oauthAuthorizationCode, Multiplicity.MANY);<NEW_LINE>EClass authorization = <MASK><NEW_LINE>EClass singleProjectAuthorization = schema.createEClass("store", "SingleProjectAuthorization", authorization);<NEW_LINE>schema.createEReference(singleProjectAuthorization, "project", schema.getEClass("store", "Project"), Multiplicity.SINGLE);<NEW_LINE>schema.createEReference(oauthAuthorizationCode, "authorization", authorization, Multiplicity.SINGLE);<NEW_LINE>}
schema.createEClass("store", "Authorization");
745,479
public static <F, T> ImmutableMap<F, T> readAttributes(Iterable<F> files, AttributeReader<F, T> attributeReader, ListeningExecutorService executor) throws InterruptedException, ExecutionException {<NEW_LINE>List<ListenableFuture<FilePair<F, T>>> futures = Lists.newArrayList();<NEW_LINE>for (F file : files) {<NEW_LINE>futures.add(executor.submit(() -> {<NEW_LINE>T attribute = attributeReader.getAttribute(file);<NEW_LINE>if (attribute != null && attributeReader.isValid(attribute)) {<NEW_LINE>return new <MASK><NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}));<NEW_LINE>}<NEW_LINE>Map<F, T> result = new HashMap<>();<NEW_LINE>for (FilePair<F, T> filePair : Futures.allAsList(futures).get()) {<NEW_LINE>if (filePair != null) {<NEW_LINE>result.put(filePair.file, filePair.attribute);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ImmutableMap.copyOf(result);<NEW_LINE>}
FilePair<>(file, attribute);
381,351
public List<JdbcSession> extractData(ResultSet rs) throws SQLException, DataAccessException {<NEW_LINE>List<JdbcSession> sessions = new ArrayList<>();<NEW_LINE>while (rs.next()) {<NEW_LINE>String id = rs.getString("SESSION_ID");<NEW_LINE>JdbcSession session;<NEW_LINE>if (sessions.size() > 0 && getLast(sessions).getId().equals(id)) {<NEW_LINE>session = getLast(sessions);<NEW_LINE>} else {<NEW_LINE>MapSession delegate = new MapSession(id);<NEW_LINE>String primaryKey = rs.getString("PRIMARY_ID");<NEW_LINE>delegate.setCreationTime(Instant.ofEpochMilli(rs.getLong("CREATION_TIME")));<NEW_LINE>delegate.setLastAccessedTime(Instant.ofEpochMilli(rs.getLong("LAST_ACCESS_TIME")));<NEW_LINE>delegate.setMaxInactiveInterval(Duration.ofSeconds(<MASK><NEW_LINE>session = new JdbcSession(delegate, primaryKey, false);<NEW_LINE>}<NEW_LINE>String attributeName = rs.getString("ATTRIBUTE_NAME");<NEW_LINE>if (attributeName != null) {<NEW_LINE>byte[] bytes = getLobHandler().getBlobAsBytes(rs, "ATTRIBUTE_BYTES");<NEW_LINE>session.delegate.setAttribute(attributeName, lazily(() -> deserialize(bytes)));<NEW_LINE>}<NEW_LINE>sessions.add(session);<NEW_LINE>}<NEW_LINE>return sessions;<NEW_LINE>}
rs.getInt("MAX_INACTIVE_INTERVAL")));
314,997
private static Map<String, Set<String>> convertKeymap(List<MultiKeyBinding> keyBindings) {<NEW_LINE>Map<String, Set<String>> actionNameToShortcuts = new HashMap<String, Set<String>>();<NEW_LINE>for (int i = 0; i < keyBindings.size(); i++) {<NEW_LINE>MultiKeyBinding mkb = keyBindings.get(i);<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>for (int j = 0; j < mkb.getKeyStrokeCount(); j++) {<NEW_LINE>if (j > 0) {<NEW_LINE>// NOI18N<NEW_LINE>sb.append(' ');<NEW_LINE>}<NEW_LINE>sb.append(Utilities.keyToString(mkb.getKeyStrokeList().get(j), true));<NEW_LINE>}<NEW_LINE>Set<String> keyStrokes = actionNameToShortcuts.<MASK><NEW_LINE>if (keyStrokes == null) {<NEW_LINE>keyStrokes = new HashSet<String>();<NEW_LINE>actionNameToShortcuts.put(mkb.getActionName(), keyStrokes);<NEW_LINE>}<NEW_LINE>keyStrokes.add(sb.toString());<NEW_LINE>}<NEW_LINE>return actionNameToShortcuts;<NEW_LINE>}
get(mkb.getActionName());
827,915
public Entity add(PersistencePackage persistencePackage, DynamicEntityDao dynamicEntityDao, RecordHelper helper) throws ServiceException {<NEW_LINE>Entity entity = persistencePackage.getEntity();<NEW_LINE>try {<NEW_LINE>List<Property> productOptionProperties = getProductOptionProperties(entity);<NEW_LINE>// Verify that none of the selected options is null<NEW_LINE>Entity errorEntity = validateNotNullProductOptions(productOptionProperties);<NEW_LINE>if (errorEntity != null) {<NEW_LINE>entity.setPropertyValidationErrors(errorEntity.getPropertyValidationErrors());<NEW_LINE>return entity;<NEW_LINE>}<NEW_LINE>// Fill out the Sku instance from the form<NEW_LINE>PersistencePerspective persistencePerspective = persistencePackage.getPersistencePerspective();<NEW_LINE>Sku adminInstance = (Sku) Class.forName(entity.getType()[0]).newInstance();<NEW_LINE>Map<String, FieldMetadata> adminProperties = helper.getSimpleMergedProperties(Sku.class.getName(), persistencePerspective);<NEW_LINE>filterOutProductMetadata(adminProperties);<NEW_LINE>adminInstance = (Sku) helper.createPopulatedInstance(adminInstance, entity, adminProperties, false);<NEW_LINE>// Verify that there isn't already a Sku for this particular product option value combo<NEW_LINE>errorEntity = validateUniqueProductOptionValueCombination(adminInstance.getProduct(), productOptionProperties, null);<NEW_LINE>if (errorEntity != null) {<NEW_LINE>entity.setPropertyValidationErrors(errorEntity.getPropertyValidationErrors());<NEW_LINE>return entity;<NEW_LINE>}<NEW_LINE>// persist the newly-created Sku<NEW_LINE>adminInstance = dynamicEntityDao.persist(adminInstance);<NEW_LINE>// associate the product option values<NEW_LINE><MASK><NEW_LINE>// After associating the product option values, save off the Sku<NEW_LINE>adminInstance = dynamicEntityDao.merge(adminInstance);<NEW_LINE>// Fill out the DTO and add in the product option value properties to it<NEW_LINE>Entity result = helper.getRecord(adminProperties, adminInstance, null, null);<NEW_LINE>for (Property property : productOptionProperties) {<NEW_LINE>result.addProperty(property);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ServiceException("Unable to perform fetch for entity: " + Sku.class.getName(), e);<NEW_LINE>}<NEW_LINE>}
associateProductOptionValuesToSku(entity, adminInstance, dynamicEntityDao);
883,869
public boolean createObject(Map<FieldDef, String> newData) throws SQLException {<NEW_LINE>List<Object> insertData = new ArrayList<>();<NEW_LINE>StringBuffer insertColumnBuffer = new StringBuffer();<NEW_LINE>StringBuffer insertParamsBuffer = new StringBuffer();<NEW_LINE>defToMap(newData).forEach((key, value) -> {<NEW_LINE>insertColumnBuffer.append("," + key);<NEW_LINE>insertParamsBuffer.append(",?");<NEW_LINE>insertData.add(fixString(key<MASK><NEW_LINE>});<NEW_LINE>insertColumnBuffer.deleteCharAt(0);<NEW_LINE>insertParamsBuffer.deleteCharAt(0);<NEW_LINE>//<NEW_LINE>//<NEW_LINE>String //<NEW_LINE>sqlQuery = //<NEW_LINE>"" + "insert into " + this.releaseTableName + //<NEW_LINE>" (" + //<NEW_LINE>insertColumnBuffer.toString() + //<NEW_LINE>") values (" + insertParamsBuffer.toString() + ")";<NEW_LINE>return this.jdbcTemplate.executeUpdate(sqlQuery, insertData.toArray()) > 0;<NEW_LINE>}
, value.toString()));
1,002,967
public void run() {<NEW_LINE>if (AppState.get().proxyEnable && TxtUtils.isNotEmpty(AppState.get().proxyServer) && AppState.get().proxyPort != 0) {<NEW_LINE>Type http = AppState.PROXY_SOCKS.equals(AppState.get().proxyType) ? Type.SOCKS : Type.HTTP;<NEW_LINE>LOG.d("Proxy: Server", http.name(), AppState.get().proxyServer, AppState.get().proxyPort);<NEW_LINE>builder.proxy(new Proxy(http, new InetSocketAddress(AppState.get().proxyServer, AppState.<MASK><NEW_LINE>if (TxtUtils.isNotEmpty(AppState.get().proxyUser)) {<NEW_LINE>LOG.d("Proxy: User", AppState.get().proxyUser, AppState.get().proxyPassword);<NEW_LINE>builder.proxyAuthenticator(new BasicAuthenticator(new Credentials(AppState.get().proxyUser, AppState.get().proxyPassword)));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>builder.proxy(null);<NEW_LINE>}<NEW_LINE>client = builder.build();<NEW_LINE>}
get().proxyPort)));
1,412,858
public OAuthResult validateMisc(HttpServletRequest request, OidcBaseClient client, String grantType, AttributeList attrList) throws OidcServerException {<NEW_LINE>try {<NEW_LINE>if (OAuth20Constants.GRANT_TYPE_IMPLICIT.equals(grantType)) {<NEW_LINE>// ignore resource parameter if it's not an implicit request.<NEW_LINE>// For code type, the resource parameter shows at token_endpoint<NEW_LINE>OAuth20ProviderUtils.validateResource(request, attrList, client);<NEW_LINE>}<NEW_LINE>// add extended properties in the request<NEW_LINE>Enumeration<?> e = request.getParameterNames();<NEW_LINE>while (e.hasMoreElements()) {<NEW_LINE>String name = <MASK><NEW_LINE>if (!requiredAttributes.contains(name)) {<NEW_LINE>attrList.setAttribute(name, OAuth20Constants.ATTRTYPE_REQUEST, request.getParameterValues(name));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (OAuth20BadParameterException e) {<NEW_LINE>WebUtils.throwOidcServerException(request, e);<NEW_LINE>}<NEW_LINE>return new OAuthResultImpl(OAuthResult.STATUS_OK, attrList);<NEW_LINE>}
(String) e.nextElement();
982,234
private void createActions() {<NEW_LINE>refreshAction = new DockingAction("Refresh Strings", getName()) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isEnabledForContext(ActionContext context) {<NEW_LINE>return getCurrentProgram() != null;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionContext context) {<NEW_LINE>getToolBarData().setIcon(REFRESH_NOT_NEEDED_ICON);<NEW_LINE>reload();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>refreshAction.setToolBarData(new ToolBarData(REFRESH_NOT_NEEDED_ICON));<NEW_LINE>refreshAction.setDescription("<html>Push at any time to refresh the current table of strings.<br>" + "This button is highlighted when the data <i>may</i> be stale.<br>");<NEW_LINE>refreshAction.setHelpLocation(<MASK><NEW_LINE>tool.addLocalAction(provider, refreshAction);<NEW_LINE>tool.addLocalAction(provider, new MakeProgramSelectionAction(this, provider.getTable()));<NEW_LINE>linkNavigationAction = new SelectionNavigationAction(this, provider.getTable());<NEW_LINE>tool.addLocalAction(provider, linkNavigationAction);<NEW_LINE>DockingAction editDataSettingsAction = new DockingAction("Data Settings", getName(), KeyBindingType.SHARED) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionContext context) {<NEW_LINE>try {<NEW_LINE>DataSettingsDialog dialog = provider.getSelectedRowCount() == 1 ? new DataSettingsDialog(provider.getSelectedData()) : new DataSettingsDialog(currentProgram, provider.getProgramSelection());<NEW_LINE>tool.showDialog(dialog);<NEW_LINE>dialog.dispose();<NEW_LINE>} catch (CancelledException e) {<NEW_LINE>// do nothing<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>editDataSettingsAction.setPopupMenuData(new MenuData(new String[] { "Settings..." }, "R"));<NEW_LINE>editDataSettingsAction.setHelpLocation(new HelpLocation("DataPlugin", "Data_Settings"));<NEW_LINE>DockingAction editDefaultSettingsAction = new DockingAction("Default Settings", getName(), KeyBindingType.SHARED) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionContext context) {<NEW_LINE>DataType dt = getSelectedDataType();<NEW_LINE>if (dt == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DataTypeSettingsDialog dataSettingsDialog = new DataTypeSettingsDialog(dt, dt.getSettingsDefinitions());<NEW_LINE>tool.showDialog(dataSettingsDialog);<NEW_LINE>dataSettingsDialog.dispose();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isEnabledForContext(ActionContext context) {<NEW_LINE>if (provider.getSelectedRowCount() != 1) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>DataType dt = getSelectedDataType();<NEW_LINE>if (dt == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return dt.getSettingsDefinitions().length != 0;<NEW_LINE>}<NEW_LINE><NEW_LINE>private DataType getSelectedDataType() {<NEW_LINE>Data data = provider.getSelectedData();<NEW_LINE>return data != null ? data.getDataType() : null;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>editDefaultSettingsAction.setPopupMenuData(new MenuData(new String[] { "Default Settings..." }, "R"));<NEW_LINE>editDefaultSettingsAction.setHelpLocation(new HelpLocation("DataPlugin", "Default_Settings"));<NEW_LINE>tool.addLocalAction(provider, editDataSettingsAction);<NEW_LINE>tool.addLocalAction(provider, editDefaultSettingsAction);<NEW_LINE>}
new HelpLocation("ViewStringsPlugin", "Refresh"));
424,339
// @formatter:on<NEW_LINE>@Eject(method = "fill", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/storage/loot/LootTable;getRandomItems(Lnet/minecraft/world/level/storage/loot/LootContext;)Ljava/util/List;"))<NEW_LINE>private List<ItemStack> arclight$nonPluginEvent(LootTable lootTable, LootContext context, CallbackInfo ci, Container inv) {<NEW_LINE>List<ItemStack> <MASK><NEW_LINE>if (!context.hasParam(LootContextParams.ORIGIN) && !context.hasParam(LootContextParams.THIS_ENTITY)) {<NEW_LINE>return list;<NEW_LINE>}<NEW_LINE>LootGenerateEvent event = CraftEventFactory.callLootGenerateEvent(inv, (LootTable) (Object) this, context, list, false);<NEW_LINE>if (event.isCancelled()) {<NEW_LINE>ci.cancel();<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>return event.getLoot().stream().map(CraftItemStack::asNMSCopy).collect(Collectors.toList());<NEW_LINE>}<NEW_LINE>}
list = lootTable.getRandomItems(context);
1,814,947
private static IntermediateOperation importOperation(String name, Onnx.GraphProto onnxGraph, IntermediateGraph intermediateGraph) {<NEW_LINE>if (intermediateGraph.alreadyImported(name)) {<NEW_LINE>return intermediateGraph.get(name);<NEW_LINE>}<NEW_LINE>IntermediateOperation operation;<NEW_LINE>if (isArgumentTensor(name, onnxGraph)) {<NEW_LINE>Onnx.ValueInfoProto valueInfoProto = getArgumentTensor(name, onnxGraph);<NEW_LINE>if (valueInfoProto == null)<NEW_LINE>throw new IllegalArgumentException("Could not find argument tensor '" + name + "'");<NEW_LINE>OrderedTensorType type = TypeConverter.typeFrom(valueInfoProto.getType());<NEW_LINE>operation = new Argument(intermediateGraph.name(), valueInfoProto.getName(), type);<NEW_LINE>intermediateGraph.inputs(intermediateGraph.defaultSignature()).put(IntermediateOperation.namePartOf(name), operation.vespaName());<NEW_LINE>} else if (isConstantTensor(name, onnxGraph)) {<NEW_LINE>Onnx.TensorProto tensorProto = getConstantTensor(name, onnxGraph);<NEW_LINE>OrderedTensorType defaultType = TypeConverter.typeFrom(tensorProto);<NEW_LINE>operation = new Constant(intermediateGraph.name(), name, defaultType);<NEW_LINE>operation.setConstantValueFunction(type -> new TensorValue(TensorConverter.toVespaTensor(tensorProto, type)));<NEW_LINE>} else {<NEW_LINE>Onnx.NodeProto node = getNodeFromGraph(name, onnxGraph);<NEW_LINE>int outputIndex = getOutputIndex(node, name);<NEW_LINE>List<IntermediateOperation> inputs = importOperationInputs(node, onnxGraph, intermediateGraph);<NEW_LINE>operation = mapOperation(node, inputs, intermediateGraph, outputIndex);<NEW_LINE>// propagate constant values if all inputs are constant<NEW_LINE>if (operation.isConstant()) {<NEW_LINE>operation.setConstantValueFunction(operation::evaluateAsConstant);<NEW_LINE>}<NEW_LINE>if (isOutputNode(name, onnxGraph)) {<NEW_LINE>intermediateGraph.outputs(intermediateGraph.defaultSignature()).put(IntermediateOperation.namePartOf(name), operation.name());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>intermediateGraph.put(operation.name(), operation);<NEW_LINE><MASK><NEW_LINE>return operation;<NEW_LINE>}
intermediateGraph.put(name, operation);
1,733,775
public ProgressInfo dump(Result result, ExportFileManager writer, Reporter reporter, ExportConfig config) {<NEW_LINE>try (Transaction tx = db.beginTx();<NEW_LINE>PrintWriter printWriter = writer.getPrintWriter("csv")) {<NEW_LINE>CSVWriter out = getCsvWriter(printWriter, config);<NEW_LINE>String[] <MASK><NEW_LINE>String[] data = new String[header.length];<NEW_LINE>result.accept((row) -> {<NEW_LINE>for (int col = 0; col < header.length; col++) {<NEW_LINE>String key = header[col];<NEW_LINE>Object value = row.get(key);<NEW_LINE>data[col] = FormatUtils.toString(value);<NEW_LINE>reporter.update(value instanceof Node ? 1 : 0, value instanceof Relationship ? 1 : 0, value instanceof Entity ? 0 : 1);<NEW_LINE>}<NEW_LINE>out.writeNext(data, applyQuotesToAll);<NEW_LINE>reporter.nextRow();<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>tx.commit();<NEW_LINE>reporter.done();<NEW_LINE>return reporter.getTotal();<NEW_LINE>}<NEW_LINE>}
header = writeResultHeader(result, out);
407,259
private static URL computeCoreUrl() {<NEW_LINE>URL from;<NEW_LINE>String findBugsClassFile = ClassName.toSlashedClassName(FindBugs.class) + ".class";<NEW_LINE>URL me = FindBugs.class.<MASK><NEW_LINE>LOG.debug("FindBugs.class loaded from {}", me);<NEW_LINE>if (me == null) {<NEW_LINE>throw new IllegalStateException("Failed to load " + findBugsClassFile);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String u = me.toString();<NEW_LINE>if (u.startsWith("jar:") && u.endsWith("!/" + findBugsClassFile)) {<NEW_LINE>u = u.substring(4, u.indexOf("!/"));<NEW_LINE>from = new URL(u);<NEW_LINE>} else if (u.endsWith(findBugsClassFile)) {<NEW_LINE>u = u.substring(0, u.indexOf(findBugsClassFile));<NEW_LINE>from = new URL(u);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unknown url shema: " + u);<NEW_LINE>}<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>throw new IllegalArgumentException("Failed to parse url: " + me);<NEW_LINE>}<NEW_LINE>LOG.debug("Core class files loaded from {}", from);<NEW_LINE>return from;<NEW_LINE>}
getClassLoader().getResource(findBugsClassFile);
1,768,590
public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = new String[] { "theString", "intPrimitive" };<NEW_LINE>String statementText = "@name('s0') select distinct theString, intPrimitive from SupportBean#length_batch(3)";<NEW_LINE>env.compileDeploy(statementText).addListener("s0");<NEW_LINE>env.sendEventBean(new SupportBean("E1", 1));<NEW_LINE>env.sendEventBean(new SupportBean("E1", 1));<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, new Object[][] { { "E1", 1 } });<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.sendEventBean(new SupportBean("E2", 2));<NEW_LINE>env.assertPropsPerRowLastNew("s0", fields, new Object[][] { { "E1", 1 }, { "E2", 2 } });<NEW_LINE>env.sendEventBean(new SupportBean("E2", 2));<NEW_LINE>env.sendEventBean(new SupportBean("E1", 1));<NEW_LINE>env.sendEventBean(new SupportBean("E2", 2));<NEW_LINE>env.assertPropsPerRowLastNew("s0", fields, new Object[][] { { "E2", 2 }, { "E1", 1 } });<NEW_LINE>env.milestone(0);<NEW_LINE>env.sendEventBean(new SupportBean("E2", 3));<NEW_LINE>env.sendEventBean(<MASK><NEW_LINE>env.sendEventBean(new SupportBean("E2", 3));<NEW_LINE>env.assertPropsPerRowLastNew("s0", fields, new Object[][] { { "E2", 3 } });<NEW_LINE>env.undeployAll();<NEW_LINE>// test batch window with aggregation<NEW_LINE>env.advanceTime(0);<NEW_LINE>String[] fieldsTwo = new String[] { "c1", "c2" };<NEW_LINE>String epl = "@name('s0') insert into ABC select distinct theString as c1, first(intPrimitive) as c2 from SupportBean#time_batch(1 second)";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>env.sendEventBean(new SupportBean("E1", 1));<NEW_LINE>env.sendEventBean(new SupportBean("E2", 2));<NEW_LINE>env.advanceTime(1000);<NEW_LINE>env.assertPropsPerRowLastNew("s0", fieldsTwo, new Object[][] { { "E1", 1 }, { "E2", 1 } });<NEW_LINE>env.advanceTime(2000);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.undeployAll();<NEW_LINE>}
new SupportBean("E2", 3));
1,374,328
final DescribeExportResult executeDescribeExport(DescribeExportRequest describeExportRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeExportRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeExportRequest> request = null;<NEW_LINE>Response<DescribeExportResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeExportRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeExportRequest));<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, "Lex Models V2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeExport");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeExportResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeExportResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
309,813
public final Object read(final InputStream is) {<NEW_LINE>int states = 0;<NEW_LINE>int[] items;<NEW_LINE>double[] pi = null;<NEW_LINE>Matrix transitionProbability = null;<NEW_LINE>Map<String, String> properties = null;<NEW_LINE>List<StateDistribution> distributions = new ArrayList<StateDistribution>();<NEW_LINE>final EncogReadHelper in = new EncogReadHelper(is);<NEW_LINE>EncogFileSection section;<NEW_LINE>while ((section = in.readNextSection()) != null) {<NEW_LINE>if (section.getSectionName().equals("HMM") && section.getSubSectionName().equals("PARAMS")) {<NEW_LINE>properties = section.parseParams();<NEW_LINE>}<NEW_LINE>if (section.getSectionName().equals("HMM") && section.getSubSectionName().equals("CONFIG")) {<NEW_LINE>final Map<String, String> params = section.parseParams();<NEW_LINE>states = EncogFileSection.parseInt(params, HiddenMarkovModel.TAG_STATES);<NEW_LINE>if (params.containsKey(HiddenMarkovModel.TAG_ITEMS)) {<NEW_LINE>items = EncogFileSection.parseIntArray(params, HiddenMarkovModel.TAG_ITEMS);<NEW_LINE>}<NEW_LINE>pi = section.parseDoubleArray(params, HiddenMarkovModel.TAG_PI);<NEW_LINE>transitionProbability = section.parseMatrix(params, HiddenMarkovModel.TAG_TRANSITION);<NEW_LINE>} else if (section.getSectionName().equals("HMM") && section.getSubSectionName().startsWith("DISTRIBUTION-")) {<NEW_LINE>final Map<String, String> params = section.parseParams();<NEW_LINE>String t = params.get(HiddenMarkovModel.TAG_DIST_TYPE);<NEW_LINE>if ("ContinousDistribution".equals(t)) {<NEW_LINE>double[] mean = section.parseDoubleArray(params, HiddenMarkovModel.TAG_MEAN);<NEW_LINE>Matrix cova = section.parseMatrix(params, HiddenMarkovModel.TAG_COVARIANCE);<NEW_LINE>ContinousDistribution dist = new ContinousDistribution(mean, cova.getData());<NEW_LINE>distributions.add(dist);<NEW_LINE>} else if ("DiscreteDistribution".equals(t)) {<NEW_LINE>Matrix prob = section.parseMatrix(params, HiddenMarkovModel.TAG_PROBABILITIES);<NEW_LINE>DiscreteDistribution dist = new DiscreteDistribution(prob.getData());<NEW_LINE>distributions.add(dist);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final HiddenMarkovModel result = new HiddenMarkovModel(states);<NEW_LINE>result.getProperties().putAll(properties);<NEW_LINE>result.<MASK><NEW_LINE>result.setPi(pi);<NEW_LINE>int index = 0;<NEW_LINE>for (StateDistribution dist : distributions) {<NEW_LINE>result.setStateDistribution(index++, dist);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
setTransitionProbability(transitionProbability.getData());
1,223,871
public static TypeMirror greatestLowerBound(TypeMirror tm1, TypeMirror tm2, ProcessingEnvironment processingEnv) {<NEW_LINE>Type <MASK><NEW_LINE>Type t2 = TypeAnnotationUtils.unannotatedType(tm2);<NEW_LINE>JavacProcessingEnvironment javacEnv = (JavacProcessingEnvironment) processingEnv;<NEW_LINE>com.sun.tools.javac.code.Types types = com.sun.tools.javac.code.Types.instance(javacEnv.getContext());<NEW_LINE>if (types.isSameType(t1, t2)) {<NEW_LINE>// Special case if the two types are equal.<NEW_LINE>return t1;<NEW_LINE>}<NEW_LINE>// Handle the 'null' type manually.<NEW_LINE>if (t1.getKind() == TypeKind.NULL) {<NEW_LINE>return t1;<NEW_LINE>}<NEW_LINE>if (t2.getKind() == TypeKind.NULL) {<NEW_LINE>return t2;<NEW_LINE>}<NEW_LINE>// Special case for primitives.<NEW_LINE>if (isPrimitive(t1) || isPrimitive(t2)) {<NEW_LINE>if (types.isAssignable(t1, t2)) {<NEW_LINE>return t1;<NEW_LINE>} else if (types.isAssignable(t2, t1)) {<NEW_LINE>return t2;<NEW_LINE>} else {<NEW_LINE>// Javac types.glb returns TypeKind.Error when the GLB does<NEW_LINE>// not exist, but we can't create one. Use TypeKind.NONE<NEW_LINE>// instead.<NEW_LINE>return processingEnv.getTypeUtils().getNoType(TypeKind.NONE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (t1.getKind() == TypeKind.WILDCARD) {<NEW_LINE>return t2;<NEW_LINE>}<NEW_LINE>if (t2.getKind() == TypeKind.WILDCARD) {<NEW_LINE>return t1;<NEW_LINE>}<NEW_LINE>// If neither type is a primitive type, null type, or wildcard<NEW_LINE>// and if the types are not the same, use javac types.glb<NEW_LINE>return types.glb(t1, t2);<NEW_LINE>}
t1 = TypeAnnotationUtils.unannotatedType(tm1);
595,604
public ServiceResult initialize(final StructrServices services, String serviceName) throws ClassNotFoundException, InstantiationException, IllegalAccessException {<NEW_LINE>final String taskList = Settings.CronTasks.getValue();<NEW_LINE>if (StringUtils.isNotBlank(taskList)) {<NEW_LINE>for (String task : taskList.split("[ \\t]+")) {<NEW_LINE>if (StringUtils.isNotBlank(task)) {<NEW_LINE>final Setting cronSetting = Settings.getCaseSensitiveSetting(task, EXPRESSION_SUFFIX);<NEW_LINE>if (cronSetting != null) {<NEW_LINE>CronEntry entry = CronEntry.parse(task, cronSetting.<MASK><NEW_LINE>if (entry != null) {<NEW_LINE>logger.info("Adding cron entry {} for '{}'", entry, task);<NEW_LINE>cronEntries.add(entry);<NEW_LINE>} else {<NEW_LINE>logger.warn("Unable to parse cron expression for task '{}', ignoring.", task);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.warn("No cron expression for task '{}', ignoring.", task);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new ServiceResult(true);<NEW_LINE>}
getValue().toString());
1,187,961
@RequestMapping(value = "/settings/testMail", method = RequestMethod.POST)<NEW_LINE>public void sendTestMail(@ApiParam(value = "A JSON value representing the Mail Settings.") @RequestBody AdminSettings adminSettings) throws ThingsboardException {<NEW_LINE>try {<NEW_LINE>accessControlService.checkPermission(getCurrentUser(), <MASK><NEW_LINE>adminSettings = checkNotNull(adminSettings);<NEW_LINE>if (adminSettings.getKey().equals("mail")) {<NEW_LINE>if (!adminSettings.getJsonValue().has("password")) {<NEW_LINE>AdminSettings mailSettings = checkNotNull(adminSettingsService.findAdminSettingsByKey(TenantId.SYS_TENANT_ID, "mail"));<NEW_LINE>((ObjectNode) adminSettings.getJsonValue()).put("password", mailSettings.getJsonValue().get("password").asText());<NEW_LINE>}<NEW_LINE>String email = getCurrentUser().getEmail();<NEW_LINE>mailService.sendTestMail(adminSettings.getJsonValue(), email);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw handleException(e);<NEW_LINE>}<NEW_LINE>}
Resource.ADMIN_SETTINGS, Operation.READ);
1,687,616
public void onBindViewHolder(PreferenceViewHolder holder) {<NEW_LINE>super.onBindViewHolder(holder);<NEW_LINE>boolean hasSettings = mSettingsInfo != null;<NEW_LINE>holder.findViewById(R.id.settings).setVisibility(hasSettings ? VISIBLE : GONE);<NEW_LINE>holder.findViewById(R.id.divider).setVisibility(hasSettings ? VISIBLE : GONE);<NEW_LINE>holder.findViewById(R.id.settings).setOnClickListener(v -> {<NEW_LINE>if (hasSettings) {<NEW_LINE>v.getContext().startActivity(new Intent().setComponent(new ComponentName(mSettingsInfo.activityInfo.packageName, <MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>holder.itemView.setOnLongClickListener(v -> {<NEW_LINE>Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);<NEW_LINE>intent.setData(Uri.fromParts("package", mPackageName, null));<NEW_LINE>getContext().startActivity(intent);<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>}
mSettingsInfo.activityInfo.name)));
24,603
public boolean execute() {<NEW_LINE>MeasurementEditingContext editingCtx = getEditingCtx();<NEW_LINE>oldPoints = new ArrayList<>(editingCtx.getPoints());<NEW_LINE>oldRoadSegmentData = editingCtx.getRoadSegmentData();<NEW_LINE>newPoints = new ArrayList<>(oldPoints.size());<NEW_LINE>for (int i = oldPoints.size() - 1; i >= 0; i--) {<NEW_LINE>WptPt point = oldPoints.get(i);<NEW_LINE>WptPt prevPoint = i > 0 ? oldPoints.get(i - 1) : null;<NEW_LINE><MASK><NEW_LINE>newPoint.copyExtensions(point);<NEW_LINE>if (prevPoint != null) {<NEW_LINE>String profileType = prevPoint.getProfileType();<NEW_LINE>if (profileType != null) {<NEW_LINE>newPoint.setProfileType(profileType);<NEW_LINE>} else {<NEW_LINE>newPoint.removeProfileType();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>newPoints.add(newPoint);<NEW_LINE>}<NEW_LINE>executeCommand();<NEW_LINE>return true;<NEW_LINE>}
WptPt newPoint = new WptPt(point);
972,283
private void activatePanelElements(TournamentTypeView tournamentType) {<NEW_LINE>this.pnlDraftOptions.setVisible(tournamentType.isDraft());<NEW_LINE>this.lblNumRounds.setVisible(!tournamentType.isElimination());<NEW_LINE>this.spnNumRounds.setVisible(!tournamentType.isElimination());<NEW_LINE>this.lblConstructionTime.setVisible(tournamentType.isLimited());<NEW_LINE>this.spnConstructTime.setVisible(tournamentType.isLimited());<NEW_LINE>this.lbDeckType.setVisible<MASK><NEW_LINE>this.cbDeckType.setVisible(!tournamentType.isLimited());<NEW_LINE>this.lblGameType.setVisible(!tournamentType.isLimited());<NEW_LINE>this.cbGameType.setVisible(!tournamentType.isLimited());<NEW_LINE>this.player1Panel.showDeckElements(!tournamentType.isLimited());<NEW_LINE>if (tournamentType.isLimited()) {<NEW_LINE>if (tournamentType.isCubeBooster()) {<NEW_LINE>this.lblDraftCube.setVisible(true);<NEW_LINE>this.cbDraftCube.setVisible(true);<NEW_LINE>this.lblPacks.setVisible(false);<NEW_LINE>this.pnlPacks.setVisible(false);<NEW_LINE>this.pnlRandomPacks.setVisible(false);<NEW_LINE>} else if (tournamentType.isRandom() || tournamentType.isRichMan()) {<NEW_LINE>this.lblDraftCube.setVisible(false);<NEW_LINE>this.cbDraftCube.setVisible(false);<NEW_LINE>this.lblPacks.setVisible(true);<NEW_LINE>this.pnlRandomPacks.setVisible(true);<NEW_LINE>this.pnlPacks.setVisible(false);<NEW_LINE>} else {<NEW_LINE>this.lblDraftCube.setVisible(false);<NEW_LINE>this.cbDraftCube.setVisible(false);<NEW_LINE>this.lblPacks.setVisible(true);<NEW_LINE>this.pnlPacks.setVisible(true);<NEW_LINE>this.pnlRandomPacks.setVisible(false);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// construced<NEW_LINE>this.lblDraftCube.setVisible(false);<NEW_LINE>this.cbDraftCube.setVisible(false);<NEW_LINE>this.pnlPacks.setVisible(false);<NEW_LINE>this.pnlPacks.setVisible(false);<NEW_LINE>this.pnlRandomPacks.setVisible(false);<NEW_LINE>}<NEW_LINE>}
(!tournamentType.isLimited());
370,882
private <T> List<T> load(Class<T> type, final String[] customConverterClassNames, final ClassLoader classLoader, final Kryo kryo) {<NEW_LINE>if (customConverterClassNames == null || customConverterClassNames.length == 0) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>final List<T> result = new ArrayList<T>();<NEW_LINE>final ClassLoader loader = classLoader != null ? classLoader : Thread.currentThread().getContextClassLoader();<NEW_LINE>for (final String element : customConverterClassNames) {<NEW_LINE>try {<NEW_LINE>final Class<?> clazz = Class.forName(element, true, loader);<NEW_LINE>if (type.isAssignableFrom(clazz)) {<NEW_LINE>LOG.info("Loading " + type.getSimpleName() + " " + element);<NEW_LINE>final T item = createInstance(clazz.asSubclass(type), kryo);<NEW_LINE>result.add(item);<NEW_LINE>}<NEW_LINE>} catch (final Exception e) {<NEW_LINE>LOG.error("Could not instantiate " + element + ", omitting this " + type.<MASK><NEW_LINE>throw new RuntimeException("Could not load " + type.getSimpleName() + " " + element, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
getSimpleName() + ".", e);
283,947
public void onClick(View view) {<NEW_LINE>Intent intent;<NEW_LINE>switch(view.getId()) {<NEW_LINE>case R.id.group_choose_sender_id:<NEW_LINE>intent = SelectActivity.pickSenderId(this, R.id.group_choose_sender_id);<NEW_LINE>startActivityForResult(intent, 0);<NEW_LINE>break;<NEW_LINE>case R.id.group_api_key:<NEW_LINE>intent = SelectActivity.pickApiKey(this, R.id.group_api_key);<NEW_LINE>startActivityForResult(intent, 0);<NEW_LINE>break;<NEW_LINE>case R.id.group_new_member:<NEW_LINE>intent = SelectActivity.pickToken(<MASK><NEW_LINE>startActivityForResult(intent, 0);<NEW_LINE>break;<NEW_LINE>case R.id.widget_itbr_button:<NEW_LINE>memberAction(view);<NEW_LINE>break;<NEW_LINE>case R.id.group_submit:<NEW_LINE>if (editMode) {<NEW_LINE>submitApplyChanges();<NEW_LINE>} else {<NEW_LINE>submitCreateGroup();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
this, R.id.group_new_member);
297,718
protected boolean isExportOk(X req, String repositoryName, Repository db) throws IOException {<NEW_LINE>RepositoryModel model = gitblit.getRepositoryModel(repositoryName);<NEW_LINE>UserModel user = UserModel.ANONYMOUS;<NEW_LINE>String scheme = null;<NEW_LINE>String origin = null;<NEW_LINE>if (req instanceof GitDaemonClient) {<NEW_LINE>// git daemon request<NEW_LINE>// this is an anonymous/unauthenticated protocol<NEW_LINE>GitDaemonClient client = (GitDaemonClient) req;<NEW_LINE>scheme = "git";<NEW_LINE>origin = client.getRemoteAddress().toString();<NEW_LINE>} else if (req instanceof HttpServletRequest) {<NEW_LINE>// http/https request<NEW_LINE>HttpServletRequest client = (HttpServletRequest) req;<NEW_LINE>scheme = client.getScheme();<NEW_LINE>origin = client.getRemoteAddr();<NEW_LINE>user = gitblit.authenticate(client);<NEW_LINE>if (user == null) {<NEW_LINE>user = UserModel.ANONYMOUS;<NEW_LINE>}<NEW_LINE>} else if (req instanceof SshDaemonClient) {<NEW_LINE>// ssh is always authenticated<NEW_LINE>SshDaemonClient client = (SshDaemonClient) req;<NEW_LINE>user = client.getUser();<NEW_LINE>}<NEW_LINE>if (user.canClone(model)) {<NEW_LINE>// user can access this git repo<NEW_LINE>logger.debug(MessageFormat.format("{0}:// access of {1} by {2} from {3} PERMITTED", scheme, repositoryName<MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// user can not access this git repo<NEW_LINE>logger.warn(MessageFormat.format("{0}:// access of {1} by {2} from {3} DENIED", scheme, repositoryName, user.username, origin));<NEW_LINE>return false;<NEW_LINE>}
, user.username, origin));
764,056
protected void onResume() {<NEW_LINE>// new AndroidSupportMeWrapper(this).mainOnResume();<NEW_LINE>super.onResume();<NEW_LINE>IS_DEBUG_ENABLED = BuildConfig.IS_TEST_BUILD;<NEW_LINE>if (_appSettings.isRecreateMainRequired()) {<NEW_LINE>// recreate(); // does not remake fragments<NEW_LINE>final Intent intent = getIntent();<NEW_LINE>overridePendingTransition(0, 0);<NEW_LINE><MASK><NEW_LINE>finish();<NEW_LINE>overridePendingTransition(0, 0);<NEW_LINE>startActivity(intent);<NEW_LINE>}<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && _appSettings.isMultiWindowEnabled()) {<NEW_LINE>setTaskDescription(new ActivityManager.TaskDescription(getString(R.string.app_name)));<NEW_LINE>}<NEW_LINE>if (_appSettings.isKeepScreenOn()) {<NEW_LINE>getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);<NEW_LINE>} else {<NEW_LINE>getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);<NEW_LINE>}<NEW_LINE>}
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
1,084,705
public void cylinderBrush(Player player, LocalSession session, @Arg(desc = "The pattern of blocks to set") Pattern pattern, @Arg(desc = "The radius of the cylinder", def = "2") double radius, @Arg(desc = "The height of the cylinder", def = "1") int height, @Switch(name = 'h', desc = "Create hollow cylinders instead") boolean hollow) throws WorldEditException {<NEW_LINE>worldEdit.checkMaxBrushRadius(radius);<NEW_LINE>worldEdit.checkMaxBrushRadius(height);<NEW_LINE>BrushTool tool = session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType());<NEW_LINE>tool.setFill(pattern);<NEW_LINE>tool.setSize(radius);<NEW_LINE>if (hollow) {<NEW_LINE>tool.setBrush(new HollowCylinderBrush(height), "worldedit.brush.cylinder");<NEW_LINE>} else {<NEW_LINE>tool.setBrush(<MASK><NEW_LINE>}<NEW_LINE>player.printInfo(TranslatableComponent.of("worldedit.brush.cylinder.equip", TextComponent.of((int) radius), TextComponent.of(height)));<NEW_LINE>ToolCommands.sendUnbindInstruction(player, UNBIND_COMMAND_COMPONENT);<NEW_LINE>}
new CylinderBrush(height), "worldedit.brush.cylinder");
1,635,240
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {<NEW_LINE>builder.addConstructorArgValue(element.getAttribute("path"));<NEW_LINE>String handshakeInterceptors = element.getAttribute("handshake-interceptors");<NEW_LINE>List<BeanReference> handshakeInterceptorList = new ManagedList<BeanReference>();<NEW_LINE>String[] ids = StringUtils.commaDelimitedListToStringArray(handshakeInterceptors);<NEW_LINE>for (String id : ids) {<NEW_LINE>handshakeInterceptorList.add(new RuntimeBeanReference(id));<NEW_LINE>}<NEW_LINE>builder.addPropertyValue("interceptors", handshakeInterceptorList);<NEW_LINE>String decoratorFactories = element.getAttribute("decorator-factories");<NEW_LINE>List<BeanReference> decoratorFactoryList = new ManagedList<BeanReference>();<NEW_LINE>ids = StringUtils.commaDelimitedListToStringArray(decoratorFactories);<NEW_LINE>for (String id : ids) {<NEW_LINE>decoratorFactoryList.add(new RuntimeBeanReference(id));<NEW_LINE>}<NEW_LINE>builder.addPropertyValue("decoratorFactories", decoratorFactoryList);<NEW_LINE>Element sockjs = DomUtils.getChildElementByTagName(element, "sockjs");<NEW_LINE>if (sockjs != null) {<NEW_LINE>BeanDefinitionBuilder sockjsBuilder = BeanDefinitionBuilder.genericBeanDefinition(ServerWebSocketContainer.SockJsServiceOptions.class);<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(sockjsBuilder, sockjs, "client-library-url");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(<MASK><NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(sockjsBuilder, sockjs, "stream-bytes-limit");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(sockjsBuilder, sockjs, "session-cookie-needed");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(sockjsBuilder, sockjs, "heartbeat-time");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(sockjsBuilder, sockjs, "disconnect-delay");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(sockjsBuilder, sockjs, "message-cache-size", "httpMessageCacheSize");<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(sockjsBuilder, sockjs, "scheduler", "taskScheduler");<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(sockjsBuilder, sockjs, "message-codec");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(sockjsBuilder, sockjs, "suppress-cors");<NEW_LINE>String transportHandlers = sockjs.getAttribute("transport-handlers");<NEW_LINE>if (StringUtils.hasText(transportHandlers)) {<NEW_LINE>List<BeanReference> transportHandlerList = new ManagedList<BeanReference>();<NEW_LINE>ids = StringUtils.commaDelimitedListToStringArray(transportHandlers);<NEW_LINE>for (String id : ids) {<NEW_LINE>transportHandlerList.add(new RuntimeBeanReference(id));<NEW_LINE>}<NEW_LINE>sockjsBuilder.addPropertyValue("transportHandlers", transportHandlerList);<NEW_LINE>}<NEW_LINE>builder.addPropertyValue("sockJsServiceOptions", sockjsBuilder.getBeanDefinition());<NEW_LINE>}<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "handshake-handler");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "send-buffer-size-limit");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "send-time-limit");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "allowed-origins");<NEW_LINE>}
sockjsBuilder, sockjs, "websocket-enabled", "webSocketEnabled");
1,712,461
private boolean validate(Snapshot snapshot) throws IOException, InvalidSnapshotException {<NEW_LINE>logger.info("Validating snapshot {}", snapshot.getName());<NEW_LINE>String modelStore = configManager.getModelStore();<NEW_LINE>Map<String, Map<String, JsonObject>> models = snapshot.getModels();<NEW_LINE>for (Map.Entry<String, Map<String, JsonObject>> modelMap : models.entrySet()) {<NEW_LINE><MASK><NEW_LINE>for (Map.Entry<String, JsonObject> versionModel : modelMap.getValue().entrySet()) {<NEW_LINE>String versionId = versionModel.getKey();<NEW_LINE>String marName = versionModel.getValue().get(Model.MAR_NAME).getAsString();<NEW_LINE>File marFile = new File(modelStore + "/" + marName);<NEW_LINE>if (!marFile.exists()) {<NEW_LINE>logger.error("Model archive file for model {}, version {} not found in model store", modelName, versionId);<NEW_LINE>throw new InvalidSnapshotException("Model archive file for model :" + modelName + ", version :" + versionId + " not found in model store");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.info("Snapshot {} validated successfully", snapshot.getName());<NEW_LINE>return true;<NEW_LINE>}
String modelName = modelMap.getKey();
569,575
public void init(PinotConfiguration serverConf) throws Exception {<NEW_LINE>// Make a clone so that changes to the config won't propagate to the caller<NEW_LINE>_serverConf = serverConf.clone();<NEW_LINE>_zkAddress = _serverConf.getProperty(CommonConstants.Helix.CONFIG_OF_ZOOKEEPR_SERVER);<NEW_LINE>_helixClusterName = _serverConf.getProperty(CommonConstants.Helix.CONFIG_OF_CLUSTER_NAME);<NEW_LINE>ServiceStartableUtils.applyClusterConfig(_serverConf, _zkAddress, _helixClusterName, ServiceRole.SERVER);<NEW_LINE>setupHelixSystemProperties();<NEW_LINE>_listenerConfigs = ListenerConfigUtil.buildServerAdminConfigs(_serverConf);<NEW_LINE>_hostname = _serverConf.getProperty(Helix.KEY_OF_SERVER_NETTY_HOST, _serverConf.getProperty(Helix.SET_INSTANCE_ID_TO_HOSTNAME_KEY, false) ? NetUtils.getHostnameOrAddress() : NetUtils.getHostAddress());<NEW_LINE>_port = _serverConf.getProperty(<MASK><NEW_LINE>_instanceId = _serverConf.getProperty(Server.CONFIG_OF_INSTANCE_ID);<NEW_LINE>if (_instanceId != null) {<NEW_LINE>// NOTE:<NEW_LINE>// - Force all instances to have the same prefix in order to derive the instance type based on the instance id<NEW_LINE>// - Only log a warning instead of throw exception here for backward-compatibility<NEW_LINE>if (!_instanceId.startsWith(Helix.PREFIX_OF_SERVER_INSTANCE)) {<NEW_LINE>LOGGER.warn("Instance id '{}' does not have prefix '{}'", _instanceId, Helix.PREFIX_OF_SERVER_INSTANCE);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>_instanceId = Helix.PREFIX_OF_SERVER_INSTANCE + _hostname + "_" + _port;<NEW_LINE>// NOTE: Need to add the instance id to the config because it is required in HelixInstanceDataManagerConfig<NEW_LINE>_serverConf.addProperty(Server.CONFIG_OF_INSTANCE_ID, _instanceId);<NEW_LINE>}<NEW_LINE>_instanceConfigScope = new HelixConfigScopeBuilder(ConfigScopeProperty.PARTICIPANT, _helixClusterName).forParticipant(_instanceId).build();<NEW_LINE>// Initialize Pinot Environment Provider<NEW_LINE>_pinotEnvironmentProvider = initializePinotEnvironmentProvider();<NEW_LINE>// Enable/disable thread CPU time measurement through instance config.<NEW_LINE>ThreadTimer.setThreadCpuTimeMeasurementEnabled(_serverConf.getProperty(Server.CONFIG_OF_ENABLE_THREAD_CPU_TIME_MEASUREMENT, Server.DEFAULT_ENABLE_THREAD_CPU_TIME_MEASUREMENT));<NEW_LINE>// Set data table version send to broker.<NEW_LINE>DataTableBuilder.setCurrentDataTableVersion(_serverConf.getProperty(Server.CONFIG_OF_CURRENT_DATA_TABLE_VERSION, Server.DEFAULT_CURRENT_DATA_TABLE_VERSION));<NEW_LINE>LOGGER.info("Initializing Helix manager with zkAddress: {}, clusterName: {}, instanceId: {}", _zkAddress, _helixClusterName, _instanceId);<NEW_LINE>_helixManager = HelixManagerFactory.getZKHelixManager(_helixClusterName, _instanceId, InstanceType.PARTICIPANT, _zkAddress);<NEW_LINE>}
Helix.KEY_OF_SERVER_NETTY_PORT, Helix.DEFAULT_SERVER_NETTY_PORT);
194,651
public void execute(TupleWindow inputWindow) {<NEW_LINE>Map<K, T> <MASK><NEW_LINE>Map<K, Integer> windowCountMap = new HashMap<>();<NEW_LINE>for (Tuple tuple : inputWindow.get()) {<NEW_LINE>R tup = (R) tuple.getValue(0);<NEW_LINE>addMap(reduceMap, windowCountMap, tup);<NEW_LINE>}<NEW_LINE>long startWindow;<NEW_LINE>long endWindow;<NEW_LINE>if (inputWindow.getStartTimestamp() == null) {<NEW_LINE>startWindow = 0;<NEW_LINE>} else {<NEW_LINE>startWindow = inputWindow.getStartTimestamp();<NEW_LINE>}<NEW_LINE>if (inputWindow.getEndTimestamp() == null) {<NEW_LINE>endWindow = 0;<NEW_LINE>} else {<NEW_LINE>endWindow = inputWindow.getEndTimestamp();<NEW_LINE>}<NEW_LINE>for (K key : reduceMap.keySet()) {<NEW_LINE>Window window = new Window(startWindow, endWindow, windowCountMap.get(key));<NEW_LINE>KeyedWindow<K> keyedWindow = new KeyedWindow<>(key, window);<NEW_LINE>collector.emit(new Values(new KeyValue<>(keyedWindow, reduceMap.get(key))));<NEW_LINE>}<NEW_LINE>}
reduceMap = new HashMap<>();
742,640
protected Set<String> selectAnnotatedTargets(String annotationClassName, int scanPolicies, AnnotationCategory category) {<NEW_LINE>// There is a direct line into this call from public APIs (e.g., from getMethodAnnotations).<NEW_LINE>// To this point, no steps have been taken to ensure that scans have been performed,<NEW_LINE>// meaning, no steps have been taken to ensure the intern maps are populated.<NEW_LINE>Set<String> annotatedClasses;<NEW_LINE>if (scanPolicies == 0) {<NEW_LINE>annotatedClasses = Collections.emptySet();<NEW_LINE>} else {<NEW_LINE>if (ScanPolicy.EXTERNAL.accept(scanPolicies)) {<NEW_LINE>ensureExternalResults();<NEW_LINE>} else {<NEW_LINE>ensureInternalResults();<NEW_LINE>}<NEW_LINE>String i_annotationClassName = <MASK><NEW_LINE>if (i_annotationClassName == null) {<NEW_LINE>annotatedClasses = Collections.emptySet();<NEW_LINE>} else {<NEW_LINE>annotatedClasses = uninternClassNames(i_selectAnnotatedTargets(i_annotationClassName, scanPolicies, category));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writeQuery(CLASS_NAME, "selectedAnnotatedTargets", "Discover annotated classes", scanPolicies, asQueryType(category), annotationClassName, annotatedClasses);<NEW_LINE>return annotatedClasses;<NEW_LINE>}
internClassName(annotationClassName, Util_InternMap.DO_NOT_FORCE);
732,125
public TsiFrameProtector createFrameProtector(int maxFrameSize, ByteBufAllocator alloc) {<NEW_LINE>Preconditions.checkState(!isInProgress(), "Handshake is not complete.");<NEW_LINE>byte[] key = handshaker.getKey();<NEW_LINE>Preconditions.checkState(key.length == AltsChannelCrypter.getKeyLength(), "Bad key length.");<NEW_LINE>// Frame size negotiation is not performed if the peer does not send max frame size (e.g. peer<NEW_LINE>// is gRPC Go or peer uses an old binary).<NEW_LINE>int peerMaxFrameSize = handshaker.getResult().getMaxFrameSize();<NEW_LINE>if (peerMaxFrameSize != 0) {<NEW_LINE>maxFrameSize = Math.min(peerMaxFrameSize, AltsTsiFrameProtector.getMaxFrameSize());<NEW_LINE>maxFrameSize = Math.max(<MASK><NEW_LINE>}<NEW_LINE>logger.log(ChannelLogLevel.INFO, "Maximum frame size value is {0}.", maxFrameSize);<NEW_LINE>return new AltsTsiFrameProtector(maxFrameSize, new AltsChannelCrypter(key, isClient), alloc);<NEW_LINE>}
AltsTsiFrameProtector.getMinFrameSize(), maxFrameSize);
814,720
public static DescribeImageFromFamilyResponse unmarshall(DescribeImageFromFamilyResponse describeImageFromFamilyResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeImageFromFamilyResponse.setRequestId(_ctx.stringValue("DescribeImageFromFamilyResponse.RequestId"));<NEW_LINE>Image image = new Image();<NEW_LINE>image.setCreationTime(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.CreationTime"));<NEW_LINE>image.setStatus(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.Status"));<NEW_LINE>image.setImageFamily(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.ImageFamily"));<NEW_LINE>image.setProgress(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.Progress"));<NEW_LINE>image.setIsCopied(_ctx.booleanValue("DescribeImageFromFamilyResponse.Image.IsCopied"));<NEW_LINE>image.setIsSupportIoOptimized(_ctx.booleanValue("DescribeImageFromFamilyResponse.Image.IsSupportIoOptimized"));<NEW_LINE>image.setImageOwnerAlias(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.ImageOwnerAlias"));<NEW_LINE>image.setIsSupportCloudinit(_ctx.booleanValue("DescribeImageFromFamilyResponse.Image.IsSupportCloudinit"));<NEW_LINE>image.setImageVersion(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.ImageVersion"));<NEW_LINE>image.setUsage(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.Usage"));<NEW_LINE>image.setIsSelfShared(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.IsSelfShared"));<NEW_LINE>image.setDescription(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.Description"));<NEW_LINE>image.setSize(_ctx.integerValue("DescribeImageFromFamilyResponse.Image.Size"));<NEW_LINE>image.setPlatform(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.Platform"));<NEW_LINE>image.setImageName(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.ImageName"));<NEW_LINE>image.setOSName(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.OSName"));<NEW_LINE>image.setImageId(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.ImageId"));<NEW_LINE>image.setOSType(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.OSType"));<NEW_LINE>image.setIsSubscribed(_ctx.booleanValue("DescribeImageFromFamilyResponse.Image.IsSubscribed"));<NEW_LINE>image.setProductCode(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.ProductCode"));<NEW_LINE>image.setArchitecture(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.Architecture"));<NEW_LINE>List<DiskDeviceMapping> diskDeviceMappings = new ArrayList<DiskDeviceMapping>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeImageFromFamilyResponse.Image.DiskDeviceMappings.Length"); i++) {<NEW_LINE>DiskDeviceMapping diskDeviceMapping = new DiskDeviceMapping();<NEW_LINE>diskDeviceMapping.setType(_ctx.stringValue<MASK><NEW_LINE>diskDeviceMapping.setImportOSSBucket(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.DiskDeviceMappings[" + i + "].ImportOSSBucket"));<NEW_LINE>diskDeviceMapping.setSnapshotId(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.DiskDeviceMappings[" + i + "].SnapshotId"));<NEW_LINE>diskDeviceMapping.setImportOSSObject(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.DiskDeviceMappings[" + i + "].ImportOSSObject"));<NEW_LINE>diskDeviceMapping.setSize(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.DiskDeviceMappings[" + i + "].Size"));<NEW_LINE>diskDeviceMapping.setDevice(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.DiskDeviceMappings[" + i + "].Device"));<NEW_LINE>diskDeviceMapping.setFormat(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.DiskDeviceMappings[" + i + "].Format"));<NEW_LINE>diskDeviceMappings.add(diskDeviceMapping);<NEW_LINE>}<NEW_LINE>image.setDiskDeviceMappings(diskDeviceMappings);<NEW_LINE>List<Tag> tags = new ArrayList<Tag>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeImageFromFamilyResponse.Image.Tags.Length"); i++) {<NEW_LINE>Tag tag = new Tag();<NEW_LINE>tag.setTagValue(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.Tags[" + i + "].TagValue"));<NEW_LINE>tag.setTagKey(_ctx.stringValue("DescribeImageFromFamilyResponse.Image.Tags[" + i + "].TagKey"));<NEW_LINE>tags.add(tag);<NEW_LINE>}<NEW_LINE>image.setTags(tags);<NEW_LINE>describeImageFromFamilyResponse.setImage(image);<NEW_LINE>return describeImageFromFamilyResponse;<NEW_LINE>}
("DescribeImageFromFamilyResponse.Image.DiskDeviceMappings[" + i + "].Type"));
1,328,757
static public EObject universaltime_to_posixtime(EObject a1) {<NEW_LINE>ETuple2 dt;<NEW_LINE>if ((dt = ETuple2.cast(a1)) != null) {<NEW_LINE>ETuple3 date;<NEW_LINE>ETuple3 time;<NEW_LINE>ESmall year;<NEW_LINE>ESmall month;<NEW_LINE>ESmall day;<NEW_LINE>ESmall hour;<NEW_LINE>ESmall minute;<NEW_LINE>ESmall sec;<NEW_LINE>if ((date = ETuple3.cast(dt.elem1)) != null && (year = date.elem1.testSmall()) != null && (month = date.elem2.testSmall()) != null && (day = date.elem3.testSmall()) != null && (time = ETuple3.cast(dt.elem2)) != null && (hour = time.elem1.testSmall()) != null && (minute = time.elem2.testSmall()) != null && (sec = time.elem3.testSmall()) != null) {<NEW_LINE>Calendar in_date = GregorianCalendar.getInstance(UTC_TIME_ZONE);<NEW_LINE>in_date.set(Calendar.YEAR, year.value);<NEW_LINE>in_date.set(Calendar.MONTH, month.value - 1 + Calendar.JANUARY);<NEW_LINE>in_date.set(Calendar.DAY_OF_MONTH, day.value);<NEW_LINE>in_date.set(Calendar.HOUR_OF_DAY, hour.value);<NEW_LINE>in_date.set(Calendar.MINUTE, minute.value);<NEW_LINE>in_date.set(<MASK><NEW_LINE>return ERT.box(in_date.getTimeInMillis() / 1000L);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw ERT.badarg(a1);<NEW_LINE>}
Calendar.SECOND, sec.value);
1,798,107
public CostEstimate visitPhysicalDistribute(PhysicalDistribute<? extends Plan> distribute, PlanContext context) {<NEW_LINE>StatsDeriveResult childStatistics = context.getChildStatistics(0);<NEW_LINE>DistributionSpec spec = distribute.getDistributionSpec();<NEW_LINE>// shuffle<NEW_LINE>if (spec instanceof DistributionSpecHash) {<NEW_LINE>return new CostEstimate(childStatistics.computeSize(), 0, childStatistics.computeSize());<NEW_LINE>}<NEW_LINE>// replicate<NEW_LINE>if (spec instanceof DistributionSpecReplicated) {<NEW_LINE>int beNumber = ConnectContext.get().getEnv().getClusterInfo().getBackendIds(true).size();<NEW_LINE>int instanceNumber = ConnectContext.get().getSessionVariable().getParallelExecInstanceNum();<NEW_LINE>beNumber = Math.max(1, beNumber);<NEW_LINE>return new CostEstimate(childStatistics.computeSize() * beNumber, childStatistics.computeSize() * beNumber * instanceNumber, childStatistics.computeSize() * beNumber * instanceNumber);<NEW_LINE>}<NEW_LINE>// gather<NEW_LINE>if (spec instanceof DistributionSpecGather) {<NEW_LINE>return new CostEstimate(childStatistics.computeSize(), 0, childStatistics.computeSize());<NEW_LINE>}<NEW_LINE>// any<NEW_LINE>return new CostEstimate(childStatistics.<MASK><NEW_LINE>}
computeSize(), 0, 0);
73,971
protected Collection<Message<?>> completeGroup(Message<?> message, Object correlationKey, MessageGroup group, Lock lock) {<NEW_LINE>Collection<Message<?>> partialSequence = null;<NEW_LINE>Object result;<NEW_LINE>try {<NEW_LINE>this.logger.debug(() -> "Completing group with correlationKey [" + correlationKey + "]");<NEW_LINE>result = <MASK><NEW_LINE>if (result instanceof Collection<?>) {<NEW_LINE>verifyResultCollectionConsistsOfMessages((Collection<?>) result);<NEW_LINE>partialSequence = (Collection<Message<?>>) result;<NEW_LINE>}<NEW_LINE>if (this.popSequence && partialSequence == null) {<NEW_LINE>AbstractIntegrationMessageBuilder<?> messageBuilder = null;<NEW_LINE>if (result instanceof AbstractIntegrationMessageBuilder<?>) {<NEW_LINE>messageBuilder = (AbstractIntegrationMessageBuilder<?>) result;<NEW_LINE>} else if (!(result instanceof Message<?>)) {<NEW_LINE>messageBuilder = getMessageBuilderFactory().withPayload(result).copyHeaders(message.getHeaders());<NEW_LINE>} else if (compareSequences((Message<?>) result, message)) {<NEW_LINE>messageBuilder = getMessageBuilderFactory().fromMessage((Message<?>) result);<NEW_LINE>}<NEW_LINE>result = messageBuilder != null ? messageBuilder.popSequenceDetails() : result;<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (this.releaseLockBeforeSend) {<NEW_LINE>lock.unlock();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sendOutputs(result, message);<NEW_LINE>return partialSequence;<NEW_LINE>}
this.outputProcessor.processMessageGroup(group);
761,686
static Request indicesExist(org.elasticsearch.action.admin.indices.get.GetIndexRequest getIndexRequest) {<NEW_LINE>// this can be called with no indices as argument by transport client, not via REST though<NEW_LINE>if (getIndexRequest.indices() == null || getIndexRequest.indices().length == 0) {<NEW_LINE>throw new IllegalArgumentException("indices are mandatory");<NEW_LINE>}<NEW_LINE>String endpoint = RequestConverters.endpoint(getIndexRequest.indices(), "");<NEW_LINE>Request request = new Request(HttpHead.METHOD_NAME, endpoint);<NEW_LINE>RequestConverters.Params params <MASK><NEW_LINE>params.withLocal(getIndexRequest.local());<NEW_LINE>params.withHuman(getIndexRequest.humanReadable());<NEW_LINE>params.withIndicesOptions(getIndexRequest.indicesOptions());<NEW_LINE>params.withIncludeDefaults(getIndexRequest.includeDefaults());<NEW_LINE>params.putParam(INCLUDE_TYPE_NAME_PARAMETER, Boolean.TRUE.toString());<NEW_LINE>return request;<NEW_LINE>}
= new RequestConverters.Params(request);
1,443,592
public int add(int i, double dist, int j) {<NEW_LINE>if (parent == null) {<NEW_LINE>assert mergecount == 0;<NEW_LINE>parent = MathUtil.sequence(0, (ids.size() << 1) - 1);<NEW_LINE>}<NEW_LINE>// next<NEW_LINE>int t = mergecount + ids.size();<NEW_LINE>// Follow i to its parent.<NEW_LINE>for (int p = parent[i]; i != p; ) {<NEW_LINE>final int tmp = parent[p];<NEW_LINE>parent[i] = t;<NEW_LINE>i = p;<NEW_LINE>p = tmp;<NEW_LINE>}<NEW_LINE>// Follow j to its parent.<NEW_LINE>for (int p = parent[j]; j != p; ) {<NEW_LINE><MASK><NEW_LINE>parent[j] = t;<NEW_LINE>j = p;<NEW_LINE>p = tmp;<NEW_LINE>}<NEW_LINE>int t2 = parent[i] = parent[j] = strictAdd(i, dist, j);<NEW_LINE>assert t == t2;<NEW_LINE>return t2;<NEW_LINE>}
final int tmp = parent[p];
1,068,292
public void handleEvent(Event ev) {<NEW_LINE>if (ev.widget == comp) {<NEW_LINE>int[] weights = sash.getWeights();<NEW_LINE>int current_weight = <MASK><NEW_LINE>if (comp_weight != current_weight) {<NEW_LINE>COConfigurationManager.setParameter(config_key, weights[0] + "," + weights[1]);<NEW_LINE>// sash has moved<NEW_LINE>comp_weight = current_weight;<NEW_LINE>// keep track of the width<NEW_LINE>comp_width = comp.getBounds().width;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// resize<NEW_LINE>if (comp_width > 0) {<NEW_LINE>int width = sash.getClientArea().width;<NEW_LINE>if (width < 20) {<NEW_LINE>width = 20;<NEW_LINE>}<NEW_LINE>double ratio = (double) comp_width / width;<NEW_LINE>comp_weight = (int) (ratio * 1000);<NEW_LINE>if (comp_weight < 20) {<NEW_LINE>comp_weight = 20;<NEW_LINE>} else if (comp_weight > 980) {<NEW_LINE>comp_weight = 980;<NEW_LINE>}<NEW_LINE>if (is_lhs) {<NEW_LINE>sash.setWeights(new int[] { comp_weight, 1000 - comp_weight });<NEW_LINE>} else {<NEW_LINE>sash.setWeights(new int[] { 1000 - comp_weight, comp_weight });<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
weights[is_lhs ? 0 : 1];
821,990
private Map<String, Object> retrieveAsnGeoData(InetAddress ipAddress) {<NEW_LINE>SpecialPermission.check();<NEW_LINE>AsnResponse response = AccessController.doPrivileged((PrivilegedAction<AsnResponse>) () -> cache.putIfAbsent(ipAddress, AsnResponse.class, ip -> {<NEW_LINE>try {<NEW_LINE>return lazyLoader.get().asn(ip);<NEW_LINE>} catch (AddressNotFoundException e) {<NEW_LINE>throw new AddressNotFoundRuntimeException(e);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>Integer asn = response.getAutonomousSystemNumber();<NEW_LINE>String organization_name = response.getAutonomousSystemOrganization();<NEW_LINE>Map<String, Object> geoData = new HashMap<>();<NEW_LINE>for (Property property : this.properties) {<NEW_LINE>switch(property) {<NEW_LINE>case IP:<NEW_LINE>geoData.put("ip", NetworkAddress.format(ipAddress));<NEW_LINE>break;<NEW_LINE>case ASN:<NEW_LINE>if (asn != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case ORGANIZATION_NAME:<NEW_LINE>if (organization_name != null) {<NEW_LINE>geoData.put("organization_name", organization_name);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return geoData;<NEW_LINE>}
geoData.put("asn", asn);
179,637
public FileActionEntity copy(CopyPathBody body, String path) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// verify the required parameter 'path' is set<NEW_LINE>if (path == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'path' when calling copy");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/file_actions/copy/{path}".replaceAll("\\{" + "path" + "\\}", apiClient.escapeString(path.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>GenericType<FileActionEntity> localVarReturnType = new GenericType<FileActionEntity>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>}
throw new ApiException(400, "Missing the required parameter 'body' when calling copy");
520,473
public void actionPerformed(ActionEvent e) {<NEW_LINE>final ImportZIP panel = new ImportZIP();<NEW_LINE>final JButton ok = new JButton(LBL_import());<NEW_LINE>NotifyDescriptor d = new NotifyDescriptor(panel, TITLE_import(), NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.PLAIN_MESSAGE, new Object[] { ok, NotifyDescriptor.CANCEL_OPTION }, null);<NEW_LINE>final <MASK><NEW_LINE>panel.addPropertyChangeListener(new PropertyChangeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void propertyChange(PropertyChangeEvent evt) {<NEW_LINE>ok.setEnabled(panel.check(notifications));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (DialogDisplayer.getDefault().notify(d) == ok) {<NEW_LINE>final File zip = new File(panel.zipField.getText());<NEW_LINE>final File root = new File(panel.folderField.getText());<NEW_LINE>ProjectChooser.setProjectsFolder(root);<NEW_LINE>RP.post(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>unpackAndOpen(zip, FileUtil.normalizeFile(root));<NEW_LINE>} catch (IOException x) {<NEW_LINE>LOG.log(Level.INFO, null, x);<NEW_LINE>NotifyDescriptor nd = new NotifyDescriptor.Message(ERR_Unzip(x.getLocalizedMessage()), NotifyDescriptor.ERROR_MESSAGE);<NEW_LINE>DialogDisplayer.getDefault().notifyLater(nd);<NEW_LINE>} catch (IllegalArgumentException x) {<NEW_LINE>// #230135<NEW_LINE>LOG.log(Level.INFO, null, x);<NEW_LINE>NotifyDescriptor nd = new NotifyDescriptor.Message(ERR_Unzip(x.getLocalizedMessage()), NotifyDescriptor.ERROR_MESSAGE);<NEW_LINE>DialogDisplayer.getDefault().notifyLater(nd);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
NotificationLineSupport notifications = d.createNotificationLineSupport();
1,443,329
public static LinkedBuffer writeAscii(final CharSequence str, final WriteSession session, LinkedBuffer lb) {<NEW_LINE>final int len = str.length();<NEW_LINE>if (len == 0)<NEW_LINE>return lb;<NEW_LINE>byte[] buffer = lb.buffer;<NEW_LINE>int offset = lb.offset, limit = lb.buffer.length;<NEW_LINE>// actual size<NEW_LINE>session.size += len;<NEW_LINE>if (offset + len > limit) {<NEW_LINE>// slow path<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>if (offset == limit) {<NEW_LINE>// we are done with this LinkedBuffer<NEW_LINE>lb.offset = offset;<NEW_LINE>// reset<NEW_LINE>offset = 0;<NEW_LINE>limit = session.nextBufferSize;<NEW_LINE>buffer = new byte[limit];<NEW_LINE>// grow<NEW_LINE>lb = new LinkedBuffer(buffer, 0, lb);<NEW_LINE>}<NEW_LINE>buffer[offset++] = (byte) str.charAt(i);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// fast path<NEW_LINE>for (int i = 0; i < len; i++) buffer[offset++] = (<MASK><NEW_LINE>}<NEW_LINE>lb.offset = offset;<NEW_LINE>return lb;<NEW_LINE>}
byte) str.charAt(i);
1,247,478
public void onAuthenticationSuccess(final HttpServletRequest request, final HttpServletResponse response, final Authentication authentication) throws ServletException, IOException {<NEW_LINE>final SavedRequest savedRequest = requestCache.getRequest(request, response);<NEW_LINE>if (savedRequest == null) {<NEW_LINE>super.onAuthenticationSuccess(request, response, authentication);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String targetUrlParameter = getTargetUrlParameter();<NEW_LINE>if (isAlwaysUseDefaultTargetUrl() || (targetUrlParameter != null && StringUtils.hasText(request.getParameter(targetUrlParameter)))) {<NEW_LINE><MASK><NEW_LINE>super.onAuthenticationSuccess(request, response, authentication);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>clearAuthenticationAttributes(request);<NEW_LINE>// Use the DefaultSavedRequest URL<NEW_LINE>// final String targetUrl = savedRequest.getRedirectUrl();<NEW_LINE>// logger.debug("Redirecting to DefaultSavedRequest Url: " + targetUrl);<NEW_LINE>// getRedirectStrategy().sendRedirect(request, response, targetUrl);<NEW_LINE>}
requestCache.removeRequest(request, response);
543,472
private boolean generatePng(File pngsDir, UploadedPresentation pres, int page, File pageFile) throws InterruptedException {<NEW_LINE>String source = pageFile.getAbsolutePath();<NEW_LINE>String dest;<NEW_LINE>if (SupportedFileTypes.isImageFile(pres.getFileType())) {<NEW_LINE>// Need to create a PDF as intermediate step.<NEW_LINE>// Convert single image file<NEW_LINE>dest = pngsDir.getAbsolutePath() + File.separator + "slide-1.pdf";<NEW_LINE>NuProcessBuilder convertImgToSvg = new NuProcessBuilder(Arrays.asList("timeout", convTimeout, "convert", source, "-auto-orient", dest));<NEW_LINE>Png2SvgConversionHandler pHandler = new Png2SvgConversionHandler();<NEW_LINE>convertImgToSvg.setProcessListener(pHandler);<NEW_LINE>NuProcess process = convertImgToSvg.start();<NEW_LINE>try {<NEW_LINE>process.waitFor(WAIT_FOR_SEC, TimeUnit.SECONDS);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>log.error("InterruptedException while converting to PDF {}", dest, e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Use the intermediate PDF file as source<NEW_LINE>source = dest;<NEW_LINE>}<NEW_LINE>String COMMAND = "";<NEW_LINE>// the "-x.png" is appended automagically<NEW_LINE>dest = pngsDir.getAbsolutePath() + File.separator + TEMP_PNG_NAME + "-" + page;<NEW_LINE>COMMAND = "pdftocairo -png -scale-to " + slideWidth + " " + source + " " + dest;<NEW_LINE>// System.out.println("********* CREATING PNGs " + COMMAND);<NEW_LINE>boolean done = new ExternalProcessExecutor().exec(COMMAND, 10000);<NEW_LINE>if (done) {<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>Map<String, Object> logData = new HashMap<String, Object>();<NEW_LINE>logData.put("meetingId", pres.getMeetingId());<NEW_LINE>logData.put("presId", pres.getId());<NEW_LINE>logData.put("filename", pres.getName());<NEW_LINE>logData.put("logCode", "png_create_failed");<NEW_LINE>logData.put("message", "Failed to create png.");<NEW_LINE>Gson gson = new Gson();<NEW_LINE>String logStr = gson.toJson(logData);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
log.warn(" --analytics-- data={}", logStr);
443,237
private Pair<MysqlSemiIndexNLJoin, MysqlTableScan> transformToIndexNLJoin(LogicalSemiJoin logicalSemiJoin) {<NEW_LINE>RelNode inner = logicalSemiJoin.getRight();<NEW_LINE>if (inner instanceof HepRelVertex) {<NEW_LINE>inner = ((HepRelVertex) inner).getCurrentRel();<NEW_LINE>}<NEW_LINE>CheckMysqlIndexNLJoinRelVisitor checkMysqlIndexNLJoinRelVisitor = new CheckMysqlIndexNLJoinRelVisitor();<NEW_LINE>inner.accept(checkMysqlIndexNLJoinRelVisitor);<NEW_LINE>boolean isSupportUseIndexNLJoin = checkMysqlIndexNLJoinRelVisitor.isSupportUseIndexNLJoin();<NEW_LINE>if (isSupportUseIndexNLJoin) {<NEW_LINE>MysqlSemiIndexNLJoin mysqlSemiIndexNLJoin = MysqlSemiIndexNLJoin.create(logicalSemiJoin.getTraitSet(), logicalSemiJoin.getLeft(), logicalSemiJoin.getRight(), logicalSemiJoin.getCondition(), logicalSemiJoin.getVariablesSet(), logicalSemiJoin.getJoinType(), logicalSemiJoin.isSemiJoinDone(), ImmutableList.copyOf(logicalSemiJoin.getSystemFieldList()<MASK><NEW_LINE>MysqlTableScan mysqlTableScan = checkMysqlIndexNLJoinRelVisitor.getMysqlTableScan();<NEW_LINE>if (mysqlTableScan != null) {<NEW_LINE>mysqlTableScan.setJoin(mysqlSemiIndexNLJoin);<NEW_LINE>mysqlSemiIndexNLJoin.setMysqlTableScan(mysqlTableScan);<NEW_LINE>return Pair.of(mysqlSemiIndexNLJoin, mysqlTableScan);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
), logicalSemiJoin.getHints());
1,460,702
public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {<NEW_LINE>LOG.trace("Executing {}", RpcMethod.PRIV_DELETE_PRIVACY_GROUP.getMethodName());<NEW_LINE>final String privacyGroupId = requestContext.getRequiredParameter(0, String.class);<NEW_LINE>final String response;<NEW_LINE>try {<NEW_LINE>response = privacyController.deletePrivacyGroup(privacyGroupId, privacyIdProvider.getPrivacyUserId<MASK><NEW_LINE>} catch (final MultiTenancyValidationException e) {<NEW_LINE>LOG.error("Unauthorized privacy multi-tenancy rpc request. {}", e.getMessage());<NEW_LINE>return new JsonRpcErrorResponse(requestContext.getRequest().getId(), DELETE_PRIVACY_GROUP_ERROR);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Failed to delete privacy group", e);<NEW_LINE>return new JsonRpcErrorResponse(requestContext.getRequest().getId(), DELETE_PRIVACY_GROUP_ERROR);<NEW_LINE>}<NEW_LINE>return new JsonRpcSuccessResponse(requestContext.getRequest().getId(), response);<NEW_LINE>}
(requestContext.getUser()));
59,239
public StringBuffer format(Object number, StringBuffer toAppendTo, FieldPosition pos) {<NEW_LINE>if (number instanceof Long) {<NEW_LINE>return format(((Long) number).longValue(), toAppendTo, pos);<NEW_LINE>} else if (number instanceof BigInteger) {<NEW_LINE>return format((BigInteger) number, toAppendTo, pos);<NEW_LINE>} else if (number instanceof java.math.BigDecimal) {<NEW_LINE>return format((java.math.BigDecimal) number, toAppendTo, pos);<NEW_LINE>} else if (number instanceof android.icu.math.BigDecimal) {<NEW_LINE>return format((android.icu.math.BigDecimal) number, toAppendTo, pos);<NEW_LINE>} else if (number instanceof CurrencyAmount) {<NEW_LINE>return format((<MASK><NEW_LINE>} else if (number instanceof Number) {<NEW_LINE>return format(((Number) number).doubleValue(), toAppendTo, pos);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Cannot format given Object as a Number");<NEW_LINE>}<NEW_LINE>}
CurrencyAmount) number, toAppendTo, pos);
453,370
private void shareCsvFile() {<NEW_LINE>final ScaleUser selectedScaleUser = OpenScale.getInstance().getSelectedScaleUser();<NEW_LINE>File shareFile = new File(getApplicationContext().getCacheDir(), getExportFilename(selectedScaleUser));<NEW_LINE>if (!OpenScale.getInstance().exportData(Uri.fromFile(shareFile))) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Intent intent = new Intent(Intent.ACTION_SEND);<NEW_LINE><MASK><NEW_LINE>intent.setType("text/csv");<NEW_LINE>final Uri uri = FileProvider.getUriForFile(getApplicationContext(), BuildConfig.APPLICATION_ID + ".fileprovider", shareFile);<NEW_LINE>intent.putExtra(Intent.EXTRA_STREAM, uri);<NEW_LINE>intent.putExtra(Intent.EXTRA_SUBJECT, getResources().getString(R.string.label_share_subject, selectedScaleUser.getUserName()));<NEW_LINE>startActivity(Intent.createChooser(intent, getResources().getString(R.string.label_share)));<NEW_LINE>}
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
544,400
public static boolean isApplicationEnabled(String appName, String target) {<NEW_LINE>String prefix = (String) GuiUtil.getSessionValue("REST_URL");<NEW_LINE>List<String> clusters = TargetUtil.getClusters();<NEW_LINE>List<String> standalone = TargetUtil.getStandaloneInstances();<NEW_LINE>List<String> dgs = TargetUtil.getDeploymentGroups();<NEW_LINE>standalone.add("server");<NEW_LINE>Map<MASK><NEW_LINE>String endpoint = "";<NEW_LINE>if (clusters.contains(target)) {<NEW_LINE>endpoint = prefix + "/clusters/cluster/" + target + "/application-ref/" + appName;<NEW_LINE>attrs = RestUtil.getAttributesMap(prefix + endpoint);<NEW_LINE>} else if (dgs.contains(target)) {<NEW_LINE>endpoint = prefix + "/deployment-groups/deployment-group/" + target + "/application-ref/" + appName;<NEW_LINE>attrs = RestUtil.getAttributesMap(endpoint);<NEW_LINE>} else {<NEW_LINE>endpoint = prefix + "/servers/server/" + target + "/application-ref/" + appName;<NEW_LINE>attrs = RestUtil.getAttributesMap(endpoint);<NEW_LINE>}<NEW_LINE>return Boolean.parseBoolean((String) attrs.get("enabled"));<NEW_LINE>}
<String, Object> attrs = null;
70,654
private BigInteger calculateU(BigInteger clientPublic, BigInteger serverPublic, BigInteger modulus) {<NEW_LINE>byte[] paddedClientPublic = calculatePadding(modulus, clientPublic);<NEW_LINE>LOGGER.debug("ClientPublic Key:" + ArrayConverter.bytesToHexString(ArrayConverter.bigIntegerToByteArray(clientPublic)));<NEW_LINE>LOGGER.debug("PaddedClientPublic. " + ArrayConverter.bytesToHexString(paddedClientPublic));<NEW_LINE>byte[] <MASK><NEW_LINE>LOGGER.debug("ServerPublic Key:" + ArrayConverter.bytesToHexString(ArrayConverter.bigIntegerToByteArray(serverPublic)));<NEW_LINE>LOGGER.debug("PaddedServerPublic. " + ArrayConverter.bytesToHexString(paddedServerPublic));<NEW_LINE>byte[] hashInput = ArrayConverter.concatenate(paddedClientPublic, paddedServerPublic);<NEW_LINE>LOGGER.debug("HashInput for u: " + ArrayConverter.bytesToHexString(hashInput));<NEW_LINE>byte[] hashOutput = shaSum(hashInput);<NEW_LINE>LOGGER.debug("HashValue for u: " + ArrayConverter.bytesToHexString(hashOutput));<NEW_LINE>return new BigInteger(1, hashOutput);<NEW_LINE>}
paddedServerPublic = calculatePadding(modulus, serverPublic);
1,762,617
public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@name('s0') select * from pattern[s0=SupportBean_S0 -> SupportBean(intPrimitive+5=s0.id and theString='a')]";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>env.sendEventBean(new SupportBean_S0(10));<NEW_LINE>if (hasFilterIndexPlanAdvanced(env)) {<NEW_LINE>env.assertStatement("s0", statement -> {<NEW_LINE>FilterItem[] params = getFilterSvcMultiAssertNonEmpty(statement);<NEW_LINE>assertEquals(EQUAL, params[0].getOp());<NEW_LINE>assertEquals(EQUAL, params[1].getOp());<NEW_LINE>});<NEW_LINE>}<NEW_LINE>env.milestone(0);<NEW_LINE>sendSBAssert(env, "a", 10, false);<NEW_LINE>sendSBAssert(<MASK><NEW_LINE>sendSBAssert(env, "a", 5, true);<NEW_LINE>env.undeployAll();<NEW_LINE>}
env, "b", 5, false);
48,111
public void handle(MongoRequest request, MongoResponse response) throws Exception {<NEW_LINE>var content = request.getContent();<NEW_LINE>if (content == null) {<NEW_LINE>return;<NEW_LINE>} else if (content.isArray() && request.isPost()) {<NEW_LINE>// POST collection with array of documents<NEW_LINE>JsonArray passwords = JsonPath.read(BsonUtils.toJson(content), "$.[*].".concat(this.propNamePassword));<NEW_LINE>int[] iarr = { 0 };<NEW_LINE>passwords.forEach(plain -> {<NEW_LINE>if (plain != null && plain.isJsonPrimitive() && plain.getAsJsonPrimitive().isString()) {<NEW_LINE>var hashed = BCrypt.hashpw(plain.getAsJsonPrimitive().getAsString(), BCrypt.gensalt(complexity));<NEW_LINE>content.asArray().get(iarr[0]).asDocument().put(this.<MASK><NEW_LINE>}<NEW_LINE>iarr[0]++;<NEW_LINE>});<NEW_LINE>} else if (content.isDocument()) {<NEW_LINE>// PUT/PATCH document or bulk PATCH<NEW_LINE>JsonElement plain;<NEW_LINE>try {<NEW_LINE>plain = JsonPath.read(BsonUtils.toJson(content), "$.".concat(this.propNamePassword));<NEW_LINE>if (plain != null && plain.isJsonPrimitive() && plain.getAsJsonPrimitive().isString()) {<NEW_LINE>String hashed = BCrypt.hashpw(plain.getAsJsonPrimitive().getAsString(), BCrypt.gensalt(complexity));<NEW_LINE>content.asDocument().put(this.propNamePassword, new BsonString(hashed));<NEW_LINE>}<NEW_LINE>} catch (PathNotFoundException pnfe) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
propNamePassword, new BsonString(hashed));
1,745,496
private StaticLayout createLayoutWithNumberOfLine(int lastLineStart, int width) {<NEW_LINE>if (mSpanned == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>SpannableStringBuilder temp = (SpannableStringBuilder) mSpanned.subSequence(0, text.length());<NEW_LINE>String ellipsizeStr = (String) TextUtils.ellipsize(text.substring(lastLineStart), sTextPaintInstance, width, TextUtils.TruncateAt.END);<NEW_LINE>String newString = text.subSequence(0, lastLineStart).toString() + truncate(ellipsizeStr, sTextPaintInstance, width, mTruncateAt);<NEW_LINE>int start = Math.max(newString.length() - 1, 0);<NEW_LINE>CharacterStyle[] hippyStyleSpans = temp.getSpans(start, text.length(), CharacterStyle.class);<NEW_LINE>if (hippyStyleSpans != null && hippyStyleSpans.length > 0) {<NEW_LINE>for (CharacterStyle hippyStyleSpan : hippyStyleSpans) {<NEW_LINE>if (temp.getSpanStart(hippyStyleSpan) >= start) {<NEW_LINE>temp.removeSpan(hippyStyleSpan);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return buildStaticLayout(temp.replace(start, text.length(), ELLIPSIS), sTextPaintInstance, width);<NEW_LINE>}
String text = mSpanned.toString();
1,393,007
public ModelConfVO save(ModelConfVO confVO) {<NEW_LINE>ModelConfPO conf = new ModelConfPO();<NEW_LINE>BeanUtils.copyProperties(confVO, conf);<NEW_LINE>if (conf.getId() == null) {<NEW_LINE>conf.setCreateTime(new Date());<NEW_LINE>conf<MASK><NEW_LINE>modelConfMapper.insert(conf);<NEW_LINE>confVO.setId(conf.getId());<NEW_LINE>ModelConfParamPO paramPO = new ModelConfParamPO();<NEW_LINE>paramPO.setFeed(confVO.getConfParam().getFeed());<NEW_LINE>paramPO.setExpressions(confVO.getConfParam().getExpressions());<NEW_LINE>paramPO.setMoldId(conf.getId());<NEW_LINE>modelConfParamMapper.insert(paramPO);<NEW_LINE>confVO.getConfParam().setId(paramPO.getId());<NEW_LINE>} else {<NEW_LINE>modelConfMapper.updateByPrimaryKeySelective(conf);<NEW_LINE>}<NEW_LINE>return confVO;<NEW_LINE>}
.setUpdateDate(new Date());
507,886
private void emitQueryTimeEvent(ServiceMetricEvent event) {<NEW_LINE>Context opentelemetryContext = propagator.extract(Context.current(), event, DRUID_CONTEXT_TEXT_MAP_GETTER);<NEW_LINE>try (Scope scope = opentelemetryContext.makeCurrent()) {<NEW_LINE>DateTime endTime = event.getCreatedTime();<NEW_LINE>DateTime startTime = endTime.minusMillis(event.getValue().intValue());<NEW_LINE>Span span = tracer.spanBuilder(event.getService()).setStartTimestamp(startTime.getMillis(), <MASK><NEW_LINE>getContext(event).entrySet().stream().filter(entry -> entry.getValue() != null).filter(entry -> !TRACEPARENT_PROPAGATION_FIELDS.contains(entry.getKey())).forEach(entry -> span.setAttribute(entry.getKey(), entry.getValue().toString()));<NEW_LINE>Object status = event.getUserDims().get("success");<NEW_LINE>if (status == null) {<NEW_LINE>span.setStatus(StatusCode.UNSET);<NEW_LINE>} else if (status.toString().equals("true")) {<NEW_LINE>span.setStatus(StatusCode.OK);<NEW_LINE>} else {<NEW_LINE>span.setStatus(StatusCode.ERROR);<NEW_LINE>}<NEW_LINE>span.end(endTime.getMillis(), TimeUnit.MILLISECONDS);<NEW_LINE>}<NEW_LINE>}
TimeUnit.MILLISECONDS).startSpan();
1,517,207
private void remove() {<NEW_LINE>preview.removeAll();<NEW_LINE>preview.revalidate();<NEW_LINE>preview.repaint();<NEW_LINE>int dpi = DPIS[this.dpi.getSelectedIndex()];<NEW_LINE>int[] dpis = multi.getDpi();<NEW_LINE>com.codename1.ui.EncodedImage[] imgs = multi.getInternalImages();<NEW_LINE>for (int iter = 0; iter < dpis.length; iter++) {<NEW_LINE>if (dpis[iter] == dpi) {<NEW_LINE>com.codename1.ui.EncodedImage[] newImages = new com.codename1.ui.<MASK><NEW_LINE>int[] newDpis = new int[dpis.length - 1];<NEW_LINE>int originalOffset = 0;<NEW_LINE>for (int x = 0; x < newImages.length; x++) {<NEW_LINE>if (originalOffset == iter) {<NEW_LINE>originalOffset++;<NEW_LINE>}<NEW_LINE>newImages[x] = imgs[originalOffset];<NEW_LINE>newDpis[x] = dpis[originalOffset];<NEW_LINE>originalOffset++;<NEW_LINE>}<NEW_LINE>multi = new EditableResources.MultiImage();<NEW_LINE>multi.setDpi(newDpis);<NEW_LINE>multi.setInternalImages(newImages);<NEW_LINE>res.setMultiImage(name, multi);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
EncodedImage[imgs.length - 1];
1,560,985
public JsonOutOfStockResponse handleOutOfStockRequest(@NonNull final String warehouseIdentifier, @NonNull final JsonOutOfStockNoticeRequest outOfStockInfoRequest) {<NEW_LINE>if (!Boolean.TRUE.equals(outOfStockInfoRequest.getClosePendingShipmentSchedules()) && !Boolean.TRUE.equals(outOfStockInfoRequest.getCreateInventory())) {<NEW_LINE>Loggables.addLog("WarehouseService.handleOutOfStockRequest: JsonOutOfStockNoticeRequest: closePendingShipmentSchedules and createInventory are both false! No action is performed!");<NEW_LINE>return JsonOutOfStockResponse.builder().affectedWarehouses(ImmutableList.of()).build();<NEW_LINE>}<NEW_LINE>final OrgId orgId = RestUtils.retrieveOrgIdOrDefault(outOfStockInfoRequest.getOrgCode());<NEW_LINE>Loggables.addLog("WarehouseService.handleOutOfStockRequest: JsonOutOfStockNoticeRequest: orgCode resolved to AD_Org_ID {}!"<MASK><NEW_LINE>final ExternalIdentifier productIdentifier = ExternalIdentifier.of(outOfStockInfoRequest.getProductIdentifier());<NEW_LINE>final ProductId productId = productRestService.resolveProductExternalIdentifier(productIdentifier, orgId).orElseThrow(() -> MissingResourceException.builder().resourceIdentifier(productIdentifier.getRawValue()).resourceName("M_Product").build());<NEW_LINE>Loggables.addLog("WarehouseService.handleOutOfStockRequest: JsonOutOfStockNoticeRequest: productIdentifier resolved to M_Product_ID {}!", ProductId.toRepoId(productId));<NEW_LINE>final AttributeSetInstanceId attributeSetInstanceId = jsonAttributeService.computeAttributeSetInstanceFromJson(outOfStockInfoRequest.getAttributeSetInstance()).orElse(null);<NEW_LINE>Loggables.addLog("WarehouseService.handleOutOfStockRequest: JsonOutOfStockNoticeRequest: attributeSetInstance emerged to asiId: {}!", AttributeSetInstanceId.toRepoId(attributeSetInstanceId));<NEW_LINE>final Optional<WarehouseId> targetWarehouseId = ALL.equals(warehouseIdentifier) ? Optional.empty() : Optional.of(getWarehouseByIdentifier(orgId, warehouseIdentifier));<NEW_LINE>final Map<WarehouseId, String> warehouseId2InventoryDocNo = outOfStockInfoRequest.getCreateInventory() ? emptyWarehouse(productId, attributeSetInstanceId, targetWarehouseId.orElse(null)) : ImmutableMap.of();<NEW_LINE>final Map<WarehouseId, List<ShipmentScheduleId>> warehouseId2ClosedShipmentSchedules = outOfStockInfoRequest.getClosePendingShipmentSchedules() ? handleCloseShipmentSchedulesRequest(targetWarehouseId, productId, attributeSetInstanceId) : ImmutableMap.of();<NEW_LINE>return buildOutOfStockNoticeResponse(warehouseId2InventoryDocNo, warehouseId2ClosedShipmentSchedules);<NEW_LINE>}
, OrgId.toRepoIdOrAny(orgId));
1,256,084
private void addAnd(StringBuilder sb, Expression and, Collection<Variable> variables, int results) throws ExpressionException {<NEW_LINE>HashSet<String> <MASK><NEW_LINE>HashSet<String> nv = new HashSet<>();<NEW_LINE>if (and instanceof Operation.And) {<NEW_LINE>Operation.And a = (Operation.And) and;<NEW_LINE>for (Expression va : a.getExpressions()) {<NEW_LINE>Expression var = va;<NEW_LINE>HashSet<String> map = v;<NEW_LINE>if (var instanceof Not) {<NEW_LINE>map = nv;<NEW_LINE>var = ((Not) var).getExpression();<NEW_LINE>}<NEW_LINE>if (var instanceof Variable)<NEW_LINE>map.add(((Variable) var).getIdentifier());<NEW_LINE>else<NEW_LINE>throw new ExpressionException("invalid expression");<NEW_LINE>}<NEW_LINE>} else<NEW_LINE>throw new ExpressionException("invalid expression");<NEW_LINE>for (Variable var : variables) {<NEW_LINE>if (v.contains(var.getIdentifier()))<NEW_LINE>sb.append("1,");<NEW_LINE>else if (nv.contains(var.getIdentifier()))<NEW_LINE>sb.append("0,");<NEW_LINE>else<NEW_LINE>sb.append("X,");<NEW_LINE>}<NEW_LINE>for (int i = 0; i < results; i++) {<NEW_LINE>if (i == number)<NEW_LINE>sb.append(",1");<NEW_LINE>else<NEW_LINE>sb.append(",0");<NEW_LINE>}<NEW_LINE>sb.append('\n');<NEW_LINE>}
v = new HashSet<>();
1,695,109
public Object calculate(Context ctx) {<NEW_LINE>IParam param = this.param;<NEW_LINE>if (param == null) {<NEW_LINE><MASK><NEW_LINE>throw new RQException("concat" + mm.getMessage("function.missingParam"));<NEW_LINE>}<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>if (param.isLeaf()) {<NEW_LINE>Object obj = param.getLeafExpression().calculate(ctx);<NEW_LINE>concat(obj, sb);<NEW_LINE>} else {<NEW_LINE>for (int i = 0, size = param.getSubSize(); i < size; ++i) {<NEW_LINE>IParam sub = param.getSub(i);<NEW_LINE>if (sub == null || !sub.isLeaf()) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("concat" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>Object obj = sub.getLeafExpression().calculate(ctx);<NEW_LINE>concat(obj, sb);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}
MessageManager mm = EngineMessage.get();
1,770,757
private Mono<Response<SqlServerInstanceInner>> updateWithResponseAsync(String resourceGroupName, String sqlServerInstanceName, SqlServerInstanceUpdate parameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == 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>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (sqlServerInstanceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter sqlServerInstanceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, sqlServerInstanceName, this.client.getApiVersion(), parameters, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
907,132
private void readSecureResource(String tagName, AbstractAdapterConfigurationDefinition resource, XMLExtendedStreamReader reader, List<ModelNode> resourcesToAdd) throws XMLStreamException {<NEW_LINE>String name = readNameAttribute(reader);<NEW_LINE>ModelNode addSecureDeployment = new ModelNode();<NEW_LINE>addSecureDeployment.get(ModelDescriptionConstants.OP).set(ModelDescriptionConstants.ADD);<NEW_LINE>PathAddress addr = PathAddress.pathAddress(PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, KeycloakExtension.SUBSYSTEM_NAME), PathElement.pathElement(tagName, name));<NEW_LINE>addSecureDeployment.get(ModelDescriptionConstants.OP_ADDR).set(addr.toModelNode());<NEW_LINE>List<ModelNode> credentialsToAdd = new ArrayList<ModelNode>();<NEW_LINE>List<ModelNode> redirectRulesToAdd = new ArrayList<ModelNode>();<NEW_LINE>while (reader.hasNext() && nextTag(reader) != END_ELEMENT) {<NEW_LINE>String localName = reader.getLocalName();<NEW_LINE>if (localName.equals(CredentialDefinition.TAG_NAME)) {<NEW_LINE><MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (localName.equals(RedirecRewritetRuleDefinition.TAG_NAME)) {<NEW_LINE>readRewriteRule(reader, addr, redirectRulesToAdd);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>SimpleAttributeDefinition def = resource.lookup(localName);<NEW_LINE>if (def == null)<NEW_LINE>throw new XMLStreamException("Unknown secure-deployment tag " + localName);<NEW_LINE>def.parseAndSetParameter(reader.getElementText(), addSecureDeployment, reader);<NEW_LINE>}<NEW_LINE>// Must add credentials after the deployment is added.<NEW_LINE>resourcesToAdd.add(addSecureDeployment);<NEW_LINE>resourcesToAdd.addAll(credentialsToAdd);<NEW_LINE>resourcesToAdd.addAll(redirectRulesToAdd);<NEW_LINE>}
readCredential(reader, addr, credentialsToAdd);
812,471
private void connect(MessageContext messageContext) throws IOException {<NEW_LINE>String outboundChainName = m_channel.getOutboundChainName();<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(this, tc, "<connect>", "outboundChainName = " + outboundChainName);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ChannelFramework cf = ChannelFrameworkFactory.getChannelFramework();<NEW_LINE>VirtualConnectionFactory factory = cf.getOutboundVCFactory(outboundChainName);<NEW_LINE>VirtualConnection vc;<NEW_LINE>synchronized (SipUdpConnLink.class) {<NEW_LINE>s_connectingInstance = this;<NEW_LINE>vc = factory.createConnection();<NEW_LINE>// now s_connectingInstance is back to null<NEW_LINE>}<NEW_LINE>setVirtualConnection(vc);<NEW_LINE>if (!(vc instanceof OutboundVirtualConnection)) {<NEW_LINE>throw new IllegalStateException("Not an OutboundVirtualConnection");<NEW_LINE>}<NEW_LINE>setConnectionProperties(vc);<NEW_LINE>OutboundVirtualConnection outboundConnection = (OutboundVirtualConnection) vc;<NEW_LINE>String localHostname = null;<NEW_LINE>int localPort = 0;<NEW_LINE>// use the selected interface for the outbound connection<NEW_LINE>if (messageContext != null && messageContext.getSipConnection() != null) {<NEW_LINE>localHostname = // can't use the real port because we're already listening on it<NEW_LINE>messageContext.getSipConnection().getSIPListenningConnection().getListeningPoint().getHost();<NEW_LINE>}<NEW_LINE>UDPRequestContext connectRequestContext = UDPRequestContextFactory.getRef().createUDPRequestContext(localHostname, localPort);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(<MASK><NEW_LINE>}<NEW_LINE>outboundConnection.connectAsynch(connectRequestContext, this);<NEW_LINE>} catch (ChannelException e) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(this, tc, "connect", "ChannelException", e);<NEW_LINE>}<NEW_LINE>throw new IOException(e.getMessage());<NEW_LINE>} catch (ChainException e) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(this, tc, "connect", "ChainException", e);<NEW_LINE>}<NEW_LINE>throw new IOException(e.getMessage());<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(this, tc, "connect", "Exception", e);<NEW_LINE>}<NEW_LINE>throw new IOException(e.getMessage());<NEW_LINE>}<NEW_LINE>}
this, tc, "<connect>", "connectAsynch...");
241,242
public static ImageResult toJpeg(@NonNull ImageProxy image, boolean flip) throws IOException {<NEW_LINE>ImageProxy.PlaneProxy[] planes = image.getPlanes();<NEW_LINE>ByteBuffer buffer = planes[0].getBuffer();<NEW_LINE>Rect cropRect = shouldCropImage(image) ? image.getCropRect() : null;<NEW_LINE>byte[] data = new byte[buffer.capacity()];<NEW_LINE>int rotation = image.getImageInfo().getRotationDegrees();<NEW_LINE>buffer.get(data);<NEW_LINE>try {<NEW_LINE>Pair<Integer, Integer> dimens = BitmapUtil.getDimensions(new ByteArrayInputStream(data));<NEW_LINE>if (dimens.first != image.getWidth() && dimens.second != image.getHeight()) {<NEW_LINE>Log.w(TAG, String.format(Locale.ENGLISH, "Decoded image dimensions differed from stated dimensions! Stated: %d x %d, Decoded: %d x %d", image.getWidth(), image.getHeight(), dimens.first, dimens.second));<NEW_LINE>Log.w(TAG, "Ignoring the stated rotation and rotating the crop rect 90 degrees (stated rotation is " + rotation + " degrees).");<NEW_LINE>rotation = 0;<NEW_LINE>if (cropRect != null) {<NEW_LINE>cropRect = new Rect(cropRect.top, cropRect.left, cropRect.bottom, cropRect.right);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (BitmapDecodingException e) {<NEW_LINE>Log.w(TAG, "Failed to decode!", e);<NEW_LINE>}<NEW_LINE>if (cropRect != null || rotation != 0 || flip) {<NEW_LINE>data = transformByteArray(data, cropRect, rotation, flip);<NEW_LINE>}<NEW_LINE>int width = cropRect != null ? (cropRect.right - cropRect.left) : image.getWidth();<NEW_LINE>int height = cropRect != null ? (cropRect.bottom - cropRect.<MASK><NEW_LINE>if (rotation == 90 || rotation == 270) {<NEW_LINE>int swap = width;<NEW_LINE>width = height;<NEW_LINE>height = swap;<NEW_LINE>}<NEW_LINE>return new ImageResult(data, width, height);<NEW_LINE>}
top) : image.getHeight();
1,105,709
protected void exportLine(JRPrintLine line) throws IOException {<NEW_LINE>int x = line.getX() + getOffsetX();<NEW_LINE>int y = line<MASK><NEW_LINE>int height = line.getHeight();<NEW_LINE>int width = line.getWidth();<NEW_LINE>if (width <= 1 || height <= 1) {<NEW_LINE>if (width > 1) {<NEW_LINE>height = 0;<NEW_LINE>} else {<NEW_LINE>width = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>contentWriter.write("{\\shp\\shpbxpage\\shpbypage\\shpwr5\\shpfhdr0\\shpz");<NEW_LINE>contentWriter.write(String.valueOf(zorder++));<NEW_LINE>contentWriter.write("\\shpleft");<NEW_LINE>contentWriter.write(String.valueOf(LengthUtil.twip(x)));<NEW_LINE>contentWriter.write("\\shpright");<NEW_LINE>contentWriter.write(String.valueOf(LengthUtil.twip(x + width)));<NEW_LINE>contentWriter.write("\\shptop");<NEW_LINE>contentWriter.write(String.valueOf(LengthUtil.twip(y)));<NEW_LINE>contentWriter.write("\\shpbottom");<NEW_LINE>contentWriter.write(String.valueOf(LengthUtil.twip(y + height)));<NEW_LINE>contentWriter.write("{\\shpinst");<NEW_LINE>contentWriter.write("{\\sp{\\sn shapeType}{\\sv 20}}");<NEW_LINE>exportPen(line.getLinePen());<NEW_LINE>if (line.getDirectionValue() == LineDirectionEnum.TOP_DOWN) {<NEW_LINE>contentWriter.write("{\\sp{\\sn fFlipV}{\\sv 0}}");<NEW_LINE>} else {<NEW_LINE>contentWriter.write("{\\sp{\\sn fFlipV}{\\sv 1}}");<NEW_LINE>}<NEW_LINE>contentWriter.write("}}\n");<NEW_LINE>}
.getY() + getOffsetY();
700,833
void intervalElapsed(final Plotter p) {<NEW_LINE>tab.getRequestProcessor().post(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>Number n = (Number) mbean.getCachedMBeanServerConnection().getAttribute(mbean.getObjectName(), attributeName);<NEW_LINE>long v;<NEW_LINE>if (n instanceof Float || n instanceof Double) {<NEW_LINE>p.setDecimals(PLOTTER_DECIMALS);<NEW_LINE>double d = (n instanceof Float) ? (Float) n : (Double) n;<NEW_LINE>v = Math.round(d * Math.pow(10.0, PLOTTER_DECIMALS));<NEW_LINE>} else {<NEW_LINE>v = n.longValue();<NEW_LINE>}<NEW_LINE>p.addValues(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>// NOI18N<NEW_LINE>LOGGER.// NOI18N<NEW_LINE>throwing(// NOI18N<NEW_LINE>XPlottingViewer.class.getName(), // NOI18N<NEW_LINE>"intervalElapsed", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
System.currentTimeMillis(), v);
683,859
private void addToOpenWithList(SystemApplicationKey app, FileExtensionKey ext, Properties props) throws NativeException {<NEW_LINE>String name = ext.getDotName();<NEW_LINE>String extKey = ext.getKey();<NEW_LINE>String appName = app.getKey();<NEW_LINE>if (app.isAddOpenWithList()) {<NEW_LINE>if (!isEmpty(name) && !isEmpty(extKey) && !isEmpty(appName)) {<NEW_LINE>if (!registry.keyExists(clSection, clKey + name + SEP + OPEN_WITH_LIST_KEY_NAME, appName)) {<NEW_LINE>registry.createKey(clSection, clKey + <MASK><NEW_LINE>setExtProperty(props, name, EXT_HKCR_OPENWITHLIST_PROPERTY, CREATED);<NEW_LINE>}<NEW_LINE>addCurrentUserOpenWithList(name, extKey, appName, props);<NEW_LINE>if (!registry.keyExists(clSection, clKey + name + SEP + OPEN_WITH_PROGIDS_KEY_NAME)) {<NEW_LINE>registry.createKey(clSection, clKey + name + SEP + OPEN_WITH_PROGIDS_KEY_NAME);<NEW_LINE>setExtProperty(props, name, EXT_HKCR_OPENWITHPROGIDS_PROPERTY, CREATED);<NEW_LINE>}<NEW_LINE>registry.setNoneValue(clSection, clKey + name + SEP + OPEN_WITH_PROGIDS_KEY_NAME, extKey);<NEW_LINE>addCurrentUserOpenWithProgids(name, extKey, appName, props);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
name + SEP + OPEN_WITH_LIST_KEY_NAME, appName);
1,241,777
public boolean removeMember(long commitIndex, CPMemberInfo leavingMember) {<NEW_LINE>checkNotNull(leavingMember);<NEW_LINE>checkMetadataGroupInitSuccessful();<NEW_LINE>if (!activeMembers.contains(leavingMember)) {<NEW_LINE>logger.fine("Not removing " + leavingMember + " since it is not an active CP member");<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (membershipChangeSchedule != null) {<NEW_LINE>if (leavingMember.equals(membershipChangeSchedule.getLeavingMember())) {<NEW_LINE>membershipChangeSchedule = membershipChangeSchedule.addRetriedCommitIndex(commitIndex);<NEW_LINE>if (logger.isFineEnabled()) {<NEW_LINE>logger.fine(leavingMember + " is already marked as leaving.");<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (logger.isFineEnabled()) {<NEW_LINE>logger.fine(msg);<NEW_LINE>}<NEW_LINE>throw new CannotRemoveCPMemberException(msg);<NEW_LINE>}<NEW_LINE>if (activeMembers.size() == 2) {<NEW_LINE>// There are two CP members.<NEW_LINE>// If this operation is committed, it means both CP members have appended this operation.<NEW_LINE>// I am returning a retry response, so that leavingMember will retry and commit this operation again.<NEW_LINE>// Commit of its retry will ensure that both CP members' activeMember.size() == 1,<NEW_LINE>// so that they will complete their shutdown in RaftService.ensureCPMemberRemoved()<NEW_LINE>logger.warning(leavingMember + " is directly removed as there are only " + activeMembers.size() + " CP members.");<NEW_LINE>removeActiveMember(commitIndex, leavingMember);<NEW_LINE>throw new RetryableHazelcastException();<NEW_LINE>} else if (activeMembers.size() == 1) {<NEW_LINE>// This is the last CP member. It is not removed from the active CP members list<NEW_LINE>// so that it will complete its shutdown in RaftService.ensureCPMemberRemoved()<NEW_LINE>logger.fine("Not removing the last active CP member: " + leavingMember + " to help it complete its shutdown");<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return initMembershipChangeScheduleForLeavingMember(commitIndex, leavingMember);<NEW_LINE>}
String msg = "There is already an ongoing CP membership change process. " + "Cannot process remove request of " + leavingMember;
1,713,001
final UpdateClusterKafkaVersionResult executeUpdateClusterKafkaVersion(UpdateClusterKafkaVersionRequest updateClusterKafkaVersionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateClusterKafkaVersionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateClusterKafkaVersionRequest> request = null;<NEW_LINE>Response<UpdateClusterKafkaVersionResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new UpdateClusterKafkaVersionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateClusterKafkaVersionRequest));<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, "Kafka");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateClusterKafkaVersion");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateClusterKafkaVersionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateClusterKafkaVersionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
267,823
private void doTargetsForFullyQualifiedExtensionFile(VirtualFile sourceVirtualFile, Project project, String prefixToAutocomplete, CompletionResultSet result) {<NEW_LINE>Matcher matcher = TARGET_TO_EXTENSION_FILE_PATTERN.matcher(prefixToAutocomplete);<NEW_LINE>if (!matcher.matches()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String cellName = matcher.group("cell");<NEW_LINE>String cellPath = matcher.group("path");<NEW_LINE>String extPath = matcher.group("extpath");<NEW_LINE>BuckTargetLocator buckTargetLocator = BuckTargetLocator.getInstance(project);<NEW_LINE>VirtualFile targetDirectory = BuckTargetPattern.parse(cellName + "//" + cellPath + "/" + extPath).flatMap(p -> buckTargetLocator.resolve(sourceVirtualFile, p)).flatMap(buckTargetLocator::findVirtualFileForTargetPattern).orElse(null);<NEW_LINE>if (targetDirectory == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String partialPrefix;<NEW_LINE>if ("".equals(cellName)) {<NEW_LINE>partialPrefix = cellPath + ":" + extPath;<NEW_LINE>} else {<NEW_LINE>partialPrefix = cellName + "//" + cellPath + ":" + extPath;<NEW_LINE>}<NEW_LINE>String <MASK><NEW_LINE>for (VirtualFile child : targetDirectory.getChildren()) {<NEW_LINE>String name = child.getName();<NEW_LINE>if (!child.isDirectory() && name.startsWith(partial) && name.endsWith(".bzl")) {<NEW_LINE>addResultForFile(result, child, partialPrefix + name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
partial = matcher.group("partial");
214,678
public Map<String, Object> execute(Map<String, Object> context) {<NEW_LINE>final Map<String, Object> result = new HashMap<>();<NEW_LINE>final List<Action> children = getChildren();<NEW_LINE>final Map<String, Object> compositeContext = getCompositeContext(context);<NEW_LINE>for (Action child : children) {<NEW_LINE>ActionHandler childHandler = moduleHandlerMap.get(child);<NEW_LINE>Map<String, Object> childContext = Collections.unmodifiableMap(getChildContext(child, compositeContext));<NEW_LINE>Map<String, Object> childResults = childHandler == null ? null : childHandler.execute(childContext);<NEW_LINE>if (childResults != null) {<NEW_LINE>for (Entry<String, Object> childResult : childResults.entrySet()) {<NEW_LINE>String childOuputName = child.getId() + "." + childResult.getKey();<NEW_LINE>Output output = compositeOutputs.get(childOuputName);<NEW_LINE>if (output != null) {<NEW_LINE>String childOuputRef = output.getReference();<NEW_LINE>if (childOuputRef != null && childOuputRef.length() > childOuputName.length()) {<NEW_LINE>childOuputRef = childOuputRef.substring(childOuputName.length());<NEW_LINE>result.put(output.getName(), ReferenceResolver.resolveComplexDataReference(childResult<MASK><NEW_LINE>} else {<NEW_LINE>result.put(output.getName(), childResult.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return !result.isEmpty() ? result : null;<NEW_LINE>}
.getValue(), childOuputRef));
1,181,209
public static IMouseStateChange exitNode(final CStateFactory<?, ?> m_factory, final MouseEvent event, final HitInfo hitInfo, final IMouseState state) {<NEW_LINE>if (hitInfo.hasHitNodeLabels()) {<NEW_LINE>throw new IllegalStateException();<NEW_LINE>} else if (hitInfo.hasHitEdges()) {<NEW_LINE>return CHitEdgesTransformer.<MASK><NEW_LINE>} else if (hitInfo.hasHitEdgeLabels()) {<NEW_LINE>return CHitEdgeLabelsTransformer.enterEdgeLabel(m_factory, event, hitInfo);<NEW_LINE>} else if (hitInfo.hasHitBends()) {<NEW_LINE>return CHitBendsTransformer.enterBend(m_factory, event, hitInfo);<NEW_LINE>} else if (hitInfo.hasHitPorts()) {<NEW_LINE>return new CStateChange(state, true);<NEW_LINE>} else {<NEW_LINE>// TODO @Nils please check if this change does not break BinDiff behavior<NEW_LINE>// It fixes case 4207.<NEW_LINE>// return new CStateChange(m_factory.createDefaultState(), true);<NEW_LINE>return new CStateChange(m_factory.createDefaultState(), false);<NEW_LINE>}<NEW_LINE>}
enterEdge(m_factory, event, hitInfo);
1,017,783
public void changePropertyByName(String name, Object value) {<NEW_LINE>if (name == null)<NEW_LINE>return;<NEW_LINE>name = name.intern();<NEW_LINE>if ("dtdName".equals(name))<NEW_LINE>setDtdName((String) value);<NEW_LINE>else if ("namespace".equals(name))<NEW_LINE>setNamespace((String) value);<NEW_LINE>else if ("beanName".equals(name))<NEW_LINE>setBeanName((String) value);<NEW_LINE>else if ("beanClass".equals(name))<NEW_LINE>setBeanClass((String) value);<NEW_LINE>else if ("wrapperClass".equals(name))<NEW_LINE>setWrapperClass((String) value);<NEW_LINE>else if ("defaultValue".equals(name))<NEW_LINE>addDefaultValue((String) value);<NEW_LINE>else if ("defaultValue[]".equals(name))<NEW_LINE>setDefaultValue((String[]) value);<NEW_LINE>else if ("knownValue".equals(name))<NEW_LINE>addKnownValue((String) value);<NEW_LINE>else if ("knownValue[]".equals(name))<NEW_LINE>setKnownValue((String[]) value);<NEW_LINE>else if ("metaProperty".equals(name))<NEW_LINE>addMetaProperty((MetaProperty) value);<NEW_LINE>else if ("metaProperty[]".equals(name))<NEW_LINE>setMetaProperty((MetaProperty[]) value);<NEW_LINE>else if ("comparatorClass".equals(name))<NEW_LINE>addComparatorClass((String) value);<NEW_LINE>else if ("comparatorClass[]".equals(name))<NEW_LINE>setComparatorClass((String[]) value);<NEW_LINE>else if ("implements".equals(name))<NEW_LINE>setImplements((String) value);<NEW_LINE>else if ("extends".equals(name))<NEW_LINE>setExtends((String) value);<NEW_LINE>else if ("import".equals(name))<NEW_LINE>addImport((String) value);<NEW_LINE>else if ("import[]".equals(name))<NEW_LINE>setImport((String[]) value);<NEW_LINE>else if ("userCode".equals(name))<NEW_LINE>setUserCode((String) value);<NEW_LINE>else if ("vetoable".equals(name))<NEW_LINE>setVetoable(((java.lang.Boolean) value).booleanValue());<NEW_LINE>else if ("skipGeneration".equals(name))<NEW_LINE>setSkipGeneration(((java.lang.Boolean) value).booleanValue());<NEW_LINE>else if ("delegatorName".equals(name))<NEW_LINE>setDelegatorName((String) value);<NEW_LINE>else if ("delegatorExtends".equals(name))<NEW_LINE>setDelegatorExtends((String) value);<NEW_LINE>else if ("beanInterfaceExtends".equals(name))<NEW_LINE>setBeanInterfaceExtends((String) value);<NEW_LINE>else if ("canBeEmpty".equals(name))<NEW_LINE>setCanBeEmpty(((java.lang.Boolean<MASK><NEW_LINE>else<NEW_LINE>throw new IllegalArgumentException(name + " is not a valid property name for MetaElement");<NEW_LINE>}
) value).booleanValue());
1,349,270
public static FileObject resolveFileObjectForClass(FileObject referenceFileObject, final String className) throws IOException {<NEW_LINE>final FileObject[] result = new FileObject[1];<NEW_LINE>JavaSource javaSource = JavaSource.forFileObject(referenceFileObject);<NEW_LINE>if (javaSource == null) {<NEW_LINE>// Should not happen, at least some debug logging, see i.e. issue #202495.<NEW_LINE>Logger.getLogger(_RetoucheUtil.class.getName()).log(Level.SEVERE, "JavaSource not created for FileObject: path={0}, valid={1}, mime-type={2}", new Object[] { referenceFileObject.getPath(), referenceFileObject.isValid(), referenceFileObject.getMIMEType() });<NEW_LINE>}<NEW_LINE>javaSource.runUserActionTask(new Task<CompilationController>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(CompilationController controller) throws IOException {<NEW_LINE>controller.<MASK><NEW_LINE>TypeElement typeElement = controller.getElements().getTypeElement(className);<NEW_LINE>if (typeElement != null) {<NEW_LINE>result[0] = org.netbeans.api.java.source.SourceUtils.getFile(ElementHandle.create(typeElement), controller.getClasspathInfo());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, true);<NEW_LINE>return result[0];<NEW_LINE>}
toPhase(JavaSource.Phase.ELEMENTS_RESOLVED);
728,873
public boolean initOnce() {<NEW_LINE>try {<NEW_LINE>for (Method m : Initiator.load("com.tencent.mobileqq.activity.VisitorsActivity").getDeclaredMethods()) {<NEW_LINE>if (m.getName().equals("onClick")) {<NEW_LINE>XposedBridge.hookMethod(m, new XC_MethodHook() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void beforeHookedMethod(MethodHookParam param) throws Throwable {<NEW_LINE>if (LicenseStatus.sDisableCommonHooks) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!isEnabled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>View view = (View) param.args[0];<NEW_LINE>Object tag = view.getTag();<NEW_LINE>Object likeClickListener = getFirstByType(param.thisObject, Initiator._VoteHelper());<NEW_LINE>Method onClick = likeClickListener.getClass().getDeclaredMethod("a", tag.<MASK><NEW_LINE>for (int i = 0; i < 20; i++) {<NEW_LINE>onClick.invoke(likeClickListener, tag, (ImageView) view);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} catch (Throwable e) {<NEW_LINE>log(e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
getClass(), ImageView.class);
183,484
public void marshall(CreateCustomDataIdentifierRequest createCustomDataIdentifierRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createCustomDataIdentifierRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createCustomDataIdentifierRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createCustomDataIdentifierRequest.getIgnoreWords(), IGNOREWORDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createCustomDataIdentifierRequest.getKeywords(), KEYWORDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createCustomDataIdentifierRequest.getMaximumMatchDistance(), MAXIMUMMATCHDISTANCE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createCustomDataIdentifierRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createCustomDataIdentifierRequest.getRegex(), REGEX_BINDING);<NEW_LINE>protocolMarshaller.marshall(createCustomDataIdentifierRequest.getSeverityLevels(), SEVERITYLEVELS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createCustomDataIdentifierRequest.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
createCustomDataIdentifierRequest.getClientToken(), CLIENTTOKEN_BINDING);
1,360,325
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>ShepherdLogManager.setRequestIp(request.getRemoteAddr(), request.getHeader("X-Forwarded-For"));<NEW_LINE>try {<NEW_LINE>Auth auth = new Auth();<NEW_LINE>Saml2Settings settings = auth.getSettings();<NEW_LINE>settings.setSPValidationOnly(true);<NEW_LINE><MASK><NEW_LINE>List<String> errors = Saml2Settings.validateMetadata(metadata);<NEW_LINE>PrintWriter out = response.getWriter();<NEW_LINE>if (errors.isEmpty()) {<NEW_LINE>response.setContentType("application/xml; charset=UTF-8");<NEW_LINE>out.println(metadata);<NEW_LINE>} else {<NEW_LINE>response.setContentType("text/html; charset=UTF-8");<NEW_LINE>for (String error : errors) {<NEW_LINE>out.println("<p>" + error + "</p>");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Caught exception when initializing SSO: " + e.toString());<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}
String metadata = settings.getSPMetadata();
1,645,589
private void paintInstanceEvolution(InstancePainter painter) {<NEW_LINE>// draw boundary, label<NEW_LINE>painter.drawLabel();<NEW_LINE>final var xpos = painter.getLocation().getX();<NEW_LINE>final var ypos = painter.getLocation().getY();<NEW_LINE>final var wid = painter.getAttributeValue(StdAttr.WIDTH).getWidth();<NEW_LINE>final var lenObj = painter.getAttributeValue(ATTR_LENGTH);<NEW_LINE>final var len = lenObj == null ? 8 : lenObj;<NEW_LINE>final var <MASK><NEW_LINE>final var negEdge = painter.getAttributeValue(StdAttr.EDGE_TRIGGER).equals(StdAttr.TRIG_FALLING);<NEW_LINE>drawControl(painter, xpos, ypos, len, wid, parallelObj, negEdge);<NEW_LINE>final var data = (ShiftRegisterData) painter.getData();<NEW_LINE>// In the case data is null we assume that the different value are null. This allow the user to<NEW_LINE>// instantiate the shift register without simulation mode<NEW_LINE>if (data == null) {<NEW_LINE>for (var stage = 0; stage < len; stage++) {<NEW_LINE>drawDataBlock(painter, xpos, ypos, len, wid, stage, null, parallelObj);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (var stage = 0; stage < len; stage++) drawDataBlock(painter, xpos, ypos, len, wid, stage, data.get(len - stage - 1), parallelObj);<NEW_LINE>}<NEW_LINE>}
parallelObj = painter.getAttributeValue(ATTR_LOAD);