From issues-return-149155-archive-asf-public=cust-asf.ponee.io@maven.apache.org Sat May 11 20:08:35 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id C39B2180651 for ; Sat, 11 May 2019 22:08:34 +0200 (CEST) Received: (qmail 31689 invoked by uid 500); 11 May 2019 20:08:34 -0000 Mailing-List: contact issues-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list issues@maven.apache.org Received: (qmail 31677 invoked by uid 99); 11 May 2019 20:08: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; Sat, 11 May 2019 20:08:34 +0000 From: GitBox To: issues@maven.apache.org Subject: [GitHub] [maven-pmd-plugin] wcarmon commented on a change in pull request #11: Fixed NullPointerException Message-ID: <155760530896.11921.8059023983751081457.gitbox@gitbox.apache.org> Date: Sat, 11 May 2019 20:08:28 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit wcarmon commented on a change in pull request #11: Fixed NullPointerException URL: https://github.com/apache/maven-pmd-plugin/pull/11#discussion_r283109917 ########## File path: src/main/java/org/apache/maven/plugins/pmd/PmdReport.java ########## @@ -769,7 +769,7 @@ private void configureTypeResolution( PMDConfiguration configuration ) throws Ma for ( String path : projectCompileClasspath ) { File pathFile = new File( path ); - if ( !pathFile.exists() || pathFile.list().length == 0 ) + if ( !pathFile.exists() || pathFile.list() == null || pathFile.list().length == 0 ) Review comment: I'm not following/understanding your feedback. If the second clause is `true`, the third clause never executes. If the second clause is `false`, the third clause won't throw an NPE. Can you suggest code that is better for this? (Or describe why a local variable is better?) ---------------------------------------------------------------- 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 With regards, Apache Git Services