idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
441,863 | protected void startHeartbeat() throws ServiceException {<NEW_LINE>if (master == null) {<NEW_LINE>LOG.error("Master has not been connected");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>clientId = master.getClientId(null, GetClientIdRequest.getDefaultInstance()).getClientId();<NEW_LINE>master.clientRegister(null, ClientRegisterRequest.newBuilder().setClientId<MASK><NEW_LINE>LOG.info("clientId=" + clientId);<NEW_LINE>hbThread = new Thread(() -> {<NEW_LINE>long lastHbTs = System.currentTimeMillis();<NEW_LINE>while (!stopped.get() && !Thread.interrupted()) {<NEW_LINE>try {<NEW_LINE>if (System.currentTimeMillis() - lastHbTs > hbTimeoutMS) {<NEW_LINE>LOG.fatal("can not connect to master in " + hbTimeoutMS + " ms. the client will be killed by itself");<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>Thread.sleep(hbIntervalMS);<NEW_LINE>master.keepAlive(null, KeepAliveRequest.newBuilder().setClientId(clientId).build());<NEW_LINE>lastHbTs = System.currentTimeMillis();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>if (!stopped.get()) {<NEW_LINE>LOG.error("AngelClient " + clientId + " send heartbeat to Master failed ", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>hbThread.setName("client-heartbeat");<NEW_LINE>hbThread.setDaemon(true);<NEW_LINE>hbThread.start();<NEW_LINE>} | (clientId).build()); |
1,682,180 | public InProcessNeo4j build() {<NEW_LINE>Path <MASK><NEW_LINE>Path internalLogFile = serverFolder.resolve("debug.log");<NEW_LINE>config.set(ServerSettings.third_party_packages, unmanagedExtentions.toList());<NEW_LINE>config.set(GraphDatabaseSettings.store_internal_log_path, internalLogFile.toAbsolutePath());<NEW_LINE>var certificates = serverFolder.resolve("certificates");<NEW_LINE>if (disabledServer) {<NEW_LINE>config.set(HttpConnector.enabled, false);<NEW_LINE>config.set(HttpsConnector.enabled, false);<NEW_LINE>}<NEW_LINE>Config dbConfig = config.build();<NEW_LINE>if (dbConfig.get(HttpsConnector.enabled) || dbConfig.get(BoltConnector.enabled) && dbConfig.get(BoltConnector.encryption_level) != BoltConnector.EncryptionLevel.DISABLED) {<NEW_LINE>SelfSignedCertificateFactory.create(certificates);<NEW_LINE>List<SslPolicyConfig> policies = List.of(SslPolicyConfig.forScope(HTTPS), SslPolicyConfig.forScope(BOLT));<NEW_LINE>for (SslPolicyConfig policy : policies) {<NEW_LINE>config.set(policy.enabled, Boolean.TRUE);<NEW_LINE>config.set(policy.base_directory, certificates);<NEW_LINE>config.set(policy.trust_all, true);<NEW_LINE>config.set(policy.client_auth, ClientAuth.NONE);<NEW_LINE>}<NEW_LINE>dbConfig = config.build();<NEW_LINE>}<NEW_LINE>Neo4jLoggerContext loggerContext = LogConfig.createBuilder(new DefaultFileSystemAbstraction(), userLogFile, Level.INFO).withTimezone(dbConfig.get(db_timezone)).build();<NEW_LINE>var userLogProvider = new Log4jLogProvider(loggerContext);<NEW_LINE>GraphDatabaseDependencies dependencies = GraphDatabaseDependencies.newDependencies().userLogProvider(userLogProvider);<NEW_LINE>dependencies = dependencies.extensions(buildExtensionList(dependencies));<NEW_LINE>var managementService = createNeo(dbConfig, dependencies);<NEW_LINE>InProcessNeo4j controls = new InProcessNeo4j(serverFolder, userLogFile, internalLogFile, managementService, dbConfig, userLogProvider);<NEW_LINE>controls.start();<NEW_LINE>try {<NEW_LINE>fixtures.applyTo(controls);<NEW_LINE>} catch (Exception e) {<NEW_LINE>controls.close();<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>return controls;<NEW_LINE>} | userLogFile = serverFolder.resolve("neo4j.log"); |
535,603 | private JMenu buildHelpMenu() {<NEW_LINE>JMenu menu = new JMenu(tr("Help"));<NEW_LINE>menu.setMnemonic(KeyEvent.VK_H);<NEW_LINE>JMenuItem item = new JMenuItem(tr("Getting Started"));<NEW_LINE>item.addActionListener(event -> Base.openURL("https://www.arduino.cc/en/Guide"));<NEW_LINE>menu.add(item);<NEW_LINE>item = <MASK><NEW_LINE>item.addActionListener(event -> Base.openURL("https://www.arduino.cc/en/Guide/Environment"));<NEW_LINE>menu.add(item);<NEW_LINE>item = new JMenuItem(tr("Troubleshooting"));<NEW_LINE>item.addActionListener(event -> Base.openURL("https://support.arduino.cc/hc/en-us"));<NEW_LINE>menu.add(item);<NEW_LINE>item = new JMenuItem(tr("Reference"));<NEW_LINE>item.addActionListener(event -> Base.openURL("https://www.arduino.cc/reference/en/"));<NEW_LINE>menu.add(item);<NEW_LINE>menu.addSeparator();<NEW_LINE>item = newJMenuItemShift(tr("Find in Reference"), 'F');<NEW_LINE>item.addActionListener(event -> handleFindReference(getCurrentTab().getCurrentKeyword()));<NEW_LINE>menu.add(item);<NEW_LINE>item = new JMenuItem(tr("Frequently Asked Questions"));<NEW_LINE>item.addActionListener(event -> Base.openURL("https://support.arduino.cc/hc/en-us"));<NEW_LINE>menu.add(item);<NEW_LINE>item = new JMenuItem(tr("Visit Arduino.cc"));<NEW_LINE>item.addActionListener(event -> Base.openURL("https://www.arduino.cc/"));<NEW_LINE>menu.add(item);<NEW_LINE>// macosx already has its own about menu<NEW_LINE>if (!OSUtils.hasMacOSStyleMenus()) {<NEW_LINE>menu.addSeparator();<NEW_LINE>item = new JMenuItem(tr("About Arduino"));<NEW_LINE>item.addActionListener(event -> base.handleAbout());<NEW_LINE>menu.add(item);<NEW_LINE>}<NEW_LINE>return menu;<NEW_LINE>} | new JMenuItem(tr("Environment")); |
1,170,271 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag) throws Exception {<NEW_LINE>logger.print("{} delete query flag:{}.", effectivePerson.getDistinguishedName(), flag);<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Query query = emc.flag(flag, Query.class);<NEW_LINE>if (null == query) {<NEW_LINE>throw new ExceptionQueryNotExist(flag);<NEW_LINE>}<NEW_LINE>if (!business.editable(effectivePerson, query)) {<NEW_LINE>throw new ExceptionQueryAccessDenied(effectivePerson.getDistinguishedName(), query.getName(), query.getId());<NEW_LINE>}<NEW_LINE>emc.beginTransaction(View.class);<NEW_LINE>for (View _o : this.listView(business, query)) {<NEW_LINE>emc.remove(_o, CheckRemoveType.all);<NEW_LINE>}<NEW_LINE>emc.commit();<NEW_LINE>emc.beginTransaction(Stat.class);<NEW_LINE>for (Stat _o : this.listStat(business, query)) {<NEW_LINE>emc.remove(_o, CheckRemoveType.all);<NEW_LINE>}<NEW_LINE>emc.commit();<NEW_LINE><MASK><NEW_LINE>for (Reveal _o : this.listReveal(business, query)) {<NEW_LINE>emc.remove(_o, CheckRemoveType.all);<NEW_LINE>}<NEW_LINE>emc.commit();<NEW_LINE>emc.beginTransaction(Statement.class);<NEW_LINE>for (Statement _o : this.listStatement(business, query)) {<NEW_LINE>emc.remove(_o, CheckRemoveType.all);<NEW_LINE>}<NEW_LINE>emc.commit();<NEW_LINE>emc.beginTransaction(Table.class);<NEW_LINE>for (Table _o : this.listTable(business, query)) {<NEW_LINE>emc.remove(_o, CheckRemoveType.all);<NEW_LINE>}<NEW_LINE>emc.commit();<NEW_LINE>emc.beginTransaction(ImportModel.class);<NEW_LINE>for (ImportModel _o : this.listImportModel(business, query)) {<NEW_LINE>emc.remove(_o, CheckRemoveType.all);<NEW_LINE>}<NEW_LINE>emc.commit();<NEW_LINE>emc.beginTransaction(Query.class);<NEW_LINE>emc.remove(query, CheckRemoveType.all);<NEW_LINE>emc.commit();<NEW_LINE>CacheManager.notify(View.class);<NEW_LINE>CacheManager.notify(Stat.class);<NEW_LINE>CacheManager.notify(Reveal.class);<NEW_LINE>CacheManager.notify(Query.class);<NEW_LINE>CacheManager.notify(Table.class);<NEW_LINE>CacheManager.notify(Statement.class);<NEW_LINE>CacheManager.notify(ImportModel.class);<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(query.getId());<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | emc.beginTransaction(Reveal.class); |
247,528 | final DescribeNetworkInsightsAccessScopesResult executeDescribeNetworkInsightsAccessScopes(DescribeNetworkInsightsAccessScopesRequest describeNetworkInsightsAccessScopesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeNetworkInsightsAccessScopesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeNetworkInsightsAccessScopesRequest> request = null;<NEW_LINE>Response<DescribeNetworkInsightsAccessScopesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeNetworkInsightsAccessScopesRequestMarshaller().marshall(super.beforeMarshalling(describeNetworkInsightsAccessScopesRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeNetworkInsightsAccessScopes");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeNetworkInsightsAccessScopesResult> responseHandler = new StaxResponseHandler<DescribeNetworkInsightsAccessScopesResult>(new DescribeNetworkInsightsAccessScopesResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
649,930 | public void generate(TypeElement e) throws IOException {<NEW_LINE>Map<String, HashSet<ExecutableElement>> methodsPerAttribute = methodsPerAttributeMapping(e);<NEW_LINE>String className = e.getQualifiedName().toString();<NEW_LINE>String packageName = null;<NEW_LINE>int lastDot = className.lastIndexOf('.');<NEW_LINE>if (lastDot > 0) {<NEW_LINE>packageName = className.substring(0, lastDot);<NEW_LINE>}<NEW_LINE>String simpleClassName = className.substring(lastDot + 1);<NEW_LINE>String mapFieldsClassName = className + "Fields";<NEW_LINE>String mapSimpleFieldsClassName = simpleClassName + "Fields";<NEW_LINE>JavaFileObject file = processingEnv.getFiler().createSourceFile(mapFieldsClassName);<NEW_LINE>try (PrintWriter pw = new PrintWriterNoJavaLang(file.openWriter())) {<NEW_LINE>if (packageName != null) {<NEW_LINE>pw.<MASK><NEW_LINE>}<NEW_LINE>pw.println("public enum " + mapSimpleFieldsClassName + " implements " + FQN_ENTITY_FIELD + "<" + className + "> {");<NEW_LINE>methodsPerAttribute.keySet().stream().sorted(NameFirstComparator.ID_INSTANCE).forEach(key -> {<NEW_LINE>pw.println(" " + toEnumConstant(key) + " {");<NEW_LINE>printEntityFieldMethods(pw, className, key, methodsPerAttribute.get(key));<NEW_LINE>pw.println(" },");<NEW_LINE>});<NEW_LINE>pw.println("}");<NEW_LINE>}<NEW_LINE>} | println("package " + packageName + ";"); |
1,548,443 | public // The caller need to hold the db write lock<NEW_LINE>void modifyTableReplicationNum(Database db, OlapTable table, Map<String, String> properties) throws DdlException {<NEW_LINE>Preconditions.checkArgument(db.isWriteLockHeldByCurrentThread());<NEW_LINE>ColocateTableIndex colocateTableIndex = Catalog.getCurrentColocateIndex();<NEW_LINE>if (colocateTableIndex.isColocateTable(table.getId())) {<NEW_LINE>throw new DdlException("table " + table.getName() + " is colocate table, cannot change replicationNum");<NEW_LINE>}<NEW_LINE>String defaultReplicationNumName = "default." + PropertyAnalyzer.PROPERTIES_REPLICATION_NUM;<NEW_LINE>PartitionInfo partitionInfo = table.getPartitionInfo();<NEW_LINE>if (partitionInfo.getType() == PartitionType.RANGE) {<NEW_LINE>throw new DdlException("This is a range partitioned table, you should specify partitions with MODIFY PARTITION clause." + " If you want to set default replication number, please use '" + defaultReplicationNumName + "' instead of '" + PropertyAnalyzer.PROPERTIES_REPLICATION_NUM + "' to escape misleading.");<NEW_LINE>}<NEW_LINE>// unpartitioned table<NEW_LINE>// update partition replication num<NEW_LINE>String partitionName = table.getName();<NEW_LINE>Partition partition = table.getPartition(partitionName);<NEW_LINE>if (partition == null) {<NEW_LINE>throw new DdlException("Partition does not exist. name: " + partitionName);<NEW_LINE>}<NEW_LINE>short replicationNum = Short.parseShort(properties.get(PropertyAnalyzer.PROPERTIES_REPLICATION_NUM));<NEW_LINE>boolean isInMemory = partitionInfo.getIsInMemory(partition.getId());<NEW_LINE>DataProperty newDataProperty = partitionInfo.<MASK><NEW_LINE>partitionInfo.setReplicationNum(partition.getId(), replicationNum);<NEW_LINE>// update table default replication num<NEW_LINE>table.setReplicationNum(replicationNum);<NEW_LINE>// log<NEW_LINE>ModifyPartitionInfo info = new ModifyPartitionInfo(db.getId(), table.getId(), partition.getId(), newDataProperty, replicationNum, isInMemory);<NEW_LINE>editLog.logModifyPartition(info);<NEW_LINE>LOG.info("modify partition[{}-{}-{}] replication num to {}", db.getFullName(), table.getName(), partition.getName(), replicationNum);<NEW_LINE>} | getDataProperty(partition.getId()); |
564,610 | public void process(final Exchange exchange) throws Exception {<NEW_LINE>final ImportOrdersRouteContext context = ProcessorHelper.getPropertyOrThrowError(exchange, ROUTE_PROPERTY_IMPORT_ORDERS_CONTEXT, ImportOrdersRouteContext.class);<NEW_LINE>final Optional<Instant> nextImportStartingTimestamp = context.getNextImportStartingTimestamp();<NEW_LINE>if (nextImportStartingTimestamp.isEmpty()) {<NEW_LINE>// nothing to do<NEW_LINE>exchange.getIn().setBody(null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final JsonRuntimeParameterUpsertItem runtimeParameterUpsertItem = JsonRuntimeParameterUpsertItem.builder().externalSystemParentConfigId(context.getExternalSystemRequest().getExternalSystemConfigId()).name(PARAM_UPDATED_AFTER).request(context.getExternalSystemRequest().getCommand()).value(nextImportStartingTimestamp.get().toString()).build();<NEW_LINE>final JsonESRuntimeParameterUpsertRequest request = JsonESRuntimeParameterUpsertRequest.builder().runtimeParameterUpsertItems(ImmutableList.of<MASK><NEW_LINE>exchange.getIn().setBody(request);<NEW_LINE>} | (runtimeParameterUpsertItem)).build(); |
1,727,181 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_contacts);<NEW_LINE>// For set status bar<NEW_LINE>ChinaPhoneHelper.setStatusBar(this, true);<NEW_LINE>themeManager = ThemeManager.getInstance();<NEW_LINE>initLanguageStr();<NEW_LINE>topicId = getIntent().getLongExtra("topicId", -1);<NEW_LINE>if (topicId == -1) {<NEW_LINE>finish();<NEW_LINE>}<NEW_LINE>RL_contacts_content = (RelativeLayout) findViewById(R.id.RL_contacts_content);<NEW_LINE>RL_contacts_content.setBackground(themeManager.getContactsBgDrawable(this, topicId));<NEW_LINE>TV_contact_short_sort = (TextView) <MASK><NEW_LINE>TV_contact_short_sort.setBackgroundColor(themeManager.getThemeDarkColor(ContactsActivity.this));<NEW_LINE>STL_contacts = (LatterSortLayout) findViewById(R.id.STL_contacts);<NEW_LINE>STL_contacts.setSortTextView(TV_contact_short_sort);<NEW_LINE>STL_contacts.setOnTouchingLetterChangedListener(this);<NEW_LINE>EDT_main_contacts_search = (EditText) findViewById(R.id.EDT_main_contacts_search);<NEW_LINE>IV_contacts_add = (ImageView) findViewById(R.id.IV_contacts_add);<NEW_LINE>IV_contacts_add.setOnClickListener(this);<NEW_LINE>IV_contacts_title = (TextView) findViewById(R.id.IV_contacts_title);<NEW_LINE>String diaryTitle = getIntent().getStringExtra("diaryTitle");<NEW_LINE>if (diaryTitle == null) {<NEW_LINE>diaryTitle = "Contacts";<NEW_LINE>}<NEW_LINE>IV_contacts_title.setText(diaryTitle);<NEW_LINE>STL_contacts = (LatterSortLayout) findViewById(R.id.STL_contacts);<NEW_LINE>RecyclerView_contacts = (RecyclerView) findViewById(R.id.RecyclerView_contacts);<NEW_LINE>contactsNamesList = new ArrayList<>();<NEW_LINE>dbManager = new DBManager(ContactsActivity.this);<NEW_LINE>initTopbar();<NEW_LINE>loadContacts();<NEW_LINE>initTopicAdapter();<NEW_LINE>} | findViewById(R.id.TV_contact_short_sort); |
1,458,438 | public BatchDeleteDevicePositionHistoryResult batchDeleteDevicePositionHistory(BatchDeleteDevicePositionHistoryRequest batchDeleteDevicePositionHistoryRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(batchDeleteDevicePositionHistoryRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<BatchDeleteDevicePositionHistoryRequest> request = null;<NEW_LINE>Response<BatchDeleteDevicePositionHistoryResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new BatchDeleteDevicePositionHistoryRequestMarshaller().marshall(batchDeleteDevicePositionHistoryRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<BatchDeleteDevicePositionHistoryResult, JsonUnmarshallerContext> unmarshaller = new BatchDeleteDevicePositionHistoryResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<BatchDeleteDevicePositionHistoryResult> responseHandler = new JsonResponseHandler<BatchDeleteDevicePositionHistoryResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
767,283 | static HazelcastInstance embeddedHazelcastServer() {<NEW_LINE>Config config = new Config();<NEW_LINE>NetworkConfig networkConfig = config.getNetworkConfig();<NEW_LINE>networkConfig.setPort(0);<NEW_LINE>networkConfig.getJoin().<MASK><NEW_LINE>MapAttributeConfig attributeConfig = new MapAttributeConfig().setName(HazelcastIndexedSessionRepository.PRINCIPAL_NAME_ATTRIBUTE).setExtractor(PrincipalNameExtractor.class.getName());<NEW_LINE>config.getMapConfig(HazelcastIndexedSessionRepository.DEFAULT_SESSION_MAP_NAME).addMapAttributeConfig(attributeConfig).addMapIndexConfig(new MapIndexConfig(HazelcastIndexedSessionRepository.PRINCIPAL_NAME_ATTRIBUTE, false));<NEW_LINE>SerializerConfig serializerConfig = new SerializerConfig();<NEW_LINE>serializerConfig.setImplementation(new HazelcastSessionSerializer()).setTypeClass(MapSession.class);<NEW_LINE>config.getSerializationConfig().addSerializerConfig(serializerConfig);<NEW_LINE>return Hazelcast.newHazelcastInstance(config);<NEW_LINE>} | getMulticastConfig().setEnabled(false); |
599,311 | private static Object convert(Object value, Type targetType, List<TypeValuePair> unresolvedValues, boolean allowAmbiguity, BTypedesc t) {<NEW_LINE>if (value == null) {<NEW_LINE>if (targetType.isNilable()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return createError(VALUE_LANG_LIB_CONVERSION_ERROR, BLangExceptionHelper.getErrorMessage(RuntimeErrors.CANNOT_CONVERT_NIL, targetType));<NEW_LINE>}<NEW_LINE>List<String> errors = new ArrayList<>();<NEW_LINE>Set<Type> convertibleTypes;<NEW_LINE>convertibleTypes = TypeConverter.getConvertibleTypes(value, targetType, null, false, new ArrayList<>(), errors, allowAmbiguity);<NEW_LINE>Type sourceType = TypeChecker.getType(value);<NEW_LINE>if (convertibleTypes.isEmpty()) {<NEW_LINE>throw CloneUtils.createConversionError(value, targetType, errors);<NEW_LINE>}<NEW_LINE>Type matchingType;<NEW_LINE>if (convertibleTypes.contains(sourceType)) {<NEW_LINE>matchingType = sourceType;<NEW_LINE>} else {<NEW_LINE>matchingType = convertibleTypes.iterator().next();<NEW_LINE>}<NEW_LINE>// handle primitive values<NEW_LINE>if (sourceType.getTag() <= TypeTags.BOOLEAN_TAG) {<NEW_LINE>if (TypeChecker.checkIsType(value, matchingType)) {<NEW_LINE>return value;<NEW_LINE>} else {<NEW_LINE>// Has to be a numeric conversion.<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return convert((BRefValue) value, matchingType, unresolvedValues, t);<NEW_LINE>} | TypeConverter.convertValues(matchingType, value); |
581,496 | private static String processClassLoaderString43OrLater(String input) {<NEW_LINE>int start = input.indexOf("DexPathList") + "DexPathList".length();<NEW_LINE>if (input.length() > start + 4) {<NEW_LINE>// [[ + ]]<NEW_LINE>String trimmed = input.substring(start);<NEW_LINE>int end = trimmed.indexOf(']');<NEW_LINE>if (trimmed.charAt(0) == '[' && trimmed.charAt(1) == '[' && end >= 0) {<NEW_LINE>trimmed = <MASK><NEW_LINE>// Comma-separated list, Arrays.toString output.<NEW_LINE>String[] split = trimmed.split(",");<NEW_LINE>// Clean up parts. Each path element is the type of the element plus the path in<NEW_LINE>// quotes.<NEW_LINE>for (int i = 0; i < split.length; i++) {<NEW_LINE>int quoteStart = split[i].indexOf('"');<NEW_LINE>int quoteEnd = split[i].lastIndexOf('"');<NEW_LINE>if (quoteStart > 0 && quoteStart < quoteEnd) {<NEW_LINE>split[i] = split[i].substring(quoteStart + 1, quoteEnd);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Need to rejoin components.<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>for (String s : split) {<NEW_LINE>if (sb.length() > 0) {<NEW_LINE>sb.append(':');<NEW_LINE>}<NEW_LINE>sb.append(s);<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// This is technically a parsing failure. Return the original string, maybe a later<NEW_LINE>// stage can still salvage this.<NEW_LINE>return input;<NEW_LINE>} | trimmed.substring(2, end); |
962,223 | public void baseline(Blackhole blackHole) {<NEW_LINE>blackHole.consume(baselineInstance.method(booleanValue));<NEW_LINE>blackHole.consume(baselineInstance.method(byteValue));<NEW_LINE>blackHole.consume(baselineInstance.method(shortValue));<NEW_LINE>blackHole.consume(baselineInstance.method(intValue));<NEW_LINE>blackHole.consume(baselineInstance.method(charValue));<NEW_LINE>blackHole.consume(baselineInstance.method(intValue));<NEW_LINE>blackHole.consume(baselineInstance.method(longValue));<NEW_LINE>blackHole.consume(baselineInstance.method(floatValue));<NEW_LINE>blackHole.consume(baselineInstance.method(doubleValue));<NEW_LINE>blackHole.consume(baselineInstance.method(stringValue));<NEW_LINE>blackHole.consume(baselineInstance.method(booleanValue, booleanValue, booleanValue));<NEW_LINE>blackHole.consume(baselineInstance.method(byteValue, byteValue, byteValue));<NEW_LINE>blackHole.consume(baselineInstance.method(shortValue, shortValue, shortValue));<NEW_LINE>blackHole.consume(baselineInstance.method(intValue, intValue, intValue));<NEW_LINE>blackHole.consume(baselineInstance.method(charValue, charValue, charValue));<NEW_LINE>blackHole.consume(baselineInstance.method(intValue, intValue, intValue));<NEW_LINE>blackHole.consume(baselineInstance.method(longValue, longValue, longValue));<NEW_LINE>blackHole.consume(baselineInstance.method(floatValue, floatValue, floatValue));<NEW_LINE>blackHole.consume(baselineInstance.method(doubleValue, doubleValue, doubleValue));<NEW_LINE>blackHole.consume(baselineInstance.method<MASK><NEW_LINE>} | (stringValue, stringValue, stringValue)); |
472,875 | public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException {<NEW_LINE>InstrumentClass target = instrumentor.getInstrumentClass(loader, className, classfileBuffer);<NEW_LINE>if (!target.isInterceptable()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>target.addField(DatabaseInfoAccessor.class);<NEW_LINE>final Class<? <MASK><NEW_LINE>InstrumentUtils.findMethod(target, "executeQuery", "java.lang.String").addScopedInterceptor(executeQueryInterceptor, MYSQL_SCOPE);<NEW_LINE>final Class<? extends Interceptor> executeUpdateInterceptor = StatementExecuteUpdateInterceptor.class;<NEW_LINE>InstrumentUtils.findMethod(target, "executeUpdate", "java.lang.String").addScopedInterceptor(executeUpdateInterceptor, MYSQL_SCOPE);<NEW_LINE>InstrumentUtils.findMethod(target, "executeUpdate", "java.lang.String", "int").addScopedInterceptor(executeUpdateInterceptor, MYSQL_SCOPE);<NEW_LINE>InstrumentUtils.findMethod(target, "execute", "java.lang.String").addScopedInterceptor(executeUpdateInterceptor, MYSQL_SCOPE);<NEW_LINE>InstrumentUtils.findMethod(target, "execute", "java.lang.String", "int").addScopedInterceptor(executeUpdateInterceptor, MYSQL_SCOPE);<NEW_LINE>return target.toBytecode();<NEW_LINE>} | extends Interceptor> executeQueryInterceptor = StatementExecuteQueryInterceptor.class; |
363,285 | protected void ExpandBuff(boolean wrapAround) throws IOException {<NEW_LINE>char[] newbuffer <MASK><NEW_LINE>int[] newbufline = new int[bufsize + 2048];<NEW_LINE>int[] newbufcolumn = new int[bufsize + 2048];<NEW_LINE>try {<NEW_LINE>if (wrapAround) {<NEW_LINE>System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);<NEW_LINE>System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos);<NEW_LINE>buffer = newbuffer;<NEW_LINE>System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);<NEW_LINE>System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);<NEW_LINE>bufline = newbufline;<NEW_LINE>System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);<NEW_LINE>System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);<NEW_LINE>bufcolumn = newbufcolumn;<NEW_LINE>maxNextCharInd = bufpos += bufsize - tokenBegin;<NEW_LINE>} else {<NEW_LINE>System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);<NEW_LINE>buffer = newbuffer;<NEW_LINE>System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);<NEW_LINE>bufline = newbufline;<NEW_LINE>System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);<NEW_LINE>bufcolumn = newbufcolumn;<NEW_LINE>maxNextCharInd = bufpos -= tokenBegin;<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new IOException("Errow expanding the buffer.", t);<NEW_LINE>}<NEW_LINE>bufsize += 2048;<NEW_LINE>available = bufsize;<NEW_LINE>tokenBegin = 0;<NEW_LINE>} | = new char[bufsize + 2048]; |
1,673,586 | final CreateCloudFormationChangeSetResult executeCreateCloudFormationChangeSet(CreateCloudFormationChangeSetRequest createCloudFormationChangeSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createCloudFormationChangeSetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateCloudFormationChangeSetRequest> request = null;<NEW_LINE>Response<CreateCloudFormationChangeSetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateCloudFormationChangeSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createCloudFormationChangeSetRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "ServerlessApplicationRepository");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateCloudFormationChangeSet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateCloudFormationChangeSetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateCloudFormationChangeSetResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
1,784,376 | final CreateSlotTypeVersionResult executeCreateSlotTypeVersion(CreateSlotTypeVersionRequest createSlotTypeVersionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createSlotTypeVersionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateSlotTypeVersionRequest> request = null;<NEW_LINE>Response<CreateSlotTypeVersionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateSlotTypeVersionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createSlotTypeVersionRequest));<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 Model Building Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateSlotTypeVersion");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateSlotTypeVersionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateSlotTypeVersionResultJsonUnmarshaller());<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); |
1,461,930 | public static String extractFromURIPattern(String pattern, String realURI) {<NEW_LINE>Map<String, String> criteriaMap = new TreeMap<String, String>();<NEW_LINE>// Build a pattern for extracting parts from pattern and a pattern for extracting values<NEW_LINE>// from realURI. Supporting both {id} and :id.<NEW_LINE>String partsPattern = null;<NEW_LINE>String valuesPattern = null;<NEW_LINE>if (pattern.indexOf("/{") != -1) {<NEW_LINE>partsPattern = pattern.replaceAll("(\\{[^\\}]+\\})", "\\\\{(.+)\\\\}");<NEW_LINE>valuesPattern = pattern.replaceAll("(\\{[^\\}]+\\})", "(.+)");<NEW_LINE>} else {<NEW_LINE>partsPattern = pattern.replaceAll("(:[^:^/]+)", "\\:(.+)");<NEW_LINE>valuesPattern = pattern.replaceAll("(:[^:^/]+)", "(.+)");<NEW_LINE>}<NEW_LINE>if (pattern.contains("$")) {<NEW_LINE>partsPattern = partsPattern.replaceAll("\\$", "\\\\\\$");<NEW_LINE>valuesPattern = valuesPattern.replaceAll("\\$", "\\\\\\$");<NEW_LINE>}<NEW_LINE>Pattern partsP = Pattern.compile(partsPattern);<NEW_LINE>Matcher partsM = partsP.matcher(pattern);<NEW_LINE>Pattern <MASK><NEW_LINE>Matcher valuesM = valuesP.matcher(realURI);<NEW_LINE>// Both should match and have the same group count.<NEW_LINE>if (valuesM.matches() && partsM.matches() && valuesM.groupCount() == partsM.groupCount()) {<NEW_LINE>for (int i = 1; i < partsM.groupCount() + 1; i++) {<NEW_LINE>criteriaMap.put(partsM.group(i), valuesM.group(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Just appends sorted entries, separating them with /.<NEW_LINE>StringBuilder result = new StringBuilder();<NEW_LINE>for (String criteria : criteriaMap.keySet()) {<NEW_LINE>result.append("/").append(criteria).append("=").append(criteriaMap.get(criteria));<NEW_LINE>}<NEW_LINE>return result.toString();<NEW_LINE>} | valuesP = Pattern.compile(valuesPattern); |
938,771 | public Mono<Void> onGuildCreate(int shardIndex, GuildCreate dispatch) {<NEW_LINE>return Mono.fromRunnable(() -> {<NEW_LINE>long guildId = dispatch.guild().id().asLong();<NEW_LINE>GuildCreateData createData = dispatch.guild();<NEW_LINE>List<RoleData> roles = createData.roles();<NEW_LINE>List<EmojiData> emojis = createData.emojis();<NEW_LINE>List<MemberData> members = createData.members();<NEW_LINE>List<ChannelData> channels = createData.channels();<NEW_LINE>List<PresenceData> presences = createData.presences();<NEW_LINE>List<VoiceStateData> voiceStates = createData.voiceStates();<NEW_LINE>ImmutableGuildData guild = ImmutableGuildData.builder().from(createData).roles(Collections.emptyList()).emojis(Collections.emptyList()).members(Collections.emptyList()).channels(Collections.emptyList()).build();<NEW_LINE>guilds.put(guildId, new WrappedGuildData(guild));<NEW_LINE>roles.forEach(role -> saveRole(guildId, role));<NEW_LINE>emojis.forEach(emoji -> saveEmoji(guildId, emoji));<NEW_LINE>members.forEach(member <MASK><NEW_LINE>channels.forEach(channel -> saveChannel(guildId, channel));<NEW_LINE>presences.forEach(presence -> savePresence(guildId, presence));<NEW_LINE>voiceStates.forEach(voiceState -> saveOrRemoveVoiceState(guildId, voiceState));<NEW_LINE>});<NEW_LINE>} | -> saveMember(guildId, member)); |
251,190 | public AnnotationProcessingData read(Decoder decoder) throws Exception {<NEW_LINE><MASK><NEW_LINE>SetSerializer<String> typesSerializer = new SetSerializer<>(hierarchicalNameSerializer);<NEW_LINE>MapSerializer<String, Set<String>> generatedTypesSerializer = new MapSerializer<>(hierarchicalNameSerializer, typesSerializer);<NEW_LINE>GeneratedResourceSerializer resourceSerializer = new GeneratedResourceSerializer(hierarchicalNameSerializer);<NEW_LINE>SetSerializer<GeneratedResource> resourcesSerializer = new SetSerializer<>(resourceSerializer);<NEW_LINE>MapSerializer<String, Set<GeneratedResource>> generatedResourcesSerializer = new MapSerializer<>(hierarchicalNameSerializer, resourcesSerializer);<NEW_LINE>Map<String, Set<String>> generatedTypes = generatedTypesSerializer.read(decoder);<NEW_LINE>Set<String> aggregatedTypes = typesSerializer.read(decoder);<NEW_LINE>Set<String> generatedTypesDependingOnAllOthers = typesSerializer.read(decoder);<NEW_LINE>String fullRebuildCause = decoder.readNullableString();<NEW_LINE>Map<String, Set<GeneratedResource>> generatedResources = generatedResourcesSerializer.read(decoder);<NEW_LINE>Set<GeneratedResource> generatedResourcesDependingOnAllOthers = resourcesSerializer.read(decoder);<NEW_LINE>return new AnnotationProcessingData(generatedTypes, aggregatedTypes, generatedTypesDependingOnAllOthers, generatedResources, generatedResourcesDependingOnAllOthers, fullRebuildCause);<NEW_LINE>} | HierarchicalNameSerializer hierarchicalNameSerializer = classNameSerializerSupplier.get(); |
1,714,966 | public Future<Boolean> startModule(ExtendedModuleInfo moduleInfo) throws StateChangeException {<NEW_LINE>try {<NEW_LINE>latch.await(5, TimeUnit.SECONDS);<NEW_LINE>} catch (InterruptedException e1) {<NEW_LINE>AccessController.doPrivileged(new PrivilegedAction<Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void run() {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// well, we waited for a while, go ahead and try to start the client.<NEW_LINE>}<NEW_LINE>ClientModuleMetaData cmmd = (ClientModuleMetaData) moduleInfo.getMetaData();<NEW_LINE>ComponentMetaData cmd = new ClientComponentMetaDataImpl(cmmd);<NEW_LINE>ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().setDefaultCMD(cmd);<NEW_LINE>String[] args = libertyProcess.getArgs();<NEW_LINE>appContextClassLoader = classLoadingService.createThreadContextClassLoader(moduleInfo.getClassLoader());<NEW_LINE>ClassLoader origLoader = AccessController.doPrivileged(new GetTCCL());<NEW_LINE>ClassLoader newLoader = AccessController.doPrivileged(new SetTCCL(appContextClassLoader));<NEW_LINE>try {<NEW_LINE>ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().beginContext(cmd);<NEW_LINE>ApplicationClientBnd appClientBnd = appClientBnds.get(cmmd);<NEW_LINE>CallbackHandler callbackHandler = callbackHandlers.get(cmmd);<NEW_LINE>ClientModuleInjection cmi = new ClientModuleInjection(cmmd, appClientBnd, resourceRefConfigFactory, injectionEngine, managedObjectServiceRef, callbackHandler, runningInClient);<NEW_LINE>cmi.processReferences();<NEW_LINE>activeCMDs.put(cmmd.getJ2EEName(), cmd);<NEW_LINE>clientRunner.readyToRun(<MASK><NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>clientRunner.setupFailure();<NEW_LINE>throw new StateChangeException(e);<NEW_LINE>} catch (InjectionException e) {<NEW_LINE>clientRunner.setupFailure();<NEW_LINE>throw new StateChangeException(e);<NEW_LINE>} finally {<NEW_LINE>ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().endContext();<NEW_LINE>if (origLoader != newLoader) {<NEW_LINE>AccessController.doPrivileged(new SetTCCL(origLoader));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return futureMonitor.createFutureWithResult(true);<NEW_LINE>} | cmi, args, cmd, newLoader); |
841,623 | private void configurePorts(Instance instance) {<NEW_LINE>BitWidth inWidth = instance.getAttributeValue(StdAttr.WIDTH);<NEW_LINE>int inputs = instance.getAttributeValue(NUM_INPUTS);<NEW_LINE>int outWidth = computeOutputBits(inWidth.getWidth(), inputs);<NEW_LINE>int y;<NEW_LINE>int dy = 10;<NEW_LINE>switch(inputs) {<NEW_LINE>case 1:<NEW_LINE>y = 0;<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>y = -10;<NEW_LINE>dy = 20;<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>y = -10;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>y = ((inputs - 1) / 2) * -10;<NEW_LINE>}<NEW_LINE>Port[] ps = new Port[inputs + 1];<NEW_LINE>ps[0] = new Port(0, 0, Port.OUTPUT, BitWidth.create(outWidth));<NEW_LINE>ps[0].setToolTip<MASK><NEW_LINE>for (int i = 0; i < inputs; i++) {<NEW_LINE>ps[i + 1] = new Port(-40, y + i * dy, Port.INPUT, inWidth);<NEW_LINE>ps[i + 1].setToolTip(S.getter("bitAdderInputTip"));<NEW_LINE>}<NEW_LINE>instance.setPorts(ps);<NEW_LINE>} | (S.getter("bitAdderOutputManyTip")); |
1,402,658 | public void updateDescription(@NonNull LocalIndexInfo info) {<NEW_LINE>File f = new File(info.getPathToData());<NEW_LINE>if (info.getType() == LocalIndexType.MAP_DATA) {<NEW_LINE>Map<String, String> ifns = app.getResourceManager().getIndexFileNames();<NEW_LINE>if (ifns.containsKey(info.getFileName())) {<NEW_LINE>try {<NEW_LINE>Date dt = app.getResourceManager().getDateFormat().parse(ifns.get(info.getFileName()));<NEW_LINE>info.setDescription(getInstalledDate(dt.getTime(), null));<NEW_LINE>} catch (ParseException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>info.setDescription(getInstalledDate(f));<NEW_LINE>}<NEW_LINE>} else if (info.getType() == LocalIndexType.TILES_DATA) {<NEW_LINE>ITileSource template;<NEW_LINE>if (f.isDirectory() && TileSourceManager.isTileSourceMetaInfoExist(f)) {<NEW_LINE>template = TileSourceManager.createTileSourceTemplate(new File(info.getPathToData()));<NEW_LINE>} else if (f.isFile() && f.getName().endsWith(SQLiteTileSource.EXT)) {<NEW_LINE>template = new SQLiteTileSource(app, f, TileSourceManager.getKnownSourceTemplates());<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String descr = "";<NEW_LINE>if (template.getExpirationTimeMinutes() >= 0) {<NEW_LINE>descr += app.getString(R.string.local_index_tile_data_expire, String.valueOf(template.getExpirationTimeMinutes()));<NEW_LINE>}<NEW_LINE>info.setAttachedObject(template);<NEW_LINE>info.setDescription(descr);<NEW_LINE>} else if (info.getType() == LocalIndexType.SRTM_DATA) {<NEW_LINE>info.setDescription(app.getString(R.string.download_srtm_maps));<NEW_LINE>} else if (info.getType() == LocalIndexType.WIKI_DATA) {<NEW_LINE>info.setDescription(getInstalledDate(f));<NEW_LINE>} else if (info.getType() == LocalIndexType.TRAVEL_DATA) {<NEW_LINE>info.setDescription(getInstalledDate(f));<NEW_LINE>} else if (info.getType() == LocalIndexType.TTS_VOICE_DATA) {<NEW_LINE>info.setDescription(getInstalledDate(f));<NEW_LINE>} else if (info.getType() == LocalIndexType.DEACTIVATED) {<NEW_LINE>info<MASK><NEW_LINE>} else if (info.getType() == LocalIndexType.VOICE_DATA) {<NEW_LINE>info.setDescription(getInstalledDate(f));<NEW_LINE>} else if (info.getType() == LocalIndexType.FONT_DATA) {<NEW_LINE>info.setDescription(getInstalledDate(f));<NEW_LINE>}<NEW_LINE>} | .setDescription(getInstalledDate(f)); |
1,062,612 | public void onPlayerJoin(PlayerJoinEvent event) {<NEW_LINE>if (!DiscordSRV.config().getBoolean("BanSynchronizationMinecraftToDiscord")) {<NEW_LINE>DiscordSRV.debug(Debug.MINECRAFT_TO_DISCORD, "Not handling possible unban for player " + event.getPlayer().getName() + " (" + event.getPlayer().getUniqueId() + ") because doing so is disabled in the config");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>CompletableFuture.runAsync(() -> {<NEW_LINE>String discordId = DiscordSRV.getPlugin().getAccountLinkManager().getDiscordIdBypassCache(event.<MASK><NEW_LINE>if (discordId == null)<NEW_LINE>return;<NEW_LINE>DiscordSRV.getPlugin().getMainGuild().retrieveBanById(discordId).queue(ban -> {<NEW_LINE>DiscordSRV.info("Unbanning player " + event.getPlayer().getName() + " from Discord (ID " + discordId + ") because they aren't banned on the server");<NEW_LINE>DiscordSRV.getPlugin().getMainGuild().unban(discordId).queue();<NEW_LINE>}, failure -> DiscordSRV.debug(Debug.MINECRAFT_TO_DISCORD, "Failed to check if player " + event.getPlayer().getName() + " is banned in Discord: " + failure.getMessage()));<NEW_LINE>});<NEW_LINE>} | getPlayer().getUniqueId()); |
968,491 | private void loadLocaleIndependentCurrencyData() {<NEW_LINE>InputFile supp = cldrFactory.getSupplementalData();<NEW_LINE>// load the table of default # of decimal places and rounding for each currency<NEW_LINE>defaultCurrencyFraction = 0;<NEW_LINE>XPathParts parts = new XPathParts();<NEW_LINE>for (String path : supp.listPaths("//supplementalData/currencyData/fractions/info")) {<NEW_LINE>parts.set<MASK><NEW_LINE>Map<String, String> attr = parts.findAttributes("info");<NEW_LINE>if (attr == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String curCode = attr.get("iso4217");<NEW_LINE>int digits = Integer.valueOf(attr.get("digits"));<NEW_LINE>if ("DEFAULT".equalsIgnoreCase(curCode)) {<NEW_LINE>defaultCurrencyFraction = digits;<NEW_LINE>} else {<NEW_LINE>currencyFractions.put(curCode, digits);<NEW_LINE>}<NEW_LINE>int roundingDigits = Integer.valueOf(attr.get("rounding"));<NEW_LINE>if (roundingDigits != 0) {<NEW_LINE>rounding.put(curCode, roundingDigits);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// find which currencies are still in use in some region, everything else<NEW_LINE>// should be marked as deprecated<NEW_LINE>for (String path : supp.listPaths("//supplementalData/currencyData/region")) {<NEW_LINE>parts.set(supp.getFullXPath(path));<NEW_LINE>Map<String, String> attr = parts.findAttributes("currency");<NEW_LINE>if (attr == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String region = parts.findAttributeValue("region", "iso3166");<NEW_LINE>String curCode = attr.get("iso4217");<NEW_LINE>if ("ZZ".equals(region) || "false".equals(attr.get("tender")) || "XXX".equals(curCode)) {<NEW_LINE>// ZZ is an undefined region, XXX is an unknown currency code (and needs<NEW_LINE>// to be special-cased because it is listed as used in Anartica!)<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String to = attr.get("to");<NEW_LINE>if (to == null) {<NEW_LINE>stillInUse.add(curCode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (supp.getFullXPath(path)); |
792,727 | private HttpMediaType fromString(String combinedType) {<NEW_LINE>Matcher matcher = FULL_MEDIA_TYPE_REGEX.matcher(combinedType);<NEW_LINE>Preconditions.checkArgument(matcher.matches(), "Type must be in the 'maintype/subtype; parameter=value' format");<NEW_LINE>setType<MASK><NEW_LINE>setSubType(matcher.group(2));<NEW_LINE>String params = matcher.group(3);<NEW_LINE>if (params != null) {<NEW_LINE>matcher = PARAMETER_REGEX.matcher(params);<NEW_LINE>while (matcher.find()) {<NEW_LINE>// 1=key, 2=valueWithQuotes, 3=valueWithoutQuotes<NEW_LINE>String key = matcher.group(1);<NEW_LINE>String value = matcher.group(3);<NEW_LINE>if (value == null) {<NEW_LINE>value = matcher.group(2);<NEW_LINE>}<NEW_LINE>setParameter(key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>} | (matcher.group(1)); |
603,361 | public boolean accept(final Path file, final Local local, final TransferStatus parent) throws BackgroundException {<NEW_LINE>if (local.isFile()) {<NEW_LINE>if (local.exists()) {<NEW_LINE>// Read remote attributes<NEW_LINE>final PathAttributes attributes = attribute.find(file);<NEW_LINE>if (local.attributes().getSize() == attributes.getSize()) {<NEW_LINE>if (Checksum.NONE != attributes.getChecksum()) {<NEW_LINE>final ChecksumCompute compute = ChecksumComputeFactory.get(attributes.getChecksum().algorithm);<NEW_LINE>if (compute.compute(local.getInputStream(), parent).equals(attributes.getChecksum())) {<NEW_LINE>if (log.isInfoEnabled()) {<NEW_LINE>log.info(String.format("Skip file %s with checksum %s", file, local.attributes().getChecksum()));<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>log.warn(String.format("Checksum mismatch for %s and %s", file, local));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (log.isInfoEnabled()) {<NEW_LINE>log.info(String.format("Skip file %s with local size %d", file, local.attributes().getSize()));<NEW_LINE>}<NEW_LINE>// No need to resume completed transfers<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return super.<MASK><NEW_LINE>} | accept(file, local, parent); |
1,662,521 | void asyncStartFetchLogSegments(final CompletableFuture<Versioned<List<LogSegmentMetadata>>> promise) {<NEW_LINE>readLogSegmentsFromStore(LogSegmentMetadata.COMPARATOR, LogSegmentFilter.DEFAULT_FILTER, this).whenComplete(new FutureEventListener<Versioned<List<LogSegmentMetadata>>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(Throwable cause) {<NEW_LINE>if (cause instanceof LogNotFoundException || cause instanceof LogSegmentNotFoundException || cause instanceof UnexpectedException) {<NEW_LINE>// indicate some inconsistent behavior, abort<NEW_LINE>METADATA_EXCEPTION_UPDATER.compareAndSet(BKLogReadHandler.this, null, (IOException) cause);<NEW_LINE>// notify the reader that read handler is in error state<NEW_LINE>notifyReaderOnError(cause);<NEW_LINE>FutureUtils.completeExceptionally(promise, cause);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>scheduler.schedule(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>asyncStartFetchLogSegments(promise);<NEW_LINE>}<NEW_LINE>}, conf.<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(Versioned<List<LogSegmentMetadata>> segments) {<NEW_LINE>// no-op<NEW_LINE>FutureUtils.complete(promise, segments);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | getZKRetryBackoffMaxMillis(), TimeUnit.MILLISECONDS); |
784,960 | public int[] intersection(SparseVector other) {<NEW_LINE>List<Integer> diffIndicesList = new ArrayList<>();<NEW_LINE>Iterator<VectorTuple> itr = iterator();<NEW_LINE>Iterator<VectorTuple> otherItr = other.iterator();<NEW_LINE>if (itr.hasNext() && otherItr.hasNext()) {<NEW_LINE>VectorTuple tuple = itr.next();<NEW_LINE>VectorTuple otherTuple = otherItr.next();<NEW_LINE>while (itr.hasNext() && otherItr.hasNext()) {<NEW_LINE>if (tuple.index == otherTuple.index) {<NEW_LINE>diffIndicesList.add(tuple.index);<NEW_LINE>tuple = itr.next();<NEW_LINE>otherTuple = otherItr.next();<NEW_LINE>} else if (tuple.index < otherTuple.index) {<NEW_LINE>tuple = itr.next();<NEW_LINE>} else {<NEW_LINE>otherTuple = otherItr.next();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>if (tuple.index == otherTuple.index) {<NEW_LINE>diffIndicesList.add(tuple.index);<NEW_LINE>}<NEW_LINE>tuple = itr.next();<NEW_LINE>}<NEW_LINE>while (otherItr.hasNext()) {<NEW_LINE>if (tuple.index == otherTuple.index) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>otherTuple = otherItr.next();<NEW_LINE>}<NEW_LINE>if (tuple.index == otherTuple.index) {<NEW_LINE>diffIndicesList.add(tuple.index);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Util.toPrimitiveInt(diffIndicesList);<NEW_LINE>} | diffIndicesList.add(tuple.index); |
1,729,085 | public static boolean checkInstanceIdForPortRuleInES(String instanceId, String ec2PortUrl, String ruleId, String type) throws Exception {<NEW_LINE>JsonParser jsonParser = new JsonParser();<NEW_LINE>String resourceid = null;<NEW_LINE>Map<String, Object> mustFilter = new HashMap<>();<NEW_LINE>Map<String, Object> mustNotFilter = new HashMap<>();<NEW_LINE>HashMultimap<String, Object> shouldFilter = HashMultimap.create();<NEW_LINE>Map<String, Object> mustTermsFilter = new HashMap<>();<NEW_LINE>if (StringUtils.isEmpty(type)) {<NEW_LINE>shouldFilter.put(convertAttributetoKeyword(PacmanSdkConstants.ISSUE_STATUS_KEY), PacmanSdkConstants.STATUS_OPEN);<NEW_LINE>} else {<NEW_LINE>shouldFilter.put(convertAttributetoKeyword(PacmanSdkConstants.ISSUE_STATUS_KEY), PacmanSdkConstants.STATUS_OPEN);<NEW_LINE>shouldFilter.put(convertAttributetoKeyword(PacmanSdkConstants.ISSUE_STATUS_KEY), PacmanRuleConstants.STATUS_EXEMPTED);<NEW_LINE>}<NEW_LINE>mustFilter.put(convertAttributetoKeyword(PacmanSdkConstants.RULE_ID), ruleId);<NEW_LINE>mustFilter.put(convertAttributetoKeyword(PacmanSdkConstants.RESOURCE_ID), instanceId);<NEW_LINE>JsonObject resultJson = RulesElasticSearchRepositoryUtil.getQueryDetailsFromES(ec2PortUrl, mustFilter, mustNotFilter, shouldFilter, null, 0, mustTermsFilter, null, null);<NEW_LINE>if (resultJson != null && resultJson.has(PacmanRuleConstants.HITS)) {<NEW_LINE>JsonObject hitsJson = (JsonObject) jsonParser.parse(resultJson.get(PacmanRuleConstants.HITS).toString());<NEW_LINE>JsonArray hitsArray = hitsJson.getAsJsonArray(PacmanRuleConstants.HITS);<NEW_LINE>for (int i = 0; i < hitsArray.size(); i++) {<NEW_LINE>JsonObject source = hitsArray.get(i).getAsJsonObject().get(PacmanRuleConstants.SOURCE).getAsJsonObject();<NEW_LINE>resourceid = source.get(<MASK><NEW_LINE>if (!org.apache.commons.lang.StringUtils.isEmpty(resourceid)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | PacmanSdkConstants.RESOURCE_ID).getAsString(); |
45,690 | public void sendEvent(Event event) throws InterruptedException {<NEW_LINE>try {<NEW_LINE>if (latencyTracker != null && Level.BASIC.compareTo(siddhiAppContext.getRootMetricsLevel()) <= 0) {<NEW_LINE>latencyTracker.markOut();<NEW_LINE>}<NEW_LINE>Object[] transportProperties = trpProperties.get();<NEW_LINE>String[<MASK><NEW_LINE>if (event.getTimestamp() == -1) {<NEW_LINE>long currentTimestamp = timestampGenerator.currentTime();<NEW_LINE>event.setTimestamp(currentTimestamp);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < transportMapping.size(); i++) {<NEW_LINE>AttributeMapping attributeMapping = transportMapping.get(i);<NEW_LINE>event.getData()[attributeMapping.getPosition()] = AttributeConverter.getPropertyValue(transportProperties[i], attributeMapping.getType());<NEW_LINE>}<NEW_LINE>inputEventHandlerCallback.sendEvent(event, transportSyncProperties);<NEW_LINE>eventCount++;<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>LOG.error(ExceptionUtil.getMessageWithContext(e, siddhiAppContext) + " Error in applying transport property mapping for '" + sourceType + "' source at '" + inputHandler.getStreamId() + "' stream.", e);<NEW_LINE>}<NEW_LINE>} | ] transportSyncProperties = trpSyncProperties.get(); |
590,400 | public static Collection<RegressionExecution> executions() {<NEW_LINE>ArrayList<RegressionExecution> execs = new ArrayList<>();<NEW_LINE>execs.add(new InfraFAFSubquerySimple(true));<NEW_LINE>execs.add(new InfraFAFSubquerySimple(false));<NEW_LINE>execs<MASK><NEW_LINE>execs.add(new InfraFAFSubqueryInsert(true));<NEW_LINE>execs.add(new InfraFAFSubqueryInsert(false));<NEW_LINE>execs.add(new InfraFAFSubqueryUpdateUncorrelated());<NEW_LINE>execs.add(new InfraFAFSubqueryDeleteUncorrelated());<NEW_LINE>execs.add(new InfraFAFSubquerySelectCorrelated());<NEW_LINE>execs.add(new InfraFAFSubqueryUpdateCorrelatedSet());<NEW_LINE>execs.add(new InfraFAFSubqueryUpdateCorrelatedWhere());<NEW_LINE>execs.add(new InfraFAFSubqueryDeleteCorrelatedWhere());<NEW_LINE>execs.add(new InfraFAFSubqueryContextBothWindows());<NEW_LINE>execs.add(new InfraFAFSubqueryContextSelect());<NEW_LINE>execs.add(new InfraFAFSubquerySelectWhere());<NEW_LINE>execs.add(new InfraFAFSubquerySelectGroupBy());<NEW_LINE>execs.add(new InfraFAFSubquerySelectIndexPerfWSubstitution(true));<NEW_LINE>execs.add(new InfraFAFSubquerySelectIndexPerfWSubstitution(false));<NEW_LINE>execs.add(new InfraFAFSubquerySelectIndexPerfCorrelated(true));<NEW_LINE>execs.add(new InfraFAFSubquerySelectIndexPerfCorrelated(false));<NEW_LINE>execs.add(new InfraFAFSubqueryInvalid());<NEW_LINE>return execs;<NEW_LINE>} | .add(new InfraFAFSubquerySimpleJoin()); |
357,115 | private void convertUnopInsn(InsnNode insn) {<NEW_LINE>int op = insn.getOpcode();<NEW_LINE>boolean dword = op == LNEG || op == DNEG;<NEW_LINE>StackFrame frame = getFrame(insn);<NEW_LINE>Operand[] out = frame.out();<NEW_LINE>Operand opr;<NEW_LINE>if (out == null) {<NEW_LINE>Operand op1 = dword ? popImmediateDual() : popImmediate();<NEW_LINE>Value v1 = op1.stackOrValue();<NEW_LINE>UnopExpr unop;<NEW_LINE>if (op >= INEG && op <= DNEG) {<NEW_LINE>unop = Jimple.v().newNegExpr(v1);<NEW_LINE>} else if (op == ARRAYLENGTH) {<NEW_LINE>unop = Jimple.v().newLengthExpr(v1);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>op1.addBox(unop.getOpBox());<NEW_LINE>opr = new Operand(insn, unop);<NEW_LINE>frame.in(op1);<NEW_LINE>frame.boxes(unop.getOpBox());<NEW_LINE>frame.out(opr);<NEW_LINE>} else {<NEW_LINE>opr = out[0];<NEW_LINE>frame.mergeIn(dword ? popDual() : pop());<NEW_LINE>}<NEW_LINE>if (dword) {<NEW_LINE>pushDual(opr);<NEW_LINE>} else {<NEW_LINE>push(opr);<NEW_LINE>}<NEW_LINE>} | throw new AssertionError("Unknown unop: " + op); |
1,195,170 | private static <K, V> void translateGroupByKey(PTransformNode transformNode, RunnerApi.Pipeline pipeline, SparkTranslationContext context) {<NEW_LINE>RunnerApi.Components components = pipeline.getComponents();<NEW_LINE>String inputId = getInputId(transformNode);<NEW_LINE>Dataset inputDataset = context.popDataset(inputId);<NEW_LINE>JavaRDD<WindowedValue<KV<K, V>>> inputRdd = ((BoundedDataset<KV<K, V>>) inputDataset).getRDD();<NEW_LINE>WindowedValueCoder<KV<K, V>> inputCoder = getWindowedValueCoder(inputId, components);<NEW_LINE>KvCoder<K, V> inputKvCoder = (KvCoder<K, V>) inputCoder.getValueCoder();<NEW_LINE>Coder<K> inputKeyCoder = inputKvCoder.getKeyCoder();<NEW_LINE>Coder<V> inputValueCoder = inputKvCoder.getValueCoder();<NEW_LINE>WindowingStrategy windowingStrategy = getWindowingStrategy(inputId, components);<NEW_LINE>WindowFn<Object, BoundedWindow> windowFn = windowingStrategy.getWindowFn();<NEW_LINE>WindowedValue.WindowedValueCoder<V> wvCoder = WindowedValue.FullWindowedValueCoder.of(inputValueCoder, windowFn.windowCoder());<NEW_LINE>JavaRDD<WindowedValue<KV<K, Iterable<V>>>> groupedByKeyAndWindow;<NEW_LINE>Partitioner partitioner = getPartitioner(context);<NEW_LINE>// As this is batch, we can ignore triggering and allowed lateness parameters.<NEW_LINE>if (windowingStrategy.getWindowFn().equals(new GlobalWindows()) && windowingStrategy.getTimestampCombiner().equals(TimestampCombiner.END_OF_WINDOW)) {<NEW_LINE>// we can drop the windows and recover them later<NEW_LINE>groupedByKeyAndWindow = GroupNonMergingWindowsFunctions.groupByKeyInGlobalWindow(<MASK><NEW_LINE>} else if (GroupNonMergingWindowsFunctions.isEligibleForGroupByWindow(windowingStrategy)) {<NEW_LINE>// we can have a memory sensitive translation for non-merging windows<NEW_LINE>groupedByKeyAndWindow = GroupNonMergingWindowsFunctions.groupByKeyAndWindow(inputRdd, inputKeyCoder, inputValueCoder, windowingStrategy, partitioner);<NEW_LINE>} else {<NEW_LINE>JavaRDD<KV<K, Iterable<WindowedValue<V>>>> groupedByKeyOnly = GroupCombineFunctions.groupByKeyOnly(inputRdd, inputKeyCoder, wvCoder, partitioner);<NEW_LINE>// for batch, GroupAlsoByWindow uses an in-memory StateInternals.<NEW_LINE>groupedByKeyAndWindow = groupedByKeyOnly.flatMap(new SparkGroupAlsoByWindowViaOutputBufferFn<>(windowingStrategy, new TranslationUtils.InMemoryStateInternalsFactory<>(), SystemReduceFn.buffering(inputValueCoder), context.serializablePipelineOptions));<NEW_LINE>}<NEW_LINE>context.pushDataset(getOutputId(transformNode), new BoundedDataset<>(groupedByKeyAndWindow));<NEW_LINE>} | inputRdd, inputKeyCoder, inputValueCoder, partitioner); |
1,580,443 | public void actionPerformed(ActionEvent event) {<NEW_LINE>Queue<PageFlowSceneElement> deleteNodesList <MASK><NEW_LINE>// Workaround: Temporarily Wrapping Collection because of Issue: 100127<NEW_LINE>Set<Object> selectedObjects = new HashSet<Object>(scene.getSelectedObjects());<NEW_LINE>LOG.fine("Selected Objects: " + selectedObjects);<NEW_LINE>LOG.finest("Scene: \n" + "Nodes: " + scene.getNodes() + "\n" + "Edges: " + scene.getEdges() + "\n" + "Pins: " + scene.getPins());<NEW_LINE>Set<Object> nonEdgeSelectedObjects = new HashSet<Object>();<NEW_LINE>for (Object selectedObj : selectedObjects) {<NEW_LINE>if (selectedObj instanceof PageFlowSceneElement) {<NEW_LINE>if (scene.isEdge(selectedObj)) {<NEW_LINE>assert !scene.isPin(selectedObj);<NEW_LINE>selectedEdges.add((NavigationCaseEdge) selectedObj);<NEW_LINE>} else {<NEW_LINE>assert scene.isNode(selectedObj) || scene.isPin(selectedObj);<NEW_LINE>selectedNonEdges.add((PageFlowSceneElement) selectedObj);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = new LinkedList<PageFlowSceneElement>(); |
1,418,999 | public void writeTo(StreamOutput out) throws IOException {<NEW_LINE>out.writeVInt(entries.size());<NEW_LINE>for (ObjectCursor<Entry> v : entries.values()) {<NEW_LINE>Entry entry = v.value;<NEW_LINE>if (out.getVersion().onOrAfter(Version.V_4_3_0)) {<NEW_LINE>out.writeString(entry.uuid);<NEW_LINE>}<NEW_LINE>entry.snapshot().writeTo(out);<NEW_LINE>out.writeByte(entry.state().value());<NEW_LINE>out.writeVInt(entry.indices().size());<NEW_LINE>for (String index : entry.indices()) {<NEW_LINE>out.writeString(index);<NEW_LINE>}<NEW_LINE>out.writeVInt(entry.<MASK><NEW_LINE>for (ObjectObjectCursor<ShardId, ShardRestoreStatus> shardEntry : entry.shards()) {<NEW_LINE>shardEntry.key.writeTo(out);<NEW_LINE>shardEntry.value.writeTo(out);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | shards().size()); |
234,911 | public ASTNode visitResetOption(final ResetOptionContext ctx) {<NEW_LINE>if (null != ctx.MASTER()) {<NEW_LINE>ResetMasterOptionSegment result = new ResetMasterOptionSegment();<NEW_LINE>if (null != ctx.binaryLogFileIndexNumber()) {<NEW_LINE>result.setBinaryLogFileIndexNumber((NumberLiteralValue) visit(ctx.binaryLogFileIndexNumber()));<NEW_LINE>}<NEW_LINE>result.setStartIndex(ctx.start.getStartIndex());<NEW_LINE>result.setStopIndex(ctx.stop.getStopIndex());<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>ResetSlaveOptionSegment result = new ResetSlaveOptionSegment();<NEW_LINE>if (null != ctx.ALL()) {<NEW_LINE>result.setAll(true);<NEW_LINE>}<NEW_LINE>if (null != ctx.channelOption()) {<NEW_LINE>result.setChannelOption((StringLiteralValue) visit(ctx.channelOption()));<NEW_LINE>}<NEW_LINE>result.setStartIndex(ctx.start.getStartIndex());<NEW_LINE>result.setStopIndex(<MASK><NEW_LINE>return result;<NEW_LINE>} | ctx.stop.getStopIndex()); |
1,184,659 | public void pointerReleasedImpl(int x, int y, boolean longPress) {<NEW_LINE>if (!isDragActivated()) {<NEW_LINE>// fire the action event into the selected component<NEW_LINE>Component cmp = renderer.getCellRendererComponent(ContainerList.this, model, model.getItemAt(offset), offset, hasFocus());<NEW_LINE>if (cmp instanceof Container) {<NEW_LINE>int absX = getAbsoluteX();<NEW_LINE>int absY = getAbsoluteY();<NEW_LINE>int newX = x - absX + cmp.getX();<NEW_LINE>int newY = y - absY + cmp.getY();<NEW_LINE>Component selectionCmp = ((Container) cmp).getComponentAt(newX, newY);<NEW_LINE>if (selectionCmp != null) {<NEW_LINE>selectionCmp.setX(0);<NEW_LINE>selectionCmp.setY(0);<NEW_LINE>if (longPress) {<NEW_LINE>selectionCmp.longPointerPress(newX, newY);<NEW_LINE>fireActionEvent(new ActionEvent(ContainerList.this, x, y, true));<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>selectionCmp.pointerReleased(newX, newY);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>fireActionEvent(new ActionEvent(ContainerList.this, x, y, longPress));<NEW_LINE>}<NEW_LINE>} | selectionCmp.pointerPressed(newX, newY); |
454,451 | public void parse() {<NEW_LINE>for (String nextResourceName : myResourceNames) {<NEW_LINE>RuntimeResourceDefinition def = <MASK><NEW_LINE>Resource resource = new Resource();<NEW_LINE>resource.setName(def.getName());<NEW_LINE>resource.setElementName(def.getName());<NEW_LINE>addResource(resource);<NEW_LINE>for (RuntimeSearchParam nextSearchParam : def.getSearchParams()) {<NEW_LINE>SearchParameter param = new SearchParameter(getVersion(), def.getName());<NEW_LINE>List<RuntimeSearchParam> compositeOfParams = nextSearchParam.getComponents().stream().map(t -> def.getSearchParams().stream().filter(y -> y.getUri().equals(t.getReference())).findFirst().orElseThrow(() -> new IllegalStateException())).collect(Collectors.toList());<NEW_LINE>if (nextSearchParam.getParamType() == RestSearchParameterTypeEnum.COMPOSITE && compositeOfParams.size() != 2) {<NEW_LINE>throw new IllegalStateException(Msg.code(163) + "Search param " + nextSearchParam.getName() + " on base " + nextSearchParam.getBase() + " has components: " + nextSearchParam.getComponents());<NEW_LINE>}<NEW_LINE>param.setName(nextSearchParam.getName());<NEW_LINE>param.setDescription(nextSearchParam.getDescription());<NEW_LINE>param.setCompositeOf(toCompositeOfStrings(compositeOfParams));<NEW_LINE>param.setCompositeTypes(toCompositeOfTypes(compositeOfParams));<NEW_LINE>param.setPath(nextSearchParam.getPath());<NEW_LINE>param.setType(nextSearchParam.getParamType().getCode());<NEW_LINE>resource.addSearchParameter(param);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getCtx().getResourceDefinition(nextResourceName); |
670,182 | private void downloadFormList() {<NEW_LINE>if (!connectivityProvider.isDeviceOnline()) {<NEW_LINE>ToastUtils.showShortToast(this, R.string.no_connection);<NEW_LINE>if (viewModel.isDownloadOnlyMode()) {<NEW_LINE>setReturnResult(false, getString(R.string.no_connection), viewModel.getFormResults());<NEW_LINE>finish();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>viewModel.clearFormDetailsByFormId();<NEW_LINE>DialogFragmentUtils.showIfNotShowing(RefreshFormListDialogFragment.class, getSupportFragmentManager());<NEW_LINE>if (downloadFormListTask != null && downloadFormListTask.getStatus() != AsyncTask.Status.FINISHED) {<NEW_LINE>// we are already doing the download!!!<NEW_LINE>return;<NEW_LINE>} else if (downloadFormListTask != null) {<NEW_LINE>downloadFormListTask.setDownloaderListener(null);<NEW_LINE>downloadFormListTask.cancel(true);<NEW_LINE>downloadFormListTask = null;<NEW_LINE>}<NEW_LINE>if (viewModel.isDownloadOnlyMode()) {<NEW_LINE>// Handle external app download case with different server<NEW_LINE>downloadFormListTask = new DownloadFormListTask(serverFormsDetailsFetcher);<NEW_LINE>downloadFormListTask.setAlternateCredentials(webCredentialsUtils, viewModel.getUrl(), viewModel.getUsername(<MASK><NEW_LINE>downloadFormListTask.setDownloaderListener(this);<NEW_LINE>downloadFormListTask.execute();<NEW_LINE>} else {<NEW_LINE>downloadFormListTask = new DownloadFormListTask(serverFormsDetailsFetcher);<NEW_LINE>downloadFormListTask.setDownloaderListener(this);<NEW_LINE>downloadFormListTask.execute();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ), viewModel.getPassword()); |
622,681 | public void processTask(long taskId, Metadata metadata) {<NEW_LINE>int indent = metadata.getValue(GtasksMetadata.INDENT);<NEW_LINE>try {<NEW_LINE>long parent, sibling;<NEW_LINE>if (indent > previousIndent.get()) {<NEW_LINE>parent = previousTask.get();<NEW_LINE>sibling = Task.NO_ID;<NEW_LINE>} else if (indent == previousIndent.get()) {<NEW_LINE>sibling = previousTask.get();<NEW_LINE>parent = parents.get(sibling);<NEW_LINE>} else {<NEW_LINE>// move up once for each indent<NEW_LINE>sibling = previousTask.get();<NEW_LINE>for (int i = indent; i < previousIndent.get(); i++) <MASK><NEW_LINE>if (parents.containsKey(sibling))<NEW_LINE>parent = parents.get(sibling);<NEW_LINE>else<NEW_LINE>parent = Task.NO_ID;<NEW_LINE>}<NEW_LINE>parents.put(taskId, parent);<NEW_LINE>siblings.put(taskId, sibling);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>Log.e("gtasks-task-updating", "Caught exception", e);<NEW_LINE>}<NEW_LINE>previousTask.set(taskId);<NEW_LINE>previousIndent.set(indent);<NEW_LINE>if (!TextUtils.isEmpty(metadata.getValue(GtasksMetadata.ID)))<NEW_LINE>localToRemoteIdMap.put(taskId, metadata.getValue(GtasksMetadata.ID));<NEW_LINE>} | sibling = parents.get(sibling); |
332,809 | public static Map<String, String> patch(final String address, final String requestBody, final String username, final String password, final String proxyUrl, final String proxyUsername, final String proxyPassword, final String cookie, final Map<String, String> headers, final String charset) {<NEW_LINE>final Map<String, String> responseData = new HashMap<>();<NEW_LINE>try {<NEW_LINE>final URI url = URI.create(address);<NEW_LINE>final HttpPut req = new HttpPatch(url);<NEW_LINE>configure(req, charset, username, password, proxyUrl, proxyUsername, <MASK><NEW_LINE>req.setEntity(new StringEntity(requestBody, charset));<NEW_LINE>final CloseableHttpResponse response = client.execute(req);<NEW_LINE>final HttpEntity entity = response.getEntity();<NEW_LINE>String content = null;<NEW_LINE>if (entity != null) {<NEW_LINE>final InputStream responseContent = entity.getContent();<NEW_LINE>if (responseContent != null) {<NEW_LINE>content = IOUtils.toString(responseContent, charset(response));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>content = skipBOMIfPresent(content);<NEW_LINE>responseData.put("body", content);<NEW_LINE>responseData.put("status", Integer.toString(response.getStatusLine().getStatusCode()));<NEW_LINE>for (final Header header : response.getAllHeaders()) {<NEW_LINE>responseData.put(header.getName(), header.getValue());<NEW_LINE>}<NEW_LINE>} catch (final Throwable t) {<NEW_LINE>logger.error("Unable to fetch content from address {}, {}", new Object[] { address, t.getMessage() });<NEW_LINE>}<NEW_LINE>return responseData;<NEW_LINE>} | proxyPassword, cookie, headers, true); |
522,071 | private List<Hierarchy> axisInfo(SaxWriter writer, CellSetAxis axis, String axisName) {<NEW_LINE>writer.startElement("AxisInfo", "name", axisName);<NEW_LINE>List<Hierarchy> hierarchies;<NEW_LINE>List<Property> props = new ArrayList<>(getProps(axis.getAxisMetaData()));<NEW_LINE>Iterator<org.olap4j.Position> it = axis.getPositions().iterator();<NEW_LINE>if (it.hasNext()) {<NEW_LINE>final org.olap4j.<MASK><NEW_LINE>hierarchies = new ArrayList<Hierarchy>();<NEW_LINE>for (Member member : position.getMembers()) {<NEW_LINE>hierarchies.add(member.getHierarchy());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>hierarchies = axis.getAxisMetaData().getHierarchies();<NEW_LINE>}<NEW_LINE>// remove a property without a valid associated hierarchy<NEW_LINE>props.removeIf(prop -> !isValidProp(axis.getPositions(), prop));<NEW_LINE>writeHierarchyInfo(writer, hierarchies, props);<NEW_LINE>// AxisInfo<NEW_LINE>writer.endElement();<NEW_LINE>return hierarchies;<NEW_LINE>} | Position position = it.next(); |
1,441,973 | public void INVOKEDYNAMIC(Object indyResult, String owner) {<NEW_LINE>final Class<?> anonymousClass = indyResult.getClass();<NEW_LINE>if (!LambdaUtils.isLambda(anonymousClass))<NEW_LINE>throw new IllegalArgumentException("InvokeDynamic for things other than lambdas are not implemented yet!, class found: " + anonymousClass.getName());<NEW_LINE>// Add it as lambda owner<NEW_LINE>env.heap.buildNewLambdaConstant(anonymousClass, conf.isIgnored(owner));<NEW_LINE>Type <MASK><NEW_LINE>// prepare symbolic fields<NEW_LINE>env.ensurePrepared(anonymousClass);<NEW_LINE>// Create reference<NEW_LINE>final ReferenceConstant symbolicRef = env.heap.buildNewReferenceConstant(anonymousClassType);<NEW_LINE>env.heap.initializeReference(indyResult, symbolicRef);<NEW_LINE>final Field[] fields = anonymousClass.getDeclaredFields();<NEW_LINE>for (int i = fields.length - 1; i >= 0; i--) {<NEW_LINE>Operand symbolicOperand = env.topFrame().operandStack.popOperand();<NEW_LINE>Expression<?> symbolicValue = OperandUtils.retrieveOperandExpression(symbolicOperand);<NEW_LINE>env.heap.putField(anonymousClass.getName(), fields[i].getName(), anonymousClass, symbolicRef, symbolicValue);<NEW_LINE>}<NEW_LINE>// Symbolic instance produced by invokedynamic<NEW_LINE>env.topFrame().operandStack.pushRef(symbolicRef);<NEW_LINE>} | anonymousClassType = Type.getType(anonymousClass); |
717,487 | private void init(Context context, AttributeSet attrs) {<NEW_LINE>TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.ColorPanelView);<NEW_LINE>shape = a.getInt(R.<MASK><NEW_LINE>showOldColor = a.getBoolean(R.styleable.ColorPanelView_cpv_showOldColor, false);<NEW_LINE>if (showOldColor && shape != ColorShape.CIRCLE) {<NEW_LINE>throw new IllegalStateException("Color preview is only available in circle mode");<NEW_LINE>}<NEW_LINE>borderColor = a.getColor(R.styleable.ColorPanelView_cpv_borderColor, DEFAULT_BORDER_COLOR);<NEW_LINE>a.recycle();<NEW_LINE>if (borderColor == DEFAULT_BORDER_COLOR) {<NEW_LINE>// If no specific border color has been set we take the default secondary text color as border/slider color.<NEW_LINE>// Thus it will adopt to theme changes automatically.<NEW_LINE>final TypedValue value = new TypedValue();<NEW_LINE>TypedArray typedArray = context.obtainStyledAttributes(value.data, new int[] { android.R.attr.textColorSecondary });<NEW_LINE>borderColor = typedArray.getColor(0, borderColor);<NEW_LINE>typedArray.recycle();<NEW_LINE>}<NEW_LINE>borderWidthPx = DrawingUtils.dpToPx(context, 1);<NEW_LINE>borderPaint = new Paint();<NEW_LINE>borderPaint.setAntiAlias(true);<NEW_LINE>colorPaint = new Paint();<NEW_LINE>colorPaint.setAntiAlias(true);<NEW_LINE>if (showOldColor) {<NEW_LINE>originalPaint = new Paint();<NEW_LINE>}<NEW_LINE>if (shape == ColorShape.CIRCLE) {<NEW_LINE>Bitmap bitmap = ((BitmapDrawable) context.getResources().getDrawable(R.drawable.cpv_alpha)).getBitmap();<NEW_LINE>alphaPaint = new Paint();<NEW_LINE>alphaPaint.setAntiAlias(true);<NEW_LINE>BitmapShader shader = new BitmapShader(bitmap, Shader.TileMode.REPEAT, Shader.TileMode.REPEAT);<NEW_LINE>alphaPaint.setShader(shader);<NEW_LINE>}<NEW_LINE>} | styleable.ColorPanelView_cpv_colorShape, ColorShape.CIRCLE); |
103,285 | private UnionTypeExtensionDefinition createUnionTypeExtensionDefinition(@NotNull GraphQLUnionTypeExtensionDefinition extensionDefinition) {<NEW_LINE>UnionTypeExtensionDefinition.Builder def = UnionTypeExtensionDefinition.newUnionTypeExtensionDefinition();<NEW_LINE>GraphQLTypeName typeName = extensionDefinition.getTypeName();<NEW_LINE>if (typeName != null) {<NEW_LINE>def.<MASK><NEW_LINE>}<NEW_LINE>addCommonData(def, extensionDefinition);<NEW_LINE>def.directives(createDirectives(extensionDefinition.getDirectives()));<NEW_LINE>List<Type> members = new ArrayList<>();<NEW_LINE>GraphQLUnionMembership unionMembership = extensionDefinition.getUnionMembership();<NEW_LINE>if (unionMembership != null) {<NEW_LINE>GraphQLUnionMembers unionMembers = unionMembership.getUnionMembers();<NEW_LINE>if (unionMembers != null) {<NEW_LINE>for (GraphQLTypeName name : unionMembers.getTypeNameList()) {<NEW_LINE>TypeName newTypeName = createTypeName(name);<NEW_LINE>if (newTypeName != null) {<NEW_LINE>members.add(newTypeName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>def.memberTypes(members);<NEW_LINE>}<NEW_LINE>return checkNode(def.build());<NEW_LINE>} | name(typeName.getName()); |
1,140,575 | private boolean isNeedInfer(SlotRef newSlot, SlotRef checkSlot, Analyzer analyzer, ExprRewriter.ClauseType clauseType) {<NEW_LINE>boolean ret = false;<NEW_LINE>TupleId newTid = newSlot.getDesc().getParent().getRef().getId();<NEW_LINE>TupleId checkTid = checkSlot.getDesc().getParent().getRef().getId();<NEW_LINE>boolean needChange = false;<NEW_LINE>Pair<TupleId, TupleId> tids = new Pair<>(newTid, checkTid);<NEW_LINE>if (analyzer.isContainTupleIds(tids)) {<NEW_LINE>JoinOperator joinOperator = analyzer.getAnyTwoTablesJoinOp(tids);<NEW_LINE>ret = checkNeedInfer(joinOperator, needChange, clauseType);<NEW_LINE>} else {<NEW_LINE>Pair<TupleId, TupleId> changeTids = new Pair<>(checkTid, newTid);<NEW_LINE>if (analyzer.isContainTupleIds(changeTids)) {<NEW_LINE>needChange = true;<NEW_LINE>JoinOperator <MASK><NEW_LINE>ret = checkNeedInfer(joinOperator, needChange, clauseType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | joinOperator = analyzer.getAnyTwoTablesJoinOp(changeTids); |
805,635 | private void showEvent() {<NEW_LINE>if (!event.isValid())<NEW_LINE>return;<NEW_LINE>try {<NEW_LINE>int id = SharedPreferencesUtil.getInt(ConstantStrings.SESSION_MAP_ID, -1);<NEW_LINE>if (id != -1) {<NEW_LINE>Session session = realmRepo.getSessionSync(id);<NEW_LINE>Microlocation microlocation = session.getMicrolocation();<NEW_LINE>if (microlocation.getLatitude() == 0 && microlocation.getLongitude() == 0) {<NEW_LINE>setDestinationLatitude(event.getLatitude());<NEW_LINE>setDestinationLongitude(event.getLongitude());<NEW_LINE>setDestinationName(event.getLocationName());<NEW_LINE>} else {<NEW_LINE>setDestinationLatitude(microlocation.getLatitude());<NEW_LINE><MASK><NEW_LINE>setDestinationName(microlocation.getName());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>setDestinationLatitude(event.getLatitude());<NEW_LINE>setDestinationLongitude(event.getLongitude());<NEW_LINE>setDestinationName(event.getLocationName());<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>setDestinationLatitude(event.getLatitude());<NEW_LINE>setDestinationLongitude(event.getLongitude());<NEW_LINE>setDestinationName(event.getLocationName());<NEW_LINE>}<NEW_LINE>} | setDestinationLongitude(microlocation.getLongitude()); |
1,046,785 | public void updateUiElements() {<NEW_LINE>super.updateUiElements();<NEW_LINE>toolbar.setBackgroundColor(getPrimaryColor());<NEW_LINE>setStatusBarColor();<NEW_LINE>setNavBarColor();<NEW_LINE>setRecentApp(getString(org.horaapps.leafpic.R.string.donate));<NEW_LINE>themeSeekBar(bar);<NEW_LINE>themeButton(btnDonateIap);<NEW_LINE>themeButton(btnDonatePP);<NEW_LINE>((TextView) findViewById(org.horaapps.leafpic.R.id.team_name)).setTextColor(getAccentColor());<NEW_LINE>((TextView) findViewById(org.horaapps.leafpic.R.id.donate_googleplay_item_title)).setTextColor(getAccentColor());<NEW_LINE>((TextView) findViewById(org.horaapps.leafpic.R.id.donate_paypal_item_title)).setTextColor(getAccentColor());<NEW_LINE>((TextView) findViewById(org.horaapps.leafpic.R.id.donate_bitcoin_item_title)).setTextColor(getAccentColor());<NEW_LINE>findViewById(org.horaapps.leafpic.R.id.donate_background).setBackgroundColor(getBackgroundColor());<NEW_LINE>int color = getCardBackgroundColor();<NEW_LINE>((CardView) findViewById(org.horaapps.leafpic.R.id.donate_googleplay_card)).setCardBackgroundColor(color);<NEW_LINE>((CardView) findViewById(org.horaapps.leafpic.R.id.donate_paypal_card)).setCardBackgroundColor(color);<NEW_LINE>((CardView) findViewById(org.horaapps.leafpic.R.id.donate_bitcoin_card)).setCardBackgroundColor(color);<NEW_LINE>((CardView) findViewById(org.horaapps.leafpic.R.id.donate_header_card)).setCardBackgroundColor(color);<NEW_LINE>color = getIconColor();<NEW_LINE>((ThemedIcon) findViewById(org.horaapps.leafpic.R.id.donate_googleplay_icon_title)).setColor(color);<NEW_LINE>((ThemedIcon) findViewById(org.horaapps.leafpic.R.id.donate_paypal_icon_title)).setColor(color);<NEW_LINE>((ThemedIcon) findViewById(org.horaapps.leafpic.R.id.donate_bitcoin_icon_title)).setColor(color);<NEW_LINE>((ThemedIcon) findViewById(org.horaapps.leafpic.R.id.donate_header_icon)).setColor(color);<NEW_LINE>color = getTextColor();<NEW_LINE>((TextView) findViewById(org.horaapps.leafpic.R.id.donate_googleplay_item)).setTextColor(color);<NEW_LINE>((TextView) findViewById(org.horaapps.leafpic.R.id.donate_paypal_item)).setTextColor(color);<NEW_LINE>((TextView) findViewById(org.horaapps.leafpic.R.id.donate_bitcoin_item)).setTextColor(color);<NEW_LINE>((TextView) findViewById(org.horaapps.leafpic.R.id.<MASK><NEW_LINE>setScrollViewColor(scr);<NEW_LINE>} | donate_header_item)).setTextColor(color); |
816,188 | public void store() throws IOException {<NEW_LINE>Preferences prefs = prefs(suiteProject);<NEW_LINE>prefs.putBoolean(GENERATE_FOR_WINDOWS, windowsModel.isSelected());<NEW_LINE>prefs.putBoolean(GENERATE_FOR_LINUX, linuxModel.isSelected());<NEW_LINE>prefs.putBoolean(GENERATE_FOR_SOLARIS, solarisModel.isSelected());<NEW_LINE>prefs.putBoolean(GENERATE_FOR_MAC, macModel.isSelected());<NEW_LINE>String licenseName = (String) licenseModel.getSelectedItem();<NEW_LINE>if (licenseName != null) {<NEW_LINE>int index = licenseModel.getNames().indexOf(licenseName);<NEW_LINE>if (index != -1) {<NEW_LINE>String type = licenseModel.getTypes().get(index);<NEW_LINE>if (type.equals(LICENSE_TYPE_FILE)) {<NEW_LINE>File suiteLocation = FileUtil.toFile(suiteProject.getProjectDirectory());<NEW_LINE>File f = PropertyUtils.resolveFile(suiteLocation, licenseName);<NEW_LINE>String rel = <MASK><NEW_LINE>if (rel != null) {<NEW_LINE>prefs.put(LICENSE_FILE, rel);<NEW_LINE>} else {<NEW_LINE>prefs.put(LICENSE_FILE, f.getAbsolutePath());<NEW_LINE>}<NEW_LINE>prefs.remove(LICENSE_TYPE);<NEW_LINE>} else {<NEW_LINE>prefs.put(LICENSE_TYPE, type);<NEW_LINE>prefs.remove(LICENSE_FILE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | PropertyUtils.relativizeFile(suiteLocation, f); |
371,277 | protected boolean supportsViewFor(Application app) {<NEW_LINE>if (!(ApplicationTypeFactory.getApplicationTypeFor(app) instanceof GlassFishApplicationType))<NEW_LINE>return false;<NEW_LINE>final JmxModel <MASK><NEW_LINE>if (model == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>DomainRoot dr = AMXUtil.getDomainRoot(model);<NEW_LINE>if (dr == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final Map<String, ServerRootMonitor> serverMonitors = dr.getMonitoringRoot().getServerRootMonitorMap();<NEW_LINE>final String serverName = JMXUtil.getServerName(model);<NEW_LINE>if (serverMonitors.get(serverName) == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>HTTPServiceMonitor httpMonitor = serverMonitors.get(serverName).getHTTPServiceMonitor();<NEW_LINE>ModuleMonitoringLevelsConfig monitorConfig = AMXUtil.getMonitoringConfig(model);<NEW_LINE>if (!monitorConfig.getHTTPService().equals(ModuleMonitoringLevelValues.OFF)) {<NEW_LINE>return httpMonitor != null;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | model = JmxModelFactory.getJmxModelFor(app); |
1,098,781 | private void initializeUnsafeOffsets(TypeSpec.Builder builder, TypeElement encodedType, List<? extends VariableElement> parameters) {<NEW_LINE>MethodSpec.Builder constructor = MethodSpec.constructorBuilder();<NEW_LINE>for (VariableElement param : parameters) {<NEW_LINE>Optional<FieldValueAndClass> field = getFieldByNameRecursive(encodedType, param.getSimpleName().toString());<NEW_LINE>if (!field.isPresent()) {<NEW_LINE>// Will attempt to use a getter for this field instead.<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>builder.addField(TypeName.LONG, param.getSimpleName() + "_offset", <MASK><NEW_LINE>constructor.beginControlFlow("try");<NEW_LINE>constructor.addStatement("this.$L_offset = $T.unsafe().objectFieldOffset($T.class.getDeclaredField(\"$L\"))", param.getSimpleName(), UnsafeProvider.class, ClassName.get(field.get().declaringClassType), param.getSimpleName());<NEW_LINE>constructor.nextControlFlow("catch ($T e)", NoSuchFieldException.class);<NEW_LINE>constructor.addStatement("throw new $T(e)", IllegalStateException.class);<NEW_LINE>constructor.endControlFlow();<NEW_LINE>}<NEW_LINE>builder.addMethod(constructor.build());<NEW_LINE>} | Modifier.PRIVATE, Modifier.FINAL); |
1,809,283 | private com.netflix.genie.proto.JobMetadata toJobMetadataProto(final AgentJobRequest jobRequest) throws GenieConversionException {<NEW_LINE>final JobMetadata jobMetadata = jobRequest.getMetadata();<NEW_LINE>final ExecutionEnvironment jobResources = jobRequest.getResources();<NEW_LINE>final com.netflix.genie.proto.JobMetadata.Builder builder = com.netflix.genie<MASK><NEW_LINE>jobRequest.getRequestedId().ifPresent(builder::setId);<NEW_LINE>builder.setName(jobMetadata.getName());<NEW_LINE>builder.setUser(jobMetadata.getUser());<NEW_LINE>builder.setVersion(jobMetadata.getVersion());<NEW_LINE>jobMetadata.getDescription().ifPresent(builder::setDescription);<NEW_LINE>builder.addAllTags(jobMetadata.getTags());<NEW_LINE>if (jobMetadata.getMetadata().isPresent()) {<NEW_LINE>final String serializedMetadata;<NEW_LINE>try {<NEW_LINE>serializedMetadata = GenieObjectMapper.getMapper().writeValueAsString(jobMetadata.getMetadata().get());<NEW_LINE>} catch (JsonProcessingException e) {<NEW_LINE>throw new GenieConversionException("Failed to serialize job metadata to JSON", e);<NEW_LINE>}<NEW_LINE>builder.setMetadata(serializedMetadata);<NEW_LINE>}<NEW_LINE>jobMetadata.getEmail().ifPresent(builder::setEmail);<NEW_LINE>jobMetadata.getGrouping().ifPresent(builder::setGrouping);<NEW_LINE>jobMetadata.getGroupingInstance().ifPresent(builder::setGroupingInstance);<NEW_LINE>jobResources.getSetupFile().ifPresent(builder::setSetupFile);<NEW_LINE>builder.addAllConfigs(jobResources.getConfigs());<NEW_LINE>builder.addAllDependencies(jobResources.getDependencies());<NEW_LINE>builder.addAllCommandArgs(jobRequest.getCommandArgs());<NEW_LINE>return builder.build();<NEW_LINE>} | .proto.JobMetadata.newBuilder(); |
1,284,940 | public static byte[] buildPsshAtom(UUID systemId, @Nullable UUID[] keyIds, @Nullable byte[] data) {<NEW_LINE>int dataLength = data <MASK><NEW_LINE>int psshBoxLength = Atom.FULL_HEADER_SIZE + 16 + /* SystemId */<NEW_LINE>4 + /* DataSize */<NEW_LINE>dataLength;<NEW_LINE>if (keyIds != null) {<NEW_LINE>psshBoxLength += 4 + /* KID_count */<NEW_LINE>(keyIds.length * 16);<NEW_LINE>}<NEW_LINE>ByteBuffer psshBox = ByteBuffer.allocate(psshBoxLength);<NEW_LINE>psshBox.putInt(psshBoxLength);<NEW_LINE>psshBox.putInt(Atom.TYPE_pssh);<NEW_LINE>psshBox.putInt(keyIds != null ? 0x01000000 : 0);<NEW_LINE>psshBox.putLong(systemId.getMostSignificantBits());<NEW_LINE>psshBox.putLong(systemId.getLeastSignificantBits());<NEW_LINE>if (keyIds != null) {<NEW_LINE>psshBox.putInt(keyIds.length);<NEW_LINE>for (UUID keyId : keyIds) {<NEW_LINE>psshBox.putLong(keyId.getMostSignificantBits());<NEW_LINE>psshBox.putLong(keyId.getLeastSignificantBits());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (data != null && data.length != 0) {<NEW_LINE>psshBox.putInt(data.length);<NEW_LINE>psshBox.put(data);<NEW_LINE>}<NEW_LINE>// Else the last 4 bytes are a 0 DataSize.<NEW_LINE>return psshBox.array();<NEW_LINE>} | != null ? data.length : 0; |
369,446 | private T createInstanceForParameterizedType(CreationalContext<T> creationalContext, BeanManager beanManager) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {<NEW_LINE>Tr.entry(tc, "createInstanceForParameterizedType", creationalContext, beanManager);<NEW_LINE>}<NEW_LINE>T instance = null;<NEW_LINE>boolean isOptional = false;<NEW_LINE>ParameterizedType parameterizedType = (ParameterizedType) beanType;<NEW_LINE>Tr.debug(tc, "parameterizedType", parameterizedType);<NEW_LINE>Class<?> returnClass = (Class<<MASK><NEW_LINE>if (ClaimValue.class.isAssignableFrom(returnClass)) {<NEW_LINE>returnClass = getTypeClass(parameterizedType.getActualTypeArguments()[0]);<NEW_LINE>isOptional = Optional.class.isAssignableFrom(returnClass);<NEW_LINE>if (isOptional) {<NEW_LINE>Class<?> wrappedClass = getTypeClass(((ParameterizedType) parameterizedType.getActualTypeArguments()[0]).getActualTypeArguments()[0]);<NEW_LINE>instance = createClaimValueWithOptional(returnClass, wrappedClass);<NEW_LINE>} else {<NEW_LINE>instance = createClaimValue(returnClass);<NEW_LINE>}<NEW_LINE>} else if (Optional.class.isAssignableFrom(returnClass)) {<NEW_LINE>returnClass = getTypeClass(parameterizedType.getActualTypeArguments()[0]);<NEW_LINE>instance = (T) Optional.ofNullable(getPlainValue(returnClass, getCurrentJsonWebToken()));<NEW_LINE>} else {<NEW_LINE>instance = (T) getPlainValue(returnClass, getCurrentJsonWebToken());<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {<NEW_LINE>Tr.exit(tc, "createInstanceForParameterizedType", instance);<NEW_LINE>}<NEW_LINE>return instance;<NEW_LINE>} | ?>) parameterizedType.getRawType(); |
289,137 | final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(tagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TagResourceRequest> request = null;<NEW_LINE>Response<TagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new TagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(tagResourceRequest));<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, "Cognito Identity Provider");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TagResourceResultJsonUnmarshaller());<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,383,413 | public boolean install(String name, String url, String version) {<NEW_LINE>if (url.startsWith("---extensions---")) {<NEW_LINE>// url = RunTime.get().SikuliRepo + name + "-" + version + ".jar";<NEW_LINE>}<NEW_LINE>String extPath = fExtensions.getAbsolutePath();<NEW_LINE>String tmpdir = Commons<MASK><NEW_LINE>try {<NEW_LINE>File localFile = new File(FileManager.downloadURL(new URL(url), tmpdir));<NEW_LINE>String extName = localFile.getName();<NEW_LINE>File targetFile = new File(extPath, extName);<NEW_LINE>if (targetFile.exists()) {<NEW_LINE>targetFile.delete();<NEW_LINE>}<NEW_LINE>if (!localFile.renameTo(targetFile)) {<NEW_LINE>Debug.error("ExtensionManager: Failed to install " + localFile.getName() + " to " + targetFile.getAbsolutePath());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>addExtension(name, localFile.getAbsolutePath(), version);<NEW_LINE>} catch (IOException e) {<NEW_LINE>Debug.error("ExtensionManager: Failed to download " + url);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | .getIDETemp().getAbsolutePath(); |
614,734 | private byte[] createNewRef(int newRef, int forceLength) {<NEW_LINE>byte[] newRefBytes;<NEW_LINE>if ((forceLength == -1 && newRef <= 107) || forceLength == 1) {<NEW_LINE>newRefBytes = new byte[1];<NEW_LINE>newRefBytes[0] = (byte) (newRef + 139);<NEW_LINE>} else if ((forceLength == -1 && newRef <= 1131) || forceLength == 2) {<NEW_LINE>newRefBytes = new byte[2];<NEW_LINE>if (newRef <= 363) {<NEW_LINE>newRefBytes[0] = (byte) 247;<NEW_LINE>} else if (newRef <= 619) {<NEW_LINE>newRefBytes[0] = (byte) 248;<NEW_LINE>} else if (newRef <= 875) {<NEW_LINE>newRefBytes[0] = (byte) 249;<NEW_LINE>} else {<NEW_LINE>newRefBytes[0] = (byte) 250;<NEW_LINE>}<NEW_LINE>newRefBytes[1] = (byte) (newRef - 108);<NEW_LINE>} else {<NEW_LINE>newRefBytes = new byte[5];<NEW_LINE>newRefBytes[0] = (byte) 255;<NEW_LINE>newRefBytes[1] = (byte) (newRef >> 24);<NEW_LINE>newRefBytes[2] = (byte) (newRef >> 16);<NEW_LINE>newRefBytes[3] = (byte) (newRef >> 8);<NEW_LINE>newRefBytes<MASK><NEW_LINE>}<NEW_LINE>return newRefBytes;<NEW_LINE>} | [4] = (byte) newRef; |
422,980 | private void readAllServices() {<NEW_LINE>Document xml = getFboxXmlResponse(_url + "/" + TR064DOWNLOADFILE);<NEW_LINE>if (xml == null) {<NEW_LINE>logger.error("Could not read xml response services");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// get all service nodes<NEW_LINE>NodeList nlServices = xml.getElementsByTagName("service");<NEW_LINE>Node currentNode = null;<NEW_LINE>XPath xPath = XPathFactory.newInstance().newXPath();<NEW_LINE>for (int i = 0; i < nlServices.getLength(); i++) {<NEW_LINE>// iterate over all services fbox offered us<NEW_LINE>currentNode = nlServices.item(i);<NEW_LINE>Tr064Service trS = new Tr064Service();<NEW_LINE>try {<NEW_LINE>trS.setControlUrl((String) xPath.evaluate("controlURL", currentNode, XPathConstants.STRING));<NEW_LINE>trS.setEventSubUrl((String) xPath.evaluate("eventSubURL", currentNode, XPathConstants.STRING));<NEW_LINE>trS.setScpdurl((String) xPath.evaluate("SCPDURL", currentNode, XPathConstants.STRING));<NEW_LINE>trS.setServiceId((String) xPath.evaluate("serviceId"<MASK><NEW_LINE>trS.setServiceType((String) xPath.evaluate("serviceType", currentNode, XPathConstants.STRING));<NEW_LINE>} catch (XPathExpressionException e) {<NEW_LINE>logger.debug("Could not parse service {}", currentNode.getTextContent());<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>_allServices.put(trS.getServiceId(), trS);<NEW_LINE>}<NEW_LINE>} | , currentNode, XPathConstants.STRING)); |
729,520 | boolean computeFused(GrayF32 disparity) {<NEW_LINE>// If there's one pixel with a valid value this will pass<NEW_LINE>boolean singleValidPixel = false;<NEW_LINE>for (int y = 0; y < fused.height; y++) {<NEW_LINE>int indexOut = disparity.startIndex + y * disparity.stride;<NEW_LINE>for (int x = 0; x < fused.width; x++) {<NEW_LINE>DogArray_F32 values = <MASK><NEW_LINE>float outputValue;<NEW_LINE>if (values.size == 0) {<NEW_LINE>// mark this pixel as invalid. The disparity will be rescaled later on and the max value at this<NEW_LINE>// time isn't known<NEW_LINE>outputValue = Float.MAX_VALUE;<NEW_LINE>} else if (values.size == 1) {<NEW_LINE>singleValidPixel = true;<NEW_LINE>outputValue = values.data[0];<NEW_LINE>} else if (values.size == 2) {<NEW_LINE>singleValidPixel = true;<NEW_LINE>outputValue = 0.5f * (values.data[0] + values.data[1]);<NEW_LINE>} else {<NEW_LINE>// median value<NEW_LINE>outputValue = QuickSelect.select(values.data, values.size / 2, values.size);<NEW_LINE>singleValidPixel = true;<NEW_LINE>}<NEW_LINE>disparity.data[indexOut++] = outputValue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return singleValidPixel;<NEW_LINE>} | fused.get(x, y); |
1,297,521 | public void drawLayer(Canvas canvas, Matrix parentMatrix, int parentAlpha) {<NEW_LINE>int backgroundAlpha = Color.alpha(layerModel.getSolidColor());<NEW_LINE>if (backgroundAlpha == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int opacity = transform.getOpacity() == null ? 100 : transform.getOpacity().getValue();<NEW_LINE>int alpha = (int) (parentAlpha / 255f * (backgroundAlpha / 255f * opacity / 100f) * 255);<NEW_LINE>paint.setAlpha(alpha);<NEW_LINE>if (colorFilterAnimation != null) {<NEW_LINE>paint.setColorFilter(colorFilterAnimation.getValue());<NEW_LINE>}<NEW_LINE>if (alpha > 0) {<NEW_LINE>points[0] = 0;<NEW_LINE>points[1] = 0;<NEW_LINE>points[2] = layerModel.getSolidWidth();<NEW_LINE>points[3] = 0;<NEW_LINE>points[4] = layerModel.getSolidWidth();<NEW_LINE>points[5] = layerModel.getSolidHeight();<NEW_LINE>points[6] = 0;<NEW_LINE>points[7] = layerModel.getSolidHeight();<NEW_LINE>// We can't map rect here because if there is rotation on the transform then we aren't<NEW_LINE>// actually drawing a rect.<NEW_LINE>parentMatrix.mapPoints(points);<NEW_LINE>path.reset();<NEW_LINE>path.moveTo(points[0], points[1]);<NEW_LINE>path.lineTo(points[2], points[3]);<NEW_LINE>path.lineTo(points[4], points[5]);<NEW_LINE>path.lineTo(points[<MASK><NEW_LINE>path.lineTo(points[0], points[1]);<NEW_LINE>path.close();<NEW_LINE>canvas.drawPath(path, paint);<NEW_LINE>}<NEW_LINE>} | 6], points[7]); |
1,625,825 | public void modifyState(@FeatureFlags int key, boolean enabled) {<NEW_LINE>switch(key) {<NEW_LINE>case FEAT_INSTALLER:<NEW_LINE>modifyState(<MASK><NEW_LINE>break;<NEW_LINE>case FEAT_INTERCEPTOR:<NEW_LINE>modifyState(key, ActivityInterceptor.class, enabled);<NEW_LINE>break;<NEW_LINE>case FEAT_MANIFEST:<NEW_LINE>modifyState(key, ManifestViewerActivity.class, enabled);<NEW_LINE>break;<NEW_LINE>case FEAT_SCANNER:<NEW_LINE>modifyState(key, ScannerActivity.class, enabled);<NEW_LINE>break;<NEW_LINE>case FEAT_USAGE_ACCESS:<NEW_LINE>case FEAT_INTERNET:<NEW_LINE>// Only depends on flag<NEW_LINE>break;<NEW_LINE>case FEAT_LOG_VIEWER:<NEW_LINE>modifyState(key, LogViewerActivity.class, enabled);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// Modify flags<NEW_LINE>flags = enabled ? (flags | key) : (flags & ~key);<NEW_LINE>// Save to pref<NEW_LINE>AppPref.set(AppPref.PrefKey.PREF_ENABLED_FEATURES_INT, flags);<NEW_LINE>} | key, PackageInstallerActivity.class, enabled); |
1,488,063 | private static ParcelUuid parseUuidFrom(byte[] uuidBytes) {<NEW_LINE>if (uuidBytes == null) {<NEW_LINE>throw new IllegalArgumentException("uuidBytes cannot be null");<NEW_LINE>}<NEW_LINE>int length = uuidBytes.length;<NEW_LINE>if (length != UUID_BYTES_16_BIT && length != UUID_BYTES_32_BIT && length != UUID_BYTES_128_BIT) {<NEW_LINE>throw new IllegalArgumentException("uuidBytes length invalid - " + length);<NEW_LINE>}<NEW_LINE>// Construct a 128 bit UUID.<NEW_LINE>if (length == UUID_BYTES_128_BIT) {<NEW_LINE>ByteBuffer buf = ByteBuffer.wrap(uuidBytes).order(ByteOrder.LITTLE_ENDIAN);<NEW_LINE>long msb = buf.getLong(8);<NEW_LINE>long lsb = buf.getLong(0);<NEW_LINE>return new ParcelUuid(new UUID(msb, lsb));<NEW_LINE>}<NEW_LINE>// For 16 bit and 32 bit UUID we need to convert them to 128 bit value.<NEW_LINE>// 128_bit_value = uuid * 2^96 + BASE_UUID<NEW_LINE>long shortUuid;<NEW_LINE>if (length == UUID_BYTES_16_BIT) {<NEW_LINE>shortUuid = uuidBytes[0] & 0xFF;<NEW_LINE>shortUuid += (uuidBytes[1] & 0xFF) << 8;<NEW_LINE>} else {<NEW_LINE>shortUuid = uuidBytes[0] & 0xFF;<NEW_LINE>shortUuid += (uuidBytes[1] & 0xFF) << 8;<NEW_LINE>shortUuid += (uuidBytes[2] & 0xFF) << 16;<NEW_LINE>shortUuid += (uuidBytes[3] & 0xFF) << 24;<NEW_LINE>}<NEW_LINE>long msb = BASE_UUID.getMostSignificantBits() + (shortUuid << 32);<NEW_LINE>long lsb = BASE_UUID.getLeastSignificantBits();<NEW_LINE>return new ParcelUuid(<MASK><NEW_LINE>} | new UUID(msb, lsb)); |
400,262 | protected String doIt() throws Exception {<NEW_LINE>MDDFreight freightOrder = new MDDFreight(getCtx(), 0, get_TrxName());<NEW_LINE><MASK><NEW_LINE>freightOrder.setDD_Driver_ID(getDriverId());<NEW_LINE>freightOrder.setDD_Vehicle_ID(getVehicleId());<NEW_LINE>freightOrder.setDateDoc(getDateDoc());<NEW_LINE>freightOrder.setM_Shipper_ID(getShipperId());<NEW_LINE>if (getDateOrdered() == null) {<NEW_LINE>freightOrder.setDateOrdered(getDateDoc());<NEW_LINE>} else {<NEW_LINE>freightOrder.setDateOrdered(getDateOrdered());<NEW_LINE>}<NEW_LINE>if (getBPartnerId() > 0) {<NEW_LINE>freightOrder.setC_BPartner_ID(getBPartnerId());<NEW_LINE>}<NEW_LINE>if (getDocTypeId() > 0) {<NEW_LINE>freightOrder.setC_DocType_ID(getDocTypeId());<NEW_LINE>}<NEW_LINE>freightOrder.setDocAction(getDocAction());<NEW_LINE>freightOrder.setFreightAmt(getFreightAmt());<NEW_LINE>freightOrder.saveEx();<NEW_LINE>// Add lines from Outbound<NEW_LINE>MWMInOutBound outbound = new MWMInOutBound(getCtx(), getInOutBoundId(), get_TrxName());<NEW_LINE>int lineNo = 10;<NEW_LINE>MDDFreightLine line = new MDDFreightLine(getCtx(), 0, get_TrxName());<NEW_LINE>line.setDD_Freight_ID(freightOrder.getDD_Freight_ID());<NEW_LINE>line.setLine(lineNo);<NEW_LINE>line.setWeight(outbound.getWeight());<NEW_LINE>line.setVolume(outbound.getVolume());<NEW_LINE>// Set from client<NEW_LINE>MClientInfo clientInfo = MClientInfo.get(getCtx());<NEW_LINE>// Weight<NEW_LINE>if (clientInfo.getC_UOM_Weight_ID() <= 0) {<NEW_LINE>throw new AdempiereException("@C_UOM_Weight_ID@ @NotFound@ @SeeClientInfoConfig@");<NEW_LINE>}<NEW_LINE>// Volume<NEW_LINE>if (clientInfo.getC_UOM_Volume_ID() <= 0) {<NEW_LINE>throw new AdempiereException("@C_UOM_Volume_ID@ @NotFound@ @SeeClientInfoConfig@");<NEW_LINE>}<NEW_LINE>// Set values<NEW_LINE>line.setWeight_UOM_ID(clientInfo.getC_UOM_Weight_ID());<NEW_LINE>line.setVolume_UOM_ID(clientInfo.getC_UOM_Volume_ID());<NEW_LINE>if (getFreightId() != 0) {<NEW_LINE>line.setM_Freight_ID(getFreightId());<NEW_LINE>}<NEW_LINE>line.setFreightAmt(getFreightAmt());<NEW_LINE>line.saveEx();<NEW_LINE>// Complete<NEW_LINE>freightOrder.processIt(getDocAction());<NEW_LINE>freightOrder.saveEx();<NEW_LINE>// Add to log<NEW_LINE>addLog(freightOrder.getDD_Freight_ID(), freightOrder.getDateDoc(), null, "@Created@");<NEW_LINE>openResult(I_DD_Freight.Table_Name);<NEW_LINE>//<NEW_LINE>return "@DD_Freight_ID@ @Created@: " + freightOrder.getDocumentInfo();<NEW_LINE>} | freightOrder.setWM_InOutBound_ID(getInOutBoundId()); |
865,058 | public void buildUserInfo(List<ApiDefinitionResult> apis) {<NEW_LINE>if (CollectionUtils.isEmpty(apis)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Set<String> userIds = new HashSet<>();<NEW_LINE>apis.forEach(i -> {<NEW_LINE>userIds.add(i.getUserId());<NEW_LINE>userIds.<MASK><NEW_LINE>userIds.add(i.getCreateUser());<NEW_LINE>});<NEW_LINE>if (!org.apache.commons.collections.CollectionUtils.isEmpty(userIds)) {<NEW_LINE>Map<String, String> userMap = ServiceUtils.getUserNameMap(new ArrayList<>(userIds));<NEW_LINE>apis.forEach(caseResult -> {<NEW_LINE>caseResult.setCreateUser(userMap.get(caseResult.getCreateUser()));<NEW_LINE>caseResult.setDeleteUser(userMap.get(caseResult.getDeleteUserId()));<NEW_LINE>caseResult.setUserName(userMap.get(caseResult.getUserId()));<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | add(i.getDeleteUserId()); |
866,499 | public void run(RegressionEnvironment env) {<NEW_LINE>env.advanceTime(0);<NEW_LINE>String[] fields = new String[] { "theString" };<NEW_LINE>String epl = "create variable boolean KEEP = true;\n" + "@name('s0') select irstream * from SupportBean#expr(KEEP);\n";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>env.advanceTime(1000);<NEW_LINE>env.sendEventBean(new SupportBean("E1", 1));<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { "E1" } });<NEW_LINE>env.runtimeSetVariable("s0", "KEEP", false);<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { "E1" } });<NEW_LINE>env.listenerReset("s0");<NEW_LINE>env.advanceTime(1001);<NEW_LINE>env.assertPropsOld("s0", fields, new Object[] { "E1" });<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, null);<NEW_LINE>env.milestone(0);<NEW_LINE>env.sendEventBean(new SupportBean("E2", 2));<NEW_LINE>env.assertPropsIRPair("s0", fields, new Object[] { "E2" }, new Object[] { "E2" });<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, null);<NEW_LINE>env.runtimeSetVariable("s0", "KEEP", true);<NEW_LINE>env.sendEventBean(<MASK><NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "E3" });<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { "E3" } });<NEW_LINE>env.undeployAll();<NEW_LINE>} | new SupportBean("E3", 3)); |
86,950 | private String convertLessThanOneThousand(int number) {<NEW_LINE>String soFar;<NEW_LINE>if (number % 100 < 20) {<NEW_LINE>// 19 et moins<NEW_LINE>soFar = numNames[number % 100];<NEW_LINE>number /= 100;<NEW_LINE>} else if ((number % 100 < 80) && (number % 100 > 70)) {<NEW_LINE>// 71 ->79 (soixante et onze )<NEW_LINE>soFar = numNames[<MASK><NEW_LINE>number /= 10;<NEW_LINE>soFar = tensNames[(number - 1) % 10] + soFar;<NEW_LINE>number /= 10;<NEW_LINE>} else if ((number % 100 < 100) && (number % 100 > 90)) {<NEW_LINE>// 91->99<NEW_LINE>soFar = numNames[(number - 80) % 100];<NEW_LINE>number /= 10;<NEW_LINE>soFar = tensNames[(number - 1) % 10] + soFar;<NEW_LINE>number /= 10;<NEW_LINE>} else {<NEW_LINE>// 9 et moins<NEW_LINE>soFar = numNames[number % 10];<NEW_LINE>number /= 10;<NEW_LINE>// 90, 80, ... 20<NEW_LINE>soFar = tensNames[number % 10] + soFar;<NEW_LINE>number /= 10;<NEW_LINE>}<NEW_LINE>// reste les centaines<NEW_LINE>// y'en a pas<NEW_LINE>if (number == 0)<NEW_LINE>return soFar;<NEW_LINE>if (number == 1)<NEW_LINE>// on ne retourne "un cent xxxx" mais "cent xxxx"<NEW_LINE>return " cent" + soFar;<NEW_LINE>else<NEW_LINE>return numNames[number] + " cent" + soFar;<NEW_LINE>} | (number - 60) % 100]; |
850,763 | public void PrintRegionData(int Label0, int Label1) {<NEW_LINE>if (Label0 < 0)<NEW_LINE>Label0 = 0;<NEW_LINE>if (Label1 > MaxLabel)<NEW_LINE>Label1 = MaxLabel;<NEW_LINE>if (Label1 < Label0)<NEW_LINE>return;<NEW_LINE>for (int Label = Label0; Label <= Label1; Label++) {<NEW_LINE>double[] Property = RegionData[Label];<NEW_LINE>int ThisLabel = (int) Property[BLOBLABEL];<NEW_LINE>int ThisParent = (int) Property[BLOBPARENT];<NEW_LINE>int ThisColor = (int) Property[BLOBCOLOR];<NEW_LINE>double ThisArea = Property[BLOBAREA];<NEW_LINE>double ThisPerimeter = Property[BLOBPERIMETER];<NEW_LINE>double ThisSumX = Property[BLOBSUMX];<NEW_LINE>double ThisSumY = Property[BLOBSUMY];<NEW_LINE>double ThisSumXX = Property[BLOBSUMXX];<NEW_LINE>double ThisSumYY = Property[BLOBSUMYY];<NEW_LINE>double ThisSumXY = Property[BLOBSUMXY];<NEW_LINE>int ThisMinX = (int) Property[BLOBMINX];<NEW_LINE>int ThisMaxX = (int) Property[BLOBMAXX];<NEW_LINE>int ThisMinY <MASK><NEW_LINE>int ThisMaxY = (int) Property[BLOBMAXY];<NEW_LINE>String Str1 = " " + Label + ": L[" + ThisLabel + "] P[" + ThisParent + "] C[" + ThisColor + "]";<NEW_LINE>String Str2 = " AP[" + ThisArea + ", " + ThisPerimeter + "]";<NEW_LINE>String Str3 = " M1[" + ThisSumX + ", " + ThisSumY + "] M2[" + ThisSumXX + ", " + ThisSumYY + ", " + ThisSumXY + "]";<NEW_LINE>String Str4 = " MINMAX[" + ThisMinX + ", " + ThisMaxX + ", " + ThisMinY + ", " + ThisMaxY + "]";<NEW_LINE>String Str = Str1 + Str2 + Str3 + Str4;<NEW_LINE>System.out.println(Str);<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>} | = (int) Property[BLOBMINY]; |
1,192,131 | public void recordBrokerStats(BrokerStats brokerStats) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>LinkedList<BrokerStats> brokerStatsList = brokerStatsMap.computeIfAbsent(brokerId, i -> new LinkedList<>());<NEW_LINE>// multiple PastReplicaStatsProcessor/BrokerStatsProcessor may be processing BrokerStats<NEW_LINE>// for the same broker simultaneously, thus enforcing single writes here<NEW_LINE>synchronized (brokerStatsList) {<NEW_LINE>if (brokerStatsList.size() == MAX_NUM_STATS) {<NEW_LINE>brokerStatsList.removeFirst();<NEW_LINE>}<NEW_LINE>brokerStatsList.addLast(brokerStats);<NEW_LINE>}<NEW_LINE>if (!brokerStats.getHasFailure()) {<NEW_LINE>// only record brokerstat when there is no failure on that broker.<NEW_LINE>KafkaBroker broker = brokers.computeIfAbsent(brokerId, i -> new KafkaBroker(clusterConfig, this, i));<NEW_LINE>broker.update(brokerStats);<NEW_LINE>}<NEW_LINE>if (brokerStats.getLeaderReplicaStats() != null) {<NEW_LINE>for (ReplicaStat replicaStat : brokerStats.getLeaderReplicaStats()) {<NEW_LINE>String topic = replicaStat.getTopic();<NEW_LINE>TopicPartition topicPartition = new TopicPartition(topic, replicaStat.getPartition());<NEW_LINE>topicPartitions.computeIfAbsent(topic, t -> new HashSet<>()).add(topicPartition);<NEW_LINE>// if the replica is involved in reassignment, ignore the stats<NEW_LINE>if (replicaStat.getInReassignment()) {<NEW_LINE>reassignmentTimestamps.compute(topicPartition, (t, v) -> v == null || v < replicaStat.getTimestamp() ? replicaStat.getTimestamp() : v);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>long lastReassignment = reassignmentTimestamps.getOrDefault(topicPartition, 0L);<NEW_LINE>if (brokerStats.getTimestamp() - lastReassignment < REASSIGNMENT_COOLDOWN_WINDOW_IN_MS) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>bytesInHistograms.computeIfAbsent(topicPartition, k -> new Histogram(new SlidingWindowReservoir(SLIDING_WINDOW_SIZE)));<NEW_LINE>bytesOutHistograms.computeIfAbsent(topicPartition, k -> new Histogram(new SlidingWindowReservoir(SLIDING_WINDOW_SIZE)));<NEW_LINE>bytesInHistograms.get(topicPartition).update(replicaStat.getBytesIn15MinMeanRate());<NEW_LINE>bytesOutHistograms.get(topicPartition).update(replicaStat.getBytesOut15MinMeanRate());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Failed to read broker stats : {}", brokerStats, e);<NEW_LINE>}<NEW_LINE>} | int brokerId = brokerStats.getId(); |
926,211 | static Throwable removeRecursiveCalls(final Throwable cause, final Class<?> declaringClass) {<NEW_LINE>final List<String> uniqueStackTraceItems = new ArrayList<>();<NEW_LINE>final List<Integer> indexesToBeRemoved = new ArrayList<>();<NEW_LINE>for (StackTraceElement element : cause.getStackTrace()) {<NEW_LINE>final String key = element.getClassName() + element.getLineNumber();<NEW_LINE>final int elementIndex = uniqueStackTraceItems.lastIndexOf(key);<NEW_LINE>uniqueStackTraceItems.add(key);<NEW_LINE>if (elementIndex > -1 && declaringClass.getName().equals(element.getClassName())) {<NEW_LINE>indexesToBeRemoved.add(elementIndex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final List<StackTraceElement> adjustedList = new ArrayList<>(Arrays.asList(cause.getStackTrace()));<NEW_LINE>indexesToBeRemoved.stream().sorted(Comparator.reverseOrder()).mapToInt(Integer::intValue<MASK><NEW_LINE>cause.setStackTrace(adjustedList.toArray(new StackTraceElement[] {}));<NEW_LINE>return cause;<NEW_LINE>} | ).forEach(adjustedList::remove); |
1,722,119 | private void initialize() {<NEW_LINE>if (selection != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {<NEW_LINE>IStructuredSelection ssel = (IStructuredSelection) selection;<NEW_LINE>if (ssel.size() > 1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Object obj = ssel.getFirstElement();<NEW_LINE>// try to find a resource for the selected object<NEW_LINE>IResource resource = null;<NEW_LINE>if (obj instanceof IResource) {<NEW_LINE>resource = (IResource) obj;<NEW_LINE>} else if (obj != null && obj.getClass().getName().equals("org.eclipse.jdt.core.IJavaElement")) {<NEW_LINE>// use reflection here to avoid dependency on JDT, such that the wizard can be used for<NEW_LINE>// C/C++ Eclipse installations as well<NEW_LINE>try {<NEW_LINE>resource = (IResource) obj.getClass().getMethod("getResource").invoke(obj);<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (resource != null) {<NEW_LINE>// convert the resource to a container and<NEW_LINE>// initalize the container text with it<NEW_LINE>IContainer container = null;<NEW_LINE>if (resource instanceof IContainer) {<NEW_LINE>container = (IContainer) resource;<NEW_LINE>} else {<NEW_LINE>container = resource.getParent();<NEW_LINE>}<NEW_LINE>containerText.setText(container.getFullPath().toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>fileText.setText("new_diagram." + Program.getInstance().getExtension());<NEW_LINE>} | throw new RuntimeException("Error in reflection code", e); |
857,190 | private void parseStream(StreamInfo streamInfo) {<NEW_LINE>Preconditions.checkNotNull(streamInfo, "stream is null");<NEW_LINE>Preconditions.checkNotNull(streamInfo.getStreamId(), "streamId is null");<NEW_LINE>Preconditions.checkNotNull(streamInfo.getNodes(), "nodes is null");<NEW_LINE>Preconditions.checkState(!streamInfo.getNodes().isEmpty(), "nodes is empty");<NEW_LINE>Preconditions.checkNotNull(<MASK><NEW_LINE>Preconditions.checkState(!streamInfo.getRelations().isEmpty(), "relations is empty");<NEW_LINE>log.info("start parse stream, streamId:{}", streamInfo.getStreamId());<NEW_LINE>// Inject the `inlong.metric` for ExtractNode or LoadNode<NEW_LINE>injectInlongMetric(streamInfo);<NEW_LINE>Map<String, Node> nodeMap = new HashMap<>(streamInfo.getNodes().size());<NEW_LINE>streamInfo.getNodes().forEach(s -> {<NEW_LINE>Preconditions.checkNotNull(s.getId(), "node id is null");<NEW_LINE>nodeMap.put(s.getId(), s);<NEW_LINE>});<NEW_LINE>Map<String, NodeRelation> relationMap = new HashMap<>();<NEW_LINE>streamInfo.getRelations().forEach(r -> {<NEW_LINE>for (String output : r.getOutputs()) {<NEW_LINE>relationMap.put(output, r);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>streamInfo.getRelations().forEach(r -> {<NEW_LINE>parseNodeRelation(r, nodeMap, relationMap);<NEW_LINE>});<NEW_LINE>log.info("parse stream success, streamId:{}", streamInfo.getStreamId());<NEW_LINE>} | streamInfo.getRelations(), "relations is null"); |
1,141,115 | public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {<NEW_LINE>TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "mfxer");<NEW_LINE>final IOperandTreeNode targetRegister = instruction.getOperands().get(0).getRootNode().getChildren().get(0);<NEW_LINE>Long baseOffset = instruction.getAddress().toLong() * 0x100;<NEW_LINE>final OperandSize bt = OperandSize.BYTE;<NEW_LINE>final OperandSize dw = OperandSize.DWORD;<NEW_LINE>final String tmpVar1 = environment.getNextVariableString();<NEW_LINE>instructions.add(ReilHelpers.createStr(baseOffset++, dw, String.valueOf(0x0L), dw, tmpVar1));<NEW_LINE>instructions.add(ReilHelpers.createOr(baseOffset++, bt, Helpers.XER_SUMMARY_OVERFLOW, dw, tmpVar1, dw, tmpVar1));<NEW_LINE>instructions.add(ReilHelpers.createBsh(baseOffset++, dw, tmpVar1, bt, String.valueOf(1L), dw, tmpVar1));<NEW_LINE>instructions.add(ReilHelpers.createOr(baseOffset++, bt, Helpers.XER_OVERFLOW, dw, tmpVar1, dw, tmpVar1));<NEW_LINE>instructions.add(ReilHelpers.createBsh(baseOffset++, dw, tmpVar1, bt, String.valueOf(1L), dw, tmpVar1));<NEW_LINE>instructions.add(ReilHelpers.createOr(baseOffset++, bt, Helpers.XER_CARRY_BIT, dw, tmpVar1, dw, tmpVar1));<NEW_LINE>instructions.add(ReilHelpers.createBsh(baseOffset++, dw, tmpVar1, bt, String.valueOf(<MASK><NEW_LINE>instructions.add(ReilHelpers.createOr(baseOffset++, bt, Helpers.XER_COUNT_REGISTER, dw, tmpVar1, dw, targetRegister.getValue()));<NEW_LINE>} | 29L), dw, tmpVar1)); |
66,292 | public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = "c0,c1,c2,c3".split(",");<NEW_LINE>String epl = "@name('s0') select " + "maxbyever(intPrimitive).theString as c0, " + "minbyever(intPrimitive).theString as c1, " + "maxby(intPrimitive).theString as c2, " + "minby(intPrimitive).theString as c3 " + "from SupportBean";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>env.sendEventBean(new SupportBean("E1", 1));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "E1", "E1", "E1", "E1" });<NEW_LINE>env.sendEventBean(new SupportBean("E2", 2));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "E2", "E1", "E2", "E1" });<NEW_LINE>env.milestone(0);<NEW_LINE>env.sendEventBean(<MASK><NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "E2", "E3", "E2", "E3" });<NEW_LINE>env.sendEventBean(new SupportBean("E4", 3));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "E4", "E3", "E4", "E3" });<NEW_LINE>env.undeployAll();<NEW_LINE>} | new SupportBean("E3", 0)); |
1,765,102 | private WrapClosure makeEvalWrapClosure(WrapClosure wrapClosure, TruffleString name, int frameLevel, int scopeLevel, Environment current) {<NEW_LINE>final JSFrameSlot dynamicScopeSlot = current.findBlockFrameSlot(FunctionEnvironment.DYNAMIC_SCOPE_IDENTIFIER);<NEW_LINE>assert dynamicScopeSlot != null;<NEW_LINE>return WrapClosure.compose(wrapClosure, new WrapClosure() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public JavaScriptNode apply(JavaScriptNode delegateNode, WrapAccess access) {<NEW_LINE>JavaScriptNode dynamicScopeNode = new FrameSlotVarRef(dynamicScopeSlot, scopeLevel, frameLevel, FunctionEnvironment.DYNAMIC_SCOPE_IDENTIFIER, current).createReadNode();<NEW_LINE>JSTargetableNode scopeAccessNode;<NEW_LINE>if (access == WrapAccess.Delete) {<NEW_LINE>scopeAccessNode = factory.createDeleteProperty(null, factory.createConstantString(name<MASK><NEW_LINE>} else if (access == WrapAccess.Write) {<NEW_LINE>assert delegateNode instanceof WriteNode : delegateNode;<NEW_LINE>scopeAccessNode = factory.createWriteProperty(null, name, null, context, isStrictMode());<NEW_LINE>} else if (access == WrapAccess.Read) {<NEW_LINE>assert delegateNode instanceof ReadNode || delegateNode instanceof RepeatableNode : delegateNode;<NEW_LINE>scopeAccessNode = factory.createReadProperty(context, null, name);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>return new EvalVariableNode(context, name, delegateNode, dynamicScopeNode, scopeAccessNode);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | ), isStrictMode(), context); |
730,118 | public void run() {<NEW_LINE>TcpProxy tcp = TcpProxy.getTcpProxy(serverId);<NEW_LINE>try {<NEW_LINE>MapPack param = new MapPack();<NEW_LINE>param.put(CounterEngine.ATTR_NAME, type);<NEW_LINE>param.put(CounterEngine.ATTR_DISPLAY, displayName);<NEW_LINE>param.<MASK><NEW_LINE>param.put(CounterEngine.ATTR_ICON, icon);<NEW_LINE>param.put(CounterEngine.ATTR_SUBOBJECT, subObject);<NEW_LINE>String requestCmd = (mode == EDIT_MODE) ? RequestCmd.EDIT_OBJECT_TYPE : RequestCmd.DEFINE_OBJECT_TYPE;<NEW_LINE>final Value v = tcp.getSingleValue(requestCmd, param);<NEW_LINE>ExUtil.exec(window.getShell(), new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>if (v != null && ((BooleanValue) v).value) {<NEW_LINE>MessageDialog.openInformation(window.getShell(), "Success", ((mode == EDIT_MODE) ? "Edit" : "Add") + " successfully.");<NEW_LINE>ExUtil.asyncRun(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>TcpProxy tcp = TcpProxy.getTcpProxy(serverId);<NEW_LINE>try {<NEW_LINE>MapPack param = new MapPack();<NEW_LINE>param.put("command", RemoteCmd.REFETCH_COUNTER_XML);<NEW_LINE>param.put("fromSession", ServerManager.getInstance().getServer(serverId).getSession());<NEW_LINE>tcp.getSingle(RequestCmd.REMOTE_CONTROL_ALL, param);<NEW_LINE>} catch (Exception e) {<NEW_LINE>ConsoleProxy.errorSafe(e.toString());<NEW_LINE>} finally {<NEW_LINE>TcpProxy.putTcpProxy(tcp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>MessageDialog.openError(window.getShell(), "Failed", "Add Failed. Please try again or contact administrator.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} finally {<NEW_LINE>TcpProxy.putTcpProxy(tcp);<NEW_LINE>}<NEW_LINE>} | put(CounterEngine.ATTR_FAMILY, family); |
1,837,549 | public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {<NEW_LINE>if (((bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.<MASK><NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 2, diskURI_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 3, cachingMode_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 4, fsType_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>output.writeBool(5, readOnly_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000020) == 0x00000020)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 6, kind_);<NEW_LINE>}<NEW_LINE>unknownFields.writeTo(output);<NEW_LINE>} | writeString(output, 1, diskName_); |
1,335,184 | public Entity newLevelBox(SpawnData data) {<NEW_LINE>var ground = new Box(50, 0.5, 150);<NEW_LINE>ground.setMaterial(new PhongMaterial(Color.BROWN));<NEW_LINE>var WALL_HEIGHT = 20;<NEW_LINE>var wallL = new Box(0.5, WALL_HEIGHT, 150);<NEW_LINE>wallL.setMaterial(new PhongMaterial(Color.LIGHTCORAL));<NEW_LINE>wallL.setTranslateY(-WALL_HEIGHT / 2.0);<NEW_LINE>wallL.setTranslateX(-ground.getWidth() / 2.0);<NEW_LINE>var wallR = new Box(0.5, WALL_HEIGHT, 150);<NEW_LINE>wallR.setMaterial(new PhongMaterial(Color.LIGHTCORAL));<NEW_LINE>wallR.setTranslateY(-WALL_HEIGHT / 2.0);<NEW_LINE>wallR.setTranslateX(+ground.getWidth() / 2.0);<NEW_LINE>var wallT = new Box(50, WALL_HEIGHT, 0.5);<NEW_LINE>wallT.setMaterial(new PhongMaterial(Color.LIGHTCORAL));<NEW_LINE>wallT.setTranslateY(-WALL_HEIGHT / 2.0);<NEW_LINE>wallT.setTranslateZ(+wallL.getDepth() / 2.0);<NEW_LINE>var wallB = new Box(50, WALL_HEIGHT, 0.5);<NEW_LINE>wallB.setMaterial(new PhongMaterial(Color.LIGHTCORAL));<NEW_LINE>wallB<MASK><NEW_LINE>wallB.setTranslateZ(-25);<NEW_LINE>return entityBuilder(data).view(new Group(ground, wallL, wallR, wallT, wallB)).build();<NEW_LINE>} | .setTranslateY(-WALL_HEIGHT / 2.0); |
1,080,840 | protected void consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() {<NEW_LINE>// ClassInstanceCreationExpression ::= Primary '.' 'new' TypeArguments SimpleName '(' ArgumentListopt ')' ClassBodyopt<NEW_LINE>// ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName 'new' TypeArguments SimpleName '(' ArgumentListopt ')' ClassBodyopt<NEW_LINE>QualifiedAllocationExpression alloc;<NEW_LINE>int length;<NEW_LINE>if (((length = this.astLengthStack[this.astLengthPtr--]) == 1) && (this.astStack[this.astPtr] == null)) {<NEW_LINE>// NO ClassBody<NEW_LINE>this.astPtr--;<NEW_LINE>alloc = new QualifiedAllocationExpression();<NEW_LINE>// the position has been stored explicitly<NEW_LINE>alloc.sourceEnd = this.endPosition;<NEW_LINE>if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {<NEW_LINE>this.expressionPtr -= length;<NEW_LINE>System.arraycopy(this.expressionStack, this.expressionPtr + 1, alloc.arguments = new Expression[length], 0, length);<NEW_LINE>}<NEW_LINE>alloc.type = getTypeReference(0);<NEW_LINE>checkForDiamond(alloc.type);<NEW_LINE>length = this<MASK><NEW_LINE>this.genericsPtr -= length;<NEW_LINE>System.arraycopy(this.genericsStack, this.genericsPtr + 1, alloc.typeArguments = new TypeReference[length], 0, length);<NEW_LINE>this.intPtr--;<NEW_LINE>// the default constructor with the correct number of argument<NEW_LINE>// will be created and added by the TC (see createsInternalConstructorWithBinding)<NEW_LINE>alloc.sourceStart = this.intStack[this.intPtr--];<NEW_LINE>pushOnExpressionStack(alloc);<NEW_LINE>} else {<NEW_LINE>dispatchDeclarationInto(length);<NEW_LINE>TypeDeclaration anonymousTypeDeclaration = (TypeDeclaration) this.astStack[this.astPtr];<NEW_LINE>anonymousTypeDeclaration.declarationSourceEnd = this.endStatementPosition;<NEW_LINE>anonymousTypeDeclaration.bodyEnd = this.endStatementPosition;<NEW_LINE>if (length == 0 && !containsComment(anonymousTypeDeclaration.bodyStart, anonymousTypeDeclaration.bodyEnd)) {<NEW_LINE>anonymousTypeDeclaration.bits |= ASTNode.UndocumentedEmptyBlock;<NEW_LINE>}<NEW_LINE>this.astPtr--;<NEW_LINE>this.astLengthPtr--;<NEW_LINE>QualifiedAllocationExpression allocationExpression = anonymousTypeDeclaration.allocation;<NEW_LINE>if (allocationExpression != null) {<NEW_LINE>allocationExpression.sourceEnd = this.endStatementPosition;<NEW_LINE>// handle type arguments<NEW_LINE>length = this.genericsLengthStack[this.genericsLengthPtr--];<NEW_LINE>this.genericsPtr -= length;<NEW_LINE>System.arraycopy(this.genericsStack, this.genericsPtr + 1, allocationExpression.typeArguments = new TypeReference[length], 0, length);<NEW_LINE>allocationExpression.sourceStart = this.intStack[this.intPtr--];<NEW_LINE>checkForDiamond(allocationExpression.type);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>QualifiedAllocationExpression qae = (QualifiedAllocationExpression) this.expressionStack[this.expressionPtr];<NEW_LINE>if (qae.anonymousType == null) {<NEW_LINE>this.expressionLengthPtr--;<NEW_LINE>this.expressionPtr--;<NEW_LINE>qae.enclosingInstance = this.expressionStack[this.expressionPtr];<NEW_LINE>this.expressionStack[this.expressionPtr] = qae;<NEW_LINE>}<NEW_LINE>qae.sourceStart = qae.enclosingInstance.sourceStart;<NEW_LINE>consumeInvocationExpression();<NEW_LINE>} | .genericsLengthStack[this.genericsLengthPtr--]; |
344,315 | public final void paint(Graphics g) {<NEW_LINE>Theme currentTheme = ThemeFactory.getCurrentTheme();<NEW_LINE>super.paint(g);<NEW_LINE>Graphics2D g2 = (Graphics2D) g;<NEW_LINE>if (translateForExport) {<NEW_LINE>g2.translate(Constants.EXPORT_DISPLACEMENT, Constants.EXPORT_DISPLACEMENT);<NEW_LINE>}<NEW_LINE>boolean selected = getDiagramHandler().getDrawPanel().getSelector().isSelected(this);<NEW_LINE>if (selected) {<NEW_LINE>if (SharedConfig.getInstance().isDev_mode()) {<NEW_LINE>Color oldColor = g2.getColor();<NEW_LINE>g2.setColor(Converter.convert(currentTheme.getColor(Theme.PredefinedColors.BLACK)));<NEW_LINE>String text = "Type: " <MASK><NEW_LINE>g2.drawString(text, getWidth() - (int) getDiagramHandler().getFontHandler().getTextWidth(text), getHeight() - 5);<NEW_LINE>g2.setColor(oldColor);<NEW_LINE>}<NEW_LINE>if (isDeprecated()) {<NEW_LINE>Color oldColor = g2.getColor();<NEW_LINE>g2.setColor(Converter.convert(currentTheme.getColor(Theme.PredefinedColors.RED).transparency(Transparency.SELECTION_BACKGROUND)));<NEW_LINE>g2.fillRect(0, 0, getWidth(), getHeight());<NEW_LINE>g2.setColor(oldColor);<NEW_LINE>g2.setColor(Converter.convert(currentTheme.getColor(Theme.PredefinedColors.RED).transparency(Transparency.DEPRECATED_WARNING)));<NEW_LINE>g2.drawString("DEPRECATED ELEMENT", 10, 15);<NEW_LINE>g2.drawString("WILL SOON BE REMOVED", 10, 30);<NEW_LINE>}<NEW_LINE>fgColor = Converter.convert(currentTheme.getColor(Theme.ColorStyle.SELECTION_FG));<NEW_LINE>if (SharedConfig.getInstance().isShow_stickingpolygon()) {<NEW_LINE>drawStickingPolygon(g2);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>fgColor = fgColorBase;<NEW_LINE>}<NEW_LINE>updateModelFromText();<NEW_LINE>paintEntity(g2);<NEW_LINE>} | + getClass().getName(); |
689,338 | private boolean advanceRight(TInner right, TKey rightKey) {<NEW_LINE>rights.clear();<NEW_LINE>rights.add(right);<NEW_LINE>while (getRightEnumerator().moveNext()) {<NEW_LINE>right <MASK><NEW_LINE>TKey rightKey2 = innerKeySelector.apply(right);<NEW_LINE>if (rightKey2 == null) {<NEW_LINE>// mergeJoin assumes inputs sorted in ascending order with nulls last,<NEW_LINE>// if we reach a null key, we are done<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>int c = compare(rightKey, rightKey2);<NEW_LINE>if (c != 0) {<NEW_LINE>if (c > 0) {<NEW_LINE>throw new IllegalStateException("mergeJoin assumes input sorted in ascending order, " + "however '" + rightKey + "' is greater than '" + rightKey2 + "'");<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>rights.add(right);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | = getRightEnumerator().current(); |
760,617 | public wind.v1.XmlPullParser newPullParser() throws XmlPullParserException {<NEW_LINE>if (parserClasses == null)<NEW_LINE>throw new XmlPullParserException("Factory initialization was incomplete - has not tried " + classNamesLocation);<NEW_LINE>if (parserClasses.size() == 0)<NEW_LINE>throw new XmlPullParserException("No valid parser classes found in " + classNamesLocation);<NEW_LINE>final StringBuffer issues = new StringBuffer();<NEW_LINE>for (int i = 0; i < parserClasses.size(); i++) {<NEW_LINE>final Class ppClass = (Class) parserClasses.elementAt(i);<NEW_LINE>try {<NEW_LINE>final wind.v1.XmlPullParser pp = (wind.v1.XmlPullParser) ppClass.newInstance();<NEW_LINE>// if( ! features.isEmpty() ) {<NEW_LINE>// Enumeration keys = features.keys();<NEW_LINE>// while(keys.hasMoreElements()) {<NEW_LINE>for (Enumeration e = features.keys(); e.hasMoreElements(); ) {<NEW_LINE>final String key = (String) e.nextElement();<NEW_LINE>final Boolean value = (Boolean) features.get(key);<NEW_LINE>if (value != null && value.booleanValue()) {<NEW_LINE>pp.setFeature(key, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return pp;<NEW_LINE>} catch (Exception ex) {<NEW_LINE>issues.append(ppClass.getName() + ": " + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new XmlPullParserException("could not create parser: " + issues);<NEW_LINE>} | ex.toString() + "; "); |
330,264 | private void loadNode786() {<NEW_LINE>StateVariableTypeNode node = new StateVariableTypeNode(this.context, Identifiers.StateMachineType_CurrentState, new QualifiedName(0, "CurrentState"), new LocalizedText("en", "CurrentState"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.LocalizedText, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.StateMachineType_CurrentState, Identifiers.HasProperty, Identifiers.StateMachineType_CurrentState_Id<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.StateMachineType_CurrentState, Identifiers.HasTypeDefinition, Identifiers.StateVariableType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.StateMachineType_CurrentState, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.StateMachineType_CurrentState, Identifiers.HasComponent, Identifiers.StateMachineType.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | .expanded(), true)); |
1,313,532 | private StatementNode createDestructuringAssignment(ExpressionNode[] leftHandSides, ExpressionNode rhs) {<NEW_LINE>StatementNode[] statements = new StatementNode[leftHandSides.length];<NEW_LINE>ReadNode[] temps <MASK><NEW_LINE>int starredIndex = -1;<NEW_LINE>for (int i = 0; i < leftHandSides.length; i++) {<NEW_LINE>ReadNode tempRead = makeTempLocalVariable();<NEW_LINE>temps[i] = tempRead;<NEW_LINE>if (leftHandSides[i] instanceof StarredExpressionNode) {<NEW_LINE>if (starredIndex != -1) {<NEW_LINE>SourceSection section = leftHandSides[0].getSourceSection();<NEW_LINE>if (section == null) {<NEW_LINE>section = ((StarredExpressionNode) leftHandSides[i]).getValue().getSourceSection();<NEW_LINE>}<NEW_LINE>throw errors.raiseInvalidSyntax(source, section, ErrorMessages.STARRED_ASSIGMENT_MUST_BE_IN_LIST_OR_TUPLE);<NEW_LINE>}<NEW_LINE>starredIndex = i;<NEW_LINE>statements[i] = createAssignment(((StarredExpressionNode) leftHandSides[i]).getValue(), (ExpressionNode) tempRead);<NEW_LINE>} else {<NEW_LINE>statements[i] = createAssignment(leftHandSides[i], (ExpressionNode) tempRead);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return DestructuringAssignmentNode.create(rhs, temps, starredIndex, statements);<NEW_LINE>} | = new ReadNode[leftHandSides.length]; |
1,434,938 | private void populateFromConnectionModel(ConnectionModel connectionModel) {<NEW_LINE>clientId.setText(connectionModel.getClientId());<NEW_LINE>serverHostname.setText(connectionModel.getServerHostName());<NEW_LINE>serverPort.setText(Integer.toString(connectionModel.getServerPort()));<NEW_LINE>cleanSession.setChecked(connectionModel.isCleanSession());<NEW_LINE>username.setText(connectionModel.getUsername());<NEW_LINE>password.<MASK><NEW_LINE>tlsServerKey.setText(connectionModel.getTlsServerKey());<NEW_LINE>tlsClientKey.setText(connectionModel.getTlsClientKey());<NEW_LINE>timeout.setText(Integer.toString(connectionModel.getTimeout()));<NEW_LINE>keepAlive.setText(Integer.toString(connectionModel.getKeepAlive()));<NEW_LINE>lwtTopic.setText(connectionModel.getLwtTopic());<NEW_LINE>lwtMessage.setText(connectionModel.getLwtMessage());<NEW_LINE>lwtQos.setSelection(connectionModel.getLwtQos());<NEW_LINE>lwtRetain.setChecked(connectionModel.isLwtRetain());<NEW_LINE>} | setText(connectionModel.getPassword()); |
1,215,760 | private void updateAdapterList() {<NEW_LINE>// Fetch the picker's proxy.<NEW_LINE>PickerProxy pickerProxy = getPickerProxy();<NEW_LINE>if (pickerProxy == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Fetch the text field to update the drop-down list on.<NEW_LINE>AutoCompleteTextView textView = getAutoCompleteTextView();<NEW_LINE>if (textView == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Fetch all rows from the 1st column. (We do not support more than 1 column.)<NEW_LINE>List<TiPickerAdapterItem> itemList = TiPickerAdapterItem.<MASK><NEW_LINE>// Update view's drop-down list.<NEW_LINE>TiPickerAdapter adapter = (TiPickerAdapter) textView.getAdapter();<NEW_LINE>int lastSelectedIndex = (adapter != null) ? adapter.getSelectedIndex() : -1;<NEW_LINE>adapter = new TiPickerAdapter(textView.getContext(), android.R.layout.simple_spinner_dropdown_item, itemList);<NEW_LINE>adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);<NEW_LINE>adapter.setFontProperties(getFontProperties());<NEW_LINE>adapter.setSelectedIndex(lastSelectedIndex);<NEW_LINE>textView.setAdapter(adapter);<NEW_LINE>// Select a row.<NEW_LINE>if (itemList.isEmpty()) {<NEW_LINE>textView.clearListSelection();<NEW_LINE>} else {<NEW_LINE>selectRow(0, pickerProxy.getSelectedRowIndex(0), false);<NEW_LINE>}<NEW_LINE>} | createListFrom(pickerProxy.getFirstColumn()); |
885,103 | private void mountGlobalRestFailureHandler(Router mainRouter) {<NEW_LINE>GlobalRestFailureHandler globalRestFailureHandler = SPIServiceUtils.getPriorityHighestService(GlobalRestFailureHandler.class);<NEW_LINE>Handler<RoutingContext> failureHandler = null == globalRestFailureHandler ? ctx -> {<NEW_LINE>if (ctx.response().closed() || ctx.response().ended()) {<NEW_LINE>// response has been sent, do nothing<NEW_LINE>LOGGER.error("get a failure with closed response", ctx.failure());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>HttpServerResponse response = ctx.response();<NEW_LINE>if (ctx.failure() instanceof InvocationException) {<NEW_LINE>// ServiceComb defined exception<NEW_LINE>InvocationException exception = (InvocationException) ctx.failure();<NEW_LINE>response.<MASK><NEW_LINE>response.setStatusMessage(exception.getReasonPhrase());<NEW_LINE>response.end(exception.getErrorData().toString());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LOGGER.error("unexpected failure happened", ctx.failure());<NEW_LINE>try {<NEW_LINE>// unknown exception<NEW_LINE>CommonExceptionData unknownError = new CommonExceptionData("unknown error");<NEW_LINE>ctx.response().setStatusCode(500).putHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON).end(RestObjectMapperFactory.getRestObjectMapper().writeValueAsString(unknownError));<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("failed to send error response!", e);<NEW_LINE>}<NEW_LINE>} : globalRestFailureHandler;<NEW_LINE>// this handler does nothing, just ensure the failure handler can catch exception<NEW_LINE>mainRouter.route().handler(RoutingContext::next).failureHandler(failureHandler);<NEW_LINE>} | setStatusCode(exception.getStatusCode()); |
1,331,031 | static KeyStore GetPEMKeyStore(InputStream inputStream) throws Exception {<NEW_LINE>KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());<NEW_LINE>keyStore.load(null);<NEW_LINE>int index = 0;<NEW_LINE>BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));<NEW_LINE>String carBegin;<NEW_LINE>while ((carBegin = bufferedReader.readLine()) != null) {<NEW_LINE>if (carBegin.contains("BEGIN CERTIFICATE")) {<NEW_LINE>StringBuilder stringBuilder = new StringBuilder();<NEW_LINE>while ((carBegin = bufferedReader.readLine()) != null) {<NEW_LINE>if (carBegin.contains("END CERTIFICATE")) {<NEW_LINE><MASK><NEW_LINE>byte[] bytes = Base64.decode(hexString, Base64.DEFAULT);<NEW_LINE>Certificate certificate = _GenerateCertificateFromDER(bytes);<NEW_LINE>keyStore.setCertificateEntry(Integer.toString(index++), certificate);<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>stringBuilder.append(carBegin);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>bufferedReader.close();<NEW_LINE>if (index == 0) {<NEW_LINE>throw new IllegalArgumentException("No CERTIFICATE found");<NEW_LINE>}<NEW_LINE>return keyStore;<NEW_LINE>} | String hexString = stringBuilder.toString(); |
1,720,324 | private static void processOutputLimitedLastAllNonBufferedCodegen(ResultSetProcessorSimpleForge forge, String methodName, CodegenClassScope classScope, CodegenMethod method, CodegenInstanceAux instance) {<NEW_LINE>CodegenExpressionField factory = <MASK><NEW_LINE>CodegenExpression eventTypes = classScope.addFieldUnshared(true, EventType.EPTYPEARRAY, EventTypeUtility.resolveTypeArrayCodegen(forge.getEventTypes(), EPStatementInitServices.REF));<NEW_LINE>if (forge.isOutputAll()) {<NEW_LINE>instance.addMember(NAME_OUTPUTALLHELPER, ResultSetProcessorSimpleOutputAllHelper.EPTYPE);<NEW_LINE>instance.getServiceCtor().getBlock().assignRef(NAME_OUTPUTALLHELPER, exprDotMethod(factory, "makeRSSimpleOutputAll", ref("this"), MEMBER_EXPREVALCONTEXT, eventTypes, forge.getOutputAllHelperSettings().toExpression()));<NEW_LINE>method.getBlock().exprDotMethod(member(NAME_OUTPUTALLHELPER), methodName, REF_NEWDATA, REF_OLDDATA);<NEW_LINE>} else if (forge.isOutputLast()) {<NEW_LINE>instance.addMember(NAME_OUTPUTLASTHELPER, ResultSetProcessorSimpleOutputLastHelper.EPTYPE);<NEW_LINE>instance.getServiceCtor().getBlock().assignRef(NAME_OUTPUTLASTHELPER, exprDotMethod(factory, "makeRSSimpleOutputLast", ref("this"), MEMBER_EXPREVALCONTEXT, eventTypes, forge.getOutputLastHelperSettings().toExpression()));<NEW_LINE>method.getBlock().exprDotMethod(member(NAME_OUTPUTLASTHELPER), methodName, REF_NEWDATA, REF_OLDDATA);<NEW_LINE>}<NEW_LINE>} | classScope.addOrGetFieldSharable(ResultSetProcessorHelperFactoryField.INSTANCE); |
1,340,944 | public CreateAppInstanceAdminResult createAppInstanceAdmin(CreateAppInstanceAdminRequest createAppInstanceAdminRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createAppInstanceAdminRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateAppInstanceAdminRequest> request = null;<NEW_LINE>Response<CreateAppInstanceAdminResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateAppInstanceAdminRequestMarshaller().marshall(createAppInstanceAdminRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<CreateAppInstanceAdminResult, JsonUnmarshallerContext> unmarshaller = new CreateAppInstanceAdminResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<CreateAppInstanceAdminResult> responseHandler = new JsonResponseHandler<CreateAppInstanceAdminResult>(unmarshaller);<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
439,343 | private Dialog fetchDialog() {<NEW_LINE>AlertDialog.Builder builder = new AlertDialog.Builder(mActivity);<NEW_LINE>final String[] originRemotes = mRepo.getRemotes().toArray(new String[0]);<NEW_LINE>final ArrayList<String> <MASK><NEW_LINE>return builder.setTitle(R.string.dialog_fetch_title).setMultiChoiceItems(originRemotes, null, new DialogInterface.OnMultiChoiceClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialogInterface, int index, boolean isChecked) {<NEW_LINE>if (isChecked) {<NEW_LINE>remotes.add(originRemotes[index]);<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < remotes.size(); ++i) {<NEW_LINE>if (remotes.get(i) == originRemotes[index]) {<NEW_LINE>remotes.remove(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}).setPositiveButton(R.string.dialog_fetch_positive_button, new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialogInterface, int i) {<NEW_LINE>fetch(remotes.toArray(new String[0]));<NEW_LINE>}<NEW_LINE>}).setNeutralButton(R.string.dialog_fetch_all_button, new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialogInterface, int i) {<NEW_LINE>fetch(originRemotes);<NEW_LINE>}<NEW_LINE>}).setNegativeButton(android.R.string.cancel, new DummyDialogListener()).create();<NEW_LINE>} | remotes = new ArrayList<>(); |
1,430,373 | public void deleteIfExistsCodeSnippets() {<NEW_LINE>// BEGIN: com.azure.storage.blob.BlobContainerAsyncClient.deleteIfExists<NEW_LINE>client.deleteIfExists().subscribe(deleted -> {<NEW_LINE>if (deleted) {<NEW_LINE>System.out.println("Successfully deleted.");<NEW_LINE>} else {<NEW_LINE>System.out.println("Does not exist.");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// END: com.azure.storage.blob.BlobContainerAsyncClient.deleteIfExists<NEW_LINE>// BEGIN: com.azure.storage.blob.BlobContainerAsyncClient.deleteIfExistsWithResponse#BlobRequestConditions<NEW_LINE>BlobRequestConditions requestConditions = new BlobRequestConditions().setLeaseId(leaseId).setIfUnmodifiedSince(OffsetDateTime.now().minusDays(3));<NEW_LINE>client.deleteIfExistsWithResponse(requestConditions).subscribe(response -> {<NEW_LINE>if (response.getStatusCode() == 404) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>System.out.println("successfully deleted.");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// END: com.azure.storage.blob.BlobContainerAsyncClient.deleteIfExistsWithResponse#BlobRequestConditions<NEW_LINE>} | System.out.println("Does not exist."); |
406,731 | protected void execute() {<NEW_LINE>List<Device> devices = getDevices(apiDeviceListUrl, credentials, appKey);<NEW_LINE>List<Plant> plants = getPlants(apiPlantListUrl, credentials, appKey);<NEW_LINE>for (KoubachiBindingProvider provider : providers) {<NEW_LINE>for (String itemName : provider.getItemNames()) {<NEW_LINE>if (provider.isCareAction(itemName)) {<NEW_LINE>// nothing to do for care actions<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>KoubachiResourceType resourceType = provider.getResourceType(itemName);<NEW_LINE>String resourceId = provider.getResourceId(itemName);<NEW_LINE>String <MASK><NEW_LINE>KoubachiResource resource = null;<NEW_LINE>if (KoubachiResourceType.DEVICE.equals(resourceType)) {<NEW_LINE>resource = findResource(resourceId, devices);<NEW_LINE>} else {<NEW_LINE>resource = findResource(resourceId, plants);<NEW_LINE>}<NEW_LINE>if (resource == null) {<NEW_LINE>logger.debug("Cannot find Koubachi resource with id '{}'", resourceId);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Object propertyValue = PropertyUtils.getProperty(resource, propertyName);<NEW_LINE>State state = createState(propertyValue);<NEW_LINE>if (state != null) {<NEW_LINE>eventPublisher.postUpdate(itemName, state);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.warn("Reading value '{}' from Resource '{}' throws went wrong", propertyName, resource);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | propertyName = provider.getPropertyName(itemName); |
1,695,759 | public ListEnvironmentsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListEnvironmentsResult listEnvironmentsResult = new ListEnvironmentsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listEnvironmentsResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Items", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listEnvironmentsResult.setItems(new ListUnmarshaller<Environment>(EnvironmentJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listEnvironmentsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listEnvironmentsResult;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
933,304 | public static GetWorkFlowResponse unmarshall(GetWorkFlowResponse getWorkFlowResponse, UnmarshallerContext _ctx) {<NEW_LINE>getWorkFlowResponse.setRequestId(_ctx.stringValue("GetWorkFlowResponse.RequestId"));<NEW_LINE>getWorkFlowResponse.setCode(_ctx.integerValue("GetWorkFlowResponse.Code"));<NEW_LINE>getWorkFlowResponse.setMessage(_ctx.stringValue("GetWorkFlowResponse.Message"));<NEW_LINE>getWorkFlowResponse.setSuccess(_ctx.booleanValue("GetWorkFlowResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>WorkFlowInfo workFlowInfo = new WorkFlowInfo();<NEW_LINE>workFlowInfo.setWorkflowId(_ctx.longValue("GetWorkFlowResponse.Data.WorkFlowInfo.WorkflowId"));<NEW_LINE>workFlowInfo.setName(_ctx.stringValue("GetWorkFlowResponse.Data.WorkFlowInfo.Name"));<NEW_LINE>workFlowInfo.setDescription(_ctx.stringValue("GetWorkFlowResponse.Data.WorkFlowInfo.Description"));<NEW_LINE>workFlowInfo.setStatus<MASK><NEW_LINE>workFlowInfo.setTimeType(_ctx.stringValue("GetWorkFlowResponse.Data.WorkFlowInfo.TimeType"));<NEW_LINE>workFlowInfo.setTimeExpression(_ctx.stringValue("GetWorkFlowResponse.Data.WorkFlowInfo.TimeExpression"));<NEW_LINE>data.setWorkFlowInfo(workFlowInfo);<NEW_LINE>WorkFlowNodeInfo workFlowNodeInfo = new WorkFlowNodeInfo();<NEW_LINE>List<Node> nodes = new ArrayList<Node>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetWorkFlowResponse.Data.WorkFlowNodeInfo.Nodes.Length"); i++) {<NEW_LINE>Node node = new Node();<NEW_LINE>node.setId(_ctx.longValue("GetWorkFlowResponse.Data.WorkFlowNodeInfo.Nodes[" + i + "].Id"));<NEW_LINE>node.setLabel(_ctx.stringValue("GetWorkFlowResponse.Data.WorkFlowNodeInfo.Nodes[" + i + "].Label"));<NEW_LINE>node.setStatus(_ctx.integerValue("GetWorkFlowResponse.Data.WorkFlowNodeInfo.Nodes[" + i + "].Status"));<NEW_LINE>nodes.add(node);<NEW_LINE>}<NEW_LINE>workFlowNodeInfo.setNodes(nodes);<NEW_LINE>List<Edge> edges = new ArrayList<Edge>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetWorkFlowResponse.Data.WorkFlowNodeInfo.Edges.Length"); i++) {<NEW_LINE>Edge edge = new Edge();<NEW_LINE>edge.setSource(_ctx.longValue("GetWorkFlowResponse.Data.WorkFlowNodeInfo.Edges[" + i + "].Source"));<NEW_LINE>edge.setTarget(_ctx.longValue("GetWorkFlowResponse.Data.WorkFlowNodeInfo.Edges[" + i + "].Target"));<NEW_LINE>edges.add(edge);<NEW_LINE>}<NEW_LINE>workFlowNodeInfo.setEdges(edges);<NEW_LINE>data.setWorkFlowNodeInfo(workFlowNodeInfo);<NEW_LINE>getWorkFlowResponse.setData(data);<NEW_LINE>return getWorkFlowResponse;<NEW_LINE>} | (_ctx.stringValue("GetWorkFlowResponse.Data.WorkFlowInfo.Status")); |
112,122 | public MCostDetail process() {<NEW_LINE>CLogger logger = CLogger.getCLogger(LastInvoiceCostingMethod.class);<NEW_LINE>boolean isReturnTrx = costDetail.getQty().signum() < 0;<NEW_LINE>int precision = accountSchema.getCostingPrecision();<NEW_LINE>BigDecimal price = costDetail.getAmt();<NEW_LINE>if (costDetail.getQty().signum() != 0)<NEW_LINE>price = costDetail.getAmt().divide(costDetail.getQty(), precision, BigDecimal.ROUND_HALF_UP);<NEW_LINE>if (costDetail.getC_OrderLine_ID() != 0) {<NEW_LINE>if (!isReturnTrx) {<NEW_LINE>if (costDetail.getQty().signum() != 0)<NEW_LINE>dimension.setCurrentCostPrice(price);<NEW_LINE>else {<NEW_LINE>BigDecimal currentCost = dimension.getCurrentCostPrice().<MASK><NEW_LINE>dimension.setCurrentCostPrice(currentCost);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>dimension.add(costDetail.getAmt(), costDetail.getQty());<NEW_LINE>logger.finer("Inv - LastInv - " + dimension);<NEW_LINE>} else if (// AR Shipment Detail Record<NEW_LINE>costDetail.getM_InOutLine_ID() != 0 || costDetail.getM_MovementLine_ID() != 0 || costDetail.getM_InventoryLine_ID() != 0 || costDetail.getM_ProductionLine_ID() != 0 || costDetail.getC_ProjectIssue_ID() != 0 || costDetail.getPP_Cost_Collector_ID() != 0) {<NEW_LINE>dimension.setCurrentQty(dimension.getCurrentQty().add(costDetail.getQty()));<NEW_LINE>logger.finer("QtyAdjust - LastInv - " + dimension);<NEW_LINE>dimension.saveEx();<NEW_LINE>}<NEW_LINE>return costDetail;<NEW_LINE>} | add(costDetail.getAmt()); |
1,054,532 | public BeanDefinition parse(Element elt, ParserContext pc) {<NEW_LINE>String loginUrl = null;<NEW_LINE>String defaultTargetUrl = null;<NEW_LINE>String authenticationFailureUrl = null;<NEW_LINE>String alwaysUseDefault = null;<NEW_LINE>String successHandlerRef = null;<NEW_LINE>String failureHandlerRef = null;<NEW_LINE>// Only available with form-login<NEW_LINE>String usernameParameter = null;<NEW_LINE>String passwordParameter = null;<NEW_LINE>String authDetailsSourceRef = null;<NEW_LINE>String authenticationFailureForwardUrl = null;<NEW_LINE>String authenticationSuccessForwardUrl = null;<NEW_LINE>Object source = null;<NEW_LINE>if (elt != null) {<NEW_LINE>source = pc.extractSource(elt);<NEW_LINE>loginUrl = elt.getAttribute(ATT_LOGIN_URL);<NEW_LINE>WebConfigUtils.validateHttpRedirect(loginUrl, pc, source);<NEW_LINE>defaultTargetUrl = elt.getAttribute(ATT_FORM_LOGIN_TARGET_URL);<NEW_LINE>WebConfigUtils.<MASK><NEW_LINE>authenticationFailureUrl = elt.getAttribute(ATT_FORM_LOGIN_AUTHENTICATION_FAILURE_URL);<NEW_LINE>WebConfigUtils.validateHttpRedirect(authenticationFailureUrl, pc, source);<NEW_LINE>alwaysUseDefault = elt.getAttribute(ATT_ALWAYS_USE_DEFAULT_TARGET_URL);<NEW_LINE>this.loginPage = elt.getAttribute(ATT_LOGIN_PAGE);<NEW_LINE>successHandlerRef = elt.getAttribute(ATT_SUCCESS_HANDLER_REF);<NEW_LINE>failureHandlerRef = elt.getAttribute(ATT_FAILURE_HANDLER_REF);<NEW_LINE>authDetailsSourceRef = elt.getAttribute(AuthenticationConfigBuilder.ATT_AUTH_DETAILS_SOURCE_REF);<NEW_LINE>authenticationFailureForwardUrl = elt.getAttribute(ATT_FORM_LOGIN_AUTHENTICATION_FAILURE_FORWARD_URL);<NEW_LINE>WebConfigUtils.validateHttpRedirect(authenticationFailureForwardUrl, pc, source);<NEW_LINE>authenticationSuccessForwardUrl = elt.getAttribute(ATT_FORM_LOGIN_AUTHENTICATION_SUCCESS_FORWARD_URL);<NEW_LINE>WebConfigUtils.validateHttpRedirect(authenticationSuccessForwardUrl, pc, source);<NEW_LINE>if (!StringUtils.hasText(this.loginPage)) {<NEW_LINE>this.loginPage = null;<NEW_LINE>}<NEW_LINE>WebConfigUtils.validateHttpRedirect(this.loginPage, pc, source);<NEW_LINE>usernameParameter = elt.getAttribute(ATT_USERNAME_PARAMETER);<NEW_LINE>passwordParameter = elt.getAttribute(ATT_PASSWORD_PARAMETER);<NEW_LINE>}<NEW_LINE>this.filterBean = createFilterBean(loginUrl, defaultTargetUrl, alwaysUseDefault, this.loginPage, authenticationFailureUrl, successHandlerRef, failureHandlerRef, authDetailsSourceRef, authenticationFailureForwardUrl, authenticationSuccessForwardUrl);<NEW_LINE>if (StringUtils.hasText(usernameParameter)) {<NEW_LINE>this.filterBean.getPropertyValues().addPropertyValue("usernameParameter", usernameParameter);<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(passwordParameter)) {<NEW_LINE>this.filterBean.getPropertyValues().addPropertyValue("passwordParameter", passwordParameter);<NEW_LINE>}<NEW_LINE>this.filterBean.setSource(source);<NEW_LINE>BeanDefinitionBuilder entryPointBuilder = BeanDefinitionBuilder.rootBeanDefinition(LoginUrlAuthenticationEntryPoint.class);<NEW_LINE>entryPointBuilder.getRawBeanDefinition().setSource(source);<NEW_LINE>entryPointBuilder.addConstructorArgValue((this.loginPage != null) ? this.loginPage : DEF_LOGIN_PAGE);<NEW_LINE>entryPointBuilder.addPropertyValue("portMapper", this.portMapper);<NEW_LINE>entryPointBuilder.addPropertyValue("portResolver", this.portResolver);<NEW_LINE>this.entryPointBean = (RootBeanDefinition) entryPointBuilder.getBeanDefinition();<NEW_LINE>return null;<NEW_LINE>} | validateHttpRedirect(defaultTargetUrl, pc, source); |
1,516,515 | public void testPurgeMaxSize_9() throws Exception {<NEW_LINE>RemoteFile binaryLogDir = null;<NEW_LINE>RemoteFile binaryTraceDir = null;<NEW_LINE>NumberFormat nf = NumberFormat.getInstance();<NEW_LINE>//<NEW_LINE>CommonTasks.addBootstrapProperty(server, "com.ibm.hpel.trace.purgeMaxSize", "91");<NEW_LINE>server.restartServer();<NEW_LINE>// write enough records to new log repository updated.<NEW_LINE>CommonTasks.writeLogMsg(Level.INFO, "Writing log records to fill binary log repository.");<NEW_LINE>long loopsPerFullRepository = (91 * 1024 * 1024) / 200;<NEW_LINE>logger.info("writting " + nf.format(loopsPerFullRepository) + " log loops to produce " + 91 + " MB of data.");<NEW_LINE>logger.info("Writing FINE Level Trace entries: ");<NEW_LINE>CommonTasks.createLogEntries(server, loggerName, "Sample log record for the test case " + name.getMethodName() + ".", Level.FINE, (int) loopsPerFullRepository, CommonTasks.TRACE, 0);<NEW_LINE>CommonTasks.writeLogMsg(Level.INFO, "Verifying the repository size .");<NEW_LINE>binaryLogDir = server.getFileFromLibertyServerRoot("logs/logdata");<NEW_LINE>binaryTraceDir = server.getFileFromLibertyServerRoot("logs/tracedata");<NEW_LINE>long binaryLogSize = getSizeOfBinaryLogs(binaryLogDir);<NEW_LINE>long binaryTraceSize = getSizeOfBinaryLogs(binaryTraceDir);<NEW_LINE>logger.info("The current size of BinaryLog files in " + binaryLogDir.getAbsolutePath() + " is " + nf.format(binaryLogSize));<NEW_LINE>assertTrue("BinaryLog Repository size should be less than 50 MB", binaryLogSize < <MASK><NEW_LINE>logger.info("The current size of BinaryTrace files in " + binaryTraceDir.getAbsolutePath() + " is " + nf.format(binaryTraceSize));<NEW_LINE>assertTrue("BinaryTrace Repository size should be less than 91 MB", binaryTraceSize < (91 * 1024 * 1024));<NEW_LINE>;<NEW_LINE>// Re-enable console.log<NEW_LINE>server.updateServerConfiguration(new File(server.pathToAutoFVTTestFiles, "server-HpelLogDirectoryChange_1.xml"));<NEW_LINE>// remove bootstrap<NEW_LINE>CommonTasks.removeBootstrapProperty(server, "com.ibm.hpel.trace.purgeMaxSize");<NEW_LINE>server.restartServer();<NEW_LINE>} | (MAX_DEFAULT_PURGE_SIZE * 1024 * 1024)); |
1,772,884 | public int execute(Meterpreter meterpreter, TLVPacket request, TLVPacket response) throws Exception {<NEW_LINE>String path = request.getStringValue(TLVType.TLV_TYPE_FILE_PATH);<NEW_LINE>if (path.equals("...")) {<NEW_LINE><MASK><NEW_LINE>if (length != -1) {<NEW_LINE>response.add(TLVType.TLV_TYPE_STAT_BUF, stat(0444 | 0100000, length, System.currentTimeMillis()));<NEW_LINE>return ERROR_SUCCESS;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>File file = new File(path);<NEW_LINE>if (!file.exists()) {<NEW_LINE>file = Loader.expand(path);<NEW_LINE>}<NEW_LINE>if (!file.exists()) {<NEW_LINE>throw new IOException("File/directory does not exist: " + path);<NEW_LINE>}<NEW_LINE>response.add(TLVType.TLV_TYPE_STAT_BUF, stat(file));<NEW_LINE>return ERROR_SUCCESS;<NEW_LINE>} | long length = meterpreter.getErrorBufferLength(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.