input
stringlengths 10
828
| output
stringlengths 5
107
|
---|---|
protected connection get new connection throws com fujitsu arcon servlet connection exception connection connection null we do not want to end up with too many open connections connection set keep open false create a new connection connection connection get connection reference return connection | get a new connection |
private string sign list name value pair params throws exception string builder sb new string builder collections sort params new comparator name value pair public int compare name value pair p1 name value pair p2 return p1 get name compare to p2 get name for name value pair pair params sb append pair get name append pair get value sb append secret key string str sb to string return digest utils sha hex str | create the signature for this set of parameters |
public resource get root resource logger debug creating new root resource return new http resource context | returns the root http resource |
public void check for updates boolean contains changes contains changes tracker contains changes contains changes true if contains changes tracker clear template resources clear templates clear fire invalidation event | checks to see if any parsed resource has changed |
public string save with rollback string node name string property name save smth node name property name throw new runtime exception do rollback | save something inside the repository |
private void configure end boolean discard runnable command discard end tag stack push discard end element command stack push command | invoked whenever a token start start component etc |
private void work component queue while component queue is empty component page element component element component queue pop load template for component component element | works the component queue until exausted |
protected string suitable string s int max int s width font string width s if s width max return s string left part left s max three dots width return left part | return a suitable string |
protected string left string s int max int s width font string width s if s width max return null char cs s to char array int estimate cs length int ax 0 do estimate estimate 2 ax font chars width cs 0 estimate while ax max now 0 estimate is less than s max for int i estimate i cs length i ax font char width cs i if ax max found return new string cs 0 i 1 there must be logic error in this method return | return a left string |
public string send message string email string message string id get next id string xml message xmlns jabber client id id type chat to email body encode message body message sending thread send later xml return id | send a message and return this messages id for future check |
static public void print string s try out write s get bytes catch ioexception e todo auto generated catch block e print stack trace | prints the given string only if the current verbosity |
static public void set output stream output stream out debug out out | sets the ouput print stream for debug |
public compound constraint get constraint return constraint | gets the compound constraint associated with this principal solution |
public boolean has backward nodes return backward queue is empty | returns a boolean expressing whether there are any unexplored |
public boolean has forward nodes return forward queue is empty | returns a boolean expressing whether there are any unexplored |
public role node next backward node return backward queue remove first | retrieves and removes the next unexplored backward node |
public node next forward node return forward queue remove first | retrieves and removes the next unexplored forward node |
public void add backward node role node node backward queue add node | inserts a backward node into the back of the queue |
public void add forward node node node forward queue add node | inserts a forward node into the back of the queue |
public void add repository repository client new repository if this repositories contains new repository this repositories add new repository | adds a new repository to be searched |
public void close all repositories iterator repository client client iter repositories iterator repository client client while client iter has next client client iter next client send request end session client close | ends all clients sessions with their associated server |
public boolean is currently forward searching return this is forward searching this is bi dir searching | determines if this engine is currently performing a forward search |
public principal node get nodes matching principal e return principal nodes get e | returns all principal nodes matching a given entity if any exist |
public credential manager get credential manager return this credential manager | returns the hash set of credential manager for this proof graph |
public boolean has solution role role for role solution solution this solutions if solution get role equals role return true return false | determines if this node has a solution which contains |
public void print nodes system out println role nodes nl string output new string this role nodes size iterator array list role node list iterator this role nodes values iterator int i 0 while list iterator has next output i list iterator next to string arrays sort output for int j 0 j i j system out println output j system out println principal nodes nl this principal nodes to string | prints out the nodes currently in the graph |
public role solution get solution matching role role for role solution solution this solutions if solution get role equals role return solution return null | finds a solution to this node which contains a given role |
private void print help system out println command t t usage system out println t t nl system out println exit t texit system out println get t tget all issuer principal defined role role subject role expression type int type system out println add t tadd credential file system out println stats t tstats | prints usage info for all commands |
public void close try out close in close socket close catch ioexception e e print stack trace | effectively closes this thread by closing streams and sockets |
public void process input string input throws ioexception system out println input 0 if input 0 starts with request input 0 input 0 substring 8 chop off request hash set string unserved serials new hash set string for string serial this credential manager get input 0 if this served serials contains serial this served serials add serial unserved serials add serial out println this credential manager get creds unserved serials out println end of credentials else if input 0 starts with add try this credential manager add input 1 catch exception e e print stack trace | evaluates a request and returns the result to the client |
public void increment serial this last used serial number generate next serial this last used serial number | increments the serial number |
public string find credentials by issuer principal principal hash set string matches this issuer map get principal if matches null return return get creds matches | finds all locals issued by a principal |
public string find credentials by defined role role role hash set string matches this defined role map get role if matches null return return get creds matches | finds all locals by defined role |
public string find credentials by subject role expression subject hash set string matches this subject map get subject if matches null return return get creds matches | finds credentials by subject |
public void remove key pair key pair key pair this keys remove key pair | removes the meta data for this key pair from the profile |
public void remove and delete key pair key pair key pair if this keys contains key pair return this keys remove key pair file public key key pair get public key file file private key key pair get private key file if public key exists public key delete if private key exists private key delete | removes the meta data for this key pair and deletes the key files |
public string find credentials by partial subject role subject hash set string matches this partial subject map get subject if matches null return return get creds matches | finds credentials by partial subject rhs |
public string find credentials by type integer type hash set string matches this type map get type if matches null return return get creds matches | find credentials by type |
public string get all credentials return get creds this all serials | gets all credentials stored by this repository |
public void add key pair key pair key pair if this keys contains key pair this keys add key pair | adds the meta data for this key pair to the profile |
private file get next cred file throws file not found exception file creds dir new file creds dir if creds dir exists creds dir mkdir else if creds dir is directory throw new file not found exception non directory file credentials exists string new file name cred0000 asc file new file null for int i 0 i 10000 i new file new file creds dir new file name if new file exists break new file name get next name new file name return new file | returns an empty file with a name of the form cred |
private string get next name string previous name previous name previous name substring 4 8 int num integer parse int previous name num string buffer new name new string buffer cred if num 10 new name append 000 else if num 100 new name append 00 else if num 1000 new name append 0 new name append num new name append asc return new name to string | a helper method for get next cred file |
public comparable get lower bound return lower bound | gets the lower bound for this range |
public void set lower bound comparable lower bound this lower bound lower bound this lower constrained true | sets the lower bound for this range |
public void set lower inclusive boolean lower inclusive this lower inclusive lower inclusive | sets this range to include or exclude the lower bound |
public comparable get upper bound return upper bound | gets the upper bound for this range |
public void set parameter constraint simple constraint constraint int role number int param number parameters role number param number set constraint constraint | sets the specified parameter to point to the given constraint |
public int get credentials server count this credentials served at last stat this credentials served return this credentials served | returns the number of credentials that have been served |
public void set upper bound comparable upper bound this upper bound upper bound this upper constrained true | sets the upper bound for this range |
public simple constraint get parameter constraint int role number int param number return this parameters role number param number get constraint | gets the constraint associated with a parameter |
public role name get next role name random rand new random int temp rand next int random range temp this role number this role number this random range string temp2 temp role name new role name new role name temp2 temp2 return new role name | for use with the big test generator |
public void set upper inclusive boolean upper inclusive this upper inclusive upper inclusive | sets this range to include or exclude the upper bound |
public string to rtml return new string range n this lower bound n this lower inclusive n this upper bound n this upper inclusive n range | returns an rtml representation of this |
public boolean is satisfiable for int i 0 i parameters length i for int j 0 j parameters i length j simple constraint constraint parameters i j get constraint if constraint is satisfiable if debug verbosity level debug high debug println unsatisfiable constraint nl this to string verbose return false return true | determines if this is satisfiable |
public principal get base return base | returns the base of this role which is an entity |
public role name get role name return role name | returns the role name for this role |
public void set url string url this url url calc hash | sets the name space for this role name |
public void add parameter parameter new parameter this parameters add new parameter | adds a parameter to this role name |
public string to rtml string buffer sb new string buffer sb append role name n sb append this name n sb append this url n sb append description n if this description null sb append this description n sb append description n iterator parameter iter this parameters iterator while iter has next sb append iter next to rtml sb append role name return sb to string | returns an rtml representation of this role name |
public string to string verbose string buffer output new string buffer for int i 0 i num roles i if parameters i null continue for int j 0 j parameters i length j output append output append parameters i j to string verbose if j parameters i length 1 if i parameters length 1 output append nl nl else output append nl return output to string | returns a string with parameter names and their constraints |
public principal get issuer return this defined role get base | retrieves the base of the issuing role of this credential |
public role get first role return first role | returns the first role of this linked role |
public role get defined role return this defined role | returns the role on the left hand side of the credential |
public role name get second role name return this second role name | returns the second role name |
public role expression get subject return this subject | returns the role expression on the right hand side of the credential |
public string to rtml string out new string parameter n this name n this value type n if this constraint null out this constraint to rtml n out parameter n return out | returns an rtml representation of this parameter |
public intersection add role r parts add r return this | adds a new expression to this intersection |
public int get parts count return parts size | determines the number of subexpressions contained in this intersection |
public int compare to object o throws class cast exception if o instanceof intersection throw new class cast exception iterator role parts1 get parts iterator role parts2 intersection o get parts int comparison while parts1 has next parts2 has next comparison parts1 next compare to parts2 next if comparison 0 return comparison return 0 | compares two intersections aphabetically by their roles |
public boolean has solution principal principal for principal solution solution this solutions if solution get principal equals principal return true return false | determines if this node has a solution which contains |
public principal solution get solution matching principal princpal for principal solution solution this solutions if solution get principal equals princpal return solution return null | finds a solution to this node which contains a given code principal code |
override public string to string return role to string | returns this node in a readable string format |
private void set info this shortcut ds cyclo this full name mccabe cyclomatic complexity this description cyclomatic complexity directly measures the number of linearly independent paths through a program s source code by counting branch statements | sets the information for metric |
private void set info this shortcut ds cint this full name coupling dispersion this description the number of classes in which the operation called from the measured operation are defined divided by cint | sets the information for metric shortcut full name description |
private void set info this shortcut ds cdisp this full name coupling intensity this description the number of classes in which the operation called from the measured operation are defined divided by cint | sets the information for metric shortcut full name description |
private void set info this shortcut ds tcc this full name tight class cohesion this description the relative number of method pairs of a class that access in common at least one attribute of the measured class | sets the information for metric shortcut full name description |
private int calculate cdisp list reference methods list string res new array list string for reference method methods if method instanceof type reference if res is empty res add si get method method reference method get containing class type get name else if is already in res si get method method reference method get containing class type get name res add si get method method reference method get containing class type get name return res size | sort the method reference in the specificed methods so they will only |
private void set info this shortcut ds wmc this full name weighted method count this description the sum of the statical complexity of all methods of a class the cyclo metric is used to quantify the method s complexity | sets the information for metric shortcut full name description |
private void set info this shortcut ds locc this full name lines of code class this description number of lines of code of a class including blank lines comments parenthesis and method header but without java doc header | sets the information for metric |
private boolean is already in list string class names string name for string n class names try if n equals name return false catch exception e return false return true | check the class is already accessed from another methods |
private void set info this shortcut ds nopa this full name number of public attributes this description the number of public attributes which are not static and constant of a class don t measured for abstract classes | sets the information for metric shortcut full name description |
private void set info this shortcut ds noav this full name number of accessed variables this description the total number of variables accessed directly from the measured operation | sets the information for metric shortcut full name description |
private void set info this shortcut ds cc this full name changing classes this description the number of classes in which the methods that call the measured method are defined in | sets the information for metric shortcut full name description |
private void set info this shortcut ds locm this full name lines of code method this description number of lines of code of a method including blank lines comments parenthesis and method header but without java doc header | sets the information for metric |
private void set info this shortcut ds noam this full name number of accessor methods this description noam number of get set methods of a class don t measured for abstract classes here is summed the number of only public get set methods constructur static abstract | sets the information for metric shortcut full name description |
private void set info this shortcut ds maxnesting this full name maximum nesting level this description the maximum nesting level of control structures within an operation | sets the information for metric shortcut full name description |
private void set info this shortcut ds atfd this full name access to foreign data this description the number of attributes from unrelated classes that are accessed directly or by invoking accessor methods | sets the information for metric shortcut full name description |
private void set info this shortcut ds woc this full name weight of a class this description number of functional public methods divided by the total number of public members | sets the information for metric shortcut full name description |
private void set info this shortcut ds cm this full name changing methods this description the number of dinstinct methods that call the measured method | sets the information for metric shortcut full name description |
protected source info make source info return new default cross reference source info this | the cross reference source info is a subclass of the source info |
protected string strip comment chars string line string result line trim if result length 0 int left 0 int right result length 1 if result char at left left while left right result char at left left if result char at right right while left right result char at right right if left right result result substring left right 1 trim else result return result | strips comment characters from the beginning and end of the |
public string get next candidate string res if attempt derivates length res derivates attempt else res derivates 0 2 attempt derivates length attempt 1 return res | returns the next name candidate |
public string get intro if analyzed parse raw comment return intro text null intro text | returns the introductionary text of the comment |
public boolean has tags return get tag count 0 | determines whether or not there are tags contained in the |
public int get tag count if analyzed parse raw comment return tag names null 0 tag names size | determines the number of tags in the underlying comment |
public boolean accept model element e return type is instance e name equals named model element e get name | accepts or denies a given model element |
public enumeration get tags if analyzed parse raw comment if tag names null return empty enumeration else return tag names elements | return an enumeration of tags contained in the comment in |
public string get tag value string tag string result null if tag null if analyzed parse raw comment if tag values null result tag values get property tag null return result | returns the text for the given tag or tt null tt if that |
public void reset program element root super reset root | reset the walker to a new start position reusing existing objects |
public void set reporting returns boolean yes is reporting returns yes | decide whether non terminal elements should be reported when returning |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.