Uploaded image for project: 'Commons VFS'
  1. Commons VFS
  2. VFS-369

Compilation error with newer versions of Jackrabbit

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.0
    • None
    • None

    Description

      When I try to compile VFS on my computer I've got compilation errors due maybe because I use a more recent version of jackrabbit. I patched the code and now it compiles.

      diff -rupN original//org/apache/commons/vfs2/provider/webdav/ExceptionConverter.java patched//org/apache/commons/vfs2/provider/webdav/ExceptionConverter.java
      --- original//org/apache/commons/vfs2/provider/webdav/ExceptionConverter.java	2011-08-18 06:57:10.000000000 +0200
      +++ patched//org/apache/commons/vfs2/provider/webdav/ExceptionConverter.java	2011-10-24 20:35:41.000000000 +0200
      @@ -50,7 +50,7 @@ public final class ExceptionConverter
               {
                   try
                   {
      -                Element error = davExc.toXml(DomUtil.BUILDER_FACTORY.newDocumentBuilder().newDocument());
      +                Element error = davExc.toXml(DomUtil.createDocument());
                       if (DomUtil.matches(error, DavException.XML_ERROR, DavConstants.NAMESPACE))
                       {
                           if (DomUtil.hasChildElement(error, "exception", null))
      diff -rupN original//org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java patched//org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java
      --- original//org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java	2011-08-18 06:57:10.000000000 +0200
      +++ patched//org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java	2011-10-24 20:35:41.000000000 +0200
      @@ -292,19 +292,17 @@ public class WebdavFileObject extends Ht
                   URLFileName fileName = (URLFileName) getName();
                   DavPropertySet properties = getProperties(fileName, PropFindMethod.PROPFIND_ALL_PROP,
                           new DavPropertyNameSet(), false);
      -            @SuppressWarnings("unchecked") // iterator() is documented to return DavProperty instances
      -            Iterator<DavProperty> iter = properties.iterator();
      +            Iterator iter = properties.iterator();
                   while (iter.hasNext())
                   {
      -                DavProperty property = iter.next();
      +                DavProperty property = (DavProperty)iter.next();
                       attributes.put(property.getName().toString(), property.getValue());
                   }
                   properties = getPropertyNames(fileName);
      -            @SuppressWarnings("unchecked") // iterator() is documented to return DavProperty instances
      -            Iterator<DavProperty> iter2 = properties.iterator();
      +            Iterator iter2 = properties.iterator();
                   while (iter2.hasNext())
                   {
      -                DavProperty property = iter2.next();
      +                DavProperty property = (DavProperty)iter2.next();
                       if (!attributes.containsKey(property.getName().getName()))
                       {
                           property = getProperty(fileName, property.getName());
      

      Attachments

        1. VFS-369.patch
          3 kB
          Cedric Nanni
        2. vfs-369-JR-2.5.3.diff
          3 kB
          Gary D. Gregory
        3. pom.xml.patch
          42 kB
          Jean-Marc Borer

        Activity

          People

            Unassigned Unassigned
            cedric.nanni Cedric Nanni
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: