You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Ivica Mikic (JIRA)" <ji...@apache.org> on 2008/11/17 18:05:44 UTC

[jira] Created: (LANG-471) I would like to add isLowerCase and isUpperCase methods to the lang package

I would like to add isLowerCase and isUpperCase methods to the lang package
---------------------------------------------------------------------------

                 Key: LANG-471
                 URL: https://issues.apache.org/jira/browse/LANG-471
             Project: Commons Lang
          Issue Type: Improvement
    Affects Versions: 2.4
            Reporter: Ivica Mikic
            Priority: Minor


public static boolean isLowerCase(String s)
  {
  if (s == null || s.trim().length() == 0) return s;
  
  char[] chars = new char[s.length()];
  s.getChars(0, s.length(), chars, 0);
  boolean ilc = true;
  for (int i = 0; i < chars.length; i++)
    {
    if (Character.isUpperCase(chars[i]))
      {
      ilc = false;
      break;
      }
    }
  
  return ilc;
  }
  
  
public static boolean isUpperCase(String s)
  {
  if (s == null || s.trim().length() == 0) return s;
  
  char[] chars = new char[s.length()];
  s.getChars(0, s.length(), chars, 0);
  boolean iuc = true;
  for (int i = 0; i < chars.length; i++)
    {
    if (Character.isLowerCase(chars[i]))
      {
      iuc = false;
      break;
      }
    }
  
  return iuc;
  }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LANG-471) I would like to add isLowerCase and isUpperCase methods to WordUtils in the commons.lang package

Posted by "Vincent Ricard (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-471?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vincent Ricard updated LANG-471:
--------------------------------

    Attachment: LANG-471.patch

Here is a patch.

> I would like to add isLowerCase and isUpperCase methods to WordUtils in the commons.lang package
> ------------------------------------------------------------------------------------------------
>
>                 Key: LANG-471
>                 URL: https://issues.apache.org/jira/browse/LANG-471
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 2.4
>            Reporter: Ivica Mikic
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: LANG-471.patch
>
>   Original Estimate: 0.25h
>  Remaining Estimate: 0.25h
>
> public static boolean isLowerCase(String s)
>   {
>   if (s == null || s.trim().length() == 0) return false;
>   
>   char[] chars = new char[s.length()];
>   s.getChars(0, s.length(), chars, 0);
>   boolean ilc = true;
>   for (int i = 0; i < chars.length; i++)
>     {
>     if (Character.isUpperCase(chars[i]))
>       {
>       ilc = false;
>       break;
>       }
>     }
>   
>   return ilc;
>   }
>   
>   
> public static boolean isUpperCase(String s)
>   {
>   if (s == null || s.trim().length() == 0) return false;
>   
>   char[] chars = new char[s.length()];
>   s.getChars(0, s.length(), chars, 0);
>   boolean iuc = true;
>   for (int i = 0; i < chars.length; i++)
>     {
>     if (Character.isLowerCase(chars[i]))
>       {
>       iuc = false;
>       break;
>       }
>     }
>   
>   return iuc;
>   }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LANG-471) I would like to add isLowerCase and isUpperCase methods to WordUtils in the lang package

Posted by "Ivica Mikic (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-471?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivica Mikic updated LANG-471:
-----------------------------

    Summary: I would like to add isLowerCase and isUpperCase methods to WordUtils in the lang package  (was: I would like to add isLowerCase and isUpperCase methods to the lang package)

