From issues-return-18291-apmail-commons-issues-archive=commons.apache.org@commons.apache.org Mon Apr 11 03:31:52 2011 Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 91661 invoked from network); 11 Apr 2011 03:31:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Apr 2011 03:31:51 -0000 Received: (qmail 6532 invoked by uid 500); 11 Apr 2011 03:31:49 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 6386 invoked by uid 500); 11 Apr 2011 03:31:49 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 6368 invoked by uid 99); 11 Apr 2011 03:31:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Apr 2011 03:31:44 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Apr 2011 03:31:42 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id B086D9B6CE for ; Mon, 11 Apr 2011 03:31:05 +0000 (UTC) Date: Mon, 11 Apr 2011 03:31:05 +0000 (UTC) From: "Daniel Savarese (JIRA)" To: issues@commons.apache.org Message-ID: <1136955103.48259.1302492665705.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <2057451117.18037.1301363345750.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Reopened] (NET-396) POP3.setState() should not be public 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/NET-396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Daniel Savarese reopened NET-396: --------------------------------- Assignee: Daniel Savarese setState is supposed to be public. As I originally documented over a decade ago: "The POP3 class ... is provided only so that you may easily implement your own POP3 client ..." That is no longer possible with this change. The function must be public so the class can be used via aggregation as well as derivation by third-party code. Classes like POP3 (better thought of as instantiable namespaces instead of conventional objects) were intended to provide raw protocol access and maximum flexibility, not to protect the programmer from shooting himself in the foot. Otherwise, there would be no base protocol classes and only FooClient classes. It was always intended for it to be possible for adventurous programmers to use the base protocol classes outside of their packages. I'm not defending the outdated design--Commons Net has been in need of a rewrite for many years, but the incremental patching approach was the path of least resistance. Nonetheless, I'd like to revert the change before the 3.0 release. > POP3.setState() should not be public > ------------------------------------ > > Key: NET-396 > URL: https://issues.apache.org/jira/browse/NET-396 > Project: Commons Net > Issue Type: Bug > Components: POP3 > Affects Versions: 2.2 > Reporter: Sebb > Assignee: Daniel Savarese > Fix For: 3.0 > > > The POP3 method setState() is public. However, the state should only be settable by library methods, not by client code, otherwise the state checks won't work correctly. > Changing the visibility would break binary compatibility. > To maintain compatibility there could be a new method (package-private, which would give test cases access) which is allowed to set the state. Also change the public method to either do nothing or throw an UnsupportedOperationException. > The getState() method can remain public. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira