Github user kinow commented on a diff in the pull request:

    https://github.com/apache/commons-lang/pull/269#discussion_r120546260
  
    --- Diff: 
src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.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_VENDOR) 
&& "1.6".compareTo(SystemUtils.JAVA_SPECIFICATION_VERSION) < 0);
    -        final List<Object> list = new ArrayList<>();
    +        final List<Object> list = new ArrayList<>(10);
    --- End diff --
    
    >If the test fails when the initial size arg is omitted, does that not also 
affect the behaviour of the method being tested?
    
    Not really. The test simply checks the string built for an arraylist 
through reflection. The issue was caused for believing that the lazy 
initialization (as @andyklimczak) would work in the same independent of the JVM.
    
    What the test is verifying is correct, the current approach could be 
improved to make the test less flaky.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to