[Libreoffice-commits] core.git: 3 commits - swext/mediawiki

Noel Grandin noel at peralex.com
Tue Feb 23 07:31:32 UTC 2016


 swext/mediawiki/src/com/sun/star/wiki/WikiProtocolSocketFactory.java |   20 +++++-----
 1 file changed, 10 insertions(+), 10 deletions(-)

New commits:
commit b4203f530c856bafb117a7391905b25c3a5baa4b
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Feb 23 09:29:03 2016 +0200

    cid#1326858 Eq: Problems with implementation of equals()
    
    Change-Id: If87666e6e4ac9397ac44bed805fc7c83ad357105

diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiProtocolSocketFactory.java b/swext/mediawiki/src/com/sun/star/wiki/WikiProtocolSocketFactory.java
index edd2e10..81e09f9 100644
--- a/swext/mediawiki/src/com/sun/star/wiki/WikiProtocolSocketFactory.java
+++ b/swext/mediawiki/src/com/sun/star/wiki/WikiProtocolSocketFactory.java
@@ -157,7 +157,7 @@ class WikiProtocolSocketFactory extends SSLSocketFactory
     @Override
     public boolean equals(Object obj)
     {
-        return ((obj != null) && obj.getClass().equals(WikiProtocolSocketFactory.class));
+        return (obj != null) && (obj instanceof WikiProtocolSocketFactory);
     }
 
     @Override
commit f126d7fb8fca4a1ae1e88afe99a0229b50e944d1
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Feb 23 09:28:01 2016 +0200

    cid#1327459 BC: Bad casts of object references
    
    Change-Id: Ibf80ea0a0f1afbd8269c79d7a7f6f0703567df94

diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiProtocolSocketFactory.java b/swext/mediawiki/src/com/sun/star/wiki/WikiProtocolSocketFactory.java
index 5419fba..edd2e10 100644
--- a/swext/mediawiki/src/com/sun/star/wiki/WikiProtocolSocketFactory.java
+++ b/swext/mediawiki/src/com/sun/star/wiki/WikiProtocolSocketFactory.java
@@ -175,11 +175,11 @@ class LoggingProtocolSocketFactory extends SSLSocketFactory
 
     private static class LogSocket extends SSLSocket
     {
-        private SSLSocket m_Socket;
+        private final SSLSocket m_Socket;
 
-        public LogSocket(Socket socket)
+        public LogSocket(SSLSocket socket)
         {
-            m_Socket = (SSLSocket) socket;
+            m_Socket = socket;
         }
 
         private static class LogStream extends java.io.FilterOutputStream
@@ -272,35 +272,35 @@ class LoggingProtocolSocketFactory extends SSLSocketFactory
     public Socket createSocket(InetAddress address, int port)
         throws IOException
     {
-        return new LogSocket(((SSLSocketFactory) SSLSocketFactory.getDefault()).createSocket(address, port));
+        return new LogSocket((SSLSocket) SSLSocketFactory.getDefault().createSocket(address, port));
     }
 
     @Override
     public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort)
         throws IOException
     {
-        return new LogSocket(((SSLSocketFactory) SSLSocketFactory.getDefault()).createSocket(address, port, localAddress, localPort));
+        return new LogSocket((SSLSocket) SSLSocketFactory.getDefault().createSocket(address, port, localAddress, localPort));
     }
 
     @Override
     public Socket createSocket( String sHost, int nPort, InetAddress clientHost, int clientPort )
         throws IOException, UnknownHostException
     {
-        return new LogSocket(((SSLSocketFactory) SSLSocketFactory.getDefault()).createSocket(sHost, nPort, clientHost, clientPort));
+        return new LogSocket((SSLSocket) SSLSocketFactory.getDefault().createSocket(sHost, nPort, clientHost, clientPort));
     }
 
     @Override
     public Socket createSocket( String sHost, int nPort )
         throws IOException, UnknownHostException
     {
-        return new LogSocket(((SSLSocketFactory) SSLSocketFactory.getDefault()).createSocket(sHost, nPort));
+        return new LogSocket((SSLSocket) SSLSocketFactory.getDefault().createSocket(sHost, nPort));
     }
 
     @Override
     public Socket createSocket( Socket aSocket, String sHost, int nPort, boolean bAutoClose )
         throws IOException
     {
-        return new LogSocket(((SSLSocketFactory) SSLSocketFactory.getDefault()).createSocket(aSocket, sHost, nPort, bAutoClose));
+        return new LogSocket((SSLSocket) ((SSLSocketFactory) SSLSocketFactory.getDefault()).createSocket(aSocket, sHost, nPort, bAutoClose));
     }
 
     @Override
commit c39a9240c550e9a3f403b5a08ec6e09ab204ebfe
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Feb 23 09:25:02 2016 +0200

    cid#1327465 Eq: Problems with implementation of equals()
    
    Change-Id: I63921f5a84adcb3d1e562327fd1f47282efe6fbd

diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiProtocolSocketFactory.java b/swext/mediawiki/src/com/sun/star/wiki/WikiProtocolSocketFactory.java
index 4ffd06c..5419fba 100644
--- a/swext/mediawiki/src/com/sun/star/wiki/WikiProtocolSocketFactory.java
+++ b/swext/mediawiki/src/com/sun/star/wiki/WikiProtocolSocketFactory.java
@@ -320,7 +320,7 @@ class LoggingProtocolSocketFactory extends SSLSocketFactory
     @Override
     public boolean equals(Object obj)
     {
-        return ((obj != null) && obj.getClass().equals(LoggingProtocolSocketFactory.class));
+        return (obj != null) && (obj instanceof LoggingProtocolSocketFactory);
     }
 
     @Override


More information about the Libreoffice-commits mailing list