You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2019/11/14 19:53:50 UTC

[tomcat] branch 8.5.x updated (1786045 -> 876fe18)

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

markt pushed a change to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


    from 1786045  Remove failonwarning due to internal API use causing a javadoc warning
     new 49de92f  Fix IDE warnings. Get build working with Java 8 through 14
     new 876fe18  Use -XDignore.symbol.file to avoid the proprietary API warning

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:
 build.xml                                                    | 12 ++++--------
 .../apache/catalina/mbeans/JmxRemoteLifecycleListener.java   | 12 +++++++++++-
 res/findbugs/filter-false-positives.xml                      |  6 ++++++
 3 files changed, 21 insertions(+), 9 deletions(-)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 01/02: Fix IDE warnings. Get build working with Java 8 through 14

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

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 49de92f384a05fc9b58857ce311e0e99705bf6e6
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Nov 14 19:26:00 2019 +0000

    Fix IDE warnings. Get build working with Java 8 through 14
    
    "-XDignore.symbol.file" is a hack but it is the only solution I found
    that worked cleanly with all Java versions.
---
 build.xml                                                    |  7 +------
 .../apache/catalina/mbeans/JmxRemoteLifecycleListener.java   | 12 +++++++++++-
 res/findbugs/filter-false-positives.xml                      |  6 ++++++
 3 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/build.xml b/build.xml
index f548f23..2ec230b 100644
--- a/build.xml
+++ b/build.xml
@@ -87,7 +87,6 @@
   <!-- Servlet 3.1 spec requires Java 7+ -->
   <property name="compile.source" value="7"/>
   <property name="compile.target" value="7"/>
-  <property name="compile.release" value="7"/>
   <property name="min.java.version" value="7"/>
 
   <!-- Locations to create the JAR artifacts -->
@@ -638,7 +637,6 @@
            deprecation="${compile.deprecation}"
            source="${compile.source}"
            target="${compile.target}"
-           release="${compile.release}"
            encoding="ISO-8859-1"
            includeAntRuntime="true" >
       <!-- Uncomment this to show unchecked warnings:
@@ -693,12 +691,12 @@
            deprecation="${compile.deprecation}"
            source="${compile.source}"
            target="${compile.target}"
-           release="${compile.release}"
            encoding="ISO-8859-1"
            includeAntRuntime="true" >
       <!-- Uncomment this to show unchecked warnings:
       <compilerarg value="-Xlint:unchecked"/>
       -->
+      <compilerarg value="-XDignore.symbol.file"/>
       <classpath refid="compile.classpath" />
       <exclude name="org/apache/naming/factory/webservices/**" />
     </javac>
@@ -1162,7 +1160,6 @@
              debug="${compile.debug}" deprecation="${compile.deprecation}"
              source="${compile.source}"
              target="${compile.target}"
-             release="${compile.release}"
              classpath="${tomcat.classes}"
              encoding="ISO-8859-1"
              includeantruntime="false">
@@ -1174,7 +1171,6 @@
              debug="${compile.debug}" deprecation="${compile.deprecation}"
              source="${compile.source}"
              target="${compile.target}"
-             release="${compile.release}"
              classpath="${tomcat.classes}"
              encoding="ISO-8859-1"
              includeantruntime="false">
@@ -1407,7 +1403,6 @@
            deprecation="${compile.deprecation}"
            source="${compile.source}"
            target="${compile.target}"
-           release="${compile.release}"
            encoding="ISO-8859-1"
            includeantruntime="true">
       <classpath refid="tomcat.test.classpath" />
diff --git a/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java b/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java
index a4095aa..9bae7fd 100644
--- a/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java
+++ b/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java
@@ -324,7 +324,13 @@ public class JmxRemoteLifecycleListener implements LifecycleListener {
             Remote jmxServer = server.toStub();
             // Create the RMI registry
             try {
-                new JmxRegistry(theRmiRegistryPort, registryCsf, registrySsf, "jmxrmi", jmxServer);
+                /*
+                 * JmxRegistry is registered as a side-effect of creation.
+                 * This object is here so we can tell the IDE it is OK for it
+                 * not to be used.
+                 */
+                @SuppressWarnings("unused")
+                JmxRegistry unused = new JmxRegistry(theRmiRegistryPort, registryCsf, registrySsf, "jmxrmi", jmxServer);
             } catch (RemoteException e) {
                 log.error(sm.getString(
                         "jmxRemoteLifecycleListener.createRegistryFailed",
@@ -492,6 +498,10 @@ public class JmxRemoteLifecycleListener implements LifecycleListener {
     }
 
 
+    /*
+     * Better to use the internal API than re-invent the wheel.
+     */
+    @SuppressWarnings("restriction")
     private static class JmxRegistry extends sun.rmi.registry.RegistryImpl {
         private static final long serialVersionUID = -3772054804656428217L;
         private final String jmxName;
diff --git a/res/findbugs/filter-false-positives.xml b/res/findbugs/filter-false-positives.xml
index a4596d0..dff3613 100644
--- a/res/findbugs/filter-false-positives.xml
+++ b/res/findbugs/filter-false-positives.xml
@@ -332,6 +332,12 @@
     <Bug pattern="VO_VOLATILE_REFERENCE_TO_ARRAY" />
   </Match>
   <Match>
+    <!-- Object is used via side-effect of creation. -->
+    <Class name="org.apache.catalina.mbeans.JmxRemoteLifecycleListener" />
+    <Method name="createServer" />
+    <Bug pattern="DLS_DEAD_LOCAL_STORE" />
+  </Match>
+  <Match>
     <!-- SQL construction is safe since it is from trusted config -->
     <Or>
       <Class name="org.apache.catalina.realm.DataSourceRealm" />


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 02/02: Use -XDignore.symbol.file to avoid the proprietary API warning

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

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 876fe185db34994acf8956fcc7960fc981c3131f
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Nov 14 19:52:32 2019 +0000

    Use -XDignore.symbol.file to avoid the proprietary API warning
---
 build.xml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/build.xml b/build.xml
index 2ec230b..ab3c012 100644
--- a/build.xml
+++ b/build.xml
@@ -1998,10 +1998,11 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
       encoding="UTF-8"
       docencoding="UTF-8"
       charset="UTF-8"
-      additionalparam="-breakiterator -notimestamp ${java9.javadoc.options} -J-Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2"
+      additionalparam="-breakiterator -notimestamp ${java9.javadoc.options} -J-Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2 -XDignore.symbol.file"
       source="${compile.source}"
       maxmemory="512m"
-      failonerror="true">
+      failonerror="true"
+      failonwarning="true">
       <classpath>
         <path refid="compile.classpath"/>
         <path refid="tomcat.webservices.classpath"/>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org