idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
160,447 | private void showFiltersDialog() {<NEW_LINE>executor.submit(() -> {<NEW_LINE>final List<LogFilter> filters = AppManager.getDb().logFilterDao().getAll();<NEW_LINE>Collections.sort(filters);<NEW_LINE>mHandler.post(() -> {<NEW_LINE>final LogFilterAdapter logFilterAdapter = new LogFilterAdapter(LogViewerActivity.this, filters);<NEW_LINE>ListView view = new ListView(LogViewerActivity.this);<NEW_LINE>view.setAdapter(logFilterAdapter);<NEW_LINE>view.setDivider(null);<NEW_LINE>view.setDividerHeight(0);<NEW_LINE>View footer = getLayoutInflater().inflate(R.layout.header_logcat_add_filter, view, false);<NEW_LINE>view.addFooterView(footer);<NEW_LINE>footer.setOnClickListener(v -> new TextInputDropdownDialogBuilder(this, R.string.text_filter_text).setTitle(R.string.add_filter).setDropdownItems(new ArrayList<>(mSearchSuggestionsSet), -1, true).setPositiveButton(android.R.string.ok, (dialog1, which, inputText, isChecked) -> handleNewFilterText(inputText == null ? "" : inputText.toString(), logFilterAdapter)).setNegativeButton(R.string.cancel, null).show());<NEW_LINE>AlertDialog alertDialog = new MaterialAlertDialogBuilder(LogViewerActivity.this).setTitle(R.string.saved_filters).setView(view).setNegativeButton(R.string.<MASK><NEW_LINE>logFilterAdapter.setOnItemClickListener((parent, view1, position, logFilter) -> {<NEW_LINE>setSearchText(logFilter.name);<NEW_LINE>alertDialog.dismiss();<NEW_LINE>});<NEW_LINE>});<NEW_LINE>});<NEW_LINE>} | ok, null).show(); |
1,726,586 | void updateCandidateRecordFromCandidate(@NonNull final I_MD_Candidate candidateRecord, @NonNull final Candidate candidate, final boolean preserveExistingSeqNo) {<NEW_LINE>final MaterialDescriptor materialDescriptor = candidate.getMaterialDescriptor();<NEW_LINE>candidateRecord.setAD_Org_ID(candidate.getOrgId().getRepoId());<NEW_LINE>candidateRecord.setMD_Candidate_Type(candidate.getType().getCode());<NEW_LINE>candidateRecord.setM_Warehouse_ID(WarehouseId.toRepoId(materialDescriptor.getWarehouseId()));<NEW_LINE>candidateRecord.setC_BPartner_Customer_ID(BPartnerId.toRepoId(materialDescriptor.getCustomerId()));<NEW_LINE>candidateRecord.setIsReservedForCustomer(materialDescriptor.isReservedForCustomer());<NEW_LINE>candidateRecord.setM_Product_ID(materialDescriptor.getProductId());<NEW_LINE>candidateRecord.setM_AttributeSetInstance_ID(materialDescriptor.getAttributeSetInstanceId());<NEW_LINE>candidateRecord.setStorageAttributesKey(computeStorageAttributesKeyToStore(materialDescriptor));<NEW_LINE>final BigDecimal quantity = candidate.getQuantity();<NEW_LINE>candidateRecord.setQty(stripZerosAfterTheDigit(quantity));<NEW_LINE>candidateRecord.setDateProjected(TimeUtil.asTimestamp<MASK><NEW_LINE>candidateRecord.setReplenish_MinQty(candidate.getMinMaxDescriptor().getMin());<NEW_LINE>candidateRecord.setReplenish_MaxQty(candidate.getMinMaxDescriptor().getMax());<NEW_LINE>final DemandDetail demandDetail = candidate.getDemandDetail();<NEW_LINE>if (demandDetail != null) {<NEW_LINE>final int forecastLineId = demandDetail.getForecastLineId();<NEW_LINE>if (IdConstants.toRepoId(forecastLineId) > 0) {<NEW_LINE>final I_M_ForecastLine forecastLine = forecastDAO.getForecastLineById(forecastLineId);<NEW_LINE>final Dimension forecastLineDimension = dimensionService.getFromRecord(forecastLine);<NEW_LINE>dimensionService.updateRecord(candidateRecord, forecastLineDimension);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>updateCandidateRecordFromDemandDetail(candidateRecord, demandDetail);<NEW_LINE>if (candidate.getBusinessCase() != null) {<NEW_LINE>candidateRecord.setMD_Candidate_BusinessCase(candidate.getBusinessCase().toString());<NEW_LINE>}<NEW_LINE>if (!candidate.getParentId().isNull()) {<NEW_LINE>candidateRecord.setMD_Candidate_Parent_ID(candidate.getParentId().getRepoId());<NEW_LINE>}<NEW_LINE>final boolean candidateHasSeqNoToSync = candidate.getSeqNo() > 0;<NEW_LINE>final boolean candidateRecordHasNoSeqNo = candidateRecord.getSeqNo() <= 0;<NEW_LINE>if (candidateHasSeqNoToSync && (candidateRecordHasNoSeqNo || !preserveExistingSeqNo)) {<NEW_LINE>candidateRecord.setSeqNo(candidate.getSeqNo());<NEW_LINE>}<NEW_LINE>if (candidate.getGroupId() != null) {<NEW_LINE>candidateRecord.setMD_Candidate_GroupId(candidate.getGroupId().toInt());<NEW_LINE>}<NEW_LINE>final BigDecimal fulfilledQty = candidate.getTransactionDetails().stream().map(TransactionDetail::getQuantity).reduce(ZERO, BigDecimal::add);<NEW_LINE>candidateRecord.setQtyFulfilled(fulfilledQty);<NEW_LINE>final boolean typeImpliesProcessedDone = candidate.getType().equals(CandidateType.INVENTORY_UP) || candidate.getType().equals(CandidateType.INVENTORY_DOWN) || candidate.getType().equals(CandidateType.ATTRIBUTES_CHANGED_FROM) || candidate.getType().equals(CandidateType.ATTRIBUTES_CHANGED_TO);<NEW_LINE>if (fulfilledQty.compareTo(candidateRecord.getQty()) >= 0 || typeImpliesProcessedDone) {<NEW_LINE>candidateRecord.setMD_Candidate_Status(X_MD_Candidate.MD_CANDIDATE_STATUS_Processed);<NEW_LINE>} else {<NEW_LINE>candidateRecord.setMD_Candidate_Status(X_MD_Candidate.MD_CANDIDATE_STATUS_Planned);<NEW_LINE>}<NEW_LINE>} | (materialDescriptor.getDate())); |
708,352 | void writeBatch(ChannelHandlerContext ctx, ChannelPromise promise) {<NEW_LINE>try {<NEW_LINE>FullHttpRequest request = buildRequest(ctx, currentMessage);<NEW_LINE>int eventListSize = currentMessage<MASK><NEW_LINE>batchSize.set((double) eventListSize);<NEW_LINE>final long start = clock.millis();<NEW_LINE>ctx.writeAndFlush(request).addListener(future -> {<NEW_LINE>final long end = clock.millis();<NEW_LINE>batchFlushTime.record(end - start, TimeUnit.MILLISECONDS);<NEW_LINE>if (future.isSuccess()) {<NEW_LINE>promise.setSuccess();<NEW_LINE>flushSuccess.increment();<NEW_LINE>} else {<NEW_LINE>promise.setFailure(new RetryableException(future.cause().getMessage()));<NEW_LINE>flushFailure.increment();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.debug("unable to serialize batch", e);<NEW_LINE>droppedBatches.increment();<NEW_LINE>ctx.fireExceptionCaught(e);<NEW_LINE>} finally {<NEW_LINE>currentMessage = new // TODO: Get origin from context.<NEW_LINE>MantisEventEnvelope(// TODO: Get origin from context.<NEW_LINE>clock.millis(), "origin", new ArrayList<>());<NEW_LINE>currentMessageSize = 0;<NEW_LINE>}<NEW_LINE>} | .getEventList().size(); |
1,443,299 | private MouseListener createMouseListener() {<NEW_LINE>return new MouseAdapter() {<NEW_LINE><NEW_LINE>public void mouseClicked(MouseEvent event) {<NEW_LINE>if (SwingUtilities.isRightMouseButton(event)) {<NEW_LINE>JComponent comp = (JComponent) event.getSource();<NEW_LINE>Item item = null;<NEW_LINE>if (comp instanceof JList) {<NEW_LINE>JList list = (JList) comp;<NEW_LINE><MASK><NEW_LINE>int index = list.locationToIndex(p);<NEW_LINE>if (index >= 0 && !list.getCellBounds(index, index).contains(p)) {<NEW_LINE>index = -1;<NEW_LINE>}<NEW_LINE>if (index >= 0) {<NEW_LINE>item = (Item) list.getModel().getElementAt(index);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Action[] actions = null == item ? category.getActions() : item.getActions();<NEW_LINE>JPopupMenu popup = Utilities.actionsToPopup(actions, getComponent());<NEW_LINE>Utils.addCustomizationMenuItems(popup, getPalettePanel().getController(), getPalettePanel().getSettings());<NEW_LINE>popup.show(comp, event.getX(), event.getY());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | Point p = event.getPoint(); |
213,178 | private void configureQueryMap(Map<String, ?> configs) {<NEW_LINE>String prometheusQuerySupplierClassName = (<MASK><NEW_LINE>Class<?> prometheusQuerySupplierClass = DEFAULT_PROMETHEUS_QUERY_SUPPLIER;<NEW_LINE>if (prometheusQuerySupplierClassName != null) {<NEW_LINE>prometheusQuerySupplierClass = (Class<?>) ConfigDef.parseType(PROMETHEUS_QUERY_SUPPLIER_CONFIG, prometheusQuerySupplierClassName, CLASS);<NEW_LINE>if (!PrometheusQuerySupplier.class.isAssignableFrom(prometheusQuerySupplierClass)) {<NEW_LINE>throw new ConfigException(String.format("Invalid %s is provided to prometheus metric sampler, provided %s", PROMETHEUS_QUERY_SUPPLIER_CONFIG, prometheusQuerySupplierClass));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>PrometheusQuerySupplier prometheusQuerySupplier = KafkaCruiseControlConfigUtils.getConfiguredInstance(prometheusQuerySupplierClass, PrometheusQuerySupplier.class, Collections.emptyMap());<NEW_LINE>_metricToPrometheusQueryMap = prometheusQuerySupplier.get();<NEW_LINE>} | String) configs.get(PROMETHEUS_QUERY_SUPPLIER_CONFIG); |
438,662 | public Observable<ServiceResponseWithHeaders<Page<ImageInformation>, AccountListSupportedImagesHeaders>> listSupportedImagesNextSinglePageAsync(final String nextPageLink, final AccountListSupportedImagesNextOptions accountListSupportedImagesNextOptions) {<NEW_LINE>if (nextPageLink == null) {<NEW_LINE>throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");<NEW_LINE>}<NEW_LINE>Validator.validate(accountListSupportedImagesNextOptions);<NEW_LINE>UUID clientRequestId = null;<NEW_LINE>if (accountListSupportedImagesNextOptions != null) {<NEW_LINE>clientRequestId = accountListSupportedImagesNextOptions.clientRequestId();<NEW_LINE>}<NEW_LINE>Boolean returnClientRequestId = null;<NEW_LINE>if (accountListSupportedImagesNextOptions != null) {<NEW_LINE>returnClientRequestId = accountListSupportedImagesNextOptions.returnClientRequestId();<NEW_LINE>}<NEW_LINE>DateTime ocpDate = null;<NEW_LINE>if (accountListSupportedImagesNextOptions != null) {<NEW_LINE>ocpDate = accountListSupportedImagesNextOptions.ocpDate();<NEW_LINE>}<NEW_LINE>DateTimeRfc1123 ocpDateConverted = null;<NEW_LINE>if (ocpDate != null) {<NEW_LINE>ocpDateConverted = new DateTimeRfc1123(ocpDate);<NEW_LINE>}<NEW_LINE>String nextUrl = String.format("%s", nextPageLink);<NEW_LINE>return service.listSupportedImagesNext(nextUrl, this.client.acceptLanguage(), clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponseWithHeaders<Page<ImageInformation>, AccountListSupportedImagesHeaders>>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Observable<ServiceResponseWithHeaders<Page<ImageInformation>, AccountListSupportedImagesHeaders>> call(Response<ResponseBody> response) {<NEW_LINE>try {<NEW_LINE>ServiceResponseWithHeaders<PageImpl<ImageInformation>, <MASK><NEW_LINE>return Observable.just(new ServiceResponseWithHeaders<Page<ImageInformation>, AccountListSupportedImagesHeaders>(result.body(), result.headers(), result.response()));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>return Observable.error(t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | AccountListSupportedImagesHeaders> result = listSupportedImagesNextDelegate(response); |
359,411 | public static void main(String... args) {<NEW_LINE>ArgParser parser = new ArgParser(args);<NEW_LINE>LibUtilities.getInstance().bind();<NEW_LINE>if (parser.intercept()) {<NEW_LINE>System.exit(parser.getExitCode());<NEW_LINE>}<NEW_LINE>SingleInstanceChecker.stealWebsocket = parser.hasFlag(ArgValue.STEAL);<NEW_LINE>setupFileLogging();<NEW_LINE>log.info(Constants.ABOUT_TITLE + " version: {}", Constants.VERSION);<NEW_LINE>log.info(Constants.ABOUT_TITLE + " vendor: {}", Constants.ABOUT_COMPANY);<NEW_LINE>log.info("Java version: {}", <MASK><NEW_LINE>log.info("Java vendor: {}", Constants.JAVA_VENDOR);<NEW_LINE>CertificateManager certManager = null;<NEW_LINE>try {<NEW_LINE>// Gets and sets the SSL info, properties file<NEW_LINE>certManager = Installer.getInstance().certGen(false);<NEW_LINE>trayProperties = certManager.getProperties();<NEW_LINE>// Reoccurring (e.g. hourly) cert expiration check<NEW_LINE>new ExpiryTask(certManager).schedule();<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Something went critically wrong loading HTTPS", e);<NEW_LINE>}<NEW_LINE>Installer.getInstance().addUserSettings();<NEW_LINE>// Load overridable preferences set in qz-tray.properties file<NEW_LINE>NetworkUtilities.setPreferences(certManager.getProperties());<NEW_LINE>SingleInstanceChecker.setPreferences(certManager.getProperties());<NEW_LINE>// Linux needs the cert installed in user-space on every launch for Chrome SSL to work<NEW_LINE>if (!SystemUtilities.isWindows() && !SystemUtilities.isMac()) {<NEW_LINE>X509Certificate caCert = certManager.getKeyPair(KeyPairWrapper.Type.CA).getCert();<NEW_LINE>// Only install if a CA cert exists (e.g. one we generated)<NEW_LINE>if (caCert != null) {<NEW_LINE>NativeCertificateInstaller.getInstance().install(certManager.getKeyPair(KeyPairWrapper.Type.CA).getCert());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>log.info("Starting {} {}", Constants.ABOUT_TITLE, Constants.VERSION);<NEW_LINE>// Start the WebSocket<NEW_LINE>PrintSocketServer.runServer(certManager, parser.isHeadless());<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Could not start tray manager", e);<NEW_LINE>}<NEW_LINE>log.warn("The web socket server is no longer running");<NEW_LINE>} | Constants.JAVA_VERSION.toString()); |
1,663,805 | public void updateTunnelConnections() {<NEW_LINE>super.updateTunnelConnections();<NEW_LINE>boolean connectivityChanged = false;<NEW_LINE>boolean nowConnectedLeft = determineIfConnected(true);<NEW_LINE>boolean nowConnectedRight = determineIfConnected(false);<NEW_LINE>if (connectedLeft != nowConnectedLeft) {<NEW_LINE>connectedLeft = nowConnectedLeft;<NEW_LINE>connectivityChanged = true;<NEW_LINE>BrassTunnelTileEntity adjacent = getAdjacent(true);<NEW_LINE>if (adjacent != null && !level.isClientSide) {<NEW_LINE>adjacent.updateTunnelConnections();<NEW_LINE>adjacent.selectionMode.<MASK><NEW_LINE>AllTriggers.triggerForNearbyPlayers(AllTriggers.CONNECT_TUNNEL, level, worldPosition, 4);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (connectedRight != nowConnectedRight) {<NEW_LINE>connectedRight = nowConnectedRight;<NEW_LINE>connectivityChanged = true;<NEW_LINE>BrassTunnelTileEntity adjacent = getAdjacent(false);<NEW_LINE>if (adjacent != null && !level.isClientSide) {<NEW_LINE>adjacent.updateTunnelConnections();<NEW_LINE>adjacent.selectionMode.setValue(selectionMode.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (filtering != null)<NEW_LINE>filtering.updateFilterPresence();<NEW_LINE>if (connectivityChanged)<NEW_LINE>sendData();<NEW_LINE>} | setValue(selectionMode.getValue()); |
625,924 | public void listEnrichedSeriesWithContext() {<NEW_LINE>// BEGIN: com.azure.ai.metricsadvisor.MetricsAdvisorClient.listMetricEnrichedSeriesData#String-List-OffsetDateTime-OffsetDateTime-Context<NEW_LINE>final String detectionConfigurationId = "e87d899d-a5a0-4259-b752-11aea34d5e34";<NEW_LINE>final DimensionKey seriesKey = new DimensionKey().put("Dim1", "Common Lime").put("Dim2", "Antelope");<NEW_LINE>final OffsetDateTime startTime = OffsetDateTime.parse("2020-08-12T00:00:00Z");<NEW_LINE>final OffsetDateTime endTime = OffsetDateTime.parse("2020-09-12T00:00:00Z");<NEW_LINE>PagedIterable<MetricEnrichedSeriesData> enrichedDataIterable = metricsAdvisorClient.listMetricEnrichedSeriesData(detectionConfigurationId, Arrays.asList(seriesKey), startTime, endTime);<NEW_LINE>Stream<PagedResponse<MetricEnrichedSeriesData>> enrichedDataPageStream = enrichedDataIterable.streamByPage();<NEW_LINE>int[] pageCount = new int[1];<NEW_LINE>enrichedDataPageStream.forEach(enrichedDataPage -> {<NEW_LINE>System.out.printf("Page: %d%n", pageCount[0]++);<NEW_LINE>IterableStream<MetricEnrichedSeriesData> pageElements = enrichedDataPage.getElements();<NEW_LINE>for (MetricEnrichedSeriesData enrichedData : pageElements) {<NEW_LINE>System.out.printf("Series Key %s%n:", enrichedData.getSeriesKey().asMap());<NEW_LINE>System.out.println("List of data points for this series");<NEW_LINE>System.out.println(enrichedData.getMetricValues());<NEW_LINE>System.out.println("Timestamps of the data related to this time series:");<NEW_LINE>System.out.println(enrichedData.getTimestamps());<NEW_LINE>System.out.println("The expected values of the data points calculated by the smart detector:");<NEW_LINE>System.out.println(enrichedData.getExpectedMetricValues());<NEW_LINE>System.out.println("The lower boundary values of the data points calculated by smart detector:");<NEW_LINE>System.out.println(enrichedData.getLowerBoundaryValues());<NEW_LINE>System.out.println("the periods calculated for the data points in the time series:");<NEW_LINE>System.out.<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>// END: com.azure.ai.metricsadvisor.MetricsAdvisorClient.listMetricEnrichedSeriesData#String-List-OffsetDateTime-OffsetDateTime-Context<NEW_LINE>} | println(enrichedData.getPeriods()); |
46,944 | public void generateCode(CodeGenContext context) throws Exception {<NEW_LINE>JavaCodeGenContext ctx = (JavaCodeGenContext) context;<NEW_LINE>try {<NEW_LINE>LoggerManager.getInstance().info(String.format("Begin to generate java table code for project %s", ctx.getProjectId()));<NEW_LINE>new JavaCodeGeneratorOfTableProcessor().process(ctx);<NEW_LINE>LoggerManager.getInstance().info(String.format("Generate java table code for project %s completed.", ctx.getProjectId()));<NEW_LINE>LoggerManager.getInstance().info(String.format("Begin to generate java view code for project %s", ctx.getProjectId()));<NEW_LINE>new JavaCodeGeneratorOfViewProcessor().process(ctx);<NEW_LINE>LoggerManager.getInstance().info(String.format("Generate java view code for project %s completed.", ctx.getProjectId()));<NEW_LINE>LoggerManager.getInstance().info(String.format("Begin to generate java sp code for project %s", ctx.getProjectId()));<NEW_LINE>new JavaCodeGeneratorOfSpProcessor().process(ctx);<NEW_LINE>LoggerManager.getInstance().info(String.format("Generate java sp code for project %s completed."<MASK><NEW_LINE>LoggerManager.getInstance().info(String.format("Begin to generate java freesql code for project %s", ctx.getProjectId()));<NEW_LINE>new JavaCodeGeneratorOfFreeSqlProcessor().process(ctx);<NEW_LINE>LoggerManager.getInstance().info(String.format("Generate java freesql code for project %s completed.", ctx.getProjectId()));<NEW_LINE>LoggerManager.getInstance().info(String.format("Begin to generate java other code for project %s", ctx.getProjectId()));<NEW_LINE>new JavaCodeGeneratorOfOthersProcessor().process(ctx);<NEW_LINE>LoggerManager.getInstance().info(String.format("Generate java other code for project %s completed.", ctx.getProjectId()));<NEW_LINE>} catch (Exception e) {<NEW_LINE>LoggerManager.getInstance().error(e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>} | , ctx.getProjectId())); |
194,815 | private void logImpl(final Event event, final long duration, final Object... messageArgs) {<NEW_LINE>if (isEnabled(event.level())) {<NEW_LINE>final String[] messageArgsStr = new String[messageArgs.length];<NEW_LINE>for (int i = 0; i < messageArgs.length; i++) {<NEW_LINE>messageArgsStr[i] = formatInstance(messageArgs[i]);<NEW_LINE>}<NEW_LINE>final TracingInfo.Message message = new TracingInfo.Message(event, duration, messageArgsStr);<NEW_LINE>tracingInfo.addMessage(message);<NEW_LINE>final java.util.logging.Level loggingLevel;<NEW_LINE>switch(event.level()) {<NEW_LINE>case SUMMARY:<NEW_LINE>loggingLevel = java.util.logging.Level.FINE;<NEW_LINE>break;<NEW_LINE>case TRACE:<NEW_LINE>loggingLevel = java.util.logging.Level.FINER;<NEW_LINE>break;<NEW_LINE>case VERBOSE:<NEW_LINE>loggingLevel = java<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>loggingLevel = java.util.logging.Level.OFF;<NEW_LINE>}<NEW_LINE>if (logger.isLoggable(loggingLevel)) {<NEW_LINE>logger.log(loggingLevel, event.name() + ' ' + message.toString() + " [" + TracingInfo.formatDuration(duration) + " ms]");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .util.logging.Level.FINEST; |
505,998 | void saveRotationState() {<NEW_LINE>// Disable rotation from the accelerometer; 0 means off, 1 means on<NEW_LINE>try {<NEW_LINE>originalAccelerometer = settings.system().getInt(Settings.System.ACCELEROMETER_ROTATION);<NEW_LINE>} catch (Settings.SettingNotFoundException e) {<NEW_LINE>Log.d(TAG, "Could not read accelerometer rotation setting: " + e.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>originalUserRotation = settings.system().<MASK><NEW_LINE>} catch (Settings.SettingNotFoundException e) {<NEW_LINE>Log.d(TAG, "Could not read user rotation setting: " + e.getMessage());<NEW_LINE>}<NEW_LINE>// Make sure we start the test in portrait and disable the accelerometer<NEW_LINE>settings.system().putInt(Settings.System.USER_ROTATION, Surface.ROTATION_0);<NEW_LINE>settings.system().putInt(Settings.System.ACCELEROMETER_ROTATION, 0);<NEW_LINE>} | getInt(Settings.System.USER_ROTATION); |
210,055 | public void onReceive(Context context, Intent intent) {<NEW_LINE>// Save usage statistics right now!<NEW_LINE>// We need to use the statics at this moment<NEW_LINE>// for "skipping foreground apps"<NEW_LINE>// No app is foreground after the screen is locked.<NEW_LINE>mScreenLockTime = new Date().getTime();<NEW_LINE>if (SettingsManager.getInstance().getSkipForegroundEnabled() && Utility.checkUsageStatsPermission(FreezeService.this)) {<NEW_LINE>UsageStatsManager usm = getSystemService(UsageStatsManager.class);<NEW_LINE>mUsageStats = usm.queryAndAggregateUsageStats(mScreenLockTime - APP_INACTIVE_TIMEOUT, mScreenLockTime);<NEW_LINE>}<NEW_LINE>// Delay the work so that it can be canceled if the screen<NEW_LINE>// gets unlocked before the delay passes<NEW_LINE>mHandler.postDelayed(mFreezeWork, ((long) SettingsManager.getInstance().getAutoFreezeDelay()) * 1000);<NEW_LINE>registerReceiver(mUnlockReceiver, <MASK><NEW_LINE>} | new IntentFilter(Intent.ACTION_SCREEN_ON)); |
369,695 | public void run() {<NEW_LINE>JmxModel model = JmxModelFactory.getJmxModelFor(application);<NEW_LINE>if (model == null || !model.isJfrAvailable()) {<NEW_LINE>DialogDisplayer.getDefault().notifyLater(new // NOI18N<NEW_LINE>NotifyDescriptor.Message(// NOI18N<NEW_LINE>NbBundle.getMessage(JFRRecordingProvider.class, "MSG_Dump_failed"), NotifyDescriptor.ERROR_MESSAGE));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<Long> recordings = model.jfrCheck();<NEW_LINE>if (recordings.isEmpty()) {<NEW_LINE>DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message(// NOI18N<NEW_LINE>NbBundle.// NOI18N<NEW_LINE>getMessage(// NOI18N<NEW_LINE>JFRRecordingProvider.class, // NOI18N<NEW_LINE>"MSG_Cannot_Take_JFR_dump", DataSourceDescriptorFactory.getDescriptor(application).getName()), NotifyDescriptor.ERROR_MESSAGE));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String file = dumpFile;<NEW_LINE>if (file == null) {<NEW_LINE>file = defineRemoteFile(model, customizeDumpFile);<NEW_LINE>}<NEW_LINE>if (file == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (model.takeJfrDump(recordings.get(0), file) != null) {<NEW_LINE>DialogDisplayer.getDefault().notifyLater(new // NOI18N<NEW_LINE>NotifyDescriptor.Message(// NOI18N<NEW_LINE>NbBundle.getMessage(JFRRecordingProvider.class, "MSG_Dump_ok", <MASK><NEW_LINE>} else {<NEW_LINE>DialogDisplayer.getDefault().notifyLater(new // NOI18N<NEW_LINE>NotifyDescriptor.Message(// NOI18N<NEW_LINE>NbBundle.getMessage(JFRRecordingProvider.class, "MSG_Dump_save_failed", file), NotifyDescriptor.ERROR_MESSAGE));<NEW_LINE>}<NEW_LINE>} | file), NotifyDescriptor.INFORMATION_MESSAGE)); |
1,625,937 | public List<Integer> decode(byte[] address) {<NEW_LINE>int[] output = new int[encodingBits.size()];<NEW_LINE>int bitIndex = positiveIntegersOnly ? totalBitLength - 1 : totalBitLength - encodingBits.size() - 1;<NEW_LINE>int bitsProcessed = 0;<NEW_LINE>// Un-weave address into original integers<NEW_LINE>while (bitIndex >= 0) {<NEW_LINE>for (int index = 0; index < output.length; index++) {<NEW_LINE>if (bitsProcessed >= encodingBits.get(index)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>byte maskedBit = (byte) ((address[bitIndex >> 3] >> (<MASK><NEW_LINE>int bitPosition = encodingBits.get(index) - bitsProcessed - 1;<NEW_LINE>output[index] |= maskedBit << bitPosition;<NEW_LINE>bitIndex--;<NEW_LINE>}<NEW_LINE>bitsProcessed++;<NEW_LINE>}<NEW_LINE>if (!positiveIntegersOnly) {<NEW_LINE>// Set correct sign bit for outputs<NEW_LINE>bitIndex = totalBitLength - 1;<NEW_LINE>for (int index = 0; index < output.length; index++) {<NEW_LINE>byte signBit = (byte) ((address[bitIndex >> 3] >> (bitIndex & 7)) & 1);<NEW_LINE>if (signBit == 0) {<NEW_LINE>output[index] -= (1 << encodingBits.get(index));<NEW_LINE>}<NEW_LINE>bitIndex--;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Arrays.stream(output).boxed().collect(ImmutableList.toImmutableList());<NEW_LINE>} | bitIndex & 7)) & 1); |
715,522 | public org.python.Object __add__(org.python.Object other) {<NEW_LINE>if (other instanceof org.python.types.Bool) {<NEW_LINE>return org.python.types.Int.getInt((this.value ? 1 : 0) + (((org.python.types.Bool) other).value ? 1 : 0));<NEW_LINE>} else if (other instanceof org.python.types.Int) {<NEW_LINE>return org.python.types.Int.getInt((this.value ? 1 : 0) + ((org.python.types.Int) other).value);<NEW_LINE>} else if (other instanceof org.python.types.Float) {<NEW_LINE>return new org.python.types.Float((this.value ? 1 : 0) + ((org.python.types<MASK><NEW_LINE>} else if (other instanceof org.python.types.Complex) {<NEW_LINE>org.python.types.Complex other_cmplx = (org.python.types.Complex) other;<NEW_LINE>return new org.python.types.Complex((this.value ? 1 : 0) + other_cmplx.real.value, other_cmplx.imag.value);<NEW_LINE>}<NEW_LINE>throw new org.python.exceptions.TypeError("unsupported operand type(s) for +: 'bool' and '" + other.typeName() + "'");<NEW_LINE>} | .Float) other).value); |
1,147,608 | final DescribeGroupResult executeDescribeGroup(DescribeGroupRequest describeGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeGroupRequest> request = null;<NEW_LINE>Response<DescribeGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeGroupRequest));<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, "QuickSight");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeGroupResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeGroup"); |
153,494 | private void initVertCompSide(ComponentSide side, GridBagConstraints cons, Dimension minSize, Dimension prefSize, ParentInfo info) {<NEW_LINE>MixedConstraints mixCons = info.consTable.get(cons);<NEW_LINE>side.gridStart = mixCons.mapped.getY();<NEW_LINE>side.gridLength = mixCons.mapped.getSize().getHeight();<NEW_LINE>side.weight = cons.weighty;<NEW_LINE>side<MASK><NEW_LINE>side.end_inset = cons.insets.bottom;<NEW_LINE>int anchor = translateRelativeAnchor(cons.anchor, !info.orientation);<NEW_LINE>switch(anchor) {<NEW_LINE>case GridBagConstraints.NORTHWEST:<NEW_LINE>case GridBagConstraints.NORTH:<NEW_LINE>case GridBagConstraints.NORTHEAST:<NEW_LINE>side.position = ComponentSide.POS_START;<NEW_LINE>break;<NEW_LINE>case GridBagConstraints.WEST:<NEW_LINE>case GridBagConstraints.CENTER:<NEW_LINE>case GridBagConstraints.EAST:<NEW_LINE>side.position = ComponentSide.POS_CENTER;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>side.position = ComponentSide.POS_END;<NEW_LINE>}<NEW_LINE>if ((cons.fill == GridBagConstraints.BOTH) || (cons.fill == GridBagConstraints.VERTICAL)) {<NEW_LINE>side.stretch = true;<NEW_LINE>} else {<NEW_LINE>side.stretch = false;<NEW_LINE>}<NEW_LINE>side.minLength = minSize.getHeight() + cons.ipady;<NEW_LINE>side.prefLength = prefSize.getHeight() + cons.ipady;<NEW_LINE>} | .start_inset = cons.insets.top; |
319,974 | public void actionPerformed(final ActionEvent event) {<NEW_LINE>final Controller controller = Controller.getCurrentController();<NEW_LINE>final ModeController modeController = controller.getModeController();<NEW_LINE>final MFileManager fileManager = MFileManager.getController(modeController);<NEW_LINE>final <MASK><NEW_LINE>MindMapPreviewWithOptions previewOptions = new MindMapPreviewWithOptions(fileChooser);<NEW_LINE>fileChooser.setAccessory(previewOptions);<NEW_LINE>fileChooser.setMultiSelectionEnabled(false);<NEW_LINE>final int returnVal = fileChooser.showOpenDialog(controller.getMapViewManager().getMapViewComponent());<NEW_LINE>if (returnVal != JFileChooser.APPROVE_OPTION) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>File file = fileChooser.getSelectedFile();<NEW_LINE>if (!file.exists()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final MapModel map = controller.getMap();<NEW_LINE>MapStyle mapStyleController = MapStyle.getController(modeController);<NEW_LINE>mapStyleController.copyStyles(file, map, previewOptions.isFollowChecked(), previewOptions.isAssociateChecked());<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>LogUtils.severe(e);<NEW_LINE>}<NEW_LINE>} | JFileChooser fileChooser = fileManager.getMindMapFileChooser(); |
358,550 | // The ECMQV Primitive as described in SEC-1, 3.4<NEW_LINE>private ECPoint calculateMqvAgreement(ECDomainParameters parameters, ECPrivateKeyParameters d1U, ECPrivateKeyParameters d2U, ECPublicKeyParameters Q2U, ECPublicKeyParameters Q1V, ECPublicKeyParameters Q2V) {<NEW_LINE>BigInteger n = parameters.getN();<NEW_LINE>int e = (n.bitLength() + 1) / 2;<NEW_LINE>BigInteger powE = ECConstants.ONE.shiftLeft(e);<NEW_LINE><MASK><NEW_LINE>// The Q2U public key is optional - but will be calculated for us if it wasn't present<NEW_LINE>ECPoint q2u = ECAlgorithms.cleanPoint(curve, Q2U.getQ());<NEW_LINE>ECPoint q1v = ECAlgorithms.cleanPoint(curve, Q1V.getQ());<NEW_LINE>ECPoint q2v = ECAlgorithms.cleanPoint(curve, Q2V.getQ());<NEW_LINE>BigInteger x = q2u.getAffineXCoord().toBigInteger();<NEW_LINE>BigInteger xBar = x.mod(powE);<NEW_LINE>BigInteger Q2UBar = xBar.setBit(e);<NEW_LINE>BigInteger s = d1U.getD().multiply(Q2UBar).add(d2U.getD()).mod(n);<NEW_LINE>BigInteger xPrime = q2v.getAffineXCoord().toBigInteger();<NEW_LINE>BigInteger xPrimeBar = xPrime.mod(powE);<NEW_LINE>BigInteger Q2VBar = xPrimeBar.setBit(e);<NEW_LINE>BigInteger hs = parameters.getH().multiply(s).mod(n);<NEW_LINE>return ECAlgorithms.sumOfTwoMultiplies(q1v, Q2VBar.multiply(hs).mod(n), q2v, hs);<NEW_LINE>} | ECCurve curve = parameters.getCurve(); |
772,788 | protected void actionPerformed(OWLEntity selectedEntity) {<NEW_LINE>OWLEntityRenamer owlEntityRenamer = new OWLEntityRenamer(getOWLModelManager().getOWLOntologyManager(), getOWLModelManager().getOntologies());<NEW_LINE>final IRI iri = RenameEntityPanel.showDialog(getOWLEditorKit(), selectedEntity);<NEW_LINE>if (iri == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final List<OWLOntologyChange> changes;<NEW_LINE>if (RenameEntityPanel.isAutoRenamePuns()) {<NEW_LINE>changes = owlEntityRenamer.changeIRI(selectedEntity.getIRI(), iri);<NEW_LINE>} else {<NEW_LINE>changes = <MASK><NEW_LINE>}<NEW_LINE>getOWLModelManager().applyChanges(changes);<NEW_LINE>selectedEntity.accept(new OWLEntityVisitor() {<NEW_LINE><NEW_LINE>public void visit(OWLClass cls) {<NEW_LINE>ensureSelected(getOWLDataFactory().getOWLClass(iri));<NEW_LINE>}<NEW_LINE><NEW_LINE>public void visit(OWLObjectProperty property) {<NEW_LINE>ensureSelected(getOWLDataFactory().getOWLObjectProperty(iri));<NEW_LINE>}<NEW_LINE><NEW_LINE>public void visit(OWLDataProperty property) {<NEW_LINE>ensureSelected(getOWLDataFactory().getOWLDataProperty(iri));<NEW_LINE>}<NEW_LINE><NEW_LINE>public void visit(OWLAnnotationProperty owlAnnotationProperty) {<NEW_LINE>ensureSelected(getOWLDataFactory().getOWLAnnotationProperty(iri));<NEW_LINE>}<NEW_LINE><NEW_LINE>public void visit(OWLNamedIndividual individual) {<NEW_LINE>ensureSelected(getOWLDataFactory().getOWLNamedIndividual(iri));<NEW_LINE>}<NEW_LINE><NEW_LINE>public void visit(OWLDatatype dataType) {<NEW_LINE>ensureSelected(getOWLDataFactory().getOWLDatatype(iri));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | owlEntityRenamer.changeIRI(selectedEntity, iri); |
1,281,698 | public Cursor doHandle(final LogicalDal logicalPlan, ExecutionContext executionContext) {<NEW_LINE>SqlShowDdlResults showDdlResults = (SqlShowDdlResults) logicalPlan.getNativeSqlNode();<NEW_LINE>String schemaName = executionContext.getSchemaName();<NEW_LINE>List<Long> jobIds = showDdlResults.getJobIds();<NEW_LINE>// Try to inspect caches from new DDL engine.<NEW_LINE>ArrayResultCursor resultCursor = DdlResponseCollectSyncAction.buildResultCursor();<NEW_LINE>List<Object[]> <MASK><NEW_LINE>// new engine<NEW_LINE>IGmsSyncAction syncAction = new DdlResponseCollectSyncAction(schemaName, jobIds);<NEW_LINE>GmsSyncManagerHelper.sync(syncAction, schemaName, results -> {<NEW_LINE>if (results == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (Pair<NodeInfo, List<Map<String, Object>>> result : results) {<NEW_LINE>if (result == null || result.getValue() == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (Map<String, Object> row : result.getValue()) {<NEW_LINE>if (row == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>rowList.add(buildRow(row));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// try to inspect running ddl jobs<NEW_LINE>List<DdlEngineRecord> engineRecords = DdlEngineShowJobsHandler.inspectDdlJobs(Pair.of(jobIds, executionContext.getSchemaName()), new DdlEngineSchedulerManager());<NEW_LINE>for (DdlEngineRecord record : GeneralUtil.emptyIfNull(engineRecords)) {<NEW_LINE>if (!record.isSubJob()) {<NEW_LINE>rowList.add(convertEngineRecordToRow(record));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Collections.sort(rowList, (o1, o2) -> {<NEW_LINE>String s1 = String.valueOf(o1[0]);<NEW_LINE>String s2 = String.valueOf(o2[0]);<NEW_LINE>return s2.compareTo(s1);<NEW_LINE>});<NEW_LINE>for (Object[] row : rowList) {<NEW_LINE>resultCursor.addRow(row);<NEW_LINE>}<NEW_LINE>return resultCursor;<NEW_LINE>} | rowList = new ArrayList<>(); |
16,732 | public void marshall(UpdateLocationHdfsRequest updateLocationHdfsRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updateLocationHdfsRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(updateLocationHdfsRequest.getLocationArn(), LOCATIONARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateLocationHdfsRequest.getSubdirectory(), SUBDIRECTORY_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateLocationHdfsRequest.getNameNodes(), NAMENODES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateLocationHdfsRequest.getBlockSize(), BLOCKSIZE_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateLocationHdfsRequest.getReplicationFactor(), REPLICATIONFACTOR_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateLocationHdfsRequest.getKmsKeyProviderUri(), KMSKEYPROVIDERURI_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateLocationHdfsRequest.getQopConfiguration(), QOPCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateLocationHdfsRequest.getAuthenticationType(), AUTHENTICATIONTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateLocationHdfsRequest.getSimpleUser(), SIMPLEUSER_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateLocationHdfsRequest.getKerberosPrincipal(), KERBEROSPRINCIPAL_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateLocationHdfsRequest.getKerberosKeytab(), KERBEROSKEYTAB_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateLocationHdfsRequest.getKerberosKrb5Conf(), KERBEROSKRB5CONF_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | updateLocationHdfsRequest.getAgentArns(), AGENTARNS_BINDING); |
230,004 | private void init(EditorPatternButton imgBtn, JLabel msgApplied) {<NEW_LINE>_imgBtn = imgBtn;<NEW_LINE>JLabel lblPath = new JLabel(_I("lblPath"));<NEW_LINE>JLabel lblFilename = new JLabel(_I("lblFilename"));<NEW_LINE>String filename = _imgBtn.getFilename();<NEW_LINE>File f = new File(filename);<NEW_LINE>String fullpath = f.getParent();<NEW_LINE>filename = getFilenameWithoutExt(f);<NEW_LINE>_oldFilename = filename;<NEW_LINE>BufferedImage thumb = _imgBtn.createThumbnailImage(THUMB_MAX_HEIGHT);<NEW_LINE>Border border = LineBorder.createGrayLineBorder();<NEW_LINE>JLabel lblThumb = new JLabel(new ImageIcon(thumb));<NEW_LINE>lblThumb.setBorder(border);<NEW_LINE>_txtPath = new JTextField(fullpath, TXT_FILENAME_LENGTH);<NEW_LINE>_txtPath.setEditable(false);<NEW_LINE>_txtPath.setEnabled(false);<NEW_LINE>String[] candidates = new String[] { filename };<NEW_LINE>// <editor-fold defaultstate="collapsed" desc="OCR --- not used"><NEW_LINE>// </editor-fold><NEW_LINE>_txtFilename = new AutoCompleteCombo(candidates);<NEW_LINE>_txtFileExt = new JTextField<MASK><NEW_LINE>_txtFileExt.setEditable(false);<NEW_LINE>_txtFileExt.setEnabled(false);<NEW_LINE>GridBagConstraints c = new GridBagConstraints();<NEW_LINE>c.gridy = 0;<NEW_LINE>c.insets = new Insets(100, 0, 0, 0);<NEW_LINE>this.add(new JLabel(""), c);<NEW_LINE>c = new GridBagConstraints();<NEW_LINE>c.fill = 0;<NEW_LINE>c.gridwidth = 3;<NEW_LINE>c.gridy = 1;<NEW_LINE>c.insets = new Insets(0, 10, 20, 10);<NEW_LINE>this.add(lblThumb, c);<NEW_LINE>c = new GridBagConstraints();<NEW_LINE>c.fill = 1;<NEW_LINE>c.gridy = 2;<NEW_LINE>this.add(lblPath, c);<NEW_LINE>c.gridx = 1;<NEW_LINE>c.gridwidth = 2;<NEW_LINE>this.add(_txtPath, c);<NEW_LINE>c = new GridBagConstraints();<NEW_LINE>c.gridy = 3;<NEW_LINE>c.fill = 0;<NEW_LINE>this.add(lblFilename, c);<NEW_LINE>this.add(_txtFilename, c);<NEW_LINE>this.add(_txtFileExt, c);<NEW_LINE>c = new GridBagConstraints();<NEW_LINE>c.gridy = 4;<NEW_LINE>c.gridx = 1;<NEW_LINE>c.insets = new Insets(200, 0, 0, 0);<NEW_LINE>this.add(msgApplied, c);<NEW_LINE>} | (getFileExt(f), TXT_FILE_EXT_LENGTH); |
281,858 | public String handlevolchangeeasy(String sval) {<NEW_LINE>String res = "#notpaired";<NEW_LINE>int val;<NEW_LINE>int pos = sval.indexOf(".");<NEW_LINE>if (pos > 0) {<NEW_LINE>String ns = sval.substring(0, pos);<NEW_LINE>val = Integer.parseInt(ns);<NEW_LINE>} else {<NEW_LINE>val = Integer.parseInt(sval);<NEW_LINE>}<NEW_LINE>if (ispaired()) {<NEW_LINE>res = getvolumeinfo(0);<NEW_LINE>String currentvol = quickfind(res, "level");<NEW_LINE>int cvol = Integer.parseInt(currentvol);<NEW_LINE>int todo = val - cvol;<NEW_LINE>logger.debug("currentvolume=" + cvol + " newvolume=" + val + " todo=" + todo);<NEW_LINE>LgTvCommand volup = LgTvCommand.valueOf("VOLUME_UP");<NEW_LINE>LgTvCommand voldown = LgTvCommand.valueOf("VOLUME_DOWN");<NEW_LINE>String usecommand = todo > 0 ? volup.getLgSendCommand() : voldown.getLgSendCommand();<NEW_LINE>if (todo < 0) {<NEW_LINE>todo = todo * -1;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < todo; i++) {<NEW_LINE>handlekeyinput(usecommand);<NEW_LINE>}<NEW_LINE>logger.debug("currentvolume=" + cvol + " newvolume=" + val + " todo=" + todo + " usecommand=" + usecommand);<NEW_LINE>if (todo != 0) {<NEW_LINE>res = getvolumeinfo(0);<NEW_LINE>currentvol = quickfind(res, "level");<NEW_LINE>if (associatedreader != null) {<NEW_LINE>String volume = "VOLUME_CURRENT=" + val;<NEW_LINE>LgtvStatusUpdateEvent event = new LgtvStatusUpdateEvent(this);<NEW_LINE>associatedreader.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new String(res);<NEW_LINE>} | sendtohandlers(event, lgip, volume); |
1,541,938 | public <T extends JpaObject> List<T> fetchEqualAndEqual(Class<T> clz, List<String> fetchAttributes, String attribute, Object value, String otherAttribute, Object otherValue) throws Exception {<NEW_LINE>List<T> list = new ArrayList<>();<NEW_LINE>List<String> fields = ListTools.trim(fetchAttributes, true, true, JpaObject.id_FIELDNAME);<NEW_LINE>EntityManager em = this.get(clz);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Tuple> cq = cb.createQuery(Tuple.class);<NEW_LINE>Root<T> root = cq.from(clz);<NEW_LINE>List<Selection<?>> <MASK><NEW_LINE>for (String str : fields) {<NEW_LINE>selections.add(root.get(str));<NEW_LINE>}<NEW_LINE>Predicate p = cb.and(cb.equal(root.get(attribute), value), cb.equal(root.get(otherAttribute), otherValue));<NEW_LINE>cq.multiselect(selections).where(p);<NEW_LINE>for (Tuple o : em.createQuery(cq).getResultList()) {<NEW_LINE>T t = clz.newInstance();<NEW_LINE>for (int i = 0; i < fields.size(); i++) {<NEW_LINE>PropertyUtils.setProperty(t, fields.get(i), o.get(selections.get(i)));<NEW_LINE>}<NEW_LINE>list.add(t);<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>} | selections = new ArrayList<>(); |
1,082,915 | private int computeMinimumDesignSize(LayoutInterval interval) {<NEW_LINE>int size = 0;<NEW_LINE>if (interval.isSingle()) {<NEW_LINE>int min = interval.getMinimumSize();<NEW_LINE>size = min == USE_PREFERRED_SIZE ? interval.getPreferredSize() : min;<NEW_LINE>if (size == NOT_EXPLICITLY_DEFINED) {<NEW_LINE>if (interval.isComponent()) {<NEW_LINE>LayoutComponent comp = interval.getComponent();<NEW_LINE>Dimension dim = min == USE_PREFERRED_SIZE ? visualMapper.getComponentPreferredSize(comp.getId()) : visualMapper.getComponentMinimumSize(comp.getId());<NEW_LINE>size = interval == comp.getLayoutInterval(HORIZONTAL) ? dim.width : dim.height;<NEW_LINE>} else {<NEW_LINE>// gap<NEW_LINE>size = LayoutUtils.getSizeOfDefaultGap(interval, visualMapper);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (interval.isSequential()) {<NEW_LINE>for (int i = 0, n = interval.getSubIntervalCount(); i < n; i++) {<NEW_LINE>size += computeMinimumDesignSize<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// parallel group<NEW_LINE>for (int i = 0, n = interval.getSubIntervalCount(); i < n; i++) {<NEW_LINE>size = Math.max(size, computeMinimumDesignSize(interval.getSubInterval(i)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return size;<NEW_LINE>} | (interval.getSubInterval(i)); |
1,204,905 | static <T extends SAMLObject> MessageContext<T> toSamlObject(AggregatedHttpRequest req, String name, Map<String, SamlIdentityProviderConfig> idpConfigs, @Nullable SamlIdentityProviderConfig defaultIdpConfig) {<NEW_LINE>requireNonNull(req, "req");<NEW_LINE>requireNonNull(name, "name");<NEW_LINE>requireNonNull(idpConfigs, "idpConfigs");<NEW_LINE>final SamlParameters parameters = new SamlParameters(req);<NEW_LINE>final T message = (T) fromDeflatedBase64(parameters.getFirstValue(name));<NEW_LINE>final MessageContext<T> messageContext = new MessageContext<>();<NEW_LINE>messageContext.setMessage(message);<NEW_LINE>final Issuer issuer;<NEW_LINE>if (message instanceof RequestAbstractType) {<NEW_LINE>issuer = ((RequestAbstractType) message).getIssuer();<NEW_LINE>} else if (message instanceof StatusResponseType) {<NEW_LINE>issuer = ((StatusResponseType) message).getIssuer();<NEW_LINE>} else {<NEW_LINE>throw new InvalidSamlRequestException("invalid message type: " + message.getClass().getSimpleName());<NEW_LINE>}<NEW_LINE>// Use the default identity provider config if there's no issuer.<NEW_LINE>final SamlIdentityProviderConfig config;<NEW_LINE>if (issuer != null) {<NEW_LINE>final String idpEntityId = issuer.getValue();<NEW_LINE>config = idpConfigs.get(idpEntityId);<NEW_LINE>if (config == null) {<NEW_LINE>throw new InvalidSamlRequestException("a message from unknown identity provider: " + idpEntityId);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (defaultIdpConfig == null) {<NEW_LINE>throw new InvalidSamlRequestException("failed to get an Issuer element");<NEW_LINE>}<NEW_LINE>config = defaultIdpConfig;<NEW_LINE>}<NEW_LINE>// If this message is sent via HTTP-redirect binding protocol, its signature parameter should<NEW_LINE>// be validated.<NEW_LINE>validateSignature(config.signingCredential(), parameters, name);<NEW_LINE>final String <MASK><NEW_LINE>if (relayState != null) {<NEW_LINE>final SAMLBindingContext context = messageContext.getSubcontext(SAMLBindingContext.class, true);<NEW_LINE>assert context != null;<NEW_LINE>context.setRelayState(relayState);<NEW_LINE>}<NEW_LINE>return messageContext;<NEW_LINE>} | relayState = parameters.getFirstValueOrNull(RELAY_STATE); |
405,188 | boolean hasInstanceInChain(int tag, Instance i) {<NEW_LINE>ClassDump javaClass;<NEW_LINE>long idom;<NEW_LINE>long instanceId;<NEW_LINE>if (tag == HprofHeap.PRIMITIVE_ARRAY_DUMP) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>javaClass = (ClassDump) i.getJavaClass();<NEW_LINE>if (canContainItself == null) {<NEW_LINE>canContainItself = new HashMap(heap.getAllClasses().size() / 2);<NEW_LINE>}<NEW_LINE>if (tag == HprofHeap.INSTANCE_DUMP) {<NEW_LINE>Boolean canContain = canContainItself.get(javaClass);<NEW_LINE>if (canContain == null) {<NEW_LINE>canContain = Boolean.valueOf(javaClass.canContainItself());<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (!canContain.booleanValue()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>instanceId = i.getInstanceId();<NEW_LINE>idom = getIdomId(instanceId);<NEW_LINE>for (; idom != 0; idom = getIdomId(idom)) {<NEW_LINE>Instance ip = heap.getInstanceByID(idom);<NEW_LINE>JavaClass cls = ip.getJavaClass();<NEW_LINE>if (javaClass.equals(cls)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | canContainItself.put(javaClass, canContain); |
287,452 | public void saveConfiguration() {<NEW_LINE>IProgressMonitor monitor = new NullProgressMonitor();<NEW_LINE>Path configFile = getConfigFile(true);<NEW_LINE>try {<NEW_LINE>if (Files.exists(configFile)) {<NEW_LINE>ContentUtils.makeFileBackup(configFile);<NEW_LINE>}<NEW_LINE>if (tasks.isEmpty()) {<NEW_LINE>try {<NEW_LINE>Files.delete(configFile);<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error("Error deleting file " + configFile.toAbsolutePath(), e);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Error processing config file", e);<NEW_LINE>}<NEW_LINE>ByteArrayOutputStream dsConfigBuffer = new ByteArrayOutputStream(10000);<NEW_LINE>try (OutputStreamWriter osw = new OutputStreamWriter(dsConfigBuffer, StandardCharsets.UTF_8)) {<NEW_LINE>try (JsonWriter jsonWriter = CONFIG_GSON.newJsonWriter(osw)) {<NEW_LINE>synchronized (tasks) {<NEW_LINE>serializeTasks(new DefaultProgressMonitor(monitor), jsonWriter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error(e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>IOUtils.writeFileFromBuffer(configFile.toFile(), dsConfigBuffer.toByteArray());<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Error saving configuration to a file " + <MASK><NEW_LINE>}<NEW_LINE>} | configFile.toAbsolutePath(), e); |
1,566,537 | private UpdateShipmentScheduleRequest toUpdateShipmentScheduleRequestOrNull(@NonNull final JsonCreateShipmentInfo createShipmentInfo, @NonNull final ShippingInfoCache cache) {<NEW_LINE>final LocalDateTime deliveryDate = createShipmentInfo.getMovementDate();<NEW_LINE>final LocationBasicInfo bPartnerLocation = LocationBasicInfo.ofNullable(createShipmentInfo.getShipToLocation(), countryCodeFactory).orElse(null);<NEW_LINE>final String bpartnerCode = createShipmentInfo.getBusinessPartnerSearchKey();<NEW_LINE>final List<JsonAttributeInstance> attributes = createShipmentInfo.getAttributes();<NEW_LINE>final DeliveryRule deliveryRule = DeliveryRule.ofNullableCode(createShipmentInfo.getDeliveryRule());<NEW_LINE>final ShipperId shipperId = cache.<MASK><NEW_LINE>if (deliveryDate == null && bPartnerLocation == null && Check.isBlank(bpartnerCode) && Check.isEmpty(attributes) && deliveryRule == null && shipperId == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final ShipmentScheduleId shipmentScheduleId = extractShipmentScheduleId(createShipmentInfo);<NEW_LINE>final OrgId orgId = cache.getOrgId(shipmentScheduleId);<NEW_LINE>final ZoneId timeZoneId = orgDAO.getTimeZone(orgId);<NEW_LINE>final List<CreateAttributeInstanceReq> attributeInstanceRequestList = Check.isEmpty(attributes) ? null : attributeSetHelper.toCreateAttributeInstanceReqList(attributes);<NEW_LINE>return UpdateShipmentScheduleRequest.builder().shipmentScheduleId(shipmentScheduleId).bPartnerCode(bpartnerCode).bPartnerLocation(bPartnerLocation).attributes(attributeInstanceRequestList).deliveryDate(TimeUtil.asZonedDateTime(deliveryDate, timeZoneId)).deliveryRule(deliveryRule).shipperId(shipperId).build();<NEW_LINE>} | getShipperId(createShipmentInfo.getShipperInternalName()); |
688,065 | private static void waitForTopicsToBeCreated(Admin adminClient, Collection<String> topicsToAwait, Duration timeout) throws InterruptedException {<NEW_LINE>Set<String> lastMissingTopics = null;<NEW_LINE>while (!shutdown) {<NEW_LINE>try {<NEW_LINE>ListTopicsResult topics = adminClient.listTopics();<NEW_LINE>Set<String> existingTopics = topics.names().get(timeout.toMillis(), TimeUnit.MILLISECONDS);<NEW_LINE>if (existingTopics.containsAll(topicsToAwait)) {<NEW_LINE>LOGGER.debug("All expected topics created: " + topicsToAwait);<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>Set<String> missingTopics = new HashSet<>(topicsToAwait);<NEW_LINE>missingTopics.removeAll(existingTopics);<NEW_LINE>// Do not spam warnings - topics may take time to be created by an operator like Strimzi<NEW_LINE>if (missingTopics.equals(lastMissingTopics)) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>LOGGER.warn("Waiting for topic(s) to be created: " + missingTopics);<NEW_LINE>lastMissingTopics = missingTopics;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (ExecutionException | TimeoutException e) {<NEW_LINE>LOGGER.error("Failed to get topic names from broker", e);<NEW_LINE>} finally {<NEW_LINE>Thread.sleep(1_000);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | LOGGER.debug("Waiting for topic(s) to be created: " + missingTopics); |
897,049 | public okhttp3.Call readCSINodeCall(String name, String pretty, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/storage.k8s.io/v1/csinodes/{name}".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (pretty != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts <MASK><NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "BearerToken" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" }; |
1,077,775 | private List<ValidationEvent> validateStructureRef(Model model, ReferencesTrait.Reference reference, StructureShape shape, ReferencesTrait trait, ResourceShape target) {<NEW_LINE>List<ValidationEvent> events = new ArrayList<>();<NEW_LINE>Map<String, String> resolvedIds = resolveIds(reference, target);<NEW_LINE>boolean implicit = !resolvedIds.equals(reference.getIds());<NEW_LINE>// Only validate the "ids" keys against the "identifiers" names<NEW_LINE>// if it's an explicit reference.<NEW_LINE>if (!implicit) {<NEW_LINE>validateExplicitIds(reference, shape, trait, target, resolvedIds, events);<NEW_LINE>}<NEW_LINE>Map<String, ErrorReason> <MASK><NEW_LINE>for (String memberName : resolvedIds.values()) {<NEW_LINE>if (!shape.getMember(memberName).isPresent()) {<NEW_LINE>errors.put(memberName, ErrorReason.NOT_FOUND);<NEW_LINE>} else {<NEW_LINE>MemberShape structMember = shape.getMember(memberName).get();<NEW_LINE>if (!model.getShape(structMember.getTarget()).filter(Shape::isStringShape).isPresent()) {<NEW_LINE>errors.put(memberName, ErrorReason.BAD_TARGET);<NEW_LINE>} else if (!structMember.isRequired()) {<NEW_LINE>errors.put(memberName, ErrorReason.NOT_REQUIRED);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!errors.isEmpty()) {<NEW_LINE>validateErrors(shape, trait, reference, implicit, errors).ifPresent(events::add);<NEW_LINE>}<NEW_LINE>return events;<NEW_LINE>} | errors = new HashMap<>(); |
247,170 | final UpdateInfrastructureConfigurationResult executeUpdateInfrastructureConfiguration(UpdateInfrastructureConfigurationRequest updateInfrastructureConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateInfrastructureConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateInfrastructureConfigurationRequest> request = null;<NEW_LINE>Response<UpdateInfrastructureConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateInfrastructureConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateInfrastructureConfigurationRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "imagebuilder");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateInfrastructureConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateInfrastructureConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateInfrastructureConfigurationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
964,180 | private static String determineFileExt(DiskManagerFileInfo fileInfo) {<NEW_LINE>if (fileInfo instanceof FilesView.FilesViewTreeNode) {<NEW_LINE>if (!((FilesView.FilesViewTreeNode) fileInfo).isLeaf()) {<NEW_LINE>return ("");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String name = (fileInfo == null) ? "" : fileInfo.getFile(true).getName();<NEW_LINE>DownloadManager dm = fileInfo == null ? null : fileInfo.getDownloadManager();<NEW_LINE>String incomp_suffix = dm == null ? null : dm.getDownloadState(<MASK><NEW_LINE>if (incomp_suffix != null && name.endsWith(incomp_suffix)) {<NEW_LINE>name = name.substring(0, name.length() - incomp_suffix.length());<NEW_LINE>}<NEW_LINE>int dot_position = name.lastIndexOf(".");<NEW_LINE>if (dot_position == -1) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>return name.substring(dot_position + 1);<NEW_LINE>} | ).getAttribute(DownloadManagerState.AT_INCOMP_FILE_SUFFIX); |
710,260 | private void detectDeadlock() {<NEW_LINE>if (threadMXBean == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long[] tids = threadMXBean.findDeadlockedThreads();<NEW_LINE>if (tids == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Report deadlock just once<NEW_LINE>stop();<NEW_LINE>if (LOG.isLoggable(Level.FINE)) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.log(Level.FINE, "Deadlock detected");<NEW_LINE>}<NEW_LINE>PrintStream out;<NEW_LINE>File file = null;<NEW_LINE>try {<NEW_LINE>// NOI18N<NEW_LINE>file = File.createTempFile("deadlock", ".txt");<NEW_LINE>out = new PrintStream(new FileOutputStream(file));<NEW_LINE>if (LOG.isLoggable(Level.FINE)) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.log(Level.FINE, "Temporrary file created: {0}", file);<NEW_LINE>}<NEW_LINE>} catch (IOException iOException) {<NEW_LINE>out = System.out;<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>out.println("Deadlocked threads :");<NEW_LINE>ThreadInfo[] deadlocked = threadMXBean.getThreadInfo(tids, true, true);<NEW_LINE>for (ThreadInfo ti : deadlocked) {<NEW_LINE>printThreadInfo(ti, out);<NEW_LINE>printMonitorInfo(ti, out);<NEW_LINE>printLockInfo(ti.getLockedSynchronizers(), out);<NEW_LINE>out.println();<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>out.println("All threads :");<NEW_LINE>ThreadInfo[] infos = <MASK><NEW_LINE>for (ThreadInfo ti : infos) {<NEW_LINE>if (ti == null) {<NEW_LINE>// null can be returned in the array<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>printThreadInfo(ti, out);<NEW_LINE>printMonitorInfo(ti, out);<NEW_LINE>printLockInfo(ti.getLockedSynchronizers(), out);<NEW_LINE>out.println();<NEW_LINE>}<NEW_LINE>if (out != System.out) {<NEW_LINE>out.close();<NEW_LINE>}<NEW_LINE>reportStackTrace(deadlocked, file);<NEW_LINE>} | threadMXBean.dumpAllThreads(true, true); |
1,765,241 | private List<FailureAnalyzer> handleAwareAnalyzers(List<FailureAnalyzer> analyzers, ConfigurableApplicationContext context) {<NEW_LINE>List<FailureAnalyzer> awareAnalyzers = analyzers.stream().filter((analyzer) -> analyzer instanceof BeanFactoryAware || analyzer instanceof EnvironmentAware).collect(Collectors.toList());<NEW_LINE>if (!awareAnalyzers.isEmpty()) {<NEW_LINE>String awareAnalyzerNames = StringUtils.collectionToCommaDelimitedString(awareAnalyzers.stream().map((analyzer) -> analyzer.getClass().getName()).collect(Collectors.toList()));<NEW_LINE>logger.warn(LogMessage.format("FailureAnalyzers [%s] implement BeanFactoryAware or EnvironmentAware." + "Support for these interfaces on FailureAnalyzers is deprecated, " <MASK><NEW_LINE>if (context == null) {<NEW_LINE>logger.trace(LogMessage.format("Skipping [%s] due to missing context", awareAnalyzerNames));<NEW_LINE>return analyzers.stream().filter((analyzer) -> !awareAnalyzers.contains(analyzer)).collect(Collectors.toList());<NEW_LINE>}<NEW_LINE>awareAnalyzers.forEach((analyzer) -> {<NEW_LINE>if (analyzer instanceof BeanFactoryAware) {<NEW_LINE>((BeanFactoryAware) analyzer).setBeanFactory(context.getBeanFactory());<NEW_LINE>}<NEW_LINE>if (analyzer instanceof EnvironmentAware) {<NEW_LINE>((EnvironmentAware) analyzer).setEnvironment(context.getEnvironment());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return analyzers;<NEW_LINE>} | + "and will be removed in a future release." + "Instead provide a constructor that accepts BeanFactory or Environment parameters.", awareAnalyzerNames)); |
1,533,526 | protected void consumePackageDeclarationNameWithModifiers() {<NEW_LINE>// PackageDeclarationName ::= Modifiers 'package' PushRealModifiers Name RejectTypeAnnotations<NEW_LINE>ImportReference impt;<NEW_LINE>int length;<NEW_LINE>char[][] tokens = new char[length = this.identifierLengthStack[this.identifierLengthPtr--]][];<NEW_LINE>this.identifierPtr -= length;<NEW_LINE>long[] positions = new long[length];<NEW_LINE>System.arraycopy(this.identifierStack, ++this.identifierPtr, tokens, 0, length);<NEW_LINE>System.arraycopy(this.identifierPositionStack, this.identifierPtr--, positions, 0, length);<NEW_LINE>int packageModifiersSourceStart = this.intStack[this.intPtr--];<NEW_LINE>// Unless there were any<NEW_LINE>int packageModifiersSourceEnd = packageModifiersSourceStart;<NEW_LINE>int packageModifiers = this.intStack[this.intPtr--];<NEW_LINE>impt = new ImportReference(tokens, positions, false, packageModifiers);<NEW_LINE>this.compilationUnit.currentPackage = impt;<NEW_LINE>// consume annotations<NEW_LINE>if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {<NEW_LINE>System.arraycopy(this.expressionStack, (this.expressionPtr -= length) + 1, impt.annotations = new Annotation[length], 0, length);<NEW_LINE>impt.declarationSourceStart = packageModifiersSourceStart;<NEW_LINE>// we don't need the position of the 'package keyword<NEW_LINE>packageModifiersSourceEnd = this.intStack[this.intPtr--] - 2;<NEW_LINE>} else {<NEW_LINE>impt.declarationSourceStart = this<MASK><NEW_LINE>packageModifiersSourceEnd = impt.declarationSourceStart - 2;<NEW_LINE>// get possible comment source start<NEW_LINE>if (this.javadoc != null) {<NEW_LINE>impt.declarationSourceStart = this.javadoc.sourceStart;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (packageModifiers != 0) {<NEW_LINE>problemReporter().illegalModifiers(packageModifiersSourceStart, packageModifiersSourceEnd);<NEW_LINE>}<NEW_LINE>if (this.currentToken == TokenNameSEMICOLON) {<NEW_LINE>impt.declarationSourceEnd = this.scanner.currentPosition - 1;<NEW_LINE>} else {<NEW_LINE>impt.declarationSourceEnd = impt.sourceEnd;<NEW_LINE>}<NEW_LINE>impt.declarationEnd = impt.declarationSourceEnd;<NEW_LINE>// recovery<NEW_LINE>if (this.currentElement != null) {<NEW_LINE>this.lastCheckPoint = impt.declarationSourceEnd + 1;<NEW_LINE>// used to avoid branching back into the regular automaton<NEW_LINE>this.restartRecovery = true;<NEW_LINE>}<NEW_LINE>} | .intStack[this.intPtr--]; |
1,588,722 | public Object read(String typeID, Properties properties) {<NEW_LINE>JspLineBreakpoint b = null;<NEW_LINE>if (typeID.equals(JspLineBreakpoint.class.getName())) {<NEW_LINE>String url = properties.getString(JspLineBreakpoint.PROP_URL, null);<NEW_LINE>// #110349 - ignore loading of breakpoints which do not have URL<NEW_LINE>if (url == null || url.trim().length() == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>b = JspLineBreakpoint.create(url, properties.getInt(JspLineBreakpoint.PROP_LINE_NUMBER, 1));<NEW_LINE>b.setCondition(properties.getString(JspLineBreakpoint.PROP_CONDITION, ""));<NEW_LINE>b.setPrintText(properties.getString<MASK><NEW_LINE>b.setGroupName(properties.getString(Breakpoint.PROP_GROUP_NAME, ""));<NEW_LINE>b.setSuspend(properties.getInt(JspLineBreakpoint.PROP_SUSPEND, JspLineBreakpoint.SUSPEND_ALL));<NEW_LINE>if (properties.getBoolean(JspLineBreakpoint.PROP_ENABLED, true)) {<NEW_LINE>b.enable();<NEW_LINE>} else {<NEW_LINE>b.disable();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return b;<NEW_LINE>} | (JspLineBreakpoint.PROP_PRINT_TEXT, "")); |
453,317 | public PhysicalOperation visitSort(SortNode node, LocalExecutionPlanContext context) {<NEW_LINE>PhysicalOperation source = node.getSource().accept(this, context);<NEW_LINE>List<VariableReferenceExpression> orderByVariables = node<MASK><NEW_LINE>List<Integer> orderByChannels = getChannelsForVariables(orderByVariables, source.getLayout());<NEW_LINE>ImmutableList.Builder<SortOrder> sortOrder = ImmutableList.builder();<NEW_LINE>for (VariableReferenceExpression variable : orderByVariables) {<NEW_LINE>sortOrder.add(node.getOrderingScheme().getOrdering(variable));<NEW_LINE>}<NEW_LINE>ImmutableList.Builder<Integer> outputChannels = ImmutableList.builder();<NEW_LINE>for (int i = 0; i < source.getTypes().size(); i++) {<NEW_LINE>outputChannels.add(i);<NEW_LINE>}<NEW_LINE>boolean spillEnabled = isOrderBySpillEnabled(context.getSession());<NEW_LINE>OperatorFactory operator = new OrderByOperatorFactory(context.getNextOperatorId(), node.getId(), source.getTypes(), outputChannels.build(), 10_000, orderByChannels, sortOrder.build(), pagesIndexFactory, spillEnabled, Optional.of(spillerFactory), orderingCompiler);<NEW_LINE>return new PhysicalOperation(operator, source.getLayout(), context, source);<NEW_LINE>} | .getOrderingScheme().getOrderByVariables(); |
1,558,341 | private void initNamesView(final View view) {<NEW_LINE>mNamesCaption = (TextView) view.findViewById(R.id.show_additional_names);<NEW_LINE>mNamesCaption.setOnClickListener(this);<NEW_LINE>mAddLanguage = (TextView) view.findViewById(R.id.add_langs);<NEW_LINE>mAddLanguage.setOnClickListener(this);<NEW_LINE>mMoreLanguages = (TextView) view.findViewById(R.id.more_names);<NEW_LINE>mMoreLanguages.setOnClickListener(this);<NEW_LINE>mNamesView = (RecyclerView) view.findViewById(R.id.recycler);<NEW_LINE>mNamesView.setNestedScrollingEnabled(false);<NEW_LINE>mNamesView.setLayoutManager(new LinearLayoutManager(getActivity()));<NEW_LINE>mNamesAdapter = new MultilanguageAdapter(mParent);<NEW_LINE>mNamesView.setAdapter(mNamesAdapter);<NEW_LINE>mNamesAdapter.registerAdapterDataObserver(mNamesObserver);<NEW_LINE>final Bundle args = getArguments();<NEW_LINE>if (args == null || !args.containsKey(LAST_INDEX_OF_NAMES_ARRAY)) {<NEW_LINE>showAdditionalNames(false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>showAdditionalNames(true);<NEW_LINE>UiUtils.waitLayout(mNamesView, new ViewTreeObserver.OnGlobalLayoutListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onGlobalLayout() {<NEW_LINE>LinearLayoutManager lm = (LinearLayoutManager) mNamesView.getLayoutManager();<NEW_LINE>int position = args.getInt(LAST_INDEX_OF_NAMES_ARRAY);<NEW_LINE>View nameItem = lm.findViewByPosition(position);<NEW_LINE><MASK><NEW_LINE>int nameItemTop = nameItem.getTop();<NEW_LINE>view.scrollTo(0, cvNameTop + nameItemTop);<NEW_LINE>// TODO(mgsergio): Uncomment if focus and keyboard are required.<NEW_LINE>// TODO(mgsergio): Keyboard doesn't want to hide. Only pressing back button works.<NEW_LINE>// View nameItemInput = nameItem.findViewById(R.id.input);<NEW_LINE>// nameItemInput.requestFocus();<NEW_LINE>// InputUtils.showKeyboard(nameItemInput);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | int cvNameTop = mCardName.getTop(); |
705,959 | public void run() {<NEW_LINE>final Set<File> result = new HashSet<File>();<NEW_LINE>// Search in the source groups of the projects.<NEW_LINE>for (SourceGroup group : ProjectUtils.getSources(project).getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA)) {<NEW_LINE>for (FileObject fo : NbCollections.iterable(group.getRootFolder().getChildren(true))) {<NEW_LINE>if (Thread.currentThread().isInterrupted()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!SpringConstants.CONFIG_MIME_TYPE.equals(fo.getMIMEType())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>File file = FileUtil.toFile(fo);<NEW_LINE>if (file == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>result.add(file);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Search any providers of Spring config files registered in the project lookup.<NEW_LINE>for (SpringConfigFileProvider provider : project.getLookup().lookupAll(SpringConfigFileProvider.class)) {<NEW_LINE>if (Thread.currentThread().isInterrupted()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>result.addAll(provider.getConfigFiles());<NEW_LINE>}<NEW_LINE>final List<File> sorted = new ArrayList<File<MASK><NEW_LINE>sorted.addAll(result);<NEW_LINE>Collections.sort(sorted);<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>updateAvailableFiles(sorted);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | >(result.size()); |
1,635,217 | private BaseBottomSheetItem createBottomSheetItem() {<NEW_LINE>View rootView = UiUtilities.getInflater(getContext(), nightMode).inflate(R.layout.bottom_sheet_announcement_time, null);<NEW_LINE>tvSeekBarLabel = rootView.findViewById(R.id.tv_seek_bar_label);<NEW_LINE>slider = rootView.findViewById(R.id.arrival_slider);<NEW_LINE>ivArrow = rootView.findViewById(R.id.iv_arrow);<NEW_LINE>tvIntervalsDescr = rootView.findViewById(R.id.tv_interval_descr);<NEW_LINE>int appModeColor = getAppMode().getProfileColor(nightMode);<NEW_LINE>slider.setValue(selectedEntryIndex);<NEW_LINE>slider.setValueFrom(0);<NEW_LINE>slider.setValueTo(listPreference.getEntries().length - 1);<NEW_LINE>slider.setStepSize(1);<NEW_LINE>slider.addOnChangeListener(new OnChangeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onValueChange(@NonNull Slider slider, float value, boolean fromUser) {<NEW_LINE>int intValue = (int) value;<NEW_LINE>if (intValue != selectedEntryIndex) {<NEW_LINE>selectedEntryIndex = intValue;<NEW_LINE>updateViews();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>UiUtilities.setupSlider(slider, nightMode, appModeColor, true);<NEW_LINE>rootView.findViewById(R.id.description_container).setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>toggleDescriptionVisibility();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return new Builder().<MASK><NEW_LINE>} | setCustomView(rootView).create(); |
554,515 | public boolean copy() {<NEW_LINE>System.out.println(<MASK><NEW_LINE>if (sourcePath.isDirectory()) {<NEW_LINE>computeBuildFiles();<NEW_LINE>copyFileCount = 0;<NEW_LINE>String[] copyFiles = copyFilesBySourceDir.get(sourcePath);<NEW_LINE>for (String copyFile : copyFiles) {<NEW_LINE>File sourceFile = new File(sourcePath, copyFile);<NEW_LINE>File outputFile = new File(outputDir, copyFile);<NEW_LINE>// Exclude CVS files so the generated project does not display as shared in a repository<NEW_LINE>if (outputFile.getParentFile().getName().indexOf("CVS") > -1) {<NEW_LINE>outputFile.delete();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>copyFile(sourceFile, outputFile);<NEW_LINE>copyFileCount++;<NEW_LINE>} catch (IOException e) {<NEW_LINE>System.out.println("IOException occured in file " + sourceFile.getAbsolutePath() + ", copy failed.");<NEW_LINE>e.printStackTrace();<NEW_LINE>return false;<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.out.println("Exception occured in file " + sourceFile.getAbsolutePath() + ", copy failed.");<NEW_LINE>e.printStackTrace();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>File sourceFile = sourcePath;<NEW_LINE>File outputFile = null;<NEW_LINE>if (simpleOutput.startsWith(File.separator) || simpleOutput.startsWith(":", 1)) {<NEW_LINE>outputFile = new File(simpleOutput, sourcePath.getName());<NEW_LINE>} else if (!simpleOutput.equals("")) {<NEW_LINE>outputFile = new File(new File(outputDir, simpleOutput), sourcePath.getName());<NEW_LINE>} else {<NEW_LINE>String parent = sourcePath.getParent();<NEW_LINE>parent = parent.substring(baseDir.length());<NEW_LINE>StringBuffer strBuffer = new StringBuffer(outputDir.getAbsolutePath());<NEW_LINE>StringTokenizer st = new StringTokenizer(parent, File.separator);<NEW_LINE>if (st.countTokens() > 2) {<NEW_LINE>st.nextToken();<NEW_LINE>String token = st.nextToken();<NEW_LINE>if (!token.equals("src")) {<NEW_LINE>strBuffer.append(File.separator);<NEW_LINE>strBuffer.append(token);<NEW_LINE>}<NEW_LINE>while (st.hasMoreTokens()) {<NEW_LINE>strBuffer.append(File.separator);<NEW_LINE>strBuffer.append(st.nextToken());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>strBuffer.append(File.separator);<NEW_LINE>strBuffer.append(sourcePath.getName());<NEW_LINE>outputFile = new File(strBuffer.toString());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>copyFile(sourceFile, outputFile);<NEW_LINE>copyFileCount++;<NEW_LINE>} catch (IOException e) {<NEW_LINE>System.out.println("IOException occured in file " + sourceFile.getAbsolutePath() + ", copy failed.");<NEW_LINE>e.printStackTrace();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println(copyFileCount + " file(s) copied.\n");<NEW_LINE>return true;<NEW_LINE>} | "\nCopying from " + sourcePath.getAbsolutePath()); |
792,991 | private boolean startNewVM(long vmId) {<NEW_LINE>try {<NEW_LINE>CallContext.current(<MASK><NEW_LINE>_userVmManager.startVirtualMachine(vmId, null, null, null);<NEW_LINE>} catch (final ResourceUnavailableException ex) {<NEW_LINE>s_logger.warn("Exception: ", ex);<NEW_LINE>throw new ServerApiException(ApiErrorCode.RESOURCE_UNAVAILABLE_ERROR, ex.getMessage());<NEW_LINE>} catch (ResourceAllocationException ex) {<NEW_LINE>s_logger.warn("Exception: ", ex);<NEW_LINE>throw new ServerApiException(ApiErrorCode.RESOURCE_ALLOCATION_ERROR, ex.getMessage());<NEW_LINE>} catch (ConcurrentOperationException ex) {<NEW_LINE>s_logger.warn("Exception: ", ex);<NEW_LINE>throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, ex.getMessage());<NEW_LINE>} catch (InsufficientCapacityException ex) {<NEW_LINE>StringBuilder message = new StringBuilder(ex.getMessage());<NEW_LINE>if (ex instanceof InsufficientServerCapacityException) {<NEW_LINE>if (((InsufficientServerCapacityException) ex).isAffinityApplied()) {<NEW_LINE>message.append(", Please check the affinity groups provided, there may not be sufficient capacity to follow them");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>s_logger.info(ex);<NEW_LINE>s_logger.info(message.toString(), ex);<NEW_LINE>throw new ServerApiException(ApiErrorCode.INSUFFICIENT_CAPACITY_ERROR, message.toString());<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | ).setEventDetails("Vm Id: " + vmId); |
1,262,384 | protected void ensureJasperDesign(JasperDesignReportResource resource) {<NEW_LINE>JasperDesign jasperDesign = resource.getJasperDesign();<NEW_LINE>JasperReport jasperReport = resource.getReport();<NEW_LINE>if (jasperDesign == null) {<NEW_LINE>if (jasperReport == null) {<NEW_LINE>throw new JRRuntimeException(EXCEPTION_MESSAGE_KEY_INVALID_ENTRY, <MASK><NEW_LINE>} else {<NEW_LINE>ByteArrayInputStream bais = null;<NEW_LINE>ByteArrayOutputStream baos = new ByteArrayOutputStream();<NEW_LINE>try {<NEW_LINE>new JRXmlWriter(jasperReportsContext).write(jasperReport, baos, "UTF-8");<NEW_LINE>bais = new ByteArrayInputStream(baos.toByteArray());<NEW_LINE>jasperDesign = JRXmlLoader.load(bais);<NEW_LINE>resource.setJasperDesign(jasperDesign);<NEW_LINE>} catch (JRException e) {<NEW_LINE>throw new JRRuntimeException(e);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>baos.close();<NEW_LINE>if (bais != null) {<NEW_LINE>bais.close();<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | new Object[] { "JasperDesignCache" }); |
1,121,933 | public static File createTempFile(String suffix, String path) {<NEW_LINE>String temp1 = "sikuli-";<NEW_LINE>String temp2 = "." + suffix;<NEW_LINE>File fpath = new File(RunTime.get().fpBaseTempPath);<NEW_LINE>if (path != null) {<NEW_LINE>fpath = new File(path);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>fpath.mkdirs();<NEW_LINE>File temp = File.createTempFile(temp1, temp2, fpath);<NEW_LINE>temp.deleteOnExit();<NEW_LINE>String fpTemp = temp.getAbsolutePath();<NEW_LINE>if (!fpTemp.endsWith(".script")) {<NEW_LINE>log(lvl, <MASK><NEW_LINE>}<NEW_LINE>return temp;<NEW_LINE>} catch (IOException ex) {<NEW_LINE>log(-1, "createTempFile: IOException: %s\n%s", ex.getMessage(), fpath + File.separator + temp1 + "12....56" + temp2);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | "tempfile create:\n%s", temp.getAbsolutePath()); |
1,778,538 | private boolean initializeDatasourceXml(String dbaddress, String dbport, String dbuser, String dbpassword, String dbcatalog) throws Exception {<NEW_LINE>boolean result = false;<NEW_LINE>try {<NEW_LINE>String connectionUrl = String.format(jdbcUrlTemplate, dbaddress, dbport, dbcatalog);<NEW_LINE>Document document = DocumentHelper.createDocument();<NEW_LINE>Element root = document.addElement("Datasources");<NEW_LINE>root.addElement("Datasource").addAttribute(DATASOURCE_NAME, LOGIC_DBNAME).addAttribute(DATASOURCE_USERNAME, dbuser).addAttribute(DATASOURCE_PASSWORD, dbpassword).addAttribute(DATASOURCE_CONNECTION_URL, connectionUrl).addAttribute(DATASOURCE_DRIVER_CLASS, DATASOURCE_MYSQL_DRIVER);<NEW_LINE>URL url = classLoader.getResource(WEB_XML);<NEW_LINE>String path = url.getPath().replace(WEB_XML, DATASOURCE_XML);<NEW_LINE>try (FileWriter fileWriter = new FileWriter(path)) {<NEW_LINE><MASK><NEW_LINE>writer.write(document);<NEW_LINE>writer.close();<NEW_LINE>}<NEW_LINE>DalClientFactory.getClient(LOGIC_DBNAME);<NEW_LINE>result = true;<NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | XMLWriter writer = new XMLWriter(fileWriter); |
1,809,710 | public void exitS_route(S_routeContext ctx) {<NEW_LINE>String nextHopInterface = ctx.iface.getText();<NEW_LINE>Prefix prefix = Prefix.create(toIp(ctx.destination), toIp(ctx.mask));<NEW_LINE>NextHop nextHop;<NEW_LINE>if (nextHopInterface.equalsIgnoreCase("null0")) {<NEW_LINE>if (ctx.gateway != null) {<NEW_LINE>warn(ctx, "Cannot assign gateway to static null route");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>nextHop = NextHopDiscard.instance();<NEW_LINE>} else {<NEW_LINE>if (ctx.gateway == null) {<NEW_LINE>warn(ctx, "Must supply gateway to static interface route");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Ip <MASK><NEW_LINE>if (nextHopIp.equals(Ip.ZERO)) {<NEW_LINE>// https://github.com/batfish/batfish/issues/8134: ASA uses this for dynamic<NEW_LINE>nextHop = NextHopInterface.of(nextHopInterface);<NEW_LINE>} else {<NEW_LINE>nextHop = NextHopInterface.of(nextHopInterface, nextHopIp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int distance = DEFAULT_STATIC_ROUTE_DISTANCE;<NEW_LINE>if (ctx.distance != null) {<NEW_LINE>Optional<Integer> maybeDistance = toInteger(ctx, ctx.distance);<NEW_LINE>if (!maybeDistance.isPresent()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>distance = maybeDistance.get();<NEW_LINE>}<NEW_LINE>Integer track = null;<NEW_LINE>if (ctx.track != null) {<NEW_LINE>track = toInteger(ctx.track);<NEW_LINE>}<NEW_LINE>if (ctx.TUNNELED() != null) {<NEW_LINE>warn(ctx, "Interface default tunnel gateway option not yet supported.");<NEW_LINE>}<NEW_LINE>StaticRoute route = new StaticRoute(prefix, nextHop, distance, track);<NEW_LINE>currentVrf().getStaticRoutes().add(route);<NEW_LINE>} | nextHopIp = toIp(ctx.gateway); |
1,640,441 | public void visit(BLangErrorVariable varNode) {<NEW_LINE>// Create error destruct block stmt.<NEW_LINE>final BLangBlockStmt blockStmt = ASTBuilderUtil.createBlockStmt(varNode.pos);<NEW_LINE>BType errorType = varNode.getBType() == null ? symTable.errorType : varNode.getBType();<NEW_LINE>// Create a simple var for the error 'error x = ($error$)'.<NEW_LINE>String name = anonModelHelper.getNextErrorVarKey(env.enclPkg.packageID);<NEW_LINE>BVarSymbol errorVarSymbol = new BVarSymbol(0, names.fromString(name), this.env.scope.owner.pkgID, errorType, this.env.scope.owner, varNode.pos, VIRTUAL);<NEW_LINE>final BLangSimpleVariable error = ASTBuilderUtil.createVariable(varNode.pos, name, errorType, null, errorVarSymbol);<NEW_LINE>error.expr = varNode.expr;<NEW_LINE>final BLangSimpleVariableDef variableDef = ASTBuilderUtil.<MASK><NEW_LINE>variableDef.var = error;<NEW_LINE>// Create the variable definition statements using the root block stmt created.<NEW_LINE>createVarDefStmts(varNode, blockStmt, error.symbol, null);<NEW_LINE>// Finally rewrite the populated block statement.<NEW_LINE>result = rewrite(blockStmt, env);<NEW_LINE>} | createVariableDefStmt(varNode.pos, blockStmt); |
1,279,237 | final ListOrdersResult executeListOrders(ListOrdersRequest listOrdersRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listOrdersRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListOrdersRequest> request = null;<NEW_LINE>Response<ListOrdersResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListOrdersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listOrdersRequest));<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, "ListOrders");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListOrdersResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListOrdersResultJsonUnmarshaller());<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, "Outposts"); |
1,016,096 | static Stream<RetrieveResult> retrieve(Kernel kernel) throws TransactionFailureException {<NEW_LINE>try (KernelTransaction tx = kernel.beginTransaction(KernelTransaction.Type.EXPLICIT, LoginContext.AUTH_DISABLED)) {<NEW_LINE>TokenRead tokens = tx.tokenRead();<NEW_LINE>List<String> labels = new ArrayList<>(tokens.labelCount());<NEW_LINE>tokens.labelsGetAllTokens().forEachRemaining(t -> labels.add(t.name()));<NEW_LINE>List<String> relationshipTypes = new ArrayList<>(tokens.relationshipTypeCount());<NEW_LINE>tokens.relationshipTypesGetAllTokens().forEachRemaining(t -> relationshipTypes.add(t.name()));<NEW_LINE>List<String> propertyKeys = new ArrayList<>(tokens.propertyKeyCount());<NEW_LINE>tokens.propertyKeyGetAllTokens().forEachRemaining(t -> propertyKeys.add(t.name()));<NEW_LINE>Map<String, Object> data = new HashMap<>();<NEW_LINE>data.put("labels", labels);<NEW_LINE><MASK><NEW_LINE>data.put("propertyKeys", propertyKeys);<NEW_LINE>return Stream.of(new RetrieveResult(Sections.TOKENS, data));<NEW_LINE>}<NEW_LINE>} | data.put("relationshipTypes", relationshipTypes); |
1,636,253 | public void reduce(final IntWritable key, final Iterator<Text> values, final OutputCollector<IntWritable, Text> output, final Reporter reporter) throws IOException {<NEW_LINE>double[] v1 = null, v2 = null;<NEW_LINE>double[] result = new double[block_width];<NEW_LINE>int input_index = 0;<NEW_LINE>while (values.hasNext()) {<NEW_LINE>String cur_value_str = values<MASK><NEW_LINE>if (input_index == 0) {<NEW_LINE>v1 = MatvecUtils.decodeBlockVector(cur_value_str, block_width);<NEW_LINE>input_index++;<NEW_LINE>} else<NEW_LINE>v2 = MatvecUtils.decodeBlockVector(cur_value_str, block_width);<NEW_LINE>}<NEW_LINE>int i;<NEW_LINE>if (v1 != null && v2 != null) {<NEW_LINE>for (i = 0; i < block_width; i++) result[i] = v1[i] + v2[i];<NEW_LINE>} else if (v1 != null && v2 == null) {<NEW_LINE>for (i = 0; i < block_width; i++) result[i] = v1[i];<NEW_LINE>} else if (v1 == null && v2 != null) {<NEW_LINE>for (i = 0; i < block_width; i++) result[i] = v2[i];<NEW_LINE>} else {<NEW_LINE>for (i = 0; i < block_width; i++) result[i] = 0;<NEW_LINE>}<NEW_LINE>String new_val_str = MatvecUtils.encodeBlockVector(result, block_width);<NEW_LINE>if (new_val_str.length() > 0)<NEW_LINE>output.collect(key, new Text(new_val_str));<NEW_LINE>} | .next().toString(); |
664,882 | final GlobalReplicationGroup executeDisassociateGlobalReplicationGroup(DisassociateGlobalReplicationGroupRequest disassociateGlobalReplicationGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disassociateGlobalReplicationGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DisassociateGlobalReplicationGroupRequest> request = null;<NEW_LINE>Response<GlobalReplicationGroup> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DisassociateGlobalReplicationGroupRequestMarshaller().marshall(super.beforeMarshalling(disassociateGlobalReplicationGroupRequest));<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, "ElastiCache");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateGlobalReplicationGroup");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GlobalReplicationGroup> responseHandler = new StaxResponseHandler<GlobalReplicationGroup>(new GlobalReplicationGroupStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
764,457 | public static String toHexString(UUID uuid) {<NEW_LINE>if (uuid == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>byte[] buf = Types.UUIDtoBytes(uuid);<NEW_LINE>if (buf == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int len = buf.length;<NEW_LINE>if (len == 0) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>short bt;<NEW_LINE>char high, low;<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>bt = (short) (buf[i] & 0xFF);<NEW_LINE>high = (char) (bt >>> 4);<NEW_LINE>low = (char) (bt & 0x0F);<NEW_LINE>char h, l;<NEW_LINE>h = byteToChar(high);<NEW_LINE>l = byteToChar(low);<NEW_LINE>sb.append(byteToChar(high));<NEW_LINE>sb<MASK><NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>} | .append(byteToChar(low)); |
677,061 | private List<? super PsiElement> processAnnotation(@NotNull PsiClass psiParentClass, @NotNull PsiAnnotation psiAnnotation, @NotNull PsiClass psiClass, @Nullable String nameHint) {<NEW_LINE>SuperBuilderHandler builderHandler = getBuilderHandler();<NEW_LINE>// use parent class as source!<NEW_LINE>final String builderBaseClassName = builderHandler.getBuilderClassName(psiParentClass);<NEW_LINE>List<? super PsiElement> result = new ArrayList<>();<NEW_LINE>// apply only to inner BuilderClass<NEW_LINE>final String psiClassName = psiClass.getName();<NEW_LINE>if (builderBaseClassName.equals(psiClassName) && possibleToGenerateElementNamed(nameHint, psiClass, psiAnnotation)) {<NEW_LINE>result.addAll(generatePsiElementsOfBaseBuilderClass(psiParentClass, psiAnnotation, psiClass));<NEW_LINE>} else {<NEW_LINE>// use parent class as source!<NEW_LINE>final String <MASK><NEW_LINE>if (builderImplClassName.equals(psiClassName) && possibleToGenerateElementNamed(nameHint, psiClass, psiAnnotation)) {<NEW_LINE>result.addAll(generatePsiElementsOfImplBuilderClass(psiParentClass, psiAnnotation, psiClass));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | builderImplClassName = builderHandler.getBuilderImplClassName(psiParentClass); |
29,180 | private void expandTypeVar(NotificationAttrNode node, ArgType type, Collection<ArgType> typeVars) {<NEW_LINE>if (typeVars.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean allExtendsEmpty = true;<NEW_LINE>for (ArgType argType : typeVars) {<NEW_LINE>if (notEmpty(argType.getExtendTypes())) {<NEW_LINE>allExtendsEmpty = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (allExtendsEmpty) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>type.visitTypes(t -> {<NEW_LINE>if (t.isGenericType()) {<NEW_LINE>String typeVarName = t.getObject();<NEW_LINE>for (ArgType typeVar : typeVars) {<NEW_LINE>if (typeVar.getObject().equals(typeVarName)) {<NEW_LINE>t.<MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>node.addWarnComment("Unknown type variable: " + typeVarName + " in type: " + type);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>} | setExtendTypes(typeVar.getExtendTypes()); |
1,399,427 | private MultiMap<String, String> paramMap(ServerWebSocket vertxServerWebSocket) {<NEW_LINE><MASK><NEW_LINE>MultiMap<String, String> paramMap = MultiMap.empty();<NEW_LINE>if (!Str.isEmpty(query)) {<NEW_LINE>final String[] params = StringScanner.split(query, '&');<NEW_LINE>if (params.length > 0) {<NEW_LINE>paramMap = new MultiMapImpl<>();<NEW_LINE>for (String param : params) {<NEW_LINE>final String[] keyValue = StringScanner.split(param, '=');<NEW_LINE>if (keyValue.length == 2) {<NEW_LINE>String key = keyValue[0];<NEW_LINE>String value = keyValue[1];<NEW_LINE>try {<NEW_LINE>key = URLDecoder.decode(key, "UTF-8");<NEW_LINE>value = URLDecoder.decode(value, "UTF-8");<NEW_LINE>paramMap.add(key, value);<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>logger.warn(sputs("Unable to url decode key or value in param", key, value), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return paramMap;<NEW_LINE>} | String query = vertxServerWebSocket.query(); |
971,294 | private void docTypeBuildAnnotationType(AnnotationType annotation, DocumentmanagerConfig.Doctype.Builder builder, IdxMap indexMap) {<NEW_LINE>if (indexMap.isDone(annotation)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>indexMap.setDone(annotation);<NEW_LINE>var annBuilder = new DocumentmanagerConfig.Doctype.Annotationtype.Builder();<NEW_LINE>annBuilder.idx(indexMap.idxOf(annotation)).name(annotation.getName()).<MASK><NEW_LINE>DataType nested = annotation.getDataType();<NEW_LINE>if (nested != null) {<NEW_LINE>annBuilder.datatype(indexMap.idxOf(nested));<NEW_LINE>docTypeBuildAnyType(nested, builder, indexMap);<NEW_LINE>}<NEW_LINE>for (AnnotationType inherited : annotation.getInheritedTypes()) {<NEW_LINE>annBuilder.inherits(inhBuilder -> inhBuilder.idx(indexMap.idxOf(inherited)));<NEW_LINE>}<NEW_LINE>builder.annotationtype(annBuilder);<NEW_LINE>} | internalid(annotation.getId()); |
1,517,773 | final UpdateSecurityGroupRuleDescriptionsIngressResult executeUpdateSecurityGroupRuleDescriptionsIngress(UpdateSecurityGroupRuleDescriptionsIngressRequest updateSecurityGroupRuleDescriptionsIngressRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateSecurityGroupRuleDescriptionsIngressRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateSecurityGroupRuleDescriptionsIngressRequest> request = null;<NEW_LINE>Response<UpdateSecurityGroupRuleDescriptionsIngressResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateSecurityGroupRuleDescriptionsIngressRequestMarshaller().marshall(super.beforeMarshalling(updateSecurityGroupRuleDescriptionsIngressRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateSecurityGroupRuleDescriptionsIngress");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<UpdateSecurityGroupRuleDescriptionsIngressResult> responseHandler = new StaxResponseHandler<UpdateSecurityGroupRuleDescriptionsIngressResult>(new UpdateSecurityGroupRuleDescriptionsIngressResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
585,685 | protected void onInitialized() {<NEW_LINE>if (!tradeModel.isCompleted()) {<NEW_LINE>protocolModel.getP2PService().addDecryptedDirectMessageListener(this);<NEW_LINE>}<NEW_LINE>MailboxMessageService mailboxMessageService = protocolModel.getP2PService().getMailboxMessageService();<NEW_LINE>// We delay a bit here as the tradeModel gets updated from the wallet to update the tradeModel<NEW_LINE>// state (deposit confirmed) and that happens after our method is called.<NEW_LINE>// TODO To fix that in a better way we would need to change the order of some routines<NEW_LINE>// from the TradeManager, but as we are close to a release I dont want to risk a bigger<NEW_LINE>// change and leave that for a later PR<NEW_LINE>UserThread.runAfter(() -> {<NEW_LINE>mailboxMessageService.addDecryptedMailboxListener(this);<NEW_LINE><MASK><NEW_LINE>}, 100, TimeUnit.MILLISECONDS);<NEW_LINE>} | handleMailboxCollection(mailboxMessageService.getMyDecryptedMailboxMessages()); |
1,783,885 | public AutoCloseable start() throws IOException, InterruptedException {<NEW_LINE>File bootstrapScript = File.createTempFile("bootstrap_beam_venv", ".py");<NEW_LINE>bootstrapScript.deleteOnExit();<NEW_LINE>try (FileOutputStream fout = new FileOutputStream(bootstrapScript.getAbsolutePath())) {<NEW_LINE>ByteStreams.copy(getClass().getResourceAsStream("bootstrap_beam_venv.py"), fout);<NEW_LINE>}<NEW_LINE>List<String> bootstrapCommand = ImmutableList.of("python", bootstrapScript.getAbsolutePath());<NEW_LINE>LOG.info("Running bootstrap command " + bootstrapCommand);<NEW_LINE>Process bootstrap = new ProcessBuilder("python", bootstrapScript.getAbsolutePath()).redirectError(ProcessBuilder.Redirect.INHERIT).start();<NEW_LINE>bootstrap.getOutputStream().close();<NEW_LINE>BufferedReader reader = new BufferedReader(new InputStreamReader(bootstrap.getInputStream(), Charsets.UTF_8));<NEW_LINE>String lastLine = reader.readLine();<NEW_LINE>String lastNonEmptyLine = lastLine;<NEW_LINE>while (lastLine != null) {<NEW_LINE>LOG.info(lastLine);<NEW_LINE>if (lastLine.length() > 0) {<NEW_LINE>lastNonEmptyLine = lastLine;<NEW_LINE>}<NEW_LINE>lastLine = reader.readLine();<NEW_LINE>}<NEW_LINE>// Make SpotBugs happy.<NEW_LINE>reader.close();<NEW_LINE>int result = bootstrap.waitFor();<NEW_LINE>if (result != 0) {<NEW_LINE>throw new RuntimeException("Python boostrap failed with error " + result + ", " + lastNonEmptyLine);<NEW_LINE>}<NEW_LINE>String pythonExecutable = lastNonEmptyLine;<NEW_LINE>List<String> command = new ArrayList<>();<NEW_LINE>command.add(pythonExecutable);<NEW_LINE>command.add("-m");<NEW_LINE>command.add(module);<NEW_LINE>command.addAll(args);<NEW_LINE><MASK><NEW_LINE>Process p = new ProcessBuilder(command).redirectError(ProcessBuilder.Redirect.INHERIT).redirectOutput(ProcessBuilder.Redirect.INHERIT).start();<NEW_LINE>return p::destroy;<NEW_LINE>} | LOG.info("Starting python service with arguments " + command); |
1,060,822 | public void onRun() throws Exception {<NEW_LINE>if (!SignalStore.account().isFcmEnabled())<NEW_LINE>return;<NEW_LINE>Log.i(TAG, "Reregistering FCM...");<NEW_LINE>int result = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context);<NEW_LINE>if (result != ConnectionResult.SUCCESS) {<NEW_LINE>notifyFcmFailure();<NEW_LINE>} else {<NEW_LINE>Optional<String> token = FcmUtil.getToken();<NEW_LINE>if (token.isPresent()) {<NEW_LINE>String oldToken = SignalStore.account().getFcmToken();<NEW_LINE>if (!token.get().equals(oldToken)) {<NEW_LINE>int oldLength = oldToken != null ? oldToken.length() : -1;<NEW_LINE>Log.i(TAG, "Token changed. oldLength: " + oldLength + " newLength: " + token.<MASK><NEW_LINE>} else {<NEW_LINE>Log.i(TAG, "Token didn't change.");<NEW_LINE>}<NEW_LINE>ApplicationDependencies.getSignalServiceAccountManager().setGcmId(token);<NEW_LINE>SignalStore.account().setFcmToken(token.get());<NEW_LINE>} else {<NEW_LINE>throw new RetryLaterException(new IOException("Failed to retrieve a token."));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | get().length()); |
607,961 | public static DescribeDatabasesResponse unmarshall(DescribeDatabasesResponse describeDatabasesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDatabasesResponse.setRequestId(_ctx.stringValue("DescribeDatabasesResponse.RequestId"));<NEW_LINE>describeDatabasesResponse.setPageNumber(_ctx.integerValue("DescribeDatabasesResponse.PageNumber"));<NEW_LINE>describeDatabasesResponse.setPageRecordCount(_ctx.integerValue("DescribeDatabasesResponse.PageRecordCount"));<NEW_LINE>List<Database> databases = new ArrayList<Database>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDatabasesResponse.Databases.Length"); i++) {<NEW_LINE>Database database = new Database();<NEW_LINE>database.setDBName(_ctx.stringValue("DescribeDatabasesResponse.Databases[" + i + "].DBName"));<NEW_LINE>database.setDBStatus(_ctx.stringValue("DescribeDatabasesResponse.Databases[" + i + "].DBStatus"));<NEW_LINE>database.setDBDescription(_ctx.stringValue<MASK><NEW_LINE>database.setCharacterSetName(_ctx.stringValue("DescribeDatabasesResponse.Databases[" + i + "].CharacterSetName"));<NEW_LINE>database.setEngine(_ctx.stringValue("DescribeDatabasesResponse.Databases[" + i + "].Engine"));<NEW_LINE>List<Account> accounts = new ArrayList<Account>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeDatabasesResponse.Databases[" + i + "].Accounts.Length"); j++) {<NEW_LINE>Account account = new Account();<NEW_LINE>account.setAccountName(_ctx.stringValue("DescribeDatabasesResponse.Databases[" + i + "].Accounts[" + j + "].AccountName"));<NEW_LINE>account.setAccountStatus(_ctx.stringValue("DescribeDatabasesResponse.Databases[" + i + "].Accounts[" + j + "].AccountStatus"));<NEW_LINE>account.setAccountPrivilege(_ctx.stringValue("DescribeDatabasesResponse.Databases[" + i + "].Accounts[" + j + "].AccountPrivilege"));<NEW_LINE>account.setPrivilegeStatus(_ctx.stringValue("DescribeDatabasesResponse.Databases[" + i + "].Accounts[" + j + "].PrivilegeStatus"));<NEW_LINE>accounts.add(account);<NEW_LINE>}<NEW_LINE>database.setAccounts(accounts);<NEW_LINE>databases.add(database);<NEW_LINE>}<NEW_LINE>describeDatabasesResponse.setDatabases(databases);<NEW_LINE>return describeDatabasesResponse;<NEW_LINE>} | ("DescribeDatabasesResponse.Databases[" + i + "].DBDescription")); |
1,569,419 | final ListDeviceResourcesResult executeListDeviceResources(ListDeviceResourcesRequest listDeviceResourcesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listDeviceResourcesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListDeviceResourcesRequest> request = null;<NEW_LINE>Response<ListDeviceResourcesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListDeviceResourcesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listDeviceResourcesRequest));<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, "Snow Device Management");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListDeviceResources");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListDeviceResourcesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListDeviceResourcesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
351,608 | public WindowInsetsCompat onApplyWindowInsets(View view, @NonNull WindowInsetsCompat insets, @NonNull RelativePadding initialPadding) {<NEW_LINE>// Apply the top, bottom, and start padding for a start edge aligned<NEW_LINE>// NavigationRailView to dodge the system status and navigation bars<NEW_LINE>if (shouldApplyWindowInsetPadding(paddingTopSystemWindowInsets)) {<NEW_LINE>initialPadding.top += insets.getInsets(WindowInsetsCompat.Type.systemBars()).top;<NEW_LINE>}<NEW_LINE>if (shouldApplyWindowInsetPadding(paddingBottomSystemWindowInsets)) {<NEW_LINE>initialPadding.bottom += insets.getInsets(WindowInsetsCompat.Type.systemBars()).bottom;<NEW_LINE>}<NEW_LINE>boolean isRtl = ViewCompat.getLayoutDirection(view) == ViewCompat.LAYOUT_DIRECTION_RTL;<NEW_LINE><MASK><NEW_LINE>int systemWindowInsetRight = insets.getSystemWindowInsetRight();<NEW_LINE>initialPadding.start += isRtl ? systemWindowInsetRight : systemWindowInsetLeft;<NEW_LINE>initialPadding.applyToView(view);<NEW_LINE>return insets;<NEW_LINE>} | int systemWindowInsetLeft = insets.getSystemWindowInsetLeft(); |
1,211,451 | public <T> Provider<T> scope(final Key<T> key, final Provider<T> creator) {<NEW_LINE>final <MASK><NEW_LINE>return new Provider<T>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public T get() {<NEW_LINE>HttpSession session = GuiceFilter.getRequest(key).getSession();<NEW_LINE>synchronized (session) {<NEW_LINE>Object obj = session.getAttribute(name);<NEW_LINE>if (NullObject.INSTANCE == obj) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>T t = (T) obj;<NEW_LINE>if (t == null) {<NEW_LINE>t = creator.get();<NEW_LINE>if (!Scopes.isCircularProxy(t)) {<NEW_LINE>session.setAttribute(name, (t != null) ? t : NullObject.INSTANCE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return t;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String toString() {<NEW_LINE>return String.format("%s[%s]", creator, SESSION);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | String name = key.toString(); |
929,590 | public void enableMetaDataPersictency() {<NEW_LINE>clusterService.submitStateUpdateTask("gateway-cassandra-ring-ready", new ClusterStateUpdateTask() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ClusterState execute(ClusterState currentState) {<NEW_LINE>logger.debug("releasing the cassandra ring block...");<NEW_LINE>// remove the block, since we recovered from gateway<NEW_LINE>ClusterBlocks.Builder blocks = ClusterBlocks.builder().blocks(currentState.blocks()).removeGlobalBlock(NO_CASSANDRA_RING_BLOCK);<NEW_LINE>// update the state to reflect<NEW_LINE>ClusterState updatedState = ClusterState.builder(currentState).<MASK><NEW_LINE>// update routing table<NEW_LINE>RoutingTable routingTable = RoutingTable.build(clusterService, updatedState);<NEW_LINE>return ClusterState.builder(updatedState).routingTable(routingTable).build();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(String source, Exception t) {<NEW_LINE>logger.error("unexpected failure during [{}]", t, source);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState) {<NEW_LINE>logger.info("cassandra ring block released");<NEW_LINE>try {<NEW_LINE>clusterService.publishX1();<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.error("unexpected failure on X1 publishing during [{}]", source, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | blocks(blocks).build(); |
1,504,467 | static final String hostKey(String host) {<NEW_LINE>try {<NEW_LINE>final Matcher m = HOST_PATTERN.matcher(host);<NEW_LINE>// I know which type of host matched by the number of the group that is non-null<NEW_LINE>// I use a different replacement string per host type to make the Epic stats more clear<NEW_LINE>if (m.matches()) {<NEW_LINE>if (m.group(1) != null)<NEW_LINE>host = host.replace(m.group(1), "EC2");<NEW_LINE>else if (m.group(2) != null)<NEW_LINE>host = host.replace(m<MASK><NEW_LINE>else if (m.group(3) != null)<NEW_LINE>host = host.replace(m.group(3), "IP");<NEW_LINE>else if (m.group(4) != null)<NEW_LINE>host = host.replace(m.group(4), "CDN");<NEW_LINE>else if (m.group(5) != null)<NEW_LINE>host = host.replace(m.group(5), "CDN");<NEW_LINE>else if (m.group(6) != null)<NEW_LINE>host = host.replace(m.group(6), "CDN");<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error(e.getMessage(), e);<NEW_LINE>} finally {<NEW_LINE>return String.format("host_%s", host);<NEW_LINE>}<NEW_LINE>} | .group(2), "IP"); |
1,855,532 | /*<NEW_LINE>Returns the main list of ~500 banks in Japan with bank codes,<NEW_LINE>but since 90%+ of people will be using one of ~30 major banks,<NEW_LINE>we hard-code those at the top for easier pull-down selection,<NEW_LINE>and add their English names in parenthesis for foreigners.<NEW_LINE>*/<NEW_LINE>public static // {{{<NEW_LINE>// {{{<NEW_LINE>List<String> prettyPrintBankList() {<NEW_LINE>List<String> prettyList = new ArrayList<>();<NEW_LINE>// add mega banks at the top<NEW_LINE>for (Map.Entry<String, String> bank : megaBanksEnglish.entrySet()) {<NEW_LINE>String bankId = bank.getKey();<NEW_LINE>String bankNameEn = bank.getValue();<NEW_LINE>String bankNameJa = majorBanksJapanese.get(bankId);<NEW_LINE>if (bankNameJa == null)<NEW_LINE><MASK><NEW_LINE>prettyList.add(prettyPrintMajorBank(bankId, bankNameJa, bankNameEn));<NEW_LINE>}<NEW_LINE>// append the major banks next<NEW_LINE>for (Map.Entry<String, String> bank : majorBanksJapanese.entrySet()) {<NEW_LINE>String bankId = bank.getKey();<NEW_LINE>String bankNameJa = bank.getValue();<NEW_LINE>// avoid duplicates<NEW_LINE>if (megaBanksEnglish.get(bankId) != null)<NEW_LINE>continue;<NEW_LINE>prettyList.add(prettyPrintBank(bankId, bankNameJa));<NEW_LINE>}<NEW_LINE>// append the minor local banks last<NEW_LINE>for (Map.Entry<String, String> bank : minorBanksJapanese.entrySet()) {<NEW_LINE>String bankId = bank.getKey();<NEW_LINE>String bankNameJa = bank.getValue();<NEW_LINE>prettyList.add(prettyPrintBank(bankId, bankNameJa));<NEW_LINE>}<NEW_LINE>return prettyList;<NEW_LINE>} | bankNameJa = minorBanksJapanese.get(bankId); |
347,365 | public final void write(java.io.Writer w, Object inst) throws java.io.IOException {<NEW_LINE>Document doc = null;<NEW_LINE>try {<NEW_LINE>doc = XMLUtil.createDocument(rootElement, null, publicID, systemID);<NEW_LINE>setDocumentContext(doc, findContext(w));<NEW_LINE>writeElement(doc, doc.getDocumentElement(), inst);<NEW_LINE>java.io.ByteArrayOutputStream baos = new <MASK><NEW_LINE>// NOI18N<NEW_LINE>XMLUtil.write(doc, baos, "UTF-8");<NEW_LINE>// NOI18N<NEW_LINE>w.write(baos.toString("UTF-8"));<NEW_LINE>} catch (org.w3c.dom.DOMException ex) {<NEW_LINE>IOException e = new IOException(ex.getLocalizedMessage());<NEW_LINE>e.initCause(ex);<NEW_LINE>throw e;<NEW_LINE>} finally {<NEW_LINE>if (doc != null) {<NEW_LINE>clearCashesForDocument(doc);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | java.io.ByteArrayOutputStream(1024); |
1,441,079 | final PutImageTagMutabilityResult executePutImageTagMutability(PutImageTagMutabilityRequest putImageTagMutabilityRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putImageTagMutabilityRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutImageTagMutabilityRequest> request = null;<NEW_LINE>Response<PutImageTagMutabilityResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutImageTagMutabilityRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putImageTagMutabilityRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "ECR");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutImageTagMutability");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutImageTagMutabilityResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutImageTagMutabilityResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
21,538 | public boolean projectToPixel(int pointIdx, int viewIdx, Se3_F64 world_to_view, Se3_F64 tmpSE, Point3D_F64 tmpX, Point2D_F64 pixel) {<NEW_LINE>// Get the coordinate transform<NEW_LINE>View <MASK><NEW_LINE>getWorldToView(view, world_to_view, tmpSE);<NEW_LINE>// extract the coordinate for 3D and homogenous case<NEW_LINE>Point p = points.get(pointIdx);<NEW_LINE>double x, y, z, w;<NEW_LINE>x = p.coordinate[0];<NEW_LINE>y = p.coordinate[1];<NEW_LINE>z = p.coordinate[2];<NEW_LINE>w = homogenous ? p.coordinate[3] : 1.0;<NEW_LINE>// Project the pixel while being careful for points at infinity<NEW_LINE>BundleAdjustmentCamera camera = Objects.requireNonNull(getViewCamera(view).model);<NEW_LINE>SePointOps_F64.transformV(world_to_view, x, y, z, w, tmpX);<NEW_LINE>camera.project(tmpX.x, tmpX.y, tmpX.z, pixel);<NEW_LINE>// if the sign is positive then it's in front<NEW_LINE>return z * w > 0.0;<NEW_LINE>} | view = views.get(viewIdx); |
201,402 | final ListExtensionVersionsResult executeListExtensionVersions(ListExtensionVersionsRequest listExtensionVersionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listExtensionVersionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListExtensionVersionsRequest> request = null;<NEW_LINE>Response<ListExtensionVersionsResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new ListExtensionVersionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listExtensionVersionsRequest));<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, "GameSparks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListExtensionVersions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListExtensionVersionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListExtensionVersionsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
269,012 | public void BackoffAsync(Runnable command) {<NEW_LINE>com.gmt2001.Console.debug.println("BackoffAsync() called by: " + com.gmt2001.Console.debug.findCaller("com.gmt2001.ExponentialBackoff"));<NEW_LINE>this.setIsBackingOff(true);<NEW_LINE>com.gmt2001.Console.debug.println("Locked backoff...");<NEW_LINE>this.determineNextInterval();<NEW_LINE>com.gmt2001.Console.debug.println("Interval calculated as " + this.lastIntervalMS + "...");<NEW_LINE>this.totalIterations++;<NEW_LINE>com.gmt2001.<MASK><NEW_LINE>ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor();<NEW_LINE>service.schedule(() -> {<NEW_LINE>this.setIsBackingOff(false);<NEW_LINE>com.gmt2001.Console.debug.println("Unlocked backoff...");<NEW_LINE>this.setIsNextIntervalDetermined(false);<NEW_LINE>com.gmt2001.Console.debug.println("Unlocked calculation...");<NEW_LINE>command.run();<NEW_LINE>com.gmt2001.Console.debug.println("Callback completed...");<NEW_LINE>com.gmt2001.Console.debug.println("Returning control...");<NEW_LINE>}, this.lastIntervalMS, TimeUnit.MILLISECONDS);<NEW_LINE>} | Console.debug.println("Scheduling..."); |
433,748 | public void resolveConfiguredHosts(Consumer<List<TransportAddress>> consumer) {<NEW_LINE>if (lifecycle.started() == false) {<NEW_LINE>logger.debug("resolveConfiguredHosts: lifecycle is {}, not proceeding", lifecycle);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (resolveInProgress.compareAndSet(false, true)) {<NEW_LINE>transportService.getThreadPool().generic().execute(new AbstractRunnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(Exception e) {<NEW_LINE>logger.debug("failure when resolving unicast hosts list", e);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void doRun() {<NEW_LINE>if (lifecycle.started() == false) {<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<TransportAddress> providedAddresses = hostsProvider.getSeedAddresses(hosts -> resolveHostsLists(cancellableThreads, executorService.get(), logger, hosts, transportService, resolveTimeout));<NEW_LINE>consumer.accept(providedAddresses);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onAfter() {<NEW_LINE>resolveInProgress.set(false);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String toString() {<NEW_LINE>return "SeedHostsResolver resolving unicast hosts list";<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | logger.debug("resolveConfiguredHosts.doRun: lifecycle is {}, not proceeding", lifecycle); |
1,267,030 | /*<NEW_LINE>* Recover syntax on type argument in invalid method/constructor reference<NEW_LINE>*/<NEW_LINE>protected Object syntaxRecoverArgumentType(Object receiver, List arguments, Object argument) throws InvalidInputException {<NEW_LINE>if (this.completionNode != null && !this.pushText) {<NEW_LINE>this.completionNode.addCompletionFlags(CompletionOnJavadoc.BASE_TYPES);<NEW_LINE>if (this.completionNode instanceof CompletionOnJavadocSingleTypeReference) {<NEW_LINE>char[] token = ((CompletionOnJavadocSingleTypeReference) this.completionNode).token;<NEW_LINE>if (token != null && token.length > 0) {<NEW_LINE>return this.completionNode;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return this.completionNode;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Filter empty token<NEW_LINE>if (this.completionNode instanceof CompletionOnJavadocSingleTypeReference) {<NEW_LINE>CompletionOnJavadocSingleTypeReference singleTypeReference = (CompletionOnJavadocSingleTypeReference) this.completionNode;<NEW_LINE>if (singleTypeReference.token != null && singleTypeReference.token.length > 0) {<NEW_LINE>arguments.add(argument);<NEW_LINE>}<NEW_LINE>} else if (this.completionNode instanceof CompletionOnJavadocQualifiedTypeReference) {<NEW_LINE>CompletionOnJavadocQualifiedTypeReference qualifiedTypeReference = (CompletionOnJavadocQualifiedTypeReference) this.completionNode;<NEW_LINE>if (qualifiedTypeReference.tokens != null && qualifiedTypeReference.tokens.length == qualifiedTypeReference.sourcePositions.length) {<NEW_LINE>arguments.add(argument);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>arguments.add(argument);<NEW_LINE>}<NEW_LINE>Object methodRef = super.createMethodReference(receiver, arguments);<NEW_LINE>if (methodRef instanceof JavadocMessageSend) {<NEW_LINE>JavadocMessageSend msgSend = (JavadocMessageSend) methodRef;<NEW_LINE>if (this.index > this.cursorLocation) {<NEW_LINE>msgSend.sourceEnd = this.tokenPreviousPosition - 1;<NEW_LINE>}<NEW_LINE>int nameStart = (int) (msgSend.nameSourcePosition >>> 32);<NEW_LINE>int nameEnd = (int) msgSend.nameSourcePosition;<NEW_LINE>if ((nameStart <= (this.cursorLocation + 1) && this.cursorLocation <= nameEnd)) {<NEW_LINE>this.completionNode = new <MASK><NEW_LINE>} else {<NEW_LINE>this.completionNode = new CompletionOnJavadocMessageSend(msgSend, this.memberStart);<NEW_LINE>}<NEW_LINE>} else if (methodRef instanceof JavadocAllocationExpression) {<NEW_LINE>JavadocAllocationExpression allocExp = (JavadocAllocationExpression) methodRef;<NEW_LINE>if (this.index > this.cursorLocation) {<NEW_LINE>allocExp.sourceEnd = this.tokenPreviousPosition - 1;<NEW_LINE>}<NEW_LINE>this.completionNode = new CompletionOnJavadocAllocationExpression(allocExp, this.memberStart);<NEW_LINE>}<NEW_LINE>if (CompletionEngine.DEBUG) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>System.out.println(" completion method=" + this.completionNode);<NEW_LINE>}<NEW_LINE>return this.completionNode;<NEW_LINE>} | CompletionOnJavadocFieldReference(msgSend, this.memberStart); |
1,604,739 | public Description describe(BinaryTree tree, VisitorState state) {<NEW_LINE>List<ExpressionTree> binaryTreeMatches = ASTHelpers.matchBinaryTree(tree, Arrays.asList(Matchers.<ExpressionTree>isInstance(JCLiteral.class), Matchers.<ExpressionTree>anything()), state);<NEW_LINE>if (binaryTreeMatches == null) {<NEW_LINE>throw new IllegalStateException("Expected one of the operands to be a literal");<NEW_LINE>}<NEW_LINE>JCLiteral literal = (JCLiteral) binaryTreeMatches.get(0);<NEW_LINE>JCTree nonLiteralOperand = (JCTree) binaryTreeMatches.get(1);<NEW_LINE>boolean byteMatch = state.getTypes().isSameType(nonLiteralOperand.type, state.getSymtab().byteType);<NEW_LINE>boolean willEvaluateTo = (tree.getKind() != Kind.EQUAL_TO);<NEW_LINE>Fix fix;<NEW_LINE>String customDiagnosticMessage;<NEW_LINE>if (byteMatch) {<NEW_LINE>String replacement = Byte.toString(((Number) literal.getValue()).byteValue());<NEW_LINE>fix = SuggestedFix.replace(literal, replacement);<NEW_LINE>customDiagnosticMessage = String.format(MESSAGE_TEMPLATE, "byte", (int) Byte.MIN_VALUE, (int) Byte.MAX_VALUE, state.getSourceForNode(literal), Boolean.toString(willEvaluateTo));<NEW_LINE>} else {<NEW_LINE>fix = SuggestedFix.replace(tree<MASK><NEW_LINE>customDiagnosticMessage = String.format(MESSAGE_TEMPLATE, "char", (int) Character.MIN_VALUE, (int) Character.MAX_VALUE, state.getSourceForNode(literal), Boolean.toString(willEvaluateTo));<NEW_LINE>}<NEW_LINE>return buildDescription(tree).addFix(fix).setMessage(customDiagnosticMessage).build();<NEW_LINE>} | , Boolean.toString(willEvaluateTo)); |
1,428,203 | public void propagateAreaLocations(OverlayEdge nodeEdge, int geomIndex) {<NEW_LINE>if (!inputGeometry.isArea(geomIndex))<NEW_LINE>return;<NEW_LINE>if (nodeEdge.degree() == 1)<NEW_LINE>return;<NEW_LINE>OverlayEdge <MASK><NEW_LINE>// no labelled edge found, so nothing to propagate<NEW_LINE>if (eStart == null)<NEW_LINE>return;<NEW_LINE>// initialize currLoc to location of L side<NEW_LINE>int currLoc = eStart.getLocation(geomIndex, Position.LEFT);<NEW_LINE>OverlayEdge e = eStart.oNextOE();<NEW_LINE>// Debug.println("\npropagateSideLabels geomIndex = " + geomIndex + " : " + eStart);<NEW_LINE>// Debug.print("BEFORE: " + toString(eStart));<NEW_LINE>do {<NEW_LINE>OverlayLabel label = e.getLabel();<NEW_LINE>if (!label.isBoundary(geomIndex)) {<NEW_LINE>label.setLocationLine(geomIndex, currLoc);<NEW_LINE>} else {<NEW_LINE>// must be a boundary edge<NEW_LINE>Assert.isTrue(label.hasSides(geomIndex));<NEW_LINE>int locRight = e.getLocation(geomIndex, Position.RIGHT);<NEW_LINE>if (locRight != currLoc) {<NEW_LINE>throw new TopologyException("side location conflict: arg " + geomIndex, e.getCoordinate());<NEW_LINE>}<NEW_LINE>int locLeft = e.getLocation(geomIndex, Position.LEFT);<NEW_LINE>if (locLeft == Location.NONE) {<NEW_LINE>Assert.shouldNeverReachHere("found single null side at " + e);<NEW_LINE>}<NEW_LINE>currLoc = locLeft;<NEW_LINE>}<NEW_LINE>e = e.oNextOE();<NEW_LINE>} while (e != eStart);<NEW_LINE>// Debug.print("AFTER: " + toString(eStart));<NEW_LINE>} | eStart = findPropagationStartEdge(nodeEdge, geomIndex); |
1,310,417 | public final void functionType() throws RecognitionException, TokenStreamException {<NEW_LINE>returnAST = null;<NEW_LINE>ASTPair currentAST = new ASTPair();<NEW_LINE>PascalAST functionType_AST = null;<NEW_LINE>PascalAST tmp38_AST = null;<NEW_LINE>tmp38_AST = (PascalAST) astFactory.create(LT(1));<NEW_LINE>astFactory.makeASTRoot(currentAST, tmp38_AST);<NEW_LINE>match(FUNCTION);<NEW_LINE>{<NEW_LINE>switch(LA(1)) {<NEW_LINE>case LPAREN:<NEW_LINE>{<NEW_LINE>formalParameterList();<NEW_LINE>astFactory.addASTChild(currentAST, returnAST);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case COLON:<NEW_LINE>{<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>throw new NoViableAltException(LT<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>match(COLON);<NEW_LINE>resultType();<NEW_LINE>astFactory.addASTChild(currentAST, returnAST);<NEW_LINE>functionType_AST = (PascalAST) currentAST.root;<NEW_LINE>returnAST = functionType_AST;<NEW_LINE>} | (1), getFilename()); |
1,625,482 | protected void waitForXClusterOperation(IPollForXClusterOperation p) {<NEW_LINE>XClusterConfig xClusterConfig = taskParams().xClusterConfig;<NEW_LINE>try {<NEW_LINE>IsSetupUniverseReplicationDoneResponse doneResponse = null;<NEW_LINE>int numAttempts = 1;<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>while (((System.currentTimeMillis() - startTime) / 1000) < POLL_TIMEOUT_SECONDS) {<NEW_LINE>if (numAttempts % 10 == 0) {<NEW_LINE>log.info("Wait for XClusterConfig({}) operation to complete (attempt {})", xClusterConfig.uuid, numAttempts);<NEW_LINE>}<NEW_LINE>doneResponse = p.<MASK><NEW_LINE>if (doneResponse.isDone()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (doneResponse.hasError()) {<NEW_LINE>log.warn("Failed to wait for XClusterConfig({}) operation: {}", xClusterConfig.uuid, doneResponse.getError().toString());<NEW_LINE>}<NEW_LINE>waitFor(Duration.ofMillis(1000));<NEW_LINE>numAttempts++;<NEW_LINE>}<NEW_LINE>if (doneResponse == null) {<NEW_LINE>// TODO: Add unit tests (?) -- May be difficult due to wait<NEW_LINE>throw new RuntimeException(String.format("Never received response waiting for XClusterConfig(%s) operation to complete", xClusterConfig.uuid));<NEW_LINE>}<NEW_LINE>if (!doneResponse.isDone()) {<NEW_LINE>// TODO: Add unit tests (?) -- May be difficult due to wait<NEW_LINE>throw new RuntimeException(String.format("Timed out waiting for XClusterConfig(%s) operation to complete", xClusterConfig.uuid));<NEW_LINE>}<NEW_LINE>if (doneResponse.hasReplicationError() && doneResponse.getReplicationError().getCode() != ErrorCode.OK) {<NEW_LINE>throw new RuntimeException(String.format("XClusterConfig(%s) operation failed: %s", xClusterConfig.uuid, doneResponse.getReplicationError().toString()));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("{} hit error : {}", getName(), e.getMessage());<NEW_LINE>Throwables.propagate(e);<NEW_LINE>}<NEW_LINE>} | poll(xClusterConfig.getReplicationGroupName()); |
682,820 | //<NEW_LINE>@Override<NEW_LINE>public void log(TraceComponent logger) {<NEW_LINE>Tr.debug(logger, MessageFormat.format("Method [ {0} ]", getHashText()));<NEW_LINE>Tr.debug(logger, MessageFormat.format(" Name [ {0} ]", getName()));<NEW_LINE>for (ClassInfoImpl nextParameterType : getParameterTypes()) {<NEW_LINE>Tr.debug(logger, MessageFormat.format(" Parameter Type [ {0} ]", nextParameterType.getHashText()));<NEW_LINE>}<NEW_LINE>Tr.debug(logger, MessageFormat.format(" Return Type [ {0} ]", getReturnType().getHashText()));<NEW_LINE>for (ClassInfoImpl nextExceptionType : getExceptionTypes()) {<NEW_LINE>Tr.debug(logger, MessageFormat.format(" Exception Type [ {0} ]", nextExceptionType.getHashText()));<NEW_LINE>}<NEW_LINE>Tr.debug(logger, MessageFormat.format(" Declaring Class [ {0} ]", getDeclaringClass<MASK><NEW_LINE>Tr.debug(logger, MessageFormat.format(" Default Value [ {0} ]", getAnnotationDefaultValue()));<NEW_LINE>} | ().getHashText())); |
924,903 | public static <// TODO: Deprecate.<NEW_LINE>T> boolean xmlIsValid(DOMSource xmlfile, Class<T> clazz, String schemaFile) {<NEW_LINE>try {<NEW_LINE>PlatformUtil.extractResourceToUserConfigDir(clazz, schemaFile, false);<NEW_LINE>File schemaLoc = new File(PlatformUtil.getUserConfigDirectory() + File.separator + schemaFile);<NEW_LINE>SchemaFactory schm = getSchemaFactory(XMLConstants.W3C_XML_SCHEMA_NS_URI);<NEW_LINE>try {<NEW_LINE>Schema <MASK><NEW_LINE>Validator validator = schema.newValidator();<NEW_LINE>DOMResult result = new DOMResult();<NEW_LINE>validator.validate(xmlfile, result);<NEW_LINE>return true;<NEW_LINE>} catch (SAXException e) {<NEW_LINE>// NON-NLS<NEW_LINE>Logger.getLogger(clazz.getName()).log(Level.WARNING, "Unable to validate XML file.", e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>// NON-NLS<NEW_LINE>Logger.getLogger(clazz.getName()).log(Level.WARNING, "Unable to load XML file [" + xmlfile.toString() + "] of type [" + schemaFile + "]", e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | schema = schm.newSchema(schemaLoc); |
1,244,297 | public void handleDeltas(Deque<MutablePair<DeltaFIFO.DeltaType, KubernetesObject>> deltas) {<NEW_LINE>if (CollectionUtils.isEmpty(deltas)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// from oldest to newest<NEW_LINE>for (MutablePair<DeltaFIFO.DeltaType, KubernetesObject> delta : deltas) {<NEW_LINE>DeltaFIFO.DeltaType deltaType = delta.getLeft();<NEW_LINE>KubernetesObject obj = delta.getRight();<NEW_LINE>if (transform != null) {<NEW_LINE>obj = transform.transform(obj);<NEW_LINE>}<NEW_LINE>switch(deltaType) {<NEW_LINE>case Sync:<NEW_LINE>case Added:<NEW_LINE>case Updated:<NEW_LINE>boolean isSync = deltaType == DeltaFIFO.DeltaType.Sync;<NEW_LINE>Object oldObj = this.indexer.get((ApiType) obj);<NEW_LINE>if (oldObj != null) {<NEW_LINE>this.indexer<MASK><NEW_LINE>this.processor.distribute(new ProcessorListener.UpdateNotification(oldObj, obj), isSync);<NEW_LINE>} else {<NEW_LINE>this.indexer.add((ApiType) obj);<NEW_LINE>this.processor.distribute(new ProcessorListener.AddNotification(obj), isSync);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case Deleted:<NEW_LINE>this.indexer.delete((ApiType) obj);<NEW_LINE>this.processor.distribute(new ProcessorListener.DeleteNotification(obj), false);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .update((ApiType) obj); |
794,490 | public static void convert(GrayS32 input, GrayF64 output) {<NEW_LINE>if (input.isSubimage() || output.isSubimage()) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, input.height, y -> {<NEW_LINE>for (int y = 0; y < input.height; y++) {<NEW_LINE>int indexSrc = <MASK><NEW_LINE>int indexDst = output.getIndex(0, y);<NEW_LINE>for (int x = 0; x < input.width; x++) {<NEW_LINE>output.data[indexDst++] = (double) (input.data[indexSrc++]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} else {<NEW_LINE>final int N = input.width * input.height;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopBlocks(0,N,(i0,i1)->{<NEW_LINE>int i0 = 0, i1 = N;<NEW_LINE>for (int i = i0; i < i1; i++) {<NEW_LINE>output.data[i] = (double) (input.data[i]);<NEW_LINE>}<NEW_LINE>// CONCURRENT_INLINE });<NEW_LINE>}<NEW_LINE>} | input.getIndex(0, y); |
603,661 | public JobDetail mapRow(ResultSet rs, int rowNum) throws SQLException {<NEW_LINE>JobDetail job = new JobDetail();<NEW_LINE>job.id = rs.getString("pk_job");<NEW_LINE>job.showId = rs.getString("pk_show");<NEW_LINE>job.facilityId = rs.getString("pk_facility");<NEW_LINE>job.deptId = rs.getString("pk_dept");<NEW_LINE>job.groupId = rs.getString("pk_folder");<NEW_LINE>job.logDir = rs.getString("str_log_dir");<NEW_LINE>job.maxCoreUnits = rs.getInt("int_max_cores");<NEW_LINE>job.minCoreUnits = rs.getInt("int_min_cores");<NEW_LINE>job.maxGpuUnits = rs.getInt("int_max_gpus");<NEW_LINE>job.minGpuUnits = rs.getInt("int_min_gpus");<NEW_LINE>job.name = rs.getString("str_name");<NEW_LINE>job.priority = rs.getInt("int_priority");<NEW_LINE>job.shot = rs.getString("str_shot");<NEW_LINE>job.state = JobState.valueOf(rs.getString("str_state"));<NEW_LINE>int uid = rs.getInt("int_uid");<NEW_LINE>job.uid = rs.wasNull() ? Optional.empty() : Optional.of(uid);<NEW_LINE>job.user = rs.getString("str_user");<NEW_LINE>job.<MASK><NEW_LINE>job.totalFrames = rs.getInt("int_frame_count");<NEW_LINE>job.totalLayers = rs.getInt("int_layer_count");<NEW_LINE>Timestamp startTime = rs.getTimestamp("ts_started");<NEW_LINE>job.startTime = startTime != null ? (int) (startTime.getTime() / 1000) : 0;<NEW_LINE>Timestamp stopTime = rs.getTimestamp("ts_stopped");<NEW_LINE>job.stopTime = stopTime != null ? (int) (stopTime.getTime() / 1000) : 0;<NEW_LINE>job.isPaused = rs.getBoolean("b_paused");<NEW_LINE>job.maxRetries = rs.getInt("int_max_retries");<NEW_LINE>job.showName = rs.getString("show_name");<NEW_LINE>job.facilityName = rs.getString("facility_name");<NEW_LINE>job.deptName = rs.getString("dept_name");<NEW_LINE>return job;<NEW_LINE>} | email = rs.getString("str_email"); |
1,428,466 | final PutTargetsResult executePutTargets(PutTargetsRequest putTargetsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putTargetsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutTargetsRequest> request = null;<NEW_LINE>Response<PutTargetsResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new PutTargetsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putTargetsRequest));<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, "CloudWatch Events");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutTargets");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutTargetsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutTargetsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
962,914 | public static String reportMicrophoneInfo(MicrophoneInfo micInfo) {<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>sb.append("\n==== Microphone ========= " + micInfo.getId());<NEW_LINE>sb.append("\nAddress : " + micInfo.getAddress());<NEW_LINE>sb.append("\nDescription: " + micInfo.getDescription());<NEW_LINE>sb.append("\nDirection : " + convertDirectionality(micInfo.getDirectionality()));<NEW_LINE>sb.append("\nLocation : " + convertLocation<MASK><NEW_LINE>sb.append("\nMinSPL : " + micInfo.getMinSpl());<NEW_LINE>sb.append("\nMaxSPL : " + micInfo.getMaxSpl());<NEW_LINE>sb.append("\nSensitivity: " + micInfo.getSensitivity());<NEW_LINE>sb.append("\nGroup : " + micInfo.getGroup());<NEW_LINE>sb.append("\nIndexInTheGroup: " + micInfo.getIndexInTheGroup());<NEW_LINE>sb.append("\nOrientation: " + convertCoordinates(micInfo.getOrientation()));<NEW_LINE>sb.append("\nPosition : " + convertCoordinates(micInfo.getPosition()));<NEW_LINE>sb.append("\nType : " + micInfo.getType());<NEW_LINE>List<Pair<Integer, Integer>> mapping = micInfo.getChannelMapping();<NEW_LINE>sb.append("\nChannelMapping: {");<NEW_LINE>for (Pair<Integer, Integer> pair : mapping) {<NEW_LINE>sb.append("[" + pair.first + "," + pair.second + "], ");<NEW_LINE>}<NEW_LINE>sb.append("}");<NEW_LINE>sb.append("\n");<NEW_LINE>return sb.toString();<NEW_LINE>} | (micInfo.getLocation())); |
764,222 | void shutdown() {<NEW_LINE>if (null != periodicTasksExecutor) {<NEW_LINE>periodicTasksExecutor.shutdownNow();<NEW_LINE>try {<NEW_LINE>while (!periodicTasksExecutor.awaitTermination(EXECUTOR_TERMINATION_WAIT_SECS, TimeUnit.SECONDS)) {<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(<MASK><NEW_LINE>}<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(Level.SEVERE, "Unexpected interrupt while stopping periodic tasks executor", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Case.removeEventTypeSubscriber(CASE_EVENTS_OF_INTEREST, localTasksManager);<NEW_LINE>IngestManager.getInstance().removeIngestJobEventListener(localTasksManager);<NEW_LINE>if (null != eventPublisher) {<NEW_LINE>eventPublisher.removeSubscriber(COLLABORATION_MONITOR_EVENT, remoteTasksManager);<NEW_LINE>eventPublisher.closeRemoteEventChannel();<NEW_LINE>}<NEW_LINE>remoteTasksManager.shutdown();<NEW_LINE>} | Level.WARNING, "Waited at least {0} seconds for periodic tasks executor to shut down, continuing to wait", EXECUTOR_TERMINATION_WAIT_SECS); |
498,191 | protected ClassLoader createReportClassLoader(final ReportContext reportContext) {<NEW_LINE>final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();<NEW_LINE>final ClassLoader parentClassLoader;<NEW_LINE>if (developerModeBL.isEnabled()) {<NEW_LINE>parentClassLoader = JasperCompileClassLoader.builder().parentClassLoader(contextClassLoader).additionalResourceDirNames(getConfiguredReportsDirs()).additionalResourceDirNames(<MASK><NEW_LINE>logger.info("Using compile class loader: {}", parentClassLoader);<NEW_LINE>} else {<NEW_LINE>parentClassLoader = contextClassLoader;<NEW_LINE>}<NEW_LINE>final OrgId adOrgId = reportContext.getOrgId();<NEW_LINE>final JasperClassLoader jasperLoader = JasperClassLoader.builder().attachmentEntryService(attachmentEntryService).parent(parentClassLoader).adOrgId(adOrgId).printFormatId(getPrintFormatIdOrNull(reportContext)).build();<NEW_LINE>logger.debug("Created jasper loader: {}", jasperLoader);<NEW_LINE>return jasperLoader;<NEW_LINE>} | getDevelopmentWorkspaceReportsDirs()).build(); |
1,640,092 | private void fit2(int xPosition, int yPosition, int columnCachedWidth, @NonNull View column, @NonNull ColumnLayoutManager childLayoutManager) {<NEW_LINE>int cellCacheWidth = getCacheWidth(yPosition, xPosition);<NEW_LINE>View cell = childLayoutManager.findViewByPosition(xPosition);<NEW_LINE>// Control whether the cell needs to be fitted by column header or not.<NEW_LINE>if (cell != null) {<NEW_LINE>if (cellCacheWidth != columnCachedWidth || mNeedSetLeft) {<NEW_LINE>// This is just for setting width value<NEW_LINE>if (cellCacheWidth != columnCachedWidth) {<NEW_LINE>cellCacheWidth = columnCachedWidth;<NEW_LINE>TableViewUtils.setWidth(cell, cellCacheWidth);<NEW_LINE>setCacheWidth(yPosition, xPosition, cellCacheWidth);<NEW_LINE>}<NEW_LINE>// The left & right values of Column header can be considered. Because this<NEW_LINE>// method will be worked<NEW_LINE>// after drawing process of main thread.<NEW_LINE>if (column.getLeft() != cell.getLeft() || column.getRight() != cell.getRight()) {<NEW_LINE>// TODO: + 1 is for decoration item. It should be gotten from a generic<NEW_LINE>// method of layoutManager<NEW_LINE>// Set right & left values<NEW_LINE>cell.setLeft(column.getLeft());<NEW_LINE>cell.setRight(column.getRight() + 1);<NEW_LINE>childLayoutManager.layoutDecoratedWithMargins(cell, cell.getLeft(), cell.getTop(), cell.getRight(<MASK><NEW_LINE>mNeedSetLeft = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ), cell.getBottom()); |
186,370 | public void processImage(int sourceID, long frameID, BufferedImage buffered, ImageBase input) {<NEW_LINE>synchronized (imageLock) {<NEW_LINE>// create a copy of the input image for output purposes<NEW_LINE>if (buffEqui.getWidth() != buffered.getWidth() || buffEqui.getHeight() != buffered.getHeight()) {<NEW_LINE>buffEqui = new BufferedImage(buffered.getWidth(), buffered.getHeight(), BufferedImage.TYPE_INT_BGR);<NEW_LINE>panelEqui.setPreferredSize(new Dimension(buffered.getWidth(), buffered.getHeight()));<NEW_LINE>panelEqui.setImageUI(buffEqui);<NEW_LINE>distorter.setEquirectangularShape(input.width, input.height);<NEW_LINE>distortImage.setModel(distorter);<NEW_LINE>}<NEW_LINE>buffEqui.createGraphics().drawImage(buffered, 0, 0, null);<NEW_LINE>equi<MASK><NEW_LINE>rerenderPinhole();<NEW_LINE>}<NEW_LINE>} | .setTo((T) input); |
1,289,311 | public void registerCommands(Consumer<Command> consumer) {<NEW_LINE>consumer.accept(Command.builder().aliases("tickmonitor", "tickmonitoring").argumentUsage("threshold", "percentage increase").argumentUsage("threshold-tick", "tick duration").argumentUsage("without-gc", null).executor((platform, sender, resp, arguments) -> {<NEW_LINE>TickHook tickHook = platform.getTickHook();<NEW_LINE>if (tickHook == null) {<NEW_LINE>resp.replyPrefixed(text<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (this.activeTickMonitor == null) {<NEW_LINE>ReportPredicate reportPredicate;<NEW_LINE>int threshold;<NEW_LINE>if ((threshold = arguments.intFlag("threshold")) != -1) {<NEW_LINE>reportPredicate = new ReportPredicate.PercentageChangeGt(threshold);<NEW_LINE>} else if ((threshold = arguments.intFlag("threshold-tick")) != -1) {<NEW_LINE>reportPredicate = new ReportPredicate.DurationGt(threshold);<NEW_LINE>} else {<NEW_LINE>reportPredicate = new ReportPredicate.PercentageChangeGt(100);<NEW_LINE>}<NEW_LINE>this.activeTickMonitor = new ReportingTickMonitor(platform, resp, tickHook, reportPredicate, !arguments.boolFlag("without-gc"));<NEW_LINE>this.activeTickMonitor.start();<NEW_LINE>} else {<NEW_LINE>close();<NEW_LINE>resp.broadcastPrefixed(text("Tick monitor disabled."));<NEW_LINE>}<NEW_LINE>}).tabCompleter((platform, sender, arguments) -> TabCompleter.completeForOpts(arguments, "--threshold", "--threshold-tick", "--without-gc")).build());<NEW_LINE>} | ("Not supported!", NamedTextColor.RED)); |
29,512 | public void writeToParcel(Parcel parcel, int i) {<NEW_LINE>parcel.writeString(name);<NEW_LINE>parcel.writeInt(maxVote);<NEW_LINE>parcel.writeInt(minVote);<NEW_LINE>parcel.writeInt(maxComments);<NEW_LINE>parcel.writeInt(minComments);<NEW_LINE>parcel.writeInt(maxAwards);<NEW_LINE>parcel.writeInt(minAwards);<NEW_LINE>parcel.writeByte((byte) (allowNSFW ? 1 : 0));<NEW_LINE>parcel.writeByte((byte) (onlyNSFW ? 1 : 0));<NEW_LINE>parcel.writeByte((byte) (onlySpoiler ? 1 : 0));<NEW_LINE>parcel.writeString(postTitleExcludesRegex);<NEW_LINE>parcel.writeString(postTitleContainsRegex);<NEW_LINE>parcel.writeString(postTitleExcludesStrings);<NEW_LINE>parcel.writeString(postTitleContainsStrings);<NEW_LINE>parcel.writeString(excludeSubreddits);<NEW_LINE>parcel.writeString(excludeUsers);<NEW_LINE>parcel.writeString(containFlairs);<NEW_LINE>parcel.writeString(excludeFlairs);<NEW_LINE>parcel.writeString(excludeDomains);<NEW_LINE>parcel.writeString(containDomains);<NEW_LINE>parcel.writeByte((byte) (containTextType ? 1 : 0));<NEW_LINE>parcel.writeByte((byte) (containLinkType ? 1 : 0));<NEW_LINE>parcel.writeByte((byte) (containImageType ? 1 : 0));<NEW_LINE>parcel.writeByte((byte) (containGifType ? 1 : 0));<NEW_LINE>parcel.writeByte((byte) (containVideoType ? 1 : 0));<NEW_LINE>parcel.writeByte((byte) <MASK><NEW_LINE>} | (containGalleryType ? 1 : 0)); |
253,146 | public void actionPerformed(java.awt.event.ActionEvent p_evt) {<NEW_LINE>java.util.Collection<WindowObjectInfo.Printable> object_list = new java.util.LinkedList<WindowObjectInfo.Printable>();<NEW_LINE>app.freerouting.library.BoardLibrary board_library = board_frame.board_panel.board_handling.get_routing_board().library;<NEW_LINE>for (int i = 0; i < board_library.via_padstack_count(); ++i) {<NEW_LINE>object_list.add(board_library.get_via_padstack(i));<NEW_LINE>}<NEW_LINE>app.freerouting.board.CoordinateTransform coordinate_transform = board_frame.board_panel.board_handling.coordinate_transform;<NEW_LINE>WindowObjectInfo new_window = WindowObjectInfo.display(resources.getString("available_via_padstacks"), object_list, board_frame, coordinate_transform);<NEW_LINE>java.<MASK><NEW_LINE>java.awt.Point new_window_location = new java.awt.Point((int) (loc.getX() + WINDOW_OFFSET), (int) (loc.getY() + WINDOW_OFFSET));<NEW_LINE>new_window.setLocation(new_window_location);<NEW_LINE>subwindows.add(new_window);<NEW_LINE>} | awt.Point loc = getLocation(); |
1,170,184 | final StopPiiEntitiesDetectionJobResult executeStopPiiEntitiesDetectionJob(StopPiiEntitiesDetectionJobRequest stopPiiEntitiesDetectionJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(stopPiiEntitiesDetectionJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StopPiiEntitiesDetectionJobRequest> request = null;<NEW_LINE>Response<StopPiiEntitiesDetectionJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StopPiiEntitiesDetectionJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(stopPiiEntitiesDetectionJobRequest));<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, "Comprehend");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StopPiiEntitiesDetectionJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StopPiiEntitiesDetectionJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | false), new StopPiiEntitiesDetectionJobResultJsonUnmarshaller()); |
1,416,967 | FixedKeyNode updateRecord(int index, DBRecord record) throws IOException {<NEW_LINE>int offset = getRecordDataOffset(index);<NEW_LINE>int oldLen = getRecordLength(index, offset);<NEW_LINE>int len = record.length();<NEW_LINE>// Check for use of indirect chained record node(s)<NEW_LINE>// min 4 records per node<NEW_LINE>int maxRecordLength = ((buffer.length() - <MASK><NEW_LINE>boolean wasIndirect = hasIndirectStorage(index);<NEW_LINE>boolean useIndirect = (len > maxRecordLength);<NEW_LINE>if (useIndirect) {<NEW_LINE>// Store record in chained buffers<NEW_LINE>len = 4;<NEW_LINE>ChainedBuffer chainedBuffer = null;<NEW_LINE>if (wasIndirect) {<NEW_LINE>chainedBuffer = new ChainedBuffer(nodeMgr.getBufferMgr(), buffer.getInt(offset));<NEW_LINE>chainedBuffer.setSize(record.length(), false);<NEW_LINE>} else {<NEW_LINE>chainedBuffer = new ChainedBuffer(record.length(), nodeMgr.getBufferMgr());<NEW_LINE>// assumes old len is always > 4<NEW_LINE>buffer.putInt(offset + oldLen - 4, chainedBuffer.getId());<NEW_LINE>enableIndirectStorage(index, true);<NEW_LINE>}<NEW_LINE>record.write(chainedBuffer, 0);<NEW_LINE>} else if (wasIndirect) {<NEW_LINE>removeChainedBuffer(buffer.getInt(offset));<NEW_LINE>enableIndirectStorage(index, false);<NEW_LINE>}<NEW_LINE>// See if updated record will fit in current buffer<NEW_LINE>if (useIndirect || len <= (getFreeSpace() + oldLen)) {<NEW_LINE>// Overwrite record data - move other data if needed<NEW_LINE>int dataShift = oldLen - len;<NEW_LINE>if (dataShift != 0) {<NEW_LINE>offset = moveRecords(index + 1, dataShift);<NEW_LINE>putRecordDataOffset(index, offset);<NEW_LINE>}<NEW_LINE>if (!useIndirect) {<NEW_LINE>record.write(buffer, offset);<NEW_LINE>}<NEW_LINE>return getRoot();<NEW_LINE>}<NEW_LINE>// Insufficient room for updated record - remove and re-add<NEW_LINE>Field key = record.getKeyField();<NEW_LINE>FixedKeyRecordNode leaf = (FixedKeyRecordNode) deleteRecord(key, null).getLeafNode(key);<NEW_LINE>return leaf.putRecord(record, null);<NEW_LINE>} | HEADER_SIZE) >> 2) - entrySize; |
630,538 | private void initializeListAdapter() {<NEW_LINE>if (this.recipient != null && this.chatId != -1) {<NEW_LINE>ConversationAdapter adapter = new ConversationAdapter(getActivity(), this.recipient.getChat(), GlideApp.with(this), locale, selectionClickListener, this.recipient);<NEW_LINE>list.setAdapter(adapter);<NEW_LINE>dateDecoration = new StickyHeaderDecoration(adapter, false, false);<NEW_LINE>list.addItemDecoration(dateDecoration);<NEW_LINE>int freshMsgs = dcContext.getFreshMsgCount((int) chatId);<NEW_LINE>SetStartingPositionLinearLayoutManager layoutManager = (SetStartingPositionLinearLayoutManager) list.getLayoutManager();<NEW_LINE>if (startingPosition > -1) {<NEW_LINE>layoutManager.setStartingPosition(startingPosition);<NEW_LINE>} else if (freshMsgs > 0) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>reloadList();<NEW_LINE>updateLocationButton();<NEW_LINE>if (freshMsgs > 0) {<NEW_LINE>getListAdapter().setLastSeenPosition(freshMsgs - 1);<NEW_LINE>if (lastSeenDecoration != null) {<NEW_LINE>list.removeItemDecoration(lastSeenDecoration);<NEW_LINE>}<NEW_LINE>lastSeenDecoration = new ConversationAdapter.LastSeenHeader(getListAdapter());<NEW_LINE>list.addItemDecoration(lastSeenDecoration);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | layoutManager.setStartingPosition(freshMsgs - 1); |
1,210,843 | private List<Integer> bfs(TreeNode root, Map<Integer, Integer> map) {<NEW_LINE>Queue<TreeNode> queue = new LinkedList<>();<NEW_LINE>queue.offer(root);<NEW_LINE>while (!queue.isEmpty()) {<NEW_LINE>int size = queue.size();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>TreeNode treeNode = queue.poll();<NEW_LINE>if (treeNode.left != null) {<NEW_LINE>queue.offer(treeNode.left);<NEW_LINE>}<NEW_LINE>if (treeNode.right != null) {<NEW_LINE>queue.offer(treeNode.right);<NEW_LINE>}<NEW_LINE>map.put(treeNode.val, map.getOrDefault(treeNode<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>int highestFrequency = 0;<NEW_LINE>List<Integer> list = new ArrayList<>();<NEW_LINE>for (Map.Entry<Integer, Integer> entry : map.entrySet()) {<NEW_LINE>if (entry.getValue() > highestFrequency) {<NEW_LINE>highestFrequency = entry.getValue();<NEW_LINE>list.clear();<NEW_LINE>list.add(entry.getKey());<NEW_LINE>} else if (entry.getValue() == highestFrequency) {<NEW_LINE>list.add(entry.getKey());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>} | .val, 0) + 1); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.