text:
class EditorCameraController;

class FreeLookComponent : public Component
{
public:
	FreeLookComponent();
	~FreeLookComponent();

	// Inherited via Component
	virtual void InitComponent() override;
	virtual void BeginPlay() override;
	virtual void Update(float delta) override;

private:
	const float BaseTranslateSpeed = 10.0f;
	const float FastTranslateSpeed = 100.0f;
	float TranslateSpeed = 10.0f;
	float LookSensitivty = 0.001f;
	class CameraComponent* CameraComp = nullptr;
	class Camera* Cam = nullptr;
	EditorCameraController* controller = nullptr;
};

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Acme\DemoBundle\Controller;

use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Cookie;
use Acme\DemoBundle\Entity\User;
use Acme\DemoBundle\Form\First;
use Acme\DemoBundle\Form\Second;
use Symfony\Component\DomCrawler\Crawler;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Acme\DemoBundle\Form\ContactType;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Bundle\FrameworkBundle\Templating\Helper\FormHelper;

// these import the "@Route" and "@Template" annotations
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\Request;

class IndexController extends Controller
{
    /**
     * @Route("/", name="index")
     * @Template()
     */
    public function indexAction(Request $request)
    {
        if ($request->cookies->get('symfony_user_registration')) {
            return new RedirectResponse($this->generateUrl('two'));
        }

        $form = $this->createForm(new First(), new User);

        if ($request->isXmlHttpRequest()) {

            $form->bind($request);
            $user = $form->getData();
            //var_dump($user);

            if ($form->isValid()) {
                $em = $this->getDoctrine()->getManager();
                $em->persist($user);
                $em->flush();
                $success = true;
                //$cookie = new Cookie();
                //$this->get('response')->setCookie('symfony_user_registration', $user->getId());
                setcookie('symfony_user_registration', $user->getId());
            } else {
                $success = false;
            }

            $view = $this->render('AcmeDemoBundle:Index:index.html.twig', array(
                'form' => $form->createView(),
                'timer' => $this->getTimer()
            ));

            return new JsonResponse(array(
                'success' => $success,
                'view' => $view->getContent()
            ));
        }
        return array('form' => $form->createView(), 'timer' => $this->getTimer());
    }

    /**
     * @Route("/two", name="two")
     * @Template()
     */
    public function twoAction(Request $request)
    {
        if (!$request->cookies->get('symfony_user_registration')) {
            return new RedirectResponse($this->generateUrl('index'));
        }

        $id = $request->cookies->get('symfony_user_registration');
        $user = $this->getDoctrine()
            ->getRepository('AcmeDemoBundle:User')
            ->find($id);

        $user->setIceCream('');
        $user->setCar('');
        $user->setBook('');
        $user->setDate(new \DateTime());
        $user->setCountry('');

        $form = $this->createForm(new Second(), $user);

        if ($request->isXmlHttpRequest()) {
            $form->bind($request);
            $user = $form->getData();

            if ($form->isValid()) {
                $em = $this->getDoctrine()->getManager();
                $em->persist($user);
                $em->flush();
                $success = true;
            } else {
                $success = false;
            }

            $view = $this->render('AcmeDemoBundle:Index:two.html.twig', array(
                'form' => $form->createView(),
                'timer' => $this->getTimer()
            ));

            return new JsonResponse(array(
                'success' => $success,
                'view' => $view->getContent()
            ));
        }

        return array('form' => $form->createView(), 'timer' => $this->getTimer());
    }

    /**
     * @Route("/three", name="three")
     * @Template()
     */
    public function threeAction()
    {
        $url = 'http://www.gifbin.com/random';
        $browser = $this->container->get('buzz');

        $html = $browser->get($url)->getContent();
        $crawler = new Crawler($html, $url);
        $random_gif = $crawler->filter('img.gif')->attr('src');

        return array('timer' => $this->getTimer(), 'random_gif' => $random_gif);
    }

    /**
     * @return mixed
     */
    private function getTimer()
    {
        $session = new Session();
        $session->start();

        if (!$session->get('timer')) {
            $session->set('timer', time());
        }

        return max(0, $session->get('timer') + 360 - time());
    }
}


text:
FROM node:6.9.1

RUN mkdir /app
WORKDIR /app
ADD ./package.json /app/package.json
RUN npm install

CMD npm start


text:
require('normalize.css');
require('styles/App.css');

import React from 'react';
import Todos from './Todos';

let yeomanImage = require('../images/yeoman.png');

class AppComponent extends React.Component {
  constructor() {
    super();
    this.foo = 'bar';
  }

  render() {
    return (

          <Todos />

    );
  }
}

export default AppComponent;


text:
function addIFrame(host) {
  document.write(['<iframe src="http://', host, ':', location.port,
                  '/extensions/api_test/executescript',
                  '/permissions/empty.html"> </iframe>'].join(''));
}
addIFrame("a.com");
addIFrame("b.com");
addIFrame("c.com");


text:
namespace mojo {

namespace embedder {
class PlatformSharedBufferMapping;
}

namespace system {

class Core;

// Test-only function (defined/used in embedder/test_embedder.cc). Declared here
// so it can be friended.
namespace internal {
bool ShutdownCheckNoLeaks(Core*);
}

// This class provides the (global) table of memory mappings (owned by |Core|),
// which maps mapping base addresses to |PlatformSharedBufferMapping|s.
//
// This class is NOT thread-safe; locking is left to |Core|.
class MOJO_SYSTEM_IMPL_EXPORT MappingTable {
 public:
  MappingTable();
  ~MappingTable();

  // Tries to add a mapping. (Takes ownership of the mapping in all cases; on
  // failure, it will be destroyed.)
  MojoResult AddMapping(
      scoped_ptr<embedder::PlatformSharedBufferMapping> mapping);
  MojoResult RemoveMapping(uintptr_t address);

 private:
  friend bool internal::ShutdownCheckNoLeaks(Core*);

  typedef base::hash_map<uintptr_t, embedder::PlatformSharedBufferMapping*>
      AddressToMappingMap;
  AddressToMappingMap address_to_mapping_map_;

  DISALLOW_COPY_AND_ASSIGN(MappingTable);
};

}  // namespace system
}  // namespace mojo

#endif  // MOJO_SYSTEM_MAPPING_TABLE_H_


text:
package org.kuali.kpme.edo.candidate.delegate;

import org.joda.time.DateTime;

public class EdoChairDelegate {

    private String delegatePrincipalId;
    private String delegatePrincipalName;
    private String delegateFullName;
    private DateTime startDate;
    private DateTime endDate;
    public String getDelegatePrincipalId() {
        return delegatePrincipalId;
    }
    public void setDelegatePrincipalId(String delegatePrincipalId) {
        this.delegatePrincipalId = delegatePrincipalId;
    }
    public String getDelegatePrincipalName() {
        return delegatePrincipalName;
    }
    public void setDelegatePrincipalName(String delegatePrincipalName) {
        this.delegatePrincipalName = delegatePrincipalName;
    }

    public DateTime getStartDate() {
        return startDate;
    }
    public void setStartDate(DateTime startDate) {
        this.startDate = startDate;
    }
    public DateTime getEndDate() {
        return endDate;
    }
    public void setEndDate(DateTime endDate) {
        this.endDate = endDate;
    }
    public String getDelegateFullName() {
        return delegateFullName;
    }
    public void setDelegateFullName(String delegateFullName) {
        this.delegateFullName = delegateFullName;
    }

}


text:
package com.intellij.mock;

import com.intellij.openapi.application.AccessToken;
import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.progress.EmptyProgressIndicator;
import com.intellij.openapi.project.DumbModeTask;
import com.intellij.openapi.project.DumbService;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.ModificationTracker;
import com.intellij.openapi.util.SimpleModificationTracker;
import consulo.disposer.Disposable;
import consulo.disposer.Disposer;

import javax.annotation.Nonnull;

import javax.swing.*;

/**
 * @author yole
 */
@Deprecated
public class MockDumbService extends DumbService {
  private final Project myProject;

  public MockDumbService(Project project) {
    myProject = project;
  }

  @Override
  public ModificationTracker getModificationTracker() {
    return new SimpleModificationTracker();
  }

  @Override
  public boolean isDumb() {
    return false;
  }

  @Override
  public void runWhenSmart(@Nonnull Runnable runnable) {
    runnable.run();
  }

  @Override
  public void waitForSmartMode() {
  }

  @Override
  public void queueTask(@Nonnull DumbModeTask task) {
    task.performInDumbMode(new EmptyProgressIndicator());
    Disposer.dispose(task);
  }

  @Override
  public void cancelTask(@Nonnull DumbModeTask task) {
  }

  @Override
  public void completeJustSubmittedTasks() {
  }

  @Override
  public JComponent wrapGently(@Nonnull JComponent dumbUnawareContent, @Nonnull Disposable parentDisposable) {
    throw new UnsupportedOperationException();
  }

  @Override
  public void showDumbModeNotification(@Nonnull String message) {
    throw new UnsupportedOperationException();
  }

  @Override
  public Project getProject() {
    return myProject;
  }

  @Override
  public void setAlternativeResolveEnabled(boolean enabled) {
  }

  @Override
  public boolean isAlternativeResolveEnabled() {
    return false;
  }

  @Nonnull
  @Override
  public AccessToken startHeavyActivityStarted(@Nonnull String activityName) {
    return AccessToken.EMPTY_ACCESS_TOKEN;
  }

  @Override
  public boolean isSuspendedDumbMode() {
    return false;
  }

  public void smartInvokeLater(@Nonnull final Runnable runnable) {
    runnable.run();
  }

  public void smartInvokeLater(@Nonnull final Runnable runnable, @Nonnull ModalityState modalityState) {
    runnable.run();
  }
}


text:
package apycazo.codex.rest.common.data;

import lombok.Getter;

@Getter
public class ImmutablePair<X,Y> implements Pair<X,Y> {

  private final X key;
  private final Y value;

  ImmutablePair(X key, Y value) {
    this.key = key;
    this.value = value;
  }

  @Override
  public Pair<X, Y> withKey(X key) {
    return new ImmutablePair<>(key, value);
  }

  @Override
  public Pair<X, Y> withValue(Y value) {
    return new ImmutablePair<>(key, value);
  }
}


text:
FOUNDATION_EXPORT double Pods_WLHelpers_ExampleVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_WLHelpers_ExampleVersionString[];


text:
var simplefunc = require('../'),
    assert = require('assert');

// decode defined

assert.ok(simplefunc.decode);
assert.equal(typeof simplefunc.decode, 'function');

var value = 3;
assert.equal(simplefunc.decode(value), value);

var value = "foo";
assert.equal(simplefunc.decode(value), value);

var value = [1,2,3];
assert.equal(simplefunc.decode(value), value);

var value = { a: 1, b: 2 };
assert.equal(simplefunc.decode(value), value);

// decode function

function foo(a, b) {
    return a+b;
};

var coded = simplefunc.encode(foo);
var result = simplefunc.decode(coded);
assert.ok(result);
assert.equal(typeof result, 'function');
assert.equal(result(1,2), 3);

// decode object with function

var obj = { a: 1, b: 2, foo: function (a, b) { return a+b; } };

var coded = simplefunc.encode(obj);
var result = simplefunc.decode(coded);
assert.ok(result);
assert.ok(result.a);
assert.equal(result.a, 1);
assert.ok(result.b);
assert.equal(result.b, 2);
assert.ok(result.foo);
assert.equal(typeof result.foo, 'function');
assert.equal(result.foo(1,2), 3);

// encode null

assert.equal(simplefunc.encode(null), null);

// decode null

assert.equal(simplefunc.decode(null), null);


text:
layout: post
title: Home Made Sex 7 - Scene 1
titleinfo: pornvd
desc: Watch Home Made Sex 7 - Scene 1. Pornhub is the ultimate xxx porn and sex site.
---

Home Made Sex 7 - Scene 1

Watch Home Made Sex 7 - Scene 1. Pornhub is the ultimate xxx porn and sex site.


text:
package me.Swedz.jca.match;

public interface iMatches {
	public String getAllMatches() throws Exception;
	public String getMatch(int matchID) throws Exception;
	public int getUniqueMatchID(int match) throws Exception;
	public void winner(int matchID, String winnerName) throws Exception;
	public void tie(int matchID, String player1, String player2) throws Exception;
}


text:
package org.tinspin.index.test.util;

import java.util.Arrays;
import java.util.Random;

public abstract class AbstractTest {

	protected final Random R;
	protected int DIM;
	protected final double param1;
	protected final double param2;
	protected String paramStr;
	protected final TestStats S;
	//global min/max of data area
	protected double[] globalMin;
	protected double[] globalMax;

	protected AbstractTest(Random R, TestStats S) {
		this.R = R;
		this.S = S;
		this.DIM = S.cfgNDims;
		this.param1 = S.param1;
		this.param2 = S.param2;
		this.paramStr = S.paramStr;
		this.globalMin = new double[DIM];
		this.globalMax = new double[DIM];
		Arrays.fill(globalMin, 0);
		Arrays.fill(globalMax, S.cfgDataLen);
	}

	public int getN() {
		//This may change, for example when exceeding maximum size for
		//CSV, Tiger, OpenStreeMap datasets
		return S.cfgNEntries;
	}

	public final TestStats.TST getTestType() {
		return S.TEST;
	}

	/**
	 *
	 * @return Maximum distance for each update().
	 */
	public double maxUpdateDistance() {
		double d = 0;
		for (int i = 0; i < globalMin.length; i++) {
			if (d < globalMax[i]-globalMin[i]) {
				d = globalMax[i]-globalMin[i];
			}
		}
		return d * 10e-5;
	}

	public abstract double[] generate();
	public abstract double[][] generateUpdates(int n, double[] data, double[][] ups);

	public void log(String str) {
		System.out.println(str);
	}

	public void logWarning(String str) {
		System.err.println(str);
	}

	public TestStats getTestStats() {
		return S;
	}

	public void generateWindowQueries(double[][] lower, double[][] upper) {
		int nEntries = S.cfgNEntries;
		if (nEntries < S.cfgWindowQuerySize*10) {
			//N < 10*000 ? -> N = 100
			nEntries = S.cfgWindowQuerySize*10;
		}

		//find minimum extent (maximum allowable query box size)
		double maxQueryLen = Double.MAX_VALUE;
		//Here is a fixed size version, returning 1% of the space.
		//final double qVolume = 0.01 * Math.pow(cfgDataLen, DIM);//(float) Math.pow(0.1, DIM); //0.01 for DIM=2
		double totalV = 1;
		for (int i = 0; i < DIM; i++) {
			double len = globalMax[i] - globalMin[i];
			totalV *= len;
			maxQueryLen = len < maxQueryLen ? len : maxQueryLen;
		}
		double avgQueryVolume = S.cfgWindowQuerySize/(double)nEntries * totalV;
		//final double avgLen = Math.pow(avgVolume, 1./DIM);
		//final double avgLenVar = 0.5*avgLen;
		//final double minLen = 0.5*avgLen;
		for (int i = 0; i < lower.length; i++) {
			generateQuery(lower[i], upper[i], maxQueryLen, avgQueryVolume);
		}
	}

	/**
	 * Generate query rectangle.
	 * This method should be overwritten by tests that provide
	 * non-standard queries.
	 * @param min output: query box minimum
	 * @param max output: query box maximum
	 * @param maxLen maximum allowed length for a query box in any dimension.
	 * @param avgQVol Average expected volume of a query box
	 */
	public void generateQuery(double[] min, double[] max,
			final double maxLen, final double avgQVol) {
		int dims = DIM;

		//query create cube
		double[] len = new double[min.length];
		int nTries = 0;
		do {
			double vol = 1;
			for (int d = 0; d < dims-1; d++) {
				//calculate the average required len
				final double avgLen = Math.pow(avgQVol/vol, 1./dims);
				//create a len between 0.5 and 1.5 of the required length
				len[d] = (0.5*avgLen) + R.nextDouble()*(avgLen);
				len[d] = len[d] > maxLen*0.99 ? maxLen*0.99 : len[d];
				vol *= len[d];
			}
			//create cuboid/box of desired size by dropping random length
			len[dims-1] = avgQVol/vol;  //now the new len creates a rectangle/box of SIZE.
			if (nTries++ > 100) {
				System.out.println(Arrays.toString(len) + " vol=" + vol + " aVol=" + avgQVol);
				throw new IllegalStateException("dims=" + dims + "  N=" + S.cfgNEntries);
			}
		} while (len[dims-1] >= maxLen); //drop bad rectangles

		shuffle(len);

		//create location
		for (int d = 0; d < dims; d++) {
			min[d] = globalMin[d] + R.nextDouble()*(maxLen-len[d]);
			max[d] = min[d]+len[d];
			if (min[d]+len[d] >= globalMax[d]) {
				//drop bad rectangles
				throw new RuntimeException();
			}
		}
	}

	private void shuffle(double[] da) {
		// Fisher-Yates shuffle
		for (int i = da.length - 1; i > 0; i--) {
			int index = R.nextInt(i + 1);
			double a = da[index];
			da[index] = da[i];
			da[i] = a;
		}
	}

	public double min(int d) {
		return globalMin[d];
	}

	public double max(int d) {
		return globalMax[d];
	}

	public double len(int d) {
		return globalMax[d] - globalMin[d];
	}

}


text:
package com.xmlcalabash.functions;

import com.xmlcalabash.runtime.XCompoundStep;
import com.xmlcalabash.runtime.XStep;
import net.sf.saxon.expr.XPathContext;
import net.sf.saxon.lib.ExtensionFunctionCall;
import net.sf.saxon.lib.ExtensionFunctionDefinition;
import net.sf.saxon.om.Item;
import net.sf.saxon.om.Sequence;
import net.sf.saxon.om.SequenceIterator;
import net.sf.saxon.om.StructuredQName;
import net.sf.saxon.trans.XPathException;
import net.sf.saxon.tree.iter.SingletonIterator;
import net.sf.saxon.tree.tiny.TinyDocumentImpl;
import net.sf.saxon.value.AnyURIValue;
import net.sf.saxon.value.SequenceType;
import com.xmlcalabash.core.XProcConstants;
import com.xmlcalabash.core.XProcRuntime;
import com.xmlcalabash.core.XProcException;

import java.net.URI;
import java.net.URISyntaxException;

//
// The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
// you may not use this file except in compliance with the License. You may obtain a copy of the
// License at http://www.mozilla.org/MPL/
//
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied.
// See the License for the specific language governing rights and limitations under the License.
//
// The Original Code is: all this file.
//
// The Initial Developer of the Original Code is Michael H. Kay.
//
// Portions created by Norman Walsh are Copyright (C) Mark Logic Corporation. All Rights Reserved.
//
// Contributor(s): Norman Walsh.
//

/**
 * Implementation of the XSLT system-property() function
 */

public class ResolveURI extends XProcExtensionFunctionDefinition {
    private static StructuredQName funcname = new StructuredQName("p", XProcConstants.NS_XPROC, "resolve-uri");

    protected ResolveURI() {
        // you can't call this one
    }

