idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
899,762 | private JComponent createLeftActionsToolbar() {<NEW_LINE>final CommonActionsManager actionsManager = CommonActionsManager.getInstance();<NEW_LINE>DefaultActionGroup group = new DefaultActionGroup();<NEW_LINE>group.<MASK><NEW_LINE>group.add(new CloseAction());<NEW_LINE>final TreeExpander treeExpander = new TreeExpander() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void expandAll() {<NEW_LINE>TreeUtil.expandAll(myTree);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean canExpand() {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void collapseAll() {<NEW_LINE>TreeUtil.collapseAll(myTree, 0);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean canCollapse() {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>group.add(actionsManager.createExpandAllAction(treeExpander, myTree));<NEW_LINE>group.add(actionsManager.createCollapseAllAction(treeExpander, myTree));<NEW_LINE>group.add(actionsManager.createPrevOccurenceAction(getOccurenceNavigator()));<NEW_LINE>group.add(actionsManager.createNextOccurenceAction(getOccurenceNavigator()));<NEW_LINE>group.add(myGlobalInspectionContext.createToggleAutoscrollAction());<NEW_LINE>group.add(new ExportHTMLAction(this));<NEW_LINE>group.add(new ContextHelpAction(HELP_ID));<NEW_LINE>return createToolbar(group);<NEW_LINE>} | add(new RerunAction(this)); |
1,231,331 | private AccessListAddressSpecifier toAccessListAddressSpecifier(Access_list_ip_rangeContext ctx) {<NEW_LINE>if (ctx.ip != null) {<NEW_LINE>if (ctx.wildcard != null) {<NEW_LINE>// IP and mask<NEW_LINE>Ip <MASK><NEW_LINE>return new WildcardAddressSpecifier(IpWildcard.ipWithWildcardMask(toIp(ctx.ip), wildcard));<NEW_LINE>} else {<NEW_LINE>// Just IP. Same as if 'host' was specified<NEW_LINE>return new WildcardAddressSpecifier(IpWildcard.create(toIp(ctx.ip)));<NEW_LINE>}<NEW_LINE>} else if (ctx.ANY() != null) {<NEW_LINE>return AnyAddressSpecifier.INSTANCE;<NEW_LINE>} else if (ctx.prefix != null) {<NEW_LINE>return new WildcardAddressSpecifier(IpWildcard.create(Prefix.parse(ctx.prefix.getText())));<NEW_LINE>} else {<NEW_LINE>throw convError(AccessListAddressSpecifier.class, ctx);<NEW_LINE>}<NEW_LINE>} | wildcard = toIp(ctx.wildcard); |
944,986 | static Bitmap decodeStream(InputStream stream, Request request) throws IOException {<NEW_LINE>MarkableInputStream markStream = new MarkableInputStream(stream);<NEW_LINE>stream = markStream;<NEW_LINE>// TODO fix this crap.<NEW_LINE>long mark = markStream.savePosition(65536);<NEW_LINE>final BitmapFactory.Options options = RequestHandler.createBitmapOptions(request);<NEW_LINE>final boolean calculateSize = RequestHandler.requiresInSampleSize(options);<NEW_LINE>boolean isWebPFile = Utils.isWebPFile(stream);<NEW_LINE>markStream.reset(mark);<NEW_LINE>// When decode WebP network stream, BitmapFactory throw JNI Exception and make app crash.<NEW_LINE>// Decode byte array instead<NEW_LINE>if (isWebPFile) {<NEW_LINE>byte[] bytes = Utils.toByteArray(stream);<NEW_LINE>if (calculateSize) {<NEW_LINE>BitmapFactory.decodeByteArray(bytes, <MASK><NEW_LINE>RequestHandler.calculateInSampleSize(request.targetWidth, request.targetHeight, options, request);<NEW_LINE>}<NEW_LINE>return BitmapFactory.decodeByteArray(bytes, 0, bytes.length, options);<NEW_LINE>} else {<NEW_LINE>if (calculateSize) {<NEW_LINE>BitmapFactory.decodeStream(stream, null, options);<NEW_LINE>RequestHandler.calculateInSampleSize(request.targetWidth, request.targetHeight, options, request);<NEW_LINE>markStream.reset(mark);<NEW_LINE>}<NEW_LINE>Bitmap bitmap = BitmapFactory.decodeStream(stream, null, options);<NEW_LINE>if (bitmap == null) {<NEW_LINE>// Treat null as an IO exception, we will eventually retry.<NEW_LINE>throw new IOException("Failed to decode stream.");<NEW_LINE>}<NEW_LINE>return bitmap;<NEW_LINE>}<NEW_LINE>} | 0, bytes.length, options); |
855,422 | private void visitMemberDeclarator(AstNode node) {<NEW_LINE>if (isOverriddenMethod(node)) {<NEW_LINE>// assume that ancestor method is documented<NEW_LINE>// and do not count as public API<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>var container = node.getFirstAncestor(CxxGrammarImpl.templateDeclaration, CxxGrammarImpl.classSpecifier);<NEW_LINE>AstNode docNode = node;<NEW_LINE>List<Token> comments;<NEW_LINE>if (container == null || container.getType().equals(CxxGrammarImpl.classSpecifier)) {<NEW_LINE>comments = getBlockDocumentation(docNode);<NEW_LINE>} else {<NEW_LINE>// template<NEW_LINE>do {<NEW_LINE>comments = getBlockDocumentation(container);<NEW_LINE>if (!comments.isEmpty()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>container = container.getFirstAncestor(CxxGrammarImpl.templateDeclaration);<NEW_LINE>} while (container != null);<NEW_LINE>}<NEW_LINE>// documentation may be inlined<NEW_LINE>if (comments.isEmpty()) {<NEW_LINE>comments = getDeclaratorInlineComment(node);<NEW_LINE>}<NEW_LINE>// find the identifier to present to concrete visitors<NEW_LINE>String id = null;<NEW_LINE>// first look for an operator function id<NEW_LINE>var idNode = node.getFirstDescendant(CxxGrammarImpl.operatorFunctionId);<NEW_LINE>if (idNode != null) {<NEW_LINE>id = getOperatorId(idNode);<NEW_LINE>} else {<NEW_LINE>// look for a declarator id<NEW_LINE>idNode = <MASK><NEW_LINE>if (idNode != null) {<NEW_LINE>id = idNode.getTokenValue();<NEW_LINE>} else {<NEW_LINE>// look for an identifier (e.g in bitfield declaration)<NEW_LINE>idNode = node.getFirstDescendant(GenericTokenType.IDENTIFIER);<NEW_LINE>if (idNode != null) {<NEW_LINE>id = idNode.getTokenValue();<NEW_LINE>} else {<NEW_LINE>LOG.error("unsupported declarator at {}", node.getTokenLine());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (idNode != null && id != null) {<NEW_LINE>visitPublicApi(idNode, id, comments);<NEW_LINE>}<NEW_LINE>} | node.getFirstDescendant(CxxGrammarImpl.declaratorId); |
1,082,006 | private HdfsBlobStore createBlobstore(URI uri, String path, Settings repositorySettings) {<NEW_LINE>Configuration hadoopConfiguration = new Configuration(repositorySettings.getAsBoolean("load_defaults", true));<NEW_LINE>hadoopConfiguration.setClassLoader(HdfsRepository.class.getClassLoader());<NEW_LINE>hadoopConfiguration.reloadConfiguration();<NEW_LINE>final Settings confSettings = repositorySettings.getByPrefix("conf.");<NEW_LINE>for (String key : confSettings.keySet()) {<NEW_LINE>logger.debug("Adding configuration to HDFS Client Configuration : {} = {}", key, confSettings.get(key));<NEW_LINE>hadoopConfiguration.set(key, confSettings.get(key));<NEW_LINE>}<NEW_LINE>// Disable FS cache<NEW_LINE>hadoopConfiguration.setBoolean("fs.hdfs.impl.disable.cache", true);<NEW_LINE>// Create a hadoop user<NEW_LINE>UserGroupInformation <MASK><NEW_LINE>// Sense if HA is enabled<NEW_LINE>// HA requires elevated permissions during regular usage in the event that a failover operation<NEW_LINE>// occurs and a new connection is required.<NEW_LINE>String host = uri.getHost();<NEW_LINE>String configKey = HdfsClientConfigKeys.Failover.PROXY_PROVIDER_KEY_PREFIX + "." + host;<NEW_LINE>Class<?> ret = hadoopConfiguration.getClass(configKey, null, FailoverProxyProvider.class);<NEW_LINE>boolean haEnabled = ret != null;<NEW_LINE>// Create the filecontext with our user information<NEW_LINE>// This will correctly configure the filecontext to have our UGI as its internal user.<NEW_LINE>FileContext fileContext = ugi.doAs((PrivilegedAction<FileContext>) () -> {<NEW_LINE>try {<NEW_LINE>AbstractFileSystem fs = AbstractFileSystem.get(uri, hadoopConfiguration);<NEW_LINE>return FileContext.getFileContext(fs, hadoopConfiguration);<NEW_LINE>} catch (UnsupportedFileSystemException e) {<NEW_LINE>throw new UncheckedIOException(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>logger.debug("Using file-system [{}] for URI [{}], path [{}]", fileContext.getDefaultFileSystem(), fileContext.getDefaultFileSystem().getUri(), path);<NEW_LINE>try {<NEW_LINE>return new HdfsBlobStore(fileContext, path, bufferSize, isReadOnly(), haEnabled);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new UncheckedIOException(String.format(Locale.ROOT, "Cannot create HDFS repository for uri [%s]", uri), e);<NEW_LINE>}<NEW_LINE>} | ugi = login(hadoopConfiguration, repositorySettings); |
1,378,626 | public TransferStatus prepare(final Path file, final Local local, final TransferStatus parent, final ProgressListener progress) throws BackgroundException {<NEW_LINE>final TransferStatus status = super.prepare(file, local, parent, progress);<NEW_LINE>if (status.isExists()) {<NEW_LINE>final String filename = file.getName();<NEW_LINE>int no = 0;<NEW_LINE>do {<NEW_LINE>String proposal = String.format("%s-%d", FilenameUtils.getBaseName(filename), ++no);<NEW_LINE>if (StringUtils.isNotBlank(Path.getExtension(filename))) {<NEW_LINE>proposal += String.format(".%s", Path.getExtension(filename));<NEW_LINE>}<NEW_LINE>if (parent.getRename().remote != null) {<NEW_LINE>status.rename(new Path(parent.getRename().remote, proposal, file.getType()));<NEW_LINE>} else {<NEW_LINE>status.rename(new Path(file.getParent(), proposal, file.getType()));<NEW_LINE>}<NEW_LINE>} while (find.find(status.getRename().remote));<NEW_LINE>if (log.isInfoEnabled()) {<NEW_LINE>log.info(String.format("Changed upload target from %s to %s", file, status.getRename().remote));<NEW_LINE>}<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Clear exist flag for file %s", file));<NEW_LINE>}<NEW_LINE>status.setExists(false);<NEW_LINE>} else {<NEW_LINE>if (parent.getRename().remote != null) {<NEW_LINE>status.rename(new Path(parent.getRename().remote, file.getName()<MASK><NEW_LINE>}<NEW_LINE>if (log.isInfoEnabled()) {<NEW_LINE>log.info(String.format("Changed upload target from %s to %s", file, status.getRename().remote));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return status;<NEW_LINE>} | , file.getType())); |
341,606 | private Iterator<I_IMP_ProcessorLog> retrieveLogs() {<NEW_LINE>final <MASK><NEW_LINE>final List<Object> params = new ArrayList<Object>();<NEW_LINE>// Window selection<NEW_LINE>final String processWhereClause = getProcessInfo().getWhereClause();<NEW_LINE>if (!Check.isEmpty(processWhereClause, true)) {<NEW_LINE>whereClause.append(" AND (").append(processWhereClause).append(")");<NEW_LINE>}<NEW_LINE>// Only those who have errors<NEW_LINE>whereClause.append(" AND ").append(I_IMP_ProcessorLog.COLUMNNAME_IsError).append("=?");<NEW_LINE>params.add(true);<NEW_LINE>return // .setApplyAccessFilterRW(true) // if a user can open the window and see the error-log records, we want to let him/her resubmit them<NEW_LINE>new Query(getCtx(), I_IMP_ProcessorLog.Table_Name, whereClause.toString(), ITrx.TRXNAME_None).setParameters(params).setOrderBy(// guaranteed=false<NEW_LINE>I_IMP_ProcessorLog.COLUMNNAME_IMP_ProcessorLog_ID).// guaranteed=false<NEW_LINE>iterate(// guaranteed=false<NEW_LINE>I_IMP_ProcessorLog.class, false);<NEW_LINE>} | StringBuilder whereClause = new StringBuilder("1=1"); |
1,163,240 | private static void createTable(final Connection connection) throws SQLException {<NEW_LINE>LOGGER.debug(LOG_CREATING_TABLE, DATABASE_NAME, TABLE_NAME);<NEW_LINE>execute(connection, "CREATE TABLE SUBTRACKS (" + "ID INT NOT NULL , " + "FILEID BIGINT NOT NULL , " + "LANG VARCHAR2(" + SIZE_LANG + ") , " + "TITLE VARCHAR2(" + SIZE_MAX + ") , " + "FORMAT_TYPE INT , " + "EXTERNALFILE VARCHAR2(" + SIZE_EXTERNALFILE + ") NOT NULL default '' , " + "CHARSET VARCHAR2(" + SIZE_MAX + <MASK><NEW_LINE>} | ") , " + "CONSTRAINT PKSUB PRIMARY KEY (FILEID, ID, EXTERNALFILE) , " + "FOREIGN KEY(FILEID) REFERENCES FILES(ID) ON DELETE CASCADE" + ")"); |
41,546 | public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {<NEW_LINE>String[] clientRegistrationRepositoryBeanNames = BeanFactoryUtils.beanNamesForTypeIncludingAncestors((ListableBeanFactory) this.beanFactory, ClientRegistrationRepository.class, false, false);<NEW_LINE>String[] authorizedClientRepositoryBeanNames = BeanFactoryUtils.beanNamesForTypeIncludingAncestors((ListableBeanFactory) this.beanFactory, OAuth2AuthorizedClientRepository.class, false, false);<NEW_LINE>if (clientRegistrationRepositoryBeanNames.length != 1 || authorizedClientRepositoryBeanNames.length != 1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (String beanName : registry.getBeanDefinitionNames()) {<NEW_LINE>BeanDefinition <MASK><NEW_LINE>if (RequestMappingHandlerAdapter.class.getName().equals(beanDefinition.getBeanClassName())) {<NEW_LINE>PropertyValue currentArgumentResolvers = beanDefinition.getPropertyValues().getPropertyValue(CUSTOM_ARGUMENT_RESOLVERS_PROPERTY);<NEW_LINE>ManagedList<Object> argumentResolvers = new ManagedList<>();<NEW_LINE>if (currentArgumentResolvers != null) {<NEW_LINE>argumentResolvers.addAll((ManagedList<?>) currentArgumentResolvers.getValue());<NEW_LINE>}<NEW_LINE>String[] authorizedClientManagerBeanNames = BeanFactoryUtils.beanNamesForTypeIncludingAncestors((ListableBeanFactory) this.beanFactory, OAuth2AuthorizedClientManager.class, false, false);<NEW_LINE>BeanDefinitionBuilder beanDefinitionBuilder = BeanDefinitionBuilder.genericBeanDefinition(OAuth2AuthorizedClientArgumentResolver.class);<NEW_LINE>if (authorizedClientManagerBeanNames.length == 1) {<NEW_LINE>beanDefinitionBuilder.addConstructorArgReference(authorizedClientManagerBeanNames[0]);<NEW_LINE>} else {<NEW_LINE>beanDefinitionBuilder.addConstructorArgReference(clientRegistrationRepositoryBeanNames[0]);<NEW_LINE>beanDefinitionBuilder.addConstructorArgReference(authorizedClientRepositoryBeanNames[0]);<NEW_LINE>}<NEW_LINE>argumentResolvers.add(beanDefinitionBuilder.getBeanDefinition());<NEW_LINE>beanDefinition.getPropertyValues().add(CUSTOM_ARGUMENT_RESOLVERS_PROPERTY, argumentResolvers);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | beanDefinition = registry.getBeanDefinition(beanName); |
49,815 | public static ScenarioSetup initTimerChangeProcessDefinition() {<NEW_LINE>return new ScenarioSetup() {<NEW_LINE><NEW_LINE>public void execute(ProcessEngine engine, String scenarioName) {<NEW_LINE>String processDefinitionIdWithoutTenant = engine.getRepositoryService().createDeployment().addClasspathResource("org/camunda/bpm/qa/upgrade/gson/oneTaskProcessTimer.bpmn20.xml").tenantId(null).deployWithResult().getDeployedProcessDefinitions().get(0).getId();<NEW_LINE>engine.getRuntimeService().startProcessInstanceById(processDefinitionIdWithoutTenant, "TimerChangeProcessDefinitionScenarioV1");<NEW_LINE>engine.getRepositoryService().updateProcessDefinitionSuspensionState().byProcessDefinitionId(processDefinitionIdWithoutTenant).includeProcessInstances(true).<MASK><NEW_LINE>String processDefinitionIdWithTenant = engine.getRepositoryService().createDeployment().addClasspathResource("org/camunda/bpm/qa/upgrade/gson/oneTaskProcessTimer.bpmn20.xml").tenantId("aTenantId").deployWithResult().getDeployedProcessDefinitions().get(0).getId();<NEW_LINE>engine.getRuntimeService().startProcessInstanceById(processDefinitionIdWithTenant, "TimerChangeProcessDefinitionScenarioV2");<NEW_LINE>engine.getRepositoryService().updateProcessDefinitionSuspensionState().byProcessDefinitionKey("oneTaskProcessTimer_710").processDefinitionTenantId("aTenantId").includeProcessInstances(true).executionDate(FIXED_DATE_TWO).suspend();<NEW_LINE>engine.getRepositoryService().updateProcessDefinitionSuspensionState().byProcessDefinitionKey("oneTaskProcessTimer_710").processDefinitionWithoutTenantId().includeProcessInstances(false).executionDate(FIXED_DATE_THREE).suspend();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | executionDate(FIXED_DATE_ONE).suspend(); |
1,315,682 | public TextFile importMedia(String userId, long projectId, String urlString, boolean save) throws IOException {<NEW_LINE>InputStream is = null;<NEW_LINE>try {<NEW_LINE>final int BUFSIZE = 4096;<NEW_LINE>URL url = new URL(urlString);<NEW_LINE>byte[] buffer = new byte[BUFSIZE];<NEW_LINE>int read = 0;<NEW_LINE>ByteArrayOutputStream baos = new ByteArrayOutputStream();<NEW_LINE>is = url.openStream();<NEW_LINE>while ((read = is.read(buffer)) > 0) {<NEW_LINE>baos.<MASK><NEW_LINE>}<NEW_LINE>byte[] bytes = baos.toByteArray();<NEW_LINE>baos.flush();<NEW_LINE>String filename = null;<NEW_LINE>if (save) {<NEW_LINE>String[] parts = url.getPath().split("/");<NEW_LINE>filename = parts[parts.length - 1];<NEW_LINE>if (filename.length() == 0) {<NEW_LINE>throw new IOException("Cannot determine name when saving media resource.");<NEW_LINE>}<NEW_LINE>filename = "assets/" + filename;<NEW_LINE>storageIo.uploadRawFileForce(projectId, filename, userId, bytes);<NEW_LINE>}<NEW_LINE>return new TextFile(filename, Base64Util.encodeLines(bytes));<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>throw new IOException("Unable to import from malformed URL", e);<NEW_LINE>} finally {<NEW_LINE>if (is != null) {<NEW_LINE>try {<NEW_LINE>is.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>// suppress error on close<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | write(buffer, 0, read); |
451,230 | public static void main(String[] args) throws PcapNativeException, NotOpenException {<NEW_LINE>String filter = args.length != 0 ? args[0] : "";<NEW_LINE>System.out.println(COUNT_KEY + ": " + COUNT);<NEW_LINE>System.out.println(READ_TIMEOUT_KEY + ": " + READ_TIMEOUT);<NEW_LINE>System.out.println(SNAPLEN_KEY + ": " + SNAPLEN);<NEW_LINE>System.out.println("\n");<NEW_LINE>PcapNetworkInterface nif;<NEW_LINE>try {<NEW_LINE>nif = new NifSelector().selectNetworkInterface();<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (nif == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>System.out.println(nif.getName() + "(" + nif.getDescription() + ")");<NEW_LINE>final PcapHandle handle = nif.openLive(SNAPLEN, PromiscuousMode.PROMISCUOUS, READ_TIMEOUT);<NEW_LINE>if (filter.length() != 0) {<NEW_LINE>handle.setFilter(filter, BpfCompileMode.OPTIMIZE);<NEW_LINE>}<NEW_LINE>RawPacketListener listener = new RawPacketListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void gotPacket(byte[] packet) {<NEW_LINE>System.out.println(handle.getTimestamp());<NEW_LINE>System.out.println(ByteArrays.toHexString(packet, " "));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>try {<NEW_LINE>handle.loop(COUNT, listener);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>PcapStat ps = handle.getStats();<NEW_LINE>System.out.println(<MASK><NEW_LINE>System.out.println("ps_drop: " + ps.getNumPacketsDropped());<NEW_LINE>System.out.println("ps_ifdrop: " + ps.getNumPacketsDroppedByIf());<NEW_LINE>if (Platform.isWindows()) {<NEW_LINE>System.out.println("bs_capt: " + ps.getNumPacketsCaptured());<NEW_LINE>}<NEW_LINE>handle.close();<NEW_LINE>} | "ps_recv: " + ps.getNumPacketsReceived()); |
1,292,485 | public com.amazonaws.services.memorydb.model.InvalidARNException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.memorydb.model.InvalidARNException invalidARNException = new com.amazonaws.services.memorydb.model.InvalidARNException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return invalidARNException;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,417,049 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, JsonElement jsonElement) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>Business business = new Business(emc);<NEW_LINE>File file = emc.find(id, File.class);<NEW_LINE>if (null == file) {<NEW_LINE>throw new ExceptionEntityNotExist(id, File.class);<NEW_LINE>}<NEW_LINE>Application application = emc.flag(file.getApplication(), Application.class);<NEW_LINE>if (null == application) {<NEW_LINE>throw new ExceptionEntityNotExist(wi.getApplication(), Application.class);<NEW_LINE>}<NEW_LINE>if ((!business.editable(effectivePerson, application))) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson.getDistinguishedName());<NEW_LINE>}<NEW_LINE>Wi.copier.copy(wi, file);<NEW_LINE>file.setApplication(application.getId());<NEW_LINE>this.updateCreator(file, effectivePerson);<NEW_LINE>emc.beginTransaction(File.class);<NEW_LINE>if (StringUtils.isNotEmpty(file.getAlias())) {<NEW_LINE>if (emc.duplicateWithFlags(file.getId(), File.class, file.getAlias())) {<NEW_LINE>throw new ExceptionDuplicateFlag(File.class, file.getAlias());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(file.getName())) {<NEW_LINE>throw new ExceptionEmptyName();<NEW_LINE>}<NEW_LINE>if (emc.duplicateWithRestrictFlags(File.class, File.application_FIELDNAME, file.getApplication(), file.getId(), ListTools.toList(file.getName()))) {<NEW_LINE>throw new ExceptionDuplicateRestrictFlag(File.class, file.getName());<NEW_LINE>}<NEW_LINE>emc.<MASK><NEW_LINE>emc.commit();<NEW_LINE>CacheManager.notify(File.class);<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(file.getId());<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | check(file, CheckPersistType.all); |
1,219,743 | private static void assertIterableEquals(Iterable<?> expected, Iterable<?> actual, Deque<Integer> indexes, Object messageOrSupplier) {<NEW_LINE>if (expected == actual) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>assertIterablesNotNull(expected, actual, indexes, messageOrSupplier);<NEW_LINE>Iterator<?> expectedIterator = expected.iterator();<NEW_LINE>Iterator<?> actualIterator = actual.iterator();<NEW_LINE>int processed = 0;<NEW_LINE>while (expectedIterator.hasNext() && actualIterator.hasNext()) {<NEW_LINE>processed++;<NEW_LINE>Object expectedElement = expectedIterator.next();<NEW_LINE><MASK><NEW_LINE>if (Objects.equals(expectedElement, actualElement)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>indexes.addLast(processed - 1);<NEW_LINE>assertIterableElementsEqual(expectedElement, actualElement, indexes, messageOrSupplier);<NEW_LINE>indexes.removeLast();<NEW_LINE>}<NEW_LINE>assertIteratorsAreEmpty(expectedIterator, actualIterator, processed, indexes, messageOrSupplier);<NEW_LINE>} | Object actualElement = actualIterator.next(); |
1,042,217 | final CreateSamplingRuleResult executeCreateSamplingRule(CreateSamplingRuleRequest createSamplingRuleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createSamplingRuleRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateSamplingRuleRequest> request = null;<NEW_LINE>Response<CreateSamplingRuleResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateSamplingRuleRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createSamplingRuleRequest));<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, "XRay");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateSamplingRule");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateSamplingRuleResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateSamplingRuleResultJsonUnmarshaller());<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,483,785 | public static void populateMeasure(Measure measure, boolean checkGroupSplit) {<NEW_LINE>// Retrieve beams in this measure<NEW_LINE>final Set<AbstractBeamInter> <MASK><NEW_LINE>for (AbstractChordInter chord : measure.getHeadChords()) {<NEW_LINE>beams.addAll(chord.getBeams());<NEW_LINE>}<NEW_LINE>// Retrieve beam groups for this measure<NEW_LINE>final Set<BeamGroupInter> groups = new LinkedHashSet<>();<NEW_LINE>for (AbstractBeamInter beam : beams) {<NEW_LINE>if (beam.isRemoved()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final BeamGroupInter group = beam.getGroup();<NEW_LINE>groups.add(group);<NEW_LINE>}<NEW_LINE>// Detect groups that are linked to more than one staff<NEW_LINE>for (BeamGroupInter group : measure.getBeamGroups()) {<NEW_LINE>group.countStaves();<NEW_LINE>}<NEW_LINE>} | beams = new LinkedHashSet<>(); |
706,938 | public Transferable clipboardCopy() {<NEW_LINE>String result = "";<NEW_LINE>GlassfishModule commonModule = lu.lookup(GlassfishModule.class);<NEW_LINE>if (commonModule != null) {<NEW_LINE>Map<String, String<MASK><NEW_LINE>String host = ip.get(GlassfishModule.HTTPHOST_ATTR);<NEW_LINE>if (null == host) {<NEW_LINE>host = ip.get(GlassfishModule.HOSTNAME_ATTR);<NEW_LINE>}<NEW_LINE>String httpPort = ip.get(GlassfishModule.HTTPPORT_ATTR);<NEW_LINE>String url = ip.get(GlassfishModule.URL_ATTR);<NEW_LINE>if (url == null || !url.contains("ee6wc")) {<NEW_LINE>result = Utils.getHttpListenerProtocol(host, httpPort) + "://" + host + ":" + httpPort + "/" + ws.getTestURL();<NEW_LINE>} else {<NEW_LINE>result = "http" + "://" + host + ":" + httpPort + "/" + ws.getTestURL();<NEW_LINE>}<NEW_LINE>if (result.endsWith("//")) {<NEW_LINE>result = result.substring(0, result.length() - 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new StringSelection(result);<NEW_LINE>} | > ip = commonModule.getInstanceProperties(); |
424,453 | private Collection<Fiber> findProblemFibers(long now, long nanos) {<NEW_LINE>final List<Fiber> pfs = new ArrayList<Fiber>();<NEW_LINE>final Map<Thread, Fiber> fibs = scheduler.getRunningFibers();<NEW_LINE>if (fibs == null)<NEW_LINE>return null;<NEW_LINE>fibersInfo.keySet().retainAll(fibs.keySet());<NEW_LINE>for (Iterator<Map.Entry<Thread, Fiber>> it = fibs.entrySet().iterator(); it.hasNext(); ) {<NEW_LINE>final Map.Entry<Thread, Fiber> entry = it.next();<NEW_LINE>final Thread t = entry.getKey();<NEW_LINE>final Fiber f = entry.getValue();<NEW_LINE>if (f != null)<NEW_LINE>// volatile read<NEW_LINE>f.getState();<NEW_LINE>final FiberInfo fi = fibersInfo.get(t);<NEW_LINE>final long run = f != null ? f.getRun() : 0;<NEW_LINE>// if (f != null)<NEW_LINE>// System.err.println("XXX findProblemFibers f: " + f + " run: " + run + " time: " + (fi != null ? (now - fi.time) : "NA"));<NEW_LINE>if (fi == null)<NEW_LINE>fibersInfo.put(t, new FiberInfo(f, run, f != <MASK><NEW_LINE>else if (fi.fiber != f | fi.run != run)<NEW_LINE>fi.set(f, run, f != null ? now : -1);<NEW_LINE>else if (f != null & now - fi.time > nanos)<NEW_LINE>pfs.add(f);<NEW_LINE>}<NEW_LINE>return pfs;<NEW_LINE>} | null ? now : -1)); |
294,861 | public float evaluateMask(int tl_x, int tl_y) {<NEW_LINE>Objects.requireNonNull(o.mask);<NEW_LINE>float imageSumSq = 0;<NEW_LINE>for (int y = 0; y < o.template.height; y++) {<NEW_LINE>int imageIndex = o.image.startIndex + (tl_y + y) * o.image.stride + tl_x;<NEW_LINE>int maskIndex = o.mask.startIndex <MASK><NEW_LINE>for (int x = 0; x < o.template.width; x++) {<NEW_LINE>float v = o.image.data[imageIndex++] * o.mask.data[maskIndex++];<NEW_LINE>imageSumSq += v * v;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>imageSumSq /= area;<NEW_LINE>float errorSumSq = 0.0f;<NEW_LINE>for (int y = 0; y < o.template.height; y++) {<NEW_LINE>int imageIndex = o.image.startIndex + (tl_y + y) * o.image.stride + tl_x;<NEW_LINE>int templateIndex = o.template.startIndex + y * o.template.stride;<NEW_LINE>int maskIndex = o.mask.startIndex + y * o.mask.stride;<NEW_LINE>for (int x = 0; x < o.template.width; x++) {<NEW_LINE>float mask = o.mask.data[maskIndex++];<NEW_LINE>float error = (o.image.data[imageIndex++] - o.template.data[templateIndex++]) * mask;<NEW_LINE>errorSumSq += error * error;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>errorSumSq /= area;<NEW_LINE>return (float) (-errorSumSq / Math.sqrt(EPS + templateSumSq * imageSumSq));<NEW_LINE>} | + y * o.mask.stride; |
1,312,868 | public void profilingConfigurableHookOut(Op op, OpContext oc, long timeStart) {<NEW_LINE>if (OpProfiler.getInstance().getConfig() == null)<NEW_LINE>return;<NEW_LINE>if (OpProfiler.getInstance().getConfig().isStackTrace()) {<NEW_LINE>OpProfiler.getInstance().processStackCall(op, timeStart);<NEW_LINE>}<NEW_LINE>if (OpProfiler.getInstance().getConfig().isCheckElapsedTime()) {<NEW_LINE>OpProfiler.getInstance().timeOpCall(op, timeStart);<NEW_LINE>}<NEW_LINE>if (OpProfiler.getInstance().getConfig().isCheckForNAN()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (OpProfiler.getInstance().getConfig().isCheckForINF()) {<NEW_LINE>OpExecutionerUtil.checkForInf(op, oc);<NEW_LINE>}<NEW_LINE>if (OpProfiler.getInstance().getConfig().isNativeStatistics()) {<NEW_LINE>if (op.z() != null) {<NEW_LINE>INDArrayStatistics stat = inspectArray(op.z());<NEW_LINE>OpProfiler.getInstance().setStatistics(stat);<NEW_LINE>log.info("Op name: {}; Z shapeInfo: {}; Statistics: min:{} max:{} mean:{} stdev:{} pos:{}, neg:{} zero:{} inf:{} nan:{}", op.opName(), op.z().shapeInfoJava(), stat.getMinValue(), stat.getMaxValue(), stat.getMeanValue(), stat.getStdDevValue(), stat.getCountPositive(), stat.getCountNegative(), stat.getCountZero(), stat.getCountInf(), stat.getCountNaN());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (Nd4j.getExecutioner().isVerbose()) {<NEW_LINE>if (op.z() != null)<NEW_LINE>log.info("Op name: {}; Z shapeInfo: {}; Z values: {}", op.opName(), op.z().shapeInfoJava(), firstX(op.z(), 10));<NEW_LINE>}<NEW_LINE>} | OpExecutionerUtil.checkForNaN(op, oc); |
1,454,392 | public static boolean scrollToVisible(@Nonnull JTree tree, @Nonnull TreePath path, boolean centered) {<NEW_LINE>assert UIAccess.isUIThread();<NEW_LINE>Rectangle bounds = tree.getPathBounds(path);<NEW_LINE>if (bounds == null) {<NEW_LINE>LOG.debug("cannot scroll to: ", path);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Container parent = tree.getParent();<NEW_LINE>if (parent instanceof JViewport) {<NEW_LINE>int width = parent.getWidth();<NEW_LINE>if (!centered && tree instanceof Tree && !((Tree) tree).isHorizontalAutoScrollingEnabled()) {<NEW_LINE>bounds.<MASK><NEW_LINE>bounds.width = width;<NEW_LINE>} else {<NEW_LINE>bounds.width = Math.min(bounds.width, width / 2);<NEW_LINE>// TODO: calculate a control width<NEW_LINE>bounds.x -= JBUI.scale(20);<NEW_LINE>if (bounds.x < 0) {<NEW_LINE>bounds.width += bounds.x;<NEW_LINE>bounds.x = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int height = parent.getHeight();<NEW_LINE>if (height > bounds.height && height < tree.getHeight()) {<NEW_LINE>if (centered || height < bounds.height * 5) {<NEW_LINE>bounds.y -= (height - bounds.height) / 2;<NEW_LINE>bounds.height = height;<NEW_LINE>} else {<NEW_LINE>bounds.y -= bounds.height * 2;<NEW_LINE>bounds.height *= 5;<NEW_LINE>}<NEW_LINE>if (bounds.y < 0) {<NEW_LINE>bounds.height += bounds.y;<NEW_LINE>bounds.y = 0;<NEW_LINE>}<NEW_LINE>int y = bounds.y + bounds.height - tree.getHeight();<NEW_LINE>if (y > 0)<NEW_LINE>bounds.height -= y;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>scrollToVisibleWithAccessibility(tree, bounds);<NEW_LINE>return true;<NEW_LINE>} | x = -tree.getX(); |
1,013,308 | private <T> IQuery<T> createQuery_ExplodingORJoinsToUnions_SecondLevelCompositeOR(final QueryBuildContext<T> queryBuildCtx) {<NEW_LINE>final ICompositeQueryFilter<T<MASK><NEW_LINE>if (mainFilterAsComposite == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (mainFilterAsComposite.getFiltersCount() <= 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (!mainFilterAsComposite.isJoinAnd()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Find second level composite-OR<NEW_LINE>final List<IQueryFilter<T>> otherFilters = new ArrayList<>();<NEW_LINE>ICompositeQueryFilter<T> compositeFilterToExplode = null;<NEW_LINE>for (final IQueryFilter<T> filter : mainFilterAsComposite.getFilters()) {<NEW_LINE>if (compositeFilterToExplode == null && filter instanceof ICompositeQueryFilter) {<NEW_LINE>final ICompositeQueryFilter<T> compositeFilter = (ICompositeQueryFilter<T>) filter;<NEW_LINE>if (compositeFilter.isJoinOr() && compositeFilter.getFiltersCount() >= 2) {<NEW_LINE>compositeFilterToExplode = compositeFilter;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>otherFilters.add(filter);<NEW_LINE>}<NEW_LINE>if (compositeFilterToExplode == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final List<IQueryFilter<T>> subFilters = compositeFilterToExplode.getFilters();<NEW_LINE>//<NEW_LINE>// For the main query we use only the first filter from our composite.<NEW_LINE>final IQuery<T> query;<NEW_LINE>{<NEW_LINE>final IQueryFilter<T> firstSubFilter = subFilters.get(0);<NEW_LINE>final IPair<ISqlQueryFilter, IQueryFilter<T>> sqlAndNonSqlFilters = extractSqlAndNonSqlFilters(new CompositeQueryFilter<T>(queryBuildCtx.getModelTableName()).addFilters(otherFilters).addFilter(firstSubFilter));<NEW_LINE>final ISqlQueryFilter sqlFilters = sqlAndNonSqlFilters.getLeft();<NEW_LINE>final IQueryFilter<T> nonSqlFilters = sqlAndNonSqlFilters.getRight();<NEW_LINE>query = createQuery(queryBuildCtx, sqlFilters, nonSqlFilters);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Create union queries, starting from second sub-filter.<NEW_LINE>for (int subFilterIndex = 1, subFiltersCount = subFilters.size(); subFilterIndex < subFiltersCount; subFilterIndex++) {<NEW_LINE>final IQueryFilter<T> subFilter = subFilters.get(subFilterIndex);<NEW_LINE>final QueryBuildContext<T> subQueryCtx = queryBuildCtx.deriveForSubFilter(new CompositeQueryFilter<T>(queryBuildCtx.getModelTableName()).addFilters(otherFilters).addFilter(subFilter));<NEW_LINE>final IQuery<T> unionQuery = create(subQueryCtx);<NEW_LINE>query.addUnion(unionQuery, /* distinct */<NEW_LINE>true);<NEW_LINE>}<NEW_LINE>return query;<NEW_LINE>} | > mainFilterAsComposite = queryBuildCtx.getMainFilterAsCompositeOrNull(); |
1,156,987 | public void cmp(AsmMemoryOperand dst, int imm) {<NEW_LINE>int code;<NEW_LINE>if (dst.size == MemoryOperandSize.QWORD) {<NEW_LINE>code = imm >= -0x80 && imm <= 0x7F <MASK><NEW_LINE>} else if (dst.size == MemoryOperandSize.DWORD) {<NEW_LINE>code = imm >= -0x80 && imm <= 0x7F ? Code.CMP_RM32_IMM8 : Code.CMP_RM32_IMM32;<NEW_LINE>} else if (dst.size == MemoryOperandSize.WORD) {<NEW_LINE>code = imm >= -0x80 && imm <= 0x7F ? Code.CMP_RM16_IMM8 : Code.CMP_RM16_IMM16;<NEW_LINE>} else if (dst.size == MemoryOperandSize.BYTE) {<NEW_LINE>code = Code.CMP_RM8_IMM8;<NEW_LINE>} else {<NEW_LINE>throw noOpCodeFoundFor(Mnemonic.CMP, dst, imm);<NEW_LINE>}<NEW_LINE>addInstruction(Instruction.create(code, dst.toMemoryOperand(getBitness()), imm));<NEW_LINE>} | ? Code.CMP_RM64_IMM8 : Code.CMP_RM64_IMM32; |
520,501 | public void init(final SortedKeyValueIterator<Key, Value> source, final Map<String, String> options, final IteratorEnvironment env) throws IOException {<NEW_LINE>super.<MASK><NEW_LINE>if (options.containsKey(AccumuloStoreConstants.INCOMING_EDGE_ONLY)) {<NEW_LINE>incomingEdges = true;<NEW_LINE>} else if (options.containsKey(AccumuloStoreConstants.OUTGOING_EDGE_ONLY)) {<NEW_LINE>outgoingEdges = true;<NEW_LINE>}<NEW_LINE>if (options.containsKey(AccumuloStoreConstants.DIRECTED_EDGE_ONLY)) {<NEW_LINE>directedEdges = true;<NEW_LINE>} else if (options.containsKey(AccumuloStoreConstants.UNDIRECTED_EDGE_ONLY)) {<NEW_LINE>unDirectedEdges = true;<NEW_LINE>}<NEW_LINE>if (options.containsKey(AccumuloStoreConstants.INCLUDE_ENTITIES)) {<NEW_LINE>entities = true;<NEW_LINE>}<NEW_LINE>if (options.containsKey(AccumuloStoreConstants.INCLUDE_EDGES)) {<NEW_LINE>edges = true;<NEW_LINE>}<NEW_LINE>if (options.containsKey(AccumuloStoreConstants.DEDUPLICATE_UNDIRECTED_EDGES)) {<NEW_LINE>deduplicateUndirectedEdges = true;<NEW_LINE>}<NEW_LINE>LOGGER.debug("Initialised ByteEntityRangeElementPropertyFilterIterator with " + "incomingEdges = {}, outgoingEdges = {}, " + "directedEdges = {}, unDirectedEdges = {}, " + "entities = {}, edges = {}, deduplicateUndirectedEdges = {}", incomingEdges, outgoingEdges, directedEdges, unDirectedEdges, entities, edges, deduplicateUndirectedEdges);<NEW_LINE>} | init(source, options, env); |
508,103 | public com.didiglobal.booster.aapt2.Resources.Value buildPartial() {<NEW_LINE>com.didiglobal.booster.aapt2.Resources.Value result = new com.didiglobal.booster.aapt2.Resources.Value(this);<NEW_LINE>if (sourceBuilder_ == null) {<NEW_LINE>result.source_ = source_;<NEW_LINE>} else {<NEW_LINE>result.source_ = sourceBuilder_.build();<NEW_LINE>}<NEW_LINE>result.comment_ = comment_;<NEW_LINE>result.weak_ = weak_;<NEW_LINE>if (valueCase_ == 4) {<NEW_LINE>if (itemBuilder_ == null) {<NEW_LINE>result.value_ = value_;<NEW_LINE>} else {<NEW_LINE>result<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (valueCase_ == 5) {<NEW_LINE>if (compoundValueBuilder_ == null) {<NEW_LINE>result.value_ = value_;<NEW_LINE>} else {<NEW_LINE>result.value_ = compoundValueBuilder_.build();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.valueCase_ = valueCase_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>} | .value_ = itemBuilder_.build(); |
698,447 | public Void run(EntityMappingsMetadata metadata) {<NEW_LINE><MASK><NEW_LINE>Object modelElement = ctx.getModelElement();<NEW_LINE>do {<NEW_LINE>if (JPAHelper.isAnyMemberAnnotatedAsIdOrEmbeddedId(modelElement)) {<NEW_LINE>haveId[0] = true;<NEW_LINE>// OK<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>TypeMirror parentType = javaClass.getSuperclass();<NEW_LINE>javaClass = null;<NEW_LINE>if (!"java.lang.Object".equals(parentType.toString())) {<NEW_LINE>// NOI18N<NEW_LINE>if (parentType.getKind() == TypeKind.DECLARED) {<NEW_LINE>Element parent = ((DeclaredType) parentType).asElement();<NEW_LINE>if (parent.getKind() == ElementKind.CLASS) {<NEW_LINE>javaClass = (TypeElement) parent;<NEW_LINE>modelElement = ModelUtils.getEntity(metadata, javaClass);<NEW_LINE>if (modelElement == null) {<NEW_LINE>modelElement = ModelUtils.getMappedSuperclass(metadata, javaClass);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} while (javaClass != null && modelElement != null);<NEW_LINE>return null;<NEW_LINE>} | TypeElement javaClass = ctx.getJavaClass(); |
917,407 | final UpdateApplicationVersionResult executeUpdateApplicationVersion(UpdateApplicationVersionRequest updateApplicationVersionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateApplicationVersionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateApplicationVersionRequest> request = null;<NEW_LINE>Response<UpdateApplicationVersionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateApplicationVersionRequestMarshaller().marshall(super.beforeMarshalling(updateApplicationVersionRequest));<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 Beanstalk");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateApplicationVersion");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<UpdateApplicationVersionResult> responseHandler = new StaxResponseHandler<UpdateApplicationVersionResult>(new UpdateApplicationVersionResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
242,654 | public boolean visit(JWhileStatement x, Context ctx) {<NEW_LINE>List<Exit> unlabeledExits = removeUnlabeledExits();<NEW_LINE>pushNode(new CfgStatementNode<JStatement>(parent, x));<NEW_LINE>int pos = nodes.size();<NEW_LINE>accept(x.getTestExpr());<NEW_LINE>CfgWhileNode node = addNode(new CfgWhileNode(parent, x));<NEW_LINE>addNormalExit(node, CfgConditionalNode.THEN);<NEW_LINE>if (x.getBody() != null) {<NEW_LINE>accept(x.getBody());<NEW_LINE>}<NEW_LINE>List<MASK><NEW_LINE>for (Exit e : thenExits) {<NEW_LINE>addEdge(e, nodes.get(pos));<NEW_LINE>}<NEW_LINE>String label = labels.get(x);<NEW_LINE>addContinueEdges(nodes.get(pos), label);<NEW_LINE>addBreakExits(label);<NEW_LINE>addNormalExit(node, CfgConditionalNode.ELSE);<NEW_LINE>popNode();<NEW_LINE>addExits(unlabeledExits);<NEW_LINE>return false;<NEW_LINE>} | <Exit> thenExits = removeNormalExits(); |
139,901 | public void marshall(AwsOpenSearchServiceDomainDetails awsOpenSearchServiceDomainDetails, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (awsOpenSearchServiceDomainDetails == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(awsOpenSearchServiceDomainDetails.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsOpenSearchServiceDomainDetails.getAccessPolicies(), ACCESSPOLICIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsOpenSearchServiceDomainDetails.getDomainName(), DOMAINNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsOpenSearchServiceDomainDetails.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsOpenSearchServiceDomainDetails.getDomainEndpoint(), DOMAINENDPOINT_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsOpenSearchServiceDomainDetails.getEngineVersion(), ENGINEVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsOpenSearchServiceDomainDetails.getEncryptionAtRestOptions(), ENCRYPTIONATRESTOPTIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsOpenSearchServiceDomainDetails.getNodeToNodeEncryptionOptions(), NODETONODEENCRYPTIONOPTIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(awsOpenSearchServiceDomainDetails.getClusterConfig(), CLUSTERCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsOpenSearchServiceDomainDetails.getDomainEndpointOptions(), DOMAINENDPOINTOPTIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsOpenSearchServiceDomainDetails.getVpcOptions(), VPCOPTIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsOpenSearchServiceDomainDetails.getLogPublishingOptions(), LOGPUBLISHINGOPTIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsOpenSearchServiceDomainDetails.getDomainEndpoints(), DOMAINENDPOINTS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | awsOpenSearchServiceDomainDetails.getServiceSoftwareOptions(), SERVICESOFTWAREOPTIONS_BINDING); |
1,800,854 | final UpdateInputSecurityGroupResult executeUpdateInputSecurityGroup(UpdateInputSecurityGroupRequest updateInputSecurityGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateInputSecurityGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateInputSecurityGroupRequest> request = null;<NEW_LINE>Response<UpdateInputSecurityGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateInputSecurityGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateInputSecurityGroupRequest));<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, "MediaLive");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateInputSecurityGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateInputSecurityGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateInputSecurityGroupResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
32,561 | protected void constructDom() {<NEW_LINE><MASK><NEW_LINE>addStyleName(CLASSNAME);<NEW_LINE>String treeItemId = DOM.createUniqueId();<NEW_LINE>getElement().setId(treeItemId);<NEW_LINE>Roles.getTreeitemRole().set(getElement());<NEW_LINE>Roles.getTreeitemRole().setAriaSelectedState(getElement(), SelectedValue.FALSE);<NEW_LINE>Roles.getTreeitemRole().setAriaLabelledbyProperty(getElement(), Id.of(labelId));<NEW_LINE>nodeCaptionDiv = DOM.createDiv();<NEW_LINE>DOM.setElementProperty(nodeCaptionDiv, "className", CLASSNAME + "-caption");<NEW_LINE>Element wrapper = DOM.createDiv();<NEW_LINE>wrapper.setId(labelId);<NEW_LINE>wrapper.setAttribute("for", treeItemId);<NEW_LINE>nodeCaptionSpan = DOM.createSpan();<NEW_LINE>DOM.appendChild(getElement(), nodeCaptionDiv);<NEW_LINE>DOM.appendChild(nodeCaptionDiv, wrapper);<NEW_LINE>DOM.appendChild(wrapper, nodeCaptionSpan);<NEW_LINE>if (BrowserInfo.get().isOpera()) {<NEW_LINE>nodeCaptionDiv.setTabIndex(-1);<NEW_LINE>}<NEW_LINE>childNodeContainer = new FlowPanel();<NEW_LINE>childNodeContainer.setStyleName(CLASSNAME + "-children");<NEW_LINE>Roles.getGroupRole().set(childNodeContainer.getElement());<NEW_LINE>setWidget(childNodeContainer);<NEW_LINE>} | String labelId = DOM.createUniqueId(); |
1,147,514 | public AuthServiceResult authenticate(AuthServiceCredentials authCredentials) {<NEW_LINE>final Optional<AuthServiceBackend> activeBackend = authServiceConfig.getActiveBackend();<NEW_LINE>if (activeBackend.isPresent()) {<NEW_LINE>AuthenticationServiceUnavailableException caughtException = null;<NEW_LINE>try {<NEW_LINE>final AuthServiceResult result = authenticate(<MASK><NEW_LINE>if (result.isSuccess()) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} catch (AuthenticationServiceUnavailableException e) {<NEW_LINE>caughtException = e;<NEW_LINE>}<NEW_LINE>// TODO: Do we want the fallback to the default backend here? Maybe it should be configurable?<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>final AuthServiceBackend defaultBackend = authServiceConfig.getDefaultBackend();<NEW_LINE>LOG.debug("Couldn't authenticate <{}> against active authentication service <{}/{}/{}>. Trying default backend <{}/{}/{}>.", authCredentials.username(), activeBackend.get().backendId(), activeBackend.get().backendType(), activeBackend.get().backendTitle(), defaultBackend.backendId(), defaultBackend.backendType(), defaultBackend.backendTitle());<NEW_LINE>}<NEW_LINE>final AuthServiceResult result = authenticate(authCredentials, authServiceConfig.getDefaultBackend());<NEW_LINE>if (result.isSuccess()) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>if (caughtException != null) {<NEW_LINE>throw caughtException;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} else {<NEW_LINE>return authenticate(authCredentials, authServiceConfig.getDefaultBackend());<NEW_LINE>}<NEW_LINE>} | authCredentials, activeBackend.get()); |
1,125,974 | public AviatorObject call(final Map<String, Object> env, final AviatorObject arg1, final AviatorObject arg2, final AviatorObject arg3, final AviatorObject arg4, final AviatorObject arg5, final AviatorObject arg6, final AviatorObject arg7, final AviatorObject arg8, final AviatorObject arg9, final AviatorObject arg10, final AviatorObject arg11, final AviatorObject arg12, final AviatorObject arg13, final AviatorObject arg14, final AviatorObject arg15, final AviatorObject arg16) {<NEW_LINE>traceArgs(env, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, <MASK><NEW_LINE>AviatorObject ret = this.rawFunc.call(env, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16);<NEW_LINE>traceResult(env, ret);<NEW_LINE>return ret;<NEW_LINE>} | arg13, arg14, arg15, arg16); |
596,070 | public SDVariable defineLayer(SameDiff sameDiff, SDVariable layerInput, Map<String, SDVariable> paramTable, SDVariable mask) {<NEW_LINE>final val W = paramTable.get(WEIGHT_KEY);<NEW_LINE>final val R = paramTable.get(RECURRENT_WEIGHT_KEY);<NEW_LINE>final val b = paramTable.get(BIAS_KEY);<NEW_LINE>long[] shape = layerInput.getShape();<NEW_LINE>Preconditions.checkState(shape != null, "Null shape for input placeholder");<NEW_LINE>SDVariable[] inputSlices = sameDiff.unstack(layerInput, 2, (int) shape[2]);<NEW_LINE>this.timeSteps = inputSlices.length;<NEW_LINE>SDVariable[] outputSlices = new SDVariable[timeSteps];<NEW_LINE>SDVariable prev = null;<NEW_LINE>for (int i = 0; i < timeSteps; i++) {<NEW_LINE>final val x_i = inputSlices[i];<NEW_LINE>outputSlices[i] = x_i.mmul(W);<NEW_LINE>if (hasBias) {<NEW_LINE>outputSlices[i] = outputSlices[i].add(b);<NEW_LINE>}<NEW_LINE>if (prev != null) {<NEW_LINE>SDVariable attn;<NEW_LINE>if (projectInput) {<NEW_LINE>val Wq = paramTable.get(WEIGHT_KEY_QUERY_PROJECTION);<NEW_LINE>val Wk = paramTable.get(WEIGHT_KEY_KEY_PROJECTION);<NEW_LINE>val Wv = paramTable.get(WEIGHT_KEY_VALUE_PROJECTION);<NEW_LINE>val Wo = paramTable.get(WEIGHT_KEY_OUT_PROJECTION);<NEW_LINE>attn = sameDiff.nn.multiHeadDotProductAttention(getLayerName() + "_attention_" + i, prev, layerInput, layerInput, Wq, Wk, Wv, Wo, mask, true);<NEW_LINE>} else {<NEW_LINE>attn = sameDiff.nn.dotProductAttention(getLayerName() + "_attention_" + i, prev, layerInput, layerInput, mask, true);<NEW_LINE>}<NEW_LINE>attn = sameDiff.squeeze(attn, 2);<NEW_LINE>outputSlices[i] = outputSlices[i].add(attn.mmul(R));<NEW_LINE>}<NEW_LINE>outputSlices[i] = activation.asSameDiff(sameDiff, outputSlices[i]);<NEW_LINE>outputSlices[i] = sameDiff.expandDims<MASK><NEW_LINE>prev = outputSlices[i];<NEW_LINE>}<NEW_LINE>return sameDiff.concat(2, outputSlices);<NEW_LINE>} | (outputSlices[i], 2); |
1,416,634 | public void deleteNode(String userName, AbstractAppConnNode node) throws ExternalOperationFailedException {<NEW_LINE>NodeInfo nodeInfo = nodeInfoMapper.getWorkflowNodeByType(node.getNodeType());<NEW_LINE>AppConn appConn = AppConnManager.getAppConnManager().getAppConn(nodeInfo.getAppConnName());<NEW_LINE>DevelopmentIntegrationStandard developmentIntegrationStandard = ((OnlyDevelopmentAppConn) appConn).getOrCreateDevelopmentStandard();<NEW_LINE>if (null != developmentIntegrationStandard) {<NEW_LINE>String label = node.getJobContent().get(DSSCommonUtils.DSS_LABELS_KEY).toString();<NEW_LINE>AppInstance appInstance = getAppInstance(appConn, label);<NEW_LINE>RefDeletionOperation refDeletionOperation = developmentIntegrationStandard.<MASK><NEW_LINE>Workspace workspace = (Workspace) node.getJobContent().get("workspace");<NEW_LINE>NodeRequestRef ref = null;<NEW_LINE>try {<NEW_LINE>ref = AppConnRefFactoryUtils.newAppConnRefByPackageName(NodeRequestRef.class, appConn.getClass().getClassLoader(), appConn.getClass().getPackage().getName());<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Failed to create DeleteNodeRequestRef", e);<NEW_LINE>}<NEW_LINE>ref.setUserName(userName);<NEW_LINE>ref.setWorkspace(workspace);<NEW_LINE>ref.setJobContent(node.getJobContent());<NEW_LINE>ref.setName(node.getName());<NEW_LINE>ref.setOrcId(node.getFlowId());<NEW_LINE>ref.setOrcName(node.getFlowName());<NEW_LINE>ref.setProjectId(node.getProjectId());<NEW_LINE>ref.setProjectName(node.getProjectName());<NEW_LINE>ref.setNodeType(node.getNodeType());<NEW_LINE>refDeletionOperation.deleteRef(ref);<NEW_LINE>}<NEW_LINE>} | getRefCRUDService(appInstance).getRefDeletionOperation(); |
723,215 | final RotateIngestEndpointCredentialsResult executeRotateIngestEndpointCredentials(RotateIngestEndpointCredentialsRequest rotateIngestEndpointCredentialsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(rotateIngestEndpointCredentialsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RotateIngestEndpointCredentialsRequest> request = null;<NEW_LINE>Response<RotateIngestEndpointCredentialsResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new RotateIngestEndpointCredentialsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(rotateIngestEndpointCredentialsRequest));<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, "MediaPackage");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RotateIngestEndpointCredentials");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<RotateIngestEndpointCredentialsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RotateIngestEndpointCredentialsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
1,670,417 | public SchemaInfo parse(InputSource in) {<NEW_LINE>// NOI18N<NEW_LINE>Util.THIS.debug("SchemaParser started.");<NEW_LINE>try {<NEW_LINE>depth = 0;<NEW_LINE>XMLReader parser = XMLUtil.createXMLReader(false, true);<NEW_LINE>parser.setContentHandler(this);<NEW_LINE>parser.setErrorHandler(this);<NEW_LINE><MASK><NEW_LINE>EntityResolver res = (catalog == null ? null : catalog.getEntityResolver());<NEW_LINE>if (res != null)<NEW_LINE>parser.setEntityResolver(res);<NEW_LINE>parser.parse(in);<NEW_LINE>return info;<NEW_LINE>} catch (SAXException ex) {<NEW_LINE>// NOI18N<NEW_LINE>Util.THIS.debug("Ignoring ex. thrown while looking for Schema roots:", ex);<NEW_LINE>if (ex.getException() instanceof RuntimeException) {<NEW_LINE>// NOI18N<NEW_LINE>Util.THIS.debug("Nested exception:", ex.getException());<NEW_LINE>}<NEW_LINE>// better partial result than nothing<NEW_LINE>return info;<NEW_LINE>} catch (IOException ex) {<NEW_LINE>// NOI18N<NEW_LINE>Util.THIS.debug("Ignoring ex. thrown while looking for Schema roots:", ex);<NEW_LINE>// better partial result than nothing<NEW_LINE>return info;<NEW_LINE>} finally {<NEW_LINE>// NOI18N<NEW_LINE>Util.THIS.debug("SchemaParser stopped.");<NEW_LINE>}<NEW_LINE>} | UserCatalog catalog = UserCatalog.getDefault(); |
1,310,195 | public CodegenExpression codegen(EnumForgeCodegenParams premade, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) {<NEW_LINE>CodegenExpressionField indexTypeMember = codegenClassScope.addFieldUnshared(true, ObjectArrayEventType.EPTYPE, cast(ObjectArrayEventType.EPTYPE, EventTypeUtility.resolveTypeCodegen(fieldEventType, EPStatementInitServices.REF)));<NEW_LINE>ExprForgeCodegenSymbol scope = new ExprForgeCodegenSymbol(false, null);<NEW_LINE>CodegenMethod methodNode = codegenMethodScope.makeChildWithScope(returnTypeOfMethod(), getClass(), scope, codegenClassScope<MASK><NEW_LINE>CodegenBlock block = methodNode.getBlock();<NEW_LINE>CodegenExpression returnEmpty = returnIfEmptyOptional();<NEW_LINE>if (returnEmpty != null) {<NEW_LINE>block.ifCondition(exprDotMethod(EnumForgeCodegenNames.REF_ENUMCOLL, "isEmpty")).blockReturn(returnEmpty);<NEW_LINE>}<NEW_LINE>block.declareVar(ObjectArrayEventBean.EPTYPE, "indexEvent", newInstance(ObjectArrayEventBean.EPTYPE, newArrayByLength(EPTypePremade.OBJECT.getEPType(), constant(numParameters - 1)), indexTypeMember)).assignArrayElement(EnumForgeCodegenNames.REF_EPS, constant(getStreamNumLambda() + 1), ref("indexEvent")).declareVar(EPTypePremade.OBJECTARRAY.getEPType(), "props", exprDotMethod(ref("indexEvent"), "getProperties"));<NEW_LINE>block.declareVar(EPTypePremade.INTEGERPRIMITIVE.getEPType(), "count", constant(-1));<NEW_LINE>if (numParameters == 3) {<NEW_LINE>block.assignArrayElement(ref("props"), constant(1), exprDotMethod(REF_ENUMCOLL, "size"));<NEW_LINE>}<NEW_LINE>initBlock(block, methodNode, scope, codegenClassScope);<NEW_LINE>if (hasForEachLoop()) {<NEW_LINE>CodegenBlock forEach = block.forEach(EventBean.EPTYPE, "next", EnumForgeCodegenNames.REF_ENUMCOLL).incrementRef("count").assignArrayElement("props", constant(0), ref("count")).assignArrayElement(EnumForgeCodegenNames.REF_EPS, constant(getStreamNumLambda()), ref("next"));<NEW_LINE>forEachBlock(forEach, methodNode, scope, codegenClassScope);<NEW_LINE>}<NEW_LINE>returnResult(block);<NEW_LINE>return localMethod(methodNode, premade.getEps(), premade.getEnumcoll(), premade.getIsNewData(), premade.getExprCtx());<NEW_LINE>} | ).addParam(EnumForgeCodegenNames.PARAMSCOLLBEAN); |
772,530 | public void saveSettings(DBPDataSourceContainer dataSource) {<NEW_LINE>DBPConnectionConfiguration connectionInfo = dataSource.getConnectionConfiguration();<NEW_LINE>connectionInfo.setProviderProperty(PROV_PROP_EDITION, edition.name());<NEW_LINE>if (created) {<NEW_LINE>connectionInfo.setHostName(hostText.getText().trim());<NEW_LINE>connectionInfo.setHostPort(portText.getText().trim());<NEW_LINE>if (edition != HANAEdition.GENERIC) {<NEW_LINE>instanceValue = instanceText.getText().trim();<NEW_LINE>if (instanceValue.isEmpty()) {<NEW_LINE>connectionInfo.removeProviderProperty(PROV_PROP_INSTANCE_NUMBER);<NEW_LINE>} else {<NEW_LINE>connectionInfo.setProviderProperty(PROV_PROP_INSTANCE_NUMBER, instanceValue);<NEW_LINE>}<NEW_LINE>databaseValue = databaseText<MASK><NEW_LINE>if (databaseValue.isEmpty()) {<NEW_LINE>removeProperty(connectionInfo, PROP_DATABASE_NAME);<NEW_LINE>} else {<NEW_LINE>setProperty(connectionInfo, PROP_DATABASE_NAME, databaseValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>super.saveSettings(dataSource);<NEW_LINE>} | .getText().trim(); |
1,232,343 | public void marshall(JobTemplateSettings jobTemplateSettings, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (jobTemplateSettings == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(jobTemplateSettings.getAdAvailOffset(), ADAVAILOFFSET_BINDING);<NEW_LINE>protocolMarshaller.marshall(jobTemplateSettings.getAvailBlanking(), AVAILBLANKING_BINDING);<NEW_LINE>protocolMarshaller.marshall(jobTemplateSettings.getEsam(), ESAM_BINDING);<NEW_LINE>protocolMarshaller.marshall(jobTemplateSettings.getExtendedDataServices(), EXTENDEDDATASERVICES_BINDING);<NEW_LINE>protocolMarshaller.marshall(jobTemplateSettings.getInputs(), INPUTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(jobTemplateSettings.getKantarWatermark(), KANTARWATERMARK_BINDING);<NEW_LINE>protocolMarshaller.marshall(jobTemplateSettings.getMotionImageInserter(), MOTIONIMAGEINSERTER_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(jobTemplateSettings.getNielsenNonLinearWatermark(), NIELSENNONLINEARWATERMARK_BINDING);<NEW_LINE>protocolMarshaller.marshall(jobTemplateSettings.getOutputGroups(), OUTPUTGROUPS_BINDING);<NEW_LINE>protocolMarshaller.marshall(jobTemplateSettings.getTimecodeConfig(), TIMECODECONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(jobTemplateSettings.getTimedMetadataInsertion(), TIMEDMETADATAINSERTION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | jobTemplateSettings.getNielsenConfiguration(), NIELSENCONFIGURATION_BINDING); |
1,557,885 | private List<BitcoindeAccountLedger> checkForAndQueryAdditionalFees(final List<BitcoindeAccountLedger> ledgers, final Currency currency, final BitcoindeAccountLedgerType customType, final Date start, final Date end, final Integer page) throws IOException {<NEW_LINE>if (customType != null && BitcoindeAccountLedgerType.PAYOUT != customType && BitcoindeAccountLedgerType.ALL != customType) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>// If only PAYOUTs were requested, this get the same "page" of OUTGOING_FEE_VOLUNTARYs<NEW_LINE>if (BitcoindeAccountLedgerType.PAYOUT == customType) {<NEW_LINE>return getAccountLedger(currency, BitcoindeAccountLedgerType.OUTGOING_FEE_VOLUNTARY, start, end, page).getAccountLedgers();<NEW_LINE>}<NEW_LINE>int feeCount = 0;<NEW_LINE>for (int i = ledgers.size() - 1; i >= 0; i--) {<NEW_LINE>if (BitcoindeAccountLedgerType.OUTGOING_FEE_VOLUNTARY == ledgers.get(i).getType()) {<NEW_LINE>feeCount++;<NEW_LINE>} else if (BitcoindeAccountLedgerType.PAYOUT == ledgers.get(i).getType()) {<NEW_LINE>feeCount--;<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (feeCount < 0) {<NEW_LINE>List<BitcoindeAccountLedger> feeLedgers = new ArrayList<>();<NEW_LINE>List<BitcoindeAccountLedger> feeResult = getAccountLedger(currency, customType, start, end, <MASK><NEW_LINE>for (BitcoindeAccountLedger ledger : feeResult) {<NEW_LINE>if (BitcoindeAccountLedgerType.OUTGOING_FEE_VOLUNTARY == ledger.getType()) {<NEW_LINE>feeLedgers.add(ledger);<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return feeLedgers;<NEW_LINE>}<NEW_LINE>return Collections.emptyList();<NEW_LINE>} | page + 1).getAccountLedgers(); |
641,280 | final ListRecordingConfigurationsResult executeListRecordingConfigurations(ListRecordingConfigurationsRequest listRecordingConfigurationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listRecordingConfigurationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListRecordingConfigurationsRequest> request = null;<NEW_LINE>Response<ListRecordingConfigurationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListRecordingConfigurationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listRecordingConfigurationsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListRecordingConfigurations");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListRecordingConfigurationsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListRecordingConfigurationsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.SERVICE_ID, "ivs"); |
1,467,041 | @Path("/instances/{role}")<NEW_LINE>@ApiOperation(value = "Start a Pinot instance")<NEW_LINE>@ApiResponses(value = { @ApiResponse(code = 200, message = "Pinot instance is started"), @ApiResponse(code = 400, message = "Bad Request"), @ApiResponse(code = 404, message = "Pinot Role Not Found"), @ApiResponse(code = 500, message = "Internal Server Error") })<NEW_LINE>public PinotInstanceStatus startPinotInstance(@ApiParam(value = "A Role of Pinot Instance to start: CONTROLLER/BROKER/SERVER/MINION") @PathParam("role") String role, @ApiParam(value = "true|false") @QueryParam("autoMode") boolean autoMode, String confStr) {<NEW_LINE>ServiceRole serviceRole;<NEW_LINE>try {<NEW_LINE>serviceRole = ServiceRole.valueOf(role.toUpperCase());<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new WebApplicationException("Unrecognized Role: " + role, Response.Status.NOT_FOUND);<NEW_LINE>}<NEW_LINE>Map<String, Object> properties = new HashMap<>();<NEW_LINE>try {<NEW_LINE>properties = CommonsConfigurationUtils.toMap(JsonUtils.stringToObject(confStr, Configuration.class));<NEW_LINE>} catch (IOException e) {<NEW_LINE>if (!autoMode) {<NEW_LINE>throw new WebApplicationException("Unable to deserialize Conf String to Configuration Object", Response.Status.BAD_REQUEST);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (autoMode) {<NEW_LINE>updateConfiguration(serviceRole, properties);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String instanceName = _pinotServiceManager.startRole(serviceRole, properties);<NEW_LINE>if (instanceName != null) {<NEW_LINE>LOGGER.info("Successfully started Pinot [{}] instance [{}]", serviceRole, instanceName);<NEW_LINE>return _pinotServiceManager.getInstanceStatus(instanceName);<NEW_LINE>}<NEW_LINE>throw new WebApplicationException(String.format("Unable to start a Pinot [%s]", serviceRole<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("Caught exception while processing POST request", e);<NEW_LINE>throw new WebApplicationException(e, Response.Status.INTERNAL_SERVER_ERROR);<NEW_LINE>}<NEW_LINE>} | ), Response.Status.INTERNAL_SERVER_ERROR); |
414,362 | private void verifyChangeLog(SchemaChangeLog schemaChangeLog, ChangeSet changeSet, int expectedOrder) {<NEW_LINE>String changeSetId = changeSet.getId();<NEW_LINE>String schemaChangeLogId = schemaChangeLog.getId();<NEW_LINE>if (!changeSetId.equals(schemaChangeLogId)) {<NEW_LINE>throw new IllegalArgumentException("Unexpected schema change log id, expected : " + changeSetId + " , was : " + schemaChangeLogId);<NEW_LINE>}<NEW_LINE>CheckSum actualCheckSum = schemaChangeLog.getCheckSum();<NEW_LINE>CheckSum expectedCheckSum = CheckSum.compute(actualCheckSum.getVersion(<MASK><NEW_LINE>if (!expectedCheckSum.equals(actualCheckSum)) {<NEW_LINE>throw new IllegalArgumentException("Unexpected schema change log check sum for : " + schemaChangeLogId);<NEW_LINE>}<NEW_LINE>int actualOrder = schemaChangeLog.getExecOrder();<NEW_LINE>if (expectedOrder != actualOrder) {<NEW_LINE>throw new IllegalArgumentException("Unexpected schema change log execution order for " + schemaChangeLogId + ", expected : " + expectedOrder + ", was : " + actualOrder);<NEW_LINE>}<NEW_LINE>} | ), changeSet.getValue()); |
710,980 | private void doProcessFile(boolean remap) {<NEW_LINE>try {<NEW_LINE>importer.processFile(remap);<NEW_LINE>tableViewer.getTable().setRedraw(false);<NEW_LINE>for (TableColumn column : tableViewer.getTable().getColumns<MASK><NEW_LINE>TableColumnLayout layout = (TableColumnLayout) tableViewer.getTable().getParent().getLayout();<NEW_LINE>for (Column column : importer.getColumns()) {<NEW_LINE>TableColumn tableColumn = new TableColumn(tableViewer.getTable(), SWT.None);<NEW_LINE>layout.setColumnData(tableColumn, new ColumnPixelData(80, true));<NEW_LINE>setColumnLabel(tableColumn, column);<NEW_LINE>}<NEW_LINE>List<Object> input = new ArrayList<>();<NEW_LINE>input.add(importer);<NEW_LINE>input.addAll(importer.getRawValues());<NEW_LINE>tableViewer.setInput(input);<NEW_LINE>tableViewer.refresh();<NEW_LINE>tableViewer.getTable().pack();<NEW_LINE>TableColumn[] columns = tableViewer.getTable().getColumns();<NEW_LINE>for (TableColumn column : columns) column.pack();<NEW_LINE>// see #1723 and #1536: under Linux, the first column is extended to<NEW_LINE>// the full size of the table. Re-packing it after all other columns<NEW_LINE>// have been packed resolves this.<NEW_LINE>if (Platform.getWS().equals(Platform.WS_GTK) && columns.length > 0)<NEW_LINE>tableViewer.getTable().getColumns()[0].pack();<NEW_LINE>doUpdateErrorMessages();<NEW_LINE>} catch (IOException e) {<NEW_LINE>PortfolioPlugin.log(e);<NEW_LINE>ErrorDialog.openError(getShell(), Messages.LabelError, e.getMessage(), new Status(Status.ERROR, PortfolioPlugin.PLUGIN_ID, e.getMessage(), e));<NEW_LINE>} finally {<NEW_LINE>tableViewer.getTable().setRedraw(true);<NEW_LINE>}<NEW_LINE>} | ()) column.dispose(); |
1,477,915 | public void marshall(CreateTriggerRequest createTriggerRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createTriggerRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createTriggerRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTriggerRequest.getWorkflowName(), WORKFLOWNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createTriggerRequest.getSchedule(), SCHEDULE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTriggerRequest.getPredicate(), PREDICATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTriggerRequest.getActions(), ACTIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTriggerRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTriggerRequest.getStartOnCreation(), STARTONCREATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTriggerRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTriggerRequest.getEventBatchingCondition(), EVENTBATCHINGCONDITION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | createTriggerRequest.getType(), TYPE_BINDING); |
1,256,001 | // Convert items into XML to pass back to the view.<NEW_LINE>private Document toXml(List<BucketItem> itemList) {<NEW_LINE>try {<NEW_LINE>DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();<NEW_LINE>DocumentBuilder builder = factory.newDocumentBuilder();<NEW_LINE><MASK><NEW_LINE>// Start building the XML.<NEW_LINE>Element root = doc.createElement("Items");<NEW_LINE>doc.appendChild(root);<NEW_LINE>// Get the elements from the collection.<NEW_LINE>int custCount = itemList.size();<NEW_LINE>// Iterate through the collection.<NEW_LINE>for (int index = 0; index < custCount; index++) {<NEW_LINE>// Get the WorkItem object from the collection.<NEW_LINE>BucketItem myItem = itemList.get(index);<NEW_LINE>Element item = doc.createElement("Item");<NEW_LINE>root.appendChild(item);<NEW_LINE>// Set Key.<NEW_LINE>Element id = doc.createElement("Key");<NEW_LINE>id.appendChild(doc.createTextNode(myItem.getKey()));<NEW_LINE>item.appendChild(id);<NEW_LINE>// Set Owner.<NEW_LINE>Element name = doc.createElement("Owner");<NEW_LINE>name.appendChild(doc.createTextNode(myItem.getOwner()));<NEW_LINE>item.appendChild(name);<NEW_LINE>// Set Date.<NEW_LINE>Element date = doc.createElement("Date");<NEW_LINE>date.appendChild(doc.createTextNode(myItem.getDate()));<NEW_LINE>item.appendChild(date);<NEW_LINE>// Set Size.<NEW_LINE>Element desc = doc.createElement("Size");<NEW_LINE>desc.appendChild(doc.createTextNode(myItem.getSize()));<NEW_LINE>item.appendChild(desc);<NEW_LINE>}<NEW_LINE>return doc;<NEW_LINE>} catch (ParserConfigurationException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | Document doc = builder.newDocument(); |
1,850,852 | public void load() {<NEW_LINE>TcpProxy tcp = TcpProxy.getTcpProxy(serverId);<NEW_LINE>MapPack out = null;<NEW_LINE>try {<NEW_LINE>MapPack param = new MapPack();<NEW_LINE>param.put("date", date);<NEW_LINE>param.put("objHash", objHash);<NEW_LINE>param.put("objType", objType);<NEW_LINE>param.put("counter", counter);<NEW_LINE>out = (MapPack) tcp.getSingle(RequestCmd.COUNTER_PAST_DATE, param);<NEW_LINE>if (out == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>ConsoleProxy.errorSafe(t.toString());<NEW_LINE>} finally {<NEW_LINE>TcpProxy.putTcpProxy(tcp);<NEW_LINE>}<NEW_LINE>final ListValue time = out.getList("time");<NEW_LINE>final ListValue value = out.getList("value");<NEW_LINE>ExUtil.exec(this.canvas, new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>provider.clearTrace();<NEW_LINE>for (int i = 0; time != null && i < time.size(); i++) {<NEW_LINE>long tm = CastUtil.clong((time.get(i)));<NEW_LINE>double va = CastUtil.clong(value.get(i));<NEW_LINE>provider.addSample(new Sample(tm, va));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>long stime = DateUtil.getTime(date, "yyyyMMdd");<NEW_LINE><MASK><NEW_LINE>xyGraph.primaryXAxis.setRange(stime, etime);<NEW_LINE>} catch (Exception e) {<NEW_LINE>ConsoleProxy.error(e.toString());<NEW_LINE>}<NEW_LINE>if (CounterUtil.isPercentValue(objType, counter)) {<NEW_LINE>xyGraph.primaryYAxis.setRange(0, 100);<NEW_LINE>} else {<NEW_LINE>xyGraph.primaryYAxis.setRange(0, ChartUtil.getMax(provider.iterator()));<NEW_LINE>}<NEW_LINE>canvas.redraw();<NEW_LINE>xyGraph.repaint();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | long etime = stime + DateUtil.MILLIS_PER_DAY; |
880,585 | public List<MeasureSlot> buildSlots() {<NEW_LINE>final List<MeasureSlot> slots = new ArrayList<>();<NEW_LINE>final int chordCount = candidateChords.size();<NEW_LINE>int slotCount = 0;<NEW_LINE>int iStart = 0;<NEW_LINE>NextSlot: while (iStart < chordCount) {<NEW_LINE>for (int i = iStart + 1; i < chordCount; i++) {<NEW_LINE>AbstractChordInter c2 = candidateChords.get(i);<NEW_LINE>// Make sure c2 is compatible with ALL slot chords so far<NEW_LINE>for (AbstractChordInter c1 : candidateChords.subList(iStart, i)) {<NEW_LINE>Rel <MASK><NEW_LINE>if ((rel != Rel.EQUAL) && (rel != Rel.CLOSE)) {<NEW_LINE>// New slot starting here, register previous one<NEW_LINE>MeasureSlot slot = new MeasureSlot(++slotCount, measure, candidateChords.subList(iStart, i));<NEW_LINE>slots.add(slot);<NEW_LINE>iStart = i;<NEW_LINE>continue NextSlot;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Register last slot<NEW_LINE>MeasureSlot slot = new MeasureSlot(++slotCount, measure, candidateChords.subList(iStart, chordCount));<NEW_LINE>slots.add(slot);<NEW_LINE>iStart = chordCount;<NEW_LINE>}<NEW_LINE>return slots;<NEW_LINE>} | rel = getRel(c1, c2); |
230,585 | final GetSessionResult executeGetSession(GetSessionRequest getSessionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getSessionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetSessionRequest> request = null;<NEW_LINE>Response<GetSessionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetSessionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getSessionRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Lex Runtime Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetSession");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetSessionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetSessionResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
233,118 | public FieldVariable save(final FieldVariable var, final User user) throws DotDataException, DotSecurityException {<NEW_LINE>ContentTypeAPI contentTypeAPI = APILocator.getContentTypeAPI(user);<NEW_LINE>Field field = fieldFactory.<MASK><NEW_LINE>ContentType type = contentTypeAPI.find(field.contentTypeId());<NEW_LINE>APILocator.getPermissionAPI().checkPermission(type, PermissionLevel.EDIT_PERMISSIONS, user);<NEW_LINE>FieldVariable newFieldVariable = fieldFactory.save(ImmutableFieldVariable.builder().from(var).userId(user.getUserId()).build());<NEW_LINE>// update Content Type mod_date to detect the changes done on the field variables<NEW_LINE>contentTypeAPI.updateModDate(type);<NEW_LINE>// Validates custom mapping format<NEW_LINE>if (var.key().equals(FieldVariable.ES_CUSTOM_MAPPING_KEY)) {<NEW_LINE>try {<NEW_LINE>new JSONObject(var.value());<NEW_LINE>} catch (JSONException e) {<NEW_LINE>handleInvalidCustomMappingError(var, user, field, type, e);<NEW_LINE>}<NEW_LINE>// Verifies the field is marked as System Indexed. In case it isn't, the field will be updated with this flag on<NEW_LINE>if (!field.indexed()) {<NEW_LINE>save(FieldBuilder.builder(field).indexed(true).build(), user);<NEW_LINE>Logger.info(this, "Field " + type.variable() + "." + field.variable() + " has been marked as System Indexed as it has defined a field variable with key " + FieldVariable.ES_CUSTOM_MAPPING_KEY);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newFieldVariable;<NEW_LINE>} | byId(var.fieldId()); |
1,113,962 | final DeleteSizeConstraintSetResult executeDeleteSizeConstraintSet(DeleteSizeConstraintSetRequest deleteSizeConstraintSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteSizeConstraintSetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DeleteSizeConstraintSetRequest> request = null;<NEW_LINE>Response<DeleteSizeConstraintSetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteSizeConstraintSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteSizeConstraintSetRequest));<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, "WAF Regional");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteSizeConstraintSet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteSizeConstraintSetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteSizeConstraintSetResultJsonUnmarshaller());<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); |
494,981 | private final static <T> void populateFromItemsSketch(final int k, final long n, final long bitPattern, final T[] combinedBuffer, final int baseBufferCount, final int numSamples, final T[] itemsArr, final long[] cumWtsArr, final Comparator<? super T> comparator) {<NEW_LINE>long weight = 1;<NEW_LINE>int nxt = 0;<NEW_LINE>long bits = bitPattern;<NEW_LINE>// internal consistency check<NEW_LINE>assert bits == (n / (2L * k));<NEW_LINE>for (int lvl = 0; bits != 0L; lvl++, bits >>>= 1) {<NEW_LINE>weight *= 2;<NEW_LINE>if ((bits & 1L) > 0L) {<NEW_LINE>final int offset = (2 + lvl) * k;<NEW_LINE>for (int i = 0; i < k; i++) {<NEW_LINE>itemsArr[nxt] = combinedBuffer[i + offset];<NEW_LINE>cumWtsArr[nxt] = weight;<NEW_LINE>nxt++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// NOT a mistake! We just copied the highest level; now we need to copy the base buffer<NEW_LINE>weight = 1;<NEW_LINE>final int startOfBaseBufferBlock = nxt;<NEW_LINE>// Copy BaseBuffer over, along with weight = 1<NEW_LINE>for (int i = 0; i < baseBufferCount; i++) {<NEW_LINE>itemsArr<MASK><NEW_LINE>cumWtsArr[nxt] = weight;<NEW_LINE>nxt++;<NEW_LINE>}<NEW_LINE>assert nxt == numSamples;<NEW_LINE>// Must sort the items that came from the base buffer.<NEW_LINE>// Don't need to sort the corresponding weights because they are all the same.<NEW_LINE>Arrays.sort(itemsArr, startOfBaseBufferBlock, numSamples, comparator);<NEW_LINE>cumWtsArr[numSamples] = 0;<NEW_LINE>} | [nxt] = combinedBuffer[i]; |
1,640,001 | private void allocateMemory() {<NEW_LINE>_snappyCompressedStringOutput = ByteBuffer.allocateDirect(_uncompressedString.capacity() * 2);<NEW_LINE>_zstandardCompressedStringOutput = ByteBuffer.allocateDirect(_uncompressedString.capacity() * 2);<NEW_LINE>_snappyStringDecompressed = ByteBuffer.allocateDirect(_uncompressedString.capacity() * 2);<NEW_LINE>_zstandardStringDecompressed = ByteBuffer.allocateDirect(<MASK><NEW_LINE>_snappyCompressedStringInput = ByteBuffer.allocateDirect(_uncompressedString.capacity() * 2);<NEW_LINE>_zstandardCompressedStringInput = ByteBuffer.allocateDirect(_uncompressedString.capacity() * 2);<NEW_LINE>_lz4StringDecompressed = ByteBuffer.allocateDirect(_uncompressedString.capacity() * 2);<NEW_LINE>_lz4CompressedStringOutput = ByteBuffer.allocateDirect(_uncompressedString.capacity() * 2);<NEW_LINE>_lz4CompressedStringInput = ByteBuffer.allocateDirect(_uncompressedString.capacity() * 2);<NEW_LINE>} | _uncompressedString.capacity() * 2); |
216,040 | @RequestMapping(value = "/device/credentials", method = RequestMethod.POST)<NEW_LINE>@ResponseBody<NEW_LINE>public DeviceCredentials updateDeviceCredentials(@ApiParam(value = "A JSON value representing the device credentials.") @RequestBody DeviceCredentials deviceCredentials) throws ThingsboardException {<NEW_LINE>checkNotNull(deviceCredentials);<NEW_LINE>try {<NEW_LINE>Device device = checkDeviceId(deviceCredentials.getDeviceId(), Operation.WRITE_CREDENTIALS);<NEW_LINE>DeviceCredentials result = checkNotNull(deviceCredentialsService.updateDeviceCredentials(getCurrentUser().getTenantId(), deviceCredentials));<NEW_LINE>tbClusterService.pushMsgToCore(new DeviceCredentialsUpdateNotificationMsg(getCurrentUser().getTenantId(), deviceCredentials.getDeviceId(), result), null);<NEW_LINE>sendEntityNotificationMsg(getTenantId(), device.getId(), EdgeEventActionType.CREDENTIALS_UPDATED);<NEW_LINE>logEntityAction(device.getId(), device, device.getCustomerId(), ActionType.CREDENTIALS_UPDATED, null, deviceCredentials);<NEW_LINE>return result;<NEW_LINE>} catch (Exception e) {<NEW_LINE>logEntityAction(emptyId(EntityType.DEVICE), null, null, <MASK><NEW_LINE>throw handleException(e);<NEW_LINE>}<NEW_LINE>} | ActionType.CREDENTIALS_UPDATED, e, deviceCredentials); |
349,035 | public Dimension render(Graphics2D g) {<NEW_LINE>Widget w = inspector.getSelectedWidget();<NEW_LINE>if (w != null) {<NEW_LINE>Object wiw = w;<NEW_LINE>if (inspector.getSelectedItem() != -1) {<NEW_LINE>wiw = w.getWidgetItem(inspector.getSelectedItem());<NEW_LINE>}<NEW_LINE>renderWiw(g, wiw, WidgetInspector.SELECTED_WIDGET_COLOR);<NEW_LINE>}<NEW_LINE>if (inspector.isPickerSelected()) {<NEW_LINE>boolean menuOpen = client.isMenuOpen();<NEW_LINE>MenuEntry[<MASK><NEW_LINE>for (int i = menuOpen ? 0 : entries.length - 1; i < entries.length; i++) {<NEW_LINE>MenuEntry e = entries[i];<NEW_LINE>Object wiw = inspector.getWidgetOrWidgetItemForMenuOption(e.getType(), e.getParam0(), e.getParam1());<NEW_LINE>if (wiw == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Color color = inspector.colorForWidget(i, entries.length);<NEW_LINE>renderWiw(g, wiw, color);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | ] entries = client.getMenuEntries(); |
1,647,964 | private IRubyObject objectForUClass(boolean partial, List<RubyModule> extendedModules) throws IOException {<NEW_LINE>RubyClass c = getClassFromPath(runtime, <MASK><NEW_LINE>if (c.isSingleton())<NEW_LINE>throw runtime.newTypeError("singleton can't be loaded");<NEW_LINE>int type = r_byte();<NEW_LINE>if (c == runtime.getHash() && (type == TYPE_HASH || type == TYPE_HASH_DEF)) {<NEW_LINE>// FIXME: Missing logic to make the following methods use compare_by_identity (and construction of that)<NEW_LINE>return type == TYPE_HASH ? objectForHash(partial) : objectForHashDefault(partial);<NEW_LINE>}<NEW_LINE>IRubyObject obj = objectFor(type, null, partial, extendedModules);<NEW_LINE>// if result is a module or type doesn't extend result's class...<NEW_LINE>if (obj.getMetaClass() == runtime.getModule() || !c.isKindOfModule(obj.getMetaClass())) {<NEW_LINE>// if allocators do not match, error<NEW_LINE>// Note: MRI is a bit different here, and tests TYPE(type.allocate()) != TYPE(result)<NEW_LINE>if (c.getAllocator() != obj.getMetaClass().getRealClass().getAllocator()) {<NEW_LINE>throw runtime.newArgumentError("dump format error (user class)");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>((RubyObject) obj).setMetaClass(c);<NEW_LINE>return obj;<NEW_LINE>} | unique().asJavaString()); |
61,687 | public okhttp3.Call connectPatchNamespacedPodProxyWithPathCall(String name, String namespace, String path, String path2, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())).replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString())).replaceAll("\\{" + "path" + "\\}", localVarApiClient.escapeString(path.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (path2 != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("path", path2));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "*/*" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames <MASK><NEW_LINE>return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | = new String[] { "BearerToken" }; |
564,272 | public void watchPositionImplAsync(final int watchId, final Map<String, Object> options, final Promise promise) {<NEW_LINE>// Check for permissions<NEW_LINE>if (isMissingForegroundPermissions()) {<NEW_LINE>promise.reject(new LocationUnauthorizedException());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final LocationRequest <MASK><NEW_LINE>boolean showUserSettingsDialog = !options.containsKey(SHOW_USER_SETTINGS_DIALOG_KEY) || (boolean) options.get(SHOW_USER_SETTINGS_DIALOG_KEY);<NEW_LINE>if (LocationHelpers.hasNetworkProviderEnabled(mContext) || !showUserSettingsDialog) {<NEW_LINE>LocationHelpers.requestContinuousUpdates(this, locationRequest, watchId, promise);<NEW_LINE>} else {<NEW_LINE>// Pending requests can ask the user to turn on improved accuracy mode in user's settings.<NEW_LINE>addPendingLocationRequest(locationRequest, resultCode -> {<NEW_LINE>if (resultCode == Activity.RESULT_OK) {<NEW_LINE>LocationHelpers.requestContinuousUpdates(LocationModule.this, locationRequest, watchId, promise);<NEW_LINE>} else {<NEW_LINE>promise.reject(new LocationSettingsUnsatisfiedException());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | locationRequest = LocationHelpers.prepareLocationRequest(options); |
1,363,670 | final DeleteEventSubscriptionResult executeDeleteEventSubscription(DeleteEventSubscriptionRequest deleteEventSubscriptionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteEventSubscriptionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteEventSubscriptionRequest> request = null;<NEW_LINE>Response<DeleteEventSubscriptionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteEventSubscriptionRequestMarshaller().marshall(super.beforeMarshalling(deleteEventSubscriptionRequest));<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, "Redshift");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteEventSubscription");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteEventSubscriptionResult> responseHandler = new StaxResponseHandler<<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | DeleteEventSubscriptionResult>(new DeleteEventSubscriptionResultStaxUnmarshaller()); |
1,416,806 | private void incrNavigatorsFromSolrFacets(final Map<String, ReversibleScoreMap<String>> facets) {<NEW_LINE>if (facets != null && !facets.isEmpty()) {<NEW_LINE>fcts = facets.get(CollectionSchema.coordinate_p_0_coordinate.getSolrFieldName());<NEW_LINE>if (fcts != null) {<NEW_LINE>for (String coordinate : fcts) {<NEW_LINE>int hc = fcts.get(coordinate);<NEW_LINE>if (hc == 0)<NEW_LINE>continue;<NEW_LINE>this.locationNavigator.inc(coordinate, hc);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (this.dateNavigator != null) {<NEW_LINE>fcts = facets.get(CollectionSchema.dates_in_content_dts.getSolrFieldName());<NEW_LINE>if (fcts != null)<NEW_LINE>this.dateNavigator.inc(fcts);<NEW_LINE>}<NEW_LINE>if (this.protocolNavigator != null) {<NEW_LINE>fcts = facets.get(CollectionSchema.url_protocol_s.getSolrFieldName());<NEW_LINE>if (fcts != null) {<NEW_LINE>// remove all protocols that we don't know<NEW_LINE>Iterator<String<MASK><NEW_LINE>while (i.hasNext()) {<NEW_LINE>String protocol = i.next();<NEW_LINE>if (PROTOCOL_NAVIGATOR_SUPPORTED_VALUES.indexOf(protocol) < 0) {<NEW_LINE>i.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.protocolNavigator.inc(fcts);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// get the vocabulary navigation<NEW_LINE>Set<String> genericFacets = new LinkedHashSet<>();<NEW_LINE>for (Tagging v : LibraryProvider.autotagging.getVocabularies()) genericFacets.add(v.getName());<NEW_LINE>genericFacets.addAll(ProbabilisticClassifier.getContextNames());<NEW_LINE>for (String vocName : genericFacets) {<NEW_LINE>fcts = facets.get(CollectionSchema.VOCABULARY_PREFIX + vocName + CollectionSchema.VOCABULARY_TERMS_SUFFIX);<NEW_LINE>if (fcts != null) {<NEW_LINE>ScoreMap<String> vocNav = this.vocabularyNavigator.get(vocName);<NEW_LINE>if (vocNav == null) {<NEW_LINE>vocNav = new ConcurrentScoreMap<String>();<NEW_LINE>this.vocabularyNavigator.put(vocName, vocNav);<NEW_LINE>}<NEW_LINE>vocNav.inc(fcts);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | > i = fcts.iterator(); |
1,237,422 | final RegisterTypeResult executeRegisterType(RegisterTypeRequest registerTypeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(registerTypeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RegisterTypeRequest> request = null;<NEW_LINE>Response<RegisterTypeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RegisterTypeRequestMarshaller().marshall(super.beforeMarshalling(registerTypeRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RegisterType");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<RegisterTypeResult> responseHandler = new StaxResponseHandler<RegisterTypeResult>(new RegisterTypeResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
1,466,198 | final DeleteWirelessDeviceResult executeDeleteWirelessDevice(DeleteWirelessDeviceRequest deleteWirelessDeviceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteWirelessDeviceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteWirelessDeviceRequest> request = null;<NEW_LINE>Response<DeleteWirelessDeviceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteWirelessDeviceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteWirelessDeviceRequest));<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, "IoT Wireless");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteWirelessDeviceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteWirelessDeviceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteWirelessDevice"); |
1,764,396 | public void onError(@NonNull Throwable t) {<NEW_LINE>if (done) {<NEW_LINE>RxJavaPlugins.onError(t);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>done = true;<NEW_LINE>if (upstream == null) {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>downstream.onSubscribe(EmptyDisposable.INSTANCE);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Exceptions.throwIfFatal(e);<NEW_LINE>// can't call onError because the actual's state may be corrupt at this point<NEW_LINE>RxJavaPlugins.onError(new CompositeException(t, npe, e));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>downstream.onError(new CompositeException(t, npe));<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Exceptions.throwIfFatal(e);<NEW_LINE>// if onError failed, all that's left is to report the error to plugins<NEW_LINE>RxJavaPlugins.onError(new CompositeException(t, npe, e));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (t == null) {<NEW_LINE>t = ExceptionHelper.createNullPointerException("onError called with a null Throwable.");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>downstream.onError(t);<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>Exceptions.throwIfFatal(ex);<NEW_LINE>RxJavaPlugins.onError(new CompositeException(t, ex));<NEW_LINE>}<NEW_LINE>} | Throwable npe = new NullPointerException("Subscription not set!"); |
1,410,876 | private synchronized void maybeSaveUnhandledThrowable(Throwable e, boolean markToStopJobs) {<NEW_LINE>boolean critical = false;<NEW_LINE>ErrorClassification <MASK><NEW_LINE>switch(errorClassification) {<NEW_LINE>case AS_CRITICAL_AS_POSSIBLE:<NEW_LINE>case CRITICAL_AND_LOG:<NEW_LINE>critical = true;<NEW_LINE>logger.atWarning().withCause(e).log("Found critical error in queue visitor");<NEW_LINE>break;<NEW_LINE>case CRITICAL:<NEW_LINE>critical = true;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (unhandled == null || errorClassification.compareTo(errorClassifier.classify(unhandled)) > 0) {<NEW_LINE>// Save the most severe error.<NEW_LINE>unhandled = e;<NEW_LINE>exceptionLatch.countDown();<NEW_LINE>}<NEW_LINE>if (markToStopJobs) {<NEW_LINE>synchronized (zeroRemainingTasks) {<NEW_LINE>if (critical && !jobsMustBeStopped) {<NEW_LINE>jobsMustBeStopped = true;<NEW_LINE>// This introduces a benign race, but it's the best we can do. When we have multiple<NEW_LINE>// errors of the same severity that is at least CRITICAL, we'll end up saving (above) and<NEW_LINE>// propagating (in 'awaitQuiescence') the most severe one we see, but the set of errors we<NEW_LINE>// see is non-deterministic and is at the mercy of how quickly the calling thread of<NEW_LINE>// 'awaitQuiescence' can do its thing after this 'notify' call.<NEW_LINE>zeroRemainingTasks.notify();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | errorClassification = errorClassifier.classify(e); |
1,536,765 | protected BBFormularioSondaReturn createFormularioSondaReturn(RespostaInicialFormularioSonda formularioSonda) {<NEW_LINE>return new BBFormularioSondaReturn(new BBBasicDataReturn(Integer.valueOf(formularioSonda.getIdConv()), formularioSonda.getRefTran()), new BigDecimalFormatter().stringInCentsToBigDecimal(formularioSonda.getValor()), new EnumComCodigoFinder().descobreAEnumPeloCodigo(BBTipoTransacao.class, formularioSonda.getTpPagamento()), new EnumComCodigoFinder().descobreAEnumPeloCodigo(BBSituacao.class, formularioSonda.getSituacao()), new CalendarFormatter().stringToCalendar(formularioSonda<MASK><NEW_LINE>} | .getDataPagamento(), "ddMMyyyy")); |
1,759,012 | private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>javax.swing.JScrollPane jScrollPane1 = new javax.swing.JScrollPane();<NEW_LINE>artifactsTable = new javax.swing.JTable();<NEW_LINE>setOpaque(false);<NEW_LINE>setPreferredSize(new java.awt.Dimension(350, 10));<NEW_LINE>jScrollPane1.setBorder(null);<NEW_LINE>jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);<NEW_LINE>jScrollPane1.setMinimumSize(new java.awt.Dimension(0, 0));<NEW_LINE>jScrollPane1.setPreferredSize(new java.awt.Dimension(350, 10));<NEW_LINE>artifactsTable.setAutoCreateRowSorter(true);<NEW_LINE>artifactsTable.setModel(tableModel);<NEW_LINE>artifactsTable.setSelectionMode(<MASK><NEW_LINE>jScrollPane1.setViewportView(artifactsTable);<NEW_LINE>javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);<NEW_LINE>this.setLayout(layout);<NEW_LINE>layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));<NEW_LINE>layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));<NEW_LINE>} | javax.swing.ListSelectionModel.SINGLE_SELECTION); |
14,350 | static <InElementT extends @Nullable Object, OutElementT extends @Nullable Object> Spliterator<OutElementT> map(Spliterator<InElementT> fromSpliterator, Function<? super InElementT, ? extends OutElementT> function) {<NEW_LINE>checkNotNull(fromSpliterator);<NEW_LINE>checkNotNull(function);<NEW_LINE>return new Spliterator<OutElementT>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean tryAdvance(Consumer<? super OutElementT> action) {<NEW_LINE>return fromSpliterator.tryAdvance(fromElement -> action.accept(function.apply(fromElement)));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void forEachRemaining(Consumer<? super OutElementT> action) {<NEW_LINE>fromSpliterator.forEachRemaining(fromElement -> action.accept(function.apply(fromElement)));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>@CheckForNull<NEW_LINE>public Spliterator<OutElementT> trySplit() {<NEW_LINE>Spliterator<InElementT> fromSplit = fromSpliterator.trySplit();<NEW_LINE>return (fromSplit != null) ? map(fromSplit, function) : null;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public long estimateSize() {<NEW_LINE>return fromSpliterator.estimateSize();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int characteristics() {<NEW_LINE>return fromSpliterator.characteristics() & ~(Spliterator.DISTINCT | <MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | Spliterator.NONNULL | Spliterator.SORTED); |
1,169,621 | public void moveMCWrapperFromUnSharedToShared(Object value1, Object affinity) {<NEW_LINE>if (tc.isEntryEnabled()) {<NEW_LINE>Tr.entry(this, tc, "moveMCWrapperFromUnSharedToShared");<NEW_LINE>}<NEW_LINE>MCWrapper mcWrapper = (MCWrapper) value1;<NEW_LINE>int sharedbucket = Math.abs(<MASK><NEW_LINE>// Start - Need code here, but more work is needed.<NEW_LINE>if (localConnection_ != null && mcWrapper.getPoolState() == MCWrapper.ConnectionState_unsharedTLSPool) {<NEW_LINE>mcWrapper.setPoolState(MCWrapper.ConnectionState_sharedTLSPool);<NEW_LINE>mcWrapper.setSharedPoolCoordinator(affinity);<NEW_LINE>// This mcwrapper is already in thread local, nothing else to do.<NEW_LINE>} else {<NEW_LINE>// End - Need code here, but more work is needed.<NEW_LINE>sharedPool[sharedbucket].setSharedConnection(affinity, mcWrapper);<NEW_LINE>mcWrapper.setInSharedPool(true);<NEW_LINE>}<NEW_LINE>if (tc.isEntryEnabled()) {<NEW_LINE>Tr.exit(this, tc, "moveMCWrapperFromUnSharedToShared");<NEW_LINE>}<NEW_LINE>} | affinity.hashCode() % maxSharedBuckets); |
1,105,820 | static void generateXmlParseBody(GenerationContext context) {<NEW_LINE>TypeScriptWriter writer = context.getWriter();<NEW_LINE>// Include an XML body parser used to deserialize documents from HTTP responses.<NEW_LINE>writer.addImport("SerdeContext", "__SerdeContext", "@aws-sdk/types");<NEW_LINE>writer.<MASK><NEW_LINE>writer.addDependency(AwsDependency.XML_PARSER);<NEW_LINE>writer.addDependency(AwsDependency.HTML_ENTITIES);<NEW_LINE>writer.addImport("parse", "xmlParse", "fast-xml-parser");<NEW_LINE>writer.addImport("decodeHTML", "decodeHTML", "entities");<NEW_LINE>writer.openBlock("const parseBody = (streamBody: any, context: __SerdeContext): " + "any => collectBodyString(streamBody, context).then(encoded => {", "});", () -> {<NEW_LINE>writer.openBlock("if (encoded.length) {", "}", () -> {<NEW_LINE>writer.write("const parsedObj = xmlParse(encoded, { attributeNamePrefix: '', " + "ignoreAttributes: false, parseNodeValue: false, trimValues: false, " + "tagValueProcessor: (val) => (val.trim() === '' && val.includes('\\n'))" + " ? '': decodeHTML(val) });");<NEW_LINE>writer.write("const textNodeName = '#text';");<NEW_LINE>writer.write("const key = Object.keys(parsedObj)[0];");<NEW_LINE>writer.write("const parsedObjToReturn = parsedObj[key];");<NEW_LINE>writer.openBlock("if (parsedObjToReturn[textNodeName]) {", "}", () -> {<NEW_LINE>writer.write("parsedObjToReturn[key] = parsedObjToReturn[textNodeName];");<NEW_LINE>writer.write("delete parsedObjToReturn[textNodeName];");<NEW_LINE>});<NEW_LINE>writer.write("return __getValueFromTextNode(parsedObjToReturn);");<NEW_LINE>});<NEW_LINE>writer.write("return {};");<NEW_LINE>});<NEW_LINE>writer.write("");<NEW_LINE>} | addImport("getValueFromTextNode", "__getValueFromTextNode", "@aws-sdk/smithy-client"); |
37,525 | public void onMapReady(@NonNull final MapboxMap mapboxMap) {<NEW_LINE>mapboxMap.setStyle(Style.MAPBOX_STREETS, new Style.OnStyleLoaded() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onStyleLoaded(@NonNull Style style) {<NEW_LINE>try {<NEW_LINE>GeoJsonSource urbanAreasSource = new GeoJsonSource("urban-areas", new URI("https://d2ad6b4ur7yvpq.cloudfront.net/naturalearth-3.3.0/ne_50m_urban_areas.geojson"));<NEW_LINE>style.addSource(urbanAreasSource);<NEW_LINE>FillLayer urbanArea = new FillLayer("urban-areas-fill", "urban-areas");<NEW_LINE>urbanArea.setProperties(fillColor(Color.parseColor("#ff0088"<MASK><NEW_LINE>style.addLayerBelow(urbanArea, "water");<NEW_LINE>} catch (URISyntaxException uriSyntaxException) {<NEW_LINE>uriSyntaxException.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | )), fillOpacity(0.4f)); |
40,951 | public void addNotify() {<NEW_LINE>super.addNotify();<NEW_LINE>int ptSize <MASK><NEW_LINE>if (useMonospacedFont) {<NEW_LINE>// NOI18N<NEW_LINE>Font font = new Font("Monospaced", Font.PLAIN, ptSize);<NEW_LINE>setFont(font);<NEW_LINE>}<NEW_LINE>fontMetrics = getFontMetrics(getFont());<NEW_LINE>int width = 0;<NEW_LINE>if (stringsToDisplay == null) {<NEW_LINE>lineSpacing = 0;<NEW_LINE>if (ptSize > 12) {<NEW_LINE>lineSpacing = LINE_SPACING + ((ptSize - 4) / 4);<NEW_LINE>} else {<NEW_LINE>lineSpacing = LINE_SPACING;<NEW_LINE>}<NEW_LINE>totalWidth = insets.left + insets.right + width;<NEW_LINE>lineHeight = charHeight + lineSpacing;<NEW_LINE>if (formatText) {<NEW_LINE>reformat();<NEW_LINE>}<NEW_LINE>int totalHeight = insets.top + insets.bottom + (charHeight * numberLines) + (lineSpacing * (numberLines - 1));<NEW_LINE>preferredSize = new Dimension(totalWidth, totalHeight);<NEW_LINE>} | = getFont().getSize(); |
1,660,818 | public void marshall(App app, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (app == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(app.getAppId(), APPID_BINDING);<NEW_LINE>protocolMarshaller.marshall(app.getAppArn(), APPARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(app.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(app.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(app.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(app.getRepository(), REPOSITORY_BINDING);<NEW_LINE>protocolMarshaller.marshall(app.getPlatform(), PLATFORM_BINDING);<NEW_LINE>protocolMarshaller.marshall(app.getCreateTime(), CREATETIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(app.getUpdateTime(), UPDATETIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(app.getIamServiceRoleArn(), IAMSERVICEROLEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(app.getEnvironmentVariables(), ENVIRONMENTVARIABLES_BINDING);<NEW_LINE>protocolMarshaller.marshall(app.getDefaultDomain(), DEFAULTDOMAIN_BINDING);<NEW_LINE>protocolMarshaller.marshall(app.getEnableBranchAutoBuild(), ENABLEBRANCHAUTOBUILD_BINDING);<NEW_LINE>protocolMarshaller.marshall(app.getEnableBranchAutoDeletion(), ENABLEBRANCHAUTODELETION_BINDING);<NEW_LINE>protocolMarshaller.marshall(app.getEnableBasicAuth(), ENABLEBASICAUTH_BINDING);<NEW_LINE>protocolMarshaller.marshall(app.getBasicAuthCredentials(), BASICAUTHCREDENTIALS_BINDING);<NEW_LINE>protocolMarshaller.marshall(app.getCustomRules(), CUSTOMRULES_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(app.getBuildSpec(), BUILDSPEC_BINDING);<NEW_LINE>protocolMarshaller.marshall(app.getCustomHeaders(), CUSTOMHEADERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(app.getEnableAutoBranchCreation(), ENABLEAUTOBRANCHCREATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(app.getAutoBranchCreationPatterns(), AUTOBRANCHCREATIONPATTERNS_BINDING);<NEW_LINE>protocolMarshaller.marshall(app.getAutoBranchCreationConfig(), AUTOBRANCHCREATIONCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(app.getRepositoryCloneMethod(), REPOSITORYCLONEMETHOD_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | app.getProductionBranch(), PRODUCTIONBRANCH_BINDING); |
1,506,209 | public ParsedLine parse(String line, int cursor, ParseContext context) throws SyntaxError {<NEW_LINE>if (line.isBlank())<NEW_LINE>return simplest(line, cursor, 0, Collections.emptyList());<NEW_LINE>var tokensRaw = new CommonTokenStream(CommonCliRepl.createLexer(line, new BaseErrorListener()));<NEW_LINE>tokensRaw.fill();<NEW_LINE>var tokens = // Drop the EOF<NEW_LINE>tokensRaw.getTokens().stream().limit(tokensRaw.size() - 1).filter(token -> token.getChannel() != Token.HIDDEN_CHANNEL).collect(Collectors.toList());<NEW_LINE>var wordOpt = tokens.stream().filter(token -> token.getStartIndex() <= cursor && token.getStopIndex() + 1 >= cursor).findFirst();<NEW_LINE>// In case we're in a whitespace or at the end<NEW_LINE>if (wordOpt.isEmpty()) {<NEW_LINE>var tokenOpt = tokens.stream().filter(tok -> tok.getStartIndex() >= cursor).findFirst();<NEW_LINE>if (tokenOpt.isEmpty()) {<NEW_LINE>return simplest(line, cursor, tokens.size(), tokens.stream().map(Token::getText).collect(Collectors.toList()));<NEW_LINE>}<NEW_LINE>var token = tokenOpt.get();<NEW_LINE>var wordCursor = cursor - token.getStartIndex();<NEW_LINE>return new ArendParsedLine(Math.max(wordCursor, 0), tokens.stream().map(Token::getText).collect(Collectors.toList()), token.getText(), tokens.size() - 1, line, cursor);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>var wordText = word.getText();<NEW_LINE>return new ArendParsedLine(cursor - word.getStartIndex(), tokens.stream().map(Token::getText).collect(Collectors.toList()), wordText, tokens.indexOf(word), line, cursor);<NEW_LINE>} | var word = wordOpt.get(); |
1,049,524 | public void update(@Nonnull AnActionEvent e) {<NEW_LINE><MASK><NEW_LINE>Project project = e.getData(CommonDataKeys.PROJECT);<NEW_LINE>ComboBoxButtonImpl button = (ComboBoxButtonImpl) presentation.getClientProperty(CustomComponentAction.COMPONENT_KEY);<NEW_LINE>if (project == null || project.isDefault() || project.isDisposed() || button == null) {<NEW_LINE>presentation.setEnabled(false);<NEW_LINE>presentation.setText("");<NEW_LINE>presentation.setIcon(null);<NEW_LINE>} else {<NEW_LINE>TaskManager taskManager = TaskManager.getManager(project);<NEW_LINE>LocalTask activeTask = taskManager.getActiveTask();<NEW_LINE>presentation.setVisible(true);<NEW_LINE>presentation.setEnabled(true);<NEW_LINE>if (isImplicit(activeTask) && taskManager.getAllRepositories().length == 0 && !TaskSettings.getInstance().ALWAYS_DISPLAY_COMBO) {<NEW_LINE>presentation.setVisible(false);<NEW_LINE>} else {<NEW_LINE>String s = getText(activeTask);<NEW_LINE>presentation.setText(s);<NEW_LINE>presentation.setIcon(activeTask.getIcon());<NEW_LINE>presentation.setDescription(activeTask.getSummary());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Presentation presentation = e.getPresentation(); |
96,689 | public emu.grasscutter.net.proto.PlayerStoreNotifyOuterClass.PlayerStoreNotify buildPartial() {<NEW_LINE>emu.grasscutter.net.proto.PlayerStoreNotifyOuterClass.PlayerStoreNotify result = new emu.grasscutter.net.proto.PlayerStoreNotifyOuterClass.PlayerStoreNotify(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>result.storeType_ = storeType_;<NEW_LINE>if (itemListBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000001) != 0)) {<NEW_LINE>itemList_ = java.util.Collections.unmodifiableList(itemList_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>}<NEW_LINE>result.itemList_ = itemList_;<NEW_LINE>} else {<NEW_LINE>result<MASK><NEW_LINE>}<NEW_LINE>result.weightLimit_ = weightLimit_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>} | .itemList_ = itemListBuilder_.build(); |
250,909 | private void restoreData() {<NEW_LINE>String data = mPrefs.getData(VIDEO_PLAYER_TWEAKS_DATA);<NEW_LINE>String[] split = Helpers.splitObjectLegacy(data);<NEW_LINE>mIsAmlogicFixEnabled = Helpers.parseBoolean(split, 0, false);<NEW_LINE>mIsFrameDropFixEnabled = Helpers.parseBoolean(split, 1, false);<NEW_LINE>mIsSnapToVsyncDisabled = Helpers.parseBoolean(split, 2, false);<NEW_LINE>mIsProfileLevelCheckSkipped = Helpers.parseBoolean(split, 3, false);<NEW_LINE>mIsSWDecoderForced = Helpers.parseBoolean(split, 4, false);<NEW_LINE>mIsTextureViewEnabled = Helpers.parseBoolean(split, 5, false);<NEW_LINE>// Need to be enabled (?) on older version of ExoPlayer (e.g. 2.10.6).<NEW_LINE>// It's because there's no tweaks for modern devices.<NEW_LINE>mIsSetOutputSurfaceWorkaroundEnabled = Helpers.parseBoolean(split, 7, true);<NEW_LINE>mIsAudioSyncFixEnabled = Helpers.parseBoolean(split, 8, false);<NEW_LINE>mIsKeepFinishedActivityEnabled = Helpers.parseBoolean(split, 9, false);<NEW_LINE>mIsLiveStreamFixEnabled = Helpers.parseBoolean(split, 10, false);<NEW_LINE>mIsPlaybackNotificationsDisabled = Helpers.parseBoolean(split, 11, !Helpers.isAndroidTV(mPrefs.getContext()));<NEW_LINE>mIsTunneledPlaybackEnabled = Helpers.parseBoolean(split, 12, false);<NEW_LINE>// Example usage: Integer.MAX_VALUE ^ PlayerTweaksData.PLAYER_BUTTON_VIDEO_INFO // all buttons, except info button<NEW_LINE>// all buttons<NEW_LINE>mPlayerButtons = Helpers.parseInt(split, 13, Integer.MAX_VALUE);<NEW_LINE>mIsBufferingFixEnabled = Helpers.parseBoolean(split, 14, false);<NEW_LINE>mIsNoFpsPresetsEnabled = Helpers.<MASK><NEW_LINE>} | parseBoolean(split, 15, false); |
590,183 | public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {<NEW_LINE>addPreferencesFromResource(R.xml.preferences_file_management);<NEW_LINE>offlineFileManagement = findPreference(KEY_OFFLINE);<NEW_LINE>offlineFileManagement.setOnPreferenceClickListener(this);<NEW_LINE>cacheAdvancedOptions = findPreference(KEY_CACHE);<NEW_LINE>cacheAdvancedOptions.setOnPreferenceClickListener(this);<NEW_LINE>rubbishFileManagement = findPreference(KEY_RUBBISH);<NEW_LINE>rubbishFileManagement.setOnPreferenceClickListener(this);<NEW_LINE>enableRbSchedulerSwitch = findPreference(KEY_ENABLE_RB_SCHEDULER);<NEW_LINE>enableRbSchedulerSwitch.setOnPreferenceClickListener(this);<NEW_LINE>daysRbSchedulerPreference = findPreference(KEY_DAYS_RB_SCHEDULER);<NEW_LINE>enableVersionsSwitch = findPreference(KEY_ENABLE_VERSIONS);<NEW_LINE>updateEnabledFileVersions();<NEW_LINE>fileVersionsFileManagement = findPreference(KEY_FILE_VERSIONS);<NEW_LINE>clearVersionsFileManagement = findPreference(KEY_CLEAR_VERSIONS);<NEW_LINE>clearVersionsFileManagement.setOnPreferenceClickListener(this);<NEW_LINE>autoPlaySwitch = findPreference(KEY_AUTO_PLAY_SWITCH);<NEW_LINE>autoPlaySwitch.setOnPreferenceClickListener(this);<NEW_LINE>autoPlaySwitch.setChecked(prefs.isAutoPlayEnabled());<NEW_LINE>mobileDataHighResolution = findPreference(KEY_MOBILE_DATA_HIGH_RESOLUTION);<NEW_LINE>mobileDataHighResolution.setOnPreferenceClickListener(this);<NEW_LINE>if (megaApi.serverSideRubbishBinAutopurgeEnabled()) {<NEW_LINE>megaApi.<MASK><NEW_LINE>getPreferenceScreen().addPreference(enableRbSchedulerSwitch);<NEW_LINE>getPreferenceScreen().addPreference(daysRbSchedulerPreference);<NEW_LINE>daysRbSchedulerPreference.setOnPreferenceClickListener(this);<NEW_LINE>} else {<NEW_LINE>getPreferenceScreen().removePreference(enableRbSchedulerSwitch);<NEW_LINE>getPreferenceScreen().removePreference(daysRbSchedulerPreference);<NEW_LINE>}<NEW_LINE>cacheAdvancedOptions.setSummary(getString(R.string.settings_advanced_features_calculating));<NEW_LINE>offlineFileManagement.setSummary(getString(R.string.settings_advanced_features_calculating));<NEW_LINE>rubbishFileManagement.setSummary(getString(R.string.settings_advanced_features_size, myAccountInfo.getFormattedUsedRubbish()));<NEW_LINE>taskGetSizeCache();<NEW_LINE>taskGetSizeOffline();<NEW_LINE>megaApi.getFileVersionsOption(new GetAttrUserListener(context));<NEW_LINE>if (savedInstanceState != null && savedInstanceState.getBoolean(IS_DISABLE_VERSIONS_SHOWN, false)) {<NEW_LINE>showWarningDisableVersions();<NEW_LINE>}<NEW_LINE>} | getRubbishBinAutopurgePeriod(new GetAttrUserListener(context)); |
522,913 | public void valueChanged(TreeSelectionEvent e) {<NEW_LINE>TreePath newLeadSelectionPath = e.getNewLeadSelectionPath();<NEW_LINE>if (newLeadSelectionPath != null) {<NEW_LINE>if (!navigating) {<NEW_LINE>// if we have moved back in history.. reverse before adding<NEW_LINE>while (historyIndex < navigationHistory.size() - 1) {<NEW_LINE>TreePath path = navigationHistory.remove(navigationHistory.size() - 1);<NEW_LINE>navigationHistory.add(historyIndex++, path);<NEW_LINE>}<NEW_LINE>navigationHistory.add(newLeadSelectionPath);<NEW_LINE>historyIndex = navigationHistory.size() - 1;<NEW_LINE>}<NEW_LINE>DefaultMutableTreeNode tn = (DefaultMutableTreeNode) newLeadSelectionPath.getLastPathComponent();<NEW_LINE>if (tn.getUserObject() instanceof InspectItem) {<NEW_LINE>InspectItem item = (InspectItem) tn.getUserObject();<NEW_LINE>partTabs.<MASK><NEW_LINE>statusBar.setInfo(item.getDescription());<NEW_LINE>RSyntaxTextArea editor = editors.get(item.getTabIndex());<NEW_LINE>int lineNumber = item.getLineNumber();<NEW_LINE>try {<NEW_LINE>if (lineNumber > 0 && editor.getLineStartOffset(lineNumber) >= 0) {<NEW_LINE>editor.setCaretPosition(editor.getLineStartOffset(lineNumber));<NEW_LINE>} else {<NEW_LINE>editor.setCaretPosition(0);<NEW_LINE>}<NEW_LINE>} catch (BadLocationException e1) {<NEW_LINE>// TODO What todo?<NEW_LINE>e1.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tree.scrollPathToVisible(newLeadSelectionPath);<NEW_LINE>tree.expandPath(newLeadSelectionPath);<NEW_LINE>}<NEW_LINE>} | setSelectedIndex(item.getTabIndex()); |
468,636 | public void consume(List<Datum> records) throws Exception {<NEW_LINE>underlyingTransform.consume(records);<NEW_LINE>log.debug("dumping");<NEW_LINE>if (dumpFilename != null) {<NEW_LINE>BatchTrainScore batchTrainScore = underlyingTransform.getBatchTrainScore();<NEW_LINE>ScoreDumper.tryToDumpScoredGrid(batchTrainScore, AlgebraUtils.getBoundingBox(records), dimensionsPerGrid, dumpFilename);<NEW_LINE>}<NEW_LINE>if (this.dumpMixtureComponents != null) {<NEW_LINE>BatchMixtureModel mixtureModel = <MASK><NEW_LINE>JsonUtils.tryToDumpAsJson(mixtureModel.getClusterProportions(), "weights-" + dumpMixtureComponents);<NEW_LINE>JsonUtils.tryToDumpAsJson(mixtureModel.getClusterCovariances(), "covariances-" + dumpMixtureComponents);<NEW_LINE>JsonUtils.tryToDumpAsJson(mixtureModel.getClusterCenters(), "centers-" + dumpMixtureComponents);<NEW_LINE>}<NEW_LINE>} | (BatchMixtureModel) underlyingTransform.getBatchTrainScore(); |
776,049 | private void addSortCondition(StringBuilder sb, List<Map<String, String>> sortBy) throws AppsmithPluginException {<NEW_LINE>if (isSortConditionEmpty(sortBy)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>sb.append(" ORDER BY");<NEW_LINE>sortBy.stream().filter(sortCondition -> !isBlank(sortCondition.get(SORT_BY_COLUMN_NAME_KEY))).forEachOrdered(sortCondition -> {<NEW_LINE>String columnName = sortCondition.get(SORT_BY_COLUMN_NAME_KEY);<NEW_LINE>SortType sortType;<NEW_LINE>try {<NEW_LINE>sortType = SortType.valueOf(sortCondition.get(SORT_BY_TYPE_KEY).toUpperCase());<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Appsmith server failed " + "to parse the type of sort condition. Please reach out to Appsmith customer support " + "to resolve this.");<NEW_LINE>}<NEW_LINE>sb.append(" " + <MASK><NEW_LINE>});<NEW_LINE>sb.setLength(sb.length() - 1);<NEW_LINE>} | columnName + " " + sortType + ","); |
1,369,332 | protected ExecutableDdlJob doCreate() {<NEW_LINE>Long initWait = executionContext.getParamManager(<MASK><NEW_LINE>Long interval = executionContext.getParamManager().getLong(ConnectionParams.PREEMPTIVE_MDL_INTERVAL);<NEW_LINE>Map<String, Long> tablesVersion = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);<NEW_LINE>List<String> logicalTableNames = new ArrayList<>();<NEW_LINE>TableGroupConfig tableGroupConfig = OptimizerContext.getContext(preparedData.getSchemaName()).getTableGroupInfoManager().getTableGroupConfigByName(preparedData.getTableGroupName());<NEW_LINE>for (TablePartRecordInfoContext tablePartRecordInfoContext : tableGroupConfig.getAllTables()) {<NEW_LINE>String tableName = tablePartRecordInfoContext.getLogTbRec().getTableName();<NEW_LINE>String primaryTableName;<NEW_LINE>TableMeta tableMeta = executionContext.getSchemaManager(preparedData.getSchemaName()).getTable(tableName);<NEW_LINE>if (tableMeta.isGsi()) {<NEW_LINE>// all the gsi table version change will be behavior by primary table<NEW_LINE>assert tableMeta.getGsiTableMetaBean() != null && tableMeta.getGsiTableMetaBean().gsiMetaBean != null;<NEW_LINE>primaryTableName = tableMeta.getGsiTableMetaBean().gsiMetaBean.tableName;<NEW_LINE>tableMeta = executionContext.getSchemaManager(preparedData.getSchemaName()).getTable(primaryTableName);<NEW_LINE>} else {<NEW_LINE>primaryTableName = tableName;<NEW_LINE>}<NEW_LINE>logicalTableNames.add(primaryTableName);<NEW_LINE>tablesVersion.put(primaryTableName, tableMeta.getVersion());<NEW_LINE>}<NEW_LINE>DdlTask changeMetaTask = new AlterTableGroupRenamePartitionChangeMetaTask(preparedData.getSchemaName(), preparedData.getTableGroupName(), preparedData.getChangePartitionsPair());<NEW_LINE>DdlTask syncTask = new TablesSyncTask(preparedData.getSchemaName(), logicalTableNames, true, initWait, interval, TimeUnit.MILLISECONDS);<NEW_LINE>ExecutableDdlJob executableDdlJob = new ExecutableDdlJob();<NEW_LINE>DdlTask validateTask = new AlterTableGroupValidateTask(preparedData.getSchemaName(), preparedData.getTableGroupName(), tablesVersion, true, null);<NEW_LINE>DdlTask reloadTableGroup = new TableGroupSyncTask(preparedData.getSchemaName(), preparedData.getTableGroupName());<NEW_LINE>executableDdlJob.addSequentialTasks(Lists.newArrayList(validateTask, changeMetaTask, syncTask, reloadTableGroup));<NEW_LINE>return executableDdlJob;<NEW_LINE>} | ).getLong(ConnectionParams.PREEMPTIVE_MDL_INITWAIT); |
1,645,651 | private static PriceSpecification applyPartialPriceChangeTo(@NonNull final PartialPriceChange changes, @NonNull final PriceSpecification price) {<NEW_LINE>final PriceSpecificationType priceType = coalesce(changes.getPriceType(), price.getType());<NEW_LINE>if (priceType == PriceSpecificationType.NONE) {<NEW_LINE>return PriceSpecification.none();<NEW_LINE>} else if (priceType == PriceSpecificationType.BASE_PRICING_SYSTEM) {<NEW_LINE>final PricingSystemId requestBasePricingSystemId = changes.getBasePricingSystemId() != null ? changes.getBasePricingSystemId().orElse(null) : null;<NEW_LINE>final PricingSystemId basePricingSystemId = coalesce(requestBasePricingSystemId, price.getBasePricingSystemId(), PricingSystemId.NONE);<NEW_LINE>final Money surcharge = extractMoney(changes.getPricingSystemSurchargeAmt(), changes.getCurrencyId(), price.getPricingSystemSurcharge<MASK><NEW_LINE>return PriceSpecification.basePricingSystem(basePricingSystemId, surcharge);<NEW_LINE>} else if (priceType == PriceSpecificationType.FIXED_PRICE) {<NEW_LINE>final Money fixedPrice = extractMoney(changes.getFixedPriceAmt(), changes.getCurrencyId(), price.getFixedPrice(), extractDefaultCurrencyIdSupplier(changes));<NEW_LINE>return PriceSpecification.fixedPrice(fixedPrice);<NEW_LINE>} else {<NEW_LINE>throw new AdempiereException("Unknow price type: " + priceType);<NEW_LINE>}<NEW_LINE>} | (), extractDefaultCurrencyIdSupplier(changes)); |
726,439 | public long learnParametersWithMoments(Object[] observations) {<NEW_LINE>@Var<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>@Var<NEW_LINE>int i;<NEW_LINE>@Var<NEW_LINE>int bin;<NEW_LINE>int[] observationLengths = new int[observations.length];<NEW_LINE>double[] variances = new double[partition.length];<NEW_LINE>Arrays.fill(partition, 0.0);<NEW_LINE><MASK><NEW_LINE>Arrays.fill(variances, 0.0);<NEW_LINE>// Find E[p_k]'s<NEW_LINE>for (i = 0; i < observations.length; i++) {<NEW_LINE>int[] observation = (int[]) observations[i];<NEW_LINE>// Find the sum of counts in each bin<NEW_LINE>for (bin = 0; bin < partition.length; bin++) {<NEW_LINE>observationLengths[i] += observation[bin];<NEW_LINE>}<NEW_LINE>for (bin = 0; bin < partition.length; bin++) {<NEW_LINE>partition[bin] += (double) observation[bin] / observationLengths[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (bin = 0; bin < partition.length; bin++) {<NEW_LINE>partition[bin] /= observations.length;<NEW_LINE>}<NEW_LINE>// Find var[p_k]'s<NEW_LINE>@Var<NEW_LINE>double difference;<NEW_LINE>for (i = 0; i < observations.length; i++) {<NEW_LINE>int[] observation = (int[]) observations[i];<NEW_LINE>for (bin = 0; bin < partition.length; bin++) {<NEW_LINE>difference = ((double) observation[bin] / observationLengths[i]) - partition[bin];<NEW_LINE>// avoiding Math.pow...<NEW_LINE>variances[bin] += difference * difference;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (bin = 0; bin < partition.length; bin++) {<NEW_LINE>variances[bin] /= observations.length - 1;<NEW_LINE>}<NEW_LINE>// Now calculate the magnitude:<NEW_LINE>// log \sum_k \alpha_k = 1/(K-1) \sum_k log[ ( E[p_k](1 - E[p_k]) / var[p_k] ) - 1 ]<NEW_LINE>@Var<NEW_LINE>double sum = 0.0;<NEW_LINE>for (bin = 0; bin < partition.length; bin++) {<NEW_LINE>if (partition[bin] == 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>sum += Math.log((partition[bin] * (1 - partition[bin]) / variances[bin]) - 1);<NEW_LINE>}<NEW_LINE>magnitude = Math.exp(sum / (partition.length - 1));<NEW_LINE>// System.out.println(distributionToString(magnitude, partition));<NEW_LINE>return System.currentTimeMillis() - start;<NEW_LINE>} | Arrays.fill(observationLengths, 0); |
1,321,331 | protected void scoreCensus(int disparityRange, final boolean leftToRight) {<NEW_LINE>final int[] scores = leftToRight ? scoreLtoR : scoreRtoL;<NEW_LINE>final long[] dataLeft = censusLeft.data;<NEW_LINE>final long[] dataRight = censusRight.data;<NEW_LINE>for (int d = 0; d < disparityRange; d++) {<NEW_LINE>int total = 0;<NEW_LINE>for (int y = 0; y < blockHeight; y++) {<NEW_LINE>int idxLeft = (y + <MASK><NEW_LINE>int idxRight = (y + sampleRadiusY) * censusRight.stride + sampleRadiusX + d;<NEW_LINE>for (int x = 0; x < blockWidth; x++) {<NEW_LINE>final long a = dataLeft[idxLeft++];<NEW_LINE>final long b = dataRight[idxRight++];<NEW_LINE>total += DescriptorDistance.hamming(a ^ b);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int index = leftToRight ? disparityRange - d - 1 : d;<NEW_LINE>scores[index] = total;<NEW_LINE>}<NEW_LINE>} | sampleRadiusY) * censusLeft.stride + sampleRadiusX; |
1,087,631 | public void initialize(String imageType) {<NEW_LINE>if ("png".equalsIgnoreCase(imageType)) {<NEW_LINE>this.caseDiagram = new BufferedImage(canvasWidth, canvasHeight, BufferedImage.TYPE_INT_ARGB);<NEW_LINE>} else {<NEW_LINE>this.caseDiagram = new BufferedImage(canvasWidth, canvasHeight, BufferedImage.TYPE_INT_RGB);<NEW_LINE>}<NEW_LINE>this.g = caseDiagram.createGraphics();<NEW_LINE>if (!"png".equalsIgnoreCase(imageType)) {<NEW_LINE>this.g.setBackground(new Color(255, 255, 255, 0));<NEW_LINE>this.g.clearRect(0, 0, canvasWidth, canvasHeight);<NEW_LINE>}<NEW_LINE>g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);<NEW_LINE>g.setPaint(Color.black);<NEW_LINE>Font font = new Font(activityFontName, Font.BOLD, FONT_SIZE);<NEW_LINE>g.setFont(font);<NEW_LINE>this.fontMetrics = g.getFontMetrics();<NEW_LINE>LABEL_FONT = new Font(labelFontName, Font.ITALIC, 10);<NEW_LINE>ANNOTATION_FONT = new Font(annotationFontName, Font.PLAIN, FONT_SIZE);<NEW_LINE>try {<NEW_LINE>TIMER_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/timer.png", customClassLoader));<NEW_LINE>USERLISTENER_IMAGE = ImageIO.read(ReflectUtil<MASK><NEW_LINE>VARIABLELISTENER_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/variablelistener.png", customClassLoader));<NEW_LINE>USERTASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/userTask.png", customClassLoader));<NEW_LINE>SERVICETASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/serviceTask.png", customClassLoader));<NEW_LINE>CASETASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/caseTask.png", customClassLoader));<NEW_LINE>PROCESSTASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/processTask.png", customClassLoader));<NEW_LINE>DECISIONTASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/decisionTask.png", customClassLoader));<NEW_LINE>SENDEVENTTASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/sendEventTask.png", customClassLoader));<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.warn("Could not load image for case diagram creation: {}", e.getMessage());<NEW_LINE>}<NEW_LINE>} | .getResource("org/flowable/icons/user.png", customClassLoader)); |
213,383 | protected void encode(ChannelHandlerContext ctx, WeixinResponse response, List<Object> out) {<NEW_LINE>WeixinMessageTransfer messageTransfer = ctx.channel().attr(ServerToolkits.MESSAGE_TRANSFER_KEY).get();<NEW_LINE>EncryptType encryptType = messageTransfer.getEncryptType();<NEW_LINE>StringBuilder content = new StringBuilder();<NEW_LINE>content.append(XML_START);<NEW_LINE>content.append(String.format(ELEMENT_TOUSERNAME, messageTransfer.getFromUserName()));<NEW_LINE>content.append(String.format(ELEMENT_FROMUSERNAME, messageTransfer.getToUserName()));<NEW_LINE>content.append(String.format(ELEMENT_CREATETIME, System.currentTimeMillis() / 1000l));<NEW_LINE>content.append(String.format(ELEMENT_MSGTYPE, response.getMsgType()));<NEW_LINE>content.append(response.toContent());<NEW_LINE>content.append(XML_END);<NEW_LINE>if (encryptType == EncryptType.AES) {<NEW_LINE><MASK><NEW_LINE>String nonce = ServerToolkits.generateRandomString(32);<NEW_LINE>String timestamp = Long.toString(System.currentTimeMillis() / 1000l);<NEW_LINE>String encrtypt = MessageUtil.aesEncrypt(aesToken.getWeixinId(), aesToken.getAesKey(), content.toString());<NEW_LINE>String msgSignature = MessageUtil.signature(aesToken.getToken(), nonce, timestamp, encrtypt);<NEW_LINE>content.delete(0, content.length());<NEW_LINE>content.append(XML_START);<NEW_LINE>content.append(String.format(ELEMENT_NONCE, nonce));<NEW_LINE>content.append(String.format(ELEMENT_TIMESTAMP, timestamp));<NEW_LINE>content.append(String.format(ELEMENT_MSGSIGNATURE, msgSignature));<NEW_LINE>content.append(String.format(ELEMENT_ENCRYPT, encrtypt));<NEW_LINE>content.append(XML_END);<NEW_LINE>}<NEW_LINE>ctx.writeAndFlush(HttpUtil.createHttpResponse(content.toString(), ServerToolkits.CONTENTTYPE$APPLICATION_XML));<NEW_LINE>logger.info("{} encode weixin response:{}", encryptType, content);<NEW_LINE>} | AesToken aesToken = messageTransfer.getAesToken(); |
1,322,396 | private static Context buildTrie(byte[][] needles) {<NEW_LINE>ArrayList<Integer> jumpTableBuilder = new ArrayList<Integer>(ALPHABET_SIZE);<NEW_LINE>for (int i = 0; i < ALPHABET_SIZE; i++) {<NEW_LINE>jumpTableBuilder.add(-1);<NEW_LINE>}<NEW_LINE>ArrayList<Integer> matchForBuilder = new ArrayList<Integer>();<NEW_LINE>matchForBuilder.add(-1);<NEW_LINE>for (int needleId = 0; needleId < needles.length; needleId++) {<NEW_LINE>byte[] needle = needles[needleId];<NEW_LINE>int currentPosition = 0;<NEW_LINE>for (byte ch0 : needle) {<NEW_LINE>final int ch = ch0 & 0xff;<NEW_LINE>final int next = currentPosition + ch;<NEW_LINE>if (jumpTableBuilder.get(next) == -1) {<NEW_LINE>jumpTableBuilder.set(next, jumpTableBuilder.size());<NEW_LINE>for (int i = 0; i < ALPHABET_SIZE; i++) {<NEW_LINE>jumpTableBuilder.add(-1);<NEW_LINE>}<NEW_LINE>matchForBuilder.add(-1);<NEW_LINE>}<NEW_LINE>currentPosition = jumpTableBuilder.get(next);<NEW_LINE>}<NEW_LINE>matchForBuilder.set<MASK><NEW_LINE>}<NEW_LINE>Context context = new Context();<NEW_LINE>context.jumpTable = new int[jumpTableBuilder.size()];<NEW_LINE>for (int i = 0; i < jumpTableBuilder.size(); i++) {<NEW_LINE>context.jumpTable[i] = jumpTableBuilder.get(i);<NEW_LINE>}<NEW_LINE>context.matchForNeedleId = new int[matchForBuilder.size()];<NEW_LINE>for (int i = 0; i < matchForBuilder.size(); i++) {<NEW_LINE>context.matchForNeedleId[i] = matchForBuilder.get(i);<NEW_LINE>}<NEW_LINE>return context;<NEW_LINE>} | (currentPosition >> BITS_PER_SYMBOL, needleId); |
453,447 | static ImmutableList<Step> addPostprocessClassesCommands(ProjectFilesystem filesystem, List<String> postprocessClassesCommands, Path outputDirectory, ImmutableSortedSet<Path> declaredClasspathEntries, Optional<String> bootClasspath) {<NEW_LINE>if (postprocessClassesCommands.isEmpty()) {<NEW_LINE>return ImmutableList.of();<NEW_LINE>}<NEW_LINE>ImmutableList.Builder<Step> commands = new <MASK><NEW_LINE>ImmutableMap.Builder<String, String> envVarBuilder = ImmutableMap.builder();<NEW_LINE>envVarBuilder.put("COMPILATION_CLASSPATH", Joiner.on(':').join(Iterables.transform(declaredClasspathEntries, filesystem::resolve)));<NEW_LINE>if (bootClasspath.isPresent()) {<NEW_LINE>envVarBuilder.put("COMPILATION_BOOTCLASSPATH", bootClasspath.get());<NEW_LINE>}<NEW_LINE>ImmutableMap<String, String> envVars = envVarBuilder.build();<NEW_LINE>for (String postprocessClassesCommand : postprocessClassesCommands) {<NEW_LINE>BashStep bashStep = new BashStep(filesystem.getRootPath(), postprocessClassesCommand + " " + outputDirectory) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ImmutableMap<String, String> getEnvironmentVariables(ExecutionContext context) {<NEW_LINE>return envVars;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>commands.add(bashStep);<NEW_LINE>}<NEW_LINE>return commands.build();<NEW_LINE>} | ImmutableList.Builder<Step>(); |
737,734 | private void buildApiParams(ApiMessageDescriptor desc) {<NEW_LINE>Class msgClz = desc.getClazz();<NEW_LINE>List<Field> fields = FieldUtils.getAllFields(msgClz);<NEW_LINE>class FP {<NEW_LINE><NEW_LINE>Field field;<NEW_LINE><NEW_LINE>APIParam param;<NEW_LINE>}<NEW_LINE>Map<String, FP> fmap = new HashMap<String, FP>();<NEW_LINE>for (Field f : fields) {<NEW_LINE>APIParam at = f.getAnnotation(APIParam.class);<NEW_LINE>if (at == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>FP fp = new FP();<NEW_LINE>fp.field = f;<NEW_LINE>fp.param = f.getAnnotation(APIParam.class);<NEW_LINE>fmap.put(f.getName(), fp);<NEW_LINE>}<NEW_LINE>OverriddenApiParams at = desc.getClazz().getAnnotation(OverriddenApiParams.class);<NEW_LINE>if (at != null) {<NEW_LINE>for (OverriddenApiParam atp : at.value()) {<NEW_LINE>Field f = FieldUtils.getField(atp.field(), msgClz);<NEW_LINE>if (f == null) {<NEW_LINE>throw new CloudRuntimeException(String.format("cannot find the field[%s] specified in @OverriddenApiParam of class[%s]", atp.field(), msgClz));<NEW_LINE>}<NEW_LINE>FP fp = new FP();<NEW_LINE>fp.field = f;<NEW_LINE>fp.param = atp.param();<NEW_LINE>fmap.put(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (FP fp : fmap.values()) {<NEW_LINE>desc.getFieldApiParams().put(fp.field, fp.param);<NEW_LINE>}<NEW_LINE>} | atp.field(), fp); |
904,691 | public final void clear() {<NEW_LINE>// fill grid with background color<NEW_LINE>final int bgR = (int) (this.backgroundCol >> 16);<NEW_LINE>final int bgG = (int) ((this.backgroundCol >> 8) & 0xff);<NEW_LINE>final int bgB = (int) (this.backgroundCol & 0xff);<NEW_LINE>if (this.frame == null) {<NEW_LINE>final Graphics2D gr = this.image.createGraphics();<NEW_LINE>Color c = new Color(bgR, bgG, bgB);<NEW_LINE>gr.setBackground(c);<NEW_LINE>gr.clearRect(0, 0, this.width, this.height);<NEW_LINE>gr.setColor(c);<NEW_LINE>gr.fillRect(0, 0, this.width, this.height);<NEW_LINE>} else {<NEW_LINE>int p = 0;<NEW_LINE>for (int i = 0; i < width; i++) {<NEW_LINE>this.frame[<MASK><NEW_LINE>this.frame[p++] = (byte) bgG;<NEW_LINE>this.frame[p++] = (byte) bgB;<NEW_LINE>}<NEW_LINE>final int rw = width * 3;<NEW_LINE>for (int i = 1; i < height; i++) {<NEW_LINE>System.arraycopy(this.frame, 0, this.frame, i * rw, rw);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | p++] = (byte) bgR; |
1,689,448 | public void showDownloadControls(boolean needToShow) {<NEW_LINE>// 2 modes:<NEW_LINE>// - only message;<NEW_LINE>// - message + download controls and buttons<NEW_LINE>this.panelGlobal.setVisible(true);<NEW_LINE>// stop button only for loading mode<NEW_LINE>this.buttonStop.setVisible(!needToShow);<NEW_LINE>this.tabsList.setVisible(needToShow);<NEW_LINE>this.panelCommands.setVisible(needToShow);<NEW_LINE>// auto-size form<NEW_LINE>if (needToShow) {<NEW_LINE>this.setWindowSize(this.sizeModeMessageAndControls.width, this.sizeModeMessageAndControls.height);<NEW_LINE>} else {<NEW_LINE>this.setWindowSize(this.sizeModeMessageOnly.width, this.sizeModeMessageOnly.height);<NEW_LINE>}<NEW_LINE>this.makeWindowCentered();<NEW_LINE>// this.setLocationRelativeTo(null); // center screen //FIX<NEW_LINE>// icons on tabs left side<NEW_LINE>setTabTitle(0, "Standard download", "/buttons/card_panel.png");<NEW_LINE><MASK><NEW_LINE>// TODO: add manual mode as tab<NEW_LINE>this.tabsList.getTabComponentAt(1).setEnabled(false);<NEW_LINE>this.tabsList.setEnabledAt(1, false);<NEW_LINE>} | setTabTitle(1, "Custom download", "/buttons/list_panel.png"); |
1,096,142 | static void registerRSocketForwardingFunctionIfNecessary(String definition, FunctionCatalog functionCatalog, ApplicationContext applicationContext) {<NEW_LINE>String[] names = StringUtils.delimitedListToStringArray(definition.replaceAll(",", "|").trim(), "|");<NEW_LINE>for (String name : names) {<NEW_LINE>if (functionCatalog.lookup(name) == null) {<NEW_LINE>// this means RSocket<NEW_LINE>String[] functionToRSocketDefinition = StringUtils.delimitedListToStringArray(name, ">");<NEW_LINE>if (functionToRSocketDefinition.length == 1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>LOGGER.debug("Registering RSocket forwarder for '" + name + "' function.");<NEW_LINE>}<NEW_LINE>Assert.isTrue(functionToRSocketDefinition.length == 2, "Must only contain one output redirect. Was '" + name + "'.");<NEW_LINE>FunctionInvocationWrapper function = functionCatalog.lookup(functionToRSocketDefinition[0], MimeTypeUtils.APPLICATION_JSON_VALUE);<NEW_LINE>String[] hostPort = StringUtils.delimitedListToStringArray(functionToRSocketDefinition[1], ":");<NEW_LINE>String forwardingUrl = functionToRSocketDefinition[1];<NEW_LINE>Builder rsocketRequesterBuilder = applicationContext.getBean(Builder.class);<NEW_LINE>RSocketRequester rsocketRequester = (WS_URI_PATTERN.matcher(forwardingUrl).matches()) ? rsocketRequesterBuilder.websocket(URI.create(forwardingUrl)) : rsocketRequesterBuilder.tcp(hostPort[0], Integer.parseInt(hostPort[1]));<NEW_LINE>RSocketForwardingFunction rsocketFunction = new RSocketForwardingFunction(function, rsocketRequester, null);<NEW_LINE>FunctionRegistration<RSocketForwardingFunction> functionRegistration = new FunctionRegistration<>(rsocketFunction, name);<NEW_LINE>functionRegistration.type(FunctionTypeUtils.discoverFunctionTypeFromClass(RSocketForwardingFunction.class));<NEW_LINE>((FunctionRegistry<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ) functionCatalog).register(functionRegistration); |
101,070 | public QueueServiceClient createClientWithDecodingFailedHandler() {<NEW_LINE>// BEGIN: com.azure.storage.queue.QueueServiceClientBuilder#processMessageDecodingErrorHandler<NEW_LINE>String connectionString = "DefaultEndpointsProtocol=https;AccountName={name};" + "AccountKey={key};EndpointSuffix={core.windows.net}";<NEW_LINE>Consumer<QueueMessageDecodingError> processMessageDecodingErrorHandler = (queueMessageDecodingFailure) -> {<NEW_LINE><MASK><NEW_LINE>PeekedMessageItem peekedMessageItem = queueMessageDecodingFailure.getPeekedMessageItem();<NEW_LINE>if (queueMessageItem != null) {<NEW_LINE>System.out.printf("Received badly encoded message, messageId=%s, messageBody=%s", queueMessageItem.getMessageId(), queueMessageItem.getBody().toString());<NEW_LINE>queueMessageDecodingFailure.getQueueClient().deleteMessage(queueMessageItem.getMessageId(), queueMessageItem.getPopReceipt());<NEW_LINE>} else if (peekedMessageItem != null) {<NEW_LINE>System.out.printf("Peeked badly encoded message, messageId=%s, messageBody=%s", peekedMessageItem.getMessageId(), peekedMessageItem.getBody().toString());<NEW_LINE>}<NEW_LINE>};<NEW_LINE>QueueServiceClient client = new QueueServiceClientBuilder().connectionString(connectionString).processMessageDecodingError(processMessageDecodingErrorHandler).buildClient();<NEW_LINE>// END: com.azure.storage.queue.QueueServiceClientBuilder#processMessageDecodingErrorHandler<NEW_LINE>return client;<NEW_LINE>} | QueueMessageItem queueMessageItem = queueMessageDecodingFailure.getQueueMessageItem(); |
1,669,974 | private byte[] readUsbFile() throws Exception {<NEW_LINE>ByteBuffer <MASK><NEW_LINE>IntBuffer readBufTransferred = IntBuffer.allocate(1);<NEW_LINE>int result;<NEW_LINE>int countDown = 0;<NEW_LINE>while (!parent.isCancelled() && countDown < 5) {<NEW_LINE>result = LibUsb.bulkTransfer(handlerNS, (byte) 0x81, readBuffer, readBufTransferred, 1000);<NEW_LINE>switch(result) {<NEW_LINE>case LibUsb.SUCCESS:<NEW_LINE>int trans = readBufTransferred.get();<NEW_LINE>byte[] receivedBytes = new byte[trans];<NEW_LINE>readBuffer.get(receivedBytes);<NEW_LINE>return receivedBytes;<NEW_LINE>case LibUsb.ERROR_TIMEOUT:<NEW_LINE>countDown++;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new Exception("Data transfer issue [read file]" + "\n Returned: " + UsbErrorCodes.getErrCode(result) + "\n (execution stopped)");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new InterruptedException();<NEW_LINE>} | readBuffer = ByteBuffer.allocateDirect(NXDT_FILE_CHUNK_SIZE); |
93,951 | private void validateVector(String name, ValueVector vector) {<NEW_LINE>if (vector instanceof BitVector) {<NEW_LINE>validateBitVector(name, (BitVector) vector);<NEW_LINE>} else if (vector instanceof RepeatedBitVector) {<NEW_LINE>validateRepeatedBitVector(name, (RepeatedBitVector) vector);<NEW_LINE>} else if (vector instanceof NullableVector) {<NEW_LINE>validateNullableVector(name, (NullableVector) vector);<NEW_LINE>} else if (vector instanceof VarCharVector) {<NEW_LINE>validateVarCharVector(name, (VarCharVector) vector);<NEW_LINE>} else if (vector instanceof VarBinaryVector) {<NEW_LINE>validateVarBinaryVector(name, (VarBinaryVector) vector);<NEW_LINE>} else if (vector instanceof FixedWidthVector || vector instanceof ZeroVector) {<NEW_LINE>// Not much to do. The only item to check is the vector<NEW_LINE>// count itself, which was already done. There is no inner<NEW_LINE>// structure to check.<NEW_LINE>} else if (vector instanceof BaseRepeatedValueVector) {<NEW_LINE>validateRepeatedVector(name, (BaseRepeatedValueVector) vector);<NEW_LINE>} else if (vector instanceof AbstractRepeatedMapVector) {<NEW_LINE>// RepeatedMapVector or DictVector<NEW_LINE>// In case of DictVector, keys and values vectors are not validated explicitly to avoid NPE<NEW_LINE>// when keys and values vectors are not set. This happens when output dict vector's keys and<NEW_LINE>// values are not constructed while copying values from input reader to dict writer and the<NEW_LINE>// input reader is an instance of NullReader for all rows which does not have schema.<NEW_LINE>validateRepeatedMapVector(name, (AbstractRepeatedMapVector) vector);<NEW_LINE>} else if (vector instanceof MapVector) {<NEW_LINE>validateMapVector<MASK><NEW_LINE>} else if (vector instanceof RepeatedListVector) {<NEW_LINE>validateRepeatedListVector(name, (RepeatedListVector) vector);<NEW_LINE>} else if (vector instanceof UnionVector) {<NEW_LINE>validateUnionVector(name, (UnionVector) vector);<NEW_LINE>} else if (vector instanceof VarDecimalVector) {<NEW_LINE>validateVarDecimalVector(name, (VarDecimalVector) vector);<NEW_LINE>} else {<NEW_LINE>logger.debug("Don't know how to validate vector: {} of class {}", name, vector.getClass().getSimpleName());<NEW_LINE>}<NEW_LINE>} | (name, (MapVector) vector); |
309,288 | protected void declareDataStructures(PyramidDiscrete<I> image) {<NEW_LINE>numPyramidLayers = image.getNumLayers();<NEW_LINE>previousDerivX = (D[]) Array.newInstance(derivType, image.getNumLayers());<NEW_LINE>previousDerivY = (D[]) Array.newInstance(derivType, image.getNumLayers());<NEW_LINE>currentDerivX = (D[]) Array.newInstance(derivType, image.getNumLayers());<NEW_LINE>currentDerivY = (D[]) Array.newInstance(<MASK><NEW_LINE>for (int i = 0; i < image.getNumLayers(); i++) {<NEW_LINE>int w = image.getWidth(i);<NEW_LINE>int h = image.getHeight(i);<NEW_LINE>previousDerivX[i] = GeneralizedImageOps.createSingleBand(derivType, w, h);<NEW_LINE>previousDerivY[i] = GeneralizedImageOps.createSingleBand(derivType, w, h);<NEW_LINE>currentDerivX[i] = GeneralizedImageOps.createSingleBand(derivType, w, h);<NEW_LINE>currentDerivY[i] = GeneralizedImageOps.createSingleBand(derivType, w, h);<NEW_LINE>}<NEW_LINE>Class imageClass = image.getImageType().getImageClass();<NEW_LINE>previousImage = FactoryPyramid.discreteGaussian(image.getConfigLayers(), -1, 1, false, ImageType.single(imageClass));<NEW_LINE>previousImage.initialize(image.getInputWidth(), image.getInputHeight());<NEW_LINE>for (int i = 0; i < tracks.length; i++) {<NEW_LINE>Track t = new Track();<NEW_LINE>t.klt = new PyramidKltFeature(numPyramidLayers, featureRadius);<NEW_LINE>tracks[i] = t;<NEW_LINE>}<NEW_LINE>} | derivType, image.getNumLayers()); |
1,179,524 | default F2<TreeZipper<A>, TreeZipper<B>, TreeZipper<C>> zipTreeZipperM() {<NEW_LINE>F2<A, B, C> outer = this;<NEW_LINE>return (ta, tb) -> {<NEW_LINE>final F2<Stream<Tree<A>>, Stream<Tree<B>>, Stream<Tree<C>>> sf = outer<MASK><NEW_LINE>F2<P3<Stream<Tree<A>>, A, Stream<Tree<A>>>, P3<Stream<Tree<B>>, B, Stream<Tree<B>>>, P3<Stream<Tree<C>>, C, Stream<Tree<C>>>> g = (pa, pb) -> p(outer.treeM().zipStreamM().f(pa._1(), pb._1()), outer.f(pa._2(), pb._2()), outer.treeM().zipStreamM().f(pa._3(), pb._3()));<NEW_LINE>final F2<Stream<P3<Stream<Tree<A>>, A, Stream<Tree<A>>>>, Stream<P3<Stream<Tree<B>>, B, Stream<Tree<B>>>>, Stream<P3<Stream<Tree<C>>, C, Stream<Tree<C>>>>> pf = g.zipStreamM();<NEW_LINE>return treeZipper(outer.treeM().f(ta.p()._1(), tb.p()._1()), sf.f(ta.lefts(), tb.lefts()), sf.f(ta.rights(), tb.rights()), pf.f(ta.p()._4(), tb.p()._4()));<NEW_LINE>};<NEW_LINE>} | .treeM().zipStreamM(); |
1,759,565 | private void processBlock(String ip, Block block) {<NEW_LINE>try {<NEW_LINE>Bucket bucket = m_bucketManager.getBucket(block.getDomain(), ip, block.getHour(), true);<NEW_LINE>boolean monitor = (++m_count) % 1000 == 0;<NEW_LINE>if (monitor) {<NEW_LINE>Transaction t = Cat.newTransaction("Block", block.getDomain());<NEW_LINE>try {<NEW_LINE>bucket.puts(block.getData(), block.getOffsets());<NEW_LINE>} catch (Exception e) {<NEW_LINE>Cat.logError(ip, e);<NEW_LINE>t.setStatus(Transaction.SUCCESS);<NEW_LINE>}<NEW_LINE>t.setStatus(Transaction.SUCCESS);<NEW_LINE>t.complete();<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>bucket.puts(block.getData(), block.getOffsets());<NEW_LINE>} catch (Exception e) {<NEW_LINE>Cat.logError(ip, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>} catch (Error e) {<NEW_LINE>Cat.logError(ip, e);<NEW_LINE>} finally {<NEW_LINE>block.clear();<NEW_LINE>}<NEW_LINE>} | Cat.logError(ip, e); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.