input
stringlengths
10
828
output
stringlengths
5
107
public void set directories list directories this directories directories
sets the directories
private void set combox jcombo box box string text combo box box jframe simple reg expression helper text component null jframe simple reg expression helper j list null string s text if s null s string combo box get editor get item this fill components s
changes the text in the jcombo box given as parameter
private void set jlist jlist list string text j list list jframe simple reg expression helper combo box null jframe simple reg expression helper text component null this fill components text
changes the text in the jlist given as parameter
public list get files return this files
files that are tailed or greped
public void set file tails list file tails this file tails file tails
collection of tails or greps
public boolean set configuration directory string dir file f new file dir string default dir system get property user home file separator config if f exists this config directory default dir return false if f is directory this config directory default dir return false this config directory dir return true
used to store the configuration files for configuration manager
public string get configuration directory string default dir system get property user home file separator smarttail file separator config file tmp dir new file default dir if tmp dir exists if tmp dir is directory if tmp dir mkdirs throw new runtime exception failed to create default directory for configurations tmp dir if equals this config directory this config directory null file f new file this config directory if f exists this config directory default dir if f is directory this config directory default dir else this config directory default dir return this config directory
return the dir for the configurations used by config manager
private boolean check file logger finest checking file file f new file this file if f exists logger warning file does not exist this file return false if f is file logger warning file is not a file this file return false return true
does the file exist and is it a file
private void check values logger finest checking values if this replacement null this replacement logger finer replacement null replaced replacement by an empty string if this search expression null this search expression logger finer search expression null replaced search expression by if this text null this text logger finer text null replaced text by an empty string
check some values for null
public void run this log command output
calls log command output
public void set file size int max size mb this logger fine set size of files to max size mb mb long l long max size mb 1024 1024 this file size l
set the maximum file size of the rolling file appender
public int get file size int i int this file size 1024 1024 logger fine returning file size of i mb return i
gets the maximum file size of the files of the rolling file
public void write string s throws ioexception this check if this reached max size this roll file super write s
let the rolling file appender write a string into the file and roll
private void create file list logger fine create list of files this files new array list string tmp file this get file this files add new file tmp file for int i 0 i this file count 1 i tmp file this get new file name i tmp file this files add new file tmp file
creates a lis of files used by the rolling file appender
public properties get environment variables throws exception logger finest about to execute cmd c set properties prop new java util properties java io buffered reader in new java io buffered reader new java io input stream reader runtime get runtime exec cmd c set get input stream while true string str in read line logger finest reading next windows environment variable str if str null int index str index of if index 1 prop put str substring 0 index str substring index 1 else break in close return prop
works for windows only
public string get environment variable string name throws exception properties prop this get environment variables enumeration names prop keys while names has more elements string key string names next element if key equals ignore case name string value prop get property key return value return null
works for windows only
public string get property case independent string key string value system get property key if value null key key to upper case value system get property key if value null key key to lower case value system get property key return value
why to use this mehtod eclipse reads envrionment variables but converts
private void check values this check files this check id
calls check files and check id
private void check id check file and set default value if neccessary if equals this id this id null else this id time stamp get full timstamp logger finer this to string id for command this command not given and therefor set to default this id
it the id is not set a time stamp is taken as id
public properties read properties string file throws exception properties props new properties buffered input stream in null try in new buffered input stream new file input stream file props load in in close in null catch exception e logger log level warning failed to load properties from file file e throw e finally if in null try in close catch exception e1 return props
reads properties from a file
public list get directories of files list files list directories new array list if files null return directories iterator it files iterator while it has next string file string it next file f new file file string directory f get parent if directory null if directories contains directory directories add directory return directories
creates a list of the directories of a list of files
public string get ipfrom uncpath string uncpath name string reg expession d 1 3 d 1 3 d 1 3 d 1 3 string ip null logger finest compiling the regular expression reg expession java util regex pattern pattern java util regex pattern compile reg expession logger finest matching the expression reg expession in unc path name uncpath name java util regex matcher matcher pattern matcher uncpath name if matcher find ip matcher group logger finest found ip in unc path name uncpath name else logger finest no ip found in unc path name uncpath name return ip
get the ip address from an unc path windows
public void value changed tree selection event e default mutable tree node node default mutable tree node this j tree reg exp get last selected path component if node null return object node detail node get user object if node is leaf this detail reg expression details node detail display url detail get details url this j text area reg exp details sub exp request focus
required by tree selection listener interface
public void add result string topic long exec time list list for topic get list for topic topic list for topic add new long exec time
you can messure timings for different topics e
public void test copy file try this util copy file this file from this file to catch exception e fail copy file from this file from to this file to file from new file this file from file to new file this file to long length from from length long length to to length assert equals length of files are the same file from this file from file to this file to length from length to
test of copy file method of file util
private boolean check formatter class string class name this j text field formatter get text boolean class was found false try class for name class name class was found true catch java lang class not found exception e logger fine class for foramtter not found in classpath class name return class was found
checks wether the class for the formatter given in gui
private boolean reload logging configuration string file from gui logging initializer initializer new logging initializer if file from gui null this pop error could not find file this logger fine could not find a file return false try initializer init logging file from gui catch exception e this pop error failed to reload logging configuration n n the original error message is n e get message return false return true
reloads the logging configuration using the modified
public void empty text areas for test this input text pane set text this j text area reg exp details sub exp set text
clears both textfields search expression and text to search through
public void set test text string s if s null this test text s if this input text pane null this add input text area this input text pane set text this test text this input text pane set caret position 0
sets the text of the reg exp assistant in the upper textfield
public void visit int version int access string name string signature string super name string interfaces super visit version access name signature super name interfaces
start visiting a class
public void visit int version int access string name string signature string super name string interfaces super class super name super visit version access name signature super name interfaces
start visiting a class
public void set class visitor class visitor cv super cv cv
each of extended
protected void set processing boolean processing this processing processing
subclasses should invoke this method with code true code arguments value if any
private void init velocity try get and initialize an engine ve new velocity engine disable velocity logging final extended properties ep new extended properties ep add property runtime log logsystem class org apache velocity runtime log null log system ve set extended properties ep ve init get the template final input stream is get class get resource as stream template file final byte bytes various utils convert is2 bytes is template new string bytes utf 8 catch exception e logger error e
inits apache velocity template engine
public string get mutation name return mutation name
returns name of recently introduced mutaiton
private void save muateted file byte processed bytecode final file file files list get mutated file index system out println saving file get name try various utils write file file processed bytecode catch ioexception e throw new runtime exception e
saves on the disk changes applied by mutation
public void create report file writer fw null try init velocity final file file new file output file fw new file writer file final string report new string create report content utf 8 fw write report catch ioexception e logger error e throw new runtime exception e finally if null fw try fw close catch ioexception e not good but we don t care ignore it
creates report according to parameters specified in this class cunstructor
public string get mutated file return mutated file index 1 files str list get mutated file index null
gets name of the file that was mutated in last iteration
public boolean is mutated return mutated
checks if last mutating iteration mutated some file
public string get mutation name return mutators set get mutation name
returns name of recently introduced mutaiton
private void create summary report file writer fw null try init velocity final string summary output file name path for mutated reports file separator summary report file name final file file new file summary output file name fw new file writer file final string report new string create report content utf 8 fw write report catch ioexception e logger error e throw new runtime exception e finally if null fw try fw close catch ioexception e not good but we don t care ignore it
creates summary report from all mutations in current iteration
private void create report final xmlresult aggregator result aggr new xmlresult aggregator result aggr set project get project result aggr set task name junit report result aggr set todir path with results fileset element final file set fs new file set fs set dir path with results fs create include set name xml result aggr add file set fs report element final aggregate transformer tranformer result aggr create report tranformer set todir path with results format format new format format set value frames tranformer set format format execute result aggr execute
creates standard report from from performed junit tests
private void init mutator path with results new file bt get todir engine new mutator engine path with oryginal program
inits mutator internal state
private void validate arguments throws build exception if null bt null bt get todir throw new build exception nested batchtest element with todir argument is required
check whether arguments set in ants xml make file are correct
private void copy oryginal program final copy copy new copy copy set task name mutator copy oryg prog copy set overwrite true copy set project get project copy set todir path for copy oryginal program final file set fs new file set fs set dir path with oryginal program include all files by default fs set defaultexcludes false copy add fileset fs copy execute
copies whole oryginal program class files to separate directory
public void set path for mutated reports file path for reports this path for mutated reports path for reports
sets directory where report from mutation should be stored
public void set path with oryginal program file path with oryginal program this path with oryginal program path with oryginal program
sets path where oryginal program to mutate is located
public void set path for copy oryginal program file path for copy oryginal program this path for copy oryginal program path for copy oryginal program
sets path where oryginal program may be temporary copied by mutator
public void set mass double mass this mass mass
sets the override mass of the molecule
public double get mass mass masstype boolean override if override this mass 1 return this mass return this get mass masstype
returns the mass of the molecule
public polarity get polarity return this polarity
returns the optional polarity for this molecule
public void set polarity final polarity polarity this polarity polarity
sets the optional polarity for this molecule
public static mass calculator peak standard masscalculator new mass calculator peak public double get mass vector peak peaks calculate the min max intensity collections sort peaks ipeak sort intensity ascending double minintensity peaks first element get intensity double maxintensity peaks last element get intensity double intensityrange maxintensity minintensity calculate the weighted mean double n 0 double meanmass 0 for peak peak peaks the weight should end up between 1 and 10 double weight peak get intensity minintensity intensityrange 9 1 n weight meanmass weight peak get mass return meanmass n
standard implementation of the mass calculator which reduces memory requirements
public void set up throws exception super set up demo project new test project ittest plugin get default get bundle get entry
method set up
public void tear down throws exception super tear down demo project tear down
method tear down
public ipackage fragment root get default source folder throws exception if fg root null return fg root throw new exception my setup not initialized
method get default source folder
public ijava project get project throws exception if fg java test project null return fg java test project throw new exception my setup not initialized
method get project
public ipackage fragment get package p throws exception if fg package p null return fg package p throw new exception my setup not initialized
method get package p
public file get file in plugin ipath path try url install url new url get base url path to string url local url platform as local url install url return new file local url get file catch ioexception e return null
method get file in plugin
public ipackage fragment root add rtjar ijava project jproject throws exception ipath rt jar path find rt jar if rt jar path null return java project helper add library jproject rt jar path 0 rt jar path 1 rt jar path 2 else throw new exception java runtime path is invalid
adds a library entry pointing to a jre
public void tear down throws exception remove children of package fg package p remove from root fg root fg package p if fg package p exists fg package p delete true null java project helper remove source container fg java test project container java project helper delete fg java test project
method tear down
public void try deleting all java children ipackage fragment pack throws java model exception ijava element kids pack get children for int i 0 i kids length i if kids i instanceof isource manipulation try if kids i exists kids i is read only isource manipulation kids i delete true null catch java model exception e try to delete em all e print stack trace
method try deleting all java children
public void try deleting all non java child resources ipackage fragment pack throws java model exception object non java kids pack get non java resources for int i 0 i non java kids length i if non java kids i instanceof iresource iresource resource iresource non java kids i try resource delete true null catch core exception e try to delete em all e print stack trace
method try deleting all non java child resources
public icompilation unit create type in package p string class name string file throws exception return create cu fg package p class name file
method create type in package p
public icompilation unit create cu ipackage fragment pack string name string file throws exception ipath path2 new path file url url new url get base url path2 to string string contents get contents url open stream if pack get compilation unit name exists return pack get compilation unit name icompilation unit cu pack create compilation unit name contents true null cu save null true return cu
method create cu
public string query overwrite string file return all
method query overwrite
public void accept class char package name char simple type name char enclosing type names string path
method accept class
public void accept interface char package name char simple type name char enclosing type names string path
method accept interface
public boolean perform ok iselection sel calc combo get selection if sel instanceof istructured selection iaccess set calculator calc iaccess set calculator istructured selection sel get first element calc list set selected calculator calc return true
method declared on ipreference page
public taaccess set add access set declaration element de deset key invocations metrics what we need to do here too is to figure out the real resolved type of the de if de null type element relevant resolved type get relevant resolved type de if relevant resolved type null throw new error should not be null as it must be a type from the hierarchy per definition de set relevant resolved type relevant resolved type taaccess set set find set invocations if set null set add new set invocations if de null set add declaration element de return set
adds an access set to the access set lattice
private type element get relevant resolved type declaration element de fimxe bug with arrays key starts with open brackets if de get declared type get key starts with if de get declared type get key equals this the type get binding get key return the type else if de get declared type get key equals this the type get binding get key return the type return this supertypes find type element for binding de get declared type
returns the declared type element of the given declaration element
private taaccess set add new set deset key invocations taaccess set new set new taaccess set invocations type set fitting types find types for invocations invocations new set set fitting types fitting types elements add new set return new set
adds a new access set lattice with the given invocations to this
private type set find types for invocations deset key invocations type set supported new type set for iterator i supertypes type iterator i has next type element t type element i next if t contains all members invocations supported add type t needed for metrics and it is fitting after all supported add type this the type return supported
this methods finds the supertypes which contains all the given
private taaccess set find set deset key invocations iterator i elements iterator while i has next taaccess set c taaccess set i next if c get invocations equals invocations return c return null
this method checks if there is still an access set with the given
public void add declaration element declaration element current de this declaration elements add declaration current de
adds a new declaration element that is an element on which the members
public boolean is empty return declaration elements is empty
checks whether the declaration elements collection in this access set
public type element get fittest type int member count integer max value type element fittest null for iterator i fitting types type iterator i has next type element current type element i next if current member count member count member count current member count fittest current return fittest
returns the best fitting type of the access set
public void reset state directions new int default directions length system arraycopy default directions 0 directions 0 directions length column 1
resets the sorter to the default sorting state
public void set column int column if this column column this column column set direction column ascending else reverse direction column
sets the column which should be sorted
private void set direction int which column int ascend directions which column ascend
reverses the direction of the sorting
private void reverse direction int column directions column 1
reverses the sorting direction of the column specified
public int compare viewer viewer object e1 object e2 int return c 0 switch column case 0 case 1 return c e1 to string compare to e2 to string break return return c directions column
compares two objects from the table which are always tarepresentatives
public string get column text object element int column index taaccess set result taaccess set element switch column index case 0 return case 1 return string value of result declaration elements size case 2 return string value of result invocations size case 3 return result get invocations representative string case 4 return result get declaration elements representative string return null
returns the column text for each column
public image get column image object element int column index if column index 0 return title image return null
returns the column image only in the first column
public void change selection int currentselection display actions declarationelements is checked declarationelements display actions invocationelements is checked invocationelements supertypes first change ui information switch currentselection case declarationelements this menu selection declarationelements this text column set text header des this set part name title des break case invocationelements this menu selection invocationelements this text column set text header invocations this set part name title invocations break case supertypes this menu selection supertypes this text column set text header supertypes this set part name title supertypes break label provider set selection mode currentselection update domain data
displays another part of the information of a access set lattice
public int compare viewer viewer object e1 object e2 int return c 0 switch column case 0 case 1 return c new integer taaccess set e1 declaration elements size compare to new integer taaccess set e2 declaration elements size break case 2 return c new integer taaccess set e1 invocations size compare to new integer taaccess set e2 invocations size break case 3 return c taaccess set e1 get invocations representative string compare to taaccess set e2 get invocations representative string break return return c directions column
compares two objects from the table which are always taacess sets
private void update domain data if current access set null switch menu selection case declarationelements viewer set input current access set get declaration elements to collection break case invocationelements viewer set input current access set get invocations to collection break case supertypes viewer set input current access set get fitting types to collection break else viewer set input new array list
called by the listener method changes the underlying data
public taaccess set get selected access set first check if there is a selected as in the tabular view object first istructured selection this viewer get selection get first element if first null first instanceof taaccess set return taaccess set first then check if there is a selected as in the graphical view return current access set
returns the actually selected declaration element
public void add invocation declaration element invocation invocations add declaration invocation access set new taaccess set invocations
adds a new invocation to the graph node
public void subtract tagraph node subtracted graph node invocations remove declarations subtracted graph node get invocations access set new taaccess set invocations
removes all invocations of the given graph node from this
public void set access set taaccess set access set this access set access set
sets the access set the graph node represents
private boolean check prerequesites itype type if type is binary message dialog open error null binary type cannot parse binary types no access information available return false return true
checks whether access sets of type can be found
private shell get shell iworkbench window window platform ui get workbench get active workbench window if window null return null return window get shell
returns the current shell
private boolean is empty itype type itype supertypes throws java model exception boolean type contains methods type get methods length 0 if type contains methods return false type itself is not empty supertypes won t help type is not is empty type seems to be empty check the supertypes boolean is empty true for int i 0 i supertypes length i if supertypes i get methods length 0 is empty false break return is empty
checks whether a type has zero methods
public void add type itype type types we are looking for add type
used to add types to the list
public collection get compilation units return compilation units
returns the compilation units
private boolean is type in list string type for iterator i types we are looking for iterator i has next itype current itype i next if current get fully qualified name equals type return true return false
checks whether a type is in the list
public count result get num vars found return num of variables
returns the result
public string get column text object element int column index metric selection result metric selection element switch column index case 0 return case 1 return result get metric get name return hm
returns the column text for each column
private image get image boolean is selected string key is selected checked image unchecked image return image registry get key
returns the image with the given key or code null code if not