text:
package org.eclipse.emf.cdo.internal.common.model;

import java.io.IOException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;

import org.eclipse.emf.cdo.common.model.CDOModelUtil;
import org.eclipse.emf.cdo.common.model.CDOPackageTypeRegistry;
import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
import org.eclipse.emf.cdo.common.model.EMFUtil;
import org.eclipse.emf.cdo.common.protocol.CDODataInput;
import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
import org.eclipse.emf.cdo.common.util.CDOCommonUtil;
import org.eclipse.emf.cdo.internal.common.bundle.OM;
import org.eclipse.emf.cdo.internal.common.messages.Messages;
import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageInfo;
import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageRegistry;
import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageRegistry.PackageLoader;
import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageUnit;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.net4j.util.CheckUtil;
import org.eclipse.net4j.util.om.trace.ContextTracer;

/**
 * @author Eike Stepper
 */
public class CDOPackageUnitImpl implements InternalCDOPackageUnit
{
  private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, CDOPackageUnitImpl.class);

  private InternalCDOPackageRegistry packageRegistry;

  private State state = State.PROXY;

  private Type type;

  private Type originalType;

  private long timeStamp;

  private InternalCDOPackageInfo[] packageInfos;

  public CDOPackageUnitImpl()
  {
  }

  public InternalCDOPackageRegistry getPackageRegistry()
  {
    return packageRegistry;
  }

  public void setPackageRegistry(InternalCDOPackageRegistry packageRegistry)
  {
    this.packageRegistry = packageRegistry;
  }

  public String getID()
  {
    try
    {
      return getTopLevelPackageInfo().getPackageURI();
    }
    catch (RuntimeException ex)
    {
      return Messages.getString("CDOPackageUnitImpl.0"); //$NON-NLS-1$
    }
  }

  public State getState()
  {
    return state;
  }

  public void setState(State state)
  {
    this.state = state;
    if (state == State.LOADED)
    {
      type = null;
    }
  }

  public Type getType()
  {
    if (getOriginalType() == Type.DYNAMIC)
    {
      type = Type.DYNAMIC;
    }
    else if (type == null || type == Type.UNKNOWN)
    {
      if (state == State.PROXY)
      {
        type = CDOPackageTypeRegistry.INSTANCE.lookup(getID());
      }
      else
      {
        InternalCDOPackageInfo packageInfo = getTopLevelPackageInfo();
        EPackage ePackage = packageInfo.getEPackage();
        type = CDOPackageTypeRegistry.INSTANCE.lookup(ePackage);
      }

      if (type == null)
      {
        type = Type.UNKNOWN;
      }
    }

    return type;
  }

  public Type getOriginalType()
  {
    return originalType;
  }

  public void setOriginalType(Type originalType)
  {
    this.originalType = originalType;
  }

  public long getTimeStamp()
  {
    return timeStamp;
  }

  public void setTimeStamp(long timeStamp)
  {
    this.timeStamp = timeStamp;
  }

  public InternalCDOPackageInfo getTopLevelPackageInfo()
  {
    if (packageInfos == null || packageInfos.length == 0)
    {
      throw new IllegalStateException(Messages.getString("CDOPackageUnitImpl.1")); //$NON-NLS-1$
    }

    return packageInfos[0];
  }

  public InternalCDOPackageInfo getPackageInfo(String packageURI)
  {
    for (InternalCDOPackageInfo packageInfo : packageInfos)
    {
      if (packageInfo.getPackageURI().equals(packageURI))
      {
        return packageInfo;
      }
    }

    return null;
  }

  public InternalCDOPackageInfo[] getPackageInfos()
  {
    return packageInfos;
  }

  public void setPackageInfos(InternalCDOPackageInfo[] packageInfos)
  {
    this.packageInfos = packageInfos;
    for (InternalCDOPackageInfo packageInfo : packageInfos)
    {
      packageInfo.setPackageUnit(this);
    }
  }

  public EPackage[] getEPackages(boolean loadOnDemand)
  {
    List<EPackage> result = new ArrayList<EPackage>();
    for (InternalCDOPackageInfo packageInfo : packageInfos)
    {
      EPackage ePackage = packageInfo.getEPackage(loadOnDemand);
      if (ePackage != null)
      {
        result.add(ePackage);
      }
    }

    return result.toArray(new EPackage[result.size()]);
  }

  public boolean isSystem()
  {
    return getTopLevelPackageInfo().isSystemPackage();
  }

  public boolean isResource()
  {
    return getTopLevelPackageInfo().isResourcePackage();
  }

  public void init(EPackage ePackage)
  {
    EPackage topLevelPackage = EMFUtil.getTopLevelPackage(ePackage);
    List<InternalCDOPackageInfo> result = new ArrayList<InternalCDOPackageInfo>();
    initPackageInfos(topLevelPackage, result);
    packageInfos = result.toArray(new InternalCDOPackageInfo[result.size()]);

    setState(State.NEW);
    setOriginalType(getType());
  }

  public void dispose()
  {
    packageInfos = null;
    setState(State.DISPOSED);
  }

  public synchronized void load(boolean resolve)
  {
    PackageLoader packageLoader = packageRegistry.getPackageLoader();
    load(packageLoader, resolve);
  }

  public synchronized void load(PackageLoader packageLoader, boolean resolve)
  {
    if (state == State.PROXY)
    {
      EPackage[] ePackages = null;
      ePackages = loadPackagesFromGlobalRegistry();
      if (ePackages == null)
      {
        ePackages = packageLoader.loadPackages(this);
      }

      for (EPackage ePackage : ePackages)
      {
        String packageURI = ePackage.getNsURI();
        InternalCDOPackageInfo packageInfo = getPackageInfo(packageURI);
        packageRegistry.registerPackageInfo(ePackage, packageInfo);
        if (resolve)
        {
          synchronized (ePackage)
          {
            EcoreUtil.resolveAll(ePackage);
          }
        }
      }

      setState(State.LOADED);
    }
  }

  public void write(CDODataOutput out, boolean withPackages) throws IOException
  {
    if (TRACER.isEnabled())
    {
      TRACER.format("Writing {0}", this); //$NON-NLS-1$
    }

    out.writeBoolean(withPackages);
    if (withPackages)
    {
      CDOModelUtil.writePackage(out, packageInfos[0].getEPackage(), true, packageRegistry);
    }

    out.writeCDOPackageUnitType(originalType);
    out.writeLong(timeStamp);
    out.writeInt(packageInfos.length);
    for (InternalCDOPackageInfo packageInfo : packageInfos)
    {
      out.writeCDOPackageInfo(packageInfo);
    }
  }

  public void read(CDODataInput in, ResourceSet resourceSet) throws IOException
  {
    if (packageRegistry == null)
    {
      packageRegistry = (InternalCDOPackageRegistry)in.getPackageRegistry();
      if (packageRegistry == null)
      {
        EPackage.Registry resourceSetPackageRegistry = resourceSet.getPackageRegistry();
        if (resourceSetPackageRegistry instanceof InternalCDOPackageRegistry)
        {
          packageRegistry = (InternalCDOPackageRegistry)resourceSetPackageRegistry;
        }
      }
    }

    EPackage ePackage = null;
    boolean withPackages = in.readBoolean();
    if (withPackages)
    {
      CheckUtil.checkArg(resourceSet, "resourceSet"); //$NON-NLS-1$
      ePackage = CDOModelUtil.readPackage(in, resourceSet, true);
      EPackage globalPackage = loadPackageFromGlobalRegistry(ePackage.getNsURI());
      if (globalPackage != null)
      {
        ePackage = globalPackage;
      }

      setState(State.LOADED);
    }

    originalType = in.readCDOPackageUnitType();
    timeStamp = in.readLong();
    packageInfos = new InternalCDOPackageInfo[in.readInt()];
    for (int i = 0; i < packageInfos.length; i++)
    {
      packageInfos[i] = (InternalCDOPackageInfo)in.readCDOPackageInfo();
      packageInfos[i].setPackageUnit(this);
    }

    if (ePackage != null)
    {
      attachPackageInfos(ePackage);
    }

    if (TRACER.isEnabled())
    {
      TRACER.format("Read {0}", this); //$NON-NLS-1$
    }
  }

  public int compareTo(CDOPackageUnit o)
  {
    return getID().compareTo(o.getID());
  }

  @Override
  public String toString()
  {
    String fmt = "CDOPackageUnit[id={0}, state={1}, type={2}, originalType={3}, timeStamp={4}]"; //$NON-NLS-1$
    return MessageFormat.format(fmt, getID(), getState(), getType(), getOriginalType(),
        CDOCommonUtil.formatTimeStamp(getTimeStamp()));
  }

  private void initPackageInfos(EPackage ePackage, List<InternalCDOPackageInfo> result)
  {
    InternalCDOPackageInfo packageInfo = (InternalCDOPackageInfo)CDOModelUtil.createPackageInfo();
    packageInfo.setPackageUnit(this);
    packageInfo.setPackageURI(ePackage.getNsURI());
    packageInfo.setParentURI(ePackage.getESuperPackage() == null ? null : ePackage.getESuperPackage().getNsURI());

    packageRegistry.basicPut(ePackage.getNsURI(), ePackage);
    packageRegistry.registerPackageInfo(ePackage, packageInfo);
    result.add(packageInfo);
    for (EPackage subPackage : ePackage.getESubpackages())
    {
      initPackageInfos(subPackage, result);
    }
  }

  private void attachPackageInfos(EPackage ePackage)
  {
    InternalCDOPackageInfo packageInfo = getPackageInfo(ePackage.getNsURI());
    if (packageInfo != null)
    {
      packageRegistry.registerPackageInfo(ePackage, packageInfo);
    }

    for (EPackage subPackage : ePackage.getESubpackages())
    {
      attachPackageInfos(subPackage);
    }
  }

  private EPackage[] loadPackagesFromGlobalRegistry()
  {
    EPackage[] ePackages = new EPackage[packageInfos.length];
    for (int i = 0; i < ePackages.length; i++)
    {
      ePackages[i] = loadPackageFromGlobalRegistry(packageInfos[i].getPackageURI());
      if (ePackages[i] == null)
      {
        return null;
      }
    }

    return ePackages;
  }

  private EPackage loadPackageFromGlobalRegistry(String packageURI)
  {
    return EPackage.Registry.INSTANCE.getEPackage(packageURI);
  }
}


text:
package com.velvetPearl.lottery.dataAccess.firebase;

import com.google.firebase.database.ChildEventListener;
import com.google.firebase.database.Query;
import com.google.firebase.database.ValueEventListener;

/**
 * Created by Stensig on 15-Oct-16.
 */

public class FirebaseQueryObject {

    public ChildEventListener listener;
    public Query query;

    public FirebaseQueryObject() {
        this.query = null;
        this.listener = null;
    }

    public FirebaseQueryObject(Query query, ChildEventListener listener) {
        this.query = query;
        this.listener = listener;
    }

}

redpajama_set_name: RedPajamaGithub


text:
import sublime, sublime_plugin

class $1Command(sublime_plugin.$2Command):
	def run(self$3):
		print("preliminary test>>\n\n\tIts Working! :)")
		$4

r"""
$1--- camelCase, starting with uppercase (as is the class naming
		convention), word describing what it does, say
		`HipHopCommand`. will be exposed to api as `hip_hop()`
		to call it use`view.run_command(hip_hop)`
$2--- either `Text` or `Application` or `
$3--- parameter list, if required
"""


text:
@font-face {
  font-family: "OpenSans";
  src: url("/_app_files/fonts/Open_Sans/OpenSans-Bold.ttf") format("truetype");
  font-weight: bold;
  font-style: normal; }
