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 47F80200ABD for ; Sat, 14 May 2016 13:13:15 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 34FD9160969; Sat, 14 May 2016 11:13:15 +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 7E223160131 for ; Sat, 14 May 2016 13:13:14 +0200 (CEST) Received: (qmail 98624 invoked by uid 500); 14 May 2016 11:13:13 -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 98524 invoked by uid 99); 14 May 2016 11:13:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 May 2016 11:13:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id F02F92C0451 for ; Sat, 14 May 2016 11:13:12 +0000 (UTC) Date: Sat, 14 May 2016 11:13:12 +0000 (UTC) From: "Sebb (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Reopened] (CODEC-178) Deprecate Charsets Charset constants in favor of Java 7's java.nio.charset.StandardCharsets MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 14 May 2016 11:13:15 -0000 [ https://issues.apache.org/jira/browse/CODEC-178?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sebb reopened CODEC-178: ------------------------ I wonder whether it is necessary to deprecate the fields. It's not possible for Java 6 users to use the suggested alternative. Also the replacements are anyway identical code-wise. Once Codec requires a minimum of Java 7, I think a more helpful solution would be to redefine the constants in terms of the StandardCharsets fields, e.g. public static final Charset US_ASCII = Charset java.nio.charset.StandardCharsets.US_ASCII; It should be possible to do this now in a static block. i.e. try and reference StandardCharsets.US_ASCII; if this fails then revert to creating the Charset directly. The Javadoc should probably still recommend people to use the Java 7 constants if available, but I don't see any reason to deprecate the fields given that the contents are identical. > Deprecate Charsets Charset constants in favor of Java 7's java.nio.charset.StandardCharsets > ------------------------------------------------------------------------------------------- > > Key: CODEC-178 > URL: https://issues.apache.org/jira/browse/CODEC-178 > Project: Commons Codec > Issue Type: Task > Affects Versions: 1.9 > Environment: Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 11:22:22-0400) > Maven home: C:\Java\apache-maven-3.1.1\bin\.. > Java version: 1.7.0_51, vendor: Oracle Corporation > Java home: C:\Program Files\Java\jdk1.7.0_51\jre > Default locale: en_US, platform encoding: Cp1252 > OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows" > Reporter: Gary Gregory > Assignee: Gary Gregory > Priority: Minor > Fix For: 1.10 > > > Deprecate Charsets Charset constants in favor of Java 7's java.nio.charset.StandardCharsets -- This message was sent by Atlassian JIRA (v6.3.4#6332)