Uploaded image for project: 'Sqoop (Retired)'
  1. Sqoop (Retired)
  2. SQOOP-1227

Sqoop fails to compile against commons-io higher then 1.4

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4.4
    • 1.4.5
    • None
    • None

    Description

      The problem is in DataDrivenImportJob.writeAvroSchema where we have following code fragment:

          FileUtils.writeStringToFile(schemaFile, schema.toString(true), null);
      

      The last parameter to the function call is null without any type. This works fine in commons-io 1.4 as the method writeStringToFile have only two different definitions:

      writeStringToFile(File file, String data) 
      writeStringToFile(File file, String data, String encoding) 
      

      However later versions has added a lot of other definitions, such as:

      writeStringToFile(File file, String data, Charset encoding)
      

      And thus the compilation fails on ambiguity problem:

          [javac] /home/jarcec/apache/repos/sqoop/src/java/org/apache/sqoop/mapreduce/DataDrivenImportJob.java:109: error: reference to writeStringToFile is ambiguous, both method writeStringToFile(File,String,Charset) in FileUtils and method writeStringToFile(File,String,String) in FileUtils match
          [javac]     FileUtils.writeStringToFile(schemaFile, schema.toString(true), null);
          [javac]              ^
      

      Attachments

        1. SQOOP-1227.patch
          0.8 kB
          Jarek Jarcec Cecho

        Issue Links

          Activity

            People

              jarcec Jarek Jarcec Cecho
              jarcec Jarek Jarcec Cecho
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: