text:
#ifndef STA_INFO_H
#define STA_INFO_H

#include <linux/list.h>
#include <linux/types.h>
#include <linux/if_ether.h>
#include <linux/workqueue.h>
#include <linux/average.h>
#include <linux/etherdevice.h>
#include <linux/rhashtable.h>
#include "key.h"

/**
 * enum ieee80211_sta_info_flags - Stations flags
 *
 * These flags are used with &struct sta_info's @flags member, but
 * only indirectly with set_sta_flag() and friends.
 *
 * @WLAN_STA_AUTH: Station is authenticated.
 * @WLAN_STA_ASSOC: Station is associated.
 * @WLAN_STA_PS_STA: Station is in power-save mode
 * @WLAN_STA_AUTHORIZED: Station is authorized to send/receive traffic.
 *	This bit is always checked so needs to be enabled for all stations
 *	when virtual port control is not in use.
 * @WLAN_STA_SHORT_PREAMBLE: Station is capable of receiving short-preamble
 *	frames.
 * @WLAN_STA_WDS: Station is one of our WDS peers.
 * @WLAN_STA_CLEAR_PS_FILT: Clear PS filter in hardware (using the
 *	IEEE80211_TX_CTL_CLEAR_PS_FILT control flag) when the next
 *	frame to this station is transmitted.
 * @WLAN_STA_MFP: Management frame protection is used with this STA.
 * @WLAN_STA_BLOCK_BA: Used to deny ADDBA requests (both TX and RX)
 *	during suspend/resume and station removal.
 * @WLAN_STA_PS_DRIVER: driver requires keeping this station in
 *	power-save mode logically to flush frames that might still
 *	be in the queues
 * @WLAN_STA_PSPOLL: Station sent PS-poll while driver was keeping
 *	station in power-save mode, reply when the driver unblocks.
 * @WLAN_STA_TDLS_PEER: Station is a TDLS peer.
 * @WLAN_STA_TDLS_PEER_AUTH: This TDLS peer is authorized to send direct
 *	packets. This means the link is enabled.
 * @WLAN_STA_TDLS_INITIATOR: We are the initiator of the TDLS link with this
 *	station.
 * @WLAN_STA_TDLS_CHAN_SWITCH: This TDLS peer supports TDLS channel-switching
 * @WLAN_STA_TDLS_OFF_CHANNEL: The local STA is currently off-channel with this
 *	TDLS peer
 * @WLAN_STA_TDLS_WIDER_BW: This TDLS peer supports working on a wider bw on
 *	the BSS base channel.
 * @WLAN_STA_UAPSD: Station requested unscheduled SP while driver was
 *	keeping station in power-save mode, reply when the driver
 *	unblocks the station.
 * @WLAN_STA_SP: Station is in a service period, so don't try to
 *	reply to other uAPSD trigger frames or PS-Poll.
 * @WLAN_STA_4ADDR_EVENT: 4-addr event was already sent for this frame.
 * @WLAN_STA_INSERTED: This station is inserted into the hash table.
 * @WLAN_STA_RATE_CONTROL: rate control was initialized for this station.
 * @WLAN_STA_TOFFSET_KNOWN: toffset calculated for this station is valid.
 * @WLAN_STA_MPSP_OWNER: local STA is owner of a mesh Peer Service Period.
 * @WLAN_STA_MPSP_RECIPIENT: local STA is recipient of a MPSP.
 * @WLAN_STA_PS_DELIVER: station woke up, but we're still blocking TX
 *	until pending frames are delivered
 */
enum ieee80211_sta_info_flags {
	WLAN_STA_AUTH,
	WLAN_STA_ASSOC,
	WLAN_STA_PS_STA,
	WLAN_STA_AUTHORIZED,
	WLAN_STA_SHORT_PREAMBLE,
	WLAN_STA_WDS,
	WLAN_STA_CLEAR_PS_FILT,
	WLAN_STA_MFP,
	WLAN_STA_BLOCK_BA,
	WLAN_STA_PS_DRIVER,
	WLAN_STA_PSPOLL,
	WLAN_STA_TDLS_PEER,
	WLAN_STA_TDLS_PEER_AUTH,
	WLAN_STA_TDLS_INITIATOR,
	WLAN_STA_TDLS_CHAN_SWITCH,
	WLAN_STA_TDLS_OFF_CHANNEL,
	WLAN_STA_TDLS_WIDER_BW,
	WLAN_STA_UAPSD,
	WLAN_STA_SP,
	WLAN_STA_4ADDR_EVENT,
	WLAN_STA_INSERTED,
	WLAN_STA_RATE_CONTROL,
	WLAN_STA_TOFFSET_KNOWN,
	WLAN_STA_MPSP_OWNER,
	WLAN_STA_MPSP_RECIPIENT,
	WLAN_STA_PS_DELIVER,
};

#define ADDBA_RESP_INTERVAL HZ
#define HT_AGG_MAX_RETRIES		15
#define HT_AGG_BURST_RETRIES		3
#define HT_AGG_RETRIES_PERIOD		(15 * HZ)

#define HT_AGG_STATE_DRV_READY		0
#define HT_AGG_STATE_RESPONSE_RECEIVED	1
#define HT_AGG_STATE_OPERATIONAL	2
#define HT_AGG_STATE_STOPPING		3
#define HT_AGG_STATE_WANT_START		4
#define HT_AGG_STATE_WANT_STOP		5

enum ieee80211_agg_stop_reason {
	AGG_STOP_DECLINED,
	AGG_STOP_LOCAL_REQUEST,
	AGG_STOP_PEER_REQUEST,
	AGG_STOP_DESTROY_STA,
};

/**
 * struct tid_ampdu_tx - TID aggregation information (Tx).
 *
 * @rcu_head: rcu head for freeing structure
 * @session_timer: check if we keep Tx-ing on the TID (by timeout value)
 * @addba_resp_timer: timer for peer's response to addba request
 * @pending: pending frames queue -- use sta's spinlock to protect
 * @dialog_token: dialog token for aggregation session
 * @timeout: session timeout value to be filled in ADDBA requests
 * @state: session state (see above)
 * @last_tx: jiffies of last tx activity
 * @stop_initiator: initiator of a session stop
 * @tx_stop: TX DelBA frame when stopping
 * @buf_size: reorder buffer size at receiver
 * @failed_bar_ssn: ssn of the last failed BAR tx attempt
 * @bar_pending: BAR needs to be re-sent
 * @amsdu: support A-MSDU withing A-MDPU
 *
 * This structure's lifetime is managed by RCU, assignments to
 * the array holding it must hold the aggregation mutex.
 *
 * The TX path can access it under RCU lock-free if, and
 * only if, the state has the flag %HT_AGG_STATE_OPERATIONAL
 * set. Otherwise, the TX path must also acquire the spinlock
 * and re-check the state, see comments in the tx code
 * touching it.
 */
struct tid_ampdu_tx {
	struct rcu_head rcu_head;
	struct timer_list session_timer;
	struct timer_list addba_resp_timer;
	struct sk_buff_head pending;
	unsigned long state;
	unsigned long last_tx;
	u16 timeout;
	u8 dialog_token;
	u8 stop_initiator;
	bool tx_stop;
	u8 buf_size;

	u16 failed_bar_ssn;
	bool bar_pending;
	bool amsdu;
};

/**
 * struct tid_ampdu_rx - TID aggregation information (Rx).
 *
 * @reorder_buf: buffer to reorder incoming aggregated MPDUs. An MPDU may be an
 *	A-MSDU with individually reported subframes.
 * @reorder_time: jiffies when skb was added
 * @session_timer: check if peer keeps Tx-ing on the TID (by timeout value)
 * @reorder_timer: releases expired frames from the reorder buffer.
 * @last_rx: jiffies of last rx activity
 * @head_seq_num: head sequence number in reordering buffer.
 * @stored_mpdu_num: number of MPDUs in reordering buffer
 * @ssn: Starting Sequence Number expected to be aggregated.
 * @buf_size: buffer size for incoming A-MPDUs
 * @timeout: reset timer value (in TUs).
 * @dialog_token: dialog token for aggregation session
 * @rcu_head: RCU head used for freeing this struct
 * @reorder_lock: serializes access to reorder buffer, see below.
 * @auto_seq: used for offloaded BA sessions to automatically pick head_seq_and
 *	and ssn.
 * @removed: this session is removed (but might have been found due to RCU)
 *
 * This structure's lifetime is managed by RCU, assignments to
 * the array holding it must hold the aggregation mutex.
 *
 * The @reorder_lock is used to protect the members of this
 * struct, except for @timeout, @buf_size and @dialog_token,
 * which are constant across the lifetime of the struct (the
 * dialog token being used only for debugging).
 */
struct tid_ampdu_rx {
	struct rcu_head rcu_head;
	spinlock_t reorder_lock;
	struct sk_buff_head *reorder_buf;
	unsigned long *reorder_time;
	struct timer_list session_timer;
	struct timer_list reorder_timer;
	unsigned long last_rx;
	u16 head_seq_num;
	u16 stored_mpdu_num;
	u16 ssn;
	u16 buf_size;
	u16 timeout;
	u8 dialog_token;
	bool auto_seq;
	bool removed;
};

/**
 * struct sta_ampdu_mlme - STA aggregation information.
 *
 * @tid_rx: aggregation info for Rx per TID -- RCU protected
 * @tid_tx: aggregation info for Tx per TID
 * @tid_start_tx: sessions where start was requested
 * @addba_req_num: number of times addBA request has been sent.
 * @last_addba_req_time: timestamp of the last addBA request.
 * @dialog_token_allocator: dialog token enumerator for each new session;
 * @work: work struct for starting/stopping aggregation
 * @tid_rx_timer_expired: bitmap indicating on which TIDs the
 *	RX timer expired until the work for it runs
 * @tid_rx_stop_requested:  bitmap indicating which BA sessions per TID the
 *	driver requested to close until the work for it runs
 * @mtx: mutex to protect all TX data (except non-NULL assignments
 *	to tid_tx[idx], which are protected by the sta spinlock)
 *	tid_start_tx is also protected by sta->lock.
 */
