idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,667,190 | private void onRestoreFileVersionOperationFinish(RemoteOperationResult result) {<NEW_LINE>if (result.isSuccess()) {<NEW_LINE>OCFile file = getFile();<NEW_LINE>// delete old local copy<NEW_LINE>if (file.isDown()) {<NEW_LINE>List<OCFile> list = new ArrayList<>();<NEW_LINE>list.add(file);<NEW_LINE>getFileOperationsHelper().<MASK><NEW_LINE>// download new version, only if file was previously download<NEW_LINE>getFileOperationsHelper().syncFile(file);<NEW_LINE>}<NEW_LINE>OCFile parent = getStorageManager().getFileById(file.getParentId());<NEW_LINE>startSyncFolderOperation(parent, true, true);<NEW_LINE>Fragment leftFragment = getLeftFragment();<NEW_LINE>if (leftFragment instanceof FileDetailFragment) {<NEW_LINE>FileDetailFragment fileDetailFragment = (FileDetailFragment) leftFragment;<NEW_LINE>fileDetailFragment.getFileDetailActivitiesFragment().reload();<NEW_LINE>}<NEW_LINE>DisplayUtils.showSnackMessage(this, R.string.file_version_restored_successfully);<NEW_LINE>} else {<NEW_LINE>DisplayUtils.showSnackMessage(this, R.string.file_version_restored_error);<NEW_LINE>}<NEW_LINE>} | removeFiles(list, true, true); |
1,175,095 | protected void configure() {<NEW_LINE>LOGGER.debug("installing module: {}", ExportModule.class.getSimpleName());<NEW_LINE>Properties properties = create(PROPERTY_NAME, ExportModule.class);<NEW_LINE>bind(Integer.class).annotatedWith(named("export.rest.client.connectionTimeout")).toInstance(Integer.valueOf(getProperty("export.rest.client.connectionTimeout", properties)));<NEW_LINE>bind(Integer.class).annotatedWith(named("export.rest.client.socketTimeout")).toInstance(Integer.valueOf(getProperty("export.rest.client.socketTimeout", properties)));<NEW_LINE>bind(String.class).annotatedWith(named("export.http.proxy.host")).toInstance<MASK><NEW_LINE>bind(Integer.class).annotatedWith(named("export.http.proxy.port")).toInstance(Integer.valueOf(getProperty("http.proxy.port", properties, "80")));<NEW_LINE>bind(Driver.class).to(DefaultRestDriver.class).in(SINGLETON);<NEW_LINE>bind(Driver.Configuration.class).to(DefaultDriverConfiguration.class);<NEW_LINE>LOGGER.debug("installed module: {}", ExportModule.class.getSimpleName());<NEW_LINE>} | (getProperty("http.proxy.host", properties)); |
571,316 | public void testRetrySixWithTwoPasses(PrintWriter out) throws Exception {<NEW_LINE>List<Instruction> instructions = new ArrayList<Instruction>(6);<NEW_LINE>instructions.addAll(Arrays.asList(Instruction.FAIL, Instruction.FAIL, Instruction.FAIL, Instruction.PASS, Instruction.FAIL, Instruction.PASS));<NEW_LINE>ProgrammableTriggerTask task = new ProgrammableTriggerTask(instructions);<NEW_LINE>TaskStatus<Void> status = scheduler.schedule(task, task);<NEW_LINE>for (long start = System.nanoTime(); status != null && System.nanoTime() - start < TIMEOUT_NS; Thread.sleep(POLL_INTERVAL)) status = scheduler.getStatus(status.getTaskId());<NEW_LINE>if (status != null) {<NEW_LINE>status.cancel(true);<NEW_LINE>throw new Exception("Task did not end successfully and autopurge within allotted interval. " + status);<NEW_LINE>}<NEW_LINE>final List<Instruction> results = new ArrayList<Instruction>();<NEW_LINE>for (Result result : task.getResultList()) results.add(result.getResult());<NEW_LINE>if (!instructions.equals(results))<NEW_LINE><MASK><NEW_LINE>} | throw new Exception("Results were inconsistent: " + results); |
727,540 | final GetChangeTokenResult executeGetChangeToken(GetChangeTokenRequest getChangeTokenRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getChangeTokenRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetChangeTokenRequest> request = null;<NEW_LINE>Response<GetChangeTokenResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetChangeTokenRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getChangeTokenRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "WAF");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetChangeToken");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetChangeTokenResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetChangeTokenResultJsonUnmarshaller());<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.SIGNING_REGION, getSigningRegion()); |
647,813 | private static ClientHello implParse(ByteArrayInputStream messageInput, OutputStream dtlsOutput) throws IOException {<NEW_LINE>InputStream input = messageInput;<NEW_LINE>if (null != dtlsOutput) {<NEW_LINE>input = new TeeInputStream(input, dtlsOutput);<NEW_LINE>}<NEW_LINE>ProtocolVersion clientVersion = TlsUtils.readVersion(input);<NEW_LINE>byte[] random = TlsUtils.readFully(32, input);<NEW_LINE>byte[] sessionID = TlsUtils.<MASK><NEW_LINE>byte[] cookie = null;<NEW_LINE>if (null != dtlsOutput) {<NEW_LINE>int maxCookieLength = ProtocolVersion.DTLSv12.isEqualOrEarlierVersionOf(clientVersion) ? 255 : 32;<NEW_LINE>cookie = TlsUtils.readOpaque8(messageInput, 0, maxCookieLength);<NEW_LINE>}<NEW_LINE>int cipher_suites_length = TlsUtils.readUint16(input);<NEW_LINE>if (cipher_suites_length < 2 || (cipher_suites_length & 1) != 0 || messageInput.available() < cipher_suites_length) {<NEW_LINE>throw new TlsFatalAlert(AlertDescription.decode_error);<NEW_LINE>}<NEW_LINE>int[] cipherSuites = TlsUtils.readUint16Array(cipher_suites_length / 2, input);<NEW_LINE>short[] compressionMethods = TlsUtils.readUint8ArrayWithUint8Length(input, 1);<NEW_LINE>if (!Arrays.contains(compressionMethods, CompressionMethod._null)) {<NEW_LINE>throw new TlsFatalAlert(AlertDescription.handshake_failure);<NEW_LINE>}<NEW_LINE>Hashtable extensions = null;<NEW_LINE>if (messageInput.available() > 0) {<NEW_LINE>byte[] extBytes = TlsUtils.readOpaque16(input);<NEW_LINE>TlsProtocol.assertEmpty(messageInput);<NEW_LINE>extensions = TlsProtocol.readExtensionsDataClientHello(extBytes);<NEW_LINE>}<NEW_LINE>return new ClientHello(clientVersion, random, sessionID, cookie, cipherSuites, extensions, -1);<NEW_LINE>} | readOpaque8(input, 0, 32); |
1,506,648 | private Dimension layoutSize(@Nonnull Function<Component, Dimension> size) {<NEW_LINE>Dimension titleSize = myTitleComponent == null ? new Dimension() : size.fun(myTitleComponent);<NEW_LINE>Dimension centeredSize = myCenteredComponent == null ? new Dimension() : size.fun(myCenteredComponent);<NEW_LINE>Dimension actionSize = myActionPanel == null ? new Dimension() : size.fun(myActionPanel);<NEW_LINE>Dimension expandSize = myExpandAction == null || myLayoutData.showMinSize ? new Dimension() : size.fun(myExpandAction);<NEW_LINE>int height = myLayoutData.configuration.topSpaceHeight + titleSize.height + centeredSize.height + Math.max(actionSize.height, expandSize.height) + myLayoutData.configuration.bottomSpaceHeight;<NEW_LINE>if (titleSize.height > 0 && centeredSize.height > 0) {<NEW_LINE>height += myLayoutData.configuration.titleContentSpaceHeight;<NEW_LINE>}<NEW_LINE>if (centeredSize.height > 0 && actionSize.height > 0) {<NEW_LINE>height += myLayoutData.configuration.contentActionsSpaceHeight;<NEW_LINE>}<NEW_LINE>if (titleSize.height > 0 && actionSize.height > 0) {<NEW_LINE>height += myLayoutData.configuration.titleActionsSpaceHeight;<NEW_LINE>}<NEW_LINE>int titleWidth = titleSize.width + myLayoutData.configuration.closeOffset;<NEW_LINE>int centerWidth = centeredSize<MASK><NEW_LINE>int actionWidth = actionSize.width + expandSize.width;<NEW_LINE>int width = Math.max(centerWidth, Math.max(titleWidth, actionWidth));<NEW_LINE>if (!myLayoutData.showFullContent) {<NEW_LINE>width = Math.min(width, BalloonLayoutConfiguration.MaxWidth());<NEW_LINE>}<NEW_LINE>width = Math.max(width, BalloonLayoutConfiguration.MinWidth());<NEW_LINE>return new Dimension(width, height);<NEW_LINE>} | .width + myLayoutData.configuration.closeOffset; |
69,794 | public void install() {<NEW_LINE>File targetDirectory = null;<NEW_LINE>JavaHomeHandler javaHomeHandler = null;<NEW_LINE>if (_commandLine.hasConsoleOption()) {<NEW_LINE>welcome();<NEW_LINE>selectLanguage();<NEW_LINE>acceptLicense();<NEW_LINE>InstallationType installationType = selectInstallationType();<NEW_LINE>targetDirectory = determineTargetDirectory();<NEW_LINE>javaHomeHandler = checkVersion(determineJavaHome());<NEW_LINE>promptForCopying(targetDirectory, installationType, javaHomeHandler);<NEW_LINE>_jarInstaller.inflate(targetDirectory, installationType, javaHomeHandler);<NEW_LINE>showReadme(targetDirectory);<NEW_LINE>success(targetDirectory);<NEW_LINE>} else if (_commandLine.hasSilentOption()) {<NEW_LINE>message(getText(C_SILENT_INSTALLATION));<NEW_LINE>targetDirectory = _commandLine.getTargetDirectory();<NEW_LINE>checkTargetDirectorySilent(targetDirectory);<NEW_LINE>javaHomeHandler = <MASK><NEW_LINE>_jarInstaller.inflate(targetDirectory, _commandLine.getInstallationType(), javaHomeHandler);<NEW_LINE>success(targetDirectory);<NEW_LINE>}<NEW_LINE>} | checkVersionSilent(_commandLine.getJavaHomeHandler()); |
1,235,288 | private static AlertDialog.Builder buildUnblockFor(@NonNull Context context, @NonNull Recipient recipient, @NonNull Runnable onUnblock) {<NEW_LINE>recipient = recipient.resolve();<NEW_LINE>AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context);<NEW_LINE>Resources resources = context.getResources();<NEW_LINE>if (recipient.isGroup()) {<NEW_LINE>if (SignalDatabase.groups().isActive(recipient.requireGroupId())) {<NEW_LINE>builder.setTitle(resources.getString(R.string.BlockUnblockDialog_unblock_s, recipient.getDisplayName(context)));<NEW_LINE>builder.setMessage(R.string.BlockUnblockDialog_group_members_will_be_able_to_add_you);<NEW_LINE>builder.setPositiveButton(R.string.RecipientPreferenceActivity_unblock, ((dialog, which) -> onUnblock.run()));<NEW_LINE>builder.setNegativeButton(android.R.string.cancel, null);<NEW_LINE>} else {<NEW_LINE>builder.setTitle(resources.getString(R.string.BlockUnblockDialog_unblock_s, recipient.getDisplayName(context)));<NEW_LINE>builder.setMessage(R.string.BlockUnblockDialog_group_members_will_be_able_to_add_you);<NEW_LINE>builder.setPositiveButton(R.string.RecipientPreferenceActivity_unblock, ((dialog, which) -> onUnblock.run()));<NEW_LINE>builder.setNegativeButton(android.R.string.cancel, null);<NEW_LINE>}<NEW_LINE>} else if (recipient.isReleaseNotes()) {<NEW_LINE>builder.setTitle(resources.getString(R.string.BlockUnblockDialog_unblock_s, recipient.getDisplayName(context)));<NEW_LINE>builder.setMessage(R.string.BlockUnblockDialog_resume_getting_signal_updates_and_news);<NEW_LINE>builder.setPositiveButton(R.string.RecipientPreferenceActivity_unblock, ((dialog, which) -> onUnblock.run()));<NEW_LINE>builder.setNegativeButton(android.R.string.cancel, null);<NEW_LINE>} else {<NEW_LINE>builder.setTitle(resources.getString(R.string.BlockUnblockDialog_unblock_s, recipient.getDisplayName(context)));<NEW_LINE>builder.setMessage(R.string.BlockUnblockDialog_you_will_be_able_to_call_and_message_each_other);<NEW_LINE>builder.setPositiveButton(R.string.RecipientPreferenceActivity_unblock, ((dialog, which) -> onUnblock.run()));<NEW_LINE>builder.setNegativeButton(android.<MASK><NEW_LINE>}<NEW_LINE>return builder;<NEW_LINE>} | R.string.cancel, null); |
1,816,376 | public void accept(XMLEvent event, SynchronousSink<List<XMLEvent>> sink) {<NEW_LINE>if (event.isStartElement()) {<NEW_LINE>if (this.barrier == Integer.MAX_VALUE) {<NEW_LINE>QName startElementName = event<MASK><NEW_LINE>if (this.desiredName.equals(startElementName)) {<NEW_LINE>this.events = new ArrayList<>();<NEW_LINE>this.barrier = this.elementDepth;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.elementDepth++;<NEW_LINE>}<NEW_LINE>if (this.elementDepth > this.barrier) {<NEW_LINE>Assert.state(this.events != null, "No XMLEvent List");<NEW_LINE>this.events.add(event);<NEW_LINE>}<NEW_LINE>if (event.isEndElement()) {<NEW_LINE>this.elementDepth--;<NEW_LINE>if (this.elementDepth == this.barrier) {<NEW_LINE>this.barrier = Integer.MAX_VALUE;<NEW_LINE>Assert.state(this.events != null, "No XMLEvent List");<NEW_LINE>sink.next(this.events);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .asStartElement().getName(); |
1,697,620 | private Mono<Response<Flux<ByteBuffer>>> upgradeWithResponseAsync(String resourceGroupName, String diskPoolName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (diskPoolName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.upgrade(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, diskPoolName, this.client.getApiVersion(), accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); |
1,843,233 | private void displayPopupEditor() {<NEW_LINE>PopupPropertySheet<T> sheet = new PopupPropertySheet<>(item, this);<NEW_LINE>sheet.setPrefWidth(500);<NEW_LINE>Alert alert = new Alert(Alert.AlertType.NONE);<NEW_LINE>// alert.setWidth(700);<NEW_LINE>// alert.setResizable(true);<NEW_LINE>alert.setResizable(false);<NEW_LINE>alert.getDialogPane().setContent(sheet);<NEW_LINE>alert.setTitle("Popup Property Editor");<NEW_LINE>ButtonType saveButton = new ButtonType("Save", ButtonBar.ButtonData.OK_DONE);<NEW_LINE>ButtonType testButton = new ButtonType(<MASK><NEW_LINE>alert.getButtonTypes().addAll(ButtonType.CANCEL, saveButton, testButton);<NEW_LINE>final Button btTest = (Button) alert.getDialogPane().lookupButton(testButton);<NEW_LINE>btTest.addEventFilter(ActionEvent.ACTION, event -> {<NEW_LINE>Address addr = null;<NEW_LINE>if (item.getValue() != null && item.getValue() instanceof Address) {<NEW_LINE>addr = (Address) item.getValue();<NEW_LINE>} else if (sheet.getBean() != null && sheet.getBean() instanceof Address) {<NEW_LINE>addr = (Address) sheet.getBean();<NEW_LINE>}<NEW_LINE>if (addr != null) {<NEW_LINE>int pc = (int) (Math.random() * 8000);<NEW_LINE>addr.setPostcode(Integer.toString(pc));<NEW_LINE>}<NEW_LINE>event.consume();<NEW_LINE>});<NEW_LINE>Optional<ButtonType> response = alert.showAndWait();<NEW_LINE>if (response.isPresent() && saveButton.equals(response.get())) {<NEW_LINE>item.setValue(sheet.getBean());<NEW_LINE>btnEditor.setText(sheet.getBean().toString());<NEW_LINE>}<NEW_LINE>} | "Change Postcode", ButtonBar.ButtonData.OTHER); |
406,882 | protected String layoutCL(final JLabel label, final FontMetrics fontMetrics, final String text, final Icon icon, final Rectangle viewR, final Rectangle iconR, final Rectangle textR) {<NEW_LINE>final ZoomableLabel zLabel = (ZoomableLabel) label;<NEW_LINE>final float zoom = zLabel.getZoom();<NEW_LINE>if (isPainting) {<NEW_LINE>final Insets insets = zLabel.getInsets();<NEW_LINE>final int width = zLabel.getWidth();<NEW_LINE>final int height = zLabel.getHeight();<NEW_LINE>viewR.x = insets.left;<NEW_LINE>viewR.y = insets.top;<NEW_LINE>viewR.width = (int) (width / zoom) - (insets.left + insets.right);<NEW_LINE>viewR.height = (int) (height / zoom) - (insets.top + insets.bottom);<NEW_LINE>if (viewR.width < 0)<NEW_LINE>viewR.width = 0;<NEW_LINE>} else {<NEW_LINE>if (zLabel.getMaximumWidth() != Integer.MAX_VALUE) {<NEW_LINE>final int maximumWidth = (int) (zLabel.getMaximumWidth() / zoom);<NEW_LINE>final Insets insets = label.getInsets();<NEW_LINE>viewR.width = maximumWidth - insets.left - insets.right;<NEW_LINE>if (viewR.width < 0)<NEW_LINE>viewR.width = 0;<NEW_LINE>ScaledHTML.Renderer v = (ScaledHTML.Renderer) <MASK><NEW_LINE>if (v != null) {<NEW_LINE>int availableTextWidth = viewR.width;<NEW_LINE>if (icon != null)<NEW_LINE>availableTextWidth -= icon.getIconWidth() + label.getIconTextGap();<NEW_LINE>float minimumWidth = v.getMinimumSpan(View.X_AXIS);<NEW_LINE>if (minimumWidth > availableTextWidth) {<NEW_LINE>viewR.width += minimumWidth - availableTextWidth;<NEW_LINE>availableTextWidth = (int) minimumWidth;<NEW_LINE>}<NEW_LINE>int currentWidth = v.getWidth();<NEW_LINE>if (currentWidth != availableTextWidth) {<NEW_LINE>float viewPreferredWidth = v.getPreferredWidth();<NEW_LINE>if (viewPreferredWidth > availableTextWidth) {<NEW_LINE>v.setWidth(availableTextWidth);<NEW_LINE>super.layoutCL(zLabel, zLabel.getFontMetrics(), text, icon, viewR, iconR, textR);<NEW_LINE>return text;<NEW_LINE>} else if (currentWidth != viewPreferredWidth)<NEW_LINE>v.resetWidth();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Icon textRenderingIcon = zLabel.getTextRenderingIcon();<NEW_LINE>if (textRenderingIcon != null) {<NEW_LINE>layoutLabelWithTextIcon(textRenderingIcon, icon, viewR, iconR, textR, zLabel);<NEW_LINE>} else<NEW_LINE>super.layoutCL(zLabel, zLabel.getFontMetrics(), text, icon, viewR, iconR, textR);<NEW_LINE>return text;<NEW_LINE>} | label.getClientProperty(BasicHTML.propertyKey); |
607,077 | public static String computeFitText(JTable table, int rowIdx, int columnIdx, String text) {<NEW_LINE>// NOI18N<NEW_LINE>if (text == null)<NEW_LINE>text = "";<NEW_LINE>if (text.length() <= VISIBLE_START_CHARS + 3)<NEW_LINE>return text;<NEW_LINE>FontMetrics fm = table.<MASK><NEW_LINE>int width = table.getCellRect(rowIdx, columnIdx, false).width;<NEW_LINE>// NOI18N<NEW_LINE>String sufix = "...";<NEW_LINE>// NOI18N<NEW_LINE>int sufixLength = fm.stringWidth(sufix + " ");<NEW_LINE>int desired = width - sufixLength;<NEW_LINE>if (desired <= 0)<NEW_LINE>return text;<NEW_LINE>for (int i = 0; i <= text.length() - 1; i++) {<NEW_LINE>String prefix = text.substring(0, i);<NEW_LINE>int swidth = fm.stringWidth(prefix);<NEW_LINE>if (swidth >= desired) {<NEW_LINE>return prefix.length() > 0 ? prefix + sufix : text;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return text;<NEW_LINE>} | getFontMetrics(table.getFont()); |
1,801,227 | public WebIntentBuilder build() {<NEW_LINE>if (webpage == null) {<NEW_LINE>throw new RuntimeException("URL cannot be null.");<NEW_LINE>}<NEW_LINE>if (forceExternal || shouldAlwaysForceExternal(webpage) || settings.browserSelection.equals("external")) {<NEW_LINE>// request the external browser<NEW_LINE>intent = new Intent(Intent.ACTION_VIEW, Uri.parse(webpage));<NEW_LINE>intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>} else if (settings.browserSelection.equals("article")) {<NEW_LINE>articleIntent = new ArticleIntent.Builder(context, APIKeys.ARTICLE_API_KEY).build();<NEW_LINE>} else if (settings.browserSelection.equals("custom_tab")) {<NEW_LINE>// add the share action<NEW_LINE>Intent shareIntent = new Intent(Intent.ACTION_SEND);<NEW_LINE>String extraText = webpage;<NEW_LINE>shareIntent.<MASK><NEW_LINE>shareIntent.setType("text/plain");<NEW_LINE>Random random = new Random();<NEW_LINE>PendingIntent pendingIntent = PendingIntent.getActivity(context, random.nextInt(Integer.MAX_VALUE), shareIntent, 0);<NEW_LINE>customTab = new CustomTabsIntent.Builder(null).setShowTitle(true).setActionButton(((BitmapDrawable) context.getResources().getDrawable(R.drawable.ic_action_share_light)).getBitmap(), "Share", pendingIntent).build();<NEW_LINE>} else {<NEW_LINE>// fallback to in app browser<NEW_LINE>intent = new Intent(context, BrowserActivity.class);<NEW_LINE>intent.putExtra("url", webpage);<NEW_LINE>intent.setFlags(0);<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>} | putExtra(Intent.EXTRA_TEXT, extraText); |
1,386,496 | // TODO(bleichen): Mabye implement write(ByteBuffer) so that<NEW_LINE>// there are no surprises if the underlying class is extended.<NEW_LINE>@Override<NEW_LINE>public synchronized void write(byte[] pt, int offset, int length) throws IOException {<NEW_LINE>if (!open) {<NEW_LINE>throw new IOException("Trying to write to closed stream");<NEW_LINE>}<NEW_LINE>int startPosition = offset;<NEW_LINE>int remaining = length;<NEW_LINE>while (remaining > ptBuffer.remaining()) {<NEW_LINE>int sliceSize = ptBuffer.remaining();<NEW_LINE>ByteBuffer slice = ByteBuffer.<MASK><NEW_LINE>startPosition += sliceSize;<NEW_LINE>remaining -= sliceSize;<NEW_LINE>try {<NEW_LINE>ptBuffer.flip();<NEW_LINE>ctBuffer.clear();<NEW_LINE>encrypter.encryptSegment(ptBuffer, slice, false, ctBuffer);<NEW_LINE>} catch (GeneralSecurityException ex) {<NEW_LINE>throw new IOException(ex);<NEW_LINE>}<NEW_LINE>ctBuffer.flip();<NEW_LINE>out.write(ctBuffer.array(), ctBuffer.position(), ctBuffer.remaining());<NEW_LINE>ptBuffer.clear();<NEW_LINE>ptBuffer.limit(plaintextSegmentSize);<NEW_LINE>}<NEW_LINE>ptBuffer.put(pt, startPosition, remaining);<NEW_LINE>} | wrap(pt, startPosition, sliceSize); |
920,401 | private Throwable createException(Iterator<ErrorHolder> iterator) {<NEW_LINE>if (!iterator.hasNext()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ErrorHolder errorHolder = iterator.next();<NEW_LINE>ExceptionFactory exceptionFactory = intToFactory.get(errorHolder.getErrorCode());<NEW_LINE>Throwable throwable = null;<NEW_LINE>if (exceptionFactory == null) {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>Class<? extends Throwable> exceptionClass = (Class<? extends Throwable>) ClassLoaderUtil.loadClass(classLoader, className);<NEW_LINE>throwable = ExceptionUtil.tryCreateExceptionWithMessageAndCause(exceptionClass, errorHolder.getMessage(), createException(iterator));<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>EmptyStatement.ignore(e);<NEW_LINE>}<NEW_LINE>if (throwable == null) {<NEW_LINE>throwable = new UndefinedErrorCodeException(errorHolder.getMessage(), className, createException(iterator));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throwable = exceptionFactory.createException(errorHolder.getMessage(), createException(iterator));<NEW_LINE>}<NEW_LINE>throwable.setStackTrace(errorHolder.getStackTraceElements().toArray(new StackTraceElement[0]));<NEW_LINE>return throwable;<NEW_LINE>} | String className = errorHolder.getClassName(); |
928,681 | public void notifyDownload(SpeedManagerLimitEstimate estimate) {<NEW_LINE>int bestLimit = <MASK><NEW_LINE>SpeedManagerLogger.trace("notifyDownload downloadLimitMax=" + downloadLimitMax + " conf=" + downloadLimitConf.getString() + " (" + downloadLimitConf.asEstimateType() + ")");<NEW_LINE>tempLogEstimate(estimate);<NEW_LINE>if (downloadLimitMax != bestLimit) {<NEW_LINE>// update COConfiguration<NEW_LINE>SpeedManagerLogger.log("persistent PingMap changed download limit to " + bestLimit);<NEW_LINE>downloadLimitMax = bestLimit;<NEW_LINE>COConfigurationManager.setParameter(SpeedManagerAlgorithmProviderV2.SETTING_DOWNLOAD_MAX_LIMIT, bestLimit);<NEW_LINE>}<NEW_LINE>downloadLimitMin = SMConst.calculateMinDownload(downloadLimitMax);<NEW_LINE>slider.updateLimits(uploadLimitMax, uploadLimitMin, downloadLimitMax, downloadLimitMin);<NEW_LINE>if (estimate.getBytesPerSec() != 0) {<NEW_LINE>slider.setDownloadUnlimitedMode(false);<NEW_LINE>} else {<NEW_LINE>slider.setDownloadUnlimitedMode(true);<NEW_LINE>}<NEW_LINE>SMSearchLogger.log("download " + downloadLimitMax);<NEW_LINE>} | choseBestLimit(estimate, downloadLimitMax, downloadLimitConf); |
689,841 | private void dbUpdatePriceLists(@NonNull final ImportRecordsSelection selection, @NonNull final Properties ctx, @NonNull final String nameToMatch) {<NEW_LINE>final int <MASK><NEW_LINE>final StringBuilder sql = new StringBuilder("UPDATE ").append(targetTableName + " i set ").append(nameToMatch).append("_Price_List_ID=(select pl.M_PriceList_ID from M_PriceList pl ").append(" where pl.InternalName=?").append(" and pl.AD_Client_ID=?").append(" and pl.IsActive='Y' order by pl.M_PriceList_ID limit 1)").append(" where true").append(" and " + COLUMNNAME_I_IsImported + "<>'Y'").append(selection.toSqlWhereClause("i"));<NEW_LINE>final Object[] params = new Object[] { nameToMatch, adClientId };<NEW_LINE>DB.executeUpdateEx(sql.toString(), params, ITrx.TRXNAME_ThreadInherited);<NEW_LINE>} | adClientId = Env.getAD_Client_ID(ctx); |
1,479,785 | private void importUsersFromSO(List<Map<String, Object>> objs, List<ParaObject> toImport) throws ParseException {<NEW_LINE>logger.info("Importing {} users...", objs.size());<NEW_LINE>for (Map<String, Object> obj : objs) {<NEW_LINE>User u = new User();<NEW_LINE>u.setId("user_" + (Integer) obj.get("id"));<NEW_LINE>u.setTimestamp(DateUtils.parseDate((String) obj.get("creationDate"), soDateFormat1, soDateFormat2).getTime());<NEW_LINE>u.setActive(true);<NEW_LINE>u.setCreatorid(((Integer) obj.get("accountId")).toString());<NEW_LINE>u.setGroups("admin".equalsIgnoreCase((String) obj.get("userTypeId")) ? User.Groups.ADMINS.toString() : User.Groups.USERS.toString());<NEW_LINE>u.setEmail(<MASK><NEW_LINE>u.setIdentifier(u.getEmail());<NEW_LINE>u.setName((String) obj.get("realName"));<NEW_LINE>String lastLogin = (String) obj.get("lastLoginDate");<NEW_LINE>u.setUpdated(StringUtils.isBlank(lastLogin) ? null : DateUtils.parseDate(lastLogin, soDateFormat1, soDateFormat2).getTime());<NEW_LINE>u.setPicture((String) obj.get("profileImageUrl"));<NEW_LINE>u.setPassword(Utils.generateSecurityToken(10));<NEW_LINE>Profile p = Profile.fromUser(u);<NEW_LINE>p.setVotes((Integer) obj.get("reputation"));<NEW_LINE>p.setAboutme((String) obj.getOrDefault("title", ""));<NEW_LINE>p.setLastseen(u.getUpdated());<NEW_LINE>toImport.add(u);<NEW_LINE>toImport.add(p);<NEW_LINE>}<NEW_LINE>pc.createAll(toImport);<NEW_LINE>} | u.getId() + "@scoold.com"); |
1,086,284 | private void applyRename(RenameEntry entry) {<NEW_LINE>if (entry.hasDstPath()) {<NEW_LINE>entry = rewriteDeprecatedRenameEntry(entry);<NEW_LINE>}<NEW_LINE>MutableInode<?> inode = mInodeStore.getMutable(entry.getId()).get();<NEW_LINE>long oldParent = inode.getParentId();<NEW_LINE>long newParent = entry.getNewParentId();<NEW_LINE>mInodeStore.removeChild(<MASK><NEW_LINE>inode.setName(entry.getNewName());<NEW_LINE>mInodeStore.addChild(newParent, inode);<NEW_LINE>inode.setParentId(newParent);<NEW_LINE>mInodeStore.writeInode(inode);<NEW_LINE>if (oldParent == newParent) {<NEW_LINE>updateTimestampsAndChildCount(oldParent, entry.getOpTimeMs(), 0);<NEW_LINE>} else {<NEW_LINE>updateTimestampsAndChildCount(oldParent, entry.getOpTimeMs(), -1);<NEW_LINE>updateTimestampsAndChildCount(newParent, entry.getOpTimeMs(), 1);<NEW_LINE>}<NEW_LINE>} | oldParent, inode.getName()); |
1,244,827 | final CreateTokenResult executeCreateToken(CreateTokenRequest createTokenRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createTokenRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateTokenRequest> request = null;<NEW_LINE>Response<CreateTokenResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateTokenRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createTokenRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "AmplifyBackend");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateToken");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateTokenResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateTokenResultJsonUnmarshaller());<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.SIGNING_REGION, getSigningRegion()); |
1,105,552 | public String refund(@RequestAttribute SysSite site, @SessionAttribute SysUser user, TradeRefund entity, String returnUrl, HttpServletRequest request, HttpSession session, ModelMap model) {<NEW_LINE>Map<String, String> config = configComponent.getConfigData(site.getId(), Config.CONFIG_CODE_SITE);<NEW_LINE>String safeReturnUrl = <MASK><NEW_LINE>if (ControllerUtils.isUnSafeUrl(returnUrl, site, safeReturnUrl, request)) {<NEW_LINE>returnUrl = site.isUseStatic() ? site.getSitePath() : site.getDynamicPath();<NEW_LINE>}<NEW_LINE>if (null != user && ControllerUtils.verifyCustom("tradePaymentStatus", !service.pendingRefund(site.getId(), entity.getPaymentId()), model)) {<NEW_LINE>return UrlBasedViewResolver.REDIRECT_URL_PREFIX + returnUrl;<NEW_LINE>}<NEW_LINE>if (null == entity.getId()) {<NEW_LINE>entity.setSiteId(site.getId());<NEW_LINE>entity.setRefundAmount(null);<NEW_LINE>entity.setReply(null);<NEW_LINE>entity.setRefundUserId(null);<NEW_LINE>entity.setUserId(user.getId());<NEW_LINE>entity.setStatus(TradeRefundService.STATUS_PENDING);<NEW_LINE>entity.setCreateDate(null);<NEW_LINE>refundService.save(entity);<NEW_LINE>} else {<NEW_LINE>refundService.updateAmound(entity.getId(), user.getId(), entity.getAmount(), entity.getReason());<NEW_LINE>}<NEW_LINE>return UrlBasedViewResolver.REDIRECT_URL_PREFIX + returnUrl;<NEW_LINE>} | config.get(LoginConfigComponent.CONFIG_RETURN_URL); |
1,589,909 | private String attribute(XMLStreamReader parser, String nsURI, String localname) {<NEW_LINE>int x = parser.getAttributeCount();<NEW_LINE>if (x > 1)<NEW_LINE>// Namespaces?<NEW_LINE>staxError(parser.getLocation()<MASK><NEW_LINE>if (x == 0)<NEW_LINE>return null;<NEW_LINE>String attrPX = parser.getAttributePrefix(0);<NEW_LINE>String attrNS = parser.getAttributeNamespace(0);<NEW_LINE>if (attrNS == null)<NEW_LINE>attrNS = parser.getName().getNamespaceURI();<NEW_LINE>String attrLN = parser.getAttributeLocalName(0);<NEW_LINE>if (!Objects.equals(nsURI, attrNS) || !Objects.equals(attrLN, localname)) {<NEW_LINE>staxError(parser.getLocation(), "Unexpected attribute : " + attrPX + ":" + attrLN + " at " + tagName(parser));<NEW_LINE>}<NEW_LINE>String attrVal = parser.getAttributeValue(0);<NEW_LINE>return attrVal;<NEW_LINE>} | , "Multiple attributes : only one allowed : " + tagName(parser)); |
1,807,319 | public static ModularClassPath resolveDependencies(List<String> deps, List<MavenRepo> repos, boolean offline, boolean updateCache, boolean loggingEnabled, boolean transitivity) {<NEW_LINE>// if no dependencies were provided we stop here<NEW_LINE>if (deps.isEmpty()) {<NEW_LINE>return new ModularClassPath(Collections.emptyList());<NEW_LINE>}<NEW_LINE>if (repos.isEmpty()) {<NEW_LINE>repos = new ArrayList<>();<NEW_LINE>repos.add(toMavenRepo("mavencentral"));<NEW_LINE>}<NEW_LINE>// Turn any URL dependencies into regular GAV coordinates<NEW_LINE>List<String> depIds = deps.stream().map(JitPackUtil::ensureGAV).collect(Collectors.toList());<NEW_LINE>// And if we encountered URLs let's make sure the JitPack repo is available<NEW_LINE>if (!depIds.equals(deps) && !repos.stream().anyMatch(r -> REPO_JITPACK.equals(r.getUrl()))) {<NEW_LINE>repos.add(toMavenRepo(ALIAS_JITPACK));<NEW_LINE>}<NEW_LINE>String depsHash = String.join(CP_SEPARATOR, depIds);<NEW_LINE>if (!transitivity) {<NEW_LINE>// the cached key need to be different for non-transivity<NEW_LINE>depsHash = "notransitivity-" + depsHash;<NEW_LINE>}<NEW_LINE>List<ArtifactInfo> cachedDeps = null;<NEW_LINE>if (!updateCache) {<NEW_LINE>cachedDeps = DependencyCache.findDependenciesByHash(depsHash);<NEW_LINE>if (cachedDeps != null) {<NEW_LINE>return new ModularClassPath(cachedDeps);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (loggingEnabled) {<NEW_LINE>infoMsg("Resolving dependencies...");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>List<ArtifactInfo> artifacts = resolveDependenciesViaAether(depIds, repos, offline, loggingEnabled, transitivity);<NEW_LINE>ModularClassPath classPath = new ModularClassPath(artifacts);<NEW_LINE>if (loggingEnabled) {<NEW_LINE>infoMsg("Dependencies resolved");<NEW_LINE>}<NEW_LINE>DependencyCache.cache(depsHash, classPath.getArtifacts());<NEW_LINE>// Print the classpath<NEW_LINE>return classPath;<NEW_LINE>} catch (DependencyException e) {<NEW_LINE>// Probably a wrapped Nullpointer from<NEW_LINE>// 'DefaultRepositorySystem.resolveDependencies()', this however is probably<NEW_LINE>// a connection problem.<NEW_LINE>errorMsg("Exception: " + e.getMessage());<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>} | ExitException(0, "Failed while connecting to the server. Check the connection (http/https, port, proxy, credentials, etc.) of your maven dependency locators.", e); |
77,066 | protected void encodeMarkup(FacesContext context, InputNumber inputNumber, Object value, String valueToRender) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>String clientId = inputNumber.getClientId(context);<NEW_LINE>String styleClass = inputNumber.getStyleClass();<NEW_LINE>styleClass = styleClass == null ? InputNumber.STYLE_CLASS : InputNumber.STYLE_CLASS + " " + styleClass;<NEW_LINE>// see #3706<NEW_LINE>styleClass = inputNumber.isValid() ? styleClass : styleClass + " ui-state-error";<NEW_LINE>writer.startElement("span", inputNumber);<NEW_LINE>writer.writeAttribute("id", clientId, null);<NEW_LINE>writer.writeAttribute("class", styleClass, "styleClass");<NEW_LINE>if (inputNumber.getStyle() != null) {<NEW_LINE>writer.writeAttribute("style", inputNumber.getStyle(), "style");<NEW_LINE>}<NEW_LINE>encodeInput(<MASK><NEW_LINE>encodeHiddenInput(context, inputNumber, clientId, valueToRender);<NEW_LINE>writer.endElement("span");<NEW_LINE>} | context, inputNumber, clientId, valueToRender); |
572,668 | public Composite createPreferenceComposite(Composite parent, final IBuildParticipantWorkingCopy participant) {<NEW_LINE>Composite master = new Composite(parent, SWT.NONE);<NEW_LINE>master.setLayout(GridLayoutFactory.fillDefaults().create());<NEW_LINE>GridDataFactory fillHoriz = GridDataFactory.fillDefaults().grab(true, false);<NEW_LINE>// Options<NEW_LINE>Group group = new Group(master, SWT.BORDER);<NEW_LINE>group.setText(Messages.JSParserValidatorPreferenceCompositeFactory_OptionsGroup);<NEW_LINE>group.setLayout(new GridLayout());<NEW_LINE>group.setLayoutData(fillHoriz.create());<NEW_LINE>Composite pairs = new Composite(group, SWT.NONE);<NEW_LINE>pairs.setLayout(GridLayoutFactory.fillDefaults().numColumns<MASK><NEW_LINE>Label label = new Label(pairs, SWT.WRAP);<NEW_LINE>label.setText(Messages.JSParserValidatorPreferenceCompositeFactory_MissingSemicolons);<NEW_LINE>Combo combo = new Combo(pairs, SWT.READ_ONLY | SWT.SINGLE);<NEW_LINE>for (IProblem.Severity severity : IProblem.Severity.values()) {<NEW_LINE>combo.add(severity.label());<NEW_LINE>combo.setData(severity.label(), severity);<NEW_LINE>}<NEW_LINE>String severityValue = participant.getPreferenceString(IPreferenceConstants.PREF_MISSING_SEMICOLON_SEVERITY);<NEW_LINE>combo.setText(IProblem.Severity.create(severityValue).label());<NEW_LINE>combo.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>Combo c = ((Combo) e.widget);<NEW_LINE>int index = c.getSelectionIndex();<NEW_LINE>String text = c.getItem(index);<NEW_LINE>IProblem.Severity s = (Severity) c.getData(text);<NEW_LINE>participant.setPreference(IPreferenceConstants.PREF_MISSING_SEMICOLON_SEVERITY, s.id());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>fillHoriz.applyTo(pairs);<NEW_LINE>// Filters<NEW_LINE>Composite filtersGroup = new ValidatorFiltersPreferenceComposite(master, participant);<NEW_LINE>filtersGroup.setLayoutData(fillHoriz.grab(true, true).hint(SWT.DEFAULT, 150).create());<NEW_LINE>return master;<NEW_LINE>} | (2).create()); |
334,488 | public void promoteLocalLiteMember() {<NEW_LINE>MemberImpl member = getLocalMember();<NEW_LINE>if (!member.isLiteMember()) {<NEW_LINE>throw new IllegalStateException(member + " is not a lite member!");<NEW_LINE>}<NEW_LINE>MemberImpl master = getMasterMember();<NEW_LINE>PromoteLiteMemberOp op = new PromoteLiteMemberOp();<NEW_LINE>op.setCallerUuid(member.getUuid());<NEW_LINE>InvocationFuture<MembersView> future = nodeEngine.getOperationService().invokeOnTarget(SERVICE_NAME, op, master.getAddress());<NEW_LINE>MembersView view = future.joinInternal();<NEW_LINE>lock.lock();<NEW_LINE>try {<NEW_LINE>if (!member.getAddress().equals(master.getAddress())) {<NEW_LINE>updateMembers(view, master.getAddress(), master.getUuid(), getThisUuid());<NEW_LINE>}<NEW_LINE>MemberImpl localMemberInMemberList = membershipManager.getMember(member.getAddress());<NEW_LINE><MASK><NEW_LINE>node.getNodeExtension().getAuditlogService().eventBuilder(AuditlogTypeIds.CLUSTER_PROMOTE_MEMBER).message("Promotion of the lite member").addParameter("success", result).addParameter("address", node.getThisAddress()).log();<NEW_LINE>if (result) {<NEW_LINE>throw new IllegalStateException("Cannot promote to data member! Previous master was: " + master.getAddress() + ", Current master is: " + getMasterAddress());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>lock.unlock();<NEW_LINE>}<NEW_LINE>} | boolean result = localMemberInMemberList.isLiteMember(); |
537,389 | public ChangeInfo implement() {<NEW_LINE>PickOrCreateFieldPanel pnlPickOrCreateField = new PickOrCreateFieldPanel();<NEW_LINE>pnlPickOrCreateField.setAvailableFields(getAvailableFields());<NEW_LINE>pnlPickOrCreateField.setFileObject(fileObject);<NEW_LINE>DialogDescriptor ddesc = new DialogDescriptor(pnlPickOrCreateField, NbBundle.getMessage<MASK><NEW_LINE>ddesc.createNotificationLineSupport();<NEW_LINE>Dialog dlg = DialogDisplayer.getDefault().createDialog(ddesc);<NEW_LINE>pnlPickOrCreateField.setDlgDescriptor(ddesc);<NEW_LINE>dlg.setLocationRelativeTo(null);<NEW_LINE>dlg.setVisible(true);<NEW_LINE>if (ddesc.getValue() == DialogDescriptor.OK_OPTION) {<NEW_LINE>if (pnlPickOrCreateField.wasCreateNewFieldSelected()) {<NEW_LINE>createIDField(pnlPickOrCreateField.getNewIdName(), pnlPickOrCreateField.getSelectedIdType());<NEW_LINE>} else {<NEW_LINE>// pick existing<NEW_LINE>String fieldName = (String) pnlPickOrCreateField.getSelectedField();<NEW_LINE>createIDField(fieldName, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | (CreateId.class, "LBL_AddIDAnnotationDlgTitle")); |
1,184,671 | ContentResponse processX509CertRequest(final String csr, final List<Integer> extKeyUsage, int expiryTime, int retryCount) {<NEW_LINE>ContentResponse response = null;<NEW_LINE>try {<NEW_LINE>Request request = httpClient.POST(x509CertUri);<NEW_LINE>request.<MASK><NEW_LINE>request.header(HttpHeader.CONTENT_TYPE, CONTENT_JSON);<NEW_LINE>X509CertSignObject csrCert = new X509CertSignObject();<NEW_LINE>csrCert.setPem(csr);<NEW_LINE>csrCert.setX509ExtKeyUsage(extKeyUsage);<NEW_LINE>if (expiryTime > 0 && expiryTime < maxCertExpiryTimeMins) {<NEW_LINE>csrCert.setExpiryTime(expiryTime);<NEW_LINE>}<NEW_LINE>request.content(new StringContentProvider(JSON.string(csrCert)), CONTENT_JSON);<NEW_LINE>// our max timeout is going to be 30 seconds. By default<NEW_LINE>// we're picking a small value to quickly recognize when<NEW_LINE>// our idle connections are disconnected by certsigner but<NEW_LINE>// we won't allow any connections taking longer than 30 secs<NEW_LINE>long timeout = retryCount * requestTimeout;<NEW_LINE>if (timeout > 30) {<NEW_LINE>timeout = 30;<NEW_LINE>}<NEW_LINE>request.timeout(timeout, TimeUnit.SECONDS);<NEW_LINE>response = request.send();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>LOGGER.error("Unable to process x509 certificate request", ex);<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>} | header(HttpHeader.ACCEPT, CONTENT_JSON); |
31,718 | private void initControllerView(View v) {<NEW_LINE>mPauseButton = v.<MASK><NEW_LINE>if (mPauseButton != null) {<NEW_LINE>mPauseButton.requestFocus();<NEW_LINE>mPauseButton.setOnClickListener(mPauseListener);<NEW_LINE>}<NEW_LINE>mFullscreenButton = v.findViewById(R.id.fullscreen_mode_button);<NEW_LINE>if (mFullscreenButton != null) {<NEW_LINE>mFullscreenButton.requestFocus();<NEW_LINE>mFullscreenButton.setOnClickListener(mFullscreenListener);<NEW_LINE>}<NEW_LINE>mFastForwardButton = v.findViewById(R.id.fast_forward_button);<NEW_LINE>if (mFastForwardButton != null) {<NEW_LINE>mFastForwardButton.setOnClickListener(mFfwdListener);<NEW_LINE>if (!mFromXml) {<NEW_LINE>mFastForwardButton.setVisibility(mUseFastForward ? View.VISIBLE : View.GONE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mRewindButton = v.findViewById(R.id.rewind_button);<NEW_LINE>if (mRewindButton != null) {<NEW_LINE>mRewindButton.setOnClickListener(mRewListener);<NEW_LINE>if (!mFromXml) {<NEW_LINE>mRewindButton.setVisibility(mUseFastForward ? View.VISIBLE : View.GONE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// By default these are hidden. They will be enabled when setPrevNextListeners() is called<NEW_LINE>mNextButton = v.findViewById(R.id.skip_next_button);<NEW_LINE>if (mNextButton != null && !mFromXml && !mListenersSet) {<NEW_LINE>mNextButton.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>mPrevButton = v.findViewById(R.id.skip_previous_button);<NEW_LINE>if (mPrevButton != null && !mFromXml && !mListenersSet) {<NEW_LINE>mPrevButton.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>mProgress = v.findViewById(R.id.seek_bar);<NEW_LINE>if (mProgress != null) {<NEW_LINE>if (mProgress instanceof SeekBar) {<NEW_LINE>SeekBar seeker = (SeekBar) mProgress;<NEW_LINE>seeker.setOnSeekBarChangeListener(mSeekListener);<NEW_LINE>}<NEW_LINE>mProgress.setMax(1000);<NEW_LINE>}<NEW_LINE>mEndTime = v.findViewById(R.id.end_time_text);<NEW_LINE>mCurrentTime = v.findViewById(R.id.current_time_text);<NEW_LINE>mFormatBuilder = new StringBuilder();<NEW_LINE>mFormatter = new Formatter(mFormatBuilder, Locale.getDefault());<NEW_LINE>installPrevNextListeners();<NEW_LINE>} | findViewById(R.id.play_button); |
488,356 | boolean assignParent(Config parentConfig) {<NEW_LINE>if (this.parent != null) {<NEW_LINE>throw new MixinInitialisationError("Mixin config " + this.name + " was already initialised");<NEW_LINE>}<NEW_LINE>if (parentConfig.get() == this) {<NEW_LINE>throw new MixinInitialisationError("Mixin config " + this.name + " cannot be its own parent");<NEW_LINE>}<NEW_LINE>this.parent = parentConfig.get();<NEW_LINE>if (!this.parent.initialised) {<NEW_LINE>throw new MixinInitialisationError("Mixin config " + this.name + " attempted to assign uninitialised parent config." + " This probably means that there is an indirect loop in the mixin configs: child -> parent -> child");<NEW_LINE>}<NEW_LINE>this.env = this.parseSelector(this.selector, this.parent.env);<NEW_LINE>this.verboseLogging |= this.env.getOption(Option.DEBUG_VERBOSE);<NEW_LINE>this.required = this.requiredValue == null ? this.parent.required : this.requiredValue.booleanValue() && !this.env.getOption(Option.IGNORE_REQUIRED);<NEW_LINE>this.initPriority(this.parent.priority, this.parent.mixinPriority);<NEW_LINE>if (this.injectorOptions == null) {<NEW_LINE>this.injectorOptions = this.parent.injectorOptions;<NEW_LINE>} else {<NEW_LINE>this.injectorOptions.mergeFrom(this.parent.injectorOptions);<NEW_LINE>}<NEW_LINE>if (this.overwriteOptions == null) {<NEW_LINE>this.overwriteOptions = this.parent.overwriteOptions;<NEW_LINE>} else {<NEW_LINE>this.overwriteOptions.mergeFrom(this.parent.overwriteOptions);<NEW_LINE>}<NEW_LINE>this.setSourceFile |= this.parent.setSourceFile;<NEW_LINE>this<MASK><NEW_LINE>return this.postInit();<NEW_LINE>} | .verboseLogging |= this.parent.verboseLogging; |
587,761 | protected static String createRandomStringHostNameForEbc(String canonicalHostName) {<NEW_LINE>String methodName = "createRandomStringHostNameForEbc";<NEW_LINE>rndHostName = libertyHostMap.get(canonicalHostName);<NEW_LINE>if (rndHostName == null) {<NEW_LINE>String prefix = "ebc_";<NEW_LINE>String chars = "abcdefghijklmnopqrstuvwxyz0123456789";<NEW_LINE>StringBuilder rdnString = new StringBuilder();<NEW_LINE>Random rnd = new Random();<NEW_LINE>while (rdnString.length() < CANONICAL_HOST_NAME_CHAR_LIMIT - prefix.length()) {<NEW_LINE>int index = (int) (rnd.nextFloat(<MASK><NEW_LINE>rdnString.append(chars.charAt(index));<NEW_LINE>}<NEW_LINE>rndHostName = prefix + rdnString.toString();<NEW_LINE>libertyHostMap.put(canonicalHostName, rndHostName);<NEW_LINE>isRndHostName = true;<NEW_LINE>}<NEW_LINE>Log.info(c, methodName, "EBC canonical hostname " + canonicalHostName + " mapped to the random generated hostname " + rndHostName);<NEW_LINE>return rndHostName;<NEW_LINE>} | ) * chars.length()); |
956,113 | // Post Format Helpers<NEW_LINE>private void updatePostFormatKeysAndNames() {<NEW_LINE>final SiteModel site = getSite();<NEW_LINE>if (site == null) {<NEW_LINE>// Since this method can get called after a callback, we have to make sure we have the site<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Initialize the lists from the defaults<NEW_LINE>mPostFormatKeys <MASK><NEW_LINE>mPostFormatNames = new ArrayList<>(mDefaultPostFormatNames);<NEW_LINE>// If we have specific values for this site, use them<NEW_LINE>List<PostFormatModel> postFormatModels = mSiteStore.getPostFormats(site);<NEW_LINE>for (PostFormatModel postFormatModel : postFormatModels) {<NEW_LINE>if (!mPostFormatKeys.contains(postFormatModel.getSlug())) {<NEW_LINE>mPostFormatKeys.add(postFormatModel.getSlug());<NEW_LINE>mPostFormatNames.add(postFormatModel.getDisplayName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = new ArrayList<>(mDefaultPostFormatKeys); |
709,979 | public com.squareup.okhttp.Call cancelTaskCall(String id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v1/tasks/{id}:cancel".replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null)<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>if (progressListener != null) {<NEW_LINE>apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {<NEW_LINE>com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());<NEW_LINE>return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>String[] <MASK><NEW_LINE>return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>} | localVarAuthNames = new String[] {}; |
846,189 | public Client call123testSpecialTags(Client body) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'body' when calling call123testSpecialTags");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/another-fake/dummy";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<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 = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] <MASK><NEW_LINE>GenericType<Client> localVarReturnType = new GenericType<Client>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | localVarAuthNames = new String[] {}; |
1,734,355 | public void clear(short columnFrom, short columnTo, short rowFrom, short rowTo) {<NEW_LINE>if (columnFrom < 0 || columnFrom > maxColumn) {<NEW_LINE>logger.error("start column must have a value from 0 to {}", maxColumn);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (columnTo < 0 || columnTo > maxColumn) {<NEW_LINE>logger.error("end column must have a value from 0 to {}", maxColumn);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (rowFrom < 0 || rowFrom > maxLine) {<NEW_LINE>logger.error("start row must have a value from 0 to {}", maxLine);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (rowTo < 0 || rowTo > maxLine) {<NEW_LINE>logger.error("end row must have a value from 0 to {}", maxLine);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>tinkerforgeDevice.newWindow(columnFrom, columnTo, rowFrom, rowTo);<NEW_LINE>tinkerforgeDevice.clearDisplay();<NEW_LINE>} catch (TimeoutException e) {<NEW_LINE>TinkerforgeErrorHandler.handleError(<MASK><NEW_LINE>} catch (NotConnectedException e) {<NEW_LINE>TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_NOT_CONNECTION_EXCEPTION, e);<NEW_LINE>}<NEW_LINE>} | this, TinkerforgeErrorHandler.TF_TIMEOUT_EXCEPTION, e); |
451,481 | public ConcurrentMap<CacheKey, CacheValue> createCache(LocalCachedMapOptions<?, ?> options) {<NEW_LINE>if (options.getCacheProvider() == LocalCachedMapOptions.CacheProvider.CAFFEINE) {<NEW_LINE>Caffeine<Object, Object> caffeineBuilder = Caffeine.newBuilder();<NEW_LINE>if (options.getTimeToLiveInMillis() > 0) {<NEW_LINE>caffeineBuilder.expireAfterWrite(options.getTimeToLiveInMillis(), TimeUnit.MILLISECONDS);<NEW_LINE>}<NEW_LINE>if (options.getMaxIdleInMillis() > 0) {<NEW_LINE>caffeineBuilder.expireAfterAccess(options.getMaxIdleInMillis(), TimeUnit.MILLISECONDS);<NEW_LINE>}<NEW_LINE>if (options.getCacheSize() > 0) {<NEW_LINE>caffeineBuilder.maximumSize(options.getCacheSize());<NEW_LINE>}<NEW_LINE>if (options.getEvictionPolicy() == LocalCachedMapOptions.EvictionPolicy.SOFT) {<NEW_LINE>caffeineBuilder.softValues();<NEW_LINE>}<NEW_LINE>if (options.getEvictionPolicy() == LocalCachedMapOptions.EvictionPolicy.WEAK) {<NEW_LINE>caffeineBuilder.weakValues();<NEW_LINE>}<NEW_LINE>return caffeineBuilder.<CacheKey, CacheValue>build().asMap();<NEW_LINE>}<NEW_LINE>if (options.getEvictionPolicy() == LocalCachedMapOptions.EvictionPolicy.NONE) {<NEW_LINE>return new NoneCacheMap<>(options.getTimeToLiveInMillis(), options.getMaxIdleInMillis());<NEW_LINE>}<NEW_LINE>if (options.getEvictionPolicy() == LocalCachedMapOptions.EvictionPolicy.LRU) {<NEW_LINE>return new LRUCacheMap<>(options.getCacheSize(), options.getTimeToLiveInMillis(), options.getMaxIdleInMillis());<NEW_LINE>}<NEW_LINE>if (options.getEvictionPolicy() == LocalCachedMapOptions.EvictionPolicy.LFU) {<NEW_LINE>return new LFUCacheMap<>(options.getCacheSize(), options.getTimeToLiveInMillis(), options.getMaxIdleInMillis());<NEW_LINE>}<NEW_LINE>if (options.getEvictionPolicy() == LocalCachedMapOptions.EvictionPolicy.SOFT) {<NEW_LINE>return ReferenceCacheMap.soft(options.getTimeToLiveInMillis(), options.getMaxIdleInMillis());<NEW_LINE>}<NEW_LINE>if (options.getEvictionPolicy() == LocalCachedMapOptions.EvictionPolicy.WEAK) {<NEW_LINE>return ReferenceCacheMap.weak(options.getTimeToLiveInMillis(), options.getMaxIdleInMillis());<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException(<MASK><NEW_LINE>} | "Invalid eviction policy: " + options.getEvictionPolicy()); |
358,984 | public PageSmsSignBO pageSmsSign(PageQuerySmsSignDTO queryDTO) {<NEW_LINE>QueryWrapper<SmsSignDO> queryWrapper = new QueryWrapper<>();<NEW_LINE>if (queryDTO.getApplyStatus() != null) {<NEW_LINE>queryWrapper.eq("apply_status", queryDTO.getApplyStatus());<NEW_LINE>}<NEW_LINE>if (!StringUtils.isEmpty(queryDTO.getSign())) {<NEW_LINE>queryWrapper.like("sign", queryDTO.getSign());<NEW_LINE>}<NEW_LINE>if (!StringUtils.isEmpty(queryDTO.getId())) {<NEW_LINE>queryWrapper.eq("id", queryDTO.getId());<NEW_LINE>}<NEW_LINE>Page<SmsSignDO> page = new Page<SmsSignDO>().setSize(queryDTO.getSize()).setCurrent(queryDTO.getCurrent()).setDesc("create_time");<NEW_LINE>IPage<SmsSignDO> signPage = smsSignMapper.selectPage(page, queryWrapper);<NEW_LINE>List<PageSmsSignBO.Sign> signList = SmsSignConvert.INSTANCE.<MASK><NEW_LINE>return new PageSmsSignBO().setData(signList).setCurrent(signPage.getCurrent()).setSize(signPage.getSize()).setTotal(signPage.getTotal());<NEW_LINE>} | convert(signPage.getRecords()); |
1,854,449 | final GetBlacklistReportsResult executeGetBlacklistReports(GetBlacklistReportsRequest getBlacklistReportsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getBlacklistReportsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetBlacklistReportsRequest> request = null;<NEW_LINE>Response<GetBlacklistReportsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetBlacklistReportsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getBlacklistReportsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Pinpoint Email");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetBlacklistReports");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetBlacklistReportsResult>> 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 GetBlacklistReportsResultJsonUnmarshaller()); |
1,135,749 | public static DescribeGatherStatsResultResponse unmarshall(DescribeGatherStatsResultResponse describeGatherStatsResultResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeGatherStatsResultResponse.setRequestId(_ctx.stringValue("DescribeGatherStatsResultResponse.RequestId"));<NEW_LINE>describeGatherStatsResultResponse.setCode(_ctx.stringValue("DescribeGatherStatsResultResponse.Code"));<NEW_LINE>describeGatherStatsResultResponse.setMessage(_ctx.stringValue("DescribeGatherStatsResultResponse.Message"));<NEW_LINE>GatherStatsResult gatherStatsResult = new GatherStatsResult();<NEW_LINE>Change change = new Change();<NEW_LINE>change.setChangeId(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangeId"));<NEW_LINE>change.setEnvId(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.EnvId"));<NEW_LINE>change.setChangeName(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangeName"));<NEW_LINE>change.setChangeDescription(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangeDescription"));<NEW_LINE>change.setChangeFinished(_ctx.booleanValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangeFinished"));<NEW_LINE>change.setChangeSucceeded<MASK><NEW_LINE>change.setChangeAborted(_ctx.booleanValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangeAborted"));<NEW_LINE>change.setChangePaused(_ctx.booleanValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangePaused"));<NEW_LINE>change.setChangeTimedout(_ctx.booleanValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangeTimedout"));<NEW_LINE>change.setCreateTime(_ctx.longValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.CreateTime"));<NEW_LINE>change.setUpdateTime(_ctx.longValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.UpdateTime"));<NEW_LINE>change.setFinishTime(_ctx.longValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.FinishTime"));<NEW_LINE>change.setActionName(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ActionName"));<NEW_LINE>change.setCreateUsername(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.CreateUsername"));<NEW_LINE>change.setChangeMessage(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangeMessage"));<NEW_LINE>gatherStatsResult.setChange(change);<NEW_LINE>List<InstanceResult> instanceResults = new ArrayList<InstanceResult>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeGatherStatsResultResponse.GatherStatsResult.InstanceResults.Length"); i++) {<NEW_LINE>InstanceResult instanceResult = new InstanceResult();<NEW_LINE>instanceResult.setInstanceId(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.InstanceResults[" + i + "].InstanceId"));<NEW_LINE>instanceResult.setStorageKey(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.InstanceResults[" + i + "].StorageKey"));<NEW_LINE>instanceResult.setTaskSucceeded(_ctx.booleanValue("DescribeGatherStatsResultResponse.GatherStatsResult.InstanceResults[" + i + "].TaskSucceeded"));<NEW_LINE>instanceResult.setTaskMessage(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.InstanceResults[" + i + "].TaskMessage"));<NEW_LINE>instanceResults.add(instanceResult);<NEW_LINE>}<NEW_LINE>gatherStatsResult.setInstanceResults(instanceResults);<NEW_LINE>describeGatherStatsResultResponse.setGatherStatsResult(gatherStatsResult);<NEW_LINE>return describeGatherStatsResultResponse;<NEW_LINE>} | (_ctx.booleanValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangeSucceeded")); |
406,046 | public boolean updateAttributes() {<NEW_LINE>this.name = FileUtil.getStringFromFile(String.format(ProcPath.TASK_COMM, this.getOwningProcessId(), this.threadId));<NEW_LINE>Map<String, String> status = FileUtil.getKeyValueMapFromFile(String.format(ProcPath.TASK_STATUS, this.getOwningProcessId(), this.threadId), ":");<NEW_LINE>String stat = FileUtil.getStringFromFile(String.format(ProcPath.TASK_STAT, this.getOwningProcessId(), this.threadId));<NEW_LINE>if (stat.isEmpty()) {<NEW_LINE>this.state = State.INVALID;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>long[] statArray = ParseUtil.parseStringToLongArray(stat, PROC_TASK_STAT_ORDERS, ProcessStat.PROC_PID_STAT_LENGTH, ' ');<NEW_LINE>// BOOTTIME is in seconds and start time from proc/pid/stat is in jiffies.<NEW_LINE>// Combine units to jiffies and convert to millijiffies before hz division to<NEW_LINE>// avoid precision loss without having to cast<NEW_LINE>this.startTime = (LinuxOperatingSystem.BOOTTIME * LinuxOperatingSystem.getHz() + statArray[LinuxOSThread.ThreadPidStat.START_TIME.ordinal()]) * 1000L / LinuxOperatingSystem.getHz();<NEW_LINE>// BOOT_TIME could be up to 500ms off and start time up to 5ms off. A process<NEW_LINE>// that has started within last 505ms could produce a future start time/negative<NEW_LINE>// up time, so insert a sanity check.<NEW_LINE>if (this.startTime >= now) {<NEW_LINE>this.startTime = now - 1;<NEW_LINE>}<NEW_LINE>this.minorFaults = statArray[ThreadPidStat.MINOR_FAULTS.ordinal()];<NEW_LINE>this.majorFaults = statArray[ThreadPidStat.MAJOR_FAULT.ordinal()];<NEW_LINE>this.startMemoryAddress = statArray[ThreadPidStat.START_CODE.ordinal()];<NEW_LINE>long voluntaryContextSwitches = ParseUtil.parseLongOrDefault(status.get("voluntary_ctxt_switches"), 0L);<NEW_LINE>long nonVoluntaryContextSwitches = ParseUtil.parseLongOrDefault(status.get("nonvoluntary_ctxt_switches"), 0L);<NEW_LINE>this.contextSwitches = voluntaryContextSwitches + nonVoluntaryContextSwitches;<NEW_LINE>this.state = ProcessStat.getState(status.getOrDefault("State", "U").charAt(0));<NEW_LINE>this.kernelTime = statArray[ThreadPidStat.KERNEL_TIME.ordinal()] * 1000L / LinuxOperatingSystem.getHz();<NEW_LINE>this.userTime = statArray[ThreadPidStat.USER_TIME.ordinal()] * 1000L / LinuxOperatingSystem.getHz();<NEW_LINE>this.upTime = now - startTime;<NEW_LINE>this.priority = (int) statArray[ThreadPidStat.PRIORITY.ordinal()];<NEW_LINE>return true;<NEW_LINE>} | long now = System.currentTimeMillis(); |
339,322 | public void disableLedgerReplication() throws ReplicationException.UnavailableException {<NEW_LINE>List<ACL> zkAcls = ZkUtils.getACLs(conf);<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("disableLedegerReplication()");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String znode = basePath + '/' + BookKeeperConstants.DISABLE_NODE;<NEW_LINE>zkc.create(znode, "".getBytes(UTF_8), zkAcls, CreateMode.PERSISTENT);<NEW_LINE>LOG.info("Auto ledger re-replication is disabled!");<NEW_LINE>} catch (KeeperException.NodeExistsException ke) {<NEW_LINE>LOG.warn("AutoRecovery is already disabled!", ke);<NEW_LINE>throw new ReplicationException.UnavailableException("AutoRecovery is already disabled!", ke);<NEW_LINE>} catch (KeeperException ke) {<NEW_LINE>LOG.error("Exception while stopping auto ledger re-replication", ke);<NEW_LINE>throw new ReplicationException.UnavailableException("Exception while stopping auto ledger re-replication", ke);<NEW_LINE>} catch (InterruptedException ie) {<NEW_LINE>Thread<MASK><NEW_LINE>throw new ReplicationException.UnavailableException("Interrupted while stopping auto ledger re-replication", ie);<NEW_LINE>}<NEW_LINE>} | .currentThread().interrupt(); |
1,220,262 | public void marshall(UpdateIdentityPoolRequest updateIdentityPoolRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updateIdentityPoolRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(updateIdentityPoolRequest.getIdentityPoolId(), IDENTITYPOOLID_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIdentityPoolRequest.getIdentityPoolName(), IDENTITYPOOLNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIdentityPoolRequest.getAllowUnauthenticatedIdentities(), ALLOWUNAUTHENTICATEDIDENTITIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(updateIdentityPoolRequest.getSupportedLoginProviders(), SUPPORTEDLOGINPROVIDERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIdentityPoolRequest.getDeveloperProviderName(), DEVELOPERPROVIDERNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIdentityPoolRequest.getOpenIdConnectProviderARNs(), OPENIDCONNECTPROVIDERARNS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIdentityPoolRequest.getCognitoIdentityProviders(), COGNITOIDENTITYPROVIDERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIdentityPoolRequest.getSamlProviderARNs(), SAMLPROVIDERARNS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIdentityPoolRequest.getIdentityPoolTags(), IDENTITYPOOLTAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | updateIdentityPoolRequest.getAllowClassicFlow(), ALLOWCLASSICFLOW_BINDING); |
252,385 | public void refresh(TableCell cell, long timestamp) {<NEW_LINE>Subscription sub = <MASK><NEW_LINE>if (sub == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// SortVal will be: ((latest & 0x7FFFFFFFL) << 32) + (scanTime & 0xFFFFFFFFL)<NEW_LINE>long scanTime = (sub.getHistory().getLastScanTime() / 1000) & 0xFFFFFFFFL;<NEW_LINE>if (!cell.isSecondarySortEnabled()) {<NEW_LINE>// remove from consideration<NEW_LINE>scanTime = 0;<NEW_LINE>}<NEW_LINE>if (cell.isValid()) {<NEW_LINE>Comparable lastSortVal = cell.getSortValue();<NEW_LINE>if (lastSortVal instanceof Long) {<NEW_LINE>long lastScanTime = ((Long) lastSortVal) & 0xFFFFFFFFL;<NEW_LINE>if (lastScanTime == scanTime) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long latest = 0;<NEW_LINE>SubscriptionResult[] results = sub.getResults(true);<NEW_LINE>for (SubscriptionResult result : results) {<NEW_LINE>if (result.isDeleted() || result.getRead()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>long timeFound = result.getTimeFound();<NEW_LINE>if (timeFound > latest) {<NEW_LINE>latest = timeFound;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long sortVal = (((latest / 1000) & 0x7FFFFFFFL) << 32) + scanTime;<NEW_LINE>super.refresh(cell, latest, sortVal, null);<NEW_LINE>} | (Subscription) cell.getDataSource(); |
610,980 | static LogResult postLog(@NonNull final Geocache cache, @NonNull final LogType logType, @NonNull final Calendar date, @NonNull final String log) {<NEW_LINE>final Parameters params = new Parameters("cache_id", cache.getGeocode());<NEW_LINE>params.add("type", logType.type);<NEW_LINE><MASK><NEW_LINE>params.add("date", LOG_DATE_FORMAT.format(date.getTime()));<NEW_LINE>params.add("sid", ecLogin.getSessionId());<NEW_LINE>final String uri = API_HOST + "log.php";<NEW_LINE>try {<NEW_LINE>final Response response = Network.postRequest(uri, params).blockingGet();<NEW_LINE>if (response.code() == 403 && ecLogin.login() == StatusCode.NO_ERROR) {<NEW_LINE>apiRequest(uri, params, true);<NEW_LINE>}<NEW_LINE>if (response.code() != 200) {<NEW_LINE>return new LogResult(StatusCode.LOG_POST_ERROR, "");<NEW_LINE>}<NEW_LINE>final String data = Network.getResponseData(response, false);<NEW_LINE>if (StringUtils.isNotBlank(data) && StringUtils.contains(data, "success")) {<NEW_LINE>if (logType.isFoundLog()) {<NEW_LINE>ecLogin.increaseActualCachesFound();<NEW_LINE>}<NEW_LINE>final String uid = StringUtils.remove(data, "success:");<NEW_LINE>return new LogResult(StatusCode.NO_ERROR, uid);<NEW_LINE>}<NEW_LINE>} catch (final Exception ignored) {<NEW_LINE>// Response is already logged<NEW_LINE>}<NEW_LINE>return new LogResult(StatusCode.LOG_POST_ERROR, "");<NEW_LINE>} | params.add("log", log); |
1,338,251 | // looking for nums[0] < nums[1] > nums[2] < nums[3] and so on.<NEW_LINE>public void wiggleSort2(int[] arr) {<NEW_LINE>if (arr.length == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int k = arr.length / 2;<NEW_LINE>KthElementInArray kthElementInArray = new KthElementInArray();<NEW_LINE>kthElementInArray.kthElement(arr, k);<NEW_LINE>int mid = arr[k];<NEW_LINE>int n = arr.length;<NEW_LINE>int i = 0, j = 0;<NEW_LINE>k = n - 1;<NEW_LINE>while (j <= k) {<NEW_LINE>if (arr[next(j, n)] > mid) {<NEW_LINE>swap(arr, next(i++, n), next(j++, n));<NEW_LINE>} else if (arr[next(j, n)] < mid) {<NEW_LINE>swap(arr, next(j, n), <MASK><NEW_LINE>} else {<NEW_LINE>j++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | next(k--, n)); |
87,045 | public ANode visitLambda(LambdaContext ctx) {<NEW_LINE>reserved.push(new FunctionReserved());<NEW_LINE>List<String> paramTypes = new ArrayList<>();<NEW_LINE>List<String> paramNames = new ArrayList<>();<NEW_LINE>List<AStatement> statements = new ArrayList<>();<NEW_LINE>for (LamtypeContext lamtype : ctx.lamtype()) {<NEW_LINE>if (lamtype.decltype() == null) {<NEW_LINE>paramTypes.add(null);<NEW_LINE>} else {<NEW_LINE>paramTypes.add(lamtype.decltype().getText());<NEW_LINE>}<NEW_LINE>paramNames.add(lamtype.ID().getText());<NEW_LINE>}<NEW_LINE>if (ctx.expression() != null) {<NEW_LINE>// single expression<NEW_LINE>AExpression expression = (AExpression) visit(ctx.expression());<NEW_LINE>statements.add(new SReturn(location(ctx), expression));<NEW_LINE>} else {<NEW_LINE>for (StatementContext statement : ctx.block().statement()) {<NEW_LINE>statements.add((AStatement) visit(statement));<NEW_LINE>}<NEW_LINE>if (ctx.block().dstatement() != null) {<NEW_LINE>statements.add((AStatement) visit(ctx.block().dstatement()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>FunctionReserved lambdaReserved = (FunctionReserved) reserved.pop();<NEW_LINE>reserved.peek().addUsedVariables(lambdaReserved);<NEW_LINE>String name = nextLambda();<NEW_LINE>return new ELambda(name, lambdaReserved, location(ctx<MASK><NEW_LINE>} | ), paramTypes, paramNames, statements); |
579,390 | private DeferredResult<ResponseEntity> saveAttributes(TenantId srcTenantId, EntityId entityIdSrc, String scope, JsonNode json) throws ThingsboardException {<NEW_LINE>if (!DataConstants.SERVER_SCOPE.equals(scope) && !DataConstants.SHARED_SCOPE.equals(scope)) {<NEW_LINE>return getImmediateDeferredResult("Invalid scope: " + scope, HttpStatus.BAD_REQUEST);<NEW_LINE>}<NEW_LINE>if (json.isObject()) {<NEW_LINE>List<AttributeKvEntry> attributes = extractRequestAttributes(json);<NEW_LINE>attributes.forEach(ConstraintValidator::validateFields);<NEW_LINE>if (attributes.isEmpty()) {<NEW_LINE>return getImmediateDeferredResult("No attributes data found in request body!", HttpStatus.BAD_REQUEST);<NEW_LINE>}<NEW_LINE>for (AttributeKvEntry attributeKvEntry : attributes) {<NEW_LINE>if (attributeKvEntry.getKey().isEmpty() || attributeKvEntry.getKey().trim().length() == 0) {<NEW_LINE>return getImmediateDeferredResult("Key cannot be empty or contains only spaces", HttpStatus.BAD_REQUEST);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SecurityUser user = getCurrentUser();<NEW_LINE>return accessValidator.validateEntityAndCallback(getCurrentUser(), Operation.WRITE_ATTRIBUTES, entityIdSrc, (result, tenantId, entityId) -> {<NEW_LINE>tsSubService.saveAndNotify(tenantId, entityId, scope, attributes, new FutureCallback<Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(@Nullable Void tmp) {<NEW_LINE>logAttributesUpdated(user, entityId, scope, attributes, null);<NEW_LINE>result.setResult(<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(Throwable t) {<NEW_LINE>logAttributesUpdated(user, entityId, scope, attributes, t);<NEW_LINE>AccessValidator.handleError(t, result, HttpStatus.INTERNAL_SERVER_ERROR);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>return getImmediateDeferredResult("Request is not a JSON object", HttpStatus.BAD_REQUEST);<NEW_LINE>}<NEW_LINE>} | new ResponseEntity(HttpStatus.OK)); |
646,313 | public static void writeTo(CompositeValuesSourceBuilder<?> builder, StreamOutput out) throws IOException {<NEW_LINE>final byte code;<NEW_LINE>if (builder.getClass() == TermsValuesSourceBuilder.class) {<NEW_LINE>code = 0;<NEW_LINE>} else if (builder.getClass() == DateHistogramValuesSourceBuilder.class) {<NEW_LINE>code = 1;<NEW_LINE>} else if (builder.getClass() == HistogramValuesSourceBuilder.class) {<NEW_LINE>code = 2;<NEW_LINE>} else if (builder.getClass() == GeoTileGridValuesSourceBuilder.class) {<NEW_LINE>if (out.getVersion().before(LegacyESVersion.V_7_5_0)) {<NEW_LINE>throw new IOException("Attempting to serialize [" + builder.getClass().getSimpleName() + "] to a node with unsupported version [" + <MASK><NEW_LINE>}<NEW_LINE>code = 3;<NEW_LINE>} else {<NEW_LINE>throw new IOException("invalid builder type: " + builder.getClass().getSimpleName());<NEW_LINE>}<NEW_LINE>out.writeByte(code);<NEW_LINE>builder.writeTo(out);<NEW_LINE>} | out.getVersion() + "]"); |
1,330,976 | public void testRxFlowableToObservableInvoker_get1(Map<String, String> param, StringBuilder ret) {<NEW_LINE>String serverIP = param.get("serverIP");<NEW_LINE>String serverPort = param.get("serverPort");<NEW_LINE>final String threadName = "jaxrs21Thread";<NEW_LINE>ThreadFactory jaxrs21ThreadFactory = Executors.defaultThreadFactory();<NEW_LINE>Thread jaxrs21Thread = jaxrs21ThreadFactory.newThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>String runThreadName = Thread.currentThread().getName();<NEW_LINE>if (!(runThreadName.equals(threadName))) {<NEW_LINE>throw new RuntimeException("testRxFlowableToObservableInvoker_get1: incorrect thread name");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>jaxrs21Thread.setName(threadName);<NEW_LINE>ExecutorService executorService = Executors.newSingleThreadExecutor(jaxrs21ThreadFactory);<NEW_LINE>ClientBuilder cb = ClientBuilder.<MASK><NEW_LINE>Client c = cb.build();<NEW_LINE>c.register(RxFlowableInvokerProvider.class);<NEW_LINE>WebTarget t = c.target("http://" + serverIP + ":" + serverPort + "/jaxrs21bookstore/JAXRS21bookstore2/rxget1");<NEW_LINE>Builder builder = t.request();<NEW_LINE>Flowable<Response> flowable = builder.rx(RxFlowableInvoker.class).get(Response.class);<NEW_LINE>Observable<Response> observable = flowable.toObservable();<NEW_LINE>final Holder<Response> holder = new Holder<Response>();<NEW_LINE>final CountDownLatch countDownLatch = new CountDownLatch(1);<NEW_LINE>observable.subscribe(v -> {<NEW_LINE>// OnNext<NEW_LINE>holder.value = v;<NEW_LINE>countDownLatch.countDown();<NEW_LINE>}, throwable -> {<NEW_LINE>// OnError<NEW_LINE>throw new RuntimeException("testRxFlowableToObservableInvoker_get1: onError " + throwable.getStackTrace());<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>if (!(countDownLatch.await(basicTimeout, TimeUnit.SECONDS))) {<NEW_LINE>throw new RuntimeException("testRxFlowableToObservableInvoker_get1: Response took too long. Waited " + basicTimeout);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>ret.append(holder.value.readEntity(String.class));<NEW_LINE>c.close();<NEW_LINE>} | newBuilder().executorService(executorService); |
201,172 | public void doText(NewsViewHolder holder, Submission submission, Context mContext, String baseSub) {<NEW_LINE>SpannableStringBuilder t = <MASK><NEW_LINE>SpannableStringBuilder l = SubmissionCache.getInfoLine(submission, mContext, baseSub);<NEW_LINE>int[] textSizeAttr = new int[] { R.attr.font_cardtitle, R.attr.font_cardinfo };<NEW_LINE>TypedArray a = mContext.obtainStyledAttributes(textSizeAttr);<NEW_LINE>int textSizeT = a.getDimensionPixelSize(0, 18);<NEW_LINE>int textSizeI = a.getDimensionPixelSize(1, 14);<NEW_LINE>a.recycle();<NEW_LINE>t.setSpan(new AbsoluteSizeSpan(textSizeT), 0, t.length(), 0);<NEW_LINE>l.setSpan(new AbsoluteSizeSpan(textSizeI), 0, l.length(), 0);<NEW_LINE>SpannableStringBuilder s = new SpannableStringBuilder();<NEW_LINE>if (SettingValues.titleTop) {<NEW_LINE>s.append(t);<NEW_LINE>s.append("\n");<NEW_LINE>s.append(l);<NEW_LINE>} else {<NEW_LINE>s.append(l);<NEW_LINE>s.append("\n");<NEW_LINE>s.append(t);<NEW_LINE>}<NEW_LINE>holder.title.setText(s);<NEW_LINE>} | SubmissionCache.getTitleLine(submission, mContext); |
982,235 | public Graph.Builder createGraphBuilder() {<NEW_LINE>final String storePropertiesPath = System.getProperty(SystemProperty.STORE_PROPERTIES_PATH);<NEW_LINE>if (null == storePropertiesPath) {<NEW_LINE>throw new SchemaException("The path to the Store Properties was not found in system properties for key: " + SystemProperty.STORE_PROPERTIES_PATH);<NEW_LINE>}<NEW_LINE>final StoreProperties storeProperties = StoreProperties.loadStoreProperties(storePropertiesPath);<NEW_LINE>// Disable any operations required<NEW_LINE>storeProperties.addOperationDeclarationPaths("disableOperations.json");<NEW_LINE>final Graph.Builder builder = new Graph.Builder();<NEW_LINE>builder.storeProperties(storeProperties);<NEW_LINE>final String graphConfigPath = System.getProperty(SystemProperty.GRAPH_CONFIG_PATH);<NEW_LINE>if (null != graphConfigPath) {<NEW_LINE>builder.config(Paths.get(graphConfigPath));<NEW_LINE>}<NEW_LINE>for (final Path path : getSchemaPaths()) {<NEW_LINE>builder.addSchema(path);<NEW_LINE>}<NEW_LINE>final String graphId = System.getProperty(SystemProperty.GRAPH_ID);<NEW_LINE>if (null != graphId) {<NEW_LINE>builder.graphId(graphId);<NEW_LINE>}<NEW_LINE>String graphLibraryClassName = System.getProperty(SystemProperty.GRAPH_LIBRARY_CLASS);<NEW_LINE>if (null != graphLibraryClassName) {<NEW_LINE>GraphLibrary library;<NEW_LINE>try {<NEW_LINE>library = Class.forName(graphLibraryClassName).asSubclass(GraphLibrary.class).newInstance();<NEW_LINE>} catch (final ClassNotFoundException | InstantiationException | IllegalAccessException e) {<NEW_LINE>throw new RuntimeException("Error creating GraphLibrary class", e);<NEW_LINE>}<NEW_LINE>library.initialise(System.getProperty(SystemProperty.GRAPH_LIBRARY_CONFIG));<NEW_LINE>builder.library(library);<NEW_LINE>}<NEW_LINE>final String graphHooksPath = System.getProperty(SystemProperty.GRAPH_HOOKS_PATH);<NEW_LINE>if (null != graphHooksPath) {<NEW_LINE>builder.addHooks<MASK><NEW_LINE>}<NEW_LINE>return builder;<NEW_LINE>} | (Paths.get(graphHooksPath)); |
1,732,452 | @Operation(summary = "Set the greeting prefix", description = "Permits the client to set the prefix part of the greeting (\"Hello\")")<NEW_LINE>@RequestBody(name = "greeting", description = "Conveys the new greeting prefix to use in building greetings", content = @Content(mediaType = "application/json", schema = @Schema(implementation = GreetingMessage.class), examples = @ExampleObject(name = "greeting", summary = "Example greeting message to update", value = "New greeting message")))<NEW_LINE>@Consumes(MediaType.APPLICATION_JSON)<NEW_LINE>@Produces(MediaType.APPLICATION_JSON)<NEW_LINE>public Response updateGreeting(JsonObject jsonObject) {<NEW_LINE>if (!jsonObject.containsKey("greeting")) {<NEW_LINE>JsonObject entity = JSON.createObjectBuilder().add("error", "No greeting provided").build();<NEW_LINE>return Response.status(Response.Status.BAD_REQUEST).entity(entity).build();<NEW_LINE>}<NEW_LINE>String newGreeting = jsonObject.getString("greeting");<NEW_LINE>greetingProvider.setMessage(newGreeting);<NEW_LINE>return Response.status(Response.<MASK><NEW_LINE>} | Status.NO_CONTENT).build(); |
773,787 | default <R1, R2, R3, R4> Reader<T, R4> forEach4(Function<? super R, Function<? super T, ? extends R1>> value2, BiFunction<? super R, ? super R1, Function<? super T, ? extends R2>> value3, Function3<? super R, ? super R1, ? super R2, Function<? super T, ? extends R3>> value4, Function4<? super R, ? super R1, ? super R2, ? super R3, ? extends R4> yieldingFunction) {<NEW_LINE>Reader<? super T, ? extends R4> res = this.flatMap(in -> {<NEW_LINE>Reader<T, R1> a = functionToReader(value2.apply(in));<NEW_LINE>return a.flatMap(ina -> {<NEW_LINE>Reader<T, R2> b = functionToReader(value3.apply(in, ina));<NEW_LINE>return b.flatMap(inb -> {<NEW_LINE>Reader<T, R3> c = functionToReader(value4.apply(in, ina, inb));<NEW_LINE>return c.mapFn(in2 -> {<NEW_LINE>return yieldingFunction.apply(in, ina, inb, in2);<NEW_LINE>});<NEW_LINE>});<NEW_LINE>});<NEW_LINE>});<NEW_LINE>return (<MASK><NEW_LINE>} | Reader<T, R4>) res; |
854,035 | private void checkHostStorageConnection(final String hostUuid, String clusterUuid, Completion completion) {<NEW_LINE>List<String> psUuids = findCephPrimaryStorage(clusterUuid);<NEW_LINE>if (psUuids.isEmpty()) {<NEW_LINE>completion.success();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<CheckHostStorageConnectionMsg> msgs = CollectionUtils.transformToList(psUuids, new Function<CheckHostStorageConnectionMsg, String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public CheckHostStorageConnectionMsg call(String puuid) {<NEW_LINE>CheckHostStorageConnectionMsg msg = new CheckHostStorageConnectionMsg();<NEW_LINE>msg.setPrimaryStorageUuid(puuid);<NEW_LINE>msg<MASK><NEW_LINE>bus.makeTargetServiceIdByResourceUuid(msg, PrimaryStorageConstant.SERVICE_ID, puuid);<NEW_LINE>return msg;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>new While<>(msgs).step((msg, whileCompletion) -> {<NEW_LINE>bus.send(msg, new CloudBusCallBack(whileCompletion) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(MessageReply reply) {<NEW_LINE>if (!reply.isSuccess()) {<NEW_LINE>whileCompletion.addError(reply.getError());<NEW_LINE>}<NEW_LINE>whileCompletion.done();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}, 10).run(new WhileDoneCompletion(completion) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void done(ErrorCodeList errorCodeList) {<NEW_LINE>if (!errorCodeList.getCauses().isEmpty()) {<NEW_LINE>completion.fail(errorCodeList.getCauses().get(0));<NEW_LINE>} else {<NEW_LINE>completion.success();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | .setHostUuids(list(hostUuid)); |
1,179,934 | public void perform() {<NEW_LINE>if (updateInfo.getPass().isExpired()) {<NEW_LINE>finalizeRunnable.run();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!updateInfo.isDescriptorIsUpToDate()) {<NEW_LINE>update(updateInfo.getDescriptor(), true);<NEW_LINE>}<NEW_LINE>if (!updateInfo.isUpdateChildren()) {<NEW_LINE>nodeToProcessActions[0] = node;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Object element = getElementFromDescriptor(updateInfo.getDescriptor());<NEW_LINE>if (element == null) {<NEW_LINE>removeFromLoadedInBackground(oldElementFromDescriptor);<NEW_LINE>finalizeRunnable.run();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>elementFromDescriptor.set(element);<NEW_LINE>Object[] loadedElements = getChildrenFor(element);<NEW_LINE>final LoadedChildren loaded = new LoadedChildren(loadedElements);<NEW_LINE>for (final Object each : loadedElements) {<NEW_LINE>NodeDescriptor existingDesc = getDescriptorFrom(getNodeForElement(each, true));<NEW_LINE>final NodeDescriptor eachChildDescriptor = isValid(existingDesc, updateInfo.getDescriptor()) ? existingDesc : getTreeStructure().createDescriptor(each, updateInfo.getDescriptor());<NEW_LINE>execute(new TreeRunnable("AbstractTreeUi.queueBackgroundUpdate") {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void perform() {<NEW_LINE>try {<NEW_LINE>loaded.putDescriptor(each, eachChildDescriptor, update(eachChildDescriptor, <MASK><NEW_LINE>} catch (TimeoutException | ExecutionException e) {<NEW_LINE>LOG.error(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>children.set(loaded);<NEW_LINE>} | true).blockingGet(0)); |
1,575,050 | private boolean compareVarnode(Varnode vn1, Varnode vn2, PcodeOpEmitter op2) {<NEW_LINE>if (vn1 == null) {<NEW_LINE>return (vn2 == null);<NEW_LINE>}<NEW_LINE>if (vn2 == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (vn1.getSize() != vn2.getSize()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>AddressSpace spc1 = vn1.getAddress().getAddressSpace();<NEW_LINE>AddressSpace spc2 = vn2<MASK><NEW_LINE>if (spc1 != spc2) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>long offset1 = vn1.getOffset();<NEW_LINE>long offset2 = vn2.getOffset();<NEW_LINE>if (offset1 == offset2) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>String name1 = findTempName(vn1.getAddress());<NEW_LINE>if (name1 == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String name2 = op2.findTempName(vn2.getAddress());<NEW_LINE>if (name2 == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return name1.equals(name2);<NEW_LINE>} | .getAddress().getAddressSpace(); |
1,526,752 | private void processMaxAggregation(AggregationResult aggResult, Long curLValue, Double curDValue, Boolean curBValue, String curSValue, String curJValue) {<NEW_LINE>if (curDValue != null || curLValue != null) {<NEW_LINE>if (curDValue != null) {<NEW_LINE>aggResult.dValue = aggResult.dValue == null ? curDValue : Math.<MASK><NEW_LINE>}<NEW_LINE>if (curLValue != null) {<NEW_LINE>aggResult.lValue = aggResult.lValue == null ? curLValue : Math.max(aggResult.lValue, curLValue);<NEW_LINE>}<NEW_LINE>} else if (curBValue != null) {<NEW_LINE>aggResult.bValue = aggResult.bValue == null ? curBValue : aggResult.bValue || curBValue;<NEW_LINE>} else if (curSValue != null && (aggResult.sValue == null || curSValue.compareTo(aggResult.sValue) > 0)) {<NEW_LINE>aggResult.sValue = curSValue;<NEW_LINE>} else if (curJValue != null && (aggResult.jValue == null || curJValue.compareTo(aggResult.jValue) > 0)) {<NEW_LINE>aggResult.jValue = curJValue;<NEW_LINE>}<NEW_LINE>} | max(aggResult.dValue, curDValue); |
377,203 | public void initialize(ExtensionContext context) {<NEW_LINE>// Note: initialize could be called twice in an account migration scenario where we import and<NEW_LINE>// export to the same service provider. So just return rather than throwing if called multiple<NEW_LINE>// times.<NEW_LINE>if (initialized)<NEW_LINE>return;<NEW_LINE>TemporaryPerJobDataStore jobStore = context.getService(TemporaryPerJobDataStore.class);<NEW_LINE>HttpTransport httpTransport = context.getService(HttpTransport.class);<NEW_LINE>JsonFactory jsonFactory = context.getService(JsonFactory.class);<NEW_LINE>TransformerService transformerService = new TransformerServiceImpl();<NEW_LINE>OkHttpClient client = new OkHttpClient.Builder().build();<NEW_LINE>ObjectMapper mapper = new ObjectMapper();<NEW_LINE>AppCredentials appCredentials;<NEW_LINE>try {<NEW_LINE>appCredentials = context.getService(AppCredentialStore.class).getAppCredentials("MICROSOFT_KEY", "MICROSOFT_SECRET");<NEW_LINE>} catch (IOException e) {<NEW_LINE>Monitor monitor = context.getMonitor();<NEW_LINE>monitor.info(() -> "Unable to retrieve Microsoft AppCredentials. Did you set MICROSOFT_KEY and MICROSOFT_SECRET?");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Create the MicrosoftCredentialFactory with the given {@link AppCredentials}.<NEW_LINE>MicrosoftCredentialFactory credentialFactory = new MicrosoftCredentialFactory(httpTransport, jsonFactory, appCredentials);<NEW_LINE>Monitor monitor = context.getMonitor();<NEW_LINE>ImmutableMap.Builder<String, Importer> importBuilder = ImmutableMap.builder();<NEW_LINE>importBuilder.put(CONTACTS, new MicrosoftContactsImporter(BASE_GRAPH_URL, client, mapper, transformerService));<NEW_LINE>importBuilder.put(CALENDAR, new MicrosoftCalendarImporter(BASE_GRAPH_URL, client, mapper, transformerService));<NEW_LINE>importBuilder.put(PHOTOS, new MicrosoftPhotosImporter(BASE_GRAPH_URL, client, mapper<MASK><NEW_LINE>importerMap = importBuilder.build();<NEW_LINE>ImmutableMap.Builder<String, Exporter> exporterBuilder = ImmutableMap.builder();<NEW_LINE>exporterBuilder.put(CONTACTS, new MicrosoftContactsExporter(BASE_GRAPH_URL, client, mapper, transformerService));<NEW_LINE>exporterBuilder.put(CALENDAR, new MicrosoftCalendarExporter(BASE_GRAPH_URL, client, mapper, transformerService));<NEW_LINE>exporterBuilder.put(PHOTOS, new MicrosoftPhotosExporter(credentialFactory, jsonFactory, monitor));<NEW_LINE>exporterBuilder.put(OFFLINE_DATA, new MicrosoftOfflineDataExporter(BASE_GRAPH_URL, client, mapper));<NEW_LINE>exporterMap = exporterBuilder.build();<NEW_LINE>initialized = true;<NEW_LINE>} | , jobStore, monitor, credentialFactory)); |
901,820 | public Request<ModifyCustomDBEngineVersionRequest> marshall(ModifyCustomDBEngineVersionRequest modifyCustomDBEngineVersionRequest) {<NEW_LINE>if (modifyCustomDBEngineVersionRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<ModifyCustomDBEngineVersionRequest> request = new DefaultRequest<MASK><NEW_LINE>request.addParameter("Action", "ModifyCustomDBEngineVersion");<NEW_LINE>request.addParameter("Version", "2014-10-31");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (modifyCustomDBEngineVersionRequest.getEngine() != null) {<NEW_LINE>request.addParameter("Engine", StringUtils.fromString(modifyCustomDBEngineVersionRequest.getEngine()));<NEW_LINE>}<NEW_LINE>if (modifyCustomDBEngineVersionRequest.getEngineVersion() != null) {<NEW_LINE>request.addParameter("EngineVersion", StringUtils.fromString(modifyCustomDBEngineVersionRequest.getEngineVersion()));<NEW_LINE>}<NEW_LINE>if (modifyCustomDBEngineVersionRequest.getDescription() != null) {<NEW_LINE>request.addParameter("Description", StringUtils.fromString(modifyCustomDBEngineVersionRequest.getDescription()));<NEW_LINE>}<NEW_LINE>if (modifyCustomDBEngineVersionRequest.getStatus() != null) {<NEW_LINE>request.addParameter("Status", StringUtils.fromString(modifyCustomDBEngineVersionRequest.getStatus()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | <ModifyCustomDBEngineVersionRequest>(modifyCustomDBEngineVersionRequest, "AmazonRDS"); |
92,443 | public static ListLogicDatabasesResponse unmarshall(ListLogicDatabasesResponse listLogicDatabasesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listLogicDatabasesResponse.setRequestId(_ctx.stringValue("ListLogicDatabasesResponse.RequestId"));<NEW_LINE>listLogicDatabasesResponse.setTotalCount(_ctx.longValue("ListLogicDatabasesResponse.TotalCount"));<NEW_LINE>listLogicDatabasesResponse.setErrorCode(_ctx.stringValue("ListLogicDatabasesResponse.ErrorCode"));<NEW_LINE>listLogicDatabasesResponse.setErrorMessage(_ctx.stringValue("ListLogicDatabasesResponse.ErrorMessage"));<NEW_LINE>listLogicDatabasesResponse.setSuccess(_ctx.booleanValue("ListLogicDatabasesResponse.Success"));<NEW_LINE>List<LogicDatabase> logicDatabaseList = new ArrayList<LogicDatabase>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListLogicDatabasesResponse.LogicDatabaseList.Length"); i++) {<NEW_LINE>LogicDatabase logicDatabase = new LogicDatabase();<NEW_LINE>logicDatabase.setDatabaseId(_ctx.stringValue("ListLogicDatabasesResponse.LogicDatabaseList[" + i + "].DatabaseId"));<NEW_LINE>logicDatabase.setDbType(_ctx.stringValue("ListLogicDatabasesResponse.LogicDatabaseList[" + i + "].DbType"));<NEW_LINE>logicDatabase.setLogic(_ctx.booleanValue<MASK><NEW_LINE>logicDatabase.setSchemaName(_ctx.stringValue("ListLogicDatabasesResponse.LogicDatabaseList[" + i + "].SchemaName"));<NEW_LINE>logicDatabase.setSearchName(_ctx.stringValue("ListLogicDatabasesResponse.LogicDatabaseList[" + i + "].SearchName"));<NEW_LINE>logicDatabase.setEnvType(_ctx.stringValue("ListLogicDatabasesResponse.LogicDatabaseList[" + i + "].EnvType"));<NEW_LINE>logicDatabase.setAlias(_ctx.stringValue("ListLogicDatabasesResponse.LogicDatabaseList[" + i + "].Alias"));<NEW_LINE>List<String> ownerIdList = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListLogicDatabasesResponse.LogicDatabaseList[" + i + "].OwnerIdList.Length"); j++) {<NEW_LINE>ownerIdList.add(_ctx.stringValue("ListLogicDatabasesResponse.LogicDatabaseList[" + i + "].OwnerIdList[" + j + "]"));<NEW_LINE>}<NEW_LINE>logicDatabase.setOwnerIdList(ownerIdList);<NEW_LINE>List<String> ownerNameList = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListLogicDatabasesResponse.LogicDatabaseList[" + i + "].OwnerNameList.Length"); j++) {<NEW_LINE>ownerNameList.add(_ctx.stringValue("ListLogicDatabasesResponse.LogicDatabaseList[" + i + "].OwnerNameList[" + j + "]"));<NEW_LINE>}<NEW_LINE>logicDatabase.setOwnerNameList(ownerNameList);<NEW_LINE>logicDatabaseList.add(logicDatabase);<NEW_LINE>}<NEW_LINE>listLogicDatabasesResponse.setLogicDatabaseList(logicDatabaseList);<NEW_LINE>return listLogicDatabasesResponse;<NEW_LINE>} | ("ListLogicDatabasesResponse.LogicDatabaseList[" + i + "].Logic")); |
1,285,466 | final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTagsForResourceRequest> request = null;<NEW_LINE>Response<ListTagsForResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForResourceRequest));<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, "MediaConnect");<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<ListTagsForResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsForResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForResource"); |
44,508 | public void init() throws DBException {<NEW_LINE>Properties prop = getProperties();<NEW_LINE>this.tableName = prop.getProperty(TABLENAME_PROPERTY, TABLENAME_PROPERTY_DEFAULT);<NEW_LINE>this.partitionSchema = prop.getProperty(PARTITION_SCHEMA_OPT, DEFAULT_PARTITION_SCHEMA);<NEW_LINE>this.zeropadding = Integer.parseInt(prop.getProperty(ZERO_PADDING_PROPERTY, ZERO_PADDING_PROPERTY_DEFAULT));<NEW_LINE>if (prop.getProperty(INSERT_ORDER_PROPERTY, INSERT_ORDER_PROPERTY_DEFAULT).compareTo("hashed") == 0) {<NEW_LINE>this.orderedinserts = false;<NEW_LINE>} else {<NEW_LINE>this.orderedinserts = true;<NEW_LINE>}<NEW_LINE>initClient();<NEW_LINE>this.session = client.newSession();<NEW_LINE>if (getProperties().getProperty(SYNC_OPS_OPT) != null && getProperties().getProperty(SYNC_OPS_OPT).equals("false")) {<NEW_LINE>this.session.setFlushMode(KuduSession.FlushMode.AUTO_FLUSH_BACKGROUND);<NEW_LINE>this.session.setMutationBufferSpace(getIntFromProp(getProperties(), BUFFER_NUM_OPS_OPT, BUFFER_NUM_OPS_DEFAULT));<NEW_LINE>} else {<NEW_LINE>this.session.setFlushMode(KuduSession.FlushMode.AUTO_FLUSH_SYNC);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>this.kuduTable = client.openTable(tableName);<NEW_LINE>this<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new DBException("Could not open a table because of:", e);<NEW_LINE>}<NEW_LINE>} | .schema = kuduTable.getSchema(); |
34,901 | private void catchup(boolean checkState) {<NEW_LINE>StreamAction state = getServiceState();<NEW_LINE>boolean canCatchup = true;<NEW_LINE>if (!checkState) {<NEW_LINE>Log.i(LOG_TAG, "catchup without checking state ");<NEW_LINE>} else {<NEW_LINE>Log.i(LOG_TAG, "catchup with state " + state + " CurrentActivity " + VectorApp.getCurrentActivity());<NEW_LINE>// the catchup should only be done<NEW_LINE>// 1- the state is in catchup : the event stream might have gone to sleep between two catchups<NEW_LINE>// 2- the thread is suspended<NEW_LINE>// 3- the application has been launched by a push so there is no displayed activity<NEW_LINE>canCatchup = (state == StreamAction.CATCHUP) || (state == StreamAction.PAUSE) || ((StreamAction.START == state) && (null == VectorApp.getCurrentActivity()));<NEW_LINE>}<NEW_LINE>if (canCatchup) {<NEW_LINE>if (mSessions != null) {<NEW_LINE>for (MXSession session : mSessions) {<NEW_LINE>session.catchupEventStream();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Log.i(LOG_TAG, "catchup no session");<NEW_LINE>}<NEW_LINE>setServiceState(StreamAction.CATCHUP);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | Log.i(LOG_TAG, "No catchup is triggered because there is already a running event thread"); |
474,631 | private void altCommitToOriginal(@Nonnull DocumentEvent e) {<NEW_LINE>final PsiFile origPsiFile = PsiDocumentManager.getInstance(myProject).getPsiFile(myOrigDocument);<NEW_LINE>String newText = myNewDocument.getText();<NEW_LINE>// prepare guarded blocks<NEW_LINE>Map<String, String> replacementMap = new LinkedHashMap<>();<NEW_LINE>int count = 0;<NEW_LINE>for (RangeMarker o : ContainerUtil.reverse(((DocumentEx) myNewDocument).getGuardedBlocks())) {<NEW_LINE>String replacement = o.getUserData(REPLACEMENT_KEY);<NEW_LINE>String tempText = "REPLACE" + (count++) + Long.toHexString(StringHash.calc(replacement));<NEW_LINE>newText = newText.substring(0, o.getStartOffset()) + tempText + newText.substring(o.getEndOffset());<NEW_LINE>replacementMap.put(tempText, replacement);<NEW_LINE>}<NEW_LINE>// run preformat processors<NEW_LINE>final int hostStartOffset = myAltFullRange.getStartOffset();<NEW_LINE>myEditor.getCaretModel().moveToOffset(hostStartOffset);<NEW_LINE>for (CopyPastePreProcessor preProcessor : Extensions.getExtensions(CopyPastePreProcessor.EP_NAME)) {<NEW_LINE>newText = preProcessor.preprocessOnPaste(myProject, origPsiFile, myEditor, newText, null);<NEW_LINE>}<NEW_LINE>myOrigDocument.replaceString(hostStartOffset, <MASK><NEW_LINE>// replace temp strings for guarded blocks<NEW_LINE>for (String tempText : replacementMap.keySet()) {<NEW_LINE>int idx = CharArrayUtil.indexOf(myOrigDocument.getCharsSequence(), tempText, hostStartOffset, myAltFullRange.getEndOffset());<NEW_LINE>myOrigDocument.replaceString(idx, idx + tempText.length(), replacementMap.get(tempText));<NEW_LINE>}<NEW_LINE>// JAVA: fix occasional char literal concatenation<NEW_LINE>fixDocumentQuotes(myOrigDocument, hostStartOffset - 1);<NEW_LINE>fixDocumentQuotes(myOrigDocument, myAltFullRange.getEndOffset());<NEW_LINE>// reformat<NEW_LINE>PsiDocumentManager.getInstance(myProject).commitDocument(myOrigDocument);<NEW_LINE>Runnable task = new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>CodeStyleManager.getInstance(myProject).reformatRange(origPsiFile, hostStartOffset, myAltFullRange.getEndOffset(), true);<NEW_LINE>} catch (IncorrectOperationException e) {<NEW_LINE>// LOG.error(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>DocumentUtil.executeInBulk(myOrigDocument, true, task);<NEW_LINE>PsiElement newInjected = InjectedLanguageManager.getInstance(myProject).findInjectedElementAt(origPsiFile, hostStartOffset);<NEW_LINE>DocumentWindow documentWindow = newInjected == null ? null : InjectedLanguageUtil.getDocumentWindow(newInjected);<NEW_LINE>if (documentWindow != null) {<NEW_LINE>myEditor.getCaretModel().moveToOffset(documentWindow.injectedToHost(e.getOffset()));<NEW_LINE>myEditor.getScrollingModel().scrollToCaret(ScrollType.MAKE_VISIBLE);<NEW_LINE>}<NEW_LINE>} | myAltFullRange.getEndOffset(), newText); |
831,622 | static void rethrow(Throwable cause, BugReporter bugReporter, EvaluationResult<?> resultForDebugging) throws BuildFailedException, TestExecException {<NEW_LINE>Throwables.throwIfUnchecked(cause);<NEW_LINE>Throwable innerCause = cause.getCause();<NEW_LINE>if (innerCause instanceof TestExecException) {<NEW_LINE>throw (TestExecException) innerCause;<NEW_LINE>}<NEW_LINE>if (cause instanceof ActionExecutionException) {<NEW_LINE>ActionExecutionException actionExecutionCause = (ActionExecutionException) cause;<NEW_LINE>String message = cause.getMessage();<NEW_LINE>if (actionExecutionCause.getAction() != null) {<NEW_LINE>message = actionExecutionCause.getAction().describe() + " failed: " + message;<NEW_LINE>}<NEW_LINE>// Sometimes ActionExecutionExceptions are caused by Actions with no owner.<NEW_LINE>if (actionExecutionCause.getLocation() != null) {<NEW_LINE>message = actionExecutionCause.getLocation() + " " + message;<NEW_LINE>}<NEW_LINE>throw new BuildFailedException(message, actionExecutionCause.isCatastrophe(), /*errorAlreadyShown=*/<NEW_LINE>!actionExecutionCause.showError(), actionExecutionCause.getDetailedExitCode());<NEW_LINE>}<NEW_LINE>if (cause instanceof InputFileErrorException) {<NEW_LINE>throw (InputFileErrorException) cause;<NEW_LINE>}<NEW_LINE>// We encountered an exception we don't think we should have encountered. This can indicate<NEW_LINE>// an exception-processing bug in our code, such as lower level exceptions not being properly<NEW_LINE>// handled, or in our expectations in this method.<NEW_LINE>if (cause instanceof DetailedException) {<NEW_LINE>// The exception escaped Skyframe error bubbling, but its failure detail can still be used.<NEW_LINE>bugReporter.logUnexpected((Exception) cause, "action terminated with unexpected exception with result %s", resultForDebugging);<NEW_LINE>throw new BuildFailedException(cause.getMessage(), ((DetailedException) cause).getDetailedExitCode());<NEW_LINE>}<NEW_LINE>// An undetailed exception means we may incorrectly attribute responsibility for the failure:<NEW_LINE>// we need to fix that.<NEW_LINE>bugReporter.sendBugReport(new IllegalStateException<MASK><NEW_LINE>String message = "Unexpected exception, please file an issue with the Bazel team: " + cause.getMessage();<NEW_LINE>throw new BuildFailedException(message, createDetailedExecutionExitCode(message, UNKONW_EXECUTION));<NEW_LINE>} | ("action terminated with unexpected exception with result " + resultForDebugging, cause)); |
1,211,670 | private void _fixOrphanVertices() {<NEW_LINE>int pathCount = 0;<NEW_LINE>// clean any path info<NEW_LINE>for (int node = m_sortedVertices.getFirst(m_sortedVertices.getFirstList()); node != -1; node = m_sortedVertices.getNext(node)) {<NEW_LINE>int vertex = m_sortedVertices.getData(node);<NEW_LINE>m_shape.setPathToVertex_(vertex, -1);<NEW_LINE>}<NEW_LINE>int geometrySize = 0;<NEW_LINE>for (int path = m_shape.getFirstPath(m_geometry); path != -1; ) {<NEW_LINE>int first = m_shape.getFirstVertex(path);<NEW_LINE>if (first == -1 || m_shape.getPathFromVertex(first) != -1) {<NEW_LINE>int p = path;<NEW_LINE>path = m_shape.getNextPath(path);<NEW_LINE>m_shape.removePathOnly_(p);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>m_shape.setPathToVertex_(first, path);<NEW_LINE>int pathSize = 1;<NEW_LINE>for (int vertex = m_shape.getNextVertex(first); vertex != first; vertex = m_shape.getNextVertex(vertex)) {<NEW_LINE>m_shape.setPathToVertex_(vertex, path);<NEW_LINE>pathSize++;<NEW_LINE>}<NEW_LINE>m_shape.setRingAreaValid_(path, false);<NEW_LINE>m_shape.setPathSize_(path, pathSize);<NEW_LINE>m_shape.setLastVertex_(path, m_shape.getPrevVertex(first));<NEW_LINE>geometrySize += pathSize;<NEW_LINE>pathCount++;<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// Some vertices do not belong to any path. We have to create new path<NEW_LINE>// objects for those.<NEW_LINE>// Produce new paths for the orphan vertices.<NEW_LINE>for (int node = m_sortedVertices.getFirst(m_sortedVertices.getFirstList()); node != -1; node = m_sortedVertices.getNext(node)) {<NEW_LINE>int vertex = m_sortedVertices.getData(node);<NEW_LINE>if (m_shape.getPathFromVertex(vertex) != -1)<NEW_LINE>continue;<NEW_LINE>int path = m_shape.insertClosedPath_(m_geometry, -1, vertex, vertex, null);<NEW_LINE>geometrySize += m_shape.getPathSize(path);<NEW_LINE>pathCount++;<NEW_LINE>}<NEW_LINE>m_shape.setGeometryPathCount_(m_geometry, pathCount);<NEW_LINE>m_shape.setGeometryVertexCount_(m_geometry, geometrySize);<NEW_LINE>int totalPointCount = 0;<NEW_LINE>for (int geometry = m_shape.getFirstGeometry(); geometry != -1; geometry = m_shape.getNextGeometry(geometry)) {<NEW_LINE>totalPointCount += m_shape.getPointCount(geometry);<NEW_LINE>}<NEW_LINE>m_shape.setTotalPointCount_(totalPointCount);<NEW_LINE>} | path = m_shape.getNextPath(path); |
1,124,143 | public static char[] toCharArray(char[] methodSignature, char[] methodName, char[][] parameterNames, boolean fullyQualifyTypeNames, boolean includeReturnType, boolean isVargArgs) {<NEW_LINE>int firstParen = CharOperation.indexOf(C_PARAM_START, methodSignature);<NEW_LINE>if (firstParen == -1) {<NEW_LINE>throw new IllegalArgumentException(String.valueOf(methodSignature));<NEW_LINE>}<NEW_LINE>StringBuffer buffer = new StringBuffer(methodSignature.length + 10);<NEW_LINE>// return type<NEW_LINE>if (includeReturnType) {<NEW_LINE>char[] rts = getReturnType(methodSignature);<NEW_LINE>appendTypeSignature(rts, 0, fullyQualifyTypeNames, buffer);<NEW_LINE>buffer.append(' ');<NEW_LINE>}<NEW_LINE>// selector<NEW_LINE>if (methodName != null) {<NEW_LINE>buffer.append(methodName);<NEW_LINE>}<NEW_LINE>// parameters<NEW_LINE>buffer.append('(');<NEW_LINE>char[][] pts = getParameterTypes(methodSignature);<NEW_LINE>// search for the last array in the signature<NEW_LINE>int max = pts.length;<NEW_LINE>int index = max - 1;<NEW_LINE>loop: for (int i = index; i >= 0; i--) {<NEW_LINE>if (pts[i][0] == Signature.C_ARRAY) {<NEW_LINE>break loop;<NEW_LINE>}<NEW_LINE>index--;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < max; i++) {<NEW_LINE>if (i == index) {<NEW_LINE>appendTypeSignature(pts[i], <MASK><NEW_LINE>} else {<NEW_LINE>appendTypeSignature(pts[i], 0, fullyQualifyTypeNames, buffer);<NEW_LINE>}<NEW_LINE>if (parameterNames != null) {<NEW_LINE>buffer.append(' ');<NEW_LINE>buffer.append(parameterNames[i]);<NEW_LINE>}<NEW_LINE>if (i != pts.length - 1) {<NEW_LINE>buffer.append(',');<NEW_LINE>buffer.append(' ');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>buffer.append(')');<NEW_LINE>char[] result = new char[buffer.length()];<NEW_LINE>buffer.getChars(0, buffer.length(), result, 0);<NEW_LINE>return result;<NEW_LINE>} | 0, fullyQualifyTypeNames, buffer, isVargArgs); |
1,334,498 | public static DescribeRegionsResponse unmarshall(DescribeRegionsResponse describeRegionsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeRegionsResponse.setRequestId(_ctx.stringValue("DescribeRegionsResponse.RequestId"));<NEW_LINE>describeRegionsResponse.setErrorCode(_ctx.integerValue("DescribeRegionsResponse.ErrorCode"));<NEW_LINE>describeRegionsResponse.setSuccess(_ctx.booleanValue("DescribeRegionsResponse.Success"));<NEW_LINE>List<Result> regions = new ArrayList<Result>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeRegionsResponse.Regions.Length"); i++) {<NEW_LINE>Result result = new Result();<NEW_LINE>result.setLocalName(_ctx.stringValue("DescribeRegionsResponse.Regions[" + i + "].LocalName"));<NEW_LINE>result.setRegionEndpoint(_ctx.stringValue<MASK><NEW_LINE>result.setRegionId(_ctx.stringValue("DescribeRegionsResponse.Regions[" + i + "].RegionId"));<NEW_LINE>regions.add(result);<NEW_LINE>}<NEW_LINE>describeRegionsResponse.setRegions(regions);<NEW_LINE>return describeRegionsResponse;<NEW_LINE>} | ("DescribeRegionsResponse.Regions[" + i + "].RegionEndpoint")); |
1,662,104 | public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException {<NEW_LINE>try {<NEW_LINE>setupLock.readLock().lock();<NEW_LINE>if (probes.isEmpty())<NEW_LINE>return null;<NEW_LINE>className = className != null ? className : "<anonymous>";<NEW_LINE>if ((loader == null || loader.equals(ClassLoader.getSystemClassLoader())) && isSensitiveClass(className)) {<NEW_LINE>if (isDebug()) {<NEW_LINE>// NOI18N<NEW_LINE>debugPrint("skipping transform for BTrace class " + className);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (filter.matchClass(className) == Filter.Result.FALSE)<NEW_LINE>return null;<NEW_LINE>boolean entered = BTraceRuntime.enter();<NEW_LINE>try {<NEW_LINE>if (isDebug()) {<NEW_LINE>debug.dumpClass(className.replace('.', '/') + "_orig", classfileBuffer);<NEW_LINE>}<NEW_LINE>BTraceClassReader cr = InstrumentUtils.newClassReader(loader, classfileBuffer);<NEW_LINE>BTraceClassWriter cw = InstrumentUtils.newClassWriter(cr);<NEW_LINE>cw.addCushionMethods(cushionMethods);<NEW_LINE>for (BTraceProbe p : probes) {<NEW_LINE>p.notifyTransform(className);<NEW_LINE>cw.addInstrumentor(p, loader);<NEW_LINE>}<NEW_LINE>byte[] transformed = cw.instrument();<NEW_LINE>if (transformed == null) {<NEW_LINE>// no instrumentation necessary<NEW_LINE>if (isDebug()) {<NEW_LINE>debugPrint("skipping class " + cr.getJavaClassName());<NEW_LINE>}<NEW_LINE>return classfileBuffer;<NEW_LINE>} else {<NEW_LINE>if (isDebug()) {<NEW_LINE>debugPrint("transformed class " + cr.getJavaClassName());<NEW_LINE>}<NEW_LINE>if (debug.isDumpClasses()) {<NEW_LINE>debug.dumpClass(className.replace('.', '/'), transformed);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return transformed;<NEW_LINE>} catch (Throwable th) {<NEW_LINE>debugPrint(th);<NEW_LINE>throw th;<NEW_LINE>} finally {<NEW_LINE>if (entered) {<NEW_LINE>BTraceRuntime.leave();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>setupLock<MASK><NEW_LINE>}<NEW_LINE>} | .readLock().unlock(); |
992,901 | /* Build call for subscriptionsGet */<NEW_LINE>private com.squareup.okhttp.Call subscriptionsGetCall(String apiId, Integer limit, Integer offset, String accept, String ifNoneMatch, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/subscriptions".replaceAll("\\{format\\}", "json");<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>if (apiId != null)<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "apiId", apiId));<NEW_LINE>if (limit != null)<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));<NEW_LINE>if (offset != null)<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset));<NEW_LINE>Map<String, String> localVarHeaderParams = new <MASK><NEW_LINE>if (accept != null)<NEW_LINE>localVarHeaderParams.put("Accept", apiClient.parameterToString(accept));<NEW_LINE>if (ifNoneMatch != null)<NEW_LINE>localVarHeaderParams.put("If-None-Match", apiClient.parameterToString(ifNoneMatch));<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null)<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>if (progressListener != null) {<NEW_LINE>apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {<NEW_LINE>com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());<NEW_LINE>return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>} | HashMap<String, String>(); |
32,170 | private static void assertEventProps(RegressionEnvironment env, EventBean eventBean, String currSymbol, String prev0Symbol, Double prev0Price, String prev1Symbol, Double prev1Price, String prev2Symbol, Double prev2Price, String prevTail0Symbol, Double prevTail0Price, String prevTail1Symbol, Double prevTail1Price, Long prevCount, Object[] prevWindow) {<NEW_LINE>assertEquals(currSymbol, eventBean.get("currSymbol"));<NEW_LINE>assertEquals(prev0Symbol, eventBean.get("prev0Symbol"));<NEW_LINE>assertEquals(prev0Price, eventBean.get("prev0Price"));<NEW_LINE>assertEquals(prev1Symbol, eventBean.get("prev1Symbol"));<NEW_LINE>assertEquals(prev1Price, eventBean.get("prev1Price"));<NEW_LINE>assertEquals(prev2Symbol<MASK><NEW_LINE>assertEquals(prev2Price, eventBean.get("prev2Price"));<NEW_LINE>assertEquals(prevTail0Symbol, eventBean.get("prevTail0Symbol"));<NEW_LINE>assertEquals(prevTail0Price, eventBean.get("prevTail0Price"));<NEW_LINE>assertEquals(prevTail1Symbol, eventBean.get("prevTail1Symbol"));<NEW_LINE>assertEquals(prevTail1Price, eventBean.get("prevTail1Price"));<NEW_LINE>assertEquals(prevCount, eventBean.get("prevCountPrice"));<NEW_LINE>EPAssertionUtil.assertEqualsExactOrder((Object[]) eventBean.get("prevWindowPrice"), prevWindow);<NEW_LINE>env.listenerReset("s0");<NEW_LINE>} | , eventBean.get("prev2Symbol")); |
1,296,174 | public void doAction(ActionEvent e) {<NEW_LINE>HashTree wholeTree = GuiPackage.getInstance().getTreeModel().getTestPlan();<NEW_LINE>SamplerAndTransactionNameVisitor visitor = new SamplerAndTransactionNameVisitor();<NEW_LINE>wholeTree.traverse(visitor);<NEW_LINE>Set<String> sampleNames = visitor.getListOfTransactions();<NEW_LINE>if (sampleNames.isEmpty()) {<NEW_LINE>log.warn("No transaction exported using regexp '{}', modify property '{}' to fix this problem", TRANSACTIONS_REGEX_PATTERN, "report_transactions_pattern");<NEW_LINE>showResult(e, "No transaction exported using regexp '" + TRANSACTIONS_REGEX_PATTERN + "', modify property 'report_transactions_pattern' to fix this problem");<NEW_LINE>} else {<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>for (String sampleName : sampleNames) {<NEW_LINE>builder.append(sampleName).append('|');<NEW_LINE>}<NEW_LINE>builder.setLength(builder.length() - 1);<NEW_LINE>String result = builder.toString();<NEW_LINE><MASK><NEW_LINE>showResult(e, "jmeter.reportgenerator.exporter.html.series_filter=^(" + result + ")(-success|-failure)?$");<NEW_LINE>}<NEW_LINE>} | log.info("Exported transactions: jmeter.reportgenerator.exporter.html.series_filter=^({})(-success|-failure)?$", result); |
297,456 | final GetCertificateResult executeGetCertificate(GetCertificateRequest getCertificateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getCertificateRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetCertificateRequest> request = null;<NEW_LINE>Response<GetCertificateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetCertificateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getCertificateRequest));<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, "ACM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetCertificate");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetCertificateResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetCertificateResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
1,413,252 | public void marshall(ConfigRuleEvaluationStatus configRuleEvaluationStatus, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (configRuleEvaluationStatus == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(configRuleEvaluationStatus.getConfigRuleName(), CONFIGRULENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(configRuleEvaluationStatus.getConfigRuleArn(), CONFIGRULEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(configRuleEvaluationStatus.getConfigRuleId(), CONFIGRULEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(configRuleEvaluationStatus.getLastSuccessfulInvocationTime(), LASTSUCCESSFULINVOCATIONTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(configRuleEvaluationStatus.getLastFailedInvocationTime(), LASTFAILEDINVOCATIONTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(configRuleEvaluationStatus.getLastSuccessfulEvaluationTime(), LASTSUCCESSFULEVALUATIONTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(configRuleEvaluationStatus.getFirstActivatedTime(), FIRSTACTIVATEDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(configRuleEvaluationStatus.getLastDeactivatedTime(), LASTDEACTIVATEDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(configRuleEvaluationStatus.getLastErrorCode(), LASTERRORCODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(configRuleEvaluationStatus.getLastErrorMessage(), LASTERRORMESSAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(configRuleEvaluationStatus.getFirstEvaluationStarted(), FIRSTEVALUATIONSTARTED_BINDING);<NEW_LINE>protocolMarshaller.marshall(configRuleEvaluationStatus.getLastDebugLogDeliveryStatus(), LASTDEBUGLOGDELIVERYSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(configRuleEvaluationStatus.getLastDebugLogDeliveryStatusReason(), LASTDEBUGLOGDELIVERYSTATUSREASON_BINDING);<NEW_LINE>protocolMarshaller.marshall(configRuleEvaluationStatus.getLastDebugLogDeliveryTime(), LASTDEBUGLOGDELIVERYTIME_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | configRuleEvaluationStatus.getLastFailedEvaluationTime(), LASTFAILEDEVALUATIONTIME_BINDING); |
620,444 | public static double d(double[] x1, double[] x2) {<NEW_LINE>int n1 = x1.length;<NEW_LINE>int n2 = x2.length;<NEW_LINE>double[][] table = new double[2][n2 + 1];<NEW_LINE>table[0][0] = 0;<NEW_LINE>for (int i = 1; i <= n2; i++) {<NEW_LINE>table[0][i] = Double.POSITIVE_INFINITY;<NEW_LINE>}<NEW_LINE>for (int i = 1; i <= n1; i++) {<NEW_LINE>table[1][0] = Double.POSITIVE_INFINITY;<NEW_LINE>for (int j = 1; j <= n2; j++) {<NEW_LINE>double cost = Math.abs(x1[i - 1] - x2[j - 1]);<NEW_LINE>double min = table[0][j - 1];<NEW_LINE>if (min > table[0][j]) {<NEW_LINE>min = table[0][j];<NEW_LINE>}<NEW_LINE>if (min > table[1][j - 1]) {<NEW_LINE>min = table<MASK><NEW_LINE>}<NEW_LINE>table[1][j] = cost + min;<NEW_LINE>}<NEW_LINE>double[] swap = table[0];<NEW_LINE>table[0] = table[1];<NEW_LINE>table[1] = swap;<NEW_LINE>}<NEW_LINE>return table[0][n2];<NEW_LINE>} | [1][j - 1]; |
1,346,568 | static HelpdeskVerificationStateBean fromClientString(final PwmRequest pwmRequest, final String rawValue) throws PwmUnrecoverableException {<NEW_LINE>final int maxAgeSeconds = Integer.parseInt(pwmRequest.getDomainConfig().readAppProperty(AppProperty.HELPDESK_VERIFICATION_TIMEOUT_SECONDS));<NEW_LINE>final TimeDuration maxAge = TimeDuration.of(maxAgeSeconds, TimeDuration.Unit.SECONDS);<NEW_LINE>final UserIdentity actor = pwmRequest.getUserInfoIfLoggedIn();<NEW_LINE>HelpdeskVerificationStateBean state = null;<NEW_LINE>if (rawValue != null && !rawValue.isEmpty()) {<NEW_LINE>state = pwmRequest.getPwmDomain().getSecureService().<MASK><NEW_LINE>if (!state.getActor().equals(actor)) {<NEW_LINE>state = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>state = state != null ? state : new HelpdeskVerificationStateBean(actor);<NEW_LINE>state.maximumAge = maxAge;<NEW_LINE>state.purgeOldRecords();<NEW_LINE>{<NEW_LINE>final HelpdeskVerificationStateBean finalState = state;<NEW_LINE>LOGGER.debug(pwmRequest, () -> "read current state: " + JsonFactory.get().serialize(finalState));<NEW_LINE>}<NEW_LINE>return state;<NEW_LINE>} | decryptObject(rawValue, HelpdeskVerificationStateBean.class); |
753,781 | // Finds all matches in program B to the function in Program A<NEW_LINE>public static List<MatchedFunctions> matchOneFunction(Program aProgram, Address aEntryPoint, Program bProgram, AddressSetView bAddressSet, FunctionHasher hasher, TaskMonitor monitor) throws CancelledException {<NEW_LINE>Map<Long, Match> functionHashes = new HashMap<>();<NEW_LINE>List<MatchedFunctions> functionMatches = new ArrayList<MatchedFunctions>();<NEW_LINE>Function aFunc = aProgram.getFunctionManager().getFunctionContaining(aEntryPoint);<NEW_LINE>FunctionIterator bProgfIter = bAddressSet == null ? bProgram.getFunctionManager().getFunctions(true) : bProgram.getFunctionManager().getFunctions(bAddressSet, true);<NEW_LINE>// Hash the one function in program A<NEW_LINE>hashFunction(monitor, <MASK><NEW_LINE>// Hash functions in Program B<NEW_LINE>while (!monitor.isCancelled() && bProgfIter.hasNext()) {<NEW_LINE>Function func = bProgfIter.next();<NEW_LINE>hashFunction(monitor, functionHashes, func, hasher, false);<NEW_LINE>}<NEW_LINE>// Find the remaining hash matches ---> unique code match left and THERE is no symbol that matches<NEW_LINE>// in the other program.<NEW_LINE>List<Long> keys = new ArrayList<>(functionHashes.keySet());<NEW_LINE>for (long key : keys) {<NEW_LINE>if (monitor.isCancelled()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>Match match = functionHashes.get(key);<NEW_LINE>ArrayList<Address> aProgAddrs = match.aAddresses;<NEW_LINE>ArrayList<Address> bProgAddrs = match.bAddresses;<NEW_LINE>// Want all possible matches from destination program<NEW_LINE>if ((aProgAddrs.size() == 1) && (bProgAddrs.size() >= 1)) {<NEW_LINE>for (int m = 0; m < bProgAddrs.size(); m++) {<NEW_LINE>MatchedFunctions functionMatch = new MatchedFunctions(aProgram, bProgram, aProgAddrs.get(0), bProgAddrs.get(m), aProgAddrs.size(), bProgAddrs.size(), "Code Only Match");<NEW_LINE>functionMatches.add(functionMatch);<NEW_LINE>}<NEW_LINE>functionHashes.remove(key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return functionMatches;<NEW_LINE>} | functionHashes, aFunc, hasher, true); |
1,660,217 | public void init() throws LoadBalanceException {<NEW_LINE>Backend <MASK><NEW_LINE>if (be == null) {<NEW_LINE>throw new LoadBalanceException("backend " + beId + " does not exist");<NEW_LINE>}<NEW_LINE>isAvailable = be.isAvailable();<NEW_LINE>ImmutableMap<String, DiskInfo> disks = be.getDisks();<NEW_LINE>for (DiskInfo diskInfo : disks.values()) {<NEW_LINE>TStorageMedium medium = diskInfo.getStorageMedium();<NEW_LINE>if (diskInfo.getState() == DiskState.ONLINE) {<NEW_LINE>// we only collect online disk's capacity<NEW_LINE>totalCapacityMap.put(medium, totalCapacityMap.getOrDefault(medium, 0L) + diskInfo.getDataTotalCapacityB());<NEW_LINE>totalUsedCapacityMap.put(medium, totalUsedCapacityMap.getOrDefault(medium, 0L) + diskInfo.getDataUsedCapacityB());<NEW_LINE>}<NEW_LINE>RootPathLoadStatistic pathStatistic = new RootPathLoadStatistic(beId, diskInfo.getRootPath(), diskInfo.getPathHash(), diskInfo.getStorageMedium(), diskInfo.getDataTotalCapacityB(), diskInfo.getDataUsedCapacityB(), diskInfo.getState());<NEW_LINE>pathStatistics.add(pathStatistic);<NEW_LINE>}<NEW_LINE>totalReplicaNumMap = invertedIndex.getReplicaNumByBeIdAndStorageMedium(beId);<NEW_LINE>// This is very tricky. because the number of replica on specified medium we get<NEW_LINE>// from getReplicaNumByBeIdAndStorageMedium() is defined by table properties,<NEW_LINE>// but in fact there may not has SSD disk on this backend. So if we found that no SSD disk on this<NEW_LINE>// backend, set the replica number to 0, otherwise, the average replica number on specified medium<NEW_LINE>// will be incorrect.<NEW_LINE>for (TStorageMedium medium : TStorageMedium.values()) {<NEW_LINE>if (!hasMedium(medium)) {<NEW_LINE>totalReplicaNumMap.put(medium, 0L);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (TStorageMedium storageMedium : TStorageMedium.values()) {<NEW_LINE>classifyPathByLoad(storageMedium);<NEW_LINE>}<NEW_LINE>// sort the list<NEW_LINE>Collections.sort(pathStatistics);<NEW_LINE>} | be = infoService.getBackend(beId); |
13,188 | // https://stackoverflow.com/questions/21270892/generate-affinetransform-from-3-points<NEW_LINE>public static AffineTransform deriveAffineTransform(double sourceX1, double sourceY1, double sourceX2, double sourceY2, double sourceX3, double sourceY3, double destX1, double destY1, double destX2, double destY2, double destX3, double destY3) {<NEW_LINE>RealMatrix source = MatrixUtils.createRealMatrix(new double[][] { { sourceX1, sourceX2, sourceX3 }, { sourceY1, sourceY2, sourceY3 }, { 1, 1, 1 } });<NEW_LINE>RealMatrix dest = MatrixUtils.createRealMatrix(new double[][] { { destX1, destX2, destX3 }, { destY1, destY2, destY3 } });<NEW_LINE>RealMatrix inverse = new LUDecomposition(source).getSolver().getInverse();<NEW_LINE>RealMatrix <MASK><NEW_LINE>double m00 = transform.getEntry(0, 0);<NEW_LINE>double m01 = transform.getEntry(0, 1);<NEW_LINE>double m02 = transform.getEntry(0, 2);<NEW_LINE>double m10 = transform.getEntry(1, 0);<NEW_LINE>double m11 = transform.getEntry(1, 1);<NEW_LINE>double m12 = transform.getEntry(1, 2);<NEW_LINE>return new AffineTransform(m00, m10, m01, m11, m02, m12);<NEW_LINE>} | transform = dest.multiply(inverse); |
1,170,353 | /*<NEW_LINE>* Answer a base type reference (can be an array of base type).<NEW_LINE>*/<NEW_LINE>public static final TypeReference baseTypeReference(int baseType, int dim, Annotation[][] dimAnnotations) {<NEW_LINE>if (dim == 0) {<NEW_LINE>switch(baseType) {<NEW_LINE>case (TypeIds.T_void):<NEW_LINE>return new SingleTypeReference(TypeBinding.VOID.simpleName, 0);<NEW_LINE>case (TypeIds.T_boolean):<NEW_LINE>return new SingleTypeReference(TypeBinding.BOOLEAN.simpleName, 0);<NEW_LINE>case (TypeIds.T_char):<NEW_LINE>return new SingleTypeReference(TypeBinding.CHAR.simpleName, 0);<NEW_LINE>case (TypeIds.T_float):<NEW_LINE>return new SingleTypeReference(TypeBinding.FLOAT.simpleName, 0);<NEW_LINE>case (TypeIds.T_double):<NEW_LINE>return new SingleTypeReference(TypeBinding.DOUBLE.simpleName, 0);<NEW_LINE>case (TypeIds.T_byte):<NEW_LINE>return new SingleTypeReference(TypeBinding.BYTE.simpleName, 0);<NEW_LINE>case (TypeIds.T_short):<NEW_LINE>return new SingleTypeReference(TypeBinding.SHORT.simpleName, 0);<NEW_LINE>case (TypeIds.T_int):<NEW_LINE>return new SingleTypeReference(TypeBinding.INT.simpleName, 0);<NEW_LINE>default:<NEW_LINE>// T_long<NEW_LINE>return new SingleTypeReference(TypeBinding.LONG.simpleName, 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>switch(baseType) {<NEW_LINE>case (TypeIds.T_void):<NEW_LINE>return new ArrayTypeReference(TypeBinding.VOID.simpleName, dim, dimAnnotations, 0);<NEW_LINE>case (TypeIds.T_boolean):<NEW_LINE>return new ArrayTypeReference(TypeBinding.BOOLEAN.simpleName, dim, dimAnnotations, 0);<NEW_LINE>case (TypeIds.T_char):<NEW_LINE>return new ArrayTypeReference(TypeBinding.CHAR.simpleName, dim, dimAnnotations, 0);<NEW_LINE>case (TypeIds.T_float):<NEW_LINE>return new ArrayTypeReference(TypeBinding.FLOAT.simpleName, dim, dimAnnotations, 0);<NEW_LINE>case (TypeIds.T_double):<NEW_LINE>return new ArrayTypeReference(TypeBinding.DOUBLE.<MASK><NEW_LINE>case (TypeIds.T_byte):<NEW_LINE>return new ArrayTypeReference(TypeBinding.BYTE.simpleName, dim, dimAnnotations, 0);<NEW_LINE>case (TypeIds.T_short):<NEW_LINE>return new ArrayTypeReference(TypeBinding.SHORT.simpleName, dim, dimAnnotations, 0);<NEW_LINE>case (TypeIds.T_int):<NEW_LINE>return new ArrayTypeReference(TypeBinding.INT.simpleName, dim, dimAnnotations, 0);<NEW_LINE>default:<NEW_LINE>// T_long<NEW_LINE>return new ArrayTypeReference(TypeBinding.LONG.simpleName, dim, dimAnnotations, 0);<NEW_LINE>}<NEW_LINE>} | simpleName, dim, dimAnnotations, 0); |
601,367 | protected Control createDialogArea(Composite parent) {<NEW_LINE>// Help<NEW_LINE>PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, HELP_ID);<NEW_LINE>setTitle(Messages.NewNestedRelationDialog_1);<NEW_LINE>String message = NLS.bind(Messages.NewNestedRelationDialog_2, fSourceObject.getName(<MASK><NEW_LINE>setMessage(message);<NEW_LINE>Composite composite = (Composite) super.createDialogArea(parent);<NEW_LINE>Composite client = new Composite(composite, SWT.NULL);<NEW_LINE>GridLayout layout = new GridLayout(1, false);<NEW_LINE>client.setLayout(layout);<NEW_LINE>client.setLayoutData(new GridData(GridData.FILL_BOTH));<NEW_LINE>Composite tableComp = new Composite(client, SWT.BORDER);<NEW_LINE>tableComp.setLayout(new TableColumnLayout());<NEW_LINE>tableComp.setLayoutData(new GridData(GridData.FILL_BOTH));<NEW_LINE>fTableViewer = new RelationsTableViewer(tableComp, SWT.NONE);<NEW_LINE>fTableViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));<NEW_LINE>// anything will do //$NON-NLS-1$<NEW_LINE>fTableViewer.setInput("");<NEW_LINE>fTableViewer.addDoubleClickListener(new IDoubleClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void doubleClick(DoubleClickEvent event) {<NEW_LINE>okPressed();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void selectionChanged(SelectionChangedEvent event) {<NEW_LINE>fSelected = (NestedConnectionInfo) ((IStructuredSelection) fTableViewer.getSelection()).getFirstElement();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (fTableViewer.validRelations != null && !fTableViewer.validRelations.isEmpty()) {<NEW_LINE>fTableViewer.setSelection(new StructuredSelection(fTableViewer.validRelations.get(0)));<NEW_LINE>}<NEW_LINE>return composite;<NEW_LINE>} | ), fTargetObject.getName()); |
856,267 | protected void parseCreateField(ParseContext context) throws IOException {<NEW_LINE>final String value;<NEW_LINE>if (context.externalValueSet()) {<NEW_LINE>value = context.externalValue().toString();<NEW_LINE>} else {<NEW_LINE>XContentParser parser = context.parser();<NEW_LINE>if (parser.currentToken() == XContentParser.Token.VALUE_NULL) {<NEW_LINE>value = nullValue;<NEW_LINE>} else {<NEW_LINE>value = parser.textOrNull();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (value == null || value.length() > ignoreAbove) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>RawCollationKey key = collator.getRawCollationKey(value, null);<NEW_LINE>final BytesRef binaryValue = new BytesRef(key.<MASK><NEW_LINE>if (fieldType.indexOptions() != IndexOptions.NONE || fieldType.stored()) {<NEW_LINE>Field field = new Field(mappedFieldType.name(), binaryValue, fieldType);<NEW_LINE>context.doc().add(field);<NEW_LINE>}<NEW_LINE>if (fieldType().hasDocValues()) {<NEW_LINE>context.doc().add(new SortedSetDocValuesField(fieldType().name(), binaryValue));<NEW_LINE>} else if (fieldType.indexOptions() != IndexOptions.NONE || fieldType.stored()) {<NEW_LINE>createFieldNamesField(context);<NEW_LINE>}<NEW_LINE>} | bytes, 0, key.size); |
146,772 | private boolean writeFloorToFile(String filename, ArrayList<String> rss) throws IOException {<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE><MASK><NEW_LINE>builder.append("# X, Y, HEADING");<NEW_LINE>for (String str : macAddresses) {<NEW_LINE>builder.append(", " + str);<NEW_LINE>}<NEW_LINE>for (String str : rss) {<NEW_LINE>builder.append("\n" + str);<NEW_LINE>}<NEW_LINE>File path = new File(DataConnector.FINGERPRINTS_PATH);<NEW_LINE>if (!path.exists()) {<NEW_LINE>path.mkdir();<NEW_LINE>System.out.println("[Info] Directory: " + DataConnector.FINGERPRINTS_PATH + " created");<NEW_LINE>}<NEW_LINE>File file = new File(filename);<NEW_LINE>if (file.isDirectory()) {<NEW_LINE>System.err.println("[Error]: This is a directory");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (file.exists()) {<NEW_LINE>System.out.println("[Info]: File: " + filename + " would be overwritten");<NEW_LINE>}<NEW_LINE>BufferedWriter bf = new BufferedWriter(new FileWriter(file));<NEW_LINE>bf.write(builder.toString());<NEW_LINE>bf.close();<NEW_LINE>System.out.println("[Info]: File: " + filename + " successfuly saved");<NEW_LINE>return true;<NEW_LINE>} | builder.append(firstLine + "\n"); |
195,483 | public Matrix.EVD eigen(boolean vl, boolean vr, boolean overwrite) {<NEW_LINE>if (m != n) {<NEW_LINE>throw new IllegalArgumentException(String.format("The matrix is not square: %d x %d", m, n));<NEW_LINE>}<NEW_LINE>Matrix eig = overwrite ? this : clone();<NEW_LINE>if (isSymmetric()) {<NEW_LINE>float[] w = new float[n];<NEW_LINE>int info = LAPACK.engine.syevd(eig.layout(), vr ? EVDJob.VECTORS : EVDJob.NO_VECTORS, eig.uplo, n, eig.A, eig.ld, w);<NEW_LINE>if (info != 0) {<NEW_LINE>logger.error("LAPACK SYEV error code: {}", info);<NEW_LINE>throw new ArithmeticException("LAPACK SYEV error code: " + info);<NEW_LINE>}<NEW_LINE>// Vr is not symmetric<NEW_LINE>eig.uplo = null;<NEW_LINE>return new Matrix.EVD(w, vr ? eig : null);<NEW_LINE>} else {<NEW_LINE>float[] wr = new float[n];<NEW_LINE>float[] wi = new float[n];<NEW_LINE>Matrix Vl = vl ? new Matrix(n, n) : new Matrix(1, 1);<NEW_LINE>Matrix Vr = vr ? new Matrix(n, n) <MASK><NEW_LINE>int info = LAPACK.engine.geev(eig.layout(), vl ? EVDJob.VECTORS : EVDJob.NO_VECTORS, vr ? EVDJob.VECTORS : EVDJob.NO_VECTORS, n, eig.A, eig.ld, wr, wi, Vl.A, Vl.ld, Vr.A, Vr.ld);<NEW_LINE>if (info != 0) {<NEW_LINE>logger.error("LAPACK GEEV error code: {}", info);<NEW_LINE>throw new ArithmeticException("LAPACK GEEV error code: " + info);<NEW_LINE>}<NEW_LINE>return new Matrix.EVD(wr, wi, vl ? Vl : null, vr ? Vr : null);<NEW_LINE>}<NEW_LINE>} | : new Matrix(1, 1); |
1,805,724 | private static String quoteString(String string) {<NEW_LINE>if (string.length() == 0) {<NEW_LINE>return string;<NEW_LINE>}<NEW_LINE>StringBuilder buf;<NEW_LINE>int startIndex = 0;<NEW_LINE>// NOI18N<NEW_LINE>int endIndex = string.indexOf('\\');<NEW_LINE>if (endIndex == -1) {<NEW_LINE>buf = new StringBuilder(string.length() + 4);<NEW_LINE>// NOI18N<NEW_LINE>buf.append("\\Q").append(string).append("\\E");<NEW_LINE>} else {<NEW_LINE>buf = new StringBuilder(<MASK><NEW_LINE>do {<NEW_LINE>if (endIndex != startIndex) {<NEW_LINE>// NOI18N<NEW_LINE>buf.append("\\Q");<NEW_LINE>buf.append(string.substring(startIndex, endIndex));<NEW_LINE>// NOI18N<NEW_LINE>buf.append("\\E");<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>buf.append('\\').append('\\');<NEW_LINE>startIndex = endIndex + 1;<NEW_LINE>// NOI18N<NEW_LINE>endIndex = string.indexOf('\\', startIndex);<NEW_LINE>} while (endIndex != -1);<NEW_LINE>if (startIndex != string.length()) {<NEW_LINE>// NOI18N<NEW_LINE>buf.append("\\Q");<NEW_LINE>buf.append(string.substring(startIndex));<NEW_LINE>// NOI18N<NEW_LINE>buf.append("\\E");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return buf.toString();<NEW_LINE>} | string.length() + 16); |
576,319 | public MeetingSetting unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>MeetingSetting meetingSetting = new MeetingSetting();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("RequirePin", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>meetingSetting.setRequirePin(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return meetingSetting;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,556,396 | public static final void takeSubtractUnsafe(byte[] planeData, int planeWidth, int planeHeight, int x, int y, int[] coeff, byte[] pred, int blkW, int blkH) {<NEW_LINE>int outOff = 0;<NEW_LINE>int i;<NEW_LINE>for (i = y; i < Math.min(y + blkH, planeHeight); i++) {<NEW_LINE>int off = i * planeWidth + Math.min(x, planeWidth);<NEW_LINE>int j;<NEW_LINE>for (j = x; j < Math.min(x + blkW, planeWidth); j++, outOff++, off++) {<NEW_LINE>coeff[outOff] = planeData[off] - pred[outOff];<NEW_LINE>}<NEW_LINE>--off;<NEW_LINE>for (; j < x + blkW; j++, outOff++) {<NEW_LINE>coeff[outOff] = planeData[off] - pred[outOff];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (; i < y + blkH; i++) {<NEW_LINE>int off = planeHeight * planeWidth - planeWidth + <MASK><NEW_LINE>int j;<NEW_LINE>for (j = x; j < Math.min(x + blkW, planeWidth); j++, outOff++, off++) {<NEW_LINE>coeff[outOff] = planeData[off] - pred[outOff];<NEW_LINE>}<NEW_LINE>--off;<NEW_LINE>for (; j < x + blkW; j++, outOff++) {<NEW_LINE>coeff[outOff] = planeData[off] - pred[outOff];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Math.min(x, planeWidth); |
1,428,038 | void read(WizardDescriptor settings) {<NEW_LINE>FileObject targetFolder = Templates.getTargetFolder(settings);<NEW_LINE>projectTextField.setText(ProjectUtils.getInformation(project).getDisplayName());<NEW_LINE>SourceGroup[] sourceGroups = SourceGroups.getJavaSourceGroups(project);<NEW_LINE>if (sourceGroups.length > 0) {<NEW_LINE>SourceGroupUISupport.connect(locationComboBox, sourceGroups);<NEW_LINE>packageComboBox.setRenderer(PackageView.listRenderer());<NEW_LINE>updateSourceGroupPackages();<NEW_LINE>// set default source group and package cf. targetFolder<NEW_LINE>SourceGroup targetSourceGroup = targetFolder != null ? SourceGroups.getFolderSourceGroup(sourceGroups, targetFolder) : sourceGroups[0];<NEW_LINE>if (targetSourceGroup != null) {<NEW_LINE>locationComboBox.setSelectedItem(targetSourceGroup);<NEW_LINE>if (targetFolder != null) {<NEW_LINE>String targetPackage = <MASK><NEW_LINE>if (targetPackage != null) {<NEW_LINE>packageComboBoxEditor.setText(targetPackage);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>updateCheckboxes();<NEW_LINE>}<NEW_LINE>} | SourceGroups.getPackageForFolder(targetSourceGroup, targetFolder); |
679,440 | private ClusterState updateILMState(final ClusterState currentState) {<NEW_LINE>if (ilmMode == null) {<NEW_LINE>return currentState;<NEW_LINE>}<NEW_LINE>IndexLifecycleMetadata currentMetadata = currentState.metadata().custom(IndexLifecycleMetadata.TYPE);<NEW_LINE>if (currentMetadata != null && currentMetadata.getOperationMode().isValidChange(ilmMode) == false) {<NEW_LINE>return currentState;<NEW_LINE>} else if (currentMetadata == null) {<NEW_LINE>currentMetadata = IndexLifecycleMetadata.EMPTY;<NEW_LINE>}<NEW_LINE>final OperationMode newMode;<NEW_LINE>if (currentMetadata.getOperationMode().isValidChange(ilmMode)) {<NEW_LINE>newMode = ilmMode;<NEW_LINE>} else {<NEW_LINE>newMode = currentMetadata.getOperationMode();<NEW_LINE>}<NEW_LINE>if (newMode.equals(ilmMode) == false) {<NEW_LINE>logger.info("updating ILM operation mode to {}", newMode);<NEW_LINE>}<NEW_LINE>return ClusterState.builder(currentState).metadata(Metadata.builder(currentState.metadata()).putCustom(IndexLifecycleMetadata.TYPE, new IndexLifecycleMetadata(currentMetadata.getPolicyMetadatas(), <MASK><NEW_LINE>} | newMode))).build(); |
688,626 | // invoked by the PackManager<NEW_LINE>public void staticBlockInlining(SootClass sootClass) {<NEW_LINE>this.sootClass = sootClass;<NEW_LINE>// retrieve the clinit method if any for sootClass<NEW_LINE>// the clinit method gets converted into the static block which could initialize the final variable<NEW_LINE>if (!sootClass.declaresMethod("void <clinit>()")) {<NEW_LINE>// System.out.println("no clinit");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SootMethod clinit = sootClass.getMethod("void <clinit>()");<NEW_LINE>// System.out.println(clinit);<NEW_LINE>// retireve the active body<NEW_LINE>if (!clinit.hasActiveBody()) {<NEW_LINE>throw new RuntimeException("method " + clinit.getName() + " has no active body!");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>Chain units = ((DavaBody) clinitBody).getUnits();<NEW_LINE>if (units.size() != 1) {<NEW_LINE>throw new RuntimeException("DavaBody AST doesn't have single root.");<NEW_LINE>}<NEW_LINE>ASTNode AST = (ASTNode) units.getFirst();<NEW_LINE>if (!(AST instanceof ASTMethodNode)) {<NEW_LINE>throw new RuntimeException("Starting node of DavaBody AST is not an ASTMethodNode");<NEW_LINE>}<NEW_LINE>// running methodCallFinder on the Clinit method<NEW_LINE>AST.apply(new MethodCallFinder(this));<NEW_LINE>} | Body clinitBody = clinit.getActiveBody(); |
1,790,204 | private int transitionsBetween(ResultPoint from, ResultPoint to) {<NEW_LINE>// See QR Code Detector, sizeOfBlackWhiteBlackRun()<NEW_LINE>int fromX = (int) from.getX();<NEW_LINE>int fromY = (int) from.getY();<NEW_LINE>int toX = (int) to.getX();<NEW_LINE>int toY = Math.min(image.getHeight() - 1, (int) to.getY());<NEW_LINE>boolean steep = Math.abs(toY - fromY) > <MASK><NEW_LINE>if (steep) {<NEW_LINE>int temp = fromX;<NEW_LINE>fromX = fromY;<NEW_LINE>fromY = temp;<NEW_LINE>temp = toX;<NEW_LINE>toX = toY;<NEW_LINE>toY = temp;<NEW_LINE>}<NEW_LINE>int dx = Math.abs(toX - fromX);<NEW_LINE>int dy = Math.abs(toY - fromY);<NEW_LINE>int error = -dx / 2;<NEW_LINE>int ystep = fromY < toY ? 1 : -1;<NEW_LINE>int xstep = fromX < toX ? 1 : -1;<NEW_LINE>int transitions = 0;<NEW_LINE>boolean inBlack = image.get(steep ? fromY : fromX, steep ? fromX : fromY);<NEW_LINE>for (int x = fromX, y = fromY; x != toX; x += xstep) {<NEW_LINE>boolean isBlack = image.get(steep ? y : x, steep ? x : y);<NEW_LINE>if (isBlack != inBlack) {<NEW_LINE>transitions++;<NEW_LINE>inBlack = isBlack;<NEW_LINE>}<NEW_LINE>error += dy;<NEW_LINE>if (error > 0) {<NEW_LINE>if (y == toY) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>y += ystep;<NEW_LINE>error -= dx;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return transitions;<NEW_LINE>} | Math.abs(toX - fromX); |
55,150 | public void generateGetters(Language language, List<AtomConstructor> constructors) {<NEW_LINE>if (gettersGenerated)<NEW_LINE>return;<NEW_LINE>gettersGenerated = true;<NEW_LINE>var roots = new HashMap<String, RootNode>();<NEW_LINE>if (constructors.size() != 1) {<NEW_LINE>var names = new HashMap<String, List<GetFieldWithMatchNode.GetterPair>>();<NEW_LINE>constructors.forEach(cons -> {<NEW_LINE>Arrays.stream(cons.getFields()).forEach(field -> {<NEW_LINE>var items = names.computeIfAbsent(field.getName(), (k) -> new ArrayList<>());<NEW_LINE>items.add(new GetFieldWithMatchNode.GetterPair(cons<MASK><NEW_LINE>});<NEW_LINE>});<NEW_LINE>names.forEach((name, fields) -> {<NEW_LINE>roots.put(name, new GetFieldWithMatchNode(language, name, this, fields.toArray(new GetFieldWithMatchNode.GetterPair[0])));<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>var cons = constructors.get(0);<NEW_LINE>Arrays.stream(cons.getFields()).forEach(field -> {<NEW_LINE>roots.put(field.getName(), new GetFieldNode(language, field.getPosition(), this, field.getName()));<NEW_LINE>});<NEW_LINE>}<NEW_LINE>roots.forEach((name, node) -> {<NEW_LINE>RootCallTarget callTarget = Truffle.getRuntime().createCallTarget(node);<NEW_LINE>var f = new Function(callTarget, null, new FunctionSchema(new ArgumentDefinition(0, Constants.Names.SELF_ARGUMENT, ArgumentDefinition.ExecutionMode.EXECUTE)));<NEW_LINE>definitionScope.registerMethod(this, name, f);<NEW_LINE>});<NEW_LINE>} | , field.getPosition())); |
1,760,116 | private void processMethodPermissions(PolicyConfiguration ejbPC, String beanName, Map<RoleInfo, List<MethodInfo>> methodMap, Set<String> allRoles) throws PolicyContextException {<NEW_LINE>if (methodMap != null && methodMap.size() > 0) {<NEW_LINE>Permissions ejbRolePerms = null;<NEW_LINE>Permissions ejbUncheckedPerms = null;<NEW_LINE>Permissions ejbExcludedPerms = null;<NEW_LINE>for (Entry<RoleInfo, List<MethodInfo>> entry : methodMap.entrySet()) {<NEW_LINE>RoleInfo ri = entry.getKey();<NEW_LINE>List<MethodInfo> miList = entry.getValue();<NEW_LINE>if (ri.isPermitAll()) {<NEW_LINE>ejbUncheckedPerms = getEJBPermCollection(beanName, miList);<NEW_LINE>if (ejbUncheckedPerms != null) {<NEW_LINE>ejbPC.addToUncheckedPolicy(ejbUncheckedPerms);<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "addToUncheckedPolicy permission : " + ejbUncheckedPerms);<NEW_LINE>}<NEW_LINE>} else if (ri.isDenyAll()) {<NEW_LINE>ejbExcludedPerms = getEJBPermCollection(beanName, miList);<NEW_LINE>if (ejbExcludedPerms != null) {<NEW_LINE>ejbPC.addToExcludedPolicy(ejbExcludedPerms);<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "addToExcludedPolicy permission : " + ejbExcludedPerms);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>if (ejbRolePerms != null) {<NEW_LINE>String roleName = ri.getRoleName();<NEW_LINE>ejbPC.addToRole(roleName, ejbRolePerms);<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "addToRole(MethodPermisson) role : " + roleName + " permission : " + ejbRolePerms);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ejbRolePerms = getEJBPermCollection(beanName, miList); |
413,406 | public void marshall(ParameterDefinition parameterDefinition, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (parameterDefinition == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getAllowedPattern(), ALLOWEDPATTERN_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getAllowedValues(), ALLOWEDVALUES_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getConstraintDescription(), CONSTRAINTDESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getDefaultValue(), DEFAULTVALUE_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getMaxLength(), MAXLENGTH_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getMaxValue(), MAXVALUE_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getMinLength(), MINLENGTH_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getMinValue(), MINVALUE_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getNoEcho(), NOECHO_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getType(), TYPE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | parameterDefinition.getReferencedByResources(), REFERENCEDBYRESOURCES_BINDING); |
1,510,400 | public void handleLastResult(Result lastResult) {<NEW_LINE>if (lastResult == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Cell last = lastCell(lastResult);<NEW_LINE>byte[] row = CellUtil.cloneRow(last);<NEW_LINE>byte[] <MASK><NEW_LINE>long reverseStartTime = BytesUtils.bytesToLong(originalRow, PinpointConstants.APPLICATION_NAME_MAX_LEN);<NEW_LINE>this.lastRowTimestamp = TimeUtils.recoveryTimeMillis(reverseStartTime);<NEW_LINE>byte[] qualifier = CellUtil.cloneQualifier(last);<NEW_LINE>this.lastTransactionId = TransactionIdMapper.parseVarTransactionId(qualifier, 0, qualifier.length);<NEW_LINE>this.lastTransactionElapsed = BytesUtils.bytesToInt(qualifier, 0);<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("lastRowTimestamp={}, lastTransactionId={}, lastTransactionElapsed={}", DateTimeFormatUtils.format(lastRowTimestamp), lastTransactionId, lastTransactionElapsed);<NEW_LINE>}<NEW_LINE>} | originalRow = traceIdRowKeyDistributor.getOriginalKey(row); |
314,642 | private static PostContentRequest generateRequestInternal(Map<String, String> sessionAttributes, Map<String, String> requestAttributes, InteractionConfig interactionConfig, AWSCredentialsProvider credentialsProvider, ResponseType mode) {<NEW_LINE>final PostContentRequest request = new PostContentRequest();<NEW_LINE>request.setBotName(interactionConfig.getBotName());<NEW_LINE>request.setBotAlias(interactionConfig.getBotAlias());<NEW_LINE>request.setAccept(mode.toString());<NEW_LINE>final Map<String, String> newSessionAttributes = new HashMap<String, String>();<NEW_LINE>newSessionAttributes.putAll(interactionConfig.getGlobalSessionAttributes());<NEW_LINE>if (sessionAttributes != null) {<NEW_LINE>newSessionAttributes.putAll(sessionAttributes);<NEW_LINE>}<NEW_LINE>request.setSessionAttributes(mapToBase64(newSessionAttributes));<NEW_LINE>// Set the request attributes<NEW_LINE>if (requestAttributes != null) {<NEW_LINE>request.setRequestAttributes(mapToBase64(requestAttributes));<NEW_LINE>}<NEW_LINE>if (interactionConfig.getUserId() == null || interactionConfig.getUserId().isEmpty()) {<NEW_LINE><MASK><NEW_LINE>request.setUserId(cognitoCredentialsProvider.getIdentityId());<NEW_LINE>} else {<NEW_LINE>request.setUserId(interactionConfig.getUserId());<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | final CognitoCredentialsProvider cognitoCredentialsProvider = (CognitoCredentialsProvider) credentialsProvider; |
1,174,947 | private static Map<TypeAlias, jnr.ffi.NativeType> buildTypeMap() {<NEW_LINE>Map<TypeAlias, jnr.ffi.NativeType> m = new EnumMap<TypeAlias, jnr.ffi.NativeType>(TypeAlias.class);<NEW_LINE>m.put(TypeAlias.int8_t, NativeType.SCHAR);<NEW_LINE>m.put(TypeAlias.u_int8_t, NativeType.UCHAR);<NEW_LINE>m.put(TypeAlias.int16_t, NativeType.SSHORT);<NEW_LINE>m.put(TypeAlias.u_int16_t, NativeType.USHORT);<NEW_LINE>m.put(TypeAlias.int32_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.u_int32_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.int64_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.u_int64_t, NativeType.ULONGLONG);<NEW_LINE>m.put(TypeAlias.intptr_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.uintptr_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.caddr_t, NativeType.ADDRESS);<NEW_LINE>m.put(TypeAlias.dev_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.blkcnt_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.blksize_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.gid_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.in_addr_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.in_port_t, NativeType.USHORT);<NEW_LINE>m.put(TypeAlias.ino_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.ino64_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.key_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.mode_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.nlink_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.id_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.pid_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.off_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.swblk_t, NativeType.SLONG);<NEW_LINE>m.put(<MASK><NEW_LINE>m.put(TypeAlias.clock_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.size_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.ssize_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.time_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.fsblkcnt_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.fsfilcnt_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.sa_family_t, NativeType.USHORT);<NEW_LINE>m.put(TypeAlias.socklen_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.rlim_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.cc_t, NativeType.UCHAR);<NEW_LINE>m.put(TypeAlias.speed_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.tcflag_t, NativeType.UINT);<NEW_LINE>return m;<NEW_LINE>} | TypeAlias.uid_t, NativeType.UINT); |
1,245,387 | public void cloneFlatNetwork(final FlatNetwork result) {<NEW_LINE>result.inputCount = this.inputCount;<NEW_LINE>result.layerCounts = EngineArray.arrayCopy(this.layerCounts);<NEW_LINE>result.layerIndex = EngineArray.arrayCopy(this.layerIndex);<NEW_LINE>result.layerOutput = EngineArray.arrayCopy(this.layerOutput);<NEW_LINE>result.layerSums = EngineArray.arrayCopy(this.layerSums);<NEW_LINE>result.layerFeedCounts = EngineArray.arrayCopy(this.layerFeedCounts);<NEW_LINE>result.contextTargetOffset = EngineArray.arrayCopy(this.contextTargetOffset);<NEW_LINE>result.contextTargetSize = EngineArray.arrayCopy(this.contextTargetSize);<NEW_LINE>result.layerContextCount = EngineArray.arrayCopy(this.layerContextCount);<NEW_LINE>result.biasActivation = EngineArray.arrayCopy(this.biasActivation);<NEW_LINE>result.outputCount = this.outputCount;<NEW_LINE>result.weightIndex = this.weightIndex;<NEW_LINE>result.weights = this.weights;<NEW_LINE>result.layerDropoutRates = <MASK><NEW_LINE>result.activationFunctions = new ActivationFunction[this.activationFunctions.length];<NEW_LINE>for (int i = 0; i < result.activationFunctions.length; i++) {<NEW_LINE>result.activationFunctions[i] = this.activationFunctions[i].clone();<NEW_LINE>}<NEW_LINE>result.beginTraining = this.beginTraining;<NEW_LINE>result.endTraining = this.endTraining;<NEW_LINE>} | EngineArray.arrayCopy(this.layerDropoutRates); |
1,330,182 | public Object eject(Object obj) {<NEW_LINE>try {<NEW_LINE>if (obj == null)<NEW_LINE>return null;<NEW_LINE>if (NutConf.USE_FASTCLASS) {<NEW_LINE>if (fm == null)<NEW_LINE><MASK><NEW_LINE>if (fm == null)<NEW_LINE>return getter.invoke(obj);<NEW_LINE>return fm.invoke(obj);<NEW_LINE>}<NEW_LINE>return getter.invoke(obj);<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>throw new FailToGetValueException("getter=" + getter, e);<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (log.isInfoEnabled())<NEW_LINE>log.info("Fail to value by getter", e);<NEW_LINE>throw Lang.makeThrow("Fail to invoke getter %s.'%s()' %s because [%s]: %s", getter.getDeclaringClass().getName(), getter.getName(), (obj == null || getClass().getDeclaringClass() == obj.getClass() ? "" : "<" + obj.getClass() + ">"), Lang.unwrapThrow(e), Lang.unwrapThrow(e).getMessage());<NEW_LINE>}<NEW_LINE>} | fm = FastClassFactory.get(getter); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.