@font-face {
  font-family: "OpenSans";
  src: url("/_app_files/fonts/Open_Sans/OpenSans-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal; }
@font-face {
  font-family: "OpenSans";
  src: url("/_app_files/fonts/Open_Sans/OpenSans-Italic.ttf") format("truetype");
  font-weight: normal;
  font-style: italic; }
@font-face {
  font-family: "OpenSans";
  src: url("/_app_files/fonts/Open_Sans/OpenSans-BoldItalic.ttf") format("truetype");
  font-weight: bold;
  font-style: italic; }
@font-face {
  font-family: "RobotoCondensed";
  src: url("/_app_files/fonts/Roboto_Condensed/RobotoCondensed-Bold.ttf") format("truetype");
  font-weight: bold;
  font-style: normal; }
@font-face {
  font-family: "RobotoCondensed";
  src: url("/_app_files/fonts/Roboto_Condensed/RobotoCondensed-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal; }
@font-face {
  font-family: "RobotoCondensed";
  src: url("/_app_files/fonts/Roboto_Condensed/RobotoCondensed-Italic.ttf") format("truetype");
  font-weight: normal;
  font-style: italic; }
@font-face {
  font-family: "Rupster";
  src: url("/_app_files/fonts/RupsterScriptFree/RupsterScriptFree.ttf") format("truetype");
  font-weight: normal;
  font-style: normal; }
body {
  font-family: "RobotoCondensed", sans-serif;
  background-image: url("/_app_files/images/background.png");
  color: #FFF; }

.container {
  min-height: 100vh;
  display: flex;
  justify-content: space-around;
  align-items: center;
  align-content: center; }
  .container .panel-container {
    margin: auto;
    width: 45%; }
    @media only screen and (max-width: 700px) {
      .container .panel-container {
        width: 90%; } }

#loader {
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 9999;
  background-color: rgba(0, 0, 0, 0.8); }
  #loader img {
    display: block;
    width: 50px; }

.panel {
  position: relative;
  width: 100%;
  padding: 20px;
  background: rgba(255, 255, 255, 0.3);
  overflow: hidden;
  border: none;
  box-shadow: 5px 5px 5px #88BBD6;
  border-top-left-radius: 0; }

.nav-tabs > li.active > a, .nav-tabs > li.active > a, .nav-tabs > li.active > a:focus, .nav-tabs > li.active > a:hover {
  border: none;
  background: rgba(255, 255, 255, 0.3);
  font-weight: bold;
  font-size: 1.2em; }

#login-button {
  margin-top: 5px;
  width: 55%;
  background-color: #8DCC57;
  border-color: #82b443; }

#register-button {
  margin-top: 5px;
  width: 75%;
  background-color: #99D3DF;
  border-color: #88BBD6; }

h1 {
  font-family: "Rupster";
  color: #88BBD6;
  padding: 20px 0;
  text-align: center;
  font-size: 3em; }

span.version {
  display: block;
  float: right;
  font-family: "RobotoCondensed";
  font-style: italic;
  color: #88BBD6; }

.tab-content {
  padding-top: 10px;
  padding-bottom: 30px; }
  .tab-content .form-group {
    margin: auto;
    width: 75%; }
    @media (max-width: 500px) {
      .tab-content .form-group {
        width: 100%; } }
    .tab-content .form-group input {
      font-style: italic; }
    .tab-content .form-group label {
      color: #555; }
    .tab-content .form-group .help-block {
      min-height: 20px;
      margin-bottom: 0; }

#about {
  background-color: rgba(138, 187, 214, 0.6);
  background: linear-gradient(-150deg, transparent 1.5em, rgba(136, 187, 214, 0.6) 0);
  padding: 10px;
  padding-top: 1.5em;
  position: relative;
  border-radius: .5em;
  color: #555;
  text-align: justify;
  text-indent: 1em;
  font-size: 1.1em; }

#about::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1.73em;
  height: 3em;
  background: linear-gradient(to left bottom, transparent 50%, rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0.4)) 100% 0 no-repeat;
  transform: translateY(-1.3em) rotate(-30deg);
  transform-origin: bottom right;
  border-bottom-left-radius: .5em;
  box-shadow: -0.2em 0.2em 0.3em -0.1em rgba(0, 0, 0, 0.15); }

.social-buttons {
  padding: 15px;
  margin-top: 25px;
  display: flex;
  justify-content: space-around;
  align-content: space-around;
  flex-wrap: wrap; }
  .social-buttons > * {
    margin: 5px; }

/*# sourceMappingURL=style.css.map */


text:
/**
 * Implementation notes.
 *
 * 1. Extend `LRParserGeneratorDefault`
 * 2. Implement `generateParserData()`
 * 3. Implement all specific to the target language
 *    functionality in the trait file.
 */

const LRParserGeneratorDefault = require(ROOT + 'lr/lr-parser-generator-default').default;
const JuliaParserGeneratorTrait = require('../julia-parser-generator-trait');

import fs from 'fs';
import path from 'path';

/**
 * Generic template for all LR parsers in the Example language.
 */
const JL_LR_PARSER_TEMPLATE = fs.readFileSync(
  `${__dirname}/../templates/lr.template.jl`,
  'utf-8',
);

/**
 * LR parser generator for Julia language.
 */
export default class LRParserGeneratorJulia extends LRParserGeneratorDefault {

  /**
   * Instance constructor.
   */
  constructor({
    grammar,
    outputFile,
    options = {},
  }) {
    super({grammar, outputFile, options})
      .setTemplate(JL_LR_PARSER_TEMPLATE);
    this._lexHandlers = [];
    this._productionHandlers = [];

    /**
     * Actual class name of your parser. Here we infer from the output filename.
     */
    this._parserClassName = path.basename(
      outputFile,
      path.extname(outputFile),
    );

    /**
     * The trait provides methods for lex and production handlers, as well
     * as some very specific code generation for the target language.
     */
    Object.assign(this, JuliaParserGeneratorTrait);
  }

  /**
   * Generates parser code.
   */
  generateParserData() {
    super.generateParserData();
    this.generateLexHandlers();
    this.generateProductionHandlers();
  }
};


text:
angular.module('streama').controller('adminVideoCtrl', [
	'$scope', 'apiService', '$stateParams', 'modalService', '$state', 'uploadService',
	function ($scope, apiService, $stateParams, modalService, $state, uploadService) {
    $scope.loading = true;

		apiService.genericVideo.get($stateParams.videoId).then(function (response) {
			var data = response.data;
			$scope.video = data;
      $scope.loading = false;
		});

    $scope.openVideoModal = function () {
      modalService.genericVideoModal($scope.video, function (data) {
        angular.merge($scope.video, data)
      });
    };

		$scope.delete = function(){
      alertify.set({ buttonReverse: true, labels: {ok: "Yes", cancel : "Cancel"}});
			alertify.confirm("Are you sure, you want to delete this Video?", function (confirmed) {
				if(confirmed){
					apiService.genericVideo.delete($stateParams.videoId).then(function () {
						$state.go('admin.videos');
					});
				}
			})
		};

		$scope.addToCurrentNotification = function(){
			apiService.notification.addMovieToCurrentNotification($stateParams.movieId).then(function () {
				alertify.success('The movie was added to the current notification queue.');
			});
		};

    $scope.manageFiles = function(video){
      modalService.fileManagerModal(video);
    };

		$scope.addSimilarMovieToStreama = function(movie, redirect){
      alertify.set({ buttonReverse: true, labels: {ok: "Yes", cancel : "Cancel"}});

			alertify.confirm("Do you want to add \""+ movie.title +"\" to the Streama library?", function (confirmed) {
				if(confirmed){

          var apiId = movie.id;
          delete movie.id;
          movie.apiId = apiId;

          apiService.movie.save(movie).then(function (data) {
						if(redirect){
							$state.go('admin.movie', {movieId: data.data.id});
						}
          });
				}
			})
		};

		$scope.uploadStatus = {};

		$scope.upload = uploadService.doUpload.bind(uploadService, $scope.uploadStatus, 'video/uploadFile.json?id=' + $stateParams.movieId, function (data) {
			$scope.uploadStatus.percentage = null;

			if(data.error) return

			$scope.video.files = $scope.video.files || [];
			$scope.video.files.push(data);
		}, function () {});

}]);


text:
<!doctype html>
<html lang="en">
  <head>
    <title>End2end Test Runner</title>
    <meta charset="utf-8">
    <base href="../..">
    <script src="app/lib/angular-scenario/angular-scenario.js" ng-autotest ng-useamd></script>
    <script src="test/e2e/setup.js"></script>
    <script src="test/e2e/scenarios.js"></script>
  </head>
  <body>
  </body>
</html>


text:
/**
 *
 */
package edu.berkeley.nlp.PCFGLA;

import edu.berkeley.nlp.PCFGLA.smoothing.Smoother;
import edu.berkeley.nlp.syntax.Trees.PennTreeRenderer;
import edu.berkeley.nlp.util.PriorityQueue;

/**
 * @author petrov
 *
 */
public class HierarchicalAdaptiveGrammar extends HierarchicalGrammar {

	private static final long serialVersionUID = 1L;

	public HierarchicalAdaptiveGrammar(short[] nSubStates, boolean findClosedPaths, Smoother smoother, Grammar oldGrammar, double thresh) {
		super(nSubStates, findClosedPaths, smoother, oldGrammar, thresh);
	}

	public HierarchicalAdaptiveGrammar(Grammar gr){
		super(gr.numSubStates,gr.findClosedPaths,gr.smoother,gr,gr.threshold);

		for (BinaryRule oldRule : gr.binaryRuleMap.keySet()) {
			HierarchicalAdaptiveBinaryRule newRule = new HierarchicalAdaptiveBinaryRule(oldRule);
			addBinary(newRule);
		}
		for (UnaryRule oldRule : gr.unaryRuleMap.keySet()) {
			HierarchicalAdaptiveUnaryRule newRule = new HierarchicalAdaptiveUnaryRule(oldRule);
			addUnary(newRule);
		}
		if (true) {
			closedSumRulesWithParent = closedViterbiRulesWithParent = unaryRulesWithParent;
			closedSumRulesWithChild = closedViterbiRulesWithChild = unaryRulesWithC;
		}
		else computePairsOfUnaries();
		makeCRArrays();
		isGrammarTag = gr.isGrammarTag;
	}

	public HierarchicalAdaptiveGrammar newInstance(short[] newNumSubStates) {
		return new HierarchicalAdaptiveGrammar(newNumSubStates,this.findClosedPaths,this.smoother,this,this.threshold);
	}

   void printLevelCounts(){
  	 int nBinaryParams=0, nUnaryParams=0, nBinaryFringeParams=0, nUnaryFringeParams=0;
  	 PriorityQueue<HierarchicalAdaptiveBinaryRule> pQb = new PriorityQueue<HierarchicalAdaptiveBinaryRule>();
  	 PriorityQueue<HierarchicalAdaptiveUnaryRule> pQu = new PriorityQueue<HierarchicalAdaptiveUnaryRule>();
		for (int state = 0; state < numStates; state++) {
			int[] counts = new int[8];
			BinaryRule[] parentRules = this.splitRulesWithP(state);
			if (parentRules.length==0) continue;
			double totalParamState =0, totalRulesState = 0;
			for (int i = 0; i < parentRules.length; i++) {
				HierarchicalAdaptiveBinaryRule r =(HierarchicalAdaptiveBinaryRule)parentRules[i];
//				PennTreeRenderer.render(r.hierarchy);
				counts[r.hierarchy.getDepth()]++;
				nBinaryParams += r.countNonZeroFeatures();
				int n = r.countNonZeroFringeFeatures();
				nBinaryFringeParams += n;
				pQb.add(r,n);
				totalParamState+=n;
				totalRulesState++;
			}
  		System.out.print(tagNumberer.object(state)+", binary rules per level: ");

  		for (int i=1; i<8; i++){
  			System.out.print(counts[i]+" ");
  		}
  		System.out.print(" with \n "+tagNumberer.object(state)+"\t"+ totalParamState/totalRulesState +"\n parameters on average :'\n");
		}
//		for (int i=0; i<6; i++){
//			System.out.println(counts[i]+" binary rules are split upto level "+i);
//			counts[i] = 0;
//		}
		for (int state = 0; state < numStates; state++) {
			int[] counts = new int[8];
			UnaryRule[] unaries = this.getClosedSumUnaryRulesByParent(state);
			//this.getClosedSumUnaryRulesByParent(state);//
			if (unaries.length==0) continue;
			for (int r = 0; r < unaries.length; r++) {
				HierarchicalAdaptiveUnaryRule ur =(HierarchicalAdaptiveUnaryRule)unaries[r];
//				ur.toString();
//				PennTreeRenderer.render(ur.hierarchy);
				counts[ur.hierarchy.getDepth()]++;
				nUnaryParams += ur.countNonZeroFeatures();
				int n = ur.countNonZeroFringeFeatures();
				nUnaryFringeParams += n;
//				totalParamState+=n;
//				totalRulesState++;
				pQu.add(ur,n);
			}
  		System.out.print(tagNumberer.object(state)+", unary rules per level: ");
  		for (int i=1; i<8; i++){
  			System.out.print(counts[i]+" ");
  		}
  		System.out.print("\n");
		}
		System.out.println("There are "+nBinaryParams+" binary features, of which "+ nBinaryFringeParams+" are on the fringe.");
		System.out.println("There are "+nUnaryParams+" unary features, of which "+ nUnaryFringeParams+" are on the fringe.");
		System.out.println("There are "+(nBinaryParams+nUnaryParams)+" total features, of which "+ (nBinaryFringeParams+nUnaryFringeParams)+" are on the fringe.");
		while (pQb.hasNext()){
			HierarchicalAdaptiveBinaryRule r = pQb.next();
			System.out.println(r.toStringShort()+"\t"+r.countNonZeroFringeFeatures());
		}
		while (pQu.hasNext()){
			HierarchicalAdaptiveUnaryRule r = pQu.next();
			System.out.println(r.toStringShort()+"\t"+r.countNonZeroFringeFeatures());
		}
//		for (int i=0; i<6; i++){
//			System.out.println(counts[i]+" unary rules are split upto level "+i);
//		}

	}

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Gloeosporium caryae Ellis & Everh.

### Remarks
null


text:
package xenapi

import (
	"fmt"
	"github.com/amfranz/go-xmlrpc-client"
	"reflect"
	"strconv"
	"time"
)

var _ = fmt.Errorf
var _ = xmlrpc.NewClient
var _ = reflect.TypeOf
var _ = strconv.Atoi
var _ = time.UTC

type CrashdumpRecord struct {
	// Unique identifier/object reference
	UUID string
	// the virtual machine
	VM VMRef
	// the virtual disk
	VDI VDIRef
	// additional configuration
	OtherConfig map[string]string
}

type CrashdumpRef string

// A VM crashdump
type CrashdumpClass struct {
	client *Client
}

// GetAllRecords Return a map of crashdump references to crashdump records for all crashdumps known to the system.
func (_class CrashdumpClass) GetAllRecords(sessionID SessionRef) (_retval map[CrashdumpRef]CrashdumpRecord, _err error) {
	_method := "crashdump.get_all_records"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg)
	if _err != nil {
		return
	}
	_retval, _err = convertCrashdumpRefToCrashdumpRecordMapToGo(_method + " -> ", _result.Value)
	return
}

// GetAll Return a list of all the crashdumps known to the system.
func (_class CrashdumpClass) GetAll(sessionID SessionRef) (_retval []CrashdumpRef, _err error) {
	_method := "crashdump.get_all"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg)
	if _err != nil {
		return
	}
	_retval, _err = convertCrashdumpRefSetToGo(_method + " -> ", _result.Value)
	return
}

// Destroy Destroy the specified crashdump
func (_class CrashdumpClass) Destroy(sessionID SessionRef, self CrashdumpRef) (_err error) {
	_method := "crashdump.destroy"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertCrashdumpRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_, _err =  _class.client.APICall(_method, _sessionIDArg, _selfArg)
	return
}

// RemoveFromOtherConfig Remove the given key and its corresponding value from the other_config field of the given crashdump.  If the key is not in that Map, then do nothing.
func (_class CrashdumpClass) RemoveFromOtherConfig(sessionID SessionRef, self CrashdumpRef, key string) (_err error) {
	_method := "crashdump.remove_from_other_config"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertCrashdumpRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_keyArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "key"), key)
	if _err != nil {
		return
	}
	_, _err =  _class.client.APICall(_method, _sessionIDArg, _selfArg, _keyArg)
	return
}