struct sta_ampdu_mlme {
	struct mutex mtx;
	/* rx */
	struct tid_ampdu_rx __rcu *tid_rx[IEEE80211_NUM_TIDS];
	unsigned long tid_rx_timer_expired[BITS_TO_LONGS(IEEE80211_NUM_TIDS)];
	unsigned long tid_rx_stop_requested[BITS_TO_LONGS(IEEE80211_NUM_TIDS)];
	/* tx */
	struct work_struct work;
	struct tid_ampdu_tx __rcu *tid_tx[IEEE80211_NUM_TIDS];
	struct tid_ampdu_tx *tid_start_tx[IEEE80211_NUM_TIDS];
	unsigned long last_addba_req_time[IEEE80211_NUM_TIDS];
	u8 addba_req_num[IEEE80211_NUM_TIDS];
	u8 dialog_token_allocator;
};

/* Value to indicate no TID reservation */
#define IEEE80211_TID_UNRESERVED	0xff

#define IEEE80211_FAST_XMIT_MAX_IV	18

/**
 * struct ieee80211_fast_tx - TX fastpath information
 * @key: key to use for hw crypto
 * @hdr: the 802.11 header to put with the frame
 * @hdr_len: actual 802.11 header length
 * @sa_offs: offset of the SA
 * @da_offs: offset of the DA
 * @pn_offs: offset where to put PN for crypto (or 0 if not needed)
 * @band: band this will be transmitted on, for tx_info
 * @rcu_head: RCU head to free this struct
 *
 * This struct is small enough so that the common case (maximum crypto
 * header length of 8 like for CCMP/GCMP) fits into a single 64-byte
 * cache line.
 */
struct ieee80211_fast_tx {
	struct ieee80211_key *key;
	u8 hdr_len;
	u8 sa_offs, da_offs, pn_offs;
	u8 band;
	u8 hdr[30 + 2 + IEEE80211_FAST_XMIT_MAX_IV +
	       sizeof(rfc1042_header)];

	struct rcu_head rcu_head;
};

/**
 * struct mesh_sta - mesh STA information
 * @plink_lock: serialize access to plink fields
 * @llid: Local link ID
 * @plid: Peer link ID
 * @aid: local aid supplied by peer
 * @reason: Cancel reason on PLINK_HOLDING state
 * @plink_retries: Retries in establishment
 * @plink_state: peer link state
 * @plink_timeout: timeout of peer link
 * @plink_timer: peer link watch timer
 * @t_offset: timing offset relative to this host
 * @t_offset_setpoint: reference timing offset of this sta to be used when
 * 	calculating clockdrift
 * @local_pm: local link-specific power save mode
 * @peer_pm: peer-specific power save mode towards local STA
 * @nonpeer_pm: STA power save mode towards non-peer neighbors
 * @processed_beacon: set to true after peer rates and capabilities are
 *	processed
 * @fail_avg: moving percentage of failed MSDUs
 */
struct mesh_sta {
	struct timer_list plink_timer;

	s64 t_offset;
	s64 t_offset_setpoint;

	spinlock_t plink_lock;
	u16 llid;
	u16 plid;
	u16 aid;
	u16 reason;
	u8 plink_retries;

	bool processed_beacon;

	enum nl80211_plink_state plink_state;
	u32 plink_timeout;

	/* mesh power save */
	enum nl80211_mesh_power_mode local_pm;
	enum nl80211_mesh_power_mode peer_pm;
	enum nl80211_mesh_power_mode nonpeer_pm;

	/* moving percentage of failed MSDUs */
	unsigned int fail_avg;
};

DECLARE_EWMA(signal, 1024, 8)

/**
 * struct sta_info - STA information
 *
 * This structure collects information about a station that
 * mac80211 is communicating with.
 *
 * @list: global linked list entry
 * @free_list: list entry for keeping track of stations to free
 * @hash_node: hash node for rhashtable
 * @addr: station's MAC address - duplicated from public part to
 *	let the hash table work with just a single cacheline
 * @local: pointer to the global information
 * @sdata: virtual interface this station belongs to
 * @ptk: peer keys negotiated with this station, if any
 * @ptk_idx: last installed peer key index
 * @gtk: group keys negotiated with this station, if any
 * @rate_ctrl: rate control algorithm reference
 * @rate_ctrl_lock: spinlock used to protect rate control data
 *	(data inside the algorithm, so serializes calls there)
 * @rate_ctrl_priv: rate control private per-STA pointer
 * @lock: used for locking all fields that require locking, see comments
 *	in the header file.
 * @drv_deliver_wk: used for delivering frames after driver PS unblocking
 * @listen_interval: listen interval of this station, when we're acting as AP
 * @_flags: STA flags, see &enum ieee80211_sta_info_flags, do not use directly
 * @ps_lock: used for powersave (when mac80211 is the AP) related locking
 * @ps_tx_buf: buffers (per AC) of frames to transmit to this station
 *	when it leaves power saving state or polls
 * @tx_filtered: buffers (per AC) of frames we already tried to
 *	transmit but were filtered by hardware due to STA having
 *	entered power saving state, these are also delivered to
 *	the station when it leaves powersave or polls for frames
 * @driver_buffered_tids: bitmap of TIDs the driver has data buffered on
 * @txq_buffered_tids: bitmap of TIDs that mac80211 has txq data buffered on
 * @last_connected: time (in seconds) when a station got connected
 * @last_seq_ctrl: last received seq/frag number from this STA (per TID
 *	plus one for non-QoS frames)
 * @tid_seq: per-TID sequence numbers for sending to this STA
 * @ampdu_mlme: A-MPDU state machine state
 * @timer_to_tid: identity mapping to ID timers
 * @mesh: mesh STA information
 * @debugfs: debug filesystem info
 * @dead: set to true when sta is unlinked
 * @uploaded: set to true when sta is uploaded to the driver
 * @sta: station information we share with the driver
 * @sta_state: duplicates information about station state (for debug)
 * @beacon_loss_count: number of times beacon loss has triggered
 * @rcu_head: RCU head used for freeing this station struct
 * @cur_max_bandwidth: maximum bandwidth to use for TX to the station,
 *	taken from HT/VHT capabilities or VHT operating mode notification
 * @known_smps_mode: the smps_mode the client thinks we are in. Relevant for
 *	AP only.
 * @cipher_scheme: optional cipher scheme for this station
 * @reserved_tid: reserved TID (if any, otherwise IEEE80211_TID_UNRESERVED)
 * @fast_tx: TX fastpath information
 * @tdls_chandef: a TDLS peer can have a wider chandef that is compatible to
 *	the BSS one.
 * @tx_stats: TX statistics
 * @rx_stats: RX statistics
 * @status_stats: TX status statistics
 */
struct sta_info {
	/* General information, mostly static */
	struct list_head list, free_list;
	struct rcu_head rcu_head;
	struct rhash_head hash_node;
	u8 addr[ETH_ALEN];
	struct ieee80211_local *local;
	struct ieee80211_sub_if_data *sdata;
	struct ieee80211_key __rcu *gtk[NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS];
	struct ieee80211_key __rcu *ptk[NUM_DEFAULT_KEYS];
	u8 ptk_idx;
	struct rate_control_ref *rate_ctrl;
	void *rate_ctrl_priv;
	spinlock_t rate_ctrl_lock;
	spinlock_t lock;

	struct ieee80211_fast_tx __rcu *fast_tx;

#ifdef CONFIG_MAC80211_MESH
	struct mesh_sta *mesh;
#endif

	struct work_struct drv_deliver_wk;

	u16 listen_interval;

	bool dead;

	bool uploaded;

	enum ieee80211_sta_state sta_state;

	/* use the accessors defined below */
	unsigned long _flags;

	/* STA powersave lock and frame queues */
	spinlock_t ps_lock;
	struct sk_buff_head ps_tx_buf[IEEE80211_NUM_ACS];
	struct sk_buff_head tx_filtered[IEEE80211_NUM_ACS];
	unsigned long driver_buffered_tids;
	unsigned long txq_buffered_tids;

	long last_connected;

	/* Updated from RX path only, no locking requirements */
	struct {
		unsigned long packets;
		u64 bytes;
		unsigned long last_rx;
		unsigned long num_duplicates;
		unsigned long fragments;
		unsigned long dropped;
		int last_signal;
		struct ewma_signal avg_signal;
		u8 chains;
		s8 chain_signal_last[IEEE80211_MAX_CHAINS];
		struct ewma_signal chain_signal_avg[IEEE80211_MAX_CHAINS];
		int last_rate_idx;
		u32 last_rate_flag;
		u32 last_rate_vht_flag;
		u8 last_rate_vht_nss;
		u64 msdu[IEEE80211_NUM_TIDS + 1];
	} rx_stats;

	/* Plus 1 for non-QoS frames */
	__le16 last_seq_ctrl[IEEE80211_NUM_TIDS + 1];

	/* Updated from TX status path only, no locking requirements */
	struct {
		unsigned long filtered;
		unsigned long retry_failed, retry_count;
		unsigned int lost_packets;
		unsigned long last_tdls_pkt_time;
		u64 msdu_retries[IEEE80211_NUM_TIDS + 1];
		u64 msdu_failed[IEEE80211_NUM_TIDS + 1];
	} status_stats;

	/* Updated from TX path only, no locking requirements */
	struct {
		u64 packets[IEEE80211_NUM_ACS];
		u64 bytes[IEEE80211_NUM_ACS];
		struct ieee80211_tx_rate last_rate;
		u64 msdu[IEEE80211_NUM_TIDS + 1];
	} tx_stats;
	u16 tid_seq[IEEE80211_QOS_CTL_TID_MASK + 1];

	/*
	 * Aggregation information, locked with lock.
	 */
	struct sta_ampdu_mlme ampdu_mlme;
	u8 timer_to_tid[IEEE80211_NUM_TIDS];

#ifdef CONFIG_MAC80211_DEBUGFS
	struct sta_info_debugfsdentries {
		struct dentry *dir;
		bool add_has_run;
	} debugfs;
#endif

	enum ieee80211_sta_rx_bandwidth cur_max_bandwidth;

	enum ieee80211_smps_mode known_smps_mode;
	const struct ieee80211_cipher_scheme *cipher_scheme;

	u8 reserved_tid;

	struct cfg80211_chan_def tdls_chandef;

	/* keep last! */
	struct ieee80211_sta sta;
};

static inline enum nl80211_plink_state sta_plink_state(struct sta_info *sta)
{
#ifdef CONFIG_MAC80211_MESH
	return sta->mesh->plink_state;
#endif
	return NL80211_PLINK_LISTEN;
}

static inline void set_sta_flag(struct sta_info *sta,
				enum ieee80211_sta_info_flags flag)
{
	WARN_ON(flag == WLAN_STA_AUTH ||
		flag == WLAN_STA_ASSOC ||
		flag == WLAN_STA_AUTHORIZED);
	set_bit(flag, &sta->_flags);
}

static inline void clear_sta_flag(struct sta_info *sta,
				  enum ieee80211_sta_info_flags flag)
{
	WARN_ON(flag == WLAN_STA_AUTH ||
		flag == WLAN_STA_ASSOC ||
		flag == WLAN_STA_AUTHORIZED);
	clear_bit(flag, &sta->_flags);
}

static inline int test_sta_flag(struct sta_info *sta,
				enum ieee80211_sta_info_flags flag)
{
	return test_bit(flag, &sta->_flags);
}

static inline int test_and_clear_sta_flag(struct sta_info *sta,
					  enum ieee80211_sta_info_flags flag)
{
	WARN_ON(flag == WLAN_STA_AUTH ||
		flag == WLAN_STA_ASSOC ||
		flag == WLAN_STA_AUTHORIZED);
	return test_and_clear_bit(flag, &sta->_flags);
}

static inline int test_and_set_sta_flag(struct sta_info *sta,
					enum ieee80211_sta_info_flags flag)
{
	WARN_ON(flag == WLAN_STA_AUTH ||
		flag == WLAN_STA_ASSOC ||
		flag == WLAN_STA_AUTHORIZED);
	return test_and_set_bit(flag, &sta->_flags);
}

int sta_info_move_state(struct sta_info *sta,
			enum ieee80211_sta_state new_state);

static inline void sta_info_pre_move_state(struct sta_info *sta,
					   enum ieee80211_sta_state new_state)
{
	int ret;

	WARN_ON_ONCE(test_sta_flag(sta, WLAN_STA_INSERTED));

	ret = sta_info_move_state(sta, new_state);
	WARN_ON_ONCE(ret);
}

void ieee80211_assign_tid_tx(struct sta_info *sta, int tid,
			     struct tid_ampdu_tx *tid_tx);

static inline struct tid_ampdu_tx *
rcu_dereference_protected_tid_tx(struct sta_info *sta, int tid)
{
	return rcu_dereference_protected(sta->ampdu_mlme.tid_tx[tid],
					 lockdep_is_held(&sta->lock) ||
					 lockdep_is_held(&sta->ampdu_mlme.mtx));
}

/* Maximum number of frames to buffer per power saving station per AC */
#define STA_MAX_TX_BUFFER	64

/* Minimum buffered frame expiry time. If STA uses listen interval that is
 * smaller than this value, the minimum value here is used instead. */
#define STA_TX_BUFFER_EXPIRE (10 * HZ)

/* How often station data is cleaned up (e.g., expiration of buffered frames)
 */
#define STA_INFO_CLEANUP_INTERVAL (10 * HZ)

/*
 * Get a STA info, must be under RCU read lock.
 */
struct sta_info *sta_info_get(struct ieee80211_sub_if_data *sdata,
			      const u8 *addr);

struct sta_info *sta_info_get_bss(struct ieee80211_sub_if_data *sdata,
				  const u8 *addr);

u32 sta_addr_hash(const void *key, u32 length, u32 seed);

#define _sta_bucket_idx(_tbl, _a)					\
	rht_bucket_index(_tbl, sta_addr_hash(_a, ETH_ALEN, (_tbl)->hash_rnd))

#define for_each_sta_info(local, tbl, _addr, _sta, _tmp)		\
	rht_for_each_entry_rcu(_sta, _tmp, tbl, 			\
			       _sta_bucket_idx(tbl, _addr),		\
			       hash_node)				\
	/* compare address and run code only if it matches */		\
	if (ether_addr_equal(_sta->addr, (_addr)))

/*
 * Get STA info by index, BROKEN!
 */
struct sta_info *sta_info_get_by_idx(struct ieee80211_sub_if_data *sdata,
				     int idx);
/*
 * Create a new STA info, caller owns returned structure
 * until sta_info_insert().
 */
struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
				const u8 *addr, gfp_t gfp);

void sta_info_free(struct ieee80211_local *local, struct sta_info *sta);

/*
 * Insert STA info into hash table/list, returns zero or a
 * -EEXIST if (if the same MAC address is already present).
 *
 * Calling the non-rcu version makes the caller relinquish,
 * the _rcu version calls read_lock_rcu() and must be called
 * without it held.
 */
int sta_info_insert(struct sta_info *sta);
int sta_info_insert_rcu(struct sta_info *sta) __acquires(RCU);

int __must_check __sta_info_destroy(struct sta_info *sta);
int sta_info_destroy_addr(struct ieee80211_sub_if_data *sdata,
			  const u8 *addr);
int sta_info_destroy_addr_bss(struct ieee80211_sub_if_data *sdata,
			      const u8 *addr);

void sta_info_recalc_tim(struct sta_info *sta);

int sta_info_init(struct ieee80211_local *local);
void sta_info_stop(struct ieee80211_local *local);

/**
 * sta_info_flush - flush matching STA entries from the STA table
 *
 * Returns the number of removed STA entries.
 *
 * @sdata: sdata to remove all stations from
 * @vlans: if the given interface is an AP interface, also flush VLANs
 */
int __sta_info_flush(struct ieee80211_sub_if_data *sdata, bool vlans);

static inline int sta_info_flush(struct ieee80211_sub_if_data *sdata)
{
	return __sta_info_flush(sdata, false);
}

void sta_set_rate_info_tx(struct sta_info *sta,
			  const struct ieee80211_tx_rate *rate,
			  struct rate_info *rinfo);
void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo);

void ieee80211_sta_expire(struct ieee80211_sub_if_data *sdata,
			  unsigned long exp_time);
u8 sta_info_tx_streams(struct sta_info *sta);

void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta);
void ieee80211_sta_ps_deliver_poll_response(struct sta_info *sta);
void ieee80211_sta_ps_deliver_uapsd(struct sta_info *sta);

#endif /* STA_INFO_H */


text:
namespace JelloScrum.Model.IRepositories
{
    using Entities;

    /// <summary>
    /// Interface for the task repository
    /// </summary>
    public interface ITaskRepository : IJelloScrumRepository<Task>
    {
    }
}

redpajama_set_name: RedPajamaGithub


text:
<Menu xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:gravity="center"
    android:orientation="horizontal"
    android:weightSum="3" >

    <Button
        android:id="@+id/button1"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:onClick="clickEvent"
        android:text="Button 1" />

    <TextView
        android:id="@+id/textView1"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:onClick="clickEvent"
        android:gravity="center"
        android:textColor="#FFFFFF"
        android:text="My action bar"
        android:textAppearance="?android:attr/textAppearanceLarge" />

    <Button
        android:id="@+id/button2"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:onClick="clickEvent"
        android:text="Button 2" />

</Menu>


text:
import React, { Component } from 'react'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import Actions from '../../actions'
import './App.scss'

import Navbar from '../../components/Navbar/Navbar'

class Main extends Component {
  constructor (props) {
    super(props)
  }

  render () {
    return (
      <div className='App'>
        <Navbar
          account={ this.props.account }
          onLogoutClick={ this.props.logout }
        />
        { this.props.children }
      </div>
    )
  }
}
// Place state of redux store into props of component
function mapStateToProps (state) {
  return {
    account: state.account,
    router: state.router
  }
}
// Place action methods into props
function mapDispatchToProps (dispatch) {
  return bindActionCreators(Actions, dispatch)
}

export default connect(mapStateToProps, mapDispatchToProps)(Main)


text:
package org.apache.distributedlog.client.speculative;

import com.google.common.annotations.VisibleForTesting;
import com.twitter.util.Future;
import com.twitter.util.FutureEventListener;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Default implementation of {@link SpeculativeRequestExecutionPolicy}.
 */
public class DefaultSpeculativeRequestExecutionPolicy implements SpeculativeRequestExecutionPolicy {

    private static final Logger LOG = LoggerFactory.getLogger(DefaultSpeculativeRequestExecutionPolicy.class);
    final int firstSpeculativeRequestTimeout;
    final int maxSpeculativeRequestTimeout;
    final float backoffMultiplier;
    int nextSpeculativeRequestTimeout;

    public DefaultSpeculativeRequestExecutionPolicy(int firstSpeculativeRequestTimeout,
                                                    int maxSpeculativeRequestTimeout,
                                                    float backoffMultiplier) {
        this.firstSpeculativeRequestTimeout = firstSpeculativeRequestTimeout;
        this.maxSpeculativeRequestTimeout = maxSpeculativeRequestTimeout;
        this.backoffMultiplier = backoffMultiplier;
        this.nextSpeculativeRequestTimeout = firstSpeculativeRequestTimeout;

        if (backoffMultiplier <= 0) {
            throw new IllegalArgumentException("Invalid value provided for backoffMultiplier");
        }

        // Prevent potential over flow
        if (Math.round((double) maxSpeculativeRequestTimeout * (double) backoffMultiplier) > Integer.MAX_VALUE) {
            throw new IllegalArgumentException("Invalid values for maxSpeculativeRequestTimeout and backoffMultiplier");
        }
    }

    @VisibleForTesting
    int getNextSpeculativeRequestTimeout() {
        return nextSpeculativeRequestTimeout;
    }

    /**
     * Initialize the speculative request execution policy.
     *
     * @param scheduler The scheduler service to issue the speculative request
     * @param requestExecutor The executor is used to issue the actual speculative requests
     */
    @Override
    public void initiateSpeculativeRequest(final ScheduledExecutorService scheduler,
                                           final SpeculativeRequestExecutor requestExecutor) {
        issueSpeculativeRequest(scheduler, requestExecutor);
    }

    private void issueSpeculativeRequest(final ScheduledExecutorService scheduler,
                                         final SpeculativeRequestExecutor requestExecutor) {
        Future<Boolean> issueNextRequest = requestExecutor.issueSpeculativeRequest();
        issueNextRequest.addEventListener(new FutureEventListener<Boolean>() {
            // we want this handler to run immediately after we push the big red button!
            @Override
            public void onSuccess(Boolean issueNextRequest) {
                if (issueNextRequest) {
                    scheduleSpeculativeRequest(scheduler, requestExecutor, nextSpeculativeRequestTimeout);
                    nextSpeculativeRequestTimeout = Math.min(maxSpeculativeRequestTimeout,
                            (int) (nextSpeculativeRequestTimeout * backoffMultiplier));
                } else {
                    if (LOG.isTraceEnabled()) {
                        LOG.trace("Stopped issuing speculative requests for {}, "
                            + "speculativeReadTimeout = {}", requestExecutor, nextSpeculativeRequestTimeout);
                    }
                }
            }

            @Override
            public void onFailure(Throwable thrown) {
                LOG.warn("Failed to issue speculative request for {}, speculativeReadTimeout = {} : ",
                        new Object[] { requestExecutor, nextSpeculativeRequestTimeout, thrown });
            }
        });
    }

    private void scheduleSpeculativeRequest(final ScheduledExecutorService scheduler,
                                            final SpeculativeRequestExecutor requestExecutor,
                                            final int speculativeRequestTimeout) {
        try {
            scheduler.schedule(new Runnable() {
                @Override
                public void run() {
                    issueSpeculativeRequest(scheduler, requestExecutor);
                }
            }, speculativeRequestTimeout, TimeUnit.MILLISECONDS);
        } catch (RejectedExecutionException re) {
            if (!scheduler.isShutdown()) {
                LOG.warn("Failed to schedule speculative request for {}, speculativeReadTimeout = {} : ",
                        new Object[]{requestExecutor, speculativeRequestTimeout, re});
            }
        }
    }
}


text:
//
//  TOSAccessResTrackGet.m
//  SDKtopoos
//

#import "TOSAccessOpTrackGet.h"

@implementation TOSAccessOpTrackGet

@synthesize Track,Format,Oauth_token,Endate,Initdate,Layers,Total,Method,OperationName,Version;

/**
 * Instantiates a new tracks get.
 *
 * @param operationName
 *            the operation name
 * @param method
 *            the method
 * @param format
 *            the format
 * @param version
 *            the version
 * @param oauth_token
 *            the oauth_token
 * @param track
 *            the track
 * @param total
 *            the total
 * @param initdate
 *            the initdate
 * @param endate
 *            the endate
 * @param layer
 *            the layer
 */
-(TOSAccessOpTrackGet *) init{
    self=[super init];
    return self;
}

-(TOSAccessOpTrackGet *) initWithOperationName: (NSString *) operationName andMethod: (NSString *) method andFormat:(NSString *) format
                                    andVersion: (int *) version andOauth_token: (NSString *) oauth_token
andTrack: (int *) track andTotal: (int *) total andInitdate: (NSDate *) initdate andEnddate:(NSDate *) endddate andLayers:(NSMutableArray *) layers {
    self=[super initWithOperationName: operationName andMethod:method andFormat:format andVersion:version];
    if(self)
    {
        Oauth_token = oauth_token;
        Track=track;
        Total=total;
        Initdate=initdate;
        Endate=endddate;
        Layers=layers;
    }
    return self;
}

/*
 * (non-Javadoc)
 *
 * @see topoos.APIAccess.Operations.APIOperation#ValidateParams()
 */
- (bool) ValidateParams
{
    bool validate = [super ValidateParams];
    validate = validate && [self isValid: Oauth_token];
    validate = validate && [self isValidorNullInt:Track];
    validate = validate && [self isValidorNullInt:Total];
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZ"]; // (AAAA-MM-DDThh:mm:sszzzzzz)
    validate = validate && [self isValidorNull:[NSString stringWithFormat:@"%@", [dateFormatter stringFromDate: Initdate]]];
    validate = validate && [self isValidorNull:[NSString stringWithFormat:@"%@", [dateFormatter stringFromDate: Endate]]];
    return validate;
}

/*
 * (non-Javadoc)
 *
 * @see topoos.APIAccess.Operations.APIOperation#ConcatParams()
 */
- (NSString *) ConcatParams
{
    NSString * params;
    if ([self ValidateParams])
    {
        params = @"/";
        params = [params stringByAppendingString:[NSString stringWithFormat:@"%d", *[self getVersion]]];
        params = [params stringByAppendingString: @"/tracks/get."];
        params = [params stringByAppendingString: [self getFormat]];
        params = [params stringByAppendingString: @"?oauth_token="];
        params = [params stringByAppendingString: [self stringToURLEncoded: Oauth_token]];
        params = [params stringByAppendingString: @"&track="];
        params = [params stringByAppendingString: [self intToURLEncoded: Track]];
        if(Total!=nil){
            params = [params stringByAppendingString: @"&total="];
            params = [params stringByAppendingString:[self intToURLEncoded: Total]];
        }
        if(Initdate!=nil){
            params = [params stringByAppendingString: @"&initdate="];
            params = [params stringByAppendingString:[self dateToURLEncoded: Initdate]];
        }
        if(Endate!=nil){
            params = [params stringByAppendingString: @"&endate="];
            params = [params stringByAppendingString:[self dateToURLEncoded: Endate]];
        }
        if(Layers!=nil){
            params = [params stringByAppendingString: @"&layer="];
            NSString * str_layers = @"";
            for(int i=0;i<[Layers count];i++){
                if(i<[Layers count]-1){
                    str_layers = [str_layers stringByAppendingString: [Layers objectAtIndex:i]];
                    str_layers = [str_layers stringByAppendingString:@","];
                }
                else{
                    str_layers = [str_layers stringByAppendingString: [Layers objectAtIndex:[Layers count]-1]];
                }
            }

        }
    }
    return params;
}

@end


text:
from __future__ import unicode_literals

from django.db import models, migrations
from django.conf import settings