    public ResolveURI(XProcRuntime runtime) {
        registry.registerRuntime(this, runtime);
    }

    public StructuredQName getFunctionQName() {
        return funcname;
    }

    public int getMinimumNumberOfArguments() {
        return 1;
    }

    public int getMaximumNumberOfArguments() {
        return 2;
    }

    public SequenceType[] getArgumentTypes() {
        return new SequenceType[]{SequenceType.SINGLE_STRING, SequenceType.OPTIONAL_STRING};
    }

    public SequenceType getResultType(SequenceType[] suppliedArgumentTypes) {
        return SequenceType.SINGLE_ATOMIC;
    }

    public boolean dependsOnFocus() {
        return true;
    }

    public ExtensionFunctionCall makeCallExpression() {
        return new ResolveURICall(this);
    }

    private class ResolveURICall extends ExtensionFunctionCall {
        private XProcExtensionFunctionDefinition xdef = null;

        public ResolveURICall(XProcExtensionFunctionDefinition def) {
            xdef = def;
        }

        public Sequence call(XPathContext xPathContext, Sequence[] sequences) throws XPathException {
            String relativeURI = sequences[0].head().getStringValue();

            XProcRuntime runtime = registry.getRuntime(xdef);
            XStep step = runtime.getXProcData().getStep();
            // FIXME: this can't be the best way to do this...
            // step == null in use-when
            if (step != null && !(step instanceof XCompoundStep)) {
                throw XProcException.dynamicError(23);
            }

            String baseURI = null;
            if (sequences.length > 1) {
                baseURI = sequences[1].head().getStringValue();
            } else {
                baseURI = runtime.getStaticBaseURI().toASCIIString();
                try {
                    // FIXME: TinyDocumentImpl? Surely we can do better than that!
                    Item item = xPathContext.getContextItem();
                    baseURI = ((TinyDocumentImpl) item).getBaseURI();
                } catch (Exception e) {
                    // nop
                }
            }

            // Michael Kay's done the heavy lifting and made the method public, so let's just
            // do that!
            try {
                URI abs = net.sf.saxon.functions.ResolveURI.makeAbsolute(relativeURI, baseURI);
                String resolvedURI = abs.toASCIIString();
                return new AnyURIValue(resolvedURI);
            } catch (URISyntaxException use) {
                throw new XProcException(use);
            }
        }
    }
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.streamanalytics.fluent;

import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.streamanalytics.fluent.models.StreamingJobInner;
import com.azure.resourcemanager.streamanalytics.models.ScaleStreamingJobParameters;
import com.azure.resourcemanager.streamanalytics.models.StartStreamingJobParameters;
import com.azure.resourcemanager.streamanalytics.models.StreamingJobsGetByResourceGroupResponse;
import com.azure.resourcemanager.streamanalytics.models.StreamingJobsUpdateResponse;

/** An instance of this class provides access to all the operations defined in StreamingJobsClient. */
public interface StreamingJobsClient {
    /**
     * Creates a streaming job or replaces an already existing streaming job.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @param streamingJob The definition of the streaming job that will be used to create a new streaming job or
     *     replace the existing one.
     * @param ifMatch The ETag of the streaming job. Omit this value to always overwrite the current record set. Specify
     *     the last-seen ETag value to prevent accidentally overwriting concurrent changes.
     * @param ifNoneMatch Set to '*' to allow a new streaming job to be created, but to prevent updating an existing
     *     record set. Other values will result in a 412 Pre-condition Failed response.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a streaming job object, containing all information associated with the named streaming job.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<StreamingJobInner>, StreamingJobInner> beginCreateOrReplace(
        String resourceGroupName, String jobName, StreamingJobInner streamingJob, String ifMatch, String ifNoneMatch);

    /**
     * Creates a streaming job or replaces an already existing streaming job.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @param streamingJob The definition of the streaming job that will be used to create a new streaming job or
     *     replace the existing one.
     * @param ifMatch The ETag of the streaming job. Omit this value to always overwrite the current record set. Specify
     *     the last-seen ETag value to prevent accidentally overwriting concurrent changes.
     * @param ifNoneMatch Set to '*' to allow a new streaming job to be created, but to prevent updating an existing
     *     record set. Other values will result in a 412 Pre-condition Failed response.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a streaming job object, containing all information associated with the named streaming job.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<StreamingJobInner>, StreamingJobInner> beginCreateOrReplace(
        String resourceGroupName,
        String jobName,
        StreamingJobInner streamingJob,
        String ifMatch,
        String ifNoneMatch,
        Context context);

    /**
     * Creates a streaming job or replaces an already existing streaming job.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @param streamingJob The definition of the streaming job that will be used to create a new streaming job or
     *     replace the existing one.
     * @param ifMatch The ETag of the streaming job. Omit this value to always overwrite the current record set. Specify
     *     the last-seen ETag value to prevent accidentally overwriting concurrent changes.
     * @param ifNoneMatch Set to '*' to allow a new streaming job to be created, but to prevent updating an existing
     *     record set. Other values will result in a 412 Pre-condition Failed response.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a streaming job object, containing all information associated with the named streaming job.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    StreamingJobInner createOrReplace(
        String resourceGroupName, String jobName, StreamingJobInner streamingJob, String ifMatch, String ifNoneMatch);

    /**
     * Creates a streaming job or replaces an already existing streaming job.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @param streamingJob The definition of the streaming job that will be used to create a new streaming job or
     *     replace the existing one.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a streaming job object, containing all information associated with the named streaming job.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    StreamingJobInner createOrReplace(String resourceGroupName, String jobName, StreamingJobInner streamingJob);

    /**
     * Creates a streaming job or replaces an already existing streaming job.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @param streamingJob The definition of the streaming job that will be used to create a new streaming job or
     *     replace the existing one.
     * @param ifMatch The ETag of the streaming job. Omit this value to always overwrite the current record set. Specify
     *     the last-seen ETag value to prevent accidentally overwriting concurrent changes.
     * @param ifNoneMatch Set to '*' to allow a new streaming job to be created, but to prevent updating an existing
     *     record set. Other values will result in a 412 Pre-condition Failed response.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a streaming job object, containing all information associated with the named streaming job.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    StreamingJobInner createOrReplace(
        String resourceGroupName,
        String jobName,
        StreamingJobInner streamingJob,
        String ifMatch,
        String ifNoneMatch,
        Context context);

    /**
     * Updates an existing streaming job. This can be used to partially update (ie. update one or two properties) a
     * streaming job without affecting the rest the job definition.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @param streamingJob A streaming job object. The properties specified here will overwrite the corresponding
     *     properties in the existing streaming job (ie. Those properties will be updated). Any properties that are set
     *     to null here will mean that the corresponding property in the existing input will remain the same and not
     *     change as a result of this PATCH operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a streaming job object, containing all information associated with the named streaming job.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    StreamingJobInner update(String resourceGroupName, String jobName, StreamingJobInner streamingJob);

    /**
     * Updates an existing streaming job. This can be used to partially update (ie. update one or two properties) a
     * streaming job without affecting the rest the job definition.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @param streamingJob A streaming job object. The properties specified here will overwrite the corresponding
     *     properties in the existing streaming job (ie. Those properties will be updated). Any properties that are set
     *     to null here will mean that the corresponding property in the existing input will remain the same and not
     *     change as a result of this PATCH operation.
     * @param ifMatch The ETag of the streaming job. Omit this value to always overwrite the current record set. Specify
     *     the last-seen ETag value to prevent accidentally overwriting concurrent changes.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a streaming job object, containing all information associated with the named streaming job.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    StreamingJobsUpdateResponse updateWithResponse(
        String resourceGroupName, String jobName, StreamingJobInner streamingJob, String ifMatch, Context context);

    /**
     * Deletes a streaming job.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the completion.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginDelete(String resourceGroupName, String jobName);

    /**
     * Deletes a streaming job.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the completion.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginDelete(String resourceGroupName, String jobName, Context context);

    /**
     * Deletes a streaming job.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void delete(String resourceGroupName, String jobName);

    /**
     * Deletes a streaming job.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void delete(String resourceGroupName, String jobName, Context context);

    /**
     * Gets details about the specified streaming job.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return details about the specified streaming job.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    StreamingJobInner getByResourceGroup(String resourceGroupName, String jobName);

    /**
     * Gets details about the specified streaming job.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @param expand The $expand OData query parameter. This is a comma-separated list of additional streaming job
     *     properties to include in the response, beyond the default set returned when this parameter is absent. The
     *     default set is all streaming job properties other than 'inputs', 'transformation', 'outputs', and
     *     'functions'.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return details about the specified streaming job.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    StreamingJobsGetByResourceGroupResponse getByResourceGroupWithResponse(
        String resourceGroupName, String jobName, String expand, Context context);

    /**
     * Lists all of the streaming jobs in the specified resource group.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return object containing a list of streaming jobs.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<StreamingJobInner> listByResourceGroup(String resourceGroupName);

    /**
     * Lists all of the streaming jobs in the specified resource group.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param expand The $expand OData query parameter. This is a comma-separated list of additional streaming job
     *     properties to include in the response, beyond the default set returned when this parameter is absent. The
     *     default set is all streaming job properties other than 'inputs', 'transformation', 'outputs', and
     *     'functions'.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return object containing a list of streaming jobs.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<StreamingJobInner> listByResourceGroup(String resourceGroupName, String expand, Context context);

    /**
     * Lists all of the streaming jobs in the given subscription.
     *
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return object containing a list of streaming jobs.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<StreamingJobInner> list();

    /**
     * Lists all of the streaming jobs in the given subscription.
     *
     * @param expand The $expand OData query parameter. This is a comma-separated list of additional streaming job
     *     properties to include in the response, beyond the default set returned when this parameter is absent. The
     *     default set is all streaming job properties other than 'inputs', 'transformation', 'outputs', and
     *     'functions'.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return object containing a list of streaming jobs.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<StreamingJobInner> list(String expand, Context context);

    /**
     * Starts a streaming job. Once a job is started it will start processing input events and produce output.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @param startJobParameters Parameters applicable to a start streaming job operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the completion.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginStart(
        String resourceGroupName, String jobName, StartStreamingJobParameters startJobParameters);

    /**
     * Starts a streaming job. Once a job is started it will start processing input events and produce output.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @param startJobParameters Parameters applicable to a start streaming job operation.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the completion.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginStart(
        String resourceGroupName, String jobName, StartStreamingJobParameters startJobParameters, Context context);

    /**
     * Starts a streaming job. Once a job is started it will start processing input events and produce output.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @param startJobParameters Parameters applicable to a start streaming job operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void start(String resourceGroupName, String jobName, StartStreamingJobParameters startJobParameters);

    /**
     * Starts a streaming job. Once a job is started it will start processing input events and produce output.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void start(String resourceGroupName, String jobName);

    /**
     * Starts a streaming job. Once a job is started it will start processing input events and produce output.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @param startJobParameters Parameters applicable to a start streaming job operation.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void start(
        String resourceGroupName, String jobName, StartStreamingJobParameters startJobParameters, Context context);

    /**
     * Stops a running streaming job. This will cause a running streaming job to stop processing input events and
     * producing output.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the completion.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginStop(String resourceGroupName, String jobName);

    /**
     * Stops a running streaming job. This will cause a running streaming job to stop processing input events and
     * producing output.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the completion.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginStop(String resourceGroupName, String jobName, Context context);

    /**
     * Stops a running streaming job. This will cause a running streaming job to stop processing input events and
     * producing output.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void stop(String resourceGroupName, String jobName);

    /**
     * Stops a running streaming job. This will cause a running streaming job to stop processing input events and
     * producing output.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void stop(String resourceGroupName, String jobName, Context context);

    /**
     * Scales a streaming job when the job is running.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @param scaleJobParameters Parameters applicable to a scale streaming job operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the completion.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginScale(
        String resourceGroupName, String jobName, ScaleStreamingJobParameters scaleJobParameters);

    /**
     * Scales a streaming job when the job is running.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @param scaleJobParameters Parameters applicable to a scale streaming job operation.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the completion.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginScale(
        String resourceGroupName, String jobName, ScaleStreamingJobParameters scaleJobParameters, Context context);

    /**
     * Scales a streaming job when the job is running.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @param scaleJobParameters Parameters applicable to a scale streaming job operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void scale(String resourceGroupName, String jobName, ScaleStreamingJobParameters scaleJobParameters);

    /**
     * Scales a streaming job when the job is running.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void scale(String resourceGroupName, String jobName);

    /**
     * Scales a streaming job when the job is running.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param jobName The name of the streaming job.
     * @param scaleJobParameters Parameters applicable to a scale streaming job operation.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void scale(
        String resourceGroupName, String jobName, ScaleStreamingJobParameters scaleJobParameters, Context context);
}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Collections;
using System.Diagnostics;

namespace System.Text.Json.Serialization.Converters
{
    internal sealed class DefaultImmutableDictionaryConverter : JsonDictionaryConverter
    {
        public const string ImmutableDictionaryTypeName = "System.Collections.Immutable.ImmutableDictionary";
        public const string ImmutableDictionaryGenericTypeName = "System.Collections.Immutable.ImmutableDictionary`2";
        public const string ImmutableDictionaryGenericInterfaceTypeName = "System.Collections.Immutable.IImmutableDictionary`2";

        public const string ImmutableSortedDictionaryTypeName = "System.Collections.Immutable.ImmutableSortedDictionary";
        public const string ImmutableSortedDictionaryGenericTypeName = "System.Collections.Immutable.ImmutableSortedDictionary`2";

        public static void RegisterImmutableDictionary(Type immutableCollectionType, Type elementType, JsonSerializerOptions options)
        {
            // Get a unique identifier for a delegate which will point to the appropiate CreateRange method.
            string delegateKey = DefaultImmutableEnumerableConverter.GetDelegateKey(immutableCollectionType, elementType, out Type underlyingType, out string constructingTypeName);

            // Exit if we have registered this immutable dictionary type.
            if (options.CreateRangeDelegatesContainsKey(delegateKey))
            {
                return;
            }

            // Get the constructing type.
            Type constructingType = underlyingType.Assembly.GetType(constructingTypeName);

            // Create a delegate which will point to the CreateRange method.
            ImmutableCollectionCreator createRangeDelegate;
            createRangeDelegate = options.MemberAccessorStrategy.ImmutableDictionaryCreateRange(constructingType, immutableCollectionType, elementType);

            // Cache the delegate
            options.TryAddCreateRangeDelegate(delegateKey, createRangeDelegate);
        }

        public static bool IsImmutableDictionary(Type type)
        {
            if (!type.IsGenericType)
            {
                return false;
            }

            switch (type.GetGenericTypeDefinition().FullName)
            {
                case ImmutableDictionaryGenericTypeName:
                case ImmutableDictionaryGenericInterfaceTypeName:
                case ImmutableSortedDictionaryGenericTypeName:
                    return true;
                default:
                    return false;
            }
        }

        public override object CreateFromDictionary(ref ReadStack state, IDictionary sourceDictionary, JsonSerializerOptions options)
        {
            Type immutableCollectionType = state.Current.JsonPropertyInfo.RuntimePropertyType;

            JsonClassInfo elementClassInfo = state.Current.JsonPropertyInfo.ElementClassInfo;
            Type elementType = elementClassInfo.Type;

            string delegateKey = DefaultImmutableEnumerableConverter.GetDelegateKey(immutableCollectionType, elementType, out _, out _);

            JsonPropertyInfo propertyInfo = elementClassInfo.PolicyProperty ?? elementClassInfo.CreateRootObject(options);
            Debug.Assert(propertyInfo != null);
            return propertyInfo.CreateImmutableDictionaryInstance(ref state, immutableCollectionType, delegateKey, sourceDictionary, options);
        }
    }
}


text:
package org.oscm.internal.intf;

import java.util.List;

import javax.ejb.Remote;

import org.oscm.internal.types.exception.ConcurrentModificationException;
import org.oscm.internal.types.exception.OperationNotPermittedException;
import org.oscm.internal.types.exception.OrganizationAuthoritiesException;
import org.oscm.internal.types.exception.ValidationException;
import org.oscm.internal.vo.VOCountryVatRate;
import org.oscm.internal.vo.VOOrganizationVatRate;
import org.oscm.internal.vo.VOVatRate;

/**
 * Remote interface for handling VAT-related tasks.
 */
@Remote
public interface VatService {

