Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 88C71200B48 for ; Mon, 4 Jul 2016 01:23:59 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 87656160A71; Sun, 3 Jul 2016 23:23:59 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D16A2160A6B for ; Mon, 4 Jul 2016 01:23:58 +0200 (CEST) Received: (qmail 67299 invoked by uid 500); 3 Jul 2016 23:23:58 -0000 Mailing-List: contact commits-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@poi.apache.org Delivered-To: mailing list commits@poi.apache.org Received: (qmail 67290 invoked by uid 99); 3 Jul 2016 23:23:58 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Jul 2016 23:23:58 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 8010D1A08AC for ; Sun, 3 Jul 2016 23:23:57 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.426 X-Spam-Level: X-Spam-Status: No, score=-0.426 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id DKfv4BRZRqGM for ; Sun, 3 Jul 2016 23:23:56 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 7C85B5F1F0 for ; Sun, 3 Jul 2016 23:23:56 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 8F4F5E0016 for ; Sun, 3 Jul 2016 23:23:55 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 1AA9C3A019C for ; Sun, 3 Jul 2016 23:23:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1751182 - /poi/trunk/src/scratchpad/src/org/apache/poi/hmef/HMEFMessage.java Date: Sun, 03 Jul 2016 23:23:54 -0000 To: commits@poi.apache.org From: onealj@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160703232355.1AA9C3A019C@svn01-us-west.apache.org> archived-at: Sun, 03 Jul 2016 23:23:59 -0000 Author: onealj Date: Sun Jul 3 23:23:54 2016 New Revision: 1751182 URL: http://svn.apache.org/viewvc?rev=1751182&view=rev Log: make class attributes final; return unmodifiable lists Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hmef/HMEFMessage.java Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hmef/HMEFMessage.java URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hmef/HMEFMessage.java?rev=1751182&r1=1751181&r2=1751182&view=diff ============================================================================== --- poi/trunk/src/scratchpad/src/org/apache/poi/hmef/HMEFMessage.java (original) +++ poi/trunk/src/scratchpad/src/org/apache/poi/hmef/HMEFMessage.java Sun Jul 3 23:23:54 2016 @@ -20,6 +20,7 @@ package org.apache.poi.hmef; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import org.apache.poi.hmef.attribute.MAPIAttribute; @@ -41,10 +42,11 @@ import org.apache.poi.util.LittleEndian; public final class HMEFMessage { public static final int HEADER_SIGNATURE = 0x223e9f78; + @SuppressWarnings("unused") private int fileId; - private List messageAttributes = new ArrayList(); - private List mapiAttributes = new ArrayList(); - private List attachments = new ArrayList(); + private final List messageAttributes = new ArrayList(); + private final List mapiAttributes = new ArrayList(); + private final List attachments = new ArrayList(); public HMEFMessage(InputStream inp) throws IOException { try { @@ -125,7 +127,7 @@ public final class HMEFMessage { * are stored as {@link MAPIAttribute}s - see {@link #getMessageMAPIAttributes()} */ public List getMessageAttributes() { - return messageAttributes; + return Collections.unmodifiableList(messageAttributes); } /** @@ -134,14 +136,14 @@ public final class HMEFMessage { * apply to most messages, see {@link #getMessageAttributes()} */ public List getMessageMAPIAttributes() { - return mapiAttributes; + return Collections.unmodifiableList(mapiAttributes); } /** * Returns all the Attachments of the message. */ public List getAttachments() { - return attachments; + return Collections.unmodifiableList(attachments); } /** --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org For additional commands, e-mail: commits-help@poi.apache.org