directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1771029 - in /directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1: actions/ ber/ ber/grammar/ ber/tlv/
Date Wed, 23 Nov 2016 19:15:07 GMT
Author: elecharny
Date: Wed Nov 23 19:15:07 2016
New Revision: 1771029

URL: http://svn.apache.org/viewvc?rev=1771029&view=rev
Log:
Fixed SonarLint issues

Modified:
    directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/AbstractReadBitString.java
    directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/AbstractReadInteger.java
    directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/AbstractReadOctetString.java
    directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/CheckNotNullLength.java
    directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/AbstractContainer.java
    directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/Asn1Decoder.java
    directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/AbstractGrammar.java
    directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/GrammarAction.java
    directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/BerValue.java
    directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/TLV.java

Modified: directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/AbstractReadBitString.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/AbstractReadBitString.java?rev=1771029&r1=1771028&r2=1771029&view=diff
==============================================================================
--- directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/AbstractReadBitString.java
(original)
+++ directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/AbstractReadBitString.java
Wed Nov 23 19:15:07 2016
@@ -70,6 +70,7 @@ public abstract class AbstractReadBitStr
     /**
      * {@inheritDoc}
      */
+    @Override
     public final void action( C container ) throws DecoderException
     {
         TLV tlv = container.getCurrentTLV();

Modified: directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/AbstractReadInteger.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/AbstractReadInteger.java?rev=1771029&r1=1771028&r2=1771029&view=diff
==============================================================================
--- directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/AbstractReadInteger.java
(original)
+++ directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/AbstractReadInteger.java
Wed Nov 23 19:15:07 2016
@@ -96,6 +96,7 @@ public abstract class AbstractReadIntege
     /**
      * {@inheritDoc}
      */
+    @Override
     public final void action( E container ) throws DecoderException
     {
         TLV tlv = container.getCurrentTLV();

Modified: directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/AbstractReadOctetString.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/AbstractReadOctetString.java?rev=1771029&r1=1771028&r2=1771029&view=diff
==============================================================================
--- directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/AbstractReadOctetString.java
(original)
+++ directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/AbstractReadOctetString.java
Wed Nov 23 19:15:07 2016
@@ -83,6 +83,7 @@ public abstract class AbstractReadOctetS
     /**
      * {@inheritDoc}
      */
+    @Override
     public final void action( C container ) throws DecoderException
     {
         TLV tlv = container.getCurrentTLV();

Modified: directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/CheckNotNullLength.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/CheckNotNullLength.java?rev=1771029&r1=1771028&r2=1771029&view=diff
==============================================================================
--- directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/CheckNotNullLength.java
(original)
+++ directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/CheckNotNullLength.java
Wed Nov 23 19:15:07 2016
@@ -54,6 +54,7 @@ public class CheckNotNullLength<C extend
     /**
      * {@inheritDoc}
      */
+    @Override
     public void action( C container ) throws DecoderException
     {
         TLV tlv = container.getCurrentTLV();

Modified: directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/AbstractContainer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/AbstractContainer.java?rev=1771029&r1=1771028&r2=1771029&view=diff
==============================================================================
--- directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/AbstractContainer.java
(original)
+++ directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/AbstractContainer.java
Wed Nov 23 19:15:07 2016
@@ -97,6 +97,7 @@ public abstract class AbstractContainer
     /**
      * {@inheritDoc}
      */
+    @Override
     public Grammar<?> getGrammar()
     {
         return grammar;
@@ -106,6 +107,7 @@ public abstract class AbstractContainer
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setGrammar( Grammar<?> grammar )
     {
         this.grammar = grammar;
@@ -115,6 +117,7 @@ public abstract class AbstractContainer
     /**
      * {@inheritDoc}
      */
+    @Override
     public TLVStateEnum getState()
     {
         return state;
@@ -124,6 +127,7 @@ public abstract class AbstractContainer
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setState( TLVStateEnum state )
     {
         this.state = state;
@@ -133,6 +137,7 @@ public abstract class AbstractContainer
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isGrammarEndAllowed()
     {
         return grammarEndAllowed;
@@ -142,6 +147,7 @@ public abstract class AbstractContainer
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setGrammarEndAllowed( boolean grammarEndAllowed )
     {
         this.grammarEndAllowed = grammarEndAllowed;
@@ -151,6 +157,7 @@ public abstract class AbstractContainer
     /**
      * {@inheritDoc}
      */
+    @Override
     public Enum<?> getTransition()
     {
         return transition;
@@ -160,6 +167,7 @@ public abstract class AbstractContainer
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setTransition( Enum<?> transition )
     {
         this.transition = transition;
@@ -169,6 +177,7 @@ public abstract class AbstractContainer
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setCurrentTLV( TLV currentTLV )
     {
         this.tlv = currentTLV;
@@ -178,6 +187,7 @@ public abstract class AbstractContainer
     /**
      * {@inheritDoc}
      */
+    @Override
     public TLV getCurrentTLV()
     {
         return this.tlv;
@@ -187,6 +197,7 @@ public abstract class AbstractContainer
     /**
      * {@inheritDoc}
      */
+    @Override
     public TLV getParentTLV()
     {
         return parentTLV;
@@ -196,6 +207,7 @@ public abstract class AbstractContainer
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setParentTLV( TLV parentTLV )
     {
         this.parentTLV = parentTLV;
@@ -217,6 +229,7 @@ public abstract class AbstractContainer
     /**
      * {@inheritDoc}
      */
+    @Override
     public int getNewTlvId()
     {
         return id++;
@@ -226,6 +239,7 @@ public abstract class AbstractContainer
     /**
      * {@inheritDoc}
      */
+    @Override
     public int getTlvId()
     {
         return tlv.getId();
@@ -235,6 +249,7 @@ public abstract class AbstractContainer
     /**
      * {@inheritDoc}
      */
+    @Override
     public int getDecodedBytes()
     {
         return decodedBytes;
@@ -244,6 +259,7 @@ public abstract class AbstractContainer
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setDecodedBytes( int decodedBytes )
     {
         this.decodedBytes = decodedBytes;
@@ -253,6 +269,7 @@ public abstract class AbstractContainer
     /**
      * {@inheritDoc}
      */
+    @Override
     public void incrementDecodedBytes( int nb )
     {
         decodedBytes += nb;
@@ -262,6 +279,7 @@ public abstract class AbstractContainer
     /**
      * {@inheritDoc}
      */
+    @Override
     public int getMaxPDUSize()
     {
         return maxPDUSize;
@@ -271,6 +289,7 @@ public abstract class AbstractContainer
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setMaxPDUSize( int maxPDUSize )
     {
         if ( maxPDUSize > 0 )
@@ -287,6 +306,7 @@ public abstract class AbstractContainer
     /**
      * {@inheritDoc}
      */
+    @Override
     public ByteBuffer getStream()
     {
         return stream;
@@ -296,6 +316,7 @@ public abstract class AbstractContainer
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setStream( ByteBuffer stream )
     {
         this.stream = stream;
@@ -305,6 +326,7 @@ public abstract class AbstractContainer
     /**
      * {@inheritDoc}
      */
+    @Override
     public void rewind()
     {
 
@@ -316,6 +338,7 @@ public abstract class AbstractContainer
     /**
      * {@inheritDoc}
      */
+    @Override
     public void updateParent()
     {
         TLV parentTlv = tlv.getParent();
@@ -332,6 +355,7 @@ public abstract class AbstractContainer
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isGathering()
     {
         return gathering;
@@ -341,9 +365,9 @@ public abstract class AbstractContainer
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setGathering( boolean gathering )
     {
         this.gathering = gathering;
     }
-
 }

Modified: directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/Asn1Decoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/Asn1Decoder.java?rev=1771029&r1=1771028&r2=1771029&view=diff
==============================================================================
--- directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/Asn1Decoder.java
(original)
+++ directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/Asn1Decoder.java
Wed Nov 23 19:15:07 2016
@@ -125,7 +125,7 @@ public class Asn1Decoder implements TLVB
      */
     private void dumpTLVTree( Asn1Container container )
     {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         TLV current = container.getCurrentTLV();
 
         sb.append( "TLV" ).append( Asn1StringUtils.dumpByte( current.getTag() ) ).append(
"(" ).append(
@@ -172,7 +172,7 @@ public class Asn1Decoder implements TLVB
 
         if ( ( value != null ) && ( value.getData() != null ) )
         {
-            return ( current.getExpectedLength() == value.getData().length );
+            return current.getExpectedLength() == value.getData().length;
         }
         else
         {
@@ -307,7 +307,7 @@ public class Asn1Decoder implements TLVB
      */
     private String getParentLength( TLV tlv )
     {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder buffer = new StringBuilder();
 
         buffer.append( "TLV expected length stack : " );
 
@@ -789,6 +789,7 @@ public class Asn1Decoder implements TLVB
     /**
      * {@inheritDoc}
      */
+    @Override
     public int getMaxLengthLength()
     {
         return maxLengthLength;
@@ -798,6 +799,7 @@ public class Asn1Decoder implements TLVB
     /**
      * {@inheritDoc}
      */
+    @Override
     public int getMaxTagLength()
     {
         return maxTagLength;
@@ -807,6 +809,7 @@ public class Asn1Decoder implements TLVB
     /**
      * {@inheritDoc}
      */
+    @Override
     public void disallowIndefiniteLength()
     {
         this.indefiniteLengthAllowed = false;
@@ -816,6 +819,7 @@ public class Asn1Decoder implements TLVB
     /**
      * {@inheritDoc}
      */
+    @Override
     public void allowIndefiniteLength()
     {
         this.indefiniteLengthAllowed = true;
@@ -825,6 +829,7 @@ public class Asn1Decoder implements TLVB
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isIndefiniteLengthAllowed()
     {
 
@@ -835,6 +840,7 @@ public class Asn1Decoder implements TLVB
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setMaxLengthLength( int maxLengthLength ) throws DecoderException
     {
         if ( ( this.indefiniteLengthAllowed ) && ( maxLengthLength > 126 ) )
@@ -849,6 +855,7 @@ public class Asn1Decoder implements TLVB
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setMaxTagLength( int maxTagLength )
     {
         this.maxTagLength = maxTagLength;

Modified: directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/AbstractGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/AbstractGrammar.java?rev=1771029&r1=1771028&r2=1771029&view=diff
==============================================================================
--- directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/AbstractGrammar.java
(original)
+++ directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/AbstractGrammar.java
Wed Nov 23 19:15:07 2016
@@ -64,6 +64,7 @@ public abstract class AbstractGrammar<C
     /**
      * {@inheritDoc}
      */
+    @Override
     public String getName()
     {
         return name;
@@ -73,6 +74,7 @@ public abstract class AbstractGrammar<C
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setName( String name )
     {
         this.name = name;
@@ -95,6 +97,7 @@ public abstract class AbstractGrammar<C
     /**
      * {@inheritDoc}
      */
+    @Override
     public void executeAction( C container ) throws DecoderException
     {
 

Modified: directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/GrammarAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/GrammarAction.java?rev=1771029&r1=1771028&r2=1771029&view=diff
==============================================================================
--- directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/GrammarAction.java
(original)
+++ directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/grammar/GrammarAction.java
Wed Nov 23 19:15:07 2016
@@ -59,6 +59,7 @@ public abstract class GrammarAction<C ex
      * 
      * @return The action's name
      */
+    @Override
     public String toString()
     {
         return name;

Modified: directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/BerValue.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/BerValue.java?rev=1771029&r1=1771028&r2=1771029&view=diff
==============================================================================
--- directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/BerValue.java
(original)
+++ directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/BerValue.java
Wed Nov 23 19:15:07 2016
@@ -310,7 +310,7 @@ public class BerValue
      */
     public static byte[] getBytes( int value )
     {
-        byte[] bytes = null;
+        byte[] bytes;
 
         if ( value >= 0 )
         {
@@ -354,9 +354,6 @@ public class BerValue
             }
             else
             {
-                // We have to compute the complement, and add 1
-                //value = ( ~value ) + 1;
-
                 if ( value >= 0xFFFFFF80 )
                 {
                     bytes = new byte[1];
@@ -455,7 +452,7 @@ public class BerValue
      */
     public static byte[] getBytes( long value )
     {
-        byte[] bytes = null;
+        byte[] bytes;
 
         if ( value >= 0 )
         {
@@ -545,9 +542,6 @@ public class BerValue
             }
             else
             {
-                // We have to compute the complement, and add 1
-                // value = ( ~value ) + 1;
-
                 if ( value >= 0xFFFFFFFFFFFFFF80L )
                 {
                     bytes = new byte[1];

Modified: directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/TLV.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/TLV.java?rev=1771029&r1=1771028&r2=1771029&view=diff
==============================================================================
--- directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/TLV.java
(original)
+++ directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/tlv/TLV.java
Wed Nov 23 19:15:07 2016
@@ -443,6 +443,7 @@ public class TLV
      * 
      * @return A String
      */
+    @Override
     public String toString()
     {
 



Mime
View raw message