From dev-return-3304-apmail-johnzon-dev-archive=johnzon.apache.org@johnzon.apache.org Sun Jul 26 15:48:35 2020 Return-Path: X-Original-To: apmail-johnzon-dev-archive@www.apache.org Delivered-To: apmail-johnzon-dev-archive@www.apache.org Received: from mailroute1-lw-us.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by minotaur.apache.org (Postfix) with ESMTP id 105591A0B9 for ; Sun, 26 Jul 2020 15:48:35 +0000 (UTC) Received: from mail.apache.org (localhost [127.0.0.1]) by mailroute1-lw-us.apache.org (ASF Mail Server at mailroute1-lw-us.apache.org) with SMTP id 8B763125794 for ; Sun, 26 Jul 2020 15:48:34 +0000 (UTC) Received: (qmail 46562 invoked by uid 500); 26 Jul 2020 15:48:34 -0000 Delivered-To: apmail-johnzon-dev-archive@johnzon.apache.org Received: (qmail 46544 invoked by uid 500); 26 Jul 2020 15:48:34 -0000 Mailing-List: contact dev-help@johnzon.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@johnzon.apache.org Delivered-To: mailing list dev@johnzon.apache.org Received: (qmail 46532 invoked by uid 99); 26 Jul 2020 15:48:34 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Jul 2020 15:48:34 +0000 From: =?utf-8?q?GitBox?= To: dev@johnzon.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bjohnzon=5D_rmannibucau_commented_on_a_change_in_pu?= =?utf-8?q?ll_request_=2367=3A_=5BJOHNZON-319=5D_Map_all_properties_supporte?= =?utf-8?q?d_by_MapperBuilder_in_JohnzonBuilder?= Message-ID: <159577851410.29655.13291060884785241170.asfpy@gitbox.apache.org> Date: Sun, 26 Jul 2020 15:48:34 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit In-Reply-To: References: rmannibucau commented on a change in pull request #67: URL: https://github.com/apache/johnzon/pull/67#discussion_r460542429 ########## File path: johnzon-jsonb/src/main/java/org/apache/johnzon/jsonb/JohnzonBuilder.java ########## @@ -131,9 +131,12 @@ public Jsonb build() { return it; }).orElse(false); - if (config.getProperty(JsonbConfig.FORMATTING).map(Boolean.class::cast).orElse(false)) { - builder.setPretty(true); - } + config.getProperty(JsonbConfig.FORMATTING).map(Boolean.class::cast).ifPresent(builder::setPretty); + config.getProperty(AbstractJsonFactory.BUFFER_STRATEGY).map(String::valueOf).ifPresent(builder::setBufferStrategy); + config.getProperty(JsonParserFactoryImpl.BUFFER_LENGTH).map(Integer.class::cast).ifPresent(builder::setBufferSize); + config.getProperty(JsonParserFactoryImpl.MAX_STRING_LENGTH).map(Integer.class::cast).ifPresent(builder::setMaxSize); + config.getProperty(JsonParserFactoryImpl.SUPPORTS_COMMENTS).map(Boolean.class::cast).ifPresent(builder::setSupportsComments); + config.getProperty(JsonParserFactoryImpl.ENCODING).map(String::valueOf).ifPresent(builder::setEncoding); Review comment: Must use jsonb property, not jsonp one ########## File path: johnzon-jsonb/src/main/java/org/apache/johnzon/jsonb/JohnzonBuilder.java ########## @@ -131,9 +131,12 @@ public Jsonb build() { return it; }).orElse(false); - if (config.getProperty(JsonbConfig.FORMATTING).map(Boolean.class::cast).orElse(false)) { - builder.setPretty(true); - } + config.getProperty(JsonbConfig.FORMATTING).map(Boolean.class::cast).ifPresent(builder::setPretty); + config.getProperty(AbstractJsonFactory.BUFFER_STRATEGY).map(String::valueOf).ifPresent(builder::setBufferStrategy); Review comment: Must use johnzon.name pattern IMHO for consistency and not leak jsonp impl properties since we support other jsonp impl and already used shortnames for other feature. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org