You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by allquantor <gi...@git.apache.org> on 2016/11/15 11:04:24 UTC

[GitHub] commons-lang pull request #211: Fixed possible infinite loop in random of Ra...

GitHub user allquantor opened a pull request:

    https://github.com/apache/commons-lang/pull/211

     Fixed possible infinite loop in random of RandomStringUtils

    Hi,
    I faced that the `random` method can cause an infinite loop. It can be caused if the **end** parameter is too low for generating either numbers (< 48) or letters (<65). I added some exception tests to make the cases clear. Basically, if we call the random function with for example `numbers = true && end < 48
    `
    the validation for  `Character.isDigit(ch)` will fail and we increment count  `count++`.
    
    Moreover:
    
    - Removed the white spaces in RandomStringUtilsTest.java 
    - Added the terms (inclusive) (exclusive) to the Javadoc of the random method to make it more clear.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/allquantor/commons-lang bugfix/infinite-loop-random

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/commons-lang/pull/211.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #211
    
----
commit 5779612199c76bd218223dc7da4446bf6760640d
Author: Ivan Morozov <iv...@kreditech.com>
Date:   2016-11-15T10:49:11Z

    1.) Fixed possible infinite loop that can be caused by generating either digits or letters by calling with a to low end param. 2.) Added (inclusive) and (exclusive) terms to javadoc of random method

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang issue #211: Fixed possible infinite loop in random of RandomStr...

Posted by PascalSchumacher <gi...@git.apache.org>.
Github user PascalSchumacher commented on the issue:

    https://github.com/apache/commons-lang/pull/211
  
    related issue: https://issues.apache.org/jira/browse/LANG-806 
    
    I guess this pull request fixes the most important part of the issue.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang issue #211: Fixed possible infinite loop in random of RandomStr...

Posted by allquantor <gi...@git.apache.org>.
Github user allquantor commented on the issue:

    https://github.com/apache/commons-lang/pull/211
  
    @PascalSchumacher got you. PR is updated.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang issue #211: Fixed possible infinite loop in random of RandomStr...

Posted by PascalSchumacher <gi...@git.apache.org>.
Github user PascalSchumacher commented on the issue:

    https://github.com/apache/commons-lang/pull/211
  
    Thanks for the pull request. :)
    
    Please do not mix formatting/white-space changes with functional changes in commit.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang issue #211: Fixed possible infinite loop in random of RandomStr...

Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:

    https://github.com/apache/commons-lang/pull/211
  
    
    [![Coverage Status](https://coveralls.io/builds/8852808/badge)](https://coveralls.io/builds/8852808)
    
    Coverage increased (+0.002%) to 93.565% when pulling **cc7e1a373dc9ece4c86faa9fda7122643eb155a1 on allquantor:bugfix/infinite-loop-random** into **0f6a292a29fedd49741310cd517ac4ba907bf8d4 on apache:master**.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang issue #211: Fixed possible infinite loop in random of RandomStr...

Posted by PascalSchumacher <gi...@git.apache.org>.
Github user PascalSchumacher commented on the issue:

    https://github.com/apache/commons-lang/pull/211
  
    Thanks! :+1:


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang issue #211: Fixed possible infinite loop in random of RandomStr...

Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:

    https://github.com/apache/commons-lang/pull/211
  
    
    [![Coverage Status](https://coveralls.io/builds/8852871/badge)](https://coveralls.io/builds/8852871)
    
    Coverage increased (+0.02%) to 93.587% when pulling **a96828b77e2ba86f8e10d5911372653a19790d3f on allquantor:bugfix/infinite-loop-random** into **0f6a292a29fedd49741310cd517ac4ba907bf8d4 on apache:master**.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang issue #211: Fixed possible infinite loop in random of RandomStr...

Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:

    https://github.com/apache/commons-lang/pull/211
  
    
    [![Coverage Status](https://coveralls.io/builds/8830039/badge)](https://coveralls.io/builds/8830039)
    
    Coverage increased (+0.02%) to 93.58% when pulling **5779612199c76bd218223dc7da4446bf6760640d on allquantor:bugfix/infinite-loop-random** into **0f6a292a29fedd49741310cd517ac4ba907bf8d4 on apache:master**.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request #211: Fixed possible infinite loop in random of Ra...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/commons-lang/pull/211


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---