diff --git a/regression/goto-diff/java-add-package/new.jar b/regression/goto-diff/java-add-package/new.jar new file mode 100644 index 00000000000..4076afdca54 Binary files /dev/null and b/regression/goto-diff/java-add-package/new.jar differ diff --git a/regression/goto-diff/java-add-package/new/Test.java b/regression/goto-diff/java-add-package/new/Test.java new file mode 100644 index 00000000000..fb2b278c830 --- /dev/null +++ b/regression/goto-diff/java-add-package/new/Test.java @@ -0,0 +1,20 @@ +package foo; + +public class Test { + public int foo(int x) { + if (x > 10) { + return x; + } else { + int y = x * 10; + return y; + } + } + + public int bar(int x) { + if (x < 10) { + return x; + } else { + return x / 10; + } + } +} diff --git a/regression/goto-diff/java-add-package/old.jar b/regression/goto-diff/java-add-package/old.jar new file mode 100644 index 00000000000..6779e5abd54 Binary files /dev/null and b/regression/goto-diff/java-add-package/old.jar differ diff --git a/regression/goto-diff/java-add-package/old/Test.java b/regression/goto-diff/java-add-package/old/Test.java new file mode 100644 index 00000000000..4bba83c5011 --- /dev/null +++ b/regression/goto-diff/java-add-package/old/Test.java @@ -0,0 +1,18 @@ +public class Test { + + public int foo(int x) { + if (x > 10) { + return x; + } else { + return x * 10; + } + } + + public int bar(int x) { + if (x < 10) { + return x; + } else { + return x / 10; + } + } +} diff --git a/regression/goto-diff/java-add-package/test.desc b/regression/goto-diff/java-add-package/test.desc new file mode 100644 index 00000000000..c071e7d6f7f --- /dev/null +++ b/regression/goto-diff/java-add-package/test.desc @@ -0,0 +1,12 @@ +CORE +new.jar +old.jar --json-ui +// Enable multi-line checking +activate-multi-line-match +EXIT=0 +SIGNAL=0 + "deletedFunctions": \[\n {\n "name": "java::Test\.:\(\)V",\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test\.:\(\)\V",\n "line": "1"\n }\n },\n {\n "name": "java::Test\.foo:\(I\)I",\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test\.foo:\(I\)I",\n "line": "4"\n }\n },\n {\n "name": "java::Test\.bar:\(I\)I",\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test.bar:\(I\)I",\n "line": "12"\n }\n }\n \],\n + "modifiedFunctions": \[ \], + "newFunctions": \[\n {\n "name": "java::foo\.Test\.:\(\)V",\n "sourceLocation": {\n "file": "foo/Test\.java",\n "function": "java::foo\.Test\.:\(\)V",\n "line": "3"\n }\n },\n {\n "name": "java::foo\.Test\.foo:\(I\)I",\n "sourceLocation": {\n "file": "foo/Test\.java",\n "function": "java::foo\.Test\.foo:\(I\)I",\n "line": "5"\n }\n },\n {\n "name": "java::foo\.Test\.bar:\(I\)I",\n "sourceLocation": {\n "file": "foo/Test\.java",\n "function": "java::foo\.Test\.bar:\(I\)I",\n "line": "14"\n }\n }\n \], +-- +^warning: ignoring diff --git a/regression/goto-diff/java-del-package/new.jar b/regression/goto-diff/java-del-package/new.jar new file mode 100644 index 00000000000..6779e5abd54 Binary files /dev/null and b/regression/goto-diff/java-del-package/new.jar differ diff --git a/regression/goto-diff/java-del-package/new/Test.java b/regression/goto-diff/java-del-package/new/Test.java new file mode 100644 index 00000000000..4bba83c5011 --- /dev/null +++ b/regression/goto-diff/java-del-package/new/Test.java @@ -0,0 +1,18 @@ +public class Test { + + public int foo(int x) { + if (x > 10) { + return x; + } else { + return x * 10; + } + } + + public int bar(int x) { + if (x < 10) { + return x; + } else { + return x / 10; + } + } +} diff --git a/regression/goto-diff/java-del-package/old.jar b/regression/goto-diff/java-del-package/old.jar new file mode 100644 index 00000000000..4076afdca54 Binary files /dev/null and b/regression/goto-diff/java-del-package/old.jar differ diff --git a/regression/goto-diff/java-del-package/old/Test.java b/regression/goto-diff/java-del-package/old/Test.java new file mode 100644 index 00000000000..fb2b278c830 --- /dev/null +++ b/regression/goto-diff/java-del-package/old/Test.java @@ -0,0 +1,20 @@ +package foo; + +public class Test { + public int foo(int x) { + if (x > 10) { + return x; + } else { + int y = x * 10; + return y; + } + } + + public int bar(int x) { + if (x < 10) { + return x; + } else { + return x / 10; + } + } +} diff --git a/regression/goto-diff/java-del-package/test.desc b/regression/goto-diff/java-del-package/test.desc new file mode 100644 index 00000000000..58e64919d9e --- /dev/null +++ b/regression/goto-diff/java-del-package/test.desc @@ -0,0 +1,12 @@ +CORE +new.jar +old.jar --json-ui +// Enable multi-line checking +activate-multi-line-match +EXIT=0 +SIGNAL=0 + "deletedFunctions": \[\n {\n "name": "java::foo\.Test\.:\(\)V",\n "sourceLocation": {\n "file": "foo/Test\.java",\n "function": "java::foo\.Test\.:\(\)V",\n "line": "3"\n }\n },\n {\n "name": "java::foo\.Test\.foo:\(I\)I",\n "sourceLocation": {\n "file": "foo/Test\.java",\n "function": "java::foo\.Test\.foo:\(I\)I",\n "line": "5"\n }\n },\n {\n "name": "java::foo\.Test\.bar:\(I\)I",\n "sourceLocation": {\n "file": "foo/Test\.java",\n "function": "java::foo\.Test\.bar:\(I\)I",\n "line": "14"\n }\n }\n \], + "modifiedFunctions": \[ \], + "newFunctions": \[\n {\n "name": "java::Test\.:\(\)V",\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test\.:\(\)\V",\n "line": "1"\n }\n },\n {\n "name": "java::Test\.foo:\(I\)I",\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test\.foo:\(I\)I",\n "line": "4"\n }\n },\n {\n "name": "java::Test\.bar:\(I\)I",\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test.bar:\(I\)I",\n "line": "12"\n }\n }\n \],\n +-- +^warning: ignoring diff --git a/regression/goto-diff/java-deleted-function/new.jar b/regression/goto-diff/java-deleted-function/new.jar new file mode 100644 index 00000000000..8a4eae1df51 Binary files /dev/null and b/regression/goto-diff/java-deleted-function/new.jar differ diff --git a/regression/goto-diff/java-deleted-function/new/Test.java b/regression/goto-diff/java-deleted-function/new/Test.java new file mode 100644 index 00000000000..07f8cb93d76 --- /dev/null +++ b/regression/goto-diff/java-deleted-function/new/Test.java @@ -0,0 +1,10 @@ +public class Test { + + public int bar(int x) { + if (x < 10) { + return x; + } else { + return x / 10; + } + } +} diff --git a/regression/goto-diff/java-deleted-function/old.jar b/regression/goto-diff/java-deleted-function/old.jar new file mode 100644 index 00000000000..1ab7d37184f Binary files /dev/null and b/regression/goto-diff/java-deleted-function/old.jar differ diff --git a/regression/goto-diff/java-deleted-function/old/Test.java b/regression/goto-diff/java-deleted-function/old/Test.java new file mode 100644 index 00000000000..4bba83c5011 --- /dev/null +++ b/regression/goto-diff/java-deleted-function/old/Test.java @@ -0,0 +1,18 @@ +public class Test { + + public int foo(int x) { + if (x > 10) { + return x; + } else { + return x * 10; + } + } + + public int bar(int x) { + if (x < 10) { + return x; + } else { + return x / 10; + } + } +} diff --git a/regression/goto-diff/java-deleted-function/test.desc b/regression/goto-diff/java-deleted-function/test.desc new file mode 100644 index 00000000000..d60285d0bd4 --- /dev/null +++ b/regression/goto-diff/java-deleted-function/test.desc @@ -0,0 +1,12 @@ +CORE +new.jar +old.jar --json-ui +// Enable multi-line checking +activate-multi-line-match +EXIT=0 +SIGNAL=0 + "deletedFunctions": \[\n {\n "name": "java::Test\.foo:\(I\)I",\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test\.foo:\(I\)I",\n "line": "4"\n }\n }\n \], + "modifiedFunctions": \[ \], + "newFunctions": \[ \], +-- +^warning: ignoring diff --git a/regression/goto-diff/java-mod-comment/new.jar b/regression/goto-diff/java-mod-comment/new.jar new file mode 100644 index 00000000000..073ba0aef67 Binary files /dev/null and b/regression/goto-diff/java-mod-comment/new.jar differ diff --git a/regression/goto-diff/java-mod-comment/new/Test.java b/regression/goto-diff/java-mod-comment/new/Test.java new file mode 100644 index 00000000000..b89b78f2ab6 --- /dev/null +++ b/regression/goto-diff/java-mod-comment/new/Test.java @@ -0,0 +1,18 @@ +public class Test { + public int foo(int x) { + // This is a new comment + if (x > 10) { + return x; + } else { + return x * 10; + } + } + + public int bar(int x) { + if (x < 10) { + return x; + } else { + return x / 10; + } + } +} diff --git a/regression/goto-diff/java-mod-comment/old.jar b/regression/goto-diff/java-mod-comment/old.jar new file mode 100644 index 00000000000..6779e5abd54 Binary files /dev/null and b/regression/goto-diff/java-mod-comment/old.jar differ diff --git a/regression/goto-diff/java-mod-comment/old/Test.java b/regression/goto-diff/java-mod-comment/old/Test.java new file mode 100644 index 00000000000..4bba83c5011 --- /dev/null +++ b/regression/goto-diff/java-mod-comment/old/Test.java @@ -0,0 +1,18 @@ +public class Test { + + public int foo(int x) { + if (x > 10) { + return x; + } else { + return x * 10; + } + } + + public int bar(int x) { + if (x < 10) { + return x; + } else { + return x / 10; + } + } +} diff --git a/regression/goto-diff/java-mod-comment/test.desc b/regression/goto-diff/java-mod-comment/test.desc new file mode 100644 index 00000000000..3a4cbfe0bc7 --- /dev/null +++ b/regression/goto-diff/java-mod-comment/test.desc @@ -0,0 +1,12 @@ +CORE +new.jar +old.jar --json-ui +// Enable multi-line checking +activate-multi-line-match +EXIT=0 +SIGNAL=0 + "deletedFunctions": \[ \], + "modifiedFunctions": \[ \], + "newFunctions": \[ \], +-- +^warning: ignoring diff --git a/regression/goto-diff/java-mod-identifier/new.jar b/regression/goto-diff/java-mod-identifier/new.jar new file mode 100644 index 00000000000..1162996bdd7 Binary files /dev/null and b/regression/goto-diff/java-mod-identifier/new.jar differ diff --git a/regression/goto-diff/java-mod-identifier/new/Test.java b/regression/goto-diff/java-mod-identifier/new/Test.java new file mode 100644 index 00000000000..4dcd9e65935 --- /dev/null +++ b/regression/goto-diff/java-mod-identifier/new/Test.java @@ -0,0 +1,18 @@ +public class Test { + public int foo(int y) { + // This is a new comment + if (y > 10) { + return y; + } else { + return y * 10; + } + } + + public int bar(int x) { + if (x < 10) { + return x; + } else { + return x / 10; + } + } +} diff --git a/regression/goto-diff/java-mod-identifier/old.jar b/regression/goto-diff/java-mod-identifier/old.jar new file mode 100644 index 00000000000..6779e5abd54 Binary files /dev/null and b/regression/goto-diff/java-mod-identifier/old.jar differ diff --git a/regression/goto-diff/java-mod-identifier/old/Test.java b/regression/goto-diff/java-mod-identifier/old/Test.java new file mode 100644 index 00000000000..4bba83c5011 --- /dev/null +++ b/regression/goto-diff/java-mod-identifier/old/Test.java @@ -0,0 +1,18 @@ +public class Test { + + public int foo(int x) { + if (x > 10) { + return x; + } else { + return x * 10; + } + } + + public int bar(int x) { + if (x < 10) { + return x; + } else { + return x / 10; + } + } +} diff --git a/regression/goto-diff/java-mod-identifier/test.desc b/regression/goto-diff/java-mod-identifier/test.desc new file mode 100644 index 00000000000..3a4cbfe0bc7 --- /dev/null +++ b/regression/goto-diff/java-mod-identifier/test.desc @@ -0,0 +1,12 @@ +CORE +new.jar +old.jar --json-ui +// Enable multi-line checking +activate-multi-line-match +EXIT=0 +SIGNAL=0 + "deletedFunctions": \[ \], + "modifiedFunctions": \[ \], + "newFunctions": \[ \], +-- +^warning: ignoring diff --git a/regression/goto-diff/java-mod-identifier2/new.jar b/regression/goto-diff/java-mod-identifier2/new.jar new file mode 100644 index 00000000000..7d412159813 Binary files /dev/null and b/regression/goto-diff/java-mod-identifier2/new.jar differ diff --git a/regression/goto-diff/java-mod-identifier2/new/Test.java b/regression/goto-diff/java-mod-identifier2/new/Test.java new file mode 100644 index 00000000000..db6e61e7fb4 --- /dev/null +++ b/regression/goto-diff/java-mod-identifier2/new/Test.java @@ -0,0 +1,18 @@ +public class Test { + + public int foo(int x, int y) { + if (x > 10) { + return x; + } else { + return y * 10; + } + } + + public int bar(int x) { + if (x < 10) { + return x; + } else { + return x / 10; + } + } +} diff --git a/regression/goto-diff/java-mod-identifier2/old.jar b/regression/goto-diff/java-mod-identifier2/old.jar new file mode 100644 index 00000000000..9eae3094009 Binary files /dev/null and b/regression/goto-diff/java-mod-identifier2/old.jar differ diff --git a/regression/goto-diff/java-mod-identifier2/old/Test.java b/regression/goto-diff/java-mod-identifier2/old/Test.java new file mode 100644 index 00000000000..f942f3612ee --- /dev/null +++ b/regression/goto-diff/java-mod-identifier2/old/Test.java @@ -0,0 +1,18 @@ +public class Test { + + public int foo(int x, int y) { + if (x > 10) { + return x; + } else { + return x * 10; + } + } + + public int bar(int x) { + if (x < 10) { + return x; + } else { + return x / 10; + } + } +} diff --git a/regression/goto-diff/java-mod-identifier2/test.desc b/regression/goto-diff/java-mod-identifier2/test.desc new file mode 100644 index 00000000000..7a5fdf9e9cb --- /dev/null +++ b/regression/goto-diff/java-mod-identifier2/test.desc @@ -0,0 +1,12 @@ +CORE +new.jar +old.jar --json-ui +// Enable multi-line checking +activate-multi-line-match +EXIT=0 +SIGNAL=0 + "deletedFunctions": \[ \], + "modifiedFunctions": \[\n {\n "name": "java::Test\.foo:\(II\)I",\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test\.foo:\(II\)I",\n "line": "4"\n }\n }\n \],\n + "newFunctions": \[ \], +-- +^warning: ignoring diff --git a/regression/goto-diff/java-mod-package/new.jar b/regression/goto-diff/java-mod-package/new.jar new file mode 100644 index 00000000000..313ed480eb3 Binary files /dev/null and b/regression/goto-diff/java-mod-package/new.jar differ diff --git a/regression/goto-diff/java-mod-package/new/Test.java b/regression/goto-diff/java-mod-package/new/Test.java new file mode 100644 index 00000000000..480b1e2253c --- /dev/null +++ b/regression/goto-diff/java-mod-package/new/Test.java @@ -0,0 +1,20 @@ +package com.diffblue.foo; + +public class Test { + + public int foo(int x) { + if (x > 10) { + return x; + } else { + return x * 10; + } + } + + public int bar(int x) { + if (x < 10) { + return x; + } else { + return x / 10; + } + } +} diff --git a/regression/goto-diff/java-mod-package/old.jar b/regression/goto-diff/java-mod-package/old.jar new file mode 100644 index 00000000000..4076afdca54 Binary files /dev/null and b/regression/goto-diff/java-mod-package/old.jar differ diff --git a/regression/goto-diff/java-mod-package/old/Test.java b/regression/goto-diff/java-mod-package/old/Test.java new file mode 100644 index 00000000000..fb2b278c830 --- /dev/null +++ b/regression/goto-diff/java-mod-package/old/Test.java @@ -0,0 +1,20 @@ +package foo; + +public class Test { + public int foo(int x) { + if (x > 10) { + return x; + } else { + int y = x * 10; + return y; + } + } + + public int bar(int x) { + if (x < 10) { + return x; + } else { + return x / 10; + } + } +} diff --git a/regression/goto-diff/java-mod-package/test.desc b/regression/goto-diff/java-mod-package/test.desc new file mode 100644 index 00000000000..134f6482d2c --- /dev/null +++ b/regression/goto-diff/java-mod-package/test.desc @@ -0,0 +1,12 @@ +CORE +new.jar +old.jar --json-ui +// Enable multi-line checking +activate-multi-line-match +EXIT=0 +SIGNAL=0 + "deletedFunctions": \[\n {\n "name": "java::foo\.Test\.:\(\)V",\n "sourceLocation": {\n "file": "foo/Test\.java",\n "function": "java::foo\.Test\.:\(\)V",\n "line": "3"\n }\n },\n {\n "name": "java::foo\.Test\.foo:\(I\)I",\n "sourceLocation": {\n "file": "foo/Test\.java",\n "function": "java::foo\.Test\.foo:\(I\)I",\n "line": "5"\n }\n },\n {\n "name": "java::foo\.Test\.bar:\(I\)I",\n "sourceLocation": {\n "file": "foo/Test\.java",\n "function": "java::foo\.Test\.bar:\(I\)I",\n "line": "14"\n }\n }\n \], + "modifiedFunctions": \[ \], + "newFunctions": \[\n {\n "name": "java::com\.diffblue\.foo\.Test\.:\(\)V",\n "sourceLocation": {\n "file": "com/diffblue/foo/Test\.java",\n "function": "java::com\.diffblue\.foo\.Test\.:\(\)\V",\n "line": "3"\n }\n },\n {\n "name": "java::com\.diffblue\.foo\.Test\.foo:\(I\)I",\n "sourceLocation": {\n "file": "com/diffblue/foo/Test\.java",\n "function": "java::com\.diffblue\.foo\.Test\.foo:\(I\)I",\n "line": "6"\n }\n },\n {\n "name": "java::com\.diffblue\.foo\.Test\.bar:\(I\)I",\n "sourceLocation": {\n "file": "com/diffblue/foo/Test\.java",\n "function": "java::com\.diffblue\.foo\.Test.bar:\(I\)I",\n "line": "14"\n }\n }\n \],\n +-- +^warning: ignoring diff --git a/regression/goto-diff/java-new-function/new.jar b/regression/goto-diff/java-new-function/new.jar new file mode 100644 index 00000000000..f6e0424e94c Binary files /dev/null and b/regression/goto-diff/java-new-function/new.jar differ diff --git a/regression/goto-diff/java-new-function/new/Test.java b/regression/goto-diff/java-new-function/new/Test.java new file mode 100644 index 00000000000..14572d32b29 --- /dev/null +++ b/regression/goto-diff/java-new-function/new/Test.java @@ -0,0 +1,26 @@ +public class Test { + + public int foo(int x, int y) { + if (x > 10) { + return x; + } else { + return x * y; + } + } + + public int foo(int x) { + if (x > 10) { + return x; + } else { + return x * 10; + } + } + + public int bar(int x) { + if (x < 10) { + return x; + } else { + return x / 10; + } + } +} diff --git a/regression/goto-diff/java-new-function/old.jar b/regression/goto-diff/java-new-function/old.jar new file mode 100644 index 00000000000..6779e5abd54 Binary files /dev/null and b/regression/goto-diff/java-new-function/old.jar differ diff --git a/regression/goto-diff/java-new-function/old/Test.java b/regression/goto-diff/java-new-function/old/Test.java new file mode 100644 index 00000000000..4bba83c5011 --- /dev/null +++ b/regression/goto-diff/java-new-function/old/Test.java @@ -0,0 +1,18 @@ +public class Test { + + public int foo(int x) { + if (x > 10) { + return x; + } else { + return x * 10; + } + } + + public int bar(int x) { + if (x < 10) { + return x; + } else { + return x / 10; + } + } +} diff --git a/regression/goto-diff/java-new-function/test.desc b/regression/goto-diff/java-new-function/test.desc new file mode 100644 index 00000000000..ac2fc73a3f6 --- /dev/null +++ b/regression/goto-diff/java-new-function/test.desc @@ -0,0 +1,12 @@ +CORE +new.jar +old.jar --json-ui +// Enable multi-line checking +activate-multi-line-match +EXIT=0 +SIGNAL=0 + "deletedFunctions": \[ \], + "modifiedFunctions": \[ \], + "newFunctions": \[\n {\n "name": "java::Test\.foo:\(II\)I",\n "sourceLocation": {\n "file": "Test.java",\n "function": "java::Test\.foo:\(II\)I",\n "line": "4"\n }\n }\n \], +-- +^warning: ignoring diff --git a/regression/goto-diff/java-no-change/new.jar b/regression/goto-diff/java-no-change/new.jar new file mode 100644 index 00000000000..b4212921ff8 Binary files /dev/null and b/regression/goto-diff/java-no-change/new.jar differ diff --git a/regression/goto-diff/java-no-change/new/Test.java b/regression/goto-diff/java-no-change/new/Test.java new file mode 100644 index 00000000000..c9a99f3ec43 --- /dev/null +++ b/regression/goto-diff/java-no-change/new/Test.java @@ -0,0 +1,18 @@ +public class Test { + + private int foo(int x) { + if (x > 10) { + return x; + } else { + return x * 10; + } + } + + protected int bar(int x) { + if (x < 10) { + return x; + } else { + return x / 10; + } + } +} diff --git a/regression/goto-diff/java-no-change/old.jar b/regression/goto-diff/java-no-change/old.jar new file mode 100644 index 00000000000..6779e5abd54 Binary files /dev/null and b/regression/goto-diff/java-no-change/old.jar differ diff --git a/regression/goto-diff/java-no-change/old/Test.java b/regression/goto-diff/java-no-change/old/Test.java new file mode 100644 index 00000000000..4bba83c5011 --- /dev/null +++ b/regression/goto-diff/java-no-change/old/Test.java @@ -0,0 +1,18 @@ +public class Test { + + public int foo(int x) { + if (x > 10) { + return x; + } else { + return x * 10; + } + } + + public int bar(int x) { + if (x < 10) { + return x; + } else { + return x / 10; + } + } +} diff --git a/regression/goto-diff/java-no-change/test.desc b/regression/goto-diff/java-no-change/test.desc new file mode 100644 index 00000000000..3a4cbfe0bc7 --- /dev/null +++ b/regression/goto-diff/java-no-change/test.desc @@ -0,0 +1,12 @@ +CORE +new.jar +old.jar --json-ui +// Enable multi-line checking +activate-multi-line-match +EXIT=0 +SIGNAL=0 + "deletedFunctions": \[ \], + "modifiedFunctions": \[ \], + "newFunctions": \[ \], +-- +^warning: ignoring diff --git a/regression/goto-diff/java-scope-change/new.jar b/regression/goto-diff/java-scope-change/new.jar new file mode 100644 index 00000000000..b9661c2be16 Binary files /dev/null and b/regression/goto-diff/java-scope-change/new.jar differ diff --git a/regression/goto-diff/java-scope-change/new/Test.java b/regression/goto-diff/java-scope-change/new/Test.java new file mode 100644 index 00000000000..c9a99f3ec43 --- /dev/null +++ b/regression/goto-diff/java-scope-change/new/Test.java @@ -0,0 +1,18 @@ +public class Test { + + private int foo(int x) { + if (x > 10) { + return x; + } else { + return x * 10; + } + } + + protected int bar(int x) { + if (x < 10) { + return x; + } else { + return x / 10; + } + } +} diff --git a/regression/goto-diff/java-scope-change/old.jar b/regression/goto-diff/java-scope-change/old.jar new file mode 100644 index 00000000000..6779e5abd54 Binary files /dev/null and b/regression/goto-diff/java-scope-change/old.jar differ diff --git a/regression/goto-diff/java-scope-change/old/Test.java b/regression/goto-diff/java-scope-change/old/Test.java new file mode 100644 index 00000000000..4bba83c5011 --- /dev/null +++ b/regression/goto-diff/java-scope-change/old/Test.java @@ -0,0 +1,18 @@ +public class Test { + + public int foo(int x) { + if (x > 10) { + return x; + } else { + return x * 10; + } + } + + public int bar(int x) { + if (x < 10) { + return x; + } else { + return x / 10; + } + } +} diff --git a/regression/goto-diff/java-scope-change/test.desc b/regression/goto-diff/java-scope-change/test.desc new file mode 100644 index 00000000000..cfe9d962b83 --- /dev/null +++ b/regression/goto-diff/java-scope-change/test.desc @@ -0,0 +1,11 @@ +CORE +new.jar +old.jar --json-ui +// Enable multi-line checking +activate-multi-line-match +EXIT=0 +SIGNAL=0 + "deletedFunctions": \[ \],\n "modifiedFunctions": \[\n {\n "name": "java::Test\.foo:\(I\)I",\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test\.foo:\(I\)I",\n "line": "4"\n }\n },\n {\n "name": "java::Test\.bar:\(I\)I",\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test\.bar:\(I\)I",\n "line": "12"\n }\n }\n \],\n "newFunctions": \[ \], +-- +^warning: ignoring +-- diff --git a/regression/goto-diff/java-scope-change2/new.jar b/regression/goto-diff/java-scope-change2/new.jar new file mode 100644 index 00000000000..231eccfd049 Binary files /dev/null and b/regression/goto-diff/java-scope-change2/new.jar differ diff --git a/regression/goto-diff/java-scope-change2/new/Test.java b/regression/goto-diff/java-scope-change2/new/Test.java new file mode 100644 index 00000000000..2224243f158 --- /dev/null +++ b/regression/goto-diff/java-scope-change2/new/Test.java @@ -0,0 +1,20 @@ +public class Test { + + private int y = 5; + + public int foo(int x) { + if (x > 10 && y > 5) { + return y; + } else { + return y * 10; + } + } + + public int bar(int x) { + if (x < 10) { + return x; + } else { + return x / 10; + } + } +} diff --git a/regression/goto-diff/java-scope-change2/old.jar b/regression/goto-diff/java-scope-change2/old.jar new file mode 100644 index 00000000000..80caa8915a3 Binary files /dev/null and b/regression/goto-diff/java-scope-change2/old.jar differ diff --git a/regression/goto-diff/java-scope-change2/old/Test.java b/regression/goto-diff/java-scope-change2/old/Test.java new file mode 100644 index 00000000000..319613627d3 --- /dev/null +++ b/regression/goto-diff/java-scope-change2/old/Test.java @@ -0,0 +1,20 @@ +public class Test { + + public int y = 5; + + public int foo(int x) { + if (x > 10 && y > 5) { + return y; + } else { + return y * 10; + } + } + + public int bar(int x) { + if (x < 10) { + return x; + } else { + return x / 10; + } + } +} diff --git a/regression/goto-diff/java-scope-change2/test.desc b/regression/goto-diff/java-scope-change2/test.desc new file mode 100644 index 00000000000..cc58141505e --- /dev/null +++ b/regression/goto-diff/java-scope-change2/test.desc @@ -0,0 +1,11 @@ +CORE +new.jar +old.jar --json-ui +// Enable multi-line checking +activate-multi-line-match +EXIT=0 +SIGNAL=0 + "deletedFunctions": \[ \],\n "modifiedFunctions": \[\n {\n "name": "java::Test\.:\(\)V",\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test\.:\(\)V",\n "line": "1"\n }\n },\n {\n "name": "java::Test\.foo:\(I\)I",\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test\.foo:\(I\)I",\n "line": "6"\n }\n },\n {\n "name": "java::Test\.bar:\(I\)I",\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test\.bar:\(I\)I",\n "line": "14"\n }\n }\n \],\n "newFunctions": \[ \], +-- +^warning: ignoring +-- diff --git a/regression/goto-diff/java-scope-change3/new.jar b/regression/goto-diff/java-scope-change3/new.jar new file mode 100644 index 00000000000..8f3148c0491 Binary files /dev/null and b/regression/goto-diff/java-scope-change3/new.jar differ diff --git a/regression/goto-diff/java-scope-change3/new/Test.java b/regression/goto-diff/java-scope-change3/new/Test.java new file mode 100644 index 00000000000..9cfabf3825d --- /dev/null +++ b/regression/goto-diff/java-scope-change3/new/Test.java @@ -0,0 +1,20 @@ +class Test { + + public int y = 5; + + public int foo(int x) { + if (x > 10 && y > 5) { + return y; + } else { + return y * 10; + } + } + + public int bar(int x) { + if (x < 10) { + return x; + } else { + return x / 10; + } + } +} diff --git a/regression/goto-diff/java-scope-change3/old.jar b/regression/goto-diff/java-scope-change3/old.jar new file mode 100644 index 00000000000..80caa8915a3 Binary files /dev/null and b/regression/goto-diff/java-scope-change3/old.jar differ diff --git a/regression/goto-diff/java-scope-change3/old/Test.java b/regression/goto-diff/java-scope-change3/old/Test.java new file mode 100644 index 00000000000..319613627d3 --- /dev/null +++ b/regression/goto-diff/java-scope-change3/old/Test.java @@ -0,0 +1,20 @@ +public class Test { + + public int y = 5; + + public int foo(int x) { + if (x > 10 && y > 5) { + return y; + } else { + return y * 10; + } + } + + public int bar(int x) { + if (x < 10) { + return x; + } else { + return x / 10; + } + } +} diff --git a/regression/goto-diff/java-scope-change3/test.desc b/regression/goto-diff/java-scope-change3/test.desc new file mode 100644 index 00000000000..cc58141505e --- /dev/null +++ b/regression/goto-diff/java-scope-change3/test.desc @@ -0,0 +1,11 @@ +CORE +new.jar +old.jar --json-ui +// Enable multi-line checking +activate-multi-line-match +EXIT=0 +SIGNAL=0 + "deletedFunctions": \[ \],\n "modifiedFunctions": \[\n {\n "name": "java::Test\.:\(\)V",\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test\.:\(\)V",\n "line": "1"\n }\n },\n {\n "name": "java::Test\.foo:\(I\)I",\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test\.foo:\(I\)I",\n "line": "6"\n }\n },\n {\n "name": "java::Test\.bar:\(I\)I",\n "sourceLocation": {\n "file": "Test\.java",\n "function": "java::Test\.bar:\(I\)I",\n "line": "14"\n }\n }\n \],\n "newFunctions": \[ \], +-- +^warning: ignoring +-- diff --git a/src/goto-diff/syntactic_diff.cpp b/src/goto-diff/syntactic_diff.cpp index 68b7379b688..83f4ef04a78 100644 --- a/src/goto-diff/syntactic_diff.cpp +++ b/src/goto-diff/syntactic_diff.cpp @@ -27,6 +27,46 @@ bool syntactic_difft::operator()() continue; } + // check access qualifiers + const symbolt *fun1 = goto_model1.symbol_table.lookup(it->first); + CHECK_RETURN(fun1 != nullptr); + const symbolt *fun2 = goto_model2.symbol_table.lookup(it->first); + CHECK_RETURN(fun2 != nullptr); + const irep_idt &class_name = fun1->type.get(ID_C_class); + bool function_access_changed = + fun1->type.get(ID_access) != fun2->type.get(ID_access); + bool class_access_changed = false; + bool field_access_changed = false; + if(!class_name.empty()) + { + const symbolt *class1 = goto_model1.symbol_table.lookup(class_name); + CHECK_RETURN(class1 != nullptr); + const symbolt *class2 = goto_model2.symbol_table.lookup(class_name); + CHECK_RETURN(class2 != nullptr); + class_access_changed = + class1->type.get(ID_access) != class2->type.get(ID_access); + const class_typet &class_type1 = to_class_type(class1->type); + const class_typet &class_type2 = to_class_type(class2->type); + for(const auto &field1 : class_type1.components()) + { + for(const auto &field2 : class_type2.components()) + { + if(field1.get_name() == field2.get_name()) + { + field_access_changed = field1.get_access() != field2.get_access(); + break; + } + } + if(field_access_changed) + break; + } + } + if(function_access_changed || class_access_changed || field_access_changed) + { + modified_functions.insert(it->first); + continue; + } + if(it->second.body.instructions.size() != f_it->second.body.instructions.size()) { diff --git a/src/java_bytecode/java_bytecode_convert_method.cpp b/src/java_bytecode/java_bytecode_convert_method.cpp index fb9b18bd871..2284042c92b 100644 --- a/src/java_bytecode/java_bytecode_convert_method.cpp +++ b/src/java_bytecode/java_bytecode_convert_method.cpp @@ -387,6 +387,7 @@ void java_bytecode_convert_methodt::convert( // Obtain a std::vector of code_typet::parametert objects from the // (function) type of the symbol typet member_type=method_symbol.type; + member_type.set(ID_C_class, class_symbol.name); code_typet &code_type=to_code_type(member_type); method_return_type=code_type.return_type(); code_typet::parameterst ¶meters=code_type.parameters();