class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='VBUserProfile',
            fields=[
                ('id', models.AutoField(serialize=False, verbose_name='ID', primary_key=True, auto_created=True)),
                ('_club', models.CharField(max_length=100, db_column='club', blank=True)),
                ('_level', models.CharField(max_length=14, db_column='level', choices=[('hobby', 'Loisir'), ('departmental', 'Départemental'), ('regional_1', 'Régional 1'), ('regional_2', 'Régional 2'), ('national_1', 'National 1'), ('national_2', 'National 2'), ('national_3', 'National 3'), ('professional_a', 'Professionel A'), ('professional_b', 'Professionel B'), ('kids', 'Enfant')])),
                ('_phone', models.CharField(max_length=100, db_column='phone', blank=True)),
                ('_share_mail', models.BooleanField(db_column='share_mail', default=True)),
                ('_share_phone', models.BooleanField(db_column='share_phone', default=False)),
                ('_facebook', models.CharField(max_length=100, db_column='facebook', blank=True)),
                ('_twitter', models.CharField(max_length=100, db_column='twitter', blank=True)),
                ('_user', models.OneToOneField(to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]


text:
/*******************************************************************************
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *******************************************************************************/
package io.onedecision.engine.domain.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import com.fasterxml.jackson.annotation.JsonProperty;

@Entity
@Table(name = "OL_DOMAIN_FIELD")
@Component
public class EntityField {
    protected static final Logger LOGGER = LoggerFactory
            .getLogger(EntityField.class);

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    @JsonProperty
    private Long id;

    @NotNull
    @JsonProperty
    protected String name;

    @JsonProperty
    protected String label;

    @JsonProperty
    protected String hint;

    @JsonProperty
    protected boolean required = false;

    @JsonProperty
    protected String type;

    @JsonProperty
    protected String validation;

    @JsonProperty
    protected boolean builtIn = true;

    public EntityField() {}

    public EntityField(String name, String label, String hint,
            boolean required, String type) {
        setName(name);
        setLabel(label);
        setHint(hint);
        setRequired(required);
        setType(type);
    }

    public EntityField(String name, String label, String hint,
            boolean required, String type, String validation) {
        setName(name);
        setLabel(label);
        setHint(hint);
        setRequired(required);
        setType(type);
        setValidation(validation);
    }

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public String getHint() {
		return hint;
	}

	public void setHint(String hint) {
		this.hint = hint;
	}

	public boolean isRequired() {
		return required;
	}

	public void setRequired(boolean required) {
		this.required = required;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getValidation() {
		return validation;
	}

	public void setValidation(String validation) {
		this.validation = validation;
	}

	public boolean isBuiltIn() {
		return builtIn;
	}

	public void setBuiltIn(boolean builtIn) {
		this.builtIn = builtIn;
	}

	public EntityField withId(Long id) {
	    setId(id);
	    return this;
	}

	public EntityField withName(String name) {
        setName(name);
        return this;
    }

	public EntityField withLabel(String label) {
        setLabel(label);
        return this;
    }

	public EntityField withHint(String hint) {
        setHint(hint);
        return this;
    }

	public EntityField withRequired(boolean required) {
        setRequired(required);
        return this;
    }

	public EntityField withType(String type) {
        setType(type);
        return this;
    }

	public EntityField withValidation(String validation) {
        setValidation(validation);
        return this;
    }

	public EntityField withBuiltIn(boolean builtIn) {
        setBuiltIn(builtIn);
        return this;
    }
}


text:
<!DOCTYPE HTML>

<title>RecoveryEnvironment (Narayana: narayana-full 5.13.1.Final API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2022-11-14">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Narayana: narayana-full 5.13.1.Final

All Classes

SEARCH:
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">

JavaScript is disabled on your browser.

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Package com.arjuna.ats.jts.recovery

Class RecoveryEnvironment

java.lang.Object

com.arjuna.ats.jts.recovery.RecoveryEnvironment

@Deprecated
public class RecoveryEnvironment
extends java.lang.Object

Deprecated.

use JTSEnvironmentBean instead

Container for property names used by recovery

Field Summary

Fields

Modifier and Type
Field
Description

static java.lang.String
ASSUMED_OBJECT_NOT_EXIST

Deprecated.

static java.lang.String
COMMITTED_TRANSACTION_RETRY_LIMIT

Deprecated.

static java.lang.String
OTS_ISSUE_RECOVERY_ROLLBACK

Deprecated.

Constructor Summary

Constructors

Constructor
Description

RecoveryEnvironment()

Deprecated.

Method Summary

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

OTS_ISSUE_RECOVERY_ROLLBACK

public static final java.lang.String OTS_ISSUE_RECOVERY_ROLLBACK

Deprecated.

See Also:

Constant Field Values

COMMITTED_TRANSACTION_RETRY_LIMIT

public static final java.lang.String COMMITTED_TRANSACTION_RETRY_LIMIT

Deprecated.

See Also:

Constant Field Values

ASSUMED_OBJECT_NOT_EXIST

public static final java.lang.String ASSUMED_OBJECT_NOT_EXIST

Deprecated.

See Also:

Constant Field Values

Constructor Detail

RecoveryEnvironment

public RecoveryEnvironment()

Deprecated.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Narayana: narayana-full 5.13.1.Final

All Classes

JavaScript is disabled on your browser.

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Copyright © 2022 JBoss by Red Hat. All rights reserved.


text:
package com.aripd.aricl.brushandscrollingzoom;

import java.io.IOException;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.render.FacesRenderer;
import org.primefaces.renderkit.CoreRenderer;
import org.primefaces.util.WidgetBuilder;

@FacesRenderer(componentFamily = Brushandscrollingzoom.COMPONENT_FAMILY, rendererType = Brushandscrollingzoom.DEFAULT_RENDERER)
public class BrushandscrollingzoomRenderer extends CoreRenderer {

    @Override
    public void encodeEnd(FacesContext context, UIComponent uiComponent) throws IOException {
        if (context == null) {
            throw new NullPointerException("No context defined!");
        }

        Brushandscrollingzoom component = (Brushandscrollingzoom) uiComponent;

        encodeMarkup(context, component);
        encodeScript(context, component);
    }

    protected void encodeMarkup(FacesContext context, Brushandscrollingzoom component) throws IOException {
        ResponseWriter writer = context.getResponseWriter();

        writer.startElement("div", component);
        writer.writeAttribute("id", component.getClientId(), null);
        writer.endElement("div");
    }

    protected void encodeScript(FacesContext context, Brushandscrollingzoom component) throws IOException {

        String clientId = component.getClientId();
        String widgetVar = component.resolveWidgetVar();

        WidgetBuilder wb = getWidgetBuilder(context);

        wb.init(Brushandscrollingzoom.class.getSimpleName(), widgetVar, clientId);

        if (component.getUrl() != null) {
            wb.attr("url", component.getUrl());
        }

        if (component.getWidth() != null) {
            wb.attr("width", component.getWidth());
        }

        if (component.getHeight() != null) {
            wb.attr("height", component.getHeight());
        }

        wb.finish();
    }

}


text:
package org.apache.hive.ptest.execution.conf;

import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
import com.google.common.base.Splitter;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;

class UnitTestPropertiesParser {

  private static final Splitter VALUE_SPLITTER = Splitter.onPattern("[, ]")
      .trimResults().omitEmptyStrings();

  // Prefix for top level properties.
  static final String PROP_PREFIX_ROOT = "unitTests";
  // Prefix used to specify module specific properties. Mainly to avoid conflicts with older unitTests properties
  static final String PROP_PREFIX_MODULE = "ut";

  static final String PROP_DIRECTORIES = "directories";
  static final String PROP_INCLUDE = "include";
  static final String PROP_EXCLUDE = "exclude";
  static final String PROP_ISOLATE = "isolate";
  static final String PROP_SKIP_BATCHING = "skipBatching";
  static final String PROP_BATCH_SIZE = "batchSize";
  static final String PROP_SUBDIR_FOR_PREFIX = "subdirForPrefix";

  static final String PROP_ONE_MODULE = "module";
  static final String PROP_MODULE_LIST = "modules";

  private final AtomicInteger batchIdCounter;

  static final int DEFAULT_PROP_BATCH_SIZE = 1;
  static final int DEFAULT_PROP_BATCH_SIZE_NOT_SPECIFIED = -1;
  static final int DEFAULT_PROP_BATCH_SIZE_INCLUDE_ALL = 0;
  static final String DEFAULT_PROP_DIRECTORIES = ".";
  static final String DEFAULT_PROP_SUBDIR_FOR_PREFIX = "target";

  static final String MODULE_NAME_TOP_LEVEL = "_root_"; // Special module for tests in the rootDir.
  static final String PREFIX_TOP_LEVEL = ".";

  private final Context unitRootContext; // Everything prefixed by ^unitTests.
  private final Context unitModuleContext; // Everything prefixed by ^ut.
  private final String testCasePropertyName;
  private final Logger logger;
  private final File sourceDirectory;
  private final FileListProvider fileListProvider;
  private final Set<String> excludedProvided; // excludedProvidedBy Framework vs excludedConfigured
  private final boolean inTest;

  @VisibleForTesting
  UnitTestPropertiesParser(Context testContext, AtomicInteger batchIdCounter, String testCasePropertyName,
                           File sourceDirectory, Logger logger,
                           FileListProvider fileListProvider,
                           Set<String> excludedProvided, boolean inTest) {
    logger.info("{} created with sourceDirectory={}, testCasePropertyName={}, excludedProvide={}",
        "fileListProvider={}, inTest={}",
        UnitTestPropertiesParser.class.getSimpleName(), sourceDirectory, testCasePropertyName,
        excludedProvided,
        (fileListProvider == null ? "null" : fileListProvider.getClass().getSimpleName()), inTest);
    Preconditions.checkNotNull(batchIdCounter, "batchIdCounter cannot be null");
    Preconditions.checkNotNull(testContext, "testContext cannot be null");
    Preconditions.checkNotNull(testCasePropertyName, "testCasePropertyName cannot be null");
    Preconditions.checkNotNull(sourceDirectory, "sourceDirectory cannot be null");
    Preconditions.checkNotNull(logger, "logger must be specified");
    this.batchIdCounter = batchIdCounter;
    this.unitRootContext =
        new Context(testContext.getSubProperties(Joiner.on(".").join(PROP_PREFIX_ROOT, "")));
    this.unitModuleContext =
        new Context(testContext.getSubProperties(Joiner.on(".").join(PROP_PREFIX_MODULE, "")));
    this.sourceDirectory = sourceDirectory;
    this.testCasePropertyName = testCasePropertyName;
    this.logger = logger;
    if (excludedProvided != null) {
      this.excludedProvided = excludedProvided;
    } else {
      this.excludedProvided = new HashSet<>();
    }
    if (fileListProvider != null) {
      this.fileListProvider = fileListProvider;
    } else {
      this.fileListProvider = new DefaultFileListProvider();
    }
    this.inTest = inTest;

  }

  UnitTestPropertiesParser(Context testContext, AtomicInteger batchIdCounter, String testCasePropertyName,
                           File sourceDirectory, Logger logger,
                           Set<String> excludedProvided) {
    this(testContext, batchIdCounter, testCasePropertyName, sourceDirectory, logger, null, excludedProvided, false);
  }

  Collection<TestBatch> generateTestBatches() {
    try {
      return parse();
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }

  private Collection<TestBatch> parse() throws IOException {

    RootConfig rootConfig = getRootConfig(unitRootContext);
    logger.info("RootConfig: " + rootConfig);

    // TODO: Set this up as a tree, instead of a flat list.
    Map<String, ModuleConfig> moduleConfigs = extractModuleConfigs();
    logger.info("ModuleConfigs: {} ", moduleConfigs);

    List<TestDir> unitTestsDirs = processPropertyDirectories();

    validateConfigs(rootConfig, moduleConfigs, unitTestsDirs);

    LinkedHashMap<String, LinkedHashSet<TestInfo>> allTests =
        generateFullTestSet(rootConfig, moduleConfigs, unitTestsDirs);

    return createTestBatches(allTests, rootConfig, moduleConfigs);
  }

  private Collection<TestBatch> createTestBatches(
      LinkedHashMap<String, LinkedHashSet<TestInfo>> allTests, RootConfig rootConfig,
      Map<String, ModuleConfig> moduleConfigs) {
    List<TestBatch> testBatches = new LinkedList<>();
    for (Map.Entry<String, LinkedHashSet<TestInfo>> entry : allTests.entrySet()) {
      logger.info("Creating test batches for module={}, numTests={}", entry.getKey(),
          entry.getValue().size());
      String currentModule = entry.getKey();
      String currentPathPrefix = getPathPrefixFromModuleName(currentModule);
      int batchSize = rootConfig.batchSize;
      if (moduleConfigs.containsKey(currentModule)) {
        ModuleConfig moduleConfig = moduleConfigs.get(currentModule);
        int batchSizeModule = moduleConfig.batchSize;
        if (batchSizeModule != DEFAULT_PROP_BATCH_SIZE_NOT_SPECIFIED) {
          batchSize = batchSizeModule;
        }
      }

      if (batchSize == DEFAULT_PROP_BATCH_SIZE_INCLUDE_ALL) {
        batchSize = Integer.MAX_VALUE;
      }
      logger.info("batchSize determined to be {} for module={}", batchSize, currentModule);

      // TODO Even out the batch sizes (i.e. 20/20/1 should be replaced by 14/14/13)
      List<String> currentList = new LinkedList<>();
      for (TestInfo testInfo : entry.getValue()) {
        if (testInfo.isIsolated || testInfo.skipBatching) {
          UnitTestBatch unitTestBatch =
              new UnitTestBatch(batchIdCounter, testCasePropertyName, Collections.singletonList(testInfo.testName),
                  currentPathPrefix, !testInfo.isIsolated);
          testBatches.add(unitTestBatch);
        } else {
          currentList.add(testInfo.testName);
          if (currentList.size() == batchSize) {
            UnitTestBatch unitTestBatch =
                new UnitTestBatch(batchIdCounter, testCasePropertyName, Collections.unmodifiableList(currentList),
                    currentPathPrefix, true);
            testBatches.add(unitTestBatch);
            currentList = new LinkedList<>();
          }
        }
      }
      if (!currentList.isEmpty()) {
        UnitTestBatch unitTestBatch =
            new UnitTestBatch(batchIdCounter, testCasePropertyName, Collections.unmodifiableList(currentList),
                currentPathPrefix, true);
        testBatches.add(unitTestBatch);
      }
    }
    return testBatches;
  }

  private RootConfig getRootConfig(Context context) {
    ModuleConfig moduleConfig =
        getModuleConfig(context, "irrelevant", DEFAULT_PROP_BATCH_SIZE);

    String subDirForPrefix =
        context.getString(PROP_SUBDIR_FOR_PREFIX, DEFAULT_PROP_SUBDIR_FOR_PREFIX);
    Preconditions
        .checkArgument(StringUtils.isNotBlank(subDirForPrefix) && !subDirForPrefix.contains("/"));

    Context modulesContext =
        new Context(context.getSubProperties(Joiner.on(".").join(PROP_MODULE_LIST, "")));
    Set<String> includedModules = getProperty(modulesContext, PROP_INCLUDE);
    Set<String> excludedModules = getProperty(modulesContext, PROP_EXCLUDE);
    if (!includedModules.isEmpty() && !excludedModules.isEmpty()) {
      throw new IllegalArgumentException(String.format(
          "%s and %s are mutually exclusive for property %s. Provided values: included=%s, excluded=%s",
          PROP_INCLUDE, PROP_EXCLUDE, PROP_MODULE_LIST, includedModules, excludedModules));
    }

    return new RootConfig(includedModules, excludedModules, moduleConfig.include,
        moduleConfig.exclude, moduleConfig.skipBatching, moduleConfig.isolate,
        moduleConfig.batchSize, subDirForPrefix);
  }

  private ModuleConfig getModuleConfig(Context context, String moduleName, int defaultBatchSize) {
    Set<String> excluded = getProperty(context, PROP_EXCLUDE);
    Set<String> isolated = getProperty(context, PROP_ISOLATE);
    Set<String> included = getProperty(context, PROP_INCLUDE);
    Set<String> skipBatching = getProperty(context, PROP_SKIP_BATCHING);
    if (!included.isEmpty() && !excluded.isEmpty()) {
      throw new IllegalArgumentException(String.format("Included and excluded mutually exclusive." +
          " Included = %s, excluded = %s", included.toString(), excluded.toString()) +
          " for module: " + moduleName);
    }
    int batchSize = context.getInteger(PROP_BATCH_SIZE, defaultBatchSize);

    String pathPrefix = getPathPrefixFromModuleName(moduleName);

    return new ModuleConfig(moduleName, included, excluded, skipBatching, isolated, batchSize,
        pathPrefix);
  }

  private Set<String> getProperty(Context context, String propertyName) {
    return Sets.newHashSet(VALUE_SPLITTER.split(context.getString(propertyName, "")));
  }

  private String getPathPrefixFromModuleName(String moduleName) {
    String pathPrefix;
    if (moduleName.equals(MODULE_NAME_TOP_LEVEL)) {
      pathPrefix = PREFIX_TOP_LEVEL;
    } else {
      pathPrefix = moduleName.replace(".", "/");
    }
    return pathPrefix;
  }

  private String getModuleNameFromPathPrefix(String pathPrefix) {
    if (pathPrefix.equals(PREFIX_TOP_LEVEL)) {
      return MODULE_NAME_TOP_LEVEL;
    } else {
      pathPrefix = stripEndAndStart(pathPrefix, "/");
      pathPrefix = pathPrefix.replace("/", ".");
      // Example handling of dirs with a .
      // shims/hadoop-2.6
      //   -> moduleName=shims.hadoop-.2.6
      return pathPrefix;
    }
  }

  private String stripEndAndStart(String srcString, String stripChars) {
    srcString = StringUtils.stripEnd(srcString, stripChars);
    srcString = StringUtils.stripStart(srcString, stripChars);
    return srcString;
  }

  private Map<String, ModuleConfig> extractModuleConfigs() {
    Collection<String> modules = extractConfiguredModules();
    Map<String, ModuleConfig> result = new HashMap<>();

    for (String moduleName : modules) {
      Context moduleContext =
          new Context(unitModuleContext.getSubProperties(Joiner.on(".").join(moduleName, "")));
      ModuleConfig moduleConfig =
          getModuleConfig(moduleContext, moduleName, DEFAULT_PROP_BATCH_SIZE_NOT_SPECIFIED);
      logger.info("Adding moduleConfig={}", moduleConfig);
      result.put(moduleName, moduleConfig);
    }
    return result;
  }

  private Collection<String> extractConfiguredModules() {
    List<String> configuredModules = new LinkedList<>();

    Map<String, String> modulesMap = unitRootContext.getSubProperties(Joiner.on(".").join(
        PROP_ONE_MODULE, ""));
    for (Map.Entry<String, String> module : modulesMap.entrySet()) {
      // This is an unnecessary check, and forced configuration in the property file. Maybe
      // replace with an enforced empty value string.
      Preconditions.checkArgument(module.getKey().equals(module.getValue()));
      String moduleName = module.getKey();
      configuredModules.add(moduleName);
    }
    return configuredModules;
  }

  private List<TestDir> processPropertyDirectories() throws IOException {
    String srcDirString = sourceDirectory.getCanonicalPath();
    List<TestDir> unitTestsDirs = Lists.newArrayList();
    String propDirectoriies = unitRootContext.getString(PROP_DIRECTORIES, DEFAULT_PROP_DIRECTORIES);
    Iterable<String> propDirectoriesIterable = VALUE_SPLITTER.split(propDirectoriies);

    for (String unitTestDir : propDirectoriesIterable) {
      File unitTestParent = new File(sourceDirectory, unitTestDir);
      if (unitTestParent.isDirectory() || inTest) {
        String absUnitTestDir = unitTestParent.getCanonicalPath();

        Preconditions.checkState(absUnitTestDir.startsWith(srcDirString),
            "Unit test dir: " + absUnitTestDir + " is not under provided src dir: " + srcDirString);
        String modulePath = absUnitTestDir.substring(srcDirString.length());

        modulePath = stripEndAndStart(modulePath, "/");

        Preconditions.checkState(!modulePath.startsWith("/"),
            String.format("Illegal module path: [%s]", modulePath));
        if (StringUtils.isEmpty(modulePath)) {
          modulePath = PREFIX_TOP_LEVEL;
        }
        String moduleName = getModuleNameFromPathPrefix(modulePath);
        logger.info("modulePath determined as {} for testdir={}, DerivedModuleName={}", modulePath,
            absUnitTestDir, moduleName);

        logger.info("Adding unitTests dir [{}],[{}]", unitTestParent, moduleName);
        unitTestsDirs.add(new TestDir(unitTestParent, moduleName));
      } else {
        logger.warn("Unit test directory " + unitTestParent + " does not exist, or is a file.");
      }
    }

    return unitTestsDirs;
  }

  private void validateConfigs(RootConfig rootConfig,
                               Map<String, ModuleConfig> moduleConfigs,
                               List<TestDir> unitTestDir) {

    if (rootConfig.include.isEmpty() & rootConfig.exclude.isEmpty()) {
      // No conflicts. Module configuration is what will be used.
      // We've already verified that includes and excludes are not present at the same time for
      // individual modules.
      return;
    }

    // Validate mainly for includes / excludes working as they should.
    for (Map.Entry<String, ModuleConfig> entry : moduleConfigs.entrySet()) {
      if (rootConfig.excludedModules.contains(entry.getKey())) {
        // Don't bother validating.
        continue;
      }

      if (!rootConfig.includedModules.isEmpty() &&
          !rootConfig.includedModules.contains(entry.getKey())) {
        // Include specified, but this module is not in the set.
        continue;
      }

      // If global contains includes, individual modules can only contain additional includes.
      if (!rootConfig.include.isEmpty() && !entry.getValue().exclude.isEmpty()) {
        throw new IllegalStateException(String.format(
            "Global config specified includes, while module config for %s specified excludes",
            entry.getKey()));
      }
      // If global contains excludes, individual modules can only contain additional excludes.
      if (!rootConfig.exclude.isEmpty() && !entry.getValue().include.isEmpty()) {
        throw new IllegalStateException(String.format(
            "Global config specified excludes, while module config for %s specified includes",
            entry.getKey()));
      }
    }
  }

  private LinkedHashMap<String, LinkedHashSet<TestInfo>> generateFullTestSet(RootConfig rootConfig,
                                                                             Map<String, ModuleConfig> moduleConfigs,
                                                                             List<TestDir> unitTestDirs) throws
      IOException {
    LinkedHashMap<String, LinkedHashSet<TestInfo>> result = new LinkedHashMap<>();

    for (TestDir unitTestDir : unitTestDirs) {
      for (File classFile : fileListProvider
          .listFiles(unitTestDir.path, new String[]{"class"}, true)) {
        String className = classFile.getName();

        if (className.startsWith("Test") && !className.contains("$")) {
          String testName = className.replaceAll("\\.class$", "");
          String pathPrefix = getPathPrefix(classFile, rootConfig.subDirForPrefix);
          String moduleName = getModuleNameFromPathPrefix(pathPrefix);
          logger.debug("In {}, found class {} with pathPrefix={}, moduleName={}", unitTestDir.path,
              className,
              pathPrefix, moduleName);

          ModuleConfig moduleConfig = moduleConfigs.get(moduleName);
          if (moduleConfig == null) {
            moduleConfig = FAKE_MODULE_CONFIG;
          }
          TestInfo testInfo = checkAndGetTestInfo(moduleName, pathPrefix, testName, rootConfig, moduleConfig);
          if (testInfo != null) {
            logger.info("Adding test: " + testInfo);
            addTestToResult(result, testInfo);
          }
        } else {
          logger.trace("In {}, found class {} with pathPrefix={}. Not a test", unitTestDir.path,
              className);
        }
      }
    }
    return result;
  }

  private void addTestToResult(Map<String, LinkedHashSet<TestInfo>> result, TestInfo testInfo) {
    LinkedHashSet<TestInfo> moduleSet = result.get(testInfo.moduleName);
    if (moduleSet == null) {
      moduleSet = new LinkedHashSet<>();
      result.put(testInfo.moduleName, moduleSet);
    }
    moduleSet.add(testInfo);
  }

  private String getPathPrefix(File file, String subDirPrefix) throws IOException {
    String fname = file.getCanonicalPath();
    Preconditions.checkState(fname.startsWith(sourceDirectory.getCanonicalPath()));
    fname = fname.substring(sourceDirectory.getCanonicalPath().length(), fname.length());
    if (fname.contains(subDirPrefix)) {
      fname = fname.substring(0, fname.indexOf(subDirPrefix));
      fname = StringUtils.stripStart(fname, "/");
      if (StringUtils.isEmpty(fname)) {
        fname = PREFIX_TOP_LEVEL;
      }
      return fname;
    } else {
      logger.error("Could not find subDirPrefix {} in path: {}", subDirPrefix, fname);
      return PREFIX_TOP_LEVEL;
    }
  }

  private TestInfo checkAndGetTestInfo(String moduleName, String moduleRelDir, String testName,
                                       RootConfig rootConfig, ModuleConfig moduleConfig) {
    Preconditions.checkNotNull(moduleConfig);
    TestInfo testInfo;
    String rejectReason = null;
    try {
      if (rootConfig.excludedModules.contains(moduleName)) {
        rejectReason = "root level module exclude";
        return null;
      }
      if (!rootConfig.includedModules.isEmpty() &&
          !rootConfig.includedModules.contains(moduleName)) {
        rejectReason = "root level include, but not for module";
        return null;
      }
      if (rootConfig.exclude.contains(testName)) {
        rejectReason = "root excludes test";
        return null;
      }
      if (moduleConfig.exclude.contains(testName)) {
        rejectReason = "module excludes test";
        return null;
      }
      boolean containsInclude = !rootConfig.include.isEmpty() || !moduleConfig.include.isEmpty();
      if (containsInclude) {
        if (!(rootConfig.include.contains(testName) || moduleConfig.include.contains(testName))) {
          rejectReason = "test missing from include list";
          return null;
        }
      }
      if (excludedProvided.contains(testName)) {
        // All qfiles handled via this...
        rejectReason = "test present in provided exclude list";
        return null;
      }

      // Add the test.
      testInfo = new TestInfo(moduleName, moduleRelDir, testName, rootConfig.skipBatching.contains(testName) ||
          moduleConfig.skipBatching.contains(testName),
          rootConfig.isolate.contains(testName) || moduleConfig.isolate.contains(testName));
      return testInfo;

    } finally {
      if (rejectReason != null) {
        logger.debug("excluding {} due to {}", testName, rejectReason);
      }
    }
  }

  private static final class RootConfig {
    private final Set<String> includedModules;
    private final Set<String> excludedModules;
    private final Set<String> include;
    private final Set<String> exclude;
    private final Set<String> skipBatching;
    private final Set<String> isolate;
    private final int batchSize;
    private final String subDirForPrefix;

    RootConfig(Set<String> includedModules, Set<String> excludedModules, Set<String> include,
               Set<String> exclude, Set<String> skipBatching, Set<String> isolate,
               int batchSize, String subDirForPrefix) {
      this.includedModules = includedModules;
      this.excludedModules = excludedModules;
      this.include = include;
      this.exclude = exclude;
      this.skipBatching = skipBatching;
      this.isolate = isolate;
      this.batchSize = batchSize;
      this.subDirForPrefix = subDirForPrefix;
    }

    @Override
    public String toString() {
      return "RootConfig{" +
          "includedModules=" + includedModules +
          ", excludedModules=" + excludedModules +
          ", include=" + include +
          ", exclude=" + exclude +
          ", skipBatching=" + skipBatching +
          ", isolate=" + isolate +
          ", batchSize=" + batchSize +
          ", subDirForPrefix='" + subDirForPrefix + '\'' +
          '}';
    }
  }

  private static final ModuleConfig FAKE_MODULE_CONFIG =
      new ModuleConfig("_FAKE_", new HashSet<String>(), new HashSet<String>(),
          new HashSet<String>(), new HashSet<String>(), DEFAULT_PROP_BATCH_SIZE_NOT_SPECIFIED,
          "_fake_");

  private static final class ModuleConfig {
    private final String name;
    private final Set<String> include;
    private final Set<String> exclude;
    private final Set<String> skipBatching;
    private final Set<String> isolate;
    private final String pathPrefix;
    private final int batchSize;

    ModuleConfig(String name, Set<String> include, Set<String> exclude,
                 Set<String> skipBatching, Set<String> isolate, int batchSize,
                 String pathPrefix) {
      this.name = name;
      this.include = include;
      this.exclude = exclude;
      this.skipBatching = skipBatching;
      this.isolate = isolate;
      this.batchSize = batchSize;
      this.pathPrefix = pathPrefix;
    }

    @Override
    public String toString() {
      return "ModuleConfig{" +
          "name='" + name + '\'' +
          ", include=" + include +
          ", exclude=" + exclude +
          ", skipBatching=" + skipBatching +
          ", isolate=" + isolate +
          ", pathPrefix='" + pathPrefix + '\'' +
          ", batchSize=" + batchSize +
          '}';
    }
  }

  private static class TestDir {
    final File path;
    final String module;

    TestDir(File path, String module) {
      this.path = path;
      this.module = module;
    }

    @Override
    public String toString() {
      return "TestDir{" +
          "path=" + path +
          ", module='" + module + '\'' +
          '}';
    }
  }

  private static class TestInfo {
    final String moduleName;
    final String moduleRelativeDir;
    final String testName;
    final boolean skipBatching;
    final boolean isIsolated;

    TestInfo(String moduleName, String moduleRelativeDir, String testName, boolean skipBatching, boolean isIsolated) {
      this.moduleName = moduleName;
      this.moduleRelativeDir = moduleRelativeDir;
      this.testName = testName;
      this.skipBatching = skipBatching;
      this.isIsolated = isIsolated;
    }

    @Override
    public String toString() {
      return "TestInfo{" +
          "moduleName='" + moduleName + '\'' +
          ", moduleRelativeDir='" + moduleRelativeDir + '\'' +
          ", testName='" + testName + '\'' +
          ", skipBatching=" + skipBatching +
          ", isIsolated=" + isIsolated +
          '}';
    }

    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }

      TestInfo testInfo = (TestInfo) o;

      return skipBatching == testInfo.skipBatching && isIsolated == testInfo.isIsolated &&
          moduleName.equals(testInfo.moduleName) &&
          moduleRelativeDir.equals(testInfo.moduleRelativeDir) &&
          testName.equals(testInfo.testName);

    }

    @Override
    public int hashCode() {
      int result = moduleName.hashCode();
      result = 31 * result + moduleRelativeDir.hashCode();
      result = 31 * result + testName.hashCode();
      result = 31 * result + (skipBatching ? 1 : 0);
      result = 31 * result + (isIsolated ? 1 : 0);
      return result;
    }
  }

  private static final class DefaultFileListProvider implements FileListProvider {

    @Override
    public Collection<File> listFiles(File directory, String[] extensions, boolean recursive) {
      return FileUtils.listFiles(directory, extensions, recursive);
    }
  }
}


text:
package cli

import (
	"context"

	"github.com/cosmos/cosmos-sdk/client"
	"github.com/cosmos/cosmos-sdk/client/flags"
	sdk "github.com/cosmos/cosmos-sdk/types"
	"github.com/spf13/cobra"
	"github.com/spf13/viper"
	"github.com/zigbee-alliance/distributed-compliance-ledger/utils/cli"
	"github.com/zigbee-alliance/distributed-compliance-ledger/x/validator/types"
)

func CmdListRejectedNode() *cobra.Command {
	cmd := &cobra.Command{
		Use:   "all-rejected-disable-nodes",
		Short: "Query the list of all rejected disable validators",
		RunE: func(cmd *cobra.Command, args []string) error {
			clientCtx := client.GetClientContextFromCmd(cmd)

			pageReq, err := client.ReadPageRequest(cmd.Flags())
			if err != nil {
				return err
			}

			queryClient := types.NewQueryClient(clientCtx)

			params := &types.QueryAllRejectedDisableValidatorRequest{
				Pagination: pageReq,
			}

			res, err := queryClient.RejectedDisableValidatorAll(context.Background(), params)
			if err != nil {
				return err
			}

			return clientCtx.PrintProto(res)
		},
	}

	flags.AddPaginationFlagsToCmd(cmd, cmd.Use)
	flags.AddQueryFlagsToCmd(cmd)

	return cmd
}

func CmdShowRejectedNode() *cobra.Command {
	cmd := &cobra.Command{
		Use:   "rejected-disable-node",
		Short: "Query rejected disable validator by address",
		Args:  cobra.ExactArgs(0),
		RunE: func(cmd *cobra.Command, args []string) (err error) {
			clientCtx := client.GetClientContextFromCmd(cmd)

			addr, err := sdk.ValAddressFromBech32(viper.GetString(FlagAddress))
			if err != nil {
				owner, err2 := sdk.AccAddressFromBech32(viper.GetString(FlagAddress))
				if err2 != nil {
					return err2
				}
				addr = sdk.ValAddress(owner)
			}

			var res types.RejectedDisableValidator

			return cli.QueryWithProof(
				clientCtx,
				types.StoreKey,
				types.RejectedNodeKeyPrefix,
				types.RejectedNodeKey(addr),
				&res,
			)
		},
	}

	cmd.Flags().String(FlagAddress, "", "Bech32 encoded validator address or owner account")
	flags.AddQueryFlagsToCmd(cmd)

	_ = cmd.MarkFlagRequired(FlagAddress)

	return cmd
}


text:
package com.pineone.icbms.so.interfaces.database.model;

import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.pineone.icbms.so.interfaces.database.model.CommonEntity;
import lombok.*;

/**
 * aspect model for authoring.<BR/>
 * Created by uni4love on 2017. 1. 16..
 */
//@Data
//@EqualsAndHashCode(callSuper=true)
@JsonPropertyOrder({"id","name", "description"})
@ToString
public class AspectForDB extends CommonEntity {

    @Getter @Setter
    String uri;

    @Getter @Setter
    String containerName;
}


text:
module GemBench
  class GemfileLineTokenizer
    GEM_REGEX = /\A\s*gem\s+([^#]*).*\Z/.freeze # run against gem lines like: "gem 'aftership', # Ruby SDK of AfterShip API."
    GEM_NAME_REGEX = /\A\s*gem\s+['"]{1}(?<name>[^'"]*)['"].*\Z/.freeze # run against gem lines like: "gem 'aftership', # Ruby SDK of AfterShip API."
    VERSION_CONSTRAINT = /['"]{1}([^'"]*)['"]/.freeze
    GEMFILE_HASH_CONFIG_KEY_REGEX_PROC = ->(key) { /\A\s*[^#]*(?<key1>#{key}: *)['"]{1}(?<value1>[^'"]*)['"]|(?<key2>['"]#{key}['"] *=> *)['"]{1}(?<value2>[^'"]*)['"]|(?<key3>:#{key} *=> *)['"]{1}(?<value3>[^'"]*)['"]/ }
    VERSION_PATH = GEMFILE_HASH_CONFIG_KEY_REGEX_PROC.call('path').freeze
    VERSION_GIT = GEMFILE_HASH_CONFIG_KEY_REGEX_PROC.call('git').freeze
    VERSION_GITHUB = GEMFILE_HASH_CONFIG_KEY_REGEX_PROC.call('github').freeze
    VERSION_GIT_REF = GEMFILE_HASH_CONFIG_KEY_REGEX_PROC.call('ref').freeze
    VERSION_GIT_TAG = GEMFILE_HASH_CONFIG_KEY_REGEX_PROC.call('tag').freeze
    VERSION_GIT_BRANCH = GEMFILE_HASH_CONFIG_KEY_REGEX_PROC.call('branch').freeze
    VALID_VERSION_TYPES = %i(
      constraint
      git_ref
      git_tag
    )
    # branch is only valid if the branch is not master
    attr_reader :line
    attr_reader :relevant_lines
    attr_reader :is_gem
    attr_reader :all_lines
    attr_reader :index
    attr_reader :tokens
    # version will be a string if it is a normal constraint like '~> 1.2.3'
    # version will be a hash if it is an alternative constraint like:
    # git: "blah/blah", ref: "shasha"
    attr_reader :version
    attr_reader :version_type
    attr_reader :name
    attr_reader :parse_success
    attr_reader :valid
    def initialize(all_lines, line, index)
      @line = line.strip
      @is_gem = self.line.match(GEM_REGEX)
      if self.is_gem
        @all_lines = all_lines
        @index = index
        @tokens = self.line.split(',')
        determine_name
        if self.name
          determine_relevant_lines
          determine_version
          @parse_success = true
          @valid = VALID_VERSION_TYPES.include?(self.version_type)
        else
          noop
        end
      else
        noop
      end
    end

    private

    # not a gem line.  noop.
    def noop
      @parse_success = false
      @valid = false
    end

    def determine_name
      # uses @tokens[0] because the gem name must be before the first comma
      match_data = @tokens[0].match(GEM_NAME_REGEX)
      @name = match_data[:name]
    end

    def determine_relevant_lines
      @relevant_lines = [line, *following_non_gem_lines].compact
    end

    def determine_version
      version_path ||
        (
          (version_git || version_github) && (
            check_for_version_of_type_git_ref ||
            check_for_version_of_type_git_tag ||
            check_for_version_of_type_git_branch
          )
        ) ||
        # Needs to be the last check because it can only check for a quoted string,
        #   and quoted strings are part of the other types, so they have to be checked first with higher specificity
        check_for_version_of_type_constraint
    end

    def check_for_version_of_type_constraint
      # index 1 of the comma-split tokens will usually be the version constraint, if there is one
      possible_constraint = @tokens[1]
      return false unless possible_constraint
      match_data = possible_constraint.strip.match(VERSION_CONSTRAINT)
      # the version constraint is in a regex capture group
      if match_data && (@version = match_data[1].strip)
        @version_type = :constraint
        true
      else
        false
      end
    end

    def version_path
      @version = {}
      line = relevant_lines.detect { |next_line| (next_line.match(VERSION_PATH)) }
      return false unless line
      enhance_version(
          line.match(VERSION_PATH),
          :path,
          :path
      )
    end

    def version_git
      @version = {}
      line = relevant_lines.detect { |next_line| (next_line.match(VERSION_GIT)) }
      return false unless line
      enhance_version(
          line.match(VERSION_GIT),
          :git,
          :git
      )
    end

    def version_github
      @version = {}
      line = relevant_lines.detect { |next_line| (next_line.match(VERSION_GITHUB)) }
      return false unless line
      enhance_version(
          line.match(VERSION_GITHUB),
          :github,
          :github
      )
    end

    def check_for_version_of_type_git_ref
      line = relevant_lines.detect { |next_line| (next_line.match(VERSION_GIT_REF)) }
      return false unless line
      enhance_version(
          line.match(VERSION_GIT_REF),
          :ref,
          :git_ref
      )
    end

    def check_for_version_of_type_git_tag
      line = relevant_lines.detect { |next_line| (next_line.match(VERSION_GIT_TAG)) }
      return false unless line
      enhance_version(
          line.match(VERSION_GIT_TAG),
          :tag,
          :git_tag
      )
    end

    def check_for_version_of_type_git_branch
      line = relevant_lines.detect { |next_line| (next_line.match(VERSION_GIT_BRANCH)) }
      return false unless line
      enhance_version(
          line.match(VERSION_GIT_BRANCH),
          :branch,
          :git_branch
      )
    end

    # returns an array with each line following the current line, which is not a gem line
    def following_non_gem_lines
      all_lines[(index+1)..(-1)].
          reject {|x| x.strip.empty? || x.match(GemBench::TRASH_REGEX) }.
          map(&:strip).
          inject([]) do |following_lines, next_line|
            break following_lines if next_line.match(GEM_REGEX)
            following_lines << next_line
      end
    end

    # returns a hash like:
    #   {"key" => ":git => ", "value" => "https://github.com/cte/aftership-sdk-ruby.git"}
    def normalize_match_data_captures(match_data)
      match_data.names.inject({}) do |mem, capture|
        mem[capture.gsub(/\d/,'')] = match_data[capture]
        break mem if mem.keys.length >= 2
        mem
      end
    end

    def enhance_version(match_data, version_key, type)
      return false unless match_data
      normalized_capture = normalize_match_data_captures(match_data) if match_data
      return false unless normalized_capture
      @version.merge!({version_key => normalized_capture["value"]})
      @version_type = type
      true
    end
  end
end


text:
#include <corecrypto/cccast.h>
#include <corecrypto/ccmode_factory.h>

const struct ccmode_ecb *cccast_ecb_decrypt_mode(void)
{
    return &cccast_eay_ecb_decrypt_mode;
}

const struct ccmode_ecb *cccast_ecb_encrypt_mode(void)
{
    return &cccast_eay_ecb_encrypt_mode;
}

CCMODE_CBC_FACTORY(cast, encrypt)
CCMODE_CBC_FACTORY(cast, decrypt)

CCMODE_CFB_FACTORY(cast, cfb, encrypt)
CCMODE_CFB_FACTORY(cast, cfb, decrypt)

CCMODE_CFB_FACTORY(cast, cfb8, encrypt)
CCMODE_CFB_FACTORY(cast, cfb8, decrypt)

CCMODE_CTR_FACTORY(cast)

CCMODE_OFB_FACTORY(cast)


text:
Sets the value of an attribute (whatever value is in place of `[attribute]`) on the element.

*If your binding declaration does not match any of the above routines, it will fallback to use this binding.*

```html
<input type="text" rv-placeholder="field.placeholder">
```