    /**
     * Saves the default VAT rate for the calling user's organization.
     *

     * If the VAT support is disabled and the given parameter is not
     * null, the VAT support is enabled. If the VAT support is
     * enabled and the given parameter is null, all existing VAT
     * rates are removed and the VAT support is disabled.
     *

     * Required role: service manager of a supplier organization
     *
     * @param defaultVat
     *            the default VAT rate
     *
     * @throws OrganizationAuthoritiesException
     *             if the calling user's organization does not have the supplier
     *             role
     * @throws ConcurrentModificationException
     *             if the stored VAT rate is changed by another user in the time
     *             between reading and writing it
     * @throws ValidationException
     *             if the validation of the VAT rate fails
     */

    public void saveDefaultVat(VOVatRate defaultVat)
            throws OrganizationAuthoritiesException,
            ConcurrentModificationException, ValidationException;

    /**
     * Saves country-specific VAT rates for the calling user's organization. To
     * delete an existing country-specific VAT rate, add the corresponding value
     * object to the list and set its rate to null.
     *

     * Required role: service manager of a supplier organization
     *
     * @param countryVats
     *            the list of country-specific VAT rates
     *
     * @throws OrganizationAuthoritiesException
     *             if the calling user's organization does not have the supplier
     *             role
     * @throws ConcurrentModificationException
     *             if a stored VAT rate is changed by another user in the time
     *             between reading and writing it
     * @throws ValidationException
     *             if the validation of a VAT rate fails, or if the VAT support
     *             is disabled for the calling user's organization
     */

    public void saveCountryVats(List<VOCountryVatRate> countryVats)
            throws OrganizationAuthoritiesException,
            ConcurrentModificationException, ValidationException;

    /**
     * Saves organization-specific VAT rates for the calling user's
     * organization. To delete an existing organization-specific VAT rate, add
     * the corresponding value object to the list and set its rate to
     * null.
     *

     * Required role: service manager of a supplier organization
     *
     * @param organizationVats
     *            the list of organization-specific VAT rates
     *
     * @throws OrganizationAuthoritiesException
     *             if the calling user's organization does not have the supplier
     *             role
     * @throws ConcurrentModificationException
     *             if a stored VAT rate is changed by another user in the time
     *             between reading and writing it
     * @throws OperationNotPermittedException
     *             if an organization specified in the VAT rates is not a
     *             customer of the calling user's organization
     * @throws ValidationException
     *             if the validation of a VAT rate fails, or if the VAT support
     *             is disabled for the calling user's organization
     */

    public void saveOrganizationVats(
            List<VOOrganizationVatRate> organizationVats)
            throws OrganizationAuthoritiesException,
            ConcurrentModificationException, OperationNotPermittedException,
            ValidationException;

