idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
904,193
public void startExperiment(SearchForActions<NQueensBoard, QueenAction> search) {<NEW_LINE>search.addNodeListener(n -> notifyProgressTrackers(n.getState()<MASK><NEW_LINE>Problem<NQueensBoard, QueenAction> problem;<NEW_LINE>if (board.getNumberOfQueensOnBoard() == 0)<NEW_LINE>problem = new GeneralProblem<>(board, NQueensFunctions::getIFActions, NQueensFunctions::getResult, NQueensFunctions::testGoal);<NEW_LINE>else<NEW_LINE>problem = new GeneralProblem<>(board, NQueensFunctions::getCSFActions, NQueensFunctions::getResult, NQueensFunctions::testGoal);<NEW_LINE>Optional<List<QueenAction>> actions = search.findActions(problem);<NEW_LINE>if (actions.isPresent())<NEW_LINE>for (QueenAction action : actions.get()) board = NQueensFunctions.getResult(board, action);<NEW_LINE>notifyProgressTrackers(board, search.getMetrics());<NEW_LINE>}
, search.getMetrics()));
591,610
public static KeyPair genKeyPair(KeyPairType keyPairType, String provider, int keySize) throws CryptoException, NoSuchProviderException {<NEW_LINE>try {<NEW_LINE>if (keyPairType == KeyPairType.ECDSA) {<NEW_LINE>throw new CryptoException("Could not support ''" + keyPairType + "'' key pair.");<NEW_LINE>}<NEW_LINE>KeyPairGenerator keyPairGenerator = null;<NEW_LINE>if (provider == null) {<NEW_LINE>keyPairGenerator = KeyPairGenerator.<MASK><NEW_LINE>} else {<NEW_LINE>keyPairGenerator = KeyPairGenerator.getInstance(keyPairType.name(), provider);<NEW_LINE>}<NEW_LINE>// Create a SecureRandom<NEW_LINE>SecureRandom rand = SecureRandom.getInstance("SHA1PRNG");<NEW_LINE>// SecureRandom rand = new SecureRandom();<NEW_LINE>// Initialize key pair generator with key strength and a randomness<NEW_LINE>keyPairGenerator.initialize(keySize, rand);<NEW_LINE>// Generate and return the key pair<NEW_LINE>return keyPairGenerator.generateKeyPair();<NEW_LINE>} catch (NoSuchAlgorithmException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>throw new CryptoException("Could not generate ''" + keyPairType + "'' key pair.", ex);<NEW_LINE>} catch (InvalidParameterException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>throw new CryptoException("Invalid parameter for a ''" + keyPairType + "'' key pair.", ex);<NEW_LINE>}<NEW_LINE>}
getInstance(keyPairType.name());
448,263
public static void main(String[] args) throws ApiException, IOException, org.wso2.carbon.apimgt.samples.utils.store.rest.client.ApiException {<NEW_LINE>if (StringUtils.isEmpty(System.getProperty(Constants.JAVAX_NET_SSL_TRUST_STORE))) {<NEW_LINE>System.setProperty(Constants.JAVAX_NET_SSL_TRUST_STORE, clientTrustStore);<NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(System.getProperty(Constants.JAVAX_NET_SSL_TRUST_STORE_PASSWORD))) {<NEW_LINE>System.setProperty(Constants.JAVAX_NET_SSL_TRUST_STORE_PASSWORD, Constants.WSO2_CARBON);<NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(System.getProperty(Constants.JAVAX_NET_SSL_TRUST_STORE_TYPE))) {<NEW_LINE>System.setProperty(Constants.JAVAX_NET_SSL_TRUST_STORE_TYPE, Constants.JKS);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>WebAppDeployUtils.deployWebApp(serviceEndpoint, "admin", "admin", warFileLocation, warFileName);<NEW_LINE>List<String> apiIds = createAPIs();<NEW_LINE>publishAPIs(apiIds);<NEW_LINE>String accessTokenOne = subscribeToAPI(apiIds.get(0), "Application_one");<NEW_LINE>invokeAPI(accessTokenOne, 1, "/salariesSecure/1.0.0/salary/1");<NEW_LINE>String accessTokenTwo = subscribeToAPIWithNewScope(apiIds.get(1), "Application_two");<NEW_LINE>invokeAPI(accessTokenTwo, 1, "/salariesSecure/1.0.0/salary/1");<NEW_LINE>}
System.out.println("Deploying sample back end");
1,016,369
private Mono<Response<Void>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String connectionName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (workspaceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (connectionName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, connectionName, this.client.getApiVersion(), accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
1,222,814
private void init() {<NEW_LINE>this.setLayout(new BorderLayout());<NEW_LINE>// HEADER<NEW_LINE>Box boxV = Box.createVerticalBox();<NEW_LINE>// DIALS/HTML+Bars<NEW_LINE>Box boxH = Box.createHorizontalBox();<NEW_LINE>// DIALS<NEW_LINE>Box boxV1 = Box.createVerticalBox();<NEW_LINE>// HTML/Bars<NEW_LINE>Box boxV2 = Box.createVerticalBox();<NEW_LINE>// barChart<NEW_LINE><MASK><NEW_LINE>// boxH_V.setPreferredSize(new Dimension(180, 1500));<NEW_LINE>// boxH1.setPreferredSize(new Dimension(400, 180));<NEW_LINE>boxV2.setPreferredSize(new Dimension(120, 120));<NEW_LINE>// DIALS below HEADER, LEFT<NEW_LINE>for (int i = 0; i < m_goals.length; i++) {<NEW_LINE>PerformanceIndicator pi = new PerformanceIndicator(m_goals[i]);<NEW_LINE>pi.addActionListener(this);<NEW_LINE>boxV1.add(pi, BorderLayout.NORTH);<NEW_LINE>}<NEW_LINE>boxV1.add(Box.createVerticalGlue(), BorderLayout.CENTER);<NEW_LINE>JScrollPane scrollPane = new JScrollPane();<NEW_LINE>scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);<NEW_LINE>scrollPane.getViewport().add(boxV1, BorderLayout.CENTER);<NEW_LINE>scrollPane.setMinimumSize(new Dimension(190, 180));<NEW_LINE>// RIGHT, HTML + Bars<NEW_LINE>HtmlDashboard contentHtml = new HtmlDashboard("http:///local/home", m_goals, true);<NEW_LINE>boxV2.add(contentHtml, BorderLayout.CENTER);<NEW_LINE>for (int i = 0; i < java.lang.Math.min(2, m_goals.length); i++) {<NEW_LINE>if (// MGoal goal = pi.getGoal();<NEW_LINE>m_goals[i].getMeasure() != null)<NEW_LINE>boxH1.add(new Graph(m_goals[i]), BorderLayout.SOUTH);<NEW_LINE>}<NEW_LINE>boxV2.add(boxH1, BorderLayout.SOUTH);<NEW_LINE>// below HEADER<NEW_LINE>boxH.add(scrollPane, BorderLayout.WEST);<NEW_LINE>// space<NEW_LINE>boxH.add(Box.createHorizontalStrut(5));<NEW_LINE>boxH.add(boxV2, BorderLayout.CENTER);<NEW_LINE>// HEADER + below<NEW_LINE>HtmlDashboard t = new HtmlDashboard("http:///local/logo", null, false);<NEW_LINE>t.setMaximumSize(new Dimension(2000, 80));<NEW_LINE>// t.setPreferredSize(new Dimension(200,10));<NEW_LINE>// t.setMaximumSize(new Dimension(2000,10));<NEW_LINE>boxV.add(t, BorderLayout.NORTH);<NEW_LINE>// space<NEW_LINE>boxV.add(Box.createVerticalStrut(5));<NEW_LINE>boxV.add(boxH, BorderLayout.CENTER);<NEW_LINE>boxV.add(Box.createVerticalGlue());<NEW_LINE>// WINDOW<NEW_LINE>add(boxV, BorderLayout.CENTER);<NEW_LINE>}
Box boxH1 = Box.createHorizontalBox();
598,155
final CopyBackupToRegionResult executeCopyBackupToRegion(CopyBackupToRegionRequest copyBackupToRegionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(copyBackupToRegionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CopyBackupToRegionRequest> request = null;<NEW_LINE>Response<CopyBackupToRegionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CopyBackupToRegionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(copyBackupToRegionRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudHSM V2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CopyBackupToRegion");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CopyBackupToRegionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CopyBackupToRegionResultJsonUnmarshaller());<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.CLIENT_ENDPOINT, endpoint);
1,240,694
public boolean saveOrUpdateBatch(Collection<T> entityList, int batchSize) {<NEW_LINE>TableInfo tableInfo = TableInfoHelper.getTableInfo(entityClass);<NEW_LINE>Assert.notNull(tableInfo, "error: can not execute. because can not find cache of TableInfo for entity!");<NEW_LINE>String keyProperty = tableInfo.getKeyProperty();<NEW_LINE>Assert.notEmpty(keyProperty, "error: can not execute. because can not find column for id from entity!");<NEW_LINE>return SqlHelper.saveOrUpdateBatch(this.entityClass, this.mapperClass, this.log, entityList, batchSize, (sqlSession, entity) -> {<NEW_LINE>Object idVal = tableInfo.getPropertyValue(entity, keyProperty);<NEW_LINE>return StringUtils.checkValNull(idVal) || CollectionUtils.isEmpty(sqlSession.selectList(getSqlStatement(<MASK><NEW_LINE>}, (sqlSession, entity) -> {<NEW_LINE>MapperMethod.ParamMap<T> param = new MapperMethod.ParamMap<>();<NEW_LINE>param.put(Constants.ENTITY, entity);<NEW_LINE>sqlSession.update(getSqlStatement(SqlMethod.UPDATE_BY_ID), param);<NEW_LINE>});<NEW_LINE>}
SqlMethod.SELECT_BY_ID), entity));
798,716
public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> SelectSelectStep<Record16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>> select(SelectField<T1> field1, SelectField<T2> field2, SelectField<T3> field3, SelectField<T4> field4, SelectField<T5> field5, SelectField<T6> field6, SelectField<T7> field7, SelectField<T8> field8, SelectField<T9> field9, SelectField<T10> field10, SelectField<T11> field11, SelectField<T12> field12, SelectField<T13> field13, SelectField<T14> field14, SelectField<T15> field15, SelectField<T16> field16) {<NEW_LINE>return (SelectSelectStep) select(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13<MASK><NEW_LINE>}
, field14, field15, field16 });
589,238
public Optional<InputDataSourceId> retrieveInputDataSourceIdBy(@NonNull final InputDataSourceQuery query) {<NEW_LINE>final IQueryBL queryBL = Services.get(IQueryBL.class);<NEW_LINE>final IQueryBuilder<I_AD_InputDataSource> queryBuilder = queryBL.createQueryBuilder(<MASK><NEW_LINE>Check.assumeNotNull(query.getOrgId(), "Org Id is missing from InputDataSourceQuery ", query);<NEW_LINE>queryBuilder.addInArrayFilter(I_AD_InputDataSource.COLUMNNAME_AD_Org_ID, query.getOrgId(), OrgId.ANY);<NEW_LINE>if (!query.getInternalName().isEmpty()) {<NEW_LINE>queryBuilder.addEqualsFilter(I_AD_InputDataSource.COLUMNNAME_InternalName, query.getInternalName());<NEW_LINE>}<NEW_LINE>if (query.getExternalId() != null) {<NEW_LINE>queryBuilder.addEqualsFilter(I_AD_InputDataSource.COLUMNNAME_ExternalId, query.getExternalId().getValue());<NEW_LINE>}<NEW_LINE>if (!isEmpty(query.getValue(), true)) {<NEW_LINE>queryBuilder.addEqualsFilter(I_AD_InputDataSource.COLUMNNAME_Value, query.getValue());<NEW_LINE>}<NEW_LINE>if (query.getInputDataSourceId() != null) {<NEW_LINE>queryBuilder.addEqualsFilter(I_AD_InputDataSource.COLUMNNAME_AD_InputDataSource_ID, query.getInputDataSourceId());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final InputDataSourceId firstId = queryBuilder.create().firstIdOnly(InputDataSourceId::ofRepoIdOrNull);<NEW_LINE>return Optional.ofNullable(firstId);<NEW_LINE>} catch (final DBMoreThanOneRecordsFoundException e) {<NEW_LINE>// augment and rethrow<NEW_LINE>throw e.appendParametersToMessage().setParameter("inputDataSourceQuery", query);<NEW_LINE>}<NEW_LINE>}
I_AD_InputDataSource.class).addOnlyActiveRecordsFilter();
698,400
protected void mStep() {<NEW_LINE>double sumAlpha = alpha.sum();<NEW_LINE>double sumBeta = beta.sum();<NEW_LINE>double ak, br;<NEW_LINE>// update alpha vector<NEW_LINE>for (int k = 0; k < numTopics; k++) {<NEW_LINE><MASK><NEW_LINE>double numerator = 0, denominator = 0;<NEW_LINE>for (int u = 0; u < numUsers; u++) {<NEW_LINE>numerator += digamma(userTopicNum.get(u, k) + ak) - digamma(ak);<NEW_LINE>denominator += digamma(userNum.get(u) + sumAlpha) - digamma(sumAlpha);<NEW_LINE>}<NEW_LINE>if (numerator != 0)<NEW_LINE>alpha.set(k, ak * (numerator / denominator));<NEW_LINE>}<NEW_LINE>// update beta_k<NEW_LINE>for (int r = 0; r < numRatingLevels; r++) {<NEW_LINE>br = beta.get(r);<NEW_LINE>double numerator = 0, denominator = 0;<NEW_LINE>for (int i = 0; i < numItems; i++) {<NEW_LINE>for (int k = 0; k < numTopics; k++) {<NEW_LINE>numerator += digamma(topicItemRatingNum[k][i][r] + br) - digamma(br);<NEW_LINE>denominator += digamma(topicItemNum.get(k, i) + sumBeta) - digamma(sumBeta);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (numerator != 0)<NEW_LINE>beta.set(r, br * (numerator / denominator));<NEW_LINE>}<NEW_LINE>}
ak = alpha.get(k);
437,344
public ListV2LoggingLevelsResult listV2LoggingLevels(ListV2LoggingLevelsRequest listV2LoggingLevelsRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listV2LoggingLevelsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListV2LoggingLevelsRequest> request = null;<NEW_LINE>Response<ListV2LoggingLevelsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListV2LoggingLevelsRequestMarshaller().marshall(listV2LoggingLevelsRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<ListV2LoggingLevelsResult, JsonUnmarshallerContext> unmarshaller = new ListV2LoggingLevelsResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<ListV2LoggingLevelsResult> responseHandler = new JsonResponseHandler<ListV2LoggingLevelsResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
1,248,056
public void config(String name, final OServerParameterConfiguration[] iParameters) {<NEW_LINE>super.config(name, iParameters);<NEW_LINE>for (OServerParameterConfiguration param : iParameters) {<NEW_LINE>if (param.name.equalsIgnoreCase(PARAM_NETWORK_SSL_CLIENT_AUTH)) {<NEW_LINE>clientAuth = Boolean.parseBoolean(param.value);<NEW_LINE>} else if (param.name.equalsIgnoreCase(PARAM_NETWORK_SSL_KEYSTORE)) {<NEW_LINE>keyStorePath = param.value;<NEW_LINE>} else if (param.name.equalsIgnoreCase(PARAM_NETWORK_SSL_KEYSTORE_PASSWORD)) {<NEW_LINE>keyStorePassword = param.value;<NEW_LINE>} else if (param.name.equalsIgnoreCase(PARAM_NETWORK_SSL_KEYSTORE_TYPE)) {<NEW_LINE>keyStoreType = param.value;<NEW_LINE>} else if (param.name.equalsIgnoreCase(PARAM_NETWORK_SSL_TRUSTSTORE)) {<NEW_LINE>trustStorePath = param.value;<NEW_LINE>} else if (param.name.equalsIgnoreCase(PARAM_NETWORK_SSL_TRUSTSTORE_PASSWORD)) {<NEW_LINE>trustStorePassword = param.value;<NEW_LINE>} else if (param.name.equalsIgnoreCase(PARAM_NETWORK_SSL_TRUSTSTORE_TYPE)) {<NEW_LINE>trustStoreType = param.value;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (keyStorePath == null) {<NEW_LINE>throw new OConfigurationException("Missing parameter " + PARAM_NETWORK_SSL_KEYSTORE);<NEW_LINE>} else if (keyStorePassword == null) {<NEW_LINE>throw new OConfigurationException("Missing parameter " + PARAM_NETWORK_SSL_KEYSTORE_PASSWORD);<NEW_LINE>}<NEW_LINE>keyStoreFile = new File(keyStorePath);<NEW_LINE>if (!keyStoreFile.isAbsolute()) {<NEW_LINE>keyStoreFile = new File(OSystemVariableResolver.resolveSystemVariables("${ORIENTDB_HOME}"), keyStorePath);<NEW_LINE>}<NEW_LINE>if (trustStorePath != null) {<NEW_LINE>trustStoreFile = new File(trustStorePath);<NEW_LINE>if (!trustStoreFile.isAbsolute()) {<NEW_LINE>trustStoreFile = new File(OSystemVariableResolver<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.resolveSystemVariables("${ORIENTDB_HOME}"), trustStorePath);
545,833
public static void initialize(Core core) {<NEW_LINE>ConfigurationManager config = ConfigurationManager.getInstance();<NEW_LINE>if ("az2".equalsIgnoreCase(config.getStringParameter("ui", "az3"))) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int userMode = COConfigurationManager.getIntParameter("User Mode");<NEW_LINE>boolean startAdvanced = userMode > 1;<NEW_LINE>boolean configNeedsSave = false;<NEW_LINE>final ConfigurationDefaults defaults = ConfigurationDefaults.getInstance();<NEW_LINE>defaults.addParameter("ui", "az3");<NEW_LINE>defaults.addParameter("Auto Upload Speed Enabled", true);<NEW_LINE>defaults.addParameter(ConfigurationDefaults.CFG_TORRENTADD_OPENOPTIONS, startAdvanced ? ConfigurationDefaults.CFG_TORRENTADD_OPENOPTIONS_ALWAYS : ConfigurationDefaults.CFG_TORRENTADD_OPENOPTIONS_MANY);<NEW_LINE>// defaults.addParameter("Add URL Silently", true); not used 11/30/2015 - see "Activate Window On External Download"<NEW_LINE>// defaults.addParameter("add_torrents_silently", true); not used 11/30/2015<NEW_LINE>defaults.addParameter("Popup Download Finished", false);<NEW_LINE>defaults.addParameter("Popup Download Added", false);<NEW_LINE>defaults.addParameter("Status Area Show SR", false);<NEW_LINE>defaults.addParameter("Status Area Show NAT", false);<NEW_LINE>defaults.addParameter("Status Area Show IPF", false);<NEW_LINE>defaults.addParameter("Status Area Show RIP", true);<NEW_LINE>defaults.addParameter("Message Popup Autoclose in Seconds", 10);<NEW_LINE>defaults.addParameter("window.maximized", true);<NEW_LINE>defaults.addParameter("update.autodownload", true);<NEW_LINE>// defaults.addParameter("suppress_file_download_dialog", true);<NEW_LINE>defaults.addParameter("auto_remove_inactive_items", false);<NEW_LINE>defaults.addParameter("show_torrents_menu", false);<NEW_LINE>config.removeParameter("v3.home-tab.starttab");<NEW_LINE>defaults.addParameter("MyTorrentsView.table.style", 0);<NEW_LINE>defaults.addParameter("v3.Show Welcome", true);<NEW_LINE>defaults.addParameter("Library.viewmode", startAdvanced ? 1 : 0);<NEW_LINE>defaults.addParameter("LibraryDL.viewmode", startAdvanced ? 1 : 0);<NEW_LINE><MASK><NEW_LINE>defaults.addParameter("LibraryUnopened.viewmode", startAdvanced ? 1 : 0);<NEW_LINE>defaults.addParameter("LibraryCD.viewmode", startAdvanced ? 1 : 0);<NEW_LINE>defaults.addParameter("Library.EnableSimpleView", 1);<NEW_LINE>defaults.addParameter("Library.CatInSideBar", startAdvanced ? 1 : 0);<NEW_LINE>defaults.addParameter("Library.TagInSideBar", 1);<NEW_LINE>defaults.addParameter("Library.TagGroupsInSideBar", true);<NEW_LINE>defaults.addParameter("Library.ShowTabsInTorrentView", 1);<NEW_LINE>defaults.addParameter("list.dm.dblclick", "0");<NEW_LINE>// === defaults used by MainWindow<NEW_LINE>defaults.addParameter("vista.adminquit", false);<NEW_LINE>defaults.addParameter("Start Minimized", false);<NEW_LINE>defaults.addParameter("Password enabled", false);<NEW_LINE>defaults.addParameter("ToolBar.showText", true);<NEW_LINE>defaults.addParameter("Table.extendedErase", !Constants.isWindowsXP);<NEW_LINE>defaults.addParameter("Table.useTree", true);<NEW_LINE>// by default, turn off some slidey warning<NEW_LINE>// Since they are plugin configs, we need to set the default after the<NEW_LINE>// plugin sets the default<NEW_LINE>core.addLifecycleListener(new CoreLifecycleAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void started(Core core) {<NEW_LINE>defaults.addParameter("Plugin.DHT.dht.warn.user", false);<NEW_LINE>defaults.addParameter("Plugin.UPnP.upnp.alertothermappings", false);<NEW_LINE>defaults.addParameter("Plugin.UPnP.upnp.alertdeviceproblems", false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (configNeedsSave) {<NEW_LINE>config.save();<NEW_LINE>}<NEW_LINE>}
defaults.addParameter("LibraryDL.UseDefaultIndicatorColor", false);
1,153,405
public void fileJournalChanged() {<NEW_LINE><MASK><NEW_LINE>for (long i = USN - 1; i >= lastUSN; --i) {<NEW_LINE>FileSystemJournalEntry entry = FileSystemJournal.getEntry(i);<NEW_LINE>if (entry != null) {<NEW_LINE>String path = entry.getPath();<NEW_LINE>if (entry.getEvent() == FileSystemJournalEntry.FILE_ADDED && path.endsWith(".amr")) {<NEW_LINE>UiApplication.getUiApplication().removeFileSystemJournalListener(this);<NEW_LINE>try {<NEW_LINE>EventInjector.KeyEvent inject = new EventInjector.KeyEvent(EventInjector.KeyEvent.KEY_DOWN, Characters.ESCAPE, 0, 200);<NEW_LINE>inject.post();<NEW_LINE>} catch (Exception e) {<NEW_LINE>// try to close the voicenotesrecorder<NEW_LINE>}<NEW_LINE>captureCallback.fireActionEvent(new ActionEvent("file://" + path));<NEW_LINE>captureCallback = null;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastUSN = USN;<NEW_LINE>}
long USN = FileSystemJournal.getNextUSN();
470,799
public List<String> sortMetricNames(String groupName, List<String> originMetricNames) {<NEW_LINE>Group <MASK><NEW_LINE>List<String> result = new ArrayList<String>();<NEW_LINE>if (group != null) {<NEW_LINE>List<Metric> list = new ArrayList<Metric>();<NEW_LINE>for (Entry<String, Metric> entry : group.getMetrics().entrySet()) {<NEW_LINE>if (originMetricNames.contains(entry.getKey())) {<NEW_LINE>list.add(entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Collections.sort(list, new Comparator<Metric>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(Metric m1, Metric m2) {<NEW_LINE>return m1.getOrder() - m2.getOrder();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>for (Metric metric : list) {<NEW_LINE>result.add(metric.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String originMetricName : originMetricNames) {<NEW_LINE>if (!result.contains(originMetricName)) {<NEW_LINE>result.add(originMetricName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
group = m_config.findGroup(groupName);
1,458,640
private SSLContext createSslContext(SecurityStore keystore, SecurityStore truststore) {<NEW_LINE>try {<NEW_LINE>SSLContext sslContext;<NEW_LINE>if (isNotEmpty(provider)) {<NEW_LINE>sslContext = SSLContext.getInstance(protocol, provider);<NEW_LINE>} else {<NEW_LINE>sslContext = SSLContext.getInstance(protocol);<NEW_LINE>}<NEW_LINE>KeyManager[] keyManagers = null;<NEW_LINE>if (keystore != null || isNotEmpty(kmfAlgorithm)) {<NEW_LINE>String kmfAlgorithm;<NEW_LINE>if (isNotEmpty(this.kmfAlgorithm)) {<NEW_LINE>kmfAlgorithm = this.kmfAlgorithm;<NEW_LINE>} else {<NEW_LINE>kmfAlgorithm = KeyManagerFactory.getDefaultAlgorithm();<NEW_LINE>}<NEW_LINE>KeyManagerFactory <MASK><NEW_LINE>if (keystore != null) {<NEW_LINE>kmf.init(keystore.get(), keystore.keyPassword());<NEW_LINE>} else {<NEW_LINE>kmf.init(null, null);<NEW_LINE>}<NEW_LINE>keyManagers = kmf.getKeyManagers();<NEW_LINE>}<NEW_LINE>String tmfAlgorithm = isNotEmpty(this.tmfAlgorithm) ? this.tmfAlgorithm : TrustManagerFactory.getDefaultAlgorithm();<NEW_LINE>TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmfAlgorithm);<NEW_LINE>KeyStore ts = truststore == null ? null : truststore.get();<NEW_LINE>tmf.init(ts);<NEW_LINE>sslContext.init(keyManagers, tmf.getTrustManagers(), this.secureRandomImplementation);<NEW_LINE>log.debug("Created SSL context with keystore {}, truststore {}, provider {}.", keystore, truststore, sslContext.getProvider().getName());<NEW_LINE>return sslContext;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new KafkaException(e);<NEW_LINE>}<NEW_LINE>}
kmf = KeyManagerFactory.getInstance(kmfAlgorithm);
1,218,152
private void updateTransformTaskConfig(TransformTask transformTask, @NonNull Collection<TransformStream> consumedInputStreams, @NonNull Collection<TransformStream> referencedInputStreams, @Nullable IntermediateStream outputStream) throws IllegalAccessException {<NEW_LINE>Field consumedInputStreamsField = FieldUtils.getDeclaredField(StreamBasedTask.class, "consumedInputStreams", true);<NEW_LINE>Field referencedInputStreamsField = FieldUtils.getDeclaredField(<MASK><NEW_LINE>Field outputStreamField = FieldUtils.getDeclaredField(StreamBasedTask.class, "outputStream", true);<NEW_LINE>if (null == consumedInputStreamsField || null == referencedInputStreamsField || null == outputStreamField) {<NEW_LINE>throw new StopExecutionException("The TransformTask does not has field with name: consumedInputStreams or referencedInputStreams or outputStream! Plugin version does not support!");<NEW_LINE>}<NEW_LINE>consumedInputStreamsField.set(transformTask, consumedInputStreams);<NEW_LINE>referencedInputStreamsField.set(transformTask, referencedInputStreams);<NEW_LINE>outputStreamField.set(transformTask, outputStream);<NEW_LINE>}
StreamBasedTask.class, "referencedInputStreams", true);
1,010,538
private void moveRuntimeDataFile(Path dir) {<NEW_LINE>File runtimeDataNewLoc = dir.resolve(BfConsts.RELPATH_BATFISH).resolve(BfConsts.RELPATH_RUNTIME_DATA_FILE).toFile();<NEW_LINE>File runtimeDataOldLoc = dir.resolve(<MASK><NEW_LINE>if (runtimeDataNewLoc.exists()) {<NEW_LINE>// The runtime data file already exists under batfish subdirectory. Delete the one at the root<NEW_LINE>// directory (if it exists).<NEW_LINE>FileUtils.deleteQuietly(runtimeDataOldLoc);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Move runtime data file at top-level to batfish/ subfolder<NEW_LINE>if (runtimeDataOldLoc.exists()) {<NEW_LINE>File batfishDir = dir.resolve(BfConsts.RELPATH_BATFISH).toFile();<NEW_LINE>try {<NEW_LINE>FileUtils.forceMkdir(batfishDir);<NEW_LINE>FileUtils.copyFileToDirectory(runtimeDataOldLoc, batfishDir);<NEW_LINE>FileUtils.deleteQuietly(runtimeDataOldLoc);<NEW_LINE>} catch (IOException e) {<NEW_LINE>_logger.warn("Failed to move runtime data file into batfish/ folder");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
BfConsts.RELPATH_RUNTIME_DATA_FILE).toFile();
1,178,499
private void parse() {<NEW_LINE>// From: https://tools.ietf.org/html/rfc7231#section-3.1.1.1<NEW_LINE>// The type, subtype, and parameter name tokens are case-insensitive.<NEW_LINE>// media-type = type "/" subtype *( OWS ";" OWS parameter )<NEW_LINE>// type = token.<NEW_LINE>type = parseToken().toLowerCase(Locale.US);<NEW_LINE>expect('/');<NEW_LINE>// subtype = token<NEW_LINE>subtype = parseToken().toLowerCase(Locale.US);<NEW_LINE>ws();<NEW_LINE>// parameter = token "=" ( token / quoted-string )<NEW_LINE>while (!eof()) {<NEW_LINE>expect(';');<NEW_LINE>ws();<NEW_LINE>String name = parseToken().toLowerCase(Locale.US);<NEW_LINE>expect('=');<NEW_LINE>String value = peek() == '"' <MASK><NEW_LINE>parameters.put(name, value);<NEW_LINE>ws();<NEW_LINE>}<NEW_LINE>}
? parseQuotedString() : parseToken();
1,700,423
protected void internalTraverseAttributesByView(View view, Entity entity, EntityAttributeVisitor visitor, Map<Entity, Set<View>> visited, boolean checkLoaded) {<NEW_LINE>Set<View> views = visited.get(entity);<NEW_LINE>if (views == null) {<NEW_LINE>views = new HashSet<>();<NEW_LINE>visited.put(entity, views);<NEW_LINE>} else if (views.contains(view)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>views.add(view);<NEW_LINE>MetaClass metaClass = metadata.getClassNN(entity.getClass());<NEW_LINE>for (ViewProperty property : view.getProperties()) {<NEW_LINE>MetaProperty metaProperty = metaClass.getPropertyNN(property.getName());<NEW_LINE>if (visitor.skip(metaProperty))<NEW_LINE>continue;<NEW_LINE>if (checkLoaded && !persistentAttributesLoadChecker.isLoaded(entity, metaProperty.getName()))<NEW_LINE>continue;<NEW_LINE><MASK><NEW_LINE>visitor.visit(entity, metaProperty);<NEW_LINE>Object value = entity.getValue(property.getName());<NEW_LINE>if (value != null && propertyView != null) {<NEW_LINE>if (value instanceof Collection) {<NEW_LINE>for (Object item : ((Collection) value)) {<NEW_LINE>if (item instanceof Instance)<NEW_LINE>internalTraverseAttributesByView(propertyView, (Entity) item, visitor, visited, checkLoaded);<NEW_LINE>}<NEW_LINE>} else if (value instanceof Instance) {<NEW_LINE>internalTraverseAttributesByView(propertyView, (Entity) value, visitor, visited, checkLoaded);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
View propertyView = property.getView();
444,104
// default match algorithm, find match for character under cursor<NEW_LINE>@Override<NEW_LINE>protected int destination(int offset, TextContent content, int count) throws CommandExecutionException {<NEW_LINE>LineInformation line = content.getLineInformationOfOffset(offset);<NEW_LINE>// Check for one-character pairs.<NEW_LINE>int startIndex = offset;<NEW_LINE>if (offset == line.getEndOffset() && line.getLength() > 0) {<NEW_LINE>// Special case in visual mode: if the cursor is past the end of<NEW_LINE>// line (on top of the line break), we should start looking at the<NEW_LINE>// character before.<NEW_LINE>startIndex--;<NEW_LINE>}<NEW_LINE>for (int index = startIndex; index < line.getEndOffset(); index++) {<NEW_LINE>String c = <MASK><NEW_LINE>if (PARENTHESES.containsKey(c)) {<NEW_LINE>return findMatch(index, PARENTHESES.get(c), content, count);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Check for a block comment.<NEW_LINE>ParenthesesPair pair = getBlockComment(offset, content);<NEW_LINE>if (pair != null) {<NEW_LINE>return findBlockMatch(offset, pair, content);<NEW_LINE>}<NEW_LINE>// Check for C Pre-processor conditionals.<NEW_LINE>if (CPreProcessorMove.containsPreProcessor(content, line, offset)) {<NEW_LINE>return new CPreProcessorMove().destination(offset, content, count);<NEW_LINE>}<NEW_LINE>throw new CommandExecutionException("no parentheses to jump found");<NEW_LINE>}
content.getText(index, 1);
680,497
static Map<String, Map<String, Map<String, IpSpace>>> union(Map<String, Map<String, Map<String, IpSpace>>> ipSpaces1, Map<String, Map<String, Map<String, IpSpace>>> ipSpaces2) {<NEW_LINE>checkArgument(ipSpaces1.keySet().equals(ipSpaces2.keySet()), "Can't union with different nodes: %s and %s", ipSpaces1.keySet(), ipSpaces2.keySet());<NEW_LINE>return toImmutableMap(ipSpaces1, Entry::getKey, /* hostname */<NEW_LINE>nodeEntry -> {<NEW_LINE>Map<String, Map<String, IpSpace>> nodeIpSpace2 = ipSpaces2.get(nodeEntry.getKey());<NEW_LINE>checkArgument(nodeIpSpace2.keySet().equals(nodeEntry.getValue().keySet()), "Can't union with different VRFs in node %s: %s and %s", nodeEntry.getKey(), nodeEntry.getValue().keySet(), nodeIpSpace2.keySet());<NEW_LINE>return toImmutableMap(nodeEntry.getValue(), Entry::getKey, /* vrf */<NEW_LINE>vrfEntry -> {<NEW_LINE>Map<String, IpSpace> vrfIpSpaces2 = nodeIpSpace2.get(vrfEntry.getKey());<NEW_LINE>checkArgument(vrfIpSpaces2.keySet().equals(vrfEntry.getValue().keySet()), "Can't union with different interfaces in node %s VRF %s: %s and %s", nodeEntry.getKey(), vrfEntry.getKey(), vrfEntry.getValue().keySet(<MASK><NEW_LINE>return toImmutableMap(vrfEntry.getValue(), Entry::getKey, /* interface */<NEW_LINE>ifaceEntry -> AclIpSpace.union(ifaceEntry.getValue(), vrfIpSpaces2.get(ifaceEntry.getKey())));<NEW_LINE>});<NEW_LINE>});<NEW_LINE>}
), vrfIpSpaces2.keySet());
461,341
public double findPutMessageEntireTimePX(double px) {<NEW_LINE>Map<Long, LongAdder> lastBuckets = this.lastBuckets;<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>double result = 0.0;<NEW_LINE>long totalRequest = lastBuckets.values().stream().mapToLong(LongAdder::longValue).sum();<NEW_LINE>long pxIndex = (long) (totalRequest * px);<NEW_LINE>long passCount = 0;<NEW_LINE>List<Long> bucketValue = new ArrayList<>(lastBuckets.keySet());<NEW_LINE>for (int i = 0; i < bucketValue.size(); i++) {<NEW_LINE>long count = lastBuckets.get(bucketValue.get(i)).longValue();<NEW_LINE>if (pxIndex <= passCount + count) {<NEW_LINE>long relativeIndex = pxIndex - passCount;<NEW_LINE>if (i == 0) {<NEW_LINE>result = count == 0 ? 0 : bucketValue.get(i<MASK><NEW_LINE>} else {<NEW_LINE>long lastBucket = bucketValue.get(i - 1);<NEW_LINE>result = lastBucket + (count == 0 ? 0 : (bucketValue.get(i) - lastBucket) * relativeIndex / (double) count);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>passCount += count;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log.info("findPutMessageEntireTimePX {}={}ms cost {}ms", px, String.format("%.2f", result), System.currentTimeMillis() - start);<NEW_LINE>return result;<NEW_LINE>}
) * relativeIndex / (double) count;
20,695
protected AuthenticationResponse authenticateWithExtension(String pluginId, AccessTokenCredential credentials, SecurityAuthConfig authConfig, List<PluginRoleConfig> pluginRoleConfigs) {<NEW_LINE>String username = credentials.getAccessToken().getUsername();<NEW_LINE>if (authorizationExtensionCacheService.isValidUser(pluginId, username, authConfig)) {<NEW_LINE>List<String> roles = new ArrayList<>();<NEW_LINE>if (store.doesPluginSupportGetUserRolesCall(pluginId)) {<NEW_LINE>roles.addAll(authorizationExtensionCacheService.getUserRoles(pluginId, username, authConfig, pluginRoleConfigs));<NEW_LINE>}<NEW_LINE>com.thoughtworks.go.domain.User fetched = userService.findUserByName(username);<NEW_LINE>User user = new User(fetched.getUsername().getUsername().toString(), fetched.getDisplayName(), fetched.getEmail());<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>String msg = String.format("Access Token belonging to the user has either been disabled, removed or expired. ", username, pluginId, authConfig.getId());<NEW_LINE>throw new InvalidAccessTokenException(msg);<NEW_LINE>}<NEW_LINE>}
return new AuthenticationResponse(user, roles);
984,537
final CreateVirtualRouterResult executeCreateVirtualRouter(CreateVirtualRouterRequest createVirtualRouterRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createVirtualRouterRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateVirtualRouterRequest> request = null;<NEW_LINE>Response<CreateVirtualRouterResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateVirtualRouterRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createVirtualRouterRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "App Mesh");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateVirtualRouter");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateVirtualRouterResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new CreateVirtualRouterResultJsonUnmarshaller());
1,378,049
private void updateReasonerStatus(ReasonerStatus status) {<NEW_LINE>reasonerStatus.<MASK><NEW_LINE>startReasonerAction.setEnabled(status.isEnableInitialization());<NEW_LINE>startReasonerAction.putValue(Action.SHORT_DESCRIPTION, status.getInitializationTooltip());<NEW_LINE>synchronizeReasonerAction.setEnabled(status.isEnableSynchronization());<NEW_LINE>synchronizeReasonerAction.putValue(Action.SHORT_DESCRIPTION, status.getSynchronizationTooltip());<NEW_LINE>stopReasonerAction.setEnabled(status.isEnableStop());<NEW_LINE>explainInconsistentOntologyAction.setEnabled(status == ReasonerStatus.INCONSISTENT);<NEW_LINE>KeyStroke shortcut = KeyStroke.getKeyStroke(KeyEvent.VK_R, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask());<NEW_LINE>startReasonerAction.putValue(Action.ACCELERATOR_KEY, status.isEnableInitialization() ? shortcut : null);<NEW_LINE>synchronizeReasonerAction.putValue(Action.ACCELERATOR_KEY, status.isEnableSynchronization() ? shortcut : null);<NEW_LINE>}
setText(status.getDescription());
779,099
void monitor(ArcConfig config, BuildProducer<DevConsoleRuntimeTemplateInfoBuildItem> runtimeInfos, BuildProducer<AdditionalBeanBuildItem> beans, BuildProducer<AnnotationsTransformerBuildItem> annotationTransformers, CustomScopeAnnotationsBuildItem customScopes, List<BeanDefiningAnnotationBuildItem> beanDefiningAnnotations, CurateOutcomeBuildItem curateOutcomeBuildItem) {<NEW_LINE>if (!config.devMode.monitoringEnabled) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!config.transformUnproxyableClasses) {<NEW_LINE>throw new IllegalStateException("Dev UI problem: monitoring of CDI business method invocations not possible\n\t- quarkus.arc.transform-unproxyable-classes was set to false and therefore it would not be possible to apply interceptors to unproxyable bean classes\n\t- please disable the monitoring feature via quarkus.arc.dev-mode.monitoring-enabled=false or enable unproxyable classes transformation");<NEW_LINE>}<NEW_LINE>// Events<NEW_LINE>runtimeInfos.produce(new DevConsoleRuntimeTemplateInfoBuildItem("eventsMonitor", new BeanLookupSupplier(EventsMonitor.class), this.getClass(), curateOutcomeBuildItem));<NEW_LINE>beans.produce(AdditionalBeanBuildItem.unremovableOf(EventsMonitor.class));<NEW_LINE>// Invocations<NEW_LINE>beans.produce(AdditionalBeanBuildItem.builder().setUnremovable().addBeanClasses(InvocationTree.class, InvocationsMonitor.class, InvocationInterceptor.class, Monitored.class).build());<NEW_LINE>Set<DotName> skipNames = new HashSet<>();<NEW_LINE>skipNames.add(DotName.createSimple(InvocationTree.class.getName()));<NEW_LINE>skipNames.add(DotName.createSimple(InvocationsMonitor.class.getName()));<NEW_LINE>skipNames.add(DotName.createSimple(EventsMonitor.class.getName()));<NEW_LINE>annotationTransformers.produce(new AnnotationsTransformerBuildItem(new AnnotationsTransformer() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void transform(TransformationContext transformationContext) {<NEW_LINE>if (transformationContext.isClass()) {<NEW_LINE>ClassInfo beanClass = transformationContext<MASK><NEW_LINE>if ((customScopes.isScopeDeclaredOn(beanClass) || isAdditionalBeanDefiningAnnotationOn(beanClass, beanDefiningAnnotations)) && !skipNames.contains(beanClass.name())) {<NEW_LINE>transformationContext.transform().add(Monitored.class).done();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>runtimeInfos.produce(new DevConsoleRuntimeTemplateInfoBuildItem("invocationsMonitor", new BeanLookupSupplier(InvocationsMonitor.class), this.getClass(), curateOutcomeBuildItem));<NEW_LINE>}
.getTarget().asClass();
997,926
public com.amazonaws.services.cloudcontrolapi.model.GeneralServiceException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.cloudcontrolapi.model.GeneralServiceException generalServiceException = new com.amazonaws.services.<MASK><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>} 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 generalServiceException;<NEW_LINE>}
cloudcontrolapi.model.GeneralServiceException(null);
1,056,928
private void addConnectionActions(Menu menu, IDiagramModelArchimateComponent sourceDiagramModelComponent) {<NEW_LINE>for (EClass relationshipType : ArchimateModelUtils.getRelationsClasses()) {<NEW_LINE>if (ArchimateModelUtils.isValidRelationshipStart(sourceDiagramModelComponent.getArchimateConcept(), relationshipType)) {<NEW_LINE>MenuItem item = addConnectionAction(menu, relationshipType, false);<NEW_LINE>Menu subMenu = new Menu(item);<NEW_LINE>item.setMenu(subMenu);<NEW_LINE>addConnectionActions(subMenu, Messages.MagicConnectionCreationTool_7, sourceDiagramModelComponent, ArchimateModelUtils.getStrategyClasses(), relationshipType);<NEW_LINE>addConnectionActions(subMenu, Messages.MagicConnectionCreationTool_0, sourceDiagramModelComponent, <MASK><NEW_LINE>addConnectionActions(subMenu, Messages.MagicConnectionCreationTool_1, sourceDiagramModelComponent, ArchimateModelUtils.getApplicationClasses(), relationshipType);<NEW_LINE>addConnectionActions(subMenu, Messages.MagicConnectionCreationTool_2, sourceDiagramModelComponent, ArchimateModelUtils.getTechnologyClasses(), relationshipType);<NEW_LINE>addConnectionActions(subMenu, Messages.MagicConnectionCreationTool_9, sourceDiagramModelComponent, ArchimateModelUtils.getPhysicalClasses(), relationshipType);<NEW_LINE>addConnectionActions(subMenu, Messages.MagicConnectionCreationTool_3, sourceDiagramModelComponent, ArchimateModelUtils.getMotivationClasses(), relationshipType);<NEW_LINE>addConnectionActions(subMenu, Messages.MagicConnectionCreationTool_4, sourceDiagramModelComponent, ArchimateModelUtils.getImplementationMigrationClasses(), relationshipType);<NEW_LINE>addConnectionActions(subMenu, Messages.MagicConnectionCreationTool_8, sourceDiagramModelComponent, getOtherAndConnectorClasses(), relationshipType);<NEW_LINE>if (subMenu.getItemCount() == 0) {<NEW_LINE>// Nothing there<NEW_LINE>item.dispose();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ArchimateModelUtils.getBusinessClasses(), relationshipType);
637,081
protected void CopyString20(int Length, int Distance) {<NEW_LINE>lastDist = oldDist<MASK><NEW_LINE>lastLength = Length;<NEW_LINE>destUnpSize -= Length;<NEW_LINE>int DestPtr = unpPtr - Distance;<NEW_LINE>if (DestPtr < Compress.MAXWINSIZE - 300 && unpPtr < Compress.MAXWINSIZE - 300) {<NEW_LINE>window[unpPtr++] = window[DestPtr++];<NEW_LINE>window[unpPtr++] = window[DestPtr++];<NEW_LINE>while (Length > 2) {<NEW_LINE>Length--;<NEW_LINE>window[unpPtr++] = window[DestPtr++];<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>while ((Length--) != 0) {<NEW_LINE>window[unpPtr] = window[DestPtr++ & Compress.MAXWINMASK];<NEW_LINE>unpPtr = (unpPtr + 1) & Compress.MAXWINMASK;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
[oldDistPtr++ & 3] = Distance;
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", <MASK><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>pp.startElement("group", null);<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>}
"" + config.getThreshold());
1,064,478
private int predictSerializedSize(final byte server_version) {<NEW_LINE>int size = 0;<NEW_LINE>// int: Number of parameters.<NEW_LINE>size += 4;<NEW_LINE>// byte: Type of the 1st parameter.<NEW_LINE>size += 1;<NEW_LINE>// byte: Type again (see HBASE-2877).<NEW_LINE>size += 1;<NEW_LINE>// int: How many regions do we want to affect?<NEW_LINE>size += 4;<NEW_LINE>byte[] prev_region = EMPTY_BYTES;<NEW_LINE>for (ActionEntry entry : batch) {<NEW_LINE>GetRequest req = entry.rpc;<NEW_LINE>byte[] region_name = req.getRegion().name();<NEW_LINE>boolean new_region = !Bytes.equals(prev_region, region_name);<NEW_LINE>if (new_region) {<NEW_LINE>// vint: region name length (3 bytes => max length = 32768).<NEW_LINE>size += 3;<NEW_LINE>// The region name.<NEW_LINE>size += region_name.length;<NEW_LINE>// int: How many RPCs for this region.<NEW_LINE>size += 4;<NEW_LINE>prev_region = req.getRegion().name();<NEW_LINE>}<NEW_LINE>// action<NEW_LINE>// byte: Type code for 'Action'.<NEW_LINE>size += 1;<NEW_LINE>// byte: Type code again.<NEW_LINE>size += 1;<NEW_LINE>// byte: Type code for 'Row'<NEW_LINE>size += 1;<NEW_LINE>// byte: Type code for 'Get'<NEW_LINE>size += 1;<NEW_LINE><MASK><NEW_LINE>// int: Index of the action.<NEW_LINE>size += 4;<NEW_LINE>// 3bytes: action result 'null'<NEW_LINE>size += 3;<NEW_LINE>}<NEW_LINE>return size;<NEW_LINE>}
size += req.predictSerializedSize(server_version);
1,677,330
private void updateCoProductCosts(MPPProductBOM bom, MCost baseDimension, String trxName) {<NEW_LINE>// Skip if not BOM found<NEW_LINE>if (bom == null)<NEW_LINE>return;<NEW_LINE>AtomicReference<BigDecimal> costPriceTotal = new AtomicReference<>(Env.ZERO);<NEW_LINE>// Iterate bom lines<NEW_LINE>Arrays.stream(bom.getLines()).filter(bomLine -> bomLine != null && bomLine.isCoProduct()).forEach(bomLine -> {<NEW_LINE>final BigDecimal costPrice = baseDimension.getFutureCostPriceLL().multiply(bomLine.getCostAllocationPerc(true));<NEW_LINE>// Get/Create Cost<NEW_LINE>MCost dimension = // ASI<NEW_LINE>MCost.// ASI<NEW_LINE>getDimension(// ASI<NEW_LINE>(MProduct) bomLine.getM_Product(), // ASI<NEW_LINE>baseDimension.getC_AcctSchema_ID(), // ASI<NEW_LINE>baseDimension.getAD_Org_ID(), // ASI<NEW_LINE>baseDimension.getM_Warehouse_ID(), 0, baseDimension.getM_CostType_ID(), baseDimension.getM_CostElement_ID());<NEW_LINE>if (dimension == null) {<NEW_LINE>dimension = new MCost(baseDimension.getCtx(), 0, trxName);<NEW_LINE>dimension.setAD_Org_ID(baseDimension.getAD_Org_ID());<NEW_LINE>dimension.<MASK><NEW_LINE>dimension.setM_Warehouse_ID(baseDimension.getM_Warehouse_ID());<NEW_LINE>dimension.setM_CostType_ID(baseDimension.getM_CostType_ID());<NEW_LINE>dimension.setC_AcctSchema_ID(baseDimension.getC_AcctSchema_ID());<NEW_LINE>dimension.setM_CostElement_ID(baseDimension.getM_CostElement_ID());<NEW_LINE>dimension.setM_AttributeSetInstance_ID(0);<NEW_LINE>}<NEW_LINE>dimension.setFutureCostPriceLL(costPrice);<NEW_LINE>if (!dimension.isCostFrozen())<NEW_LINE>dimension.setCurrentCostPriceLL(costPrice);<NEW_LINE>dimension.saveEx();<NEW_LINE>costPriceTotal.updateAndGet(costAmt -> costAmt.add(costPrice));<NEW_LINE>});<NEW_LINE>// Update Base Cost:<NEW_LINE>if (costPriceTotal.get().signum() != 0)<NEW_LINE>baseDimension.setFutureCostPriceLL(costPriceTotal.get());<NEW_LINE>}
setM_Product_ID(bomLine.getM_Product_ID());
100,421
public Response generateInstallation(KeycloakSession session, RealmModel realm, ClientModel client, URI baseUri) {<NEW_LINE>ClientManager.InstallationAdapterConfig rep = new ClientManager.InstallationAdapterConfig();<NEW_LINE>rep.setAuthServerUrl(baseUri.toString());<NEW_LINE>rep.setRealm(realm.getName());<NEW_LINE>rep.setSslRequired(realm.getSslRequired().<MASK><NEW_LINE>if (client.isPublicClient() && !client.isBearerOnly())<NEW_LINE>rep.setPublicClient(true);<NEW_LINE>if (client.isBearerOnly())<NEW_LINE>rep.setBearerOnly(true);<NEW_LINE>if (client.getRolesStream().count() > 0)<NEW_LINE>rep.setUseResourceRoleMappings(true);<NEW_LINE>rep.setResource(client.getClientId());<NEW_LINE>if (showClientCredentialsAdapterConfig(client)) {<NEW_LINE>Map<String, Object> adapterConfig = getClientCredentialsAdapterConfig(session, client);<NEW_LINE>rep.setCredentials(adapterConfig);<NEW_LINE>}<NEW_LINE>if (showVerifyTokenAudience(client)) {<NEW_LINE>rep.setVerifyTokenAudience(true);<NEW_LINE>}<NEW_LINE>configureAuthorizationSettings(session, client, rep);<NEW_LINE>String json = null;<NEW_LINE>try {<NEW_LINE>json = JsonSerialization.writeValueAsPrettyString(rep);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>return Response.ok(json, MediaType.TEXT_PLAIN_TYPE).build();<NEW_LINE>}
name().toLowerCase());
261,189
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {<NEW_LINE>inflater = (LayoutInflater) getContext().getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);<NEW_LINE>View view = inflater.inflate(R.layout.al_conversation_fragment, null);<NEW_LINE>recyclerView = view.<MASK><NEW_LINE>conversationAdapter = new AlConversationAdapter(getActivity(), conversationList);<NEW_LINE>LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());<NEW_LINE>layoutManager.setOrientation(LinearLayoutManager.VERTICAL);<NEW_LINE>recyclerView.setLayoutManager(layoutManager);<NEW_LINE>recyclerView.setAdapter(conversationAdapter);<NEW_LINE>ApplozicConversation.getLatestMessageList(getContext(), null, false, new MessageListHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResult(List<Message> messageList, ApplozicException e) {<NEW_LINE>conversationList.addAll(messageList);<NEW_LINE>conversationAdapter.notifyDataSetChanged();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>recyclerView.addOnScrollListener(new AlScrollListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onScrollUp() {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onScrollDown() {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onLoadMore() {<NEW_LINE>conversationAdapter.showLoading(true);<NEW_LINE>conversationAdapter.notifyDataSetChanged();<NEW_LINE>ApplozicConversation.getLatestMessageList(getContext(), null, true, new MessageListHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResult(List<Message> messageList, ApplozicException e) {<NEW_LINE>conversationList.addAll(messageList);<NEW_LINE>conversationAdapter.showLoading(false);<NEW_LINE>conversationAdapter.notifyDataSetChanged();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return view;<NEW_LINE>}
findViewById(R.id.conversationRecyclerView);
1,211,040
AuthResponseMessageV4 makeAuthInitiateV4(AuthInitiateMessageV4 initiate, ECKey key) {<NEW_LINE>initiatorNonce = initiate.nonce;<NEW_LINE>remotePublicKey = initiate.publicKey;<NEW_LINE>BigInteger secretScalar = remotePublicKey.multiply(key.getPrivKey()).normalize().getXCoord().toBigInteger();<NEW_LINE>byte[] token = ByteUtil.bigIntegerToBytes(secretScalar, NONCE_SIZE);<NEW_LINE>byte[] <MASK><NEW_LINE>ECKey ephemeral = Secp256k1.getInstance().recoverFromSignature(recIdFromSignatureV(initiate.getSignature().getV()), initiate.getSignature(), signed, false);<NEW_LINE>if (ephemeral == null) {<NEW_LINE>throw new RuntimeException("failed to recover signatue from message");<NEW_LINE>}<NEW_LINE>remoteEphemeralKey = ephemeral.getPubKeyPoint();<NEW_LINE>AuthResponseMessageV4 response = new AuthResponseMessageV4();<NEW_LINE>response.ephemeralPublicKey = ephemeralKey.getPubKeyPoint();<NEW_LINE>response.nonce = responderNonce;<NEW_LINE>return response;<NEW_LINE>}
signed = xor(token, initiatorNonce);
327,674
// Adjust upwards starting at this node until stopAt<NEW_LINE>private void adjustUpwards(TreeNode<E, T> node, TreeNode<E, T> stopAt) {<NEW_LINE>TreeNode<E, T> n = node;<NEW_LINE>while (n != null && n != stopAt) {<NEW_LINE>int leftSize = (n.left != null) ? n.left.size : 0;<NEW_LINE>int rightSize = (n.right != null) ? n.right.size : 0;<NEW_LINE>n.maxEnd = n.value.getInterval().getEnd();<NEW_LINE>if (n.left != null) {<NEW_LINE>n.maxEnd = Interval.max(n.<MASK><NEW_LINE>}<NEW_LINE>if (n.right != null) {<NEW_LINE>n.maxEnd = Interval.max(n.maxEnd, n.right.maxEnd);<NEW_LINE>}<NEW_LINE>n.size = leftSize + 1 + rightSize;<NEW_LINE>if (n == n.parent) {<NEW_LINE>throw new IllegalStateException("node is same as parent!!!");<NEW_LINE>}<NEW_LINE>n = n.parent;<NEW_LINE>}<NEW_LINE>}
maxEnd, n.left.maxEnd);
1,699,834
protected void createStmt(polyglot.ast.Stmt stmt) {<NEW_LINE>// System.out.println("stmt: "+stmt.getClass());<NEW_LINE>if (stmt instanceof polyglot.ast.Eval) {<NEW_LINE>base().createAggressiveExpr(((polyglot.ast.Eval) stmt).expr(), false, false);<NEW_LINE>} else if (stmt instanceof polyglot.ast.If) {<NEW_LINE>createIf2((polyglot.ast.If) stmt);<NEW_LINE>} else if (stmt instanceof polyglot.ast.LocalDecl) {<NEW_LINE>createLocalDecl((polyglot.ast.LocalDecl) stmt);<NEW_LINE>} else if (stmt instanceof polyglot.ast.Block) {<NEW_LINE>createBlock((polyglot.ast.Block) stmt);<NEW_LINE>} else if (stmt instanceof polyglot.ast.While) {<NEW_LINE>createWhile2((<MASK><NEW_LINE>} else if (stmt instanceof polyglot.ast.Do) {<NEW_LINE>createDo2((polyglot.ast.Do) stmt);<NEW_LINE>} else if (stmt instanceof polyglot.ast.For) {<NEW_LINE>createForLoop2((polyglot.ast.For) stmt);<NEW_LINE>} else if (stmt instanceof polyglot.ast.Switch) {<NEW_LINE>createSwitch((polyglot.ast.Switch) stmt);<NEW_LINE>} else if (stmt instanceof polyglot.ast.Return) {<NEW_LINE>createReturn((polyglot.ast.Return) stmt);<NEW_LINE>} else if (stmt instanceof polyglot.ast.Branch) {<NEW_LINE>createBranch((polyglot.ast.Branch) stmt);<NEW_LINE>} else if (stmt instanceof polyglot.ast.ConstructorCall) {<NEW_LINE>createConstructorCall((polyglot.ast.ConstructorCall) stmt);<NEW_LINE>} else if (stmt instanceof polyglot.ast.Empty) {<NEW_LINE>// do nothing empty stmt<NEW_LINE>} else if (stmt instanceof polyglot.ast.Throw) {<NEW_LINE>createThrow((polyglot.ast.Throw) stmt);<NEW_LINE>} else if (stmt instanceof polyglot.ast.Try) {<NEW_LINE>createTry((polyglot.ast.Try) stmt);<NEW_LINE>} else if (stmt instanceof polyglot.ast.Labeled) {<NEW_LINE>createLabeled((polyglot.ast.Labeled) stmt);<NEW_LINE>} else if (stmt instanceof polyglot.ast.Synchronized) {<NEW_LINE>createSynchronized((polyglot.ast.Synchronized) stmt);<NEW_LINE>} else if (stmt instanceof polyglot.ast.Assert) {<NEW_LINE>createAssert((polyglot.ast.Assert) stmt);<NEW_LINE>} else if (stmt instanceof polyglot.ast.LocalClassDecl) {<NEW_LINE>createLocalClassDecl((polyglot.ast.LocalClassDecl) stmt);<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Unhandled Stmt: " + stmt.getClass());<NEW_LINE>}<NEW_LINE>}
polyglot.ast.While) stmt);
455,734
protected void translateCore(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) {<NEW_LINE>final IOperandTreeNode registerOperand1 = instruction.getOperands().get(0).getRootNode().getChildren().get(0);<NEW_LINE>final IOperandTreeNode registerOperand2 = instruction.getOperands().get(1).getRootNode().getChildren().get(0);<NEW_LINE>final String targetRegister <MASK><NEW_LINE>final String sourceRegister = (registerOperand2.getValue());<NEW_LINE>final OperandSize dw = OperandSize.DWORD;<NEW_LINE>final OperandSize bt = OperandSize.BYTE;<NEW_LINE>final OperandSize wd = OperandSize.WORD;<NEW_LINE>long baseOffset = (instruction.getAddress().toLong() * 0x100) + instructions.size();<NEW_LINE>instructions.add(ReilHelpers.createXor(baseOffset++, dw, sourceRegister, dw, String.valueOf(0xFFFFFFFFL), dw, targetRegister));<NEW_LINE>// N Flag<NEW_LINE>instructions.add(ReilHelpers.createBsh(baseOffset++, dw, targetRegister, wd, String.valueOf(-31), bt, "N"));<NEW_LINE>// Z Flag<NEW_LINE>instructions.add(ReilHelpers.createBisz(baseOffset++, dw, targetRegister, bt, "Z"));<NEW_LINE>}
= (registerOperand1.getValue());
198,406
public void deParse(GroupByElement groupBy) {<NEW_LINE>buffer.append("GROUP BY ");<NEW_LINE>if (groupBy.isUsingBrackets()) {<NEW_LINE>buffer.append("( ");<NEW_LINE>}<NEW_LINE>List<Expression> expressions = groupBy.getGroupByExpressionList().getExpressions();<NEW_LINE>if (expressions != null) {<NEW_LINE>for (Iterator<Expression> iter = expressions.iterator(); iter.hasNext(); ) {<NEW_LINE>iter.next().accept(expressionVisitor);<NEW_LINE>if (iter.hasNext()) {<NEW_LINE>buffer.append(", ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (groupBy.isUsingBrackets()) {<NEW_LINE>buffer.append(" )");<NEW_LINE>}<NEW_LINE>if (!groupBy.getGroupingSets().isEmpty()) {<NEW_LINE>buffer.append("GROUPING SETS (");<NEW_LINE>boolean first = true;<NEW_LINE>for (Object o : groupBy.getGroupingSets()) {<NEW_LINE>if (first) {<NEW_LINE>first = false;<NEW_LINE>} else {<NEW_LINE>buffer.append(", ");<NEW_LINE>}<NEW_LINE>if (o instanceof Expression) {<NEW_LINE>buffer.append(o.toString());<NEW_LINE>} else if (o instanceof ExpressionList) {<NEW_LINE>ExpressionList list = (ExpressionList) o;<NEW_LINE>buffer.append(list.getExpressions() == null ? <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>buffer.append(")");<NEW_LINE>}<NEW_LINE>}
"()" : list.toString());
1,009,981
public android.os.ParcelFileDescriptor openFile(android.net.Uri uri, String mode) throws java.io.FileNotFoundException {<NEW_LINE>CheckForPathTraversal(uri);<NEW_LINE>// Retrieve the requested file and pass the file reference to the calling client/application via a parcel.<NEW_LINE>java.io.File dataDir = new java.io.File(getContext().getApplicationInfo().dataDir);<NEW_LINE>java.io.File file = new java.io.File(dataDir, uri.getPath());<NEW_LINE>boolean validPath = false;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>String fileCanonicalPath = file.getCanonicalPath();<NEW_LINE>validPath = fileCanonicalPath.startsWith(rootCanonicalPath);<NEW_LINE>} catch (java.io.IOException e) {<NEW_LINE>android.util.Log.e("Corona", "Error while reading canonical file path", e);<NEW_LINE>}<NEW_LINE>if (!validPath) {<NEW_LINE>android.util.Log.e("Corona", "Error while getting file path for " + uri.toString());<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>int nMode = 0;<NEW_LINE>boolean createDir = false;<NEW_LINE>switch(mode) {<NEW_LINE>case "w":<NEW_LINE>nMode = android.os.ParcelFileDescriptor.MODE_WRITE_ONLY | android.os.ParcelFileDescriptor.MODE_CREATE | android.os.ParcelFileDescriptor.MODE_TRUNCATE;<NEW_LINE>createDir = true;<NEW_LINE>break;<NEW_LINE>case "rw":<NEW_LINE>nMode = android.os.ParcelFileDescriptor.MODE_READ_WRITE | android.os.ParcelFileDescriptor.MODE_CREATE;<NEW_LINE>createDir = true;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>nMode = android.os.ParcelFileDescriptor.MODE_READ_ONLY;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (createDir)<NEW_LINE>file.getParentFile().mkdirs();<NEW_LINE>return android.os.ParcelFileDescriptor.open(file, nMode);<NEW_LINE>}
String rootCanonicalPath = dataDir.getCanonicalPath();
1,630,310
private ArrayList<String> removeOriginalDuePropertyWhereInvalid(Runnable notifyProgress) {<NEW_LINE>Timber.d("removeOriginalDuePropertyWhereInvalid()");<NEW_LINE>ArrayList<String> problems = new ArrayList<>(1);<NEW_LINE>notifyProgress.run();<NEW_LINE>// cards with odue set when it shouldn't be<NEW_LINE>ArrayList<Long> ids = mDb.queryLongList("select id from cards where odue > 0 and (type= " + Consts.CARD_TYPE_LRN + " or queue=" + Consts.QUEUE_TYPE_REV + ") and not odid");<NEW_LINE>notifyProgress.run();<NEW_LINE>if (ids.size() != 0) {<NEW_LINE>problems.add("Fixed " + <MASK><NEW_LINE>mDb.execute("update cards set odue=0 where id in " + Utils.ids2str(ids));<NEW_LINE>}<NEW_LINE>return problems;<NEW_LINE>}
ids.size() + " card(s) with invalid properties.");
1,027,797
private Optional<PaymentAllocationBuilder> preparePaymentAllocationBuilder(@NonNull final PaymentAllocationCriteria paymentAllocationCriteria) {<NEW_LINE>final boolean paymentAllocationItemsMissing = CollectionUtils.isEmpty(paymentAllocationCriteria.getPaymentAllocationPayableItems());<NEW_LINE>if (paymentAllocationItemsMissing) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>final I_C_Payment payment = paymentAllocationCriteria.getPayment();<NEW_LINE>final PaymentDocument paymentDocument = toPaymentDocument(payment);<NEW_LINE>final ZonedDateTime paymentDate = TimeUtil.asZonedDateTime(paymentDocument.getDateTrx(<MASK><NEW_LINE>final ImmutableList<PayableDocument> invoiceDocuments = paymentAllocationCriteria.getPaymentAllocationPayableItems().stream().map(paymentAllocationPayableItem -> toPayableDocument(paymentAllocationPayableItem, paymentDate)).collect(ImmutableList.toImmutableList());<NEW_LINE>final LocalDate dateTrx = TimeUtil.asLocalDate(paymentAllocationCriteria.getDateTrx());<NEW_LINE>final PaymentAllocationBuilder builder = PaymentAllocationBuilder.newBuilder().invoiceProcessingServiceCompanyService(invoiceProcessingServiceCompanyService).defaultDateTrx(dateTrx).paymentDocuments(ImmutableList.of(paymentDocument)).payableDocuments(invoiceDocuments).allowPartialAllocations(paymentAllocationCriteria.isAllowPartialAllocations()).payableRemainingOpenAmtPolicy(PaymentAllocationBuilder.PayableRemainingOpenAmtPolicy.DO_NOTHING).allowPurchaseSalesInvoiceCompensation(paymentAllocationBL.isPurchaseSalesInvoiceCompensationAllowed());<NEW_LINE>return Optional.of(builder);<NEW_LINE>}
), ZoneId.systemDefault());
929,799
public static Certificate readCertificate(InputStream stream) throws FileNotFoundException, CertificateException, IOException {<NEW_LINE>CertificateFactory certFactory = CertificateFactory.getInstance("X.509");<NEW_LINE>Collection<? extends java.security.cert.Certificate> certs = certFactory.generateCertificates(stream);<NEW_LINE>java.security.cert.Certificate sunCert = (java.security.cert.Certificate) certs.toArray()[0];<NEW_LINE>byte[] certBytes = sunCert.getEncoded();<NEW_LINE>ASN1Primitive asn1Cert = TlsUtils.readASN1Object(certBytes);<NEW_LINE>org.bouncycastle.asn1.x509.Certificate cert = org.bouncycastle.asn1.x509.Certificate.getInstance(asn1Cert);<NEW_LINE>org.bouncycastle.asn1.x509.Certificate[] certs2 = new org.bouncycastle.<MASK><NEW_LINE>certs2[0] = cert;<NEW_LINE>org.bouncycastle.crypto.tls.Certificate tlsCerts = new org.bouncycastle.crypto.tls.Certificate(certs2);<NEW_LINE>return tlsCerts;<NEW_LINE>}
asn1.x509.Certificate[1];
993,410
private static void newSparseElementToElements(HtmlElementTables.HtmlElementNames en, JsonObject obj, String fieldName, SourceLineWriter src) {<NEW_LINE>List<int[]> arrs = Lists.newArrayList();<NEW_LINE>for (String elname : obj.keySet()) {<NEW_LINE>int ei = en.getElementNameIndex(elname);<NEW_LINE>ImmutableSet.Builder<String> names = ImmutableSet.builder();<NEW_LINE>JsonArray arr = obj.getJsonArray(elname);<NEW_LINE>for (int i = 0, n = arr.size(); i < n; ++i) {<NEW_LINE>names.add(arr.getString(i));<NEW_LINE>}<NEW_LINE>ImmutableSet<String> iset = names.build();<NEW_LINE>int[] vals = new <MASK><NEW_LINE>int i = 0;<NEW_LINE>for (String name : iset) {<NEW_LINE>vals[i++] = en.getElementNameIndex(name);<NEW_LINE>}<NEW_LINE>Preconditions.checkState(vals.length == i);<NEW_LINE>Arrays.sort(vals);<NEW_LINE>int[] ints = new int[vals.length + 1];<NEW_LINE>ints[0] = ei;<NEW_LINE>System.arraycopy(vals, 0, ints, 1, vals.length);<NEW_LINE>arrs.add(ints);<NEW_LINE>}<NEW_LINE>Collections.sort(arrs, new Comparator<int[]>() {<NEW_LINE><NEW_LINE>public int compare(int[] a, int[] b) {<NEW_LINE>return Integer.compare(a[0], b[0]);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>int[][] arr = arrs.toArray(new int[arrs.size()][]);<NEW_LINE>src.lines("HtmlElementTables.SparseElementToElements " + fieldName + " = new HtmlElementTables.SparseElementToElements(");<NEW_LINE>src.write(arr);<NEW_LINE>src.line(");");<NEW_LINE>}
int[iset.size()];
954,651
private List<BackupMessageMeta> scanMessageMeta(String subject, String messageId) {<NEW_LINE>final LocalDateTime now = LocalDateTime.now();<NEW_LINE>final Date createTimeEnd = localDateTime2Date(now);<NEW_LINE>final Date createTimeBegin = localDateTime2Date(now.minusDays(30));<NEW_LINE>try {<NEW_LINE>final String subjectId = dicService.name2Id(subject);<NEW_LINE>final String keyRegexp = BackupMessageKeyRegexpBuilder.buildRetryRegexp(subjectId, messageId);<NEW_LINE>final String startKey = BackupMessageKeyRangeBuilder.buildRetryRangeKey(subjectId, messageId, createTimeEnd);<NEW_LINE>final String endKey = BackupMessageKeyRangeBuilder.buildRetryRangeKey(subjectId, messageId, createTimeBegin);<NEW_LINE>final List<BackupMessageMeta> metas = scan(indexTable, keyRegexp, startKey, endKey, 1000, 0, B_FAMILY, B_MESSAGE_QUALIFIERS, kvs -> {<NEW_LINE>KeyValueList<KeyValue> kvl = new KeyValueListImpl(kvs);<NEW_LINE>byte[] value = kvl.getValue(CONTENT);<NEW_LINE>byte[] rowKey = kvl.getKey();<NEW_LINE>BackupMessageMeta meta = getMessageMeta(rowKey, value);<NEW_LINE>if (meta != null && rowKey.length > CONSUMER_GROUP_INDEX_IN_RETRY_MESSAGE) {<NEW_LINE>byte[] consumerGroupId = new byte[CONSUMER_GROUP_LENGTH];<NEW_LINE>System.arraycopy(rowKey, CONSUMER_GROUP_INDEX_IN_RETRY_MESSAGE, consumerGroupId, 0, CONSUMER_GROUP_LENGTH);<NEW_LINE>meta.setConsumerGroupId(new String(consumerGroupId, CharsetUtil.UTF_8));<NEW_LINE>}<NEW_LINE>return meta;<NEW_LINE>});<NEW_LINE>return Lists.newArrayList<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Failed to scan messages meta.", e);<NEW_LINE>return Lists.newArrayList();<NEW_LINE>}<NEW_LINE>}
(Sets.newHashSet(metas));
575,069
public void marshall(Cluster cluster, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (cluster == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(cluster.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getPendingUpdates(), PENDINGUPDATES_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getNumberOfShards(), NUMBEROFSHARDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getShards(), SHARDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getAvailabilityMode(), AVAILABILITYMODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getClusterEndpoint(), CLUSTERENDPOINT_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getNodeType(), NODETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getEngineVersion(), ENGINEVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getEnginePatchVersion(), ENGINEPATCHVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getParameterGroupName(), PARAMETERGROUPNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getParameterGroupStatus(), PARAMETERGROUPSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getSecurityGroups(), SECURITYGROUPS_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getSubnetGroupName(), SUBNETGROUPNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getTLSEnabled(), TLSENABLED_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getKmsKeyId(), KMSKEYID_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getARN(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getSnsTopicArn(), SNSTOPICARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(cluster.getSnapshotRetentionLimit(), SNAPSHOTRETENTIONLIMIT_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getMaintenanceWindow(), MAINTENANCEWINDOW_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getSnapshotWindow(), SNAPSHOTWINDOW_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getACLName(), ACLNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(cluster.getAutoMinorVersionUpgrade(), AUTOMINORVERSIONUPGRADE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
cluster.getSnsTopicStatus(), SNSTOPICSTATUS_BINDING);
733,887
private void initialize() {<NEW_LINE>if (!(doc instanceof StyledDocument)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>GuardedSectionManager mgr = GuardedSectionManager.getInstance((StyledDocument) doc);<NEW_LINE>if (mgr == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>len = doc.getLength();<NEW_LINE>int[] arr = new int[10];<NEW_LINE>int p = 0;<NEW_LINE>for (GuardedSection s : mgr.getGuardedSections()) {<NEW_LINE>if (s instanceof InteriorSection) {<NEW_LINE>InteriorSection is = (InteriorSection) s;<NEW_LINE>arr = ensureSize(arr, p + 2);<NEW_LINE>arr[p++] = is.getStartPosition().getOffset();<NEW_LINE>arr[p++] = is.getBodyStartPosition().getOffset();<NEW_LINE>// ???<NEW_LINE>arr[p++] = is.getBodyEndPosition().getOffset() + 1;<NEW_LINE>arr[p++] = is.getEndPosition().getOffset() + 1;<NEW_LINE>} else {<NEW_LINE>arr = ensureSize(arr, p);<NEW_LINE>arr[p++] = s.getStartPosition().getOffset();<NEW_LINE>arr[p++] = s.getEndPosition<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (p == 0) {<NEW_LINE>// boundOffsets remain null for further tests.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.max = p;<NEW_LINE>this.boundOffsets = arr;<NEW_LINE>}
().getOffset() + 1;
515,438
public void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>if (cacher == null) {<NEW_LINE>try {<NEW_LINE>cacher = ResponseCacheMiddleware.addCache(AsyncHttpClient.getDefaultInstance(), getFileStreamPath("asynccache"), 1024 * 1024 * 10);<NEW_LINE>cacher.setCaching(false);<NEW_LINE>} catch (IOException e) {<NEW_LINE>Toast.makeText(getApplicationContext(), "unable to create cache", Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>Button b = (Button) <MASK><NEW_LINE>b.setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>refresh();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>rommanager = (ImageView) findViewById(R.id.rommanager);<NEW_LINE>tether = (ImageView) findViewById(R.id.tether);<NEW_LINE>desksms = (ImageView) findViewById(R.id.desksms);<NEW_LINE>chart = (ImageView) findViewById(R.id.chart);<NEW_LINE>showCacheToast();<NEW_LINE>}
findViewById(R.id.go);
1,048,582
// generate initial rwr vector<NEW_LINE>public void gen_initial_vector(long number_nodes, Path vector_path) throws IOException {<NEW_LINE>int i, j = 0;<NEW_LINE>int <MASK><NEW_LINE>String file_name = "rwr_init_vector.temp";<NEW_LINE>FileWriter file = new FileWriter(file_name);<NEW_LINE>BufferedWriter out = new BufferedWriter(file);<NEW_LINE>System.out.print("Creating initial rwr vectors...");<NEW_LINE>double initial_rank = 1.0 / (double) number_nodes;<NEW_LINE>for (i = 0; i < number_nodes; i++) {<NEW_LINE>out.write(i + "\tv" + initial_rank + "\n");<NEW_LINE>if (++j > milestone) {<NEW_LINE>System.out.print(".");<NEW_LINE>j = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.close();<NEW_LINE>System.out.println("");<NEW_LINE>// copy it to curbm_path, and delete temporary local file.<NEW_LINE>fs.delete(vector_path, true);<NEW_LINE>fs.copyFromLocalFile(true, new Path("./" + file_name), new Path(vector_path.toString() + "/" + file_name));<NEW_LINE>}
milestone = (int) number_nodes / 10;
1,703,260
public void snmpV2Trap(SnmpOid trapOid, SnmpVarBindList varBindList) throws IOException, SnmpStatusException {<NEW_LINE>if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {<NEW_LINE>SNMP_ADAPTOR_LOGGER.logp(Level.FINER, <MASK><NEW_LINE>}<NEW_LINE>// First, make an SNMP V2 trap pdu<NEW_LINE>// We clone varBindList and insert sysUpTime and snmpTrapOid<NEW_LINE>//<NEW_LINE>SnmpPduRequest pdu = new SnmpPduRequest();<NEW_LINE>pdu.address = null;<NEW_LINE>pdu.port = trapPort;<NEW_LINE>pdu.type = pduV2TrapPdu;<NEW_LINE>pdu.version = snmpVersionTwo;<NEW_LINE>pdu.community = null;<NEW_LINE>SnmpVarBindList fullVbl;<NEW_LINE>if (varBindList != null)<NEW_LINE>fullVbl = varBindList.clone();<NEW_LINE>else<NEW_LINE>fullVbl = new SnmpVarBindList(2);<NEW_LINE>SnmpTimeticks sysUpTimeValue = new SnmpTimeticks(getSysUpTime());<NEW_LINE>fullVbl.insertElementAt(new SnmpVarBind(snmpTrapOidOid, trapOid), 0);<NEW_LINE>fullVbl.insertElementAt(new SnmpVarBind(sysUpTimeOid, sysUpTimeValue), 0);<NEW_LINE>pdu.varBindList = new SnmpVarBind[fullVbl.size()];<NEW_LINE>fullVbl.copyInto(pdu.varBindList);<NEW_LINE>// Next, send the pdu to all destinations defined in ACL<NEW_LINE>//<NEW_LINE>sendTrapPdu(pdu);<NEW_LINE>}
dbgTag, "snmpV2Trap", "trapOid=" + trapOid);
416,506
public void filterWsdlRequest(SubmitContext context, WsdlRequest wsdlRequest) {<NEW_LINE>HttpRequest postMethod = (HttpRequest) context.getProperty(BaseHttpRequestTransport.HTTP_METHOD);<NEW_LINE>WsdlInterface wsdlInterface = (WsdlInterface) wsdlRequest.getOperation().getInterface();<NEW_LINE>// init content-type and encoding<NEW_LINE>String encoding = System.getProperty("soapui.request.encoding", wsdlRequest.getEncoding());<NEW_LINE>SoapVersion soapVersion = wsdlInterface.getSoapVersion();<NEW_LINE>String soapAction = wsdlRequest.isSkipSoapAction() ? null : wsdlRequest.getAction();<NEW_LINE>postMethod.setHeader("Content-Type", soapVersion<MASK><NEW_LINE>if (!wsdlRequest.isSkipSoapAction()) {<NEW_LINE>String soapActionHeader = soapVersion.getSoapActionHeader(soapAction);<NEW_LINE>if (soapActionHeader != null) {<NEW_LINE>postMethod.setHeader("SOAPAction", soapActionHeader);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getContentTypeHttpHeader(encoding, soapAction));
1,005,498
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {<NEW_LINE>String token = request.getHeader("token");<NEW_LINE>if (StringUtils.isEmpty(token)) {<NEW_LINE>RestUtil.response(response, SystemCode.UNAUTHORIZED);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (StringUtils.isBlank(token)) {<NEW_LINE>RestUtil.response(response, SystemCode.UNAUTHORIZED);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (token.length() != 36) {<NEW_LINE>RestUtil.response(response, SystemCode.UNAUTHORIZED);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>UserToken userToken = userTokenService.getToken(token);<NEW_LINE>if (null == userToken) {<NEW_LINE>RestUtil.response(response, SystemCode.UNAUTHORIZED);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Date now = new Date();<NEW_LINE>User user = userService.getUserByUserName(userToken.getUserName());<NEW_LINE>if (now.before(userToken.getEndTime())) {<NEW_LINE>wxContext.setContext(user, userToken);<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>// refresh token<NEW_LINE>UserToken refreshToken = userTokenService.insertUserToken(user);<NEW_LINE>RestUtil.response(response, SystemCode.AccessTokenError.getCode(), SystemCode.AccessTokenError.getMessage(<MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
), refreshToken.getToken());
804,373
void update(@NonNull final Collection<? extends URL> update) {<NEW_LINE>final List<? extends PathResourceImplementation<MASK><NEW_LINE>final List<PathResourceImplementation> next = new ArrayList<>();<NEW_LINE>final Set<URL> updateSet = new LinkedHashSet<>(update);<NEW_LINE>boolean dirty = false;<NEW_LINE>for (PathResourceImplementation pr : current) {<NEW_LINE>final URL[] roots = pr.getRoots();<NEW_LINE>assert roots.length == 1;<NEW_LINE>if (updateSet.remove(roots[0])) {<NEW_LINE>next.add(pr);<NEW_LINE>} else {<NEW_LINE>dirty = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (URL newRoot : updateSet) {<NEW_LINE>next.add(ClassPathSupport.createResource(newRoot));<NEW_LINE>dirty = true;<NEW_LINE>}<NEW_LINE>if (dirty && cache.compareAndSet(current, next)) {<NEW_LINE>this.listeners.firePropertyChange(PROP_RESOURCES, null, null);<NEW_LINE>}<NEW_LINE>}
> current = cache.get();
529,824
private Action createSUSPEND_ACTION(RequestProcessor requestProcessor) {<NEW_LINE>return Models.createAction(NbBundle.getBundle(DebuggingActionsProvider.class).getString("CTL_ThreadAction_Suspend_Label"), new LazyActionPerformer(requestProcessor) {<NEW_LINE><NEW_LINE>public boolean isEnabled(Object node) {<NEW_LINE>// if (node instanceof MonitorModel.ThreadWithBordel) node = ((MonitorModel.ThreadWithBordel) node).originalThread;<NEW_LINE>if (node instanceof JPDADVThread) {<NEW_LINE>return !((JPDADVThread) node).isSuspended();<NEW_LINE>}<NEW_LINE>if (node instanceof JPDAThreadGroup) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><NEW_LINE>public void run(Object[] nodes) {<NEW_LINE>int i, k = nodes.length;<NEW_LINE>for (i = 0; i < k; i++) {<NEW_LINE>Object node = (nodes[i] instanceof MonitorModel.ThreadWithBordel) ? ((MonitorModel.ThreadWithBordel) nodes[i]).getOriginalThread() : nodes[i];<NEW_LINE>if (node instanceof JPDAThread) {<NEW_LINE>((JPDAThread) node).suspend();<NEW_LINE>} else if (node instanceof JPDADVThread) {<NEW_LINE>((<MASK><NEW_LINE>} else if (node instanceof JPDAThreadGroup) {<NEW_LINE>((JPDAThreadGroup) node).suspend();<NEW_LINE>} else if (node instanceof JPDADVThreadGroup) {<NEW_LINE>((JPDADVThreadGroup) node).getKey().suspend();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, Models.MULTISELECTION_TYPE_ALL);<NEW_LINE>}
JPDADVThread) node).suspend();
1,590,399
private Mono<Response<Void>> deleteWithResponseAsync(String resourceGroupName, String envName, String name, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><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 (envName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter envName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (name == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, envName, name, this.client.getApiVersion(), accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));
1,065,828
public void handle(RoutingContext ctx) {<NEW_LINE>initLazyState();<NEW_LINE>// Redirect /q/dev to /q/dev/<NEW_LINE>if (ctx.normalizedPath().length() == devRootAppend.length()) {<NEW_LINE>ctx.response().setStatusCode(302);<NEW_LINE>ctx.response().headers().set(HttpHeaders.LOCATION, devRootAppend + "/");<NEW_LINE>ctx.response().end();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String path = ctx.normalizedPath().substring(ctx.mountPoint().length() + 1);<NEW_LINE>if (path.isEmpty() || path.equals("/")) {<NEW_LINE>sendMainPage(ctx);<NEW_LINE>} else {<NEW_LINE>int nsIndex = path.indexOf("/");<NEW_LINE>if (nsIndex == -1) {<NEW_LINE>ctx.response().setStatusCode(404).end();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String namespace = path.substring(0, nsIndex);<NEW_LINE>currentExtension.set(namespace);<NEW_LINE>Template <MASK><NEW_LINE>if (devTemplate != null) {<NEW_LINE>String extName = getExtensionName(namespace);<NEW_LINE>ctx.response().setStatusCode(200).headers().set(HttpHeaderNames.CONTENT_TYPE, HTML_CONTENT_TYPE);<NEW_LINE>TemplateInstance devTemplateInstance = devTemplate.data("currentExtensionName", extName).data("query-string", ctx.request().query()).data("flash", FlashScopeUtil.getFlash(ctx)).data("currentRequest", ctx.request());<NEW_LINE>renderTemplate(ctx, devTemplateInstance);<NEW_LINE>} else {<NEW_LINE>ctx.next();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
devTemplate = engine.getTemplate(path);
922,122
public Optional<Host> findDefaultHost(final String contentTypeId, final String columnName) throws DotDataException, DotSecurityException {<NEW_LINE>Host defaultHost = this.siteCache.getDefaultHost();<NEW_LINE>if (null != defaultHost) {<NEW_LINE>return Optional.of(defaultHost);<NEW_LINE>}<NEW_LINE>final DotConnect dotConnect = new DotConnect();<NEW_LINE>String inode = null;<NEW_LINE>if (APILocator.getContentletJsonAPI().isPersistContentAsJson()) {<NEW_LINE>String sql = null;<NEW_LINE>if (DbConnectionFactory.isPostgres()) {<NEW_LINE>sql = "SELECT cvi.working_inode\n" + " FROM contentlet_version_info cvi join contentlet c on (c.inode = cvi.working_inode) \n" + " WHERE c.contentlet_as_json @> '{ \"fields\":{\"isDefault\":{ \"value\":true }} }' \n" + " and c.structure_inode = ?";<NEW_LINE>}<NEW_LINE>if (DbConnectionFactory.isMsSql()) {<NEW_LINE>sql = "SELECT cvi.working_inode\n" + " FROM contentlet_version_info cvi join contentlet c on (c.inode = cvi.working_inode) \n" + " WHERE JSON_VALUE(c.contentlet_as_json, '$.fields.isDefault.value') = 'true' \n" + " and c.structure_inode = ?";<NEW_LINE>}<NEW_LINE>if (null == sql) {<NEW_LINE>throw new IllegalStateException("Unable to determine what db with json support we're running on!");<NEW_LINE>}<NEW_LINE>dotConnect.setSQL(sql);<NEW_LINE>dotConnect.addParam(contentTypeId);<NEW_LINE>inode = Try.of(() -> dotConnect.getString("working_inode")).onFailure(throwable -> {<NEW_LINE>Logger.warnAndDebug(HostAPIImpl.class, "An Error occurred while fetching the default host. ", throwable);<NEW_LINE>}).getOrNull();<NEW_LINE>}<NEW_LINE>if (UtilMethods.isNotSet(inode)) {<NEW_LINE>dotConnect.setSQL("select working_inode from contentlet_version_info join contentlet on (contentlet.inode = contentlet_version_info.working_inode) " + " where " + columnName + " = ? and structure_inode =?");<NEW_LINE>dotConnect.addParam(true);<NEW_LINE>dotConnect.addParam(contentTypeId);<NEW_LINE>inode = dotConnect.getString("working_inode");<NEW_LINE>}<NEW_LINE>if (UtilMethods.isNotSet(inode)) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>defaultHost = new Host(APILocator.getContentletAPI().find(inode, APILocator.systemUser(), false));<NEW_LINE><MASK><NEW_LINE>return Optional.of(defaultHost);<NEW_LINE>}
this.siteCache.add(defaultHost);
1,115,522
private void jbInit() throws Exception {<NEW_LINE>AdempierePLAF.setDefaultBackground(panel);<NEW_LINE>newBorder = new TitledBorder("");<NEW_LINE>accountBorder = new TitledBorder("");<NEW_LINE>mainPanel.setLayout(mainLayout);<NEW_LINE>newPanel.setBorder(newBorder);<NEW_LINE>newPanel.setLayout(newLayout);<NEW_LINE>newBorder.setTitle(Msg.getMsg(Env.getCtx(), "ChargeNewAccount"));<NEW_LINE>valueLabel.setText(Msg.translate(Env.getCtx(), "Value"));<NEW_LINE>isExpense.setSelected(true);<NEW_LINE>isExpense.setText(Msg.getMsg(Env.getCtx(), "Expense"));<NEW_LINE>nameLabel.setText(Msg.translate(Env.getCtx(), "Name"));<NEW_LINE>nameField.setColumns(20);<NEW_LINE>valueField.setColumns(10);<NEW_LINE>newButton.setText(Msg.getMsg(Env.getCtx(), "Create") + " " + Util.cleanAmp(Msg.getMsg(Env.getCtx(), "New")));<NEW_LINE>newButton.addActionListener(this);<NEW_LINE>accountPanel.setBorder(accountBorder);<NEW_LINE>accountPanel.setLayout(accountLayout);<NEW_LINE>accountBorder.setTitle(Msg.getMsg(Env.getCtx(), "ChargeFromAccount"));<NEW_LINE>accountButton.setText(Msg.getMsg(Env.getCtx(), "Create") + " " + Msg.getMsg(Env.getCtx(), "From") + " " + Msg.getElement(Env<MASK><NEW_LINE>accountButton.addActionListener(this);<NEW_LINE>accountOKPanel.setLayout(accountOKLayout);<NEW_LINE>accountOKLayout.setAlignment(FlowLayout.RIGHT);<NEW_LINE>confirmPanel.setActionListener(this);<NEW_LINE>//<NEW_LINE>mainPanel.add(newPanel, BorderLayout.NORTH);<NEW_LINE>newPanel.add(valueLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));<NEW_LINE>newPanel.add(valueField, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));<NEW_LINE>newPanel.add(nameLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));<NEW_LINE>newPanel.add(nameField, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));<NEW_LINE>newPanel.add(isExpense, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));<NEW_LINE>newPanel.add(newButton, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));<NEW_LINE>mainPanel.add(accountPanel, BorderLayout.CENTER);<NEW_LINE>accountPanel.add(accountOKPanel, BorderLayout.SOUTH);<NEW_LINE>accountOKPanel.add(accountButton, null);<NEW_LINE>accountPanel.add(dataPane, BorderLayout.CENTER);<NEW_LINE>dataPane.getViewport().add(dataTable, null);<NEW_LINE>}
.getCtx(), "Account_ID"));
47,669
public PageHandler query(Short siteId, boolean projection, boolean phrase, HighLighterQuery highLighterQuery, Integer[] categoryIds, String[] modelIds, String text, String[] fields, Long[] tagIds, String[] dictionaryValues, Date startPublishDate, Date endPublishDate, Date expiryDate, String orderField, Integer pageIndex, Integer pageSize) {<NEW_LINE>if (CommonUtils.notEmpty(fields)) {<NEW_LINE>for (String field : fields) {<NEW_LINE>if (!ArrayUtils.contains(textFields, field)) {<NEW_LINE>fields = textFields;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>fields = textFields;<NEW_LINE>}<NEW_LINE>initHighLighterQuery(highLighterQuery, phrase, text);<NEW_LINE>SearchQueryOptionsStep<?, CmsContent, ?, ?, ?> optionsStep = getOptionsStep(siteId, projection, phrase, categoryIds, modelIds, text, fields, tagIds, dictionaryValues, <MASK><NEW_LINE>return getPage(optionsStep, highLighterQuery, pageIndex, pageSize);<NEW_LINE>}
startPublishDate, endPublishDate, expiryDate, orderField);
749,069
public okhttp3.Call connectPostNamespacedServiceProxyWithPathCall(String name, String namespace, String path, String path2, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())).replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString())).replaceAll("\\{" + "path" + "\\}", localVarApiClient.escapeString(path.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (path2 != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("path", path2));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<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 = { "*/*" };<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 localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "BearerToken" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, <MASK><NEW_LINE>}
localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
1,002,632
public static PrimitiveCoderDescriptor createCoderDescriptorFor(final char encoding) {<NEW_LINE>switch(encoding) {<NEW_LINE>case 'B':<NEW_LINE>return new PrimitiveCoderDescriptor(BoolCoder.INST, "false");<NEW_LINE>case 'c':<NEW_LINE>return new PrimitiveCoderDescriptor(SCharCoder.INST, "0");<NEW_LINE>case 'C':<NEW_LINE>return new PrimitiveCoderDescriptor(UCharCoder.INST, "0");<NEW_LINE>case 's':<NEW_LINE>return new PrimitiveCoderDescriptor(SShortCoder.INST, "0");<NEW_LINE>case 'S':<NEW_LINE>return new PrimitiveCoderDescriptor(UShortCoder.INST, "0");<NEW_LINE>case 'i':<NEW_LINE>return new PrimitiveCoderDescriptor(SIntCoder.INST, "0");<NEW_LINE>case 'I':<NEW_LINE>return new <MASK><NEW_LINE>case 'l':<NEW_LINE>return new PrimitiveCoderDescriptor(SLongCoder.INST, "0");<NEW_LINE>case 'L':<NEW_LINE>return new PrimitiveCoderDescriptor(ULongCoder.INST, "0", "x86_64: no suitable Java primitive for unsigned long.");<NEW_LINE>case 'q':<NEW_LINE>return new PrimitiveCoderDescriptor(SLongLongCoder.INST, "0");<NEW_LINE>case 'Q':<NEW_LINE>return new PrimitiveCoderDescriptor(ULongLongCoder.INST, "0", "x86_64: no suitable Java primitive for unsigned long long.");<NEW_LINE>case 'f':<NEW_LINE>return new PrimitiveCoderDescriptor(PrimitiveCoder.FloatCoder.INST, "0");<NEW_LINE>case 'd':<NEW_LINE>return new PrimitiveCoderDescriptor(PrimitiveCoder.DoubleCoder.INST, "0");<NEW_LINE>default:<NEW_LINE>throw new RuntimeException("unknown encoding: " + encoding);<NEW_LINE>}<NEW_LINE>}
PrimitiveCoderDescriptor(UIntCoder.INST, "0");
954,628
public static void deleteLoggers(List<Map<String, Object>> allRows, String configName) {<NEW_LINE>ArrayList<String> newLoggers = new ArrayList<String>();<NEW_LINE>HashMap attrs = new HashMap();<NEW_LINE>attrs.put("target", configName);<NEW_LINE>Map result = RestUtil.restRequest((String) GuiUtil.getSessionValue("REST_URL") + "/list-log-levels.json", attrs, "GET", null, false);<NEW_LINE>List<String> oldLoggers = (List<String>) ((HashMap) ((HashMap) result.get("data")).get("extraProperties")).get("loggers");<NEW_LINE>for (Map<String, Object> oneRow : allRows) {<NEW_LINE>newLoggers.add((String<MASK><NEW_LINE>}<NEW_LINE>// delete the removed loggers<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>String sep = "";<NEW_LINE>for (String logger : oldLoggers) {<NEW_LINE>if (!newLoggers.contains(logger)) {<NEW_LINE>if (logger.contains(":")) {<NEW_LINE>logger = logger.replace(":", "\\:");<NEW_LINE>}<NEW_LINE>sb.append(sep).append(logger);<NEW_LINE>sep = ":";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (sb.length() > 0) {<NEW_LINE>attrs = new HashMap();<NEW_LINE>attrs.put("id", sb.toString());<NEW_LINE>attrs.put("target", configName);<NEW_LINE>RestUtil.restRequest((String) GuiUtil.getSessionValue("REST_URL") + "/delete-log-levels", attrs, "POST", null, false);<NEW_LINE>}<NEW_LINE>}
) oneRow.get("loggerName"));
115,937
public static byte[] encryptCCM(@NotNull final byte[] data, @NotNull final byte[] key, @NotNull final byte[] nonce, final int micSize) {<NEW_LINE>Objects.requireNonNull(data);<NEW_LINE>Objects.requireNonNull(key);<NEW_LINE>Objects.requireNonNull(nonce);<NEW_LINE>final byte[] ccm = new byte[data.length + micSize];<NEW_LINE>final CCMBlockCipher ccmBlockCipher = new CCMBlockCipher(new AESEngine());<NEW_LINE>final AEADParameters aeadParameters = new AEADParameters(new KeyParameter(key), micSize * 8, nonce);<NEW_LINE>ccmBlockCipher.init(true, aeadParameters);<NEW_LINE>ccmBlockCipher.processBytes(data, 0, data.length, ccm, data.length);<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>return ccm;<NEW_LINE>} catch (InvalidCipherTextException e) {<NEW_LINE>LOG.log(Level.SEVERE, "Error while encrypting: " + e.getMessage(), e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
ccmBlockCipher.doFinal(ccm, 0);
557,815
public void afterPropertiesSet() {<NEW_LINE>super.afterPropertiesSet();<NEW_LINE>Assert.state(this.exposeListenerChannel || !getAcknowledgeMode().isManual(), "You cannot acknowledge messages manually if the channel is not exposed to the listener " + "(please check your configuration and set exposeListenerChannel=true or " + "acknowledgeMode!=MANUAL)");<NEW_LINE>Assert.state(!(getAcknowledgeMode().isAutoAck() && isChannelTransacted()<MASK><NEW_LINE>validateConfiguration();<NEW_LINE>initialize();<NEW_LINE>try {<NEW_LINE>if (this.micrometerHolder == null && MICROMETER_PRESENT && this.micrometerEnabled && this.applicationContext != null) {<NEW_LINE>String id = getListenerId();<NEW_LINE>if (id == null) {<NEW_LINE>id = "no_id_or_beanName";<NEW_LINE>}<NEW_LINE>this.micrometerHolder = new MicrometerHolder(this.applicationContext, id, this.micrometerTags);<NEW_LINE>}<NEW_LINE>} catch (IllegalStateException e) {<NEW_LINE>this.logger.debug("Could not enable micrometer timers", e);<NEW_LINE>}<NEW_LINE>if (this.isAsyncReplies() && !AcknowledgeMode.MANUAL.equals(this.acknowledgeMode)) {<NEW_LINE>this.acknowledgeMode = AcknowledgeMode.MANUAL;<NEW_LINE>}<NEW_LINE>}
), "The acknowledgeMode is NONE (autoack in Rabbit terms) which is not consistent with having a " + "transactional channel. Either use a different AcknowledgeMode or make sure " + "channelTransacted=false");
1,630,370
public void calibrateZ(ReferenceNozzleTip nt) throws Exception {<NEW_LINE>if (nt != getCalibrationNozzleTip()) {<NEW_LINE>throw new Exception("Nozzle " + getName() + " has not nozzle tip " + <MASK><NEW_LINE>}<NEW_LINE>if (nt == null) {<NEW_LINE>throw new Exception("Nozzle " + getName() + " has no nozzle tip loaded.");<NEW_LINE>}<NEW_LINE>Location nominalLocation = nt.getTouchLocation();<NEW_LINE>if (!nominalLocation.isInitialized()) {<NEW_LINE>throw new Exception("Nozzle tip " + nt.getName() + " has no touch location configured.");<NEW_LINE>}<NEW_LINE>resetZCalibration();<NEW_LINE>Location probedLocation = contactProbeCycle(nominalLocation);<NEW_LINE>Length offsetZ = nominalLocation.getLengthZ().subtract(probedLocation.getLengthZ());<NEW_LINE>Logger.debug("Nozzle " + getName() + " nozzle tip " + nt.getName() + " Z calibration offset " + offsetZ);<NEW_LINE>if (Math.abs(offsetZ.convertToUnits(LengthUnit.Millimeters).getValue()) > maxZOffsetMm) {<NEW_LINE>throw new Exception("Nozzle " + getName() + " nozzle tip " + nt.getName() + " Z calibration offset " + offsetZ + " unexpectedly large. Check setup.");<NEW_LINE>}<NEW_LINE>// Remember which nozzle tip for trigger control.<NEW_LINE>zCalibratedNozzleTip = nt;<NEW_LINE>// Establish the new Z calibration.<NEW_LINE>setCalibrationOffsetZ(offsetZ);<NEW_LINE>if (getNozzleTip() == null) {<NEW_LINE>// Store the special "naked" nozzle Z offset.<NEW_LINE>setUnloadedCalibrationOffsetZ(calibrationOffsetZ);<NEW_LINE>}<NEW_LINE>}
nt.getName() + " loaded.");
1,622,297
private static TileSourceTemplate createWmsTileSourceTemplate(Map<String, String> attributes) {<NEW_LINE>String name = attributes.get("name");<NEW_LINE>String layer = attributes.get("layer");<NEW_LINE>String urlTemplate = attributes.get("url_template");<NEW_LINE>if (name == null || urlTemplate == null || layer == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int maxZoom = parseInt(attributes, "max_zoom", 18);<NEW_LINE>int minZoom = parseInt(attributes, "min_zoom", 5);<NEW_LINE>int tileSize = parseInt(attributes, "tile_size", 256);<NEW_LINE>String ext = attributes.get("ext") == null ? ".jpg" : attributes.get("ext");<NEW_LINE>int bitDensity = parseInt(attributes, "img_density", 16);<NEW_LINE>int avgTileSize = parseInt(attributes, "avg_img_size", 18000);<NEW_LINE>String <MASK><NEW_LINE>urlTemplate = "http://whoots.mapwarper.net/tms/{0}/{1}/{2}/" + layer + "/" + urlTemplate;<NEW_LINE>TileSourceTemplate templ = new TileSourceTemplate(name, urlTemplate, ext, maxZoom, minZoom, tileSize, bitDensity, avgTileSize);<NEW_LINE>templ.setRandoms(randoms);<NEW_LINE>return templ;<NEW_LINE>}
randoms = attributes.get("randoms");
466,522
protected void doBootstrap(ConnectionState curState) {<NEW_LINE>if (null != _lastOpenConnection) {<NEW_LINE>_lastOpenConnection.close();<NEW_LINE>_lastOpenConnection = null;<NEW_LINE>}<NEW_LINE>Checkpoint bootstrapCkpt = null;<NEW_LINE>if (_sourcesConn.getBootstrapPuller() == null) {<NEW_LINE>_log.warn("doBootstrap got called, but BootstrapPullThread is null. Is bootstrap disabled?");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>bootstrapCkpt = curState.getCheckpoint().clone();<NEW_LINE>} catch (Exception e) {<NEW_LINE>String msg = "Error copying checkpoint:" + curState.getCheckpoint();<NEW_LINE>_log.error(msg, e);<NEW_LINE>BootstrapResultMessage bootstrapResultMessage = BootstrapResultMessage.createBootstrapFailedMessage(e);<NEW_LINE>doBootstrapFailed(bootstrapResultMessage);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!bootstrapCkpt.isBootstrapStartScnSet()) {<NEW_LINE>bootstrapCkpt = curState.getBstCheckpointHandler().createInitialBootstrapCheckpoint(bootstrapCkpt, bootstrapCkpt.getWindowScn());<NEW_LINE>// bootstrapCkpt.setBootstrapSinceScn(Long.valueOf(bootstrapCkpt.getWindowScn()));<NEW_LINE>}<NEW_LINE>_log.info("Bootstrap begin: sinceScn=" + bootstrapCkpt.getWindowScn());<NEW_LINE>CheckpointMessage bootstrapCpMessage = CheckpointMessage.createSetCheckpointMessage(bootstrapCkpt);<NEW_LINE>_sourcesConn.getBootstrapPuller().enqueueMessage(bootstrapCpMessage);<NEW_LINE>try {<NEW_LINE>Checkpoint cpForDispatcher = new Checkpoint(bootstrapCkpt.toString());<NEW_LINE>cpForDispatcher.setConsumptionMode(DbusClientMode.BOOTSTRAP_SNAPSHOT);<NEW_LINE>DbusEvent cpEvent = getEventFactory().createCheckpointEvent(cpForDispatcher);<NEW_LINE>writeEventToRelayDispatcher(curState, cpEvent, "Control Event to start bootstrap");<NEW_LINE>curState.switchToBootstrapRequested();<NEW_LINE>} catch (InterruptedException ie) {<NEW_LINE>_log.error("Got interrupted while writing control message to bootstrap !!", ie);<NEW_LINE>enqueueMessage(LifecycleMessage.createSuspendOnErroMessage(ie));<NEW_LINE>} catch (Exception e) {<NEW_LINE>enqueueMessage(LifecycleMessage.createSuspendOnErroMessage(e));<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// wait for bootstrap to finish<NEW_LINE>}
_log.error("Exception occured while switching to bootstrap: ", e);
1,425,355
private void handleRegistration(Context context, Bundle extras) {<NEW_LINE><MASK><NEW_LINE>String token = extras.getString(ANSConstants.ANS_EXTRA_TOKEN);<NEW_LINE>String error = extras.getString(ANSConstants.ANS_EXTRA_ERROR);<NEW_LINE>String type = extras.getString(ANSConstants.ANS_EXTRA_RESPONSE_TYPE);<NEW_LINE>// PROCESS REGISTRATION RESPONSE<NEW_LINE>if (ANSConstants.ANS_REGISTER_RESPONSE.equals(type)) {<NEW_LINE>if (error != null) {<NEW_LINE>Logger.W(TAG, "Rhoconnect-push registration error: " + error);<NEW_LINE>PushContract.handleError(context, error, ANSFacade.ANS_PUSH_CLIENT);<NEW_LINE>} else {<NEW_LINE>Logger.I(TAG, "Rhoconnect-push registration succeded");<NEW_LINE>Logger.D(TAG, "Rhoconnect-push token: " + token);<NEW_LINE>PushContract.handleRegistration(context, token, ANSFacade.ANS_PUSH_CLIENT);<NEW_LINE>}<NEW_LINE>} else // PROCESS UNREGISTRATION RESPONSE<NEW_LINE>if (ANSConstants.ANS_UNREGISTER_RESPONSE.equals(type)) {<NEW_LINE>if (error != null) {<NEW_LINE>PushContract.handleError(context, error, ANSFacade.ANS_PUSH_CLIENT);<NEW_LINE>} else {<NEW_LINE>Logger.I(TAG, "Rhoconnect-push unregistration success");<NEW_LINE>}<NEW_LINE>} else // PROCESS CHECK REGISTRATION RESPONSE<NEW_LINE>if (ANSConstants.ANS_CHECK_REGISTER_RESPONSE.equals(type)) {<NEW_LINE>if (error != null) {<NEW_LINE>Logger.W(TAG, "Rhoconnect-push registration check failed: " + error);<NEW_LINE>PushContract.handleError(context, error, ANSFacade.ANS_PUSH_CLIENT);<NEW_LINE>} else {<NEW_LINE>Logger.I(TAG, "Rhoconect-push registration check succeded");<NEW_LINE>Logger.D(TAG, "Rhoconect-push token: " + token);<NEW_LINE>PushContract.handleRegistration(context, token, ANSFacade.ANS_PUSH_CLIENT);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Logger.E(TAG, "Rhoconnect-push registration wron response type: " + type);<NEW_LINE>}<NEW_LINE>}
Logger.T(TAG, "Handling rhoconnect-push relgistratoion response");
799,070
protected static Pair<Type, Integer> fromThrift(TTypeDesc typeDesc, int nodeIdx) throws InternalException {<NEW_LINE>TTypeNode node = typeDesc.getTypes().get(nodeIdx);<NEW_LINE>Type type = null;<NEW_LINE>switch(node.getType()) {<NEW_LINE>case SCALAR:<NEW_LINE>{<NEW_LINE>Preconditions.checkState(node.isSetScalarType());<NEW_LINE>TScalarType scalarType = node.getScalarType();<NEW_LINE>if (scalarType.getType() == TPrimitiveType.CHAR) {<NEW_LINE>Preconditions.checkState(scalarType.isSetLen());<NEW_LINE>type = ScalarType.createCharType(scalarType.getLen());<NEW_LINE>} else if (scalarType.getType() == TPrimitiveType.VARCHAR) {<NEW_LINE>Preconditions.checkState(scalarType.isSetLen());<NEW_LINE>type = ScalarType.createVarcharType(scalarType.getLen());<NEW_LINE>} else if (scalarType.getType() == TPrimitiveType.DECIMALV2) {<NEW_LINE>Preconditions.checkState(scalarType.isSetPrecision() && scalarType.isSetScale());<NEW_LINE>type = ScalarType.createDecimalV2Type(scalarType.getPrecision(<MASK><NEW_LINE>} else {<NEW_LINE>type = ScalarType.createType(PrimitiveType.fromThrift(scalarType.getType()));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>throw new InternalException("Return type " + node.getType() + " is not supported now!");<NEW_LINE>}<NEW_LINE>return new Pair<Type, Integer>(type, nodeIdx);<NEW_LINE>}
), scalarType.getScale());
384,163
private void addTaxLossAdjustmentAccountStatementTransaction() {<NEW_LINE>DocumentType type = new DocumentType("KONTOAUSZUG");<NEW_LINE>this.addDocumentTyp(type);<NEW_LINE>Block block = new Block("^[\\d]{1,2}\\.[\\d]{1,2} KESt\\-Verlustausgleich .*$");<NEW_LINE>type.addBlock(block);<NEW_LINE>Transaction<AccountTransaction> pdfTransaction = new Transaction<AccountTransaction>().subject(() -> {<NEW_LINE>AccountTransaction entry = new AccountTransaction();<NEW_LINE>entry.setType(AccountTransaction.Type.TAX_REFUND);<NEW_LINE>return entry;<NEW_LINE>});<NEW_LINE>// 15.10 KESt-Verlustausgleich Depot 7806000200/20211014-41350584 18.10 159,57<NEW_LINE>pdfTransaction.// ISIN US92556H2067 VIACOMCBS INC. BDL-,001<NEW_LINE>// KEST 159,57 EUR<NEW_LINE>section("date", "note", "year", "amount", "isin", "name", "currency").match("^(?<date>[\\d]{1,2}\\.[\\d]{1,2}) (?<note>KESt\\-Verlustausgleich) ([\\s]+)?Depot ([\\s]+)?[\\d]+\\/(?<year>[\\d]{4})[\\d]+\\-[\\d]+ [\\d]{1,2}\\.[\\d]{1,2} (?<amount>[\\.,\\d]+)(\\-)?$").match("^ISIN (?<isin>[\\w]{12}) (?<name>.*)$").match("^KEST ([\\s]+)?[\\.,\\d]+ (?<currency>[\\w]{3})$").assign((t, v) -> {<NEW_LINE>t.setDateTime(asDate(v.get("date") + "." + v.get("year")));<NEW_LINE>t.setShares(0L);<NEW_LINE>t.setSecurity(getOrCreateSecurity(v));<NEW_LINE>t.setCurrencyCode(asCurrencyCode(<MASK><NEW_LINE>t.setAmount(asAmount(v.get("amount")));<NEW_LINE>t.setNote(v.get("note"));<NEW_LINE>}).wrap(t -> {<NEW_LINE>if (t.getCurrencyCode() != null && t.getAmount() != 0)<NEW_LINE>return new TransactionItem(t);<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>block.set(pdfTransaction);<NEW_LINE>}
v.get("currency")));
829,845
private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String networkVirtualApplianceName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (networkVirtualApplianceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter networkVirtualApplianceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-05-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), resourceGroupName, networkVirtualApplianceName, apiVersion, this.client.getSubscriptionId(), accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
95,496
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {<NEW_LINE>builder.startObject();<NEW_LINE>builder.stringListField(INDEX_PATTERNS.getPreferredName(), this.indexPatterns);<NEW_LINE>if (this.template != null) {<NEW_LINE>builder.field(TEMPLATE.getPreferredName(<MASK><NEW_LINE>}<NEW_LINE>if (this.componentTemplates != null) {<NEW_LINE>builder.stringListField(COMPOSED_OF.getPreferredName(), this.componentTemplates);<NEW_LINE>}<NEW_LINE>if (this.priority != null) {<NEW_LINE>builder.field(PRIORITY.getPreferredName(), priority);<NEW_LINE>}<NEW_LINE>if (this.version != null) {<NEW_LINE>builder.field(VERSION.getPreferredName(), version);<NEW_LINE>}<NEW_LINE>if (this.metadata != null) {<NEW_LINE>builder.field(METADATA.getPreferredName(), metadata);<NEW_LINE>}<NEW_LINE>if (this.dataStreamTemplate != null) {<NEW_LINE>builder.field(DATA_STREAM.getPreferredName(), dataStreamTemplate, params);<NEW_LINE>}<NEW_LINE>if (this.allowAutoCreate != null) {<NEW_LINE>builder.field(ALLOW_AUTO_CREATE.getPreferredName(), allowAutoCreate);<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>return builder;<NEW_LINE>}
), this.template, params);
434,629
public static void main(String[] args) {<NEW_LINE>final String USAGE = "To run this example, supply a key id or ARN\n" + "Usage: GetKeyPolicy <key-id>\n" + "Example: GetKeyPolicy 1234abcd-12ab-34cd-56ef-1234567890ab\n";<NEW_LINE>if (args.length != 1) {<NEW_LINE>System.out.println(USAGE);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>String keyId = args[0];<NEW_LINE>AWSKMS kmsClient = AWSKMSClientBuilder.standard().build();<NEW_LINE>// Get the policy for a CMK<NEW_LINE>String policyName = "default";<NEW_LINE>GetKeyPolicyRequest req = new GetKeyPolicyRequest().withKeyId(keyId).withPolicyName(policyName);<NEW_LINE>GetKeyPolicyResult <MASK><NEW_LINE>System.out.printf("Found key policy for %s:%n%s%n", keyId, result.getPolicy());<NEW_LINE>}
result = kmsClient.getKeyPolicy(req);
96,590
public InteractionResultHolder<ItemStack> use(Level worldIn, Player playerIn, @NotNull InteractionHand handIn) {<NEW_LINE>ItemStack itemstack = playerIn.getItemInHand(handIn);<NEW_LINE>if (!worldIn.isClientSide) {<NEW_LINE>ThrownEnderpearl enderpearlentity = new ThrownEnderpearl(worldIn, playerIn);<NEW_LINE>enderpearlentity.setItem(itemstack);<NEW_LINE>enderpearlentity.shootFromRotation(playerIn, playerIn.getXRot(), playerIn.getYRot(), 0.0F, 1.5F, 1.0F);<NEW_LINE>if (!worldIn.addFreshEntity(enderpearlentity)) {<NEW_LINE>if (playerIn instanceof ServerPlayerEntityBridge) {<NEW_LINE>((ServerPlayerEntityBridge) playerIn).bridge$getBukkitEntity().updateInventory();<NEW_LINE>}<NEW_LINE>return new InteractionResultHolder<>(InteractionResult.FAIL, itemstack);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>worldIn.playSound(null, playerIn.getX(), playerIn.getY(), playerIn.getZ(), SoundEvents.ENDER_PEARL_THROW, SoundSource.NEUTRAL, 0.5F, 0.4F / (worldIn.getRandom().nextFloat() * 0.4F + 0.8F));<NEW_LINE>playerIn.getCooldowns().addCooldown(this, 20);<NEW_LINE>playerIn.awardStat(Stats<MASK><NEW_LINE>if (!playerIn.getAbilities().instabuild) {<NEW_LINE>itemstack.shrink(1);<NEW_LINE>}<NEW_LINE>return InteractionResultHolder.sidedSuccess(itemstack, worldIn.isClientSide());<NEW_LINE>}
.ITEM_USED.get(this));
1,300,503
private void checkFailedMeasurments(InsertPlan plan) throws PathNotExistException, StorageEngineException {<NEW_LINE>// check if all path not exist exceptions<NEW_LINE>List<String> failedPaths = plan.getFailedMeasurements();<NEW_LINE>List<Exception> exceptions = plan.getFailedExceptions();<NEW_LINE>boolean isPathNotExistException = true;<NEW_LINE>for (Exception e : exceptions) {<NEW_LINE>Throwable curException = e;<NEW_LINE>while (curException.getCause() != null) {<NEW_LINE>curException = curException.getCause();<NEW_LINE>}<NEW_LINE>if (!(curException instanceof PathNotExistException)) {<NEW_LINE>isPathNotExistException = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isPathNotExistException) {<NEW_LINE>throw new PathNotExistException(failedPaths);<NEW_LINE>} else {<NEW_LINE>throw new StorageEngineException(INSERT_MEASUREMENTS_FAILED_MESSAGE + plan.getFailedMeasurements() + (!exceptions.isEmpty() ? (" caused by " + exceptions.get(0).<MASK><NEW_LINE>}<NEW_LINE>}
getMessage()) : ""));
1,665,693
private synchronized <T extends BaseRealm> RealmAsyncTask doCreateRealmOrGetFromCacheAsync(RealmConfiguration configuration, BaseRealm.InstanceCallback<T> callback, Class<T> realmClass) {<NEW_LINE>Capabilities capabilities = new AndroidCapabilities();<NEW_LINE>capabilities.checkCanDeliverNotification(ASYNC_NOT_ALLOWED_MSG);<NEW_LINE>// noinspection ConstantConditions<NEW_LINE>if (callback == null) {<NEW_LINE>throw new IllegalArgumentException(ASYNC_CALLBACK_NULL_MSG);<NEW_LINE>}<NEW_LINE>// If there is no Realm file it means that we need to sync the initial remote data in the worker thread.<NEW_LINE>if (configuration.isSyncConfiguration() && !configuration.realmExists()) {<NEW_LINE>pendingRealmFileCreation.<MASK><NEW_LINE>}<NEW_LINE>// Always create a Realm instance in the background thread even when there are instances existing on current<NEW_LINE>// thread. This to ensure that onSuccess will always be called in the following event loop but not current one.<NEW_LINE>CreateRealmRunnable<T> createRealmRunnable = new CreateRealmRunnable<T>(new AndroidRealmNotifier(null, capabilities), configuration, callback, realmClass);<NEW_LINE>Future<?> future = BaseRealm.asyncTaskExecutor.submitTransaction(createRealmRunnable);<NEW_LINE>createRealmRunnable.setFuture(future);<NEW_LINE>// For Realms using Async Open on the server, we need to create the session right away<NEW_LINE>// in order to interact with it in a imperative way, e.g. by attaching download progress<NEW_LINE>// listeners<NEW_LINE>ObjectServerFacade.getSyncFacadeIfPossible().createNativeSyncSession(configuration);<NEW_LINE>return new RealmAsyncTaskImpl(future, BaseRealm.asyncTaskExecutor);<NEW_LINE>}
add(configuration.getPath());
366,874
final CancelJobExecutionResult executeCancelJobExecution(CancelJobExecutionRequest cancelJobExecutionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(cancelJobExecutionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CancelJobExecutionRequest> request = null;<NEW_LINE>Response<CancelJobExecutionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CancelJobExecutionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(cancelJobExecutionRequest));<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, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CancelJobExecution");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CancelJobExecutionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CancelJobExecutionResultJsonUnmarshaller());<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());
842,568
public void render(PoseStack ms, int x, int y) {<NEW_LINE>ms.pushPose();<NEW_LINE>ms.translate(x, y, 0);<NEW_LINE>if (icon != null) {<NEW_LINE>RenderSystem.setShaderTexture(0, icon);<NEW_LINE>ms.scale(0.25f, 0.25f, 1);<NEW_LINE>// x and y offset, blit z offset, tex x and y, tex width and height, entire tex<NEW_LINE>// sheet width and height<NEW_LINE>GuiComponent.blit(ms, 0, 0, 0, 0, 0, <MASK><NEW_LINE>} else if (!itemIcon.isEmpty()) {<NEW_LINE>ms.translate(-4, -4, 0);<NEW_LINE>ms.scale(1.5f, 1.5f, 1.5f);<NEW_LINE>GuiGameElement.of(itemIcon).render(ms);<NEW_LINE>}<NEW_LINE>ms.popPose();<NEW_LINE>}
64, 64, 64, 64);
611,344
protected void readNodeChildren(org.w3c.dom.Node node, java.util.Map namespacePrefixes) {<NEW_LINE>org.w3c.dom.<MASK><NEW_LINE>for (int i = 0, size = children.getLength(); i < size; ++i) {<NEW_LINE>org.w3c.dom.Node childNode = children.item(i);<NEW_LINE>String childNodeName = (childNode.getLocalName() == null ? childNode.getNodeName().intern() : childNode.getLocalName().intern());<NEW_LINE>String childNodeValue = "";<NEW_LINE>if (childNode.getFirstChild() != null) {<NEW_LINE>childNodeValue = childNode.getFirstChild().getNodeValue();<NEW_LINE>}<NEW_LINE>if (childNodeName == "xjc-options") {<NEW_LINE>_XjcOptions = newXjcOptions();<NEW_LINE>_XjcOptions.readNode(childNode, namespacePrefixes);<NEW_LINE>} else if (childNodeName == "schema-sources") {<NEW_LINE>_SchemaSources = newSchemaSources();<NEW_LINE>_SchemaSources.readNode(childNode, namespacePrefixes);<NEW_LINE>} else if (childNodeName == "bindings") {<NEW_LINE>_Bindings = newBindings();<NEW_LINE>_Bindings.readNode(childNode, namespacePrefixes);<NEW_LINE>} else if (childNodeName == "catalog") {<NEW_LINE>_Catalog = newCatalog();<NEW_LINE>_Catalog.readNode(childNode, namespacePrefixes);<NEW_LINE>} else {<NEW_LINE>// Found extra unrecognized childNode<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
NodeList children = node.getChildNodes();
1,045,788
public static void createDevice(String projectId, String cloudRegion, String registryName, String deviceId) throws GeneralSecurityException, IOException {<NEW_LINE>// [START create_device]<NEW_LINE>GoogleCredentials credential = GoogleCredentials.getApplicationDefault().createScoped(CloudIotScopes.all());<NEW_LINE>JsonFactory jsonFactory = JacksonFactory.getDefaultInstance();<NEW_LINE>HttpRequestInitializer init = new HttpCredentialsAdapter(credential);<NEW_LINE>final CloudIot service = new CloudIot.Builder(GoogleNetHttpTransport.newTrustedTransport(), jsonFactory, init).setApplicationName(APP_NAME).build();<NEW_LINE>final String registryPath = String.format(<MASK><NEW_LINE>List<Device> devices = service.projects().locations().registries().devices().list(registryPath).setFieldMask("config,gatewayConfig").execute().getDevices();<NEW_LINE>if (devices != null) {<NEW_LINE>System.out.println("Found " + devices.size() + " devices");<NEW_LINE>for (Device d : devices) {<NEW_LINE>if ((d.getId() != null && d.getId().equals(deviceId)) || (d.getName() != null && d.getName().equals(deviceId))) {<NEW_LINE>System.out.println("Device exists, skipping.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println("Creating device with id: " + deviceId);<NEW_LINE>Device device = new Device();<NEW_LINE>device.setId(deviceId);<NEW_LINE>GatewayConfig gwConfig = new GatewayConfig();<NEW_LINE>gwConfig.setGatewayType("NON_GATEWAY");<NEW_LINE>gwConfig.setGatewayAuthMethod("ASSOCIATION_ONLY");<NEW_LINE>device.setGatewayConfig(gwConfig);<NEW_LINE>Device createdDevice = service.projects().locations().registries().devices().create(registryPath, device).execute();<NEW_LINE>System.out.println("Created device: " + createdDevice.toPrettyString());<NEW_LINE>// [END create_device]<NEW_LINE>}
"projects/%s/locations/%s/registries/%s", projectId, cloudRegion, registryName);
170,898
public void insertRow() throws SQLException {<NEW_LINE>isUpdatable();<NEW_LINE>if (!oninsrow || rowbuf == null) {<NEW_LINE>throw new SQLException("no insert data provided");<NEW_LINE>}<NEW_LINE>JDBCResultSetMetaData m = (JDBCResultSetMetaData) getMetaData();<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>sb.append("INSERT INTO ");<NEW_LINE>sb.append(SQLite<MASK><NEW_LINE>sb.append("(");<NEW_LINE>for (int i = 0; i < tr.ncolumns; i++) {<NEW_LINE>sb.append(SQLite.Shell.sql_quote_dbl(m.getColumnName(i + 1)));<NEW_LINE>if (i < tr.ncolumns - 1) {<NEW_LINE>sb.append(",");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sb.append(") VALUES(");<NEW_LINE>for (int i = 0; i < tr.ncolumns; i++) {<NEW_LINE>sb.append(nullrepl ? "'%q'" : "%Q");<NEW_LINE>if (i < tr.ncolumns - 1) {<NEW_LINE>sb.append(",");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sb.append(")");<NEW_LINE>try {<NEW_LINE>this.s.conn.db.exec(sb.toString(), null, rowbuf);<NEW_LINE>} catch (SQLite.Exception e) {<NEW_LINE>throw new SQLException(e.getMessage());<NEW_LINE>}<NEW_LINE>tr.newrow(rowbuf);<NEW_LINE>rowbuf = null;<NEW_LINE>oninsrow = false;<NEW_LINE>last();<NEW_LINE>}
.Shell.sql_quote_dbl(uptable));
719,656
public void visitSimpleInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SimpleInstruction simpleInstruction) {<NEW_LINE>switch(simpleInstruction.opcode) {<NEW_LINE>case InstructionConstants.OP_AASTORE:<NEW_LINE>// Mark array parameters whose element is modified.<NEW_LINE>markModifiedParameters(method, offset, simpleInstruction.stackPopCount(clazz) - 1);<NEW_LINE>// Mark reference values that are put in the array.<NEW_LINE>markEscapingParameters(method, offset, 0);<NEW_LINE>break;<NEW_LINE>case InstructionConstants.OP_IASTORE:<NEW_LINE>case InstructionConstants.OP_LASTORE:<NEW_LINE>case InstructionConstants.OP_FASTORE:<NEW_LINE>case InstructionConstants.OP_DASTORE:<NEW_LINE>case InstructionConstants.OP_BASTORE:<NEW_LINE>case InstructionConstants.OP_CASTORE:<NEW_LINE>case InstructionConstants.OP_SASTORE:<NEW_LINE>// Mark array parameters whose element is modified.<NEW_LINE>markModifiedParameters(method, offset, simpleInstruction<MASK><NEW_LINE>break;<NEW_LINE>case InstructionConstants.OP_ARETURN:<NEW_LINE>// Mark returned reference values.<NEW_LINE>markReturnedParameters(clazz, method, offset, 0);<NEW_LINE>break;<NEW_LINE>case InstructionConstants.OP_ATHROW:<NEW_LINE>// Mark the escaping reference values.<NEW_LINE>markEscapingParameters(method, offset, 0);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
.stackPopCount(clazz) - 1);
1,618,165
protected void perform(JavaSource js, JTextComponent pane, final int[] selection) {<NEW_LINE>final Fix[] f = new Fix[1];<NEW_LINE>String error = null;<NEW_LINE>try {<NEW_LINE>js.runUserActionTask(new Task<CompilationController>() {<NEW_LINE><NEW_LINE>public void run(CompilationController parameter) throws Exception {<NEW_LINE>parameter.toPhase(JavaSource.Phase.RESOLVED);<NEW_LINE>f[0] = ConvertAnonymousToInner.computeFix(parameter, selection[0]<MASK><NEW_LINE>}<NEW_LINE>}, true);<NEW_LINE>if (f[0] == null) {<NEW_LINE>error = selection[0] == selection[1] ? "ERR_CaretNotInAnonymousInnerclass" : "ERR_SelectionNotSupported";<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>error = "ERR_SelectionNotSupported";<NEW_LINE>Exceptions.printStackTrace(e);<NEW_LINE>}<NEW_LINE>if (f[0] != null) {<NEW_LINE>try {<NEW_LINE>f[0].implement();<NEW_LINE>} catch (Exception e) {<NEW_LINE>Exceptions.printStackTrace(e);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (error != null) {<NEW_LINE>String errorText = NbBundle.getMessage(ConvertAnonymousToInnerAction.class, error);<NEW_LINE>NotifyDescriptor nd = new NotifyDescriptor.Message(errorText, NotifyDescriptor.ERROR_MESSAGE);<NEW_LINE>DialogDisplayer.getDefault().notifyLater(nd);<NEW_LINE>}<NEW_LINE>}
, selection[1], false);
1,843,842
private ReadOnlyStyledDocument<PS, SEG, S> concat0(StyledDocument<PS, SEG, S> other, BinaryOperator<Paragraph<PS, SEG, S>> parConcat) {<NEW_LINE>int n = tree.getLeafCount() - 1;<NEW_LINE>Paragraph<PS, SEG, S> p0 = tree.getLeaf(n);<NEW_LINE>Paragraph<PS, SEG, S> p1 = other.<MASK><NEW_LINE>Paragraph<PS, SEG, S> p = parConcat.apply(p0, p1);<NEW_LINE>NonEmptyFingerTree<Paragraph<PS, SEG, S>, Summary> tree1 = tree.updateLeaf(n, p);<NEW_LINE>FingerTree<Paragraph<PS, SEG, S>, Summary> tree2 = (other instanceof ReadOnlyStyledDocument) ? ((ReadOnlyStyledDocument<PS, SEG, S>) other).tree.split(1)._2 : FingerTree.mkTree(other.getParagraphs().subList(1, other.getParagraphs().size()), summaryProvider());<NEW_LINE>return new ReadOnlyStyledDocument<>(tree1.join(tree2));<NEW_LINE>}
getParagraphs().get(0);
1,407,761
public static DescribeProductResourceTagKeyListResponse unmarshall(DescribeProductResourceTagKeyListResponse describeProductResourceTagKeyListResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeProductResourceTagKeyListResponse.setRequestId(_ctx.stringValue("DescribeProductResourceTagKeyListResponse.RequestId"));<NEW_LINE>describeProductResourceTagKeyListResponse.setCode(_ctx.stringValue("DescribeProductResourceTagKeyListResponse.Code"));<NEW_LINE>describeProductResourceTagKeyListResponse.setMessage(_ctx.stringValue("DescribeProductResourceTagKeyListResponse.Message"));<NEW_LINE>describeProductResourceTagKeyListResponse.setNextToken(_ctx.stringValue("DescribeProductResourceTagKeyListResponse.NextToken"));<NEW_LINE>describeProductResourceTagKeyListResponse.setSuccess<MASK><NEW_LINE>List<String> tagKeys = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeProductResourceTagKeyListResponse.TagKeys.Length"); i++) {<NEW_LINE>tagKeys.add(_ctx.stringValue("DescribeProductResourceTagKeyListResponse.TagKeys[" + i + "]"));<NEW_LINE>}<NEW_LINE>describeProductResourceTagKeyListResponse.setTagKeys(tagKeys);<NEW_LINE>return describeProductResourceTagKeyListResponse;<NEW_LINE>}
(_ctx.booleanValue("DescribeProductResourceTagKeyListResponse.Success"));
417,208
private boolean maybeCreateFailActionDueToTransitiveSourcesVersion() {<NEW_LINE>String errorTemplate = ruleContext.getLabel() + ": " + "This target is being built for Python %s but (transitively) includes Python %s-only " + "sources. You can get diagnostic information about which dependencies introduce this " + "version requirement by running the `find_requirements` aspect. For more info see " + "the documentation for the `srcs_version` attribute: " + semantics.getSrcsVersionDocURL();<NEW_LINE>String error = null;<NEW_LINE>if (version == PythonVersion.PY2 && hasPy3OnlySources) {<NEW_LINE>error = String.<MASK><NEW_LINE>} else if (version == PythonVersion.PY3 && hasPy2OnlySources) {<NEW_LINE>error = String.format(errorTemplate, "3", "2");<NEW_LINE>}<NEW_LINE>if (error == null) {<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>ruleContext.registerAction(new FailAction(ruleContext.getActionOwner(), ImmutableList.of(executable), error, Code.INCORRECT_PYTHON_VERSION));<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}
format(errorTemplate, "2", "3");
1,349,164
public final FilterContext filter() throws RecognitionException {<NEW_LINE>FilterContext _localctx = new FilterContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 10, RULE_filter);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(69);<NEW_LINE>match(QUESTION);<NEW_LINE>setState(70);<NEW_LINE>match(LPAREN);<NEW_LINE>setState(72);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>do {<NEW_LINE>{<NEW_LINE>{<NEW_LINE>setState(71);<NEW_LINE>filterExpression();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(74);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>} while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LBRACK) | (1L << AT) | (1L << DOT) | (1L << DOT_DOT) | (1L << ROOT) | (1L << StringLiteral) | (1L << PositiveNumber) | (1L << NegativeNumber) | (1L << NumericLiteral) | (1L << TRUE) | (1L << FALSE) | (1L << <MASK><NEW_LINE>setState(76);<NEW_LINE>match(RPAREN);<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
NULL))) != 0));
386,101
public void readRange(int srcStart, int count, ByteBuffer dst, int dstOffset, boolean bForward) {<NEW_LINE>if (srcStart < 0 || count < 0 || dstOffset < 0 || size() < count + srcStart)<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>final int elmSize = NumberUtils<MASK><NEW_LINE>if (dst.capacity() < (int) (dstOffset + elmSize * count))<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>if (count == 0)<NEW_LINE>return;<NEW_LINE>int j = srcStart;<NEW_LINE>if (!bForward)<NEW_LINE>j += count - 1;<NEW_LINE>final int dj = bForward ? 1 : -1;<NEW_LINE>int offset = dstOffset;<NEW_LINE>for (int i = 0; i < count; i++, offset += elmSize) {<NEW_LINE>dst.putShort(offset, m_buffer[j]);<NEW_LINE>j += dj;<NEW_LINE>}<NEW_LINE>}
.sizeOf((double) 0);
1,138,044
private void processServers() throws InstallException {<NEW_LINE>for (Enumeration<? extends ZipEntry> zipEntries = zip.entries(); zipEntries.hasMoreElements(); ) {<NEW_LINE>ZipEntry nextEntry = zipEntries.nextElement();<NEW_LINE>String entryName = nextEntry<MASK><NEW_LINE>if (nextEntry.isDirectory()) {<NEW_LINE>if (entryName.startsWith("wlp/bin/")) {<NEW_LINE>throw new InstallException(Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("ERROR_SERVER_PACKAGE_CONTAINS_RUNTIME", getAsset().getAbsolutePath()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (entryName.contains("/servers/") && entryName.endsWith("/server.xml")) {<NEW_LINE>String[] dirs = nextEntry.getName().split("/");<NEW_LINE>String serverName = dirs[dirs.length - 2];<NEW_LINE>File serverDir = new File(InstallUtils.getServersDir(), serverName);<NEW_LINE>File serverXML = new File(serverDir, InstallUtils.SERVER_XML);<NEW_LINE>servers.add(new ServerAsset(serverName, serverXML));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (servers.isEmpty()) {<NEW_LINE>throw new InstallException(Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("ERROR_INVALID_SERVER_PACKAGE", getAsset().getAbsolutePath()));<NEW_LINE>}<NEW_LINE>}
.getName().toLowerCase();
1,264,517
public Object intercept(Object obj, Method method, Object[] args) throws Throwable {<NEW_LINE>if (method.getName().equals("getTargetConnection")) {<NEW_LINE>// Handle getTargetConnection method: return underlying RedisConnection.<NEW_LINE>return obj;<NEW_LINE>}<NEW_LINE>RedisCommand commandToExecute = RedisCommand.failsafeCommandLookup(method.getName());<NEW_LINE>if (isPotentiallyThreadBoundCommand(commandToExecute)) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Invoke '%s' on bound connection", method.getName()));<NEW_LINE>}<NEW_LINE>return invoke(method, obj, args);<NEW_LINE>}<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Invoke '%s' on unbound connection", method.getName()));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>return invoke(method, connection, args);<NEW_LINE>} finally {<NEW_LINE>// properly close the unbound connection after executing command<NEW_LINE>if (!connection.isClosed()) {<NEW_LINE>doCloseConnection(connection);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
RedisConnection connection = factory.getConnection();
419,840
private static byte[] rsaPrivateKeyToBlob(RSAPrivateCrtKey rsaPrivCrtKey) throws CryptoException {<NEW_LINE>try {<NEW_LINE>// 2316 sufficient for a 4096 bit RSA key<NEW_LINE>ByteBuffer bb = ByteBuffer.wrap(new byte[4096]);<NEW_LINE>bb.order(ByteOrder.LITTLE_ENDIAN);<NEW_LINE>// Write out the blob fields<NEW_LINE>// rsapubkey.magic<NEW_LINE>UnsignedUtil.putInt(bb, RSA_PRIV_MAGIC);<NEW_LINE>BigInteger modulus = rsaPrivCrtKey.getModulus();<NEW_LINE>int bitLength = modulus.bitLength();<NEW_LINE>// rsapubkey.bitlen<NEW_LINE>UnsignedUtil.putInt(bb, bitLength);<NEW_LINE>BigInteger publicExponent = rsaPrivCrtKey.getPublicExponent();<NEW_LINE>// rsapubkey.pubexp<NEW_LINE>UnsignedUtil.putInt(bb, (int) publicExponent.longValue());<NEW_LINE>int add8 = 0;<NEW_LINE>if ((bitLength % 8) != 0) {<NEW_LINE>add8++;<NEW_LINE>}<NEW_LINE>int add16 = 0;<NEW_LINE>if ((bitLength % 16) != 0) {<NEW_LINE>add16++;<NEW_LINE>}<NEW_LINE>// modulus<NEW_LINE>writeBigInteger(bb, modulus, (bitLength / 8) + add8);<NEW_LINE>// prime1<NEW_LINE>writeBigInteger(bb, rsaPrivCrtKey.getPrimeP(), (bitLength / 16) + add16);<NEW_LINE>// prime2<NEW_LINE>writeBigInteger(bb, rsaPrivCrtKey.getPrimeQ(), (bitLength / 16) + add16);<NEW_LINE>// exponent1<NEW_LINE>writeBigInteger(bb, rsaPrivCrtKey.getPrimeExponentP(), (bitLength / 16) + add16);<NEW_LINE>// exponent2<NEW_LINE>writeBigInteger(bb, rsaPrivCrtKey.getPrimeExponentQ(), <MASK><NEW_LINE>// coefficient<NEW_LINE>writeBigInteger(bb, rsaPrivCrtKey.getCrtCoefficient(), (bitLength / 16) + add16);<NEW_LINE>// privateExponent<NEW_LINE>writeBigInteger(bb, rsaPrivCrtKey.getPrivateExponent(), (bitLength / 8) + add8);<NEW_LINE>return getBufferBytes(bb);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new CryptoException(res.getString("NoConvertKeyToBlob.exception.message"), ex);<NEW_LINE>}<NEW_LINE>}
(bitLength / 16) + add16);
260,380
protected void channelRead0(ChannelHandlerContext ctx, FullHttpRequest request) throws Exception {<NEW_LINE>HttpResponse response;<NEW_LINE>HttpMethod httpMethod = request.getMethod();<NEW_LINE>HttpHeaders headers = request.headers();<NEW_LINE>// when a request has multiple host fields declared it would be equivalent to a comma separated list<NEW_LINE>// the request will be inmediately rejected since it won't be parsed as a valid URI<NEW_LINE>// and won't work to match an item on rpc.host<NEW_LINE>String hostHeader = headers.get(HttpHeaders.Names.HOST);<NEW_LINE>String parsedHeader = parseHostHeader(hostHeader);<NEW_LINE>if (!acceptedHosts.contains(parsedHeader)) {<NEW_LINE>logger.debug("Invalid header HOST {}", hostHeader);<NEW_LINE>response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.BAD_REQUEST);<NEW_LINE>ctx.write(response).addListener(ChannelFutureListener.CLOSE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (HttpMethod.POST.equals(httpMethod)) {<NEW_LINE>String mimeType = HttpUtils.getMimeType(headers.get(HttpHeaders.Names.CONTENT_TYPE));<NEW_LINE>String origin = headers.<MASK><NEW_LINE>String referer = headers.get(HttpHeaders.Names.REFERER);<NEW_LINE>if (!"application/json".equals(mimeType) && !"application/json-rpc".equals(mimeType)) {<NEW_LINE>logger.debug("Unsupported content type");<NEW_LINE>response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.UNSUPPORTED_MEDIA_TYPE);<NEW_LINE>} else if (origin != null && !this.originValidator.isValidOrigin(origin)) {<NEW_LINE>logger.debug("Invalid origin");<NEW_LINE>response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.BAD_REQUEST);<NEW_LINE>} else if (referer != null && !this.originValidator.isValidReferer(referer)) {<NEW_LINE>logger.debug("Invalid referer");<NEW_LINE>response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.BAD_REQUEST);<NEW_LINE>} else {<NEW_LINE>ctx.fireChannelRead(request);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.NOT_IMPLEMENTED);<NEW_LINE>}<NEW_LINE>ctx.write(response).addListener(ChannelFutureListener.CLOSE);<NEW_LINE>}
get(HttpHeaders.Names.ORIGIN);
1,525,568
protected void doAddAppliedMigration(int installedRank, MigrationVersion version, String description, MigrationType type, String script, Integer checksum, int executionTime, boolean success) {<NEW_LINE>boolean tableIsLocked = false;<NEW_LINE>connection.restoreOriginalState();<NEW_LINE>// Lock again for databases with no clean DDL transactions like Oracle<NEW_LINE>// to prevent implicit commits from triggering deadlocks<NEW_LINE>// in highly concurrent environments<NEW_LINE>if (!database.supportsDdlTransactions()) {<NEW_LINE>table.lock();<NEW_LINE>tableIsLocked = true;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String versionStr = version == null ? null : version.toString();<NEW_LINE>if (!database.supportsEmptyMigrationDescription() && "".equals(description)) {<NEW_LINE>description = NO_DESCRIPTION_MARKER;<NEW_LINE>}<NEW_LINE>Object versionObj = versionStr == null ? JdbcNullTypes.StringNull : versionStr;<NEW_LINE>Object checksumObj = checksum == null ? JdbcNullTypes.IntegerNull : checksum;<NEW_LINE>jdbcTemplate.update(database.getInsertStatement(table), installedRank, versionObj, description, type.name(), script, checksumObj, database.getInstalledBy(), executionTime, success);<NEW_LINE>LOG.debug("Schema History table " + table + " successfully updated to reflect changes");<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new FlywaySqlException("Unable to insert row for version '" + <MASK><NEW_LINE>} finally {<NEW_LINE>if (tableIsLocked) {<NEW_LINE>table.unlock();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
version + "' in Schema History table " + table, e);
35,089
public void marshall(BulkDeploymentResult bulkDeploymentResult, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (bulkDeploymentResult == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(bulkDeploymentResult.getCreatedAt(), CREATEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(bulkDeploymentResult.getDeploymentArn(), DEPLOYMENTARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(bulkDeploymentResult.getDeploymentId(), DEPLOYMENTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(bulkDeploymentResult.getDeploymentStatus(), DEPLOYMENTSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(bulkDeploymentResult.getDeploymentType(), DEPLOYMENTTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(bulkDeploymentResult.getErrorDetails(), ERRORDETAILS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(bulkDeploymentResult.getGroupArn(), GROUPARN_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
bulkDeploymentResult.getErrorMessage(), ERRORMESSAGE_BINDING);
292,067
public void playerPortal(PlayerPortalEvent event) {<NEW_LINE>if (event.isCancelled() || (event.getFrom() == null)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// The adjust should have happened much earlier.<NEW_LINE>if (event.getTo() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MultiverseWorld fromWorld = this.worldManager.getMVWorld(event.getFrom().getWorld().getName());<NEW_LINE>MultiverseWorld toWorld = this.worldManager.getMVWorld(event.getTo().getWorld().getName());<NEW_LINE>if (event.getFrom().getWorld().equals(event.getTo().getWorld())) {<NEW_LINE>// The player is Portaling to the same world.<NEW_LINE>Logging.finer("Player '" + event.getPlayer(<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>event.setCancelled(!pt.playerHasMoneyToEnter(fromWorld, toWorld, event.getPlayer(), event.getPlayer(), true));<NEW_LINE>if (event.isCancelled()) {<NEW_LINE>Logging.fine("Player '" + event.getPlayer().getName() + "' was DENIED ACCESS to '" + event.getTo().getWorld().getName() + "' because they don't have the FUNDS required to enter.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (plugin.getMVConfig().getEnforceAccess()) {<NEW_LINE>event.setCancelled(!pt.playerCanGoFromTo(fromWorld, toWorld, event.getPlayer(), event.getPlayer()));<NEW_LINE>if (event.isCancelled()) {<NEW_LINE>Logging.fine("Player '" + event.getPlayer().getName() + "' was DENIED ACCESS to '" + event.getTo().getWorld().getName() + "' because they don't have: multiverse.access." + event.getTo().getWorld().getName());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Logging.fine("Player '" + event.getPlayer().getName() + "' was allowed to go to '" + event.getTo().getWorld().getName() + "' because enforceaccess is off.");<NEW_LINE>}<NEW_LINE>if (!this.plugin.getMVConfig().isUsingDefaultPortalSearch()) {<NEW_LINE>CompatibilityLayer.setPortalSearchRadius(event, this.plugin.getMVConfig().getPortalSearchRadius());<NEW_LINE>}<NEW_LINE>}
).getName() + "' is portaling to the same world.");
569,797
private static boolean _cutteeStartCutterEndEvent(int eventIndex, EditShape editShape, ArrayList<CutEvent> cutEvents, int ipartCuttee, int ivertexCuttee, int ipartCutter, int ivertexCutter, int ifirstVertexCuttee) {<NEW_LINE>Segment segmentCuttee;<NEW_LINE>Segment segmentCutter;<NEW_LINE>Line lineCuttee = new Line();<NEW_LINE>Line lineCutter = new Line();<NEW_LINE>double[] scalarsCuttee = new double[2];<NEW_LINE>double[] scalarsCutter = new double[2];<NEW_LINE>CutEvent cutEvent;<NEW_LINE>segmentCuttee = editShape.getSegment(ivertexCuttee);<NEW_LINE>if (segmentCuttee == null) {<NEW_LINE><MASK><NEW_LINE>segmentCuttee = lineCuttee;<NEW_LINE>}<NEW_LINE>segmentCutter = editShape.getSegment(ivertexCutter);<NEW_LINE>if (segmentCutter == null) {<NEW_LINE>editShape.queryLineConnector(ivertexCutter, lineCutter);<NEW_LINE>segmentCutter = lineCutter;<NEW_LINE>}<NEW_LINE>int count = segmentCuttee.intersect(segmentCutter, null, scalarsCuttee, scalarsCutter, 0.0);<NEW_LINE>// _ASSERT(count > 0);<NEW_LINE>int icutEvent;<NEW_LINE>if (count == 2) {<NEW_LINE>cutEvent = new CutEvent(ivertexCuttee, ipartCuttee, scalarsCuttee[0], scalarsCuttee[1], count, ivertexCutter, ipartCutter, scalarsCutter[0], scalarsCutter[1]);<NEW_LINE>cutEvents.add(cutEvent);<NEW_LINE>icutEvent = editShape.getUserIndex(ivertexCuttee, eventIndex);<NEW_LINE>if (icutEvent < 0)<NEW_LINE>editShape.setUserIndex(ivertexCuttee, eventIndex, cutEvents.size() - 1);<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>boolean bCutEvent = false;<NEW_LINE>if (ivertexCuttee == ifirstVertexCuttee) {<NEW_LINE>cutEvent = new CutEvent(ivertexCuttee, ipartCuttee, scalarsCuttee[0], NumberUtils.NaN(), count, ivertexCutter, ipartCutter, scalarsCutter[0], NumberUtils.NaN());<NEW_LINE>cutEvents.add(cutEvent);<NEW_LINE>icutEvent = editShape.getUserIndex(ivertexCuttee, eventIndex);<NEW_LINE>if (icutEvent < 0)<NEW_LINE>editShape.setUserIndex(ivertexCuttee, eventIndex, cutEvents.size() - 1);<NEW_LINE>bCutEvent = true;<NEW_LINE>}<NEW_LINE>return bCutEvent;<NEW_LINE>}<NEW_LINE>}
editShape.queryLineConnector(ivertexCuttee, lineCuttee);
421,225
static boolean testPackagePatterns(String patterns, String value) {<NEW_LINE>boolean matches = false;<NEW_LINE>if (patterns != null) {<NEW_LINE>patterns = PackageDefinitionUtil.omitDirectives(patterns);<NEW_LINE>// NOI18N<NEW_LINE>StringTokenizer tok = new StringTokenizer(patterns, " ,", false);<NEW_LINE>while (tok.hasMoreTokens() && !matches) {<NEW_LINE>String token = tok.nextToken();<NEW_LINE>token = token.trim();<NEW_LINE>if ("*".equals(token)) {<NEW_LINE>// NOI18N<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>boolean recursive = false;<NEW_LINE>boolean exclusivePattern = false;<NEW_LINE>if (token.startsWith("!")) {<NEW_LINE><MASK><NEW_LINE>exclusivePattern = true;<NEW_LINE>}<NEW_LINE>if (token.endsWith("*")) {<NEW_LINE>// NOI18N<NEW_LINE>// The following cases are tested with maven-bundle-plugin<NEW_LINE>// a.* or a* -> recursive<NEW_LINE>// a. -> non-recursive<NEW_LINE>// NOI18N<NEW_LINE>token = token.substring(0, token.length() - "*".length());<NEW_LINE>recursive = true;<NEW_LINE>if (token.endsWith(".")) {<NEW_LINE>// Removes the last dot also<NEW_LINE>token = token.substring(0, token.length() - 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>matches = recursive ? value.startsWith(token) : value.equals(token);<NEW_LINE>if (matches && exclusivePattern) {<NEW_LINE>// only excluding when it matches<NEW_LINE>matches = !matches;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return matches;<NEW_LINE>}
token = token.substring(1);
1,594,052
public FeatureBuildItem build(SchedulerConfig config, BuildProducer<SyntheticBeanBuildItem> syntheticBeans, SchedulerRecorder recorder, List<ScheduledBusinessMethodItem> scheduledMethods, BuildProducer<GeneratedClassBuildItem> generatedClasses, BuildProducer<ReflectiveClassBuildItem> reflectiveClass, AnnotationProxyBuildItem annotationProxy, ExecutorBuildItem executor) {<NEW_LINE>List<ScheduledMethodMetadata> scheduledMetadata = new ArrayList<>();<NEW_LINE>ClassOutput classOutput = new GeneratedClassGizmoAdaptor(generatedClasses, new Function<String, String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String apply(String name) {<NEW_LINE>// org/acme/Foo_ScheduledInvoker_run_0000 -> org.acme.Foo<NEW_LINE>int idx = name.indexOf(INVOKER_SUFFIX);<NEW_LINE>if (idx != -1) {<NEW_LINE>name = name.substring(0, idx);<NEW_LINE>}<NEW_LINE>if (name.contains(NESTED_SEPARATOR)) {<NEW_LINE>name = name.replace(NESTED_SEPARATOR, "$");<NEW_LINE>}<NEW_LINE>return name;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>for (ScheduledBusinessMethodItem scheduledMethod : scheduledMethods) {<NEW_LINE>ScheduledMethodMetadata metadata = new ScheduledMethodMetadata();<NEW_LINE>String invokerClass = generateInvoker(scheduledMethod, classOutput);<NEW_LINE>reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, invokerClass));<NEW_LINE>metadata.setInvokerClassName(invokerClass);<NEW_LINE>List<Scheduled> <MASK><NEW_LINE>for (AnnotationInstance scheduled : scheduledMethod.getSchedules()) {<NEW_LINE>schedules.add(annotationProxy.builder(scheduled, Scheduled.class).build(classOutput));<NEW_LINE>}<NEW_LINE>metadata.setSchedules(schedules);<NEW_LINE>metadata.setDeclaringClassName(scheduledMethod.getMethod().declaringClass().toString());<NEW_LINE>metadata.setMethodName(scheduledMethod.getMethod().name());<NEW_LINE>scheduledMetadata.add(metadata);<NEW_LINE>}<NEW_LINE>syntheticBeans.produce(SyntheticBeanBuildItem.configure(SchedulerContext.class).setRuntimeInit().supplier(recorder.createContext(config, executor.getExecutorProxy(), scheduledMetadata)).done());<NEW_LINE>return new FeatureBuildItem(Feature.SCHEDULER);<NEW_LINE>}
schedules = new ArrayList<>();
1,847,883
public AddressSetView flowConstants(final Program program, Address flowStart, AddressSetView flowSet, final SymbolicPropogator symEval, final TaskMonitor monitor) throws CancelledException {<NEW_LINE>// follow all flows building up context<NEW_LINE>// use context to fill out addresses on certain instructions<NEW_LINE>ContextEvaluator eval = new ConstantPropagationContextEvaluator(trustWriteMemOption) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean evaluateReference(VarnodeContext context, Instruction instr, int pcodeop, Address address, int size, RefType refType) {<NEW_LINE>if ((refType.isRead() || refType.isWrite()) && adjustPagedAddress(instr, address, refType)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return super.evaluateReference(context, instr, pcodeop, address, size, refType);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Address evaluateConstant(VarnodeContext context, Instruction instr, int pcodeop, Address constant, int size, RefType refType) {<NEW_LINE>// TODO Auto-generated method stub<NEW_LINE>return super.evaluateConstant(context, instr, pcodeop, constant, size, refType);<NEW_LINE>}<NEW_LINE><NEW_LINE>private boolean adjustPagedAddress(Instruction instr, Address address, RefType refType) {<NEW_LINE>PcodeOp[] pcode = instr.getPcode();<NEW_LINE>for (PcodeOp op : pcode) {<NEW_LINE>int numin = op.getNumInputs();<NEW_LINE>if (numin < 1) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (op.getOpcode() != PcodeOp.CALLOTHER) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String opName = instr.getProgram().getLanguage().getUserDefinedOpName((int) op.getInput(0).getOffset());<NEW_LINE>if (opName != null && opName.equals("segment") && numin > 2) {<NEW_LINE>// assume this is a poorly created segment op addr<NEW_LINE>long high = address.getOffset() >> 16;<NEW_LINE>long low = address.getOffset() & 0xffff;<NEW_LINE>address = address.getNewAddress((high << 14) | (low & 0x3fff));<NEW_LINE>makeReference(instr, address, refType);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><NEW_LINE>// handle the reference on the correct read or write operand<NEW_LINE>private void makeReference(Instruction instr, Address address, RefType refType) {<NEW_LINE>int index = (refType.isRead() ? 1 : 0);<NEW_LINE>instr.addOperandReference(index, <MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>return symEval.flowConstants(flowStart, flowSet, eval, true, monitor);<NEW_LINE>}
address, refType, SourceType.ANALYSIS);