idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
798,683 | private Mono<Response<Void>> deleteWithResponseAsync(String resourceGroupName, String integrationAccountName, String schemaName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (integrationAccountName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter integrationAccountName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (schemaName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = <MASK><NEW_LINE>return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, integrationAccountName, schemaName, this.client.getApiVersion(), accept, context);<NEW_LINE>} | this.client.mergeContext(context); |
1,360,120 | private void citationNotExists(EntityManagerContainerBasic emc, Field field, String value, JpaObject jpa, CheckPersist checkPersist, CheckPersistType checkPersistType) throws Exception {<NEW_LINE>if (StringUtils.isNotEmpty(value) && (!ArrayUtils.contains(checkPersist.excludes(), value))) {<NEW_LINE>for (CitationNotExist citationNotExist : checkPersist.citationNotExists()) {<NEW_LINE>EntityManager em = emc.get(citationNotExist.type());<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Long> cq = cb.createQuery(Long.class);<NEW_LINE>Root<? extends JpaObject> root = cq.from(citationNotExist.type());<NEW_LINE>Predicate p = cb.disjunction();<NEW_LINE>for (String str : citationNotExist.fields()) {<NEW_LINE>Path<?> path = root.get(str);<NEW_LINE>if (JpaObjectTools.isList(path)) {<NEW_LINE>p = cb.or(p, cb.isMember(value, (Path<List<MASK><NEW_LINE>} else {<NEW_LINE>p = cb.or(p, cb.equal(path, value));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>p = cb.and(p, cb.notEqual(root.get("id"), jpa.getId()));<NEW_LINE>for (Equal o : citationNotExist.equals()) {<NEW_LINE>p = cb.and(p, cb.equal(root.get(o.field()), jpa.get(o.property())));<NEW_LINE>}<NEW_LINE>for (NotEqual o : citationNotExist.notEquals()) {<NEW_LINE>p = cb.and(p, cb.notEqual(root.get(o.field()), jpa.get(o.property())));<NEW_LINE>}<NEW_LINE>cq.select(cb.count(root)).where(p);<NEW_LINE>Long count = em.createQuery(cq).getSingleResult();<NEW_LINE>if (count != 0) {<NEW_LINE>throw new Exception("check persist stirngValue citationNotExists error, class:" + jpa.getClass().getName() + ", field:" + field.getName() + ", value: " + value + " must be a not existed in class:" + citationNotExist.type() + ", fields:" + StringUtils.join(citationNotExist.fields(), ",") + ".");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | <String>>) path)); |
1,516,010 | public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@name('s0') select * from pattern [a=SupportBeanNumeric -> every b=SupportBean(intPrimitive in (a.intOne, a.intTwo))]";<NEW_LINE>env.compileDeployAddListenerMile(epl, "s0", 0);<NEW_LINE>sendBeanNumeric(env, 10, 20);<NEW_LINE>sendBeanInt(env, 10);<NEW_LINE>env.assertListenerInvoked("s0");<NEW_LINE>sendBeanInt(env, 11);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>sendBeanInt(env, 20);<NEW_LINE>env.assertListenerInvoked("s0");<NEW_LINE>env.undeployAll();<NEW_LINE>epl = "@name('s0') select * from pattern [a=SupportBean_S0 -> every b=SupportBean(theString in (a.p00, a.p01, a.p02))]";<NEW_LINE>env.<MASK><NEW_LINE>env.sendEventBean(new SupportBean_S0(1, "a", "b", "c", "d"));<NEW_LINE>sendBeanString(env, "a");<NEW_LINE>env.assertListenerInvoked("s0");<NEW_LINE>sendBeanString(env, "x");<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>sendBeanString(env, "b");<NEW_LINE>env.assertListenerInvoked("s0");<NEW_LINE>sendBeanString(env, "c");<NEW_LINE>env.assertListenerInvoked("s0");<NEW_LINE>sendBeanString(env, "d");<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.undeployAll();<NEW_LINE>} | compileDeployAddListenerMile(epl, "s0", 1); |
536,096 | public Builder mergeFrom(voldemort.client.protocol.pb.VAdminProto.SlopPurgeJobRequest other) {<NEW_LINE>if (other == voldemort.client.protocol.pb.VAdminProto.SlopPurgeJobRequest.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (!other.filterNodeIds_.isEmpty()) {<NEW_LINE>if (result.filterNodeIds_.isEmpty()) {<NEW_LINE>result.filterNodeIds_ = new java.util.ArrayList<java.lang.Integer>();<NEW_LINE>}<NEW_LINE>result.filterNodeIds_.addAll(other.filterNodeIds_);<NEW_LINE>}<NEW_LINE>if (other.hasFilterZoneId()) {<NEW_LINE>setFilterZoneId(other.getFilterZoneId());<NEW_LINE>}<NEW_LINE>if (!other.filterStoreNames_.isEmpty()) {<NEW_LINE>if (result.filterStoreNames_.isEmpty()) {<NEW_LINE>result.filterStoreNames_ = new java.util.ArrayList<java.lang.String>();<NEW_LINE>}<NEW_LINE>result.<MASK><NEW_LINE>}<NEW_LINE>this.mergeUnknownFields(other.getUnknownFields());<NEW_LINE>return this;<NEW_LINE>} | filterStoreNames_.addAll(other.filterStoreNames_); |
886,616 | /*<NEW_LINE>* Reading configuration values from the env variables, if a value was not provided it falls back to defaults.<NEW_LINE>*/<NEW_LINE>@VisibleForTesting<NEW_LINE>public static void readConfigurationFromEnvVariables() {<NEW_LINE>int desiredContainers = env.getIntEnvVariable(ZALENIUM_DESIRED_CONTAINERS, DEFAULT_AMOUNT_DESIRED_CONTAINERS);<NEW_LINE>setDesiredContainersOnStartup(desiredContainers);<NEW_LINE>int maxDSContainers = env.getIntEnvVariable(ZALENIUM_MAX_DOCKER_SELENIUM_CONTAINERS, DEFAULT_AMOUNT_DOCKER_SELENIUM_CONTAINERS_RUNNING);<NEW_LINE>setMaxDockerSeleniumContainers(maxDSContainers);<NEW_LINE>String swarmOverlayNetwork = env.getStringEnvVariable(ZALENIUM_SWARM_OVERLAY_NETWORK, "");<NEW_LINE>setSwarmOverlayNetwork(swarmOverlayNetwork);<NEW_LINE>ZALENIUM_RUNNING_LOCALLY = Boolean.valueOf(System.getProperty(ZALENIUM_RUNNING_LOCALLY_ENV_VAR));<NEW_LINE>boolean waitForNodes = env.getBooleanEnvVariable(WAIT_FOR_AVAILABLE_NODES, true);<NEW_LINE>setWaitForAvailableNodes(waitForNodes);<NEW_LINE>int timeToWait = env.getIntEnvVariable(TIME_TO_WAIT_TO_START, DEFAULT_TIME_TO_WAIT_TO_START);<NEW_LINE>setTimeToWaitToStart(timeToWait);<NEW_LINE>int maxTimes = env.getIntEnvVariable(MAX_TIMES_TO_PROCESS_REQUEST, DEFAULT_TIMES_TO_PROCESS_REQUEST);<NEW_LINE>setMaxTimesToProcessRequest(maxTimes);<NEW_LINE>int checkContainers = env.getIntEnvVariable(CHECK_CONTAINERS_INTERVAL, DEFAULT_CHECK_CONTAINERS_INTERVAL);<NEW_LINE>setCheckContainersInterval(checkContainers);<NEW_LINE>currentUser = System.getProperty("user.name", "seluser");<NEW_LINE>HOST_GID = env.getStringEnvVariable("HOST_GID", "1000");<NEW_LINE>HOST_UID = <MASK><NEW_LINE>} | env.getStringEnvVariable("HOST_UID", "1000"); |
676,265 | private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>holderPanel = new javax.swing.JPanel();<NEW_LINE>panelSelector = new javax.swing.JComboBox();<NEW_LINE>pnlToolbar = new javax.swing.JPanel();<NEW_LINE>contentArea = new javax.swing.JPanel();<NEW_LINE>setLayout(new java.awt.BorderLayout());<NEW_LINE>holderPanel.setLayout(new java.awt.GridBagLayout());<NEW_LINE>panelSelector.setMinimumSize(new java.awt.Dimension(100, 20));<NEW_LINE>gridBagConstraints = <MASK><NEW_LINE>gridBagConstraints.gridwidth = java.awt.GridBagConstraints.RELATIVE;<NEW_LINE>gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>holderPanel.add(panelSelector, gridBagConstraints);<NEW_LINE>pnlToolbar.setOpaque(false);<NEW_LINE>pnlToolbar.setLayout(new java.awt.GridBagLayout());<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridwidth = java.awt.GridBagConstraints.RELATIVE;<NEW_LINE>gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.weighty = 1.0;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);<NEW_LINE>holderPanel.add(pnlToolbar, gridBagConstraints);<NEW_LINE>add(holderPanel, java.awt.BorderLayout.NORTH);<NEW_LINE>contentArea.setLayout(new java.awt.BorderLayout());<NEW_LINE>add(contentArea, java.awt.BorderLayout.CENTER);<NEW_LINE>} | new java.awt.GridBagConstraints(); |
958,269 | public void run(SourceContext<WindowedValue<byte[]>> sourceContext) throws Exception {<NEW_LINE>if (Iterables.isEmpty(impulseEmitted.get())) {<NEW_LINE>synchronized (sourceContext.getCheckpointLock()) {<NEW_LINE>// emit single impulse element<NEW_LINE>sourceContext.collect(WindowedValue.valueInGlobalWindow(new byte[0]));<NEW_LINE>impulseEmitted.add(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Always emit a final watermark.<NEW_LINE>// (1) In case we didn't restore the pipeline, this is important to close the global window;<NEW_LINE>// if no operator holds back this watermark.<NEW_LINE>// (2) In case we are restoring the pipeline, this is needed to initialize the operators with<NEW_LINE>// the current watermark and trigger execution of any pending timers.<NEW_LINE><MASK><NEW_LINE>// Wait to allow checkpoints of the pipeline<NEW_LINE>waitToEnsureCheckpointingWorksCorrectly();<NEW_LINE>} | sourceContext.emitWatermark(Watermark.MAX_WATERMARK); |
681,589 | private void dynInit(int C_BPartner_ID) {<NEW_LINE>log.info("C_BPartner_ID=" + C_BPartner_ID);<NEW_LINE>if (C_BPartner_ID > 0) {<NEW_LINE>int ShelfLifeMinPct = 0;<NEW_LINE>int ShelfLifeMinDays = 0;<NEW_LINE>String sql = "SELECT bp.ShelfLifeMinPct, bpp.ShelfLifeMinPct, bpp.ShelfLifeMinDays " + "FROM C_BPartner bp " + " LEFT OUTER JOIN C_BPartner_Product bpp" + " ON (bp.C_BPartner_ID=bpp.C_BPartner_ID AND bpp.M_Product_ID=?) " + "WHERE bp.C_BPartner_ID=?";<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, null);<NEW_LINE><MASK><NEW_LINE>pstmt.setInt(2, C_BPartner_ID);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>if (rs.next()) {<NEW_LINE>// BP<NEW_LINE>ShelfLifeMinPct = rs.getInt(1);<NEW_LINE>// BP_P<NEW_LINE>int pct = rs.getInt(2);<NEW_LINE>if (// overwrite<NEW_LINE>pct > 0)<NEW_LINE>ShelfLifeMinDays = pct;<NEW_LINE>ShelfLifeMinDays = rs.getInt(3);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error(sql, e);<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>rs = null;<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>if (ShelfLifeMinPct > 0) {<NEW_LINE>m_sqlMinLife = " AND COALESCE(TRUNC(((TRUNC(asi.GuaranteeDate)-TRUNC(now()))/p.GuaranteeDays)*100),0)>=" + ShelfLifeMinPct;<NEW_LINE>log.info("PAttributeInstance.dynInit - ShelfLifeMinPct=" + ShelfLifeMinPct);<NEW_LINE>}<NEW_LINE>if (ShelfLifeMinDays > 0) {<NEW_LINE>m_sqlMinLife += " AND COALESCE((TRUNC(asi.GuaranteeDate)-TRUNC(now())),0)>=" + ShelfLifeMinDays;<NEW_LINE>log.info("PAttributeInstance.dynInit - ShelfLifeMinDays=" + ShelfLifeMinDays);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// BPartner != 0<NEW_LINE>m_sql = // oldest, smallest first<NEW_LINE>m_table.prepareTable(s_layout, s_sqlFrom, m_M_Warehouse_ID == 0 ? s_sqlWhereWithoutWarehouse : s_sqlWhere, false, "s") + " ORDER BY asi.GuaranteeDate, s.QtyOnHand";<NEW_LINE>//<NEW_LINE>m_table.setRowSelectionAllowed(true);<NEW_LINE>m_table.setMultiSelection(false);<NEW_LINE>m_table.addMouseListener(this);<NEW_LINE>m_table.getSelectionModel().addListSelectionListener(this);<NEW_LINE>//<NEW_LINE>refresh();<NEW_LINE>} | pstmt.setInt(1, m_M_Product_ID); |
679,921 | private RefreshableDataSource createRefreshableDataSource(DataSourceIdentity id) throws SQLException {<NEW_LINE>if (id instanceof ClusterDataSourceIdentity) {<NEW_LINE>Database database = ((ClusterDataSourceIdentity) id).getDatabase();<NEW_LINE>Cluster cluster = database.getCluster();<NEW_LINE>ClusterInfo clusterInfo = new ClusterInfo(database.getClusterName(), database.getShardIndex(), database.isMaster() ? DatabaseRole.MASTER : DatabaseRole.SLAVE, cluster != null && cluster.dbShardingEnabled(), cluster);<NEW_LINE>try {<NEW_LINE>if (cluster != null && cluster.getClusterType() == ClusterType.DRC) {<NEW_LINE>LocalizationConfig localizationConfig = cluster.getLocalizationConfig();<NEW_LINE>LocalizationConfig lastLocalizationConfig = cluster.getLastLocalizationConfig();<NEW_LINE>LocalizationValidator validator = factory.createValidator(clusterInfo, localizationConfig, lastLocalizationConfig);<NEW_LINE>LOGGER.logEvent(LOG_TYPE_CREATE_DATASOURCE, String.format(LOG_NAME_CREATE_DRC_DATASOURCE, clusterInfo.toString()<MASK><NEW_LINE>return new LocalizedDataSource(validator, id, provider.getDataSourceConfigure(id));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.logEvent(LOG_TYPE_CREATE_DATASOURCE, String.format(LOG_NAME_CREATE_DRC_DATASOURCE_FAIL, clusterInfo.toString()), e.getMessage());<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOGGER.logEvent(LOG_TYPE_CREATE_DATASOURCE, String.format(LOG_NAME_CREATE_NORMAL_DATASOURCE, id.getId()), "");<NEW_LINE>SingleDataSourceConfigureProvider dataSourceConfigureProvider = new SingleDataSourceConfigureProvider(id, provider);<NEW_LINE>return new ForceSwitchableDataSource(id, dataSourceConfigureProvider);<NEW_LINE>} | ), localizationConfig.toString()); |
1,513,142 | final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTagsForResourceRequest> request = null;<NEW_LINE>Response<ListTagsForResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Amplify");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTagsForResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsForResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | (super.beforeMarshalling(listTagsForResourceRequest)); |
977,023 | private boolean addUnclosedTagProposals(LocationType fineLocation, List<ICompletionProposal> proposals, ILexemeProvider<HTMLTokenType> lexemeProvider, int offset) {<NEW_LINE>boolean addedProposal = false;<NEW_LINE>// First see if there are any unclosed tags, suggest them first<NEW_LINE>List<String> unclosedElements = HTMLTagUtil.getUnclosedTagNames(_document, offset);<NEW_LINE>if (unclosedElements != null && !unclosedElements.isEmpty()) {<NEW_LINE>int relevance = ICommonCompletionProposal.RELEVANCE_HIGH - 1;<NEW_LINE>for (String unclosedElement : unclosedElements) {<NEW_LINE>ElementElement element = <MASK><NEW_LINE>if (element == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>proposals.add(createCloseTagProposal(element, lexemeProvider, offset, relevance));<NEW_LINE>addedProposal = true;<NEW_LINE>relevance -= 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return addedProposal;<NEW_LINE>} | this._queryHelper.getElement(unclosedElement); |
228,134 | public void putInt(long t, int v) {<NEW_LINE>if (writeCurArrayIndex == capacity) {<NEW_LINE>if (capacity >= CAPACITY_THRESHOLD) {<NEW_LINE>timeRet.add(new long[capacity]);<NEW_LINE>intRet.add(new int[capacity]);<NEW_LINE>writeCurListIndex++;<NEW_LINE>writeCurArrayIndex = 0;<NEW_LINE>} else {<NEW_LINE>int newCapacity = capacity << 1;<NEW_LINE>long[] newTimeData = new long[newCapacity];<NEW_LINE>int[] newValueData = new int[newCapacity];<NEW_LINE>System.arraycopy(timeRet.get(0), 0, newTimeData, 0, capacity);<NEW_LINE>System.arraycopy(intRet.get(0), 0, newValueData, 0, capacity);<NEW_LINE>timeRet.set(0, newTimeData);<NEW_LINE>intRet.set(0, newValueData);<NEW_LINE>capacity = newCapacity;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>timeRet.get<MASK><NEW_LINE>intRet.get(writeCurListIndex)[writeCurArrayIndex] = v;<NEW_LINE>writeCurArrayIndex++;<NEW_LINE>count++;<NEW_LINE>} | (writeCurListIndex)[writeCurArrayIndex] = t; |
651,429 | private boolean activateSubscription(final IBaseResource theSubscription) {<NEW_LINE>IFhirResourceDao subscriptionDao = myDaoRegistry.getSubscriptionDao();<NEW_LINE>SystemRequestDetails srd = SystemRequestDetails.forAllPartition();<NEW_LINE>IBaseResource subscription = null;<NEW_LINE>try {<NEW_LINE>// read can throw ResourceGoneException<NEW_LINE>// if this happens, we will treat this as a failure to activate<NEW_LINE>subscription = subscriptionDao.read(theSubscription.getIdElement(), SystemRequestDetails.forAllPartition());<NEW_LINE>subscription.setId(subscription.getIdElement().toVersionless());<NEW_LINE>ourLog.info("Activating subscription {} from status {} to {}", subscription.getIdElement().toUnqualified().getValue(), SubscriptionConstants.REQUESTED_STATUS, SubscriptionConstants.ACTIVE_STATUS);<NEW_LINE>SubscriptionUtil.setStatus(myFhirContext, subscription, SubscriptionConstants.ACTIVE_STATUS);<NEW_LINE>subscriptionDao.update(subscription, srd);<NEW_LINE>return true;<NEW_LINE>} catch (final UnprocessableEntityException | ResourceGoneException e) {<NEW_LINE>subscription <MASK><NEW_LINE>ourLog.error("Failed to activate subscription " + subscription.getIdElement() + " : " + e.getMessage());<NEW_LINE>ourLog.info("Changing status of {} to ERROR", subscription.getIdElement());<NEW_LINE>SubscriptionUtil.setStatus(myFhirContext, subscription, SubscriptionConstants.ERROR_STATUS);<NEW_LINE>SubscriptionUtil.setReason(myFhirContext, subscription, e.getMessage());<NEW_LINE>subscriptionDao.update(subscription, srd);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | = subscription != null ? subscription : theSubscription; |
915,464 | // we have two signInUp APIs since in version 2.7, we used to also verify the email<NEW_LINE>// as seen below. But then, in newer versions, we stopped doing that cause of<NEW_LINE>// https://github.com/supertokens/supertokens-core/issues/295, so we changed the API spec.<NEW_LINE>@Deprecated<NEW_LINE>public static SignInUpResponse signInUp2_7(Main main, String thirdPartyId, String thirdPartyUserId, String email, boolean isEmailVerified) throws StorageQueryException {<NEW_LINE>SignInUpResponse response = signInUpHelper(<MASK><NEW_LINE>if (isEmailVerified) {<NEW_LINE>try {<NEW_LINE>StorageLayer.getEmailVerificationStorage(main).startTransaction(con -> {<NEW_LINE>StorageLayer.getEmailVerificationStorage(main).updateIsEmailVerified_Transaction(con, response.user.id, response.user.email, true);<NEW_LINE>StorageLayer.getEmailVerificationStorage(main).commitTransaction(con);<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>} catch (StorageTransactionLogicException e) {<NEW_LINE>throw new StorageQueryException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>} | main, thirdPartyId, thirdPartyUserId, email); |
251,485 | private void printHorizontal() {<NEW_LINE>String paramDiv = hasDivide ? " , int divisor" : "";<NEW_LINE>String totalDiv = hasDivide ? "((total + halfDivisor)/divisor)" : "total";<NEW_LINE>out.print("\tpublic static void horizontal( Kernel1D_" + kernelType + " kernel, " + inputType + " src, " + outputType + " dst" + paramDiv + " ) {\n" + "\t\tfinal " + inputData + "[] dataSrc = src.data;\n" + "\t\tfinal " + outputData + "[] dataDst = dst.data;\n" + "\t\tfinal " + kernelData + "[] dataKer = kernel.data;\n" + "\n" + "\t\tfinal int offset = kernel.getOffset();\n" + "\t\tfinal int kernelWidth = kernel.getWidth();\n");<NEW_LINE>if (hasDivide)<NEW_LINE>out.print("\t\tfinal int halfDivisor = divisor/2;\n");<NEW_LINE>out.print("\n" + "\t\tfinal int width = src.getWidth();\n");<NEW_LINE>String body = "\t\t\tint indexDst = dst.startIndex + i*dst.stride + offset;\n" + "\t\t\tint j = src.startIndex + i*src.stride;\n" + "\t\t\tfinal int jEnd = j + width - (kernelWidth - 1);\n" + "\n" + "\t\t\tfor (; j < jEnd; j++) {\n" + "\t\t\t\t" + sumType + " total = 0;\n" + "\t\t\t\tint indexSrc = j;\n" + "\t\t\t\tfor (int k = 0; k < kernelWidth; k++) {\n" + "\t\t\t\t\ttotal += (dataSrc[indexSrc++]" + bitWise + ")*dataKer[k];\n" + "\t\t\t\t}\n" + "\t\t\t\tdataDst[indexDst++] = " <MASK><NEW_LINE>printParallel("i", "0", "src.height", body);<NEW_LINE>out.print("\t}\n\n");<NEW_LINE>} | + typeCast + totalDiv + ";\n" + "\t\t\t}\n"; |
803,621 | final UpdateRecommenderResult executeUpdateRecommender(UpdateRecommenderRequest updateRecommenderRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateRecommenderRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateRecommenderRequest> request = null;<NEW_LINE>Response<UpdateRecommenderResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateRecommenderRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateRecommenderRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Personalize");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateRecommender");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateRecommenderResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateRecommenderResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
1,499,232 | public Condition repeat(String xpathBase, int index, Map<String, Condition> conditionsMap, Map<String, org.opendope.xpaths.Xpaths.Xpath> xpathsMap) {<NEW_LINE>// this Xpathref is a clone already,<NEW_LINE>// but it points to the original xpathObj<NEW_LINE>// org.opendope.xpaths.Xpaths.Xpath xpathObj = XPathsPart.getXPathById(xPaths, id);<NEW_LINE>org.opendope.xpaths.Xpaths.Xpath xpathObj = xpathsMap.get(id);<NEW_LINE>String thisXPath = xpathObj.getDataBinding().getXpath();<NEW_LINE>int <MASK><NEW_LINE>if (xpathBaseIdx < 0) {<NEW_LINE>// nothing to do<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (thisXPath.trim().startsWith("count")) {<NEW_LINE>// we are trying to count rows of the repeat eg<NEW_LINE>// eg xpath="count(/oda:answers/oda:repeat[@qref='r1_OE']/oda:row[1]/oda:repeat[@qref='r2_d4']/oda:row)<=7"<NEW_LINE>// or xpath="count(/oda:answers/oda:repeat[@qref='r1_OE']/oda:row)=999"<NEW_LINE>// We want to enhance EXCEPT for the deepest repeat.<NEW_LINE>int pos = xpathBaseIdx + xpathBase.length();<NEW_LINE>String tail = thisXPath.substring(pos);<NEW_LINE>log.debug("the tail: " + tail);<NEW_LINE>if (tail.contains("oda:repeat")) /* oda:answers XML case */<NEW_LINE>{<NEW_LINE>// There are deeper repeats in thisXPath than xpathBase, so enhance<NEW_LINE>log.debug("deeper repeats in count");<NEW_LINE>} else {<NEW_LINE>if (tail.contains("/")) {<NEW_LINE>// There are deeper bits to thisXPath than xpathBase, so enhance normally..<NEW_LINE>log.debug("deeper bits in count");<NEW_LINE>} else if (tail.startsWith("[")) {<NEW_LINE>// if you want to count the elements in a repeat, you won't have [1]; having that means something different.<NEW_LINE>log.debug("index needs enhancement");<NEW_LINE>} else if (tail.startsWith(")")) {<NEW_LINE>// we want to count elements in the repeat, so don't add an index!<NEW_LINE>log.debug("retaining (repeat count): " + thisXPath);<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>// for example?<NEW_LINE>log.info("fallback, enhance: " + thisXPath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String newPath = enhanceXPath(xpathBase, index + 1, thisXPath);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>if (thisXPath.equals(newPath)) {<NEW_LINE>log.debug("xpath base " + xpathBase + " enhanced NO CHANGE to " + newPath);<NEW_LINE>} else {<NEW_LINE>log.debug("xpath " + thisXPath + " enhanced to " + newPath + " using xpath base " + xpathBase);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Clone the xpath<NEW_LINE>org.opendope.xpaths.Xpaths.Xpath newXPathObj = createNewXPathObject(xpathsMap, newPath, xpathObj, index);<NEW_LINE>// point this at it<NEW_LINE>this.id = newXPathObj.getId();<NEW_LINE>return null;<NEW_LINE>} | xpathBaseIdx = thisXPath.indexOf(xpathBase); |
1,771,389 | final UpdatePipelineNotificationsResult executeUpdatePipelineNotifications(UpdatePipelineNotificationsRequest updatePipelineNotificationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updatePipelineNotificationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<UpdatePipelineNotificationsRequest> request = null;<NEW_LINE>Response<UpdatePipelineNotificationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdatePipelineNotificationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updatePipelineNotificationsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Elastic Transcoder");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdatePipelineNotifications");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdatePipelineNotificationsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdatePipelineNotificationsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
283,033 | public void updateNode(long expressId, EClass ec, VirtualObject eObject) throws DeserializeException, BimserverDatabaseException {<NEW_LINE>for (WaitingVirtualObject waitingObject : waitingObjects.get(expressId)) {<NEW_LINE>if (waitingObject.getStructuralFeature().isMany()) {<NEW_LINE>ListWaitingVirtualObject listWaitingObject = (ListWaitingVirtualObject) waitingObject;<NEW_LINE>if (((EClass) waitingObject.getStructuralFeature().getEType()).isSuperTypeOf(eObject.eClass())) {<NEW_LINE>if (waitingObject instanceof TwoDimensionalListWaitingVirtualObject) {<NEW_LINE>TwoDimensionalListWaitingVirtualObject twoDimensionalListWaitingVirtualObject = (TwoDimensionalListWaitingVirtualObject) waitingObject;<NEW_LINE>ListCapableVirtualObject object2 = twoDimensionalListWaitingVirtualObject.getObject2();<NEW_LINE>object2.setListItemReference(waitingObject.getStructuralFeature(), listWaitingObject.getIndex(), eObject.eClass(), eObject.getOid(), waitingObject.getBufferPosition());<NEW_LINE>} else {<NEW_LINE>waitingObject.getObject().setListItemReference(waitingObject.getStructuralFeature(), listWaitingObject.getIndex(), eObject.eClass(), eObject.getOid(<MASK><NEW_LINE>}<NEW_LINE>decrementOpenConnections(waitingObject.getObject());<NEW_LINE>} else {<NEW_LINE>throw new DeserializeException(DeserializerErrorCode.REFERENCED_OBJECT_CANNOT_BE_STORED_IN_THIS_FIELD, waitingObject.getLineNumber(), "Field " + waitingObject.getStructuralFeature().getName() + " of " + waitingObject.getStructuralFeature().getEContainingClass().getName() + " cannot contain a " + eObject.eClass().getName());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (((EClass) waitingObject.getStructuralFeature().getEType()).isSuperTypeOf(eObject.eClass())) {<NEW_LINE>try {<NEW_LINE>waitingObject.getObject().setReference((EReference) waitingObject.getStructuralFeature(), eObject.getOid(), waitingObject.getBufferPosition());<NEW_LINE>} catch (CannotStoreReferenceInFieldException e) {<NEW_LINE>throw new DeserializeException(e.getDeserializerErrorCode(), e.getMessage());<NEW_LINE>}<NEW_LINE>decrementOpenConnections(waitingObject.getObject());<NEW_LINE>} else {<NEW_LINE>throw new DeserializeException(DeserializerErrorCode.REFERENCED_OBJECT_CANNOT_BE_STORED_IN_THIS_FIELD, waitingObject.getLineNumber(), "Field " + waitingObject.getStructuralFeature().getName() + " of " + waitingObject.getStructuralFeature().getEContainingClass().getName() + " cannot contain a " + eObject.eClass().getName() + "/" + eObject.getOid());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>waitingObjects.remove(expressId);<NEW_LINE>} | ), waitingObject.getBufferPosition()); |
369,221 | public static void generateVisuals(MultiLayerNetwork model, DataSetIterator trainIter, DataSetIterator testIter) throws Exception {<NEW_LINE>if (visualize) {<NEW_LINE>double xMin = 0;<NEW_LINE>double xMax = 1.0;<NEW_LINE>double yMin = -0.2;<NEW_LINE>double yMax = 0.8;<NEW_LINE>int nPointsPerAxis = 100;<NEW_LINE>// Generate x,y points that span the whole range of features<NEW_LINE>INDArray allXYPoints = PlotUtil.generatePointsOnGraph(xMin, xMax, yMin, yMax, nPointsPerAxis);<NEW_LINE>// Get train data and plot with predictions<NEW_LINE>PlotUtil.plotTrainingData(model, trainIter, allXYPoints, nPointsPerAxis);<NEW_LINE><MASK><NEW_LINE>// Get test data, run the test data through the network to generate predictions, and plot those predictions:<NEW_LINE>PlotUtil.plotTestData(model, testIter, allXYPoints, nPointsPerAxis);<NEW_LINE>}<NEW_LINE>} | TimeUnit.SECONDS.sleep(3); |
1,754,091 | private void check(APIRecoverImageMsg msg, Map<String, Quota.QuotaPair> pairs) {<NEW_LINE>String currentAccountUuid = msg.getSession().getAccountUuid();<NEW_LINE>String resourceTargetOwnerAccountUuid = new QuotaUtil().getResourceOwnerAccountUuid(msg.getImageUuid());<NEW_LINE>long imageNumQuota = pairs.get(ImageQuotaConstant.IMAGE_NUM).getValue();<NEW_LINE>long imageSizeQuota = pairs.get(ImageQuotaConstant.IMAGE_SIZE).getValue();<NEW_LINE>long imageNumUsed = new ImageQuotaUtil().getUsedImageNum(resourceTargetOwnerAccountUuid);<NEW_LINE>long imageSizeUsed = new ImageQuotaUtil().getUsedImageSize(resourceTargetOwnerAccountUuid);<NEW_LINE>ImageVO image = dbf.getEntityManager().find(ImageVO.class, msg.getImageUuid());<NEW_LINE>long imageNumAsked = 1;<NEW_LINE>long imageSizeAsked = image.getSize();<NEW_LINE>QuotaUtil.QuotaCompareInfo quotaCompareInfo;<NEW_LINE>{<NEW_LINE>quotaCompareInfo = new QuotaUtil.QuotaCompareInfo();<NEW_LINE>quotaCompareInfo.currentAccountUuid = currentAccountUuid;<NEW_LINE>quotaCompareInfo.resourceTargetOwnerAccountUuid = resourceTargetOwnerAccountUuid;<NEW_LINE>quotaCompareInfo.quotaName = ImageQuotaConstant.IMAGE_NUM;<NEW_LINE>quotaCompareInfo.quotaValue = imageNumQuota;<NEW_LINE>quotaCompareInfo.currentUsed = imageNumUsed;<NEW_LINE>quotaCompareInfo.request = imageNumAsked;<NEW_LINE>new QuotaUtil().CheckQuota(quotaCompareInfo);<NEW_LINE>}<NEW_LINE>{<NEW_LINE><MASK><NEW_LINE>quotaCompareInfo.currentAccountUuid = currentAccountUuid;<NEW_LINE>quotaCompareInfo.resourceTargetOwnerAccountUuid = resourceTargetOwnerAccountUuid;<NEW_LINE>quotaCompareInfo.quotaName = ImageQuotaConstant.IMAGE_SIZE;<NEW_LINE>quotaCompareInfo.quotaValue = imageSizeQuota;<NEW_LINE>quotaCompareInfo.currentUsed = imageSizeUsed;<NEW_LINE>quotaCompareInfo.request = imageSizeAsked;<NEW_LINE>new QuotaUtil().CheckQuota(quotaCompareInfo);<NEW_LINE>}<NEW_LINE>} | quotaCompareInfo = new QuotaUtil.QuotaCompareInfo(); |
88,928 | public static void main(String[] args) {<NEW_LINE>try {<NEW_LINE>EJDB2 db = new EJDB2Builder("example.db").truncate().open();<NEW_LINE>long id = db.put("parrots", "{\"name\":\"Bianca\", \"age\": 4}");<NEW_LINE>System.out.println("Bianca record: " + id);<NEW_LINE>id = <MASK><NEW_LINE>System.out.println("Darko record: " + id);<NEW_LINE>db.createQuery("@parrots/[age > :age]").setLong("age", 3).execute(new JQLCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public long onRecord(long docId, String doc) {<NEW_LINE>System.out.println(String.format("Found %d %s", docId, doc));<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>db.close();<NEW_LINE>} catch (EJDB2Exception ex) {<NEW_LINE>System.out.println(String.format("Error %s", ex.getMessage()));<NEW_LINE>}<NEW_LINE>} | db.put("parrots", "{\"name\":\"Darko\", \"age\": 8}"); |
1,147,997 | public void marshall(VulnerablePackage vulnerablePackage, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (vulnerablePackage == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(vulnerablePackage.getArch(), ARCH_BINDING);<NEW_LINE>protocolMarshaller.marshall(vulnerablePackage.getEpoch(), EPOCH_BINDING);<NEW_LINE>protocolMarshaller.marshall(vulnerablePackage.getFilePath(), FILEPATH_BINDING);<NEW_LINE>protocolMarshaller.marshall(vulnerablePackage.getFixedInVersion(), FIXEDINVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(vulnerablePackage.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(vulnerablePackage.getRelease(), RELEASE_BINDING);<NEW_LINE>protocolMarshaller.marshall(vulnerablePackage.getSourceLayerHash(), SOURCELAYERHASH_BINDING);<NEW_LINE>protocolMarshaller.marshall(vulnerablePackage.getVersion(), VERSION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | vulnerablePackage.getPackageManager(), PACKAGEMANAGER_BINDING); |
1,352,982 | public void transform(TransformationContext transformationContext) {<NEW_LINE>FieldInfo field = transformationContext.getTarget().asField();<NEW_LINE>DotName fieldTypeName = field.type().name();<NEW_LINE>if (!SESSION_EXPOSED_TYPES.contains(fieldTypeName) && !SESSION_FACTORY_EXPOSED_TYPES.contains(fieldTypeName)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DotName jpaAnnotation;<NEW_LINE>if (field.hasAnnotation(ClassNames.JPA_PERSISTENCE_UNIT)) {<NEW_LINE>jpaAnnotation = ClassNames.JPA_PERSISTENCE_UNIT;<NEW_LINE>} else if (field.hasAnnotation(ClassNames.JPA_PERSISTENCE_CONTEXT)) {<NEW_LINE>jpaAnnotation = ClassNames.JPA_PERSISTENCE_CONTEXT;<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>AnnotationValue persistenceUnitNameAnnotationValue = field.annotation(jpaAnnotation).value("unitName");<NEW_LINE>Transformation transformation = transformationContext.transform().add(DotNames.INJECT);<NEW_LINE>if (persistenceUnitNameAnnotationValue == null || persistenceUnitNameAnnotationValue.asString().isEmpty()) {<NEW_LINE><MASK><NEW_LINE>} else if (persistenceUnitDescriptors.size() == 1 && !impliedBlockingPersistenceUnitType.shouldGenerateImpliedBlockingPersistenceUnit() && persistenceUnitDescriptors.get(0).getPersistenceUnitName().equals(persistenceUnitNameAnnotationValue.asString())) {<NEW_LINE>// we are in the case where we have only one persistence unit defined in a persistence.xml<NEW_LINE>// in this case, we consider it the default too if the name matches<NEW_LINE>transformation.add(DotNames.DEFAULT);<NEW_LINE>} else {<NEW_LINE>transformation.add(ClassNames.QUARKUS_PERSISTENCE_UNIT, AnnotationValue.createStringValue("value", persistenceUnitNameAnnotationValue.asString()));<NEW_LINE>}<NEW_LINE>transformation.done();<NEW_LINE>} | transformation.add(DotNames.DEFAULT); |
1,723,227 | private void loadDefaultFormat() {<NEW_LINE>// PS<NEW_LINE>addExportFormat(new ExportFormatPS(getCtx(), getReportEngine()));<NEW_LINE>// XML<NEW_LINE>addExportFormat(new ExportFormatXML(getCtx<MASK><NEW_LINE>// PDF<NEW_LINE>addExportFormat(new ExportFormatPDF(getCtx(), getReportEngine()));<NEW_LINE>// HTML<NEW_LINE>addExportFormat(new ExportFormatHTML(getCtx(), getReportEngine()));<NEW_LINE>// TXT<NEW_LINE>addExportFormat(new ExportFormatTXT(getCtx(), getReportEngine()));<NEW_LINE>// SSV<NEW_LINE>addExportFormat(new ExportFormatSSV(getCtx(), getReportEngine()));<NEW_LINE>// CSV<NEW_LINE>addExportFormat(new ExportFormatCSV(getCtx(), getReportEngine()));<NEW_LINE>// XLS<NEW_LINE>addExportFormat(new ExportFormatXLS(getCtx(), getReportEngine()));<NEW_LINE>// XLSX<NEW_LINE>addExportFormat(new ExportFormatXLSX(getCtx(), getReportEngine()));<NEW_LINE>// ARXML<NEW_LINE>addExportFormat(new ExportFormatARXML(getCtx(), getReportEngine()));<NEW_LINE>} | (), getReportEngine())); |
1,091,069 | public void copyFrom(final CopyFrom obj) {<NEW_LINE>final FeedInformationImpl info = (FeedInformationImpl) obj;<NEW_LINE>setAuthor(info.getAuthor());<NEW_LINE>setBlock(info.getBlock());<NEW_LINE>getCategories().clear();<NEW_LINE>if (info.getCategories() != null) {<NEW_LINE>getCategories().addAll(info.getCategories());<NEW_LINE>}<NEW_LINE>setComplete(info.getComplete());<NEW_LINE>setNewFeedUrl(info.getNewFeedUrl());<NEW_LINE>setExplicitNullable(info.getExplicitNullable());<NEW_LINE>if (info.getImage() != null) {<NEW_LINE>try {<NEW_LINE>setImage(new URL(info.getImage().toExternalForm()));<NEW_LINE>} catch (final MalformedURLException e) {<NEW_LINE>LOG.debug("Error copying URL:" + info.getImage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (info.getImageUri() != null) {<NEW_LINE>setImageUri(info.getImageUri());<NEW_LINE>}<NEW_LINE>if (info.getKeywords() != null) {<NEW_LINE>setKeywords(info.<MASK><NEW_LINE>}<NEW_LINE>setOwnerEmailAddress(info.getOwnerEmailAddress());<NEW_LINE>setOwnerName(info.getOwnerName());<NEW_LINE>setSubtitle(info.getSubtitle());<NEW_LINE>setSummary(info.getSummary());<NEW_LINE>setType(info.getType());<NEW_LINE>} | getKeywords().clone()); |
1,674,707 | public void writePartition() throws IOException, AlluxioException {<NEW_LINE>if (sDebugMode) {<NEW_LINE>mBuf.flip();<NEW_LINE>LOG.info<MASK><NEW_LINE>}<NEW_LINE>mBuf.flip();<NEW_LINE>for (int pId = mLeft; pId < mRight; pId++) {<NEW_LINE>final long startTimeMs = System.currentTimeMillis();<NEW_LINE>FileOutStream os = mFileSystem.createFile(new AlluxioURI(sFileName + (pId + sBaseFileNumber)), CreateFilePOptions.newBuilder().setRecursive(true).build());<NEW_LINE>for (int k = 0; k < sBlocksPerFile; k++) {<NEW_LINE>mBuf.putInt(0, k + mWorkerId);<NEW_LINE>os.write(mBuf.array());<NEW_LINE>}<NEW_LINE>os.close();<NEW_LINE>logPerIteration(startTimeMs, pId, "th WriteAlluxioFile @ Worker ", pId);<NEW_LINE>}<NEW_LINE>} | (FormatUtils.byteBufferToString(mBuf)); |
1,417,113 | public ASTNode visitCreateDefaultShardingStrategy(final CreateDefaultShardingStrategyContext ctx) {<NEW_LINE>ShardingStrategyContext shardingStrategyContext = ctx.shardingStrategy();<NEW_LINE>String shardingAlgorithmName = null;<NEW_LINE>if (null != shardingStrategyContext.shardingAlgorithm().existingAlgorithm()) {<NEW_LINE>shardingAlgorithmName = getIdentifierValue(shardingStrategyContext.shardingAlgorithm().existingAlgorithm().<MASK><NEW_LINE>}<NEW_LINE>AlgorithmSegment algorithmSegment = null;<NEW_LINE>if (null != shardingStrategyContext.shardingAlgorithm().autoCreativeAlgorithm()) {<NEW_LINE>algorithmSegment = (AlgorithmSegment) visitAlgorithmDefinition(shardingStrategyContext.shardingAlgorithm().autoCreativeAlgorithm().algorithmDefinition());<NEW_LINE>}<NEW_LINE>String defaultType = new IdentifierValue(ctx.type.getText()).getValue();<NEW_LINE>String strategyType = getIdentifierValue(shardingStrategyContext.strategyType());<NEW_LINE>String shardingColumn = buildShardingColumn(ctx.shardingStrategy().shardingColumnDefinition());<NEW_LINE>return new CreateDefaultShardingStrategyStatement(defaultType, strategyType, shardingColumn, shardingAlgorithmName, algorithmSegment);<NEW_LINE>} | shardingAlgorithmName()).toLowerCase(); |
139,686 | public void run() {<NEW_LINE>table.removeAll();<NEW_LINE>stacktrace.setText("");<NEW_LINE>int time = CastUtil.cint(pack.get("Service Elapsed"));<NEW_LINE>boolean serviceThread = false;<NEW_LINE>String[] names = scouter.util.SortUtil.sort_string(pack.keys(), pack.size());<NEW_LINE>for (int i = 0, j = 0; i < names.length; i++) {<NEW_LINE>String key = names[i];<NEW_LINE>Value value = pack.get(key);<NEW_LINE>if ("Stack Trace".equals(key)) {<NEW_LINE>stacktrace.setText(CastUtil.cString(value));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String text = null;<NEW_LINE>TableItem ti = new TableItem(table, SWT.NONE, j++);<NEW_LINE>if (value instanceof TextValue) {<NEW_LINE>text = CastUtil.cString(value);<NEW_LINE>ti.setText(0, key);<NEW_LINE>ti.setText(1, text);<NEW_LINE>} else {<NEW_LINE>if (value instanceof DecimalValue) {<NEW_LINE>text = FormatUtil.print(value, "#,##0");<NEW_LINE>} else if (value instanceof DoubleValue || value instanceof FloatValue) {<NEW_LINE>text = FormatUtil.print(value, "#,##0.0##");<NEW_LINE>}<NEW_LINE>ti.setText(new String[] { key, text });<NEW_LINE>}<NEW_LINE>if (key.startsWith("Service")) {<NEW_LINE>if (time > 8000) {<NEW_LINE>ti.setForeground(ColorUtil.getInstance()<MASK><NEW_LINE>} else if (time > 3000) {<NEW_LINE>ti.setForeground(ColorUtil.getInstance().getColor(SWT.COLOR_MAGENTA));<NEW_LINE>} else {<NEW_LINE>ti.setForeground(ColorUtil.getInstance().getColor(SWT.COLOR_BLUE));<NEW_LINE>}<NEW_LINE>serviceThread = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (stopBtn != null && interruptBtn != null) {<NEW_LINE>stopBtn.setEnabled(serviceThread);<NEW_LINE>interruptBtn.setEnabled(serviceThread);<NEW_LINE>resumeBtn.setEnabled(serviceThread);<NEW_LINE>suspendBtn.setEnabled(serviceThread);<NEW_LINE>}<NEW_LINE>sortTable();<NEW_LINE>} | .getColor(SWT.COLOR_RED)); |
673,381 | public void marshall(CreateUserPoolClientRequest createUserPoolClientRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createUserPoolClientRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createUserPoolClientRequest.getUserPoolId(), USERPOOLID_BINDING);<NEW_LINE>protocolMarshaller.marshall(createUserPoolClientRequest.getClientName(), CLIENTNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createUserPoolClientRequest.getGenerateSecret(), GENERATESECRET_BINDING);<NEW_LINE>protocolMarshaller.marshall(createUserPoolClientRequest.getRefreshTokenValidity(), REFRESHTOKENVALIDITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(createUserPoolClientRequest.getAccessTokenValidity(), ACCESSTOKENVALIDITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(createUserPoolClientRequest.getIdTokenValidity(), IDTOKENVALIDITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(createUserPoolClientRequest.getTokenValidityUnits(), TOKENVALIDITYUNITS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createUserPoolClientRequest.getReadAttributes(), READATTRIBUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(createUserPoolClientRequest.getWriteAttributes(), WRITEATTRIBUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(createUserPoolClientRequest.getExplicitAuthFlows(), EXPLICITAUTHFLOWS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createUserPoolClientRequest.getSupportedIdentityProviders(), SUPPORTEDIDENTITYPROVIDERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createUserPoolClientRequest.getCallbackURLs(), CALLBACKURLS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createUserPoolClientRequest.getDefaultRedirectURI(), DEFAULTREDIRECTURI_BINDING);<NEW_LINE>protocolMarshaller.marshall(createUserPoolClientRequest.getAllowedOAuthFlows(), ALLOWEDOAUTHFLOWS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createUserPoolClientRequest.getAllowedOAuthScopes(), ALLOWEDOAUTHSCOPES_BINDING);<NEW_LINE>protocolMarshaller.marshall(createUserPoolClientRequest.getAllowedOAuthFlowsUserPoolClient(), ALLOWEDOAUTHFLOWSUSERPOOLCLIENT_BINDING);<NEW_LINE>protocolMarshaller.marshall(createUserPoolClientRequest.getAnalyticsConfiguration(), ANALYTICSCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createUserPoolClientRequest.getPreventUserExistenceErrors(), PREVENTUSEREXISTENCEERRORS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createUserPoolClientRequest.getEnableTokenRevocation(), ENABLETOKENREVOCATION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | createUserPoolClientRequest.getLogoutURLs(), LOGOUTURLS_BINDING); |
590,947 | public Dialog onCreateDialog(Bundle savedInstanceState) {<NEW_LINE>// Check if there is a playlist key in the provided arguments<NEW_LINE>if (getArguments() != null) {<NEW_LINE>if (getArguments().containsKey(TomahawkFragment.PLAYLIST)) {<NEW_LINE>String playlistId = getArguments(<MASK><NEW_LINE>mPlaylist = DatabaseHelper.get().getPlaylist(playlistId);<NEW_LINE>if (mPlaylist == null) {<NEW_LINE>mPlaylist = Playlist.getByKey(playlistId);<NEW_LINE>if (mPlaylist == null) {<NEW_LINE>dismiss();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (getArguments().containsKey(TomahawkFragment.USER)) {<NEW_LINE>mUser = User.getUserById(getArguments().getString(TomahawkFragment.USER));<NEW_LINE>if (mUser == null) {<NEW_LINE>dismiss();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// set the proper flags for our edittext<NEW_LINE>mNameEditText = (ConfigEdittext) addScrollingViewToFrame(R.layout.config_edittext);<NEW_LINE>mNameEditText.setHint(R.string.name_playlist);<NEW_LINE>mNameEditText.setOnEditorActionListener(mOnKeyboardEnterListener);<NEW_LINE>ViewUtils.showSoftKeyboard(mNameEditText);<NEW_LINE>// Set the textview's text to the proper title<NEW_LINE>setDialogTitle(getString(R.string.create_playlist));<NEW_LINE>setStatusImage(R.drawable.ic_action_playlist);<NEW_LINE>AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());<NEW_LINE>builder.setView(getDialogView());<NEW_LINE>return builder.create();<NEW_LINE>} | ).getString(TomahawkFragment.PLAYLIST); |
475,379 | private void adjustIndexForCustomSchemaFilter(int count, PhyQueryOperation infoSchemaQuery, LogicalInfoSchemaContext infoSchemaContext) {<NEW_LINE>if (!infoSchemaContext.isCustomSchemaFilter() || count <= 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Adjust dynamic parameter index in the where clause<NEW_LINE>SqlBasicCall whereNode = (SqlBasicCall) ((TDDLSqlSelect) infoSchemaQuery.<MASK><NEW_LINE>SqlDynamicParam oldOperand = (SqlDynamicParam) whereNode.getOperands()[1];<NEW_LINE>int oldDynamicParamIndex = oldOperand.getIndex();<NEW_LINE>SqlDynamicParam newOperand = new SqlDynamicParam(oldDynamicParamIndex - count, oldOperand.getTypeName(), oldOperand.getParserPosition(), oldOperand.getValue());<NEW_LINE>whereNode.setOperand(1, newOperand);<NEW_LINE>// Adjust the parameter index<NEW_LINE>int oldParamIndex = oldDynamicParamIndex + 1;<NEW_LINE>Map<Integer, ParameterContext> params = infoSchemaQuery.getParam();<NEW_LINE>ParameterContext parameterContext = params.get(oldParamIndex);<NEW_LINE>int newParamIndex = oldParamIndex - count;<NEW_LINE>parameterContext.setArgs(new Object[] { newParamIndex, parameterContext.getValue() });<NEW_LINE>params.remove(oldParamIndex);<NEW_LINE>params.put(newParamIndex, parameterContext);<NEW_LINE>} | getNativeSqlNode()).getWhere(); |
911,497 | public boolean remove(long taskId, String owner, boolean removeIfEnded) throws Exception {<NEW_LINE>StringBuilder delete = new StringBuilder(66).append("DELETE FROM Task t WHERE t.ID=:i");<NEW_LINE>if (!removeIfEnded)<NEW_LINE>delete.append(" AND t.STATES<").<MASK><NEW_LINE>if (owner != null)<NEW_LINE>delete.append(" AND t.OWNR=:o");<NEW_LINE>final boolean trace = TraceComponent.isAnyTracingEnabled();<NEW_LINE>if (trace && tc.isEntryEnabled())<NEW_LINE>Tr.entry(this, tc, "remove", taskId, owner, removeIfEnded, delete);<NEW_LINE>EntityManager em = getPersistenceServiceUnit().createEntityManager();<NEW_LINE>try {<NEW_LINE>Query query = em.createQuery(delete.toString());<NEW_LINE>query.setParameter("i", taskId);<NEW_LINE>if (owner != null)<NEW_LINE>query.setParameter("o", owner);<NEW_LINE>boolean removed = query.executeUpdate() > 0;<NEW_LINE>if (trace && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "remove", removed);<NEW_LINE>return removed;<NEW_LINE>} finally {<NEW_LINE>em.close();<NEW_LINE>}<NEW_LINE>} | append(TaskState.ENDED.bit); |
172,132 | public void testCompleteOnTimeout() throws Exception {<NEW_LINE>// completeOnTimeout not allowed on Java SE 8, but is otherwise a no-op on an already-completed future<NEW_LINE>CompletableFuture<Integer> cf0 = defaultManagedExecutor.completedFuture(95);<NEW_LINE>CompletableFuture<Integer> cf1;<NEW_LINE>try {<NEW_LINE>cf1 = (CompletableFuture<Integer>) completeOnTimeout.apply(cf0, 195, 295l, TimeUnit.SECONDS);<NEW_LINE>} catch (UnsupportedOperationException x) {<NEW_LINE>if (AT_LEAST_JAVA_9)<NEW_LINE>throw x;<NEW_LINE>else<NEW_LINE>// expected for Java SE 8<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>assertSame(cf0, cf1);<NEW_LINE>assertEquals(Integer.valueOf(95), cf1.join());<NEW_LINE>// time out a blocked completable future<NEW_LINE>CountDownLatch beginLatch = new CountDownLatch(1);<NEW_LINE>CountDownLatch continueLatch = new CountDownLatch(1);<NEW_LINE>try {<NEW_LINE>BlockableSupplier<Integer> supplier = new BlockableSupplier<Integer>(96, beginLatch, continueLatch);<NEW_LINE>CompletableFuture<Integer> cf2 = defaultManagedExecutor.supplyAsync(supplier);<NEW_LINE>CompletableFuture<Integer> cf3 = (CompletableFuture<Integer>) completeOnTimeout.apply(cf2, 396, 96l, TimeUnit.MINUTES);<NEW_LINE>CompletableFuture<Integer> cf4 = (CompletableFuture<Integer>) completeOnTimeout.apply(cf2, 496, 96l, TimeUnit.MICROSECONDS);<NEW_LINE>assertSame(cf2, cf3);<NEW_LINE>assertSame(cf2, cf4);<NEW_LINE>assertEquals(Integer.valueOf(496), cf2.get(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE><MASK><NEW_LINE>assertFalse(cf2.isCompletedExceptionally());<NEW_LINE>assertFalse(cf2.isCancelled());<NEW_LINE>// Expect supplier thread to be interrupted due to premature completion<NEW_LINE>for (long start = System.nanoTime(); supplier.executionThread != null && System.nanoTime() - start < TIMEOUT_NS; TimeUnit.MILLISECONDS.sleep(200)) ;<NEW_LINE>assertNull(supplier.executionThread);<NEW_LINE>} finally {<NEW_LINE>// unblock<NEW_LINE>continueLatch.countDown();<NEW_LINE>}<NEW_LINE>} | assertTrue(cf2.isDone()); |
512,942 | private void renderTracers(MatrixStack matrixStack, double partialTicks, int regionX, int regionZ) {<NEW_LINE>RenderSystem.setShader(GameRenderer::getPositionColorShader);<NEW_LINE>RenderSystem.setShaderColor(1, 1, 1, 1);<NEW_LINE>Matrix4f matrix = matrixStack.peek().getPositionMatrix();<NEW_LINE>BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();<NEW_LINE>bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION_COLOR);<NEW_LINE>Vec3d start = RotationUtils.getClientLookVec().add(RenderUtils.getCameraPos()).subtract(regionX, 0, regionZ);<NEW_LINE>for (PlayerEntity e : players) {<NEW_LINE>Vec3d interpolationOffset = new Vec3d(e.getX(), e.getY(), e.getZ()).subtract(e.prevX, e.prevY, e.prevZ<MASK><NEW_LINE>Vec3d end = e.getBoundingBox().getCenter().subtract(interpolationOffset).subtract(regionX, 0, regionZ);<NEW_LINE>float r, g, b;<NEW_LINE>if (WURST.getFriends().contains(e.getEntityName())) {<NEW_LINE>r = 0;<NEW_LINE>g = 0;<NEW_LINE>b = 1;<NEW_LINE>} else {<NEW_LINE>float f = MC.player.distanceTo(e) / 20F;<NEW_LINE>r = MathHelper.clamp(2 - f, 0, 1);<NEW_LINE>g = MathHelper.clamp(f, 0, 1);<NEW_LINE>b = 0;<NEW_LINE>}<NEW_LINE>bufferBuilder.vertex(matrix, (float) start.x, (float) start.y, (float) start.z).color(r, g, b, 0.5F).next();<NEW_LINE>bufferBuilder.vertex(matrix, (float) end.x, (float) end.y, (float) end.z).color(r, g, b, 0.5F).next();<NEW_LINE>}<NEW_LINE>bufferBuilder.end();<NEW_LINE>BufferRenderer.draw(bufferBuilder);<NEW_LINE>} | ).multiply(1 - partialTicks); |
1,047,875 | public IndexResponse indexPermissionsForOneDvObject(DvObject dvObject) {<NEW_LINE>if (dvObject == null) {<NEW_LINE>return new IndexResponse("problem indexing... null DvObject passed in");<NEW_LINE>}<NEW_LINE>long dvObjectId = dvObject.getId();<NEW_LINE>Collection<SolrInputDocument> docs = new ArrayList<>();<NEW_LINE>List<DvObjectSolrDoc> definitionPoints = determineSolrDocs(dvObject);<NEW_LINE>for (DvObjectSolrDoc dvObjectSolrDoc : definitionPoints) {<NEW_LINE>SolrInputDocument solrInputDocument = SearchUtil.createSolrDoc(dvObjectSolrDoc);<NEW_LINE>docs.add(solrInputDocument);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>persistToSolr(docs);<NEW_LINE>boolean updatePermissionTimeSuccessful = false;<NEW_LINE>if (dvObject != null) {<NEW_LINE>DvObject <MASK><NEW_LINE>if (savedDvObject != null) {<NEW_LINE>updatePermissionTimeSuccessful = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new IndexResponse("attempted to index permissions for DvObject " + dvObjectId + " and updatePermissionTimeSuccessful was " + updatePermissionTimeSuccessful);<NEW_LINE>} catch (SolrServerException | IOException ex) {<NEW_LINE>return new IndexResponse("problem indexing");<NEW_LINE>}<NEW_LINE>} | savedDvObject = dvObjectService.updatePermissionIndexTime(dvObject); |
1,843,622 | public void filePathsDirty(@Nullable final Collection<FilePath> filesDirty, @Nullable final Collection<FilePath> dirsRecursivelyDirty) {<NEW_LINE>try {<NEW_LINE>final MultiMap<AbstractVcs, FilePath> filesConverted = groupByVcs(filesDirty);<NEW_LINE>final MultiMap<AbstractVcs, FilePath> dirsConverted = groupByVcs(dirsRecursivelyDirty);<NEW_LINE>if (filesConverted.isEmpty() && dirsConverted.isEmpty())<NEW_LINE>return;<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("dirty files: " + toString(filesConverted) + "; dirty dirs: " + toString(dirsConverted) + "; " + findFirstInterestingCallerClass());<NEW_LINE>}<NEW_LINE>boolean hasSomethingDirty;<NEW_LINE>synchronized (LOCK) {<NEW_LINE>if (!myReady)<NEW_LINE>return;<NEW_LINE>markDirty(myDirtBuilder, filesConverted, false);<NEW_LINE><MASK><NEW_LINE>hasSomethingDirty = !myDirtBuilder.isEmpty();<NEW_LINE>}<NEW_LINE>if (hasSomethingDirty) {<NEW_LINE>myChangeListManager.scheduleUpdate();<NEW_LINE>}<NEW_LINE>} catch (ProcessCanceledException ignore) {<NEW_LINE>}<NEW_LINE>} | markDirty(myDirtBuilder, dirsConverted, true); |
1,035,077 | public CanaryStatus unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CanaryStatus canaryStatus = new CanaryStatus();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("State", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>canaryStatus.setState(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("StateReason", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>canaryStatus.setStateReason(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("StateReasonCode", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>canaryStatus.setStateReasonCode(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return canaryStatus;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
400,694 | public FunctionEntity load(InputStream input) throws IOException {<NEW_LINE>DumpInputStream data = new DumpInputStream(input);<NEW_LINE>FunctionEntity entity = new FunctionEntity(context);<NEW_LINE>entity.setStatic(data.readBoolean());<NEW_LINE>entity.setName(data.readName());<NEW_LINE>entity.setInternalName(data.readName());<NEW_LINE>entity.setReturnReference(data.readBoolean());<NEW_LINE>entity.setReturnType(data.readHintType());<NEW_LINE><MASK><NEW_LINE>if (returnTypeClass != null && !returnTypeClass.isEmpty()) {<NEW_LINE>entity.setReturnTypeClass(returnTypeClass);<NEW_LINE>}<NEW_LINE>entity.setReturnTypeNullable(data.readBoolean());<NEW_LINE>entity.setUsesStackTrace(data.readBoolean());<NEW_LINE>entity.setImmutable(data.readBoolean());<NEW_LINE>entity.setResult(data.readMemory());<NEW_LINE>entity.setEmpty(data.readBoolean());<NEW_LINE>entity.setTrace(data.readTrace(context));<NEW_LINE>int paramCount = data.readInt();<NEW_LINE>if (paramCount < 0)<NEW_LINE>throw new DumpException("Invalid param count");<NEW_LINE>entity.setParameters(new ParameterEntity[paramCount]);<NEW_LINE>for (int i = 0; i < paramCount; i++) {<NEW_LINE>ParameterEntity param = parameterDumper.load(input);<NEW_LINE>param.setTrace(entity.getTrace());<NEW_LINE>entity.getParameters()[i] = param;<NEW_LINE>}<NEW_LINE>entity.setData(data.readRawData(Integer.MAX_VALUE));<NEW_LINE>data.readRawData();<NEW_LINE>return entity;<NEW_LINE>} | String returnTypeClass = data.readName(); |
1,591,860 | public Referable find(Predicate<Referable> pred) {<NEW_LINE>Set<ClassReferable> <MASK><NEW_LINE>Deque<ClassReferable> toVisit = new ArrayDeque<>();<NEW_LINE>toVisit.add(myReferable);<NEW_LINE>Extent extent = myExtent;<NEW_LINE>while (!toVisit.isEmpty()) {<NEW_LINE>ClassReferable classRef = toVisit.removeLast();<NEW_LINE>if (!visitedClasses.add(classRef)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (LocatedReferable referable : classRef.getFieldReferables()) {<NEW_LINE>if (pred.test(referable)) {<NEW_LINE>return referable;<NEW_LINE>}<NEW_LINE>if (referable.hasAlias()) {<NEW_LINE>AliasReferable aliasRef = new AliasReferable(referable);<NEW_LINE>if (pred.test(aliasRef)) {<NEW_LINE>return aliasRef;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (extent == Extent.WITH_DYNAMIC) {<NEW_LINE>for (GlobalReferable referable : classRef.getDynamicReferables()) {<NEW_LINE>if (pred.test(referable)) {<NEW_LINE>return referable;<NEW_LINE>}<NEW_LINE>if (referable.hasAlias()) {<NEW_LINE>AliasReferable aliasRef = new AliasReferable(referable);<NEW_LINE>if (pred.test(aliasRef)) {<NEW_LINE>return aliasRef;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (extent == Extent.WITH_SUPER_DYNAMIC) {<NEW_LINE>extent = Extent.WITH_DYNAMIC;<NEW_LINE>}<NEW_LINE>List<? extends ClassReferable> superClasses = classRef.getSuperClassReferences();<NEW_LINE>if (myExtent == Extent.WITH_SUPER_CLASSES) {<NEW_LINE>for (ClassReferable superClass : superClasses) {<NEW_LINE>if (pred.test(superClass)) {<NEW_LINE>return superClass;<NEW_LINE>}<NEW_LINE>if (superClass.hasAlias()) {<NEW_LINE>AliasReferable aliasRef = new AliasReferable(superClass);<NEW_LINE>if (pred.test(aliasRef)) {<NEW_LINE>return aliasRef;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = superClasses.size() - 1; i >= 0; i--) {<NEW_LINE>toVisit.add(superClasses.get(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | visitedClasses = new HashSet<>(); |
347,786 | final CreateConfigurationSetEventDestinationResult executeCreateConfigurationSetEventDestination(CreateConfigurationSetEventDestinationRequest createConfigurationSetEventDestinationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createConfigurationSetEventDestinationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateConfigurationSetEventDestinationRequest> request = null;<NEW_LINE>Response<CreateConfigurationSetEventDestinationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateConfigurationSetEventDestinationRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Pinpoint Email");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateConfigurationSetEventDestination");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateConfigurationSetEventDestinationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateConfigurationSetEventDestinationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | (super.beforeMarshalling(createConfigurationSetEventDestinationRequest)); |
470,659 | private String[] computeTypeArgumentProposals(CompletionProposal proposal) {<NEW_LINE>try {<NEW_LINE>IType type = (IType) resolveJavaElement(compilationUnit.getJavaProject(), proposal);<NEW_LINE>if (type == null) {<NEW_LINE>return new String[0];<NEW_LINE>}<NEW_LINE>ITypeParameter[] parameters = type.getTypeParameters();<NEW_LINE>if (parameters.length == 0) {<NEW_LINE>return new String[0];<NEW_LINE>}<NEW_LINE>String[] arguments = new String[parameters.length];<NEW_LINE>ITypeBinding expectedTypeBinding = getExpectedTypeForGenericParameters();<NEW_LINE>if (expectedTypeBinding != null && expectedTypeBinding.isParameterizedType()) {<NEW_LINE>// in this case, the type arguments we propose need to be compatible<NEW_LINE>// with the corresponding type parameters to declared type<NEW_LINE>IType expectedType = (IType) expectedTypeBinding.getJavaElement();<NEW_LINE>IType[] path = TypeProposalUtils.computeInheritancePath(type, expectedType);<NEW_LINE>if (path == null) {<NEW_LINE>// proposed type does not inherit from expected type<NEW_LINE>// the user might be looking for an inner type of proposed type<NEW_LINE>// to instantiate -> do not add any type arguments<NEW_LINE>return new String[0];<NEW_LINE>}<NEW_LINE>int[] indices = new int[parameters.length];<NEW_LINE>for (int paramIdx = 0; paramIdx < parameters.length; paramIdx++) {<NEW_LINE>indices[paramIdx] = TypeProposalUtils.mapTypeParameterIndex(path, path.length - 1, paramIdx);<NEW_LINE>}<NEW_LINE>// for type arguments that are mapped through to the expected type's<NEW_LINE>// parameters, take the arguments of the expected type<NEW_LINE>ITypeBinding[] typeArguments = expectedTypeBinding.getTypeArguments();<NEW_LINE>for (int paramIdx = 0; paramIdx < parameters.length; paramIdx++) {<NEW_LINE>if (indices[paramIdx] != -1) {<NEW_LINE>// type argument is mapped through<NEW_LINE>ITypeBinding binding <MASK><NEW_LINE>arguments[paramIdx] = computeTypeProposal(binding, parameters[paramIdx]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// for type arguments that are not mapped through to the expected type,<NEW_LINE>// take the lower bound of the type parameter<NEW_LINE>for (int i = 0; i < arguments.length; i++) {<NEW_LINE>if (arguments[i] == null) {<NEW_LINE>arguments[i] = computeTypeProposal(parameters[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return arguments;<NEW_LINE>} catch (JavaModelException e) {<NEW_LINE>return new String[0];<NEW_LINE>}<NEW_LINE>} | = typeArguments[indices[paramIdx]]; |
34,898 | public void eval(EvaluationContext ctx) {<NEW_LINE>super.evalChildren(ctx);<NEW_LINE><MASK><NEW_LINE>int batchSize = chunk.batchSize();<NEW_LINE>boolean isSelectionInUse = chunk.isSelectionInUse();<NEW_LINE>int[] sel = chunk.selection();<NEW_LINE>RandomAccessBlock outputVectorSlot = chunk.slotIn(outputIndex, outputDataType);<NEW_LINE>RandomAccessBlock inputVectorSlot = chunk.slotIn(children[0].getOutputIndex(), children[0].getOutputDataType());<NEW_LINE>Slice input = ((DecimalBlock) inputVectorSlot).getMemorySegments();<NEW_LINE>long[] output = ((ULongBlock) outputVectorSlot).longArray();<NEW_LINE>DecimalStructure tmpDecimal = new DecimalStructure();<NEW_LINE>// handle nulls<NEW_LINE>VectorizedExpressionUtils.mergeNulls(chunk, outputIndex, children[0].getOutputIndex());<NEW_LINE>if (isSelectionInUse) {<NEW_LINE>for (int i = 0; i < batchSize; i++) {<NEW_LINE>int j = sel[i];<NEW_LINE>int fromIndex = j * DECIMAL_MEMORY_SIZE;<NEW_LINE>// The convert result will directly wrote to decimal memory segment<NEW_LINE>DecimalStructure fromValue = new DecimalStructure(input.slice(fromIndex, DECIMAL_MEMORY_SIZE));<NEW_LINE>tmpDecimal.reset();<NEW_LINE>FastDecimalUtils.round(fromValue, tmpDecimal, 0, DecimalRoundMod.HALF_UP);<NEW_LINE>long l = DecimalConverter.decimalToULong(tmpDecimal)[0];<NEW_LINE>output[j] = l;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < batchSize; i++) {<NEW_LINE>int fromIndex = i * DECIMAL_MEMORY_SIZE;<NEW_LINE>// The convert result will directly wrote to decimal memory segment<NEW_LINE>DecimalStructure fromValue = new DecimalStructure(input.slice(fromIndex, DECIMAL_MEMORY_SIZE));<NEW_LINE>tmpDecimal.reset();<NEW_LINE>FastDecimalUtils.round(fromValue, tmpDecimal, 0, DecimalRoundMod.HALF_UP);<NEW_LINE>long l = DecimalConverter.decimalToULong(tmpDecimal)[0];<NEW_LINE>output[i] = l;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | MutableChunk chunk = ctx.getPreAllocatedChunk(); |
466,147 | public Cursor queryChildDocuments(String parentDocumentId, String[] projection, String sortOrder) throws FileNotFoundException {<NEW_LINE>Log.d(TAG, "queryChildDocuments(), id=" + parentDocumentId);<NEW_LINE>Context context = getNonNullContext();<NEW_LINE>Document parentFolder = toDocument(parentDocumentId);<NEW_LINE>FileDataStorageManager storageManager = parentFolder.getStorageManager();<NEW_LINE>final FileCursor resultCursor = new FileCursor(projection);<NEW_LINE>for (OCFile file : storageManager.getFolderContent(parentFolder.getFile(), false)) {<NEW_LINE>resultCursor.addFile(new Document(storageManager, file));<NEW_LINE>}<NEW_LINE>boolean isLoading = false;<NEW_LINE>if (parentFolder.isExpired()) {<NEW_LINE>final ReloadFolderDocumentTask task = new ReloadFolderDocumentTask(parentFolder, result -> context.getContentResolver().notifyChange(toNotifyUri(parentFolder), null, false));<NEW_LINE>task.executeOnExecutor(executor);<NEW_LINE>resultCursor.setLoadingTask(task);<NEW_LINE>isLoading = true;<NEW_LINE>}<NEW_LINE>final Bundle extra = new Bundle();<NEW_LINE>extra.putBoolean(DocumentsContract.EXTRA_LOADING, isLoading);<NEW_LINE>resultCursor.setExtras(extra);<NEW_LINE>resultCursor.setNotificationUri(context.getContentResolver<MASK><NEW_LINE>return resultCursor;<NEW_LINE>} | (), toNotifyUri(parentFolder)); |
1,493,652 | private T provision(Errors errors, InternalContext context, ConstructionContext<T> constructionContext) throws ErrorsException {<NEW_LINE>try {<NEW_LINE>T t;<NEW_LINE>try {<NEW_LINE>Object[] parameters = SingleParameterInjector.getAll(errors, context, parameterInjectors);<NEW_LINE>t = constructionProxy.newInstance(parameters);<NEW_LINE>constructionContext.setProxyDelegates(t);<NEW_LINE>} finally {<NEW_LINE>constructionContext.finishConstruction();<NEW_LINE>}<NEW_LINE>// Store reference. If an injector re-enters this factory, they'll get the same reference.<NEW_LINE>constructionContext.setCurrentReference(t);<NEW_LINE>membersInjector.injectMembers(<MASK><NEW_LINE>membersInjector.notifyListeners(t, errors);<NEW_LINE>return t;<NEW_LINE>} catch (InvocationTargetException userException) {<NEW_LINE>Throwable cause = userException.getCause() != null ? userException.getCause() : userException;<NEW_LINE>throw errors.withSource(constructionProxy.getInjectionPoint()).errorInjectingConstructor(cause).toException();<NEW_LINE>} finally {<NEW_LINE>constructionContext.removeCurrentReference();<NEW_LINE>}<NEW_LINE>} | t, errors, context, false); |
1,799,847 | void fillStructs() {<NEW_LINE>for (var structCfg : docTypeConfig.structtype()) {<NEW_LINE>if (isPositionStruct(structCfg)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int idx = structCfg.idx();<NEW_LINE>StructDataType type = (StructDataType) typesByIdx.get(idx);<NEW_LINE>for (var parent : structCfg.inherits()) {<NEW_LINE>var parentStruct = (StructDataType) typesByIdx.get(parent.type());<NEW_LINE>type.inherit(parentStruct);<NEW_LINE>}<NEW_LINE>for (var fieldCfg : structCfg.field()) {<NEW_LINE>if (fieldCfg.type() == idx) {<NEW_LINE>log.fine("Self-referencing struct " + structCfg.name() + " field: " + fieldCfg);<NEW_LINE>}<NEW_LINE>DataType fieldType = getOrCreateType(fieldCfg.type());<NEW_LINE>type.addField(new Field(fieldCfg.name(), fieldCfg.internalid(), fieldType));<NEW_LINE>}<NEW_LINE>if (docType != DataType.DOCUMENT) {<NEW_LINE>docType.addDeclaredStructType(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | structCfg.name(), type); |
195,979 | final DescribeUserHierarchyGroupResult executeDescribeUserHierarchyGroup(DescribeUserHierarchyGroupRequest describeUserHierarchyGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeUserHierarchyGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeUserHierarchyGroupRequest> request = null;<NEW_LINE>Response<DescribeUserHierarchyGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeUserHierarchyGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeUserHierarchyGroupRequest));<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, "Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeUserHierarchyGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeUserHierarchyGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeUserHierarchyGroupResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
413,347 | public void batch() {<NEW_LINE>LogUtils.d("RenderManager", "do batch size " + mUIUpdateNodes.size());<NEW_LINE>// mContext.getGlobalConfigs().getLogAdapter().log(TAG,"do batch size " + mShouldUpdateNodes.size());<NEW_LINE>for (int i = 0; i < mUIUpdateNodes.size(); i++) {<NEW_LINE>RenderNode uiNode = mUIUpdateNodes.get(i);<NEW_LINE>uiNode.batchStart();<NEW_LINE>}<NEW_LINE>for (int i = 0; i < mUIUpdateNodes.size(); i++) {<NEW_LINE>mUIUpdateNodes.get(i).createView();<NEW_LINE>}<NEW_LINE>for (int i = 0; i < mUIUpdateNodes.size(); i++) {<NEW_LINE>RenderNode <MASK><NEW_LINE>uiNode.update();<NEW_LINE>}<NEW_LINE>for (int i = 0; i < mUIUpdateNodes.size(); i++) {<NEW_LINE>RenderNode uiNode = mUIUpdateNodes.get(i);<NEW_LINE>uiNode.batchComplete();<NEW_LINE>}<NEW_LINE>mUIUpdateNodes.clear();<NEW_LINE>// measureInWindow and dispatch ui function<NEW_LINE>for (int i = 0; i < mNullUIUpdateNodes.size(); i++) {<NEW_LINE>mNullUIUpdateNodes.get(i).createView();<NEW_LINE>}<NEW_LINE>for (int i = 0; i < mNullUIUpdateNodes.size(); i++) {<NEW_LINE>mNullUIUpdateNodes.get(i).update();<NEW_LINE>}<NEW_LINE>mNullUIUpdateNodes.clear();<NEW_LINE>} | uiNode = mUIUpdateNodes.get(i); |
1,361,104 | public void populateGlobalValues(String root, Map<DefDescriptor<? extends Definition>, Definition> defs) throws QuickFixException {<NEW_LINE>UsageMap<PropertyReference> refs = getReferenceUsageMap(root, defs);<NEW_LINE>Map<Throwable, Collection<Location>> errors = new LinkedHashMap<>();<NEW_LINE>AuraContext context = contextService.getCurrentContext();<NEW_LINE>GlobalValueProvider provider = context.<MASK><NEW_LINE>Set<PropertyReference> validRefs = new HashSet<>();<NEW_LINE>for (Map.Entry<PropertyReference, Set<Location>> entry : refs.entrySet()) {<NEW_LINE>try {<NEW_LINE>PropertyReference ref = entry.getKey();<NEW_LINE>provider.validate(ref);<NEW_LINE>validRefs.add(ref);<NEW_LINE>} catch (InvalidExpressionException e) {<NEW_LINE>errors.put(e, entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>provider.loadValues(validRefs);<NEW_LINE>if (!errors.isEmpty()) {<NEW_LINE>throw new CompositeValidationException("Unable to load values for " + root, errors);<NEW_LINE>}<NEW_LINE>} | getGlobalProviders().get(root); |
1,354,448 | final GetPortfolioSummaryResult executeGetPortfolioSummary(GetPortfolioSummaryRequest getPortfolioSummaryRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getPortfolioSummaryRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<GetPortfolioSummaryRequest> request = null;<NEW_LINE>Response<GetPortfolioSummaryResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetPortfolioSummaryRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getPortfolioSummaryRequest));<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, "MigrationHubStrategy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetPortfolioSummary");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetPortfolioSummaryResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetPortfolioSummaryResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
245,478 | private static Map<Long, ShallowTrace> parseTraces(final JsonNode rootNode) throws IOException {<NEW_LINE>Map<Long, ShallowTrace> traceMap = new HashMap<>();<NEW_LINE>for (JsonNode traceNode : getField(rootNode, JsonTraceCodec.TRACES)) {<NEW_LINE>final long traceId = getLongField(traceNode, JsonTraceCodec.TRACE_ID);<NEW_LINE>final <MASK><NEW_LINE>final String name = getTextField(traceNode, JsonTraceCodec.TRACE_NAME);<NEW_LINE>shallowBuilder.setName(name);<NEW_LINE>if (traceNode.get(JsonTraceCodec.TRACE_HIDDEN) != null)<NEW_LINE>shallowBuilder.setHidden(getBooleanField(traceNode, JsonTraceCodec.TRACE_HIDDEN));<NEW_LINE>if (traceNode.get(JsonTraceCodec.TRACE_SYSTEM_HIDDEN) != null)<NEW_LINE>shallowBuilder.setSystemHidden(getBooleanField(traceNode, JsonTraceCodec.TRACE_SYSTEM_HIDDEN));<NEW_LINE>if (traceNode.get(JsonTraceCodec.TRACE_VALUE) != null)<NEW_LINE>shallowBuilder.setValue(getTextField(traceNode, JsonTraceCodec.TRACE_VALUE));<NEW_LINE>if (traceNode.get(JsonTraceCodec.TRACE_START_NANOS) != null)<NEW_LINE>shallowBuilder.setNativeStartNanos(getLongField(traceNode, JsonTraceCodec.TRACE_START_NANOS));<NEW_LINE>if (traceNode.get(JsonTraceCodec.TRACE_PENDING_NANOS) != null)<NEW_LINE>shallowBuilder.setNativePendingNanos(getLongField(traceNode, JsonTraceCodec.TRACE_PENDING_NANOS));<NEW_LINE>if (traceNode.get(JsonTraceCodec.TRACE_END_NANOS) != null)<NEW_LINE>shallowBuilder.setNativeEndNanos(getLongField(traceNode, JsonTraceCodec.TRACE_END_NANOS));<NEW_LINE>if (traceNode.get(JsonTraceCodec.TRACE_ATTRIBUTES) != null) {<NEW_LINE>for (JsonNode node : getField(traceNode, JsonTraceCodec.TRACE_ATTRIBUTES)) {<NEW_LINE>String key = getTextField(node, JsonTraceCodec.TRACE_ATTRIBUTE_KEY);<NEW_LINE>String value = getTextField(node, JsonTraceCodec.TRACE_ATTRIBUTE_VALUE);<NEW_LINE>shallowBuilder.addAttribute(key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final ResultType resultType = ResultType.valueOf(getTextField(traceNode, JsonTraceCodec.TRACE_RESULT_TYPE));<NEW_LINE>shallowBuilder.setResultType(resultType);<NEW_LINE>if (traceNode.get(JsonTraceCodec.TRACE_TASK_TYPE) != null)<NEW_LINE>shallowBuilder.setTaskType(getTextField(traceNode, JsonTraceCodec.TRACE_TASK_TYPE));<NEW_LINE>traceMap.put(traceId, shallowBuilder.build());<NEW_LINE>}<NEW_LINE>return traceMap;<NEW_LINE>} | ShallowTraceBuilder shallowBuilder = new ShallowTraceBuilder(traceId); |
1,774,553 | public int countVowelPermutation(int n) {<NEW_LINE>long[] dp = new long[5];<NEW_LINE>long[<MASK><NEW_LINE>Arrays.fill(dp, 1);<NEW_LINE>for (int i = 0; i < n - 1; ++i) {<NEW_LINE>t[0] = (dp[1] + dp[2] + dp[4]) % MOD;<NEW_LINE>t[1] = (dp[0] + dp[2]) % MOD;<NEW_LINE>t[2] = (dp[1] + dp[3]) % MOD;<NEW_LINE>t[3] = dp[2];<NEW_LINE>t[4] = (dp[2] + dp[3]) % MOD;<NEW_LINE>System.arraycopy(t, 0, dp, 0, 5);<NEW_LINE>}<NEW_LINE>long ans = 0;<NEW_LINE>for (int i = 0; i < 5; ++i) {<NEW_LINE>ans = (ans + dp[i]) % MOD;<NEW_LINE>}<NEW_LINE>return (int) ans;<NEW_LINE>} | ] t = new long[5]; |
1,562,189 | public static OkHttpClient.Builder enableTls12OnPreLollipop(OkHttpClient.Builder client) {<NEW_LINE>if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP_MR1 && "Samsung".equals(Build.MANUFACTURER)) {<NEW_LINE>try {<NEW_LINE>Timber.d("Creating unified TrustManager");<NEW_LINE>Certificate cert = getUserTrustRootCertificate();<NEW_LINE>String keyStoreType = KeyStore.getDefaultType();<NEW_LINE>KeyStore keyStore = KeyStore.getInstance(keyStoreType);<NEW_LINE>keyStore.load(null, null);<NEW_LINE>keyStore.setCertificateEntry("ca", cert);<NEW_LINE>UnifiedTrustManager trustManager = new UnifiedTrustManager(keyStore);<NEW_LINE>Timber.d("Finished: Creating unified TrustManager");<NEW_LINE>SSLContext sc = SSLContext.getInstance("TLSv1.2");<NEW_LINE>sc.init(null, new TrustManager[] { trustManager }, null);<NEW_LINE>Tls12SocketFactory socketFactory = new Tls12SocketFactory(sc.getSocketFactory());<NEW_LINE>client.sslSocketFactory(socketFactory, trustManager);<NEW_LINE>ConnectionSpec cs = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS).tlsVersions(TlsVersion.TLS_1_2).build();<NEW_LINE>List<ConnectionSpec> specs = new ArrayList<>(3);<NEW_LINE>specs.add(cs);<NEW_LINE>specs.add(ConnectionSpec.COMPATIBLE_TLS);<NEW_LINE><MASK><NEW_LINE>client.connectionSpecs(specs);<NEW_LINE>} catch (Exception exc) {<NEW_LINE>Timber.e(exc, "Error while setting TLS 1.2");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return client;<NEW_LINE>} | specs.add(ConnectionSpec.CLEARTEXT); |
1,104,670 | public void onBindHeaderViewHolder(HeaderViewHolder holder, int position) {<NEW_LINE>sortType = SharedPreferencesUtil.getInt(ConstantStrings.PREF_SORT_SPEAKER, SORTED_BY_NAME);<NEW_LINE>String speakerData;<NEW_LINE>if (sortType == SORTED_BY_NAME)<NEW_LINE>speakerData = Utils.nullToEmpty(getItem(position).getName());<NEW_LINE>else if (sortType == SORTED_BY_ORGANIZATION)<NEW_LINE>speakerData = Utils.nullToEmpty(getItem<MASK><NEW_LINE>else<NEW_LINE>speakerData = Utils.nullToEmpty(getItem(position).getCountry());<NEW_LINE>if (!TextUtils.isEmpty(speakerData) && sortType == SORTED_BY_NAME)<NEW_LINE>holder.header.setText(String.valueOf(speakerData.toUpperCase().charAt(0)));<NEW_LINE>else if (!TextUtils.isEmpty(speakerData) && (sortType == SORTED_BY_ORGANIZATION || sortType == SORTED_BY_COUNTRY))<NEW_LINE>holder.header.setText(String.valueOf(speakerData));<NEW_LINE>else<NEW_LINE>holder.header.setText(String.valueOf("#"));<NEW_LINE>} | (position).getOrganisation()); |
388,007 | @DB<NEW_LINE>public Project activateProject(final long projectId) {<NEW_LINE>Account caller = CallContext.current().getCallingAccount();<NEW_LINE>// check that the project exists<NEW_LINE>final ProjectVO project = getProject(projectId);<NEW_LINE>if (project == null) {<NEW_LINE><MASK><NEW_LINE>ex.addProxyObject(String.valueOf(projectId), "projectId");<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>CallContext.current().setProject(project);<NEW_LINE>// verify permissions<NEW_LINE>_accountMgr.checkAccess(caller, AccessType.ModifyProject, true, _accountMgr.getAccount(project.getProjectAccountId()));<NEW_LINE>// allow project activation only when it's in Suspended state<NEW_LINE>Project.State currentState = project.getState();<NEW_LINE>if (currentState == State.Active) {<NEW_LINE>s_logger.debug("The project id=" + projectId + " is already active, no need to activate it again");<NEW_LINE>return project;<NEW_LINE>}<NEW_LINE>if (currentState != State.Suspended) {<NEW_LINE>throw new InvalidParameterValueException("Can't activate the project in " + currentState + " state");<NEW_LINE>}<NEW_LINE>Transaction.execute(new TransactionCallbackNoReturn() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void doInTransactionWithoutResult(TransactionStatus status) {<NEW_LINE>project.setState(Project.State.Active);<NEW_LINE>_projectDao.update(projectId, project);<NEW_LINE>_accountMgr.enableAccount(project.getProjectAccountId());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return _projectDao.findById(projectId);<NEW_LINE>} | InvalidParameterValueException ex = new InvalidParameterValueException("Unable to find project with specified id"); |
1,529,634 | protected void visitAnnotations(AnnotatedNode node, int target) {<NEW_LINE>if (node.getAnnotations().isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.currentClass.setAnnotated(true);<NEW_LINE>if (!isAnnotationCompatible()) {<NEW_LINE>addError("Annotations are not supported in the current runtime. " + JVM_ERROR_MESSAGE, node);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, List<AnnotationNode>> <MASK><NEW_LINE>for (AnnotationNode unvisited : node.getAnnotations()) {<NEW_LINE>AnnotationNode visited;<NEW_LINE>{<NEW_LINE>ErrorCollector errorCollector = new ErrorCollector(source.getConfiguration());<NEW_LINE>AnnotationVisitor visitor = new AnnotationVisitor(source, errorCollector);<NEW_LINE>visited = visitor.visit(unvisited);<NEW_LINE>source.getErrorCollector().addCollectorContents(errorCollector);<NEW_LINE>}<NEW_LINE>String name = visited.getClassNode().getName();<NEW_LINE>if (!visited.hasSourceRetention()) {<NEW_LINE>List<AnnotationNode> seen = nonSourceAnnotations.get(name);<NEW_LINE>if (seen == null) {<NEW_LINE>seen = new ArrayList<>();<NEW_LINE>}<NEW_LINE>seen.add(visited);<NEW_LINE>nonSourceAnnotations.put(name, seen);<NEW_LINE>}<NEW_LINE>// Check if the annotation target is correct, unless it's the target annotating an annotation definition<NEW_LINE>// defining on which target elements the annotation applies<NEW_LINE>boolean isTargetAnnotation = name.equals("java.lang.annotation.Target");<NEW_LINE>if (!isTargetAnnotation && !visited.isTargetAllowed(target)) {<NEW_LINE>addError("Annotation @" + name + " is not allowed on element " + AnnotationNode.targetToName(target), visited);<NEW_LINE>}<NEW_LINE>visitDeprecation(node, visited);<NEW_LINE>visitOverride(node, visited);<NEW_LINE>}<NEW_LINE>checkForDuplicateAnnotations(node, nonSourceAnnotations);<NEW_LINE>} | nonSourceAnnotations = new LinkedHashMap<>(); |
1,284,442 | public static ErrorDescription forTree(HintContext context, Tree tree, String text, Fix... fixes) {<NEW_LINE>int start;<NEW_LINE>int end;<NEW_LINE>int javacEnd;<NEW_LINE>if (context.getHintMetadata().kind == Hint.Kind.INSPECTION) {<NEW_LINE>start = (int) context.getInfo().getTrees().getSourcePositions().getStartPosition(context.getInfo().getCompilationUnit(), tree);<NEW_LINE>javacEnd = (int) context.getInfo().getTrees().getSourcePositions().getEndPosition(context.getInfo().getCompilationUnit(), tree);<NEW_LINE>end = Math.min(javacEnd, findLineEnd(context<MASK><NEW_LINE>} else {<NEW_LINE>start = javacEnd = end = context.getCaretLocation();<NEW_LINE>}<NEW_LINE>if (start != (-1) && end != (-1)) {<NEW_LINE>if (start > end) {<NEW_LINE>LOG.log(Level.WARNING, "Wrong positions reported for tree (start = {0}, end = {1}): {2}", new Object[] { start, end, tree });<NEW_LINE>}<NEW_LINE>LazyFixList fixesForED = org.netbeans.spi.editor.hints.ErrorDescriptionFactory.lazyListForFixes(resolveDefaultFixes(context, fixes));<NEW_LINE>return org.netbeans.spi.editor.hints.ErrorDescriptionFactory.createErrorDescription("text/x-java:" + context.getHintMetadata().id, context.getSeverity(), text, context.getHintMetadata().description, fixesForED, context.getInfo().getFileObject(), start, end);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | .getInfo(), start)); |
1,337,222 | private static synchronized void removeDefaultConfiguration() {<NEW_LINE>if (instance == null || customConfigurationInstalled) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ConcurrentCompositeConfiguration defaultConfig = (ConcurrentCompositeConfiguration) instance;<NEW_LINE>// stop loading of the configuration<NEW_LINE>DynamicURLConfiguration defaultFileConfig = (DynamicURLConfiguration) defaultConfig.getConfiguration(URL_CONFIG_NAME);<NEW_LINE>if (defaultFileConfig != null) {<NEW_LINE>defaultFileConfig.stopLoading();<NEW_LINE>}<NEW_LINE>Collection<ConfigurationListener> listeners = defaultConfig.getConfigurationListeners();<NEW_LINE>// find the listener and remove it so that DynamicProperty will no longer receives<NEW_LINE>// callback from the default configuration source<NEW_LINE>ConfigurationListener dynamicPropertyListener = null;<NEW_LINE>for (ConfigurationListener l : listeners) {<NEW_LINE>if (l instanceof ExpandedConfigurationListenerAdapter && ((ExpandedConfigurationListenerAdapter) l).getListener() instanceof DynamicProperty.DynamicPropertyListener) {<NEW_LINE>dynamicPropertyListener = l;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (dynamicPropertyListener != null) {<NEW_LINE>defaultConfig.removeConfigurationListener(dynamicPropertyListener);<NEW_LINE>}<NEW_LINE>if (configMBean != null) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Error unregistering with JMX", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>instance = null;<NEW_LINE>} | ConfigJMXManager.unRegisterConfigMBean(defaultConfig, configMBean); |
1,012,604 | public MfaProvider deserialize(JsonParser p, DeserializationContext ctxt) {<NEW_LINE>MfaProvider result = new MfaProvider();<NEW_LINE>JsonNode node = JsonUtils.readTree(p);<NEW_LINE>MfaProviderType type;<NEW_LINE>try {<NEW_LINE>type = MfaProviderType.forValue(getNodeAsString(node, FIELD_TYPE, "google-authenticator"));<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>type = null;<NEW_LINE>}<NEW_LINE>// deserialize based on type<NEW_LINE>JsonNode configNode = node.get("config");<NEW_LINE>String config = configNode != null ? (configNode.isTextual() ? configNode.textValue() : <MASK><NEW_LINE>AbstractMfaProviderConfig definition = null;<NEW_LINE>if (type != null) {<NEW_LINE>if (type == MfaProviderType.GOOGLE_AUTHENTICATOR) {<NEW_LINE>definition = StringUtils.hasText(config) ? JsonUtils.readValue(config, GoogleMfaProviderConfig.class) : new GoogleMfaProviderConfig();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.setConfig(definition);<NEW_LINE>result.setType(type);<NEW_LINE>result.setName(getNodeAsString(node, FIELD_NAME, null));<NEW_LINE>result.setId(getNodeAsString(node, FIELD_ID, null));<NEW_LINE>result.setIdentityZoneId(getNodeAsString(node, FIELD_IDENTITY_ZONE_ID, null));<NEW_LINE>result.setCreated(getNodeAsDate(node, FIELD_CREATED));<NEW_LINE>result.setLastModified(getNodeAsDate(node, FIELD_LAST_MODIFIED));<NEW_LINE>return result;<NEW_LINE>} | configNode.toString()) : null; |
1,602,229 | // The tested deployment exceptions cause FFDC so we have to allow for this.<NEW_LINE>@AllowedFFDC()<NEW_LINE>public void launchHealth31Tck() throws Exception {<NEW_LINE>String protocol = "http";<NEW_LINE><MASK><NEW_LINE>String port = Integer.toString(server.getPort(PortType.WC_defaulthost));<NEW_LINE>Map<String, String> additionalProps = new HashMap<>();<NEW_LINE>additionalProps.put("test.url", protocol + "://" + host + ":" + port);<NEW_LINE>MvnUtils.runTCKMvnCmd(server, "io.openliberty.microprofile.health.3.1.internal_fat_tck", this.getClass() + ":launchHealth31Tck", additionalProps);<NEW_LINE>Map<String, String> resultInfo = MvnUtils.getResultInfo(server);<NEW_LINE>resultInfo.put("results_type", "MicroProfile");<NEW_LINE>resultInfo.put("feature_name", "Health");<NEW_LINE>resultInfo.put("feature_version", "3.1");<NEW_LINE>MvnUtils.preparePublicationFile(resultInfo);<NEW_LINE>} | String host = server.getHostname(); |
623,737 | private static void fillDocAndMetaFields(SearchContext context, FieldsVisitor fieldsVisitor, Map<String, Set<String>> storedToRequestedFields, Map<String, DocumentField> docFields, Map<String, DocumentField> metaFields) {<NEW_LINE>for (Map.Entry<String, List<Object>> entry : fieldsVisitor.fields().entrySet()) {<NEW_LINE>String storedField = entry.getKey();<NEW_LINE>List<Object> storedValues = entry.getValue();<NEW_LINE>if (storedToRequestedFields.containsKey(storedField)) {<NEW_LINE>for (String requestedField : storedToRequestedFields.get(storedField)) {<NEW_LINE>if (context.mapperService().isMetadataField(requestedField)) {<NEW_LINE>metaFields.put(requestedField, new DocumentField(requestedField, storedValues));<NEW_LINE>} else {<NEW_LINE>docFields.put(requestedField, new DocumentField(requestedField, storedValues));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (context.mapperService().isMetadataField(storedField)) {<NEW_LINE>metaFields.put(storedField, new DocumentField(storedField, storedValues));<NEW_LINE>} else {<NEW_LINE>docFields.put(storedField, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | new DocumentField(storedField, storedValues)); |
1,090,607 | /*<NEW_LINE>* Retrieve the server audit log<NEW_LINE>* @param userId userId under which the request is performed<NEW_LINE>* @param serverName The name of the server to interrogate<NEW_LINE>* @param methodName The name of the method being invoked<NEW_LINE>* @return the server type as a String<NEW_LINE>*<NEW_LINE>* Exceptions returned by the server<NEW_LINE>* @throws DinoViewServiceException an error was detected and reported<NEW_LINE>*<NEW_LINE>*/<NEW_LINE>public OMRSAuditLogReport serverGetAuditLog(String userId, String serverName, String platformName, String methodName) throws DinoViewServiceException {<NEW_LINE>try {<NEW_LINE>String <MASK><NEW_LINE>AuditLogServicesClient auditLogServicesClient = this.getAuditLogServicesClient(userId, serverName, platformRootURL);<NEW_LINE>return auditLogServicesClient.getAuditLogReport(userId);<NEW_LINE>} catch (RepositoryErrorException exc) {<NEW_LINE>return null;<NEW_LINE>} catch (org.odpi.openmetadata.repositoryservices.ffdc.exception.InvalidParameterException e) {<NEW_LINE>throw DinoExceptionHandler.mapOMRSInvalidParameterException(this.getClass().getName(), methodName, e);<NEW_LINE>} catch (org.odpi.openmetadata.repositoryservices.ffdc.exception.UserNotAuthorizedException e) {<NEW_LINE>throw DinoExceptionHandler.mapOMRSUserNotAuthorizedException(this.getClass().getName(), methodName, e);<NEW_LINE>}<NEW_LINE>} | platformRootURL = resolvePlatformRootURL(platformName, methodName); |
116,428 | public int blend(int src, int dst) {<NEW_LINE>int sr = (src >> 24) & 0xFF;<NEW_LINE>int sg = (src >> 16) & 0xFF;<NEW_LINE>int sb = <MASK><NEW_LINE>int a = src & 0xFF;<NEW_LINE>int dr = (dst >> 16) & 0xFF;<NEW_LINE>int dg = (dst >> 8) & 0xFF;<NEW_LINE>int db = dst & 0xFF;<NEW_LINE>int mb = (a * sb + (0xFF - a) * db) / 0xFF;<NEW_LINE>int mg = (a * sg + (0xFF - a) * dg) / 0xFF;<NEW_LINE>int mr = (a * sr + (0xFF - a) * dr) / 0xFF;<NEW_LINE>int mix = 0xFF000000 | mb | (mg << 8) | (mr << 16);<NEW_LINE>return mix;<NEW_LINE>} | (src >> 8) & 0xFF; |
783,719 | final CreateQueryLoggingConfigResult executeCreateQueryLoggingConfig(CreateQueryLoggingConfigRequest createQueryLoggingConfigRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createQueryLoggingConfigRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateQueryLoggingConfigRequest> request = null;<NEW_LINE>Response<CreateQueryLoggingConfigResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateQueryLoggingConfigRequestMarshaller().marshall(super.beforeMarshalling(createQueryLoggingConfigRequest));<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, "Route 53");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateQueryLoggingConfig");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<CreateQueryLoggingConfigResult> responseHandler = new StaxResponseHandler<CreateQueryLoggingConfigResult>(new CreateQueryLoggingConfigResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
1,299,864 | public static Planar<GrayF32> tensorToImage(Tensor_F32 input, Planar<GrayF32> output, int miniBatch) {<NEW_LINE>if (input.getDimension() != 4)<NEW_LINE>throw new IllegalArgumentException("Input should be 4-DOF. batch + spatial (channel,height,width)");<NEW_LINE>int bands = input.length(1);<NEW_LINE>int height = input.length(2);<NEW_LINE>int <MASK><NEW_LINE>if (output == null) {<NEW_LINE>output = new Planar<>(GrayF32.class, width, height, bands);<NEW_LINE>} else {<NEW_LINE>if (input.length(1) != output.getNumBands())<NEW_LINE>throw new IllegalArgumentException("Number of bands don't match");<NEW_LINE>if (input.length(2) != output.getHeight())<NEW_LINE>throw new IllegalArgumentException("Spatial height doesn't match");<NEW_LINE>if (input.length(3) != output.getWidth())<NEW_LINE>throw new IllegalArgumentException("Spatial width doesn't match");<NEW_LINE>}<NEW_LINE>for (int i = 0; i < bands; i++) {<NEW_LINE>int indexIn = input.idx(miniBatch, i, 0, 0);<NEW_LINE>GrayF32 band = output.getBand(i);<NEW_LINE>int length = output.width * output.height;<NEW_LINE>System.arraycopy(input.d, indexIn, band.data, 0, length);<NEW_LINE>}<NEW_LINE>return output;<NEW_LINE>} | width = input.length(3); |
1,062,983 | private Mono<PagedResponse<QueueProperties>> listQueues(int skip, Context context) {<NEW_LINE>return managementClient.listEntitiesWithResponseAsync(QUEUES_ENTITY_TYPE, skip, NUMBER_OF_ELEMENTS, context).onErrorMap(ServiceBusAdministrationAsyncClient::mapException).flatMap(response -> {<NEW_LINE>final Response<QueueDescriptionFeed> feedResponse = deserialize(response, QueueDescriptionFeed.class);<NEW_LINE>final QueueDescriptionFeed feed = feedResponse.getValue();<NEW_LINE>if (feed == null) {<NEW_LINE>LOGGER.warning("Could not deserialize QueueDescriptionFeed. skip {}, top: {}", skip, NUMBER_OF_ELEMENTS);<NEW_LINE>return Mono.empty();<NEW_LINE>}<NEW_LINE>final List<QueueProperties> entities = feed.getEntry().stream().filter(e -> e.getContent() != null && e.getContent().getQueueDescription() != null).map(e -> {<NEW_LINE>final String queueName = <MASK><NEW_LINE>final QueueProperties queueProperties = EntityHelper.toModel(e.getContent().getQueueDescription());<NEW_LINE>EntityHelper.setQueueName(queueProperties, queueName);<NEW_LINE>return queueProperties;<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>try {<NEW_LINE>return Mono.just(extractPage(feedResponse, entities, feed.getLink()));<NEW_LINE>} catch (MalformedURLException | UnsupportedEncodingException error) {<NEW_LINE>return Mono.error(new RuntimeException("Could not parse response into FeedPage<QueueDescription>", error));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | getTitleValue(e.getTitle()); |
209,606 | public List<ValidateError> validate(Map<String, String> values) {<NEW_LINE>List<ValidateError> errors = new ArrayList<>();<NEW_LINE>Validator validator;<NEW_LINE>ValidateError error;<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH);<NEW_LINE>error = validator.validate(values.get("title"), convLabelName("Title"), 256);<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = <MASK><NEW_LINE>error = validator.validate(values.get("rowId"), convLabelName("Row Id"), 64);<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(values.get("insertUser"), convLabelName("Insert User"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(values.get("updateUser"), convLabelName("Update User"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(values.get("deleteFlag"), convLabelName("Delete Flag"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>return errors;<NEW_LINE>} | ValidatorFactory.getInstance(Validator.MAX_LENGTH); |
1,398,268 | protected void handle(GetLocalFileSizeOnBackupStorageMsg msg) {<NEW_LINE>GetLocalFileSizeOnBackupStorageReply reply = new GetLocalFileSizeOnBackupStorageReply();<NEW_LINE>GetLocalFileSizeCmd cmd = new GetLocalFileSizeCmd();<NEW_LINE>cmd.path = msg.getUrl();<NEW_LINE>restf.asyncJsonPost(buildUrl(SftpBackupStorageConstant.GET_LOCAL_FILE_SIZE), cmd, new JsonAsyncRESTCallback<GetLocalFileSizeRsp>(msg) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode err) {<NEW_LINE>reply.setError(err);<NEW_LINE>bus.reply(msg, reply);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success(GetLocalFileSizeRsp rsp) {<NEW_LINE>if (!rsp.isSuccess()) {<NEW_LINE>reply.setError(operr("operation error, because:%s", rsp.getError()));<NEW_LINE>} else {<NEW_LINE>reply.setSize(rsp.size);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Class<GetLocalFileSizeRsp> getReturnClass() {<NEW_LINE>return GetLocalFileSizeRsp.class;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | bus.reply(msg, reply); |
832,676 | public void onActivityCreated(Bundle savedInstanceState) {<NEW_LINE>super.onActivityCreated(savedInstanceState);<NEW_LINE>adView = getView().findViewById(R.id.listener_av_main);<NEW_LINE>adView.setAdListener(new AdListener() {<NEW_LINE><NEW_LINE>private void showToast(String message) {<NEW_LINE>View view = getView();<NEW_LINE>if (view != null) {<NEW_LINE>Toast.makeText(getView().getContext(), message, Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onAdLoaded() {<NEW_LINE>showToast("Ad loaded.");<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onAdFailedToLoad(LoadAdError loadAdError) {<NEW_LINE>String error = String.format("domain: %s, code: %d, message: %s", loadAdError.getDomain(), loadAdError.getCode(), loadAdError.getMessage());<NEW_LINE>showToast(String.format("Ad failed to load with error %s", error));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onAdOpened() {<NEW_LINE>showToast("Ad opened.");<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onAdClosed() {<NEW_LINE>showToast("Ad closed.");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>AdRequest adRequest = new AdRequest<MASK><NEW_LINE>adView.loadAd(adRequest);<NEW_LINE>} | .Builder().build(); |
104,869 | private void openWindow(Vector<Integer> ids, String tableName, int windowId) {<NEW_LINE>if (ids == null || ids.size() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String whereString = " " + tableName + "_ID";<NEW_LINE>// create query string<NEW_LINE>if (ids.size() == 1) {<NEW_LINE>if (ids.get(0).intValue() == 0) {<NEW_LINE>whereString = null;<NEW_LINE>} else {<NEW_LINE>whereString += "=" + ids.<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>whereString += " IN (";<NEW_LINE>for (int i = 0; i < ids.size(); i++) {<NEW_LINE>whereString += ids.get(i).intValue();<NEW_LINE>if (i < ids.size() - 1) {<NEW_LINE>whereString += ",";<NEW_LINE>} else {<NEW_LINE>whereString += ") ";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log.fine(whereString);<NEW_LINE>final MQuery query = new MQuery(tableName);<NEW_LINE>query.addRestriction(whereString);<NEW_LINE>final boolean ok = openWindow(windowId, query);<NEW_LINE>if (!ok) {<NEW_LINE>log.severe("Unable to open window: " + whereString);<NEW_LINE>}<NEW_LINE>if (!windowOpened && ok)<NEW_LINE>windowOpened = true;<NEW_LINE>} | get(0).intValue(); |
597,964 | public void encodeMessage(byte[] data) {<NEW_LINE>super.encodeMessage(data);<NEW_LINE>subType = SubType.fromByte(super.subType);<NEW_LINE>sensorId = (data[4] & 0xFF) << 8 | (data[5] & 0xFF);<NEW_LINE>voltage = (data[6] & 0xFF);<NEW_LINE>// Current = Field / 100<NEW_LINE>instantAmps = ((data[7] & 0xFF) << 8 | (data[8] & 0xFF)) / 100.0;<NEW_LINE>// Watt<NEW_LINE>instantPower = ((data[9] & 0xFF) << 8 | (data[10] & 0xFF)) / 10.0;<NEW_LINE>// kWh<NEW_LINE>instantEnergy = ((data[11] & 0xFF) << 8 | (data[12] & 0xFF)) / 100.0;<NEW_LINE>powerFactor = data[13] / 100.0;<NEW_LINE>frequency = data[14];<NEW_LINE>signalLevel = (byte) ((data[15] & 0xF0) >> 4);<NEW_LINE>batteryLevel = (byte) <MASK><NEW_LINE>} | (data[15] & 0x0F); |
1,317,586 | private Set<String> reLoadAllDbs() {<NEW_LINE>Map<String, String> allDbs = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);<NEW_LINE>Connection connection = null;<NEW_LINE>Statement statement = null;<NEW_LINE>String sql = PolarPrivUtil.getLoadAllDbsSql();<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE>connection = metaDbDataSource.getConnection();<NEW_LINE>statement = connection.createStatement();<NEW_LINE>ResultSet resultSet = statement.executeQuery(sql);<NEW_LINE>while (resultSet.next()) {<NEW_LINE>String dbName = resultSet.getString(1);<NEW_LINE>String <MASK><NEW_LINE>allDbs.put(dbName, appName);<NEW_LINE>}<NEW_LINE>this.dbNameAppNameMap = allDbs;<NEW_LINE>return this.dbNameAppNameMap.keySet();<NEW_LINE>} finally {<NEW_LINE>if (statement != null) {<NEW_LINE>statement.close();<NEW_LINE>}<NEW_LINE>if (connection != null) {<NEW_LINE>connection.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>logger.error(String.format("Failed in loadAllDbs, sql: %s", sql), e);<NEW_LINE>throw GeneralUtil.nestedException(e);<NEW_LINE>}<NEW_LINE>} | appName = resultSet.getString(2); |
1,247,908 | public SelectResult select(int[] readfds, int[] writefds, int[] errorfds, Timeval timeout, @Shared("invoke") @Cached InvokeNativeFunction invokeNode) throws PosixException {<NEW_LINE>int largestFD <MASK><NEW_LINE>largestFD = findMax(writefds, largestFD);<NEW_LINE>largestFD = findMax(errorfds, largestFD);<NEW_LINE>// This will be treated as boolean array (output parameter), each item indicating if given<NEW_LINE>// FD was selected or not<NEW_LINE>byte[] selected = new byte[readfds.length + writefds.length + errorfds.length];<NEW_LINE>int nfds = largestFD == -1 ? 0 : largestFD + 1;<NEW_LINE>long secs = -1, usecs = -1;<NEW_LINE>if (timeout != null) {<NEW_LINE>secs = timeout.getSeconds();<NEW_LINE>usecs = timeout.getMicroseconds();<NEW_LINE>}<NEW_LINE>int result = invokeNode.callInt(this, PosixNativeFunction.call_select, nfds, wrap(readfds), readfds.length, wrap(writefds), writefds.length, wrap(errorfds), errorfds.length, secs, usecs, wrap(selected));<NEW_LINE>if (result < 0) {<NEW_LINE>throw getErrnoAndThrowPosixException(invokeNode);<NEW_LINE>}<NEW_LINE>return new SelectResult(selectFillInResult(readfds, selected, 0), selectFillInResult(writefds, selected, readfds.length), selectFillInResult(errorfds, selected, readfds.length + writefds.length));<NEW_LINE>} | = findMax(readfds, -1); |
1,338,866 | public static Map<PartitionKey, RowUpdateSplit> split(int rowId, int[] indices, double[] values, List<PartitionKey> parts, boolean sorted) {<NEW_LINE>if (!sorted) {<NEW_LINE>Sort.quickSort(indices, values, 0, indices.length - 1);<NEW_LINE>}<NEW_LINE>Map<PartitionKey, RowUpdateSplit> <MASK><NEW_LINE>int featureIndex = 0;<NEW_LINE>int partIndex = 0;<NEW_LINE>while (featureIndex < indices.length || partIndex < parts.size()) {<NEW_LINE>int length = 0;<NEW_LINE>int endOffset = (int) parts.get(partIndex).getEndCol();<NEW_LINE>while (featureIndex < indices.length && indices[featureIndex] < endOffset) {<NEW_LINE>featureIndex++;<NEW_LINE>length++;<NEW_LINE>}<NEW_LINE>RowUpdateSplit split = new SparseDoubleRowUpdateSplit(rowId, featureIndex - length, featureIndex, indices, values);<NEW_LINE>ret.put(parts.get(partIndex), split);<NEW_LINE>partIndex++;<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | ret = new HashMap<>(); |
257,787 | private ObjectNode createContractNode(ObjectNode accountNode, AccountInformationProvider accountInformation, RskAddress addr, Iterator<DataWord> contractKeys, boolean exportCode) {<NEW_LINE>ObjectNode contractNode = accountNode.objectNode();<NEW_LINE>if (exportCode) {<NEW_LINE>byte[] code = accountInformation.getCode(addr);<NEW_LINE>String codeStr = "";<NEW_LINE>if (code == null) {<NEW_LINE>codeStr = "";<NEW_LINE>} else {<NEW_LINE>codeStr = ByteUtil.toHexString(code);<NEW_LINE>}<NEW_LINE>contractNode.put("code", codeStr);<NEW_LINE>}<NEW_LINE>contractNode.put("codeHash", accountInformation.getCodeHashStandard(addr).toHexString());<NEW_LINE>if (contractKeys != null) {<NEW_LINE><MASK><NEW_LINE>while (contractKeys.hasNext()) {<NEW_LINE>DataWord key = contractKeys.next();<NEW_LINE>byte[] value = accountInformation.getStorageBytes(addr, key);<NEW_LINE>dataNode.put(ByteUtil.toHexString(key.getData()), ByteUtil.toHexString(value));<NEW_LINE>}<NEW_LINE>contractNode.set("data", dataNode);<NEW_LINE>}<NEW_LINE>return contractNode;<NEW_LINE>} | ObjectNode dataNode = contractNode.objectNode(); |
726,020 | static // some sources have Monday is holiday when Tuesday is, and Friday is holiday when Thursday is (not applying this)<NEW_LINE>ImmutableHolidayCalendar generateParis() {<NEW_LINE>List<LocalDate> holidays = new ArrayList<>(2000);<NEW_LINE>for (int year = 1950; year <= 2099; year++) {<NEW_LINE>// new year<NEW_LINE>holidays.add(date(year, 1, 1));<NEW_LINE>// good friday<NEW_LINE>holidays.add(easter(year).minusDays(2));<NEW_LINE>// easter monday<NEW_LINE>holidays.add(easter(year).plusDays(1));<NEW_LINE>// labour day<NEW_LINE>holidays.add(date(year, 5, 1));<NEW_LINE>// victory in europe<NEW_LINE>holidays.add(date(year, 5, 8));<NEW_LINE>// ascension day<NEW_LINE>holidays.add(easter(year).plusDays(39));<NEW_LINE>if (year <= 2004 || year >= 2008) {<NEW_LINE>// whit monday<NEW_LINE>holidays.add(easter(year).plusDays(50));<NEW_LINE>}<NEW_LINE>// bastille<NEW_LINE>holidays.add(date(year, 7, 14));<NEW_LINE>// assumption of mary<NEW_LINE>holidays.add(date(year, 8, 15));<NEW_LINE>// all saints<NEW_LINE>holidays.add(date<MASK><NEW_LINE>// armistice day<NEW_LINE>holidays.add(date(year, 11, 11));<NEW_LINE>// christmas day<NEW_LINE>holidays.add(date(year, 12, 25));<NEW_LINE>// saint stephen<NEW_LINE>holidays.add(date(year, 12, 26));<NEW_LINE>}<NEW_LINE>// millennium<NEW_LINE>holidays.add(date(1999, 12, 31));<NEW_LINE>removeSatSun(holidays);<NEW_LINE>return ImmutableHolidayCalendar.of(HolidayCalendarIds.FRPA, holidays, SATURDAY, SUNDAY);<NEW_LINE>} | (year, 11, 1)); |
331,273 | private void initStartingTimeline() {<NEW_LINE>startingTimeline = new Timeline();<NEW_LINE>KeyFrame kf1 = new KeyFrame(Duration.millis(500), (ActionEvent event) -> {<NEW_LINE>message.setVisible(true);<NEW_LINE>state = STARTING_LEVEL;<NEW_LINE>bat.setVisible(false);<NEW_LINE>ball.setVisible(false);<NEW_LINE>}, new KeyValue(message.opacityProperty(), 0));<NEW_LINE>KeyFrame kf2 = new KeyFrame(Duration.millis(1500), new KeyValue(message.opacityProperty(), 1));<NEW_LINE>KeyFrame kf3 = new KeyFrame(Duration.millis(3000), new KeyValue(message.opacityProperty(), 1));<NEW_LINE>KeyFrame kf4 = new KeyFrame(Duration.millis(4000), (ActionEvent event) -> {<NEW_LINE>message.setVisible(false);<NEW_LINE>bat.setTranslateX((Config.FIELD_WIDTH - bat<MASK><NEW_LINE>ball.setTranslateX((Config.FIELD_WIDTH - ball.getDiameter()) / 2.0);<NEW_LINE>ball.setTranslateY(Config.BAT_Y - ball.getDiameter());<NEW_LINE>ballDirX = (Utils.random(2) * 2 - 1) * Config.BALL_MIN_COORD_SPEED;<NEW_LINE>ballDirY = -Config.BALL_MIN_SPEED;<NEW_LINE>bat.setVisible(true);<NEW_LINE>ball.setVisible(true);<NEW_LINE>state = BALL_CATCHED;<NEW_LINE>}, new KeyValue(message.opacityProperty(), 0));<NEW_LINE>startingTimeline.getKeyFrames().addAll(kf1, kf2, kf3, kf4);<NEW_LINE>} | .getWidth()) / 2.0); |
628,502 | public Object convert(Object value) {<NEW_LINE>if (value instanceof ORidBag) {<NEW_LINE>List result = new ArrayList();<NEW_LINE>((ORidBag) value).rawIterator().forEachRemaining(x -> result.add(x));<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>if (value instanceof OEdgeToVertexIterable) {<NEW_LINE>value = ((OEdgeToVertexIterable) value).iterator();<NEW_LINE>}<NEW_LINE>if (value instanceof OEdgeToVertexIterator) {<NEW_LINE>List<ORID> result = new ArrayList<>();<NEW_LINE>while (((OEdgeToVertexIterator) value).hasNext()) {<NEW_LINE>OVertex v = ((OEdgeToVertexIterator) value).next();<NEW_LINE>if (v != null) {<NEW_LINE>result.add(v.getIdentity());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>if (value instanceof OInternalResultSet) {<NEW_LINE>((<MASK><NEW_LINE>value = ((OInternalResultSet) value).stream().collect(Collectors.toList());<NEW_LINE>}<NEW_LINE>if (value instanceof Iterator && !(value instanceof OIdentifiable)) {<NEW_LINE>Iterator iter = (Iterator) value;<NEW_LINE>value = new ArrayList<>();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>((List) value).add(iter.next());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return value;<NEW_LINE>} | OInternalResultSet) value).reset(); |
953,687 | public void onScrollChanged(int scrollY, boolean firstScroll, boolean dragging) {<NEW_LINE>// Translate overlay and image<NEW_LINE>float flexibleRange = mFlexibleSpaceImageHeight - mActionBarSize;<NEW_LINE>int minOverlayTransitionY = mActionBarSize - mOverlayView.getHeight();<NEW_LINE>ViewHelper.setTranslationY(mOverlayView, ScrollUtils.getFloat(-scrollY, minOverlayTransitionY, 0));<NEW_LINE>ViewHelper.setTranslationY(mImageView, ScrollUtils.getFloat(-scrollY / 2, minOverlayTransitionY, 0));<NEW_LINE>// Translate list background<NEW_LINE>ViewHelper.setTranslationY(mListBackgroundView, Math.max(0, -scrollY + mFlexibleSpaceImageHeight));<NEW_LINE>// Change alpha of overlay<NEW_LINE>ViewHelper.setAlpha(mOverlayView, ScrollUtils.getFloat((float) scrollY / flexibleRange, 0, 1));<NEW_LINE>// Scale title text<NEW_LINE>float scale = 1 + ScrollUtils.getFloat((flexibleRange - scrollY) / flexibleRange, 0, MAX_TEXT_SCALE_DELTA);<NEW_LINE>setPivotXToTitle();<NEW_LINE>ViewHelper.setPivotY(mTitleView, 0);<NEW_LINE>ViewHelper.setScaleX(mTitleView, scale);<NEW_LINE>ViewHelper.setScaleY(mTitleView, scale);<NEW_LINE>// Translate title text<NEW_LINE>int maxTitleTranslationY = (int) (mFlexibleSpaceImageHeight - mTitleView.getHeight() * scale);<NEW_LINE>int titleTranslationY = maxTitleTranslationY - scrollY;<NEW_LINE>ViewHelper.setTranslationY(mTitleView, titleTranslationY);<NEW_LINE>// Translate FAB<NEW_LINE>int maxFabTranslationY = mFlexibleSpaceImageHeight - mFab.getHeight() / 2;<NEW_LINE>float fabTranslationY = ScrollUtils.getFloat(-scrollY + mFlexibleSpaceImageHeight - mFab.getHeight() / 2, mActionBarSize - mFab.getHeight() / 2, maxFabTranslationY);<NEW_LINE>if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {<NEW_LINE>// On pre-honeycomb, ViewHelper.setTranslationX/Y does not set margin,<NEW_LINE>// which causes FAB's OnClickListener not working.<NEW_LINE>FrameLayout.LayoutParams lp = (FrameLayout<MASK><NEW_LINE>lp.leftMargin = mOverlayView.getWidth() - mFabMargin - mFab.getWidth();<NEW_LINE>lp.topMargin = (int) fabTranslationY;<NEW_LINE>mFab.requestLayout();<NEW_LINE>} else {<NEW_LINE>ViewHelper.setTranslationX(mFab, mOverlayView.getWidth() - mFabMargin - mFab.getWidth());<NEW_LINE>ViewHelper.setTranslationY(mFab, fabTranslationY);<NEW_LINE>}<NEW_LINE>// Show/hide FAB<NEW_LINE>if (fabTranslationY < mFlexibleSpaceShowFabOffset) {<NEW_LINE>hideFab();<NEW_LINE>} else {<NEW_LINE>showFab();<NEW_LINE>}<NEW_LINE>} | .LayoutParams) mFab.getLayoutParams(); |
1,835,757 | private void addMethod(ClassOrInterfaceDeclaration containingClassOrInterface, CallableDeclaration<?> callable, Runnable onNoExistingMethod) {<NEW_LINE>List<CallableDeclaration<?>> existingCallables = containingClassOrInterface.getCallablesWithSignature(callable.getSignature());<NEW_LINE>if (existingCallables.isEmpty()) {<NEW_LINE>onNoExistingMethod.run();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (existingCallables.size() > 1) {<NEW_LINE>throw new AssertionError(f("Wanted to regenerate a method with signature %s in %s, but found more than one.", callable.getSignature(), containingClassOrInterface.getNameAsString()));<NEW_LINE>}<NEW_LINE>final CallableDeclaration<?> <MASK><NEW_LINE>callable.setJavadocComment(callable.getJavadocComment().orElse(existingCallable.getJavadocComment().orElse(null)));<NEW_LINE>annotateGenerated(callable);<NEW_LINE>containingClassOrInterface.getMembers().replace(existingCallable, callable);<NEW_LINE>} | existingCallable = existingCallables.get(0); |
336,796 | private static List<Chainable> handleClassPrefixedNonProp(StatementSpecMapContext mapContext, List<Chainable> chain) {<NEW_LINE>int indexOfLastProp = getClassIndexOfLastProp(chain);<NEW_LINE>if (indexOfLastProp == -1 || indexOfLastProp == chain.size() - 1) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int depth = indexOfLastProp;<NEW_LINE>int depthFound = -1;<NEW_LINE>while (depth > 0) {<NEW_LINE>String classNameCandidate = buildClassName(chain, depth);<NEW_LINE>try {<NEW_LINE>mapContext.getClasspathImportService().resolveClass(classNameCandidate, false, mapContext.getClassProvidedClasspathExtension());<NEW_LINE>depthFound = depth;<NEW_LINE>break;<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>// expected, handled later when expression validation takes place<NEW_LINE>}<NEW_LINE>depth--;<NEW_LINE>}<NEW_LINE>if (depthFound == -1) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (depth == indexOfLastProp) {<NEW_LINE>String classNameCandidate = buildClassName(chain, depth);<NEW_LINE>return buildSubchainWClassname(classNameCandidate, depth + 1, chain);<NEW_LINE>}<NEW_LINE>// include the next identifier, i.e. ENUM or CONSTANT etc.<NEW_LINE>String classNameCandidate = buildClassName(chain, depth + 1);<NEW_LINE>return buildSubchainWClassname(<MASK><NEW_LINE>} | classNameCandidate, depth + 2, chain); |
1,790,748 | /*<NEW_LINE>* @see<NEW_LINE>* com.sitewhere.grpc.service.DeviceManagementGrpc.DeviceManagementImplBase#<NEW_LINE>* createArea(com.sitewhere.grpc.service.GCreateAreaRequest,<NEW_LINE>* io.grpc.stub.StreamObserver)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void createArea(GCreateAreaRequest request, StreamObserver<GCreateAreaResponse> responseObserver) {<NEW_LINE>try {<NEW_LINE>GrpcUtils.handleServerMethodEntry(this, DeviceManagementGrpc.getCreateAreaMethod());<NEW_LINE>IAreaCreateRequest apiRequest = DeviceModelConverter.asApiAreaCreateRequest(request.getRequest());<NEW_LINE>IArea apiResult = getDeviceManagement().createArea(apiRequest);<NEW_LINE>GCreateAreaResponse.<MASK><NEW_LINE>response.setArea(DeviceModelConverter.asGrpcArea(apiResult));<NEW_LINE>responseObserver.onNext(response.build());<NEW_LINE>responseObserver.onCompleted();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>GrpcUtils.handleServerMethodException(DeviceManagementGrpc.getCreateAreaMethod(), e, responseObserver);<NEW_LINE>} finally {<NEW_LINE>GrpcUtils.handleServerMethodExit(DeviceManagementGrpc.getCreateAreaMethod());<NEW_LINE>}<NEW_LINE>} | Builder response = GCreateAreaResponse.newBuilder(); |
1,223,773 | public void handleNotification(Notification notification) {<NEW_LINE>super.handleNotification(notification);<NEW_LINE>switch(notification.getName()) {<NEW_LINE>case MsgAPI.CREATE:<NEW_LINE>setViewComponent(new Overlap2DScreen());<NEW_LINE>// TODO this must be changed to Command<NEW_LINE>facade = Overlap2DFacade.getInstance();<NEW_LINE>SandboxMediator sandboxMediator = facade.retrieveMediator(SandboxMediator.NAME);<NEW_LINE>Engine engine = sandboxMediator.getViewComponent().getEngine();<NEW_LINE>getViewComponent().setEngine(engine);<NEW_LINE>getViewComponent().show();<NEW_LINE>break;<NEW_LINE>case MsgAPI.SCENE_LOADED:<NEW_LINE>facade = Overlap2DFacade.getInstance();<NEW_LINE>sandboxMediator = facade.retrieveMediator(SandboxMediator.NAME);<NEW_LINE>engine = sandboxMediator.getViewComponent().getEngine();<NEW_LINE>SandboxBackUI sandboxBackUI = new SandboxBackUI(engine.getSystem(Overlap2dRenderer.class).batch);<NEW_LINE>getViewComponent().setBackUI(sandboxBackUI);<NEW_LINE>getViewComponent().disableDrawingBgLogo();<NEW_LINE>break;<NEW_LINE>case MsgAPI.PAUSE:<NEW_LINE>getViewComponent().pause();<NEW_LINE>break;<NEW_LINE>case MsgAPI.RESUME:<NEW_LINE>getViewComponent().resume();<NEW_LINE>break;<NEW_LINE>case MsgAPI.RENDER:<NEW_LINE>getViewComponent().<MASK><NEW_LINE>break;<NEW_LINE>case MsgAPI.RESIZE:<NEW_LINE>int[] data = notification.getBody();<NEW_LINE>getViewComponent().resize(data[0], data[1]);<NEW_LINE>break;<NEW_LINE>case MsgAPI.DISPOSE:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | render(notification.getBody()); |
636,552 | final DeleteInboundConnectionResult executeDeleteInboundConnection(DeleteInboundConnectionRequest deleteInboundConnectionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteInboundConnectionRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteInboundConnectionRequest> request = null;<NEW_LINE>Response<DeleteInboundConnectionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteInboundConnectionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteInboundConnectionRequest));<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, "OpenSearch");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteInboundConnection");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteInboundConnectionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteInboundConnectionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
799,073 | private static Pair<List<Geocache>, Boolean> parseCaches(final ObjectNode response) {<NEW_LINE>try {<NEW_LINE>final JsonNode moreNode = response.path("more");<NEW_LINE>final boolean more = moreNode != null && moreNode.isBoolean() && moreNode.asBoolean();<NEW_LINE>// Check for empty result<NEW_LINE>final JsonNode <MASK><NEW_LINE>if (!results.isObject()) {<NEW_LINE>return new Pair(Collections.emptyList(), more);<NEW_LINE>}<NEW_LINE>// Get and iterate result list<NEW_LINE>final List<Geocache> caches = new ArrayList<>(results.size());<NEW_LINE>for (final JsonNode cache : results) {<NEW_LINE>caches.add(parseSmallCache((ObjectNode) cache));<NEW_LINE>}<NEW_LINE>return new Pair(caches, more);<NEW_LINE>} catch (ClassCastException | NullPointerException e) {<NEW_LINE>Log.e("OkapiClient.parseCachesResult", e);<NEW_LINE>}<NEW_LINE>return new Pair(Collections.emptyList(), false);<NEW_LINE>} | results = response.path("results"); |
1,608,291 | public void apply(IntrinsicContext context, InvocationExpr invocation) {<NEW_LINE>if (invocation.getMethod().getClassName().equals(ResourceMap.class.getName())) {<NEW_LINE>applyForResourceMap(context, invocation);<NEW_LINE>return;<NEW_LINE>} else if (invocation.getMethod().getClassName().equals(ResourceArray.class.getName())) {<NEW_LINE>applyForResourceArray(context, invocation);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String name = invocation.getMethod().getName();<NEW_LINE>if (name.startsWith("get")) {<NEW_LINE>name = name.substring(3);<NEW_LINE>} else if (name.startsWith("is")) {<NEW_LINE>name = name.substring(2);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>name = Character.toLowerCase(name.charAt(0)) + name.substring(1);<NEW_LINE>String resourceName = "resources/" + context.escapeFileName(invocation.getMethod().getClassName()) + ".h";<NEW_LINE>context.includes().includePath(resourceName);<NEW_LINE>boolean isString = invocation.getMethod().getReturnType().isObject("java.lang.String");<NEW_LINE>if (isString) {<NEW_LINE>context.writer().print("teavm_dereferenceNullable(");<NEW_LINE>}<NEW_LINE>context.writer().print("TEAVM_FIELD(");<NEW_LINE>context.emit(invocation.getArguments().get(0));<NEW_LINE>context.writer().print(", ").print(context.names().forClass(invocation.getMethod().getClassName()));<NEW_LINE>context.writer().print(", ").print<MASK><NEW_LINE>if (isString) {<NEW_LINE>context.writer().print(")");<NEW_LINE>}<NEW_LINE>} | (name).print(")"); |
774,321 | public void applyPermission(UiPermissionDescriptor permissionDescriptor) {<NEW_LINE>checkNotNullArgument(permissionDescriptor);<NEW_LINE>final String subComponentId = permissionDescriptor.getSubComponentId();<NEW_LINE>final ScreenComponentPermission permissionValue = permissionDescriptor.getPermissionValue();<NEW_LINE>final String screenId = permissionDescriptor.getScreenId();<NEW_LINE>if (subComponentId != null) {<NEW_LINE>final FieldGroup.FieldConfig field = getField(subComponentId);<NEW_LINE>if (field != null) {<NEW_LINE>if (permissionValue == ScreenComponentPermission.DENY) {<NEW_LINE>field.setVisible(false);<NEW_LINE>} else if (permissionValue == ScreenComponentPermission.VIEW) {<NEW_LINE>field.setEditable(false);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>log.info("Couldn't find suitable component {} in window {} for UI security rule", subComponentId, screenId);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final String actionHolderComponentId = permissionDescriptor.getActionHolderComponentId();<NEW_LINE>FieldConfig fieldConfig = getField(actionHolderComponentId);<NEW_LINE>if (fieldConfig == null || fieldConfig.getComponent() == null || !((fieldConfig.getComponent() instanceof Component.SecuredActionsHolder))) {<NEW_LINE>log.info("Couldn't find suitable component {} in window {} for UI security rule", actionHolderComponentId, screenId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Component fieldComponent = fieldConfig.getComponent();<NEW_LINE>String actionId = permissionDescriptor.getActionId();<NEW_LINE>ActionsPermissions permissions = ((<MASK><NEW_LINE>if (permissionValue == ScreenComponentPermission.DENY) {<NEW_LINE>permissions.addHiddenActionPermission(actionId);<NEW_LINE>} else if (permissionValue == ScreenComponentPermission.VIEW) {<NEW_LINE>permissions.addDisabledActionPermission(actionId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | SecuredActionsHolder) fieldComponent).getActionsPermissions(); |
418,836 | public static CreateScenarioParameterResponse unmarshall(CreateScenarioParameterResponse createScenarioParameterResponse, UnmarshallerContext context) {<NEW_LINE>createScenarioParameterResponse.setRequestId(context.stringValue("CreateScenarioParameterResponse.RequestId"));<NEW_LINE>createScenarioParameterResponse.setSuccess(context.booleanValue("CreateScenarioParameterResponse.Success"));<NEW_LINE>createScenarioParameterResponse.setCode(context.stringValue("CreateScenarioParameterResponse.Code"));<NEW_LINE>createScenarioParameterResponse.setMessage(context.stringValue("CreateScenarioParameterResponse.Message"));<NEW_LINE>createScenarioParameterResponse.setHttpStatusCode(context.integerValue("CreateScenarioParameterResponse.HttpStatusCode"));<NEW_LINE>List<ScenarioParameter> scenarioParameters = new ArrayList<ScenarioParameter>();<NEW_LINE>for (int i = 0; i < context.lengthValue("CreateScenarioParameterResponse.ScenarioParameters.Length"); i++) {<NEW_LINE>ScenarioParameter scenarioParameter = new ScenarioParameter();<NEW_LINE>scenarioParameter.setId(context.stringValue("CreateScenarioParameterResponse.ScenarioParameters[" + i + "].Id"));<NEW_LINE>scenarioParameter.setScenarioId(context.stringValue<MASK><NEW_LINE>scenarioParameter.setName(context.stringValue("CreateScenarioParameterResponse.ScenarioParameters[" + i + "].Name"));<NEW_LINE>scenarioParameter.setTitle(context.stringValue("CreateScenarioParameterResponse.ScenarioParameters[" + i + "].Title"));<NEW_LINE>scenarioParameter.setDescription(context.stringValue("CreateScenarioParameterResponse.ScenarioParameters[" + i + "].Description"));<NEW_LINE>scenarioParameter.setType(context.integerValue("CreateScenarioParameterResponse.ScenarioParameters[" + i + "].Type"));<NEW_LINE>scenarioParameter.setDefaultValue(context.stringValue("CreateScenarioParameterResponse.ScenarioParameters[" + i + "].DefaultValue"));<NEW_LINE>scenarioParameters.add(scenarioParameter);<NEW_LINE>}<NEW_LINE>createScenarioParameterResponse.setScenarioParameters(scenarioParameters);<NEW_LINE>return createScenarioParameterResponse;<NEW_LINE>} | ("CreateScenarioParameterResponse.ScenarioParameters[" + i + "].ScenarioId")); |
117,422 | static PropertyValue[] interpretHillshadeLayerProperties(Object o) {<NEW_LINE>final Map<String, String> data = (Map<String, String>) toMap(o);<NEW_LINE>final List<PropertyValue> properties = new LinkedList();<NEW_LINE>final JsonParser parser = new JsonParser();<NEW_LINE>for (Map.Entry<String, String> entry : data.entrySet()) {<NEW_LINE>final JsonElement jsonElement = parser.parse(entry.getValue());<NEW_LINE>Expression expression = <MASK><NEW_LINE>switch(entry.getKey()) {<NEW_LINE>case "hillshade-illumination-direction":<NEW_LINE>properties.add(PropertyFactory.hillshadeIlluminationDirection(expression));<NEW_LINE>break;<NEW_LINE>case "hillshade-illumination-anchor":<NEW_LINE>properties.add(PropertyFactory.hillshadeIlluminationAnchor(expression));<NEW_LINE>break;<NEW_LINE>case "hillshade-exaggeration":<NEW_LINE>properties.add(PropertyFactory.hillshadeExaggeration(expression));<NEW_LINE>break;<NEW_LINE>case "hillshade-shadow-color":<NEW_LINE>properties.add(PropertyFactory.hillshadeShadowColor(expression));<NEW_LINE>break;<NEW_LINE>case "hillshade-highlight-color":<NEW_LINE>properties.add(PropertyFactory.hillshadeHighlightColor(expression));<NEW_LINE>break;<NEW_LINE>case "hillshade-accent-color":<NEW_LINE>properties.add(PropertyFactory.hillshadeAccentColor(expression));<NEW_LINE>break;<NEW_LINE>case "visibility":<NEW_LINE>properties.add(PropertyFactory.visibility(entry.getValue()));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return properties.toArray(new PropertyValue[properties.size()]);<NEW_LINE>} | Expression.Converter.convert(jsonElement); |
312,041 | private Function createDestinationFunction(Program program, Address addr, Address flowFromAddr, TaskMonitor monitor) {<NEW_LINE>Listing listing = program.getListing();<NEW_LINE>BookmarkManager bookmarkMgr = program.getBookmarkManager();<NEW_LINE>if (!program.getMemory().contains(addr)) {<NEW_LINE>bookmarkMgr.setBookmark(flowFromAddr, BookmarkType.ERROR, "Bad Reference", "No memory for PLT Thunk destination at " + addr);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Function function = listing.getFunctionAt(addr);<NEW_LINE>if (function != null) {<NEW_LINE>return function;<NEW_LINE>}<NEW_LINE>CodeUnit cu = listing.getCodeUnitContaining(addr);<NEW_LINE>if (cu == null) {<NEW_LINE>throw new AssertException("expected code unit in memory");<NEW_LINE>}<NEW_LINE>if (!addr.equals(cu.getMinAddress())) {<NEW_LINE>bookmarkMgr.setBookmark(cu.getMinAddress(), BookmarkType.ERROR, "Code Unit Conflict", "Expected function entry at " + addr + " referenced by PLT Thunk at " + flowFromAddr);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (cu instanceof Data) {<NEW_LINE>Data d = (Data) cu;<NEW_LINE>if (d.isDefined()) {<NEW_LINE>bookmarkMgr.setBookmark(addr, BookmarkType.ERROR, "Code Unit Conflict", "Expected function entry referenced by PLT Thunk at " + flowFromAddr);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>DisassembleCommand cmd = new <MASK><NEW_LINE>if (!cmd.applyTo(program, monitor)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>CreateFunctionCmd cmd = new CreateFunctionCmd(addr);<NEW_LINE>if (cmd.applyTo(program, monitor)) {<NEW_LINE>return cmd.getFunction();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | DisassembleCommand(addr, null, true); |
851,770 | void processPersistenceUnit(JPAPXml pxml, JPAApplInfo applInfo) {<NEW_LINE>final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.entry(tc, "processPersistenceUnit" + pxml);<NEW_LINE>synchronized (pxmlsInfo) {<NEW_LINE>URL pxmlRootURL = pxml.getRootURL();<NEW_LINE>String pxmlInfoKey = scope == JPAPuScope.EAR_Scope ? pxml.getArchiveName() : pxmlRootURL.toString();<NEW_LINE>JPAPxmlInfo pxmlInfo = pxmlsInfo.get(pxmlInfoKey);<NEW_LINE>// if root URL is defined for this persistence.xml, it has been processed before,<NEW_LINE>// i.e. deployed web module processing will find persistence.xml in the ejb module<NEW_LINE>// since the ejb module is in the web module classpath.<NEW_LINE>if (pxmlInfo == null) {<NEW_LINE>// F743-23167<NEW_LINE>pxmlInfo = new JPAPxmlInfo(this, pxmlRootURL);<NEW_LINE><MASK><NEW_LINE>JPAIntrospection.beginPXmlInfoVisit(pxmlInfo);<NEW_LINE>try {<NEW_LINE>// read in all the persistence unit define in this persistence.xml<NEW_LINE>// PK62950<NEW_LINE>pxmlInfo.extractPersistenceUnits(pxml);<NEW_LINE>} finally {<NEW_LINE>JPAIntrospection.endPXmlInfoVisit();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "processPersistenceUnit", getPUList());<NEW_LINE>} | pxmlsInfo.put(pxmlInfoKey, pxmlInfo); |
1,069,156 | void removeUserFriend(String userId) {<NEW_LINE>Connection connection = null;<NEW_LINE>PreparedStatement statement = null;<NEW_LINE>try {<NEW_LINE>connection = DBUtil.getConnection();<NEW_LINE>String sql = "update t_friend set `_alias` = '', `_state` = 1, `_blacked` = 0, `_dt` = ?, `_extra` = 0 where `_uid` = ? or `_friend_uid` = ?";<NEW_LINE>statement = connection.prepareStatement(sql);<NEW_LINE>int index = 1;<NEW_LINE>statement.setLong(index++, System.currentTimeMillis());<NEW_LINE>statement<MASK><NEW_LINE>statement.setString(index++, userId);<NEW_LINE>int count = statement.executeUpdate();<NEW_LINE>LOG.info("Update rows {}", count);<NEW_LINE>} catch (SQLException e) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>e.printStackTrace();<NEW_LINE>Utility.printExecption(LOG, e, RDBS_Exception);<NEW_LINE>} finally {<NEW_LINE>DBUtil.closeDB(connection, statement);<NEW_LINE>}<NEW_LINE>} | .setString(index++, userId); |
324,128 | public static DataFrame read(InputFile file, int limit) throws IOException {<NEW_LINE>try (ParquetFileReader reader = ParquetFileReader.open(file)) {<NEW_LINE>ParquetMetadata footer = reader.getFooter();<NEW_LINE>MessageType schema = footer.getFileMetaData().getSchema();<NEW_LINE>StructType struct = toSmileSchema(schema);<NEW_LINE>logger.debug("The meta data of parquet file {}: {}", file.toString(), ParquetMetadata.toPrettyJSON(footer));<NEW_LINE>int nrow = (int) Math.min(<MASK><NEW_LINE>List<Tuple> rows = new ArrayList<>(nrow);<NEW_LINE>PageReadStore store;<NEW_LINE>while ((store = reader.readNextRowGroup()) != null) {<NEW_LINE>final long rowCount = store.getRowCount();<NEW_LINE>final MessageColumnIO columnIO = new ColumnIOFactory().getColumnIO(schema);<NEW_LINE>final RecordReader<Group> recordReader = columnIO.getRecordReader(store, new GroupRecordConverter(schema));<NEW_LINE>for (int i = 0; i < rowCount && rows.size() < nrow; i++) {<NEW_LINE>rows.add(Tuple.of(group2object(recordReader.read(), schema.getColumns(), struct), struct));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return DataFrame.of(rows);<NEW_LINE>}<NEW_LINE>} | reader.getRecordCount(), limit); |
850,259 | public void marshall(DatasetDescription datasetDescription, AwsJsonWriter jsonWriter) throws Exception {<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (datasetDescription.getCreationTimestamp() != null) {<NEW_LINE>java.util.<MASK><NEW_LINE>jsonWriter.name("CreationTimestamp");<NEW_LINE>jsonWriter.value(creationTimestamp);<NEW_LINE>}<NEW_LINE>if (datasetDescription.getLastUpdatedTimestamp() != null) {<NEW_LINE>java.util.Date lastUpdatedTimestamp = datasetDescription.getLastUpdatedTimestamp();<NEW_LINE>jsonWriter.name("LastUpdatedTimestamp");<NEW_LINE>jsonWriter.value(lastUpdatedTimestamp);<NEW_LINE>}<NEW_LINE>if (datasetDescription.getStatus() != null) {<NEW_LINE>String status = datasetDescription.getStatus();<NEW_LINE>jsonWriter.name("Status");<NEW_LINE>jsonWriter.value(status);<NEW_LINE>}<NEW_LINE>if (datasetDescription.getStatusMessage() != null) {<NEW_LINE>String statusMessage = datasetDescription.getStatusMessage();<NEW_LINE>jsonWriter.name("StatusMessage");<NEW_LINE>jsonWriter.value(statusMessage);<NEW_LINE>}<NEW_LINE>if (datasetDescription.getStatusMessageCode() != null) {<NEW_LINE>String statusMessageCode = datasetDescription.getStatusMessageCode();<NEW_LINE>jsonWriter.name("StatusMessageCode");<NEW_LINE>jsonWriter.value(statusMessageCode);<NEW_LINE>}<NEW_LINE>if (datasetDescription.getDatasetStats() != null) {<NEW_LINE>DatasetStats datasetStats = datasetDescription.getDatasetStats();<NEW_LINE>jsonWriter.name("DatasetStats");<NEW_LINE>DatasetStatsJsonMarshaller.getInstance().marshall(datasetStats, jsonWriter);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>} | Date creationTimestamp = datasetDescription.getCreationTimestamp(); |
1,033,435 | public void applyDiagnosisKeyHourRetentionPolicy(long retentionDays) {<NEW_LINE>Set<String> countries = Set.of(originCountry, euPackageName);<NEW_LINE>countries.forEach(country -> {<NEW_LINE>List<S3Object> diagnosisKeysObjects = objectStoreAccess.getObjectsWithPrefix(getDiagnosisKeyPrefix(country));<NEW_LINE>final LocalDate cutOffDate = getUtcDate(<MASK><NEW_LINE>var deletableKeys = diagnosisKeysObjects.stream().filter(diagnosisKeysObject -> isDiagnosisKeyFilePathOlderThan(diagnosisKeysObject, cutOffDate)).filter(this::isDiagnosisKeyFilePathOnHourFolder).collect(Collectors.toList());<NEW_LINE>logger.info("Deleting {} diagnosis key files from hourly folders older than {}", deletableKeys.size(), cutOffDate);<NEW_LINE>deletableKeys.forEach(this::deleteS3Object);<NEW_LINE>});<NEW_LINE>} | ).minusDays(retentionDays - 1L); |
1,005,369 | protected void calcSlots() {<NEW_LINE>int y = 0;<NEW_LINE>int x = 0;<NEW_LINE>ISlotSelector last = null;<NEW_LINE>for (int i = 0; i < getItemHandler().getSlots(); i++) {<NEW_LINE>final UpgradeCap handler = getItemHandler().getHandlerFromSlot(i);<NEW_LINE>int idx = <MASK><NEW_LINE>if (handler.isVisible(idx)) {<NEW_LINE>ISlotSelector current = handler.getSlotSelector();<NEW_LINE>AutoSlot slot = autoSlots.get(i);<NEW_LINE>slot.noHead = false;<NEW_LINE>if (current != last) {<NEW_LINE>x = 0;<NEW_LINE>y = 0;<NEW_LINE>last = current;<NEW_LINE>// first slot on new tab<NEW_LINE>slot.noHead = true;<NEW_LINE>} else if (handler.isHead(idx)) {<NEW_LINE>if (handler.isInventorySlot(idx)) {<NEW_LINE>x = 0;<NEW_LINE>// row 6 is inventory<NEW_LINE>y = 5 * 18;<NEW_LINE>// inventory slots never are head<NEW_LINE>slot.noHead = true;<NEW_LINE>} else {<NEW_LINE>x += 6;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (x > (COLS - 1) * 18) {<NEW_LINE>x = 0;<NEW_LINE>y += 24;<NEW_LINE>// first slot on new line<NEW_LINE>slot.noHead = true;<NEW_LINE>}<NEW_LINE>slot.xPos = X0 + x;<NEW_LINE>slot.yPos = Y0 + y;<NEW_LINE>x += 18;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getItemHandler().getIndexForHandler(i); |
395,109 | private static String tokenStringOf(Token t) {<NEW_LINE>if (ttypes == null) {<NEW_LINE>java.util.HashMap map = new java.util.HashMap();<NEW_LINE>java.lang.reflect.Field[] fields = GroovyTokenTypes.class.getDeclaredFields();<NEW_LINE>for (int i = 0; i < fields.length; i++) {<NEW_LINE>if (fields[i].getType() != int.class)<NEW_LINE>continue;<NEW_LINE>try {<NEW_LINE>map.put(fields[i].get(null), fields<MASK><NEW_LINE>} catch (IllegalAccessException ee) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ttypes = map;<NEW_LINE>}<NEW_LINE>Integer tt = Integer.valueOf(t.getType());<NEW_LINE>Object ttn = ttypes.get(tt);<NEW_LINE>if (ttn == null)<NEW_LINE>ttn = "<" + tt + ">";<NEW_LINE>return "[" + ttn + ",\"" + t.getText() + "\"]";<NEW_LINE>} | [i].getName()); |
119,837 | // -----------------------------------------------------------------------<NEW_LINE>@Override<NEW_LINE>public ValueRange range(ChronoField field) {<NEW_LINE>switch(field) {<NEW_LINE>case ALIGNED_DAY_OF_WEEK_IN_MONTH:<NEW_LINE>case ALIGNED_DAY_OF_WEEK_IN_YEAR:<NEW_LINE>case ALIGNED_WEEK_OF_MONTH:<NEW_LINE>case ALIGNED_WEEK_OF_YEAR:<NEW_LINE>throw new UnsupportedTemporalTypeException("Unsupported field: " + field);<NEW_LINE>case YEAR_OF_ERA:<NEW_LINE>{<NEW_LINE>Calendar jcal = Calendar.getInstance(LOCALE);<NEW_LINE>int startYear = getCurrentEra().getPrivateEra().getSinceDate().getYear();<NEW_LINE>return // +1 due to the different definitions<NEW_LINE>ValueRange.// +1 due to the different definitions<NEW_LINE>of(// +1 due to the different definitions<NEW_LINE>1, // +1 due to the different definitions<NEW_LINE>jcal.getGreatestMinimum(Calendar.YEAR), jcal.getLeastMaximum(Calendar.YEAR) + 1, Year.MAX_VALUE - startYear);<NEW_LINE>}<NEW_LINE>case DAY_OF_YEAR:<NEW_LINE>{<NEW_LINE>Calendar jcal = Calendar.getInstance(LOCALE);<NEW_LINE>int fieldIndex = Calendar.DAY_OF_YEAR;<NEW_LINE>return ValueRange.of(jcal.getMinimum(fieldIndex), jcal.getGreatestMinimum(fieldIndex), jcal.getLeastMaximum(fieldIndex)<MASK><NEW_LINE>}<NEW_LINE>case YEAR:<NEW_LINE>return ValueRange.of(JapaneseDate.MEIJI_6_ISODATE.getYear(), Year.MAX_VALUE);<NEW_LINE>case ERA:<NEW_LINE>return ValueRange.of(JapaneseEra.MEIJI.getValue(), getCurrentEra().getValue());<NEW_LINE>default:<NEW_LINE>return field.range();<NEW_LINE>}<NEW_LINE>} | , jcal.getMaximum(fieldIndex)); |
31,117 | private void updateOrderNodeRecord(final I_PP_Order_Node record, final PPOrderRoutingActivity from) {<NEW_LINE>final WFDurationUnit durationUnit = from.getDurationUnit();<NEW_LINE>record.setPP_Activity_Type(from.getType().getCode());<NEW_LINE>record.setIsActive(true);<NEW_LINE>record.setValue(from.getCode().getAsString());<NEW_LINE>record.setName(from.getName());<NEW_LINE>record.setAD_Workflow_ID(from.getRoutingActivityId().getRoutingId().getRepoId());<NEW_LINE>record.setAD_WF_Node_ID(from.getRoutingActivityId().getRepoId());<NEW_LINE>record.setIsSubcontracting(from.isSubcontracting());<NEW_LINE>record.setC_BPartner_ID(BPartnerId.toRepoId(from.getSubcontractingVendorId()));<NEW_LINE>record.setIsMilestone(from.isMilestone());<NEW_LINE>record.setS_Resource_ID(from.getResourceId().getRepoId());<NEW_LINE>record.setDocStatus(from.getStatus().getDocStatus());<NEW_LINE>//<NEW_LINE>// Standard values<NEW_LINE>record.setSetupTime(durationUnit.toInt(from.getSetupTime()));<NEW_LINE>record.setSetupTimeRequiered(durationUnit.toInt(from.getSetupTime()));<NEW_LINE>record.setMovingTime(durationUnit.toInt(from.getMovingTime()));<NEW_LINE>record.setWaitingTime(durationUnit.toInt(from.getWaitingTime()));<NEW_LINE>record.setQueuingTime(durationUnit.toInt(from.getQueuingTime()));<NEW_LINE>record.setDuration(durationUnit.toInt(from.getDurationPerOneUnit()));<NEW_LINE>record.setDurationRequiered(durationUnit.toInt(from.getDurationRequired()));<NEW_LINE>//<NEW_LINE>// Planned values<NEW_LINE>record.setSetupTimeRequiered(durationUnit.toInt(from.getSetupTimeRequired()));<NEW_LINE>record.setDurationRequiered(durationUnit.toInt<MASK><NEW_LINE>record.setQtyRequiered(from.getQtyRequired().toBigDecimal());<NEW_LINE>record.setC_UOM_ID(from.getQtyRequired().getUomId().getRepoId());<NEW_LINE>//<NEW_LINE>// Reported values<NEW_LINE>record.setSetupTimeReal(durationUnit.toInt(from.getSetupTimeReal()));<NEW_LINE>record.setDurationReal(durationUnit.toInt(from.getDurationReal()));<NEW_LINE>record.setQtyDelivered(from.getQtyDelivered().toBigDecimal());<NEW_LINE>record.setQtyScrap(from.getQtyScrapped().toBigDecimal());<NEW_LINE>record.setQtyReject(from.getQtyRejected().toBigDecimal());<NEW_LINE>record.setDateStart(TimeUtil.asTimestamp(from.getDateStart()));<NEW_LINE>record.setDateFinish(TimeUtil.asTimestamp(from.getDateFinish()));<NEW_LINE>final PPRoutingActivityTemplateId activityTemplateId = from.getActivityTemplateId();<NEW_LINE>record.setAD_WF_Node_Template_ID(PPRoutingActivityTemplateId.toRepoId(activityTemplateId));<NEW_LINE>} | (from.getDurationRequired())); |
1,457,172 | private Contract matchContract(Message message, Contract groovyDsl) {<NEW_LINE>List<String> unmatchedHeaders = headersMatch(message, groovyDsl);<NEW_LINE>if (!unmatchedHeaders.isEmpty()) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Contract [" + groovyDsl + "] hasn't matched the following headers " + unmatchedHeaders);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Object inputMessage = StubRunnerJmsAccessor.getBody(message);<NEW_LINE>Object dslBody = MapConverter.getStubSideValues(groovyDsl.<MASK><NEW_LINE>if (dslBody instanceof FromFileProperty) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Will compare file content");<NEW_LINE>}<NEW_LINE>FromFileProperty property = (FromFileProperty) dslBody;<NEW_LINE>if (property.isString()) {<NEW_LINE>// continue processing as if body was pure string<NEW_LINE>dslBody = property.asString();<NEW_LINE>} else if (!(inputMessage instanceof byte[])) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Contract provided byte comparison, but the input message is of type [" + inputMessage.getClass() + "]. Can't compare the two.");<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>boolean matches = Arrays.equals(property.asBytes(), (byte[]) inputMessage);<NEW_LINE>if (log.isDebugEnabled() && !matches) {<NEW_LINE>log.debug("Contract provided byte comparison, but the byte arrays don't match");<NEW_LINE>}<NEW_LINE>return matches ? groovyDsl : null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (matchViaContent(groovyDsl, inputMessage, dslBody)) {<NEW_LINE>return groovyDsl;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | getInput().getMessageBody()); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.