// AddToOtherConfig Add the given key-value pair to the other_config field of the given crashdump.
func (_class CrashdumpClass) AddToOtherConfig(sessionID SessionRef, self CrashdumpRef, key string, value string) (_err error) {
	_method := "crashdump.add_to_other_config"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertCrashdumpRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_keyArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "key"), key)
	if _err != nil {
		return
	}
	_valueArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "value"), value)
	if _err != nil {
		return
	}
	_, _err =  _class.client.APICall(_method, _sessionIDArg, _selfArg, _keyArg, _valueArg)
	return
}

// SetOtherConfig Set the other_config field of the given crashdump.
func (_class CrashdumpClass) SetOtherConfig(sessionID SessionRef, self CrashdumpRef, value map[string]string) (_err error) {
	_method := "crashdump.set_other_config"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertCrashdumpRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_valueArg, _err := convertStringToStringMapToXen(fmt.Sprintf("%s(%s)", _method, "value"), value)
	if _err != nil {
		return
	}
	_, _err =  _class.client.APICall(_method, _sessionIDArg, _selfArg, _valueArg)
	return
}

// GetOtherConfig Get the other_config field of the given crashdump.
func (_class CrashdumpClass) GetOtherConfig(sessionID SessionRef, self CrashdumpRef) (_retval map[string]string, _err error) {
	_method := "crashdump.get_other_config"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertCrashdumpRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)
	if _err != nil {
		return
	}
	_retval, _err = convertStringToStringMapToGo(_method + " -> ", _result.Value)
	return
}

// GetVDI Get the VDI field of the given crashdump.
func (_class CrashdumpClass) GetVDI(sessionID SessionRef, self CrashdumpRef) (_retval VDIRef, _err error) {
	_method := "crashdump.get_VDI"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertCrashdumpRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)
	if _err != nil {
		return
	}
	_retval, _err = convertVDIRefToGo(_method + " -> ", _result.Value)
	return
}

// GetVM Get the VM field of the given crashdump.
func (_class CrashdumpClass) GetVM(sessionID SessionRef, self CrashdumpRef) (_retval VMRef, _err error) {
	_method := "crashdump.get_VM"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertCrashdumpRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)
	if _err != nil {
		return
	}
	_retval, _err = convertVMRefToGo(_method + " -> ", _result.Value)
	return
}

// GetUUID Get the uuid field of the given crashdump.
func (_class CrashdumpClass) GetUUID(sessionID SessionRef, self CrashdumpRef) (_retval string, _err error) {
	_method := "crashdump.get_uuid"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertCrashdumpRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)
	if _err != nil {
		return
	}
	_retval, _err = convertStringToGo(_method + " -> ", _result.Value)
	return
}

// GetByUUID Get a reference to the crashdump instance with the specified UUID.
func (_class CrashdumpClass) GetByUUID(sessionID SessionRef, uuid string) (_retval CrashdumpRef, _err error) {
	_method := "crashdump.get_by_uuid"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_uuidArg, _err := convertStringToXen(fmt.Sprintf("%s(%s)", _method, "uuid"), uuid)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _uuidArg)
	if _err != nil {
		return
	}
	_retval, _err = convertCrashdumpRefToGo(_method + " -> ", _result.Value)
	return
}

// GetRecord Get a record containing the current state of the given crashdump.
func (_class CrashdumpClass) GetRecord(sessionID SessionRef, self CrashdumpRef) (_retval CrashdumpRecord, _err error) {
	_method := "crashdump.get_record"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertCrashdumpRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)
	if _err != nil {
		return
	}
	_retval, _err = convertCrashdumpRecordToGo(_method + " -> ", _result.Value)
	return
}


text:
package com.dorinbrage.easyrs.processor.enums;

/**
 *
 * @author Dorin Brage
 */
public enum UUIDIdentifier {

  ID("getId()"),

  GUID("getGuid()"),

  UUID("getUuid()");

  private String value;

  private UUIDIdentifier(String value) {
    this.value = value;
  }

  public String getValue() {
    return value;
  }

  public void setValue(String value) {
    this.value = value;
  }
}


text:
import os
from django.utils.translation import ugettext_lazy as _

SITE_ID = 1

BASE_DIR = os.path.dirname(__file__)

# Absolute filesystem path to the directory that will hold user-uploaded files.
STATIC_ROOT = os.path.join(BASE_DIR, 'web/static')

STATIC_URL = '/static/'

ROOT_URLCONF = 'urls'
SECRET_KEY = 'secretkey'
SITE_ROOT = os.path.dirname(os.path.abspath(__file__))

LANGUAGE_CODE = 'en'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

LANGUAGES = (
    ('en', _('English')),
    ('de', _('German')),
    ('ru', _('Russian')),
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.sessions',
    'django.contrib.contenttypes',
    'django.contrib.admin',
    'django.contrib.messages',
    'django.contrib.sites',
    'guardian',
    'mptt',
    'markitup',
    'easy_thumbnails',
    'image_cropping',
    'embed_video',
    'taggit',
    'pages',
    'pagesext',
)

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': 'test.db',                      # Or path to database file if using sqlite3.
        'USER': '',                      # Not used with sqlite3.
        'PASSWORD': '',                  # Not used with sqlite3.
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
    }
}

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
    }
}

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.locale.LocaleMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware'
)

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.contrib.messages.context_processors.messages',
)

# Templates settings
TEMPLATE_DIRS = tuple([os.path.join(BASE_DIR, app_name, 'templates') for app_name in INSTALLED_APPS])
TEMPLATE_DIRS += tuple([os.path.join(BASE_DIR, 'templates')])

# django-guardian settings
AUTHENTICATION_BACKENDS = (
    'django.contrib.auth.backends.ModelBackend',
    'guardian.backends.ObjectPermissionBackend',
)

ANONYMOUS_USER_ID = -1

# MarkItUp settings
MARKITUP_FILTER = ('markdown.markdown', {'safe_mode': False, 'extensions': ['extra', 'meta', 'nl2br']})

# pages
PAGES_CACHE_DELETE = True
PAGES_PAGE_USE_EXT_CONTENT_TYPES = True
PAGES_PAGE_EXT_CONTENT_TYPES = (
    'pagesext.models.pagetagscontent',
    'pagesext.models.pageimagecontent',
    'pagesext.models.pagevideocontent',
    'pagesext.models.pagefilecontent'
)
PAGES_PAGE_EXT_CONTENT_INLINES = (
    'pagesext.admin.pagetagscontent',
    'pagesext.admin.pageimagecontent',
    'pagesext.admin.pagevideocontent',
    'pagesext.admin.pagefilecontent'
)
PAGES_FALLBACK_LANGUAGE = 'en'


text:
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

using System;
using System.Collections.Generic;
using System.Linq;

using Mono.Cecil.Cil;

namespace ICSharpCode.Decompiler.FlowAnalysis
{
	/// <summary>
	/// Additional info about opcodes.
	/// </summary>
	internal sealed class OpCodeInfo
	{
		public static bool IsUnconditionalBranch(OpCode opcode)
		{
			if (opcode.OpCodeType == OpCodeType.Prefix)
				return false;
			switch (opcode.FlowControl) {
				case FlowControl.Branch:
				case FlowControl.Throw:
				case FlowControl.Return:
					return true;
				case FlowControl.Next:
				case FlowControl.Call:
				case FlowControl.Cond_Branch:
					return false;
				default:
					throw new NotSupportedException(opcode.FlowControl.ToString());
			}
		}

