Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions doc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ Further documentation can be found in:
`make -C $DAIKONDIR/java javadoc`
It is also available at <http://plse.cs.washington.edu/daikon/download/api/> .

## Version 5.9.1 (???, 2026)

* Daikon and its tools now reject an unrecognized, ambiguous, or malformed
command-line option: they describe the problem and exit with a non-zero
status. Previously, Daikon printed its usage message and exited with
status 0, and most other tools ignored the bad option and continued.
* All tools accept `-h` and `--help`, which print a usage message and exit
with status 0.
* `daikon.diff.Diff` no longer accepts the `-u` and `-z` options, which had
no effect.

## Version 5.9.0 (September 1, 2026)

* All Daikon tools now work with Java 8-26.
Expand Down
6 changes: 3 additions & 3 deletions doc/daikon.texinfo
Original file line number Diff line number Diff line change
Expand Up @@ -6749,9 +6749,6 @@ invariants must be justified. Does not print ``uninteresting'' invariants
Display the tree of all invariants. Includes invariants that are the
same in @var{file1} and @var{file2}, and unjustified invariants.

@item -u
Include ``uninteresting'' invariants in the tree of differing invariants.

@item -y
@itemx --ignore_unjustified
Include (statistically) unjustified invariants.
Expand Down Expand Up @@ -7037,6 +7034,9 @@ java -cp $@{DAIKONDIR@}/daikon.jar daikon.AnnotateNullable @i{[@var{flags}]} @va
The flags are:
@table @option

@item -h --help
Print usage message.

@item -n --nonnull-annotations
Adds @samp{NonNull} annotations as well as @samp{Nullable} annotations. Unlike @samp{Nullable}
annotations, @samp{NonNull} annotations are not guaranteed to be correct.
Expand Down
2 changes: 1 addition & 1 deletion java/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ JAVADOC_COMMAND := ${JAVADOC} -cp ${DAIKON_CLASSPATH}
JAVAC_COMMAND := ${JAVAC} -cp ${DAIKON_CLASSPATH} -Xlint -J-Xmx7g ${JAVAC_ARGS}
JAVA_COMMAND := ${JAVA} -cp ${DAIKON_CLASSPATH}

DOCLETPATH := ${DAIKONDIR}/java:$(wildcard ${DAIKONDIR}/java/lib/bcel-util-*.jar):$(wildcard ${DAIKONDIR}/java/lib/plume-util-*.jar):$(wildcard ${DAIKONDIR}/java/lib/reflection-util-*.jar):$(wildcard ${DAIKONDIR}/java/lib/hashmap-util-*.jar):${DAIKONDIR}/java/lib/daikon-plumelib.jar
DOCLETPATH := ${DAIKONDIR}/java:$(wildcard ${DAIKONDIR}/java/lib/java-getopt-*.jar):$(wildcard ${DAIKONDIR}/java/lib/bcel-util-*.jar):$(wildcard ${DAIKONDIR}/java/lib/plume-util-*.jar):$(wildcard ${DAIKONDIR}/java/lib/reflection-util-*.jar):$(wildcard ${DAIKONDIR}/java/lib/hashmap-util-*.jar):${DAIKONDIR}/java/lib/daikon-plumelib.jar

DOCLET_FLAGS :=
LINKOFFLINE := https://docs.oracle.com/javase/8/docs/api/
Expand Down
16 changes: 14 additions & 2 deletions java/daikon/AnnotateNullable.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,24 @@ private AnnotateNullable() {
@Option("-n Insert NonNull as well as Nullable annotations")
public static boolean nonnull_annotations = false;

/** If true, print a usage message and exit. */
@Option("-h Display usage information")
public static boolean help = false;

public static void main(String[] args) throws IOException {

Options options =
new Options("plume.AnnotateNullable [options] <inv_file>", AnnotateNullable.class);
new Options("daikon.AnnotateNullable [options] <inv_file>", AnnotateNullable.class);
String[] inv_files = options.parse(true, args);
assert inv_files.length == 1;
if (help) {
options.printUsage();
System.exit(0);
}
if (inv_files.length != 1) {
System.err.println("must specify exactly one invariant file");
options.printUsage(System.err);
System.exit(1);
}

// Read the serialized invariant file
File inv_file = new File(inv_files[0]);
Expand Down
2 changes: 1 addition & 1 deletion java/daikon/Chicory.java
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public static void main(String[] args) {
public static void check_args(Options options, String[] target_args) {
if (help) {
options.printUsage();
System.exit(1);
System.exit(0);
}
if (nesting_depth < 0) {
System.out.printf("nesting depth (%d) must not be negative%n", nesting_depth);
Expand Down
18 changes: 3 additions & 15 deletions java/daikon/Daikon.java
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@ static FileOptions read_options(String[] args, String usage) {
LongOpt[] longopts =
new LongOpt[] {
// Control output
new LongOpt(help_SWITCH, LongOpt.NO_ARGUMENT, null, 0),
new LongOpt(no_text_output_SWITCH, LongOpt.NO_ARGUMENT, null, 0),
new LongOpt(format_SWITCH, LongOpt.REQUIRED_ARGUMENT, null, 0),
new LongOpt(show_progress_SWITCH, LongOpt.NO_ARGUMENT, null, 0),
Expand Down Expand Up @@ -1055,7 +1054,7 @@ static FileOptions read_options(String[] args, String usage) {
new LongOpt(disc_reason_SWITCH, LongOpt.REQUIRED_ARGUMENT, null, 0),
new LongOpt(mem_stat_SWITCH, LongOpt.NO_ARGUMENT, null, 0),
};
Getopt g = new Getopt("daikon.Daikon", args, "ho:", longopts);
DaikonGetopt g = new DaikonGetopt(args, "o:", longopts, usage);
int c;

while ((c = g.getopt()) != -1) {
Expand All @@ -1065,10 +1064,7 @@ static FileOptions read_options(String[] args, String usage) {
String option_name = longopts[g.getLongind()].getName();

// Control output
if (help_SWITCH.equals(option_name)) {
System.out.println(usage);
throw new Daikon.NormalTermination();
} else if (no_text_output_SWITCH.equals(option_name)) {
if (no_text_output_SWITCH.equals(option_name)) {
no_text_output = true;
} else if (format_SWITCH.equals(option_name)) {
String format_name = getOptarg(g);
Expand Down Expand Up @@ -1367,12 +1363,9 @@ else if (ppt_regexp_SWITCH.equals(option_name)) {
} else if (mem_stat_SWITCH.equals(option_name)) {
use_mem_monitor = true;
} else {
throw new Daikon.UserError("Unknown option " + option_name + " on command line");
throw new Daikon.BugInDaikon("Unhandled long option " + option_name);
}
break;
case 'h':
System.out.println(usage);
throw new Daikon.NormalTermination();
case 'o':
String inv_filename = getOptarg(g);

Expand All @@ -1391,11 +1384,6 @@ else if (ppt_regexp_SWITCH.equals(option_name)) {
}
break;
//
case '?':
// break; // getopt() already printed an error
System.out.println(usage);
throw new Daikon.NormalTermination();
//
default:
throw new Daikon.BugInDaikon("getopt() returned " + c);
}
Expand Down
Loading
Loading