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 2FCD0200C8C for ; Tue, 6 Jun 2017 17:15:26 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2E4E2160BC6; Tue, 6 Jun 2017 15:15:26 +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 4D940160BC3 for ; Tue, 6 Jun 2017 17:15:25 +0200 (CEST) Received: (qmail 98010 invoked by uid 500); 6 Jun 2017 15:15:24 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 97997 invoked by uid 99); 6 Jun 2017 15:15:23 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jun 2017 15:15:23 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 68CF4C1380 for ; Tue, 6 Jun 2017 15:15:23 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.751 X-Spam-Level: X-Spam-Status: No, score=-99.751 tagged_above=-999 required=6.31 tests=[KAM_LOTSOFHASH=0.25, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id CG5UlHLfFx2e for ; Tue, 6 Jun 2017 15:15:21 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 9E9D85FD21 for ; Tue, 6 Jun 2017 15:15:20 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 2E595E0DC5 for ; Tue, 6 Jun 2017 15:15:20 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id B964B21E19 for ; Tue, 6 Jun 2017 15:15:18 +0000 (UTC) Date: Tue, 6 Jun 2017 15:15:18 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LANG-1337) Fix test failures in IBM JDK 8 for ToStringBuilderTest MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 06 Jun 2017 15:15:26 -0000 [ https://issues.apache.org/jira/browse/LANG-1337?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D16039= 062#comment-16039062 ]=20 ASF GitHub Bot commented on LANG-1337: -------------------------------------- Github user sebbASF commented on a diff in the pull request: https://github.com/apache/commons-lang/pull/269#discussion_r120390348 =20 --- Diff: src/test/java/org/apache/commons/lang3/builder/ToStringBuilde= rTest.java --- @@ -316,7 +316,7 @@ public void testReflectionHierarchyArrayList() { // representation different for IBM JDK 1.6.0, LANG-727 assumeFalse("IBM Corporation".equals(SystemUtils.JAVA_VENDOR) = && "1.6".equals(SystemUtils.JAVA_SPECIFICATION_VERSION)); assumeFalse("Oracle Corporation".equals(SystemUtils.JAVA_VENDO= R) && "1.6".compareTo(SystemUtils.JAVA_SPECIFICATION_VERSION) < 0); - final List list =3D new ArrayList<>(); + final List list =3D new ArrayList<>(10); --- End diff -- =20 Thanks! =20 If the test fails when the initial size arg is omitted, does that not a= lso affect the behaviour of the method being tested? i.e. do apps also have= to ensure that they specify the min size when using ToStringBuilder.reflec= tionToString() ? > Fix test failures in IBM JDK 8 for ToStringBuilderTest > ------------------------------------------------------ > > Key: LANG-1337 > URL: https://issues.apache.org/jira/browse/LANG-1337 > Project: Commons Lang > Issue Type: Bug > Components: lang.* > Affects Versions: 3.5 > Environment: java version "1.8.0" > Java(TM) SE Runtime Environment (build pxa6480sr4fp6-20170518_02(SR4 FP6)= ) > IBM J9 VM (build 2.8, JRE 1.8.0 Linux amd64-64 Compressed References 2017= 0516_348050 (JIT enabled, AOT enabled) > J9VM - R28_20170516_1905_B348050 > JIT - tr.r14.java_20170516_348050 > GC - R28_20170516_1905_B348050_CMPRSS > J9CL - 20170516_348050) > JCL - 20170516_01 based on Oracle jdk8u131-b11 > Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T= 05:41:47+13:00) > Maven home: /opt/maven > Java version: 1.8.0, vendor: IBM Corporation > Java home: /home/kinow/Development/java/ibm-java-x86_64-80/jre > Default locale: en_US, platform encoding: UTF-8 > OS name: "linux", version: "4.4.0-78-generic", arch: "amd64", family: "un= ix" > git sha 551101299da7f75ea5478db1a6bc194963e0ac34 > Reporter: Bruno P. Kinoshita > Assignee: Bruno P. Kinoshita > Priority: Minor > Labels: ibm, ibm-jdk, test > Fix For: 3.6 > > > From the 3.6 thread RC2. We had issues in the release. Two tests failed. = One of these tests happened on IBM JDK 8, and was related to time zones. Ga= ry Gregory quickly pointed that the very latest IBM JDK 8 released did not = had this issue. > Indeed, I grabbed a JDK 8 from IBM and had this issue, and then after loo= king for the latest version, I had only one test failing. This test in ques= tion was ToStringBuilderTest#testReflectionHierarchyArrayList. > Debugging the test in Eclipse, with the JDK pointing to IBM JDK 8 (and ta= king care to not let the Eclipse maven integration change it), there is a p= art of the code that receives an ArrayList object to create a String with r= eflection. > In Oracle JDK 7, the object contains the default 10 empty positions, and = thus the generated String is. > {noformat} > java.util.ArrayList@761a4a3d[elementData=3D{,,,,<= null>,,,,,},size=3D0,modCount=3D0] > {noformat} > But with IBM JDK 8, the ArrayList is empty, nada, and then I get the foll= owing in the Eclipse debugger. > {noformat} > java.util.ArrayList@761a4a3d[elementData=3D{},size=3D0,modCount=3D0] > {noformat} > The test is - as commented in LANG-727 - a bit flaky. However, the expect= ed string assumes ArrayList will have an initial 10 null values. So the pul= l request in this issue simply creates an ArrayList with 10 initial capacit= y :-) a na=C3=AFve approach, but that I believe fixes this test. > The changes in the pull request linked to this issue have all tests passi= ng with the following set-ups: > {noformat} > Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T= 05:41:47+13:00) > Maven home: /opt/maven > Java version: 1.7.0_80, vendor: Oracle Corporation > Java home: /usr/lib/jvm/java-7-oracle/jre > Default locale: en_US, platform encoding: UTF-8 > OS name: "linux", version: "4.4.0-78-generic", arch: "amd64", family: "un= ix" > --- > java version "1.7.0_80" > Java(TM) SE Runtime Environment (build 1.7.0_80-b15) > Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode) > Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T= 05:41:47+13:00) > Maven home: /opt/maven > Java version: 1.8.0_131, vendor: Oracle Corporation > Java home: /usr/lib/jvm/java-8-oracle/jre > Default locale: en_US, platform encoding: UTF-8 > OS name: "linux", version: "4.4.0-78-generic", arch: "amd64", family: "un= ix" > --- > java version "1.8.0_131" > Java(TM) SE Runtime Environment (build 1.8.0_131-b11) > Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode) > Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T= 05:41:47+13:00) > Maven home: /opt/maven > Java version: 1.8.0, vendor: IBM Corporation > Java home: /home/kinow/Development/java/ibm-java-x86_64-80/jre > Default locale: en_US, platform encoding: UTF-8 > OS name: "linux", version: "4.4.0-78-generic", arch: "amd64", family: "un= ix" > --- > java version "1.8.0" > Java(TM) SE Runtime Environment (build pxa6480sr4fp6-20170518_02(SR4 FP6)= ) > IBM J9 VM (build 2.8, JRE 1.8.0 Linux amd64-64 Compressed References 2017= 0516_348050 (JIT enabled, AOT enabled) > J9VM - R28_20170516_1905_B348050 > JIT - tr.r14.java_20170516_348050 > GC - R28_20170516_1905_B348050_CMPRSS > J9CL - 20170516_348050) > JCL - 20170516_01 based on Oracle jdk8u131-b11 > {noformat} -- This message was sent by Atlassian JIRA (v6.3.15#6346)