		static readonly OpCodeInfo[] knownOpCodes = {
			#region Base Instructions
			new OpCodeInfo(OpCodes.Add)        { CanThrow = false },
			new OpCodeInfo(OpCodes.Add_Ovf)    { CanThrow = true  },
			new OpCodeInfo(OpCodes.Add_Ovf_Un) { CanThrow = true  },
			new OpCodeInfo(OpCodes.And)        { CanThrow = false },
			new OpCodeInfo(OpCodes.Arglist)    { CanThrow = false },
			new OpCodeInfo(OpCodes.Beq)        { CanThrow = false },
			new OpCodeInfo(OpCodes.Beq_S)      { CanThrow = false },
			new OpCodeInfo(OpCodes.Bge)        { CanThrow = false },
			new OpCodeInfo(OpCodes.Bge_S)      { CanThrow = false },
			new OpCodeInfo(OpCodes.Bge_Un)     { CanThrow = false },
			new OpCodeInfo(OpCodes.Bge_Un_S)   { CanThrow = false },
			new OpCodeInfo(OpCodes.Bgt)        { CanThrow = false },
			new OpCodeInfo(OpCodes.Bgt_S)      { CanThrow = false },
			new OpCodeInfo(OpCodes.Bgt_Un)     { CanThrow = false },
			new OpCodeInfo(OpCodes.Bgt_Un_S)   { CanThrow = false },
			new OpCodeInfo(OpCodes.Ble)        { CanThrow = false },
			new OpCodeInfo(OpCodes.Ble_S)      { CanThrow = false },
			new OpCodeInfo(OpCodes.Ble_Un)     { CanThrow = false },
			new OpCodeInfo(OpCodes.Ble_Un_S)   { CanThrow = false },
			new OpCodeInfo(OpCodes.Blt)        { CanThrow = false },
			new OpCodeInfo(OpCodes.Blt_S)      { CanThrow = false },
			new OpCodeInfo(OpCodes.Blt_Un)     { CanThrow = false },
			new OpCodeInfo(OpCodes.Blt_Un_S)   { CanThrow = false },
			new OpCodeInfo(OpCodes.Bne_Un)     { CanThrow = false },
			new OpCodeInfo(OpCodes.Bne_Un_S)   { CanThrow = false },
			new OpCodeInfo(OpCodes.Br)         { CanThrow = false },
			new OpCodeInfo(OpCodes.Br_S)       { CanThrow = false },
			new OpCodeInfo(OpCodes.Break)      { CanThrow = true  },
			new OpCodeInfo(OpCodes.Brfalse)    { CanThrow = false },
			new OpCodeInfo(OpCodes.Brfalse_S)  { CanThrow = false },
			new OpCodeInfo(OpCodes.Brtrue)     { CanThrow = false },
			new OpCodeInfo(OpCodes.Brtrue_S)   { CanThrow = false },
			new OpCodeInfo(OpCodes.Call)       { CanThrow = true  },
			new OpCodeInfo(OpCodes.Calli)      { CanThrow = true  },
			new OpCodeInfo(OpCodes.Ceq)        { CanThrow = false },
			new OpCodeInfo(OpCodes.Cgt)        { CanThrow = false },
			new OpCodeInfo(OpCodes.Cgt_Un)     { CanThrow = false },
			new OpCodeInfo(OpCodes.Ckfinite)   { CanThrow = true  },
			new OpCodeInfo(OpCodes.Clt)        { CanThrow = false },
			new OpCodeInfo(OpCodes.Clt_Un)     { CanThrow = false },
			// conv.<to type>
			new OpCodeInfo(OpCodes.Conv_I1)    { CanThrow = false },
			new OpCodeInfo(OpCodes.Conv_I2)    { CanThrow = false },
			new OpCodeInfo(OpCodes.Conv_I4)    { CanThrow = false },
			new OpCodeInfo(OpCodes.Conv_I8)    { CanThrow = false },
			new OpCodeInfo(OpCodes.Conv_R4)    { CanThrow = false },
			new OpCodeInfo(OpCodes.Conv_R8)    { CanThrow = false },
			new OpCodeInfo(OpCodes.Conv_U1)    { CanThrow = false },
			new OpCodeInfo(OpCodes.Conv_U2)    { CanThrow = false },
			new OpCodeInfo(OpCodes.Conv_U4)    { CanThrow = false },
			new OpCodeInfo(OpCodes.Conv_U8)    { CanThrow = false },
			new OpCodeInfo(OpCodes.Conv_I)     { CanThrow = false },
			new OpCodeInfo(OpCodes.Conv_U)     { CanThrow = false },
			new OpCodeInfo(OpCodes.Conv_R_Un)  { CanThrow = false },
			// conv.ovf.<to type>
			new OpCodeInfo(OpCodes.Conv_Ovf_I1) { CanThrow = true},
			new OpCodeInfo(OpCodes.Conv_Ovf_I2) { CanThrow = true},
			new OpCodeInfo(OpCodes.Conv_Ovf_I4) { CanThrow = true},
			new OpCodeInfo(OpCodes.Conv_Ovf_I8) { CanThrow = true},
			new OpCodeInfo(OpCodes.Conv_Ovf_U1) { CanThrow = true},
			new OpCodeInfo(OpCodes.Conv_Ovf_U2) { CanThrow = true},
			new OpCodeInfo(OpCodes.Conv_Ovf_U4) { CanThrow = true},
			new OpCodeInfo(OpCodes.Conv_Ovf_U8) { CanThrow = true},
			new OpCodeInfo(OpCodes.Conv_Ovf_I)  { CanThrow = true},
			new OpCodeInfo(OpCodes.Conv_Ovf_U)  { CanThrow = true},
			// conv.ovf.<to type>.un
			new OpCodeInfo(OpCodes.Conv_Ovf_I1_Un) { CanThrow = true },
			new OpCodeInfo(OpCodes.Conv_Ovf_I2_Un) { CanThrow = true },
			new OpCodeInfo(OpCodes.Conv_Ovf_I4_Un) { CanThrow = true },
			new OpCodeInfo(OpCodes.Conv_Ovf_I8_Un) { CanThrow = true },
			new OpCodeInfo(OpCodes.Conv_Ovf_U1_Un) { CanThrow = true },
			new OpCodeInfo(OpCodes.Conv_Ovf_U2_Un) { CanThrow = true },
			new OpCodeInfo(OpCodes.Conv_Ovf_U4_Un) { CanThrow = true },
			new OpCodeInfo(OpCodes.Conv_Ovf_U8_Un) { CanThrow = true },
			new OpCodeInfo(OpCodes.Conv_Ovf_I_Un)  { CanThrow = true },
			new OpCodeInfo(OpCodes.Conv_Ovf_U_Un)  { CanThrow = true },

			//new OpCodeInfo(OpCodes.Cpblk)      { CanThrow = true }, - no idea whether this might cause trouble for the type system, C# shouldn't use it so I'll disable it
			new OpCodeInfo(OpCodes.Div)        { CanThrow = true },
			new OpCodeInfo(OpCodes.Div_Un)     { CanThrow = true },
			new OpCodeInfo(OpCodes.Dup)        { CanThrow = true, IsMoveInstruction = true },
			new OpCodeInfo(OpCodes.Endfilter)  { CanThrow = false },
			new OpCodeInfo(OpCodes.Endfinally) { CanThrow = false },
			//new OpCodeInfo(OpCodes.Initblk)    { CanThrow = true }, - no idea whether this might cause trouble for the type system, C# shouldn't use it so I'll disable it
			//new OpCodeInfo(OpCodes.Jmp)        { CanThrow = true } - We don't support non-local control transfers.
			new OpCodeInfo(OpCodes.Ldarg)   { CanThrow = false, IsMoveInstruction = true },
			new OpCodeInfo(OpCodes.Ldarg_0) { CanThrow = false, IsMoveInstruction = true },
			new OpCodeInfo(OpCodes.Ldarg_1) { CanThrow = false, IsMoveInstruction = true },
			new OpCodeInfo(OpCodes.Ldarg_2) { CanThrow = false, IsMoveInstruction = true },
			new OpCodeInfo(OpCodes.Ldarg_3) { CanThrow = false, IsMoveInstruction = true },
			new OpCodeInfo(OpCodes.Ldarg_S) { CanThrow = false, IsMoveInstruction = true },
			new OpCodeInfo(OpCodes.Ldarga)   { CanThrow = false },
			new OpCodeInfo(OpCodes.Ldarga_S) { CanThrow = false },
			new OpCodeInfo(OpCodes.Ldc_I4)    { CanThrow = false },
			new OpCodeInfo(OpCodes.Ldc_I4_M1) { CanThrow = false },
			new OpCodeInfo(OpCodes.Ldc_I4_0) { CanThrow = false },
			new OpCodeInfo(OpCodes.Ldc_I4_1) { CanThrow = false },
			new OpCodeInfo(OpCodes.Ldc_I4_2) { CanThrow = false },
			new OpCodeInfo(OpCodes.Ldc_I4_3) { CanThrow = false },
			new OpCodeInfo(OpCodes.Ldc_I4_4) { CanThrow = false },
			new OpCodeInfo(OpCodes.Ldc_I4_5) { CanThrow = false },
			new OpCodeInfo(OpCodes.Ldc_I4_6) { CanThrow = false },
			new OpCodeInfo(OpCodes.Ldc_I4_7) { CanThrow = false },
			new OpCodeInfo(OpCodes.Ldc_I4_8) { CanThrow = false },
			new OpCodeInfo(OpCodes.Ldc_I4_S) { CanThrow = false },
			new OpCodeInfo(OpCodes.Ldc_I8) { CanThrow = false },
			new OpCodeInfo(OpCodes.Ldc_R4) { CanThrow = false },
			new OpCodeInfo(OpCodes.Ldc_R8) { CanThrow = false },
			new OpCodeInfo(OpCodes.Ldftn)  { CanThrow = false },
			// ldind.<type>
			new OpCodeInfo(OpCodes.Ldind_I1)  { CanThrow = true },
			new OpCodeInfo(OpCodes.Ldind_I2)  { CanThrow = true },
			new OpCodeInfo(OpCodes.Ldind_I4)  { CanThrow = true },
			new OpCodeInfo(OpCodes.Ldind_I8)  { CanThrow = true },
			new OpCodeInfo(OpCodes.Ldind_U1)  { CanThrow = true },
			new OpCodeInfo(OpCodes.Ldind_U2)  { CanThrow = true },
			new OpCodeInfo(OpCodes.Ldind_U4)  { CanThrow = true },
			new OpCodeInfo(OpCodes.Ldind_R4)  { CanThrow = true },
			new OpCodeInfo(OpCodes.Ldind_R8)  { CanThrow = true },
			new OpCodeInfo(OpCodes.Ldind_I)   { CanThrow = true },
			new OpCodeInfo(OpCodes.Ldind_Ref) { CanThrow = true },
			// the ldloc exceptions described in the spec can only occur on methods without .localsinit - but csc always sets that flag
			new OpCodeInfo(OpCodes.Ldloc)      { CanThrow = false, IsMoveInstruction = true },
			new OpCodeInfo(OpCodes.Ldloc_0)    { CanThrow = false, IsMoveInstruction = true },
			new OpCodeInfo(OpCodes.Ldloc_1)    { CanThrow = false, IsMoveInstruction = true },
			new OpCodeInfo(OpCodes.Ldloc_2)    { CanThrow = false, IsMoveInstruction = true },
			new OpCodeInfo(OpCodes.Ldloc_3)    { CanThrow = false, IsMoveInstruction = true },
			new OpCodeInfo(OpCodes.Ldloc_S)    { CanThrow = false, IsMoveInstruction = true },
			new OpCodeInfo(OpCodes.Ldloca)     { CanThrow = false },
			new OpCodeInfo(OpCodes.Ldloca_S)   { CanThrow = false },
			new OpCodeInfo(OpCodes.Ldnull)     { CanThrow = false },
			new OpCodeInfo(OpCodes.Leave)      { CanThrow = false },
			new OpCodeInfo(OpCodes.Leave_S)    { CanThrow = false },
			new OpCodeInfo(OpCodes.Localloc)   { CanThrow = true  },
			new OpCodeInfo(OpCodes.Mul)        { CanThrow = false },
			new OpCodeInfo(OpCodes.Mul_Ovf)    { CanThrow = true  },
			new OpCodeInfo(OpCodes.Mul_Ovf_Un) { CanThrow = true  },
			new OpCodeInfo(OpCodes.Neg)        { CanThrow = false },
			new OpCodeInfo(OpCodes.Nop)        { CanThrow = false },
			new OpCodeInfo(OpCodes.Not)        { CanThrow = false },
			new OpCodeInfo(OpCodes.Or)         { CanThrow = false },
			new OpCodeInfo(OpCodes.Pop)        { CanThrow = false },
			new OpCodeInfo(OpCodes.Rem)        { CanThrow = true  },
			new OpCodeInfo(OpCodes.Rem_Un)     { CanThrow = true  },
			new OpCodeInfo(OpCodes.Ret)        { CanThrow = false },
			new OpCodeInfo(OpCodes.Shl)        { CanThrow = false },
			new OpCodeInfo(OpCodes.Shr)        { CanThrow = false },
			new OpCodeInfo(OpCodes.Shr_Un)     { CanThrow = false },
			new OpCodeInfo(OpCodes.Starg)      { CanThrow = false, IsMoveInstruction = true },
			new OpCodeInfo(OpCodes.Starg_S)    { CanThrow = false, IsMoveInstruction = true },
			new OpCodeInfo(OpCodes.Stind_I1)   { CanThrow = true },
			new OpCodeInfo(OpCodes.Stind_I2)   { CanThrow = true },
			new OpCodeInfo(OpCodes.Stind_I4)   { CanThrow = true },
			new OpCodeInfo(OpCodes.Stind_I8)   { CanThrow = true },
			new OpCodeInfo(OpCodes.Stind_R4)   { CanThrow = true },
			new OpCodeInfo(OpCodes.Stind_R8)   { CanThrow = true },
			new OpCodeInfo(OpCodes.Stind_I)    { CanThrow = true },
			new OpCodeInfo(OpCodes.Stind_Ref)  { CanThrow = true },
			new OpCodeInfo(OpCodes.Stloc)      { CanThrow = false, IsMoveInstruction = true },
			new OpCodeInfo(OpCodes.Stloc_0)    { CanThrow = false, IsMoveInstruction = true },
			new OpCodeInfo(OpCodes.Stloc_1)    { CanThrow = false, IsMoveInstruction = true },
			new OpCodeInfo(OpCodes.Stloc_2)    { CanThrow = false, IsMoveInstruction = true },
			new OpCodeInfo(OpCodes.Stloc_3)    { CanThrow = false, IsMoveInstruction = true },
			new OpCodeInfo(OpCodes.Stloc_S)    { CanThrow = false, IsMoveInstruction = true },
			new OpCodeInfo(OpCodes.Sub)        { CanThrow = false },
			new OpCodeInfo(OpCodes.Sub_Ovf)    { CanThrow = true  },
			new OpCodeInfo(OpCodes.Sub_Ovf_Un) { CanThrow = true  },
			new OpCodeInfo(OpCodes.Switch)     { CanThrow = false },
			new OpCodeInfo(OpCodes.Xor)        { CanThrow = false },
			#endregion
			#region Object model instructions
			// CanThrow is true by default - most OO instructions can throw, so we don't specify CanThrow all of the time
			new OpCodeInfo(OpCodes.Box),
			new OpCodeInfo(OpCodes.Callvirt),
			new OpCodeInfo(OpCodes.Castclass),
			new OpCodeInfo(OpCodes.Cpobj),
			new OpCodeInfo(OpCodes.Initobj) { CanThrow = false },
			new OpCodeInfo(OpCodes.Isinst)  { CanThrow = false },
			new OpCodeInfo(OpCodes.Ldelem_Any),
			// ldelem.<type>
			new OpCodeInfo(OpCodes.Ldelem_I) ,
			new OpCodeInfo(OpCodes.Ldelem_I1),
			new OpCodeInfo(OpCodes.Ldelem_I2),
			new OpCodeInfo(OpCodes.Ldelem_I4),
			new OpCodeInfo(OpCodes.Ldelem_I8),
			new OpCodeInfo(OpCodes.Ldelem_R4),
			new OpCodeInfo(OpCodes.Ldelem_R8),
			new OpCodeInfo(OpCodes.Ldelem_Ref),
			new OpCodeInfo(OpCodes.Ldelem_U1),
			new OpCodeInfo(OpCodes.Ldelem_U2),
			new OpCodeInfo(OpCodes.Ldelem_U4),
			new OpCodeInfo(OpCodes.Ldelema)  ,
			new OpCodeInfo(OpCodes.Ldfld) ,
			new OpCodeInfo(OpCodes.Ldflda),
			new OpCodeInfo(OpCodes.Ldlen) ,
			new OpCodeInfo(OpCodes.Ldobj) ,
			new OpCodeInfo(OpCodes.Ldsfld),
			new OpCodeInfo(OpCodes.Ldsflda),
			new OpCodeInfo(OpCodes.Ldstr) { CanThrow = false },
			new OpCodeInfo(OpCodes.Ldtoken) { CanThrow = false },
			new OpCodeInfo(OpCodes.Ldvirtftn),
			new OpCodeInfo(OpCodes.Mkrefany),
			new OpCodeInfo(OpCodes.Newarr),
			new OpCodeInfo(OpCodes.Newobj),
			new OpCodeInfo(OpCodes.Refanytype) { CanThrow = false },
			new OpCodeInfo(OpCodes.Refanyval),
			new OpCodeInfo(OpCodes.Rethrow),
			new OpCodeInfo(OpCodes.Sizeof) { CanThrow = false },
			new OpCodeInfo(OpCodes.Stelem_Any),
			new OpCodeInfo(OpCodes.Stelem_I1),
			new OpCodeInfo(OpCodes.Stelem_I2),
			new OpCodeInfo(OpCodes.Stelem_I4),
			new OpCodeInfo(OpCodes.Stelem_I8),
			new OpCodeInfo(OpCodes.Stelem_R4),
			new OpCodeInfo(OpCodes.Stelem_R8),
			new OpCodeInfo(OpCodes.Stelem_Ref),
			new OpCodeInfo(OpCodes.Stfld),
			new OpCodeInfo(OpCodes.Stobj),
			new OpCodeInfo(OpCodes.Stsfld),
			new OpCodeInfo(OpCodes.Throw),
			new OpCodeInfo(OpCodes.Unbox),
			new OpCodeInfo(OpCodes.Unbox_Any),
			#endregion
		};
		static readonly Dictionary<Code, OpCodeInfo> knownOpCodeDict = knownOpCodes.ToDictionary(info => info.OpCode.Code);

		public static OpCodeInfo Get(OpCode opCode)
		{
			return Get(opCode.Code);
		}

		public static OpCodeInfo Get(Code code)
		{
			OpCodeInfo info;
			if (knownOpCodeDict.TryGetValue(code, out info))
				return info;
			else
				throw new NotSupportedException(code.ToString());
		}

		OpCode opcode;

		OpCodeInfo(OpCode opcode)
		{
			this.opcode = opcode;
			CanThrow = true;
		}

		public OpCode OpCode { get { return opcode; } }

		/// <summary>
		/// 'Move' kind of instructions have one input (may be stack or local variable) and copy that value to all outputs (again stack or local variable).
		/// </summary>
		public bool IsMoveInstruction { get; private set; }

		/// <summary>
		/// Specifies whether this opcode is capable of throwing exceptions.
		/// </summary>
		public bool CanThrow { get; private set; }
	}
}


text:
LOG_SETUP(".storage.persistence.asynchandler");

using vespalib::CpuUsage;
using vespalib::make_string_short::fmt;
namespace storage {

namespace {

class ResultTask : public vespalib::Executor::Task {
public:
    ResultTask() : _result(), _resultHandler(nullptr) {}

    void setResult(spi::Result::UP result) {
        _result = std::move(result);
    }

    void addResultHandler(const spi::ResultHandler *resultHandler) {
        // Only handles a single handler now,
        // Can be extended if necessary later on
        assert(_resultHandler == nullptr);
        _resultHandler = resultHandler;
    }

    void handle(const spi::Result &result) {
        if (_resultHandler != nullptr) {
            _resultHandler->handle(result);
        }
    }

protected:
    spi::Result::UP _result;
private:
    const spi::ResultHandler *_resultHandler;
};

template<class FunctionType>
class LambdaResultTask : public ResultTask {
public:
    explicit LambdaResultTask(FunctionType &&func)
        : _func(std::move(func))
    {}

    ~LambdaResultTask() override = default;

    void run() override {
        handle(*_result);
        _func(std::move(_result));
    }

private:
    FunctionType _func;
};

template<class FunctionType>
std::unique_ptr<ResultTask>
makeResultTask(FunctionType &&function) {
    return std::make_unique<LambdaResultTask<std::decay_t<FunctionType>>>
            (std::forward<FunctionType>(function));
}

class ResultTaskOperationDone : public spi::OperationComplete {
public:
    ResultTaskOperationDone(vespalib::ISequencedTaskExecutor & executor, document::BucketId bucketId,
                            std::unique_ptr<ResultTask> task)
        : _executor(executor),
          _task(std::move(task)),
          _executorId(executor.getExecutorId(bucketId.getId()))
    {
    }
    ~ResultTaskOperationDone() override;
    void onComplete(spi::Result::UP result) noexcept override {
        _task->setResult(std::move(result));
        _executor.executeTask(_executorId, std::move(_task));
    }
    void addResultHandler(const spi::ResultHandler * resultHandler) override {
        _task->addResultHandler(resultHandler);
    }
private:
    vespalib::ISequencedTaskExecutor             & _executor;
    std::unique_ptr<ResultTask>                    _task;
    vespalib::ISequencedTaskExecutor::ExecutorId   _executorId;
};

ResultTaskOperationDone::~ResultTaskOperationDone() = default;

bool
bucketStatesAreSemanticallyEqual(const api::BucketInfo& a, const api::BucketInfo& b) {
    // Don't check document sizes, as background moving of documents in Proton
    // may trigger a change in size without any mutations taking place. This will
    // only take place when a document being moved was fed _prior_ to the change
    // where Proton starts reporting actual document sizes, and will eventually
    // converge to a stable value. But for now, ignore it to prevent false positive
    // error logs and non-deleted buckets.
    return ((a.getChecksum() == b.getChecksum()) && (a.getDocumentCount() == b.getDocumentCount()));
}

class UnrevertableRemoveEntryProcessor : public BucketProcessor::EntryProcessor {
public:
    using DocumentIdsAndTimeStamps = std::vector<spi::IdAndTimestamp>;
    UnrevertableRemoveEntryProcessor(DocumentIdsAndTimeStamps & to_remove)
        : _to_remove(to_remove)
    {}

    void process(spi::DocEntry& entry) override {
        _to_remove.emplace_back(*entry.getDocumentId(), entry.getTimestamp());
    }
private:
    DocumentIdsAndTimeStamps & _to_remove;
};

}

AsyncHandler::AsyncHandler(const PersistenceUtil & env, spi::PersistenceProvider & spi,
                           BucketOwnershipNotifier &bucketOwnershipNotifier,
                           vespalib::ISequencedTaskExecutor & executor,
                           const document::BucketIdFactory & bucketIdFactory)
    : _env(env),
      _spi(spi),
      _bucketOwnershipNotifier(bucketOwnershipNotifier),
      _sequencedExecutor(executor),
      _bucketIdFactory(bucketIdFactory)
{}

MessageTracker::UP
AsyncHandler::handleRunTask(RunTaskCommand& cmd, MessageTracker::UP tracker) const {
    auto task = makeResultTask([tracker = std::move(tracker)](spi::Result::UP response) {
        tracker->checkForError(*response);
        tracker->sendReply();
    });
    spi::Bucket bucket(cmd.getBucket());
    auto onDone = std::make_unique<ResultTaskOperationDone>(_sequencedExecutor, cmd.getBucketId(), std::move(task));
    cmd.run(bucket, std::make_shared<vespalib::KeepAlive<decltype(onDone)>>(std::move(onDone)));
    return tracker;
}

MessageTracker::UP
AsyncHandler::handlePut(api::PutCommand& cmd, MessageTracker::UP trackerUP) const
{
    MessageTracker & tracker = *trackerUP;
    auto& metrics = _env._metrics.put;
    tracker.setMetric(metrics);
    metrics.request_size.addValue(cmd.getApproxByteSize());

    if (tasConditionExists(cmd) && !tasConditionMatches(cmd, tracker, tracker.context())) {
        // Will also count condition parse failures etc as TaS failures, but
        // those results _will_ increase the error metrics as well.
        metrics.test_and_set_failed.inc();
        return trackerUP;
    }

    spi::Bucket bucket = _env.getBucket(cmd.getDocumentId(), cmd.getBucket());
    auto task = makeResultTask([tracker = std::move(trackerUP)](spi::Result::UP response) {
        tracker->checkForError(*response);
        tracker->sendReply();
    });
    _spi.putAsync(bucket, spi::Timestamp(cmd.getTimestamp()), std::move(cmd.getDocument()),
                  std::make_unique<ResultTaskOperationDone>(_sequencedExecutor, cmd.getBucketId(), std::move(task)));

    return trackerUP;
}

MessageTracker::UP
AsyncHandler::handleCreateBucket(api::CreateBucketCommand& cmd, MessageTracker::UP tracker) const
{
    tracker->setMetric(_env._metrics.createBuckets);
    LOG(debug, "CreateBucket(%s)", cmd.getBucketId().toString().c_str());
    if (_env._fileStorHandler.isMerging(cmd.getBucket())) {
        LOG(warning, "Bucket %s was merging at create time. Unexpected.", cmd.getBucketId().toString().c_str());
    }
    spi::Bucket bucket(cmd.getBucket());
    auto task = makeResultTask([tracker = std::move(tracker)](spi::Result::UP ignored) mutable {
        // TODO Even if an non OK response can not be handled sanely we might probably log a message, or increment a metric
        (void) ignored;
        tracker->sendReply();
    });

    if (cmd.getActive()) {
        _spi.createBucketAsync(bucket, std::make_unique<spi::NoopOperationComplete>());
        _spi.setActiveStateAsync(bucket, spi::BucketInfo::ACTIVE, std::make_unique<ResultTaskOperationDone>(_sequencedExecutor, bucket, std::move(task)));
    } else {
        _spi.createBucketAsync(bucket, std::make_unique<ResultTaskOperationDone>(_sequencedExecutor, bucket, std::move(task)));
    }

    return tracker;
}

MessageTracker::UP
AsyncHandler::handleDeleteBucket(api::DeleteBucketCommand& cmd, MessageTracker::UP tracker) const
{
    tracker->setMetric(_env._metrics.deleteBuckets);
    LOG(debug, "DeletingBucket(%s)", cmd.getBucketId().toString().c_str());
    if (_env._fileStorHandler.isMerging(cmd.getBucket())) {
        _env._fileStorHandler.clearMergeStatus(cmd.getBucket(),
                                               api::ReturnCode(api::ReturnCode::ABORTED, "Bucket was deleted during the merge"));
    }
    spi::Bucket bucket(cmd.getBucket());
    if (!checkProviderBucketInfoMatches(bucket, cmd.getBucketInfo())) {
        return tracker;
    }

    auto task = makeResultTask([this, tracker = std::move(tracker), bucket=cmd.getBucket()](spi::Result::UP ignored) {
        // TODO Even if an non OK response can not be handled sanely we might probably log a message, or increment a metric
        (void) ignored;
        StorBucketDatabase &db(_env.getBucketDatabase(bucket.getBucketSpace()));
        StorBucketDatabase::WrappedEntry entry = db.get(bucket.getBucketId(), "onDeleteBucket");
        if (entry.exist() && entry->getMetaCount() > 0) {
            LOG(debug, "onDeleteBucket(%s): Bucket DB entry existed. Likely "
                       "active operation when delete bucket was queued. "
                       "Updating bucket database to keep it in sync with file. "
                       "Cannot delete bucket from bucket database at this "
                       "point, as it can have been intentionally recreated "
                       "after delete bucket had been sent",
                bucket.getBucketId().toString().c_str());
            api::BucketInfo info(0, 0, 0);
            // Only set document counts/size; retain ready/active state.
            info.setReady(entry->getBucketInfo().isReady());
            info.setActive(entry->getBucketInfo().isActive());

            entry->setBucketInfo(info);
            entry.write();
        }
        tracker->sendReply();
    });
    _spi.deleteBucketAsync(bucket, std::make_unique<ResultTaskOperationDone>(_sequencedExecutor, cmd.getBucketId(), std::move(task)));
    return tracker;
}

MessageTracker::UP
AsyncHandler::handleSetBucketState(api::SetBucketStateCommand& cmd, MessageTracker::UP trackerUP) const
{
    trackerUP->setMetric(_env._metrics.setBucketStates);

    //LOG(debug, "handleSetBucketState(): %s", cmd.toString().c_str());
    spi::Bucket bucket(cmd.getBucket());
    bool shouldBeActive(cmd.getState() == api::SetBucketStateCommand::ACTIVE);
    spi::BucketInfo::ActiveState newState(shouldBeActive ? spi::BucketInfo::ACTIVE : spi::BucketInfo::NOT_ACTIVE);

    auto task = makeResultTask([this, &cmd, newState, tracker = std::move(trackerUP), bucket,
                                notifyGuard = std::make_unique<NotificationGuard>(_bucketOwnershipNotifier)](spi::Result::UP response) mutable {
        if (tracker->checkForError(*response)) {
            StorBucketDatabase &db(_env.getBucketDatabase(bucket.getBucketSpace()));
            StorBucketDatabase::WrappedEntry entry = db.get(bucket.getBucketId(),"handleSetBucketState");
            if (entry.exist()) {
                entry->info.setActive(newState == spi::BucketInfo::ACTIVE);
                notifyGuard->notifyIfOwnershipChanged(cmd.getBucket(), cmd.getSourceIndex(), entry->info);
                entry.write();
            } else {
                LOG(warning, "Got OK setCurrentState result from provider for %s, "
                             "but bucket has disappeared from service layer database",
                    cmd.getBucketId().toString().c_str());
            }
            tracker->setReply(std::make_shared<api::SetBucketStateReply>(cmd));
        }
        tracker->sendReply();
    });
    _spi.setActiveStateAsync(bucket, newState, std::make_unique<ResultTaskOperationDone>(_sequencedExecutor, cmd.getBucketId(), std::move(task)));
    return trackerUP;
}

MessageTracker::UP
AsyncHandler::handleUpdate(api::UpdateCommand& cmd, MessageTracker::UP trackerUP) const
{
    MessageTracker & tracker = *trackerUP;
    auto& metrics = _env._metrics.update;
    tracker.setMetric(metrics);
    metrics.request_size.addValue(cmd.getApproxByteSize());

    if (tasConditionExists(cmd) && !tasConditionMatches(cmd, tracker, tracker.context(), cmd.getUpdate()->getCreateIfNonExistent())) {
        metrics.test_and_set_failed.inc();
        return trackerUP;
    }

    spi::Bucket bucket = _env.getBucket(cmd.getDocumentId(), cmd.getBucket());

    // Note that the &cmd capture is OK since its lifetime is guaranteed by the tracker
    auto task = makeResultTask([&cmd, tracker = std::move(trackerUP)](spi::Result::UP responseUP) {
        auto & response = dynamic_cast<const spi::UpdateResult &>(*responseUP);
        if (tracker->checkForError(response)) {
            auto reply = std::make_shared<api::UpdateReply>(cmd);
            reply->setOldTimestamp(response.getExistingTimestamp());
            tracker->setReply(std::move(reply));
        }
        tracker->sendReply();
    });
    _spi.updateAsync(bucket, spi::Timestamp(cmd.getTimestamp()), std::move(cmd.getUpdate()),
                     std::make_unique<ResultTaskOperationDone>(_sequencedExecutor, cmd.getBucketId(), std::move(task)));
    return trackerUP;
}

MessageTracker::UP
AsyncHandler::handleRemove(api::RemoveCommand& cmd, MessageTracker::UP trackerUP) const
{
    MessageTracker & tracker = *trackerUP;
    auto& metrics = _env._metrics.remove;
    tracker.setMetric(metrics);
    metrics.request_size.addValue(cmd.getApproxByteSize());

    if (tasConditionExists(cmd) && !tasConditionMatches(cmd, tracker, tracker.context())) {
        metrics.test_and_set_failed.inc();
        return trackerUP;
    }

    spi::Bucket bucket = _env.getBucket(cmd.getDocumentId(), cmd.getBucket());

    // Note that the &cmd capture is OK since its lifetime is guaranteed by the tracker
    auto task = makeResultTask([&metrics, &cmd, tracker = std::move(trackerUP)](spi::Result::UP responseUP) {
        auto & response = dynamic_cast<const spi::RemoveResult &>(*responseUP);
        if (tracker->checkForError(response)) {
            tracker->setReply(std::make_shared<api::RemoveReply>(cmd, response.wasFound() ? cmd.getTimestamp() : 0));
        }
        if (!response.wasFound()) {
            metrics.notFound.inc();
        }
        tracker->sendReply();
    });
    _spi.removeIfFoundAsync(bucket, spi::Timestamp(cmd.getTimestamp()), cmd.getDocumentId(),
                            std::make_unique<ResultTaskOperationDone>(_sequencedExecutor, cmd.getBucketId(), std::move(task)));
    return trackerUP;
}

bool
AsyncHandler::is_async_message(api::MessageType::Id type_id) noexcept
{
    switch (type_id) {
        case api::MessageType::PUT_ID:
        case api::MessageType::UPDATE_ID:
        case api::MessageType::REMOVE_ID:
            return true;
        default:
            return false;
    }
}

bool
AsyncHandler::tasConditionExists(const api::TestAndSetCommand & cmd) {
    return cmd.getCondition().isPresent();
}

bool
AsyncHandler::tasConditionMatches(const api::TestAndSetCommand & cmd, MessageTracker & tracker,
                                  spi::Context & context, bool missingDocumentImpliesMatch) const {
    try {
        TestAndSetHelper helper(_env, _spi, _bucketIdFactory, cmd, missingDocumentImpliesMatch);

        auto code = helper.retrieveAndMatch(context);
        if (code.failed()) {
            tracker.fail(code.getResult(), code.getMessage());
            return false;
        }
    } catch (const TestAndSetException & e) {
        auto code = e.getCode();
        tracker.fail(code.getResult(), code.getMessage());
        return false;
    }

    return true;
}

bool
AsyncHandler::checkProviderBucketInfoMatches(const spi::Bucket& bucket, const api::BucketInfo& info) const
{
    spi::BucketInfoResult result(_spi.getBucketInfo(bucket));
    if (result.hasError()) {
        LOG(error, "getBucketInfo(%s) failed before deleting bucket; got error '%s'",
            bucket.toString().c_str(), result.getErrorMessage().c_str());
        return false;
    }
    api::BucketInfo providerInfo(PersistenceUtil::convertBucketInfo(result.getBucketInfo()));
    // Don't check meta fields or active/ready fields since these are not
    // that important and ready may change under the hood in a race with
    // getModifiedBuckets(). If bucket is empty it means it has already
    // been deleted by a racing split/join.
    if (!bucketStatesAreSemanticallyEqual(info, providerInfo) && !providerInfo.empty()) {
        LOG(error,
            "Service layer bucket database and provider out of sync before "
            "deleting bucket %s! Service layer db had %s while provider says "
            "bucket has %s. Deletion has been rejected to ensure data is not "
            "lost, but bucket may remain out of sync until service has been "
            "restarted.",
            bucket.toString().c_str(), info.toString().c_str(), providerInfo.toString().c_str());
        return false;
    }
    return true;
}

MessageTracker::UP
AsyncHandler::handleRemoveLocation(api::RemoveLocationCommand& cmd, MessageTracker::UP tracker) const
{
    tracker->setMetric(_env._metrics.removeLocation);

    spi::Bucket bucket(cmd.getBucket());
    const bool is_legacy = (!cmd.only_enumerate_docs() && cmd.explicit_remove_set().empty());
    std::vector<spi::IdAndTimestamp> to_remove;

    LOG(debug, "RemoveLocation(%s): using selection '%s' (enumerate only: %s, remove set size: %zu)",
        bucket.toString().c_str(),
        cmd.getDocumentSelection().c_str(),
        (cmd.only_enumerate_docs() ? "yes" : "no"),
        cmd.explicit_remove_set().size());

    if (is_legacy || cmd.only_enumerate_docs()) {
        UnrevertableRemoveEntryProcessor processor(to_remove);
        {
            auto usage = vespalib::CpuUsage::use(CpuUsage::Category::READ);
            BucketProcessor::iterateAll(_spi, bucket, cmd.getDocumentSelection(),
                                        std::make_shared<document::DocIdOnly>(),
                                        processor, spi::NEWEST_DOCUMENT_ONLY, tracker->context());
        }
        if (!is_legacy) {
            LOG(debug, "RemoveLocation(%s): returning 1st phase results with %zu entries",
                bucket.toString().c_str(), to_remove.size());
            auto reply = std::make_shared<api::RemoveLocationReply>(cmd, 0); // No docs removed yet
            reply->set_selection_matches(std::move(to_remove));
            tracker->setReply(std::move(reply));
            return tracker;
        }
    } else {
        to_remove = cmd.steal_explicit_remove_set();
    }

    auto task = makeResultTask([&cmd, tracker = std::move(tracker), removed = to_remove.size()](spi::Result::UP response) {
        tracker->checkForError(*response);
        tracker->setReply(std::make_shared<api::RemoveLocationReply>(cmd, removed));
        tracker->sendReply();
    });

    // In the case where a _newer_ mutation exists for a given entry in to_remove, it will be ignored
    // (with no tombstone added) since we only preserve the newest operation for a document.
    _spi.removeAsync(bucket, std::move(to_remove),
                     std::make_unique<ResultTaskOperationDone>(_sequencedExecutor, cmd.getBucketId(), std::move(task)));

    return tracker;
}

}


text:
package org.ops4j.pax.logging.spi;

import java.io.Closeable;
import java.io.PrintStream;

/**
 * Interface to register OSGi services that give access to single {@link java.io.PrintStream}
 * that should be used for many file-based default/fallback logs.
 */
public interface PaxDefaultLogStreamProvider extends Closeable {

    PrintStream stream();

}


text:
/*
 * @(#)ButtonDemo.java	1.15 05/11/17
 */

import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Insets;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.Vector;

import javax.swing.AbstractButton;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTabbedPane;
import javax.swing.JToggleButton;
import javax.swing.SingleSelectionModel;
import javax.swing.border.EmptyBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

import org.jb2011.lnf.beautyeye.ch3_button.BEButtonUI;
import org.jb2011.lnf.beautyeye.widget.N9ComponentFactory;

// TODO: Auto-generated Javadoc
/**
 * JButton, JRadioButton, JToggleButton, JCheckBox Demos.
 *
 * @version 1.15 11/17/05
 * @author Jeff Dinkins
 */
public class ButtonDemo extends DemoModule implements ChangeListener {

    /** The tab. */
    JTabbedPane tab;

    /** The button panel. */
    JPanel buttonPanel = new JPanel();

    /** The checkbox panel. */
    JPanel checkboxPanel = new JPanel();

    /** The radio button panel. */
    JPanel radioButtonPanel = new JPanel();

    /** The toggle button panel. */
    JPanel toggleButtonPanel = new JPanel();

    /** The buttons. */
    Vector buttons = new Vector();

    /** The checkboxes. */
    Vector checkboxes = new Vector();

    /** The radiobuttons. */
    Vector radiobuttons = new Vector();

    /** The togglebuttons. */
    Vector togglebuttons = new Vector();

    /** The current controls. */
    Vector currentControls = buttons;

    /** The button. */
    JButton button;

    /** The check. */
    JCheckBox check;

    /** The radio. */
    JRadioButton radio;

    /** The toggle. */
    JToggleButton toggle;

    /** The border0. */
    EmptyBorder border0 = new EmptyBorder(0,0,0,0);// add by jb2011 2012-08-24

    /** The border5. */
    EmptyBorder border5 = new EmptyBorder(5,5,5,5);

    /** The border10. */
    EmptyBorder border10 = new EmptyBorder(10,10,10,10);

    /** The button display listener. */
    ItemListener buttonDisplayListener = null;

    /** The button pad listener. */
    ItemListener buttonPadListener = null;

    /** The insets0. */
    Insets insets0 = new Insets(0,0,0,0);

    /** The insets10. */
    Insets insets10 = new Insets(10,10,10,10);

    /**
     * main method allows us to run as a standalone demo.
     *
     * @param args the arguments
     */
    public static void main(String[] args) {
	ButtonDemo demo = new ButtonDemo(null);
	demo.mainImpl();
    }

    /* (non-Javadoc)
     * @see DemoModule#getName()
     */
    @Override public String getName() {
    	return "按钮";
    };

    /**
     * ButtonDemo Constructor.
     *
     * @param swingset the swingset
     */
    public ButtonDemo(SwingSet2 swingset) {
	// Set the title for this demo, and an icon used to represent this
	// demo inside the SwingSet2 app.
	super(swingset, "ButtonDemo"
			, "toolbar/JButton.gif");

	tab = new JTabbedPane();
	tab.getModel().addChangeListener(this);

	JPanel demo = getDemoPanel();
	demo.setLayout(new BoxLayout(demo, BoxLayout.Y_AXIS));
	demo.add(tab);

	addButtons();
	addRadioButtons();
	addCheckBoxes();
	// addToggleButtons();
	currentControls = buttons;
    }

    /**
     * Adds the buttons.
     */
    public void addButtons() {
	tab.addTab(getString("ButtonDemo.buttons"), buttonPanel);
	buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS));
    buttonPanel.setBorder(border0);

	JPanel p1 = createVerticalPanel(true);
	p1.setAlignmentY(TOP_ALIGNMENT);
	buttonPanel.add(p1);
	p1.add(Box.createHorizontalGlue());// add by jb2011

	// Text Buttons
	JPanel jb2011p = new JPanel();
	jb2011p.setLayout(new BoxLayout(jb2011p, BoxLayout.Y_AXIS));
	JPanel p2 = createHorizontalPanel(false);
	createHorizonalHintBox(jb2011p, p2, getString("ButtonDemo.textbuttons"));
//	p1.add(p2);
	p1.add(jb2011p);
//	p2.setBorder(new CompoundBorder(new TitledBorder(null, getString("ButtonDemo.textbuttons"),
//							  TitledBorder.LEFT, TitledBorder.TOP), border5));

	JButton btn0 = new JButton(getString("ButtonDemo.button1"));
	btn0.setUI(new BEButtonUI().setNormalColor(BEButtonUI.NormalColor.lightBlue));
	btn0.setForeground(Color.white);
	buttons.add(p2.add(btn0));
	p2.add(Box.createRigidArea(HGAP10));

	buttons.add(p2.add(new JButton(getString("ButtonDemo.button2"))));
	p2.add(Box.createRigidArea(HGAP10));

	JButton btn = new JButton("这是一个用来测试的长文本按钮");
	btn.setUI(new BEButtonUI().setNormalColor(BEButtonUI.NormalColor.green));
	btn.setForeground(Color.white);
	buttons.add(p2.add(btn));

	// Image Buttons
	p1.add(Box.createRigidArea(VGAP30));
	jb2011p = new JPanel();
	jb2011p.setLayout(new BoxLayout(jb2011p, BoxLayout.Y_AXIS));
	JPanel p3 = createHorizontalPanel(false);
	createHorizonalHintBox(jb2011p, p3, getString("ButtonDemo.imagebuttons"));