    /**
     * Saves the default, country-specific, and organization-specific VAT rates
     * for the calling user's organization. If the default VAT rate is
     * null, the lists of country-specific and
     * organization-specific VAT rates must be null or empty.
     *

     * Required role: service manager of a supplier organization
     *
     * @param defaultVat
     *            the default VAT rate
     * @param countryVats
     *            a list of country-specific VAT rates
     * @param organizationVats
     *            a list of organization-specific VAT rates
     *
     * @throws OrganizationAuthoritiesException
     *             if the calling user's organization does not have the supplier
     *             role
     * @throws ConcurrentModificationException
     *             if a stored VAT rate is changed by another user in the time
     *             between reading and writing it
     * @throws OperationNotPermittedException
     *             if an organization specified in the organization-specific VAT
     *             rates is not a customer of the calling user's organization
     * @throws ValidationException
     *             if the validation of a VAT rate fails
     */
    public void saveAllVats(VOVatRate defaultVat,
            List<VOCountryVatRate> countryVats,
            List<VOOrganizationVatRate> organizationVats)
            throws OrganizationAuthoritiesException,
            ConcurrentModificationException, OperationNotPermittedException,
            ValidationException;

    /**
     * Retrieves the default VAT rate set for the calling user's organization.
     * If the VAT support is disabled, null is returned.
     *

     * Required role: any user role in an organization
     *
     * @return the default VAT rate, or null if the VAT support is
     *         disabled
     */
    public VOVatRate getDefaultVat();

    /**
     * Retrieves the country-specific VAT rates set for the calling user's
     * organization. If the VAT support is disabled, an empty list is returned.
     *

     * Required role: any user role in an organization
     *
     * @return the country-specific VAT rates
     */
    public List<VOCountryVatRate> getCountryVats();

    /**
     * Retrieves the organization-specific VAT rates set for the calling user's
     * organization. If the VAT support is disabled, an empty list is returned.
     *

     * Required role: any user role in an organization
     *
     * @return the organization-specific VAT rates
     */
    public List<VOOrganizationVatRate> getOrganizationVats();

    /**
     * Checks whether the VAT support is enabled for the calling user's
     * organization.
     *

     * Required role: any user role in an organization
     *
     * @return true if the VAT support is enabled,
     *         false otherwise
     */
    public boolean getVatSupport();

}


text:
package io.fdlessard.codesamples.order.controllers;

import io.fdlessard.codesamples.order.configurations.PersistenceItTestConfiguration;
import io.fdlessard.codesamples.order.configurations.WebMvcItTestConfiguration;

import io.restassured.http.ContentType;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.transaction.annotation.Transactional;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

import static io.restassured.RestAssured.given;
import static io.restassured.RestAssured.when;
import static org.hamcrest.core.IsEqual.*;
import static org.hamcrest.Matchers.hasItems;

@ContextConfiguration(classes = {PersistenceItTestConfiguration.class, WebMvcItTestConfiguration.class})
@WebAppConfiguration
@Transactional
@RunWith(SpringJUnit4ClassRunner.class)
public class SalesOrderControllerIT {

    private Date today = Calendar.getInstance().getTime();

    @Before
    public void setup() {
    }

    @Test
    public void testGetSalesOrder() throws Exception {
        when().
                get("http://localhost:8080/RestSpringMvcDataApp/salesorders/100").
                then().statusCode(200).body("id", equalTo(100)).
                contentType(ContentType.JSON);
    }

    @Test
    public void testGetSalesOrderWithNonExistingId() throws Exception {

        when().
                get("http://localhost:8080/RestSpringMvcDataApp/salesorders/1000").
                then().statusCode(404).
                contentType(ContentType.JSON);
    }

    @Test
    public void testGetSalesOrderWithInvalidId() throws Exception {

        when().
                get("http://localhost:8080/RestSpringMvcDataApp/salesorders/aaaa").
                then().statusCode(404).
                contentType(ContentType.JSON);
    }

    @Test
    public void testGetAllSalesOrder() throws Exception {

        when().
                get("http://localhost:8080/RestSpringMvcDataApp/salesorders").
                then().statusCode(200).body("id", hasItems(100, 200, 300)).
                contentType(ContentType.JSON);
    }

    @Test
    public void testCreateSalesOrder() throws Exception {

        DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy hh:mm:ss");
        String todayStr = dateFormat.format(today);

        String postStr = "{\"description\":\"SalesOrder IT\", \"date\": " + "\"" + todayStr + "\",\"total\": \"10.00\" }";

        given().contentType(ContentType.JSON).body(postStr ).
            when().post("http://localhost:8080/RestSpringMvcDataApp/salesorders").
                then().statusCode(201);
    }

    @Test
    public void testCreateSalesOrderWithAlreadyExistingSalesOrder() throws Exception {

        DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy hh:mm:ss");
        String todayStr = dateFormat.format(today);

        String postStr = "{\"id\" : \"100\", \"description\":\"SalesOrder IT\", \"date\": " + "\"" + todayStr + "\",\"total\": \"10.00\" }";

        given().contentType(ContentType.JSON).body(postStr ).
                when().post("http://localhost:8080/RestSpringMvcDataApp/salesorders").
                then().statusCode(201);
    }

    @Test
    public void testUpdateSalesOrder() throws Exception {

        DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy hh:mm:ss");
        String todayStr = dateFormat.format(today);

        String putStr = "{\"id\": \"100\",\"description\":\"SalesOrder Updated\", \"date\":" + "\"" + todayStr + "\",\"total\": \"10.00\" }";

        given().contentType(ContentType.JSON).body(putStr).
                when().put("http://localhost:8080/RestSpringMvcDataApp/salesorders").
                then().statusCode(200);
    }

    @Test
    public void testDeleteSalesOrderWithNonExistingId() throws Exception {

        when().
                delete("http://localhost:8080/RestSpringMvcDataApp/salesorders/1000").
                then().statusCode(404).
                contentType(ContentType.JSON);
    }

    @Test
    public void testDeleteSalesOrderWithInvalidId() throws Exception {

        when().
                delete("http://localhost:8080/RestSpringMvcDataApp/salesorders/aaaa").
                then().statusCode(404).
                contentType(ContentType.JSON);
    }
}


text:
<ion-modal-view>
    <ion-header-bar class="bar-positive">
          <button class="button" ng-click="closeYipeeModal()"></button>

          <button class="button" ng-click="closeYipeeModal()">OK</button>
    </ion-header-bar>
    <ion-content>

Yipee !

Tout s'est bien passé.

    </ion-content>
  </ion-modal-view>


text:
{% extends 'manage/manage_base.html' %}
{% set page='events' -%}

{% block manage_title %}
  New Event Tweet for "{{ event.title }}"
{% endblock %}

{% block site_css %}
  {{ super() }}
  <link href="{{ static('manage/css/jquery-ui-1.10.1.custom.min.css') }}" rel="stylesheet" type="text/css">
{% endblock %}

{% block site_js %}
  {{ super() }}
  {% javascript 'jquery_ui_timepicker' %}
  {% javascript 'edit_event_tweet' %}
{% endblock %}

{% block content_class %}col-md-6{% endblock %}

{% block manage_content %}
  <input type="hidden" name="event_edit_url" value="{{ url('manage:event_edit', event.pk) }}">

  {% set count_tweets=tweets.count() %}
  {% if count_tweets %}

    <button type="button" class="close" data-dismiss="alert">×</button>

Note!

    This event already has
    {% if count_tweets == 1 %}a tweet{% else %}{{ count_tweets }} tweets{% endif %}.

  {% endif %}

  {% if shortener_error %}

    <button type="button" class="close" data-dismiss="alert">×</button>

Note!

Unable to use Bit.ly URL shortener. Error:
    {{ shortener_error }}

  {% endif %}

  {% if event.is_public() %}
    {% include "manage/_default_form.html" %}

About when the tweet will be sent

If the event needs approval, it will not be sent until it has been approved.

If you enter a date and time, it will not be sent till after that.

If you don't enter a date and time and the event does not need approval, the tweet
        will be sent as soon as you save it.

This event:
    {% if not event.is_scheduled() %}
      Needs to be scheduled first
    {% elif event.needs_approval() %}
      Needs to be approved first
    {% else %}
      Does not need approval first
    {% endif %}

  {% else %}

This event is not public.

  {% endif %}

