Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jf6yu-00062z-38 for pljava-dev@arkaria.postgresql.org; Sat, 30 May 2020 19:17:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jf6yL-0006hN-99 for pljava-dev@arkaria.postgresql.org; Sat, 30 May 2020 19:16:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jf6yK-0006hG-Pj for pljava-dev@lists.postgresql.org; Sat, 30 May 2020 19:16:45 +0000 Received: from anastigmatix.net ([68.171.219.55]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jf6yD-0006m5-Tn for pljava-dev@lists.postgresql.org; Sat, 30 May 2020 19:16:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=anastigmatix.net; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Date:Message-ID:Subject:From:To:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=WULlFdrnT+byustwQyKhf1AO6sTrcFQDoBs2lXJGP+U=; b=mKXJLsx0B/YoRtCeghFNYdngWP zMVCwvyN0+awXFg3C69GmQZvKRLkaeh3R1icstPYHdaaC8D9ucN9ReKvecL1OaJLXrz7k3Bmrvkmi w5zXM4YljRqcISQVQB0dYfeKXK/hDEwKqi3t4kXg3MrkKwPP2xNCrpNC7bxWd0xmorHqPF0Ag9Ehb GeW49Hexk9OwA+dnx37Y3xMqWNkN9pMIKh6y0YHsdmQcsoOsboRUSijx0P+EHkgL/Ucw1vvgqURPb l/UCevVb1AI1JyGoNRh0+1bNPcD/aVQlB9SsFk6SguQkVYEReAhRSkS0N/vL+GHtHAL/Xdg3ErvLM dC8YbCOg==; Received: from [184.19.31.139] (port=53089) by bay.acenet.us with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1jf6yC-00DLd4-0S for pljava-dev@lists.postgresql.org; Sat, 30 May 2020 15:16:36 -0400 To: "pljava-dev@lists.postgresql.org" From: Chapman Flack Subject: Java 14 "Helpful NullPointerExceptions" X-Enigmail-Draft-Status: N1110 Message-ID: <5ED2B113.1000606@anastigmatix.net> Date: Sat, 30 May 2020 15:16:35 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-OutGoing-Spam-Status: No, score=-96.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bay.acenet.us X-AntiAbuse: Original Domain - lists.postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - anastigmatix.net X-Get-Message-Sender-Via: bay.acenet.us: authenticated_id: chap@anastigmatix.net X-Authenticated-Sender: bay.acenet.us: chap@anastigmatix.net X-Source: X-Source-Args: X-Source-Dir: X-From-Rewrite: unmodified, already matched List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk There is a great option to add in pljava.vmoptions when running on Java 14 or later: -XX:+ShowCodeDetailsInExceptionMessages It arranges so that if a NullPointerException is ever thrown, instead of ERROR: java.lang.NullPointerException you see something like ERROR: java.lang.NullPointerException: Cannot assign field "i" because "a" is null A little thing, but handy, and very easy to enable. It doesn't add to the cost of null-pointer exceptions thrown and caught internally, because the work is only done if the message is used. [1] -Chap [1] https://openjdk.java.net/jeps/358