directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1786287 - /directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/valueeditors/AbstractInPlaceStringValueEditor.java
Date Fri, 10 Mar 2017 05:23:21 GMT
Author: elecharny
Date: Fri Mar 10 05:23:21 2017
New Revision: 1786287

URL: http://svn.apache.org/viewvc?rev=1786287&view=rev
Log:
o Fixed a typo
o Fixed SonnarLint warnings

Modified:
    directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/valueeditors/AbstractInPlaceStringValueEditor.java

Modified: directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/valueeditors/AbstractInPlaceStringValueEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/valueeditors/AbstractInPlaceStringValueEditor.java?rev=1786287&r1=1786286&r2=1786287&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/valueeditors/AbstractInPlaceStringValueEditor.java
(original)
+++ directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/valueeditors/AbstractInPlaceStringValueEditor.java
Fri Mar 10 05:23:21 2017
@@ -38,7 +38,7 @@ import org.eclipse.jface.viewers.TextCel
 /**
  * 
  * Abstract base class for value editors that handle string values
- * withing the table or tree control. 
+ * within the table or tree control. 
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -80,6 +80,7 @@ public abstract class AbstractInPlaceStr
      * This implementation of getDisplayValue() returns a 
      * comma-separated list of all values. 
      */
+    @Override
     public String getDisplayValue( AttributeHierarchy attributeHierarchy )
     {
         if ( attributeHierarchy == null )
@@ -87,14 +88,14 @@ public abstract class AbstractInPlaceStr
             return NULL;
         }
 
-        List<IValue> valueList = new ArrayList<IValue>();
+        List<IValue> valueList = new ArrayList<>();
         
         for ( IAttribute attribute : attributeHierarchy )
         {
             valueList.addAll( Arrays.asList( attribute.getValues() ) );
         }
 
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         boolean isFirst = true;
         
         for ( IValue value : valueList )
@@ -120,6 +121,7 @@ public abstract class AbstractInPlaceStr
      * 
      * This implementation just returns the raw value
      */
+    @Override
     public String getDisplayValue( IValue value )
     {
         Object obj = getRawValue( value );
@@ -134,6 +136,7 @@ public abstract class AbstractInPlaceStr
      * in attributeHierarchy or calls getRawValue(IValue) if attributeHierarchy
      * contains exactly one value. Otherwise null is returned.
      */
+    @Override
     public Object getRawValue( AttributeHierarchy attributeHierarchy )
     {
         if ( ( attributeHierarchy != null ) && ( attributeHierarchy.size() == 1 )
)
@@ -162,6 +165,7 @@ public abstract class AbstractInPlaceStr
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean hasValue( IValue value )
     {
         return ( value != null ) && ( value.isString() || value.isBinary() );
@@ -174,6 +178,7 @@ public abstract class AbstractInPlaceStr
      * This implementation returns the string value 
      * of the given value. 
      */
+    @Override
     public Object getRawValue( IValue value )
     {
         return StringValueEditorUtils.getRawValue( value );
@@ -186,6 +191,7 @@ public abstract class AbstractInPlaceStr
      * This implementation always return the string value
      * as String.
      */
+    @Override
     public Object getStringOrBinaryValue( Object rawValue )
     {
         return StringValueEditorUtils.getStringOrBinaryValue( rawValue );
@@ -195,6 +201,7 @@ public abstract class AbstractInPlaceStr
     /**
      * {@inheritDoc}
      */
+    @Override
     public CellEditor getCellEditor()
     {
         return this;
@@ -204,6 +211,7 @@ public abstract class AbstractInPlaceStr
     /**
      * {@inheritDoc}
      */
+    @Override
     protected Object doGetValue()
     {
         if ( EMPTY.equals( text.getText() ) )
@@ -220,20 +228,24 @@ public abstract class AbstractInPlaceStr
     /**
      * {@inheritDoc}
      */
+    @Override
     protected void doSetValue( Object value )
     {
         if ( value instanceof IValue.EmptyValue )
         {
-            value = ( ( IValue.EmptyValue ) value ).getStringValue();
+            super.doSetValue( ( ( IValue.EmptyValue ) value ).getStringValue() );
+        }
+        else
+        {
+            super.doSetValue( value );
         }
-        
-        super.doSetValue( value );
     }
 
 
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setValueEditorName( String name )
     {
         this.name = name;
@@ -243,6 +255,7 @@ public abstract class AbstractInPlaceStr
     /**
      * {@inheritDoc}
      */
+    @Override
     public String getValueEditorName()
     {
         return name;
@@ -252,6 +265,7 @@ public abstract class AbstractInPlaceStr
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setValueEditorImageDescriptor( ImageDescriptor imageDescriptor )
     {
         this.imageDescriptor = imageDescriptor;
@@ -261,6 +275,7 @@ public abstract class AbstractInPlaceStr
     /**
      * {@inheritDoc}
      */
+    @Override
     public ImageDescriptor getValueEditorImageDescriptor()
     {
         return imageDescriptor;



Mime
View raw message