    ← Return to event

{% endblock %}


text:
Additions
----
* Added Cucumber generator tests.
* Added Cucumber CLI tests.

*the end*

---

# Demo App 0.5.1 Release Notes
###### Added release_note_indicator helper.

#### 07/13/2014

Additions
----
* Added release_note_indicator helper.
* Added release_note_indicator snippet to dummy app view.

Changes
----
* Updated gemspec.
* Updated README.

Fixes
----
* Fixed a template error that occurred when trying to navigate to a specific release note by version.

Upcoming
----
* Add generator tests.
* Add command line tests.

*the end*

---

# Demo App 0.5.1 Release Notes
###### Added release_note_indicator helper.

#### 07/13/2014

Additions
----
* Added release_note_indicator helper.
* Added release_note_indicator snippet to dummy app view.

Changes
----
* Updated gemspec.
* Updated README.

Fixes
----
* Fixed a template error that occurred when trying to navigate to a specific release note by version.

Upcoming
----
* Add generator tests.
* Add command line tests.

*the end*

---

# Demo App 0.5.0 Release Notes
###### Dummy app added and testing framework updated.

#### 07/03/2014

Additions
----
* Added dummy app (/spec/dummy) to demo and test ReleaseNotes.
* Added bootstrap-sass gem dependency.
* Added controller and routing tests.

Improvements
----
* Updated rspec.

Removals
----
* Removed static bootstrap.js and bootstrap.css files.

Fixes
----
* Fixed issue where after running `release_notes update -r` would return the index of ReleaseNotes in reverse order (oldest to newest).

Upcoming
----
* Add generator tests.
* Add command line tests.

*the end*

---

# Demo App 0.4.0 Release Notes
###### Removal of Broadcast feature.

#### 05/20/2014

Changes
----
* Updated README.

Removals
----
* Removed all files related to the Broadcast feature.

Upcoming
----
* Adding tests... eventually.

*the end*

---


text:
import path from 'path';
import fs from 'fs-extra';
import _ from 'underscore';
import winston from 'winston';
import * as misc from './misc.js';
import * as bowerTools from './bowerTools.js';
import * as getTransport from './getTransport.js';

function stampBowerJson(options, bowerJson, packageArray, branched) {
	let changed = false;
	function replaceTrunksWithVersions(depsObj) {
		if (!depsObj) {
			return;
		}
		// put new versions of all dependency modules into project's bower.json
		for (const moduleName in depsObj) {
			if (depsObj.hasOwnProperty(moduleName)) {
				const pkg = bowerTools.existsInPackageArray(packageArray, moduleName);
				if (pkg && branched.hasOwnProperty(moduleName)) {
					const branchName = branched[moduleName];
					const transport = getTransport.fromType(pkg.transportType);
					// console.log( JSON.stringify( pkg,null,2 ) );
					depsObj[moduleName] = transport.formatBowerDependencyUrl(pkg.url, { type: 'branch', name: branchName });
					changed = true;
				}
			}
		}
	}
	replaceTrunksWithVersions(bowerJson.dependencies);
	replaceTrunksWithVersions(bowerJson.devDependencies);
	return changed;
}

export default async function branch(names, options) {
	misc.clearBowerRuntimeCache();
	options = misc.mergeFileOptions(options);

	if (!options.branchName) {
		options.branchName = await misc.prompt(options, {
			type: 'input',
			message: 'Specify the name of the branch',
			default: 'branch'
		});
	}

	const bowerJsonPath = path.join(options.cwd, 'bower.json');
	let bowerJson;
	if (fs.existsSync(bowerJsonPath)) {
		bowerJson = JSON.parse(fs.readFileSync(bowerJsonPath));
	}

	const packageArray = await bowerTools.getProjectPackageList(options.cwd, names, _.extend({}, options, { includeRootProject: true }));
	const branched = {};
	// creates branches for all specified packages
	for (let i = 0; i < packageArray.length; ++i) {
		const pkg = packageArray[i];
		if (misc.isLinked(bowerJson, pkg.name) || pkg.isMain) {
			winston.info(`Creating branch for ${pkg.name}`);
			// TODO: check branch doesn't already exist
			const transport = getTransport.fromType(pkg.transportType);
			await transport.createBranch(pkg.dir, options.branchName, { switch: true });
			branched[pkg.name] = options.branchName;
		}
	}
	// stamp bower.json's to change trunk -> branch
	const fullPackageArray = await bowerTools.getProjectPackageList(options.cwd, [], _.extend({}, options, { includeRootProject: true }));

	for (let i = 0; i < fullPackageArray.length; ++i) {
		const pkg = fullPackageArray[i];
		const pkgBowerJsonPath = path.join(pkg.dir, 'bower.json');
		if (fs.existsSync(pkgBowerJsonPath)) {
			const pkgBowerJson = JSON.parse(fs.readFileSync(pkgBowerJsonPath));
			if (stampBowerJson(options, pkgBowerJson, fullPackageArray, branched)) {
				winston.info(`Updating bower.json for dependency '${pkg.name}'`);
				const transport = getTransport.fromType(pkg.transportType);
				const pkgdesc = pkg.targetDesc;
				if (branched[pkg.name]) {
					pkgdesc.type = 'branch';
					pkgdesc.name = branched[pkg.name];
				}
				await transport.unCat(pkg.url, pkgdesc, 'bower.json', { contents: JSON.stringify(pkgBowerJson, null, 2), msg: 'Updating bower.json' });
			}
		}
	}
}


text:
package com.zimbra.cs.account.ldap.custom;

import java.util.Map;

import com.zimbra.common.localconfig.KnownKey;
import com.zimbra.common.localconfig.LC;
import com.zimbra.common.service.ServiceException;
import com.zimbra.common.util.StringUtil;
import com.zimbra.common.util.ZimbraLog;
import com.zimbra.cs.account.Domain;
import com.zimbra.cs.account.Provisioning;
import com.zimbra.cs.account.Server;
import com.zimbra.cs.account.ldap.LdapDIT;
import com.zimbra.cs.account.ldap.LdapProv;
import com.zimbra.cs.account.ldap.SpecialAttrs;
import com.zimbra.cs.ldap.IAttributes;
import com.zimbra.cs.ldap.LdapUtil;
import com.zimbra.cs.ldap.ZLdapFilter;
import com.zimbra.cs.ldap.ZLdapFilterFactory;

/*
 * This class and CustomerLdapProvisioning should really go under the
 * Velodrome extension.  But there is an initializing sequence problem
 * that the class specified in the zimbra_class_provisioning key cannot
 * be in an extension.  Currently it just calls Class.forName, which does
 * not take into account that the class could be in an extension.
 * However even if it does and uses ExtensionUtil.loadClass
 * (we can use {ext-name}:{class-name} format for the zimbra_class_provisioning key),
 * the class still cannot be loaded because:
 *
 * when server is starting up, Provisioning.getInstance is first called from
 * PrivilegedServlet.init, then called from SoapServlet.init() ... -> Config.init(),
 * but ExtensionUtil.loadAll is not called until SoapServlet.init -> Zimbra.startup(),
 * which happens later.
 *
 * For now the Velodrome Provisioning impl will have to reside in the core product.
 *
 * While CustomLdapProvisioning and CustomLdapDIT try to make DIT layout as generic
 * as possible, it was implemented to meet the requirement from Velodrome.  It provides
 * flexibility and differs from the default DIT via localconfig keys as follows:
 *
 * See ZimbraCustomerServices/velodrome/ZimbraServer/docs/custom-DIT.txt for detailed
 * descrittion of the functionalities of the custom DIT.
 *
 */

public class CustomLdapDIT extends LdapDIT {

    private final String DEFAULT_BASE_RDN_DOMAIN = "cn=domains";
    private String BASE_DN_DOMAIN;

    public CustomLdapDIT(LdapProv prov) {
        super(prov);
    }

    private String getLC(KnownKey key, String defaultValue) {
        String lcValue = key.value();

        if (StringUtil.isNullOrEmpty(lcValue))
            return defaultValue;
        else
            return lcValue;
    }

    private String getLCAndValidateUnderConfigBranchDN(KnownKey key, String defaultValue) {
        String dn = getLC(key, defaultValue);

        if (!validateUnderDN(BASE_DN_CONFIG_BRANCH, dn)) {
            ZimbraLog.account.warn("dn " + dn + " must be under " + BASE_DN_CONFIG_BRANCH + ", localconfig value " + dn + " ignored, using default value " + defaultValue);
            dn = defaultValue;
        }

        return dn;
    }

    protected void init() {

        BASE_DN_CONFIG_BRANCH = getLC(LC.ldap_dit_base_dn_config, DEFAULT_CONFIG_BASE_DN);
        BASE_DN_MAIL_BRANCH   = getLC(LC.ldap_dit_base_dn_mail, DEFAULT_MAIL_BASE_DN).toLowerCase();

        BASE_RDN_ACCOUNT  = "";

        NAMING_RDN_ATTR_USER          = getLC(LC.ldap_dit_naming_rdn_attr_user,         DEFAULT_NAMING_RDN_ATTR_USER);
        NAMING_RDN_ATTR_COS           = getLC(LC.ldap_dit_naming_rdn_attr_cos,          DEFAULT_NAMING_RDN_ATTR_COS);
        NAMING_RDN_ATTR_GLOBALCONFIG  = getLC(LC.ldap_dit_naming_rdn_attr_globalconfig, DEFAULT_NAMING_RDN_ATTR_GLOBALCONFIG);
        NAMING_RDN_ATTR_GLOBALGRANT   = getLC(LC.ldap_dit_naming_rdn_attr_globalgrant,  DEFAULT_NAMING_RDN_ATTR_GLOBALGRANT);
        NAMING_RDN_ATTR_DYNAMICGROUP         = getLC(LC.ldap_dit_naming_rdn_attr_group,        DEFAULT_NAMING_RDN_ATTR_DYNAMICGROUP);
        NAMING_RDN_ATTR_MIME          = getLC(LC.ldap_dit_naming_rdn_attr_mime,         DEFAULT_NAMING_RDN_ATTR_MIME);
        NAMING_RDN_ATTR_SERVER        = getLC(LC.ldap_dit_naming_rdn_attr_server,       DEFAULT_NAMING_RDN_ATTR_SERVER);
        NAMING_RDN_ATTR_XMPPCOMPONENT = getLC(LC.ldap_dit_naming_rdn_attr_xmppcomponent,DEFAULT_NAMING_RDN_ATTR_XMPPCOMPONENT);
        NAMING_RDN_ATTR_ZIMLET        = getLC(LC.ldap_dit_naming_rdn_attr_zimlet,       DEFAULT_NAMING_RDN_ATTR_ZIMLET);

        DN_GLOBALCONFIG    = NAMING_RDN_ATTR_GLOBALCONFIG + "=config" + "," + BASE_DN_CONFIG_BRANCH;
        DN_GLOBALGRANT     = NAMING_RDN_ATTR_GLOBALGRANT  + "=globalgrant" + "," + BASE_DN_CONFIG_BRANCH;

        BASE_DN_ADMIN         = getLCAndValidateUnderConfigBranchDN(LC.ldap_dit_base_dn_admin,         DEFAULT_BASE_RDN_ADMIN         + "," + BASE_DN_CONFIG_BRANCH);
        BASE_DN_APPADMIN      = getLCAndValidateUnderConfigBranchDN(LC.ldap_dit_base_dn_appadmin,      DEFAULT_BASE_RDN_APPADMIN      + "," + BASE_DN_CONFIG_BRANCH);
        BASE_DN_COS           = getLCAndValidateUnderConfigBranchDN(LC.ldap_dit_base_dn_cos,           DEFAULT_BASE_RDN_COS           + "," + BASE_DN_CONFIG_BRANCH);
        BASE_DN_MIME          = getLCAndValidateUnderConfigBranchDN(LC.ldap_dit_base_dn_mime,          DEFAULT_BASE_RDN_MIME          + "," + DN_GLOBALCONFIG);
        BASE_DN_SERVER        = getLCAndValidateUnderConfigBranchDN(LC.ldap_dit_base_dn_server,        DEFAULT_BASE_RDN_SERVER        + "," + BASE_DN_CONFIG_BRANCH);
        BASE_DN_XMPPCOMPONENT = getLCAndValidateUnderConfigBranchDN(LC.ldap_dit_base_dn_xmppcomponent, DEFAULT_BASE_RDN_XMPPCOMPONENT + "," + BASE_DN_CONFIG_BRANCH);
        BASE_DN_ZIMLET        = getLCAndValidateUnderConfigBranchDN(LC.ldap_dit_base_dn_zimlet,        DEFAULT_BASE_RDN_ZIMLET        + "," + BASE_DN_CONFIG_BRANCH);

        BASE_DN_DOMAIN        = getLCAndValidateUnderConfigBranchDN(LC.ldap_dit_base_dn_domain, DEFAULT_BASE_RDN_DOMAIN + "," + BASE_DN_CONFIG_BRANCH);

        BASE_DN_ZIMBRA        = computeZimbraBaseDN();
    }