//	p1.add(p3);
	p1.add(jb2011p);
	p3.setLayout(new BoxLayout(p3, BoxLayout.X_AXIS));
//	p3.setBorder(new TitledBorder(null, getString("ButtonDemo.imagebuttons"),
//					 TitledBorder.LEFT, TitledBorder.TOP));

	// home image button
	String description = getString("ButtonDemo.phone");
	button = new JButton(createImageIcon("buttons/b1.gif", description));
	button.setPressedIcon(createImageIcon("buttons/b1p.gif", description));
	button.setRolloverIcon(createImageIcon("buttons/b1r.gif", description));
	button.setDisabledIcon(createImageIcon("buttons/b1d.gif", description));
	button.setMargin(new Insets(0,0,0,0));
	button.setUI(new BEButtonUI().setNormalColor(BEButtonUI.NormalColor.red));
	button.setForeground(Color.white);
	p3.add(button);
	buttons.add(button);
	p3.add(Box.createRigidArea(HGAP10));

	// write image button
	description = getString("ButtonDemo.write");
	button = new JButton(createImageIcon("buttons/b2.gif", description));
	button.setPressedIcon(createImageIcon("buttons/b2p.gif", description));
	button.setRolloverIcon(createImageIcon("buttons/b2r.gif", description));
	button.setDisabledIcon(createImageIcon("buttons/b2d.gif", description));
	button.setMargin(new Insets(0,0,0,0));
	p3.add(button);
	buttons.add(button);
	p3.add(Box.createRigidArea(HGAP10));

	// write image button
	description = getString("ButtonDemo.peace");
	button = new JButton(createImageIcon("buttons/b3.gif", description));
	button.setPressedIcon(createImageIcon("buttons/b3p.gif", description));
	button.setRolloverIcon(createImageIcon("buttons/b3r.gif", description));
	button.setDisabledIcon(createImageIcon("buttons/b3d.gif", description));
	button.setMargin(new Insets(0,0,0,0));
	button.setUI(new BEButtonUI().setNormalColor(BEButtonUI.NormalColor.green));
	p3.add(button);
	buttons.add(button);

	p1.add(Box.createVerticalGlue());

//	buttonPanel.add(Box.createHorizontalGlue());
	buttonPanel.add(Box.createHorizontalStrut(10));//modified by jb2011
	currentControls = buttons;
	buttonPanel.add(createControls());
    }

    /**
     * Adds the radio buttons.
     */
    public void addRadioButtons() {
	ButtonGroup group = new ButtonGroup();

	tab.addTab(getString("ButtonDemo.radiobuttons"), radioButtonPanel);
	radioButtonPanel.setLayout(new BoxLayout(radioButtonPanel, BoxLayout.X_AXIS));
        radioButtonPanel.setBorder(border0);

	JPanel p1 = createVerticalPanel(true);
	p1.setAlignmentY(TOP_ALIGNMENT);
	radioButtonPanel.add(p1);
	p1.add(Box.createHorizontalGlue());// add by jb2011

	// Text Radio Buttons
	JPanel jb2011p = new JPanel();
	jb2011p.setLayout(new BoxLayout(jb2011p, BoxLayout.Y_AXIS));
	JPanel p2 = createHorizontalPanel(false);
	createHorizonalHintBox(jb2011p, p2, getString("ButtonDemo.textradiobuttons"));
//	p1.add(p2);
	p1.add(jb2011p);
//	p2.setBorder(new CompoundBorder(
//                      new TitledBorder(
//			null, getString("ButtonDemo.textradiobuttons"),
//			TitledBorder.LEFT, TitledBorder.TOP), border0)
//	);

        radio = (JRadioButton)p2.add(
                new JRadioButton(getString("ButtonDemo.radio1")));
        group.add(radio);
	radiobuttons.add(radio);
	p2.add(Box.createRigidArea(HGAP10));

	radio = (JRadioButton)p2.add(
                new JRadioButton(getString("ButtonDemo.radio2")));
        group.add(radio);
	radiobuttons.add(radio);
	p2.add(Box.createRigidArea(HGAP10));

	radio = (JRadioButton)p2.add(
                new JRadioButton(getString("ButtonDemo.radio3")));
        group.add(radio);
	radiobuttons.add(radio);

	// Image Radio Buttons
        group = new ButtonGroup();
	p1.add(Box.createRigidArea(VGAP30));
	jb2011p = new JPanel();
	jb2011p.setLayout(new BoxLayout(jb2011p, BoxLayout.Y_AXIS));
	JPanel p3 = createHorizontalPanel(false);
	createHorizonalHintBox(jb2011p, p3, getString("ButtonDemo.imageradiobuttons"));
//	p1.add(p2);
	p1.add(jb2011p);
//	JPanel p3 = createHorizontalPanel(false);
//	p1.add(p3);
//	p3.setLayout(new BoxLayout(p3, BoxLayout.X_AXIS));
//	p3.setBorder(new TitledBorder(null, getString("ButtonDemo.imageradiobuttons"),
//					 TitledBorder.LEFT, TitledBorder.TOP));

	// image radio button 1
	String description = getString("ButtonDemo.customradio");
	String text = getString("ButtonDemo.radio1");
	radio = new JRadioButton(text, createImageIcon("buttons/rb.gif", description));
	radio.setPressedIcon(createImageIcon("buttons/rbp.gif", description));
	radio.setRolloverIcon(createImageIcon("buttons/rbr.gif", description));
	radio.setRolloverSelectedIcon(createImageIcon("buttons/rbrs.gif", description));
	radio.setSelectedIcon(createImageIcon("buttons/rbs.gif", description));
	radio.setMargin(new Insets(0,0,0,0));
	group.add(radio);
	p3.add(radio);
	radiobuttons.add(radio);
	p3.add(Box.createRigidArea(HGAP20));

	// image radio button 2
	text = getString("ButtonDemo.radio2");
	radio = new JRadioButton(text, createImageIcon("buttons/rb.gif", description));
	radio.setPressedIcon(createImageIcon("buttons/rbp.gif", description));
	radio.setRolloverIcon(createImageIcon("buttons/rbr.gif", description));
	radio.setRolloverSelectedIcon(createImageIcon("buttons/rbrs.gif", description));
	radio.setSelectedIcon(createImageIcon("buttons/rbs.gif", description));
	radio.setMargin(new Insets(0,0,0,0));
	group.add(radio);
	p3.add(radio);
	radiobuttons.add(radio);
	p3.add(Box.createRigidArea(HGAP20));

	// image radio button 3
	text = getString("ButtonDemo.radio3");
	radio = new JRadioButton(text, createImageIcon("buttons/rb.gif", description));
	radio.setPressedIcon(createImageIcon("buttons/rbp.gif", description));
	radio.setRolloverIcon(createImageIcon("buttons/rbr.gif", description));
	radio.setRolloverSelectedIcon(createImageIcon("buttons/rbrs.gif", description));
	radio.setSelectedIcon(createImageIcon("buttons/rbs.gif", description));
	radio.setMargin(new Insets(0,0,0,0));
	group.add(radio);
	radiobuttons.add(radio);
	p3.add(radio);

	// verticaly glue fills out the rest of the box
	p1.add(Box.createVerticalGlue());

	//modified by jb2011
	radioButtonPanel.add(Box.createHorizontalStrut(10));//Box.createHorizontalGlue());

	currentControls = radiobuttons;
	radioButtonPanel.add(createControls());
    }

    /**
     * Adds the check boxes.
     */
    public void addCheckBoxes() {
	tab.addTab(getString("ButtonDemo.checkboxes"), checkboxPanel);
	checkboxPanel.setLayout(new BoxLayout(checkboxPanel, BoxLayout.X_AXIS));
        checkboxPanel.setBorder(border0);

	JPanel p1 = createVerticalPanel(true);
	p1.setAlignmentY(TOP_ALIGNMENT);
	checkboxPanel.add(p1);
	p1.add(Box.createHorizontalGlue());// add by jb2011

	// Text Radio Buttons
	JPanel jb2011p = new JPanel();
	jb2011p.setLayout(new BoxLayout(jb2011p, BoxLayout.Y_AXIS));
	JPanel p2 = createHorizontalPanel(false);
	createHorizonalHintBox(jb2011p, p2, getString("ButtonDemo.textcheckboxes"));
//	p1.add(p2);
	p1.add(jb2011p);
//	p2.setBorder(new CompoundBorder(
//                      new TitledBorder(
//			null, getString("ButtonDemo.textcheckboxes"),
//			TitledBorder.LEFT, TitledBorder.TOP), border0)
//	);

	checkboxes.add(p2.add(new JCheckBox(getString("ButtonDemo.check1"))));
	p2.add(Box.createRigidArea(HGAP10));

	checkboxes.add(p2.add(new JCheckBox(getString("ButtonDemo.check2"))));
	p2.add(Box.createRigidArea(HGAP10));

	checkboxes.add(p2.add(new JCheckBox(getString("ButtonDemo.check3"))));

	// Image Radio Buttons
	p1.add(Box.createRigidArea(VGAP30));
	jb2011p = new JPanel();
	jb2011p.setLayout(new BoxLayout(jb2011p, BoxLayout.Y_AXIS));
	JPanel p3 = createHorizontalPanel(false);
	createHorizonalHintBox(jb2011p, p3, getString("ButtonDemo.imagecheckboxes"));
//	p1.add(p2);
	p1.add(jb2011p);
//	p1.add(p3);
//	p3.setLayout(new BoxLayout(p3, BoxLayout.X_AXIS));
//	p3.setBorder(new TitledBorder(null, getString("ButtonDemo.imagecheckboxes"),
//					 TitledBorder.LEFT, TitledBorder.TOP));

	// image checkbox 1
	String description = getString("ButtonDemo.customcheck");
	String text = getString("ButtonDemo.check1");
	check = new JCheckBox(text, createImageIcon("buttons/cb.gif", description));
	check.setRolloverIcon(createImageIcon("buttons/cbr.gif", description));
	check.setRolloverSelectedIcon(createImageIcon("buttons/cbrs.gif", description));
	check.setSelectedIcon(createImageIcon("buttons/cbs.gif", description));
	check.setMargin(new Insets(0,0,0,0));
	p3.add(check);
	checkboxes.add(check);
	p3.add(Box.createRigidArea(HGAP20));

	// image checkbox 2
	text = getString("ButtonDemo.check2");
	check = new JCheckBox(text, createImageIcon("buttons/cb.gif", description));
	check.setRolloverIcon(createImageIcon("buttons/cbr.gif", description));
	check.setRolloverSelectedIcon(createImageIcon("buttons/cbrs.gif", description));
	check.setSelectedIcon(createImageIcon("buttons/cbs.gif", description));
	check.setMargin(new Insets(0,0,0,0));
	p3.add(check);
	checkboxes.add(check);
	p3.add(Box.createRigidArea(HGAP20));

	// image checkbox 3
	text = getString("ButtonDemo.check3");
	check = new JCheckBox(text, createImageIcon("buttons/cb.gif", description));
	check.setRolloverIcon(createImageIcon("buttons/cbr.gif", description));
	check.setRolloverSelectedIcon(createImageIcon("buttons/cbrs.gif", description));
	check.setSelectedIcon(createImageIcon("buttons/cbs.gif", description));
	check.setMargin(new Insets(0,0,0,0));
	p3.add(check);
	checkboxes.add(check);

	// verticaly glue fills out the rest of the box
	p1.add(Box.createVerticalGlue());

	//modified by jb2011
	checkboxPanel.add(Box.createHorizontalStrut(10));//Box.createHorizontalGlue());
	currentControls = checkboxes;
	checkboxPanel.add(createControls());
    }

    /**
     * Adds the toggle buttons.
     */
    public void addToggleButtons() {
	tab.addTab(getString("ButtonDemo.togglebuttons"), toggleButtonPanel);
    }

    /**
     * Creates the controls.
     *
     * @return the j panel
     */
    public JPanel createControls() {
        JPanel controls = new JPanel() {
            public Dimension getMaximumSize() {
                return new Dimension(300, super.getMaximumSize().height);
            }
        };
        controls.setLayout(new BoxLayout(controls, BoxLayout.Y_AXIS));
        controls.setAlignmentY(TOP_ALIGNMENT);
        controls.setAlignmentX(LEFT_ALIGNMENT);

        JPanel buttonControls = createHorizontalPanel(true);
        buttonControls.setAlignmentY(TOP_ALIGNMENT);
        buttonControls.setAlignmentX(LEFT_ALIGNMENT);

        JPanel leftColumn = createVerticalPanel(false);
        leftColumn.setAlignmentX(LEFT_ALIGNMENT);
        leftColumn.setAlignmentY(TOP_ALIGNMENT);

        JPanel rightColumn = new LayoutControlPanel(this);

        buttonControls.add(leftColumn);
        buttonControls.add(Box.createRigidArea(HGAP20));
        buttonControls.add(rightColumn);
        buttonControls.add(Box.createRigidArea(HGAP20));

        controls.add(buttonControls);

	createListeners();

        // Display Options
		//* modified by jb2011:改成一个灰色圆色背景的label
		//JLabel l = new JLabel(getString("ButtonDemo.controlpanel_label"));
        JLabel l = N9ComponentFactory.createLabel_style4(getString("ButtonDemo.controlpanel_label"));
        leftColumn.add(l);

        JCheckBox bordered = new JCheckBox(getString("ButtonDemo.paintborder"));
        bordered.setActionCommand("PaintBorder");
        bordered.setToolTipText(getString("ButtonDemo.paintborder_tooltip"));
        bordered.setMnemonic(getMnemonic("ButtonDemo.paintborder_mnemonic"));
	if (currentControls == buttons) {
	        bordered.setSelected(true);
	}
        bordered.addItemListener(buttonDisplayListener);
        leftColumn.add(bordered);

        JCheckBox focused = new JCheckBox(getString("ButtonDemo.paintfocus"));
        focused.setActionCommand("PaintFocus");
        focused.setToolTipText(getString("ButtonDemo.paintfocus_tooltip"));
        focused.setMnemonic(getMnemonic("ButtonDemo.paintfocus_mnemonic"));
        focused.setSelected(true);
        focused.addItemListener(buttonDisplayListener);
        leftColumn.add(focused);

        JCheckBox enabled = new JCheckBox(getString("ButtonDemo.enabled"));
        enabled.setActionCommand("Enabled");
        enabled.setToolTipText(getString("ButtonDemo.enabled_tooltip"));
        enabled.setSelected(true);
        enabled.addItemListener(buttonDisplayListener);
        enabled.setMnemonic(getMnemonic("ButtonDemo.enabled_mnemonic"));
        leftColumn.add(enabled);

        JCheckBox filled = new JCheckBox(getString("ButtonDemo.contentfilled"));
        filled.setActionCommand("ContentFilled");
        filled.setToolTipText(getString("ButtonDemo.contentfilled_tooltip"));
        filled.setSelected(true);
        filled.addItemListener(buttonDisplayListener);
        filled.setMnemonic(getMnemonic("ButtonDemo.contentfilled_mnemonic"));
        leftColumn.add(filled);

        leftColumn.add(Box.createRigidArea(VGAP20));

        //* modified by jb2011:改成一个灰色圆色背景的label
        // l = new JLabel(getString("ButtonDemo.padamount_label"));
        l = N9ComponentFactory.createLabel_style4(getString("ButtonDemo.padamount_label"));
        leftColumn.add(l);
        ButtonGroup group = new ButtonGroup();
        JRadioButton defaultPad = new JRadioButton(getString("ButtonDemo.default"));
        defaultPad.setToolTipText(getString("ButtonDemo.default_tooltip"));
        defaultPad.setMnemonic(getMnemonic("ButtonDemo.default_mnemonic"));
        defaultPad.addItemListener(buttonPadListener);
        group.add(defaultPad);
        defaultPad.setSelected(true);
        leftColumn.add(defaultPad);

        JRadioButton zeroPad = new JRadioButton(getString("ButtonDemo.zero"));
        zeroPad.setActionCommand("ZeroPad");
        zeroPad.setToolTipText(getString("ButtonDemo.zero_tooltip"));
        zeroPad.addItemListener(buttonPadListener);
        zeroPad.setMnemonic(getMnemonic("ButtonDemo.zero_mnemonic"));
        group.add(zeroPad);
        leftColumn.add(zeroPad);

        JRadioButton tenPad = new JRadioButton(getString("ButtonDemo.ten"));
        tenPad.setActionCommand("TenPad");
        tenPad.setMnemonic(getMnemonic("ButtonDemo.ten_mnemonic"));
        tenPad.setToolTipText(getString("ButtonDemo.ten_tooltip"));
        tenPad.addItemListener(buttonPadListener);
        group.add(tenPad);
        leftColumn.add(tenPad);

        leftColumn.add(Box.createRigidArea(VGAP20));
	return controls;
    }

    /**
     * Creates the listeners.
     */
    public void createListeners() {
	buttonDisplayListener = new ItemListener() {
		Component c;
		AbstractButton b;

		public void itemStateChanged(ItemEvent e) {
		    JCheckBox cb = (JCheckBox) e.getSource();
		    String command = cb.getActionCommand();
		    if(command == "Enabled") {
			for(int i = 0; i < currentControls.size(); i++) {
			    c = (Component) currentControls.elementAt(i);
			    c.setEnabled(cb.isSelected());
			    c.invalidate();
			}
		    } else if(command == "PaintBorder") {
			c = (Component) currentControls.elementAt(0);
			if(c instanceof AbstractButton) {
			    for(int i = 0; i < currentControls.size(); i++) {
				b = (AbstractButton) currentControls.elementAt(i);
				b.setBorderPainted(cb.isSelected());
				b.invalidate();
			    }
			}
		    } else if(command == "PaintFocus") {
			c = (Component) currentControls.elementAt(0);
			if(c instanceof AbstractButton) {
			    for(int i = 0; i < currentControls.size(); i++) {
				b = (AbstractButton) currentControls.elementAt(i);
				b.setFocusPainted(cb.isSelected());
				b.invalidate();
			    }
			}
		    } else if(command == "ContentFilled") {
			c = (Component) currentControls.elementAt(0);
			if(c instanceof AbstractButton) {
			    for(int i = 0; i < currentControls.size(); i++) {
				b = (AbstractButton) currentControls.elementAt(i);
				b.setContentAreaFilled(cb.isSelected());
				b.invalidate();
			    }
			}
		    }
		    invalidate();
		    validate();
		    repaint();
		}
	};

	buttonPadListener = new ItemListener() {
		Component c;
		AbstractButton b;

		public void itemStateChanged(ItemEvent e) {
		    // *** pad = 0
		    int pad = -1;
		    JRadioButton rb = (JRadioButton) e.getSource();
		    String command = rb.getActionCommand();
		    if(command == "ZeroPad" && rb.isSelected()) {
			pad = 0;
		    } else if(command == "TenPad" && rb.isSelected()) {
			pad = 10;
		    }

		    for(int i = 0; i < currentControls.size(); i++) {
			b = (AbstractButton) currentControls.elementAt(i);
			if(pad == -1) {
			    b.setMargin(null);
			} else if(pad == 0) {
			    b.setMargin(insets0);
			} else {
			    b.setMargin(insets10);
			}
		    }
		    invalidate();
		    validate();
		    repaint();
		}
	};
    }

    /* (non-Javadoc)
     * @see javax.swing.event.ChangeListener#stateChanged(javax.swing.event.ChangeEvent)
     */
    public void stateChanged(ChangeEvent e) {
	SingleSelectionModel model = (SingleSelectionModel) e.getSource();
	if(model.getSelectedIndex() == 0) {
	    currentControls = buttons;
	} else if(model.getSelectedIndex() == 1) {
	    currentControls = radiobuttons;
	} else if(model.getSelectedIndex() == 2) {
	    currentControls = checkboxes;
	} else {
	    currentControls = togglebuttons;
	}
    }

    /**
     * Gets the current controls.
     *
     * @return the current controls
     */
    public Vector getCurrentControls() {
	return currentControls;
    }

    //------------------------------------------------------------------------
    //add by jb2011 START
    /**
     * Creates the horizonal hint box.
     *
     * @param parent the parent
     * @param c the c
     * @param txt the txt
     */
    public static void createHorizonalHintBox(JPanel parent,JComponent c, String txt)
    {
    	parent.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    	parent.setAlignmentX(Component.LEFT_ALIGNMENT);
    	c.setBorder(BorderFactory.createEmptyBorder(10, 0, 5, 0));
    	c.setAlignmentX(Component.LEFT_ALIGNMENT);

    	JLabel l1 = N9ComponentFactory.createLabel_style4(txt);
    	l1.setAlignmentX(Component.LEFT_ALIGNMENT);
    	parent.add(l1);

    	parent.add(c);
    }
}


