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

Sqoop fails to compile against commons-io higher then 1.4

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.4
    • Fix Version/s: 1.4.5
    • Component/s: None
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: