Return-Path: X-Original-To: apmail-creadur-dev-archive@www.apache.org Delivered-To: apmail-creadur-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DF6D411D2E for ; Fri, 25 Jul 2014 14:37:39 +0000 (UTC) Received: (qmail 5409 invoked by uid 500); 25 Jul 2014 14:37:39 -0000 Delivered-To: apmail-creadur-dev-archive@creadur.apache.org Received: (qmail 5369 invoked by uid 500); 25 Jul 2014 14:37:39 -0000 Mailing-List: contact dev-help@creadur.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@creadur.apache.org Delivered-To: mailing list dev@creadur.apache.org Received: (qmail 5291 invoked by uid 99); 25 Jul 2014 14:37:39 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Jul 2014 14:37:39 +0000 Date: Fri, 25 Jul 2014 14:37:39 +0000 (UTC) From: "Chris A. Mattmann (JIRA)" To: dev@creadur.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (RAT-148) LicenseAddingReport#report has useless call to metaData.getData MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/RAT-148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14074439#comment-14074439 ] Chris A. Mattmann commented on RAT-148: --------------------------------------- Thank you! > LicenseAddingReport#report has useless call to metaData.getData > --------------------------------------------------------------- > > Key: RAT-148 > URL: https://issues.apache.org/jira/browse/RAT-148 > Project: Apache Rat > Issue Type: Bug > Components: reports > Reporter: Chris A. Mattmann > Assignee: Philipp Ottlinger > Fix For: 0.11 > > Attachments: RAT-148.Mattmann.082813.patch.txt > > > While perusing the current trunk code, I noticed that LicenseAddingReport.java#report has a useless call to metaData.getData: > {code:java} > public class LicenseAddingReport extends AbstractReport { > private final AbstractLicenceAppender appender; > public LicenseAddingReport(String pCopyrightMsg, boolean pForced) { > appender = pCopyrightMsg == null ? new ApacheV2LicenceAppender() : new ApacheV2LicenceAppender(pCopyrightMsg); > appender.setForce(pForced); > } > @Override > public void report(org.apache.rat.api.Document document) throws RatException { > final MetaData metaData = document.getMetaData(); > final Datum licenseHeader = metaData.get(MetaData.RAT_URL_HEADER_CATEGORY); > if (licenseHeader == null > || MetaData.RAT_LICENSE_FAMILY_CATEGORY_DATUM_UNKNOWN.getValue().equals(licenseHeader.getValue())) { > final File file = new File(document.getName()); > if (file.isFile()) { > try { > appender.append(file); > } catch (IOException e) { > throw new RatException(e.getMessage(), e); > } > } > } > metaData.getData(); > } > } > {code} > Looks to me that metaData is a local final variable, and that the call to getData returns a MetaData object, which in turn is never used. -- This message was sent by Atlassian JIRA (v6.2#6252)