    /*
     * take the common base for config branch and mail branch
     */
    private String computeZimbraBaseDN() {
        String[] rdns1 = BASE_DN_CONFIG_BRANCH.split(",");
        String[] rdns2 = BASE_DN_MAIL_BRANCH.split(",");

        int idx1 = rdns1.length - 1;
        int idx2 = rdns2.length - 1;

        int shorter;

        if (rdns1.length < rdns2.length)
            shorter = rdns1.length;
        else
            shorter = rdns2.length;

        String commonDn = null;
        for (int i=0; i<shorter; i++, idx1--, idx2--) {
            if (rdns1[idx1].equalsIgnoreCase(rdns2[idx2])) {
                if (commonDn == null)
                    commonDn = rdns1[idx1];
                else
                    commonDn = rdns1[idx1] + "," + commonDn;
            } else
                break;
        }

        return commonDn;
    }

    private ServiceException UNSUPPORTED(String msg) {
        return ServiceException.FAILURE(msg + " unsupported in " + getClass().getCanonicalName(), null);
    }

    /*
     * verify that dn is under parentDn
     */
    private boolean validateUnderDN(String parentDn, String dn) {
        return isUnder(parentDn, dn);
    }

    private void validateMailBranchEntryDN(String dn) throws ServiceException {
        if (!validateUnderDN(BASE_DN_MAIL_BRANCH, dn))
            throw ServiceException.INVALID_REQUEST("dn " + dn + " must be under " + BASE_DN_MAIL_BRANCH, null);
    }

    private String defaultDomain() throws ServiceException {
        String defaultDomain = mProv.getConfig().getAttr(Provisioning.A_zimbraDefaultDomainName, null);
        if (StringUtil.isNullOrEmpty(defaultDomain))
           throw UNSUPPORTED("default domain is empty");

        return defaultDomain;
    }

    private String acctAndDLDNCreate(String baseDn, IAttributes attrs) throws ServiceException {
        String rdnAttr = NAMING_RDN_ATTR_USER;
        String rdnValue = attrs.getAttrString(rdnAttr);

        if (rdnValue == null)
            throw ServiceException.FAILURE("missing rdn attribute" + rdnAttr, null);

        validateMailBranchEntryDN(baseDn);

        return rdnAttr + "=" + LdapUtil.escapeRDNValue(rdnValue) + "," + baseDn;
    }

    /*
     * ===========
     *   account
     * ===========
     */
    @Override
    public String emailToDN(String localPart, String domain) throws ServiceException{
        throw UNSUPPORTED("function emailToDN");
    }

    @Override
    public String emailToDN(String email) throws ServiceException {
        throw UNSUPPORTED("function emailToDN");
    }

    @Override
    public String accountDNCreate(String baseDn, IAttributes attrs, String localPart, String domain) throws ServiceException {
        if (baseDn == null)
            throw ServiceException.INVALID_REQUEST("base dn is required in DIT impl " + getClass().getCanonicalName(), null);

        return acctAndDLDNCreate(baseDn, attrs);
    }

    @Override
    public String accountDNRename(String oldDn, String newLocalPart, String newDomain) throws ServiceException {
        return oldDn;
    }

    /*
     * Get email local part attr from attrs and form the email with the default domain
     */
    @Override
    public String dnToEmail(String dn, IAttributes attrs) throws ServiceException {
        String localPart = attrs.getAttrString(DEFAULT_NAMING_RDN_ATTR_USER);

        if (localPart != null)
            return localPart + "@" + defaultDomain();
        else
            throw ServiceException.FAILURE("unable to map dn [" + dn + "] to email", null);
    }

    /*
     * ==========
     *   alias
     * ==========
     */
    /*
     *  - Aliases has to be in the same domain as the target entry, and the domain has to be the default
     *    domain(config.zimbraDefaultDomainName).  For example, if the entry is foo@domain1.com,
     *    it *cannot* have foo-alias@domain2.com.  And, in order for foo@domain1.com to have alias, domain1.com
     *    has to be the default domain.
     *
     *  - This is because alias entries do not carry the domain information.
     *    In our default DIT, aliases are created under the DN which is computed from the domain.
     *    Therefore, given a dn, we can compute it back to the domain of the alias.
     *    But in the custom DIT, aliases are always created under the same DN of the target entry,
     *    because in the custom DIT there is no co-relation between the email address and the DN.
     *    As a workaround so we can at least have basic alias functionalities, the dnToEmail function
     *    always uses zimbraDefaultDomainName for the domain, which is of course still wrong and will break
     *    when zimbraDefaultDomainName is changed!  Until we have a real solution for that, for now aliases
     *    in the custom DIT is flakey and this is the best we can do.  Maybe we should just disallow
     *    aliases in the custom DIT?
     */
    @Override
    public String aliasDN(String targetDn, String targetDomain, String aliasLocalPart, String aliasDomain) throws ServiceException {
        if (targetDn == null || targetDomain == null)
            throw UNSUPPORTED("alias DN without target dn or target domain");

        String allowedDomain = defaultDomain();
        if (!aliasDomain.equals(allowedDomain))
            throw UNSUPPORTED("alias DN not in default domain" + "(alias domain=" + aliasDomain + ", default domain=" + allowedDomain + ")");

        if (!targetDomain.equals(aliasDomain))
            throw UNSUPPORTED("alias DN with different target domain and alias domain" + "(alias domain=" + aliasDomain + ", target domain=" + targetDomain + ")");

        /*
         * alias is placed under the same dn as the target
         */
        String[] parts = LdapUtil.dnToRdnAndBaseDn(targetDn);
        return NAMING_RDN_ATTR_USER + "=" + LdapUtil.escapeRDNValue(aliasLocalPart) + "," + parts[1];
    }

    @Override
    public String aliasDNRename(String targetNewDn, String targetNewDomain, String newAliasEmail) throws ServiceException {
        if (targetNewDn == null || targetNewDomain == null)
            throw UNSUPPORTED("alias DN rename without target dn or target domain");

        String allowedDomain = defaultDomain();
        if (!targetNewDomain.equals(allowedDomain))
            throw UNSUPPORTED("alias DN rename not in default domain" + "(alias domain=" + targetNewDomain + ", default domain=" + allowedDomain + ")");

        return targetNewDn;
    }

    /* =================
     * calendar resource
     * =================
     */

    /*
     * =====================
     *   distribution list
     * =====================
     */
    /*
     * same restrictions on domain as the restrictions for aliases.
     */
    @Override
    public String distributionListDNCreate(String baseDn, IAttributes attrs, String localPart, String domain) throws ServiceException {
        if (baseDn == null)
            throw ServiceException.INVALID_REQUEST("base dn is required in DIT impl " + getClass().getCanonicalName(), null);

        String allowedDomain = defaultDomain();
        if (!domain.equals(allowedDomain))
            throw UNSUPPORTED("DL DN not in default domain" + "(DL domain=" + domain + ", default domain=" + allowedDomain + ")");

        return acctAndDLDNCreate(baseDn, attrs);
    }

    @Override
    public String distributionListDNRename(String oldDn, String newLocalPart, String newDomain) throws ServiceException {
        return oldDn;
    }

    /*
     * ==========
     *   domain
     * ==========
     */
    @Override
    public String domainBaseDN() {
        return BASE_DN_DOMAIN;
    }

    @Override
    public String[] domainToDNs(String[] parts) {
        return domainToDNsInternal(parts, BASE_DN_DOMAIN);
    }

