You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by garydgregory <gi...@git.apache.org> on 2017/07/12 22:53:08 UTC

[GitHub] logging-log4j2 pull request #92: Consider the StringBuilder's capacity inste...

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

    https://github.com/apache/logging-log4j2/pull/92#discussion_r127092555
  
    --- Diff: log4j-core/src/test/java/org/apache/logging/log4j/core/layout/AbstractStringLayoutTest.java ---
    @@ -59,12 +59,14 @@ public void testGetStringBuilderCapacityRestrictedToMax() throws Exception {
             final int LARGE = 4096;
             final String largeMessage = new String(new char[LARGE]);
             final StringBuilder sb2 = ConcreteStringLayout.getStringBuilder();
    -        assertEquals("resized capacity", GROWN, sb2.capacity());
    +        assertTrue("reset capacity", sb2.capacity() <= AbstractStringLayout.MAX_STRING_BUILDER_SIZE);
    --- End diff --
    
    Can't we have an exact comparison here? This feels hacky to me :-(


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---