text:
@interface ChatRecorderView(){
    NSArray         *peakImageAry;
    NSArray         *trashImageAry;
    BOOL            isPrepareDelete;
    BOOL            isTrashCanRocking;
}

@end

@implementation ChatRecorderView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {

        [self initilization];
    }
    return self;
}

- (id)initWithCoder:(NSCoder *)aDecoder{
    self = [super initWithCoder:aDecoder];
    if (self) {
        [self initilization];
    }
    return self;
}

- (void)initilization{
    //初始化音量peak峰值图片数组
    _countDownLabel.text = @"手指上滑,取消发送";

    peakImageAry = [[NSArray alloc]initWithObjects:
                    [UIImage imageNamed:@"speaker_0.png"],
                    [UIImage imageNamed:@"speaker_1.png"],
                    [UIImage imageNamed:@"speaker_2.png"],
                    [UIImage imageNamed:@"speaker_3.png"], nil];
    trashImageAry = [[NSArray alloc]initWithObjects:kTrashImage1,kTrashImage2,kTrashImage3,kTrashImage2, nil];

}

#pragma mark -还原显示界面
- (void)restoreDisplay{
    //还原录音图
    _peakMeterIV.image = [peakImageAry objectAtIndex:0];
    //还原倒计时文本
    _countDownLabel.text = @"";
}

#pragma mark - 是否准备删除
- (void)prepareToDelete:(BOOL)_preareDelete{
    if (_preareDelete != isPrepareDelete) {
        isPrepareDelete = _preareDelete;
        [self rockTrashCan:isPrepareDelete];
    }
}
#pragma mark - 是否摇晃垃圾桶
- (void)rockTrashCan:(BOOL)_isTure{

}

#pragma mark - 更新音频峰值
- (void)updateMetersByAvgPower:(float)_avgPower{
    //-160表示完全安静,0表示最大输入值
    //
    NSInteger imageIndex = 0;
    if (_avgPower >= -40 && _avgPower < -30)
        imageIndex = 1;
    else if (_avgPower >= -30 && _avgPower < -25)
        imageIndex = 2;
    else if (_avgPower >= -25)
        imageIndex = 3;

    _peakMeterIV.image = [peakImageAry objectAtIndex:imageIndex];
}

@end


text:
package craterdog.smart;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * This annotation is used to mark string attributes that contain sensitive information and should
 * be masked when output to a log file, and encrypted when stored in a database.
 *
 * @author Yan Ma
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface Sensitive {

    /**
     * The type of sensitive attribute. This may be needed to determine how to encrypt/decrypt the
     * sensitive information.
     *
     * @return The attribute type
     */
    public String type();

    /**
     * The masking pattern that should be applied to the value of the annotated attribute. The
     * pattern is a regular expression that contains "(" and ")" surrounding the parts of the string
     * that should be masked with "X"s.
     *
     * @return The masking pattern.
     */
    public String mask();

    /**
     * The character that should be used to mask the value of the annotated attribute. The default
     * character is 'X'.
     *
     * @return The masking character.
     */
    public char character() default 'X';

    //Defining some constants for frequently used mask annotations
    /**
     * Mask for a password or alphanumeric pin with various lengths (min length = 4, max length =
     * 100): mask all characters
     */
    static public final String MASK_PASSWORD = "(^\\w{4,100}$)";

    /**
     * Mask for a email address. Masks every character before @
     */
    static public final String MASK_EMAIL_ADDRESS = "(^[^@]+)@[^@]+$";

    /**
     * Mask for a phone number: XXX-XXX-dddd leave the last four digits unmasked
     */
    static public final String MASK_PHONE_NUMBER = "(^\\d{3})-(\\d{3})-\\d{4}$";

    /**
     * Mask for a credit card number: dddd-XXXX-XXXX-dddd
     */
    static public final String MASK_CREDIT_CARD_NUMBER = "^\\d{4}-(\\d{4})-(\\d{4})-\\d{4}$";

    /**
     * MASK for a SSN: XXX-XX-dddd leave the last four digits unmasked
     */
    static public final String MASK_SSN = "(^\\d{3}-\\d{2}-)\\d{4}$";

}


text:
/*global define*/
define({
  "_widgetLabel": "Bij mij in de buurt",
  "searchHeaderText": "Zoek een adres of zoek op kaart",
  "invalidSearchLayerMsg": "Zoeklagen zijn niet correct geconfigureerd",
  "bufferSliderText": "Resultaten weergeven binnen ${BufferDistance} ${BufferUnit}",
  "bufferSliderValueString": "Geef een afstand groter dan 0 op",
  "unableToCreateBuffer": "Resulta(a)t(en) kon(den) niet worden gevonden",
  "selectLocationToolTip": "Locatie instellen",
  "noFeatureFoundText": "Geen resultaten gevonden ",
  "attachmentHeader": "Bijlagen",
  "unableToFetchResults": "Kan geen resultaten ophalen van la(a)g(en):",
  "informationTabTitle": "Informatie",
  "directionTabTitle": "Routebeschrijving",
  "failedToGenerateRouteMsg": "Kan de route niet genereren",
  "geometryServicesNotFound": "Geometrie-service niet beschikbaar.",
  "allPopupsDisabledMsg": "Popups zijn niet geconfigureerd, resultaten kunnen niet worden weergegeven.",
  "worldGeocoderName": "Adres",
  "searchLocationTitle": "Gezochte locatie"
});