Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0276CE521 for ; Wed, 2 Jan 2013 23:30:14 +0000 (UTC) Received: (qmail 38293 invoked by uid 500); 2 Jan 2013 23:30:13 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 38191 invoked by uid 500); 2 Jan 2013 23:30: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 37987 invoked by uid 99); 2 Jan 2013 23:30:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jan 2013 23:30:13 +0000 Date: Wed, 2 Jan 2013 23:30:13 +0000 (UTC) From: "Gary Gregory (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (IO-363) FileUtils.readFileToString((new File("myFile"), null) produces the following compilation error 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/IO-363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13542547#comment-13542547 ] Gary Gregory commented on IO-363: --------------------------------- If you really want to pass in null, then you can say: {code:java} FileUtils.readFileToString(new File("myFile"), (String)null) {code} This is better IMO: {code:java} FileUtils.readFileToString(new File("myFile"), Charset.defaultCharset()) {code} > FileUtils.readFileToString((new File("myFile"), null) produces the following compilation error > ------------------------------------------------------------------------------------------------ > > Key: IO-363 > URL: https://issues.apache.org/jira/browse/IO-363 > Project: Commons IO > Issue Type: Bug > Reporter: Peter Warde > Priority: Minor > Fix For: 2.4 > > > org.apache.commons.io.FileUtils.readFileToString(new File("myFile"), null) in 2.4 produces the following compilation error "The method readFileToString(File, Charset) is ambiguous for the type FileUtils", even though the javadoc says "encoding - the encoding to use, null means platform default". > This is due to FileUtils having 2 readFileToString methods - readFileToString(File file, Charset encoding) and readFileToString(File file, > String encoding) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira