You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2021/03/03 15:09:12 UTC

[commons-vfs] branch master updated (bd6ccba -> 5a5a115)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git.


    from bd6ccba  Stub out a log call as a TODO (handle PMD issues)
     new 730cc42  Add maven-pmd-plugin to Maven plugin management section.
     new 5a5a115  Stub out a log call as a TODO (handle PMD issues)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../vfs2/provider/webdav/WebdavFileObject.java     | 14 ++++++++---
 .../vfs2/provider/webdav4/Webdav4FileObject.java   |  2 +-
 pom.xml                                            | 29 +++++++++++++++++++++-
 3 files changed, 39 insertions(+), 6 deletions(-)


[commons-vfs] 01/02: Add maven-pmd-plugin to Maven plugin management section.

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git

commit 730cc42fe94ecfbf88e11bb41714779ad706f3ac
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Mar 3 10:08:48 2021 -0500

    Add maven-pmd-plugin to Maven plugin management section.
---
 pom.xml | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 63f4b5a..0b58940 100644
--- a/pom.xml
+++ b/pom.xml
@@ -196,6 +196,7 @@
     <commons.jacoco.version>0.8.6</commons.jacoco.version>
     <commons.spotbugs.version>4.2.0</commons.spotbugs.version>
     <commons.spotbugs.impl.version>4.2.0</commons.spotbugs.impl.version>
+    <commons.pmd.version>6.32.0</commons.pmd.version>
     <slf4j.version>1.7.26</slf4j.version>
     <log4j2.version>2.14.0</log4j2.version>
     <clirr.skip>true</clirr.skip>
@@ -209,6 +210,33 @@
     <pluginManagement>
       <plugins>
         <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-pmd-plugin</artifactId>
+          <version>3.14.0</version>
+          <dependencies>
+            <dependency>
+              <groupId>net.sourceforge.pmd</groupId>
+              <artifactId>pmd-core</artifactId>
+              <version>${commons.pmd.version}</version>
+            </dependency>
+            <dependency>
+              <groupId>net.sourceforge.pmd</groupId>
+              <artifactId>pmd-java</artifactId>
+              <version>${commons.pmd.version}</version>
+            </dependency>
+            <dependency>
+              <groupId>net.sourceforge.pmd</groupId>
+              <artifactId>pmd-javascript</artifactId>
+              <version>${commons.pmd.version}</version>
+            </dependency>
+            <dependency>
+              <groupId>net.sourceforge.pmd</groupId>
+              <artifactId>pmd-jsp</artifactId>
+              <version>${commons.pmd.version}</version>
+            </dependency>
+          </dependencies>
+        </plugin>
+        <plugin>
           <!--  Fixes org.apache.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19 -->
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-project-info-reports-plugin</artifactId>
@@ -411,7 +439,6 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-pmd-plugin</artifactId>
-        <version>3.14.0</version>
         <configuration>
           <targetJdk>${maven.compiler.target}</targetJdk>
           <aggregate>true</aggregate>


[commons-vfs] 02/02: Stub out a log call as a TODO (handle PMD issues)

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git

commit 5a5a1158f8e16582a1158e6aab1c30e49fa961e3
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Mar 3 10:09:08 2021 -0500

    Stub out a log call as a TODO (handle PMD issues)
---
 .../commons/vfs2/provider/webdav/WebdavFileObject.java     | 14 ++++++++++----
 .../commons/vfs2/provider/webdav4/Webdav4FileObject.java   |  2 +-
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/commons-vfs2-jackrabbit1/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java b/commons-vfs2-jackrabbit1/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java
index c371a4c..0505c69 100644
--- a/commons-vfs2-jackrabbit1/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java
+++ b/commons-vfs2-jackrabbit1/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java
@@ -146,7 +146,7 @@ public class WebdavFileObject extends HttpFileObject<WebdavFileSystem> {
                         execute(checkout);
                         isCheckedIn = false;
                     } catch (final FileSystemException ex) {
-                        // Ignore the exception checking out.
+                        log(ex);
                     }
                 }
 
@@ -164,7 +164,8 @@ public class WebdavFileObject extends HttpFileObject<WebdavFileSystem> {
                             execute(method);
                             isCheckedIn = true;
                         } catch (final Exception e) {
-                            // Ignore the exception. Going to throw original.
+                            // Going to throw original.
+                            log(e);
                         }
                         throw ex;
                     }
@@ -175,7 +176,7 @@ public class WebdavFileObject extends HttpFileObject<WebdavFileSystem> {
                         final DavPropertySet props = getPropertyNames(fileName);
                         isCheckedIn = !props.contains(VersionControlledResource.CHECKED_OUT);
                     } catch (final FileNotFoundException fnfe) {
-                        // Ignore the error
+                        log(fnfe);
                     }
                 }
                 if (!isCheckedIn) {
@@ -191,7 +192,8 @@ public class WebdavFileObject extends HttpFileObject<WebdavFileSystem> {
                 try {
                     setUserName(fileName, urlStr);
                 } catch (final IOException e) {
-                    // Ignore the exception if unable to set the user name.
+                    // Unable to set the user name.
+                    log(e);
                 }
             }
             ((DefaultFileContent) this.file.getContent()).resetAttributes();
@@ -228,6 +230,10 @@ public class WebdavFileObject extends HttpFileObject<WebdavFileSystem> {
         builder = (WebdavFileSystemConfigBuilder) WebdavFileSystemConfigBuilder.getInstance();
     }
 
+    void log(Exception ex) {
+        // TODO Consider logging.
+    }
+
     protected void configureMethod(final HttpMethodBase httpMethod) {
         httpMethod.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, WebdavMethodRetryHandler.getInstance());
     }
diff --git a/commons-vfs2-jackrabbit2/src/main/java/org/apache/commons/vfs2/provider/webdav4/Webdav4FileObject.java b/commons-vfs2-jackrabbit2/src/main/java/org/apache/commons/vfs2/provider/webdav4/Webdav4FileObject.java
index 366790a..d0db899 100644
--- a/commons-vfs2-jackrabbit2/src/main/java/org/apache/commons/vfs2/provider/webdav4/Webdav4FileObject.java
+++ b/commons-vfs2-jackrabbit2/src/main/java/org/apache/commons/vfs2/provider/webdav4/Webdav4FileObject.java
@@ -164,7 +164,7 @@ public class Webdav4FileObject extends Http4FileObject<Webdav4FileSystem> {
                             isCheckedIn = true;
                         } catch (final Exception e) {
                             // Going to throw original.
-                            log(ex);
+                            log(e);
                         }
                         throw ex;
                     }