directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [directory-server] branch master updated: A few trivial fixes thrown up by spotbugs (#24)
Date Tue, 05 Nov 2019 09:43:28 GMT
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/directory-server.git


The following commit(s) were added to refs/heads/master by this push:
     new 839daac  A few trivial fixes thrown up by spotbugs (#24)
839daac is described below

commit 839daac2e838fce7d4f32d55e15b6bbb0dcf09c8
Author: Colm O hEigeartaigh <coheigea@users.noreply.github.com>
AuthorDate: Tue Nov 5 09:43:18 2019 +0000

    A few trivial fixes thrown up by spotbugs (#24)
---
 .../java/org/apache/directory/server/core/avltree/AvlTreeImpl.java   | 4 +---
 .../org/apache/directory/server/core/avltree/AvlTreeMapImpl.java     | 4 +---
 .../server/core/shared/partition/DefaultPartitionNexus.java          | 5 +++--
 .../apache/directory/server/core/changelog/MemoryChangeLogStore.java | 2 +-
 4 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeImpl.java
b/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeImpl.java
index 2553ad4..e9f8e90 100644
--- a/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeImpl.java
+++ b/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeImpl.java
@@ -657,12 +657,10 @@ public class AvlTreeImpl<K> implements AvlTree<K>
         {
             return find( key, startNode.right, path );
         }
-        else if ( c < 0 )
+        else
         {
             return find( key, startNode.left, path );
         }
-
-        return null;
     }
 
 
diff --git a/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapImpl.java
b/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapImpl.java
index 6993a3c..ea86d30 100644
--- a/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapImpl.java
+++ b/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapImpl.java
@@ -858,12 +858,10 @@ public class AvlTreeMapImpl<K, V> implements AvlTreeMap<K,
V>
         {
             return find( key, startNode.right, path );
         }
-        else if ( c < 0 )
+        else
         {
             return find( key, startNode.left, path );
         }
-
-        return null;
     }
 
 
diff --git a/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java
b/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java
index 9f40bf5..fe9f210 100644
--- a/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java
+++ b/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java
@@ -20,6 +20,7 @@
 package org.apache.directory.server.core.shared.partition;
 
 
+import java.io.InputStream;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -163,9 +164,9 @@ public class DefaultPartitionNexus extends AbstractPartition implements
Partitio
 
         Properties props = new Properties();
 
-        try
+        try ( InputStream inputStream = getClass().getResourceAsStream( "version.properties"
) )
         {
-            props.load( getClass().getResourceAsStream( "version.properties" ) );
+            props.load( inputStream );
         }
         catch ( IOException e )
         {
diff --git a/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/MemoryChangeLogStore.java
b/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/MemoryChangeLogStore.java
index 77a0e76..796c8df 100644
--- a/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/MemoryChangeLogStore.java
+++ b/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/MemoryChangeLogStore.java
@@ -165,7 +165,7 @@ public class MemoryChangeLogStore implements TaggableChangeLogStore
             try ( BufferedReader reader = Files.newBufferedReader( revFile.toPath(), StandardCharsets.UTF_8
) )
             {
                 String line = reader.readLine();
-                currentRevision = Long.valueOf( line );
+                currentRevision = Long.parseLong( line );
             }
         }
     }


Mime
View raw message