directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r631730 - /directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/filtereditor/FilterDamagerRepairer.java
Date Wed, 27 Feb 2008 21:11:51 GMT
Author: seelmann
Date: Wed Feb 27 13:11:50 2008
New Revision: 631730

URL: http://svn.apache.org/viewvc?rev=631730&view=rev
Log:
Fixed IllegalArgumentException with zero length

Modified:
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/filtereditor/FilterDamagerRepairer.java

Modified: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/filtereditor/FilterDamagerRepairer.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/filtereditor/FilterDamagerRepairer.java?rev=631730&r1=631729&r2=631730&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/filtereditor/FilterDamagerRepairer.java
(original)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/filtereditor/FilterDamagerRepairer.java
Wed Feb 27 13:11:50 2008
@@ -162,9 +162,12 @@
      */
     private void addStyleRange( TextPresentation presentation, LdapFilterToken token, TextAttribute
textAttribute )
     {
-        StyleRange range = new StyleRange( token.getOffset(), token.getLength(), textAttribute.getForeground(),
-            textAttribute.getBackground(), textAttribute.getStyle() );
-        presentation.addStyleRange( range );
+        if ( token.getLength() > 0 )
+        {
+            StyleRange range = new StyleRange( token.getOffset(), token.getLength(), textAttribute.getForeground(),
+                textAttribute.getBackground(), textAttribute.getStyle() );
+            presentation.addStyleRange( range );
+        }
     }
 
 }



Mime
View raw message