    /*
     * account base search dn
     *
     * In custom DIT, accounts are not located under domain's DN.
     * Accounts can be created anywhere in the DIT.  We use the mail branch base if
     * it is configured, the default mail branch base is "".
     */
    @Override
    public String domainToAccountSearchDN(String domain) throws ServiceException {
        return BASE_DN_MAIL_BRANCH;
    }

    // account base search dn
    @Override
    public String domainDNToAccountSearchDN(String domainDN) throws ServiceException {
        return BASE_DN_MAIL_BRANCH;
    }

    /*
     * ==========
     *   filters
     * ==========
     */
    @Override
    public ZLdapFilter filterAccountsByDomainAndServer(Domain domain, Server server) {
        return ZLdapFilterFactory.getInstance().velodromeAllAccountsByDomainAndServer(
                domain.getName(), server.getServiceHostname());
    }

    @Override
    public ZLdapFilter filterAccountsOnlyByDomainAndServer(Domain domain, Server server) {
        return ZLdapFilterFactory.getInstance().velodromeAllAccountsOnlyByDomainAndServer(
                domain.getName(), server.getServiceHostname());
    }

    @Override
    public ZLdapFilter filterCalendarResourceByDomainAndServer(Domain domain, Server server) {
        return ZLdapFilterFactory.getInstance().velodromeAllCalendarResourcesByDomainAndServer(
                domain.getName(), server.getServiceHostname());
    }

    @Override
    public ZLdapFilter filterAccountsOnlyByDomain(Domain domain) {
        return ZLdapFilterFactory.getInstance().velodromeAllAccountsOnlyByDomain(domain.getName());
    }

    @Override
    public ZLdapFilter filterCalendarResourcesByDomain(Domain domain) {
        return ZLdapFilterFactory.getInstance().velodromeAllCalendarResourcesByDomain(domain.getName());
    }

    /*
     * Too bad we can't do anything about DL and dynamic groups, because we can't tell
     * by mail or zimbraNailAlias which one is an alias and which one is the main email.
     *
     * The one in default DIT is used for DL, that means for custom DIT the getAllDistrubutionLists
     * function will return DLs in all domains if there are any (although the broken logic
     * that DL can only belong to the single default domain kind of restricted, but it will
     * break once the default domain changed)!
     *
     * Just throw UNSUPPORTED for groups.
     */
    @Override
    public ZLdapFilter filterDistributionListsByDomain(Domain domain) {
        throw new UnsupportedOperationException();
    }

    @Override
    public ZLdapFilter filterGroupsByDomain(Domain domain) {
        throw new UnsupportedOperationException();
    }

    /*
     * ========================================================================================
     */
    @Override
    public SpecialAttrs handleSpecialAttrs(Map<String, Object> attrs) throws ServiceException {

        // check for required attrs
        if (SpecialAttrs.getSingleValuedAttr(attrs, SpecialAttrs.PA_ldapBase) == null)
            throw ServiceException.INVALID_REQUEST("missing required attribute " + SpecialAttrs.PA_ldapBase, null);

        if (!NAMING_RDN_ATTR_USER.equals(DEFAULT_NAMING_RDN_ATTR_USER)) {
            if (SpecialAttrs.getSingleValuedAttr(attrs, NAMING_RDN_ATTR_USER) == null)
                throw ServiceException.INVALID_REQUEST("missing required attribute " + NAMING_RDN_ATTR_USER, null);
        }

        SpecialAttrs specialAttrs = new SpecialAttrs();
        if (attrs != null) {
            specialAttrs.handleZimbraId(attrs);
            specialAttrs.handleLdapBaseDn(attrs);
        }

        return specialAttrs;
    }
}


text:
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.weblayer_private;

import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.view.ViewGroup;
import android.webkit.ValueCallback;

import androidx.annotation.NonNull;
import androidx.fragment.app.FragmentManager;

import org.chromium.base.Callback;
import org.chromium.base.StrictModeContext;
import org.chromium.components.browser_ui.site_settings.ContentSettingsResources;
import org.chromium.components.browser_ui.site_settings.SiteSettingsCategory;
import org.chromium.components.browser_ui.site_settings.SiteSettingsDelegate;
import org.chromium.components.content_settings.ContentSettingsType;
import org.chromium.components.content_settings.CookieControlsBridge;
import org.chromium.components.content_settings.CookieControlsObserver;
import org.chromium.components.embedder_support.util.UrlConstants;
import org.chromium.components.page_info.PageInfoControllerDelegate;
import org.chromium.components.page_info.PageInfoMainController;
import org.chromium.components.page_info.PageInfoSubpageController;
import org.chromium.content_public.browser.BrowserContextHandle;
import org.chromium.content_public.browser.WebContents;
import org.chromium.ui.modaldialog.ModalDialogManager;
import org.chromium.url.GURL;
import org.chromium.weblayer_private.interfaces.ObjectWrapper;
import org.chromium.weblayer_private.interfaces.SettingsIntentHelper;
import org.chromium.weblayer_private.settings.WebLayerSiteSettingsDelegate;

import java.util.Collection;
import java.util.Collections;

/**
 * WebLayer's customization of PageInfoControllerDelegate.
 */
public class PageInfoControllerDelegateImpl extends PageInfoControllerDelegate {
    private final Context mContext;
    private final WebContents mWebContents;
    private final BrowserImpl mBrowser;
    private final ProfileImpl mProfile;

    static PageInfoControllerDelegateImpl create(WebContents webContents) {
        TabImpl tab = TabImpl.fromWebContents(webContents);
        assert tab != null;
        return new PageInfoControllerDelegateImpl(webContents, tab.getBrowser());
    }

    private PageInfoControllerDelegateImpl(WebContents webContents, BrowserImpl browser) {
        super(new AutocompleteSchemeClassifierImpl(),
                /** vrHandler= */ null,
                /** isSiteSettingsAvailable= */
                isHttpOrHttps(webContents.getVisibleUrl()),
                /** cookieControlsShown= */
                CookieControlsBridge.isCookieControlsEnabled(browser.getProfile()));
        mContext = browser.getContext();
        mWebContents = webContents;
        mBrowser = browser;
        mProfile = browser.getProfile();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public ModalDialogManager getModalDialogManager() {
        return mBrowser.getWindowAndroid().getModalDialogManager();
    }

    @Override
    public void showCookieSettings() {
        String category = SiteSettingsCategory.preferenceKey(SiteSettingsCategory.Type.COOKIES);
        String title = mContext.getResources().getString(
                ContentSettingsResources.getTitle(ContentSettingsType.COOKIES));
        Intent intent = SettingsIntentHelper.createIntentForSiteSettingsSingleCategory(
                mContext, mProfile.getName(), mProfile.isIncognito(), category, title);
        launchIntent(intent);
    }

    @Override
    public void showAdPersonalizationSettings() {
        // The Privacy Sandbox currently does not exist on Weblayer, so it will never show the
        // ad personalization section in PageInfo. When we add support for the Privacy Sandbox,
        // this method should open a settings page for it.
        assert false;
    }

    private void launchIntent(Intent intent) {
        // Disabling StrictMode to avoid violations (https://crbug.com/819410).
        try (StrictModeContext ignored = StrictModeContext.allowDiskReads()) {
            mContext.startActivity(intent);
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    @NonNull
    public CookieControlsBridge createCookieControlsBridge(CookieControlsObserver observer) {
        return new CookieControlsBridge(observer, mWebContents, null);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    @NonNull
    public Collection<PageInfoSubpageController> createAdditionalRowViews(
            PageInfoMainController mainController, ViewGroup rowWrapper) {
        return Collections.emptyList();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    @NonNull
    public BrowserContextHandle getBrowserContext() {
        return mProfile;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    @NonNull
    public SiteSettingsDelegate getSiteSettingsDelegate() {
        return new WebLayerSiteSettingsDelegate(getBrowserContext());
    }

    @Override
    public void getFavicon(GURL url, Callback<Drawable> callback) {
        mProfile.getCachedFaviconForPageUri(
                url.getSpec(), ObjectWrapper.wrap((ValueCallback<Bitmap>) (bitmap) -> {
                    if (bitmap != null) {
                        callback.onResult(new BitmapDrawable(mContext.getResources(), bitmap));
                    } else {
                        callback.onResult(null);
                    }
                }));
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isAccessibilityEnabled() {
        return WebLayerAccessibilityUtil.get().isAccessibilityEnabled();
    }

    private static boolean isHttpOrHttps(GURL url) {
        String scheme = url.getScheme();
        return UrlConstants.HTTP_SCHEME.equals(scheme) || UrlConstants.HTTPS_SCHEME.equals(scheme);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public FragmentManager getFragmentManager() {
        return mBrowser.getFragmentManager();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isIncognito() {
        return mProfile.isIncognito();
    }
}


text:
package org.apache.synapse.aspects.statistics;

/**
 * Capability of configure statistics
 */
public interface StatisticsConfigurable {
    /**
     * Whether statistics has been enabled
     *
     * @return True if enable , o.w , false
     */
    public boolean isStatisticsEnable();

    /**
     * To disable statistics
     */
    public void disableStatistics();

    /**
     * To enable statistics
     */
    public void enableStatistics();
}


text:
import java.util.function.Predicate;

public class Test {
  public static void main(String[] args) {
    while(((Predicate<String>) ((x) -> {
      System.out.println("hello");
      return Collections.singleton("abc").contains(x);
    })).<caret>test("ab")) {
      System.out.println("hello");
    }
  }
}


text:
package com.amoseui.ruffjava.singleton;

public class DoubleCheckedLockingTest extends SingletonTestBase<DoubleCheckedLocking> {

    public DoubleCheckedLockingTest() {
        super(DoubleCheckedLocking::getInstance);
    }
}