> I would like to add isLowerCase and isUpperCase methods to WordUtils in the lang package
> ----------------------------------------------------------------------------------------
>
>                 Key: LANG-471
>                 URL: https://issues.apache.org/jira/browse/LANG-471
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 2.4
>            Reporter: Ivica Mikic
>            Priority: Minor
>   Original Estimate: 0.25h
>  Remaining Estimate: 0.25h
>
> public static boolean isLowerCase(String s)
>   {
>   if (s == null || s.trim().length() == 0) return s;
>   
>   char[] chars = new char[s.length()];
>   s.getChars(0, s.length(), chars, 0);
>   boolean ilc = true;
>   for (int i = 0; i < chars.length; i++)
>     {
>     if (Character.isUpperCase(chars[i]))
>       {
>       ilc = false;
>       break;
>       }
>     }
>   
>   return ilc;
>   }
>   
>   
> public static boolean isUpperCase(String s)
>   {
>   if (s == null || s.trim().length() == 0) return s;
>   
>   char[] chars = new char[s.length()];
>   s.getChars(0, s.length(), chars, 0);
>   boolean iuc = true;
>   for (int i = 0; i < chars.length; i++)
>     {
>     if (Character.isLowerCase(chars[i]))
>       {
>       iuc = false;
>       break;
>       }
>     }
>   
>   return iuc;
>   }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LANG-471) I would like to add isLowerCase and isUpperCase methods to WordUtils in the commons.lang package

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-471?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Niall Pemberton updated LANG-471:
---------------------------------

    Fix Version/s:     (was: 3.0)
                   2.5

> I would like to add isLowerCase and isUpperCase methods to WordUtils in the commons.lang package
> ------------------------------------------------------------------------------------------------
>
>                 Key: LANG-471
>                 URL: https://issues.apache.org/jira/browse/LANG-471
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>    Affects Versions: 2.4
>            Reporter: Ivica Mikic
>            Priority: Minor
>             Fix For: 2.5
>
>         Attachments: LANG-471.patch
>
>   Original Estimate: 0.25h
>  Remaining Estimate: 0.25h
>
> public static boolean isLowerCase(String s)
>   {
>   if (s == null || s.trim().length() == 0) return false;
>   
>   char[] chars = new char[s.length()];
>   s.getChars(0, s.length(), chars, 0);
>   boolean ilc = true;
>   for (int i = 0; i < chars.length; i++)
>     {
>     if (Character.isUpperCase(chars[i]))
>       {
>       ilc = false;
>       break;
>       }
>     }
>   
>   return ilc;
>   }
>   
>   
> public static boolean isUpperCase(String s)
>   {
>   if (s == null || s.trim().length() == 0) return false;
>   
>   char[] chars = new char[s.length()];
>   s.getChars(0, s.length(), chars, 0);
>   boolean iuc = true;
>   for (int i = 0; i < chars.length; i++)
>     {
>     if (Character.isLowerCase(chars[i]))
>       {
>       iuc = false;
>       break;
>       }
>     }
>   
>   return iuc;
>   }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (LANG-471) I would like to add isLowerCase and isUpperCase methods to WordUtils in the commons.lang package

Posted by "Ivica Mikic (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12648237#action_12648237 ] 

Ivica Mikic commented on LANG-471:
----------------------------------

Yes, StringUtils is more appropriate. What do I need to do to ensure it's included in the next version/release? Thanks.

> I would like to add isLowerCase and isUpperCase methods to WordUtils in the commons.lang package
> ------------------------------------------------------------------------------------------------
>
>                 Key: LANG-471
>                 URL: https://issues.apache.org/jira/browse/LANG-471
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 2.4
>            Reporter: Ivica Mikic
>            Priority: Minor
>   Original Estimate: 0.25h
>  Remaining Estimate: 0.25h
>
> public static boolean isLowerCase(String s)
>   {
>   if (s == null || s.trim().length() == 0) return false;
>   
>   char[] chars = new char[s.length()];
>   s.getChars(0, s.length(), chars, 0);
>   boolean ilc = true;
>   for (int i = 0; i < chars.length; i++)
>     {
>     if (Character.isUpperCase(chars[i]))
>       {
>       ilc = false;
>       break;
>       }
>     }
>   
>   return ilc;
>   }
>   
>   
> public static boolean isUpperCase(String s)
>   {
>   if (s == null || s.trim().length() == 0) return false;
>   
>   char[] chars = new char[s.length()];
>   s.getChars(0, s.length(), chars, 0);
>   boolean iuc = true;
>   for (int i = 0; i < chars.length; i++)
>     {
>     if (Character.isLowerCase(chars[i]))
>       {
>       iuc = false;
>       break;
>       }
>     }
>   
>   return iuc;
>   }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (LANG-471) I would like to add isLowerCase and isUpperCase methods to WordUtils in the commons.lang package

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-471?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell closed LANG-471.
------------------------------

    Resolution: Fixed

Thanks Vincent.

svn ci -m "Applying Vincent Ricard's patch in LANG-471 (reported by Ivica Mikic) adding isAllUpperCase and isAllLowerCase to StringUtils"

Sending        src/java/org/apache/commons/lang/StringUtils.java
Sending        src/test/org/apache/commons/lang/StringUtilsTest.java
Transmitting file data ..
Committed revision 789573.

> I would like to add isLowerCase and isUpperCase methods to WordUtils in the commons.lang package
> ------------------------------------------------------------------------------------------------
>
>                 Key: LANG-471
>                 URL: https://issues.apache.org/jira/browse/LANG-471
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 2.4
>            Reporter: Ivica Mikic
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: LANG-471.patch
>
>   Original Estimate: 0.25h
>  Remaining Estimate: 0.25h
>
> public static boolean isLowerCase(String s)
>   {
>   if (s == null || s.trim().length() == 0) return false;
>   
>   char[] chars = new char[s.length()];
>   s.getChars(0, s.length(), chars, 0);
>   boolean ilc = true;
>   for (int i = 0; i < chars.length; i++)
>     {
>     if (Character.isUpperCase(chars[i]))
>       {
>       ilc = false;
>       break;
>       }
>     }
>   
>   return ilc;
>   }
>   
>   
> public static boolean isUpperCase(String s)
>   {
>   if (s == null || s.trim().length() == 0) return false;
>   
>   char[] chars = new char[s.length()];
>   s.getChars(0, s.length(), chars, 0);
>   boolean iuc = true;
>   for (int i = 0; i < chars.length; i++)
>     {
>     if (Character.isLowerCase(chars[i]))
>       {
>       iuc = false;
>       break;
>       }
>     }
>   
>   return iuc;
>   }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (LANG-471) I would like to add isLowerCase and isUpperCase methods to WordUtils in the commons.lang package

Posted by "James Carman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12648256#action_12648256 ] 

James Carman commented on LANG-471:
-----------------------------------

Providing a proper patch (with test cases) would be a great start.

> I would like to add isLowerCase and isUpperCase methods to WordUtils in the commons.lang package
> ------------------------------------------------------------------------------------------------
>
>                 Key: LANG-471
>                 URL: https://issues.apache.org/jira/browse/LANG-471
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 2.4
>            Reporter: Ivica Mikic
>            Priority: Minor
>   Original Estimate: 0.25h
>  Remaining Estimate: 0.25h
>
> public static boolean isLowerCase(String s)
>   {
>   if (s == null || s.trim().length() == 0) return false;
>   
>   char[] chars = new char[s.length()];
>   s.getChars(0, s.length(), chars, 0);
>   boolean ilc = true;
>   for (int i = 0; i < chars.length; i++)
>     {
>     if (Character.isUpperCase(chars[i]))
>       {
>       ilc = false;
>       break;
>       }
>     }
>   
>   return ilc;
>   }
>   
>   
> public static boolean isUpperCase(String s)
>   {
>   if (s == null || s.trim().length() == 0) return false;
>   
>   char[] chars = new char[s.length()];
>   s.getChars(0, s.length(), chars, 0);
>   boolean iuc = true;
>   for (int i = 0; i < chars.length; i++)
>     {
>     if (Character.isLowerCase(chars[i]))
>       {
>       iuc = false;
>       break;
>       }
>     }
>   
>   return iuc;
>   }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (LANG-471) I would like to add isLowerCase and isUpperCase methods to WordUtils in the commons.lang package

Posted by "James Carman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12648219#action_12648219 ] 

James Carman commented on LANG-471:
-----------------------------------

I don't know if it belongs in WordUtils.  I'd say put it in StringUtils.  You might also want to call them isAllUpperCase() or isAllLowerCase().

