Jcontract Preferences
User preferences for the Jcontract package are stored in a preference file. Jcontract searches for a preferences file in the following locations (in the order listed):
- The location specified by the DBC_PREFERENCES environment variable.
- The "jcontract.preferences" file in your home directory.
- The "jcontract.preferences" files in the Jcontract installation directory.
The first preference file found will be used.
The preference file contains preferences of the form:
Category.Item=value
For example:
Instrumentation.InstrumentPreConditions=true
Changing Preference Options
The preference values can be changed in either of the following ways:
- Edit the preferences file directly.
- Edit the preference options through the Preference panel GUI interface that modifies the
jcontract.preferences file. The are three ways to reach this Preferences panel:
- Choose Start> Programs> Jcontract> Edit Preferences.
- Enter the following command at the command prompt:
dbc_preferences
- (If the Jcontract Monitor is already open) Choose Edit> Preferences in the Jcontract Monitor.
- Edit the preference options with commands that work with the
dbc_preferences command. For example, to change the Instrument.InstrumentPreConditions preference to false use the following command:
$ dbc_preferences -set Instrument.InstrumentPreConditions=false
For more information see dbc_preferences.
Available Preference Options
All of the following preference options can be modified in the Jcontract Preferences panel; all options that are not exclusive to the Jcontract GUI Monitor can be modified directly in the jcontract.preferences file or from the command line. The GUI options related to each preference option are listed in parentheses below the name of each option.
Instrumentation Preferences
Instrumentation.InstrumentPreConditions (Instrumentation tab> Instrument @pre Conditions)
Specifies if the "dbc_javac" compiler should generate code to check the "@pre" contracts in the class.
Possible values are "true" and "false". The default value is "true".
The value specified here can be overridden in the "dbc_javac" command by using the "-Z@pre (on|off)" flag.
Instrumentation.InstrumentPostConditions (Instrumentation tab> Instrument @post Conditions)
Specifies if the "dbc_javac" compiler should generate code to check the "@post" contracts in the class.
Possible values are "true" and "false". The default value is "true".
The value specified here can be overridden in the "dbc_javac" command by using the "-Z@post (on|off)" flag.
Instrumentation.InstrumentInvariantConditions (Instrumentation tab> Instrument @invariant Conditions)
Specifies if the "dbc_javac" compiler should generate code to check the "@invariant" contracts in the class.
Possible values are "true" and "false". The default value is "true".
The value specified here can be overridden in the "dbc_javac" command by using the "-Z@invariant (on|off)" flag.
Instrumentation.InstrumentConcurrencyConditions (Instrumentation tab> Instrument @concurrency Conditions)
Specifies if the "dbc_javac" compiler should generate code to check the "@concurrency" contracts in the class.
Possible values are "true" and "false". The default value is "true".
The value specified here can be overridden in the "dbc_javac" command by using the "-Z@concurrency (on|off)" flag.
Instrumentation.DefaultConcurrency (Instrumentation tab> Default Concurrency)
Default concurrency to be used by "dbc_javac" for methods without a "@concurrency" contract.
Possible values are "concurrent", "guarded" and "sequential".The default value is "concurrent".
See The Design by Contract Specification Language for more information about these values.
Note: This preference is not used for methods with empty bodies and get/set methods. Those methods are always assumed to have "concurrent" @concurrency if they don't have an explicit @concurrency tag.
Instrumentation.InstrumentThrowsConditions (Instrumentation tab> Instrument @throws Conditions)
Specifies if the "dbc_javac" compiler should generate code to check the "@throws" conditions in the class.
Possible values are "true" and "false". The default value is "true".
The value specified here can be overridden in the "dbc_javac" command by using the "-Z@assert (on|off)" flag.
Instrumentation.InstrumentAssertConditions (Instrumentation tab> Instrument @assert Conditions)
Specifies if the "dbc_javac" compiler should generate code to check the "@assert" conditions in the class.
Possible values are "true" and "false". The default value is "true".
The value specified here can be overridden in the "dbc_javac" command by using the "-Z@assert (on|off)" flag.
Instrumentation.InstrumentVerboseStatements (Instrumentation tab> Instrument @verbose Conditions)
Specifies if the "dbc_javac" compiler should generate code for the "@verbose" statements in the class.
Possible values are "true" and "false". The default value is "true".
The value specified here can be overridden in the "dbc_javac" command by using the "-Z@verbose (on|off)" flag.
Instrumentation.WriteLog (Instrumentation tab> Write Log File)
Specifies if a log file should be written by the Jcontract runtime.
Possible values are "true" and "false". The default value is "true".
The value specified here is ignored if the "dbc_javac" flag "-Zruntime_preference Instrumentation.WriteLog..." was used with "dbc_javac" to compile the first instrumented class loaded.
Instrumentation.LogFile (Instrumentation tab> Log File)
Specifies the path to the log file Jcontract writes.
The default value is "jcontract.log".
The value specified here is ignored if the flag "-Zruntime_preference Runtime.LogFile..." was used with "dbc_javac" to compile the first instrumented class loaded.
Instrumentation.TmpDirectory (Instrumentation tab> Temporary Directory)
Specifies the directory where Jcontract writes the temporary files generated by "dbc_javac".
The default value is "\Temp".
Instrumentation.RuntimeHandler (Instrumentation tab> Temporary Directory)
Specifies which Runtime Handler will be associated with the classes compiled with "dbc_javac".
The default value is "jcontract.MonitorRuntimeHandler".
The value specified here can be overridden in the "dbc_javac" command using "-Zruntime_handler {class_name}".
For more information about Runtime Handlers see Runtime Handlers.
Monitor Preferences
Monitor.Type (Monitor tab> Monitor Type)
Specifies the type of monitor Jcontract uses at runtime.
The possible values are "TEXT" or "GUI". The default is "GUI".
See Jcontract's Monitors for more information about the Jcontract monitors.
Monitor.GUI.Bounds: (Monitor tab> GUI Monitor Bounds)
Specifies the bounds of the Jcontract GUI Monitor.
This preference is updated automatically if the GUI monitor is moved or resized.
Monitor.TEXT.Output (Monitor tab> TEXT Monitor Output)
Specifies the path to the file that the TEXT monitor will write to.
The possible values are "stdout", "stderr" and a file system path. The default value is "stdout".
For "stdout" and "stderr", the monitor sends the output to the standard output and standard error (the console).
Editor Preferences (GUI Only)
Editor (Editor tab> Editor command)
Lets you specify which editor you want to Jcontract to invoke when you choose to edit files from the Jcontract GUI Monitor.
|