text:
/* Copyright (c) 1995, 1997 Apple Computer, Inc. All Rights Reserved */
/*
 * Copyright (c) 1982, 1986, 1989, 1991, 1993
 *	The Regents of the University of California.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Berkeley and its contributors.
 * 4. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 *	@(#)user.h	8.2 (Berkeley) 9/23/93
 */

#ifndef	_SYS_USER_H_
#define	_SYS_USER_H_

#include <sys/appleapiopts.h>
#ifndef KERNEL
/* stuff that *used* to be included by user.h, or is now needed */
#include <errno.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/ucred.h>
#include <sys/uio.h>
#endif
#ifdef XNU_KERNEL_PRIVATE
#include <sys/resourcevar.h>
#include <sys/signalvar.h>
#endif
#include <sys/vm.h>		/* XXX */
#include <sys/sysctl.h>

#ifdef KERNEL
#ifdef BSD_KERNEL_PRIVATE
#include <sys/pthread_internal.h> /* for uu_kwe entry */
#endif  /* BSD_KERNEL_PRIVATE */
#ifdef __APPLE_API_PRIVATE
#include <sys/eventvar.h>

#if !defined(__LP64__) || defined(XNU_KERNEL_PRIVATE)
/*
 * VFS context structure (part of uthread)
 */
struct vfs_context {
	thread_t	vc_thread;		/* pointer to Mach thread */
	kauth_cred_t	vc_ucred;		/* per thread credential */
};

#endif /* !__LP64 || XNU_KERNEL_PRIVATE */

#ifdef BSD_KERNEL_PRIVATE
/* XXX Deprecated: xnu source compatability */
#define uu_ucred	uu_context.vc_ucred

struct label;		/* MAC label dummy struct */

#define MAXTHREADNAMESIZE 64
/*
 *	Per-thread U area.
 */

struct uthread {
	/* syscall parameters, results and catches */
	u_int64_t uu_arg[8]; /* arguments to current system call */
	int	*uu_ap;			/* pointer to arglist */
    int uu_rval[2];

	/* thread exception handling */
	mach_exception_code_t uu_code;	/* ``code'' to trap */
	mach_exception_subcode_t uu_subcode;
	int	uu_exception;
	char uu_cursig;			/* p_cursig for exc. */
	/* support for syscalls which use continuations */
	union {
		struct _select_data {
			u_int64_t abstime;
			char * wql;
			int poll;
			int error;
			int count;
		} ss_select_data;
		struct _kqueue_scan {
			kevent_callback_t call; /* per-event callback */
			kqueue_continue_t cont; /* whole call continuation */
			uint64_t deadline;	/* computed deadline for operation */
			void *data;		/* caller's private data */
		} ss_kqueue_scan;		/* saved state for kevent_scan() */
		struct _kevent {
			struct _kqueue_scan scan;/* space for the generic data */
			struct fileproc *fp;	 /* fileproc we hold iocount on */
			int fd;			 /* filedescriptor for kq */
			int32_t *retval;	 /* place to store return val */
			user_addr_t eventlist;	 /* user-level event list address */
			size_t eventsize;	/* kevent or kevent64_s */
			int eventcount;	 	/* user-level event count */
			int eventout;		 /* number of events output */
		} ss_kevent;			 /* saved state for kevent() */

		struct _kauth {
			user_addr_t message;	/* message in progress */
		} uu_kauth;

		struct ksyn_waitq_element  uu_kwe;		/* user for pthread synch */
	} uu_kevent;

	struct _select {
			u_int32_t	*ibits, *obits; /* bits to select on */
			uint	nbytes;	/* number of bytes in ibits and obits */
			struct _select_data *data;
	} uu_select;			/* saved state for select() */

  /* internal support for continuation framework */
    int (*uu_continuation)(int);
    int uu_pri;
    int uu_timo;
	caddr_t uu_wchan;			/* sleeping thread wait channel */
	const char *uu_wmesg;			/* ... wait message */
	struct proc * uu_proc;
	thread_t uu_thread;
	void * uu_userstate;
	wait_queue_set_t uu_wqset;			/* cached across select calls */
	size_t uu_allocsize;				/* ...size of select cache */
	int uu_flag;
	sigset_t uu_siglist;				/* signals pending for the thread */
	sigset_t  uu_sigwait;				/*  sigwait on this thread*/
	sigset_t  uu_sigmask;				/* signal mask for the thread */
	sigset_t  uu_oldmask;				/* signal mask saved before sigpause */
	sigset_t  uu_vforkmask;				/* saved signal mask during vfork */
	struct vfs_context uu_context;			/* thread + cred */

	TAILQ_ENTRY(uthread) uu_list;		/* List of uthreads in proc */

	struct kaudit_record 	*uu_ar;			/* audit record */
	struct task*	uu_aio_task;			/* target task for async io */

	lck_mtx_t	*uu_mtx;

	TAILQ_ENTRY(uthread) uu_throttlelist;	/* List of uthreads currently throttled */
	void	*	uu_throttle_info; 	/* pointer to throttled I/Os info */
	int		uu_on_throttlelist;
	int		uu_lowpri_window;
	boolean_t	uu_throttle_bc;

	u_int32_t	uu_network_marks;	/* network control flow marks */

	struct kern_sigaltstack uu_sigstk;
        vnode_t		uu_vreclaims;
	vnode_t		uu_cdir;		/* per thread CWD */
	int		uu_notrigger;		/* XXX - flag for autofs */
	int		uu_dupfd;		/* fd in fdesc_open/dupfdopen */
        int		uu_defer_reclaims;

#ifdef JOE_DEBUG
        int		uu_iocount;
        int		uu_vpindex;
        void 	*	uu_vps[32];
        void    *       uu_pcs[32][10];
#endif
#if CONFIG_DTRACE
	uint32_t	t_dtrace_errno; /* Most recent errno */
	siginfo_t	t_dtrace_siginfo;
        uint64_t        t_dtrace_resumepid; /* DTrace's pidresume() pid */
        uint8_t         t_dtrace_stop;  /* indicates a DTrace desired stop */
        uint8_t         t_dtrace_sig;   /* signal sent via DTrace's raise() */

        union __tdu {
                struct __tds {
                        uint8_t _t_dtrace_on;   /* hit a fasttrap tracepoint */
                        uint8_t _t_dtrace_step; /* about to return to kernel */
                        uint8_t _t_dtrace_ret;  /* handling a return probe */
                        uint8_t _t_dtrace_ast;  /* saved ast flag */
#if __sol64 || defined(__APPLE__)
                        uint8_t _t_dtrace_reg;  /* modified register */
#endif
                } _tds;
                u_int32_t _t_dtrace_ft;           /* bitwise or of these flags */
        } _tdu;
#define t_dtrace_ft     _tdu._t_dtrace_ft
#define t_dtrace_on     _tdu._tds._t_dtrace_on
#define t_dtrace_step   _tdu._tds._t_dtrace_step
#define t_dtrace_ret    _tdu._tds._t_dtrace_ret
#define t_dtrace_ast    _tdu._tds._t_dtrace_ast
#if __sol64 || defined(__APPLE__)
#define t_dtrace_reg    _tdu._tds._t_dtrace_reg
#endif

        user_addr_t	t_dtrace_pc;    /* DTrace saved pc from fasttrap */
        user_addr_t	t_dtrace_npc;   /* DTrace next pc from fasttrap */
        user_addr_t	t_dtrace_scrpc; /* DTrace per-thread scratch location */
        user_addr_t	t_dtrace_astpc; /* DTrace return sequence location */

	struct dtrace_ptss_page_entry*	t_dtrace_scratch; /* scratch space entry */

#if __sol64 || defined(__APPLE__)
        uint64_t        t_dtrace_regv;  /* DTrace saved reg from fasttrap */
#endif
	void *		t_dtrace_syscall_args;
#endif /* CONFIG_DTRACE */
	void *		uu_threadlist;
	char *		pth_name;
	struct label *	uu_label;	/* MAC label */
};

typedef struct uthread * uthread_t;

/* Definition of uu_flag */
#define	UT_SAS_OLDMASK	0x00000001	/* need to restore mask before pause */
#define	UT_NO_SIGMASK	0x00000002	/* exited thread; invalid sigmask */
#define UT_NOTCANCELPT	0x00000004             /* not a cancelation point */
#define UT_CANCEL	0x00000008             /* thread marked for cancel */
#define UT_CANCELED	0x00000010            /* thread cancelled */
#define UT_CANCELDISABLE 0x00000020            /* thread cancel disabled */
#define	UT_ALTSTACK	0x00000040	/* this thread has alt stack for signals */
#define UT_THROTTLE_IO	0x00000080	/* this thread issues throttle I/O */
#define UT_PASSIVE_IO	0x00000100	/* this thread issues passive I/O */
#define UT_PROCEXIT	0x00000200	/* this thread completed the  proc exit */
#define UT_RAGE_VNODES	0x00000400	/* rapid age any vnodes created by this thread */
/* 0x00000800 unused, used to be UT_BACKGROUND */
/* 0x00001000 unused, used to be UT_BACKGROUND_TRAFFIC_MGT */

#define	UT_VFORK	0x02000000	/* thread has vfork children */
#define	UT_SETUID	0x04000000	/* thread is settugid() */
#define UT_WASSETUID	0x08000000	/* thread was settugid() (in vfork) */
#define	UT_VFORKING	0x10000000	/* thread in vfork() syscall */

#endif /* BSD_KERNEL_PRIVATE */

#endif /* __APPLE_API_PRIVATE */

#endif	/* KERNEL */

/*
 * Per process structure containing data that isn't needed in core
 * when the process isn't running (esp. when swapped out).
 * This structure may or may not be at the same kernel address
 * in all processes.
 */

struct	user {
  /* NOT USED ANYMORE */
};

#endif	/* !_SYS_USER_H_ */


text:
module Apiman {

 export var ApiDefController = _module.controller('Apiman.ApiDefController',
        ['$q', '$rootScope', '$scope', '$location', 'PageLifecycle', 'ApiEntityLoader', 'OrgSvcs', 'Logger', '$routeParams', 'ApiDefinitionSvcs', 'Configuration', 'EntityStatusSvc', 'CurrentUser',
        ($q, $rootScope, $scope, $location, PageLifecycle, ApiEntityLoader, OrgSvcs, Logger, $routeParams, ApiDefinitionSvcs, Configuration, EntityStatusSvc, CurrentUser) => {
            var params = $routeParams;

            $scope.organizationId = params.org;
            $scope.tab = 'def';
            $scope.version = params.version;
            $scope.showMetrics = Configuration.ui.metrics;
            $scope.textAreaHeight = '100';

            $scope.typeOptions = [
                { "label" : "No API Definition",     "value" : "None" },
                { "label" : "Swagger (JSON)",        "value" : "SwaggerJSON" },
                { "label" : "Swagger (YAML)",        "value" : "SwaggerYAML" },
                { "label" : "WSDL",                  "value" : "WSDL" }
            ];

            var selectType = function(newType) {
                angular.forEach($scope.typeOptions, function(option) {
                    if (option.value == newType) {
                        $scope.selectedDefinitionType = option;
                    }
                });
            };

            selectType('None');

            $scope.isEntityDisabled = EntityStatusSvc.isEntityDisabled;

            $scope.saveApi = function() {
                console.log('$scope.selectedDefinitionType.value: ' + $scope.selectedDefinitionType.value);
                $scope.saveButton.state = 'in-progress';

                ApiDefinitionSvcs.updateApiDefinition(params.org, params.api, params.version,
                    $scope.updatedApiDefinition, $scope.selectedDefinitionType.value,
                    function(definition) {
                        Logger.debug("Updated the api definition!");
                        $scope.apiDefinition = $scope.updatedApiDefinition;
                        $rootScope.isDirty = false;
                        $scope.saveButton.state = 'complete';
                    },
                    function(error) {
                        Logger.error("Error updating definition: {0}", error);
                        $scope.saveButton.state = 'error';
                    });
            };

            $scope.$on('afterdrop', function(event, data) {
                let newValue = data.value;

                if (newValue) {
                    if (newValue.lastIndexOf('{', 0) === 0) {
                        $scope.$apply(function() {
                            selectType('SwaggerJSON');
                        });
                    } else if (newValue.lastIndexOf('<', 0) === 0) {
                        $scope.$apply(function() {
                            selectType('WSDL');
                        });
                    } else {
                        $scope.$apply(function() {
                            selectType('SwaggerYAML');
                        });
                    }
                }
            });

            var pageData = ApiEntityLoader.getCommonData($scope, $location);

            var loadDefinition = function() {
                ApiDefinitionSvcs.getApiDefinition(params.org, params.api, params.version,
                    function(definition) {
                        $scope.apiDefinition = definition;
                        $scope.updatedApiDefinition = definition;
                    },
                    function(error) {
                        Logger.error("Error loading definition: {0}", error);
                    });
            };

            let loadDefinitionUrl = function () {
                $scope.apimanDefinitionUrl = ApiDefinitionSvcs.getApimanDefinitionUrl(params.org, params.api, params.version)
            };

            var checkDirty = function() {
                if ($scope.version) {
                    var dirty = false;

                    Logger.debug("Model def type: {1}   UI Def type: {0}", $scope.definitionType, $scope.selectedDefinitionType.value);

                    if ($scope.apiDefinition != $scope.updatedApiDefinition) {
                        Logger.debug("**** dirty because of api def");
                        dirty = true;
                    }

                    if ($scope.selectedDefinitionType.value != $scope.definitionType) {
                        Logger.debug("**** dirty because of def type: {0} != {1}", $scope.selectedDefinitionType.value, $scope.definitionType);
                        dirty = true;
                    }

                    $rootScope.isDirty = dirty;
                }
            };

            $scope.$watch('updatedApi', checkDirty, true);

            $scope.$watch('updatedApiDefinition', function(newValue, oldValue) {
                if (!newValue && !oldValue) {
                    return;
                }

                checkDirty();
            });

            $scope.$watch('selectedDefinitionType', checkDirty, true);

            $scope.reset = function() {
                selectType($scope.definitionType);
                $scope.updatedApiDefinition = $scope.apiDefinition;
                $scope.updatedApiDefinitionUrl = $scope.version.definitionUrl;
                $rootScope.isDirty = false;
            };

            $scope.downloadDefinition = function () {
                let element = document.createElement('a');
                element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent($scope.apiDefinition));
                let fileName = $scope.api.id + '-' + $scope.version.version + '-' + $scope.definitionType;
                let fileExtension = '.json';
                if ($scope.definitionType == 'SwaggerYAML') {
                    fileExtension = '.yaml';
                } else if ($scope.definitionType == 'WSDL') {
                    fileExtension = '.xml';
                }
                element.setAttribute('download', fileName + fileExtension);
                element.style.display = 'none';
                document.body.appendChild(element);
                element.click();
                document.body.removeChild(element);
            };

            $scope.updateDefinitionFromUrl = function () {
                let definitionUrl = $scope.updatedApiDefinitionUrl;
                let definitionType = $scope.selectedDefinitionType.value;
                ApiDefinitionSvcs.updateApiDefinitionFromUrl(params.org, params.api, params.version, definitionUrl, definitionType,
                    function() {
                        Logger.debug("Updated the api definition!");
                        loadDefinition();
                        $rootScope.isDirty = false;
                        $scope.saveButton.state = 'complete';
                    },
                    function(error) {
                        Logger.error("Error updating definition: {0}", error);
                        $scope.saveButton.state = 'error';
                    })

            };

            PageLifecycle.loadPage('ApiDef', 'apiView', pageData, $scope, function() {
                $scope.definitionType = $scope.version.definitionType;
                $scope.updatedApiDefinitionUrl = $scope.version.definitionUrl;

                if (!$scope.definitionType) {
                    $scope.definitionType = 'None';
                }

                if ($scope.version.definitionType && $scope.version.definitionType != 'None' && $scope.version.definitionType != 'External') {
                    loadDefinition();
                    loadDefinitionUrl();
                } else {
                    Logger.debug("Skipped loading api definition - None defined.");
                }

                $scope.reset();

                PageLifecycle.setPageTitle('api-def', [ $scope.api.name ]);
            });
        }]);
}

redpajama_set_name: RedPajamaGithub


text:
module VagrantPlugins
  module HostsProvisioner
    VERSION = "2.0"
  end
end


text:
const chai = require('chai')
const assert = chai.assert

import Map from '../lib/map'

describe('Map', function() {
  context('basic map', function() {

    var map = new Map({ tsize: 10,
                        columns: 2,
                        rows: 2,
                        tiles: [ 78, 81,
                                 78, 78 ],
                        barriers: [81]
                      })

    it('should have tiles', () => {
      assert.equal(map.tiles.length, 4)
    })

    it('can convert coordinates to a tile index', () => {
      let result =  map.convertXYtoTileIndex(5, 5)
      assert.equal(result, 0, 'conversion to tile index is not correct')
    })

    it('can convert coordinates to a barrier index', () => {
      let result =  map.convertXYtoTileIndex(15, 5)
      assert.equal(result, 1)
    })

    it('can retrieve the tile value for specific coordinates', () => {
      let regular_tile =  map.getTileValueAtXY(5, 5)
      let barrier_tile =  map.getTileValueAtXY(15, 5)
      assert.equal(regular_tile, 78)
      assert.equal(barrier_tile, 81)
    })

    it('if coordinates indicate a colision with the wall', () => {
      let result =  map.isWallCollision(11, 0)
      assert.equal(result, true)
    })
  })
})


text:
package integration.browser;

import static org.hamcrest.MatcherAssert.assertThat;

import org.hamcrest.Matchers;
import org.junit.Test;

import integration.AbstractWebTesterIntegrationTest;

import info.novatec.testit.webtester.api.annotations.IdentifyUsing;
import info.novatec.testit.webtester.pageobjects.Button;
import info.novatec.testit.webtester.pageobjects.PageObject;

public class ScrollIntoViewIntegrationTest extends AbstractWebTesterIntegrationTest {

    @Override
    protected String getHTMLFilePath() {
        return "html/browser/scroll-into-view.html";
    }

    @Test
    public void scrollIntoView() {
        Button outOfView = getBrowser().create(TestPage.class).outOfView;
        assertThat(elementIsInView(), Matchers.is(false));
        getBrowser().scrollTo(outOfView);
        assertThat(elementIsInView(), Matchers.is(true));
    }

    Boolean elementIsInView() {
        return getBrowser().javaScript().executeWithReturn("return isScrolledIntoView()");
    }

    private static class TestPage extends PageObject {

        @IdentifyUsing("outOfView")
        Button outOfView;

    }

}


text:
package org.apache.carbondata.integration.spark.testsuite.primitiveTypes

import org.apache.spark.sql.test.util.QueryTest
import org.scalatest.BeforeAndAfterAll

/**
 * Test Class for filter query on Float datatypes
 */
class MapDataTypeTestCase extends QueryTest with BeforeAndAfterAll {

  override def beforeAll {
    sql("DROP TABLE IF EXISTS datatype_map_parquet")
    sql("DROP TABLE IF EXISTS datatype_map_carbondata")
  }

  test("test when insert select from a parquet table with an map with empty key and value") {
    sql("create table datatype_map_parquet(col map<string,string>) stored as parquet")
    sql("create table datatype_map_carbondata(col map<string,string>) stored as carbondata")
    sql("insert into datatype_map_parquet values(map('',''))")
    sql("insert into datatype_map_carbondata select * from datatype_map_parquet")
    checkAnswer(
      sql("SELECT * FROM datatype_map_carbondata"),
      sql("SELECT * FROM datatype_map_parquet"))
    sql("DROP TABLE IF EXISTS datatype_map_carbondata")
    sql("DROP TABLE IF EXISTS datatype_map_parquet")
  }

  test("test when insert select from a parquet table with an map with empty key") {
    sql("create table datatype_map_parquet(col map<string,string>) stored as parquet")
    sql("create table datatype_map_carbondata(col map<string,string>) stored as carbondata")
    sql("insert into datatype_map_parquet values(map('','value'))")
    sql("insert into datatype_map_carbondata select * from datatype_map_parquet")
    checkAnswer(
      sql("SELECT * FROM datatype_map_carbondata"),
      sql("SELECT * FROM datatype_map_parquet"))
    sql("DROP TABLE IF EXISTS datatype_map_carbondata")
    sql("DROP TABLE IF EXISTS datatype_map_parquet")
  }

  test("test when insert select from a parquet table with an map with empty value") {
    sql("create table datatype_map_parquet(col map<string,string>) stored as parquet")
    sql("create table datatype_map_carbondata(col map<string,string>) stored as carbondata")
    sql("insert into datatype_map_parquet values(map('key',''))")
    sql("insert into datatype_map_carbondata select * from datatype_map_parquet")
    checkAnswer(
      sql("SELECT * FROM datatype_map_carbondata"),
      sql("SELECT * FROM datatype_map_parquet"))
    sql("DROP TABLE IF EXISTS datatype_map_carbondata")
    sql("DROP TABLE IF EXISTS datatype_map_parquet")
  }

  override def afterAll {
    sql("DROP TABLE IF EXISTS datatype_map_carbondata")
    sql("DROP TABLE IF EXISTS datatype_map_parquet")
  }
}


text:
package com.yammer.metrics.jetty;

import com.yammer.metrics.Metrics;
import com.yammer.metrics.core.Counter;
import com.yammer.metrics.core.Meter;
import com.yammer.metrics.core.MetricsRegistry;
import com.yammer.metrics.core.Timer;
import org.eclipse.jetty.io.Connection;
import org.eclipse.jetty.server.ssl.SslSocketConnector;

import java.io.IOException;
import java.util.concurrent.TimeUnit;

public class InstrumentedSslSocketConnector extends SslSocketConnector {
    private final Timer duration;
    private final Meter accepts, connects, disconnects;
    private final Counter connections;

    public InstrumentedSslSocketConnector(int port) {
        this(Metrics.defaultRegistry(), port);
    }

    public InstrumentedSslSocketConnector(MetricsRegistry registry, int port) {
        super();
        setPort(port);
        this.duration = registry.newTimer(SslSocketConnector.class,
                                          "connection-duration",
                                          Integer.toString(port),
                                          TimeUnit.MILLISECONDS,
                                          TimeUnit.SECONDS);
        this.accepts = registry.newMeter(SslSocketConnector.class,
                                         "accepts",
                                         Integer.toString(port),
                                         "connections",
                                         TimeUnit.SECONDS);
        this.connects = registry.newMeter(SslSocketConnector.class,
                                          "connects",
                                          Integer.toString(port),
                                          "connections",
                                          TimeUnit.SECONDS);
        this.disconnects = registry.newMeter(SslSocketConnector.class,
                                             "disconnects",
                                             Integer.toString(port),
                                             "connections",
                                             TimeUnit.SECONDS);
        this.connections = registry.newCounter(SslSocketConnector.class,
                                               "active-connections",
                                               Integer.toString(port));
    }

    @Override
    public void accept(int acceptorID) throws IOException, InterruptedException {
        super.accept(acceptorID);
        accepts.mark();
    }

    @Override
    protected void connectionOpened(Connection connection) {
        connections.inc();
        super.connectionOpened(connection);
        connects.mark();
    }

    @Override
    protected void connectionClosed(Connection connection) {
        super.connectionClosed(connection);
        disconnects.mark();
        final long duration = System.currentTimeMillis() - connection.getTimeStamp();
        this.duration.update(duration, TimeUnit.MILLISECONDS);
        connections.dec();
    }
}


text:
package com.tinkerpop.pipes.sideeffect;

import com.tinkerpop.pipes.AbstractPipe;
import com.tinkerpop.pipes.PipeFunction;
import com.tinkerpop.pipes.util.structures.Pair;

import java.util.HashMap;
import java.util.Map;

/**
 * GroupCountFunctionPipe is analogous to GroupCountPipe save that it takes two optional functions.
 * The first function is a key function which determines the key to use for each incoming object.
 * The second function is a value function which determines the value to put into the Map for each key.
 *
 * @author Marko A. Rodriguez (http://markorodriguez.com)
 */
public class GroupCountFunctionPipe<S, K> extends AbstractPipe<S, S> implements SideEffectPipe.GreedySideEffectPipe<S, Map<K, Number>> {

    private Map<K, Number> countMap;
    private final PipeFunction<Pair<S, Number>, Number> valueFunction;
    private final PipeFunction<S, K> keyFunction;

    public GroupCountFunctionPipe(final Map<K, Number> countMap, final PipeFunction<S, K> keyFunction, final PipeFunction<Pair<S, Number>, Number> valueFunction) {
        this.countMap = countMap;
        this.valueFunction = valueFunction;
        this.keyFunction = keyFunction;
    }

    public GroupCountFunctionPipe(final PipeFunction<S, K> keyFunction, final PipeFunction<Pair<S, Number>, Number> valueFunction) {
        this(new HashMap<K, Number>(), keyFunction, valueFunction);
    }

    protected S processNextStart() {
        final S s = this.starts.next();
        final K key = this.getKey(s);
        this.countMap.put(key, this.getValue(s, key));
        return s;
    }

    public Map<K, Number> getSideEffect() {
        return this.countMap;
    }

    public void reset() {
        try {
            this.countMap = this.countMap.getClass().getConstructor().newInstance();
        } catch (Exception e) {
            throw new RuntimeException(e.getMessage(), e);
        }
        super.reset();
    }

    private K getKey(final S start) {
        if (null == keyFunction) {
            return (K) start;
        } else {
            return keyFunction.compute(start);
        }
    }

    //TODO: Fix java.lang.Number issue.
    private Number getValue(final S start, final K key) {
        Number number = this.countMap.get(key);
        if (null == number) {
            number = 0l;
        }
        if (null == valueFunction) {
            return 1l + number.longValue();
        } else {
            return this.valueFunction.compute(new Pair<S, Number>(start, number));
        }

    }
}


text:
<?php

class Dlayer_Designer_Form
{

    /**
     * @var boolean
     */
    private $builder = false;

    /**
     * @var integer|null
     */
    private $field_id = null;

    /**
     * @var \Dlayer_Model_View_Form
     */
    private $model_form;

    /**
     * @var \Dlayer_Model_View_Form_Styling
     */
    private $model_styling;

    /**
     * @var array
     */
    private $styles;

    /**
     * Pass in anything required to setup the object
     *
     * @param integer $site_id
     * @param integer $id
     * @param boolean $builder
     * @param integer|NULL $field_id
     */
    public function __construct($site_id, $id, $builder = false, $field_id = null)
    {
        $this->site_id = $site_id;
        $this->id = $id;
        $this->builder = $builder;
        $this->field_id = $field_id;

        $this->model_form = new Dlayer_Model_View_Form();
        $this->model_form->setUp($site_id, $id);

        $this->model_styling = new Dlayer_Model_View_Form_Styling();
        $this->model_form->setUp($site_id, $id);
    }

    /**
     * Fetch the form titles and buttons
     *
     * @return array
     */
    public function layoutOptions()
    {
        $layoutOptions = $this->model_form->layoutOptions();
        if ($layoutOptions !== false) {
            return $layoutOptions;
        } else {
            return array(
                'title' => Dlayer_Config::FORM_DEFAULT_TITLE,
                'subtitle' => Dlayer_Config::FORM_DEFAULT_SUBTITLE,
                'submit_label' => Dlayer_Config::FORM_DEFAULT_SUBMIT_LABEL,
                'reset_label' => Dlayer_Config::FORM_DEFAULT_RESET_LABEL
            );
        }
    }

    /**
     * Fetch all the fields that have assigned to the form, will include all the attributes for each field
     *
     * @return array
     */
    private function fields()
    {
        return $this->model_form->fields();
    }

    /**
     * Fetch the form
     *
     * @return Dlayer_Form_Builder
     */
    public function form()
    {
        return new Dlayer_Form_Builder($this->id, $this->fields(), $this->builder, $this->field_id);
    }

    /**
     * Fetch the styling for field rows, indexed by field row
     *
     * @return array
     */
    public function rowStyles()
    {
        return array(
            'background-color' => $this->rowBackgroundColors()
        );
    }

    /**
     * Fetch the background colors assigned to the field rows
     *
     * @return array
     */
    private function rowBackgroundColors()
    {
        return $this->model_styling->rowBackgroundColors($this->site_id, $this->id);
    }
}


text:
ActiveRecord::Schema.define(:version => 20130671612345) do
    create_table :deb_accounts do |t|
      t.string :name
      t.string :kind
      t.string :short_name, limit: 16
      t.references :accountable, polymorphic: true
      t.boolean :contra
      t.decimal :current_balance, precision: 20, scale: 2, default: 0
      t.timestamps
    end
    add_index :deb_accounts, :short_name
    add_index :deb_accounts, [:accountable_type, :accountable_id, :kind], name: "deb_accounts_default"

    create_table :deb_transactions do |t|
      t.string :description
      t.string :kind, limit: 16
      t.references :transactionable, polymorphic: true
      t.integer :rollback_transaction_id
      t.timestamps
    end
    add_index :deb_transactions, [:transactionable_type, :transactionable_id, :kind], name: "deb_transactions_default"

    create_table :deb_items do |t|
      t.string :kind
      t.integer :account_id
      t.integer :transaction_id
      t.decimal :amount, precision: 20, scale: 2, default: 0
      t.decimal :balance_before, precision: 20, scale: 2, default: 0
      t.decimal :balance_after, precision: 20, scale: 2, default: 0
    end
    add_index :deb_items, :account_id
    add_index :deb_items, [:transaction_id, :kind]
end


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Tournia presentation screen</title>
    <meta name="description" content="Tournia presentation screen">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap-theme.min.css">
    <link rel="stylesheet" href="css/app.css">

Current matches

                                {{match.team1Txt}}

                                {{match.team2Txt}}

court

{{match.locationTxt}}

Upcoming matches

postponed

                                {{player.name}}

                                {{player.name}}

{{match.disciplineLevelTxt}}

{{match.disciplineTypeTxt}}

Played matches

                                {{player.name}}

                                {{player.name}}

                                    {{score}}


text:
package com.support.android.musicindia.model;

import java.util.Date;

/**
 * Created by amitagarwal3 on 7/17/2016.
 */
public class SONG {

    private int songId;
    private String songName;
    private String songUrl;
    private int completed;
    private int running;

    public SONG(int songId, String songName, String songUrl, int completed, int running) {
        this.songId = songId;
        this.songName = songName;
        this.songUrl = songUrl;
        this.completed = completed;
        this.running = running;
    }

    public int getRunning() {
        return running;
    }

    public void setRunning(int running) {
        this.running = running;
    }

    public SONG() {
    }

    public int getSongId() {
        return songId;
    }

    public void setSongId(int songId) {
        this.songId = songId;
    }

    public String getSongName() {
        return songName;
    }

    public void setSongName(String songName) {
        this.songName = songName;
    }

    public String getSongUrl() {
        return songUrl;
    }

    public void setSongUrl(String songUrl) {
        this.songUrl = songUrl;
    }

    public int getCompleted() {
        return completed;
    }

    public void setCompleted(int completed) {
        this.completed = completed;
    }
}


text:
module BasicConstant where

import Alias
import BasicData
import Data.Bits