> I would like to add isLowerCase and isUpperCase methods to WordUtils in the commons.lang package
> ------------------------------------------------------------------------------------------------
>
>                 Key: LANG-471
>                 URL: https://issues.apache.org/jira/browse/LANG-471
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 2.4
>            Reporter: Ivica Mikic
>            Priority: Minor
>   Original Estimate: 0.25h
>  Remaining Estimate: 0.25h
>
> public static boolean isLowerCase(String s)
>   {
>   if (s == null || s.trim().length() == 0) return false;
>   
>   char[] chars = new char[s.length()];
>   s.getChars(0, s.length(), chars, 0);
>   boolean ilc = true;
>   for (int i = 0; i < chars.length; i++)
>     {
>     if (Character.isUpperCase(chars[i]))
>       {
>       ilc = false;
>       break;
>       }
>     }
>   
>   return ilc;
>   }
>   
>   
> public static boolean isUpperCase(String s)
>   {
>   if (s == null || s.trim().length() == 0) return false;
>   
>   char[] chars = new char[s.length()];
>   s.getChars(0, s.length(), chars, 0);
>   boolean iuc = true;
>   for (int i = 0; i < chars.length; i++)
>     {
>     if (Character.isLowerCase(chars[i]))
>       {
>       iuc = false;
>       break;
>       }
>     }
>   
>   return iuc;
>   }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LANG-471) I would like to add isLowerCase and isUpperCase methods to WordUtils in the commons.lang package

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-471?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell updated LANG-471:
-------------------------------

    Fix Version/s: 3.0

> I would like to add isLowerCase and isUpperCase methods to WordUtils in the commons.lang package
> ------------------------------------------------------------------------------------------------
>
>                 Key: LANG-471
>                 URL: https://issues.apache.org/jira/browse/LANG-471
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 2.4
>            Reporter: Ivica Mikic
>            Priority: Minor
>             Fix For: 3.0
>
>   Original Estimate: 0.25h
>  Remaining Estimate: 0.25h
>
> public static boolean isLowerCase(String s)
>   {
>   if (s == null || s.trim().length() == 0) return false;
>   
>   char[] chars = new char[s.length()];
>   s.getChars(0, s.length(), chars, 0);
>   boolean ilc = true;
>   for (int i = 0; i < chars.length; i++)
>     {
>     if (Character.isUpperCase(chars[i]))
>       {
>       ilc = false;
>       break;
>       }
>     }
>   
>   return ilc;
>   }
>   
>   
> public static boolean isUpperCase(String s)
>   {
>   if (s == null || s.trim().length() == 0) return false;
>   
>   char[] chars = new char[s.length()];
>   s.getChars(0, s.length(), chars, 0);
>   boolean iuc = true;
>   for (int i = 0; i < chars.length; i++)
>     {
>     if (Character.isLowerCase(chars[i]))
>       {
>       iuc = false;
>       break;
>       }
>     }
>   
>   return iuc;
>   }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LANG-471) I would like to add isLowerCase and isUpperCase methods to WordUtils in the commons.lang package

Posted by "Ivica Mikic (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-471?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivica Mikic updated LANG-471:
-----------------------------

    Description: 
public static boolean isLowerCase(String s)
  {
  if (s == null || s.trim().length() == 0) return false;
  
  char[] chars = new char[s.length()];
  s.getChars(0, s.length(), chars, 0);
  boolean ilc = true;
  for (int i = 0; i < chars.length; i++)
    {
    if (Character.isUpperCase(chars[i]))
      {
      ilc = false;
      break;
      }
    }
  
  return ilc;
  }
  
  
public static boolean isUpperCase(String s)
  {
  if (s == null || s.trim().length() == 0) return false;
  
  char[] chars = new char[s.length()];
  s.getChars(0, s.length(), chars, 0);
  boolean iuc = true;
  for (int i = 0; i < chars.length; i++)
    {
    if (Character.isLowerCase(chars[i]))
      {
      iuc = false;
      break;
      }
    }
  
  return iuc;
  }

  was:
