You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by bl...@apache.org on 2016/08/24 21:23:41 UTC

[2/2] groovy git commit: jdk9: more "friendly" toString of annotation values in Java changes the result string

jdk9: more "friendly" toString of annotation values in Java changes the result string


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/e04b6ac9
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/e04b6ac9
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/e04b6ac9

Branch: refs/heads/master
Commit: e04b6ac9c1b7e695462ecbfbabeb958041ee76ad
Parents: 57b48e2
Author: Jochen Theodorou <bl...@gmx.org>
Authored: Wed Aug 24 23:22:34 2016 +0200
Committer: Jochen Theodorou <bl...@gmx.org>
Committed: Wed Aug 24 23:22:34 2016 +0200

----------------------------------------------------------------------
 src/test/gls/annotations/AnnotationTest.groovy | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/e04b6ac9/src/test/gls/annotations/AnnotationTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/gls/annotations/AnnotationTest.groovy b/src/test/gls/annotations/AnnotationTest.groovy
index 7344a4d..7c80faf 100644
--- a/src/test/gls/annotations/AnnotationTest.groovy
+++ b/src/test/gls/annotations/AnnotationTest.groovy
@@ -642,8 +642,11 @@ class AnnotationTest extends CompilableTestSupport {
                 double d4() default 2.3 as double
             }
             @Foo method() {}
-            assert getClass().getMethod('method').getAnnotation(Foo).toString()[5..-2].tokenize(', ').sort().join('|') ==
-                    'b=6|c1=A|c2=B|c3=C|c4=D|d1=2.0|d2=2.1|d3=2.2|d4=2.3|f1=1.0|f2=1.1|f3=1.2|f4=1.3|i1=0|i2=1|s1=2|s2=3|s3=4|s4=5'
+            def string = getClass().getMethod('method').getAnnotation(Foo).toString()[5..-2].tokenize(', ').sort().join('|')
+            assert string == 'b=6|c1=A|c2=B|c3=C|c4=D|d1=2.0|d2=2.1|d3=2.2|d4=2.3|f1=1.0|f2=1.1|f3=1.2|f4=1.3|i1=0|i2=1|s1=2|s2=3|s3=4|s4=5' ||
+                    // changed in some jdk9 versions
+                   string == "b=6|c1='A'|c2='B'|c3='C'|c4='D'|d1=2.0|d2=2.1|d3=2.2|d4=2.3|f1=1.0f|f2=1.1f|f3=1.2f|f4=1.3f|i1=0|i2=1|s1=2|s2=3|s3=4|s4=5"
+
         '''
     }