aFile,aAndBFile,hFile,gAndHFile,edge,backrank,eighthRank,firstRank,kingside,queenside   :: BitBoard
initWKingsideRook,initWQueensideRook,initBKingsideRook,initBQueensideRook,initRooks     :: BitBoard
initWKing,initBKing,initKingsAndRooks,initKingsideRooks,initQueensideRooks              :: BitBoard
initWKRBQR,initWQRBKR,lightSquares,darkSquares                                          :: BitBoard
aFile                   = 0x8080808080808080
aAndBFile               = 0xc0c0c0c0c0c0c0c0
hFile                   = 0x0101010101010101
gAndHFile               = 0x0303030303030303
edge                    = 0xff818181818181ff
backrank                = 0xff000000000000ff
eighthRank              = 0xff00000000000000
firstRank               = 0x00000000000000ff
kingside                = 0x0f0f0f0f0f0f0f0f
queenside               = 0xf0f0f0f0f0f0f0f0
initWKingsideRook       = 0x0000000000000001
initWQueensideRook      = 0x0000000000000080
initBKingsideRook       = 0x0100000000000000
initBQueensideRook      = 0x8000000000000000
initRooks               = 0x8100000000000081
initWKing               = 0x0000000000000008
initBKing               = 0x0800000000000000
initKingsAndRooks       = 0x8900000000000089
initKingsideRooks       = initWKingsideRook  .|. initBKingsideRook
initQueensideRooks      = initWQueensideRook .|. initBQueensideRook
initWKRBQR              = initWKingsideRook  .|. initBQueensideRook
initWQRBKR              = initWQueensideRook .|. initBKingsideRook
lightSquares            = 0x5555555555555555
darkSquares             = complement lightSquares

pawnMaterial,knightMaterial,bishopMaterial,rookMaterial,queenMaterial,kingMaterial :: PieceValue
pawnMaterial    = 100
knightMaterial  = 320
bishopMaterial  = 330
rookMaterial    = 500
queenMaterial   = 900
kingMaterial    = 20000


text:
package org.apache.ignite.spi.discovery.tcp.internal;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.UUID;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteException;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.internal.GridComponent;
import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.marshaller.Marshaller;
import org.apache.ignite.spi.discovery.DiscoveryDataBag;

import static org.apache.ignite.internal.GridComponent.DiscoveryDataExchangeType.CONTINUOUS_PROC;

/**
 * Carries discovery data in marshalled form
 * and allows convenient way of converting it to and from {@link DiscoveryDataBag} objects.
 */
public class DiscoveryDataPacket implements Serializable {
    /** Local file header signature(read as a little-endian number). */
    private static int ZIP_HEADER_SIGNATURE = 0x04034b50;

    /** */
    private static final long serialVersionUID = 0L;

    /** */
    private final UUID joiningNodeId;

    /** */
    private Map<Integer, byte[]> joiningNodeData = new HashMap<>();

    /** */
    private transient Map<Integer, Serializable> unmarshalledJoiningNodeData;

    /** */
    private Map<Integer, byte[]> commonData = new HashMap<>();

    /** */
    private Map<UUID, Map<Integer, byte[]>> nodeSpecificData = new LinkedHashMap<>();

    /** */
    private transient boolean joiningNodeClient;

    /**
     * @param joiningNodeId Joining node id.
     */
    public DiscoveryDataPacket(UUID joiningNodeId) {
        this.joiningNodeId = joiningNodeId;
    }

    /**
     *
     */
    public UUID joiningNodeId() {
        return joiningNodeId;
    }

    /**
     * @param bag Bag.
     * @param nodeId Node id.
     * @param marsh Marsh.
     * @param log Logger.
     */
    public void marshalGridNodeData(DiscoveryDataBag bag, UUID nodeId, Marshaller marsh, boolean isCompressionEnabled,
        int compressionLevel, IgniteLogger log) {
        marshalData(bag.commonData(), commonData, marsh, isCompressionEnabled, compressionLevel, log);

        Map<Integer, Serializable> locNodeSpecificData = bag.localNodeSpecificData();

        if (locNodeSpecificData != null) {
            Map<Integer, byte[]> marshLocNodeSpecificData = U.newHashMap(locNodeSpecificData.size());

            marshalData(locNodeSpecificData, marshLocNodeSpecificData, marsh, isCompressionEnabled, compressionLevel, log);

            filterDuplicatedData(marshLocNodeSpecificData);

            if (!marshLocNodeSpecificData.isEmpty())
                nodeSpecificData.put(nodeId, marshLocNodeSpecificData);
        }
    }

    /**
     * @param bag Bag.
     * @param marsh Marsh.
     * @param log Logger.
     */
    public void marshalJoiningNodeData(DiscoveryDataBag bag, Marshaller marsh, boolean isCompressionEnabled,
        int compressionLevel, IgniteLogger log) {
        marshalData(bag.joiningNodeData(), joiningNodeData, marsh, isCompressionEnabled, compressionLevel, log);
    }

    /**
     * @return {@code true} if joining node data was transferred via network in zipped format.
     */
    public boolean isJoiningDataZipped() {
        for (Map.Entry<Integer, byte[]> entry : joiningNodeData.entrySet()) {
            if (isZipped(entry.getValue()))
                return true;
        }

        return false;
    }

    /**
     * @param marsh Marsh.
     * @param clsLdr Class loader.
     * @param clientNode Client node.
     * @param log Logger.
     */
    public DiscoveryDataBag unmarshalGridData(
        Marshaller marsh,
        ClassLoader clsLdr,
        boolean clientNode,
        IgniteLogger log
    ) throws IgniteCheckedException {
        DiscoveryDataBag dataBag = new DiscoveryDataBag(joiningNodeId, joiningNodeClient);

        if (commonData != null && !commonData.isEmpty())
            dataBag.commonData(unmarshalData(commonData, marsh, clsLdr, clientNode, log, true));

        if (nodeSpecificData != null && !nodeSpecificData.isEmpty()) {
            Map<UUID, Map<Integer, Serializable>> unmarshNodeSpecData = U.newLinkedHashMap(nodeSpecificData.size());

            for (Map.Entry<UUID, Map<Integer, byte[]>> nodeBinEntry : nodeSpecificData.entrySet()) {
                Map<Integer, byte[]> nodeBinData = nodeBinEntry.getValue();

                if (nodeBinData == null || nodeBinData.isEmpty())
                    continue;

                unmarshNodeSpecData.put(
                    nodeBinEntry.getKey(),
                    unmarshalData(nodeBinData, marsh, clsLdr, clientNode, log, true)
                );
            }

            dataBag.nodeSpecificData(unmarshNodeSpecData);
        }

        return dataBag;
    }

    /**
     * @param marsh Marsh.
     * @param clsLdr Class loader.
     * @param clientNode Client node.
     * @param log Logger.
     * @throws IgniteCheckedException If unmarshalling failed.
     */
    public DiscoveryDataBag unmarshalJoiningNodeData(
        Marshaller marsh,
        ClassLoader clsLdr,
        boolean clientNode,
        IgniteLogger log
    ) throws IgniteCheckedException {
        return unmarshalJoiningNodeData(marsh, clsLdr, clientNode, log, true);
    }

    /**
     * @param marsh Marsh.
     * @param clsLdr Class loader.
     * @param clientNode Client node.
     * @param log Logger.
     */
    public DiscoveryDataBag unmarshalJoiningNodeDataSilently(
        Marshaller marsh,
        ClassLoader clsLdr,
        boolean clientNode,
        IgniteLogger log
    ) {
        try {
            return unmarshalJoiningNodeData(marsh, clsLdr, clientNode, log, false);
        }
        catch (IgniteCheckedException impossible) {
            assert false : impossible;

            log.error("Failed to unmarshal joining node data", impossible);

            throw new IgniteException(impossible);
        }
    }

    /**
     * @param marsh Marsh.
     * @param clsLdr Class loader.
     * @param clientNode Client node.
     * @param log Logger.
     * @param panic Throw unmarshalling if {@code true}.
     * @throws IgniteCheckedException If {@code panic} is {@code true} and unmarshalling failed.
     */
    private DiscoveryDataBag unmarshalJoiningNodeData(
        Marshaller marsh,
        ClassLoader clsLdr,
        boolean clientNode,
        IgniteLogger log,
        boolean panic
    ) throws IgniteCheckedException {
        DiscoveryDataBag dataBag = new DiscoveryDataBag(joiningNodeId, joiningNodeClient);

        if (joiningNodeData != null && !joiningNodeData.isEmpty()) {
            unmarshalledJoiningNodeData = unmarshalData(joiningNodeData, marsh, clsLdr, clientNode, log, panic);

            dataBag.joiningNodeData(unmarshalledJoiningNodeData);
        }

        return dataBag;
    }

    /**
     *
     */
    public boolean hasJoiningNodeData() {
        return joiningNodeData != null && !joiningNodeData.isEmpty();
    }

    /**
     * @param nodeId Node id.
     */
    public boolean hasDataFromNode(UUID nodeId) {
        return nodeSpecificData.containsKey(nodeId);
    }

    /**
     * @param existingDataPacket Existing data packet.
     * @param mrgdCmnDataKeys Mrgd cmn data keys.
     * @param mrgdSpecifDataKeys Mrgd specif data keys.
     */
    public boolean mergeDataFrom(
            DiscoveryDataPacket existingDataPacket,
            Collection<Integer> mrgdCmnDataKeys,
            Collection<UUID> mrgdSpecifDataKeys
    ) {
        if (commonData.size() != mrgdCmnDataKeys.size()) {
            for (Map.Entry<Integer, byte[]> e : commonData.entrySet()) {
                if (!mrgdCmnDataKeys.contains(e.getKey())) {
                    byte[] data = existingDataPacket.commonData.get(e.getKey());

                    if (data != null && Arrays.equals(e.getValue(), data)) {
                        e.setValue(data);

                        boolean add = mrgdCmnDataKeys.add(e.getKey());

                        assert add;

                        if (mrgdCmnDataKeys.size() == commonData.size())
                            break;
                    }
                }
            }
        }

        if (nodeSpecificData.size() != mrgdSpecifDataKeys.size()) {
            for (Map.Entry<UUID, Map<Integer, byte[]>> e : nodeSpecificData.entrySet()) {
                if (!mrgdSpecifDataKeys.contains(e.getKey())) {
                    Map<Integer, byte[]> data = existingDataPacket.nodeSpecificData.get(e.getKey());

                    if (data != null && mapsEqual(e.getValue(), data)) {
                        e.setValue(data);

                        boolean add = mrgdSpecifDataKeys.add(e.getKey());

                        assert add;

                        if (mrgdSpecifDataKeys.size() == nodeSpecificData.size())
                            break;
                    }
                }
            }
        }

        return (mrgdCmnDataKeys.size() == commonData.size()) && (mrgdSpecifDataKeys.size() == nodeSpecificData.size());
    }

    /**
     * @param m1 first map to compare.
     * @param m2 second map to compare.
     */
    private boolean mapsEqual(Map<Integer, byte[]> m1, Map<Integer, byte[]> m2) {
        if (m1 == m2)
            return true;

        if (m1.size() == m2.size()) {
            for (Map.Entry<Integer, byte[]> e : m1.entrySet()) {
                byte[] data = m2.get(e.getKey());

                if (!Arrays.equals(e.getValue(), data))
                    return false;
            }

            return true;
        }

        return false;
    }

    /**
     * @param src Source.
     * @param marsh Marsh.
     * @param clsLdr Class loader.
     * @param clientNode Client node.
     * @param log Logger.
     * @param panic Throw unmarshalling if {@code true}.
     * @throws IgniteCheckedException If {@code panic} is {@true} and unmarshalling failed.
     */
    private Map<Integer, Serializable> unmarshalData(
        Map<Integer, byte[]> src,
        Marshaller marsh,
        ClassLoader clsLdr,
        boolean clientNode,
        IgniteLogger log,
        boolean panic
    ) throws IgniteCheckedException {
        Map<Integer, Serializable> res = U.newHashMap(src.size());

        for (Map.Entry<Integer, byte[]> binEntry : src.entrySet()) {
            try {
                Serializable compData = isZipped(binEntry.getValue()) ?
                    U.unmarshalZip(marsh, binEntry.getValue(), clsLdr) :
                    U.unmarshal(marsh, binEntry.getValue(), clsLdr);
                res.put(binEntry.getKey(), compData);
            }
            catch (IgniteCheckedException e) {
                if (CONTINUOUS_PROC.ordinal() == binEntry.getKey() &&
                    X.hasCause(e, ClassNotFoundException.class) && clientNode
                ) {
                    U.warn(log, "Failed to unmarshal continuous query remote filter on client node. Can be ignored.");

                    continue;
                }
                else if (binEntry.getKey() < GridComponent.DiscoveryDataExchangeType.VALUES.length) {
                    U.error(log,
                        "Failed to unmarshal discovery data for component: " +
                            GridComponent.DiscoveryDataExchangeType.VALUES[binEntry.getKey()],
                        e
                    );
                }
                else {
                    U.warn(log, "Failed to unmarshal discovery data." +
                        " Component " + binEntry.getKey() + " is not found.");
                }

                if (panic)
                    throw e;
            }
        }

        return res;
    }

    /**
     * @param value Value to check.
     * @return {@code true} if value is zipped.
     */
    private boolean isZipped(byte[] value) {
        return value != null && value.length > 3 && makeInt(value) == ZIP_HEADER_SIGNATURE;
    }

    /**
     * Make int from first 4 bytes in little-endian byte order.
     *
     * @param b Source of bytes.
     * @return Made int.
     */
    private static int makeInt(byte[] b) {
        return (((b[3]) << 24) |
            ((b[2] & 0xff) << 16) |
            ((b[1] & 0xff) << 8) |
            ((b[0] & 0xff)));
    }

    /**
     * @param src Source.
     * @param target Target.
     * @param marsh Marsh.
     * @param log Logger.
     */
    private void marshalData(
            Map<Integer, Serializable> src,
            Map<Integer, byte[]> target,
            Marshaller marsh,
            boolean isCompressionEnabled,
            int compressionLevel,
            IgniteLogger log
    ) {
        //may happen if nothing was collected from components,
        // corresponding map (for common data or for node specific data) left null
        if (src == null)
            return;

        for (Map.Entry<Integer, Serializable> entry : src.entrySet()) {
            try {
                target.put(entry.getKey(), isCompressionEnabled ?
                    U.zip(U.marshal(marsh, entry.getValue()), compressionLevel) :
                    U.marshal(marsh, entry.getValue()));
            }
            catch (IgniteCheckedException e) {
                U.error(log, "Failed to marshal discovery data " +
                        "[comp=" + entry.getKey() + ", data=" + entry.getValue() + ']', e);
            }
        }
    }

    /**
     * @param log Logger.
     */
    public void unzipData(IgniteLogger log) {
        for (Map.Entry<Integer, byte[]> entry : joiningNodeData.entrySet()) {
            try {
                entry.setValue(U.unzip(entry.getValue()));
            }
            catch (IgniteCheckedException e) {
                U.error(log, "Failed to unzip discovery data " +
                    "[comp=" + entry.getKey() + ']', e);
            }
        }
    }

    /**
     * TODO https://issues.apache.org/jira/browse/IGNITE-4435
     */
    private void filterDuplicatedData(Map<Integer, byte[]> discoData) {
        for (Map<Integer, byte[]> existingData : nodeSpecificData.values()) {
            Iterator<Map.Entry<Integer, byte[]>> it = discoData.entrySet().iterator();

            while (it.hasNext()) {
                Map.Entry<Integer, byte[]> discoDataEntry = it.next();

                byte[] curData = existingData.get(discoDataEntry.getKey());

                if (Arrays.equals(curData, discoDataEntry.getValue()))
                    it.remove();
            }

            if (discoData.isEmpty())
                break;
        }
    }

    /**
     * Returns {@link DiscoveryDataBag} aware of components with already initialized common data
     * (e.g. on nodes prior in cluster to the one where this method is called).
     */
    public DiscoveryDataBag bagForDataCollection() {
        DiscoveryDataBag dataBag = new DiscoveryDataBag(joiningNodeId, commonData.keySet(), joiningNodeClient);

        if (unmarshalledJoiningNodeData != null)
            dataBag.joiningNodeData(unmarshalledJoiningNodeData);

        return dataBag;
    }

    /**
     * @param joiningNodeClient Joining node is client flag.
     */
    public void joiningNodeClient(boolean joiningNodeClient) {
        this.joiningNodeClient = joiningNodeClient;
    }

    /**
     * Clears {@link #unmarshalledJoiningNodeData}
     */
    public void clearUnmarshalledJoiningNodeData() {
        unmarshalledJoiningNodeData = null;
    }
}


text:
<?xml version="1.0" encoding="UTF-8" ?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>org.neos.ws</groupId>
	<artifactId>client-ws-back</artifactId>
	<version>1.0</version>
	<packaging>jar</packaging>
	<description>Maven + JAX-WS + CXF client project just for playing around with SOAP web services</description>
	<inceptionYear>2015</inceptionYear>

	<licenses>
		<license>
			<name>GNU GENERAL PUBLIC LICENSE, Version 3.0</name>
			<url>http://www.gnu.org/licenses/gpl.html</url>
		</license>
	</licenses>

	<developers>
		<developer>
			<id>hhugohm@icloud.com</id>
			<name>camus</name>
		</developer>
	</developers>

	<properties>
		<cxf.version>3.0.5</cxf.version>
		<java.version>1.8</java.version>
		<project.build.mainClass>com.danielme.demo.jaxws.cxf.client.Main</project.build.mainClass>
	</properties>

	<build>

		<plugins>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.0</version>
				<configuration>
					<source>${java.version}</source>
					<target>${java.version}</target>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>2.4</version>
				<configuration>
					<archive>
						<manifest>
							<addClasspath>true</addClasspath>
							<mainClass>${project.build.mainClass}</mainClass>
						</manifest>
					</archive>
				</configuration>
			</plugin>

			<!-- mvn clean package exec:java -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>exec-maven-plugin</artifactId>
				<version>1.2.1</version>
				<executions>
					<execution>
						<goals>
							<goal>java</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<mainClass>${project.build.mainClass}</mainClass>
				</configuration>
			</plugin>

		</plugins>
	</build>

	<dependencies>
		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-frontend-jaxws</artifactId>
			<version>${cxf.version}</version>
		</dependency>

		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-transports-http</artifactId>
			<version>${cxf.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-bindings-soap</artifactId>
			<version>${cxf.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-databinding-aegis</artifactId>
			<version>${cxf.version}</version>
		</dependency>

		<!-- SPRING FRAMEWORK -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<version>4.1.6.RELEASE</version>
		</dependency>

		<!-- JDOM -->
		<dependency>
			<groupId>jdom</groupId>
			<artifactId>jdom</artifactId>
			<version>1.1</version>
		</dependency>

		<!-- LOGGING -->
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<version>1.2.17</version>
		</dependency>

		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-log4j12</artifactId>
			<version>1.7.12</version>
		</dependency>

	</dependencies>

</project>