public static boolean isLowerCase(String s)
  {
  if (s == null || s.trim().length() == 0) return s;
  
  char[] chars = new char[s.length()];
  s.getChars(0, s.length(), chars, 0);
  boolean ilc = true;
  for (int i = 0; i < chars.length; i++)
    {
    if (Character.isUpperCase(chars[i]))
      {
      ilc = false;
      break;
      }
    }
  
  return ilc;
  }
  
  
public static boolean isUpperCase(String s)
  {
  if (s == null || s.trim().length() == 0) return s;
  
  char[] chars = new char[s.length()];
  s.getChars(0, s.length(), chars, 0);
  boolean iuc = true;
  for (int i = 0; i < chars.length; i++)
    {
    if (Character.isLowerCase(chars[i]))
      {
      iuc = false;
      break;
      }
    }
  
  return iuc;
  }


> I would like to add isLowerCase and isUpperCase methods to WordUtils in the commons.lang package
> ------------------------------------------------------------------------------------------------
>
>                 Key: LANG-471
>                 URL: https://issues.apache.org/jira/browse/LANG-471
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 2.4
>            Reporter: Ivica Mikic
>            Priority: Minor
>   Original Estimate: 0.25h
>  Remaining Estimate: 0.25h
>
> public static boolean isLowerCase(String s)
>   {
>   if (s == null || s.trim().length() == 0) return false;
>   
>   char[] chars = new char[s.length()];
>   s.getChars(0, s.length(), chars, 0);
>   boolean ilc = true;
>   for (int i = 0; i < chars.length; i++)
>     {
>     if (Character.isUpperCase(chars[i]))
>       {
>       ilc = false;
>       break;
>       }
>     }
>   
>   return ilc;
>   }
>   
>   
> public static boolean isUpperCase(String s)
>   {
>   if (s == null || s.trim().length() == 0) return false;
>   
>   char[] chars = new char[s.length()];
>   s.getChars(0, s.length(), chars, 0);
>   boolean iuc = true;
>   for (int i = 0; i < chars.length; i++)
>     {
>     if (Character.isLowerCase(chars[i]))
>       {
>       iuc = false;
>       break;
>       }
>     }
>   
>   return iuc;
>   }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LANG-471) I would like to add isLowerCase and isUpperCase methods to WordUtils in the commons.lang package

Posted by "Ivica Mikic (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-471?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivica Mikic updated LANG-471:
-----------------------------

    Summary: I would like to add isLowerCase and isUpperCase methods to WordUtils in the commons.lang package  (was: I would like to add isLowerCase and isUpperCase methods to WordUtils in the lang package)

> I would like to add isLowerCase and isUpperCase methods to WordUtils in the commons.lang package
> ------------------------------------------------------------------------------------------------
>
>                 Key: LANG-471
>                 URL: https://issues.apache.org/jira/browse/LANG-471
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 2.4
>            Reporter: Ivica Mikic
>            Priority: Minor
>   Original Estimate: 0.25h
>  Remaining Estimate: 0.25h
>
> public static boolean isLowerCase(String s)
>   {
>   if (s == null || s.trim().length() == 0) return s;
>   
>   char[] chars = new char[s.length()];
>   s.getChars(0, s.length(), chars, 0);
>   boolean ilc = true;
>   for (int i = 0; i < chars.length; i++)
>     {
>     if (Character.isUpperCase(chars[i]))
>       {
>       ilc = false;
>       break;
>       }
>     }
>   
>   return ilc;
>   }
>   
>   
> public static boolean isUpperCase(String s)
>   {
>   if (s == null || s.trim().length() == 0) return s;
>   
>   char[] chars = new char[s.length()];
>   s.getChars(0, s.length(), chars, 0);
>   boolean iuc = true;
>   for (int i = 0; i < chars.length; i++)
>     {
>     if (Character.isLowerCase(chars[i]))
>       {
>       iuc = false;
>       break;
>       }
>     }
>   
>   return iuc;
>   }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.