idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
504,264
public void close(int requestNumber) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(this, tc, "close", requestNumber);<NEW_LINE>// Deregister any error callback created for this connection.<NEW_LINE>if (asynchReader != null) {<NEW_LINE>try {<NEW_LINE>mainConsumer.getConsumerSession().<MASK><NEW_LINE>} catch (SIException e) {<NEW_LINE>// No FFDC code needed<NEW_LINE>// Only FFDC if we haven't received a meTerminated event.<NEW_LINE>if (!((ConversationState) getConversation().getAttachment()).hasMETerminated()) {<NEW_LINE>FFDCFilter.processException(e, CLASS_NAME + ".close", CommsConstants.CATSESSSYNCHCONSUMER_CLOSE_01, this);<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())<NEW_LINE>SibTr.exception(this, tc, e);<NEW_LINE>}<NEW_LINE>if (asynchReader.isCurrentlyDoingReceiveWithWait())<NEW_LINE>asynchReader.sendNoMessageToClient();<NEW_LINE>}<NEW_LINE>super.close(requestNumber);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(this, tc, "close");<NEW_LINE>}
getConnection().removeConnectionListener(asynchReader);
838,553
private FilterConfig processFilterConfig(DeploymentDescriptor webDD, Filter filter) {<NEW_LINE>String filterName = filter.getFilterName();<NEW_LINE>Map<String, ConfigItem<FilterConfig>> <MASK><NEW_LINE>ConfigItem<FilterConfig> existedFilter = filterMap.get(filterName);<NEW_LINE>FilterConfig filterConfig = null;<NEW_LINE>if (existedFilter == null) {<NEW_LINE>String id = webDD.getIdForComponent(filter);<NEW_LINE>if (id == null) {<NEW_LINE>id = "FilterGeneratedId" + configurator.generateUniqueId();<NEW_LINE>}<NEW_LINE>filterConfig = webAppConfiguration.createFilterConfig(id, filterName);<NEW_LINE>configureTargetConfig(filterConfig, filter.getFilterClass(), "Filter", filter);<NEW_LINE>webAppConfiguration.addFilterInfo(filterConfig);<NEW_LINE>filterMap.put(filterName, createConfigItem(filterConfig));<NEW_LINE>} else {<NEW_LINE>filterConfig = existedFilter.getValue();<NEW_LINE>}<NEW_LINE>configureInitParams(filterConfig, filter.getInitParams(), "filter");<NEW_LINE>if (filter.isSetAsyncSupported()) {<NEW_LINE>configureAsyncSupported(filterConfig, filter.isAsyncSupported(), "filter");<NEW_LINE>}<NEW_LINE>return filterConfig;<NEW_LINE>}
filterMap = configurator.getConfigItemMap("filter");
592,679
private void createKafkaConsumer(String bootstrapServers) {<NEW_LINE>Properties properties = new Properties();<NEW_LINE>properties.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);<NEW_LINE>properties.put(ConsumerConfig.GROUP_ID_CONFIG, context.getConfig().getSortTaskId());<NEW_LINE>properties.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, ByteArrayDeserializer.class.getName());<NEW_LINE>properties.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, ByteArrayDeserializer.class.getName());<NEW_LINE>properties.put(ConsumerConfig.RECEIVE_BUFFER_CONFIG, context.getConfig().getKafkaSocketRecvBufferSize());<NEW_LINE>properties.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, false);<NEW_LINE>ConsumeStrategy offsetResetStrategy = context.getConfig().getOffsetResetStrategy();<NEW_LINE>if (offsetResetStrategy == ConsumeStrategy.lastest || offsetResetStrategy == ConsumeStrategy.lastest_absolutely) {<NEW_LINE>properties.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "latest");<NEW_LINE>} else if (offsetResetStrategy == ConsumeStrategy.earliest || offsetResetStrategy == ConsumeStrategy.earliest_absolutely) {<NEW_LINE>properties.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");<NEW_LINE>} else {<NEW_LINE>properties.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "none");<NEW_LINE>}<NEW_LINE>properties.put(ConsumerConfig.FETCH_MAX_BYTES_CONFIG, context.getConfig().getKafkaFetchSizeBytes());<NEW_LINE>properties.put(ConsumerConfig.FETCH_MAX_WAIT_MS_CONFIG, context.getConfig().getKafkaFetchWaitMs());<NEW_LINE>properties.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, false);<NEW_LINE>properties.put(ConsumerConfig.PARTITION_ASSIGNMENT_STRATEGY_CONFIG, RangeAssignor.class.getName());<NEW_LINE>properties.put(ConsumerConfig.CONNECTIONS_MAX_IDLE_MS_CONFIG, 120000L);<NEW_LINE>this.bootstrapServers = bootstrapServers;<NEW_LINE>logger.info("start to create kafka consumer:{}", properties);<NEW_LINE>this.consumer = new KafkaConsumer<>(properties);<NEW_LINE><MASK><NEW_LINE>}
logger.info("end to create kafka consumer:{}", consumer);
1,806,880
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>binding = DataBindingUtil.setContentView(this, R.layout.activity_main);<NEW_LINE>setSupportActionBar(binding.toolbar);<NEW_LINE>binding.startIntro.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>Intent intent = new Intent(MainActivity.this, MainIntroActivity.class);<NEW_LINE>intent.putExtra(MainIntroActivity.EXTRA_FULLSCREEN, binding.optionFullscreen.isChecked());<NEW_LINE>intent.putExtra(MainIntroActivity.EXTRA_SCROLLABLE, binding.optionScrollable.isChecked());<NEW_LINE>intent.putExtra(MainIntroActivity.EXTRA_CUSTOM_FRAGMENTS, binding.optionCustomFragments.isChecked());<NEW_LINE>intent.putExtra(MainIntroActivity.EXTRA_PERMISSIONS, <MASK><NEW_LINE>intent.putExtra(MainIntroActivity.EXTRA_SKIP_ENABLED, binding.optionSkipEnabled.isChecked());<NEW_LINE>intent.putExtra(MainIntroActivity.EXTRA_SHOW_BACK, binding.optionShowBack.isChecked());<NEW_LINE>intent.putExtra(MainIntroActivity.EXTRA_SHOW_NEXT, binding.optionShowNext.isChecked());<NEW_LINE>intent.putExtra(MainIntroActivity.EXTRA_FINISH_ENABLED, binding.optionFinishEnabled.isChecked());<NEW_LINE>intent.putExtra(MainIntroActivity.EXTRA_GET_STARTED_ENABLED, binding.optionGetStartedEnabled.isChecked());<NEW_LINE>startActivity(intent);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>binding.startCanteen.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>Intent intent = new Intent(MainActivity.this, CanteenIntroActivity.class);<NEW_LINE>startActivity(intent);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>binding.startSplash.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>Intent intent = new Intent(MainActivity.this, SplashActivity.class);<NEW_LINE>startActivity(intent);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
binding.optionPermissions.isChecked());
1,455,603
public static void main(String[] args) throws IOException {<NEW_LINE>Config clientConfig = new Config();<NEW_LINE>clientConfig.configurationHeader = CONFIG_HEADER;<NEW_LINE>clientConfig.customConfigurationDefaultsProvider = DEFAULTS;<NEW_LINE>clientConfig.configurationFile = CONFIG_FILE;<NEW_LINE>ClientInitializer.init(args, clientConfig);<NEW_LINE>if (clientConfig.helpRequested) {<NEW_LINE>Catalog catalog = new Catalog();<NEW_LINE>System.out.println("Available tests:");<NEW_LINE>ClientInitializer.print(" ", ConnectorConfig.MAX_WIDTH, catalog.getAllTestNames(), System.out);<NEW_LINE>System.exit(0);<NEW_LINE>}<NEW_LINE>verbose = clientConfig.verbose;<NEW_LINE>if (clientConfig.tcp) {<NEW_LINE>clientConfig.ping = false;<NEW_LINE>} else if (clientConfig.secure && clientConfig.configuration.get(CoapConfig.RESPONSE_MATCHING) == MatcherMode.PRINCIPAL_IDENTITY) {<NEW_LINE>clientConfig.ping = true;<NEW_LINE>}<NEW_LINE>if (clientConfig.ping) {<NEW_LINE>System.out.println("===============\nCC31\n---------------");<NEW_LINE>try {<NEW_LINE>if (ping(clientConfig.uri)) {<NEW_LINE>System.out.println(<MASK><NEW_LINE>} else {<NEW_LINE>System.out.println("FAIL:" + clientConfig.uri + " does not respond to ping, exiting...");<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>System.err.println("Error: " + clientConfig.uri + " - " + ex.getMessage());<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// create the factory with the given server URI<NEW_LINE>PlugtestChecker clientFactory = new PlugtestChecker(clientConfig.uri);<NEW_LINE>// instantiate the chosen tests<NEW_LINE>clientFactory.instantiateTests(clientConfig.tests);<NEW_LINE>System.exit(0);<NEW_LINE>}
"PASS: " + clientConfig.uri + " responds to ping");
821,570
private void loadCacertsAndCustomCerts() {<NEW_LINE>try {<NEW_LINE>KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());<NEW_LINE>InputStream keystoreStream = NzbHydra.class.getResource("/cacerts").openStream();<NEW_LINE>keystore.load(keystoreStream, null);<NEW_LINE>final File certificatesFolder = new File(NzbHydra.getDataFolder(), "certificates");<NEW_LINE>if (certificatesFolder.exists()) {<NEW_LINE>final File[] files = certificatesFolder.listFiles();<NEW_LINE>logger.info("Loading {} custom certificates", files.length);<NEW_LINE>for (File file : files) {<NEW_LINE>try (FileInputStream fileInputStream = new FileInputStream(file)) {<NEW_LINE>final Certificate certificate = CertificateFactory.getInstance("X.509").generateCertificate(fileInputStream);<NEW_LINE>logger.debug("Loading certificate in file {}", file);<NEW_LINE>keystore.setCertificateEntry(file.getName(), certificate);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TrustManagerFactory customTrustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());<NEW_LINE>customTrustManagerFactory.init(keystore);<NEW_LINE>TrustManager[] trustManagers = customTrustManagerFactory.getTrustManagers();<NEW_LINE>caCertsContext = SSLContext.getInstance("SSL");<NEW_LINE>caCertsContext.init(null, trustManagers, null);<NEW_LINE>SSLContext.setDefault(caCertsContext);<NEW_LINE>SSLSocketFactory sslSocketFactory = caCertsContext.getSocketFactory();<NEW_LINE>defaultTrustManager = (X509TrustManager) trustManagers[0];<NEW_LINE>defaultSslSocketFactory = new SniWhitelistingSocketFactory(sslSocketFactory);<NEW_LINE>} catch (IOException | GeneralSecurityException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
logger.error("Unable to load packaged cacerts file", e);
1,822,953
final DescribeWorkteamResult executeDescribeWorkteam(DescribeWorkteamRequest describeWorkteamRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeWorkteamRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeWorkteamRequest> request = null;<NEW_LINE>Response<DescribeWorkteamResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeWorkteamRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeWorkteamRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeWorkteam");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeWorkteamResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeWorkteamResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "SageMaker");
243,609
public QueryStringNames unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>QueryStringNames queryStringNames = new QueryStringNames();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE><MASK><NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return queryStringNames;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("Quantity", targetDepth)) {<NEW_LINE>queryStringNames.setQuantity(IntegerStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Items", targetDepth)) {<NEW_LINE>queryStringNames.withItems(new ArrayList<String>());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Items/Name", targetDepth)) {<NEW_LINE>queryStringNames.withItems(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return queryStringNames;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
XMLEvent xmlEvent = context.nextEvent();
18,556
private static void findTwinMentionsStrict(Document doc) {<NEW_LINE>for (int sentNum = 0; sentNum < doc.goldMentions.size(); sentNum++) {<NEW_LINE>List<Mention> golds = doc.goldMentions.get(sentNum);<NEW_LINE>List<Mention> predicts = doc.predictedMentions.get(sentNum);<NEW_LINE>// For CoNLL training there are some documents with gold mentions with the same position offsets<NEW_LINE>// See /scr/nlp/data/conll-2011/v2/data/train/data/english/annotations/nw/wsj/09/wsj_0990.v2_auto_conll<NEW_LINE>// (Packwood - Roth)<NEW_LINE>CollectionValuedMap<IntPair, Mention> goldMentionPositions = new CollectionValuedMap<>();<NEW_LINE>for (Mention g : golds) {<NEW_LINE>IntPair ip = new IntPair(g.startIndex, g.endIndex);<NEW_LINE>if (goldMentionPositions.containsKey(ip)) {<NEW_LINE>StringBuilder existingMentions = new StringBuilder();<NEW_LINE>for (Mention eg : goldMentionPositions.get(ip)) {<NEW_LINE>if (existingMentions.length() > 0) {<NEW_LINE>existingMentions.append(",");<NEW_LINE>}<NEW_LINE>existingMentions.append(eg.mentionID);<NEW_LINE>}<NEW_LINE>Redwood.log("debug-preprocessor", "WARNING: gold mentions with the same offsets: " + ip + " mentions=" + g.mentionID + "," + existingMentions + ", " + g.spanToString());<NEW_LINE>}<NEW_LINE>// assert(!goldMentionPositions.containsKey(ip));<NEW_LINE>goldMentionPositions.add(new IntPair(g.startIndex, g.endIndex), g);<NEW_LINE>}<NEW_LINE>for (Mention p : predicts) {<NEW_LINE>IntPair pos = new IntPair(p.startIndex, p.endIndex);<NEW_LINE>if (goldMentionPositions.containsKey(pos)) {<NEW_LINE>Collection<Mention> <MASK><NEW_LINE>int minId = Integer.MAX_VALUE;<NEW_LINE>Mention g = null;<NEW_LINE>for (Mention m : cm) {<NEW_LINE>if (m.mentionID < minId) {<NEW_LINE>g = m;<NEW_LINE>minId = m.mentionID;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (cm.size() == 1) {<NEW_LINE>goldMentionPositions.remove(pos);<NEW_LINE>} else {<NEW_LINE>cm.remove(g);<NEW_LINE>}<NEW_LINE>p.mentionID = g.mentionID;<NEW_LINE>p.hasTwin = true;<NEW_LINE>g.hasTwin = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
cm = goldMentionPositions.get(pos);
1,122,830
public void upload2() throws NoSuchAlgorithmException {<NEW_LINE>// BEGIN: com.azure.storage.blob.specialized.BlockBlobClient.uploadWithResponse#InputStream-long-BlobHttpHeaders-Map-AccessTier-byte-BlobRequestConditions-Duration-Context<NEW_LINE>BlobHttpHeaders headers = new BlobHttpHeaders().setContentMd5("data".getBytes(StandardCharsets.UTF_8)).setContentLanguage("en-US").setContentType("binary");<NEW_LINE>Map<String, String> metadata = Collections.singletonMap("metadata", "value");<NEW_LINE>byte[] md5 = MessageDigest.getInstance("MD5").digest("data".getBytes(StandardCharsets.UTF_8));<NEW_LINE>BlobRequestConditions requestConditions = new BlobRequestConditions().setLeaseId(leaseId).setIfUnmodifiedSince(OffsetDateTime.now().minusDays(3));<NEW_LINE>Context context = new Context("key", "value");<NEW_LINE>System.out.printf("Uploaded BlockBlob MD5 is %s%n", Base64.getEncoder().encodeToString(client.uploadWithResponse(data, length, headers, metadata, AccessTier.HOT, md5, requestConditions, timeout, context).getValue<MASK><NEW_LINE>// END: com.azure.storage.blob.specialized.BlockBlobClient.uploadWithResponse#InputStream-long-BlobHttpHeaders-Map-AccessTier-byte-BlobRequestConditions-Duration-Context<NEW_LINE>}
().getContentMd5()));
1,558,357
private E switchToNextConsumerChunkAndPoll(MpmcUnboundedXaddChunk<E> cChunk, MpmcUnboundedXaddChunk<E> next, long expectedChunkIndex) {<NEW_LINE>if (next == null) {<NEW_LINE>final long ccChunkIndex = expectedChunkIndex - 1;<NEW_LINE>assert cChunk.lvIndex() == ccChunkIndex;<NEW_LINE>if (lvProducerChunkIndex() == ccChunkIndex) {<NEW_LINE>// no need to help too much here or the consumer latency will be hurt<NEW_LINE>next = appendNextChunks(cChunk, ccChunkIndex, 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>while (next == null) {<NEW_LINE>next = cChunk.lvNext();<NEW_LINE>}<NEW_LINE>// we can freely spin awaiting producer, because we are the only one in charge to<NEW_LINE>// rotate the consumer buffer and use next<NEW_LINE>final E e = next.spinForElement(0, false);<NEW_LINE>final boolean pooled = next.isPooled();<NEW_LINE>if (pooled) {<NEW_LINE>next.spinForSequence(0, expectedChunkIndex);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>moveToNextConsumerChunk(cChunk, next);<NEW_LINE>return e;<NEW_LINE>}
next.soElement(0, null);
141,279
private List<TokenTextElement> findTokenTextElementForComment(Comment oldValue, NodeText nodeText) {<NEW_LINE>List<TokenTextElement> matchingTokens;<NEW_LINE>if (oldValue instanceof JavadocComment) {<NEW_LINE>matchingTokens = nodeText.getElements().stream().filter(e -> e.isToken(JAVADOC_COMMENT)).map(e -> (TokenTextElement) e).filter(t -> t.getText().equals("/**" + oldValue.getContent() + "*/")).collect(toList());<NEW_LINE>} else if (oldValue instanceof BlockComment) {<NEW_LINE>matchingTokens = nodeText.getElements().stream().filter(e -> e.isToken(MULTI_LINE_COMMENT)).map(e -> (TokenTextElement) e).filter(t -> t.getText().equals("/*" + oldValue.getContent() + "*/")<MASK><NEW_LINE>} else {<NEW_LINE>matchingTokens = nodeText.getElements().stream().filter(e -> e.isToken(SINGLE_LINE_COMMENT)).map(e -> (TokenTextElement) e).filter(t -> t.getText().trim().equals(("//" + oldValue.getContent()).trim())).collect(toList());<NEW_LINE>}<NEW_LINE>if (matchingTokens.size() > 1) {<NEW_LINE>// Duplicate comments found, refine the result<NEW_LINE>matchingTokens = matchingTokens.stream().filter(t -> isEqualRange(t.getToken().getRange(), oldValue.getRange())).collect(toList());<NEW_LINE>}<NEW_LINE>return matchingTokens;<NEW_LINE>}
).collect(toList());
1,526,572
public double yearFraction(LocalDate startDate, LocalDate endDate, DayCount dayCount) {<NEW_LINE>ArgChecker.inOrderOrEqual(getUnadjustedStartDate(), startDate, "bond.unadjustedStartDate", "startDate");<NEW_LINE>ArgChecker.inOrderOrEqual(startDate, endDate, "startDate", "endDate");<NEW_LINE>ArgChecker.inOrderOrEqual(endDate, getUnadjustedEndDate(), "endDate", "bond.unadjustedEndDate");<NEW_LINE>// bond day counts often need ScheduleInfo<NEW_LINE>ScheduleInfo info = new ScheduleInfo() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public LocalDate getStartDate() {<NEW_LINE>return getUnadjustedStartDate();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public LocalDate getEndDate() {<NEW_LINE>return getUnadjustedEndDate();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Frequency getFrequency() {<NEW_LINE>return frequency;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public LocalDate getPeriodEndDate(LocalDate date) {<NEW_LINE>return periodicPayments.stream().filter(p -> p.contains(date)).map(p -> p.getUnadjustedEndDate()).findFirst().orElseThrow(() -> new IllegalArgumentException("Date is not contained in any period"));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isEndOfMonthConvention() {<NEW_LINE>return rollConvention == RollConventions.EOM;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>return dayCount.<MASK><NEW_LINE>}
yearFraction(startDate, endDate, info);
389,044
/*<NEW_LINE>* @Sensitive<NEW_LINE>* public boolean checkForSignatureProps(@Sensitive Map<String, Object> map) {<NEW_LINE>* boolean isSigConfig = false;<NEW_LINE>* if (map.containsKey(WSSecurityConstants.CXF_SIG_PROPS))<NEW_LINE>* isSigConfig = true;<NEW_LINE>* return isSigConfig;<NEW_LINE>* }<NEW_LINE>*<NEW_LINE>* public boolean checkForEncryptionProps(Map<String, Object> map) {<NEW_LINE>* boolean isEncConfig = false;<NEW_LINE>* if (map.containsKey(WSSecurityConstants.CXF_ENC_PROPS))<NEW_LINE>* isEncConfig = true;<NEW_LINE>* return isEncConfig;<NEW_LINE>* }<NEW_LINE>*/<NEW_LINE>@Sensitive<NEW_LINE>static public void modifyConfigMap(Map<String, Object> configMap) {<NEW_LINE>if (configMap.containsKey(WSSecurityConstants.CXF_USER_PASSWORD)) {<NEW_LINE>String pwd = changePasswordType((SerializableProtectedString) configMap.get(WSSecurityConstants.CXF_USER_PASSWORD));<NEW_LINE>configMap.put(WSSecurityConstants.CXF_USER_PASSWORD, pwd);<NEW_LINE>}<NEW_LINE>if (configMap.containsKey(WSSecurityConstants.WSS4J_KEY_PASSWORD)) {<NEW_LINE>String pwd = changePasswordType((SerializableProtectedString) configMap.get(WSSecurityConstants.WSS4J_KEY_PASSWORD));<NEW_LINE>configMap.put(WSSecurityConstants.WSS4J_KEY_PASSWORD, pwd);<NEW_LINE>}<NEW_LINE>if (configMap.containsKey(WSSecurityConstants.WSS4J_KS_PASSWORD)) {<NEW_LINE>String pwd = changePasswordType((SerializableProtectedString) configMap.get(WSSecurityConstants.WSS4J_KS_PASSWORD));<NEW_LINE>configMap.<MASK><NEW_LINE>}<NEW_LINE>if (configMap.containsKey(WSSecurityConstants.WSS4J_TS_PASSWORD)) {<NEW_LINE>String pwd = changePasswordType((SerializableProtectedString) configMap.get(WSSecurityConstants.WSS4J_TS_PASSWORD));<NEW_LINE>configMap.put(WSSecurityConstants.WSS4J_TS_PASSWORD, pwd);<NEW_LINE>}<NEW_LINE>}
put(WSSecurityConstants.WSS4J_KS_PASSWORD, pwd);
1,624,392
public static long pack(double v) {<NEW_LINE>// Not "raw" , so NaNs end up as the same bit pattern when packed.<NEW_LINE>long x = Double.doubleToLongBits(v);<NEW_LINE>long sign = BitsLong.unpack(x, 63, 64);<NEW_LINE>long exp11 = BitsLong.unpack(x, 52, 63);<NEW_LINE>long exp9 = encode11to9(exp11);<NEW_LINE>if (exp9 == -1)<NEW_LINE>return NO_ENCODING;<NEW_LINE>long significand = BitsLong.unpack(x, 0, 52);<NEW_LINE>// Do not set the value bit or double bit.<NEW_LINE>// This is done in NodeId.toBytes and NodeId.toByteBuffer.<NEW_LINE>long z = 0;<NEW_LINE>z = BitsLong.pack(z, sign, 61, 62);<NEW_LINE>z = BitsLong.pack(z, exp9, 52, 61);<NEW_LINE>z = BitsLong.pack(<MASK><NEW_LINE>return z;<NEW_LINE>}
z, significand, 0, 52);
912,195
public ExitCode run(CommandEnv commandEnv) throws ValidationException, IOException, RepoException {<NEW_LINE>ConfigFileArgs configFileArgs = commandEnv.parseConfigFileArgs(this, /*useSourceRef*/<NEW_LINE>false);<NEW_LINE>ConfigLoader configLoader = configLoaderProvider.newLoader(configFileArgs.getConfigPath(<MASK><NEW_LINE>ValidationResult result = validate(commandEnv.getOptions(), configLoader, configFileArgs.getWorkflowName());<NEW_LINE>Console console = commandEnv.getOptions().get(GeneralOptions.class).console();<NEW_LINE>for (ValidationMessage message : result.getAllMessages()) {<NEW_LINE>switch(message.getLevel()) {<NEW_LINE>case WARNING:<NEW_LINE>console.warn(message.getMessage());<NEW_LINE>break;<NEW_LINE>case ERROR:<NEW_LINE>console.error(message.getMessage());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (result.hasErrors()) {<NEW_LINE>console.errorFmt("Configuration '%s' is invalid.", configLoader.location());<NEW_LINE>return ExitCode.CONFIGURATION_ERROR;<NEW_LINE>}<NEW_LINE>console.infoFmt("Configuration '%s' is valid.", configLoader.location());<NEW_LINE>return ExitCode.SUCCESS;<NEW_LINE>}
), configFileArgs.getSourceRef());
1,338,984
private void workCompletedProjection(String workCompletedId, List<Projection> projections) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>WorkCompleted o = emc.find(workCompletedId, WorkCompleted.class);<NEW_LINE>Data data = this.data(business, o);<NEW_LINE>emc.beginTransaction(WorkCompleted.class);<NEW_LINE>emc.beginTransaction(Task.class);<NEW_LINE>emc.beginTransaction(TaskCompleted.class);<NEW_LINE>emc.beginTransaction(Read.class);<NEW_LINE>emc.beginTransaction(ReadCompleted.class);<NEW_LINE>emc.beginTransaction(Review.class);<NEW_LINE>ProjectionFactory.projectionWorkCompleted(projections, data, o);<NEW_LINE>for (Task task : business.entityManagerContainer().listEqualAndEqual(Task.class, Task.job_FIELDNAME, o.getJob(), Task.process_FIELDNAME, o.getProcess())) {<NEW_LINE>ProjectionFactory.projectionTask(projections, data, task);<NEW_LINE>}<NEW_LINE>for (TaskCompleted taskCompleted : business.entityManagerContainer().listEqualAndEqual(TaskCompleted.class, TaskCompleted.job_FIELDNAME, o.getJob(), TaskCompleted.process_FIELDNAME, o.getProcess())) {<NEW_LINE>ProjectionFactory.projectionTaskCompleted(projections, data, taskCompleted);<NEW_LINE>}<NEW_LINE>for (Read read : business.entityManagerContainer().listEqualAndEqual(Read.class, Read.job_FIELDNAME, o.getJob(), Read.process_FIELDNAME, o.getProcess())) {<NEW_LINE>ProjectionFactory.projectionRead(projections, data, read);<NEW_LINE>}<NEW_LINE>for (ReadCompleted readCompleted : business.entityManagerContainer().listEqualAndEqual(ReadCompleted.class, ReadCompleted.job_FIELDNAME, o.getJob(), ReadCompleted.process_FIELDNAME, o.getProcess())) {<NEW_LINE>ProjectionFactory.<MASK><NEW_LINE>}<NEW_LINE>for (Review review : business.entityManagerContainer().listEqualAndEqual(Review.class, Review.job_FIELDNAME, o.getJob(), Review.process_FIELDNAME, o.getProcess())) {<NEW_LINE>ProjectionFactory.projectionReview(projections, data, review);<NEW_LINE>}<NEW_LINE>emc.commit();<NEW_LINE>}<NEW_LINE>}
projectionReadCompleted(projections, data, readCompleted);
968,216
public static boolean backupToFile(Context context, Uri uri, String password, String plain) {<NEW_LINE>boolean success;<NEW_LINE>try {<NEW_LINE>int iter = EncryptionHelper.generateRandomIterations();<NEW_LINE>byte[] salt = EncryptionHelper.generateRandom(Constants.ENCRYPTION_IV_LENGTH);<NEW_LINE>SecretKey key = EncryptionHelper.<MASK><NEW_LINE>byte[] encrypted = EncryptionHelper.encrypt(key, plain.getBytes(StandardCharsets.UTF_8));<NEW_LINE>byte[] iterBytes = ByteBuffer.allocate(Constants.INT_LENGTH).putInt(iter).array();<NEW_LINE>byte[] data = new byte[Constants.INT_LENGTH + Constants.ENCRYPTION_IV_LENGTH + encrypted.length];<NEW_LINE>System.arraycopy(iterBytes, 0, data, 0, Constants.INT_LENGTH);<NEW_LINE>System.arraycopy(salt, 0, data, Constants.INT_LENGTH, Constants.ENCRYPTION_IV_LENGTH);<NEW_LINE>System.arraycopy(encrypted, 0, data, Constants.INT_LENGTH + Constants.ENCRYPTION_IV_LENGTH, encrypted.length);<NEW_LINE>success = StorageAccessHelper.saveFile(context, uri, data);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>success = false;<NEW_LINE>}<NEW_LINE>return success;<NEW_LINE>}
generateSymmetricKeyPBKDF2(password, iter, salt);
1,093,841
public ResponseType execute() {<NEW_LINE>try {<NEW_LINE>return queue().get();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>if (e instanceof HystrixRuntimeException) {<NEW_LINE>throw (HystrixRuntimeException) e;<NEW_LINE>}<NEW_LINE>// if we have an exception we know about we'll throw it directly without the threading wrapper exception<NEW_LINE>if (e.getCause() instanceof HystrixRuntimeException) {<NEW_LINE>throw (HystrixRuntimeException) e.getCause();<NEW_LINE>}<NEW_LINE>// we don't know what kind of exception this is so create a generic message and throw a new HystrixRuntimeException<NEW_LINE>String message = getClass<MASK><NEW_LINE>// debug only since we're throwing the exception and someone higher will do something with it<NEW_LINE>logger.debug(message, e);<NEW_LINE>// TODO should this be made a HystrixRuntimeException?<NEW_LINE>throw new RuntimeException(message, e);<NEW_LINE>}<NEW_LINE>}
().getSimpleName() + " HystrixCollapser failed while executing.";
996,247
public static ResolvedSwapLeg cashFlowEquivalentOnLeg(ResolvedSwapLeg onLeg, RatesProvider multicurve) {<NEW_LINE>Currency ccy = onLeg.getCurrency();<NEW_LINE>ArgChecker.isTrue(onLeg.getType().equals(SwapLegType.OVERNIGHT), "Leg type should be OVERNIGHT");<NEW_LINE>ArgChecker.isTrue(onLeg.getPaymentEvents().isEmpty(), "PaymentEvent should be empty");<NEW_LINE>List<NotionalExchange> paymentEvents = new ArrayList<NotionalExchange>();<NEW_LINE>for (SwapPaymentPeriod paymentPeriod : onLeg.getPaymentPeriods()) {<NEW_LINE>ArgChecker.isTrue(paymentPeriod instanceof RatePaymentPeriod, "rate payment should be RatePaymentPeriod");<NEW_LINE>RatePaymentPeriod ratePaymentPeriod = (RatePaymentPeriod) paymentPeriod;<NEW_LINE>ArgChecker.isTrue(ratePaymentPeriod.getAccrualPeriods().size() == 1, "rate payment should not be compounding");<NEW_LINE>RateAccrualPeriod rateAccrualPeriod = ratePaymentPeriod.getAccrualPeriods().get(0);<NEW_LINE>CurrencyAmount notional = ratePaymentPeriod.getNotionalAmount();<NEW_LINE>RateComputation rateComputation = rateAccrualPeriod.getRateComputation();<NEW_LINE>ArgChecker.isTrue(rateComputation instanceof OvernightCompoundedRateComputation, "RateComputation should be of type OvernightCompoundedRateComputation");<NEW_LINE>OvernightCompoundedRateComputation onComputation = (OvernightCompoundedRateComputation) rateComputation;<NEW_LINE>LocalDate startDate = rateAccrualPeriod.getStartDate();<NEW_LINE><MASK><NEW_LINE>double computationAccrual = onComputation.getIndex().getDayCount().yearFraction(startDate, endDate);<NEW_LINE>LocalDate paymentDate = ratePaymentPeriod.getPaymentDate();<NEW_LINE>double paymentAccural = rateAccrualPeriod.getYearFraction();<NEW_LINE>double payDateRatio = multicurve.discountFactor(ccy, paymentDate) / multicurve.discountFactor(ccy, endDate);<NEW_LINE>NotionalExchange payStart = NotionalExchange.of(notional.multipliedBy(payDateRatio * paymentAccural / computationAccrual), startDate);<NEW_LINE>double spread = rateAccrualPeriod.getSpread();<NEW_LINE>NotionalExchange payEnd = NotionalExchange.of(notional.multipliedBy(-paymentAccural / computationAccrual + spread * paymentAccural), paymentDate);<NEW_LINE>paymentEvents.add(payStart);<NEW_LINE>paymentEvents.add(payEnd);<NEW_LINE>}<NEW_LINE>ResolvedSwapLeg leg = ResolvedSwapLeg.builder().paymentEvents(paymentEvents).payReceive(PayReceive.RECEIVE).type(SwapLegType.OTHER).build();<NEW_LINE>return leg;<NEW_LINE>}
LocalDate endDate = rateAccrualPeriod.getEndDate();
1,474,310
private void createToken(String name, int tokenId, boolean internal, CursorContext cursorContext, PageCursor pageCursor, StoreCursors storeCursors) {<NEW_LINE>RECORD record = recordInstantiator.apply(tokenId);<NEW_LINE>record.setInUse(true);<NEW_LINE>record.setCreated();<NEW_LINE>record.setInternal(internal);<NEW_LINE>Collection<DynamicRecord> nameRecords = store.allocateNameRecords(encodeString(name), cursorContext, EmptyMemoryTracker.INSTANCE);<NEW_LINE>record.setNameId((int) Iterables.first(nameRecords).getId());<NEW_LINE>record.addNameRecords(nameRecords);<NEW_LINE>store.updateRecord(record, pageCursor, cursorContext, storeCursors);<NEW_LINE>try (var namedCursor = store.getWriteDynamicTokenCursor(storeCursors)) {<NEW_LINE><MASK><NEW_LINE>nameRecords.forEach(nameRecord -> tokenNameStore.updateRecord(nameRecord, namedCursor, cursorContext, storeCursors));<NEW_LINE>}<NEW_LINE>}
DynamicStringStore tokenNameStore = store.getNameStore();
991,011
private Set<String> foreignKeyDiff(final String[] outliers, final String[] inliers, double minRatioThreshold) {<NEW_LINE>final Map<String, Integer> outlierCounts = new HashMap<>();<NEW_LINE>log.info("Starting outliers");<NEW_LINE>// noinspection Duplicates<NEW_LINE>for (final String outlier : outliers) {<NEW_LINE>outlierCounts.merge(outlier, 1, (a, b) -> a + b);<NEW_LINE>}<NEW_LINE>log.info("Starting inliers");<NEW_LINE>final Map<String, Integer> inlierCounts = new HashMap<>();<NEW_LINE>// noinspection Duplicates<NEW_LINE>for (final String inlier : inliers) {<NEW_LINE>inlierCounts.merge(inlier, 1, (a, b) -> a + b);<NEW_LINE>}<NEW_LINE>// Generate candidates based on min ratio<NEW_LINE>final ImmutableSet.Builder<String<MASK><NEW_LINE>for (Entry<String, Integer> entry : outlierCounts.entrySet()) {<NEW_LINE>final int numOutliers = entry.getValue();<NEW_LINE>final int numInliers = inlierCounts.getOrDefault(entry.getKey(), 0);<NEW_LINE>if ((numOutliers / (numOutliers + numInliers + 0.0)) >= minRatioThreshold) {<NEW_LINE>builder.add(entry.getKey());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>}
> builder = ImmutableSet.builder();
1,210,608
public void addPostCondition(final String postConditionString, final String attributeName) {<NEW_LINE>if (postConditionString.trim().length() != 0) {<NEW_LINE>final String id = SpecWriterUtilities.getValidIdentifier(TLAConstants.Schemes.POST_CONDITION_SCHEME);<NEW_LINE>if (cfgBuffer != null) {<NEW_LINE>cfgBuffer.append(TLAConstants.COMMENT).append("POSTCONDITION definition").append(TLAConstants.CR);<NEW_LINE>cfgBuffer.append("POSTCONDITION").append(TLAConstants.CR).append(id).append(TLAConstants.CR);<NEW_LINE>}<NEW_LINE>tlaBuffer.append(TLAConstants.COMMENT).append("POSTCONDITION definition ").append(TLAConstants.ATTRIBUTE);<NEW_LINE>tlaBuffer.append(attributeName).append(TLAConstants.CR);<NEW_LINE>tlaBuffer.append(id).append(TLAConstants.DEFINES).append(TLAConstants<MASK><NEW_LINE>tlaBuffer.append(CLOSING_SEP).append(TLAConstants.CR);<NEW_LINE>}<NEW_LINE>}
.CR).append(postConditionString);
130,492
private static void generic(Exchange okcoinExchange) throws IOException {<NEW_LINE>// Interested in the public market data feed (no authentication)<NEW_LINE>MarketDataService marketDataService = okcoinExchange.getMarketDataService();<NEW_LINE>// Get the latest trade data for BTC_CNY<NEW_LINE>Trades trades = marketDataService.getTrades(CurrencyPair.BTC_USD, FuturesContract.ThisWeek);<NEW_LINE>System.out.println(trades);<NEW_LINE>System.out.println("Trades(0): " + trades.getTrades().get(0).toString());<NEW_LINE>System.out.println("Trades size: " + trades.getTrades().size());<NEW_LINE>// Get the latest trades data for BTC_CNY for the past couple of trades<NEW_LINE>trades = marketDataService.getTrades(CurrencyPair.BTC_CNY, <MASK><NEW_LINE>System.out.println(trades);<NEW_LINE>System.out.println("Trades size: " + trades.getTrades().size());<NEW_LINE>}
trades.getlastID() - 10);
1,545,358
public static void populateSwiftLibraryDescriptionArg(SwiftBuckConfig swiftBuckConfig, SourcePathResolverAdapter sourcePathResolverAdapter, SwiftLibraryDescriptionArg.Builder output, CxxLibraryDescription.CommonArg args, BuildTarget buildTarget) {<NEW_LINE>output.setName(args.getName());<NEW_LINE>output.setSrcs(filterSwiftSources(sourcePathResolverAdapter, args.getSrcs()));<NEW_LINE>if (args instanceof SwiftCommonArg) {<NEW_LINE>Optional<String> swiftVersion = ((SwiftCommonArg) args).getSwiftVersion();<NEW_LINE>if (!swiftVersion.isPresent()) {<NEW_LINE>swiftVersion = swiftBuckConfig.getVersion();<NEW_LINE>}<NEW_LINE>output.setCompilerFlags(((SwiftCommonArg) args).getSwiftCompilerFlags());<NEW_LINE>output.setVersion(swiftVersion);<NEW_LINE>} else {<NEW_LINE>output.setCompilerFlags(args.getCompilerFlags());<NEW_LINE>}<NEW_LINE>output.setFrameworks(args.getFrameworks());<NEW_LINE>output.setLibraries(args.getLibraries());<NEW_LINE>output.setDeps(args.getDeps());<NEW_LINE>output.setSupportedPlatformsRegex(args.getSupportedPlatformsRegex());<NEW_LINE>output.setModuleName(args.getModuleName().map(Optional::of).orElse(Optional.of(buildTarget.getShortName())));<NEW_LINE>output.setEnableObjcInterop(true);<NEW_LINE>output.setBridgingHeader(args.getBridgingHeader());<NEW_LINE>boolean isCompanionTarget = buildTarget.getFlavors().contains(SWIFT_COMPANION_FLAVOR);<NEW_LINE>output.setPreferredLinkage(isCompanionTarget ? Optional.of(STATIC<MASK><NEW_LINE>}
) : args.getPreferredLinkage());
118,206
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>log.fine("");<NEW_LINE>HttpSession sess = request.getSession();<NEW_LINE>WWindowStatus ws = WWindowStatus.get(request);<NEW_LINE>if (ws == null) {<NEW_LINE>WebUtil.createTimeoutPage(request, response, this, null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Get Mandatory Parameters<NEW_LINE>String columnName = WebUtil.getParameter(request, "ColumnName");<NEW_LINE>log.info("ColumnName=" + columnName + " - " + ws.toString());<NEW_LINE>//<NEW_LINE>GridField mField = ws.curTab.getField(columnName);<NEW_LINE>log.config("ColumnName=" + columnName + ", MField=" + mField);<NEW_LINE>if (mField == null || columnName == null || columnName.equals("")) {<NEW_LINE>WebUtil.createErrorPage(request, response, this, Msg.getMsg(ws.ctx, "ParameterMissing"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MLocation location = null;<NEW_LINE>Object value = mField.getValue();<NEW_LINE>if (value != null && value instanceof Integer)<NEW_LINE>location = new MLocation(ws.ctx, ((Integer) value).intValue(), null);<NEW_LINE>else<NEW_LINE>location = new MLocation(ws.ctx, 0, null);<NEW_LINE>// String targetBase = "parent.WWindow." + WWindow.FORM_NAME + "." + columnName;<NEW_LINE>String targetBase = "opener.WWindow." + WWindow.FORM_NAME + "." + columnName;<NEW_LINE>String action = request.getRequestURI();<NEW_LINE>// Create Document<NEW_LINE>WebDoc doc = WebDoc.createPopup(mField.getHeader());<NEW_LINE>doc.addPopupClose(ws.ctx);<NEW_LINE>boolean hasDependents = ws.curTab.hasDependants(columnName);<NEW_LINE>boolean hasCallout = mField.getCallout().length() > 0;<NEW_LINE>// Reset<NEW_LINE>button reset = new button();<NEW_LINE>// translate<NEW_LINE>reset.addElement("Reset");<NEW_LINE>String script <MASK><NEW_LINE>if (hasDependents || hasCallout)<NEW_LINE>script += "startUpdate(" + targetBase + "F);";<NEW_LINE>reset.setOnClick(script);<NEW_LINE>//<NEW_LINE>doc.getTable().addElement(new tr().addElement(fillForm(ws, action, location, targetBase, hasDependents || hasCallout)).addElement(reset));<NEW_LINE>//<NEW_LINE>doc.addPopupClose(ws.ctx);<NEW_LINE>// log.trace(log.l6_Database, doc.toString());<NEW_LINE>WebUtil.createResponse(request, response, this, null, doc, true);<NEW_LINE>}
= targetBase + "D.value='';" + targetBase + "F.value='';closePopup();";
1,050,895
public static FilePickerDialogFragment newInstance(String tag, String title, DialogProperties properties) {<NEW_LINE>FilePickerDialogFragment fragment = new FilePickerDialogFragment();<NEW_LINE>Bundle args = new Bundle();<NEW_LINE>args.putString(ARG_TAG, tag);<NEW_LINE><MASK><NEW_LINE>args.putInt(ARG_SELECTION_MODE, properties.selection_mode);<NEW_LINE>args.putInt(ARG_SELECTION_TYPE, properties.selection_type);<NEW_LINE>args.putString(ARG_ROOT_FOLDER, properties.root.getAbsolutePath());<NEW_LINE>args.putString(ARG_STARTING_FOLDER, properties.offset.getAbsolutePath());<NEW_LINE>args.putString(ARG_ERROR_FOLDER, properties.error_dir.getAbsolutePath());<NEW_LINE>args.putStringArray(ARG_EXTENSIONS, properties.extensions);<NEW_LINE>args.putInt(ARG_SORT_BY, properties.sortBy);<NEW_LINE>args.putInt(ARG_SORT_ORDER, properties.sortOrder);<NEW_LINE>// properties.<NEW_LINE>// args.putInt(ARG_SORT_BY, properties.);<NEW_LINE>fragment.setArguments(args);<NEW_LINE>return fragment;<NEW_LINE>}
args.putString(ARG_TITLE, title);
386,813
public void submit(VariantContext vc) {<NEW_LINE>Utils.nonNull(vc);<NEW_LINE>Utils.validateArg(vc.hasGenotypes(), "GVCF assumes that the VariantContext has genotypes");<NEW_LINE>Utils.validateArg(vc.getGenotypes().size() == 1, () -> "GVCF assumes that the VariantContext has exactly one genotype but saw " + vc.getGenotypes().size());<NEW_LINE>if (sampleName == null) {<NEW_LINE>sampleName = vc.getGenotype(0).getSampleName();<NEW_LINE>}<NEW_LINE>if (currentBlock != null && !currentBlock.isContiguous(vc)) {<NEW_LINE>// we've made a non-contiguous step (across interval, onto another chr), so finalize<NEW_LINE>emitCurrentBlock();<NEW_LINE>}<NEW_LINE>final Genotype g = vc.getGenotype(0);<NEW_LINE>if ((g.isHomRef() || (g.isNoCall() && g.hasPL() && g.getPL()[0] == 0)) && vc.hasAlternateAllele(Allele.NON_REF_ALLELE) && vc.isBiallelic()) {<NEW_LINE>// genotypes with PL=0,0,0 get treated as zero confidence hom refs<NEW_LINE>// create bands<NEW_LINE>final VariantContext <MASK><NEW_LINE>if (maybeCompletedBand != null) {<NEW_LINE>toOutput.add(maybeCompletedBand);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// g is variant, so flush the bands and emit vc<NEW_LINE>emitCurrentBlock();<NEW_LINE>nextAvailableStart = vc.getEnd();<NEW_LINE>contigOfNextAvailableStart = vc.getContig();<NEW_LINE>toOutput.add(vc);<NEW_LINE>}<NEW_LINE>}
maybeCompletedBand = addHomRefSite(vc, g);
314,209
private long closeRewrittenPartitionFiles(int partitionIndex, int oldBase, Path path) {<NEW_LINE>long partitionTs = openPartitionInfo.getQuick(partitionIndex * PARTITIONS_SLOT_SIZE);<NEW_LINE>long exisingPartitionNameTxn = openPartitionInfo.getQuick(partitionIndex * PARTITIONS_SLOT_SIZE + PARTITIONS_SLOT_OFFSET_NAME_TXN);<NEW_LINE>long newNameTxn = txFile.getPartitionNameTxnByPartitionTimestamp(partitionTs);<NEW_LINE>long <MASK><NEW_LINE>if (exisingPartitionNameTxn != newNameTxn || newSize < 0) {<NEW_LINE>LOG.debugW().$("close outdated partition files [table=").$(tableName).$(", ts=").$ts(partitionTs).$(", nameTxn=").$(newNameTxn).$();<NEW_LINE>// Close all columns, partition is overwritten. Partition reconciliation process will re-open correct files<NEW_LINE>for (int i = 0; i < this.columnCount; i++) {<NEW_LINE>closePartitionColumnFile(oldBase, i);<NEW_LINE>}<NEW_LINE>openPartitionInfo.setQuick(partitionIndex * PARTITIONS_SLOT_SIZE + PARTITIONS_SLOT_OFFSET_SIZE, -1);<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>pathGenPartitioned(partitionIndex);<NEW_LINE>TableUtils.txnPartitionConditionally(path, exisingPartitionNameTxn);<NEW_LINE>return newSize;<NEW_LINE>}
newSize = txFile.getPartitionSizeByPartitionTimestamp(partitionTs);
1,002,755
private HeartbeatMsg buildHeartbeat() {<NEW_LINE>ConfigManager configManager = ConfigManager.getInstance();<NEW_LINE>HeartbeatMsg heartbeatMsg = new HeartbeatMsg();<NEW_LINE>Map<String, String> commonProperties = configManager.getCommonProperties();<NEW_LINE>String localIp = commonProperties.get(ConfigConstants.PROXY_LOCAL_IP);<NEW_LINE>heartbeatMsg.setIp(localIp);<NEW_LINE>heartbeatMsg.setComponentType(ComponentTypeEnum.DataProxy.getName());<NEW_LINE>heartbeatMsg.setReportTime(System.currentTimeMillis());<NEW_LINE>Map<String, String> groupIdMappings = configManager.getGroupIdMappingProperties();<NEW_LINE>Map<String, Map<String, String>> streamIdMappings = configManager.getStreamIdMappingProperties();<NEW_LINE>Map<String, String> groupIdEnableMappings = configManager.getGroupIdEnableMappingProperties();<NEW_LINE>List<GroupHeartbeat> groupHeartbeats = new ArrayList<>();<NEW_LINE>for (Entry<String, String> entry : groupIdMappings.entrySet()) {<NEW_LINE>String groupIdNum = entry.getKey();<NEW_LINE>String groupId = entry.getValue();<NEW_LINE>GroupHeartbeat groupHeartbeat = new GroupHeartbeat();<NEW_LINE>groupHeartbeat.setInlongGroupId(groupId);<NEW_LINE>String status = groupIdEnableMappings.getOrDefault(groupIdNum, "disabled");<NEW_LINE>status = status.equals("TRUE") ? "enabled" : "disabled";<NEW_LINE>groupHeartbeat.setStatus(status);<NEW_LINE>groupHeartbeats.add(groupHeartbeat);<NEW_LINE>}<NEW_LINE>heartbeatMsg.setGroupHeartbeats(groupHeartbeats);<NEW_LINE>List<StreamHeartbeat> streamHeartbeats = new ArrayList<>();<NEW_LINE>for (Entry<String, Map<String, String>> entry : streamIdMappings.entrySet()) {<NEW_LINE>String groupIdNum = entry.getKey();<NEW_LINE>String status = groupIdEnableMappings.getOrDefault(groupIdNum, "disabled");<NEW_LINE>status = status.equals("TRUE") ? "enabled" : "disabled";<NEW_LINE>String <MASK><NEW_LINE>for (Entry<String, String> streamEntry : entry.getValue().entrySet()) {<NEW_LINE>String streamId = streamEntry.getValue();<NEW_LINE>StreamHeartbeat streamHeartbeat = new StreamHeartbeat();<NEW_LINE>streamHeartbeat.setInlongGroupId(groupId);<NEW_LINE>streamHeartbeat.setInlongStreamId(streamId);<NEW_LINE>streamHeartbeat.setStatus(status);<NEW_LINE>streamHeartbeats.add(streamHeartbeat);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>heartbeatMsg.setStreamHeartbeats(streamHeartbeats);<NEW_LINE>return heartbeatMsg;<NEW_LINE>}
groupId = groupIdMappings.get(groupIdNum);
475,781
public void visit(CallExpression node) {<NEW_LINE>// validate call arguments<NEW_LINE>boolean seenVarargs = false;<NEW_LINE>boolean seenKwargs = false;<NEW_LINE>Set<String> keywords = null;<NEW_LINE>for (Argument arg : node.getArguments()) {<NEW_LINE>if (arg instanceof Argument.Positional) {<NEW_LINE>if (seenVarargs) {<NEW_LINE>errorf(arg, "positional argument may not follow *args");<NEW_LINE>} else if (seenKwargs) {<NEW_LINE>errorf(arg, "positional argument may not follow **kwargs");<NEW_LINE>} else if (keywords != null) {<NEW_LINE>errorf(arg, "positional argument may not follow keyword argument");<NEW_LINE>}<NEW_LINE>} else if (arg instanceof Argument.Keyword) {<NEW_LINE>String keyword = ((Argument.Keyword) arg).getName();<NEW_LINE>if (seenVarargs) {<NEW_LINE><MASK><NEW_LINE>} else if (seenKwargs) {<NEW_LINE>errorf(arg, "keyword argument %s may not follow **kwargs", keyword);<NEW_LINE>}<NEW_LINE>if (keywords == null) {<NEW_LINE>keywords = new HashSet<>();<NEW_LINE>}<NEW_LINE>if (!keywords.add(keyword)) {<NEW_LINE>errorf(arg, "duplicate keyword argument: %s", keyword);<NEW_LINE>}<NEW_LINE>} else if (arg instanceof Argument.Star) {<NEW_LINE>if (seenKwargs) {<NEW_LINE>errorf(arg, "*args may not follow **kwargs");<NEW_LINE>} else if (seenVarargs) {<NEW_LINE>errorf(arg, "multiple *args not allowed");<NEW_LINE>}<NEW_LINE>seenVarargs = true;<NEW_LINE>} else if (arg instanceof Argument.StarStar) {<NEW_LINE>if (seenKwargs) {<NEW_LINE>errorf(arg, "multiple **kwargs not allowed");<NEW_LINE>}<NEW_LINE>seenKwargs = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>super.visit(node);<NEW_LINE>}
errorf(arg, "keyword argument %s may not follow *args", keyword);
41,803
private void recover(StartRecoveryRequest request, ActionListener<RecoveryResponse> listener) throws IOException {<NEW_LINE>final IndexService indexService = indicesService.indexServiceSafe(request.<MASK><NEW_LINE>final IndexShard shard = indexService.getShard(request.shardId().id());<NEW_LINE>final ShardRouting routingEntry = shard.routingEntry();<NEW_LINE>if (routingEntry.primary() == false || routingEntry.active() == false) {<NEW_LINE>throw new DelayRecoveryException("source shard [" + routingEntry + "] is not an active primary");<NEW_LINE>}<NEW_LINE>if (request.isPrimaryRelocation() && (routingEntry.relocating() == false || routingEntry.relocatingNodeId().equals(request.targetNode().getId()) == false)) {<NEW_LINE>logger.debug("delaying recovery of {} as source shard is not marked yet as relocating to {}", request.shardId(), request.targetNode());<NEW_LINE>throw new DelayRecoveryException("source shard is not marked yet as relocating to [" + request.targetNode() + "]");<NEW_LINE>}<NEW_LINE>RecoverySourceHandler handler = ongoingRecoveries.addNewRecovery(request, shard);<NEW_LINE>logger.trace("[{}][{}] starting recovery to {}", request.shardId().getIndex().getName(), request.shardId().id(), request.targetNode());<NEW_LINE>handler.recoverToTarget(ActionListener.runAfter(listener, () -> ongoingRecoveries.remove(shard, handler)));<NEW_LINE>}
shardId().getIndex());
627,348
protected void convertElementToJson(ObjectNode propertiesNode, BaseElement baseElement, BpmnJsonConverterContext converterContext) {<NEW_LINE>BoundaryEvent boundaryEvent = (BoundaryEvent) baseElement;<NEW_LINE>ArrayNode dockersArrayNode = objectMapper.createArrayNode();<NEW_LINE>ObjectNode dockNode = objectMapper.createObjectNode();<NEW_LINE>GraphicInfo graphicInfo = model.getGraphicInfo(boundaryEvent.getId());<NEW_LINE>GraphicInfo parentGraphicInfo = model.getGraphicInfo(boundaryEvent.getAttachedToRef().getId());<NEW_LINE>BigDecimal parentX = new <MASK><NEW_LINE>BigDecimal parentY = new BigDecimal(parentGraphicInfo.getY());<NEW_LINE>BigDecimal boundaryX = new BigDecimal(graphicInfo.getX());<NEW_LINE>BigDecimal boundaryWidth = new BigDecimal(graphicInfo.getWidth());<NEW_LINE>BigDecimal boundaryXMid = boundaryWidth.divide(new BigDecimal(2));<NEW_LINE>BigDecimal boundaryY = new BigDecimal(graphicInfo.getY());<NEW_LINE>BigDecimal boundaryHeight = new BigDecimal(graphicInfo.getHeight());<NEW_LINE>BigDecimal boundaryYMid = boundaryHeight.divide(new BigDecimal(2));<NEW_LINE>BigDecimal xBound = boundaryX.add(boundaryXMid).subtract(parentX).setScale(0, RoundingMode.HALF_UP);<NEW_LINE>BigDecimal yBound = boundaryY.add(boundaryYMid).subtract(parentY).setScale(0, RoundingMode.HALF_UP);<NEW_LINE>dockNode.put(EDITOR_BOUNDS_X, xBound.intValue());<NEW_LINE>dockNode.put(EDITOR_BOUNDS_Y, yBound.intValue());<NEW_LINE>dockersArrayNode.add(dockNode);<NEW_LINE>flowElementNode.set("dockers", dockersArrayNode);<NEW_LINE>propertiesNode.put(PROPERTY_CANCEL_ACTIVITY, boundaryEvent.isCancelActivity());<NEW_LINE>addEventProperties(boundaryEvent, propertiesNode);<NEW_LINE>addEventRegistryProperties(boundaryEvent, propertiesNode);<NEW_LINE>}
BigDecimal(parentGraphicInfo.getX());
1,564,644
private void loadAllClasses() {<NEW_LINE>waitForFile();<NEW_LINE>try {<NEW_LINE>NativeLibraries nativeLibraries = new NativeLibraries(apkFile);<NEW_LINE>this<MASK><NEW_LINE>} catch (Throwable e) {<NEW_LINE>nativeLibraries = Collections.emptyList();<NEW_LINE>}<NEW_LINE>if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {<NEW_LINE>try {<NEW_LINE>VirtualFileSystem.DexFileSystem dfs = new VirtualFileSystem.DexFileSystem(Uri.fromFile(apkFile), apkFile);<NEW_LINE>dexVfsId = VirtualFileSystem.mount(dfs);<NEW_LINE>allClasses = dfs.getDexClasses().getClassNames();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>allClasses = Collections.emptyList();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>dexClassesPreOreo = new DexClassesPreOreo(getApplication(), apkFile);<NEW_LINE>allClasses = dexClassesPreOreo.getClassNames();<NEW_LINE>}<NEW_LINE>allClassesLiveData.postValue(allClasses);<NEW_LINE>}
.nativeLibraries = nativeLibraries.getUniqueLibs();
1,420,172
private static void writeComponent(Scope scope, String groupId, String artifactId, String version, String packaging, List<License> licenses, StringBuilder bom) {<NEW_LINE>String indent = " ";<NEW_LINE>String bomReference = getBomReference(groupId, artifactId, version);<NEW_LINE>bom.append(indent).append("<component bom-ref=\"").append(bomReference).append("\" type=\"").append(packaging).append("\">\n");<NEW_LINE>bom.append(indent).append(" <group>").append(groupId).append("</group>\n");<NEW_LINE>bom.append(indent).append(" <name>").append(artifactId).append("</name>\n");<NEW_LINE>bom.append(indent).append(" <version>").append(version).append("</version>\n");<NEW_LINE>if (scope != null) {<NEW_LINE>// Cyclone schema allows three scopes:<NEW_LINE>String cycloneScope;<NEW_LINE>switch(scope) {<NEW_LINE>case Compile:<NEW_LINE>case System:<NEW_LINE>cycloneScope = "required";<NEW_LINE>break;<NEW_LINE>case None:<NEW_LINE>case Invalid:<NEW_LINE>case Test:<NEW_LINE>cycloneScope = "excluded";<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>cycloneScope = "optional";<NEW_LINE>}<NEW_LINE>bom.append(indent).append(" <scope>").append(cycloneScope).append("</scope>\n");<NEW_LINE>}<NEW_LINE>writeLicenses(licenses, bom, indent);<NEW_LINE>bom.append(indent).append(" <purl>").append(bomReference).append("</purl>\n");<NEW_LINE>bom.append<MASK><NEW_LINE>}
(indent).append("</component>\n");
1,839,346
public NodeValue eval(List<NodeValue> args) {<NEW_LINE>Node arg = NodeFunctions.checkAndGetStringLiteral("REGEX"<MASK><NEW_LINE>NodeValue vPattern = args.get(1);<NEW_LINE>NodeValue vFlags = (args.size() == 2 ? null : args.get(2));<NEW_LINE>RegexEngine regex = regexEngine;<NEW_LINE>if (regex == null) {<NEW_LINE>// Execution time regex compile (not a constant pattern).<NEW_LINE>try {<NEW_LINE>regex = makeRegexEngine(vPattern, vFlags);<NEW_LINE>} catch (ExprEvalException ex) {<NEW_LINE>// Avoid multiple logging of the same message (at least if adjacent)<NEW_LINE>String m = ex.getMessage();<NEW_LINE>if (m != null && !m.equals(currentFailMessage))<NEW_LINE>Log.warn(this, m);<NEW_LINE>currentFailMessage = m;<NEW_LINE>// This becomes an eval error, the FILTER is false and the current row rejected.<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean b = regex.match(arg.getLiteralLexicalForm());<NEW_LINE>return b ? NodeValue.TRUE : NodeValue.FALSE;<NEW_LINE>}
, args.get(0));
1,709,226
public static String jweDirectEncode(Key aesKey, Key hmacKey, byte[] contentBytes) throws JWEException {<NEW_LINE>int keyLength = aesKey.getEncoded().length;<NEW_LINE>String encAlgorithm;<NEW_LINE>switch(keyLength) {<NEW_LINE>case 16:<NEW_LINE>encAlgorithm = JWEConstants.A128CBC_HS256;<NEW_LINE>break;<NEW_LINE>case 24:<NEW_LINE>encAlgorithm = JWEConstants.A192CBC_HS384;<NEW_LINE>break;<NEW_LINE>case 32:<NEW_LINE>encAlgorithm = JWEConstants.A256CBC_HS512;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Bad size for Encryption key: " + aesKey + ". Valid sizes are 16, 24, 32.");<NEW_LINE>}<NEW_LINE>JWEHeader jweHeader = new JWEHeader(JWEConstants.DIR, encAlgorithm, null);<NEW_LINE>JWE jwe = new JWE().header<MASK><NEW_LINE>jwe.getKeyStorage().setCEKKey(aesKey, JWEKeyStorage.KeyUse.ENCRYPTION).setCEKKey(hmacKey, JWEKeyStorage.KeyUse.SIGNATURE);<NEW_LINE>return jwe.encodeJwe();<NEW_LINE>}
(jweHeader).content(contentBytes);
1,184,900
private void updatePorts(Instance instance) {<NEW_LINE>Direction facing = instance.getAttributeValue(StdAttr.FACING);<NEW_LINE>int dx = 0;<NEW_LINE>int dy = 0;<NEW_LINE>if (facing == Direction.NORTH) {<NEW_LINE>dy = 1;<NEW_LINE>} else if (facing == Direction.EAST) {<NEW_LINE>dx = -1;<NEW_LINE>} else if (facing == Direction.SOUTH) {<NEW_LINE>dy = -1;<NEW_LINE>} else if (facing == Direction.WEST) {<NEW_LINE>dx = 1;<NEW_LINE>}<NEW_LINE>Object powerLoc = instance.getAttributeValue(StdAttr.SELECT_LOC);<NEW_LINE>boolean flip = (facing == Direction.NORTH || facing == Direction.WEST) == (powerLoc == StdAttr.SELECT_TOP_RIGHT);<NEW_LINE>Port[] ports = new Port[3];<NEW_LINE>ports[OUTPUT] = new Port(0, 0, Port.OUTPUT, StdAttr.WIDTH);<NEW_LINE>ports[INPUT] = new Port(40 * dx, 40 * dy, <MASK><NEW_LINE>if (flip) {<NEW_LINE>ports[GATE] = new Port(20 * (dx + dy), 20 * (-dx + dy), Port.INPUT, 1);<NEW_LINE>} else {<NEW_LINE>ports[GATE] = new Port(20 * (dx - dy), 20 * (dx + dy), Port.INPUT, 1);<NEW_LINE>}<NEW_LINE>if (instance.getAttributeValue(ATTR_TYPE) == TYPE_P) {<NEW_LINE>ports[GATE].setToolTip(S.getter("transistorPGate"));<NEW_LINE>ports[INPUT].setToolTip(S.getter("transistorPSource"));<NEW_LINE>ports[OUTPUT].setToolTip(S.getter("transistorPDrain"));<NEW_LINE>} else {<NEW_LINE>ports[GATE].setToolTip(S.getter("transistorNGate"));<NEW_LINE>ports[INPUT].setToolTip(S.getter("transistorNSource"));<NEW_LINE>ports[OUTPUT].setToolTip(S.getter("transistorNDrain"));<NEW_LINE>}<NEW_LINE>instance.setPorts(ports);<NEW_LINE>}
Port.INPUT, StdAttr.WIDTH);
825,631
static void lookupCodeInfo(CodeInfo info, long ip, SimpleCodeInfoQueryResult codeInfoQueryResult) {<NEW_LINE>long sizeEncoding = initialSizeEncoding();<NEW_LINE>long entryIP = lookupEntryIP(ip);<NEW_LINE>long entryOffset = loadEntryOffset(info, ip);<NEW_LINE>do {<NEW_LINE>int entryFlags = loadEntryFlags(info, entryOffset);<NEW_LINE>sizeEncoding = updateSizeEncoding(info, entryOffset, entryFlags, sizeEncoding);<NEW_LINE>if (entryIP == ip) {<NEW_LINE>codeInfoQueryResult.setEncodedFrameSize(sizeEncoding);<NEW_LINE>codeInfoQueryResult.setExceptionOffset(loadExceptionOffset(info, entryOffset, entryFlags));<NEW_LINE>codeInfoQueryResult.setReferenceMapIndex(loadReferenceMapIndex(info, entryOffset, entryFlags));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>entryIP = advanceIP(info, entryOffset, entryIP);<NEW_LINE>entryOffset = advanceOffset(entryOffset, entryFlags);<NEW_LINE>} while (entryIP <= ip);<NEW_LINE>codeInfoQueryResult.setEncodedFrameSize(sizeEncoding);<NEW_LINE><MASK><NEW_LINE>codeInfoQueryResult.setReferenceMapIndex(ReferenceMapIndex.NO_REFERENCE_MAP);<NEW_LINE>}
codeInfoQueryResult.setExceptionOffset(CodeInfoQueryResult.NO_EXCEPTION_OFFSET);
1,052,083
private void fetchRequests(RequestRegistrationCallback<DeleteOperation> requestRegistrationCallback) {<NEW_LINE>Iterator<ReplicaId> replicaIterator = operationTracker.getReplicaIterator();<NEW_LINE>while (replicaIterator.hasNext()) {<NEW_LINE>ReplicaId replica = replicaIterator.next();<NEW_LINE>String hostname = replica.getDataNodeId().getHostname();<NEW_LINE>Port port = RouterUtils.getPortToConnectTo(replica, routerConfig.routerEnableHttp2NetworkClient);<NEW_LINE>DeleteRequest deleteRequest = createDeleteRequest();<NEW_LINE>deleteRequestInfos.put(deleteRequest.getCorrelationId(), new DeleteRequestInfo(time.milliseconds(), replica));<NEW_LINE>RequestInfo requestInfo = new RequestInfo(hostname, <MASK><NEW_LINE>requestRegistrationCallback.registerRequestToSend(this, requestInfo);<NEW_LINE>replicaIterator.remove();<NEW_LINE>if (RouterUtils.isRemoteReplica(routerConfig, replica)) {<NEW_LINE>logger.trace("Making request with correlationId {} to a remote replica {} in {} ", deleteRequest.getCorrelationId(), replica.getDataNodeId(), replica.getDataNodeId().getDatacenterName());<NEW_LINE>routerMetrics.crossColoRequestCount.inc();<NEW_LINE>} else {<NEW_LINE>logger.trace("Making request with correlationId {} to a local replica {} ", deleteRequest.getCorrelationId(), replica.getDataNodeId());<NEW_LINE>}<NEW_LINE>routerMetrics.getDataNodeBasedMetrics(replica.getDataNodeId()).deleteRequestRate.mark();<NEW_LINE>}<NEW_LINE>}
port, deleteRequest, replica, operationQuotaCharger);
812,661
// ////////////////////////////////////////////////////////////<NEW_LINE>// MASK<NEW_LINE>// @Override<NEW_LINE>// public void mask(int alpha[]) {<NEW_LINE>// PImage temp = get();<NEW_LINE>// temp.mask(alpha);<NEW_LINE>// set(0, 0, temp);<NEW_LINE>// }<NEW_LINE>@Override<NEW_LINE>public void mask(PImage alpha) {<NEW_LINE>updatePixelSize();<NEW_LINE>if (alpha.width != pixelWidth || alpha.height != pixelHeight) {<NEW_LINE>throw new RuntimeException("The PImage used with mask() must be " + "the same size as the applet.");<NEW_LINE>}<NEW_LINE>PGraphicsOpenGL ppg = getPrimaryPG();<NEW_LINE>if (ppg.maskShader == null) {<NEW_LINE>ppg.maskShader = new PShader(parent, defTextureShaderVertURL, maskShaderFragURL);<NEW_LINE>}<NEW_LINE>ppg.<MASK><NEW_LINE>filter(ppg.maskShader);<NEW_LINE>}
maskShader.set("mask", alpha);
834,396
public static void addPath(String path) throws MalformedURLException {<NEW_LINE>File file = new File(path);<NEW_LINE>// Ensure that directory URLs end in "/"<NEW_LINE>if (file.isDirectory() && !path.endsWith("/")) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>// $NON-NLS-1$<NEW_LINE>file = new File(path + "/");<NEW_LINE>}<NEW_LINE>// See Java bug 4496398<NEW_LINE>loader.addURL(file.toURI().toURL());<NEW_LINE>StringBuilder sb = new StringBuilder(System.getProperty(JAVA_CLASS_PATH));<NEW_LINE>sb.append(CLASSPATH_SEPARATOR);<NEW_LINE>sb.append(path);<NEW_LINE>File[] jars = listJars(file);<NEW_LINE>for (File jar : jars) {<NEW_LINE>// See Java bug 4496398<NEW_LINE>loader.addURL(jar.toURI().toURL());<NEW_LINE>sb.append(CLASSPATH_SEPARATOR);<NEW_LINE>sb.append(jar.getPath());<NEW_LINE>}<NEW_LINE>// ClassFinder needs this<NEW_LINE>System.setProperty(<MASK><NEW_LINE>}
JAVA_CLASS_PATH, sb.toString());
1,784,307
public Void visitTry(TryTree javacTree, Node javaParserNode) {<NEW_LINE>TryStmt node = castNode(TryStmt.class, javaParserNode, javacTree);<NEW_LINE>processTry(javacTree, node);<NEW_LINE>Iterator<? extends Tree> javacResources = javacTree.getResources().iterator();<NEW_LINE>for (Expression resource : node.getResources()) {<NEW_LINE>if (resource.isVariableDeclarationExpr()) {<NEW_LINE>for (VariableDeclarator declarator : resource.asVariableDeclarationExpr().getVariables()) {<NEW_LINE>assert javacResources.hasNext();<NEW_LINE>javacResources.next().accept(this, declarator);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>assert javacResources.hasNext();<NEW_LINE>javacResources.next().accept(this, resource);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>javacTree.getBlock().accept(<MASK><NEW_LINE>visitLists(javacTree.getCatches(), node.getCatchClauses());<NEW_LINE>visitOptional(javacTree.getFinallyBlock(), node.getFinallyBlock());<NEW_LINE>return null;<NEW_LINE>}
this, node.getTryBlock());
910,559
public InternalAggregation reduce(InternalAggregation aggregation, InternalAggregation.ReduceContext reduceContext) {<NEW_LINE>InternalMultiBucketAggregation<? extends InternalMultiBucketAggregation, ? extends InternalMultiBucketAggregation.InternalBucket> histo = (InternalMultiBucketAggregation<? extends InternalMultiBucketAggregation, <MASK><NEW_LINE>List<? extends InternalMultiBucketAggregation.InternalBucket> buckets = histo.getBuckets();<NEW_LINE>HistogramFactory factory = (HistogramFactory) histo;<NEW_LINE>List<MultiBucketsAggregation.Bucket> newBuckets = new ArrayList<>();<NEW_LINE>EvictingQueue<Double> values = new EvictingQueue<>(this.window);<NEW_LINE>// Initialize the script<NEW_LINE>MovingFunctionScript.Factory scriptFactory = reduceContext.scriptService().compile(script, MovingFunctionScript.CONTEXT);<NEW_LINE>Map<String, Object> vars = new HashMap<>();<NEW_LINE>if (script.getParams() != null) {<NEW_LINE>vars.putAll(script.getParams());<NEW_LINE>}<NEW_LINE>MovingFunctionScript executableScript = scriptFactory.newInstance();<NEW_LINE>for (InternalMultiBucketAggregation.InternalBucket bucket : buckets) {<NEW_LINE>Double thisBucketValue = resolveBucketValue(histo, bucket, bucketsPaths()[0], gapPolicy);<NEW_LINE>// Default is to reuse existing bucket. Simplifies the rest of the logic,<NEW_LINE>// since we only change newBucket if we can add to it<NEW_LINE>MultiBucketsAggregation.Bucket newBucket = bucket;<NEW_LINE>if (thisBucketValue != null && thisBucketValue.equals(Double.NaN) == false) {<NEW_LINE>// The custom context mandates that the script returns a double (not Double) so we<NEW_LINE>// don't need null checks, etc.<NEW_LINE>double movavg = executableScript.execute(vars, values.stream().mapToDouble(Double::doubleValue).toArray());<NEW_LINE>List<InternalAggregation> aggs = StreamSupport.stream(bucket.getAggregations().spliterator(), false).map(InternalAggregation.class::cast).collect(Collectors.toList());<NEW_LINE>aggs.add(new InternalSimpleValue(name(), movavg, formatter, new ArrayList<>(), metaData()));<NEW_LINE>newBucket = factory.createBucket(factory.getKey(bucket), bucket.getDocCount(), new InternalAggregations(aggs));<NEW_LINE>values.offer(thisBucketValue);<NEW_LINE>}<NEW_LINE>newBuckets.add(newBucket);<NEW_LINE>}<NEW_LINE>return factory.createAggregation(newBuckets);<NEW_LINE>}
? extends InternalMultiBucketAggregation.InternalBucket>) aggregation;
477,830
protected AbstractBeanDefinition parseConsumer(Element element, ParserContext parserContext) {<NEW_LINE>BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(MailSendingMessageHandler.class);<NEW_LINE>String mailSenderRef = element.getAttribute("mail-sender");<NEW_LINE>String host = element.getAttribute("host");<NEW_LINE>boolean hasHost = StringUtils.hasText(host);<NEW_LINE>String port = element.getAttribute("port");<NEW_LINE>String username = element.getAttribute("username");<NEW_LINE>String password = element.getAttribute("password");<NEW_LINE>String javaMailProperties = element.getAttribute("java-mail-properties");<NEW_LINE>boolean hasJavaMailProperties = StringUtils.hasText(javaMailProperties);<NEW_LINE>if (StringUtils.hasText(mailSenderRef)) {<NEW_LINE>Assert.isTrue(!hasHost && !StringUtils.hasText(username) && !StringUtils.hasText(password), "The 'host', 'username', and 'password' properties " + "should not be provided when using a 'mail-sender' reference.");<NEW_LINE>builder.addConstructorArgReference(mailSenderRef);<NEW_LINE>} else {<NEW_LINE>Assert.isTrue(!hasHost || !hasJavaMailProperties, "Either a 'mail-sender' or 'java-mail-properties' reference or 'host' property is required.");<NEW_LINE>BeanDefinitionBuilder mailSenderBuilder = BeanDefinitionBuilder.genericBeanDefinition(JavaMailSenderImpl.class);<NEW_LINE>if (hasHost) {<NEW_LINE>mailSenderBuilder.addPropertyValue("host", host);<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(username)) {<NEW_LINE>mailSenderBuilder.addPropertyValue("username", username);<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(password)) {<NEW_LINE>mailSenderBuilder.addPropertyValue("password", password);<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(port)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (hasJavaMailProperties) {<NEW_LINE>mailSenderBuilder.addPropertyReference("javaMailProperties", javaMailProperties);<NEW_LINE>}<NEW_LINE>String mailSenderBeanName = BeanDefinitionReaderUtils.registerWithGeneratedName(mailSenderBuilder.getBeanDefinition(), parserContext.getRegistry());<NEW_LINE>builder.addConstructorArgReference(mailSenderBeanName);<NEW_LINE>}<NEW_LINE>return builder.getBeanDefinition();<NEW_LINE>}
mailSenderBuilder.addPropertyValue("port", port);
1,112,381
private Mono<Response<UploadCertificateResponseInner>> uploadCertificateWithResponseAsync(String deviceName, String resourceGroupName, UploadCertificateRequest parameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (deviceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.<MASK><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.uploadCertificate(this.client.getEndpoint(), deviceName, this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), parameters, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
1,630,343
public boolean visit(SQLSubqueryTableSource x) {<NEW_LINE>sqlNode = convertToSqlNode(x.getSelect());<NEW_LINE>final String alias = x.getAlias();<NEW_LINE>if (alias != null) {<NEW_LINE>SqlIdentifier aliasIdentifier = new SqlIdentifier(alias, SqlParserPos.ZERO);<NEW_LINE>List<SQLName> columns = x.getColumns();<NEW_LINE>SqlNode[] operands;<NEW_LINE>if (columns.size() == 0) {<NEW_LINE>operands = new SqlNode[] { sqlNode, aliasIdentifier };<NEW_LINE>} else {<NEW_LINE>operands = new SqlNode[<MASK><NEW_LINE>operands[0] = sqlNode;<NEW_LINE>operands[1] = aliasIdentifier;<NEW_LINE>for (int i = 0; i < columns.size(); i++) {<NEW_LINE>SQLName column = columns.get(i);<NEW_LINE>operands[i + 2] = new SqlIdentifier(SQLUtils.normalize(column.getSimpleName()), SqlParserPos.ZERO);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sqlNode = new SqlBasicCall(SqlStdOperatorTable.AS, operands, SqlParserPos.ZERO);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
columns.size() + 2];
454,834
private int distance(TagSet base, TagSet set, TagSetEncoder encoder) {<NEW_LINE>int cost = 0;<NEW_LINE>int nb = 0;<NEW_LINE>int ns = 0;<NEW_LINE>while (nb < base.tags.length && ns < set.tags.length) {<NEW_LINE>int c = base.tags[nb].compareTo(set.tags[ns]);<NEW_LINE>if (c == 0) {<NEW_LINE>++nb;<NEW_LINE>++ns;<NEW_LINE>} else if (c < 0) {<NEW_LINE>cost += encoder.cost(base.tags[nb].key, base.tags[nb].tag);<NEW_LINE>++nb;<NEW_LINE>} else {<NEW_LINE>cost += encoder.cost(set.tags[ns].key, set.tags[ns].tag);<NEW_LINE>++ns;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>while (nb < base.tags.length) {<NEW_LINE>cost += encoder.cost(base.tags[nb].key, base<MASK><NEW_LINE>++nb;<NEW_LINE>}<NEW_LINE>while (ns < set.tags.length) {<NEW_LINE>cost += encoder.cost(set.tags[ns].key, set.tags[ns].tag);<NEW_LINE>++ns;<NEW_LINE>}<NEW_LINE>return cost;<NEW_LINE>}
.tags[nb].tag);
940,602
private void createDefaultConversionTypes() {<NEW_LINE>Adempiere.assertUnitTestMode();<NEW_LINE>final Properties ctx = Env.getCtx();<NEW_LINE>for (final ConversionTypeMethod type : ConversionTypeMethod.values()) {<NEW_LINE>final I_C_ConversionType conversionType = InterfaceWrapperHelper.create(ctx, I_C_ConversionType.class, ITrx.TRXNAME_None);<NEW_LINE>InterfaceWrapperHelper.setValue(conversionType, I_C_ConversionType.COLUMNNAME_AD_Client_ID, Env.CTXVALUE_AD_Client_ID_System);<NEW_LINE>conversionType.setAD_Org_ID(Env.CTXVALUE_AD_Org_ID_System);<NEW_LINE>conversionType.<MASK><NEW_LINE>conversionType.setName(type.toString());<NEW_LINE>InterfaceWrapperHelper.save(conversionType);<NEW_LINE>if (type == ConversionTypeMethod.Spot) {<NEW_LINE>final I_C_ConversionType_Default conversionTypeDefault = InterfaceWrapperHelper.newInstance(I_C_ConversionType_Default.class, conversionType, true);<NEW_LINE>conversionTypeDefault.setC_ConversionType(conversionType);<NEW_LINE>conversionTypeDefault.setValidFrom(TimeUtil.getDay(1970, 1, 1));<NEW_LINE>InterfaceWrapperHelper.save(conversionTypeDefault);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
setValue(type.getCode());
68,740
public void keyPressed(java.awt.event.KeyEvent e) {<NEW_LINE>if (changingPage)<NEW_LINE>return;<NEW_LINE>int deltaPage = 0;<NEW_LINE>int keyCode = e.getKeyCode();<NEW_LINE>if (keyCode == java.awt.event.KeyEvent.VK_PAGE_DOWN) {<NEW_LINE>deltaPage = documentView.getPreviousPageIncrement();<NEW_LINE>} else if (keyCode == java.awt.event.KeyEvent.VK_PAGE_UP) {<NEW_LINE>deltaPage = -documentView.getNextPageIncrement();<NEW_LINE>} else if (keyCode == java.awt.event.KeyEvent.VK_HOME) {<NEW_LINE>deltaPage = -controller.getCurrentPageNumber();<NEW_LINE>} else if (keyCode == java.awt.event.KeyEvent.VK_END) {<NEW_LINE>deltaPage = controller.getDocument().getNumberOfPages() - controller.getCurrentPageNumber() - 1;<NEW_LINE>}<NEW_LINE>if (deltaPage == 0)<NEW_LINE>return;<NEW_LINE>int newPage = controller.getCurrentPageNumber() + deltaPage;<NEW_LINE>if (controller.getDocument() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (newPage < 0) {<NEW_LINE>deltaPage = -controller.getCurrentPageNumber();<NEW_LINE>}<NEW_LINE>if (newPage >= controller.getDocument().getNumberOfPages()) {<NEW_LINE>deltaPage = controller.getDocument().getNumberOfPages() <MASK><NEW_LINE>}<NEW_LINE>changingPage = true;<NEW_LINE>final int dp = deltaPage;<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>changingPage = false;<NEW_LINE>controller.goToDeltaPage(dp);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
- controller.getCurrentPageNumber() - 1;
1,718,256
public ProcessStatus restWriteSetting(final PwmRequest pwmRequest) throws PwmUnrecoverableException, IOException {<NEW_LINE>final String profileID = "default";<NEW_LINE>final String settingKey = pwmRequest.readParameterAsString("key");<NEW_LINE>final String bodyString = pwmRequest.readRequestBodyAsString();<NEW_LINE>final PwmSetting pwmSetting = PwmSetting.forKey(settingKey).orElseThrow(() -> new IllegalStateException("invalid setting parameter value"));<NEW_LINE>final ConfigGuideBean configGuideBean = getBean(pwmRequest);<NEW_LINE>final StoredConfiguration storedConfiguration = ConfigGuideForm.generateStoredConfig(configGuideBean);<NEW_LINE>final StoredConfigKey key = StoredConfigKey.forSetting(pwmSetting, profileID, DomainID.DOMAIN_ID_DEFAULT);<NEW_LINE>final LinkedHashMap<String, Object> returnMap = new LinkedHashMap<>();<NEW_LINE>try {<NEW_LINE>final StoredValue storedValue = ValueFactory.fromJson(pwmSetting, bodyString);<NEW_LINE>final List<String> errorMsgs = storedValue.validateValue(pwmSetting);<NEW_LINE>if (errorMsgs != null && !errorMsgs.isEmpty()) {<NEW_LINE>returnMap.put("errorMessage", pwmSetting.getLabel(pwmRequest.getLocale()) + ": " + errorMsgs.get(0));<NEW_LINE>}<NEW_LINE>if (pwmSetting == PwmSetting.CHALLENGE_RANDOM_CHALLENGES) {<NEW_LINE>configGuideBean.getFormData().put(ConfigGuideFormField.CHALLENGE_RESPONSE_DATA, JsonFactory.get().serialize((Serializable) storedValue.toNativeObject()));<NEW_LINE>}<NEW_LINE>} catch (final Exception e) {<NEW_LINE>final String errorMsg = "error writing default value for setting " + pwmSetting + ", error: " + e.getMessage();<NEW_LINE>LOGGER.error(() -> errorMsg, e);<NEW_LINE>throw new IllegalStateException(errorMsg, e);<NEW_LINE>}<NEW_LINE>returnMap.put("key", settingKey);<NEW_LINE>returnMap.put("category", pwmSetting.<MASK><NEW_LINE>returnMap.put("syntax", pwmSetting.getSyntax().toString());<NEW_LINE>returnMap.put("isDefault", StoredConfigurationUtil.isDefaultValue(storedConfiguration, key));<NEW_LINE>pwmRequest.outputJsonResult(RestResultBean.withData(returnMap, Map.class));<NEW_LINE>return ProcessStatus.Halt;<NEW_LINE>}
getCategory().toString());
1,564,193
public double updateJacobiWeight(final double[] gradients, final double[] lastGradient, final int index) {<NEW_LINE>// multiply the current and previous gradient, and take the<NEW_LINE>// sign. We want to see if the gradient has changed its sign.<NEW_LINE>final int change = EncogMath.sign(gradients[index] * lastGradient[index]);<NEW_LINE>double weightChange = 0;<NEW_LINE>// if the gradient has retained its sign, then we increase the<NEW_LINE>// delta so that it will converge faster<NEW_LINE>double delta = this.updateValues[index];<NEW_LINE>if (change > 0) {<NEW_LINE>delta = this.<MASK><NEW_LINE>delta = Math.min(delta, this.maxStep);<NEW_LINE>weightChange = EncogMath.sign(gradients[index]) * delta;<NEW_LINE>this.updateValues[index] = delta;<NEW_LINE>lastGradient[index] = gradients[index];<NEW_LINE>} else if (change < 0) {<NEW_LINE>// if change<0, then the sign has changed, and the last<NEW_LINE>// delta was too big<NEW_LINE>delta = this.updateValues[index] * RPROPConst.NEGATIVE_ETA;<NEW_LINE>delta = Math.max(delta, RPROPConst.DELTA_MIN);<NEW_LINE>this.updateValues[index] = delta;<NEW_LINE>weightChange = -this.lastWeightChange[index];<NEW_LINE>// set the previous gradient to zero so that there will be no<NEW_LINE>// adjustment the next iteration<NEW_LINE>lastGradient[index] = 0;<NEW_LINE>} else if (change == 0) {<NEW_LINE>// if change==0 then there is no change to the delta<NEW_LINE>delta = this.updateValues[index];<NEW_LINE>weightChange = EncogMath.sign(gradients[index]) * delta;<NEW_LINE>lastGradient[index] = gradients[index];<NEW_LINE>}<NEW_LINE>if (this.getError() > this.lastError) {<NEW_LINE>weightChange = (1 / (2 * q)) * delta;<NEW_LINE>q++;<NEW_LINE>} else {<NEW_LINE>q = 1;<NEW_LINE>}<NEW_LINE>// apply the weight change, if any<NEW_LINE>return weightChange;<NEW_LINE>}
updateValues[index] * RPROPConst.POSITIVE_ETA;
51,447
private void garbageCollectionMetrics(MetricRegistry registry) {<NEW_LINE>List<GarbageCollectorMXBean> gcs = ManagementFactory.getGarbageCollectorMXBeans();<NEW_LINE>if (gcs.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Metadata countMetadata = Metadata.builder().withName("gc.total").withType(MetricType.COUNTER).withDisplayName("Garbage Collection Count").withUnit("none").<MASK><NEW_LINE>Metadata timeMetadata = Metadata.builder().withName("gc.time").withType(MetricType.COUNTER).withDisplayName("Garbage Collection Time").withUnit("milliseconds").withDescription("Displays the approximate accumulated collection elapsed time in milliseconds. This attribute " + "displays -1 if the collection elapsed time is undefined for this collector. The Java " + "virtual machine implementation may use a high resolution timer to measure the " + "elapsed time. This attribute may display the same value even if the collection " + "count has been incremented if the collection elapsed time is very short.").build();<NEW_LINE>for (GarbageCollectorMXBean gc : gcs) {<NEW_LINE>registry.register(countMetadata, new GetCountOnlyCounter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public long getCount() {<NEW_LINE>return gc.getCollectionCount();<NEW_LINE>}<NEW_LINE>}, new Tag("name", gc.getName()));<NEW_LINE>registry.register(timeMetadata, new GetCountOnlyCounter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public long getCount() {<NEW_LINE>return gc.getCollectionTime();<NEW_LINE>}<NEW_LINE>}, new Tag("name", gc.getName()));<NEW_LINE>}<NEW_LINE>}
withDescription("Displays the total number of collections that have occurred. This attribute lists -1 if the collection count is undefined for this collector.").build();
393,296
private static void mergeResults(Map<String, Response> remoteResponses, List<ResolvedIndex> indices, List<ResolvedAlias> aliases, List<ResolvedDataStream> dataStreams) {<NEW_LINE>for (Map.Entry<String, Response> responseEntry : remoteResponses.entrySet()) {<NEW_LINE>String clusterAlias = responseEntry.getKey();<NEW_LINE>Response response = responseEntry.getValue();<NEW_LINE>for (ResolvedIndex index : response.indices) {<NEW_LINE>indices.add(index.copy(RemoteClusterAware.buildRemoteIndexName(clusterAlias, index.getName())));<NEW_LINE>}<NEW_LINE>for (ResolvedAlias alias : response.aliases) {<NEW_LINE>aliases.add(alias.copy(RemoteClusterAware.buildRemoteIndexName(clusterAlias, alias.getName())));<NEW_LINE>}<NEW_LINE>for (ResolvedDataStream dataStream : response.dataStreams) {<NEW_LINE>dataStreams.add(dataStream.copy(RemoteClusterAware.buildRemoteIndexName(clusterAlias, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
dataStream.getName())));
1,018,771
public OffsetStorageInfo loadOffset(String group, String topic, int partitionId) {<NEW_LINE>String zkNode = new StringBuilder(512).append(this.consumerZkDir).append("/").append(group).append("/offsets/").append(topic).append("/").append(brokerId).append(TokenConstants.HYPHEN).append(partitionId).toString();<NEW_LINE>String offsetZkInfo;<NEW_LINE>try {<NEW_LINE>offsetZkInfo = ZKUtil.<MASK><NEW_LINE>} catch (KeeperException e) {<NEW_LINE>BrokerSrvStatsHolder.incZKExcCnt();<NEW_LINE>logger.error("KeeperException during load offsets from ZooKeeper", e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (offsetZkInfo == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String[] offsetInfoStrs = offsetZkInfo.split(TokenConstants.HYPHEN);<NEW_LINE>return new OffsetStorageInfo(topic, brokerId, partitionId, Long.parseLong(offsetInfoStrs[1]), Long.parseLong(offsetInfoStrs[0]), false);<NEW_LINE>}
readDataMaybeNull(this.zkw, zkNode);
1,694,350
private void resend() {<NEW_LINE>log.info("Resend message, info: {}", this.toString());<NEW_LINE>// Gradually increase the resend interval.<NEW_LINE>try {<NEW_LINE>Thread.sleep(Math.min(this.resendCount++ * 100, 60 * 1000));<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>MessageExt msgExt = ScheduleMessageService.this.defaultMessageStore.lookMessageByOffset(this.physicOffset, this.physicSize);<NEW_LINE>if (msgExt == null) {<NEW_LINE>log.warn("ScheduleMessageService resend not found message. info: {}", this.toString());<NEW_LINE>this.status = need2Skip() ? ProcessStatus.SKIP : ProcessStatus.EXCEPTION;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MessageExtBrokerInner msgInner = ScheduleMessageService.this.messageTimeup(msgExt);<NEW_LINE>PutMessageResult result = ScheduleMessageService.this.writeMessageStore.putMessage(msgInner);<NEW_LINE>this.handleResult(result);<NEW_LINE>if (result != null && result.getPutMessageStatus() == PutMessageStatus.PUT_OK) {<NEW_LINE>log.info(<MASK><NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>this.status = ProcessStatus.EXCEPTION;<NEW_LINE>log.error("Resend message error, info: {}", this.toString(), e);<NEW_LINE>}<NEW_LINE>}
"Resend message success, info: {}", this.toString());
1,287,940
public EnableSharingWithAwsOrganizationResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>EnableSharingWithAwsOrganizationResult enableSharingWithAwsOrganizationResult = new EnableSharingWithAwsOrganizationResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return enableSharingWithAwsOrganizationResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("returnValue", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>enableSharingWithAwsOrganizationResult.setReturnValue(context.getUnmarshaller(Boolean.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return enableSharingWithAwsOrganizationResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
158,055
public void executeOrFail(DependencyCarrier dependencies, PlannerContext plannerContext, RowConsumer consumer, Row parameters, SubQueryResults subQueryResults) {<NEW_LINE>if (analysis.tables().isEmpty()) {<NEW_LINE>consumer.accept(InMemoryBatchIterator.empty(SENTINEL), null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Function<? super Symbol, Object> eval = x -> SymbolEvaluator.evaluate(plannerContext.transactionContext(), plannerContext.nodeContext(), x, parameters, subQueryResults);<NEW_LINE>ArrayList<String> toRefresh = new ArrayList<>();<NEW_LINE>for (Map.Entry<Table<Symbol>, DocTableInfo> table : analysis.tables().entrySet()) {<NEW_LINE>var tableInfo = table.getValue();<NEW_LINE><MASK><NEW_LINE>if (tableSymbol.partitionProperties().isEmpty()) {<NEW_LINE>toRefresh.addAll(Arrays.asList(tableInfo.concreteOpenIndices()));<NEW_LINE>} else {<NEW_LINE>var partitionName = toPartitionName(tableInfo, Lists2.map(tableSymbol.partitionProperties(), p -> p.map(eval)));<NEW_LINE>if (!tableInfo.partitions().contains(partitionName)) {<NEW_LINE>throw new PartitionUnknownException(partitionName);<NEW_LINE>}<NEW_LINE>toRefresh.add(partitionName.asIndexName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>RefreshRequest request = new RefreshRequest(toRefresh.toArray(String[]::new));<NEW_LINE>request.indicesOptions(IndicesOptions.lenientExpandOpen());<NEW_LINE>var transportRefreshAction = dependencies.transportActionProvider().transportRefreshAction();<NEW_LINE>transportRefreshAction.execute(request, new OneRowActionListener<>(consumer, response -> new Row1(toRefresh.isEmpty() ? -1L : (long) toRefresh.size())));<NEW_LINE>}
var tableSymbol = table.getKey();
121,784
private static void putPositiveLongAscii(final byte[] dest, final int offset, final long value, final int digitCount) {<NEW_LINE>long quotient = value;<NEW_LINE>int i = digitCount;<NEW_LINE>while (quotient >= 100_000_000) {<NEW_LINE>final int lastEightDigits = (int) (quotient % 100_000_000);<NEW_LINE>quotient /= 100_000_000;<NEW_LINE>final int upperPart = lastEightDigits / 10_000;<NEW_LINE>final int lowerPart = lastEightDigits % 10_000;<NEW_LINE>final int u1 = (upperPart / 100) << 1;<NEW_LINE>final int u2 = (upperPart % 100) << 1;<NEW_LINE>final int l1 = (lowerPart / 100) << 1;<NEW_LINE>final int l2 = (lowerPart % 100) << 1;<NEW_LINE>i -= 8;<NEW_LINE>dest[offset + i] = ASCII_DIGITS[u1];<NEW_LINE>dest[offset + i + 1] = ASCII_DIGITS[u1 + 1];<NEW_LINE>dest[offset + i <MASK><NEW_LINE>dest[offset + i + 3] = ASCII_DIGITS[u2 + 1];<NEW_LINE>dest[offset + i + 4] = ASCII_DIGITS[l1];<NEW_LINE>dest[offset + i + 5] = ASCII_DIGITS[l1 + 1];<NEW_LINE>dest[offset + i + 6] = ASCII_DIGITS[l2];<NEW_LINE>dest[offset + i + 7] = ASCII_DIGITS[l2 + 1];<NEW_LINE>}<NEW_LINE>putPositiveIntAscii(dest, offset, (int) quotient, i);<NEW_LINE>}
+ 2] = ASCII_DIGITS[u2];
1,447,043
public void bind(@NonNull DcMsg messageResult, @NonNull GlideRequests glideRequests, @NonNull Locale locale, @Nullable String highlightSubstring) {<NEW_LINE>DcContext dcContext = DcHelper.getContext(getContext());<NEW_LINE>DcContact sender = dcContext.getContact(messageResult.getFromId());<NEW_LINE>this.selectedThreads = Collections.emptySet();<NEW_LINE>Recipient recipient = new Recipient(getContext(), sender);<NEW_LINE>this.glideRequests = glideRequests;<NEW_LINE>fromView.setText(recipient, true);<NEW_LINE>fromView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);<NEW_LINE>subjectView.setText(getHighlightedSpan(locale, messageResult.getSummarytext(512), highlightSubstring));<NEW_LINE><MASK><NEW_LINE>if (timestamp > 0) {<NEW_LINE>dateView.setText(DateUtils.getBriefRelativeTimeSpanString(getContext(), locale, messageResult.getTimestamp()));<NEW_LINE>} else {<NEW_LINE>dateView.setText("");<NEW_LINE>}<NEW_LINE>dateView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);<NEW_LINE>archivedBadgeView.setVisibility(GONE);<NEW_LINE>requestBadgeView.setVisibility(GONE);<NEW_LINE>unreadIndicator.setVisibility(GONE);<NEW_LINE>deliveryStatusIndicator.setNone();<NEW_LINE>setBatchState(false);<NEW_LINE>contactPhotoImage.setAvatar(glideRequests, recipient, false);<NEW_LINE>}
long timestamp = messageResult.getTimestamp();
1,554,962
static Object toJsonCompatibleSnapshot(BucketState state, Version backwardCompatibilityVersion) throws IOException {<NEW_LINE>switch(state.getMathType()) {<NEW_LINE>case INTEGER_64_BITS:<NEW_LINE>{<NEW_LINE>Map<String, Object> result = BucketState64BitsInteger.SERIALIZATION_HANDLE.toJsonCompatibleSnapshot((BucketState64BitsInteger) state, backwardCompatibilityVersion);<NEW_LINE>result.put("type", BucketState64BitsInteger.SERIALIZATION_HANDLE.getTypeName());<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>case IEEE_754:<NEW_LINE>{<NEW_LINE>Map<String, Object> result = BucketStateIEEE754.SERIALIZATION_HANDLE.toJsonCompatibleSnapshot((BucketStateIEEE754) state, backwardCompatibilityVersion);<NEW_LINE>result.put("type", <MASK><NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>throw new IOException("Unknown mathType=" + state.getMathType());<NEW_LINE>}<NEW_LINE>}
BucketStateIEEE754.SERIALIZATION_HANDLE.getTypeName());
1,196,798
public void startPollLoop(ShutdownContext context, LaunchMode launchMode) {<NEW_LINE>AbstractLambdaPollLoop loop = new AbstractLambdaPollLoop(AmazonLambdaMapperRecorder.objectMapper, AmazonLambdaMapperRecorder.cognitoIdReader, AmazonLambdaMapperRecorder.clientCtxReader, launchMode) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected Object processRequest(Object input, AmazonLambdaContext context) throws Exception {<NEW_LINE>RequestHandler handler = beanContainer.instance(handlerClass);<NEW_LINE>return handler.handleRequest(input, context);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected LambdaInputReader getInputReader() {<NEW_LINE>return objectReader;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected LambdaOutputWriter getOutputWriter() {<NEW_LINE>return objectWriter;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected boolean isStream() {<NEW_LINE>return streamHandlerClass != null;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void processRequest(InputStream input, OutputStream output, AmazonLambdaContext context) throws Exception {<NEW_LINE>RequestStreamHandler handler = beanContainer.instance(streamHandlerClass);<NEW_LINE>handler.<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected boolean shouldLog(Exception e) {<NEW_LINE>return expectedExceptionClasses.stream().noneMatch(clazz -> clazz.isAssignableFrom(e.getClass()));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>loop.startPollLoop(context);<NEW_LINE>}
handleRequest(input, output, context);
791,051
public void write(Configuration config) throws IOException {<NEW_LINE>pp.startDocument();<NEW_LINE>pp.startElement("duke", null);<NEW_LINE>// FIXME: here we should write the objects, but that's not<NEW_LINE>// possible with the current API. we don't need that for the<NEW_LINE>// genetic algorithm at the moment, but it would be useful.<NEW_LINE>pp.startElement("schema", null);<NEW_LINE>writeElement("threshold", "" + config.getThreshold());<NEW_LINE>if (config.getMaybeThreshold() != 0.0)<NEW_LINE>writeElement("maybe-threshold", "" + config.getMaybeThreshold());<NEW_LINE>for (Property p : config.getProperties()) writeProperty(p);<NEW_LINE>pp.endElement("schema");<NEW_LINE>String dbclass = config.getDatabase(false).getClass().getName();<NEW_LINE>AttributeListImpl atts = new AttributeListImpl();<NEW_LINE>atts.addAttribute("class", "CDATA", dbclass);<NEW_LINE>pp.startElement("database", atts);<NEW_LINE>pp.endElement("database");<NEW_LINE>if (config.isDeduplicationMode())<NEW_LINE>for (DataSource src : config.getDataSources()) writeDataSource(src);<NEW_LINE>else {<NEW_LINE><MASK><NEW_LINE>for (DataSource src : config.getDataSources(1)) writeDataSource(src);<NEW_LINE>pp.endElement("group");<NEW_LINE>pp.startElement("group", null);<NEW_LINE>for (DataSource src : config.getDataSources(2)) writeDataSource(src);<NEW_LINE>pp.endElement("group");<NEW_LINE>}<NEW_LINE>pp.endElement("duke");<NEW_LINE>pp.endDocument();<NEW_LINE>}
pp.startElement("group", null);
784,743
public static DescribeDomainRealTimeHttpCodeDataResponse unmarshall(DescribeDomainRealTimeHttpCodeDataResponse describeDomainRealTimeHttpCodeDataResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDomainRealTimeHttpCodeDataResponse.setRequestId(_ctx.stringValue("DescribeDomainRealTimeHttpCodeDataResponse.RequestId"));<NEW_LINE>describeDomainRealTimeHttpCodeDataResponse.setDomainName(_ctx.stringValue("DescribeDomainRealTimeHttpCodeDataResponse.DomainName"));<NEW_LINE>describeDomainRealTimeHttpCodeDataResponse.setStartTime<MASK><NEW_LINE>describeDomainRealTimeHttpCodeDataResponse.setEndTime(_ctx.stringValue("DescribeDomainRealTimeHttpCodeDataResponse.EndTime"));<NEW_LINE>describeDomainRealTimeHttpCodeDataResponse.setDataInterval(_ctx.stringValue("DescribeDomainRealTimeHttpCodeDataResponse.DataInterval"));<NEW_LINE>List<UsageData> realTimeHttpCodeData = new ArrayList<UsageData>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDomainRealTimeHttpCodeDataResponse.RealTimeHttpCodeData.Length"); i++) {<NEW_LINE>UsageData usageData = new UsageData();<NEW_LINE>usageData.setTimeStamp(_ctx.stringValue("DescribeDomainRealTimeHttpCodeDataResponse.RealTimeHttpCodeData[" + i + "].TimeStamp"));<NEW_LINE>List<RealTimeCodeProportionData> value = new ArrayList<RealTimeCodeProportionData>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeDomainRealTimeHttpCodeDataResponse.RealTimeHttpCodeData[" + i + "].Value.Length"); j++) {<NEW_LINE>RealTimeCodeProportionData realTimeCodeProportionData = new RealTimeCodeProportionData();<NEW_LINE>realTimeCodeProportionData.setCode(_ctx.stringValue("DescribeDomainRealTimeHttpCodeDataResponse.RealTimeHttpCodeData[" + i + "].Value[" + j + "].Code"));<NEW_LINE>realTimeCodeProportionData.setProportion(_ctx.stringValue("DescribeDomainRealTimeHttpCodeDataResponse.RealTimeHttpCodeData[" + i + "].Value[" + j + "].Proportion"));<NEW_LINE>realTimeCodeProportionData.setCount(_ctx.stringValue("DescribeDomainRealTimeHttpCodeDataResponse.RealTimeHttpCodeData[" + i + "].Value[" + j + "].Count"));<NEW_LINE>value.add(realTimeCodeProportionData);<NEW_LINE>}<NEW_LINE>usageData.setValue(value);<NEW_LINE>realTimeHttpCodeData.add(usageData);<NEW_LINE>}<NEW_LINE>describeDomainRealTimeHttpCodeDataResponse.setRealTimeHttpCodeData(realTimeHttpCodeData);<NEW_LINE>return describeDomainRealTimeHttpCodeDataResponse;<NEW_LINE>}
(_ctx.stringValue("DescribeDomainRealTimeHttpCodeDataResponse.StartTime"));
40,453
protected static <T> T newInstance(String className, String type) throws JetException {<NEW_LINE>try {<NEW_LINE>Class<?> clazz = Thread.currentThread().getContextClassLoader().loadClass(className);<NEW_LINE>return (T) clazz<MASK><NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>throw new JetException(String.format("%s class %s not found", type, className));<NEW_LINE>} catch (InstantiationException e) {<NEW_LINE>throw new JetException(String.format("%s class %s can't be instantiated", type, className));<NEW_LINE>} catch (IllegalArgumentException | NoSuchMethodException e) {<NEW_LINE>throw new JetException(String.format("%s class %s has no default constructor", type, className));<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>throw new JetException(String.format("Default constructor of %s class %s is not accessible", type, className));<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>throw new JetException(String.format("%s class %s failed on construction: %s", type, className, e.getMessage()));<NEW_LINE>}<NEW_LINE>}
.getConstructor().newInstance();
1,843,604
private void refreshUI() {<NEW_LINE><MASK><NEW_LINE>if (index < 0) {<NEW_LINE>// no category selected<NEW_LINE>cbForeground.setEnabled(false);<NEW_LINE>cbBackground.setEnabled(false);<NEW_LINE>cbEffectColor.setEnabled(false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>cbForeground.setEnabled(true);<NEW_LINE>cbBackground.setEnabled(true);<NEW_LINE>cbEffectColor.setEnabled(true);<NEW_LINE>listen = false;<NEW_LINE>// set defaults<NEW_LINE>AttributeSet defAs = getDefaultColoring();<NEW_LINE>if (defAs != null) {<NEW_LINE>Color inheritedForeground = (Color) defAs.getAttribute(StyleConstants.Foreground);<NEW_LINE>if (inheritedForeground == null) {<NEW_LINE>inheritedForeground = Color.black;<NEW_LINE>}<NEW_LINE>ColorComboBoxSupport.setInheritedColor((ColorComboBox) cbForeground, inheritedForeground);<NEW_LINE>Color inheritedBackground = (Color) defAs.getAttribute(StyleConstants.Background);<NEW_LINE>if (inheritedBackground == null) {<NEW_LINE>inheritedBackground = Color.white;<NEW_LINE>}<NEW_LINE>ColorComboBoxSupport.setInheritedColor((ColorComboBox) cbBackground, inheritedBackground);<NEW_LINE>}<NEW_LINE>// set values<NEW_LINE>List<AttributeSet> annotations = getAnnotations(currentScheme);<NEW_LINE>AttributeSet c = annotations.get(index);<NEW_LINE>ColorComboBoxSupport.setSelectedColor((ColorComboBox) cbForeground, (Color) c.getAttribute(StyleConstants.Foreground));<NEW_LINE>ColorComboBoxSupport.setSelectedColor((ColorComboBox) cbBackground, (Color) c.getAttribute(StyleConstants.Background));<NEW_LINE>if (c.getAttribute(EditorStyleConstants.WaveUnderlineColor) != null) {<NEW_LINE>cbEffects.setSelectedIndex(1);<NEW_LINE>cbEffectColor.setEnabled(true);<NEW_LINE>((ColorComboBox) cbEffectColor).setSelectedColor((Color) c.getAttribute(EditorStyleConstants.WaveUnderlineColor));<NEW_LINE>} else {<NEW_LINE>cbEffects.setSelectedIndex(0);<NEW_LINE>cbEffectColor.setEnabled(false);<NEW_LINE>cbEffectColor.setSelectedIndex(-1);<NEW_LINE>}<NEW_LINE>listen = true;<NEW_LINE>}
int index = lCategories.getSelectedIndex();
781,791
final UpdateServiceResult executeUpdateService(UpdateServiceRequest updateServiceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateServiceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateServiceRequest> request = null;<NEW_LINE>Response<UpdateServiceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateServiceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateServiceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "ECS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateService");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateServiceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateServiceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
405,509
public void unsafeElementTypeConversion(Expression expression, TypeBinding expressionType, TypeBinding expectedType) {<NEW_LINE>// https://bugs.eclipse.org/bugs/show_bug.cgi?id=305259<NEW_LINE>if (this.options.sourceLevel < ClassFileConstants.JDK1_5)<NEW_LINE>return;<NEW_LINE>int severity = computeSeverity(IProblem.UnsafeElementTypeConversion);<NEW_LINE>if (severity == ProblemSeverities.Ignore)<NEW_LINE>return;<NEW_LINE>if (!this.options.reportUnavoidableGenericTypeProblems && expression.forcedToBeRaw(this.referenceContext)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.handle(IProblem.UnsafeElementTypeConversion, new String[] { new String(expressionType.readableName()), new String(expectedType.readableName()), new String(expectedType.erasure().readableName()) }, new String[] { new String(expressionType.shortReadableName()), new String(expectedType.shortReadableName()), new String(expectedType.erasure().shortReadableName()) }, severity, <MASK><NEW_LINE>}
expression.sourceStart, expression.sourceEnd);
1,550,539
public void marshall(SkillDetails skillDetails, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (skillDetails == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(skillDetails.getProductDescription(), PRODUCTDESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(skillDetails.getInvocationPhrase(), INVOCATIONPHRASE_BINDING);<NEW_LINE>protocolMarshaller.marshall(skillDetails.getReleaseDate(), RELEASEDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(skillDetails.getEndUserLicenseAgreement(), ENDUSERLICENSEAGREEMENT_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(skillDetails.getBulletPoints(), BULLETPOINTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(skillDetails.getNewInThisVersionBulletPoints(), NEWINTHISVERSIONBULLETPOINTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(skillDetails.getSkillTypes(), SKILLTYPES_BINDING);<NEW_LINE>protocolMarshaller.marshall(skillDetails.getReviews(), REVIEWS_BINDING);<NEW_LINE>protocolMarshaller.marshall(skillDetails.getDeveloperInfo(), DEVELOPERINFO_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
skillDetails.getGenericKeywords(), GENERICKEYWORDS_BINDING);
608,494
static <T1, T2, T3, T4, T5, T6, T7, R> Seq<R> zipAll(Stream<? extends T1> s1, Stream<? extends T2> s2, Stream<? extends T3> s3, Stream<? extends T4> s4, Stream<? extends T5> s5, Stream<? extends T6> s6, Stream<? extends T7> s7, T1 default1, T2 default2, T3 default3, T4 default4, T5 default5, T6 default6, T7 default7, Function7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? extends R> zipper) {<NEW_LINE>return zipAll(seq(s1), seq(s2), seq(s3), seq(s4), seq(s5), seq(s6), seq(s7), default1, default2, default3, default4, <MASK><NEW_LINE>}
default5, default6, default7, zipper);
1,179,763
private static boolean isEnable(FileObject fileObject, TypeElement typeElement) {<NEW_LINE>Project project = FileOwnerQuery.getOwner(fileObject);<NEW_LINE>if (project == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (ElementKind.INTERFACE == typeElement.getKind())<NEW_LINE>return false;<NEW_LINE>DataObject dObj = null;<NEW_LINE>try {<NEW_LINE>dObj = DataObject.find(fileObject);<NEW_LINE>} catch (DataObjectNotFoundException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>if (dObj == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Enable it only if the EntityManager is in the project classpath<NEW_LINE>// This check was motivated by issue 139333 - The Use Entity Manager action<NEW_LINE>// breaks from left to right if the javax.persistence.EntityManager class is missing<NEW_LINE>FileObject target = dObj.getCookie(DataObject.class).getPrimaryFile();<NEW_LINE>ClassPath cp = ClassPath.getClassPath(target, ClassPath.COMPILE);<NEW_LINE>if (cp == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (PersistenceScope.getPersistenceScope(target) == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>FileObject <MASK><NEW_LINE>if (entityMgrRes != null) {<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
entityMgrRes = cp.findResource("javax/persistence/EntityManager.class");
948,144
public boolean visit(String typeName, JFREvent event) {<NEW_LINE>if (JFRSnapshotGcViewProvider.EVENT_HEAP_CONFIGURATION.equals(typeName)) {<NEW_LINE>// NOI18N<NEW_LINE>try {<NEW_LINE>final StringBuilder s = new StringBuilder();<NEW_LINE>s.append("<table border='0' cellpadding='0' cellspacing='0' width='100%'>");<NEW_LINE>// NOI18N<NEW_LINE>s.append("<tr><td nowrap><b>Initial Size:</b>&nbsp;&nbsp;&nbsp;&nbsp;</td><td width='100%'>").append(Formatters.bytesFormat().format(new Object[] { event.getLong("initialSize") })).append("</td></tr>");<NEW_LINE>// NOI18N<NEW_LINE>s.append("<tr><td nowrap><b>Minimum Size:</b>&nbsp;&nbsp;&nbsp;&nbsp;</td><td width='100%'>").append(Formatters.bytesFormat().format(new Object[] { event.getLong("minSize") })).append("</td></tr>");<NEW_LINE>// NOI18N<NEW_LINE>s.append("<tr><td nowrap><b>Maximum Size:</b>&nbsp;&nbsp;&nbsp;&nbsp;</td><td width='100%'>").append(Formatters.bytesFormat().format(new Object[] { event.getLong("maxSize") <MASK><NEW_LINE>// NOI18N<NEW_LINE>s.append("<tr><td nowrap><b>Compressed Oops:</b>&nbsp;&nbsp;&nbsp;&nbsp;</td><td width='100%'>").append(event.getBoolean("usesCompressedOops")).append("</td></tr>");<NEW_LINE>// NOI18N<NEW_LINE>s.append("<tr><td nowrap><b>Compressed Oops Mode:</b>&nbsp;&nbsp;&nbsp;&nbsp;</td><td width='100%'>").append(event.getString("compressedOopsMode")).append("</td></tr>");<NEW_LINE>// NOI18N<NEW_LINE>s.append("<tr><td nowrap><b>Address Size:</b>&nbsp;&nbsp;&nbsp;&nbsp;</td><td width='100%'>").append(Formatters.numberFormat().format(event.getLong("heapAddressBits"))).append(" bits</td></tr>");<NEW_LINE>// NOI18N<NEW_LINE>s.append("<tr><td nowrap><b>Object Alignment:</b>&nbsp;&nbsp;&nbsp;&nbsp;</td><td width='100%'>").append(Formatters.bytesFormat().format(new Object[] { event.getLong("objectAlignment") })).append("</td></tr>");<NEW_LINE>// NOI18N<NEW_LINE>s.append("</table>");<NEW_LINE>initialized = true;<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>area.setText(s.toString());<NEW_LINE>area.setCaretPosition(0);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (JFRPropertyNotAvailableException e) {<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
})).append("</td></tr>");
368,694
public AccountEnrollmentStatus unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AccountEnrollmentStatus accountEnrollmentStatus = new AccountEnrollmentStatus();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("accountId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>accountEnrollmentStatus.setAccountId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("status", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>accountEnrollmentStatus.setStatus(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("statusReason", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>accountEnrollmentStatus.setStatusReason(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("lastUpdatedTimestamp", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>accountEnrollmentStatus.setLastUpdatedTimestamp(DateJsonUnmarshallerFactory.getInstance(<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return accountEnrollmentStatus;<NEW_LINE>}
"unixTimestamp").unmarshall(context));
226,735
public void compileRoutes() {<NEW_LINE>if (routes != null) {<NEW_LINE>throw new IllegalStateException("Routes already compiled");<NEW_LINE>}<NEW_LINE>List<Route> routesLocal = new ArrayList<>();<NEW_LINE>allRouteBuilders.forEach(routeBuilder -> {<NEW_LINE>routesLocal.add<MASK><NEW_LINE>});<NEW_LINE>this.routes = ImmutableList.copyOf(routesLocal);<NEW_LINE>// compile reverse routes for O(1) lookups<NEW_LINE>this.reverseRoutes = new HashMap<>(this.routes.size());<NEW_LINE>this.routes.forEach(route -> {<NEW_LINE>Class<?> methodClass = route.getControllerClass();<NEW_LINE>String methodName = route.getControllerMethod().getName();<NEW_LINE>MethodReference controllerMethodRef = new MethodReference(methodClass, methodName);<NEW_LINE>if (this.reverseRoutes.containsKey(controllerMethodRef)) {<NEW_LINE>// the first one wins with reverse routing so we ignore this route<NEW_LINE>} else {<NEW_LINE>this.reverseRoutes.put(controllerMethodRef, route);<NEW_LINE>}<NEW_LINE>if (route.isHttpMethodWebSocket()) {<NEW_LINE>if (this.webSockets == null) {<NEW_LINE>throw new IllegalStateException("WebSockets instance was null. Unable to configure route " + route.getUri() + ".");<NEW_LINE>}<NEW_LINE>if (!this.webSockets.isEnabled()) {<NEW_LINE>throw new IllegalStateException("WebSockets are not enabled. Unable to configure route " + route.getUri() + "." + " Using implementation " + this.webSockets.getClass().getCanonicalName());<NEW_LINE>}<NEW_LINE>webSockets.compileRoute(route);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>logRoutes();<NEW_LINE>}
(routeBuilder.buildRoute(injector));
205,556
protected Properties readConfiguration() {<NEW_LINE>Properties props = new Properties();<NEW_LINE>// Context parameters<NEW_LINE>ServletContext context = getServletContext();<NEW_LINE>Enumeration<?> e = context.getInitParameterNames();<NEW_LINE>while (e.hasMoreElements()) {<NEW_LINE>String name = (String) e.nextElement();<NEW_LINE>props.put(name, context.getInitParameter(name));<NEW_LINE>}<NEW_LINE>// Servlet parameters override context parameters<NEW_LINE>e = getInitParameterNames();<NEW_LINE>while (e.hasMoreElements()) {<NEW_LINE>String name = (String) e.nextElement();<NEW_LINE>props.put(name, getInitParameter(name));<NEW_LINE>}<NEW_LINE>// Check if python home is relative, in which case find it in the servlet context<NEW_LINE>String <MASK><NEW_LINE>if (pythonHomeString != null) {<NEW_LINE>File pythonHome = new File(pythonHomeString);<NEW_LINE>if (!pythonHome.isAbsolute())<NEW_LINE>pythonHomeString = context.getRealPath(pythonHomeString);<NEW_LINE>props.setProperty(PYTHON_HOME_PARAM, pythonHomeString);<NEW_LINE>}<NEW_LINE>return props;<NEW_LINE>}
pythonHomeString = props.getProperty(PYTHON_HOME_PARAM);
34,175
public static DescribeBackupsResponse unmarshall(DescribeBackupsResponse describeBackupsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeBackupsResponse.setRequestId(_ctx.stringValue("DescribeBackupsResponse.RequestId"));<NEW_LINE>describeBackupsResponse.setTotalRecordCount(_ctx.stringValue("DescribeBackupsResponse.TotalRecordCount"));<NEW_LINE>describeBackupsResponse.setPageNumber(_ctx.stringValue("DescribeBackupsResponse.PageNumber"));<NEW_LINE>describeBackupsResponse.setPageRecordCount(_ctx.stringValue("DescribeBackupsResponse.PageRecordCount"));<NEW_LINE>List<Backup> items = new ArrayList<Backup>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeBackupsResponse.Items.Length"); i++) {<NEW_LINE>Backup backup = new Backup();<NEW_LINE>backup.setBackupId(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupId"));<NEW_LINE>backup.setDBClusterId(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].DBClusterId"));<NEW_LINE>backup.setBackupStatus(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupStatus"));<NEW_LINE>backup.setBackupStartTime(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupStartTime"));<NEW_LINE>backup.setBackupEndTime(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupEndTime"));<NEW_LINE>backup.setBackupType(_ctx.stringValue<MASK><NEW_LINE>backup.setBackupMode(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupMode"));<NEW_LINE>backup.setBackupMethod(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupMethod"));<NEW_LINE>backup.setStoreStatus(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].StoreStatus"));<NEW_LINE>backup.setBackupSetSize(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupSetSize"));<NEW_LINE>backup.setConsistentTime(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].ConsistentTime"));<NEW_LINE>backup.setBackupsLevel(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupsLevel"));<NEW_LINE>backup.setIsAvail(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].IsAvail"));<NEW_LINE>items.add(backup);<NEW_LINE>}<NEW_LINE>describeBackupsResponse.setItems(items);<NEW_LINE>return describeBackupsResponse;<NEW_LINE>}
("DescribeBackupsResponse.Items[" + i + "].BackupType"));
1,112,363
private void processAddRequest(final BookieProtocol.ParsedAddRequest r, final Channel c) {<NEW_LINE>WriteEntryProcessor write = WriteEntryProcessor.create(r, c, this);<NEW_LINE>// If it's a high priority add (usually as part of recovery process), we want to make sure it gets<NEW_LINE>// executed as fast as possible, so bypass the normal writeThreadPool and execute in highPriorityThreadPool<NEW_LINE>final OrderedExecutor threadPool;<NEW_LINE>if (r.isHighPriority()) {<NEW_LINE>threadPool = highPriorityThreadPool;<NEW_LINE>} else {<NEW_LINE>threadPool = writeThreadPool;<NEW_LINE>}<NEW_LINE>if (null == threadPool) {<NEW_LINE>write.run();<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>threadPool.executeOrdered(r.getLedgerId(), write);<NEW_LINE>} catch (RejectedExecutionException e) {<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("Failed to process request to add entry at {}:{}. Too many pending requests", <MASK><NEW_LINE>}<NEW_LINE>getRequestStats().getAddEntryRejectedCounter().inc();<NEW_LINE>write.sendResponse(BookieProtocol.ETOOMANYREQUESTS, ResponseBuilder.buildErrorResponse(BookieProtocol.ETOOMANYREQUESTS, r), requestStats.getAddRequestStats());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
r.ledgerId, r.entryId);
1,653,458
public java.util.concurrent.Future<ProjectProblemsProvider.Result> resolve() {<NEW_LINE>ProjectProblemsProvider.Result res;<NEW_LINE>if (action != null) {<NEW_LINE>action.actionPerformed(null);<NEW_LINE>String text = (String) action.getValue(ACT_START_MESSAGE);<NEW_LINE>if (text != null) {<NEW_LINE>res = ProjectProblemsProvider.Result.create(ProjectProblemsProvider.Status.RESOLVED, text);<NEW_LINE>} else {<NEW_LINE>res = ProjectProblemsProvider.Result.<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>res = ProjectProblemsProvider.Result.create(ProjectProblemsProvider.Status.UNRESOLVED, "No resolution for the problem");<NEW_LINE>}<NEW_LINE>RunnableFuture<ProjectProblemsProvider.Result> f = new FutureTask<>(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>}<NEW_LINE>}, res);<NEW_LINE>f.run();<NEW_LINE>return f;<NEW_LINE>}
create(ProjectProblemsProvider.Status.RESOLVED);
890,268
public void cancelReceivingMedia(KurentoParticipant senderKurentoParticipant, EndReason reason, boolean silent) {<NEW_LINE>final String senderName = senderKurentoParticipant.getParticipantPublicId();<NEW_LINE>final PublisherEndpoint pub = senderKurentoParticipant.publisher;<NEW_LINE>if (pub != null) {<NEW_LINE>try {<NEW_LINE>final Lock closingWriteLock = pub.closingLock.writeLock();<NEW_LINE>if (closingWriteLock.tryLock(15, TimeUnit.SECONDS)) {<NEW_LINE>try {<NEW_LINE>log.info("PARTICIPANT {}: cancel receiving media from {}", this.getParticipantPublicId(), senderName);<NEW_LINE>SubscriberEndpoint <MASK><NEW_LINE>if (subscriberEndpoint == null) {<NEW_LINE>log.warn("PARTICIPANT {}: Trying to cancel receiving video from user {}. " + "But there is no such subscriber endpoint.", this.getParticipantPublicId(), senderName);<NEW_LINE>} else {<NEW_LINE>releaseSubscriberEndpoint(senderName, senderKurentoParticipant, subscriberEndpoint, reason, silent);<NEW_LINE>log.info("PARTICIPANT {}: stopped receiving media from {} in room {}", this.getParticipantPublicId(), senderName, this.session.getSessionId());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>closingWriteLock.unlock();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>log.error("Timeout waiting for PublisherEndpoint closing lock of participant {} to be available for participant {} to call cancelReceivingMedia", senderName, this.getParticipantPublicId());<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>log.error("InterruptedException while waiting for PublisherEndpoint closing lock of participant {} to be available for participant {} to call cancelReceivingMedia", senderName, this.getParticipantPublicId());<NEW_LINE>} finally {<NEW_LINE>// Always clean map<NEW_LINE>subscribers.remove(senderName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
subscriberEndpoint = subscribers.remove(senderName);
1,335,184
public Entity newLevelBox(SpawnData data) {<NEW_LINE>var ground = new Box(50, 0.5, 150);<NEW_LINE>ground.setMaterial(new PhongMaterial(Color.BROWN));<NEW_LINE>var WALL_HEIGHT = 20;<NEW_LINE>var wallL = new Box(0.5, WALL_HEIGHT, 150);<NEW_LINE>wallL.setMaterial(new PhongMaterial(Color.LIGHTCORAL));<NEW_LINE>wallL.setTranslateY(-WALL_HEIGHT / 2.0);<NEW_LINE>wallL.setTranslateX(-ground.getWidth() / 2.0);<NEW_LINE>var wallR = new Box(0.5, WALL_HEIGHT, 150);<NEW_LINE>wallR.setMaterial(new PhongMaterial(Color.LIGHTCORAL));<NEW_LINE>wallR<MASK><NEW_LINE>wallR.setTranslateX(+ground.getWidth() / 2.0);<NEW_LINE>var wallT = new Box(50, WALL_HEIGHT, 0.5);<NEW_LINE>wallT.setMaterial(new PhongMaterial(Color.LIGHTCORAL));<NEW_LINE>wallT.setTranslateY(-WALL_HEIGHT / 2.0);<NEW_LINE>wallT.setTranslateZ(+wallL.getDepth() / 2.0);<NEW_LINE>var wallB = new Box(50, WALL_HEIGHT, 0.5);<NEW_LINE>wallB.setMaterial(new PhongMaterial(Color.LIGHTCORAL));<NEW_LINE>wallB.setTranslateY(-WALL_HEIGHT / 2.0);<NEW_LINE>wallB.setTranslateZ(-25);<NEW_LINE>return entityBuilder(data).view(new Group(ground, wallL, wallR, wallT, wallB)).build();<NEW_LINE>}
.setTranslateY(-WALL_HEIGHT / 2.0);
143,432
protected JPanel createPanel() {<NEW_LINE>JPanel panel = new JPanel();<NEW_LINE>BoxLayout boxLayout = new BoxLayout(panel, BoxLayout.Y_AXIS);<NEW_LINE>panel.setLayout(boxLayout);<NEW_LINE>panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));<NEW_LINE>for (String currentRegister : extent.getContextRegisters()) {<NEW_LINE>JPanel currentRegPanel = new JPanel();<NEW_LINE>PairLayout pairLayout = new PairLayout();<NEW_LINE>currentRegPanel.setLayout(pairLayout);<NEW_LINE>JTextField currentTextField = new JTextField(currentRegister, TEXT_FIELD_COLUMNS);<NEW_LINE>currentTextField.setEditable(false);<NEW_LINE>currentRegPanel.add(currentTextField);<NEW_LINE>List<BigInteger> <MASK><NEW_LINE>RegisterValueWrapper[] valueArray = new RegisterValueWrapper[regValues.size() + 1];<NEW_LINE>valueArray[0] = new RegisterValueWrapper(null);<NEW_LINE>for (int i = 1; i < regValues.size() + 1; ++i) {<NEW_LINE>valueArray[i] = new RegisterValueWrapper(regValues.get(i - 1));<NEW_LINE>}<NEW_LINE>GhidraComboBox<RegisterValueWrapper> currentCombo = new GhidraComboBox<RegisterValueWrapper>(valueArray);<NEW_LINE>currentRegPanel.add(currentCombo);<NEW_LINE>panel.add(currentRegPanel);<NEW_LINE>regsToBoxes.put(currentRegister, currentCombo);<NEW_LINE>}<NEW_LINE>return panel;<NEW_LINE>}
regValues = extent.getValuesForRegister(currentRegister);
303,751
public CompletableFuture<Map<String, StreamConfiguration>> listStreamsInScope(final String scopeName, final OperationContext ctx, final Executor executor) {<NEW_LINE>OperationContext context = getOperationContext(ctx);<NEW_LINE>InMemoryScope inMemoryScope = scopes.get(scopeName);<NEW_LINE>if (inMemoryScope != null) {<NEW_LINE>return inMemoryScope.listStreamsInScope(context).thenApply(streams -> {<NEW_LINE>HashMap<String, StreamConfiguration> <MASK><NEW_LINE>for (String stream : streams) {<NEW_LINE>State state = getState(scopeName, stream, true, null, executor).join();<NEW_LINE>StreamConfiguration configuration = Futures.exceptionallyExpecting(getConfiguration(scopeName, stream, null, executor), e -> e instanceof StoreException.DataNotFoundException, null).join();<NEW_LINE>if (configuration != null && !state.equals(State.CREATING) && !state.equals(State.UNKNOWN)) {<NEW_LINE>result.put(stream, configuration);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>return Futures.failedFuture(StoreException.create(StoreException.Type.DATA_NOT_FOUND, scopeName));<NEW_LINE>}<NEW_LINE>}
result = new HashMap<>();
490,316
public List<PlayerStat> readLeaderboard(@Nullable PrimarySkillType skill, int pageNumber, int statsPerPage) throws InvalidSkillException {<NEW_LINE>List<PlayerStat> stats = new ArrayList<>();<NEW_LINE>// Fix for a plugin that people are using that is throwing SQL errors<NEW_LINE>if (skill != null && SkillTools.isChildSkill(skill)) {<NEW_LINE>mcMMO.p.getLogger().severe("A plugin hooking into mcMMO is being naughty with our database commands, update all plugins that hook into mcMMO and contact their devs!");<NEW_LINE>throw new InvalidSkillException("A plugin hooking into mcMMO that you are using is attempting to read leaderboard skills for child skills, child skills do not have leaderboards! This is NOT an mcMMO error!");<NEW_LINE>}<NEW_LINE>String query = skill == null ? ALL_QUERY_VERSION : skill.name().toLowerCase(Locale.ENGLISH);<NEW_LINE>ResultSet resultSet = null;<NEW_LINE>PreparedStatement statement = null;<NEW_LINE>Connection connection = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>statement = connection.prepareStatement("SELECT " + query + ", user FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON (user_id = id) WHERE " + query + " > 0 AND NOT user = '\\_INVALID\\_OLD\\_USERNAME\\_' ORDER BY " + query + " DESC, user LIMIT ?, ?");<NEW_LINE>statement.setInt(1, (pageNumber * statsPerPage) - statsPerPage);<NEW_LINE>statement.setInt(2, statsPerPage);<NEW_LINE>resultSet = statement.executeQuery();<NEW_LINE>while (resultSet.next()) {<NEW_LINE>ArrayList<String> column = new ArrayList<>();<NEW_LINE>for (int i = 1; i <= resultSet.getMetaData().getColumnCount(); i++) {<NEW_LINE>column.add(resultSet.getString(i));<NEW_LINE>}<NEW_LINE>stats.add(new PlayerStat(column.get(1), Integer.parseInt(column.get(0))));<NEW_LINE>}<NEW_LINE>} catch (SQLException ex) {<NEW_LINE>printErrors(ex);<NEW_LINE>} finally {<NEW_LINE>tryClose(resultSet);<NEW_LINE>tryClose(statement);<NEW_LINE>tryClose(connection);<NEW_LINE>}<NEW_LINE>return stats;<NEW_LINE>}
connection = getConnection(PoolIdentifier.MISC);
784,601
public void run(Configuration configuration) {<NEW_LINE>SupportExceptionHandlerFactory.getFactoryContexts().clear();<NEW_LINE>SupportExceptionHandlerFactory.getHandlers().clear();<NEW_LINE>configuration.getRuntime().getExceptionHandling().getHandlerFactories().clear();<NEW_LINE>configuration.getRuntime().getExceptionHandling().addClass(SupportExceptionHandlerFactory.class);<NEW_LINE>configuration.getRuntime().getExceptionHandling().addClass(SupportExceptionHandlerFactory.class);<NEW_LINE>configuration.getCommon().addEventType(SupportBean.class);<NEW_LINE>configuration.getCompiler().addPlugInAggregationFunctionForge("myinvalidagg", SupportInvalidAggregationFunctionForge.class.getName());<NEW_LINE>EPRuntime runtime = EPRuntimeProvider.getRuntime(ClientRuntimeExHandlerGetContext.class.getName(), configuration);<NEW_LINE>SupportExceptionHandlerFactory.getFactoryContexts().clear();<NEW_LINE>SupportExceptionHandlerFactory.getHandlers().clear();<NEW_LINE>runtime.initialize();<NEW_LINE>String epl = "@Name('ABCName') select myinvalidagg() from SupportBean";<NEW_LINE>EPDeployment deployment;<NEW_LINE>try {<NEW_LINE>EPCompiled compiled = EPCompilerProvider.getCompiler().compile(epl, new CompilerArguments(configuration));<NEW_LINE>deployment = runtime.getDeploymentService().deploy(compiled);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new RuntimeException(t);<NEW_LINE>}<NEW_LINE>List<ExceptionHandlerFactoryContext> contexts = SupportExceptionHandlerFactory.getFactoryContexts();<NEW_LINE>assertEquals(2, contexts.size());<NEW_LINE>assertEquals(runtime.getURI(), contexts.get(0).getRuntimeURI());<NEW_LINE>assertEquals(runtime.getURI(), contexts.get(1).getRuntimeURI());<NEW_LINE>SupportExceptionHandlerFactory.SupportExceptionHandler handlerOne = SupportExceptionHandlerFactory.getHandlers().get(0);<NEW_LINE>SupportExceptionHandlerFactory.SupportExceptionHandler handlerTwo = SupportExceptionHandlerFactory.getHandlers().get(1);<NEW_LINE>runtime.getEventService().sendEventBean(new SupportBean(), "SupportBean");<NEW_LINE>assertEquals(1, handlerOne.getContexts().size());<NEW_LINE>assertEquals(1, handlerTwo.getContexts().size());<NEW_LINE>ExceptionHandlerContext ehc = handlerOne.getContexts().get(0);<NEW_LINE>assertEquals(runtime.getURI(), ehc.getRuntimeURI());<NEW_LINE>assertEquals(epl, ehc.getEpl());<NEW_LINE>assertEquals(deployment.getDeploymentId(<MASK><NEW_LINE>assertEquals("ABCName", ehc.getStatementName());<NEW_LINE>assertEquals("Sample exception", ehc.getThrowable().getMessage());<NEW_LINE>assertNotNull(ehc.getCurrentEvent());<NEW_LINE>runtime.destroy();<NEW_LINE>}
), ehc.getDeploymentId());
1,696,006
private Map<Address, Long> resolveConstants(Map<Function, Set<Address>> funcsToCalls, Program program, TaskMonitor tMonitor) throws CancelledException {<NEW_LINE>Map<Address, Long> <MASK><NEW_LINE>Register syscallReg = program.getLanguage().getRegister(syscallRegister);<NEW_LINE>for (Function func : funcsToCalls.keySet()) {<NEW_LINE>Address start = func.getEntryPoint();<NEW_LINE>ContextEvaluator eval = new ConstantPropagationContextEvaluator(true);<NEW_LINE>SymbolicPropogator symEval = new SymbolicPropogator(program);<NEW_LINE>symEval.flowConstants(start, func.getBody(), eval, true, tMonitor);<NEW_LINE>for (Address callSite : funcsToCalls.get(func)) {<NEW_LINE>Value val = symEval.getRegisterValue(callSite, syscallReg);<NEW_LINE>if (val == null) {<NEW_LINE>createBookmark(callSite, "System Call", "Couldn't resolve value of " + syscallReg);<NEW_LINE>printf("Couldn't resolve value of " + syscallReg + " at " + callSite + "\n");<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>addressesToSyscalls.put(callSite, val.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return addressesToSyscalls;<NEW_LINE>}
addressesToSyscalls = new HashMap<>();
943,767
public void permissionIndividuallyByRole(Permissionable parent, Permissionable permissionable, User user, Role role) throws DotDataException, DotSecurityException {<NEW_LINE>List<Permission> newSetOfPermissions = getNewPermissions(parent, permissionable, user);<NEW_LINE>ImmutableList.Builder<Permission> <MASK><NEW_LINE>// We need to make sure that newSetOfPermissions doesn't contain<NEW_LINE>// a child or sibling of the role we are assigning permissions.<NEW_LINE>for (Permission newPermission : newSetOfPermissions) {<NEW_LINE>Role newPermissionRole = APILocator.getRoleAPI().loadRoleById(newPermission.getRoleId());<NEW_LINE>if (!APILocator.getRoleAPI().isParentRole(role, newPermissionRole) && !APILocator.getRoleAPI().isSiblingRole(role, newPermissionRole)) {<NEW_LINE>immutablePermissionsFiltered.add(newPermission);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final List<Permission> permissionsFiltered = immutablePermissionsFiltered.build();<NEW_LINE>if (!permissionsFiltered.isEmpty()) {<NEW_LINE>// NOTE: Method "assignPermissions" is deprecated in favor of "savePermission",<NEW_LINE>// which has subtle functional differences. Please take these differences into<NEW_LINE>// consideration if planning to replace this method with the "savePermission"<NEW_LINE>permissionFactory.assignPermissions(permissionsFiltered, permissionable);<NEW_LINE>}<NEW_LINE>}
immutablePermissionsFiltered = new Builder<>();
1,053,037
private AddEntryResult addEntry(final int recordVersion, final byte[] entryContent, final OAtomicOperation atomicOperation) throws IOException {<NEW_LINE>int recordSizesDiff;<NEW_LINE>int position;<NEW_LINE>int finalVersion = 0;<NEW_LINE>long pageIndex;<NEW_LINE>do {<NEW_LINE>final FindFreePageResult findFreePageResult = findFreePage(entryContent.length, atomicOperation);<NEW_LINE>final int freePageIndex = findFreePageResult.freePageIndex;<NEW_LINE>pageIndex = findFreePageResult.pageIndex;<NEW_LINE>final boolean newRecord = freePageIndex >= FREE_LIST_SIZE;<NEW_LINE>OCacheEntry cacheEntry = loadPageForWrite(atomicOperation, fileId, pageIndex, false, true);<NEW_LINE>if (cacheEntry == null) {<NEW_LINE>cacheEntry = addPage(atomicOperation, fileId);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final <MASK><NEW_LINE>if (newRecord) {<NEW_LINE>localPage.init();<NEW_LINE>}<NEW_LINE>assert newRecord || freePageIndex == calculateFreePageIndex(localPage);<NEW_LINE>final int initialFreeSpace = localPage.getFreeSpace();<NEW_LINE>position = localPage.appendRecord(recordVersion, entryContent, -1, atomicOperation.getBookedRecordPositions(id, cacheEntry.getPageIndex()));<NEW_LINE>final int freeSpace = localPage.getFreeSpace();<NEW_LINE>recordSizesDiff = initialFreeSpace - freeSpace;<NEW_LINE>if (position >= 0) {<NEW_LINE>finalVersion = localPage.getRecordVersion(position);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>releasePageFromWrite(atomicOperation, cacheEntry);<NEW_LINE>}<NEW_LINE>updateFreePagesIndex(freePageIndex, pageIndex, atomicOperation);<NEW_LINE>} while (position < 0);<NEW_LINE>return new AddEntryResult(pageIndex, position, finalVersion, recordSizesDiff);<NEW_LINE>}
OClusterPage localPage = new OClusterPage(cacheEntry);
268,997
public void onTlsCaCrtNameClick(final View v) {<NEW_LINE>PopupMenu popup = new PopupMenu(v.getContext(), v);<NEW_LINE>popup.getMenuInflater().inflate(R.menu.picker, popup.getMenu());<NEW_LINE>popup.setOnMenuItemClickListener(item -> {<NEW_LINE>if (item.getItemId() == R.id.clear) {<NEW_LINE>setTlsCaCrtName(null);<NEW_LINE>} else if (item.getItemId() == R.id.select) {<NEW_LINE>Intent intent = new Intent(Intent.ACTION_GET_CONTENT);<NEW_LINE>intent.addCategory(Intent.CATEGORY_OPENABLE);<NEW_LINE>intent.setType("*/*");<NEW_LINE>try {<NEW_LINE>navigator.startActivityForResult(Intent.createChooser<MASK><NEW_LINE>} catch (android.content.ActivityNotFoundException ex) {<NEW_LINE>// Potentially direct the user to the Market with a Dialog<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>popup.show();<NEW_LINE>}
(intent, "Select a file"), REQUEST_CODE_FILE_CA_CRT);
958,954
public void mouseReleased(MouseEvent e) {<NEW_LINE>isDragging = false;<NEW_LINE>// deselect rectangles on other selected pages.<NEW_LINE>ArrayList<AbstractPageViewComponent> selectedPages = documentViewModel.getSelectedPageText();<NEW_LINE>// check if we are over a page<NEW_LINE>AbstractPageViewComponent pageComponent = isOverPageComponent(parentComponent, e);<NEW_LINE>if (pageComponent != null) {<NEW_LINE>MouseEvent modeEvent = SwingUtilities.<MASK><NEW_LINE>if (selectedPages != null && selectedPages.size() > 0) {<NEW_LINE>PageViewComponentImpl pageComp;<NEW_LINE>for (AbstractPageViewComponent selectedPage : selectedPages) {<NEW_LINE>pageComp = (PageViewComponentImpl) selectedPage;<NEW_LINE>if (pageComp != null) {<NEW_LINE>pageComp.getTextSelectionPageHandler().selectionEnd(modeEvent.getPoint(), pageComp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// finally if we have selected any text then fire a property change event<NEW_LINE>if (selectedPages != null && selectedPages.size() > 0) {<NEW_LINE>documentViewController.firePropertyChange(PropertyConstants.TEXT_SELECTED, null, null);<NEW_LINE>}<NEW_LINE>// clear the rectangle<NEW_LINE>clearRectangle(parentComponent);<NEW_LINE>}
convertMouseEvent(parentComponent, e, pageComponent);
1,254,468
public void endVisit() {<NEW_LINE>if (sequences.size() > 0) {<NEW_LINE>GraphGeneratorVisitor.Sequence mainSequence = sequences.get(0);<NEW_LINE>// iterate until nothing left to do<NEW_LINE>int tooMany = 0;<NEW_LINE>while (!mainSequence.outstandingTransitions.isEmpty() && tooMany < 50) {<NEW_LINE>List<Context.TransitionTarget> nextTransitions = findNextTransitions(mainSequence.outstandingTransitions);<NEW_LINE><MASK><NEW_LINE>GraphGeneratorVisitor.Sequence sequence = findSequence(nextTransitions.get(0).label);<NEW_LINE>if (sequence == null) {<NEW_LINE>throw new IllegalStateException("Out of flow transition? " + nextTransitions.get(0));<NEW_LINE>}<NEW_LINE>inline(mainSequence, sequence, nextTransitions);<NEW_LINE>// Some transitions might be satisfiable now<NEW_LINE>Iterator<TransitionTarget> iter = mainSequence.outstandingTransitions.iterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>TransitionTarget transitionTarget = iter.next();<NEW_LINE>FlowNode flowInWhichTransitionOccurring = transitionTarget.flow;<NEW_LINE>Map<String, Node> candidates = mainSequence.labeledNodesInEachFlow.get(flowInWhichTransitionOccurring);<NEW_LINE>for (Map.Entry<String, Node> candidate : candidates.entrySet()) {<NEW_LINE>if (candidate.getKey().equals(transitionTarget.label)) {<NEW_LINE>// This is the right one!<NEW_LINE>mainSequence.links.add(new Link(transitionTarget.nodeId, candidate.getValue().id, transitionTarget.onState));<NEW_LINE>iter.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tooMany++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
mainSequence.outstandingTransitions.removeAll(nextTransitions);
74,869
void write(MethodWriter writer, Globals globals) {<NEW_LINE>writer.writeStatementOffset(location);<NEW_LINE>expression.write(writer, globals);<NEW_LINE>if (method == null) {<NEW_LINE>org.objectweb.asm.Type methodType = org.objectweb.asm.Type.getMethodType(org.objectweb.asm.Type.getType(Iterator.class), org.objectweb.asm.Type.getType(Object.class));<NEW_LINE>writer.invokeDefCall("iterator", methodType, DefBootstrap.ITERATOR);<NEW_LINE>} else {<NEW_LINE>writer.invokeMethodCall(method);<NEW_LINE>}<NEW_LINE>writer.visitVarInsn(MethodWriter.getType(iterator.clazz).getOpcode(Opcodes.ISTORE), iterator.getSlot());<NEW_LINE>Label begin = new Label();<NEW_LINE>Label end = new Label();<NEW_LINE>writer.mark(begin);<NEW_LINE>writer.visitVarInsn(MethodWriter.getType(iterator.clazz).getOpcode(Opcodes.ILOAD), iterator.getSlot());<NEW_LINE>writer.invokeInterface(ITERATOR_TYPE, ITERATOR_HASNEXT);<NEW_LINE>writer.ifZCmp(MethodWriter.EQ, end);<NEW_LINE>writer.visitVarInsn(MethodWriter.getType(iterator.clazz).getOpcode(Opcodes.ILOAD), iterator.getSlot());<NEW_LINE>writer.invokeInterface(ITERATOR_TYPE, ITERATOR_NEXT);<NEW_LINE>writer.writeCast(cast);<NEW_LINE>writer.visitVarInsn(MethodWriter.getType(variable.clazz).getOpcode(Opcodes.ISTORE), variable.getSlot());<NEW_LINE>if (loopCounter != null) {<NEW_LINE>writer.writeLoopCounter(loopCounter.getSlot(), statementCount, location);<NEW_LINE>}<NEW_LINE>block.continu = begin;<NEW_LINE>block.brake = end;<NEW_LINE><MASK><NEW_LINE>writer.goTo(begin);<NEW_LINE>writer.mark(end);<NEW_LINE>}
block.write(writer, globals);
1,212,842
private // to avoid dealing with escaped space characters, etc.<NEW_LINE>String recoverPropertyName(String text) {<NEW_LINE>try {<NEW_LINE>new TaskDefinition("__dummy", text + " --");<NEW_LINE>} catch (CheckPointedParseException exception) {<NEW_LINE>List<Token> tokens = exception.getTokens();<NEW_LINE>// -2 for skipping dangling -- and space preceding it<NEW_LINE>int end = tokens<MASK><NEW_LINE>int tokenPointer = end;<NEW_LINE>while (!tokens.get(tokenPointer - 1).isKind(TokenKind.DOUBLE_MINUS)) {<NEW_LINE>tokenPointer--;<NEW_LINE>}<NEW_LINE>StringBuilder builder;<NEW_LINE>for (builder = new StringBuilder(); tokenPointer < end; tokenPointer++) {<NEW_LINE>Token t = tokens.get(tokenPointer);<NEW_LINE>if (t.isIdentifier()) {<NEW_LINE>builder.append(t.stringValue());<NEW_LINE>} else {<NEW_LINE>builder.append(t.getKind().getTokenChars());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return builder.toString();<NEW_LINE>}<NEW_LINE>throw new AssertionError("Can't be reached");<NEW_LINE>}
.size() - 1 - 2;
683,099
public okhttp3.Call throttlingDenyPolicyConditionIdDeleteCall(String conditionId, String ifMatch, String ifUnmodifiedSince, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/throttling/deny-policy/{conditionId}".replaceAll("\\{" + "conditionId" + "\\}", localVarApiClient.escapeString(conditionId.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>if (ifMatch != null) {<NEW_LINE>localVarHeaderParams.put("If-Match", localVarApiClient.parameterToString(ifMatch));<NEW_LINE>}<NEW_LINE>if (ifUnmodifiedSince != null) {<NEW_LINE>localVarHeaderParams.put("If-Unmodified-Since", localVarApiClient.parameterToString(ifUnmodifiedSince));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String <MASK><NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "OAuth2Security" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
1,234,577
synchronized void insert(List<String> path, DrawableGroup g, boolean tree) {<NEW_LINE>if (tree) {<NEW_LINE>// Are we at the end of the recursion?<NEW_LINE>if (path.isEmpty()) {<NEW_LINE>getValue().setGroup(g);<NEW_LINE>} else {<NEW_LINE>String prefix = path.get(0);<NEW_LINE>GroupTreeItem prefixTreeItem = childMap.computeIfAbsent(prefix, (String t) -> {<NEW_LINE>final GroupTreeItem newTreeItem = new GroupTreeItem(t, null, false);<NEW_LINE>Platform.runLater(() -> {<NEW_LINE><MASK><NEW_LINE>getChildren().sort(Comparator.comparing(treeItem -> treeItem.getValue().getGroup(), Comparator.nullsLast(comp)));<NEW_LINE>});<NEW_LINE>return newTreeItem;<NEW_LINE>});<NEW_LINE>// recursively go into the path<NEW_LINE>treeInsertTread.execute(() -> {<NEW_LINE>prefixTreeItem.insert(path.subList(1, path.size()), g, true);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String join = StringUtils.join(path, "/");<NEW_LINE>// flat list<NEW_LINE>childMap.computeIfAbsent(join, (String t) -> {<NEW_LINE>final GroupTreeItem newTreeItem = new GroupTreeItem(t, g, true);<NEW_LINE>Platform.runLater(() -> {<NEW_LINE>getChildren().add(newTreeItem);<NEW_LINE>getChildren().sort(Comparator.comparing(treeItem -> treeItem.getValue().getGroup(), Comparator.nullsLast(comp)));<NEW_LINE>});<NEW_LINE>return newTreeItem;<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
getChildren().add(newTreeItem);
1,604,988
public static String makeNamespaceFromClassName(String className, String protocol) {<NEW_LINE>int index = className.lastIndexOf(".");<NEW_LINE>if (index == -1) {<NEW_LINE>return protocol + "://" + "DefaultNamespace";<NEW_LINE>}<NEW_LINE>String packageName = className.substring(0, index);<NEW_LINE>StringTokenizer st = new StringTokenizer(packageName, ".");<NEW_LINE>String[] words = new String[st.countTokens()];<NEW_LINE>for (int i = 0; i < words.length; ++i) {<NEW_LINE>words[<MASK><NEW_LINE>}<NEW_LINE>StringBuilder sb = new StringBuilder(80);<NEW_LINE>for (int i = words.length - 1; i >= 0; --i) {<NEW_LINE>String word = words[i];<NEW_LINE>// seperate with dot<NEW_LINE>if (i != words.length - 1) {<NEW_LINE>sb.append('.');<NEW_LINE>}<NEW_LINE>sb.append(word);<NEW_LINE>}<NEW_LINE>return protocol + "://" + sb.toString() + "/";<NEW_LINE>}
i] = st.nextToken();
1,127,030
public Object calculate(Context ctx) {<NEW_LINE>if (param == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("ifx_client" + mm.getMessage("function.missingParam"));<NEW_LINE>}<NEW_LINE>int nSize = param.getSubSize();<NEW_LINE>if (nSize < 2) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("ifx_client" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>ArrayList<Expression> list1 = new ArrayList<Expression>();<NEW_LINE>ArrayList<Expression> list2 = new ArrayList<Expression>();<NEW_LINE>param.getSub(0).getAllLeafExpression(list1);<NEW_LINE>param.getSub(1).getAllLeafExpression(list2);<NEW_LINE>nSize = list1.size() + list2.size();<NEW_LINE>int nOffset = 0;<NEW_LINE>String[<MASK><NEW_LINE>String s = "";<NEW_LINE>if (list1.size() == 1) {<NEW_LINE>nOffset = 1;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < list1.size(); i++) {<NEW_LINE>s = ((Expression) list1.get(i)).getIdentifierName();<NEW_LINE>vals[i + nOffset] = s.replace("\"", "");<NEW_LINE>}<NEW_LINE>for (int i = 0; i < list2.size(); i++) {<NEW_LINE>Expression e = ((Expression) list2.get(i));<NEW_LINE>if (e.isConstExpression()) {<NEW_LINE>s = e.getIdentifierName();<NEW_LINE>} else {<NEW_LINE>INormalCell cell = e.getHome().calculateCell(ctx);<NEW_LINE>s = cell.getValue().toString();<NEW_LINE>}<NEW_LINE>vals[i + list1.size() + nOffset] = s.replace("\"", "");<NEW_LINE>}<NEW_LINE>DBSession session = getDBSession(vals);<NEW_LINE>return new IfxConn(ctx, session, vals[2]);<NEW_LINE>}
] vals = new String[3];
1,655,796
public static void verticalInverse(BorderIndex1D border, WlBorderCoef<WlCoef_F32> inverseCoef, GrayF32 input, GrayF32 output) {<NEW_LINE>UtilWavelet.checkShape(output, input);<NEW_LINE>float[] trends = new float[output.height];<NEW_LINE>float[] details = new float[output.height];<NEW_LINE>boolean isLarger = input.height > output.height;<NEW_LINE>int paddedHeight = output.height + output.height % 2;<NEW_LINE>final int lowerBorder = inverseCoef.getLowerLength() * 2;<NEW_LINE>final int upperBorder = output.height - inverseCoef.getUpperLength() * 2;<NEW_LINE>border.setLength(output.height + output.height % 2);<NEW_LINE>WlCoef_F32 coefficients;<NEW_LINE>for (int x = 0; x < output.width; x++) {<NEW_LINE>for (int i = 0; i < details.length; i++) {<NEW_LINE>details[i] = 0;<NEW_LINE>trends[i] = 0;<NEW_LINE>}<NEW_LINE>for (int y = 0; y < output.height; y += 2) {<NEW_LINE>float a = input.get(x, y / 2);<NEW_LINE>float d = input.get(x, y / 2 + input.height / 2);<NEW_LINE>if (y < lowerBorder) {<NEW_LINE>coefficients = inverseCoef.getBorderCoefficients(y);<NEW_LINE>} else if (y >= upperBorder) {<NEW_LINE>coefficients = inverseCoef.getBorderCoefficients(y - paddedHeight);<NEW_LINE>} else {<NEW_LINE>coefficients = inverseCoef.getInnerCoefficients();<NEW_LINE>}<NEW_LINE>final int offsetA = coefficients.offsetScaling;<NEW_LINE>final int offsetB = coefficients.offsetWavelet;<NEW_LINE>final float[] alpha = coefficients.scaling;<NEW_LINE>final float[] beta = coefficients.wavelet;<NEW_LINE>// add the 'average' signal<NEW_LINE>for (int i = 0; i < alpha.length; i++) {<NEW_LINE>// if an odd image don't update the outer edge<NEW_LINE>int yy = border.getIndex(y + offsetA + i);<NEW_LINE>if (isLarger && yy >= output.height)<NEW_LINE>continue;<NEW_LINE>trends[yy<MASK><NEW_LINE>}<NEW_LINE>// add the detail signal<NEW_LINE>for (int i = 0; i < beta.length; i++) {<NEW_LINE>int yy = border.getIndex(y + offsetB + i);<NEW_LINE>if (isLarger && yy >= output.height)<NEW_LINE>continue;<NEW_LINE>details[yy] += d * beta[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int y = 0; y < output.height; y++) {<NEW_LINE>output.set(x, y, trends[y] + details[y]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
] += a * alpha[i];
699,311
public static svm_model svm_load_model(BufferedReader fp) throws IOException {<NEW_LINE>// read parameters<NEW_LINE>svm_model model = new svm_model();<NEW_LINE>model.rho = null;<NEW_LINE>model.probA = null;<NEW_LINE>model.probB = null;<NEW_LINE>model.label = null;<NEW_LINE>model.nSV = null;<NEW_LINE>// read header<NEW_LINE>if (!read_model_header(fp, model)) {<NEW_LINE>System.err.print("ERROR: failed to read model\n");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// read sv_coef and SV<NEW_LINE>int m = model.nr_class - 1;<NEW_LINE>int l = model.l;<NEW_LINE>model.sv_coef = new double[m][l];<NEW_LINE>model.SV = new svm_node[l][];<NEW_LINE>for (int i = 0; i < l; i++) {<NEW_LINE>String line = fp.readLine();<NEW_LINE>StringTokenizer st = new StringTokenizer(line, " \t\n\r\f:");<NEW_LINE>for (int k = 0; k < m; k++) model.sv_coef[k][i] = atof(st.nextToken());<NEW_LINE>int n <MASK><NEW_LINE>model.SV[i] = new svm_node[n];<NEW_LINE>for (int j = 0; j < n; j++) {<NEW_LINE>model.SV[i][j] = new svm_node();<NEW_LINE>model.SV[i][j].index = atoi(st.nextToken());<NEW_LINE>model.SV[i][j].value = atof(st.nextToken());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>fp.close();<NEW_LINE>return model;<NEW_LINE>}
= st.countTokens() / 2;
853,322
private static ScalarValue[] parseTRBLValue(String val) {<NEW_LINE>ScalarValue[] out = new ScalarValue[4];<NEW_LINE>String[] parts = <MASK><NEW_LINE>int len = parts.length;<NEW_LINE>switch(len) {<NEW_LINE>case 1:<NEW_LINE>ScalarValue v = parseSingleTRBLValue(parts[0]);<NEW_LINE>for (int i = 0; i < 4; i++) {<NEW_LINE>out[i] = v;<NEW_LINE>}<NEW_LINE>return out;<NEW_LINE>case 2:<NEW_LINE>{<NEW_LINE>ScalarValue v1 = parseSingleTRBLValue(parts[0]);<NEW_LINE>ScalarValue v2 = parseSingleTRBLValue(parts[1]);<NEW_LINE>out[Component.TOP] = out[Component.BOTTOM] = v1;<NEW_LINE>out[Component.LEFT] = out[Component.RIGHT] = v2;<NEW_LINE>return out;<NEW_LINE>}<NEW_LINE>case 3:<NEW_LINE>{<NEW_LINE>ScalarValue v1 = parseSingleTRBLValue(parts[0]);<NEW_LINE>ScalarValue v2 = parseSingleTRBLValue(parts[1]);<NEW_LINE>ScalarValue v3 = parseSingleTRBLValue(parts[2]);<NEW_LINE>out[Component.TOP] = v1;<NEW_LINE>out[Component.LEFT] = out[Component.RIGHT] = v2;<NEW_LINE>out[Component.BOTTOM] = v3;<NEW_LINE>return out;<NEW_LINE>}<NEW_LINE>case 4:<NEW_LINE>{<NEW_LINE>ScalarValue v1 = parseSingleTRBLValue(parts[0]);<NEW_LINE>ScalarValue v2 = parseSingleTRBLValue(parts[1]);<NEW_LINE>ScalarValue v3 = parseSingleTRBLValue(parts[2]);<NEW_LINE>ScalarValue v4 = parseSingleTRBLValue(parts[3]);<NEW_LINE>out[Component.TOP] = v1;<NEW_LINE>out[Component.RIGHT] = v2;<NEW_LINE>out[Component.BOTTOM] = v3;<NEW_LINE>out[Component.LEFT] = v4;<NEW_LINE>return out;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
Util.split(val, " ");
37,908
private void removeCiphers(TlsContext ctx, ClientHelloMessage ch) {<NEW_LINE>String msgName = ch.toCompactString();<NEW_LINE>if (ch.getCipherSuites() == null) {<NEW_LINE>LOGGER.debug("No cipher suites found in " + msgName + ". Nothing to do.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>LOGGER.debug("Original cipher suites in " + msgName + ":\n" + summarizeCiphers(ch));<NEW_LINE>}<NEW_LINE>byte[] ciphersBytes = ch.getCipherSuites().getValue();<NEW_LINE>List<CipherSuite> <MASK><NEW_LINE>int origCiphersLength = ciphersBytes.length;<NEW_LINE>ByteArrayOutputStream newCiphersBytes = new ByteArrayOutputStream();<NEW_LINE>CipherSuite type;<NEW_LINE>for (CipherSuite cs : ciphers) {<NEW_LINE>LOGGER.debug("cipher.name, cipher.val = " + cs.name() + ", " + cs.getValue());<NEW_LINE>if (!removeCiphers.contains(cs)) {<NEW_LINE>try {<NEW_LINE>newCiphersBytes.write(cs.getByteValue());<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new WorkflowExecutionException("Could not write CipherSuite value to byte[]", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ch.setCipherSuites(newCiphersBytes.toByteArray());<NEW_LINE>int newSuitesLength = ch.getCipherSuites().getValue().length;<NEW_LINE>int diffSuitesLength = origCiphersLength - newSuitesLength;<NEW_LINE>int newMsgLength = ch.getLength().getValue() - diffSuitesLength;<NEW_LINE>ch.setLength(newMsgLength);<NEW_LINE>ch.setCipherSuiteLength(newSuitesLength);<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>LOGGER.debug("Modified cipher suites in " + msgName + ":\n" + summarizeCiphers(ch));<NEW_LINE>}<NEW_LINE>}
ciphers = CipherSuite.getCipherSuites(ciphersBytes);