idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
652,395 | private List<NameValueCountPair> listActivityNamePair(Business business, EffectivePerson effectivePerson, Wi wi) throws Exception {<NEW_LINE>EntityManager em = business.entityManagerContainer().get(Task.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<String> cq = cb.createQuery(String.class);<NEW_LINE>Root<Task> root = cq.from(Task.class);<NEW_LINE>Predicate p = cb.equal(root.get(Task_.person), effectivePerson.getDistinguishedName());<NEW_LINE>if (ListTools.isNotEmpty(wi.getApplicationList())) {<NEW_LINE>p = cb.and(p, root.get(Task_.application).in(wi.getApplicationList()));<NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(wi.getProcessList())) {<NEW_LINE>p = cb.and(p, root.get(Task_.process).in(wi.getProcessList()));<NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(wi.getCreatorUnitList())) {<NEW_LINE>p = cb.and(p, root.get(Task_.creatorUnit).in(wi.getCreatorUnitList()));<NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(wi.getStartTimeMonthList())) {<NEW_LINE>p = cb.and(p, root.get(Task_.startTimeMonth).in(wi.getStartTimeMonthList()));<NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(wi.getActivityNameList())) {<NEW_LINE>p = cb.and(p, root.get(Task_.activityName).in(wi.getActivityNameList()));<NEW_LINE>}<NEW_LINE>cq.select(root.get(Task_.<MASK><NEW_LINE>List<String> os = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());<NEW_LINE>List<NameValueCountPair> wos = new ArrayList<>();<NEW_LINE>for (String str : os) {<NEW_LINE>if (StringUtils.isNotEmpty(str)) {<NEW_LINE>NameValueCountPair o = new NameValueCountPair();<NEW_LINE>o.setValue(str);<NEW_LINE>o.setName(str);<NEW_LINE>wos.add(o);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>wos = wos.stream().sorted(Comparator.comparing(NameValueCountPair::getName, (s1, s2) -> {<NEW_LINE>return Objects.toString(s1, "").compareTo(Objects.toString(s2, ""));<NEW_LINE>})).collect(Collectors.toList());<NEW_LINE>return wos;<NEW_LINE>} | activityName)).where(p); |
1,491,676 | void configAndStart() throws Exception {<NEW_LINE>try (Config config = new Config()) {<NEW_LINE>boolean defaultConfig = true;<NEW_LINE>if (mLoadConfig) {<NEW_LINE>if (configStream(config) > 0)<NEW_LINE>defaultConfig = false;<NEW_LINE>}<NEW_LINE>if (mListener != null)<NEW_LINE>mListener.config(config);<NEW_LINE>// try statement needed here to release resources allocated by the Pipeline:start() method<NEW_LINE>try (PipelineProfile pp = mPipeline.start(config)) {<NEW_LINE>// if device runs on default configuration, get active stream profiles and record in settings<NEW_LINE>if (defaultConfig) {<NEW_LINE>List<StreamProfile> activeProfiles = mPipeline.getActiveStreams();<NEW_LINE>SharedPreferences sharedPref = mContext.getSharedPreferences(mContext.getString(R.string.app_settings), Context.MODE_PRIVATE);<NEW_LINE>Device device = pp.getDevice();<NEW_LINE>for (StreamProfile sp : activeProfiles) {<NEW_LINE>String msg = "active profile: " + sp.getType() + "," + sp.getIndex() + "," + sp.getFormat().toString() + "," + sp.getFrameRate() + " fps";<NEW_LINE>if (sp.is(Extension.VIDEO_PROFILE)) {<NEW_LINE>VideoStreamProfile vp = sp.as(Extension.VIDEO_PROFILE);<NEW_LINE>if (vp != null) {<NEW_LINE>msg += "," + vp.getWidth() + "x" + vp.getHeight();<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>// turn on the active profile in settings<NEW_LINE>SettingsActivity.setProfileSetting(sharedPref, device, sp, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Log.d(TAG, msg); |
572,975 | final CreateTapesResult executeCreateTapes(CreateTapesRequest createTapesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createTapesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateTapesRequest> request = null;<NEW_LINE>Response<CreateTapesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateTapesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createTapesRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateTapes");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateTapesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateTapesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.SERVICE_ID, "Storage Gateway"); |
661,277 | private Map<String, String> buildRemapMultiVersions(Iterator<String> zipNameIterator) {<NEW_LINE>SimpleMultiMap<Integer, String> byVersions = SimpleMultiMap.newHashMap();<NEW_LINE>while (zipNameIterator.hasNext()) {<NEW_LINE>String name = zipNameIterator.next();<NEW_LINE>String prefix = "META-INF/versions/";<NEW_LINE>if (name.startsWith(prefix)) {<NEW_LINE>try {<NEW_LINE>int endIndex = name.indexOf(<MASK><NEW_LINE>if (endIndex == -1 || name.charAt(name.length() - 1) == '/') {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int ver = Integer.parseInt(name.substring(prefix.length(), endIndex));<NEW_LINE>String normalizeUrl = name.substring(endIndex + 1, name.length());<NEW_LINE>byVersions.putValue(ver, normalizeUrl);<NEW_LINE>} catch (Exception e) {<NEW_LINE>error("url: " + myFilePath, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (byVersions.isEmpty()) {<NEW_LINE>return Collections.emptyMap();<NEW_LINE>}<NEW_LINE>JavaVersion javaVersion = JavaVersion.current();<NEW_LINE>Map<String, String> toRemap = new HashMap<String, String>();<NEW_LINE>// if version is 14, array will be 14,13,12,11,10,9,8<NEW_LINE>for (int ver = javaVersion.feature; ver != 7; ver--) {<NEW_LINE>Collection<String> urls = byVersions.get(ver);<NEW_LINE>if (urls.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (String url : urls) {<NEW_LINE>if (toRemap.containsKey(url)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>toRemap.put(url, buildVersionableUrl(ver, url));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return toRemap;<NEW_LINE>} | '/', prefix.length()); |
124,992 | protected void processThermostatOperatingStateReport(SerialMessage serialMessage, int offset, int endpoint) {<NEW_LINE>int value = serialMessage.getMessagePayloadByte(offset + 1);<NEW_LINE>logger.debug("NODE {}: Thermostat Operating State report value = {}", this.getNode().getNodeId(), value);<NEW_LINE>OperatingStateType operatingStateType = OperatingStateType.getOperatingStateType(value);<NEW_LINE>if (operatingStateType == null) {<NEW_LINE>logger.error("NODE {}: Unknown Operating State Type = {}, ignoring report.", this.getNode(<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>dynamicDone = true;<NEW_LINE>logger.debug("NODE {}: Operating State Type = {} ({})", this.getNode().getNodeId(), operatingStateType.getLabel(), value);<NEW_LINE>logger.debug("NODE {}: Thermostat Operating State Report value = {}", this.getNode().getNodeId(), operatingStateType.getLabel());<NEW_LINE>ZWaveCommandClassValueEvent zEvent = new ZWaveCommandClassValueEvent(this.getNode().getNodeId(), endpoint, this.getCommandClass(), new BigDecimal(value));<NEW_LINE>this.getController().notifyEventListeners(zEvent);<NEW_LINE>} | ).getNodeId(), value); |
440,092 | private Block createRawBlock(String defaultName, SectionDefinitionData def) {<NEW_LINE>Block block = new Block();<NEW_LINE>block.setLiquid(def.isLiquid());<NEW_LINE>block.setWater(def.isWater());<NEW_LINE>block.setGrass(def.isGrass());<NEW_LINE>block.setIce(def.isIce());<NEW_LINE>block.setHardness(def.getHardness());<NEW_LINE>block.setAttachmentAllowed(def.isAttachmentAllowed());<NEW_LINE>block.setReplacementAllowed(def.isReplacementAllowed());<NEW_LINE>block.setSupportRequired(def.isSupportRequired());<NEW_LINE>block.setPenetrable(def.isPenetrable());<NEW_LINE>block.setTargetable(def.isTargetable());<NEW_LINE>block.setClimbable(def.isClimbable());<NEW_LINE>block.setTranslucent(def.isTranslucent());<NEW_LINE>block.<MASK><NEW_LINE>block.setShadowCasting(def.isShadowCasting());<NEW_LINE>block.setWaving(def.isWaving());<NEW_LINE>block.setLuminance(def.getLuminance());<NEW_LINE>block.setTint(def.getTint());<NEW_LINE>if (Strings.isNullOrEmpty(def.getDisplayName())) {<NEW_LINE>block.setDisplayName(properCase(defaultName));<NEW_LINE>} else {<NEW_LINE>block.setDisplayName(def.getDisplayName());<NEW_LINE>}<NEW_LINE>block.setSounds(def.getSounds());<NEW_LINE>block.setMass(def.getMass());<NEW_LINE>block.setDebrisOnDestroy(def.isDebrisOnDestroy());<NEW_LINE>block.setFriction(def.getFriction());<NEW_LINE>block.setRestitution(def.getRestitution());<NEW_LINE>if (def.getEntity() != null) {<NEW_LINE>block.setPrefab(def.getEntity().getPrefab());<NEW_LINE>block.setKeepActive(def.getEntity().isKeepActive());<NEW_LINE>}<NEW_LINE>if (def.getInventory() != null) {<NEW_LINE>block.setStackable(def.getInventory().isStackable());<NEW_LINE>block.setDirectPickup(def.getInventory().isDirectPickup());<NEW_LINE>}<NEW_LINE>return block;<NEW_LINE>} | setDoubleSided(def.isDoubleSided()); |
562,031 | private boolean visit(FunctionCall call) {<NEW_LINE>if (!(call.getTarget() instanceof PropertyGet)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>PropertyGet propertyGet = (PropertyGet) call.getTarget();<NEW_LINE>MethodReference methodRef = getJavaMethodSelector(propertyGet.getTarget());<NEW_LINE>if (methodRef == null || !propertyGet.getProperty().getIdentifier().equals("invoke")) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>for (AstNode arg : call.getArguments()) {<NEW_LINE>arg.visit(this);<NEW_LINE>}<NEW_LINE>MethodReader <MASK><NEW_LINE>if (method == null) {<NEW_LINE>diagnostics.error(location, "Java method not found: {{m0}}", methodRef);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int requiredParams = methodRef.parameterCount();<NEW_LINE>if (!method.hasModifier(ElementModifier.STATIC)) {<NEW_LINE>++requiredParams;<NEW_LINE>}<NEW_LINE>if (call.getArguments().size() != requiredParams) {<NEW_LINE>diagnostics.error(location, "Invalid number of arguments for method {{m0}}. Expected: " + requiredParams + ", encountered: " + call.getArguments().size(), methodRef);<NEW_LINE>}<NEW_LINE>MethodReference caller = createCallbackMethod(method);<NEW_LINE>MethodReference delegate = repository.methodMap.get(location.getMethod());<NEW_LINE>repository.callbackCallees.put(caller, methodRef);<NEW_LINE>repository.callbackMethods.computeIfAbsent(delegate, key -> new HashSet<>()).add(caller);<NEW_LINE>validateSignature(method);<NEW_LINE>StringLiteral newTarget = new StringLiteral();<NEW_LINE>newTarget.setValue("$$JSO$$_" + caller);<NEW_LINE>propertyGet.setTarget(newTarget);<NEW_LINE>return false;<NEW_LINE>} | method = classSource.resolve(methodRef); |
1,289,102 | public void lookupResource(ApplicationResource resource, boolean contextBound, boolean global) {<NEW_LINE>DataSourceInfo dataSourceInfo = null;<NEW_LINE>if (contextBound) {<NEW_LINE>try {<NEW_LINE>javax.naming.Context ctx = !global ? new InitialContext() : getGlobalNamingContext();<NEW_LINE>if (ctx == null) {<NEW_LINE>logger.error("Unable to find context. This may indicate invalid setup. Check global resources versus requested resources");<NEW_LINE>resource.setLookedUp(false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String jndiName = resolveJndiName(resource.getName(), global);<NEW_LINE>logger.debug("reading resource jndi name: {}", jndiName);<NEW_LINE>Object obj = ctx.lookup(jndiName);<NEW_LINE>resource.setLookedUp(true);<NEW_LINE>for (String accessorString : datasourceMappers) {<NEW_LINE><MASK><NEW_LINE>DatasourceAccessor accessor = (DatasourceAccessor) Class.forName(accessorString).getDeclaredConstructor().newInstance();<NEW_LINE>dataSourceInfo = accessor.getInfo(obj);<NEW_LINE>if (dataSourceInfo != null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>resource.setLookedUp(false);<NEW_LINE>dataSourceInfo = null;<NEW_LINE>logger.error("Failed to lookup: '{}'", resource.getName(), e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>resource.setLookedUp(false);<NEW_LINE>}<NEW_LINE>if (resource.isLookedUp() && dataSourceInfo != null) {<NEW_LINE>resource.setDataSourceInfo(dataSourceInfo);<NEW_LINE>}<NEW_LINE>} | logger.debug("Looking up datasource adapter: {}", accessorString); |
1,600,922 | private void checkQueryParamStyleProperty(Class<?> aClass) {<NEW_LINE>// User's programmatic setting takes precedence over<NEW_LINE>// microprofile-config.properties.<NEW_LINE>if (queryParamStyle == null) {<NEW_LINE>if (config != null) {<NEW_LINE>// property using fully-qualified class name takes precedence<NEW_LINE>Optional<String> prop = config.getOptionalValue(aClass.getName(<MASK><NEW_LINE>if (prop.isPresent()) {<NEW_LINE>queryParamStyle(QueryParamStyle.valueOf(prop.get().trim().toUpperCase()));<NEW_LINE>} else {<NEW_LINE>RegisterRestClient registerRestClient = aClass.getAnnotation(RegisterRestClient.class);<NEW_LINE>if (registerRestClient != null && registerRestClient.configKey() != null && !registerRestClient.configKey().isEmpty()) {<NEW_LINE>// property using configKey<NEW_LINE>prop = config.getOptionalValue(registerRestClient.configKey() + "/mp-rest/queryParamStyle", String.class);<NEW_LINE>if (prop.isPresent()) {<NEW_LINE>queryParamStyle(QueryParamStyle.valueOf(prop.get().trim().toUpperCase()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (queryParamStyle == null) {<NEW_LINE>queryParamStyle = QueryParamStyle.MULTI_PAIRS;<NEW_LINE>}<NEW_LINE>} | ) + "/mp-rest/queryParamStyle", String.class); |
865,051 | public Optional<HiveFileWriter> createFileWriter(Path path, List<String> inputColumnNames, StorageFormat storageFormat, Properties schema, JobConf conf, ConnectorSession session, Optional<EncryptionInformation> encryptionInformation) {<NEW_LINE>if (!isParquetOptimizedWriterEnabled(session)) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>if (!MapredParquetOutputFormat.class.getName().equals(storageFormat.getOutputFormat())) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>ParquetWriterOptions parquetWriterOptions = ParquetWriterOptions.builder().setMaxPageSize(getParquetWriterPageSize(session)).setMaxBlockSize(getParquetWriterBlockSize<MASK><NEW_LINE>CompressionCodecName compressionCodecName = getCompression(conf);<NEW_LINE>List<String> fileColumnNames = Splitter.on(',').trimResults().omitEmptyStrings().splitToList(schema.getProperty(META_TABLE_COLUMNS, ""));<NEW_LINE>List<Type> fileColumnTypes = toHiveTypes(schema.getProperty(META_TABLE_COLUMN_TYPES, "")).stream().map(hiveType -> hiveType.getType(typeManager)).collect(toList());<NEW_LINE>int[] fileInputColumnIndexes = fileColumnNames.stream().mapToInt(inputColumnNames::indexOf).toArray();<NEW_LINE>try {<NEW_LINE>FileSystem fileSystem = hdfsEnvironment.getFileSystem(session.getUser(), path, conf);<NEW_LINE>Callable<Void> rollbackAction = () -> {<NEW_LINE>fileSystem.delete(path, false);<NEW_LINE>return null;<NEW_LINE>};<NEW_LINE>return Optional.of(new ParquetFileWriter(fileSystem.create(path), rollbackAction, fileColumnNames, fileColumnTypes, parquetWriterOptions, fileInputColumnIndexes, compressionCodecName));<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new PrestoException(HIVE_WRITER_OPEN_ERROR, "Error creating Parquet file", e);<NEW_LINE>}<NEW_LINE>} | (session)).build(); |
1,806,127 | public synchronized void resetObjInfo() {<NEW_LINE>String detected = ObjTypeDetector.drivedType != null ? ObjTypeDetector.drivedType : ObjTypeDetector.objType != null ? ObjTypeDetector.objType : CounterConstants.JAVA;<NEW_LINE>this.objDetectedType = detected;<NEW_LINE>this.monitoring_group_type = getValue("monitoring_group_type");<NEW_LINE>this.obj_type = StringUtil.isEmpty(this.monitoring_group_type) ? getValue("obj_type", detected) : this.monitoring_group_type;<NEW_LINE>this.objExtType = ObjTypeDetector.objExtType;<NEW_LINE>detected = CounterConstants.HOST;<NEW_LINE>if (SystemUtil.IS_LINUX) {<NEW_LINE>detected = CounterConstants.LINUX;<NEW_LINE>} else if (SystemUtil.IS_WINDOWS) {<NEW_LINE>detected = CounterConstants.WINDOWS;<NEW_LINE>} else if (SystemUtil.IS_MAC_OSX) {<NEW_LINE>detected = CounterConstants.OSX;<NEW_LINE>} else if (SystemUtil.IS_AIX) {<NEW_LINE>detected = CounterConstants.AIX;<NEW_LINE>} else if (SystemUtil.IS_HP_UX) {<NEW_LINE>detected = CounterConstants.HPUX;<NEW_LINE>}<NEW_LINE>this.obj_host_type = getValue("obj_host_type", detected);<NEW_LINE>this.kube = getBoolean("kube", isKube());<NEW_LINE>this.obj_host_name_follow_host_agent = getBoolean("obj_host_name_follow_host_agent", true);<NEW_LINE>String tempObjHostName = getValue("obj_host_name", SysJMX.getHostName());<NEW_LINE>if (kube && obj_host_name_follow_host_agent) {<NEW_LINE>String nameFromHost = readHostNameFromHostAgent();<NEW_LINE>if (StringUtil.isNotEmpty(nameFromHost) && nameFromHost.length() > 1 && nameFromHost.length() < 100) {<NEW_LINE>tempObjHostName = nameFromHost;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.obj_host_name = tempObjHostName;<NEW_LINE>this.objHostName = "/" + this.obj_host_name;<NEW_LINE>this.objHostHash = HashUtil.hash(objHostName);<NEW_LINE>this.obj_name_auto_pid_enabled = getBoolean("obj_name_auto_pid_enabled", false);<NEW_LINE>String defaultName;<NEW_LINE>if (this.obj_name_auto_pid_enabled == true) {<NEW_LINE>defaultName = "" + SysJMX.getProcessPID();<NEW_LINE>} else {<NEW_LINE>defaultName = this.obj_type + "1";<NEW_LINE>}<NEW_LINE>this.obj_name = getValue("obj_name", System.getProperty("jvmRoute", defaultName));<NEW_LINE>this.objName <MASK><NEW_LINE>this.objHash = HashUtil.hash(objName);<NEW_LINE>System.setProperty("scouter.objname", this.objName);<NEW_LINE>System.setProperty("scouter.objtype", this.obj_type);<NEW_LINE>System.setProperty("scouter.dir", agent_dir_path);<NEW_LINE>} | = objHostName + "/" + this.obj_name; |
121,081 | static Component onCreateLayout(ComponentContext c, @State int state) {<NEW_LINE>final boolean redLeft = state == 0 || state == 4 || state == 5;<NEW_LINE>final boolean blueLeft = state == 0 <MASK><NEW_LINE>final boolean greenLeft = state == 0 || state == 1 || state == 2;<NEW_LINE>return Column.create(c).child(Column.create(c).alignItems(redLeft ? YogaAlign.FLEX_START : YogaAlign.FLEX_END).child(Row.create(c).heightDip(40).widthDip(40).backgroundColor(Color.parseColor("#ee1111")).transitionKey(TRANSITION_KEY_RED).build())).child(Column.create(c).alignItems(blueLeft ? YogaAlign.FLEX_START : YogaAlign.FLEX_END).child(Row.create(c).heightDip(40).widthDip(40).backgroundColor(Color.parseColor("#1111ee")).transitionKey(TRANSITION_KEY_BLUE).build())).child(Column.create(c).alignItems(greenLeft ? YogaAlign.FLEX_START : YogaAlign.FLEX_END).child(Row.create(c).heightDip(40).widthDip(40).backgroundColor(Color.parseColor("#11ee11")).transitionKey(TRANSITION_KEY_GREEN).build())).clickHandler(OneByOneLeftRightBlocksComponent.onClick(c)).build();<NEW_LINE>} | || state == 1 || state == 5; |
1,548,938 | private void sendViaSms(final String caller) {<NEW_LINE>Log.i(TAG, "Sending via built-in Sms");<NEW_LINE>// Need to make sure we have the SEND_SMS permission<NEW_LINE>if (!havePermission) {<NEW_LINE>final Form form = container.$form();<NEW_LINE>final Texting me = this;<NEW_LINE>form.runOnUiThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>form.askPermission(Manifest.permission.SEND_SMS, new PermissionResultHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void HandlePermissionResponse(String permission, boolean granted) {<NEW_LINE>if (granted) {<NEW_LINE>me.havePermission = true;<NEW_LINE>me.sendViaSms(caller);<NEW_LINE>} else {<NEW_LINE>form.dispatchPermissionDeniedEvent(me, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ArrayList<String> parts = smsManager.divideMessage(message);<NEW_LINE>int numParts = parts.size();<NEW_LINE>ArrayList<PendingIntent> pendingIntents = new ArrayList<PendingIntent>();<NEW_LINE>for (int i = 0; i < numParts; i++) pendingIntents.add(PendingIntent.getBroadcast(activity, 0, new Intent(SENT), 0));<NEW_LINE>// Receiver for when the SMS is sent<NEW_LINE>BroadcastReceiver sendReceiver = new BroadcastReceiver() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public synchronized void onReceive(Context arg0, Intent arg1) {<NEW_LINE>try {<NEW_LINE>handleSentMessage(arg0, null, getResultCode(), message);<NEW_LINE>activity.unregisterReceiver(this);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.e("BroadcastReceiver", "Error in onReceive for msgId " + arg1.getAction());<NEW_LINE>Log.e("BroadcastReceiver", e.getMessage());<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>// This may result in an error -- a "sent" or "error" message will be displayed<NEW_LINE>activity.registerReceiver(sendReceiver, new IntentFilter(SENT));<NEW_LINE>smsManager.sendMultipartTextMessage(phoneNumber, null, parts, pendingIntents, null);<NEW_LINE>} | caller, Manifest.permission.SEND_SMS); |
1,492,739 | public static void putEncryptedData1() throws NoSuchAlgorithmException {<NEW_LINE>// snippet-start:[s3.java.s3_cse_v2.symmetric]<NEW_LINE>KeyGenerator <MASK><NEW_LINE>keyGenerator.init(256);<NEW_LINE>// generate a symmetric encryption key for testing<NEW_LINE>SecretKey secretKey = keyGenerator.generateKey();<NEW_LINE>// snippet-start:[s3.java.s3_cse_v2.strictauth]<NEW_LINE>String s3ObjectKey = "EncryptedContent1.txt";<NEW_LINE>String s3ObjectContent = "This is the 1st content to encrypt";<NEW_LINE>AmazonS3EncryptionV2 s3Encryption = AmazonS3EncryptionClientV2Builder.standard().withRegion(Regions.DEFAULT_REGION).withClientConfiguration(new ClientConfiguration()).withCryptoConfiguration(new CryptoConfigurationV2().withCryptoMode(CryptoMode.StrictAuthenticatedEncryption)).withEncryptionMaterialsProvider(new StaticEncryptionMaterialsProvider(new EncryptionMaterials(secretKey))).build();<NEW_LINE>s3Encryption.putObject(bucketName, s3ObjectKey, s3ObjectContent);<NEW_LINE>// snippet-end:[s3.java.s3_cse_v2.strictauth]<NEW_LINE>System.out.println(s3Encryption.getObjectAsString(bucketName, s3ObjectKey));<NEW_LINE>s3Encryption.shutdown();<NEW_LINE>// snippet-end:[s3.java.s3_cse_v2.symmetric]<NEW_LINE>} | keyGenerator = KeyGenerator.getInstance("AES"); |
935,501 | protected boolean processSysEvent(DispatcherState curState, DbusEvent event) {<NEW_LINE>boolean success = true;<NEW_LINE>boolean debugEnabled = getLog().isDebugEnabled();<NEW_LINE>Checkpoint ckptInEvent = null;<NEW_LINE>int eventSrcId = event.getSourceId();<NEW_LINE>if (event.isCheckpointMessage()) {<NEW_LINE><MASK><NEW_LINE>byte[] eventBytes = new byte[eventValue.limit()];<NEW_LINE>eventValue.get(eventBytes);<NEW_LINE>if (eventValue.limit() > 0) {<NEW_LINE>try {<NEW_LINE>String cpString = new String(eventBytes, "UTF-8");<NEW_LINE>ckptInEvent = new Checkpoint(cpString);<NEW_LINE>_lastCkpt = ckptInEvent;<NEW_LINE>getLog().info("Bootstrap checkpoint received from the bootstrap server: " + ckptInEvent);<NEW_LINE>_bootstrapMode = _lastCkpt.getConsumptionMode();<NEW_LINE>curState.setEventsSeen(true);<NEW_LINE>if (_bootstrapMode == DbusClientMode.ONLINE_CONSUMPTION) {<NEW_LINE>getLog().info("Bootstrap is complete. Switching to relay consumption");<NEW_LINE>Checkpoint restartCkpt = _lastCkpt.clone();<NEW_LINE>_relayPuller.enqueueMessage(BootstrapResultMessage.createBootstrapCompleteMessage(restartCkpt));<NEW_LINE>}<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>getLog().error("Error while processing internal databus event", e);<NEW_LINE>success = false;<NEW_LINE>} catch (IOException e) {<NEW_LINE>getLog().error("Error while processing internal databus event", e);<NEW_LINE>success = false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>getLog().error("Missing checkpoint in control message");<NEW_LINE>success = false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (debugEnabled)<NEW_LINE>getLog().debug(getName() + ": control srcid:" + eventSrcId);<NEW_LINE>success = super.processSysEvent(curState, event);<NEW_LINE>}<NEW_LINE>return success;<NEW_LINE>} | ByteBuffer eventValue = event.value(); |
1,200,472 | public void readChunkColumn(DataTypeProvider dataProvider) {<NEW_LINE>// Loop through section Y values, starting from the lowest section that has blocks inside it.<NEW_LINE>for (int sectionY = getMinBlockSection(); sectionY <= getMaxSection() + 1 && dataProvider.hasNext(); sectionY++) {<NEW_LINE>ChunkSection_1_18 section = (ChunkSection_1_18) getChunkSection(sectionY);<NEW_LINE>int blockCount = dataProvider.readShort();<NEW_LINE>Palette blockPalette = Palette.readPalette(dataProvider);<NEW_LINE>if (section == null) {<NEW_LINE>section = (ChunkSection_1_18) createNewChunkSection((byte) (sectionY & 0xFF), blockPalette);<NEW_LINE>}<NEW_LINE>// parse blocks<NEW_LINE>section.setBlocks(dataProvider.readLongArray<MASK><NEW_LINE>// biomes<NEW_LINE>section.setBiomePalette(Palette.readPalette(dataProvider));<NEW_LINE>section.setBiomes(dataProvider.readLongArray(dataProvider.readVarInt()));<NEW_LINE>// May replace an existing section or a null one<NEW_LINE>setChunkSection(sectionY, section);<NEW_LINE>}<NEW_LINE>} | (dataProvider.readVarInt())); |
948,989 | // @Override<NEW_LINE>public void start(final Stage primaryStage) {<NEW_LINE><MASK><NEW_LINE>Rectangle2D bounds = screen.getVisualBounds();<NEW_LINE>primaryStage.setX(0);<NEW_LINE>primaryStage.setY(0);<NEW_LINE>final VBox mainBox = new VBox(30);<NEW_LINE>mainBox.setAlignment(Pos.CENTER);<NEW_LINE>final Scene globalScene = new Scene(new Group(), bounds.getWidth(), bounds.getHeight());<NEW_LINE>final TestBuilder builder = TestBuilder.getInstance();<NEW_LINE>Label welcome = new Label("Welcome to Hello Sanity");<NEW_LINE>Button bControls = new Button("Controls");<NEW_LINE>bControls.setOnAction(e -> builder.controlTest(globalScene, mainBox));<NEW_LINE>Button bTabs = new Button("Tabs and Menus");<NEW_LINE>bTabs.setOnAction(e -> builder.menusTest(globalScene, mainBox, primaryStage));<NEW_LINE>Button bWins = new Button("Windows");<NEW_LINE>bWins.setOnAction(e -> builder.windowsTest(globalScene, mainBox, primaryStage));<NEW_LINE>Button bAnim = new Button("Animation");<NEW_LINE>bAnim.setOnAction(e -> builder.animationTest(globalScene, mainBox));<NEW_LINE>Button bEffs = new Button("Effects");<NEW_LINE>bEffs.setOnAction(e -> builder.effectsTest(globalScene, mainBox));<NEW_LINE>Button bgestures = new Button("Gesture Actions");<NEW_LINE>bgestures.setOnAction(e -> builder.GestureTest(globalScene, mainBox));<NEW_LINE>Button bquit = new Button("Quit");<NEW_LINE>bquit.setOnAction(e -> primaryStage.close());<NEW_LINE>mainBox.getChildren().addAll(welcome, bControls, bTabs, bWins, bAnim, bEffs, bgestures, bquit);<NEW_LINE>globalScene.setRoot(mainBox);<NEW_LINE>globalScene.getStylesheets().add("hello/HelloSanityStyles.css");<NEW_LINE>primaryStage.setScene(globalScene);<NEW_LINE>primaryStage.show();<NEW_LINE>} | Screen screen = Screen.getPrimary(); |
1,065,177 | public void processIntent(@NonNull Intent intent) {<NEW_LINE>checkNotNull(intent);<NEW_LINE>if (!intent.hasExtra("serviceUriString")) {<NEW_LINE>Log.e(TAG, "No service uri defined");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!intent.hasExtra("listenerId")) {<NEW_LINE>Log.e(TAG, "No listener id defined");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String serviceUriString = intent.getStringExtra("serviceUriString");<NEW_LINE>int listenerId = intent.getIntExtra("listenerId", 0);<NEW_LINE>Uri serviceUri = Uri.parse(serviceUriString);<NEW_LINE>Fetcher<Uri> <MASK><NEW_LINE>if (matchingFetcher != null) {<NEW_LINE>Log.v(TAG, "Fetcher found for " + serviceUri);<NEW_LINE>matchingFetcher.fetch(intent, listenerId);<NEW_LINE>} else {<NEW_LINE>Log.e(TAG, "Unknown Uri " + serviceUri);<NEW_LINE>}<NEW_LINE>} | matchingFetcher = fetcherManager.findFetcher(serviceUri); |
508,328 | public Task[] readAll(String instance) throws EntranceIllegalParamException, EntranceRPCException, QueryFailedException {<NEW_LINE>List<Task> <MASK><NEW_LINE>if (instance == null || "".equals(instance)) {<NEW_LINE>throw new EntranceIllegalParamException(20004, "instance can not be null");<NEW_LINE>}<NEW_LINE>RequestReadAllTask requestReadAllTask = new RequestReadAllTask(instance);<NEW_LINE>ResponsePersist responsePersist = null;<NEW_LINE>try {<NEW_LINE>responsePersist = (ResponsePersist) sender.ask(requestReadAllTask);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new EntranceRPCException(20020, "sender rpc failed ", e);<NEW_LINE>}<NEW_LINE>if (responsePersist != null) {<NEW_LINE>int status = responsePersist.getStatus();<NEW_LINE>String message = responsePersist.getMsg();<NEW_LINE>if (status != 0) {<NEW_LINE>throw new QueryFailedException(20011, "read all tasks failed, reason: " + message);<NEW_LINE>}<NEW_LINE>Map<String, Object> data = responsePersist.getData();<NEW_LINE>Object object = data.get(TaskConstant.TASK);<NEW_LINE>if (object instanceof List) {<NEW_LINE>List list = (List) object;<NEW_LINE>if (list.size() == 0) {<NEW_LINE>logger.info("no running task in this instance: {}", instance);<NEW_LINE>}<NEW_LINE>for (Object o : list) {<NEW_LINE>if (o instanceof RequestPersistTask) {<NEW_LINE>retList.add((RequestPersistTask) o);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return retList.toArray(new Task[0]);<NEW_LINE>} | retList = new ArrayList<>(); |
1,169,849 | private void parseLine(CNode root, String line, NormalizedDefinition nd) throws IllegalArgumentException {<NEW_LINE>line = NormalizedDefinition.normalize(line);<NEW_LINE>line = line.trim();<NEW_LINE>if (line.length() == 0) {<NEW_LINE>// If having empty lines in between comments, that is logically a break in the comment too<NEW_LINE>if (!comment.isEmpty()) {<NEW_LINE>comment += "\n";<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Matcher commentMatch = commentPattern.matcher(line);<NEW_LINE>if (commentMatch.matches()) {<NEW_LINE>parseCommentLine(commentMatch);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Matcher versionMatch = versionPattern.matcher(line);<NEW_LINE>if (versionMatch.matches()) {<NEW_LINE>// Do nothing, versions are not used<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Matcher namespaceMatcher = namespacePattern.matcher(line);<NEW_LINE>if (namespaceMatcher.matches()) {<NEW_LINE>parseNamespaceLine(namespaceMatcher.group(2));<NEW_LINE>nd.addNormalizedLine(line);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Matcher packageMatcher = packagePattern.matcher(line);<NEW_LINE>if (packageMatcher.matches()) {<NEW_LINE>parsePackageLine(packageMatcher.group(2));<NEW_LINE>nd.addNormalizedLine(line);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Only add lines that are not namespace or comment lines<NEW_LINE>nd.addNormalizedLine(line);<NEW_LINE><MASK><NEW_LINE>root.setLeaf(root.getName() + "." + defLine.getName(), defLine, comment);<NEW_LINE>comment = "";<NEW_LINE>} | DefLine defLine = new DefLine(line); |
644,638 | public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@name('s0') select symbol, sum(price) from " + "SupportMarketDataBean#length(10) as one, " + "SupportBeanString#length(100) as two " + "where one.symbol = two.theString " + "output every 6 events " + "order by volume*sum(price), symbol";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>sendEvent(env, "IBM", 2);<NEW_LINE>env.milestone(0);<NEW_LINE>sendEvent(env, "KGB", 1);<NEW_LINE>sendEvent(env, "CMU", 3);<NEW_LINE>sendEvent(env, "IBM", 6);<NEW_LINE>sendEvent(env, "CAT", 6);<NEW_LINE>env.milestone(1);<NEW_LINE>sendEvent(env, "CAT", 5);<NEW_LINE>env.sendEventBean(new SupportBeanString("CAT"));<NEW_LINE>env.sendEventBean(new SupportBeanString("IBM"));<NEW_LINE>env.sendEventBean(new SupportBeanString("CMU"));<NEW_LINE>env.milestone(2);<NEW_LINE>env.<MASK><NEW_LINE>env.sendEventBean(new SupportBeanString("DOG"));<NEW_LINE>String[] fields = "symbol".split(",");<NEW_LINE>env.assertPropsPerRowNewOnly("s0", fields, new Object[][] { { "CAT" }, { "CAT" }, { "CMU" }, { "IBM" }, { "IBM" }, { "KGB" } });<NEW_LINE>env.undeployAll();<NEW_LINE>} | sendEventBean(new SupportBeanString("KGB")); |
39,139 | public void updateItem(Type item, boolean empty) {<NEW_LINE>super.updateItem(item, empty);<NEW_LINE>setGraphic(null);<NEW_LINE>if (empty) {<NEW_LINE>setText(null);<NEW_LINE>} else {<NEW_LINE>List<String> <MASK><NEW_LINE>for (Type arg : item.getArgumentTypes()) {<NEW_LINE>Type used = arg;<NEW_LINE>int arrayLevel = arg.getSort() == Type.ARRAY ? arg.getDimensions() : 0;<NEW_LINE>if (arrayLevel > 0)<NEW_LINE>used = used.getElementType();<NEW_LINE>String argType = used.getInternalName();<NEW_LINE>if (argType.indexOf('/') > 0) {<NEW_LINE>argType = argType.substring(argType.lastIndexOf('/') + 1);<NEW_LINE>} else if (used.getSort() <= Type.DOUBLE) {<NEW_LINE>argType = used.getClassName();<NEW_LINE>}<NEW_LINE>args.add(argType + array(arrayLevel));<NEW_LINE>}<NEW_LINE>setText(String.join(", ", args));<NEW_LINE>String descArgs = item.getDescriptor();<NEW_LINE>descArgs = descArgs.substring(0, descArgs.indexOf(')') + 1);<NEW_LINE>setTooltip(new Tooltip(descArgs));<NEW_LINE>}<NEW_LINE>} | args = new ArrayList<>(); |
144,895 | private static StringBuilder possibleArgumentTypesOf(InvocationOnMock invocation) {<NEW_LINE>Class<?>[] parameterTypes = invocation<MASK><NEW_LINE>if (parameterTypes.length == 0) {<NEW_LINE>return new StringBuilder("the method has no arguments.\n");<NEW_LINE>}<NEW_LINE>StringBuilder stringBuilder = new StringBuilder("the possible argument indexes for this method are :\n");<NEW_LINE>for (int i = 0, parameterTypesLength = parameterTypes.length; i < parameterTypesLength; i++) {<NEW_LINE>stringBuilder.append(" [").append(i);<NEW_LINE>if (invocation.getMethod().isVarArgs() && i == parameterTypesLength - 1) {<NEW_LINE>stringBuilder.append("+] ").append(parameterTypes[i].getComponentType().getSimpleName()).append(" <- Vararg").append("\n");<NEW_LINE>} else {<NEW_LINE>stringBuilder.append("] ").append(parameterTypes[i].getSimpleName()).append("\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return stringBuilder;<NEW_LINE>} | .getMethod().getParameterTypes(); |
1,594,239 | public boolean checkOperandTypes(HazelcastCallBinding binding, boolean throwOnFailure) {<NEW_LINE>HazelcastSqlValidator validator = binding.getValidator();<NEW_LINE>if (binding.getOperandType(0).getSqlTypeName() != VARCHAR) {<NEW_LINE>if (throwOnFailure) {<NEW_LINE>throw binding.newValidationSignatureError();<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>for (int i = 1; i < binding.getOperandCount(); i++) {<NEW_LINE>SqlNode <MASK><NEW_LINE>RelDataType operandType = binding.getOperandType(i);<NEW_LINE>if (operandType.getSqlTypeName() != VARCHAR) {<NEW_LINE>// Coerce everything to VARCHAR<NEW_LINE>RelDataType newOperandType = HazelcastTypeUtils.createType(validator.getTypeFactory(), VARCHAR, operandType.isNullable());<NEW_LINE>validator.getTypeCoercion().coerceOperandType(binding.getScope(), binding.getCall(), i, newOperandType);<NEW_LINE>}<NEW_LINE>// Set parameter converters<NEW_LINE>if (operand.getKind() == SqlKind.DYNAMIC_PARAM) {<NEW_LINE>int paramIndex = ((SqlDynamicParam) operand).getIndex();<NEW_LINE>ParameterConverter paramConverter = new AnyToVarcharParameterConverter(paramIndex, operand.getParserPosition());<NEW_LINE>validator.setParameterConverter(paramIndex, paramConverter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | operand = binding.operand(i); |
1,038,446 | private void parseConfigFile() throws Exception {<NEW_LINE>String line = null;<NEW_LINE>String[] temp = null;<NEW_LINE>File file = new File(this.confPath);<NEW_LINE>BufferedReader reader = new BufferedReader(new FileReader(file));<NEW_LINE>while ((line = reader.readLine()) != null) {<NEW_LINE>if (line.isEmpty() || line.startsWith("#"))<NEW_LINE>continue;<NEW_LINE>if (line.contains("buid")) {<NEW_LINE>temp = line.split("=");<NEW_LINE><MASK><NEW_LINE>} else if (line.contains("dataset")) {<NEW_LINE>temp = line.split("=");<NEW_LINE>this.dataset = temp[1];<NEW_LINE>} else if (line.contains("algorithm")) {<NEW_LINE>temp = line.split("=");<NEW_LINE>this.algorithm = Integer.parseInt(temp[1]);<NEW_LINE>} else if (line.contains("maxSignalStrength")) {<NEW_LINE>temp = line.split("=");<NEW_LINE>this.maxSignalStrength = Integer.parseInt(temp[1]);<NEW_LINE>} else if (line.contains("k")) {<NEW_LINE>temp = line.split("=");<NEW_LINE>this.k = Integer.parseInt(temp[1]);<NEW_LINE>} else if (line.contains("probability")) {<NEW_LINE>temp = line.split("=");<NEW_LINE>this.probability = Integer.parseInt(temp[1]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println("Buid: " + this.buid + " dataset: " + this.dataset + " algorithm: " + this.algorithm + " maxSignalStrength: " + this.maxSignalStrength + " k: " + this.k + " probability: " + this.probability);<NEW_LINE>reader.close();<NEW_LINE>} | this.buid = temp[1]; |
550,895 | public void onBackPressed() {<NEW_LINE>// Toast.makeText(this, "onBackPressed", Toast.LENGTH_SHORT).show();<NEW_LINE>if (isInterstialShown()) {<NEW_LINE>onFinishActivity();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (dc != null && dc.floatingBookmark != null) {<NEW_LINE>dc.floatingBookmark = null;<NEW_LINE>onRefresh.run();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (anchor != null && anchor.getChildCount() > 0 && anchor.getVisibility() == View.VISIBLE) {<NEW_LINE>dc.clearSelectedText();<NEW_LINE>try {<NEW_LINE>findViewById(R.id.closePopup).performClick();<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.e(e);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (dc != null && !dc.getLinkHistory().isEmpty()) {<NEW_LINE>dc.onLinkHistory();<NEW_LINE>showHideHistory();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (AppState.get().isShowLongBackDialog) {<NEW_LINE>CloseAppDialog.showOnLongClickDialog(<MASK><NEW_LINE>} else {<NEW_LINE>showInterstial();<NEW_LINE>}<NEW_LINE>} | HorizontalViewActivity.this, null, dc); |
812,860 | public boolean offer(T e) {<NEW_LINE>Objects.requireNonNull(e);<NEW_LINE>long pi = producerIndex;<NEW_LINE>AtomicReferenceArray<Object> a = producerArray;<NEW_LINE>int m = mask;<NEW_LINE>int offset = (int) (pi + 1) & m;<NEW_LINE>if (a.get(offset) != null) {<NEW_LINE>offset = (int) pi & m;<NEW_LINE>AtomicReferenceArray<Object> b = new AtomicReferenceArray<>(m + 2);<NEW_LINE>producerArray = b;<NEW_LINE>b.lazySet(offset, e);<NEW_LINE>a.lazySet(m + 1, b);<NEW_LINE>a.lazySet(offset, NEXT);<NEW_LINE>PRODUCER_INDEX.<MASK><NEW_LINE>} else {<NEW_LINE>offset = (int) pi & m;<NEW_LINE>a.lazySet(offset, e);<NEW_LINE>PRODUCER_INDEX.lazySet(this, pi + 1);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | lazySet(this, pi + 1); |
955,811 | public void rollback(final FlowRollback chain, Map data) {<NEW_LINE>if (!data.containsKey(VmStartOnHypervisorFlow.class.getName())) {<NEW_LINE>chain.rollback();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final VmInstanceSpec spec = (VmInstanceSpec) data.get(VmInstanceConstant.Params.VmInstanceSpec.toString());<NEW_LINE>StopVmOnHypervisorMsg msg = new StopVmOnHypervisorMsg();<NEW_LINE>msg.<MASK><NEW_LINE>msg.getVmInventory().setHostUuid(spec.getDestHost().getUuid());<NEW_LINE>bus.makeTargetServiceIdByResourceUuid(msg, HostConstant.SERVICE_ID, spec.getDestHost().getUuid());<NEW_LINE>bus.send(msg, new CloudBusCallBack(chain) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(MessageReply reply) {<NEW_LINE>if (!reply.isSuccess()) {<NEW_LINE>logger.warn(String.format("failed to stop vm[uuid:%s] on host[uuid:%s], %s", spec.getVmInventory().getUuid(), spec.getDestHost().getUuid(), reply.getError()));<NEW_LINE>}<NEW_LINE>chain.rollback();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | setVmInventory(spec.getVmInventory()); |
1,549,614 | public void close() {<NEW_LINE>LOG.info("Close netty connection to {}", name());<NEW_LINE>if (!beingClosed.compareAndSet(false, true)) {<NEW_LINE>LOG.info("Netty client has been closed.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!connectMyself) {<NEW_LINE>unregisterMetrics();<NEW_LINE>}<NEW_LINE>Channel channel = channelRef.get();<NEW_LINE>if (channel == null) {<NEW_LINE>LOG.info("Channel {} has been closed already", name());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// wait for pendings to exit<NEW_LINE>final long timeoutMilliSeconds = 10 * 1000;<NEW_LINE>final long start = System.currentTimeMillis();<NEW_LINE>LOG.info("Waiting for pending batchs to be sent with " + name() + "..., timeout: {}ms, pendings: {}", timeoutMilliSeconds, pendings.get());<NEW_LINE>while (pendings.get() != 0) {<NEW_LINE>try {<NEW_LINE>long delta <MASK><NEW_LINE>if (delta > timeoutMilliSeconds) {<NEW_LINE>LOG.error("Timeout when sending pending batchs with {}..., there are still {} pending batchs not sent", name(), pendings.get());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// sleep 1s<NEW_LINE>Thread.sleep(1000);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>close_n_release();<NEW_LINE>} | = System.currentTimeMillis() - start; |
1,208,278 | private Sendung.Empfaenger createGODeliveryAddress(final Address deliveryAddress, final ContactPerson deliveryContact) {<NEW_LINE>// Consginee address<NEW_LINE>final Sendung.Empfaenger goDeliveryAddress = objectFactory.createSendungEmpfaenger();<NEW_LINE>// Name 1 (an60, mandatory)<NEW_LINE>goDeliveryAddress.setFirmenname1(deliveryAddress.getCompanyName1());<NEW_LINE>// Name 2 (an60, not mandatory)<NEW_LINE>goDeliveryAddress.setFirmenname2(deliveryAddress.getCompanyName2());<NEW_LINE>// Department (an40, mandatory)<NEW_LINE>goDeliveryAddress.setAbteilung(deliveryAddress.getCompanyDepartment());<NEW_LINE>// Street 1 (an35, mandatory)<NEW_LINE>goDeliveryAddress.setStrasse1(deliveryAddress.getStreet1());<NEW_LINE>// House no. (an10, mandatory in DE)<NEW_LINE>goDeliveryAddress.setHausnummer(deliveryAddress.getHouseNo());<NEW_LINE>// Street 2 (an25, not mandatory)<NEW_LINE>goDeliveryAddress.setStrasse2(deliveryAddress.getStreet2());<NEW_LINE>// Country (an3, mandatory) // IMPORTANT: it's alpha2<NEW_LINE>goDeliveryAddress.setLand(deliveryAddress.getCountry().getAlpha2());<NEW_LINE>// ZIP code (an9, mandatory)<NEW_LINE>goDeliveryAddress.setPostleitzahl(deliveryAddress.getZipCode());<NEW_LINE>// City (an30, mandatory)<NEW_LINE>goDeliveryAddress.setStadt(deliveryAddress.getCity());<NEW_LINE>if (deliveryContact != null) {<NEW_LINE>final <MASK><NEW_LINE>final Sendung.Empfaenger.Ansprechpartner.Telefon goPhone = objectFactory.createSendungEmpfaengerAnsprechpartnerTelefon();<NEW_LINE>// Country phone area code (n4, mandatory)<NEW_LINE>goPhone.setLaenderPrefix(phone.getCountryCode());<NEW_LINE>// Area code (n7, mandatory)<NEW_LINE>goPhone.setOrtsvorwahl(phone.getAreaCode());<NEW_LINE>// Phone no. (n10, mandatory)<NEW_LINE>goPhone.setTelefonnummer(phone.getPhoneNumber());<NEW_LINE>final Sendung.Empfaenger.Ansprechpartner goContactPerson = objectFactory.createSendungEmpfaengerAnsprechpartner();<NEW_LINE>// Phone (mandatory)<NEW_LINE>goContactPerson.setTelefon(goPhone);<NEW_LINE>// Contact person (not mandatory)<NEW_LINE>goDeliveryAddress.setAnsprechpartner(goContactPerson);<NEW_LINE>}<NEW_LINE>return goDeliveryAddress;<NEW_LINE>} | PhoneNumber phone = deliveryContact.getPhone(); |
1,325,273 | public void sendSync(long userId, Event event, Position position) {<NEW_LINE>final User user = Context.getPermissionsManager().getUser(userId);<NEW_LINE>String device = "";<NEW_LINE>if (user.getAttributes().containsKey("notificator.pushover.device")) {<NEW_LINE>device = user.getString("notificator.pushover.device").replaceAll(" *, *", ",");<NEW_LINE>}<NEW_LINE>if (token == null) {<NEW_LINE>LOGGER.warn("Pushover token not found");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (this.user == null) {<NEW_LINE>LOGGER.warn("Pushover user not found");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>NotificationMessage shortMessage = NotificationFormatter.formatMessage(userId, event, position, "short");<NEW_LINE>Message message = new Message();<NEW_LINE>message.token = token;<NEW_LINE>message.user = this.user;<NEW_LINE>message.device = device;<NEW_LINE>message.title = shortMessage.getSubject();<NEW_LINE>message.message = shortMessage.getBody();<NEW_LINE>Context.getClient().target(url).request().async().post(Entity.json(message), new InvocationCallback<Object>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void completed(Object o) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void failed(Throwable throwable) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | LOGGER.warn("Pushover API error", throwable); |
195,318 | private void growHashTable() {<NEW_LINE>int[] newHashedOrdinals = new int[hashedOrdinals.length * 2];<NEW_LINE>int[] newOrdinalHashCodes = new int[ordinalHashCodes.length * 2];<NEW_LINE>int[] newOrdinalHashCodeCounts = new <MASK><NEW_LINE>Arrays.fill(newHashedOrdinals, -1);<NEW_LINE>long[] ordinalsAndHashCodes = ordinalsAndHashCodes();<NEW_LINE>for (int i = 0; i < ordinalsAndHashCodes.length; i++) {<NEW_LINE>int hashOrdinal = (int) (ordinalsAndHashCodes[i] >> 32);<NEW_LINE>int hashCode = (int) ordinalsAndHashCodes[i];<NEW_LINE>int hashCount = findOrdinalCount(hashOrdinal, hashCode);<NEW_LINE>hashIntoArray(hashOrdinal, hashCode, hashCount, newHashedOrdinals, newOrdinalHashCodes, newOrdinalHashCodeCounts);<NEW_LINE>}<NEW_LINE>hashedOrdinals = newHashedOrdinals;<NEW_LINE>ordinalHashCodes = newOrdinalHashCodes;<NEW_LINE>ordinalHashCounts = newOrdinalHashCodeCounts;<NEW_LINE>hashSizeBeforeGrow = newHashedOrdinals.length * 7 / 10;<NEW_LINE>} | int[ordinalHashCounts.length * 2]; |
116,962 | protected void initListeners() {<NEW_LINE>super.initListeners();<NEW_LINE>binding.detailTitleRootLayout.setOnClickListener(this);<NEW_LINE>binding.detailTitleRootLayout.setOnLongClickListener(this);<NEW_LINE>binding.detailUploaderRootLayout.setOnClickListener(this);<NEW_LINE>binding.detailUploaderRootLayout.setOnLongClickListener(this);<NEW_LINE>binding.detailThumbnailRootLayout.setOnClickListener(this);<NEW_LINE>binding.detailControlsBackground.setOnClickListener(this);<NEW_LINE>binding.detailControlsBackground.setOnLongClickListener(this);<NEW_LINE>binding.detailControlsPopup.setOnClickListener(this);<NEW_LINE>binding.detailControlsPopup.setOnLongClickListener(this);<NEW_LINE>binding.detailControlsPlaylistAppend.setOnClickListener(this);<NEW_LINE>binding.detailControlsDownload.setOnClickListener(this);<NEW_LINE>binding.detailControlsDownload.setOnLongClickListener(this);<NEW_LINE><MASK><NEW_LINE>binding.detailControlsOpenInBrowser.setOnClickListener(this);<NEW_LINE>binding.detailControlsPlayWithKodi.setOnClickListener(this);<NEW_LINE>if (DEBUG) {<NEW_LINE>binding.detailControlsCrashThePlayer.setOnClickListener(v -> VideoDetailPlayerCrasher.onCrashThePlayer(this.getContext(), this.player, getLayoutInflater()));<NEW_LINE>}<NEW_LINE>binding.overlayThumbnail.setOnClickListener(this);<NEW_LINE>binding.overlayThumbnail.setOnLongClickListener(this);<NEW_LINE>binding.overlayMetadataLayout.setOnClickListener(this);<NEW_LINE>binding.overlayMetadataLayout.setOnLongClickListener(this);<NEW_LINE>binding.overlayButtonsLayout.setOnClickListener(this);<NEW_LINE>binding.overlayCloseButton.setOnClickListener(this);<NEW_LINE>binding.overlayPlayPauseButton.setOnClickListener(this);<NEW_LINE>binding.detailControlsBackground.setOnTouchListener(getOnControlsTouchListener());<NEW_LINE>binding.detailControlsPopup.setOnTouchListener(getOnControlsTouchListener());<NEW_LINE>binding.appBarLayout.addOnOffsetChangedListener((layout, verticalOffset) -> {<NEW_LINE>// prevent useless updates to tab layout visibility if nothing changed<NEW_LINE>if (verticalOffset != lastAppBarVerticalOffset) {<NEW_LINE>lastAppBarVerticalOffset = verticalOffset;<NEW_LINE>// the view was scrolled<NEW_LINE>updateTabLayoutVisibility();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>setupBottomPlayer();<NEW_LINE>if (!playerHolder.isBound()) {<NEW_LINE>setHeightThumbnail();<NEW_LINE>} else {<NEW_LINE>playerHolder.startService(false, this);<NEW_LINE>}<NEW_LINE>} | binding.detailControlsShare.setOnClickListener(this); |
627,290 | public static float[] XYZtoLAB(float x, float y, float z, float[] tristimulus) {<NEW_LINE>float[] lab = new float[3];<NEW_LINE>x /= tristimulus[0];<NEW_LINE>y /= tristimulus[1];<NEW_LINE>z /= tristimulus[2];<NEW_LINE>if (x > 0.008856)<NEW_LINE>x = (float) Math.pow(x, 0.33f);<NEW_LINE>else<NEW_LINE>x = (7.787f * x) + (0.1379310344827586f);<NEW_LINE>if (y > 0.008856)<NEW_LINE>y = (float) Math.pow(y, 0.33f);<NEW_LINE>else<NEW_LINE>y = (7.787f * y) + (0.1379310344827586f);<NEW_LINE>if (z > 0.008856)<NEW_LINE>z = (float) <MASK><NEW_LINE>else<NEW_LINE>z = (7.787f * z) + (0.1379310344827586f);<NEW_LINE>lab[0] = (116 * y) - 16;<NEW_LINE>lab[1] = 500 * (x - y);<NEW_LINE>lab[2] = 200 * (y - z);<NEW_LINE>return lab;<NEW_LINE>} | Math.pow(z, 0.33f); |
1,058,675 | public void execute() {<NEW_LINE>BackgroundTask<Optional<BibEntry>> backgroundTask = searchAndImportEntryInBackground();<NEW_LINE>backgroundTask.titleProperty().set(Localization.lang("Import by ID"));<NEW_LINE>backgroundTask.showToUser(true);<NEW_LINE>backgroundTask.onRunning(() -> dialogService.notify("%s".formatted(backgroundTask.messageProperty().get())));<NEW_LINE>backgroundTask.onFailure((e) -> {<NEW_LINE>// When unable to import by ID, present the user options to cancel or add entry manually<NEW_LINE>boolean addEntryFlag = dialogService.showConfirmationDialogAndWait(Localization.lang("Failed to import by ID"), e.getMessage(), Localization.lang("Add entry manually"));<NEW_LINE>if (addEntryFlag) {<NEW_LINE>// add entry manually<NEW_LINE>new NewEntryAction(libraryTab.frame(), StandardEntryType.Article, dialogService, preferencesService, stateManager).execute();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>backgroundTask.onSuccess((bibEntry) -> {<NEW_LINE>Optional<BibEntry> result = bibEntry;<NEW_LINE>if (result.isPresent()) {<NEW_LINE>final BibEntry entry = result.get();<NEW_LINE>ImportHandler handler = new ImportHandler(libraryTab.getBibDatabaseContext(), ExternalFileTypes.getInstance(), preferencesService, Globals.getFileUpdateMonitor(), libraryTab.getUndoManager(), stateManager, dialogService);<NEW_LINE>handler.importEntryWithDuplicateCheck(<MASK><NEW_LINE>} else {<NEW_LINE>dialogService.notify("No entry found or import canceled");<NEW_LINE>}<NEW_LINE>entryFromIdPopOver.hide();<NEW_LINE>});<NEW_LINE>backgroundTask.executeWith(taskExecutor);<NEW_LINE>} | libraryTab.getBibDatabaseContext(), entry); |
1,147,930 | private void renameOutgoingPhis(int successor, boolean allVersions) {<NEW_LINE>int[] phiIndexes = phiIndexMap[successor];<NEW_LINE>List<Phi> phis = synthesizedPhisByBlock.get(successor);<NEW_LINE>for (int j = 0; j < phis.size(); ++j) {<NEW_LINE>Phi phi = phis.get(j);<NEW_LINE>Variable originalVar = program.variableAt(phiIndexes[j]);<NEW_LINE>Variable var <MASK><NEW_LINE>if (var != null) {<NEW_LINE>List<Variable> versions = definedVersions.get(phiIndexes[j]);<NEW_LINE>if (versions != null && allVersions) {<NEW_LINE>for (Variable version : versions) {<NEW_LINE>Incoming incoming = new Incoming();<NEW_LINE>incoming.setSource(currentBlock);<NEW_LINE>incoming.setValue(version);<NEW_LINE>phi.getIncomings().add(incoming);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Variable sigmaVar = applySigmaRename(program.basicBlockAt(successor), originalVar);<NEW_LINE>Incoming incoming = new Incoming();<NEW_LINE>incoming.setSource(currentBlock);<NEW_LINE>incoming.setValue(sigmaVar != originalVar ? sigmaVar : var);<NEW_LINE>phi.getIncomings().add(incoming);<NEW_LINE>phi.getReceiver().setDebugName(var.getDebugName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = variableMap[phiIndexes[j]]; |
362,682 | public void read(org.apache.thrift.protocol.TProtocol iprot, add_filter_result struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TField schemeField;<NEW_LINE>iprot.readStructBegin();<NEW_LINE>while (true) {<NEW_LINE>schemeField = iprot.readFieldBegin();<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>switch(schemeField.id) {<NEW_LINE>case // EX<NEW_LINE>1:<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {<NEW_LINE>if (struct.ex == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>struct.ex.read(iprot);<NEW_LINE>struct.setExIsSet(true);<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>iprot.readFieldEnd();<NEW_LINE>}<NEW_LINE>iprot.readStructEnd();<NEW_LINE>// check for required fields of primitive type, which can't be checked in the validate method<NEW_LINE>struct.validate();<NEW_LINE>} | struct.ex = new rpc_management_exception(); |
351,675 | public String generateClassData() {<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>Constructor[] constructors;<NEW_LINE>Method[] methods;<NEW_LINE>Field[] fields;<NEW_LINE>Class currentClass;<NEW_LINE>String x, y;<NEW_LINE>Hashtable<String, String> classRef;<NEW_LINE>currentClass = clazz;<NEW_LINE>x = currentClass.getName();<NEW_LINE>if (x.lastIndexOf(".") != -1) {<NEW_LINE>y = x.substring(0, x.lastIndexOf("."));<NEW_LINE>words.add(new TaggedWord("package ", TAG.MODIFIER));<NEW_LINE>words.add(new TaggedWord(y, TAG.IDENTIFIER));<NEW_LINE>words.add(new TaggedWord(";\n", TAG.MODIFIER));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// NoClassDefFoundError ccc71/at/xposed/blocks/at_block_manage_accounts$5<NEW_LINE>fields = currentClass.getDeclaredFields();<NEW_LINE>constructors = currentClass.getDeclaredConstructors();<NEW_LINE>methods = currentClass.getDeclaredMethods();<NEW_LINE>} catch (NoClassDefFoundError e) {<NEW_LINE>return e.toString();<NEW_LINE>}<NEW_LINE>classRef = generateDependencies(constructors, methods, fields);<NEW_LINE>// Don't import ourselves ...<NEW_LINE>classRef.remove(currentClass.getName());<NEW_LINE>fillTaggedText(constructors, methods, fields, currentClass, classRef);<NEW_LINE>long finish = System.currentTimeMillis();<NEW_LINE>System.out.println("* " + (finish - start) + "ms");<NEW_LINE>return (constructors.length + " constructors\n" + methods.length + <MASK><NEW_LINE>} | " methods\n" + fields.length + " fields\n"); |
963,902 | public static void main(String[] args) {<NEW_LINE>InputReader in = new InputReader(System.in);<NEW_LINE>PrintWriter pw = new PrintWriter(System.out);<NEW_LINE>// Code starts..<NEW_LINE>int n = in.nextInt();<NEW_LINE>int[] a = in.nextIntArray(n);<NEW_LINE>query[] qr1 = new query[n];<NEW_LINE>pair[] p = new pair[n];<NEW_LINE>q = n;<NEW_LINE>HashMap<Integer, Integer> map = new HashMap<>();<NEW_LINE>for (int i = 0; i < n; i++) map.put(a[i], i);<NEW_LINE>Arrays.sort(a);<NEW_LINE>for (int i = n - 1; i >= 0; i--) {<NEW_LINE>p[n - i - 1] = new pair(-a[i], map.get(a[i]));<NEW_LINE>int l = 0;<NEW_LINE>int r = map.get(a[i]) - 1;<NEW_LINE>int x = a[i];<NEW_LINE>qr1[n - i - 1] = new query(l, r, -a[i], map.get(a[i]));<NEW_LINE>// pw.println(qr1[n-i-1].l+" "+qr1[n-i-1].x+" "+p[n-i-1]);<NEW_LINE>}<NEW_LINE>int[] ans = answerQueries(n, qr1, q, p);<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>int l = map.get<MASK><NEW_LINE>int r = n - 1;<NEW_LINE>int x = a[i];<NEW_LINE>qr1[i].l = l;<NEW_LINE>qr1[i].r = r;<NEW_LINE>qr1[i].x = x;<NEW_LINE>qr1[i].idx = map.get(a[i]);<NEW_LINE>p[i].x = x;<NEW_LINE>p[i].y = map.get(a[i]);<NEW_LINE>// pw.println(qr1[i].l+" "+qr1[i].x+" "+p[i]+" ");<NEW_LINE>}<NEW_LINE>int[] ans2 = answerQueries(n, qr1, q, p);<NEW_LINE>long sum = 0;<NEW_LINE>for (int i = 0; i < q; i++) {<NEW_LINE>sum += (long) ans[i] * ans2[i];<NEW_LINE>// pw.println(ans[i]+" "+ans2[i]);<NEW_LINE>}<NEW_LINE>pw.print(sum);<NEW_LINE>// code ends...<NEW_LINE>pw.flush();<NEW_LINE>pw.close();<NEW_LINE>} | (a[i]) + 1; |
161,988 | public void start() {<NEW_LINE>Duration[] defaultLatchIntervals = { Duration.apply(1, TimeUnit.MINUTES) };<NEW_LINE>Map<String, CustomHttpHandler> handlers = mPrometheusEnabled ? new Map.Map1<>("/prometheus", new PrometheusHandler()) : Map$.MODULE$.empty();<NEW_LINE>@SuppressWarnings("deprecation")<NEW_LINE>AdminServiceFactory adminServiceFactory = new AdminServiceFactory(this.mPort, 20, List$.MODULE$.<StatsFactory>empty(), Option.<String>empty(), List$.MODULE$.<Regex>empty(), handlers, JavaConversions.asScalaBuffer(Arrays.asList(defaultLatchIntervals)).toList());<NEW_LINE>RuntimeEnvironment runtimeEnvironment = new RuntimeEnvironment(this);<NEW_LINE>adminServiceFactory.apply(runtimeEnvironment);<NEW_LINE>try {<NEW_LINE>Properties properties = new Properties();<NEW_LINE>properties.load(this.getClass().getResource("build.properties").openStream());<NEW_LINE>String buildRevision = properties.getProperty("build_revision", "unknown");<NEW_LINE>LOG.info("build.properties build_revision: {}", properties.getProperty("build_revision", "unknown"));<NEW_LINE><MASK><NEW_LINE>} catch (Throwable t) {<NEW_LINE>LOG.error("Failed to load properties from build.properties", t);<NEW_LINE>}<NEW_LINE>} | StatsUtil.setLabel("secor.build_revision", buildRevision); |
1,428,507 | public ValueNode canonical(CanonicalizerTool tool, ValueNode forObject) {<NEW_LINE>NodeView view = NodeView.from(tool);<NEW_LINE>if (tool.allUsagesAvailable() && hasNoUsages() && !ordersMemoryAccesses()) {<NEW_LINE>if (isStatic() || StampTool.isPointerNonNull(forObject.stamp(view))) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (graph().getGuardsStage().allowsGuardInsertion()) {<NEW_LINE>return new FixedGuardNode(new IsNullNode(forObject), DeoptimizationReason.NullCheckException, DeoptimizationAction.InvalidateReprofile, true, getNodeSourcePosition());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return canonical(this, StampPair.create(stamp, uncheckedStamp), forObject, field, tool.getConstantFieldProvider(), tool.getConstantReflection(), tool.getOptions(), tool.getMetaAccess(), tool.canonicalizeReads(<MASK><NEW_LINE>} | ), tool.allUsagesAvailable()); |
450,907 | public ResponseEntity<Void> createUsersWithListInputWithHttpInfo(List<User> body) throws RestClientException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUsersWithListInput");<NEW_LINE>}<NEW_LINE>final MultiValueMap<String, String> localVarQueryParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final HttpHeaders localVarHeaderParams = new HttpHeaders();<NEW_LINE>final MultiValueMap<String, String> localVarCookieParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final MultiValueMap<String, Object> localVarFormParams = new LinkedMultiValueMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = {};<NEW_LINE>final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>ParameterizedTypeReference<Void> localReturnType = new ParameterizedTypeReference<Void>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI("/user/createWithList", HttpMethod.POST, Collections.<String, Object>emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, <MASK><NEW_LINE>} | localVarAccept, localVarContentType, localVarAuthNames, localReturnType); |
957,597 | public UpdateSecretResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UpdateSecretResult updateSecretResult = new UpdateSecretResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return updateSecretResult;<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("ARN", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateSecretResult.setARN(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateSecretResult.setName(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("VersionId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateSecretResult.setVersionId(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 updateSecretResult;<NEW_LINE>} | class).unmarshall(context)); |
321,008 | public boolean performOk() {<NEW_LINE>DBPPreferenceStore store = DBWorkbench.getPlatform().getPreferenceStore();<NEW_LINE>if (isStandalone) {<NEW_LINE>store.setValue(DBeaverPreferences.UI_AUTO_UPDATE_CHECK, automaticUpdateCheck.getSelection());<NEW_LINE>}<NEW_LINE>store.setValue(ModelPreferences.NOTIFICATIONS_ENABLED, notificationsEnabled.getSelection());<NEW_LINE>store.setValue(ModelPreferences.<MASK><NEW_LINE>store.setValue(DBeaverPreferences.AGENT_LONG_OPERATION_NOTIFY, longOperationsCheck.getSelection());<NEW_LINE>store.setValue(DBeaverPreferences.AGENT_LONG_OPERATION_TIMEOUT, longOperationsTimeout.getSelection());<NEW_LINE>PrefUtils.savePreferenceStore(store);<NEW_LINE>if (workspaceLanguage.getSelectionIndex() >= 0) {<NEW_LINE>PlatformLanguageDescriptor language = PlatformLanguageRegistry.getInstance().getLanguages().get(workspaceLanguage.getSelectionIndex());<NEW_LINE>DBPPlatformLanguage curLanguage = DBWorkbench.getPlatform().getLanguage();<NEW_LINE>try {<NEW_LINE>if (curLanguage != language) {<NEW_LINE>((DBPPlatformLanguageManager) DBWorkbench.getPlatform()).setPlatformLanguage(language);<NEW_LINE>if (UIUtils.confirmAction(getShell(), "Restart " + GeneralUtils.getProductName(), "You need to restart " + GeneralUtils.getProductName() + " to perform actual language change.\nDo you want to restart?")) {<NEW_LINE>UIUtils.asyncExec(() -> PlatformUI.getWorkbench().restart());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (DBException e) {<NEW_LINE>DBWorkbench.getPlatformUI().showError("Change language", "Can't switch language to " + language, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | NOTIFICATIONS_CLOSE_DELAY_TIMEOUT, notificationsCloseDelay.getSelection()); |
425,611 | private Mono<Response<Flux<ByteBuffer>>> createOrUpdateWithResponseAsync(String resourceGroupName, String workspaceName, WorkspaceInner parameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (workspaceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, parameters, accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); |
1,493,502 | public static DescribeAppDetailResponse unmarshall(DescribeAppDetailResponse describeAppDetailResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeAppDetailResponse.setRequestId(_ctx.stringValue("DescribeAppDetailResponse.RequestId"));<NEW_LINE>describeAppDetailResponse.setCode(_ctx.longValue("DescribeAppDetailResponse.Code"));<NEW_LINE>describeAppDetailResponse.setErrMessage(_ctx.stringValue("DescribeAppDetailResponse.ErrMessage"));<NEW_LINE>Result result = new Result();<NEW_LINE>result.setAppStateType(_ctx.stringValue("DescribeAppDetailResponse.Result.AppStateType"));<NEW_LINE>result.setDescription(_ctx.stringValue("DescribeAppDetailResponse.Result.Description"));<NEW_LINE>result.setDeployType(_ctx.stringValue("DescribeAppDetailResponse.Result.DeployType"));<NEW_LINE>result.setAppId<MASK><NEW_LINE>result.setBizName(_ctx.stringValue("DescribeAppDetailResponse.Result.BizName"));<NEW_LINE>result.setTitle(_ctx.stringValue("DescribeAppDetailResponse.Result.Title"));<NEW_LINE>result.setBizTitle(_ctx.stringValue("DescribeAppDetailResponse.Result.BizTitle"));<NEW_LINE>result.setServiceType(_ctx.stringValue("DescribeAppDetailResponse.Result.ServiceType"));<NEW_LINE>result.setOperatingSystem(_ctx.stringValue("DescribeAppDetailResponse.Result.OperatingSystem"));<NEW_LINE>result.setLanguage(_ctx.stringValue("DescribeAppDetailResponse.Result.Language"));<NEW_LINE>List<UserRole> userRoles = new ArrayList<UserRole>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeAppDetailResponse.Result.UserRoles.Length"); i++) {<NEW_LINE>UserRole userRole = new UserRole();<NEW_LINE>userRole.setUserType(_ctx.stringValue("DescribeAppDetailResponse.Result.UserRoles[" + i + "].UserType"));<NEW_LINE>userRole.setRoleName(_ctx.stringValue("DescribeAppDetailResponse.Result.UserRoles[" + i + "].RoleName"));<NEW_LINE>userRole.setRealName(_ctx.stringValue("DescribeAppDetailResponse.Result.UserRoles[" + i + "].RealName"));<NEW_LINE>userRole.setUserId(_ctx.stringValue("DescribeAppDetailResponse.Result.UserRoles[" + i + "].UserId"));<NEW_LINE>userRoles.add(userRole);<NEW_LINE>}<NEW_LINE>result.setUserRoles(userRoles);<NEW_LINE>List<MiddleWareInfo> middleWareInfoList = new ArrayList<MiddleWareInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeAppDetailResponse.Result.MiddleWareInfoList.Length"); i++) {<NEW_LINE>MiddleWareInfo middleWareInfo = new MiddleWareInfo();<NEW_LINE>middleWareInfo.setCode(_ctx.integerValue("DescribeAppDetailResponse.Result.MiddleWareInfoList[" + i + "].Code"));<NEW_LINE>middleWareInfo.setName(_ctx.stringValue("DescribeAppDetailResponse.Result.MiddleWareInfoList[" + i + "].Name"));<NEW_LINE>middleWareInfo.setAppId(_ctx.longValue("DescribeAppDetailResponse.Result.MiddleWareInfoList[" + i + "].AppId"));<NEW_LINE>middleWareInfoList.add(middleWareInfo);<NEW_LINE>}<NEW_LINE>result.setMiddleWareInfoList(middleWareInfoList);<NEW_LINE>describeAppDetailResponse.setResult(result);<NEW_LINE>return describeAppDetailResponse;<NEW_LINE>} | (_ctx.longValue("DescribeAppDetailResponse.Result.AppId")); |
585,725 | public Object onCall(String method, Map<String, Object> param) {<NEW_LINE>Bundle result = new Bundle();<NEW_LINE>ConversationEventListener conversationEventListener = getInstance().getConversationEventListener();<NEW_LINE>if (conversationEventListener == null) {<NEW_LINE>TUIConversationLog.e(TAG, "execute " + method + " failed , conversationEvent listener is null");<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>if (TextUtils.equals(TUIConstants.TUIConversation.METHOD_IS_TOP_CONVERSATION, method)) {<NEW_LINE>String chatId = (String) param.get(TUIConstants.TUIConversation.CHAT_ID);<NEW_LINE>if (!TextUtils.isEmpty(chatId)) {<NEW_LINE>boolean isTop = conversationEventListener.isTopConversation(chatId);<NEW_LINE>result.putBoolean(TUIConstants.TUIConversation.IS_TOP, isTop);<NEW_LINE>}<NEW_LINE>} else if (TextUtils.equals(TUIConstants.TUIConversation.METHOD_SET_TOP_CONVERSATION, method)) {<NEW_LINE>String chatId = (String) param.<MASK><NEW_LINE>boolean isTop = (boolean) param.get(TUIConstants.TUIConversation.IS_SET_TOP);<NEW_LINE>if (!TextUtils.isEmpty(chatId)) {<NEW_LINE>conversationEventListener.setConversationTop(chatId, isTop, new IUIKitCallback<Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(Void data) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(String module, int errCode, String errMsg) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} else if (TextUtils.equals(TUIConstants.TUIConversation.METHOD_GET_TOTAL_UNREAD_COUNT, method)) {<NEW_LINE>return conversationEventListener.getUnreadTotal();<NEW_LINE>} else if (TextUtils.equals(TUIConstants.TUIConversation.METHOD_UPDATE_TOTAL_UNREAD_COUNT, method)) {<NEW_LINE>HashMap<String, Object> unreadMap = new HashMap<>();<NEW_LINE>long totalUnread = conversationEventListener.getUnreadTotal();<NEW_LINE>unreadMap.put(TUIConstants.TUIConversation.TOTAL_UNREAD_COUNT, totalUnread);<NEW_LINE>TUICore.notifyEvent(TUIConstants.TUIConversation.EVENT_UNREAD, TUIConstants.TUIConversation.EVENT_SUB_KEY_UNREAD_CHANGED, unreadMap);<NEW_LINE>} else if (TextUtils.equals(TUIConstants.TUIConversation.METHOD_DELETE_CONVERSATION, method)) {<NEW_LINE>String conversationId = (String) param.get(TUIConstants.TUIConversation.CONVERSATION_ID);<NEW_LINE>conversationEventListener.deleteConversation(conversationId);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | get(TUIConstants.TUIConversation.CHAT_ID); |
1,063,388 | final GetFileUploadURLResult executeGetFileUploadURL(GetFileUploadURLRequest getFileUploadURLRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getFileUploadURLRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetFileUploadURLRequest> request = null;<NEW_LINE>Response<GetFileUploadURLResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetFileUploadURLRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getFileUploadURLRequest));<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, "MTurk");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetFileUploadURL");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetFileUploadURLResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetFileUploadURLResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
911,792 | private void publishBlindVote(Coin stake) {<NEW_LINE>// TODO Starting voteButtonBusyAnimation here does not make sense if we stop it immediately below.<NEW_LINE>// Check if voteButtonBusyAnimation should stay running until we hear back from publishing and only disable<NEW_LINE>// button so that the user cannot click twice.<NEW_LINE>voteButtonBusyAnimation.play();<NEW_LINE>voteButtonInfoLabel.setText(Res.get("dao.blindVote.startPublishing"));<NEW_LINE>daoFacade.publishBlindVote(stake, () -> {<NEW_LINE>if (!DevEnv.isDevMode())<NEW_LINE>new Popup().feedback(Res.get<MASK><NEW_LINE>}, exception -> {<NEW_LINE>voteButtonBusyAnimation.stop();<NEW_LINE>voteButtonInfoLabel.setText("");<NEW_LINE>updateViews();<NEW_LINE>new Popup().warning(exception.toString()).show();<NEW_LINE>});<NEW_LINE>// We reset UI without waiting for callback as callback might be slow and then the user could click<NEW_LINE>// multiple times.<NEW_LINE>voteButtonBusyAnimation.stop();<NEW_LINE>voteButtonInfoLabel.setText("");<NEW_LINE>updateViews();<NEW_LINE>} | ("dao.blindVote.success")).show(); |
622,103 | public Token produce() throws CompileException, IOException {<NEW_LINE>if (this.peek() == -1)<NEW_LINE>return this.token(TokenType.END_OF_INPUT, "end-of-input");<NEW_LINE>// Funny... the JLS calls it "white space", and the JRE calls it "whitespace"!?<NEW_LINE>if (this.ignoreWhiteSpace && Character.isWhitespace(this.peek())) {<NEW_LINE>do {<NEW_LINE>this.read();<NEW_LINE>if (this.peek() == -1)<NEW_LINE>return this.token(TokenType.END_OF_INPUT, "end-of-input");<NEW_LINE>} while (Character.isWhitespace(this.peek()));<NEW_LINE>}<NEW_LINE>this.tokenLineNumber = this.nextCharLineNumber;<NEW_LINE>this.tokenColumnNumber = this.nextCharColumnNumber;<NEW_LINE>this.sb.setLength(0);<NEW_LINE>TokenType tokenType = this.scan();<NEW_LINE>String tokenValue <MASK><NEW_LINE>// We want to be able to use REFERENCE EQUALITY for these...<NEW_LINE>if (tokenType == TokenType.KEYWORD || tokenType == TokenType.BOOLEAN_LITERAL || tokenType == TokenType.NULL_LITERAL || tokenType == TokenType.OPERATOR)<NEW_LINE>tokenValue = tokenValue.intern();<NEW_LINE>return this.token(tokenType, tokenValue);<NEW_LINE>} | = this.sb.toString(); |
46,451 | public void announcementGet(String columns, final Response.Listener<List<Announcement>> responseListener, final Response.ErrorListener errorListener) {<NEW_LINE>Object postBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String path = "/announcement".replaceAll("\\{format\\}", "json");<NEW_LINE>// query params<NEW_LINE>List<Pair> queryParams = new ArrayList<Pair>();<NEW_LINE>// header params<NEW_LINE>Map<String, String> headerParams = new HashMap<String, String>();<NEW_LINE>// form params<NEW_LINE>Map<String, String> formParams = new HashMap<String, String>();<NEW_LINE>queryParams.addAll(ApiInvoker.parameterToPairs("", "columns", columns));<NEW_LINE>String[] contentTypes = { "application/json", "application/x-www-form-urlencoded" };<NEW_LINE>String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";<NEW_LINE>if (contentType.startsWith("multipart/form-data")) {<NEW_LINE>// file uploading<NEW_LINE>MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();<NEW_LINE>HttpEntity httpEntity = localVarBuilder.build();<NEW_LINE>postBody = httpEntity;<NEW_LINE>} else {<NEW_LINE>// normal form params<NEW_LINE>}<NEW_LINE>String[] authNames = new String[] {};<NEW_LINE>try {<NEW_LINE>apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, new Response.Listener<String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponse(String localVarResponse) {<NEW_LINE>try {<NEW_LINE>responseListener.onResponse((List<Announcement>) ApiInvoker.deserialize(localVarResponse<MASK><NEW_LINE>} catch (ApiException exception) {<NEW_LINE>errorListener.onErrorResponse(new VolleyError(exception));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, new Response.ErrorListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onErrorResponse(VolleyError error) {<NEW_LINE>errorListener.onErrorResponse(error);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (ApiException ex) {<NEW_LINE>errorListener.onErrorResponse(new VolleyError(ex));<NEW_LINE>}<NEW_LINE>} | , "array", Announcement.class)); |
16,690 | public static void main(String[] args) throws Exception {<NEW_LINE>JetConfig jetConfig = getJetConfig();<NEW_LINE>JetInstance jet = Jet.newJetInstance(jetConfig);<NEW_LINE>Jet.newJetInstance(jetConfig);<NEW_LINE>try {<NEW_LINE>Pipeline p = Pipeline.create();<NEW_LINE>p.readFrom(Sources.<Integer, Integer>mapJournal(MAP_NAME, START_FROM_OLDEST)).withoutTimestamps().map(Entry::getValue).writeTo(Sinks.list(SINK_NAME));<NEW_LINE>jet.newJob(p);<NEW_LINE>IMap<Integer, Integer> map = jet.getMap(MAP_NAME);<NEW_LINE>for (int i = 0; i < 1000; i++) {<NEW_LINE>map.set(i, i);<NEW_LINE>}<NEW_LINE>TimeUnit.SECONDS.sleep(3);<NEW_LINE>System.out.println("Read " + jet.getList(SINK_NAME<MASK><NEW_LINE>} finally {<NEW_LINE>Jet.shutdownAll();<NEW_LINE>}<NEW_LINE>} | ).size() + " entries from map journal."); |
1,586,598 | private Map<ParameterServerId, PSMatricesLoadContext> split(int requestId, ModelLoadContext loadContext) throws IOException {<NEW_LINE>List<MatrixLoadContext> matricesContext = loadContext.getMatricesContext();<NEW_LINE>Map<ParameterServerId, List<PSMatrixLoadContext>> psIdToContextsMap = new HashMap<>();<NEW_LINE>int size = matricesContext.size();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>Map<ParameterServerId, PSMatrixLoadContext> psIdToContextMap = split(matricesContext.get(i), loadContext);<NEW_LINE>for (Map.Entry<ParameterServerId, PSMatrixLoadContext> matrixEntry : psIdToContextMap.entrySet()) {<NEW_LINE>List<PSMatrixLoadContext> contexts = psIdToContextsMap.get(matrixEntry.getKey());<NEW_LINE>if (contexts == null) {<NEW_LINE>contexts = new ArrayList<>();<NEW_LINE>psIdToContextsMap.put(matrixEntry.getKey(), contexts);<NEW_LINE>}<NEW_LINE>contexts.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<ParameterServerId, PSMatricesLoadContext> ret = new HashMap<>(psIdToContextsMap.size());<NEW_LINE>int subRequestId = 0;<NEW_LINE>for (Map.Entry<ParameterServerId, List<PSMatrixLoadContext>> modelEntry : psIdToContextsMap.entrySet()) {<NEW_LINE>ret.put(modelEntry.getKey(), new PSMatricesLoadContext(requestId, subRequestId++, modelEntry.getValue()));<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | add(matrixEntry.getValue()); |
44,048 | public void watch() {<NEW_LINE>boolean activated = false;<NEW_LINE>if (this.properties.isMonitoringConfigMaps()) {<NEW_LINE>try {<NEW_LINE>String name = "config-maps-watch-event";<NEW_LINE>this.watches.put(name, this.kubernetesClient.configMaps().watch(new Watcher<ConfigMap>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void eventReceived(Watcher.Action action, ConfigMap configMap) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(name + " received event for ConfigMap " + configMap.getMetadata().getName());<NEW_LINE>}<NEW_LINE>onEvent(configMap);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClose(WatcherException exception) {<NEW_LINE>log.warn("ConfigMaps watch closed", exception);<NEW_LINE>Optional.ofNullable(exception).map(e -> {<NEW_LINE>log.debug("Exception received during watch", e);<NEW_LINE>return exception.asClientException();<NEW_LINE>}).map(KubernetesClientException::getStatus).map(Status::getCode).filter(c -> c.equals(HttpURLConnection.HTTP_GONE)).ifPresent(c -> watch());<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>activated = true;<NEW_LINE>this.log.info("Added new Kubernetes watch: " + name);<NEW_LINE>} catch (Exception e) {<NEW_LINE>this.log.error("Error while establishing a connection to watch config maps: configuration may remain stale", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (activated) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | this.log.info("Kubernetes event-based configMap change detector activated"); |
1,049,639 | UnmodifiableIterator<Entry<K, V>> entryIterator() {<NEW_LINE>return new UnmodifiableIterator<Entry<K, V>>() {<NEW_LINE><NEW_LINE>final Iterator<? extends Entry<K, ? extends ImmutableCollection<V>>> asMapItr = map.entrySet().iterator();<NEW_LINE><NEW_LINE>@CheckForNull<NEW_LINE>K currentKey = null;<NEW_LINE><NEW_LINE>Iterator<V> valueItr = Iterators.emptyIterator();<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean hasNext() {<NEW_LINE>return valueItr.hasNext<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Entry<K, V> next() {<NEW_LINE>if (!valueItr.hasNext()) {<NEW_LINE>Entry<K, ? extends ImmutableCollection<V>> entry = asMapItr.next();<NEW_LINE>currentKey = entry.getKey();<NEW_LINE>valueItr = entry.getValue().iterator();<NEW_LINE>}<NEW_LINE>return immutableEntry(requireNonNull(currentKey), valueItr.next());<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | () || asMapItr.hasNext(); |
911,811 | public KeyManagerFactory initializeKeyManagerFactory() throws DrillException {<NEW_LINE>KeyManagerFactory kmf;<NEW_LINE>String keyStorePath = getKeyStorePath();<NEW_LINE>String keyStorePassword = getKeyStorePassword();<NEW_LINE>String keyStoreType = getKeyStoreType();<NEW_LINE>try {<NEW_LINE>if (keyStorePath.isEmpty()) {<NEW_LINE>throw new DrillException("No Keystore provided.");<NEW_LINE>}<NEW_LINE>KeyStore ks = KeyStore.getInstance(!keyStoreType.isEmpty() ? keyStoreType : KeyStore.getDefaultType());<NEW_LINE>// initialize the key manager factory<NEW_LINE>// Will throw an exception if the file is not found/accessible.<NEW_LINE><MASK><NEW_LINE>// A key password CANNOT be null or an empty string.<NEW_LINE>if (keyStorePassword.isEmpty()) {<NEW_LINE>throw new DrillException("The Keystore password cannot be empty.");<NEW_LINE>}<NEW_LINE>ks.load(ksStream, keyStorePassword.toCharArray());<NEW_LINE>// Empty Keystore. (Remarkably, it is possible to do this).<NEW_LINE>if (ks.size() == 0) {<NEW_LINE>throw new DrillException("The Keystore has no entries.");<NEW_LINE>}<NEW_LINE>kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());<NEW_LINE>kmf.init(ks, getKeyPassword().toCharArray());<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new DrillException(new StringBuilder().append("Exception while initializing the keystore: [").append(e.getMessage()).append("]. ").toString());<NEW_LINE>}<NEW_LINE>return kmf;<NEW_LINE>} | InputStream ksStream = new FileInputStream(keyStorePath); |
845,051 | public boolean process() {<NEW_LINE>if (configConverge.maxIterations == 0)<NEW_LINE>return true;<NEW_LINE>if (configScale)<NEW_LINE>scaler.applyScale(structure, observations);<NEW_LINE>sba.configure(configConverge.ftol, configConverge.gtol, configConverge.maxIterations);<NEW_LINE>sba.setParameters(structure, observations);<NEW_LINE>if (verbose != null)<NEW_LINE>printAverageError("BEFORE", verbose);<NEW_LINE>if (!sba.optimize(structure))<NEW_LINE>return false;<NEW_LINE>if (verbose != null)<NEW_LINE>printAverageError("AFTER", verbose);<NEW_LINE>if (keepFraction < 1.0) {<NEW_LINE>// don't prune views since they might be required<NEW_LINE>prune<MASK><NEW_LINE>sba.setParameters(structure, observations);<NEW_LINE>if (!sba.optimize(structure))<NEW_LINE>return false;<NEW_LINE>if (verbose != null)<NEW_LINE>printAverageError("PRUNED-AFTER", verbose);<NEW_LINE>}<NEW_LINE>if (configScale)<NEW_LINE>scaler.undoScale(structure, observations);<NEW_LINE>return true;<NEW_LINE>} | (keepFraction, -1, 1); |
870,287 | private boolean decode(T gray, QrCode qr) {<NEW_LINE>if (!extractFormatInfo(qr)) {<NEW_LINE>qr.failureCause = QrCode.Failure.FORMAT;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!extractVersionInfo(qr)) {<NEW_LINE>qr.failureCause = QrCode.Failure.VERSION;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!alignmentLocator.process(gray, qr)) {<NEW_LINE>qr.failureCause = QrCode.Failure.ALIGNMENT;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// First try using all the features then remove features if they have large errors and might<NEW_LINE>// have incorrectly localized<NEW_LINE>boolean success = false;<NEW_LINE>gridReader.setMarker(qr);<NEW_LINE>gridReader.getTransformGrid().addAllFeatures(qr);<NEW_LINE>// by default it removes outside corners. This works most of the time<NEW_LINE>for (int i = 0; i < 6; i++) {<NEW_LINE>if (i > 0) {<NEW_LINE>boolean removed = gridReader<MASK><NEW_LINE>if (!removed) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>gridReader.getTransformGrid().computeTransform();<NEW_LINE>qr.failureCause = QrCode.Failure.NONE;<NEW_LINE>if (!readRawData(qr)) {<NEW_LINE>qr.failureCause = QrCode.Failure.READING_BITS;<NEW_LINE>// System.out.println("failed trial "+i+" "+qr.failureCause);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!decoder.applyErrorCorrection(qr)) {<NEW_LINE>qr.failureCause = QrCode.Failure.ERROR_CORRECTION;<NEW_LINE>// System.out.println("failed trial "+i+" "+qr.failureCause);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>success = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (success) {<NEW_LINE>// if it can error the errors that means it has all the bits correct<NEW_LINE>// that's why decode is outside of the loop above<NEW_LINE>if (!decoder.decodeMessage(qr)) {<NEW_LINE>// error enum is set internally so that it can be more specific<NEW_LINE>// System.out.println("failed trial "+i+" "+qr.failureCause);<NEW_LINE>success = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// System.out.println("success "+success+" v "+qr.version+" mask "+qr.mask+" error "+qr.error);<NEW_LINE>qr.Hinv.setTo(gridReader.getTransformGrid().Hinv);<NEW_LINE>return success;<NEW_LINE>} | .getTransformGrid().removeFeatureWithLargestError(); |
1,247,524 | final CreateResourceResult executeCreateResource(CreateResourceRequest createResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateResourceRequest> request = null;<NEW_LINE>Response<CreateResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudControl"); |
544,961 | public String prepareIt() {<NEW_LINE>log.info(toString());<NEW_LINE>m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE);<NEW_LINE>if (m_processMsg != null)<NEW_LINE>return DocAction.STATUS_Invalid;<NEW_LINE>MRequisitionLine[] lines = getLines();<NEW_LINE>// Invalid<NEW_LINE>if (getAD_User_ID() == 0 || getM_PriceList_ID() == 0 || getM_Warehouse_ID() == 0) {<NEW_LINE>return DocAction.STATUS_Invalid;<NEW_LINE>}<NEW_LINE>if (lines.length == 0) {<NEW_LINE>throw new AdempiereException("@NoLines@");<NEW_LINE>}<NEW_LINE>// Std Period open?<NEW_LINE>MPeriod.testPeriodOpen(getCtx(), getDateDoc(), <MASK><NEW_LINE>// Add up Amounts<NEW_LINE>int precision = MPriceList.getStandardPrecision(getCtx(), getM_PriceList_ID());<NEW_LINE>BigDecimal totalLines = Env.ZERO;<NEW_LINE>for (int i = 0; i < lines.length; i++) {<NEW_LINE>MRequisitionLine line = lines[i];<NEW_LINE>BigDecimal lineNet = line.getQty().multiply(line.getPriceActual());<NEW_LINE>lineNet = lineNet.setScale(precision, BigDecimal.ROUND_HALF_UP);<NEW_LINE>if (lineNet.compareTo(line.getLineNetAmt()) != 0) {<NEW_LINE>line.setLineNetAmt(lineNet);<NEW_LINE>line.saveEx();<NEW_LINE>}<NEW_LINE>totalLines = totalLines.add(line.getLineNetAmt());<NEW_LINE>}<NEW_LINE>if (totalLines.compareTo(getTotalLines()) != 0) {<NEW_LINE>setTotalLines(totalLines);<NEW_LINE>saveEx();<NEW_LINE>}<NEW_LINE>if (!calculateTaxTotal()) {<NEW_LINE>m_processMsg = "Error calculating tax";<NEW_LINE>return DocAction.STATUS_Invalid;<NEW_LINE>}<NEW_LINE>m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE);<NEW_LINE>if (m_processMsg != null)<NEW_LINE>return DocAction.STATUS_Invalid;<NEW_LINE>m_justPrepared = true;<NEW_LINE>return DocAction.STATUS_InProgress;<NEW_LINE>} | MDocType.DOCBASETYPE_PurchaseRequisition, getAD_Org_ID()); |
1,455,765 | public void prepareChunkedQuery(PreparedStatement stmt, List<Object> values) throws SQLException {<NEW_LINE><MASK><NEW_LINE>// Bind all variables in the PreparedStatement i.e. the '?' to values supplied in the list.<NEW_LINE>// For the example query<NEW_LINE>//<NEW_LINE>// SELECT * FROM<NEW_LINE>// (<NEW_LINE>// SELECT * FROM<NEW_LINE>// (<NEW_LINE>// SELECT * FROM TABLE<NEW_LINE>// ) nestedTab1 WHERE ( MOD ( MD5 ( CONCAT ( KEY1 , KEY2 ) ) , 10 ) IN ( 2 , 5 ) )<NEW_LINE>// AND ( ( KEY1 > ? ) OR ( KEY1 = ? AND KEY2 > ? ) )<NEW_LINE>// ORDER BY KEY1 , KEY2<NEW_LINE>// ) as nestedTab2 LIMIT 10;<NEW_LINE>//<NEW_LINE>// the value for KEY1 and KEY2 needs to be plugged in order. The index values for PreparedStatement.setObject start<NEW_LINE>// at 1.<NEW_LINE>for (int i = 0, index = 1; i < count; i++) {<NEW_LINE>for (int j = 0; j <= i; j++, index++) {<NEW_LINE>stmt.setObject(index, values.get(j));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int count = values.size(); |
1,052,455 | public static void displayUsage(final PrintStream ps, final String commandName, final String version, final String commandShortSummary, final String commandDescription, final List<List<Argument>> commandVariants, final List<String> tips, final char valuedArgumentsSeparator) {<NEW_LINE>ps.println();<NEW_LINE>ps.println(generateSectionHeader(NAME));<NEW_LINE>ps.println('\t' + commandName + " - " + commandShortSummary + ((version != null) ? (" - " + <MASK><NEW_LINE>final String boldName = markupWord(commandName, true);<NEW_LINE>final HashSet<Argument> arguments = new HashSet<>();<NEW_LINE>ps.println(generateSectionHeader(SYNOPSIS));<NEW_LINE>for (final List<Argument> variant : commandVariants) {<NEW_LINE>ps.println("\t" + generateCommandForVariant(boldName, variant, arguments, valuedArgumentsSeparator));<NEW_LINE>}<NEW_LINE>ps.println();<NEW_LINE>final String commandNameRegex = commandName + "(\\)|\\s|$)";<NEW_LINE>final Pattern p = Pattern.compile(commandNameRegex);<NEW_LINE>final Matcher m = p.matcher(commandDescription);<NEW_LINE>final String markedUpDescription;<NEW_LINE>if (m.find()) {<NEW_LINE>final StringBuilder sb = new StringBuilder();<NEW_LINE>if (m.start() > 0) {<NEW_LINE>sb.append(commandDescription.substring(0, m.start()));<NEW_LINE>}<NEW_LINE>sb.append(boldName).append(m.group(1));<NEW_LINE>int lastEnd = m.end();<NEW_LINE>while (m.find()) {<NEW_LINE>sb.append(commandDescription.substring(lastEnd, m.start())).append(boldName).append(m.group(1));<NEW_LINE>lastEnd = m.end();<NEW_LINE>}<NEW_LINE>sb.append(commandDescription.substring(lastEnd, commandDescription.length()));<NEW_LINE>markedUpDescription = sb.toString();<NEW_LINE>} else {<NEW_LINE>markedUpDescription = commandDescription;<NEW_LINE>}<NEW_LINE>ps.println(generateSectionHeader(DESCRIPTION));<NEW_LINE>ps.println("\t" + markedUpDescription.replaceAll("(\\r\\n|\\r|\\n)", "\n\t"));<NEW_LINE>ps.println();<NEW_LINE>final List<Argument> orderedArguments = new ArrayList<>(arguments);<NEW_LINE>Collections.sort(orderedArguments, NAME_COMPARATOR);<NEW_LINE>ps.println(generateSectionHeader(OPTIONS));<NEW_LINE>for (final Argument arg : orderedArguments) {<NEW_LINE>if (arg.expectsValue() || arg.isOptional() || (!arg.expectsValue() && arg.isDashArgument())) {<NEW_LINE>ps.println(generateOptionText(arg, valuedArgumentsSeparator));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ps.println();<NEW_LINE>if ((tips != null) && (tips.size() > 0)) {<NEW_LINE>ps.println(generateSectionHeader(TIPS));<NEW_LINE>for (final String tip : tips) {<NEW_LINE>ps.println("\t" + tip.replaceAll("(\\r\\n|\\r|\\n)", "\n\t") + "\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | version) : "") + "\n\n"); |
1,603,010 | public static Optional<ApiListing> mergedApiListing(Collection<ApiListing> apiListings) {<NEW_LINE>if (nullToEmptyList(apiListings).size() > 1) {<NEW_LINE>ApiListing merged = new ApiListing();<NEW_LINE>merged.setSwaggerVersion("1.2");<NEW_LINE>merged.setPosition(0);<NEW_LINE>for (ApiListing each : apiListings) {<NEW_LINE>merged.<MASK><NEW_LINE>merged.setBasePath(each.getBasePath());<NEW_LINE>merged.setResourcePath(each.getResourcePath());<NEW_LINE>merged.setDescription(each.getDescription());<NEW_LINE>merged.appendAuthorizations(each.getAuthorizations());<NEW_LINE>merged.appendApis(each.getApis());<NEW_LINE>merged.appendProtocols(new HashSet<>(each.getProtocols()));<NEW_LINE>merged.appendConsumes(new HashSet<>(each.getConsumes()));<NEW_LINE>merged.appendModels(each.getModels());<NEW_LINE>merged.appendProduces(new HashSet<>(each.getProduces()));<NEW_LINE>}<NEW_LINE>return of(merged);<NEW_LINE>}<NEW_LINE>return nullToEmptyList(apiListings).stream().findFirst();<NEW_LINE>} | setApiVersion(each.getApiVersion()); |
1,123,274 | int allSlotsInAnnotationDo(U32Pointer annotation, String annotationSectionName) throws CorruptDataException {<NEW_LINE>int increment = 0;<NEW_LINE>int annotationLength = annotation.<MASK><NEW_LINE>int padding = U32.SIZEOF - (annotationLength % U32.SIZEOF);<NEW_LINE>increment = annotationLength / U32.SIZEOF;<NEW_LINE>if (U32.SIZEOF == padding) {<NEW_LINE>padding = 0;<NEW_LINE>}<NEW_LINE>if (padding > 0) {<NEW_LINE>increment++;<NEW_LINE>}<NEW_LINE>classWalkerCallback.addSlot(clazz, SlotType.J9_U32, annotation, "annotation length");<NEW_LINE>int count = annotationLength;<NEW_LINE>U8Pointer cursor = U8Pointer.cast(annotation.add(1));<NEW_LINE>for (; count > 0; count--) {<NEW_LINE>classWalkerCallback.addSlot(clazz, SlotType.J9_U8, cursor, "annotation data");<NEW_LINE>cursor = cursor.add(1);<NEW_LINE>}<NEW_LINE>count = padding;<NEW_LINE>for (; count > 0; count--) {<NEW_LINE>classWalkerCallback.addSlot(clazz, SlotType.J9_U8, cursor, "annotation padding");<NEW_LINE>cursor = cursor.add(1);<NEW_LINE>} | at(0).intValue(); |
1,834,993 | private void commitTrusts() {<NEW_LINE>for (final String fingerprint : ownKeysToTrust.keySet()) {<NEW_LINE>mAccount.getAxolotlService().setFingerprintTrust(fingerprint, FingerprintStatus.createActive(ownKeysToTrust.get(fingerprint)));<NEW_LINE>}<NEW_LINE>List<Jid> acceptedTargets = mConversation == null ? new ArrayList<>() : mConversation.getAcceptedCryptoTargets();<NEW_LINE>synchronized (this.foreignKeysToTrust) {<NEW_LINE>for (Map.Entry<Jid, Map<String, Boolean>> entry : foreignKeysToTrust.entrySet()) {<NEW_LINE>Jid jid = entry.getKey();<NEW_LINE>Map<String, Boolean> value = entry.getValue();<NEW_LINE>if (!acceptedTargets.contains(jid)) {<NEW_LINE>acceptedTargets.add(jid);<NEW_LINE>}<NEW_LINE>for (final String fingerprint : value.keySet()) {<NEW_LINE>mAccount.getAxolotlService().setFingerprintTrust(fingerprint, FingerprintStatus.createActive(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mConversation != null && mConversation.getMode() == Conversation.MODE_MULTI) {<NEW_LINE>mConversation.setAcceptedCryptoTargets(acceptedTargets);<NEW_LINE>xmppConnectionService.updateConversation(mConversation);<NEW_LINE>}<NEW_LINE>} | value.get(fingerprint))); |
830,278 | public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@name('create') create window MyWindowMU#unique(theString)#length(2) retain-union as select * from SupportBean;\n" + "insert into MyWindowMU select * from SupportBean;\n" + "on SupportBean_A update MyWindowMU mw set mw.intPrimitive=intPrimitive*100 where theString=id;\n";<NEW_LINE>env.compileDeploy(epl).addListener("create");<NEW_LINE>env.sendEventBean(new SupportBean("E1", 2));<NEW_LINE>env.sendEventBean(new SupportBean("E2", 3));<NEW_LINE>env.sendEventBean(new SupportBean_A("E2"));<NEW_LINE>env.assertListener("create", listener -> {<NEW_LINE>EventBean[] newevents = listener.getLastNewData();<NEW_LINE>EventBean[] oldevents = listener.getLastOldData();<NEW_LINE>assertEquals(1, newevents.length);<NEW_LINE>EPAssertionUtil.assertProps(newevents[0], "intPrimitive".split(","), new Object[] { 300 });<NEW_LINE>assertEquals(1, oldevents.length);<NEW_LINE>EPAssertionUtil.assertPropsPerRow(oldevents, "theString,intPrimitive".split(","), new Object[][] { { "E2", 3 } });<NEW_LINE>});<NEW_LINE>env.assertIterator("create", iterator -> {<NEW_LINE>EventBean[] events = EPAssertionUtil.sort(iterator, "theString");<NEW_LINE>EPAssertionUtil.assertPropsPerRow(events, "theString,intPrimitive".split(","), new Object[][] { { "E1", 2 }<MASK><NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>} | , { "E2", 300 } }); |
1,456,802 | private static double lengthReductionToStayWithinBounds(Point2D centerPoint, double width, double height, Rectangle2D bounds) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Objects.requireNonNull(centerPoint, "The specified center point of the new rectangle must not be null.");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Objects.requireNonNull(bounds, "The specified bounds for the new rectangle must not be null.");<NEW_LINE>boolean centerPointInBounds = bounds.contains(centerPoint);<NEW_LINE>if (!centerPointInBounds) {<NEW_LINE>throw new // $NON-NLS-1$<NEW_LINE>IllegalArgumentException(// $NON-NLS-1$<NEW_LINE>"The center point " + centerPoint + " of the original rectangle is out of the specified bounds.");<NEW_LINE>}<NEW_LINE>if (width < 0) {<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>throw new IllegalArgumentException("The specified width " + width + " must be larger than zero.");<NEW_LINE>}<NEW_LINE>if (height < 0) {<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>throw new IllegalArgumentException("The specified height " + height + " must be larger than zero.");<NEW_LINE>}<NEW_LINE>double distanceToEast = Math.abs(centerPoint.getX() - bounds.getMinX());<NEW_LINE>double distanceToWest = Math.abs(centerPoint.getX() - bounds.getMaxX());<NEW_LINE>double distanceToNorth = Math.abs(centerPoint.getY(<MASK><NEW_LINE>double distanceToSouth = Math.abs(centerPoint.getY() - bounds.getMaxY());<NEW_LINE>// the returned factor must not be greater than one; otherwise the size would increase<NEW_LINE>return MathTools.min(1, distanceToEast / width * 2, distanceToWest / width * 2, distanceToNorth / height * 2, distanceToSouth / height * 2);<NEW_LINE>} | ) - bounds.getMinY()); |
1,197,018 | public void paintBorder(final Component c, final Graphics g, int x, int y, int width, int height) {<NEW_LINE>// g.setColor(Color.MAGENTA);<NEW_LINE>// g.drawRect(x, y, width - 1, height - 1);<NEW_LINE>if (!(c instanceof JTextComponent)) {<NEW_LINE>painter.state.set(State.ACTIVE);<NEW_LINE>painter.state.set(Focused.NO);<NEW_LINE>painter.paint(g, c, <MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final JTextComponent jc = (JTextComponent) c;<NEW_LINE>final State state = getStateFor(jc);<NEW_LINE>painter.state.set(state);<NEW_LINE>painter.state.set(State.ACTIVE == state && jc.hasFocus() ? Focused.YES : Focused.NO);<NEW_LINE>if (jc.isOpaque()) {<NEW_LINE>painter.paint(g, c, x, y, width, height);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int shrinkage = getShrinkageFor(jc, height);<NEW_LINE>final Insets subInsets = getSubInsets(shrinkage);<NEW_LINE>x += subInsets.left;<NEW_LINE>y += subInsets.top;<NEW_LINE>width -= (subInsets.left + subInsets.right);<NEW_LINE>height -= (subInsets.top + subInsets.bottom);<NEW_LINE>if (shrinkage > 0) {<NEW_LINE>final Rectangle clipBounds = g.getClipBounds();<NEW_LINE>clipBounds.x += shrinkage;<NEW_LINE>clipBounds.width -= shrinkage * 2;<NEW_LINE>g.setClip(clipBounds);<NEW_LINE>}<NEW_LINE>painter.paint(g, c, x, y, width, height);<NEW_LINE>// g.setColor(Color.ORANGE);<NEW_LINE>// g.drawRect(x, y, width - 1, height - 1);<NEW_LINE>} | x, y, width, height); |
103,910 | public String generateRRULEString() {<NEW_LINE>StringBuilder finalRRule = new StringBuilder();<NEW_LINE>// Handle frequency.<NEW_LINE>if (this.frequency != null) {<NEW_LINE>String frequencyPart = "FREQ=" + frequency.toRfcStringId();<NEW_LINE>finalRRule.append(frequencyPart);<NEW_LINE>finalRRule.append(";");<NEW_LINE>// Handle frequency specific rules in different context.<NEW_LINE>switch(this.frequency) {<NEW_LINE>case WEEKLY:<NEW_LINE>StringBuilder weeklyRecurrencesString = new StringBuilder("BYDAY=");<NEW_LINE>int commaIndex = 0;<NEW_LINE>for (KrollDict dict : this.daysOfTheWeek) {<NEW_LINE>weeklyRecurrencesString.append(dict.get(this.dayOfWeekKey).toString());<NEW_LINE>if (commaIndex < this.daysOfTheWeek.length) {<NEW_LINE>weeklyRecurrencesString.append(",");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>finalRRule.<MASK><NEW_LINE>finalRRule.append(";");<NEW_LINE>break;<NEW_LINE>case MONTHLY:<NEW_LINE>StringBuilder monthlyReccurencesString = new StringBuilder();<NEW_LINE>// daysOfTheWeek dictionary is with highest priority.<NEW_LINE>if (this.daysOfTheWeek.length > 0) {<NEW_LINE>monthlyReccurencesString.append("BYDAY=");<NEW_LINE>int index = this.daysOfTheWeek[0].getInt(this.weekNumberKey);<NEW_LINE>monthlyReccurencesString.append(index);<NEW_LINE>// Potentially add week start (Sunday or Monday) different from the default one.<NEW_LINE>monthlyReccurencesString.append(RecurrenceRuleProxy.weekdaysMap.keySet().toArray()[index]);<NEW_LINE>} else {<NEW_LINE>monthlyReccurencesString.append("BYMONTHDAY=");<NEW_LINE>// Case in which we do not have items in daysOfTheWeek array.<NEW_LINE>monthlyReccurencesString.append(this.daysOfTheMonth[0]);<NEW_LINE>}<NEW_LINE>finalRRule.append(monthlyReccurencesString);<NEW_LINE>finalRRule.append(";");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Handle interval.<NEW_LINE>if (this.interval != null) {<NEW_LINE>finalRRule.append("INTERVAL=");<NEW_LINE>finalRRule.append(this.interval);<NEW_LINE>finalRRule.append(";");<NEW_LINE>}<NEW_LINE>// Handle end.<NEW_LINE>if (this.endDictionary.containsKey(this.until)) {<NEW_LINE>// Dictionary can contain only one of the keys,<NEW_LINE>// so what's left is a specific date end rule.<NEW_LINE>finalRRule.append("UNTIL=");<NEW_LINE>finalRRule.append(this.endDictionary.get(this.until));<NEW_LINE>finalRRule.append(";");<NEW_LINE>} else if (this.endDictionary.containsKey(this.count)) {<NEW_LINE>// End rule is with occurrence count.<NEW_LINE>finalRRule.append("COUNT=");<NEW_LINE>finalRRule.append(this.endDictionary.get(this.count));<NEW_LINE>finalRRule.append(";");<NEW_LINE>}<NEW_LINE>return finalRRule.toString();<NEW_LINE>} | append(weeklyRecurrencesString.toString()); |
737,193 | public OutputStream visitClass(String classname, Element... originatingElements) throws IOException {<NEW_LINE>File classesDir = compilationUnit.getConfiguration().getTargetDirectory();<NEW_LINE>if (classesDir != null) {<NEW_LINE>DirectoryClassWriterOutputVisitor outputVisitor = new DirectoryClassWriterOutputVisitor(classesDir);<NEW_LINE>return <MASK><NEW_LINE>} else {<NEW_LINE>// should only arrive here in testing scenarios<NEW_LINE>if (compilationUnit.getClassLoader() instanceof InMemoryByteCodeGroovyClassLoader) {<NEW_LINE>return new OutputStream() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void write(int b) {<NEW_LINE>// no-op<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void write(byte[] b) {<NEW_LINE>((InMemoryByteCodeGroovyClassLoader) compilationUnit.getClassLoader()).addClass(classname, b);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} else {<NEW_LINE>// in-memory, mock or unit tests situation?<NEW_LINE>return new ByteArrayOutputStream();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | outputVisitor.visitClass(classname, originatingElements); |
1,576,799 | private View inflateRoutingParameter(final int position) {<NEW_LINE>View v = mapActivity.getLayoutInflater().inflate(R.layout.layers_list_activity_item, null);<NEW_LINE>AndroidUtils.setListItemBackground(mapActivity, v, nightMode);<NEW_LINE>final TextView tv = (TextView) v.findViewById(R.id.title);<NEW_LINE>final TextView desc = (TextView) v.findViewById(R.id.description);<NEW_LINE>final CheckBox ch = ((CheckBox) v.findViewById<MASK><NEW_LINE>final LocalRoutingParameter rp = getItem(position);<NEW_LINE>AndroidUtils.setTextPrimaryColor(mapActivity, tv, nightMode);<NEW_LINE>tv.setText(rp.getText(mapActivity));<NEW_LINE>ch.setOnCheckedChangeListener(null);<NEW_LINE>if (rp instanceof LocalRoutingParameterGroup) {<NEW_LINE>LocalRoutingParameterGroup group = (LocalRoutingParameterGroup) rp;<NEW_LINE>AndroidUtils.setTextPrimaryColor(mapActivity, desc, nightMode);<NEW_LINE>LocalRoutingParameter selected = group.getSelected(settings);<NEW_LINE>if (selected != null) {<NEW_LINE>desc.setText(selected.getText(mapActivity));<NEW_LINE>desc.setVisibility(View.VISIBLE);<NEW_LINE>}<NEW_LINE>ch.setVisibility(View.GONE);<NEW_LINE>} else {<NEW_LINE>if (rp.routingParameter != null && rp.routingParameter.getId().equals(GeneralRouter.USE_SHORTEST_WAY)) {<NEW_LINE>// if short route settings - it should be inverse of fast_route_mode<NEW_LINE>ch.setChecked(!settings.FAST_ROUTE_MODE.getModeValue(routingHelper.getAppMode()));<NEW_LINE>} else {<NEW_LINE>ch.setChecked(rp.isSelected(settings));<NEW_LINE>}<NEW_LINE>ch.setVisibility(View.VISIBLE);<NEW_LINE>ch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {<NEW_LINE>routingOptionsHelper.applyRoutingParameter(rp, isChecked);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return v;<NEW_LINE>} | (R.id.toggle_item)); |
1,070,673 | public static ListQuotaApplicationsResponse unmarshall(ListQuotaApplicationsResponse listQuotaApplicationsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listQuotaApplicationsResponse.setRequestId(_ctx.stringValue("ListQuotaApplicationsResponse.RequestId"));<NEW_LINE>listQuotaApplicationsResponse.setTotalCount(_ctx.integerValue("ListQuotaApplicationsResponse.TotalCount"));<NEW_LINE>listQuotaApplicationsResponse.setNextToken(_ctx.stringValue("ListQuotaApplicationsResponse.NextToken"));<NEW_LINE>listQuotaApplicationsResponse.setMaxResults(_ctx.integerValue("ListQuotaApplicationsResponse.MaxResults"));<NEW_LINE>List<QuotaApplicationsItem> quotaApplications = new ArrayList<QuotaApplicationsItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListQuotaApplicationsResponse.QuotaApplications.Length"); i++) {<NEW_LINE>QuotaApplicationsItem quotaApplicationsItem = new QuotaApplicationsItem();<NEW_LINE>quotaApplicationsItem.setStatus(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].Status"));<NEW_LINE>quotaApplicationsItem.setApplyTime(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].ApplyTime"));<NEW_LINE>quotaApplicationsItem.setComment(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].Comment"));<NEW_LINE>quotaApplicationsItem.setQuotaDescription(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].QuotaDescription"));<NEW_LINE>quotaApplicationsItem.setProductCode(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].ProductCode"));<NEW_LINE>quotaApplicationsItem.setEffectiveTime(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].EffectiveTime"));<NEW_LINE>quotaApplicationsItem.setAuditReason(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].AuditReason"));<NEW_LINE>quotaApplicationsItem.setQuotaUnit(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].QuotaUnit"));<NEW_LINE>quotaApplicationsItem.setDimension(_ctx.mapValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].Dimension"));<NEW_LINE>quotaApplicationsItem.setApproveValue(_ctx.floatValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].ApproveValue"));<NEW_LINE>quotaApplicationsItem.setReason(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].Reason"));<NEW_LINE>quotaApplicationsItem.setQuotaActionCode(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].QuotaActionCode"));<NEW_LINE>quotaApplicationsItem.setQuotaName(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].QuotaName"));<NEW_LINE>quotaApplicationsItem.setQuotaArn(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].QuotaArn"));<NEW_LINE>quotaApplicationsItem.setNoticeType(_ctx.integerValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].NoticeType"));<NEW_LINE>quotaApplicationsItem.setApplicationId(_ctx.stringValue<MASK><NEW_LINE>quotaApplicationsItem.setDesireValue(_ctx.floatValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].DesireValue"));<NEW_LINE>quotaApplicationsItem.setExpireTime(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].ExpireTime"));<NEW_LINE>Period period = new Period();<NEW_LINE>period.setPeriodValue(_ctx.longValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].Period.PeriodValue"));<NEW_LINE>period.setPeriodUnit(_ctx.stringValue("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].Period.PeriodUnit"));<NEW_LINE>quotaApplicationsItem.setPeriod(period);<NEW_LINE>quotaApplications.add(quotaApplicationsItem);<NEW_LINE>}<NEW_LINE>listQuotaApplicationsResponse.setQuotaApplications(quotaApplications);<NEW_LINE>return listQuotaApplicationsResponse;<NEW_LINE>} | ("ListQuotaApplicationsResponse.QuotaApplications[" + i + "].ApplicationId")); |
1,652,519 | public static OptionDescriptor create(String name, OptionType optionType, Class<?> optionValueType, String help, String[] extraHelp, Class<?> declaringClass, String fieldName, OptionKey<?> option, boolean deprecated, String deprecationMessage) {<NEW_LINE>assert option != null : declaringClass + "." + fieldName;<NEW_LINE>OptionDescriptor result = option.getDescriptor();<NEW_LINE>if (result == null) {<NEW_LINE>List<String> extraHelpList = extraHelp == null || extraHelp.length == 0 ? Collections.emptyList() : Collections.unmodifiableList(Arrays.asList(extraHelp));<NEW_LINE>result = new OptionDescriptor(name, optionType, optionValueType, help, extraHelpList, declaringClass, fieldName, option, deprecated, deprecationMessage);<NEW_LINE>option.setDescriptor(result);<NEW_LINE>}<NEW_LINE>assert result.name.equals(name) && result.optionValueType == optionValueType && result.declaringClass == declaringClass && result.fieldName.equals(<MASK><NEW_LINE>return result;<NEW_LINE>} | fieldName) && result.optionKey == option; |
500,317 | public static void drawOutlinedBox(Box bb, BufferBuilder bufferBuilder) {<NEW_LINE>bufferBuilder.vertex(bb.minX, bb.minY, bb.minZ).next();<NEW_LINE>bufferBuilder.vertex(bb.maxX, bb.minY, bb.minZ).next();<NEW_LINE>bufferBuilder.vertex(bb.maxX, bb.minY, bb.minZ).next();<NEW_LINE>bufferBuilder.vertex(bb.maxX, bb.minY, bb.maxZ).next();<NEW_LINE>bufferBuilder.vertex(bb.maxX, bb.minY, bb.maxZ).next();<NEW_LINE>bufferBuilder.vertex(bb.minX, bb.minY, bb.maxZ).next();<NEW_LINE>bufferBuilder.vertex(bb.minX, bb.minY, bb.maxZ).next();<NEW_LINE>bufferBuilder.vertex(bb.minX, bb.minY, bb.minZ).next();<NEW_LINE>bufferBuilder.vertex(bb.minX, bb.minY, bb.minZ).next();<NEW_LINE>bufferBuilder.vertex(bb.minX, bb.maxY, bb.minZ).next();<NEW_LINE>bufferBuilder.vertex(bb.maxX, bb.minY, bb.minZ).next();<NEW_LINE>bufferBuilder.vertex(bb.maxX, bb.maxY, bb.minZ).next();<NEW_LINE>bufferBuilder.vertex(bb.maxX, bb.minY, bb.maxZ).next();<NEW_LINE>bufferBuilder.vertex(bb.maxX, bb.maxY, bb.maxZ).next();<NEW_LINE>bufferBuilder.vertex(bb.minX, bb.minY, bb.maxZ).next();<NEW_LINE>bufferBuilder.vertex(bb.minX, bb.maxY, bb.maxZ).next();<NEW_LINE>bufferBuilder.vertex(bb.minX, bb.maxY, bb.minZ).next();<NEW_LINE>bufferBuilder.vertex(bb.maxX, bb.maxY, bb.minZ).next();<NEW_LINE>bufferBuilder.vertex(bb.maxX, bb.maxY, bb.minZ).next();<NEW_LINE>bufferBuilder.vertex(bb.maxX, bb.maxY, bb.maxZ).next();<NEW_LINE>bufferBuilder.vertex(bb.maxX, bb.maxY, bb.maxZ).next();<NEW_LINE>bufferBuilder.vertex(bb.minX, bb.maxY, bb.maxZ).next();<NEW_LINE>bufferBuilder.vertex(bb.minX, bb.maxY, bb.maxZ).next();<NEW_LINE>bufferBuilder.vertex(bb.minX, bb.maxY, <MASK><NEW_LINE>} | bb.minZ).next(); |
910,442 | protected AST visit(AST node) {<NEW_LINE>if (node.getType() != XQ.PathExpr) {<NEW_LINE>return node;<NEW_LINE>}<NEW_LINE>snapshot();<NEW_LINE>boolean checkInput = false;<NEW_LINE>boolean skipDDO = false;<NEW_LINE>int len = 0;<NEW_LINE>for (int i = 1; i < node.getChildCount(); i++) {<NEW_LINE>AST step = node.getChild(i);<NEW_LINE>boolean childStep = ((step.getType() == XQ.StepExpr) && (getAxis(<MASK><NEW_LINE>boolean hasPredicate = (step.getChildCount() > 2);<NEW_LINE>if (childStep) {<NEW_LINE>skipDDO |= step.checkProperty("skipDDO");<NEW_LINE>checkInput |= step.checkProperty("checkInput");<NEW_LINE>if (!hasPredicate) {<NEW_LINE>len++;<NEW_LINE>} else {<NEW_LINE>if (len > MIN_CHILD_STEP_LENGTH) {<NEW_LINE>merge(node, i - len, len, skipDDO, checkInput);<NEW_LINE>i -= len;<NEW_LINE>}<NEW_LINE>checkInput = false;<NEW_LINE>skipDDO = false;<NEW_LINE>len = 0;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (len > MIN_CHILD_STEP_LENGTH) {<NEW_LINE>merge(node, i - len, len - 1, skipDDO, checkInput);<NEW_LINE>i -= len - 1;<NEW_LINE>}<NEW_LINE>checkInput = false;<NEW_LINE>skipDDO = false;<NEW_LINE>len = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (len > MIN_CHILD_STEP_LENGTH) {<NEW_LINE>merge(node, node.getChildCount() - len, len - 1, skipDDO, checkInput);<NEW_LINE>}<NEW_LINE>return node;<NEW_LINE>} | step) == XQ.CHILD)); |
902,942 | public static DescribeCpmcPunishListResponse unmarshall(DescribeCpmcPunishListResponse describeCpmcPunishListResponse, UnmarshallerContext context) {<NEW_LINE>describeCpmcPunishListResponse.setRequestId(context.stringValue("DescribeCpmcPunishListResponse.RequestId"));<NEW_LINE>describeCpmcPunishListResponse.setModule(context.stringValue("DescribeCpmcPunishListResponse.Module"));<NEW_LINE>PageInfo pageInfo = new PageInfo();<NEW_LINE>pageInfo.setTotal(context.integerValue("DescribeCpmcPunishListResponse.PageInfo.total"));<NEW_LINE>pageInfo.setPageSize(context.integerValue("DescribeCpmcPunishListResponse.PageInfo.pageSize"));<NEW_LINE>pageInfo.setCurrentPage(context.integerValue("DescribeCpmcPunishListResponse.PageInfo.currentPage"));<NEW_LINE>describeCpmcPunishListResponse.setPageInfo(pageInfo);<NEW_LINE>List<Data> dataList = new ArrayList<Data>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeCpmcPunishListResponse.DataList.Length"); i++) {<NEW_LINE>Data data = new Data();<NEW_LINE>data.setGmtCreate(context.stringValue("DescribeCpmcPunishListResponse.DataList[" + i + "].GmtCreate"));<NEW_LINE>data.setSrcPort(context.integerValue("DescribeCpmcPunishListResponse.DataList[" + i + "].SrcPort"));<NEW_LINE>data.setFeedBack(context.integerValue("DescribeCpmcPunishListResponse.DataList[" + i + "].FeedBack"));<NEW_LINE>data.setGmtExpire(context.stringValue("DescribeCpmcPunishListResponse.DataList[" + i + "].GmtExpire"));<NEW_LINE>data.setPunishType(context.stringValue<MASK><NEW_LINE>data.setDstIP(context.stringValue("DescribeCpmcPunishListResponse.DataList[" + i + "].DstIP"));<NEW_LINE>data.setPunishResult(context.stringValue("DescribeCpmcPunishListResponse.DataList[" + i + "].PunishResult"));<NEW_LINE>data.setRegionId(context.stringValue("DescribeCpmcPunishListResponse.DataList[" + i + "].RegionId"));<NEW_LINE>data.setDstPort(context.integerValue("DescribeCpmcPunishListResponse.DataList[" + i + "].DstPort"));<NEW_LINE>data.setProtocol(context.stringValue("DescribeCpmcPunishListResponse.DataList[" + i + "].Protocol"));<NEW_LINE>data.setSrcIP(context.stringValue("DescribeCpmcPunishListResponse.DataList[" + i + "].SrcIP"));<NEW_LINE>data.setReason(context.stringValue("DescribeCpmcPunishListResponse.DataList[" + i + "].Reason"));<NEW_LINE>dataList.add(data);<NEW_LINE>}<NEW_LINE>describeCpmcPunishListResponse.setDataList(dataList);<NEW_LINE>return describeCpmcPunishListResponse;<NEW_LINE>} | ("DescribeCpmcPunishListResponse.DataList[" + i + "].PunishType")); |
617,766 | void updateAccountsFromFile(String accountJsonPath, boolean ignoreSnapshotVersion) throws IOException, AccountServiceException {<NEW_LINE><MASK><NEW_LINE>Collection<Account> accountsToUpdate = getAccountsFromJson(accountJsonPath);<NEW_LINE>if (!hasDuplicateAccountIdOrName(accountsToUpdate)) {<NEW_LINE>if (ignoreSnapshotVersion) {<NEW_LINE>Collection<Account> allAccounts = accountService.getAllAccounts();<NEW_LINE>// Update the snapshot version to resolve conflict<NEW_LINE>Map<Short, Account> existingAccountsMap = new HashMap<>();<NEW_LINE>for (Account account : allAccounts) {<NEW_LINE>existingAccountsMap.put(account.getId(), account);<NEW_LINE>}<NEW_LINE>Collection<Account> newAccounts = new ArrayList<>(accountsToUpdate.size());<NEW_LINE>// resolve the snapshot conflict.<NEW_LINE>for (Account account : accountsToUpdate) {<NEW_LINE>Account accountInMap = existingAccountsMap.get(account.getId());<NEW_LINE>if (accountInMap != null && accountInMap.getSnapshotVersion() != account.getSnapshotVersion()) {<NEW_LINE>newAccounts.add(new AccountBuilder(account).snapshotVersion(accountInMap.getSnapshotVersion()).build());<NEW_LINE>} else {<NEW_LINE>newAccounts.add(account);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>accountsToUpdate = newAccounts;<NEW_LINE>}<NEW_LINE>accountService.updateAccounts(accountsToUpdate);<NEW_LINE>System.out.println(accountsToUpdate.size() + " account(s) successfully created or updated, took " + (System.currentTimeMillis() - startTime) + " ms");<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Duplicate id or name exists in the accounts to update");<NEW_LINE>}<NEW_LINE>} | long startTime = System.currentTimeMillis(); |
670,204 | protected QueryDataSet processShowQuery(ShowPlan showPlan, QueryContext context) throws QueryProcessException, MetadataException {<NEW_LINE>switch(showPlan.getShowContentType()) {<NEW_LINE>case TTL:<NEW_LINE>return processShowTTLQuery((ShowTTLPlan) showPlan);<NEW_LINE>case FLUSH_TASK_INFO:<NEW_LINE>return processShowFlushTaskInfo();<NEW_LINE>case VERSION:<NEW_LINE>return processShowVersion();<NEW_LINE>case TIMESERIES:<NEW_LINE>return processShowTimeseries((ShowTimeSeriesPlan) showPlan, context);<NEW_LINE>case STORAGE_GROUP:<NEW_LINE>return processShowStorageGroup((ShowStorageGroupPlan) showPlan);<NEW_LINE>case LOCK_INFO:<NEW_LINE>return processShowLockInfo((ShowLockInfoPlan) showPlan);<NEW_LINE>case DEVICES:<NEW_LINE>return processShowDevices((ShowDevicesPlan) showPlan);<NEW_LINE>case CHILD_PATH:<NEW_LINE><MASK><NEW_LINE>case CHILD_NODE:<NEW_LINE>return processShowChildNodes((ShowChildNodesPlan) showPlan);<NEW_LINE>case COUNT_TIMESERIES:<NEW_LINE>return processCountTimeSeries((CountPlan) showPlan);<NEW_LINE>case COUNT_NODE_TIMESERIES:<NEW_LINE>return processCountNodeTimeSeries((CountPlan) showPlan);<NEW_LINE>case COUNT_DEVICES:<NEW_LINE>return processCountDevices((CountPlan) showPlan);<NEW_LINE>case COUNT_STORAGE_GROUP:<NEW_LINE>return processCountStorageGroup((CountPlan) showPlan);<NEW_LINE>case COUNT_NODES:<NEW_LINE>return processCountNodes((CountPlan) showPlan);<NEW_LINE>case QUERY_PROCESSLIST:<NEW_LINE>return processShowQueryProcesslist();<NEW_LINE>case FUNCTIONS:<NEW_LINE>return processShowFunctions((ShowFunctionsPlan) showPlan);<NEW_LINE>case TRIGGERS:<NEW_LINE>return processShowTriggers();<NEW_LINE>case CONTINUOUS_QUERY:<NEW_LINE>return processShowContinuousQueries();<NEW_LINE>case SCHEMA_TEMPLATE:<NEW_LINE>return processShowSchemaTemplates();<NEW_LINE>case NODES_IN_SCHEMA_TEMPLATE:<NEW_LINE>return processShowNodesInSchemaTemplate((ShowNodesInTemplatePlan) showPlan);<NEW_LINE>case PATHS_SET_SCHEMA_TEMPLATE:<NEW_LINE>return processShowPathsSetSchemaTemplate((ShowPathsSetTemplatePlan) showPlan);<NEW_LINE>case PATHS_USING_SCHEMA_TEMPLATE:<NEW_LINE>return processShowPathsUsingSchemaTemplate((ShowPathsUsingTemplatePlan) showPlan);<NEW_LINE>default:<NEW_LINE>throw new QueryProcessException(String.format("Unrecognized show plan %s", showPlan));<NEW_LINE>}<NEW_LINE>} | return processShowChildPaths((ShowChildPathsPlan) showPlan); |
1,185,073 | public static MProject copyFrom(final Properties ctx, final int C_Project_ID, final Timestamp dateDoc, final String trxName) {<NEW_LINE>final MProject from = new MProject(ctx, C_Project_ID, trxName);<NEW_LINE>if (from.getC_Project_ID() == 0)<NEW_LINE><MASK><NEW_LINE>//<NEW_LINE>final MProject to = new MProject(ctx, 0, trxName);<NEW_LINE>PO.copyValues(from, to, from.getAD_Client_ID(), from.getAD_Org_ID());<NEW_LINE>to.set_ValueNoCheck("C_Project_ID", I_ZERO);<NEW_LINE>// Set Value with Time<NEW_LINE>String Value = to.getValue() + " ";<NEW_LINE>final String Time = dateDoc.toString();<NEW_LINE>final int length = Value.length() + Time.length();<NEW_LINE>if (length <= 40)<NEW_LINE>Value += Time;<NEW_LINE>else<NEW_LINE>Value += Time.substring(length - 40);<NEW_LINE>to.setValue(Value);<NEW_LINE>to.setInvoicedAmt(BigDecimal.ZERO);<NEW_LINE>to.setProjectBalanceAmt(BigDecimal.ZERO);<NEW_LINE>to.setProcessed(false);<NEW_LINE>//<NEW_LINE>if (!to.save())<NEW_LINE>throw new IllegalStateException("Could not create Project");<NEW_LINE>if (to.copyDetailsFrom(from) == 0)<NEW_LINE>throw new IllegalStateException("Could not create Project Details");<NEW_LINE>return to;<NEW_LINE>} | throw new IllegalArgumentException("From Project not found C_Project_ID=" + C_Project_ID); |
1,472,844 | private PredicateFinalStep generateDateOrdinalSearchTerms(String theSearchParamName, DateParam theDateParam) {<NEW_LINE>String lowerOrdinalField = SEARCH_PARAM_ROOT + "." + theSearchParamName + ".dt.lower-ord";<NEW_LINE>String upperOrdinalField = SEARCH_PARAM_ROOT + "." + theSearchParamName + ".dt.upper-ord";<NEW_LINE>int lowerBoundAsOrdinal;<NEW_LINE>int upperBoundAsOrdinal;<NEW_LINE>ParamPrefixEnum prefix = theDateParam.getPrefix();<NEW_LINE>// default when handling 'Day' temporal types<NEW_LINE>lowerBoundAsOrdinal = upperBoundAsOrdinal = DateUtils.convertDateToDayInteger(theDateParam.getValue());<NEW_LINE>TemporalPrecisionEnum precision = theDateParam.getPrecision();<NEW_LINE>// complete the date from 'YYYY' and 'YYYY-MM' temporal types<NEW_LINE>if (precision == TemporalPrecisionEnum.YEAR || precision == TemporalPrecisionEnum.MONTH) {<NEW_LINE>Pair<String, String> completedDate = DateUtils.<MASK><NEW_LINE>lowerBoundAsOrdinal = Integer.parseInt(completedDate.getLeft().replace("-", ""));<NEW_LINE>upperBoundAsOrdinal = Integer.parseInt(completedDate.getRight().replace("-", ""));<NEW_LINE>}<NEW_LINE>if (Objects.isNull(prefix) || prefix == ParamPrefixEnum.EQUAL) {<NEW_LINE>// For equality prefix we would like the date to fall between the lower and upper bound<NEW_LINE>List<? extends PredicateFinalStep> predicateSteps = Arrays.asList(myPredicateFactory.range().field(lowerOrdinalField).atLeast(lowerBoundAsOrdinal), myPredicateFactory.range().field(upperOrdinalField).atMost(upperBoundAsOrdinal));<NEW_LINE>BooleanPredicateClausesStep<?> booleanStep = myPredicateFactory.bool();<NEW_LINE>predicateSteps.forEach(booleanStep::must);<NEW_LINE>return booleanStep;<NEW_LINE>} else if (ParamPrefixEnum.GREATERTHAN == prefix || ParamPrefixEnum.STARTS_AFTER == prefix) {<NEW_LINE>// TODO JB: more fine tuning needed for STARTS_AFTER<NEW_LINE>return myPredicateFactory.range().field(upperOrdinalField).greaterThan(upperBoundAsOrdinal);<NEW_LINE>} else if (ParamPrefixEnum.GREATERTHAN_OR_EQUALS == prefix) {<NEW_LINE>return myPredicateFactory.range().field(upperOrdinalField).atLeast(upperBoundAsOrdinal);<NEW_LINE>} else if (ParamPrefixEnum.LESSTHAN == prefix || ParamPrefixEnum.ENDS_BEFORE == prefix) {<NEW_LINE>// TODO JB: more fine tuning needed for END_BEFORE<NEW_LINE>return myPredicateFactory.range().field(lowerOrdinalField).lessThan(lowerBoundAsOrdinal);<NEW_LINE>} else if (ParamPrefixEnum.LESSTHAN_OR_EQUALS == prefix) {<NEW_LINE>return myPredicateFactory.range().field(lowerOrdinalField).atMost(lowerBoundAsOrdinal);<NEW_LINE>} else if (ParamPrefixEnum.NOT_EQUAL == prefix) {<NEW_LINE>List<? extends PredicateFinalStep> predicateSteps = Arrays.asList(myPredicateFactory.range().field(upperOrdinalField).lessThan(lowerBoundAsOrdinal), myPredicateFactory.range().field(lowerOrdinalField).greaterThan(upperBoundAsOrdinal));<NEW_LINE>BooleanPredicateClausesStep<?> booleanStep = myPredicateFactory.bool();<NEW_LINE>predicateSteps.forEach(booleanStep::should);<NEW_LINE>booleanStep.minimumShouldMatchNumber(1);<NEW_LINE>return booleanStep;<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException(Msg.code(2025) + "Date search param does not support prefix of type: " + prefix);<NEW_LINE>} | getCompletedDate(theDateParam.getValueAsString()); |
1,215,303 | public static String repeat(String value, int count) {<NEW_LINE>if (count < 0) {<NEW_LINE>throw new IllegalArgumentException("count is negative: " + count);<NEW_LINE>}<NEW_LINE>if (value == null || value.length() == 0 || count == 1) {<NEW_LINE>return value;<NEW_LINE>}<NEW_LINE>if (count == 0) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>if (value.length() > Integer.MAX_VALUE / count) {<NEW_LINE>throw new OutOfMemoryError("Repeating " + value.length() + " bytes String " + count + " times will produce a String exceeding maximum size.");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>int limit = len * count;<NEW_LINE>char[] array = new char[limit];<NEW_LINE>value.getChars(0, len, array, 0);<NEW_LINE>int copied;<NEW_LINE>for (copied = len; copied < limit - copied; copied <<= 1) {<NEW_LINE>System.arraycopy(array, 0, array, copied, copied);<NEW_LINE>}<NEW_LINE>System.arraycopy(array, 0, array, copied, limit - copied);<NEW_LINE>return new String(array);<NEW_LINE>} | int len = value.length(); |
1,701,208 | public void initFreeVersionBanner() {<NEW_LINE>if (!shouldShowFreeVersionBanner(ctx.getMyApplication())) {<NEW_LINE>freeVersionBanner.setVisibility(View.GONE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>freeVersionBanner.setVisibility(View.VISIBLE);<NEW_LINE>downloadsLeftProgressBar.setMax(DownloadValidationManager.MAXIMUM_AVAILABLE_FREE_DOWNLOADS);<NEW_LINE>freeVersionDescriptionTextView.setText(ctx.getString(R.string.free_version_message<MASK><NEW_LINE>LinearLayout marksLinearLayout = (LinearLayout) freeVersionBanner.findViewById(R.id.marksLinearLayout);<NEW_LINE>Space spaceView = new Space(ctx);<NEW_LINE>LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.MATCH_PARENT, 1);<NEW_LINE>spaceView.setLayoutParams(layoutParams);<NEW_LINE>marksLinearLayout.addView(spaceView);<NEW_LINE>int markWidth = (int) (1 * ctx.getResources().getDisplayMetrics().density);<NEW_LINE>int colorBlack = ctx.getResources().getColor(R.color.color_black);<NEW_LINE>for (int i = 1; i < DownloadValidationManager.MAXIMUM_AVAILABLE_FREE_DOWNLOADS; i++) {<NEW_LINE>View markView = new View(ctx);<NEW_LINE>layoutParams = new LinearLayout.LayoutParams(markWidth, ViewGroup.LayoutParams.MATCH_PARENT);<NEW_LINE>markView.setLayoutParams(layoutParams);<NEW_LINE>markView.setBackgroundColor(colorBlack);<NEW_LINE>marksLinearLayout.addView(markView);<NEW_LINE>spaceView = new Space(ctx);<NEW_LINE>layoutParams = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.MATCH_PARENT, 1);<NEW_LINE>spaceView.setLayoutParams(layoutParams);<NEW_LINE>marksLinearLayout.addView(spaceView);<NEW_LINE>}<NEW_LINE>updateFreeVersionBanner();<NEW_LINE>collapseBanner();<NEW_LINE>} | , DownloadValidationManager.MAXIMUM_AVAILABLE_FREE_DOWNLOADS + "")); |
206,610 | public Request<DeregisterTransitGatewayMulticastGroupSourcesRequest> marshall(DeregisterTransitGatewayMulticastGroupSourcesRequest deregisterTransitGatewayMulticastGroupSourcesRequest) {<NEW_LINE>if (deregisterTransitGatewayMulticastGroupSourcesRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<DeregisterTransitGatewayMulticastGroupSourcesRequest> request = new DefaultRequest<DeregisterTransitGatewayMulticastGroupSourcesRequest>(deregisterTransitGatewayMulticastGroupSourcesRequest, "AmazonEC2");<NEW_LINE>request.addParameter("Action", "DeregisterTransitGatewayMulticastGroupSources");<NEW_LINE>request.addParameter("Version", "2016-11-15");<NEW_LINE><MASK><NEW_LINE>if (deregisterTransitGatewayMulticastGroupSourcesRequest.getTransitGatewayMulticastDomainId() != null) {<NEW_LINE>request.addParameter("TransitGatewayMulticastDomainId", StringUtils.fromString(deregisterTransitGatewayMulticastGroupSourcesRequest.getTransitGatewayMulticastDomainId()));<NEW_LINE>}<NEW_LINE>if (deregisterTransitGatewayMulticastGroupSourcesRequest.getGroupIpAddress() != null) {<NEW_LINE>request.addParameter("GroupIpAddress", StringUtils.fromString(deregisterTransitGatewayMulticastGroupSourcesRequest.getGroupIpAddress()));<NEW_LINE>}<NEW_LINE>com.amazonaws.internal.SdkInternalList<String> deregisterTransitGatewayMulticastGroupSourcesRequestNetworkInterfaceIdsList = (com.amazonaws.internal.SdkInternalList<String>) deregisterTransitGatewayMulticastGroupSourcesRequest.getNetworkInterfaceIds();<NEW_LINE>if (!deregisterTransitGatewayMulticastGroupSourcesRequestNetworkInterfaceIdsList.isEmpty() || !deregisterTransitGatewayMulticastGroupSourcesRequestNetworkInterfaceIdsList.isAutoConstruct()) {<NEW_LINE>int networkInterfaceIdsListIndex = 1;<NEW_LINE>for (String deregisterTransitGatewayMulticastGroupSourcesRequestNetworkInterfaceIdsListValue : deregisterTransitGatewayMulticastGroupSourcesRequestNetworkInterfaceIdsList) {<NEW_LINE>if (deregisterTransitGatewayMulticastGroupSourcesRequestNetworkInterfaceIdsListValue != null) {<NEW_LINE>request.addParameter("NetworkInterfaceIds." + networkInterfaceIdsListIndex, StringUtils.fromString(deregisterTransitGatewayMulticastGroupSourcesRequestNetworkInterfaceIdsListValue));<NEW_LINE>}<NEW_LINE>networkInterfaceIdsListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | request.setHttpMethod(HttpMethodName.POST); |
652,017 | public void filter() {<NEW_LINE>final String filter = getFilter();<NEW_LINE>if (filter != null && filter.length() > 0) {<NEW_LINE>if (!myExpansionMonitor.isFreeze()) {<NEW_LINE>myExpansionMonitor.freeze();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>IntentionSettingsTree.this.filter(filterModel(filter, true));<NEW_LINE>if (myTree != null) {<NEW_LINE>List<TreePath> expandedPaths = TreeUtil.collectExpandedPaths(myTree);<NEW_LINE>((DefaultTreeModel) myTree.getModel()).reload();<NEW_LINE>TreeUtil.restoreExpandedPaths(myTree, expandedPaths);<NEW_LINE>}<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>myTree.setSelectionRow(0);<NEW_LINE>IdeFocusManager.<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>TreeUtil.expandAll(myTree);<NEW_LINE>if (filter == null || filter.length() == 0) {<NEW_LINE>TreeUtil.collapseAll(myTree, 0);<NEW_LINE>myExpansionMonitor.restore();<NEW_LINE>}<NEW_LINE>} | getGlobalInstance().doForceFocusWhenFocusSettlesDown(myTree); |
903,615 | private static String[] extractHostports(SrvRecord[] srvRecords) {<NEW_LINE>String[] hostports = null;<NEW_LINE>int head = 0;<NEW_LINE>int tail = 0;<NEW_LINE>int sublistLength = 0;<NEW_LINE>int k = 0;<NEW_LINE>for (int i = 0; i < srvRecords.length; i++) {<NEW_LINE>if (hostports == null) {<NEW_LINE>hostports = new String[srvRecords.length];<NEW_LINE>}<NEW_LINE>// find the head and tail of the list of records having the same<NEW_LINE>// priority value.<NEW_LINE>head = i;<NEW_LINE>while (i < srvRecords.length - 1 && srvRecords[i].priority == srvRecords[i + 1].priority) {<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>tail = i;<NEW_LINE>// select hostports from the sublist<NEW_LINE>sublistLength = (tail - head) + 1;<NEW_LINE>for (int j = 0; j < sublistLength; j++) {<NEW_LINE>hostports[k++] = <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return hostports;<NEW_LINE>} | selectHostport(srvRecords, head, tail); |
1,335,126 | public S3DataRepositoryConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>S3DataRepositoryConfiguration s3DataRepositoryConfiguration = new S3DataRepositoryConfiguration();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("AutoImportPolicy", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>s3DataRepositoryConfiguration.setAutoImportPolicy(AutoImportPolicyJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("AutoExportPolicy", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>s3DataRepositoryConfiguration.setAutoExportPolicy(AutoExportPolicyJsonUnmarshaller.getInstance<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return s3DataRepositoryConfiguration;<NEW_LINE>} | ().unmarshall(context)); |
1,578,507 | public void doMentionToSpeaker(Annotation doc) {<NEW_LINE>List<CoreMap> quotes = doc.get(CoreAnnotations.QuotationsAnnotation.class);<NEW_LINE>List<List<Pair<Integer, Integer>>> skipChains = new ArrayList<>();<NEW_LINE>// Pairs are (pred_idx, paragraph_idx)<NEW_LINE>List<Pair<Integer, Integer>> currChain = new ArrayList<>();<NEW_LINE>for (int quote_idx = 0; quote_idx < quotes.size(); quote_idx++) {<NEW_LINE>CoreMap quote = quotes.get(quote_idx);<NEW_LINE>if (quote.get(QuoteAttributionAnnotator.SpeakerAnnotation.class) != null) {<NEW_LINE>int para_idx = getQuoteParagraph(quote);<NEW_LINE>if (currChain.size() != 0) {<NEW_LINE>if (currChain.get(currChain.size() - 1).second != para_idx - 2) {<NEW_LINE>skipChains.add(currChain);<NEW_LINE>currChain = new ArrayList<>();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>currChain.add(new Pair<>(quote_idx, para_idx));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (currChain.size() != 0) {<NEW_LINE>skipChains.add(currChain);<NEW_LINE>}<NEW_LINE>for (List<Pair<Integer, Integer>> skipChain : skipChains) {<NEW_LINE>Pair<Integer, Integer> firstPair = skipChain.get(0);<NEW_LINE>int firstParagraph = firstPair.second;<NEW_LINE>// look for conversational chain candidate<NEW_LINE>for (int prev_idx = firstPair.first - 1; prev_idx >= 0; prev_idx--) {<NEW_LINE>CoreMap quote = quotes.get(prev_idx + 1);<NEW_LINE>CoreMap prevQuote = quotes.get(prev_idx);<NEW_LINE>if (getQuoteParagraph(prevQuote) == firstParagraph - 2) {<NEW_LINE>quote.set(QuoteAttributionAnnotator.SpeakerAnnotation.class, prevQuote.get<MASK><NEW_LINE>quote.set(QuoteAttributionAnnotator.SpeakerSieveAnnotation.class, "Loose Conversational Speaker");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (QuoteAttributionAnnotator.SpeakerAnnotation.class)); |
782,323 | public CodegenExpression makeCodegen(CodegenMethodScope parent, SAIFFInitializeSymbol symbols, CodegenClassScope classScope) {<NEW_LINE>CodegenMethod method = parent.makeChild(ContextControllerDetailHash.EPTYPE, this.getClass(), classScope);<NEW_LINE>method.getBlock().declareVar(ContextControllerDetailHashItem.EPTYPEARRAY, "items", newArrayByLength(ContextControllerDetailHashItem.EPTYPE, constant(<MASK><NEW_LINE>for (int i = 0; i < items.size(); i++) {<NEW_LINE>method.getBlock().assignArrayElement("items", constant(i), items.get(i).makeCodegen(method, symbols, classScope));<NEW_LINE>}<NEW_LINE>method.getBlock().declareVarNewInstance(ContextControllerDetailHash.EPTYPE, "detail").exprDotMethod(ref("detail"), "setItems", ref("items")).exprDotMethod(ref("detail"), "setGranularity", constant(granularity)).exprDotMethod(ref("detail"), "setPreallocate", constant(preallocate)).methodReturn(ref("detail"));<NEW_LINE>return localMethod(method);<NEW_LINE>} | items.size()))); |
409,129 | protected Control createDialogArea(Composite parent) {<NEW_LINE>Composite comp = (Composite) super.createDialogArea(parent);<NEW_LINE>FillLayout fillLayout = new FillLayout();<NEW_LINE>fillLayout.marginWidth = 5;<NEW_LINE>comp.setLayout(fillLayout);<NEW_LINE>Group container = new Group(comp, SWT.NONE);<NEW_LINE>GridLayout layout = new GridLayout();<NEW_LINE>layout.numColumns = 2;<NEW_LINE>layout.makeColumnsEqualWidth = false;<NEW_LINE>layout.marginWidth = 5;<NEW_LINE>layout.marginHeight = 5;<NEW_LINE>container.setLayout(layout);<NEW_LINE>autoRange = new Button(container, SWT.CHECK);<NEW_LINE>autoRange.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));<NEW_LINE>autoRange.setText("Auto Range");<NEW_LINE>autoRange.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>if (autoRange.getSelection()) {<NEW_LINE>maxTxt.setEnabled(false);<NEW_LINE>minTxt.setEnabled(false);<NEW_LINE>} else {<NEW_LINE>maxTxt.setEnabled(true);<NEW_LINE>minTxt.setEnabled(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Label maxLbl = new Label(container, SWT.NONE);<NEW_LINE>maxLbl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));<NEW_LINE>maxLbl.setAlignment(SWT.RIGHT);<NEW_LINE>maxLbl.setText("Max : ");<NEW_LINE>maxTxt = new Text(container, SWT.BORDER);<NEW_LINE>maxTxt.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));<NEW_LINE>Label minLbl = new Label(container, SWT.NONE);<NEW_LINE>minLbl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));<NEW_LINE>minLbl.setAlignment(SWT.RIGHT);<NEW_LINE>minLbl.setText("Min : ");<NEW_LINE>minTxt = new Text(container, SWT.BORDER);<NEW_LINE>minTxt.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));<NEW_LINE>if (axis.isAutoScale()) {<NEW_LINE>autoRange.setSelection(true);<NEW_LINE>maxTxt.setText(CastUtil.cString(axis.getRange().getUpper()));<NEW_LINE>minTxt.setText(CastUtil.cString(axis.getRange().getLower()));<NEW_LINE>maxTxt.setEnabled(false);<NEW_LINE>minTxt.setEnabled(false);<NEW_LINE>} else {<NEW_LINE>maxTxt.setText(CastUtil.cString(axis.getRange<MASK><NEW_LINE>minTxt.setText(CastUtil.cString(axis.getRange().getLower()));<NEW_LINE>}<NEW_LINE>return container;<NEW_LINE>} | ().getUpper())); |
182,074 | private void closeTab(TabView tab, boolean animateRemove, boolean removeFromList) {<NEW_LINE>int index = mViews.indexOf(tab);<NEW_LINE>if (index == -1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (removeFromList == true && tab.getUrl().toString().equals(Constant.WELCOME_MESSAGE_URL)) {<NEW_LINE>Settings.get().setWelcomeMessageDisplayed(true);<NEW_LINE>}<NEW_LINE>remove(index, animateRemove, removeFromList, mOnTabRemovedListener);<NEW_LINE>// Don't do this if we're animating the final tab off, as the setCurrentTab() call messes with the<NEW_LINE>// CanvasView.mContentView, which has already been forcible set above in remove() via BeginAnimateFinalTabAwayEvent.<NEW_LINE>boolean animatingFinalTabOff = getActiveTabCount() == 0 && getVisibleTabCount() > 0 && mSlideOffAnimationPlaying;<NEW_LINE>if (mCurrentTab == tab && animatingFinalTabOff == false) {<NEW_LINE>TabView newCurrentTab = null;<NEW_LINE><MASK><NEW_LINE>if (viewsCount > 0) {<NEW_LINE>if (viewsCount == 1) {<NEW_LINE>newCurrentTab = (TabView) mViews.get(0);<NEW_LINE>} else if (index < viewsCount) {<NEW_LINE>newCurrentTab = (TabView) mViews.get(index);<NEW_LINE>} else {<NEW_LINE>if (index > 0) {<NEW_LINE>newCurrentTab = (TabView) mViews.get(index - 1);<NEW_LINE>} else {<NEW_LINE>newCurrentTab = (TabView) mViews.get(0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setCurrentTab(newCurrentTab);<NEW_LINE>}<NEW_LINE>} | int viewsCount = mViews.size(); |
222,180 | private void initializeThreadCount(CommandLine cmd) {<NEW_LINE>// Check if there are a fixed number of threads or variable.<NEW_LINE>String numThreadsStr = cmd.getOptionValue("num_threads");<NEW_LINE>if (readOnly) {<NEW_LINE>numReaderThreads = AppBase.appConfig.numReaderThreads;<NEW_LINE>numWriterThreads = 0;<NEW_LINE>} else if (AppBase.appConfig.readIOPSPercentage == -1) {<NEW_LINE>numReaderThreads = AppBase.appConfig.numReaderThreads;<NEW_LINE>numWriterThreads = AppBase.appConfig.numWriterThreads;<NEW_LINE>} else {<NEW_LINE>int numThreads = 0;<NEW_LINE>if (numThreadsStr != null) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>// Default to 8 * num-cores<NEW_LINE>numThreads = 8 * Runtime.getRuntime().availableProcessors();<NEW_LINE>}<NEW_LINE>numReaderThreads = (int) Math.round(1.0 * numThreads * AppBase.appConfig.readIOPSPercentage / 100);<NEW_LINE>numWriterThreads = numThreads - numReaderThreads;<NEW_LINE>}<NEW_LINE>// If number of read and write threads are specified on the command line, that overrides all<NEW_LINE>// the other values.<NEW_LINE>if (cmd.hasOption("num_threads_read")) {<NEW_LINE>numReaderThreads = Integer.parseInt(cmd.getOptionValue("num_threads_read"));<NEW_LINE>}<NEW_LINE>if (cmd.hasOption("num_threads_write")) {<NEW_LINE>if (readOnly) {<NEW_LINE>LOG.warn("Ignoring num_threads_write option. It shouldn't be used with read_only.");<NEW_LINE>} else {<NEW_LINE>numWriterThreads = Integer.parseInt(cmd.getOptionValue("num_threads_write"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOG.info("Num reader threads: " + numReaderThreads + ", num writer threads: " + numWriterThreads);<NEW_LINE>} | numThreads = Integer.parseInt(numThreadsStr); |
1,597,394 | public TbQueueConsumer<TbProtoQueueMsg<ToCoreNotificationMsg>> createToCoreNotificationsMsgConsumer() {<NEW_LINE>TbKafkaConsumerTemplate.TbKafkaConsumerTemplateBuilder<TbProtoQueueMsg<ToCoreNotificationMsg>> consumerBuilder = TbKafkaConsumerTemplate.builder();<NEW_LINE>consumerBuilder.settings(kafkaSettings);<NEW_LINE>consumerBuilder.topic(partitionService.getNotificationsTopic(ServiceType.TB_CORE, serviceInfoProvider.getServiceId()).getFullTopicName());<NEW_LINE>consumerBuilder.clientId(<MASK><NEW_LINE>consumerBuilder.groupId("tb-core-notifications-node-" + serviceInfoProvider.getServiceId());<NEW_LINE>consumerBuilder.decoder(msg -> new TbProtoQueueMsg<>(msg.getKey(), ToCoreNotificationMsg.parseFrom(msg.getData()), msg.getHeaders()));<NEW_LINE>consumerBuilder.admin(notificationAdmin);<NEW_LINE>consumerBuilder.statsService(consumerStatsService);<NEW_LINE>return consumerBuilder.build();<NEW_LINE>} | "tb-core-notifications-consumer-" + serviceInfoProvider.getServiceId()); |
603,180 | private void paintAxisYRight(final Graphics g2d) {<NEW_LINE>final Chart2D chart = this.getAccessor().getChart();<NEW_LINE>int tmp = 0;<NEW_LINE>final FontMetrics fontdim = g2d.getFontMetrics();<NEW_LINE>final int xAxisStart = chart.getXChartStart();<NEW_LINE>final int xAxisEnd = chart.getXChartEnd();<NEW_LINE>final int yAxisStart = chart.getYChartStart();<NEW_LINE>final int yAxisEnd = chart.getYChartEnd();<NEW_LINE>final int rangeyPx = yAxisStart - yAxisEnd;<NEW_LINE>final int xAxisLine = this.getPixelXLeft();<NEW_LINE>g2d.drawLine(xAxisLine, yAxisStart, xAxisLine, yAxisEnd);<NEW_LINE>// drawing the y title :<NEW_LINE>this.paintTitle(g2d);<NEW_LINE>// drawing tick - scale, corresponding values, grid and conditional unit<NEW_LINE>// label:<NEW_LINE>if (this.isPaintScale() || this.isPaintGrid()) {<NEW_LINE>// then for y- angle.<NEW_LINE>final IAxisTickPainter tickPainter = chart.getAxisTickPainter();<NEW_LINE>final List<LabeledValue> labels = this.m_axisScalePolicy.getScaleValues(g2d, this);<NEW_LINE>final int tickWidth <MASK><NEW_LINE>for (final LabeledValue label : labels) {<NEW_LINE>tmp = yAxisStart - (int) (label.getValue() * rangeyPx);<NEW_LINE>if (this.isPaintScale()) {<NEW_LINE>// false -> is right y axis:<NEW_LINE>tickPainter.paintYTick(xAxisLine, tmp, label.isMajorTick(), false, g2d);<NEW_LINE>tickPainter.paintYLabel(xAxisLine + tickWidth, tmp, label.getLabel(), g2d);<NEW_LINE>}<NEW_LINE>if (this.isPaintGrid()) {<NEW_LINE>// do not paint over the axis:<NEW_LINE>if (tmp != yAxisStart) {<NEW_LINE>g2d.setColor(chart.getGridColor());<NEW_LINE>g2d.drawLine(xAxisStart + 1, tmp, xAxisEnd, tmp);<NEW_LINE>g2d.setColor(chart.getForeground());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// unit-labeling<NEW_LINE>final String unitName = this.getFormatter().getUnit().getUnitName();<NEW_LINE>g2d.drawString(unitName, (int) chart.getSize().getWidth() - fontdim.charsWidth(unitName.toCharArray(), 0, unitName.length()) - 4, yAxisEnd);<NEW_LINE>}<NEW_LINE>} | = tickPainter.getMajorTickLength() + 4; |
1,588,892 | public Object calculate(Context ctx) {<NEW_LINE>IParam param = this.param;<NEW_LINE>if (param == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("case" + mm.getMessage("function.missingParam"));<NEW_LINE>}<NEW_LINE>IParam defaultParam = null;<NEW_LINE>if (param.getType() == IParam.Semicolon) {<NEW_LINE>if (param.getSubSize() != 2) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("case" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>defaultParam = param.getSub(1);<NEW_LINE><MASK><NEW_LINE>if (param == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("case" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (param.getType() != IParam.Comma) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("case" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>IParam sub = param.getSub(0);<NEW_LINE>if (sub == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("case" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>Object val = sub.getLeafExpression().calculate(ctx);<NEW_LINE>for (int i = 1, size = param.getSubSize(); i < size; ++i) {<NEW_LINE>sub = param.getSub(i);<NEW_LINE>if (sub.getSubSize() != 2) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("case" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>IParam p = sub.getSub(0);<NEW_LINE>Object condition = (p == null ? null : p.getLeafExpression().calculate(ctx));<NEW_LINE>if (Variant.isEquals(val, condition)) {<NEW_LINE>p = sub.getSub(1);<NEW_LINE>return (p == null ? null : p.getLeafExpression().calculate(ctx));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (defaultParam != null) {<NEW_LINE>return defaultParam.getLeafExpression().calculate(ctx);<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | param = param.getSub(0); |
1,846,438 | private IStatus publishDiagnostics(IProgressMonitor monitor) throws JavaModelException {<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>if (monitor.isCanceled()) {<NEW_LINE>return Status.CANCEL_STATUS;<NEW_LINE>}<NEW_LINE>this.sharedASTProvider.disposeAST();<NEW_LINE>List<ICompilationUnit> toValidate = Arrays.asList(JavaCore.getWorkingCopies(null));<NEW_LINE>if (toValidate.isEmpty()) {<NEW_LINE>return Status.OK_STATUS;<NEW_LINE>}<NEW_LINE>SubMonitor progress = SubMonitor.convert(monitor, toValidate.size() + 1);<NEW_LINE>if (monitor.isCanceled()) {<NEW_LINE>return Status.CANCEL_STATUS;<NEW_LINE>}<NEW_LINE>for (ICompilationUnit rootToValidate : toValidate) {<NEW_LINE>if (monitor.isCanceled()) {<NEW_LINE>return Status.CANCEL_STATUS;<NEW_LINE>}<NEW_LINE>CompilationUnit astRoot = this.sharedASTProvider.getAST(rootToValidate, CoreASTProvider.WAIT_YES, monitor);<NEW_LINE>if (monitor.isCanceled()) {<NEW_LINE>return Status.CANCEL_STATUS;<NEW_LINE>}<NEW_LINE>if (astRoot != null) {<NEW_LINE>// report errors, even if there are no problems in the file: The client need to know that they got fixed.<NEW_LINE>ICompilationUnit unit = <MASK><NEW_LINE>publishDiagnostics(unit, progress.newChild(1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>JavaLanguageServerPlugin.logInfo("Validated " + toValidate.size() + ". Took " + (System.currentTimeMillis() - start) + " ms");<NEW_LINE>return Status.OK_STATUS;<NEW_LINE>} | (ICompilationUnit) astRoot.getTypeRoot(); |
1,259,982 | private void swt_updateSideBarHitAreasY(SideBarEntrySWT[] entries) {<NEW_LINE>for (int x = 0; x < entries.length; x++) {<NEW_LINE>SideBarEntrySWT entry = entries[x];<NEW_LINE>TreeItem treeItem = entry.getTreeItem();<NEW_LINE>if (treeItem == null || treeItem.isDisposed()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Rectangle itemBounds = entry.swt_getBounds();<NEW_LINE>if (itemBounds != null) {<NEW_LINE>if (entry.isCloseable()) {<NEW_LINE>Rectangle closeArea = (Rectangle) treeItem.getData("closeArea");<NEW_LINE>if (closeArea != null) {<NEW_LINE>closeArea.y = itemBounds.y + (itemBounds.height - closeArea.height) / 2;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<MdiEntryVitalityImageSWT> vitalityImages = entry.getVitalityImages();<NEW_LINE>for (MdiEntryVitalityImageSWT vitalityImage : vitalityImages) {<NEW_LINE>if (!vitalityImage.isVisible()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Image image = vitalityImage.getImage();<NEW_LINE>if (image != null) {<NEW_LINE>Rectangle bounds = vitalityImage.getHitArea();<NEW_LINE>if (bounds == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>bounds.y = (itemBounds.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | height - bounds.height) / 2; |
24,109 | protected StateMachineContext<S, E> buildStateMachineContext(StateMachine<S, E> stateMachine) {<NEW_LINE>ExtendedState extendedState = new DefaultExtendedState();<NEW_LINE>extendedState.getVariables().putAll(stateMachine.getExtendedState().getVariables());<NEW_LINE>ArrayList<StateMachineContext<S, E>> childs = new ArrayList<StateMachineContext<S, E>>();<NEW_LINE>S id = null;<NEW_LINE>State<S, E> state = stateMachine.getState();<NEW_LINE>if (state.isSubmachineState()) {<NEW_LINE>StateMachine<S, E> submachine = ((AbstractState<S, E>) state).getSubmachine();<NEW_LINE>id = submachine.getState().getId();<NEW_LINE>childs.add(buildStateMachineContext(submachine));<NEW_LINE>} else if (state.isOrthogonal()) {<NEW_LINE>Collection<Region<S, E>> regions = ((AbstractState<S, E>) state).getRegions();<NEW_LINE>for (Region<S, E> r : regions) {<NEW_LINE>StateMachine<S, E> rsm = (StateMachine<S, E>) r;<NEW_LINE>childs.add(buildStateMachineContext(rsm));<NEW_LINE>}<NEW_LINE>id = state.getId();<NEW_LINE>} else {<NEW_LINE>id = state.getId();<NEW_LINE>}<NEW_LINE>// building history state mappings<NEW_LINE>Map<S, S> historyStates = new HashMap<S, S>();<NEW_LINE>PseudoState<S, E> historyState = ((AbstractStateMachine<S, E>) stateMachine).getHistoryState();<NEW_LINE>if (historyState != null && ((HistoryPseudoState<S, E>) historyState).getState() != null) {<NEW_LINE>historyStates.put(null, ((HistoryPseudoState<S, E>) historyState).getState().getId());<NEW_LINE>}<NEW_LINE>Collection<State<S, E>> states = stateMachine.getStates();<NEW_LINE>for (State<S, E> ss : states) {<NEW_LINE>if (ss.isSubmachineState()) {<NEW_LINE>StateMachine<S, E> submachine = ((AbstractState<S, E>) ss).getSubmachine();<NEW_LINE>PseudoState<S, E> ps = ((AbstractStateMachine<S, E<MASK><NEW_LINE>if (ps != null) {<NEW_LINE>State<S, E> pss = ((HistoryPseudoState<S, E>) ps).getState();<NEW_LINE>if (pss != null) {<NEW_LINE>historyStates.put(ss.getId(), pss.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new DefaultStateMachineContext<S, E>(childs, id, null, null, extendedState, historyStates, stateMachine.getId());<NEW_LINE>} | >) submachine).getHistoryState(); |
1,812,801 | private static Map<String, Object> prepareMap(Index index, ParsedDocument doc, long tookInNanos, boolean reformat, int maxSourceCharsToLog) {<NEW_LINE>Map<String, Object> map = new HashMap<>();<NEW_LINE>map.put("message", index);<NEW_LINE>map.put("took", TimeValue.timeValueNanos(tookInNanos));<NEW_LINE>map.put("took_millis", "" + TimeUnit.NANOSECONDS.toMillis(tookInNanos));<NEW_LINE>map.put("id", doc.id());<NEW_LINE>map.put("routing", doc.routing());<NEW_LINE>if (maxSourceCharsToLog == 0 || doc.source() == null || doc.source().length() == 0) {<NEW_LINE>return map;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String source = XContentHelper.convertToJson(doc.source(), reformat, doc.getXContentType());<NEW_LINE>String trim = Strings.cleanTruncate(source, maxSourceCharsToLog).trim();<NEW_LINE>StringBuilder sb = new StringBuilder(trim);<NEW_LINE>StringBuilders.escapeJson(sb, 0);<NEW_LINE>map.put("source", sb.toString());<NEW_LINE>} catch (IOException e) {<NEW_LINE>StringBuilder sb = new StringBuilder("_failed_to_convert_[" + e.getMessage() + "]");<NEW_LINE>StringBuilders.escapeJson(sb, 0);<NEW_LINE>map.put("source", sb.toString());<NEW_LINE>final String message = String.format(Locale.ROOT, <MASK><NEW_LINE>throw new UncheckedIOException(message, e);<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>} | "failed to convert source for slow log entry [%s]", map.toString()); |
1,727,776 | // GEN-LAST:event_MenuItemViewTermFontDecActionPerformed<NEW_LINE>private void MenuItemViewEditorFontIncActionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>// GEN-FIRST:event_MenuItemViewEditorFontIncActionPerformed<NEW_LINE>int size = TextEditor1.get(iTab).getFont().getSize();<NEW_LINE>if (size < EDITOR_FONT_SIZE_MAX) {<NEW_LINE>TextEditor1.get(iTab).setFont(TextEditor1.get(iTab).getFont().deriveFont(TextEditor1.get(iTab).getFont()<MASK><NEW_LINE>} else {<NEW_LINE>TextEditor1.get(iTab).setFont(TextEditor1.get(iTab).getFont().deriveFont(EDITOR_FONT_SIZE_MAX));<NEW_LINE>}<NEW_LINE>prefs.putFloat(EDITOR_FONT_SIZE, TextEditor1.get(iTab).getFont().getSize());<NEW_LINE>PrefsFlush();<NEW_LINE>// for all<NEW_LINE>SetTheme(prefs.getInt(COLOR_THEME, 0), true);<NEW_LINE>} | .getSize() + 1f)); |
1,649,060 | private void zoomEnd() {<NEW_LINE>Image img = center.getImage();<NEW_LINE>final double originalScale = Math.min((bg.getHeight() - 20) / img.getHeight(), (bg.getWidth() - 20) / img.getWidth());<NEW_LINE>final <MASK><NEW_LINE>final double ratio = newScale / originalScale;<NEW_LINE>if (ratio > 0.8 && ratio < 1.25) {<NEW_LINE>origSize = true;<NEW_LINE>ScaleTransition st = new ScaleTransition(Duration.millis(200), center);<NEW_LINE>st.setToX(originalScale);<NEW_LINE>st.setToY(originalScale);<NEW_LINE>TranslateTransition tt = new TranslateTransition(Duration.millis(200), center);<NEW_LINE>tt.setToX((bg.getWidth() - img.getWidth()) / 2);<NEW_LINE>tt.setToY((bg.getHeight() - img.getHeight()) / 2);<NEW_LINE>tt.setOnFinished(new EventHandler<ActionEvent>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handle(ActionEvent event) {<NEW_LINE>origSize = false;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>tt.play();<NEW_LINE>st.play();<NEW_LINE>}<NEW_LINE>} | double newScale = center.getScaleX(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.