Skip to content

Commit 98d19c8

Browse files
author
Matthias Güdemann
committed
Documentation for class_loader_limit
1 parent 78d22fb commit 98d19c8

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

jbmc/src/java_bytecode/java_class_loader_limit.cpp

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,35 @@ Author: Daniel Kroening, [email protected]
1313

1414
#include <json/json_parser.h>
1515

16-
/// initializes class with either regex matcher or match set
17-
/// \par parameters: parameter from `java-cp-include-files`
16+
/// Initializes class with either regex matcher or match set. The regex match
17+
/// described which class files should be loaded in the form of a regular
18+
/// expression used with `regex_match`.
19+
///
20+
/// The match set is a list of files to load in JSON format, the argument is the
21+
/// name of the JSON file, prefixed with `@`. The file contains one section to
22+
/// list the .jar files to load and one section to list the .class files to load
23+
/// from the .jar.
24+
///
25+
/// for example a file called `load.json` with the following content:
26+
/// {
27+
/// "jar":
28+
/// [
29+
/// "A.jar",
30+
/// "B.jar"
31+
/// ],
32+
/// "classFiles":
33+
/// [
34+
/// "jarfile3$A.class",
35+
/// "jarfile3.class"
36+
/// ]
37+
/// }
38+
/// would be specified via `--java-cp-include-files @load.json` and would
39+
/// instruct the driver to load `A.jar` and `B.jar` and the two .class files
40+
/// `jarfile3$A.class` and `jarfile3.class`. All the rest of the .jar files is
41+
/// ignored.
42+
///
43+
/// \param java_cp_include_files: parameter from `java-cp-include-files` in the
44+
/// format as described above
1845
void java_class_loader_limitt::setup_class_load_limit(
1946
const std::string &java_cp_include_files)
2047
{
@@ -51,7 +78,9 @@ void java_class_loader_limitt::setup_class_load_limit(
5178
}
5279
}
5380

54-
/// \par parameters: class file name
81+
/// Use the class load limiter to decide whether a class file should be loaded
82+
/// or not.
83+
/// \param file_name: the name of the class file to load
5584
/// \return true if file should be loaded, else false
5685
bool java_class_loader_limitt::load_class_file(const std::string &file_name)
5786
{

jbmc/src/java_bytecode/java_class_loader_limit.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Author: Daniel Kroening, [email protected]
1818
#include <util/irep.h>
1919
#include <util/message.h>
2020

21+
/// Class representing a filter for class file loading.
2122
class java_class_loader_limitt:public messaget
2223
{
2324
/// Whether to use regex_matcher instead of set_matcher

0 commit comments

Comments
 (0)