idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
617,583
public static List<List<String>> removeAnnounceURLs(List<List<String>> base_urls, List<List<String>> remove_urls, boolean use_prefix_match) {<NEW_LINE>base_urls = getClone(base_urls);<NEW_LINE>if (remove_urls == null) {<NEW_LINE>return (base_urls);<NEW_LINE>}<NEW_LINE>Set<String> removeSet = new HashSet<>();<NEW_LINE>// this results in removal of this dummy url if present<NEW_LINE>removeSet.add(NO_VALID_URL_URL);<NEW_LINE>for (List<String> l : remove_urls) {<NEW_LINE>for (String s : l) {<NEW_LINE>removeSet.add(UrlUtils.getCanonicalString(s.toLowerCase(Locale.US)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Iterator<List<String>> it1 = base_urls.iterator();<NEW_LINE>while (it1.hasNext()) {<NEW_LINE>List<String> l = it1.next();<NEW_LINE>Iterator<String<MASK><NEW_LINE>while (it2.hasNext()) {<NEW_LINE>String url = it2.next();<NEW_LINE>if (url.equals(NO_VALID_URL_URL)) {<NEW_LINE>it2.remove();<NEW_LINE>} else {<NEW_LINE>url = url.toLowerCase(Locale.US);<NEW_LINE>url = UrlUtils.getCanonicalString(url);<NEW_LINE>if (use_prefix_match) {<NEW_LINE>for (String s : removeSet) {<NEW_LINE>if (url.startsWith(s)) {<NEW_LINE>it2.remove();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (removeSet.contains(url)) {<NEW_LINE>it2.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (l.isEmpty()) {<NEW_LINE>it1.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (base_urls);<NEW_LINE>}
> it2 = l.iterator();
458,057
public static void hessianBorder(GrayS32 integral, int skip, int size, GrayF32 intensity, @Nullable IntegralKernel storageKerXX, @Nullable IntegralKernel storageKerYY, @Nullable IntegralKernel storageKerXY) {<NEW_LINE>final int w = intensity.width;<NEW_LINE>final int h = intensity.height;<NEW_LINE>// get convolution kernels for the second order derivatives<NEW_LINE>IntegralKernel kerXX = DerivativeIntegralImage.kernelDerivXX(size, storageKerXX);<NEW_LINE>IntegralKernel kerYY = DerivativeIntegralImage.kernelDerivYY(size, storageKerYY);<NEW_LINE>IntegralKernel kerXY = DerivativeIntegralImage.kernelDerivXY(size, storageKerXY);<NEW_LINE>int radiusFeature = size / 2;<NEW_LINE>final int borderOrig = radiusFeature + 1 + (skip - (radiusFeature + 1) % skip);<NEW_LINE>final int border = borderOrig / skip;<NEW_LINE>float norm = 1.0f / (size * size);<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, h, y -> {<NEW_LINE>for (int y = 0; y < h; y++) {<NEW_LINE>int yy = y * skip;<NEW_LINE>for (int x = 0; x < border; x++) {<NEW_LINE>int xx = x * skip;<NEW_LINE>computeHessian(integral, intensity, kerXX, kerYY, kerXY, norm, y, yy, x, xx);<NEW_LINE>}<NEW_LINE>for (int x = w - border; x < w; x++) {<NEW_LINE>int xx = x * skip;<NEW_LINE>computeHessian(integral, intensity, kerXX, kerYY, kerXY, norm, y, yy, x, xx);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(border, w - border, x -> {<NEW_LINE>for (int x = border; x < w - border; x++) {<NEW_LINE>int xx = x * skip;<NEW_LINE>for (int y = 0; y < border; y++) {<NEW_LINE>int yy = y * skip;<NEW_LINE>computeHessian(integral, intensity, kerXX, kerYY, kerXY, norm, <MASK><NEW_LINE>}<NEW_LINE>for (int y = h - border; y < h; y++) {<NEW_LINE>int yy = y * skip;<NEW_LINE>computeHessian(integral, intensity, kerXX, kerYY, kerXY, norm, y, yy, x, xx);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
y, yy, x, xx);
992,095
public Page unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Page page = new Page();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("lineRange", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>page.setLineRange(RangeJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("offsetRange", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>page.setOffsetRange(RangeJsonUnmarshaller.getInstance<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("pageNumber", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>page.setPageNumber(context.getUnmarshaller(Long.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 page;<NEW_LINE>}
().unmarshall(context));
1,328,447
public BalloonBuilder createHtmlTextBalloonBuilder(@Nonnull final String htmlContent, @Nullable final Image icon, Color textColor, final Color fillColor, @Nullable final HyperlinkListener listener) {<NEW_LINE>JEditorPane text = IdeTooltipManager.initPane(htmlContent, new HintHint().setTextFg(textColor).setAwtTooltip(true), null);<NEW_LINE>if (listener != null) {<NEW_LINE>text.addHyperlinkListener(listener);<NEW_LINE>}<NEW_LINE>text.setEditable(false);<NEW_LINE>NonOpaquePanel.setTransparent(text);<NEW_LINE>text.setBorder(null);<NEW_LINE>JLabel label = new JLabel();<NEW_LINE>final JPanel content = new NonOpaquePanel(new BorderLayout((int) (label.getIconTextGap() * 1.5), (int) (label.getIconTextGap() * 1.5)));<NEW_LINE>final NonOpaquePanel textWrapper = new NonOpaquePanel(new GridBagLayout());<NEW_LINE>JScrollPane scrolledText = ScrollPaneFactory.createScrollPane(text, true);<NEW_LINE>scrolledText.setBackground(fillColor);<NEW_LINE>scrolledText.getViewport().setBackground(fillColor);<NEW_LINE>textWrapper.add(scrolledText);<NEW_LINE>content.add(textWrapper, BorderLayout.CENTER);<NEW_LINE>if (icon != null) {<NEW_LINE>final NonOpaquePanel north = <MASK><NEW_LINE>north.add(new JBLabel(icon), BorderLayout.NORTH);<NEW_LINE>content.add(north, BorderLayout.WEST);<NEW_LINE>}<NEW_LINE>content.setBorder(JBUI.Borders.empty(2, 4));<NEW_LINE>final BalloonBuilder builder = createBalloonBuilder(content);<NEW_LINE>builder.setFillColor(fillColor);<NEW_LINE>return builder;<NEW_LINE>}
new NonOpaquePanel(new BorderLayout());
182,216
final DisassociateAssessmentReportEvidenceFolderResult executeDisassociateAssessmentReportEvidenceFolder(DisassociateAssessmentReportEvidenceFolderRequest disassociateAssessmentReportEvidenceFolderRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disassociateAssessmentReportEvidenceFolderRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DisassociateAssessmentReportEvidenceFolderRequest> request = null;<NEW_LINE>Response<DisassociateAssessmentReportEvidenceFolderResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DisassociateAssessmentReportEvidenceFolderRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(disassociateAssessmentReportEvidenceFolderRequest));<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, "AuditManager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateAssessmentReportEvidenceFolder");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DisassociateAssessmentReportEvidenceFolderResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DisassociateAssessmentReportEvidenceFolderResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
455,890
protected Collection<Artifact<?>> doEmitCompilation(TreeLogger logger, LinkerContext context, CompilationResult result, ArtifactSet artifacts) throws UnableToCompleteException {<NEW_LINE>String[<MASK><NEW_LINE>Collection<Artifact<?>> toReturn = new ArrayList<Artifact<?>>();<NEW_LINE>byte[] primary = generatePrimaryFragment(logger, context, result, js, artifacts);<NEW_LINE>toReturn.add(emitBytes(logger, primary, result.getStrongName() + getCompilationExtension(logger, context)));<NEW_LINE>primary = null;<NEW_LINE>for (int i = 1; i < js.length; i++) {<NEW_LINE>byte[] bytes = Util.getBytes(generateDeferredFragment(logger, context, i, js[i], artifacts, result));<NEW_LINE>toReturn.add(emitBytes(logger, bytes, FRAGMENT_SUBDIR + File.separator + result.getStrongName() + File.separator + i + FRAGMENT_EXTENSION));<NEW_LINE>}<NEW_LINE>toReturn.addAll(emitSelectionInformation(result.getStrongName(), result));<NEW_LINE>return toReturn;<NEW_LINE>}
] js = result.getJavaScript();
1,080,701
public Vector filterUp(double threshold) {<NEW_LINE>LongIntSparseVectorStorage newStorage = new LongIntSparseVectorStorage(size());<NEW_LINE>if (storage.isDense()) {<NEW_LINE>int[] values = ((LongIntVectorStorage) storage).getValues();<NEW_LINE>for (int i = 0; i < values.length; i++) {<NEW_LINE>if (values[i] >= threshold) {<NEW_LINE>newStorage.set(i, values[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (storage.isSparse()) {<NEW_LINE>ObjectIterator<Long2IntMap.Entry> iter = ((LongIntVectorStorage) storage).entryIterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>Long2IntMap.<MASK><NEW_LINE>int value = entry.getIntValue();<NEW_LINE>if (value >= threshold) {<NEW_LINE>newStorage.set(entry.getLongKey(), value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>long[] indices = ((LongIntVectorStorage) storage).getIndices();<NEW_LINE>int[] values = ((LongIntVectorStorage) storage).getValues();<NEW_LINE>long size = ((LongIntVectorStorage) storage).size();<NEW_LINE>for (int k = 0; k < size; k++) {<NEW_LINE>if (values[k] >= threshold) {<NEW_LINE>newStorage.set(indices[k], values[k]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new LongIntVector(matrixId, rowId, clock, getDim(), newStorage);<NEW_LINE>}
Entry entry = iter.next();
951,601
private void createLogWindow(String title, ArrayList<String> logMessages, Color color) {<NEW_LINE>// do nothing if no log messages exist<NEW_LINE>if (logMessages == null || logMessages.size() == 0)<NEW_LINE>return;<NEW_LINE>ArrayList<String> displayLogMessages = new ArrayList<String>(logMessages);<NEW_LINE>// create window<NEW_LINE>JFrame frame = new JFrame(s_logger.localizeMessage(title));<NEW_LINE>frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);<NEW_LINE>Container pane = frame.getContentPane();<NEW_LINE>Locale locale = Locale.getDefault();<NEW_LINE>pane.setComponentOrientation(ComponentOrientation.getOrientation(locale));<NEW_LINE>JTextArea textArea = new JTextArea(25, 80);<NEW_LINE>textArea.setForeground(color);<NEW_LINE>textArea.setEditable(false);<NEW_LINE>JPanel panel = new JPanel();<NEW_LINE>panel.setBorder(BorderFactory.createEmptyBorder(10<MASK><NEW_LINE>panel.add(textArea);<NEW_LINE>JScrollPane scrollPane = new JScrollPane(panel);<NEW_LINE>pane.add(scrollPane);<NEW_LINE>// size window<NEW_LINE>frame.pack();<NEW_LINE>frame.setLocationRelativeTo(null);<NEW_LINE>// load data<NEW_LINE>for (String line : displayLogMessages) {<NEW_LINE>textArea.append(line);<NEW_LINE>}<NEW_LINE>// show window<NEW_LINE>frame.setVisible(true);<NEW_LINE>}
, 10, 10, 10));
337,305
public void reset() {<NEW_LINE>myProfilesComboBox.setSelectedItem(myManager.getDefaultCopyright());<NEW_LINE>final List<ScopeSetting> mappings = new ArrayList<ScopeSetting>();<NEW_LINE>final Map<String, String> copyrights = myManager.getCopyrightsMapping();<NEW_LINE>final DependencyValidationManager manager = DependencyValidationManager.getInstance(myProject);<NEW_LINE>final Set<String> scopes2Unmap = new HashSet<String>();<NEW_LINE>for (final String scopeName : copyrights.keySet()) {<NEW_LINE>final NamedScope scope = manager.getScope(scopeName);<NEW_LINE>if (scope != null) {<NEW_LINE>mappings.add(new ScopeSetting(scope, <MASK><NEW_LINE>} else {<NEW_LINE>scopes2Unmap.add(scopeName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String scopeName : scopes2Unmap) {<NEW_LINE>myManager.unmapCopyright(scopeName);<NEW_LINE>}<NEW_LINE>myScopeMappingModel.setItems(mappings);<NEW_LINE>}
copyrights.get(scopeName)));
693,778
protected Integer doInBackground(Void... params) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>Context context = contextRef.get();<NEW_LINE>DecoderFactory<? extends ImageDecoder> decoderFactory = decoderFactoryRef.get();<NEW_LINE>SubsamplingScaleImageView view = viewRef.get();<NEW_LINE>if (context != null && decoderFactory != null && view != null) {<NEW_LINE>view.debug("BitmapLoadTask.doInBackground");<NEW_LINE>try {<NEW_LINE>bitmap = decoderFactory.make().decode(context, source);<NEW_LINE>} catch (OutOfMemoryError e) {<NEW_LINE>System.gc();<NEW_LINE>bitmap = decoderFactory.make().decode(context, source);<NEW_LINE>}<NEW_LINE>return view.getExifOrientation(context, sourceUri);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.e(TAG, "Failed to load bitmap", e);<NEW_LINE>this.exception = e;<NEW_LINE>} catch (OutOfMemoryError e) {<NEW_LINE>Log.e(TAG, "Failed to load bitmap - OutOfMemoryError", e);<NEW_LINE>this.exception = new RuntimeException(e);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
String sourceUri = source.toString();
805,261
public static // See https://developer.android.com/reference/android/app/Fragment<NEW_LINE>void addToolbarToDialog(final android.app.Fragment context, final Dialog dialog, String title) {<NEW_LINE>if (!context.isAdded() || dialog == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>View dialogContainerView = DialogExtensionsKt.getPreferenceDialogContainerView(dialog);<NEW_LINE>if (dialogContainerView == null) {<NEW_LINE>AppLog.e(T.SETTINGS, "Preference Dialog View was null when adding Toolbar");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// find the root view, then make sure the toolbar doesn't already exist<NEW_LINE>ViewGroup root = <MASK><NEW_LINE>// if we already added an appbar to the dialog it will be in the view one level above it's parent<NEW_LINE>ViewGroup modifiedRoot = (ViewGroup) dialogContainerView.getParent().getParent();<NEW_LINE>if (modifiedRoot != null && modifiedRoot.findViewById(R.id.appbar_main) != null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// remove view from the root<NEW_LINE>root.removeView(dialogContainerView);<NEW_LINE>// inflate our own layout with coordinator layout and appbar<NEW_LINE>ViewGroup dialogViewWrapper = (ViewGroup) LayoutInflater.from(context.getActivity()).inflate(R.layout.preference_screen_wrapper, root, false);<NEW_LINE>// container that will host content of the dialog<NEW_LINE>ViewGroup listContainer = dialogViewWrapper.findViewById(R.id.list_container);<NEW_LINE>final ListView listOfPreferences = dialogContainerView.findViewById(android.R.id.list);<NEW_LINE>if (listOfPreferences != null) {<NEW_LINE>ViewCompat.setNestedScrollingEnabled(listOfPreferences, true);<NEW_LINE>}<NEW_LINE>// add dialog view into container<NEW_LINE>LayoutParams lp = dialogContainerView.getLayoutParams();<NEW_LINE>lp.height = LayoutParams.MATCH_PARENT;<NEW_LINE>lp.width = LayoutParams.MATCH_PARENT;<NEW_LINE>listContainer.addView(dialogContainerView, lp);<NEW_LINE>// add layout with container back to root view<NEW_LINE>root.addView(dialogViewWrapper);<NEW_LINE>AppBarLayout appbar = dialogViewWrapper.findViewById(R.id.appbar_main);<NEW_LINE>MaterialToolbar toolbar = appbar.findViewById(R.id.toolbar_main);<NEW_LINE>appbar.setLiftOnScrollTargetViewId(android.R.id.list);<NEW_LINE>dialog.getWindow().setWindowAnimations(R.style.DialogAnimations);<NEW_LINE>toolbar.setTitle(title);<NEW_LINE>toolbar.setNavigationOnClickListener(v -> dialog.dismiss());<NEW_LINE>toolbar.setNavigationContentDescription(R.string.navigate_up_desc);<NEW_LINE>}
(ViewGroup) dialogContainerView.getParent();
1,348,108
final DescribeCodeBindingResult executeDescribeCodeBinding(DescribeCodeBindingRequest describeCodeBindingRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeCodeBindingRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeCodeBindingRequest> request = null;<NEW_LINE>Response<DescribeCodeBindingResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DescribeCodeBindingRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeCodeBindingRequest));<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, "schemas");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeCodeBinding");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeCodeBindingResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeCodeBindingResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
262,586
protected void onHandleIntent(Intent intent) {<NEW_LINE>Caches caches = new Caches(this);<NEW_LINE>if (intent != null) {<NEW_LINE>final String action = intent.getAction();<NEW_LINE>if (ACTION_SEND_PKG_INFO.equals(action)) {<NEW_LINE>String socketName = intent.getStringExtra(EXTRA_SOCKET_NAME);<NEW_LINE>if (socketName == null) {<NEW_LINE>socketName = DEFAULT_SOCKET_NAME;<NEW_LINE>}<NEW_LINE>boolean onlyDebug = <MASK><NEW_LINE>boolean includeIcons = intent.getBooleanExtra(EXTRA_INCLUDE_ICONS, false);<NEW_LINE>float iconDensityScale = intent.getFloatExtra(EXTRA_ICON_DENSITY_SCALE, 1.0f);<NEW_LINE>try (Counter.Scope t = Counter.time("handleSendPackageInfo")) {<NEW_LINE>handleSendPackageInfo(caches, socketName, onlyDebug, includeIcons, iconDensityScale);<NEW_LINE>}<NEW_LINE>if (PROFILE) {<NEW_LINE>Log.i(TAG, Counter.collect(true));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
intent.getBooleanExtra(EXTRA_ONLY_DEBUG, false);
211,282
public JobExecution submitJob(Integer theBatchSize, List<String> theUrlsToDeleteExpunge, RequestDetails theRequest) throws JobParametersInvalidException {<NEW_LINE>if (theBatchSize == null) {<NEW_LINE>theBatchSize = myDaoConfig.getExpungeBatchSize();<NEW_LINE>}<NEW_LINE>RequestListJson requestListJson = myPartitionedUrlValidator.buildRequestListJson(theRequest, theUrlsToDeleteExpunge);<NEW_LINE>if (!myDaoConfig.canDeleteExpunge()) {<NEW_LINE>throw new ForbiddenOperationException(Msg.code(820) + "Delete Expunge not allowed: " + myDaoConfig.cannotDeleteExpungeReason());<NEW_LINE>}<NEW_LINE>for (String url : theUrlsToDeleteExpunge) {<NEW_LINE>HookParams params = new HookParams().add(RequestDetails.class, theRequest).addIfMatchesType(ServletRequestDetails.class, theRequest).add(String.class, url);<NEW_LINE>CompositeInterceptorBroadcaster.doCallHooks(myInterceptorBroadcaster, theRequest, Pointcut.STORAGE_PRE_DELETE_EXPUNGE, params);<NEW_LINE>}<NEW_LINE>JobParameters jobParameters = ReverseCronologicalBatchResourcePidReader.buildJobParameters(<MASK><NEW_LINE>return myBatchJobSubmitter.runJob(myDeleteExpungeJob, jobParameters);<NEW_LINE>}
ProviderConstants.OPERATION_DELETE_EXPUNGE, theBatchSize, requestListJson);
861,509
void applyAnimation(Context context, CustomTabsIntent.Builder builder, ReadableMap animations) {<NEW_LINE>final int startEnterAnimationId = animations.hasKey(KEY_ANIMATION_START_ENTER) ? resolveAnimationIdentifierIfNeeded(context, animations.getString(KEY_ANIMATION_START_ENTER)) : -1;<NEW_LINE>final int startExitAnimationId = animations.hasKey(KEY_ANIMATION_START_EXIT) ? resolveAnimationIdentifierIfNeeded(context, animations.<MASK><NEW_LINE>final int endEnterAnimationId = animations.hasKey(KEY_ANIMATION_END_ENTER) ? resolveAnimationIdentifierIfNeeded(context, animations.getString(KEY_ANIMATION_END_ENTER)) : -1;<NEW_LINE>final int endExitAnimationId = animations.hasKey(KEY_ANIMATION_END_EXIT) ? resolveAnimationIdentifierIfNeeded(context, animations.getString(KEY_ANIMATION_END_EXIT)) : -1;<NEW_LINE>if (startEnterAnimationId != -1 && startExitAnimationId != -1) {<NEW_LINE>builder.setStartAnimations(context, startEnterAnimationId, startExitAnimationId);<NEW_LINE>}<NEW_LINE>if (endEnterAnimationId != -1 && endExitAnimationId != -1) {<NEW_LINE>builder.setExitAnimations(context, endEnterAnimationId, endExitAnimationId);<NEW_LINE>}<NEW_LINE>}
getString(KEY_ANIMATION_START_EXIT)) : -1;
922,813
public JsonResponseBPartnerCompositeUpsertItem persist(@Nullable final String orgCode, @NonNull final JsonRequestBPartnerUpsertItem requestItem, @NonNull final SyncAdvise parentSyncAdvise) {<NEW_LINE>// TODO: add support to retrieve without changelog; we don't need changelog here;<NEW_LINE>// but! make sure we don't screw up caching<NEW_LINE>final OrgId orgId = retrieveOrgIdOrDefault(orgCode);<NEW_LINE>final String rawBpartnerIdentifier = requestItem.getBpartnerIdentifier();<NEW_LINE>final IdentifierString bpartnerIdentifier = IdentifierString.of(rawBpartnerIdentifier);<NEW_LINE>final Optional<BPartnerComposite> optionalBPartnerComposite = jsonRetrieverService.getBPartnerComposite(orgId, bpartnerIdentifier);<NEW_LINE>final JsonResponseBPartnerCompositeUpsertItemUnderConstrunction resultBuilder = new JsonResponseBPartnerCompositeUpsertItemUnderConstrunction();<NEW_LINE>resultBuilder.setJsonResponseBPartnerUpsertItemBuilder(JsonResponseUpsertItem.builder().identifier(rawBpartnerIdentifier));<NEW_LINE>final JsonRequestComposite jsonRequestComposite = requestItem.getBpartnerComposite();<NEW_LINE>final SyncAdvise effectiveSyncAdvise = coalesce(jsonRequestComposite.getSyncAdvise(), parentSyncAdvise);<NEW_LINE>final BPartnerComposite bpartnerComposite;<NEW_LINE>if (optionalBPartnerComposite.isPresent()) {<NEW_LINE>logger.debug("Found BPartner with id={} for identifier={} (orgCode={})", optionalBPartnerComposite.get().getBpartner().getId(), rawBpartnerIdentifier, jsonRequestComposite.getOrgCode());<NEW_LINE>// load and mutate existing aggregation root<NEW_LINE>bpartnerComposite = optionalBPartnerComposite.get();<NEW_LINE>resultBuilder.setNewBPartner(false);<NEW_LINE>} else {<NEW_LINE>logger.debug("Found no BPartner for identifier={} (orgCode={})", rawBpartnerIdentifier, jsonRequestComposite.getOrgCode());<NEW_LINE>if (effectiveSyncAdvise.isFailIfNotExists()) {<NEW_LINE>throw MissingResourceException.builder().resourceName("bpartner").resourceIdentifier(rawBpartnerIdentifier).parentResource(jsonRequestComposite).build(<MASK><NEW_LINE>}<NEW_LINE>// create new aggregation root<NEW_LINE>logger.debug("Going to create a new bpartner-composite (orgCode={})", jsonRequestComposite.getOrgCode());<NEW_LINE>bpartnerComposite = BPartnerComposite.builder().build();<NEW_LINE>resultBuilder.setNewBPartner(true);<NEW_LINE>}<NEW_LINE>syncJsonToBPartnerComposite(resultBuilder, jsonRequestComposite, bpartnerComposite, effectiveSyncAdvise);<NEW_LINE>handleExternalReferenceRecords(requestItem, bpartnerComposite, orgCode);<NEW_LINE>return resultBuilder.build();<NEW_LINE>}
).setParameter("effectiveSyncAdvise", effectiveSyncAdvise);
927,800
public static String resolvePath(String input) {<NEW_LINE>if (null == input) {<NEW_LINE>return input;<NEW_LINE>}<NEW_LINE>// matching for 2 groups match ${VAR_NAME} or $VAR_NAME<NEW_LINE>Pattern pathPattern = Pattern.compile("\\$\\{(.+?)\\}");<NEW_LINE>// get a matcher<NEW_LINE>Matcher matcherPattern = pathPattern.matcher(input);<NEW_LINE>// object<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>EnvironmentConfiguration config = new EnvironmentConfiguration();<NEW_LINE>SystemConfiguration sysConfig = new SystemConfiguration();<NEW_LINE>while (matcherPattern.find()) {<NEW_LINE>String confVarName = matcherPattern.group(1) != null ? matcherPattern.group(1) : matcherPattern.group(2);<NEW_LINE>String <MASK><NEW_LINE>String sysVarValue = sysConfig.getString(confVarName);<NEW_LINE>if (envConfVarValue != null) {<NEW_LINE>matcherPattern.appendReplacement(sb, envConfVarValue);<NEW_LINE>} else if (sysVarValue != null) {<NEW_LINE>matcherPattern.appendReplacement(sb, sysVarValue);<NEW_LINE>} else {<NEW_LINE>matcherPattern.appendReplacement(sb, "");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>matcherPattern.appendTail(sb);<NEW_LINE>return sb.toString();<NEW_LINE>}
envConfVarValue = config.getString(confVarName);
749,206
private void createSelectionTill(@Nonnull LogicalPosition targetPosition) {<NEW_LINE>List<CaretState> caretStates = new ArrayList<>(myCaretStateBeforeLastPress);<NEW_LINE>if (myRectangularSelectionInProgress) {<NEW_LINE>caretStates.addAll(EditorModificationUtil.calcBlockSelectionState(this, myLastMousePressedLocation, targetPosition));<NEW_LINE>} else {<NEW_LINE>LogicalPosition selectionStart = myLastMousePressedLocation;<NEW_LINE>LogicalPosition selectionEnd = targetPosition;<NEW_LINE>if (getMouseSelectionState() != MOUSE_SELECTION_STATE_NONE) {<NEW_LINE>int newCaretOffset = logicalPositionToOffset(targetPosition);<NEW_LINE>if (newCaretOffset < mySavedSelectionStart) {<NEW_LINE>selectionStart = offsetToLogicalPosition(mySavedSelectionEnd);<NEW_LINE>if (getMouseSelectionState() == MOUSE_SELECTION_STATE_LINE_SELECTED) {<NEW_LINE>targetPosition = selectionEnd = visualToLogicalPosition(new VisualPosition(<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>selectionStart = offsetToLogicalPosition(mySavedSelectionStart);<NEW_LINE>int selectionEndOffset = Math.max(newCaretOffset, mySavedSelectionEnd);<NEW_LINE>if (getMouseSelectionState() == MOUSE_SELECTION_STATE_WORD_SELECTED) {<NEW_LINE>targetPosition = selectionEnd = offsetToLogicalPosition(selectionEndOffset);<NEW_LINE>} else if (getMouseSelectionState() == MOUSE_SELECTION_STATE_LINE_SELECTED) {<NEW_LINE>targetPosition = selectionEnd = visualToLogicalPosition(new VisualPosition(offsetToVisualLine(selectionEndOffset) + 1, 0));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cancelAutoResetForMouseSelectionState();<NEW_LINE>}<NEW_LINE>caretStates.add(new CaretState(targetPosition, selectionStart, selectionEnd));<NEW_LINE>}<NEW_LINE>myCaretModel.setCaretsAndSelections(caretStates);<NEW_LINE>}
offsetToVisualLine(newCaretOffset), 0));
923,760
public LoggerSetup merge(LogOptions logOptions) {<NEW_LINE>int logLevel = logOptions.getLogLevel() != null ? logOptions.getLogLevel() : this.logLevel;<NEW_LINE>int macAddressLogSetting = logOptions.getMacAddressLogSetting() != null ? logOptions.getMacAddressLogSetting() : this.macAddressLogSetting;<NEW_LINE>int uuidLogSetting = logOptions.getUuidLogSetting() != null ? logOptions.getUuidLogSetting() : this.uuidLogSetting;<NEW_LINE>boolean shouldLogAttributeValues = logOptions.getShouldLogAttributeValues() != null ? logOptions.getShouldLogAttributeValues() : this.shouldLogAttributeValues;<NEW_LINE>boolean shouldLogScanResults = logOptions.getShouldLogScannedPeripherals() != null ? logOptions.getShouldLogScannedPeripherals() : this.shouldLogScannedPeripherals;<NEW_LINE>LogOptions.Logger logger = logOptions.getLogger() != null ? logOptions.getLogger() : this.logger;<NEW_LINE>return new LoggerSetup(logLevel, macAddressLogSetting, <MASK><NEW_LINE>}
uuidLogSetting, shouldLogAttributeValues, shouldLogScanResults, logger);
1,357,752
public void testSFRemoteEnvEntry_Double() throws Exception {<NEW_LINE>// The test case looks for a environment variable named "envDouble".<NEW_LINE>Double tempDouble = fejb1.getDoubleEnvVar("envDouble");<NEW_LINE>assertNotNull("Get environment double object was null.", tempDouble);<NEW_LINE>assertEquals("Test content of environment was unexpected value.", tempDouble.doubleValue(), 7003.0, DDELTA);<NEW_LINE>tempDouble = fejb1.getDoubleEnvVar("envDouble2");<NEW_LINE>assertNotNull("Get environment double object was null.", tempDouble);<NEW_LINE>assertEquals("Test content of environment was unexpected value.", tempDouble.<MASK><NEW_LINE>tempDouble = fejb1.getDoubleEnvVar("envDouble3");<NEW_LINE>assertNotNull("Get environment double object was null.", tempDouble);<NEW_LINE>assertEquals("Test content of environment was unexpected value.", tempDouble.doubleValue(), 7.0030e3d, DDELTA);<NEW_LINE>}
doubleValue(), 7003.0, DDELTA);
384,852
private HttpPipeline createHttpPipeline() {<NEW_LINE>Configuration buildConfiguration = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration;<NEW_LINE>if (httpLogOptions == null) {<NEW_LINE>httpLogOptions = new HttpLogOptions();<NEW_LINE>}<NEW_LINE>if (clientOptions == null) {<NEW_LINE>clientOptions = new ClientOptions();<NEW_LINE>}<NEW_LINE>List<HttpPipelinePolicy> policies = new ArrayList<>();<NEW_LINE>String clientName = properties.getOrDefault(SDK_NAME, "UnknownName");<NEW_LINE>String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion");<NEW_LINE>String applicationId = CoreUtils.getApplicationId(clientOptions, httpLogOptions);<NEW_LINE>policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration));<NEW_LINE>policies.add(new AzureMonitorRedirectPolicy());<NEW_LINE>policies.add(retryPolicy == null ? new RetryPolicy() : retryPolicy);<NEW_LINE>policies<MASK><NEW_LINE>policies.addAll(this.pipelinePolicies);<NEW_LINE>policies.add(new HttpLoggingPolicy(httpLogOptions));<NEW_LINE>HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])).httpClient(httpClient).build();<NEW_LINE>return httpPipeline;<NEW_LINE>}
.add(new CookiePolicy());
72,726
public void read(org.apache.thrift.protocol.TProtocol iprot, getActiveCompactions_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TField schemeField;<NEW_LINE>iprot.readStructBegin();<NEW_LINE>while (true) {<NEW_LINE>schemeField = iprot.readFieldBegin();<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>switch(schemeField.id) {<NEW_LINE>case // TINFO<NEW_LINE>2:<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {<NEW_LINE>struct.tinfo = new org.apache.accumulo.core.trace.thrift.TInfo();<NEW_LINE>struct.tinfo.read(iprot);<NEW_LINE>struct.setTinfoIsSet(true);<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.<MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case // CREDENTIALS<NEW_LINE>1:<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {<NEW_LINE>struct.credentials = new org.apache.accumulo.core.securityImpl.thrift.TCredentials();<NEW_LINE>struct.credentials.read(iprot);<NEW_LINE>struct.setCredentialsIsSet(true);<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>iprot.readFieldEnd();<NEW_LINE>}<NEW_LINE>iprot.readStructEnd();<NEW_LINE>// check for required fields of primitive type, which can't be checked in the validate method<NEW_LINE>struct.validate();<NEW_LINE>}
skip(iprot, schemeField.type);
1,157,195
public static long parseInt000Greedy(CharSequence sequence, final int p, int lim) throws NumericException {<NEW_LINE>if (lim == p) {<NEW_LINE>throw NumericException.INSTANCE;<NEW_LINE>}<NEW_LINE>boolean negative = sequence.charAt(p) == '-';<NEW_LINE>int i = p;<NEW_LINE>if (negative) {<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>if (i >= lim || notDigit(sequence.charAt(i))) {<NEW_LINE>throw NumericException.INSTANCE;<NEW_LINE>}<NEW_LINE>int val = 0;<NEW_LINE>for (; i < lim; i++) {<NEW_LINE>char <MASK><NEW_LINE>if (notDigit(c)) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// val * 10 + (c - '0')<NEW_LINE>int r = (val << 3) + (val << 1) - (c - '0');<NEW_LINE>if (r > val) {<NEW_LINE>throw NumericException.INSTANCE;<NEW_LINE>}<NEW_LINE>val = r;<NEW_LINE>}<NEW_LINE>final int len = i - p;<NEW_LINE>if (len > 3 || val == Integer.MIN_VALUE && !negative) {<NEW_LINE>throw NumericException.INSTANCE;<NEW_LINE>}<NEW_LINE>while (i - p < 3) {<NEW_LINE>val *= 10;<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>return encodeLowHighInts(negative ? val : -val, len);<NEW_LINE>}
c = sequence.charAt(i);
1,267,724
public void paintEntity(Graphics g) {<NEW_LINE>Graphics2D g2 = (Graphics2D) g;<NEW_LINE>g2.setFont(HandlerElementMap.getHandlerForElement(this).getFontHandler().getFont());<NEW_LINE>// enable colors<NEW_LINE>Composite[] composites = colorize(g2);<NEW_LINE>g2.setColor(fgColor);<NEW_LINE>Polygon poly = new Polygon();<NEW_LINE>poly.addPoint(getRectangle().width / 2, 0);<NEW_LINE>poly.addPoint(getRectangle().width, getRectangle().height / 2);<NEW_LINE>poly.addPoint(getRectangle().width / 2, getRectangle().height);<NEW_LINE>poly.addPoint(0, getRectangle().height / 2);<NEW_LINE>g2<MASK><NEW_LINE>g2.setColor(bgColor);<NEW_LINE>g2.fillPolygon(poly);<NEW_LINE>g2.setComposite(composites[0]);<NEW_LINE>if (HandlerElementMap.getHandlerForElement(this).getDrawPanel().getSelector().isSelected(this)) {<NEW_LINE>g2.setColor(fgColor);<NEW_LINE>} else {<NEW_LINE>g2.setColor(fgColorBase);<NEW_LINE>}<NEW_LINE>g2.drawPolygon(poly);<NEW_LINE>}
.setComposite(composites[1]);
1,469,141
private void tryAssertionOneParameterLambdaReturn(RegressionEnvironment env, String epl) {<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>EPTypeClass inner = EPTypeClassParameterized.from(Collection.class, SupportBean_ST0.class);<NEW_LINE>env.assertStmtTypes("s0", "val1,val2".split(","), new EPTypeClass[] { inner, inner });<NEW_LINE>SupportBean_ST0_Container theEvent = SupportBean_ST0_Container.make3Value("E1,K1,1", "E2,K2,2", "E20,K20,20");<NEW_LINE>env.sendEventBean(theEvent);<NEW_LINE>env.assertListener("s0", listener -> {<NEW_LINE>Object[] resultVal1 = ((Collection) listener.getLastNewData()[0].get("val1")).toArray();<NEW_LINE>EPAssertionUtil.assertEqualsExactOrder(new Object[] { theEvent.getContained().get(0), theEvent.getContained().get(1) }, resultVal1);<NEW_LINE>Object[] resultVal2 = ((Collection) listener.getLastNewData()[0].get<MASK><NEW_LINE>EPAssertionUtil.assertEqualsExactOrder(new Object[] { theEvent.getContained().get(1) }, resultVal2);<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>}
("val2")).toArray();
1,391,235
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>// WUtil.debug(new String("In do Post"),"");<NEW_LINE>HttpSession sess = request.getSession();<NEW_LINE>WebSessionCtx wsc = WebSessionCtx.get(request);<NEW_LINE>Properties ctx = wsc.ctx;<NEW_LINE>if (ctx == null) {<NEW_LINE>WebUtil.createTimeoutPage(request, response, this, null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// String loginInfo = (String)sess.getAttribute(WEnv.SA_LOGININFO);<NEW_LINE>// get session attributes<NEW_LINE>MWorkflow wf = (MWorkflow) sess.getAttribute(WORKFLOW);<NEW_LINE>MWFNode[] nodes = (MWFNode[]) sess.getAttribute(NODES);<NEW_LINE>ArrayList nodes_ID = (ArrayList) sess.getAttribute(NODES_ID);<NEW_LINE>int[][] imageMap = (int[][]) sess.getAttribute(IMAGE_MAP);<NEW_LINE>int activeNode = ((Integer) sess.getAttribute(ACTIVE_NODE)).intValue();<NEW_LINE>// execute commnad<NEW_LINE>String m_command = request.getParameter(M_Command);<NEW_LINE>int j_command = WebUtil.getParameterAsInt(request, J_Command);<NEW_LINE>// WUtil.debug(m_command,"m_command");<NEW_LINE>// WUtil.debug(""+j_command,"j_command");<NEW_LINE>executeCommand(m_command, j_command, wf, <MASK><NEW_LINE>// get updated session attributes<NEW_LINE>wf = (MWorkflow) sess.getAttribute(WORKFLOW);<NEW_LINE>nodes = (MWFNode[]) sess.getAttribute(NODES);<NEW_LINE>nodes_ID = (ArrayList) sess.getAttribute(NODES_ID);<NEW_LINE>imageMap = (int[][]) sess.getAttribute(IMAGE_MAP);<NEW_LINE>activeNode = ((Integer) sess.getAttribute(ACTIVE_NODE)).intValue();<NEW_LINE>// create layout<NEW_LINE>WebDoc doc = preparePage("loginInfo");<NEW_LINE>doc = createLayout(doc, wf, activeNode, nodes, nodes_ID, imageMap);<NEW_LINE>WebUtil.createResponse(request, response, this, null, doc, false);<NEW_LINE>}
activeNode, nodes, nodes_ID, sess);
1,699,242
static public String bindSQL(String sqlText, String params) {<NEW_LINE>if (params == null || "".equals(params)) {<NEW_LINE>return sqlText;<NEW_LINE>}<NEW_LINE>ArrayList<String> binds = divideParams(params);<NEW_LINE>if (binds == null || binds.size() == 0) {<NEW_LINE>return sqlText;<NEW_LINE>}<NEW_LINE>int bindLength = binds.size();<NEW_LINE>if (sqlText == null || sqlText.length() == 0) {<NEW_LINE>return "No SQL Text";<NEW_LINE>}<NEW_LINE>String newSqlText = convertBindVariable(sqlText);<NEW_LINE>StringBuilder sqlBuilder = new StringBuilder();<NEW_LINE>int index = 0;<NEW_LINE>int pos = 0;<NEW_LINE>Matcher m = pattern.matcher(newSqlText);<NEW_LINE>while (m.find()) {<NEW_LINE>sqlBuilder.append(newSqlText.substring(pos, m.start())).append(StringUtil.stripSideChar(binds.get(index), '\''));<NEW_LINE>pos = m.end();<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>sqlBuilder.append(newSqlText.substring(pos));<NEW_LINE>// int sqlLength = newSqlText.length();<NEW_LINE>// int bindLength = binds.size();<NEW_LINE>// String bind;<NEW_LINE>// int search;<NEW_LINE>// boolean isChar;<NEW_LINE>//<NEW_LINE>// StringBuilder sb = new StringBuilder(100);<NEW_LINE>// while(pos < sqlLength){<NEW_LINE>// search = newSqlText.indexOf('@', pos);<NEW_LINE>//<NEW_LINE>// if(search < 0 || index >= bindLength){<NEW_LINE>// sb.append(newSqlText.substring(pos));<NEW_LINE>// break;<NEW_LINE>// }<NEW_LINE>//<NEW_LINE>// bind = binds.get(index);<NEW_LINE>// if(bind.charAt(0) == '\''){<NEW_LINE>// isChar = true;<NEW_LINE>// }else{<NEW_LINE>// isChar = false;<NEW_LINE>// }<NEW_LINE>//<NEW_LINE>// if(isChar){<NEW_LINE>// if(search == 0 || (search + 1) == sqlLength){<NEW_LINE>// return errorMessage(sb, newSqlText, bind, "SQL Character Position Check", pos, search, isChar);<NEW_LINE>// }<NEW_LINE>//<NEW_LINE>// if(newSqlText.charAt(search - 1) != '\'' || newSqlText.charAt(search + 1) != '\''){<NEW_LINE>// return errorMessage(sb, newSqlText, bind, "SQL Character Quata Check", pos, search, isChar);<NEW_LINE>// }<NEW_LINE>//<NEW_LINE>// sb.append(newSqlText.subSequence(pos, search - 1));<NEW_LINE>// sb.append(bind);<NEW_LINE>// pos = search + 2;<NEW_LINE>// }else{<NEW_LINE>// if(search > 0){<NEW_LINE>// if(" \t=<>,+-*/|^&(".indexOf(newSqlText.charAt(search-1))<0){<NEW_LINE>// return errorMessage(sb, newSqlText, bind, "Number Check", pos, search, isChar);<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>// sb.append(newSqlText.subSequence(pos, search));<NEW_LINE>// sb.append(bind);<NEW_LINE>// pos = search + 1;<NEW_LINE>// }<NEW_LINE>//<NEW_LINE>// index++;<NEW_LINE>// }<NEW_LINE>if (index < bindLength) {<NEW_LINE>sqlBuilder.append(SQLDIVIDE);<NEW_LINE>int inx = 1;<NEW_LINE>for (int i = index; i < bindLength; i++) {<NEW_LINE>sqlBuilder.append(':').append(inx).append(" - ").append(binds.get(<MASK><NEW_LINE>inx++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sqlBuilder.toString();<NEW_LINE>}
i)).append("\r\n");
1,245,611
final ListExecutionsResult executeListExecutions(ListExecutionsRequest listExecutionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listExecutionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListExecutionsRequest> request = null;<NEW_LINE>Response<ListExecutionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListExecutionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listExecutionsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Snow Device Management");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListExecutions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListExecutionsResult>> 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 ListExecutionsResultJsonUnmarshaller());
1,212,769
public SimpleTreeNode find(SimpleTreeNode fromNode, int recordId) {<NEW_LINE>if (fromNode == null)<NEW_LINE>fromNode = getRoot();<NEW_LINE>MTreeNode data = (MTreeNode) fromNode.getData();<NEW_LINE>if (data.getNode_ID() == recordId)<NEW_LINE>return fromNode;<NEW_LINE>// If the MTree model and the tree model aren't in sync, the data<NEW_LINE>// could include a new node that hasn't been initialized (node_id == -1).<NEW_LINE>// This will have no children causing a NPE error in isLeaf().<NEW_LINE>try {<NEW_LINE>if (isLeaf(fromNode))<NEW_LINE>return null;<NEW_LINE>} catch (NullPointerException e) {<NEW_LINE>logger.severe(<MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int cnt = getChildCount(fromNode);<NEW_LINE>for (int i = 0; i < cnt; i++) {<NEW_LINE>SimpleTreeNode child = getChild(fromNode, i);<NEW_LINE>SimpleTreeNode treeNode = find(child, recordId);<NEW_LINE>if (treeNode != null)<NEW_LINE>return treeNode;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
"Uninitialized node exists in tree. Node ID: " + data.getNode_ID());
966,998
private ConnectionInfo parseForwardedInfo(ConnectionInfo connectionInfo, String forwardedHeader) {<NEW_LINE>String forwarded = forwardedHeader.split<MASK><NEW_LINE>Matcher hostMatcher = FORWARDED_HOST_PATTERN.matcher(forwarded);<NEW_LINE>if (hostMatcher.find()) {<NEW_LINE>connectionInfo = connectionInfo.withHostAddress(AddressUtils.parseAddress(hostMatcher.group(1), connectionInfo.getHostAddress().getPort(), DEFAULT_FORWARDED_HEADER_VALIDATION));<NEW_LINE>}<NEW_LINE>Matcher protoMatcher = FORWARDED_PROTO_PATTERN.matcher(forwarded);<NEW_LINE>if (protoMatcher.find()) {<NEW_LINE>connectionInfo = connectionInfo.withScheme(protoMatcher.group(1).trim());<NEW_LINE>}<NEW_LINE>Matcher forMatcher = FORWARDED_FOR_PATTERN.matcher(forwarded);<NEW_LINE>if (forMatcher.find()) {<NEW_LINE>connectionInfo = connectionInfo.withRemoteAddress(AddressUtils.parseAddress(forMatcher.group(1).trim(), connectionInfo.getRemoteAddress().getPort(), DEFAULT_FORWARDED_HEADER_VALIDATION));<NEW_LINE>}<NEW_LINE>return connectionInfo;<NEW_LINE>}
(",", 2)[0];
897,297
public void initNearbyFilter() {<NEW_LINE><MASK><NEW_LINE>searchView.setOnQueryTextFocusChangeListener((v, hasFocus) -> {<NEW_LINE>if (hasFocus) {<NEW_LINE>presenter.searchViewGainedFocus();<NEW_LINE>nearbyFilterList.setVisibility(View.VISIBLE);<NEW_LINE>} else {<NEW_LINE>nearbyFilterList.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>recyclerView.setHasFixedSize(true);<NEW_LINE>recyclerView.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL));<NEW_LINE>final LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());<NEW_LINE>linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);<NEW_LINE>recyclerView.setLayoutManager(linearLayoutManager);<NEW_LINE>nearbyFilterSearchRecyclerViewAdapter = new NearbyFilterSearchRecyclerViewAdapter(getContext(), new ArrayList<>(Label.valuesAsList()), recyclerView);<NEW_LINE>nearbyFilterSearchRecyclerViewAdapter.setCallback(new NearbyFilterSearchRecyclerViewAdapter.Callback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void setCheckboxUnknown() {<NEW_LINE>presenter.setCheckboxUnknown();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void filterByMarkerType(final ArrayList<Label> selectedLabels, final int i, final boolean b, final boolean b1) {<NEW_LINE>presenter.filterByMarkerType(selectedLabels, i, b, b1);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isDarkTheme() {<NEW_LINE>return isDarkTheme;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>nearbyFilterList.getLayoutParams().width = (int) LayoutUtils.getScreenWidth(getActivity(), 0.75);<NEW_LINE>recyclerView.setAdapter(nearbyFilterSearchRecyclerViewAdapter);<NEW_LINE>LayoutUtils.setLayoutHeightAllignedToWidth(1.25, nearbyFilterList);<NEW_LINE>compositeDisposable.add(RxSearchView.queryTextChanges(searchView).takeUntil(RxView.detaches(searchView)).debounce(500, TimeUnit.MILLISECONDS).observeOn(AndroidSchedulers.mainThread()).subscribe(query -> {<NEW_LINE>((NearbyFilterSearchRecyclerViewAdapter) recyclerView.getAdapter()).getFilter().filter(query.toString());<NEW_LINE>}));<NEW_LINE>initFilterChips();<NEW_LINE>}
nearbyFilterList.setVisibility(View.GONE);
1,634,950
public static void main(String[] args) {<NEW_LINE>FhirContext ctx = FhirContext.forDstu3();<NEW_LINE>IGenericClient source = ctx.newRestfulGenericClient("http://localhost:8080/baseDstu3");<NEW_LINE>IGenericClient <MASK><NEW_LINE>List<String> resType = Arrays.asList("Patient", "Organization", "Encounter", "Procedure", "Observation", "ResearchSubject", "Specimen", "ResearchStudy", "Location", "Practitioner");<NEW_LINE>List<IBaseResource> queued = new ArrayList<>();<NEW_LINE>Set<String> sent = new HashSet<>();<NEW_LINE>for (String next : resType) {<NEW_LINE>copy(ctx, source, target, next, queued, sent);<NEW_LINE>}<NEW_LINE>while (queued.size() > 0) {<NEW_LINE>ourLog.info("Have {} queued resources to deliver", queued.size());<NEW_LINE>for (IBaseResource nextQueued : new ArrayList<>(queued)) {<NEW_LINE>String missingRef = null;<NEW_LINE>for (ResourceReferenceInfo nextRefInfo : ctx.newTerser().getAllResourceReferences(nextQueued)) {<NEW_LINE>String nextRef = nextRefInfo.getResourceReference().getReferenceElement().getValue();<NEW_LINE>if (isNotBlank(nextRef) && !sent.contains(nextRef)) {<NEW_LINE>missingRef = nextRef;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (missingRef != null) {<NEW_LINE>ourLog.info("Can't send {} because of missing ref {}", nextQueued.getIdElement().getIdPart(), missingRef);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>IIdType newId = target.update().resource(nextQueued).execute().getId();<NEW_LINE>ourLog.info("Copied resource {} and got ID {}", nextQueued.getIdElement().getValue(), newId);<NEW_LINE>sent.add(nextQueued.getIdElement().toUnqualifiedVersionless().getValue());<NEW_LINE>queued.remove(nextQueued);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
target = ctx.newRestfulGenericClient("https://try.smilecdr.com:8000");
1,480,739
final UpdateExperimentResult executeUpdateExperiment(UpdateExperimentRequest updateExperimentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateExperimentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateExperimentRequest> request = null;<NEW_LINE>Response<UpdateExperimentResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new UpdateExperimentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateExperimentRequest));<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, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateExperiment");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateExperimentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateExperimentResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1,740,817
private void updateEnabled() {<NEW_LINE>// add and OK is disabled in waitmodel<NEW_LINE>// TODO C.P how to disable OK?<NEW_LINE>boolean okEnabled = !UIUtil.isWaitModel(dependencyList.getModel());<NEW_LINE>// if there is no selection disable edit/remove buttons<NEW_LINE>boolean enabled = dependencyList.getModel().getSize() > 0 && okEnabled && getProperties().isActivePlatformValid() && dependencyList.getSelectedIndex() != -1;<NEW_LINE>editDepButton.setEnabled(enabled);<NEW_LINE>removeDepButton.setEnabled(enabled);<NEW_LINE>addDepButton.setEnabled(okEnabled && getProperties().isActivePlatformValid());<NEW_LINE>boolean javaEnabled = getProperties().isNetBeansOrg() || (getProperties().isStandalone() && /* #71631 */<NEW_LINE>((NbPlatform) platformValue.getSelectedItem()).getHarnessVersion().compareTo(HarnessVersion.V50u1) >= 0);<NEW_LINE>javaPlatformCombo.setEnabled(javaEnabled);<NEW_LINE>javaPlatformButton.setEnabled(javaEnabled);<NEW_LINE>int[<MASK><NEW_LINE>DefaultListModel listModel = getProperties().getWrappedJarsListModel();<NEW_LINE>boolean exportEnabled = false;<NEW_LINE>for (int i : selectedIndices) {<NEW_LINE>Item item = (Item) listModel.getElementAt(i);<NEW_LINE>if (item.getType() == Item.TYPE_JAR) {<NEW_LINE>final Boolean value = isJarExportedMap.get(item.getResolvedFile());<NEW_LINE>// value == null means not yet refreshed map, we can just allow export in such case<NEW_LINE>exportEnabled |= (value == null || !value.booleanValue());<NEW_LINE>if (exportEnabled) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>exportButton.setEnabled(exportEnabled);<NEW_LINE>}
] selectedIndices = emListComp.getSelectedIndices();
330,084
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {<NEW_LINE>final String sensor = ((TextView) view).getText().toString();<NEW_LINE>final MaterialDialog dialog = new MaterialDialog.Builder(context).title(sensor).customView(R.layout.sensor_list_long_click_dailog, false).build();<NEW_LINE>dialog.show();<NEW_LINE><MASK><NEW_LINE>assert customView != null;<NEW_LINE>ListView clickOptions = customView.findViewById(R.id.lv_sensor_list_click);<NEW_LINE>ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(context, android.R.layout.simple_list_item_1, getResources().getStringArray(R.array.sensor_click_list));<NEW_LINE>clickOptions.setAdapter(arrayAdapter);<NEW_LINE>clickOptions.setOnItemClickListener(new AdapterView.OnItemClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onItemClick(AdapterView<?> parent, View view, int position, long id) {<NEW_LINE>switch(position) {<NEW_LINE>case 0:<NEW_LINE>// todo : check for permission first<NEW_LINE>exportCompleteSensorData(sensor);<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>dialog.dismiss();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return true;<NEW_LINE>}
View customView = dialog.getCustomView();
18,511
final ListGrantsResult executeListGrants(ListGrantsRequest listGrantsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listGrantsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListGrantsRequest> request = null;<NEW_LINE>Response<ListGrantsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListGrantsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listGrantsRequest));<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, "KMS");<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<ListGrantsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListGrantsResultJsonUnmarshaller());<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, "ListGrants");
75,385
protected String buildBaseQuery() {<NEW_LINE>final StringBuilder queryBuf = new StringBuilder(255);<NEW_LINE>if (params.hasConditionQuery()) {<NEW_LINE>appendConditions(queryBuf, params.getConditions());<NEW_LINE>} else {<NEW_LINE>final String query = params.getQuery();<NEW_LINE>if (StringUtil.isNotBlank(query)) {<NEW_LINE>if (ComponentUtil.hasRelatedQueryHelper()) {<NEW_LINE>final RelatedQueryHelper relatedQueryHelper = ComponentUtil.getRelatedQueryHelper();<NEW_LINE>final String[] <MASK><NEW_LINE>if (relatedQueries.length == 0) {<NEW_LINE>appendQuery(queryBuf, query);<NEW_LINE>} else {<NEW_LINE>queryBuf.append('(');<NEW_LINE>queryBuf.append(quote(query));<NEW_LINE>for (final String s : relatedQueries) {<NEW_LINE>queryBuf.append(OR);<NEW_LINE>queryBuf.append(quote(s));<NEW_LINE>}<NEW_LINE>queryBuf.append(')');<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>appendQuery(queryBuf, query);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return queryBuf.toString().trim();<NEW_LINE>}
relatedQueries = relatedQueryHelper.getRelatedQueries(query);
902,991
private void prepareSpawn() {<NEW_LINE>int centerX = spawnLocation.getBlockX() >> 4;<NEW_LINE>int centerZ = spawnLocation.getBlockZ() >> 4;<NEW_LINE>int radius = 4 * server.getViewDistance() / 3;<NEW_LINE>long loadTime = System.currentTimeMillis();<NEW_LINE>int total = ((radius << 1) + 1) * ((radius << 1) + 1);<NEW_LINE>int current = 0;<NEW_LINE>for (int x = centerX - radius; x <= centerX + radius; ++x) {<NEW_LINE>for (int z = centerZ - radius; z <= centerZ + radius; ++z) {<NEW_LINE>++current;<NEW_LINE>if (populateAnchoredChunks) {<NEW_LINE>getChunkManager().forcePopulation(x, z);<NEW_LINE>} else {<NEW_LINE>loadChunk(x, z);<NEW_LINE>}<NEW_LINE>spawnChunkLock.acquire(GlowChunk.Key.of(x, z));<NEW_LINE>if (System.currentTimeMillis() >= loadTime + 1000) {<NEW_LINE><MASK><NEW_LINE>GlowServer.logger.info("Preparing spawn for " + name + ": " + progress + "%");<NEW_LINE>loadTime = System.currentTimeMillis();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int progress = 100 * current / total;
1,224,632
public Task applyUpdateTaskPayload(boolean isAdmin, UpdateTaskPayload updateTaskPayload) {<NEW_LINE>org.activiti.engine.task.Task internalTask;<NEW_LINE>if (isAdmin) {<NEW_LINE>internalTask = getInternalTask(updateTaskPayload.getTaskId());<NEW_LINE>} else {<NEW_LINE>internalTask = getTaskToUpdate(updateTaskPayload.getTaskId());<NEW_LINE>}<NEW_LINE>int updates = updateName(updateTaskPayload, internalTask, 0);<NEW_LINE>updates = updateDescription(updateTaskPayload, internalTask, updates);<NEW_LINE>updates = <MASK><NEW_LINE>updates = updateDueDate(updateTaskPayload, internalTask, updates);<NEW_LINE>updates = updateParentTaskId(updateTaskPayload, internalTask, updates);<NEW_LINE>updates = updateFormKey(updateTaskPayload, internalTask, updates);<NEW_LINE>if (updates > 0) {<NEW_LINE>taskService.saveTask(internalTask);<NEW_LINE>}<NEW_LINE>return taskConverter.from(getInternalTask(updateTaskPayload.getTaskId()));<NEW_LINE>}
updatePriority(updateTaskPayload, internalTask, updates);
641,000
public static MethodProvider create(TypeRegistry registry, TypeDescriptor typeDescriptor) {<NEW_LINE>if (typeDescriptor.isReloadable()) {<NEW_LINE>ReloadableType rtype = registry.getReloadableType(typeDescriptor.getName(), false);<NEW_LINE>if (rtype == null) {<NEW_LINE>TypeRegistry tr = registry;<NEW_LINE>while (rtype == null) {<NEW_LINE>ClassLoader pcl = tr.getClassLoader().getParent();<NEW_LINE>if (pcl == null) {<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>tr = TypeRegistry.getTypeRegistryFor(pcl);<NEW_LINE>if (tr == null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>rtype = tr.getReloadableType(typeDescriptor.getName(), false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (rtype != null) {<NEW_LINE>return new ReloadableTypeMethodProvider(rtype);<NEW_LINE>}<NEW_LINE>// ReloadableType rtype = registry.getReloadableType(typeDescriptor.getName(), true);<NEW_LINE>// // TODO rtype can be null if this type hasn't been loaded yet for the first time, is that true?<NEW_LINE>// // e.g. CGLIB generated proxy for a service type in grails<NEW_LINE>// if (rtype != null) {<NEW_LINE>// return new ReloadableTypeMethodProvider(rtype);<NEW_LINE>// }<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE>Type objectType = Type.getObjectType(typeDescriptor.getName());<NEW_LINE>// TODO doing things this way would mean we aren't 'guessing' the delegation strategy, we<NEW_LINE>// are instead allowing it to do its thing then looking for the right registry.<NEW_LINE>// Above we are guessing regular parent delegation.<NEW_LINE>Class<?> class1 = Utils.toClass(objectType, registry.getClassLoader());<NEW_LINE>if (typeDescriptor.isReloadable()) {<NEW_LINE>ClassLoader cl = class1.getClassLoader();<NEW_LINE>TypeRegistry <MASK><NEW_LINE>ReloadableType rtype = tr.getReloadableType(typeDescriptor.getName(), true);<NEW_LINE>if (rtype != null) {<NEW_LINE>return new ReloadableTypeMethodProvider(rtype);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return create(class1);<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>throw new IllegalStateException("We have a type descriptor for '" + typeDescriptor.getName() + " but no corresponding Java class", e);<NEW_LINE>}<NEW_LINE>} catch (RuntimeException re) {<NEW_LINE>re.printStackTrace();<NEW_LINE>throw re;<NEW_LINE>}<NEW_LINE>}
tr = TypeRegistry.getTypeRegistryFor(cl);
78,832
public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/fake/outer/composite";<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 <MASK><NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>TypeReference<OuterComposite> localVarReturnType = new TypeReference<OuterComposite>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>}
String[] localVarAccepts = { "*/*" };
386,684
private void copySettingsIfAvailable(IJTPreset selected) {<NEW_LINE>IPreferencePageContainer container = getContainer();<NEW_LINE>if (!(container instanceof PreferenceDialog)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PreferenceManager manager = ((PreferenceDialog) container).getPreferenceManager();<NEW_LINE>List<IPreferenceNode> elements = manager.getElements(PreferenceManager.POST_ORDER);<NEW_LINE>IPreferenceNode node = IterableExtensions.findFirst(elements, new Function1<IPreferenceNode, Boolean>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Boolean apply(IPreferenceNode t) {<NEW_LINE>return t.getId().equals(JTPreferencePage.ID);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (node == null || node.getPage() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JTPreferencePage page = (JTPreferencePage) node.getPage();<NEW_LINE>JThemePreferenceStore copy = JThemesCore.getDefault().getPreferenceStore().getCopyWithContext(null);<NEW_LINE>Properties properties = selected.getProperties();<NEW_LINE>for (Object keyObj : properties.keySet()) {<NEW_LINE>String key = (String) keyObj;<NEW_LINE>String value = properties.getProperty(key);<NEW_LINE>if (key.equals(JTPConstants.Layout.TAB_HEIGHT)) {<NEW_LINE>int intValue = Integer.parseInt(value);<NEW_LINE>copy.setValue(key, Math.max(intValue, SWTExtensions<MASK><NEW_LINE>} else {<NEW_LINE>copy.setValue(key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>page.loadFrom(copy);<NEW_LINE>}
.INSTANCE.getMinimumToolBarHeight()));
1,426,401
void addComponentInternal(ObserverInfo observer) {<NEW_LINE>ResultHandle beanIdToBeanHandle = addMethod.getMethodParam(0);<NEW_LINE>ResultHandle observersHandle = addMethod.getMethodParam(1);<NEW_LINE>String observerType = observerToGeneratedName.get(observer);<NEW_LINE>List<ResultHandle> params = new ArrayList<>();<NEW_LINE>List<String> paramTypes = new ArrayList<>();<NEW_LINE>if (!observer.isSynthetic()) {<NEW_LINE>List<InjectionPointInfo> injectionPoints = observer.getInjection().injectionPoints.stream().filter(ip -> !BuiltinBean.resolvesTo(ip)).collect(toList());<NEW_LINE>// First param - declaring bean<NEW_LINE>params.add(addMethod.invokeInterfaceMethod(MethodDescriptors.MAP_GET, beanIdToBeanHandle, addMethod.load(observer.getDeclaringBean().getIdentifier())));<NEW_LINE>paramTypes.add(Type.getDescriptor(Supplier.class));<NEW_LINE>for (InjectionPointInfo injectionPoint : injectionPoints) {<NEW_LINE>params.add(addMethod.invokeInterfaceMethod(MethodDescriptors.MAP_GET, beanIdToBeanHandle, addMethod.load(injectionPoint.getResolvedBean(<MASK><NEW_LINE>paramTypes.add(Type.getDescriptor(Supplier.class));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ResultHandle observerInstance = addMethod.newInstance(MethodDescriptor.ofConstructor(observerType, paramTypes.toArray(new String[0])), params.toArray(new ResultHandle[0]));<NEW_LINE>addMethod.invokeInterfaceMethod(MethodDescriptors.LIST_ADD, observersHandle, observerInstance);<NEW_LINE>}
).getIdentifier())));
407,169
public void run() {<NEW_LINE>if (label_comp.isDisposed()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ticks++;<NEW_LINE>image_index++;<NEW_LINE>if (image_index == vitality_images.length) {<NEW_LINE>image_index = 0;<NEW_LINE>}<NEW_LINE>boolean do_results = ticks % 5 == 0;<NEW_LINE>boolean all_done = do_results;<NEW_LINE>for (int i = 0; i < engines.length; i++) {<NEW_LINE>Object[] status = search.getEngineStatus(engines[i]);<NEW_LINE>int state = (Integer) status[0];<NEW_LINE>ImageLabel indicator = indicators.get(i);<NEW_LINE>if (state == 0) {<NEW_LINE>indicator<MASK><NEW_LINE>} else if (state == 1) {<NEW_LINE>indicator.setImage(ok_image);<NEW_LINE>} else if (state == 2) {<NEW_LINE>indicator.setImage(fail_image);<NEW_LINE>String msg = (String) status[2];<NEW_LINE>if (msg != null) {<NEW_LINE>Utils.setTT(indicator, msg);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>indicator.setImage(auth_image);<NEW_LINE>}<NEW_LINE>if (do_results) {<NEW_LINE>if (state == 0) {<NEW_LINE>all_done = false;<NEW_LINE>}<NEW_LINE>String str = "(" + status[1] + ")";<NEW_LINE>Label rc = result_counts.get(i);<NEW_LINE>if (!str.equals(rc.getText())) {<NEW_LINE>rc.setText(str);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (all_done) {<NEW_LINE>running = false;<NEW_LINE>}<NEW_LINE>}
.setImage(vitality_images[image_index]);
75,363
public GradientValue_F32 compute(int x, int y) {<NEW_LINE>int horizontalOffset = x - r - 1;<NEW_LINE>int indexSrc1 = input.startIndex + (y - r - 1) * input.stride + horizontalOffset;<NEW_LINE>int indexSrc2 = indexSrc1 + r * input.stride;<NEW_LINE>int indexSrc3 = indexSrc2 + input.stride;<NEW_LINE>int indexSrc4 = indexSrc3 + r * input.stride;<NEW_LINE>float p0 = input.data[indexSrc1];<NEW_LINE>float p1 = input.data[indexSrc1 + r];<NEW_LINE>float p2 = input.<MASK><NEW_LINE>float p3 = input.data[indexSrc1 + w];<NEW_LINE>float p11 = input.data[indexSrc2];<NEW_LINE>float p4 = input.data[indexSrc2 + w];<NEW_LINE>float p10 = input.data[indexSrc3];<NEW_LINE>float p5 = input.data[indexSrc3 + w];<NEW_LINE>float p9 = input.data[indexSrc4];<NEW_LINE>float p8 = input.data[indexSrc4 + r];<NEW_LINE>float p7 = input.data[indexSrc4 + r + 1];<NEW_LINE>float p6 = input.data[indexSrc4 + w];<NEW_LINE>float left = p8 - p9 - p1 + p0;<NEW_LINE>float right = p6 - p7 - p3 + p2;<NEW_LINE>float top = p4 - p11 - p3 + p0;<NEW_LINE>float bottom = p6 - p9 - p5 + p10;<NEW_LINE>ret.x = right - left;<NEW_LINE>ret.y = bottom - top;<NEW_LINE>return ret;<NEW_LINE>}
data[indexSrc1 + r + 1];
714,500
public static void main(final String... args) throws Exception {<NEW_LINE>LOGGER.info("\n=========================================================" + "\n " + "\n Welcome to Spring Integration! " + "\n " + <MASK><NEW_LINE>final AbstractApplicationContext context = new ClassPathXmlApplicationContext("classpath:META-INF/spring/integration/*-context.xml");<NEW_LINE>LOGGER.info("\n=========================================================" + "\n " + "\n This is the TCP-AMQP Sample - " + "\n " + "\n Start a netcat, listening on port 11112 - " + "\n netcat -l 11112 " + "\n " + "\n In another terminal, telnet to localhost 11111 " + "\n Enter text and you will see it echoed to the netcat " + "\n " + "\n Press Enter in this console to terminate " + "\n " + "\n=========================================================");<NEW_LINE>System.in.read();<NEW_LINE>context.close();<NEW_LINE>}
"\n For more information please visit: " + "\n https://www.springsource.org/spring-integration " + "\n " + "\n=========================================================");
386,362
public static byte[] signData(String clientID, byte[] data) {<NEW_LINE>if (clientID == null || clientID.isEmpty()) {<NEW_LINE>LOGGER.severe<MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (data == null || data.length == 0) {<NEW_LINE>LOGGER.severe(Common.addTag("[SignAndVerify] the parameter data is null or empty, please check!"));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>byte[] signData = null;<NEW_LINE>try {<NEW_LINE>KeyStore ks = KeyStore.getInstance(CipherConsts.KEYSTORE_TYPE);<NEW_LINE>ks.load(null);<NEW_LINE>Key privateKey = ks.getKey(clientID, null);<NEW_LINE>if (privateKey == null) {<NEW_LINE>LOGGER.info("private key is null");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Signature signature = Signature.getInstance(CipherConsts.SIGN_ALGORITHM, CipherConsts.PROVIDER_NAME);<NEW_LINE>signature.initSign((PrivateKey) privateKey);<NEW_LINE>signature.update(data);<NEW_LINE>signData = signature.sign();<NEW_LINE>} catch (KeyStoreException | CertificateException | NoSuchAlgorithmException | IOException | UnrecoverableKeyException | NoSuchProviderException | InvalidKeyException | SignatureException e) {<NEW_LINE>LOGGER.severe(Common.addTag("[SignAndVerify] catch Exception: " + e.getMessage()));<NEW_LINE>}<NEW_LINE>return signData;<NEW_LINE>}
(Common.addTag("[SignAndVerify] the parameter clientID is null or empty, please check!"));
307,292
public ArrayList<?> convert(String value) {<NEW_LINE>if (value == null) {<NEW_LINE>return null;<NEW_LINE>} else if (value.length() == 0) {<NEW_LINE>return new ArrayList<>();<NEW_LINE>} else if (value.startsWith("[") && value.endsWith("]")) {<NEW_LINE>try {<NEW_LINE>final JsonStreamReader reader = new JsonStreamReader(value);<NEW_LINE>reader.next();<NEW_LINE>return (ArrayList<<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>// Didn't parse, fall back to splitSimple down below.<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// This flow is considered deprecated because it does not respect the single or double quotes.<NEW_LINE>// For example, "'a,a','b,b'" will become {"'a", "a'", "'b", "b'"} splitting on the commas in the Strings<NEW_LINE>// Another example, "'a','b'" will become {"'a'", "'b'"} preserving the single quotes in the Strings<NEW_LINE>// This is being tracked in bug: W-5416395<NEW_LINE>// TODO display a warning to the developer to use the square bracket syntax.<NEW_LINE>return new ArrayList<>(Arrays.asList(StringUtils.splitByWholeSeparatorPreserveAllTokens(value, ",")));<NEW_LINE>}
?>) reader.getList();
1,852,735
private String toggleTenantState(String tenantName, String stateStr, @Nullable String tenantType) {<NEW_LINE>Set<String> serverInstances = new HashSet<>();<NEW_LINE>Set<String> brokerInstances = new HashSet<>();<NEW_LINE>ObjectNode instanceResult = JsonUtils.newObjectNode();<NEW_LINE>if ((tenantType == null) || tenantType.equalsIgnoreCase("server")) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if ((tenantType == null) || tenantType.equalsIgnoreCase("broker")) {<NEW_LINE>brokerInstances = _pinotHelixResourceManager.getAllInstancesForBrokerTenant(tenantName);<NEW_LINE>}<NEW_LINE>Set<String> allInstances = new HashSet<String>(serverInstances);<NEW_LINE>allInstances.addAll(brokerInstances);<NEW_LINE>if (StateType.DROP.name().equalsIgnoreCase(stateStr)) {<NEW_LINE>if (!allInstances.isEmpty()) {<NEW_LINE>throw new ControllerApplicationException(LOGGER, "Error: Tenant " + tenantName + " has live instances, cannot be dropped.", Response.Status.BAD_REQUEST);<NEW_LINE>}<NEW_LINE>_pinotHelixResourceManager.deleteBrokerTenantFor(tenantName);<NEW_LINE>_pinotHelixResourceManager.deleteOfflineServerTenantFor(tenantName);<NEW_LINE>_pinotHelixResourceManager.deleteRealtimeServerTenantFor(tenantName);<NEW_LINE>return new SuccessResponse("Dropped tenant " + tenantName + " successfully.").toString();<NEW_LINE>}<NEW_LINE>boolean enable = StateType.ENABLE.name().equalsIgnoreCase(stateStr) ? true : false;<NEW_LINE>for (String instance : allInstances) {<NEW_LINE>if (enable) {<NEW_LINE>instanceResult.put(instance, JsonUtils.objectToJsonNode(_pinotHelixResourceManager.enableInstance(instance)));<NEW_LINE>} else {<NEW_LINE>instanceResult.put(instance, JsonUtils.objectToJsonNode(_pinotHelixResourceManager.disableInstance(instance)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
serverInstances = _pinotHelixResourceManager.getAllInstancesForServerTenant(tenantName);
1,848,928
static void crop(String source, ReadableMap options, final Promise promise, ReactApplicationContext ctx) {<NEW_LINE>int cropWidth = (int) (options.getDouble("cropWidth"));<NEW_LINE>int cropHeight = (int) (options.getDouble("cropHeight"));<NEW_LINE>int cropOffsetX = (int) (options.getDouble("cropOffsetX"));<NEW_LINE>int cropOffsetY = (int) <MASK><NEW_LINE>ReadableMap videoSizes = getVideoRequiredMetadata(source, ctx);<NEW_LINE>int videoWidth = videoSizes.getInt("width");<NEW_LINE>int videoHeight = videoSizes.getInt("height");<NEW_LINE>ReadableMap sizes = // NOTE: MUST CHECK AGAINST "CROPPABLE" WIDTH/HEIGHT. NOT FULL WIDTH/HEIGHT<NEW_LINE>formatWidthAndHeightForFfmpeg(// NOTE: MUST CHECK AGAINST "CROPPABLE" WIDTH/HEIGHT. NOT FULL WIDTH/HEIGHT<NEW_LINE>cropWidth, // NOTE: MUST CHECK AGAINST "CROPPABLE" WIDTH/HEIGHT. NOT FULL WIDTH/HEIGHT<NEW_LINE>cropHeight, videoWidth - cropOffsetX, videoHeight - cropOffsetY);<NEW_LINE>cropWidth = sizes.getInt("width");<NEW_LINE>cropHeight = sizes.getInt("height");<NEW_LINE>// TODO: 1) ADD METHOD TO CHECK "IS FFMPEG LOADED".<NEW_LINE>// 2) CHECK IT HERE<NEW_LINE>// 3) EXPORT THAT METHOD TO "JS"<NEW_LINE>final File tempFile = createTempFile("mp4", promise, ctx);<NEW_LINE>ArrayList<String> cmd = new ArrayList<String>();<NEW_LINE>// NOTE: OVERWRITE OUTPUT FILE<NEW_LINE>cmd.add("-y");<NEW_LINE>// NOTE: INPUT FILE<NEW_LINE>cmd.add("-i");<NEW_LINE>cmd.add(source);<NEW_LINE>// NOTE: PLACE ARGUMENTS FOR FFMPEG IN THIS ORDER:<NEW_LINE>// 1. "-i" (INPUT FILE)<NEW_LINE>// 2. "-ss" (START TIME)<NEW_LINE>// 3. "-to" (END TIME) or "-t" (TRIM TIME)<NEW_LINE>// OTHERWISE WE WILL LOSE ACCURACY AND WILL GET WRONG CLIPPED VIDEO<NEW_LINE>String startTime = options.hasKey("startTime") ? options.getString("startTime") : null;<NEW_LINE>if (startTime != null) {<NEW_LINE>cmd.add("-ss");<NEW_LINE>cmd.add(startTime);<NEW_LINE>}<NEW_LINE>String endTime = options.hasKey("endTime") ? options.getString("endTime") : null;<NEW_LINE>if (endTime != null) {<NEW_LINE>cmd.add("-to");<NEW_LINE>cmd.add(endTime);<NEW_LINE>}<NEW_LINE>cmd.add("-vf");<NEW_LINE>cmd.add("crop=" + Integer.toString(cropWidth) + ":" + Integer.toString(cropHeight) + ":" + Integer.toString(cropOffsetX) + ":" + Integer.toString(cropOffsetY));<NEW_LINE>cmd.add("-preset");<NEW_LINE>cmd.add("ultrafast");<NEW_LINE>// NOTE: DO NOT CONVERT AUDIO TO SAVE TIME<NEW_LINE>cmd.add("-c:a");<NEW_LINE>cmd.add("copy");<NEW_LINE>// NOTE: FLAG TO CONVER "AAC" AUDIO CODEC<NEW_LINE>cmd.add("-strict");<NEW_LINE>cmd.add("-2");<NEW_LINE>// NOTE: OUTPUT FILE<NEW_LINE>cmd.add(tempFile.getPath());<NEW_LINE>executeFfmpegCommand(cmd, tempFile.getPath(), ctx, promise, "Crop error", null);<NEW_LINE>}
(options.getDouble("cropOffsetY"));
449,858
public void loadState(Element parentNode) {<NEW_LINE>try {<NEW_LINE>ourLocalRunManager.set(this);<NEW_LINE>clear(false);<NEW_LINE>List<Element> children = parentNode.getChildren(CONFIGURATION);<NEW_LINE>Element[] sortedElements = children.toArray(new Element[children.size()]);<NEW_LINE>// ensure templates are loaded first<NEW_LINE>Arrays.sort(sortedElements, (a, b) -> {<NEW_LINE>final boolean aDefault = Boolean.valueOf(a.getAttributeValue("default", "false"));<NEW_LINE>final boolean bDefault = Boolean.valueOf(b.getAttributeValue("default", "false"));<NEW_LINE>return aDefault == bDefault ? 0 : aDefault ? -1 : 1;<NEW_LINE>});<NEW_LINE>// element could be detached, so, we must not use for each<NEW_LINE>// noinspection ForLoopReplaceableByForEach<NEW_LINE>for (int i = 0, length = sortedElements.length; i < length; i++) {<NEW_LINE>Element element = sortedElements[i];<NEW_LINE>RunnerAndConfigurationSettings configurationSettings;<NEW_LINE>try {<NEW_LINE>configurationSettings = loadConfiguration(element, false);<NEW_LINE>} catch (ProcessCanceledException e) {<NEW_LINE>configurationSettings = null;<NEW_LINE>} catch (Throwable e) {<NEW_LINE>LOG.error(e);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (configurationSettings == null) {<NEW_LINE>if (myUnknownElements == null) {<NEW_LINE>myUnknownElements = new SmartList<>();<NEW_LINE>}<NEW_LINE>myUnknownElements.add(element.detach());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>myOrder.readExternal(parentNode);<NEW_LINE>// migration (old ids to UUIDs)<NEW_LINE>readList(myOrder);<NEW_LINE>myRecentlyUsedTemporaries.clear();<NEW_LINE>Element recentNode = parentNode.getChild(RECENT);<NEW_LINE>if (recentNode != null) {<NEW_LINE>JDOMExternalizableStringList list = new JDOMExternalizableStringList();<NEW_LINE>list.readExternal(recentNode);<NEW_LINE>readList(list);<NEW_LINE>for (String name : list) {<NEW_LINE>RunnerAndConfigurationSettings settings = myConfigurations.get(name);<NEW_LINE>if (settings != null) {<NEW_LINE>myRecentlyUsedTemporaries.add(settings.getConfiguration());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>myOrdered = false;<NEW_LINE><MASK><NEW_LINE>setSelectedConfigurationId(myLoadedSelectedConfigurationUniqueName);<NEW_LINE>fireBeforeRunTasksUpdated();<NEW_LINE>fireRunConfigurationSelected();<NEW_LINE>} finally {<NEW_LINE>ourLocalRunManager.remove();<NEW_LINE>}<NEW_LINE>}
myLoadedSelectedConfigurationUniqueName = parentNode.getAttributeValue(SELECTED_ATTR);
657,427
private void runOperationInCluster(K key, MergedUpdate<V> task, SessionEntityWrapper<V> sessionWrapper) {<NEW_LINE>V session = sessionWrapper.getEntity();<NEW_LINE>SessionUpdateTask.CacheOperation operation = task.getOperation(session);<NEW_LINE>// Don't need to run update of underlying entity. Local updates were already run<NEW_LINE>// task.runUpdate(session);<NEW_LINE>switch(operation) {<NEW_LINE>case REMOVE:<NEW_LINE>// Just remove it<NEW_LINE>CacheDecorators.skipCacheStore(cache).getAdvancedCache().withFlags(Flag.IGNORE_RETURN_VALUES).remove(key);<NEW_LINE>break;<NEW_LINE>case ADD:<NEW_LINE>CacheDecorators.skipCacheStore(cache).getAdvancedCache().withFlags(Flag.IGNORE_RETURN_VALUES).put(key, sessionWrapper, task.getLifespanMs(), TimeUnit.MILLISECONDS, task.<MASK><NEW_LINE>logger.tracef("Added entity '%s' to the cache '%s' . Lifespan: %d ms, MaxIdle: %d ms", key, cache.getName(), task.getLifespanMs(), task.getMaxIdleTimeMs());<NEW_LINE>break;<NEW_LINE>case ADD_IF_ABSENT:<NEW_LINE>SessionEntityWrapper<V> existing = CacheDecorators.skipCacheStore(cache).putIfAbsent(key, sessionWrapper, task.getLifespanMs(), TimeUnit.MILLISECONDS, task.getMaxIdleTimeMs(), TimeUnit.MILLISECONDS);<NEW_LINE>if (existing != null) {<NEW_LINE>logger.debugf("Existing entity in cache for key: %s . Will update it", key);<NEW_LINE>// Apply updates on the existing entity and replace it<NEW_LINE>task.runUpdate(existing.getEntity());<NEW_LINE>replace(key, task, existing, task.getLifespanMs(), task.getMaxIdleTimeMs());<NEW_LINE>} else {<NEW_LINE>logger.tracef("Add_if_absent successfully called for entity '%s' to the cache '%s' . Lifespan: %d ms, MaxIdle: %d ms", key, cache.getName(), task.getLifespanMs(), task.getMaxIdleTimeMs());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case REPLACE:<NEW_LINE>replace(key, task, sessionWrapper, task.getLifespanMs(), task.getMaxIdleTimeMs());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Unsupported state " + operation);<NEW_LINE>}<NEW_LINE>}
getMaxIdleTimeMs(), TimeUnit.MILLISECONDS);
516,562
public static GetCustomFieldsByTemplateIdResponse unmarshall(GetCustomFieldsByTemplateIdResponse getCustomFieldsByTemplateIdResponse, UnmarshallerContext _ctx) {<NEW_LINE>getCustomFieldsByTemplateIdResponse.setRequestId(_ctx.stringValue("GetCustomFieldsByTemplateIdResponse.RequestId"));<NEW_LINE>getCustomFieldsByTemplateIdResponse.setCode(_ctx.integerValue("GetCustomFieldsByTemplateIdResponse.Code"));<NEW_LINE>getCustomFieldsByTemplateIdResponse.setSuccess(_ctx.booleanValue("GetCustomFieldsByTemplateIdResponse.Success"));<NEW_LINE>List<DataItem> data <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetCustomFieldsByTemplateIdResponse.Data.Length"); i++) {<NEW_LINE>DataItem dataItem = new DataItem();<NEW_LINE>dataItem.setCreatedAt(_ctx.longValue("GetCustomFieldsByTemplateIdResponse.Data[" + i + "].CreatedAt"));<NEW_LINE>dataItem.setDefaultValue(_ctx.stringValue("GetCustomFieldsByTemplateIdResponse.Data[" + i + "].DefaultValue"));<NEW_LINE>dataItem.setDescription(_ctx.stringValue("GetCustomFieldsByTemplateIdResponse.Data[" + i + "].Description"));<NEW_LINE>dataItem.setDynamic(_ctx.booleanValue("GetCustomFieldsByTemplateIdResponse.Data[" + i + "].Dynamic"));<NEW_LINE>dataItem.setEditable(_ctx.booleanValue("GetCustomFieldsByTemplateIdResponse.Data[" + i + "].Editable"));<NEW_LINE>dataItem.setFieldFormat(_ctx.stringValue("GetCustomFieldsByTemplateIdResponse.Data[" + i + "].FieldFormat"));<NEW_LINE>dataItem.setId(_ctx.integerValue("GetCustomFieldsByTemplateIdResponse.Data[" + i + "].Id"));<NEW_LINE>dataItem.setIsDelete(_ctx.booleanValue("GetCustomFieldsByTemplateIdResponse.Data[" + i + "].IsDelete"));<NEW_LINE>dataItem.setIsRemember(_ctx.booleanValue("GetCustomFieldsByTemplateIdResponse.Data[" + i + "].IsRemember"));<NEW_LINE>dataItem.setIsRequired(_ctx.booleanValue("GetCustomFieldsByTemplateIdResponse.Data[" + i + "].IsRequired"));<NEW_LINE>dataItem.setMaxLength(_ctx.integerValue("GetCustomFieldsByTemplateIdResponse.Data[" + i + "].MaxLength"));<NEW_LINE>dataItem.setMinLength(_ctx.integerValue("GetCustomFieldsByTemplateIdResponse.Data[" + i + "].MinLength"));<NEW_LINE>dataItem.setName(_ctx.stringValue("GetCustomFieldsByTemplateIdResponse.Data[" + i + "].Name"));<NEW_LINE>dataItem.setNameI18N(_ctx.stringValue("GetCustomFieldsByTemplateIdResponse.Data[" + i + "].NameI18N"));<NEW_LINE>dataItem.setOther(_ctx.stringValue("GetCustomFieldsByTemplateIdResponse.Data[" + i + "].Other"));<NEW_LINE>dataItem.setPossibleValues(_ctx.stringValue("GetCustomFieldsByTemplateIdResponse.Data[" + i + "].PossibleValues"));<NEW_LINE>dataItem.setType(_ctx.stringValue("GetCustomFieldsByTemplateIdResponse.Data[" + i + "].Type"));<NEW_LINE>dataItem.setUpdatedAt(_ctx.longValue("GetCustomFieldsByTemplateIdResponse.Data[" + i + "].UpdatedAt"));<NEW_LINE>data.add(dataItem);<NEW_LINE>}<NEW_LINE>getCustomFieldsByTemplateIdResponse.setData(data);<NEW_LINE>return getCustomFieldsByTemplateIdResponse;<NEW_LINE>}
= new ArrayList<DataItem>();
805,833
/* get code directory hash */<NEW_LINE>private long csops(Emulator<DarwinFileIO> emulator) {<NEW_LINE>RegisterContext context = emulator.getContext();<NEW_LINE>int pid = context.getIntArg(0);<NEW_LINE>int <MASK><NEW_LINE>Pointer addr = context.getPointerArg(2);<NEW_LINE>int length = context.getIntArg(3);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("csops pid=" + pid + ", op=" + op + ", addr=" + addr + ", length=" + length);<NEW_LINE>}<NEW_LINE>if (op == CS_OPS_STATUS) {<NEW_LINE>addr.setInt(0, CS_HARD | CS_RESTRICT | CS_ENFORCEMENT | CS_REQUIRE_LV | CS_ENTITLEMENTS_VALIDATED | CS_DYLD_PLATFORM | CS_PLATFORM_BINARY | CS_SIGNED);<NEW_LINE>return 0;<NEW_LINE>} else if (op == CS_OPS_CDHASH) {<NEW_LINE>byte[] cdhash = new byte[length];<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>cdhash[i] = (byte) (i + 0x10);<NEW_LINE>}<NEW_LINE>addr.write(0, cdhash, 0, length);<NEW_LINE>return 0;<NEW_LINE>} else {<NEW_LINE>log.info("csops pid=" + pid + ", op=" + op + ", addr=" + addr + ", length=" + length);<NEW_LINE>Log log = LogFactory.getLog(AbstractEmulator.class);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>emulator.attach().debug();<NEW_LINE>}<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>}
op = context.getIntArg(1);
793,013
public WordprocessingMLPackage createSmartArtDocx(PageSizePaper sz, boolean landscape, MarginsWellKnown margins, Document xml) throws Exception {<NEW_LINE>// Make a basic docx<NEW_LINE>WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage(sz, landscape);<NEW_LINE>// Layout part<NEW_LINE>DiagramLayoutPart layout = new DiagramLayoutPart();<NEW_LINE>layout.setJaxbElement(diagramLayoutObj);<NEW_LINE>DiagramColorsPart colors = new DiagramColorsPart();<NEW_LINE>colors.unmarshal("colorsDef-accent1_2.xml");<NEW_LINE>// colors.CreateMinimalContent("mycolors");<NEW_LINE>DiagramStylePart style = new DiagramStylePart();<NEW_LINE>style.unmarshal("quickStyle-simple1.xml");<NEW_LINE>// style.CreateMinimalContent("mystyle");<NEW_LINE>// DiagramDataPart<NEW_LINE>DiagramDataPart data = new DiagramDataPart();<NEW_LINE>// otherwise we need to pass pkg around<NEW_LINE>data.setPackage(wordMLPackage);<NEW_LINE>data.setJaxbElement(createDiagramData(data, xml));<NEW_LINE>String layoutRelId = wordMLPackage.getMainDocumentPart().addTargetPart(layout).getId();<NEW_LINE>String dataRelId = wordMLPackage.getMainDocumentPart().addTargetPart(data).getId();<NEW_LINE>String colorsRelId = wordMLPackage.getMainDocumentPart().addTargetPart(colors).getId();<NEW_LINE>String styleRelId = wordMLPackage.getMainDocumentPart().addTargetPart(style).getId();<NEW_LINE>// Occupy entire page, less margins<NEW_LINE>PageDimensions pd = new PageDimensions();<NEW_LINE>pd.setPgSize(sz, landscape);<NEW_LINE><MASK><NEW_LINE>pd.setMargins(margins);<NEW_LINE>String cx = "" + UnitsOfMeasurement.twipToEMU(// "5486400";<NEW_LINE>pgSz.getW().intValue() - (pd.getPgMar().getLeft().intValue() + pd.getPgMar().getRight().intValue()));<NEW_LINE>String cy = "" + UnitsOfMeasurement.twipToEMU(// "3200400";<NEW_LINE>pgSz.getH().intValue() - (pd.getPgMar().getTop().intValue() + pd.getPgMar().getBottom().intValue()));<NEW_LINE>// Now use it in the docx<NEW_LINE>wordMLPackage.getMainDocumentPart().addObject(createSmartArt(layoutRelId, dataRelId, colorsRelId, styleRelId, cx, cy));<NEW_LINE>return wordMLPackage;<NEW_LINE>}
PgSz pgSz = pd.getPgSz();
1,661,138
private static void allocateRoutingNodes(Map<String, Map<Integer, String>> shardNodes, Map<String, Map<String, IntIndexedContainer>> locations) {<NEW_LINE>for (Map.Entry<String, Map<String, IntIndexedContainer>> indicesByNodeId : locations.entrySet()) {<NEW_LINE>String nodeId = indicesByNodeId.getKey();<NEW_LINE>for (Map.Entry<String, IntIndexedContainer> shardsByIndexEntry : indicesByNodeId.getValue().entrySet()) {<NEW_LINE><MASK><NEW_LINE>IntIndexedContainer shards = shardsByIndexEntry.getValue();<NEW_LINE>Map<Integer, String> shardsOnIndex = shardNodes.get(index);<NEW_LINE>if (shardsOnIndex == null) {<NEW_LINE>shardsOnIndex = new HashMap<>(shards.size());<NEW_LINE>shardNodes.put(index, shardsOnIndex);<NEW_LINE>for (IntCursor id : shards) {<NEW_LINE>shardsOnIndex.put(id.value, nodeId);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (IntCursor id : shards) {<NEW_LINE>String allocatedNodeId = shardsOnIndex.get(id.value);<NEW_LINE>assert allocatedNodeId == null || allocatedNodeId.equals(nodeId) : "allocatedNodeId must match nodeId";<NEW_LINE>shardsOnIndex.put(id.value, nodeId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
String index = shardsByIndexEntry.getKey();
1,495,398
private boolean shouldHideFromRecent(TaskInfo taskInfo) throws RemoteException {<NEW_LINE>Intent intent = taskInfo.baseIntent;<NEW_LINE>if (intent == null) {<NEW_LINE>XLog.d("isVisibleRecentTask, intent is null for task: %s", taskInfo);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String <MASK><NEW_LINE>if (pkgName == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (ObjectsUtils.equals(ThanosManagerNative.getDefault().getActivityStackSupervisor().getCurrentFrontApp(), pkgName)) {<NEW_LINE>XLog.d("isVisibleRecentTask, %s is current top, won't check.", pkgName);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int setting = ThanosManagerNative.getDefault().getActivityManager().getRecentTaskExcludeSettingForPackage(pkgName);<NEW_LINE>boolean res = setting == github.tornaco.android.thanos.core.app.ActivityManager.ExcludeRecentSetting.EXCLUDE;<NEW_LINE>XLog.d("isVisibleRecentTask hidden? %s %s", pkgName, res);<NEW_LINE>return res;<NEW_LINE>}
pkgName = PkgUtils.packageNameOf(intent);
587,915
private void pollAndNotifyNetworkInterfaceAddress() {<NEW_LINE>Collection<CidrAddress> newInterfaceAddresses = getAllInterfaceAddresses();<NEW_LINE>if (networkAddressChangeListeners.isEmpty()) {<NEW_LINE>// no listeners listening, just update<NEW_LINE>lastKnownInterfaceAddresses = newInterfaceAddresses;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Look for added addresses to notify<NEW_LINE>List<CidrAddress> added = newInterfaceAddresses.stream().filter(newInterfaceAddr -> !lastKnownInterfaceAddresses.contains(newInterfaceAddr)).collect(Collectors.toList());<NEW_LINE>// Look for removed addresses to notify<NEW_LINE>List<CidrAddress> removed = lastKnownInterfaceAddresses.stream().filter(lastKnownInterfaceAddr -> !newInterfaceAddresses.contains(lastKnownInterfaceAddr)).<MASK><NEW_LINE>lastKnownInterfaceAddresses = newInterfaceAddresses;<NEW_LINE>if (!added.isEmpty() || !removed.isEmpty()) {<NEW_LINE>LOGGER.debug("added {} network interfaces: {}", added.size(), Arrays.deepToString(added.toArray()));<NEW_LINE>LOGGER.debug("removed {} network interfaces: {}", removed.size(), Arrays.deepToString(removed.toArray()));<NEW_LINE>notifyListeners(added, removed);<NEW_LINE>}<NEW_LINE>}
collect(Collectors.toList());
1,553,623
public DescribeInstanceAttributeResult describeInstanceAttribute(DescribeInstanceAttributeRequest describeInstanceAttributeRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeInstanceAttributeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeInstanceAttributeRequest> request = null;<NEW_LINE>Response<DescribeInstanceAttributeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeInstanceAttributeRequestMarshaller().marshall(describeInstanceAttributeRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<DescribeInstanceAttributeResult, <MASK><NEW_LINE>JsonResponseHandler<DescribeInstanceAttributeResult> responseHandler = new JsonResponseHandler<DescribeInstanceAttributeResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
JsonUnmarshallerContext> unmarshaller = new DescribeInstanceAttributeResultJsonUnmarshaller();
1,146,939
@Produces({ "application/html", "application/javascript" })<NEW_LINE>@Path("search")<NEW_LINE>public Response searchPage(@Context final HttpServletRequest request, @Context final HttpServletResponse response, @QueryParam("path") final String path, @QueryParam("live") final Boolean liveQueryParam, @QueryParam("onlyLiveSites") final boolean onlyLiveSites) throws DotDataException, DotSecurityException {<NEW_LINE>final InitDataObject initData = webResource.init(null, request, response, true, null);<NEW_LINE>final <MASK><NEW_LINE>final boolean live = (liveQueryParam == null) ? PageMode.get(request).showLive : liveQueryParam;<NEW_LINE>final String esQuery = getPageByPathESQuery(path);<NEW_LINE>final ESSearchResults esresult = esapi.esSearch(esQuery, live, user, live);<NEW_LINE>final Set<Map<String, Object>> contentletMaps = applyFilters(onlyLiveSites, esresult).stream().map(contentlet -> {<NEW_LINE>try {<NEW_LINE>return ContentletUtil.getContentPrintableMap(user, contentlet);<NEW_LINE>} catch (DotDataException | IOException e) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}).filter(Objects::nonNull).collect(Collectors.toSet());<NEW_LINE>return Response.ok(new ResponseEntityView(contentletMaps)).build();<NEW_LINE>}
User user = initData.getUser();
1,844,064
public static boolean isSideInvisible(@Nonnull IColoredBlock block, @Nonnull BlockState state, @Nonnull BlockState adjacentBlockState, @Nonnull Direction side) {<NEW_LINE><MASK><NEW_LINE>if (adjacentBlock instanceof BlockPlasticTransparent || adjacentBlock instanceof BlockPlasticTransparentSlab || adjacentBlock instanceof BlockPlasticTransparentStairs) {<NEW_LINE>IColoredBlock plastic = ((IColoredBlock) adjacentBlock);<NEW_LINE>if (plastic.getColor() == block.getColor()) {<NEW_LINE>try {<NEW_LINE>VoxelShape shape = state.getShape(null, null);<NEW_LINE>VoxelShape adjacentShape = adjacentBlockState.getShape(null, null);<NEW_LINE>VoxelShape faceShape = shape.getFaceShape(side);<NEW_LINE>VoxelShape adjacentFaceShape = adjacentShape.getFaceShape(side.getOpposite());<NEW_LINE>return !Shapes.joinIsNotEmpty(faceShape, adjacentFaceShape, BooleanOp.ONLY_FIRST);<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>// Something might have errored due to the null world and position<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
Block adjacentBlock = adjacentBlockState.getBlock();
980,150
public void addView(String name, Icon icon, String description, JComponent view, boolean closable) {<NEW_LINE>if (tabs == null) {<NEW_LINE>if (firstView == null) {<NEW_LINE>firstView = view;<NEW_LINE>firstName = name;<NEW_LINE>firstIcon = icon;<NEW_LINE>firstDescription = description;<NEW_LINE>firstClosable = closable;<NEW_LINE>component.add(view, BorderLayout.CENTER);<NEW_LINE>fireChanged();<NEW_LINE>} else {<NEW_LINE>component.remove(firstView);<NEW_LINE>tabs = <MASK><NEW_LINE>tabs.setShowsTabPopup(showsTabPopup);<NEW_LINE>tabs.addTab(firstName, firstIcon, createViewport(firstView), firstDescription, firstClosable);<NEW_LINE>tabs.addTab(name, icon, createViewport(view), description, closable);<NEW_LINE>component.add(tabs, BorderLayout.CENTER);<NEW_LINE>firstView = null;<NEW_LINE>firstName = null;<NEW_LINE>firstIcon = null;<NEW_LINE>firstDescription = null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>tabs.addTab(name, icon, createViewport(view), description, closable);<NEW_LINE>}<NEW_LINE>fireViewAdded(view);<NEW_LINE>}
createTabs(tabPlacement, tabLayoutPolicy, minimizeOuterMargin);
660,205
public void paintIcon(Component comp, Graphics originalGraphics, int x, int y) {<NEW_LINE>if (myImageFilters == null || myImageFilters.length == 0) {<NEW_LINE>Graphics2D g = (Graphics2D) originalGraphics.create();<NEW_LINE>GraphicsConfig config = GraphicsUtil.setupAAPainting(g);<NEW_LINE>paintIcon(g, x, y);<NEW_LINE>config.restore();<NEW_LINE>g.dispose();<NEW_LINE>} else {<NEW_LINE>Image image = new BufferedImage(getIconWidthIgnoreAutosize(), getIconWidthIgnoreAutosize(), BufferedImage.TYPE_INT_ARGB);<NEW_LINE>Graphics2D g = ((BufferedImage) image).createGraphics();<NEW_LINE>GraphicsConfig <MASK><NEW_LINE>paintIcon(g, 0, 0);<NEW_LINE>for (Supplier<ImageFilter> filter : myImageFilters) {<NEW_LINE>image = ImageUtil.filter(image, filter.get());<NEW_LINE>}<NEW_LINE>config.restore();<NEW_LINE>g.dispose();<NEW_LINE>originalGraphics.drawImage(image, x, y, null);<NEW_LINE>}<NEW_LINE>}
config = GraphicsUtil.setupAAPainting(g);
1,744,032
public void main() {<NEW_LINE>mgPosition.assign(maPosition);<NEW_LINE>mgNormal.assign(maNormal);<NEW_LINE>mgTextureCoord.assign(maTextureCoord);<NEW_LINE>if (mUseVertexColors) {<NEW_LINE>mgColor.assign(maVertexColor);<NEW_LINE>} else {<NEW_LINE>mgColor.assign(muColor);<NEW_LINE>}<NEW_LINE>// -- do fragment stuff<NEW_LINE>boolean hasSkeletalAnimation = false;<NEW_LINE>for (int i = 0; i < mShaderFragments.size(); i++) {<NEW_LINE>IShaderFragment fragment = mShaderFragments.get(i);<NEW_LINE>if (fragment.getInsertLocation() == PluginInsertLocation.POST_TRANSFORM) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>fragment.setStringBuilder(mShaderSB);<NEW_LINE>fragment.main();<NEW_LINE>if (fragment.getShaderId().equals(SkeletalAnimationVertexShaderFragment.SHADER_ID)) {<NEW_LINE>hasSkeletalAnimation = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasSkeletalAnimation) {<NEW_LINE>RMat4 transfMatrix = (RMat4) getGlobal(SkeletalAnimationShaderVar.G_BONE_TRANSF_MATRIX);<NEW_LINE>GL_POSITION.assign(muMVPMatrix.multiply(transfMatrix).multiply(mgPosition));<NEW_LINE>mvNormal.assign(normalize(muNormalMatrix.multiply(castMat3(transfMatrix)).multiply(mgNormal)));<NEW_LINE>} else {<NEW_LINE>GL_POSITION.assign(muMVPMatrix.multiply(mgPosition));<NEW_LINE>mvNormal.assign(normalize(muNormalMatrix.multiply(mgNormal)));<NEW_LINE>}<NEW_LINE>mvTextureCoord.assign(mgTextureCoord);<NEW_LINE>if (mHasCubeMaps) {<NEW_LINE>mvCubeTextureCoord.assign(castVec3(maPosition));<NEW_LINE>if (mHasSkyTexture) {<NEW_LINE>mvCubeTextureCoord.x().assignMultiply(-1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mvColor.assign(mgColor);<NEW_LINE>mvEyeDir.assign(castVec3(<MASK><NEW_LINE>for (int i = 0; i < mShaderFragments.size(); i++) {<NEW_LINE>IShaderFragment fragment = mShaderFragments.get(i);<NEW_LINE>if (fragment.getInsertLocation() == PluginInsertLocation.POST_TRANSFORM) {<NEW_LINE>fragment.setStringBuilder(mShaderSB);<NEW_LINE>fragment.main();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
muModelViewMatrix.multiply(mgPosition)));
632,037
public Annotation createAnnotation() {<NEW_LINE>PluginException.reportDeprecatedUsage("AnnotationBuilder#createAnnotation", "Use `#create()` instead");<NEW_LINE>if (range == null) {<NEW_LINE>range = myCurrentElement.getTextRange();<NEW_LINE>}<NEW_LINE>if (tooltip == null && message != null) {<NEW_LINE>tooltip = XmlStringUtil.wrapInHtml(XmlStringUtil.escapeString(message));<NEW_LINE>}<NEW_LINE>// noinspection deprecation<NEW_LINE>Annotation annotation = new Annotation(range.getStartOffset(), range.getEndOffset(), severity, message, tooltip);<NEW_LINE>if (needsUpdateOnTyping != null) {<NEW_LINE>annotation.setNeedsUpdateOnTyping(needsUpdateOnTyping);<NEW_LINE>}<NEW_LINE>if (highlightType != null) {<NEW_LINE>annotation.setHighlightType(highlightType);<NEW_LINE>}<NEW_LINE>if (textAttributesKey != null) {<NEW_LINE>annotation.setTextAttributes(textAttributesKey);<NEW_LINE>}<NEW_LINE>if (enforcedAttributes != null) {<NEW_LINE>annotation.setEnforcedTextAttributes(enforcedAttributes);<NEW_LINE>}<NEW_LINE>if (problemGroup != null) {<NEW_LINE>annotation.setProblemGroup(problemGroup);<NEW_LINE>}<NEW_LINE>if (gutterIconRenderer != null) {<NEW_LINE>annotation.setGutterIconRenderer(gutterIconRenderer);<NEW_LINE>}<NEW_LINE>if (fileLevel != null) {<NEW_LINE>annotation.setFileLevelAnnotation(fileLevel);<NEW_LINE>}<NEW_LINE>if (afterEndOfLine != null) {<NEW_LINE>annotation.setAfterEndOfLine(afterEndOfLine);<NEW_LINE>}<NEW_LINE>if (fixes != null) {<NEW_LINE>for (FixB fb : fixes) {<NEW_LINE>IntentionAction fix = fb.fix;<NEW_LINE>TextRange finalRange = fb.range == null ? this.range : fb.range;<NEW_LINE>if (fb.batch != null && fb.batch) {<NEW_LINE>registerBatchFix(annotation, fix, finalRange, fb.key);<NEW_LINE>} else if (fb.universal != null && fb.universal) {<NEW_LINE>registerBatchFix(annotation, fix, finalRange, fb.key);<NEW_LINE>annotation.registerFix(<MASK><NEW_LINE>} else {<NEW_LINE>annotation.registerFix(fix, finalRange, fb.key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>myHolder.add(annotation);<NEW_LINE>myHolder.annotationCreatedFrom(this);<NEW_LINE>return annotation;<NEW_LINE>}
fix, finalRange, fb.key);
1,241,007
private Node createFileAnnotationNode(FileAnnotationViewModel annotation) {<NEW_LINE>GridPane node = new GridPane();<NEW_LINE>ColumnConstraints firstColumn = new ColumnConstraints();<NEW_LINE>ColumnConstraints secondColumn = new ColumnConstraints();<NEW_LINE>firstColumn.setPercentWidth(70);<NEW_LINE>secondColumn.setPercentWidth(30);<NEW_LINE>firstColumn.setHalignment(HPos.LEFT);<NEW_LINE>secondColumn.setHalignment(HPos.RIGHT);<NEW_LINE>node.getColumnConstraints().addAll(firstColumn, secondColumn);<NEW_LINE>Label marking = new Label(annotation.getMarking());<NEW_LINE>Label author = new Label(annotation.getAuthor());<NEW_LINE>Label date = new Label(annotation.getDate());<NEW_LINE>Label page = new Label(Localization.lang("Page") + ": " + annotation.getPage());<NEW_LINE>marking.setStyle("-fx-font-size: 0.75em; -fx-font-weight: bold");<NEW_LINE>marking.setMaxHeight(30);<NEW_LINE>Tooltip markingTooltip = new Tooltip(annotation.getMarking());<NEW_LINE>markingTooltip.setMaxWidth(800);<NEW_LINE>markingTooltip.setWrapText(true);<NEW_LINE>marking.setTooltip(markingTooltip);<NEW_LINE>// add alignment for text in the list<NEW_LINE>marking.setTextAlignment(TextAlignment.LEFT);<NEW_LINE>marking.setAlignment(Pos.TOP_LEFT);<NEW_LINE>marking.setMaxWidth(500);<NEW_LINE>marking.setWrapText(true);<NEW_LINE>author.setTextAlignment(TextAlignment.LEFT);<NEW_LINE>author.setAlignment(Pos.TOP_LEFT);<NEW_LINE>date.setTextAlignment(TextAlignment.RIGHT);<NEW_LINE>date.setAlignment(Pos.TOP_RIGHT);<NEW_LINE>page.setTextAlignment(TextAlignment.RIGHT);<NEW_LINE>page.setAlignment(Pos.TOP_RIGHT);<NEW_LINE>node.add(marking, 0, 0);<NEW_LINE>node.add(author, 0, 1);<NEW_LINE>node.<MASK><NEW_LINE>node.add(page, 1, 1);<NEW_LINE>return node;<NEW_LINE>}
add(date, 1, 0);
337,170
public void marshall(CreateHyperParameterTuningJobRequest createHyperParameterTuningJobRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createHyperParameterTuningJobRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createHyperParameterTuningJobRequest.getHyperParameterTuningJobName(), HYPERPARAMETERTUNINGJOBNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createHyperParameterTuningJobRequest.getHyperParameterTuningJobConfig(), HYPERPARAMETERTUNINGJOBCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createHyperParameterTuningJobRequest.getTrainingJobDefinitions(), TRAININGJOBDEFINITIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createHyperParameterTuningJobRequest.getWarmStartConfig(), WARMSTARTCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(createHyperParameterTuningJobRequest.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
createHyperParameterTuningJobRequest.getTrainingJobDefinition(), TRAININGJOBDEFINITION_BINDING);
1,106,853
public void read(org.apache.thrift.protocol.TProtocol iprot, echoBool_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TField schemeField;<NEW_LINE>iprot.readStructBegin();<NEW_LINE>while (true) {<NEW_LINE>schemeField = iprot.readFieldBegin();<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>switch(schemeField.id) {<NEW_LINE>case // ARG<NEW_LINE>1:<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {<NEW_LINE>struct.arg = iprot.readBool();<NEW_LINE>struct.setArgIsSet(true);<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.<MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>iprot.readFieldEnd();<NEW_LINE>}<NEW_LINE>iprot.readStructEnd();<NEW_LINE>// check for required fields of primitive type, which can't be checked in the validate method<NEW_LINE>if (!struct.isSetArg()) {<NEW_LINE>throw new org.apache.thrift.protocol.TProtocolException("Required field 'arg' was not found in serialized data! Struct: " + toString());<NEW_LINE>}<NEW_LINE>struct.validate();<NEW_LINE>}
skip(iprot, schemeField.type);
191,843
private static Map<Integer, String> make() {<NEW_LINE>final Map<Integer, String> map = new HashMap<>(0);<NEW_LINE>map.put(HttpURLConnection.HTTP_OK, "OK");<NEW_LINE>map.put(HttpURLConnection.HTTP_CREATED, "Created");<NEW_LINE>map.put(HttpURLConnection.HTTP_ACCEPTED, "Accepted");<NEW_LINE>map.put(HttpURLConnection.HTTP_NOT_AUTHORITATIVE, "Non-Authoritative Information");<NEW_LINE>map.put(HttpURLConnection.HTTP_NO_CONTENT, "No Content");<NEW_LINE>map.put(HttpURLConnection.HTTP_RESET, "Reset Content");<NEW_LINE>map.<MASK><NEW_LINE>map.put(HttpURLConnection.HTTP_MULT_CHOICE, "Multiple Choices");<NEW_LINE>map.put(HttpURLConnection.HTTP_MOVED_PERM, "Moved Permanently");<NEW_LINE>map.put(HttpURLConnection.HTTP_MOVED_TEMP, "Found");<NEW_LINE>map.put(HttpURLConnection.HTTP_SEE_OTHER, "See Other");<NEW_LINE>map.put(HttpURLConnection.HTTP_NOT_MODIFIED, "Not Modified");<NEW_LINE>map.put(HttpURLConnection.HTTP_USE_PROXY, "Use Proxy");<NEW_LINE>map.put(HttpURLConnection.HTTP_BAD_REQUEST, "Bad Request");<NEW_LINE>map.put(HttpURLConnection.HTTP_UNAUTHORIZED, "Unauthorized");<NEW_LINE>map.put(HttpURLConnection.HTTP_PAYMENT_REQUIRED, "Payment Required");<NEW_LINE>map.put(HttpURLConnection.HTTP_FORBIDDEN, "Forbidden");<NEW_LINE>map.put(HttpURLConnection.HTTP_NOT_FOUND, "Not Found");<NEW_LINE>map.put(HttpURLConnection.HTTP_BAD_METHOD, "Method Not Allowed");<NEW_LINE>map.put(HttpURLConnection.HTTP_NOT_ACCEPTABLE, "Not Acceptable");<NEW_LINE>map.put(HttpURLConnection.HTTP_PROXY_AUTH, "Proxy Authentication Required");<NEW_LINE>map.put(HttpURLConnection.HTTP_CLIENT_TIMEOUT, "Request Timeout");<NEW_LINE>map.put(HttpURLConnection.HTTP_CONFLICT, "Conflict");<NEW_LINE>map.put(HttpURLConnection.HTTP_GONE, "Gone");<NEW_LINE>map.put(HttpURLConnection.HTTP_LENGTH_REQUIRED, "Length Required");<NEW_LINE>map.put(HttpURLConnection.HTTP_PRECON_FAILED, "Precondition Failed");<NEW_LINE>map.put(HttpURLConnection.HTTP_ENTITY_TOO_LARGE, "Payload Too Large");<NEW_LINE>map.put(HttpURLConnection.HTTP_REQ_TOO_LONG, "URI Too Long");<NEW_LINE>map.put(HttpURLConnection.HTTP_UNSUPPORTED_TYPE, "Unsupported Media Type");<NEW_LINE>map.put(HttpURLConnection.HTTP_INTERNAL_ERROR, "Internal Server Error");<NEW_LINE>map.put(HttpURLConnection.HTTP_NOT_IMPLEMENTED, "Not Implemented");<NEW_LINE>map.put(HttpURLConnection.HTTP_BAD_GATEWAY, "Bad Gateway");<NEW_LINE>map.put(HttpURLConnection.HTTP_UNAVAILABLE, "Service Unavailable");<NEW_LINE>map.put(HttpURLConnection.HTTP_GATEWAY_TIMEOUT, "Gateway Timeout");<NEW_LINE>map.put(HttpURLConnection.HTTP_VERSION, "HTTP Version Not Supported");<NEW_LINE>return map;<NEW_LINE>}
put(HttpURLConnection.HTTP_PARTIAL, "Partial Content");
66,025
public static <K> KStreamHolder<K> build(final KStreamHolder<K> left, final KTableHolder<K> right, final StreamTableJoin<K> join, final RuntimeBuildContext buildContext, final JoinedFactory joinedFactory) {<NEW_LINE>final Formats leftFormats = join.getInternalFormats();<NEW_LINE>final QueryContext queryContext = join.getProperties().getQueryContext();<NEW_LINE>final QueryContext.Stacker stacker = <MASK><NEW_LINE>final LogicalSchema leftSchema = left.getSchema();<NEW_LINE>final PhysicalSchema leftPhysicalSchema = PhysicalSchema.from(leftSchema, leftFormats.getKeyFeatures(), leftFormats.getValueFeatures());<NEW_LINE>final Serde<GenericRow> leftSerde = buildContext.buildValueSerde(leftFormats.getValueFormat(), leftPhysicalSchema, stacker.push(SERDE_CTX).getQueryContext());<NEW_LINE>final Serde<K> keySerde = left.getExecutionKeyFactory().buildKeySerde(leftFormats.getKeyFormat(), leftPhysicalSchema, queryContext);<NEW_LINE>final Joined<K, GenericRow, GenericRow> joined = joinedFactory.create(keySerde, leftSerde, null, StreamsUtil.buildOpName(queryContext));<NEW_LINE>final LogicalSchema rightSchema = right.getSchema();<NEW_LINE>final JoinParams joinParams = JoinParamsFactory.create(join.getKeyColName(), leftSchema, rightSchema);<NEW_LINE>final KStream<K, GenericRow> result;<NEW_LINE>switch(join.getJoinType()) {<NEW_LINE>case LEFT:<NEW_LINE>result = left.getStream().leftJoin(right.getTable(), joinParams.getJoiner(), joined);<NEW_LINE>break;<NEW_LINE>case INNER:<NEW_LINE>result = left.getStream().join(right.getTable(), joinParams.getJoiner(), joined);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("invalid join type");<NEW_LINE>}<NEW_LINE>return left.withStream(result, joinParams.getSchema());<NEW_LINE>}
QueryContext.Stacker.of(queryContext);
903,810
public void sendNotification(Check check, Subscription subscription, List<Alert> alerts) throws NotificationFailedException {<NEW_LINE>String token = subscription.getTarget();<NEW_LINE><MASK><NEW_LINE>List<String> tags = Lists.newArrayList(Splitter.on(',').omitEmptyStrings().trimResults().split(seyrenConfig.getFlowdockTags()));<NEW_LINE>List<String> emojis = Lists.newArrayList(Splitter.on(',').omitEmptyStrings().trimResults().split(seyrenConfig.getFlowdockEmojis()));<NEW_LINE>String url = String.format("%s/v1/messages/chat/%s", baseUrl, token);<NEW_LINE>HttpClient client = HttpClientBuilder.create().useSystemProperties().build();<NEW_LINE>HttpPost post = new HttpPost(url);<NEW_LINE>post.addHeader("Content-Type", "application/json");<NEW_LINE>post.addHeader("accept", "application/json");<NEW_LINE>ObjectMapper mapper = new ObjectMapper();<NEW_LINE>Map<String, Object> dataToSend = new HashMap<String, Object>();<NEW_LINE>dataToSend.put("content", formatContent(emojis, check, subscription, alerts));<NEW_LINE>dataToSend.put("external_user_name", externalUsername);<NEW_LINE>dataToSend.put("tags", formatTags(tags, check, subscription, alerts));<NEW_LINE>try {<NEW_LINE>String data = StringEscapeUtils.unescapeJava(mapper.writeValueAsString(dataToSend));<NEW_LINE>post.setEntity(new StringEntity(data, APPLICATION_JSON));<NEW_LINE>client.execute(post);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.warn("Error posting to Flowdock", e);<NEW_LINE>} finally {<NEW_LINE>post.releaseConnection();<NEW_LINE>HttpClientUtils.closeQuietly(client);<NEW_LINE>}<NEW_LINE>}
String externalUsername = seyrenConfig.getFlowdockExternalUsername();
452,620
public static float distance(int mx, int my, int x, int y, int width, int height) {<NEW_LINE>if (inside(mx, my, x, y, width, height)) {<NEW_LINE>return 0;<NEW_LINE>} else {<NEW_LINE>if (mx > x && mx < x + width) {<NEW_LINE>return Math.min(Math.abs(my - y), Math.abs(my - (y + height)));<NEW_LINE>} else if (my > y && my < y + height) {<NEW_LINE>return Math.min(Math.abs(mx - x), Math.abs(mx - (x + width)));<NEW_LINE>} else if (mx <= x && my <= y) {<NEW_LINE>float dx = mx - x;<NEW_LINE>float dy = my - y;<NEW_LINE>return (float) Math.hypot(dx, dy);<NEW_LINE>} else if (mx <= x && my >= y + height) {<NEW_LINE>float dx = mx - x;<NEW_LINE>float dy = my - (y + height);<NEW_LINE>return (float) Math.hypot(dx, dy);<NEW_LINE>} else if (mx >= x + width && my <= y) {<NEW_LINE>float dx = mx - (x + width);<NEW_LINE>float dy = my - y;<NEW_LINE>return (float) Math.hypot(dx, dy);<NEW_LINE>} else if (mx >= x + width && my >= y + height) {<NEW_LINE>float dx <MASK><NEW_LINE>float dy = my - (y + height);<NEW_LINE>return (float) Math.hypot(dx, dy);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
= mx - (x + width);
611,304
public static void main(String[] args) {<NEW_LINE>try {<NEW_LINE>CommandLine cl = parseComandLine(args);<NEW_LINE>FindSCU main = new FindSCU();<NEW_LINE>CLIUtils.configureConnect(main.remote, main.rq, cl);<NEW_LINE>CLIUtils.configureBind(main.<MASK><NEW_LINE>CLIUtils.configure(main.conn, cl);<NEW_LINE>main.remote.setTlsProtocols(main.conn.getTlsProtocols());<NEW_LINE>main.remote.setTlsCipherSuites(main.conn.getTlsCipherSuites());<NEW_LINE>configureServiceClass(main, cl);<NEW_LINE>configureKeys(main, cl);<NEW_LINE>configureOutput(main, cl);<NEW_LINE>configureCancel(main, cl);<NEW_LINE>main.setPriority(CLIUtils.priorityOf(cl));<NEW_LINE>ExecutorService executorService = Executors.newSingleThreadExecutor();<NEW_LINE>ScheduledExecutorService scheduledExecutorService = Executors.newSingleThreadScheduledExecutor();<NEW_LINE>main.device.setExecutor(executorService);<NEW_LINE>main.device.setScheduledExecutor(scheduledExecutorService);<NEW_LINE>try {<NEW_LINE>main.open();<NEW_LINE>List<String> argList = cl.getArgList();<NEW_LINE>if (argList.isEmpty())<NEW_LINE>main.query();<NEW_LINE>else<NEW_LINE>for (String arg : argList) main.query(new File(arg));<NEW_LINE>} finally {<NEW_LINE>main.close();<NEW_LINE>executorService.shutdown();<NEW_LINE>scheduledExecutorService.shutdown();<NEW_LINE>}<NEW_LINE>} catch (ParseException e) {<NEW_LINE>System.err.println("findscu: " + e.getMessage());<NEW_LINE>System.err.println(rb.getString("try"));<NEW_LINE>System.exit(2);<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("findscu: " + e.getMessage());<NEW_LINE>e.printStackTrace();<NEW_LINE>System.exit(2);<NEW_LINE>}<NEW_LINE>}
conn, main.ae, cl);
1,120,871
private Format1Charset readFormat1Charset(CFFDataInput dataInput, int format, int nGlyphs, boolean isCIDFont) throws IOException {<NEW_LINE>Format1Charset charset = new Format1Charset(isCIDFont);<NEW_LINE>charset.format = format;<NEW_LINE>if (isCIDFont) {<NEW_LINE>charset.addCID(0, 0);<NEW_LINE>charset.rangesCID2GID = new ArrayList<RangeMapping>();<NEW_LINE>} else {<NEW_LINE>charset.addSID(0, 0, ".notdef");<NEW_LINE>}<NEW_LINE>for (int gid = 1; gid < nGlyphs; gid++) {<NEW_LINE>int rangeFirst = dataInput.readSID();<NEW_LINE><MASK><NEW_LINE>if (!isCIDFont) {<NEW_LINE>for (int j = 0; j < 1 + rangeLeft; j++) {<NEW_LINE>int sid = rangeFirst + j;<NEW_LINE>charset.addSID(gid + j, sid, readString(sid));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>charset.rangesCID2GID.add(new RangeMapping(gid, rangeFirst, rangeLeft));<NEW_LINE>}<NEW_LINE>gid += rangeLeft;<NEW_LINE>}<NEW_LINE>return charset;<NEW_LINE>}
int rangeLeft = dataInput.readCard8();
370,624
private Menu createMenu(ToolItem toolItem) {<NEW_LINE>if (menu != null) {<NEW_LINE>menu.dispose();<NEW_LINE>}<NEW_LINE>{<NEW_LINE>MenuManager menuManager = new MenuManager();<NEW_LINE>ToolBar toolBar = toolItem.getParent();<NEW_LINE>menu = new Menu(toolBar);<NEW_LINE>List<StreamValueManagerDescriptor> managers = new ArrayList<>(streamManagers.keySet());<NEW_LINE>managers.sort(Comparator.comparing(StreamValueManagerDescriptor::getLabel));<NEW_LINE>for (StreamValueManagerDescriptor manager : managers) {<NEW_LINE>final CommandContributionItemParameter parameters = new CommandContributionItemParameter(valueController.getValueSite(), manager.getId(), ResultSetHandlerSwitchContentViewer.COMMAND_ID, CommandContributionItem.STYLE_RADIO);<NEW_LINE>parameters.parameters = Map.of(ResultSetHandlerSwitchContentViewer.<MASK><NEW_LINE>menuManager.add(new CommandContributionItem(parameters));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>streamEditor.contributeSettings(menuManager, editorControl);<NEW_LINE>} catch (DBCException e) {<NEW_LINE>log.error(e);<NEW_LINE>}<NEW_LINE>for (IContributionItem item : menuManager.getItems()) {<NEW_LINE>item.fill(menu, -1);<NEW_LINE>}<NEW_LINE>toolBar.addDisposeListener(e -> menu.dispose());<NEW_LINE>}<NEW_LINE>for (MenuItem item : menu.getItems()) {<NEW_LINE>if (item.getData() instanceof StreamValueManagerDescriptor) {<NEW_LINE>item.setSelection(item.getData() == curStreamManager);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return menu;<NEW_LINE>}
PARAM_STREAM_MANAGER_ID, manager.getId());
887,344
public void required_createPublisher3MustProduceAStreamOfExactly3Elements() throws Throwable {<NEW_LINE>activePublisherTest(3, true, new PublisherTestRun<T>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(Publisher<T> pub) throws InterruptedException {<NEW_LINE>ManualSubscriber<T> sub = env.newManualSubscriber(pub);<NEW_LINE>assertTrue(requestNextElementOrEndOfStream(pub, sub).isDefined(), String.format("Publisher %s produced no elements", pub));<NEW_LINE>assertTrue(requestNextElementOrEndOfStream(pub, sub).isDefined(), String<MASK><NEW_LINE>assertTrue(requestNextElementOrEndOfStream(pub, sub).isDefined(), String.format("Publisher %s produced only 2 elements", pub));<NEW_LINE>sub.requestEndOfStream();<NEW_LINE>}<NEW_LINE><NEW_LINE>Optional<T> requestNextElementOrEndOfStream(Publisher<T> pub, ManualSubscriber<T> sub) throws InterruptedException {<NEW_LINE>return sub.requestNextElementOrEndOfStream(String.format("Timeout while waiting for next element from Publisher %s", pub));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
.format("Publisher %s produced only 1 element", pub));
1,217,737
private ImageResource iconForSourceItem(SourceItem sourceItem) {<NEW_LINE>// check for bookdown xref<NEW_LINE>if (sourceItem.hasXRef()) {<NEW_LINE>XRef xref = sourceItem.getXRef();<NEW_LINE>ImageResource icon = iconForXRef(xref);<NEW_LINE>if (icon != null)<NEW_LINE>return icon;<NEW_LINE>}<NEW_LINE>// compute image<NEW_LINE>ImageResource image = null;<NEW_LINE>switch(sourceItem.getType()) {<NEW_LINE>case SourceItem.FUNCTION:<NEW_LINE>image = new ImageResource2x(StandardIcons.INSTANCE.functionLetter2x());<NEW_LINE>break;<NEW_LINE>case SourceItem.METHOD:<NEW_LINE>image = new ImageResource2x(StandardIcons.INSTANCE.methodLetter2x());<NEW_LINE>break;<NEW_LINE>case SourceItem.CLASS:<NEW_LINE>image = new ImageResource2x(<MASK><NEW_LINE>break;<NEW_LINE>case SourceItem.ENUM:<NEW_LINE>image = new ImageResource2x(CodeIcons.INSTANCE.enumType2x());<NEW_LINE>break;<NEW_LINE>case SourceItem.ENUM_VALUE:<NEW_LINE>image = new ImageResource2x(CodeIcons.INSTANCE.enumValue2x());<NEW_LINE>break;<NEW_LINE>case SourceItem.NAMESPACE:<NEW_LINE>image = new ImageResource2x(CodeIcons.INSTANCE.namespace2x());<NEW_LINE>break;<NEW_LINE>case SourceItem.SECTION:<NEW_LINE>image = new ImageResource2x(CodeIcons.INSTANCE.section2x());<NEW_LINE>break;<NEW_LINE>case SourceItem.NONE:<NEW_LINE>default:<NEW_LINE>image = new ImageResource2x(CodeIcons.INSTANCE.keyword2x());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return image;<NEW_LINE>}
CodeIcons.INSTANCE.clazz2x());
1,303,505
public XMLEventReader readSubtree() throws XMLStreamException, FileNotFoundException, ServiceXmlDeserializationException {<NEW_LINE>if (!this.isStartElement()) {<NEW_LINE>throw new ServiceXmlDeserializationException("The current position is not the start of an element.");<NEW_LINE>}<NEW_LINE>XMLEventReader eventReader = null;<NEW_LINE>InputStream in = null;<NEW_LINE>XMLEvent startEvent = this.presentEvent;<NEW_LINE>XMLEvent event = startEvent;<NEW_LINE>StringBuilder str = new StringBuilder();<NEW_LINE>str.append(startEvent);<NEW_LINE>do {<NEW_LINE>event = this.xmlReader.nextEvent();<NEW_LINE>str.append(event);<NEW_LINE>} while (!checkEndElement(startEvent, event));<NEW_LINE>try {<NEW_LINE>XMLInputFactory inputFactory = XMLInputFactory.newInstance();<NEW_LINE>try {<NEW_LINE>in = new ByteArrayInputStream(str.toString().getBytes("UTF-8"));<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>LOG.error(e);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error(e);<NEW_LINE>}<NEW_LINE>return eventReader;<NEW_LINE>}
eventReader = inputFactory.createXMLEventReader(in);
673,453
public void addRemovalTimeById(String processInstanceId, Date removalTime) {<NEW_LINE>CommandContext commandContext = Context.getCommandContext();<NEW_LINE>commandContext.getHistoricActivityInstanceManager().addRemovalTimeToActivityInstancesByProcessInstanceId(processInstanceId, removalTime);<NEW_LINE>commandContext.getHistoricTaskInstanceManager().addRemovalTimeToTaskInstancesByProcessInstanceId(processInstanceId, removalTime);<NEW_LINE>commandContext.getHistoricVariableInstanceManager().addRemovalTimeToVariableInstancesByProcessInstanceId(processInstanceId, removalTime);<NEW_LINE>commandContext.getHistoricDetailManager().addRemovalTimeToDetailsByProcessInstanceId(processInstanceId, removalTime);<NEW_LINE>commandContext.getHistoricIncidentManager().addRemovalTimeToIncidentsByProcessInstanceId(processInstanceId, removalTime);<NEW_LINE>commandContext.getHistoricExternalTaskLogManager().addRemovalTimeToExternalTaskLogByProcessInstanceId(processInstanceId, removalTime);<NEW_LINE>commandContext.getHistoricJobLogManager().addRemovalTimeToJobLogByProcessInstanceId(processInstanceId, removalTime);<NEW_LINE>commandContext.getOperationLogManager().addRemovalTimeToUserOperationLogByProcessInstanceId(processInstanceId, removalTime);<NEW_LINE>commandContext.getHistoricIdentityLinkManager().addRemovalTimeToIdentityLinkLogByProcessInstanceId(processInstanceId, removalTime);<NEW_LINE>commandContext.getCommentManager().addRemovalTimeToCommentsByProcessInstanceId(processInstanceId, removalTime);<NEW_LINE>commandContext.getAttachmentManager().addRemovalTimeToAttachmentsByProcessInstanceId(processInstanceId, removalTime);<NEW_LINE>commandContext.getByteArrayManager(<MASK><NEW_LINE>if (isEnableHistoricInstancePermissions()) {<NEW_LINE>commandContext.getAuthorizationManager().addRemovalTimeToAuthorizationsByProcessInstanceId(processInstanceId, removalTime);<NEW_LINE>}<NEW_LINE>Map<String, Object> parameters = new HashMap<>();<NEW_LINE>parameters.put("processInstanceId", processInstanceId);<NEW_LINE>parameters.put("removalTime", removalTime);<NEW_LINE>getDbEntityManager().updatePreserveOrder(HistoricProcessInstanceEventEntity.class, "updateHistoricProcessInstanceByProcessInstanceId", parameters);<NEW_LINE>}
).addRemovalTimeToByteArraysByProcessInstanceId(processInstanceId, removalTime);
204,772
public void generateWriter(JBlock body, JExpression parcel, JVar flags, ASTType type, JExpression getExpression, JDefinedClass parcelableClass, JVar writeIdentitySet) {<NEW_LINE>if (!(type instanceof ASTArrayType)) {<NEW_LINE>throw new ParcelerRuntimeException("Input type not an array");<NEW_LINE>}<NEW_LINE>ASTArrayType arrayType = (ASTArrayType) type;<NEW_LINE>ASTType componentType = arrayType.getComponentType();<NEW_LINE>JClass <MASK><NEW_LINE>JConditional nullConditional = body._if(getExpression.eq(JExpr._null()));<NEW_LINE>nullConditional._then().invoke(parcel, "writeInt").arg(JExpr.lit(-1));<NEW_LINE>JBlock writeBody = nullConditional._else();<NEW_LINE>writeBody.invoke(parcel, "writeInt").arg(getExpression.ref("length"));<NEW_LINE>JForEach forEach = writeBody.forEach(componentRef, namer.generateName(componentRef), getExpression);<NEW_LINE>ReadWriteGenerator generator = generators.getGenerator(componentType);<NEW_LINE>generator.generateWriter(forEach.body(), parcel, flags, componentType, forEach.var(), parcelableClass, writeIdentitySet);<NEW_LINE>}
componentRef = generationUtil.ref(componentType);
1,346,353
public float[] findHorizontalSeparators(float minRowHeight) {<NEW_LINE>boolean foundShorter = false;<NEW_LINE>List<Integer> horizontalSeparators = new ArrayList<>();<NEW_LINE>for (Ruling r : area.getHorizontalRulings()) {<NEW_LINE>System.out.println(r.length() / this.textBounds.getWidth());<NEW_LINE>if (r.length() / this.textBounds.getWidth() >= 0.95) {<NEW_LINE>horizontalSeparators.add(toFixed(r.getPosition() - this.areaTop));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<Integer> seps = findSeparatorsFromProjection(filter(getFirstDeriv(this.verticalProjection), 0.1f));<NEW_LINE>for (Integer foundSep : seps) {<NEW_LINE>for (Integer explicitSep : horizontalSeparators) {<NEW_LINE>if (Math.abs(toDouble(foundSep - explicitSep)) <= minRowHeight) {<NEW_LINE>foundShorter = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!foundShorter) {<NEW_LINE>horizontalSeparators.add(foundSep);<NEW_LINE>}<NEW_LINE>foundShorter = false;<NEW_LINE>}<NEW_LINE>Collections.sort(horizontalSeparators);<NEW_LINE>float[] rv = new <MASK><NEW_LINE>for (int i = 0; i < rv.length; i++) {<NEW_LINE>rv[i] = (float) toDouble(horizontalSeparators.get(i));<NEW_LINE>}<NEW_LINE>return rv;<NEW_LINE>}
float[horizontalSeparators.size()];
204,688
public // =============<NEW_LINE>void functionScore(OperatorCall<DuplicateHostCQ> queryLambda, ScoreFunctionCall<ScoreFunctionCreator<DuplicateHostCQ>> functionsLambda, final ConditionOptionCall<FunctionScoreQueryBuilder> opLambda) {<NEW_LINE>DuplicateHostCQ cq = new DuplicateHostCQ();<NEW_LINE>queryLambda.callback(cq);<NEW_LINE>final Collection<FilterFunctionBuilder> <MASK><NEW_LINE>if (functionsLambda != null) {<NEW_LINE>functionsLambda.callback((cqLambda, scoreFunctionBuilder) -> {<NEW_LINE>DuplicateHostCQ cf = new DuplicateHostCQ();<NEW_LINE>cqLambda.callback(cf);<NEW_LINE>list.add(new FilterFunctionBuilder(cf.getQuery(), scoreFunctionBuilder));<NEW_LINE>});<NEW_LINE>}<NEW_LINE>final FunctionScoreQueryBuilder builder = regFunctionScoreQ(cq.getQuery(), list);<NEW_LINE>if (opLambda != null) {<NEW_LINE>opLambda.callback(builder);<NEW_LINE>}<NEW_LINE>}
list = new ArrayList<>();
1,254,640
public void build(BuildProducer<FeatureBuildItem> feature, BuildProducer<GeneratedResourceBuildItem> resourceBuildItemBuildProducer, BuildProducer<NativeImageResourceBuildItem> nativeImageResources, OpenApiFilteredIndexViewBuildItem openApiFilteredIndexViewBuildItem, Capabilities capabilities, List<AddToOpenAPIDefinitionBuildItem> openAPIBuildItems, HttpRootPathBuildItem httpRootPathBuildItem, OutputTargetBuildItem out, SmallRyeOpenApiConfig openApiConfig, Optional<ResteasyJaxrsConfigBuildItem> resteasyJaxrsConfig, OutputTargetBuildItem outputTargetBuildItem, List<IgnoreStaticDocumentBuildItem> ignoreStaticDocumentBuildItems) throws Exception {<NEW_LINE>FilteredIndexView index = openApiFilteredIndexViewBuildItem.getIndex();<NEW_LINE>feature.produce(new FeatureBuildItem(Feature.SMALLRYE_OPENAPI));<NEW_LINE>List<Pattern> urlIgnorePatterns = new ArrayList<>();<NEW_LINE>for (IgnoreStaticDocumentBuildItem isdbi : ignoreStaticDocumentBuildItems) {<NEW_LINE>urlIgnorePatterns.add(isdbi.getUrlIgnorePattern());<NEW_LINE>}<NEW_LINE>OpenAPI staticModel = generateStaticModel(openApiConfig, urlIgnorePatterns, outputTargetBuildItem.getOutputDirectory());<NEW_LINE>OpenAPI annotationModel;<NEW_LINE>if (shouldScanAnnotations(capabilities, index)) {<NEW_LINE>annotationModel = generateAnnotationModel(index, capabilities, httpRootPathBuildItem, resteasyJaxrsConfig);<NEW_LINE>} else {<NEW_LINE>annotationModel = new OpenAPIImpl();<NEW_LINE>}<NEW_LINE>OpenApiDocument finalDocument = loadDocument(staticModel, annotationModel, openAPIBuildItems);<NEW_LINE>for (Format format : Format.values()) {<NEW_LINE>String name = OpenApiConstants.BASE_NAME + format;<NEW_LINE>byte[] schemaDocument = OpenApiSerializer.serialize(finalDocument.get(), format).getBytes(StandardCharsets.UTF_8);<NEW_LINE>resourceBuildItemBuildProducer.produce(new GeneratedResourceBuildItem(name, schemaDocument));<NEW_LINE>nativeImageResources.produce(new NativeImageResourceBuildItem(name));<NEW_LINE>}<NEW_LINE>// Store the document if needed<NEW_LINE>boolean shouldStore <MASK><NEW_LINE>if (shouldStore) {<NEW_LINE>storeDocument(out, openApiConfig, staticModel, annotationModel, openAPIBuildItems);<NEW_LINE>}<NEW_LINE>}
= openApiConfig.storeSchemaDirectory.isPresent();
714,603
private void registerPushMonitorPoint() {<NEW_LINE>tpsMonitorManager.registerTpsControlPoint(new TpsMonitorPoint(TpsMonitorItem<MASK><NEW_LINE>tpsMonitorManager.registerTpsControlPoint(new TpsMonitorPoint(TpsMonitorItem.NAMING_RPC_PUSH_SUCCESS.name()));<NEW_LINE>tpsMonitorManager.registerTpsControlPoint(new TpsMonitorPoint(TpsMonitorItem.NAMING_RPC_PUSH_FAIL.name()));<NEW_LINE>tpsMonitorManager.registerTpsControlPoint(new TpsMonitorPoint(TpsMonitorItem.NAMING_UDP_PUSH.name()));<NEW_LINE>tpsMonitorManager.registerTpsControlPoint(new TpsMonitorPoint(TpsMonitorItem.NAMING_UDP_PUSH_SUCCESS.name()));<NEW_LINE>tpsMonitorManager.registerTpsControlPoint(new TpsMonitorPoint(TpsMonitorItem.NAMING_UDP_PUSH_FAIL.name()));<NEW_LINE>}
.NAMING_RPC_PUSH.name()));
120,988
protected void configure() {<NEW_LINE>List<Class<?>> classes = finder.findAnnotatedTypes(Plugin.class);<NEW_LINE>List<Class<?>> interfaces = new ArrayList<MASK><NEW_LINE>List<Class<?>> unusedInterfaces;<NEW_LINE>// Find plugin interfaces<NEW_LINE>for (Class<?> c : classes) {<NEW_LINE>if (c.isInterface()) {<NEW_LINE>interfaces.add(c);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>unusedInterfaces = new ArrayList<Class<?>>(interfaces);<NEW_LINE>// Find plugin implementations<NEW_LINE>for (Class<?> c : classes) {<NEW_LINE>if (c.isInterface())<NEW_LINE>continue;<NEW_LINE>for (Class<?> intf : interfaces) {<NEW_LINE>if (intf.isAssignableFrom(c)) {<NEW_LINE>// Ugly hack to enable dynamic binding... Can this be done type-safely?<NEW_LINE>Multibinder<Object> binder = (Multibinder<Object>) findBinder(intf);<NEW_LINE>binder.addBinding().to(c);<NEW_LINE>unusedInterfaces.remove(intf);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// TODO: Unused plugin interfaces should be bound to an empty set - how?<NEW_LINE>}
<Class<?>>();
1,641,178
// ////<NEW_LINE>@Override<NEW_LINE>public void onCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) {<NEW_LINE>super.onCharacteristicChanged(gatt, characteristic);<NEW_LINE>try {<NEW_LINE>String charString = characteristic<MASK><NEW_LINE>String service = characteristic.getService().getUuid().toString();<NEW_LINE>NotifyBufferContainer buffer = this.bufferedCharacteristics.get(this.bufferedCharacteristicsKey(service, charString));<NEW_LINE>byte[] dataValue = characteristic.getValue();<NEW_LINE>if (buffer != null) {<NEW_LINE>buffer.put(dataValue);<NEW_LINE>// Log.d(BleManager.LOG_TAG, "onCharacteristicChanged-buffering: " +<NEW_LINE>// buffer.size() + " from peripheral: " + device.getAddress());<NEW_LINE>if (buffer.size().equals(buffer.maxCount)) {<NEW_LINE>Log.d(BleManager.LOG_TAG, "onCharacteristicChanged sending buffered data " + buffer.size());<NEW_LINE>// send'm and reset<NEW_LINE>dataValue = buffer.items.array();<NEW_LINE>buffer.resetBuffer();<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Log.d(BleManager.LOG_TAG, "onCharacteristicChanged: " + BleManager.bytesToHex(dataValue) + " from peripheral: " + device.getAddress());<NEW_LINE>WritableMap map = Arguments.createMap();<NEW_LINE>map.putString("peripheral", device.getAddress());<NEW_LINE>map.putString("characteristic", charString);<NEW_LINE>map.putString("service", service);<NEW_LINE>map.putArray("value", BleManager.bytesToWritableArray(dataValue));<NEW_LINE>sendEvent("BleManagerDidUpdateValueForCharacteristic", map);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.d(BleManager.LOG_TAG, "onCharacteristicChanged ERROR: " + e.toString());<NEW_LINE>}<NEW_LINE>}
.getUuid().toString();
1,197,926
public static List<Inter> intersectedInters(List<? extends Inter> inters, GeoOrder order, Rectangle box) {<NEW_LINE>List<Inter> <MASK><NEW_LINE>int xMax = (box.x + box.width) - 1;<NEW_LINE>int yMax = (box.y + box.height) - 1;<NEW_LINE>for (Inter inter : inters) {<NEW_LINE>if (inter.isRemoved()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Rectangle iBox = inter.getBounds();<NEW_LINE>if (box.intersects(iBox)) {<NEW_LINE>found.add(inter);<NEW_LINE>} else if ((order == BY_ABSCISSA) && (iBox.x > xMax)) {<NEW_LINE>break;<NEW_LINE>} else if ((order == BY_ORDINATE) && (iBox.y > yMax)) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return found;<NEW_LINE>}
found = new ArrayList<>();
1,621,611
private void onRender2D(Render2DEvent event) {<NEW_LINE>for (Entity entity : mc.world.getEntities()) {<NEW_LINE>UUID ownerUuid;<NEW_LINE>if (entity instanceof TameableEntity)<NEW_LINE>ownerUuid = ((TameableEntity) entity).getOwnerUuid();<NEW_LINE>else if (entity instanceof HorseBaseEntity)<NEW_LINE>ownerUuid = ((HorseBaseEntity) entity).getOwnerUuid();<NEW_LINE>else if (entity instanceof ProjectileEntity && projectiles.get())<NEW_LINE>ownerUuid = ((<MASK><NEW_LINE>else<NEW_LINE>continue;<NEW_LINE>if (ownerUuid != null) {<NEW_LINE>pos.set(entity, event.tickDelta);<NEW_LINE>pos.add(0, entity.getEyeHeight(entity.getPose()) + 0.75, 0);<NEW_LINE>if (NametagUtils.to2D(pos, scale.get())) {<NEW_LINE>renderNametag(getOwnerName(ownerUuid));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ProjectileEntityAccessor) entity).getOwnerUuid();
1,846,118
public NamePatternRec parseNamePattern(MetaClass metaClass) {<NEW_LINE>Map attributes = (Map) metaClass.getAnnotations().get(<MASK><NEW_LINE>if (attributes == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String pattern = (String) attributes.get("value");<NEW_LINE>if (StringUtils.isBlank(pattern)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int pos = pattern.indexOf("|");<NEW_LINE>if (pos < 0) {<NEW_LINE>throw new DevelopmentException("Invalid name pattern: " + pattern);<NEW_LINE>}<NEW_LINE>String format = StringUtils.substring(pattern, 0, pos);<NEW_LINE>String trimmedFormat = format.trim();<NEW_LINE>String methodName = trimmedFormat.startsWith("#") ? trimmedFormat.substring(1) : null;<NEW_LINE>String fieldsStr = StringUtils.substring(pattern, pos + 1);<NEW_LINE>String[] fields = Arrays.stream(INSTANCE_NAME_SPLIT_PATTERN.split(fieldsStr)).map(String::trim).toArray(String[]::new);<NEW_LINE>return new NamePatternRec(format, methodName, fields);<NEW_LINE>}
NamePattern.class.getName());
1,308,885
void draw(Graphics g) {<NEW_LINE>int state = isCurrent() ? SELECTED : UNSELECTED;<NEW_LINE>g.setColor(tabColor[state]);<NEW_LINE>// if (notification) {<NEW_LINE>// g.setColor(errorColor);<NEW_LINE>// }<NEW_LINE>Graphics2D g2 = (Graphics2D) g;<NEW_LINE>g2.fill(Toolkit.createRoundRect(left, TAB_TOP, right, TAB_BOTTOM, 0, 0, isLast() ? CURVE_RADIUS : 0, isFirst() ? CURVE_RADIUS : 0));<NEW_LINE>if (hasIcon()) {<NEW_LINE>Image icon = (isCurrent(<MASK><NEW_LINE>g.drawImage(icon, left + MARGIN, ICON_TOP, ICON_WIDTH, ICON_HEIGHT, null);<NEW_LINE>}<NEW_LINE>int textLeft = getTextLeft();<NEW_LINE>if (notification && state == UNSELECTED) {<NEW_LINE>g.setColor(textColor[SELECTED]);<NEW_LINE>} else {<NEW_LINE>g.setColor(textColor[state]);<NEW_LINE>}<NEW_LINE>int tabHeight = TAB_BOTTOM - TAB_TOP;<NEW_LINE>int baseline = TAB_TOP + (tabHeight + fontAscent) / 2;<NEW_LINE>g.drawString(name, textLeft, baseline);<NEW_LINE>}
) || notification) ? selectedIcon : enabledIcon;
956,916
public void initialize(WizardDescriptor wizard) {<NEW_LINE>wiz = wizard;<NEW_LINE>project = Templates.getProject(wiz);<NEW_LINE>SourceGroup[] sourceGroups = SourceGroups.getJavaSourceGroups(project);<NEW_LINE>// create the Java Project chooser<NEW_LINE>if (sourceGroups.length == 0) {<NEW_LINE>SourceGroup[] genericSourceGroups = ProjectUtils.getSources(project).getSourceGroups(Sources.TYPE_GENERIC);<NEW_LINE>firstPanel = new FinishableProxyWizardPanel(Templates.createSimpleTargetChooser(project, genericSourceGroups, new BottomPanel()), sourceGroups, false);<NEW_LINE>} else {<NEW_LINE>firstPanel = new FinishableProxyWizardPanel(JavaTemplates.createPackageChooser(project, sourceGroups, new BottomPanel(), true));<NEW_LINE>}<NEW_LINE>JComponent c = (JComponent) firstPanel.getComponent();<NEW_LINE>// NOI18N<NEW_LINE>Utils.changeLabelInComponent(c, NbBundle.getMessage(MessageHandlerWizard.class, "LBL_JavaTargetChooserPanelGUI_ClassName_Label"), NbBundle.getMessage<MASK><NEW_LINE>c.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, HANDLER_STEPS);<NEW_LINE>c.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, 0);<NEW_LINE>c.getAccessibleContext().setAccessibleDescription(HANDLER_STEPS[0]);<NEW_LINE>wizardPanels = new WizardDescriptor.Panel[] { firstPanel };<NEW_LINE>}
(MessageHandlerWizard.class, "LBL_Handler_Name"));
1,418,821
private static String generateColumnCardinalitySql(Dialect dialect, String schema, String table, String column) {<NEW_LINE>final StringBuilder buf = new StringBuilder();<NEW_LINE>String exprString = dialect.quoteIdentifier(column);<NEW_LINE>if (dialect.allowsCountDistinct()) {<NEW_LINE>// e.g. "select count(distinct product_id) from product"<NEW_LINE>buf.append("select count(distinct ").append(exprString).append(") from ");<NEW_LINE>dialect.quoteIdentifier(buf, schema, table);<NEW_LINE>return buf.toString();<NEW_LINE>} else if (dialect.allowsFromQuery()) {<NEW_LINE>// Some databases (e.g. Access) don't like 'count(distinct)',<NEW_LINE>// so use, e.g., "select count(*) from (select distinct<NEW_LINE>// product_id from product)"<NEW_LINE>buf.append("select count(*) from (select distinct ").append(exprString).append(" from ");<NEW_LINE>dialect.<MASK><NEW_LINE>buf.append(")");<NEW_LINE>if (dialect.requiresAliasForFromQuery()) {<NEW_LINE>if (dialect.allowsAs()) {<NEW_LINE>buf.append(" as ");<NEW_LINE>} else {<NEW_LINE>buf.append(' ');<NEW_LINE>}<NEW_LINE>dialect.quoteIdentifier(buf, "init");<NEW_LINE>}<NEW_LINE>return buf.toString();<NEW_LINE>} else {<NEW_LINE>// Cannot compute cardinality: this database neither supports COUNT<NEW_LINE>// DISTINCT nor SELECT in the FROM clause.<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
quoteIdentifier(buf, schema, table);
1,748,806
private static IborIndex parseIborIndex(CsvRow row) {<NEW_LINE>String name = row.getValue(NAME_FIELD);<NEW_LINE>Currency currency = Currency.parse(row.getValue(CURRENCY_FIELD));<NEW_LINE>boolean active = Boolean.parseBoolean(row.getValue(ACTIVE_FIELD));<NEW_LINE>DayCount dayCount = DayCount.of(row.getValue(DAY_COUNT_FIELD));<NEW_LINE>HolidayCalendarId fixingCal = HolidayCalendarId.of(row.getValue(FIXING_CALENDAR_FIELD));<NEW_LINE>int offsetDays = Integer.parseInt(row.getValue(OFFSET_DAYS_FIELD));<NEW_LINE>HolidayCalendarId offsetCal = HolidayCalendarId.of(row.getValue(OFFSET_CALENDAR_FIELD));<NEW_LINE>HolidayCalendarId effectiveCal = HolidayCalendarId.of(row.getValue(EFFECTIVE_DATE_CALENDAR_FIELD));<NEW_LINE>Tenor tenor = Tenor.parse(row.getValue(TENOR_FIELD));<NEW_LINE>LocalTime time = LocalTime.parse(row.getValue(FIXING_TIME_FIELD), TIME_FORMAT);<NEW_LINE>ZoneId zoneId = ZoneId.of(row.getValue(FIXING_ZONE_FIELD));<NEW_LINE>DayCount fixedLegDayCount = DayCount.of<MASK><NEW_LINE>// interpret CSV<NEW_LINE>DaysAdjustment fixingOffset = DaysAdjustment.ofBusinessDays(-offsetDays, offsetCal, BusinessDayAdjustment.of(PRECEDING, fixingCal)).normalized();<NEW_LINE>DaysAdjustment effectiveOffset = DaysAdjustment.ofBusinessDays(offsetDays, offsetCal, BusinessDayAdjustment.of(FOLLOWING, effectiveCal)).normalized();<NEW_LINE>// convention can be two different things<NEW_LINE>PeriodAdditionConvention periodAdditionConvention = PeriodAdditionConvention.extendedEnum().find(row.getField(TENOR_CONVENTION_FIELD)).orElse(PeriodAdditionConventions.NONE);<NEW_LINE>BusinessDayConvention tenorBusinessConvention = BusinessDayConvention.extendedEnum().find(row.getField(TENOR_CONVENTION_FIELD)).orElse(isEndOfMonth(periodAdditionConvention) ? MODIFIED_FOLLOWING : FOLLOWING);<NEW_LINE>BusinessDayAdjustment adj = BusinessDayAdjustment.of(tenorBusinessConvention, effectiveCal);<NEW_LINE>TenorAdjustment tenorAdjustment = TenorAdjustment.of(tenor, periodAdditionConvention, adj);<NEW_LINE>// build result<NEW_LINE>return ImmutableIborIndex.builder().name(name).currency(currency).active(active).dayCount(dayCount).fixingCalendar(fixingCal).fixingDateOffset(fixingOffset).effectiveDateOffset(effectiveOffset).maturityDateOffset(tenorAdjustment).fixingTime(time).fixingZone(zoneId).defaultFixedLegDayCount(fixedLegDayCount).build();<NEW_LINE>}
(row.getValue(FIXED_LEG_DAY_COUNT));
1,551,370
private void remember(IType type, ReferenceBinding typeBinding) {<NEW_LINE>if (((CompilationUnit) type.getCompilationUnit()).isOpen()) {<NEW_LINE>try {<NEW_LINE>IGenericType genericType = (IGenericType) ((JavaElement) type).getElementInfo();<NEW_LINE>remember(genericType, typeBinding);<NEW_LINE>} catch (JavaModelException e) {<NEW_LINE>// cannot happen since element is open<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (typeBinding == null)<NEW_LINE>return;<NEW_LINE>boolean isAnonymous = false;<NEW_LINE>try {<NEW_LINE>isAnonymous = type.isAnonymous();<NEW_LINE>} catch (JavaModelException jme) {<NEW_LINE>// Ignore<NEW_LINE>}<NEW_LINE>if (typeBinding instanceof SourceTypeBinding) {<NEW_LINE>TypeDeclaration typeDeclaration = ((SourceTypeBinding) typeBinding).scope.referenceType();<NEW_LINE>// simple super class name<NEW_LINE>char[] superclassName = null;<NEW_LINE>TypeReference superclass;<NEW_LINE>if ((typeDeclaration.bits & ASTNode.IsAnonymousType) != 0) {<NEW_LINE>superclass = typeDeclaration.allocation.type;<NEW_LINE>} else {<NEW_LINE>superclass = typeDeclaration.superclass;<NEW_LINE>}<NEW_LINE>if (superclass != null) {<NEW_LINE>char[][] typeName = superclass.getTypeName();<NEW_LINE>superclassName = typeName == null ? null : typeName[typeName.length - 1];<NEW_LINE>}<NEW_LINE>// simple super interface names<NEW_LINE>char[][] superInterfaceNames = null;<NEW_LINE>TypeReference[] superInterfaces = typeDeclaration.superInterfaces;<NEW_LINE>if (superInterfaces != null) {<NEW_LINE>int length = superInterfaces.length;<NEW_LINE>superInterfaceNames = new char[length][];<NEW_LINE>for (int i = 0; i < length; i += 1) {<NEW_LINE>TypeReference superInterface = superInterfaces[i];<NEW_LINE>char[][] typeName = superInterface.getTypeName();<NEW_LINE>superInterfaceNames[i] = <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>HierarchyType hierarchyType = new HierarchyType(type, typeDeclaration.name, typeDeclaration.binding.modifiers, superclassName, superInterfaceNames, isAnonymous);<NEW_LINE>remember(hierarchyType, typeDeclaration.binding);<NEW_LINE>} else {<NEW_LINE>HierarchyType hierarchyType = new HierarchyType(type, typeBinding.sourceName(), typeBinding.modifiers, typeBinding.superclass().sourceName(), new char[][] { typeBinding.superInterfaces()[0].sourceName() }, isAnonymous);<NEW_LINE>remember(hierarchyType, typeBinding);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
typeName[typeName.length - 1];
307,847
public static <T> Map<String, String> checkConfigProperties(Class<T> configClass) throws InterruptedException {<NEW_LINE>ConfigurableApplicationContext app = SpringApplication.run(configClass, new String[] { "--spring.main.web-application-type=none" });<NEW_LINE>OpenviduConfig config = app.getBean(OpenviduConfig.class);<NEW_LINE>List<Error> errors = config.getConfigErrors();<NEW_LINE>if (!errors.isEmpty()) {<NEW_LINE>// @formatter:off<NEW_LINE>String msg = "\n\n\n" + " Configuration errors\n" + " --------------------\n" + "\n";<NEW_LINE>for (Error error : config.getConfigErrors()) {<NEW_LINE>msg += " * ";<NEW_LINE>if (error.getProperty() != null) {<NEW_LINE>msg += "Property " + config.getPropertyName(error.getProperty());<NEW_LINE>if (error.getValue() == null || error.getValue().equals("")) {<NEW_LINE>msg += " is not set. ";<NEW_LINE>} else {<NEW_LINE>msg += "=" + error.getValue() + ". ";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>msg += error.getMessage() + "\n";<NEW_LINE>}<NEW_LINE>msg += "\n" + "\n" + " Fix config errors\n" + " ---------------\n" + "\n" + " 1) Return to shell pressing Ctrl+C\n" + " 2) Set correct values in '.env' configuration file\n" + " 3) Restart OpenVidu with:\n" + "\n" + " $ ./openvidu restart\n" + "\n";<NEW_LINE>// @formatter:on<NEW_LINE>log.info(msg);<NEW_LINE>// Wait forever<NEW_LINE>new Semaphore(0).acquire();<NEW_LINE>} else {<NEW_LINE>String msg = "\n\n\n" + " Configuration properties\n" + " ------------------------\n" + "\n";<NEW_LINE>final Map<String, String> CONFIG_PROPS = config.getConfigProps();<NEW_LINE>List<String> configPropNames = new ArrayList<>(config.getUserProperties());<NEW_LINE>Collections.sort(configPropNames);<NEW_LINE>for (String property : configPropNames) {<NEW_LINE>String <MASK><NEW_LINE>msg += " * " + config.getPropertyName(property) + "=" + (value == null ? "" : value) + "\n";<NEW_LINE>}<NEW_LINE>msg += "\n\n";<NEW_LINE>log.info(msg);<NEW_LINE>// Close the auxiliary ApplicationContext<NEW_LINE>app.close();<NEW_LINE>return CONFIG_PROPS;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
value = CONFIG_PROPS.get(property);
753,884
public void checkForBuildTimeConfigChange(ConfigRecorder recorder, ConfigurationBuildItem configItem, LoggingSetupBuildItem loggingSetupBuildItem, List<SuppressNonRuntimeConfigChangedWarningBuildItem> suppressNonRuntimeConfigChangedWarningItems) {<NEW_LINE>BuildTimeConfigurationReader.ReadResult readResult = configItem.getReadResult();<NEW_LINE>Config config = ConfigProvider.getConfig();<NEW_LINE>Set<String> excludedConfigKeys = new HashSet<<MASK><NEW_LINE>for (SuppressNonRuntimeConfigChangedWarningBuildItem item : suppressNonRuntimeConfigChangedWarningItems) {<NEW_LINE>excludedConfigKeys.add(item.getConfigKey());<NEW_LINE>}<NEW_LINE>Map<String, String> values = new HashMap<>();<NEW_LINE>for (RootDefinition root : readResult.getAllRoots()) {<NEW_LINE>if (root.getConfigPhase() == ConfigPhase.BUILD_AND_RUN_TIME_FIXED || root.getConfigPhase() == ConfigPhase.BUILD_TIME) {<NEW_LINE>Iterable<ClassDefinition.ClassMember> members = root.getMembers();<NEW_LINE>handleMembers(config, values, members, root.getName() + ".", excludedConfigKeys);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>recorder.handleConfigChange(values);<NEW_LINE>}
>(suppressNonRuntimeConfigChangedWarningItems.size());
132,953
public Dataset open(Assembler a, Resource root, Mode mode) {<NEW_LINE>Resource dataset = GraphUtils.getResourceValue(root, pDataset);<NEW_LINE>Resource index = GraphUtils.getResourceValue(root, pIndex);<NEW_LINE>Resource textDocProducerNode = GraphUtils.getResourceValue(root, pTextDocProducer);<NEW_LINE>Dataset ds = (Dataset) a.open(dataset);<NEW_LINE>TextIndex textIndex = (TextIndex) a.open(index);<NEW_LINE>// Null will use the default producer<NEW_LINE>TextDocProducer textDocProducer = null;<NEW_LINE>if (null != textDocProducerNode) {<NEW_LINE>Class<?> c = ClsLoader.loadClass(textDocProducerNode.getURI(), TextDocProducer.class);<NEW_LINE>String className = textDocProducerNode.getURI().substring(ARQConstants.javaClassURIScheme.length());<NEW_LINE>Constructor<?> dyadic = getConstructor(c, DatasetGraph.class, TextIndex.class);<NEW_LINE>Constructor<?> monadic = getConstructor(c, TextIndex.class);<NEW_LINE>try {<NEW_LINE>if (dyadic != null) {<NEW_LINE>textDocProducer = (TextDocProducer) dyadic.newInstance(ds.asDatasetGraph(), textIndex);<NEW_LINE>} else if (monadic != null) {<NEW_LINE>textDocProducer = (TextDocProducer) monadic.newInstance(textIndex);<NEW_LINE>} else {<NEW_LINE>Log.warn(ClsLoader.class, "Exception during instantiation '" + className + "' no TextIndex or DatasetGraph,Index constructor");<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Log.warn(ClsLoader.class, "Exception during instantiation '" + className + <MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// "true" -> closeIndexOnDSGClose<NEW_LINE>Dataset dst = TextDatasetFactory.create(ds, textIndex, true, textDocProducer);<NEW_LINE>return dst;<NEW_LINE>}
"': " + ex.getMessage());
1,407,403
public void writePlanItemDefinitionSpecificAttributes(ExternalWorkerServiceTask externalWorkerServiceTask, XMLStreamWriter xtw) throws Exception {<NEW_LINE>super.writePlanItemDefinitionSpecificAttributes(externalWorkerServiceTask, xtw);<NEW_LINE><MASK><NEW_LINE>xtw.writeAttribute(FLOWABLE_EXTENSIONS_PREFIX, FLOWABLE_EXTENSIONS_NAMESPACE, ATTRIBUTE_TYPE, ExternalWorkerServiceTask.TYPE);<NEW_LINE>if (!externalWorkerServiceTask.isAsync()) {<NEW_LINE>// Write the exclusive only if not async (otherwise it is added in the TaskExport)<NEW_LINE>xtw.writeAttribute(FLOWABLE_EXTENSIONS_PREFIX, FLOWABLE_EXTENSIONS_NAMESPACE, ATTRIBUTE_IS_EXCLUSIVE, String.valueOf(externalWorkerServiceTask.isExclusive()));<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(externalWorkerServiceTask.getTopic())) {<NEW_LINE>xtw.writeAttribute(FLOWABLE_EXTENSIONS_PREFIX, FLOWABLE_EXTENSIONS_NAMESPACE, ATTRIBUTE_EXTERNAL_WORKER_TOPIC, externalWorkerServiceTask.getTopic());<NEW_LINE>}<NEW_LINE>}
TaskExport.writeCommonTaskAttributes(externalWorkerServiceTask, xtw);
1,655,230
public void onRequestFinish(MegaApiJava api, MegaRequest request, MegaError e) {<NEW_LINE>log.fine("Request finish (" + request.getRequestString() + "); Result: " + e.toString());<NEW_LINE>int requestType = request.getType();<NEW_LINE>if (requestType == MegaRequest.TYPE_LOGIN) {<NEW_LINE>if (e.getErrorCode() != MegaError.API_OK) {<NEW_LINE>String errorMessage = e.getErrorString();<NEW_LINE>if (e.getErrorCode() == MegaError.API_ENOENT) {<NEW_LINE>errorMessage = "Login error: Incorrect email or password!";<NEW_LINE>}<NEW_LINE>log.severe(errorMessage);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>megaApi.fetchNodes(this);<NEW_LINE>} else if (requestType == MegaRequest.TYPE_FETCH_NODES) {<NEW_LINE>this.rootNode = api.getRootNode();<NEW_LINE>} else if (requestType == MegaRequest.TYPE_ACCOUNT_DETAILS) {<NEW_LINE>MegaAccountDetails accountDetails = request.getMegaAccountDetails();<NEW_LINE>log.info("Account details received");<NEW_LINE>log.info("Storage: " + accountDetails.getStorageUsed() + " of " + accountDetails.getStorageMax() + " (" + String.valueOf((int) (100.0 * accountDetails.getStorageUsed() / accountDetails.getStorageMax())) + " %)");<NEW_LINE>log.info(<MASK><NEW_LINE>}<NEW_LINE>// Send the continue event so our synchronised code continues.<NEW_LINE>if (requestType != MegaRequest.TYPE_LOGIN) {<NEW_LINE>synchronized (this.continueEvent) {<NEW_LINE>this.wasSignalled = true;<NEW_LINE>this.continueEvent.notify();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"Pro level: " + accountDetails.getProLevel());
972,626
final DescribeReservedNodesResult executeDescribeReservedNodes(DescribeReservedNodesRequest describeReservedNodesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeReservedNodesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeReservedNodesRequest> request = null;<NEW_LINE>Response<DescribeReservedNodesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeReservedNodesRequestMarshaller().marshall(super.beforeMarshalling(describeReservedNodesRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Redshift");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeReservedNodesResult> responseHandler = new StaxResponseHandler<DescribeReservedNodesResult>(new DescribeReservedNodesResultStaxUnmarshaller());<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, "DescribeReservedNodes");