[Patch] When the order of the parameters is different, the behavior of jtdiff is different.

Ao Qi aoqi at loongson.cn
Thu Aug 30 12:36:38 UTC 2018


Hi all,

I do not know if some one uses jtdiff. When I use this tool, I think I
found a bug. When the order of the parameters is different, the
behavior is different.

$ jtdiff -s results/ -o tmp/
Error: Bad directory argument for "super" mode

$ jtdiff -o tmp/ -s results/
Differences found.

I found it is because when there are more then one args which start
with "-", jtdiff do not set inFiles = false. I made a small patch to
fix this. I did not test this patch very much.

diff -r fdfb9ee98733
src/share/classes/com/sun/javatest/regtest/tool/OptionDecoder.java
--- a/src/share/classes/com/sun/javatest/regtest/tool/OptionDecoder.java
Fri Aug 03 16:03:18 2018 -0700
+++ b/src/share/classes/com/sun/javatest/regtest/tool/OptionDecoder.java
Thu Aug 30 20:26:49 2018 +0800
@@ -81,6 +81,8 @@
                 throw new BadArgs(i18n, "opt.empty");
             if (!arg.startsWith("-"))
                 inFiles = true;
+            else
+                inFiles = false;
             if (inFiles) {
                 fileOption.process(null, arg);
             } else

In addition,

$ jtdiff -h
Compare Options

    --r | --reason  Include the reason string in the comparison, as well as the
                    type (i.e. Passed, Failed, etc.)
    --s | --super   Perform a "super-diff" looking for result sets within a
                    directory hierarchy. The hierarchy must be arranged as
                    follows: PATH/PLATFORM/YEAR/DAY_OF_YEAR/TEST_RESULTS, where
...

However, it should be "-s", not "--s".

Thanks,
Ao Qi


More information about the jtreg-dev mailing list