Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 198A4200497 for ; Wed, 9 Aug 2017 06:45:21 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 17F9416875A; Wed, 9 Aug 2017 04:45:21 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 590D4168758 for ; Wed, 9 Aug 2017 06:45:20 +0200 (CEST) Received: (qmail 85330 invoked by uid 500); 9 Aug 2017 04:45:19 -0000 Mailing-List: contact commits-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list commits@groovy.apache.org Received: (qmail 85321 invoked by uid 99); 9 Aug 2017 04:45:19 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Aug 2017 04:45:19 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 641BFDFB94; Wed, 9 Aug 2017 04:45:19 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sunlan@apache.org To: commits@groovy.apache.org Message-Id: <8c0e1b9e8cf643e389cfbe59f9caef7b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: groovy git commit: Refine the test for GROOVY-8228 further Date: Wed, 9 Aug 2017 04:45:19 +0000 (UTC) archived-at: Wed, 09 Aug 2017 04:45:21 -0000 Repository: groovy Updated Branches: refs/heads/GROOVY_2_6_X d10beb9e9 -> 9039c8592 Refine the test for GROOVY-8228 further (cherry picked from commit 9949525) Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/9039c859 Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/9039c859 Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/9039c859 Branch: refs/heads/GROOVY_2_6_X Commit: 9039c8592f929b4972f6cb1cf1bad4d1d2af3a1a Parents: d10beb9 Author: sunlan Authored: Wed Aug 9 12:44:42 2017 +0800 Committer: sunlan Committed: Wed Aug 9 12:45:10 2017 +0800 ---------------------------------------------------------------------- .../src/test/resources/bugs/GROOVY-8228.groovy | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/9039c859/subprojects/parser-antlr4/src/test/resources/bugs/GROOVY-8228.groovy ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/test/resources/bugs/GROOVY-8228.groovy b/subprojects/parser-antlr4/src/test/resources/bugs/GROOVY-8228.groovy index 19045ae..9944a75 100644 --- a/subprojects/parser-antlr4/src/test/resources/bugs/GROOVY-8228.groovy +++ b/subprojects/parser-antlr4/src/test/resources/bugs/GROOVY-8228.groovy @@ -77,16 +77,30 @@ assert ['JSR308Interface1', 'JSR308Interface2 e.name == 'test') assert [IOException, SQLException] == testMethod.getAnnotatedExceptionTypes().collect(e -> e.type) assert 'java.util.List' == testMethod.getAnnotatedReturnType().type.typeName + +// 1) assert ['java.util.List', 'java.util.List'].contains(testMethod.getAnnotatedParameterTypes().collect(e -> e.type.typeName).get(0)) Method test2Method = JSR308Class.class.getDeclaredMethods().find(e -> e.name == 'test2') assert JSR308Class.class == test2Method.getAnnotatedReceiverType().type + +// 2) Parameter listParameter = testMethod.getParameters()[0] assert ['java.util.List', 'java.util.List'].contains(listParameter.getAnnotatedType().type.typeName) Field nameField = JSR308Class.class.getDeclaredField('name'); assert String.class == nameField.getAnnotatedType().type + +// 3) TypeVariable tv = JSR308Interface2.class.getTypeParameters()[0] -assert [CharSequence.class] == tv.getAnnotatedBounds().collect(e -> e.type) +assert [CharSequence.class, null].contains(tv.getAnnotatedBounds().collect(e -> e.type).get(0)) + +// the above 3 tests get different result when running in the different CI(travis-ci and teamcity) +// travis-ci succeeds: https://travis-ci.org/apache/groovy/builds/262506189 +// teamcity fails: http://ci.groovy-lang.org/viewLog.html?buildId=41265&tab=buildResultsDiv&buildTypeId=Groovy_Jdk8Build_PlusSnapshotDeploy +// http://ci.groovy-lang.org/viewLog.html?buildId=41260&tab=buildResultsDiv&buildTypeId=Groovy_Jdk8Build_PlusSnapshotDeploy +// http://ci.groovy-lang.org/viewLog.html?buildId=41257&tab=buildResultsDiv&buildTypeId=Groovy_Jdk8Build_PlusSnapshotDeploy +// +// I guess the difference is related to the version of JDK8 deployed(Maybe it is a bug of Java8)