Re: [PR] [LANG-1772] Restrict size of cache to prevent overflow errors [commons-lang]

2025-05-24 Thread via GitHub
garydgregory merged PR #1379: URL: https://github.com/apache/commons-lang/pull/1379 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@c

Re: [PR] [LANG-1772] Restrict size of cache to prevent overflow errors [commons-lang]

2025-05-22 Thread via GitHub
ppkarwasz commented on code in PR #1379: URL: https://github.com/apache/commons-lang/pull/1379#discussion_r2103834348 ## src/main/java/org/apache/commons/lang3/RandomStringUtils.java: ## @@ -329,7 +333,16 @@ public static String random(int count, int start, int end, final boole

Re: [PR] [LANG-1772] Restrict size of cache to prevent overflow errors [commons-lang]

2025-05-22 Thread via GitHub
jcwinters commented on PR #1379: URL: https://github.com/apache/commons-lang/pull/1379#issuecomment-2900276181 I think I'm there now -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific c

Re: [PR] [LANG-1772] Restrict size of cache to prevent overflow errors [commons-lang]

2025-05-21 Thread via GitHub
ppkarwasz commented on code in PR #1379: URL: https://github.com/apache/commons-lang/pull/1379#discussion_r2100949198 ## src/main/java/org/apache/commons/lang3/RandomStringUtils.java: ## @@ -329,7 +329,10 @@ public static String random(int count, int start, int end, final boole

Re: [PR] [LANG-1772] Restrict size of cache to prevent overflow errors [commons-lang]

2025-05-21 Thread via GitHub
garydgregory commented on PR #1379: URL: https://github.com/apache/commons-lang/pull/1379#issuecomment-2897927983 Hi @jcwinters I still don't understand what the magic numbers mean, so constants with comments or a better code comment is needed IMO. -- This is an automated message from

Re: [PR] [LANG-1772] Restrict size of cache to prevent overflow errors [commons-lang]

2025-05-21 Thread via GitHub
garydgregory commented on PR #1379: URL: https://github.com/apache/commons-lang/pull/1379#issuecomment-2897919250 Hi @jcwinters, No need to apologize, we're all busy 😃 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub an

Re: [PR] [LANG-1772] Restrict size of cache to prevent overflow errors [commons-lang]

2025-05-20 Thread via GitHub
jcwinters commented on PR #1379: URL: https://github.com/apache/commons-lang/pull/1379#issuecomment-2896502012 I believe I've now incorporated most of the suggestions (I didn't use constants for the divide by 3 for instance) - sorry for the length of time this has taken -- This is an au

Re: [PR] [LANG-1772] Restrict size of cache to prevent overflow errors [commons-lang]

2025-05-16 Thread via GitHub
ppkarwasz commented on PR #1379: URL: https://github.com/apache/commons-lang/pull/1379#issuecomment-2887585781 > Where are we on this one? @ppkarwasz do you still plan on providing an alternative solution? This pull request appears to be nearly ready. It includes the following change

Re: [PR] [LANG-1772] Restrict size of cache to prevent overflow errors [commons-lang]

2025-05-16 Thread via GitHub
garydgregory commented on PR #1379: URL: https://github.com/apache/commons-lang/pull/1379#issuecomment-2887557770 Hi all, Where are we on this one? @ppkarwasz do you still plan on providing an alternative solution? -- This is an automated message from the Apache Git Service. To re

Re: [PR] [LANG-1772] Restrict size of cache to prevent overflow errors [commons-lang]

2025-05-13 Thread via GitHub
garydgregory commented on PR #1379: URL: https://github.com/apache/commons-lang/pull/1379#issuecomment-2876712217 @jcwinters Please 'mvn' by itself before you push to catch all build errors. -- This is an automated message from the Apache Git Service. To respond to the message, pl

Re: [PR] [LANG-1772] Restrict size of cache to prevent overflow errors [commons-lang]

2025-05-13 Thread via GitHub
ppkarwasz commented on code in PR #1379: URL: https://github.com/apache/commons-lang/pull/1379#discussion_r2086790446 ## src/main/java/org/apache/commons/lang3/CachedRandomBits.java: ## @@ -52,6 +52,16 @@ final class CachedRandomBits { */ private int bitIndex; +

Re: [PR] [LANG-1772] Restrict size of cache to prevent overflow errors [commons-lang]

2025-05-13 Thread via GitHub
jcwinters commented on code in PR #1379: URL: https://github.com/apache/commons-lang/pull/1379#discussion_r2086810278 ## src/main/java/org/apache/commons/lang3/RandomStringUtils.java: ## @@ -97,6 +97,7 @@ public class RandomStringUtils { private static final int ASCII_9 = '

Re: [PR] [LANG-1772] Restrict size of cache to prevent overflow errors [commons-lang]

2025-05-13 Thread via GitHub
ppkarwasz commented on code in PR #1379: URL: https://github.com/apache/commons-lang/pull/1379#discussion_r2086199080 ## src/main/java/org/apache/commons/lang3/RandomStringUtils.java: ## @@ -97,6 +97,7 @@ public class RandomStringUtils { private static final int ASCII_9 = '

Re: [PR] [LANG-1772] Restrict size of cache to prevent overflow errors [commons-lang]

2025-05-13 Thread via GitHub
jcwinters commented on code in PR #1379: URL: https://github.com/apache/commons-lang/pull/1379#discussion_r2086153654 ## src/main/java/org/apache/commons/lang3/RandomStringUtils.java: ## @@ -97,6 +97,7 @@ public class RandomStringUtils { private static final int ASCII_9 = '

Re: [PR] [LANG-1772] Restrict size of cache to prevent overflow errors [commons-lang]

2025-05-12 Thread via GitHub
ppkarwasz commented on code in PR #1379: URL: https://github.com/apache/commons-lang/pull/1379#discussion_r2085485496 ## src/main/java/org/apache/commons/lang3/RandomStringUtils.java: ## @@ -97,6 +97,7 @@ public class RandomStringUtils { private static final int ASCII_9 = '

Re: [PR] [LANG-1772] Restrict size of cache to prevent overflow errors [commons-lang]

2025-05-12 Thread via GitHub
ppkarwasz commented on PR #1379: URL: https://github.com/apache/commons-lang/pull/1379#issuecomment-2873964590 > You've proposed an alternative solution. Would you shows in a PR? I'll submit a PR by the end of the week. -- This is an automated message from the Apache Git Ser

Re: [PR] [LANG-1772] Restrict size of cache to prevent overflow errors [commons-lang]

2025-05-12 Thread via GitHub
garydgregory commented on code in PR #1379: URL: https://github.com/apache/commons-lang/pull/1379#discussion_r2085058140 ## src/main/java/org/apache/commons/lang3/RandomStringUtils.java: ## @@ -97,6 +97,7 @@ public class RandomStringUtils { private static final int ASCII_9

Re: [PR] [LANG-1772] Restrict size of cache to prevent overflow errors [commons-lang]

2025-05-12 Thread via GitHub
garydgregory commented on PR #1379: URL: https://github.com/apache/commons-lang/pull/1379#issuecomment-2873250469 Hi @ppkarwasz You've proposed an alternative solution. Would you shows in a PR? -- This is an automated message from the Apache Git Service. To respond to the messa

Re: [PR] [LANG-1772] Restrict size of cache to prevent overflow errors [commons-lang]

2025-05-08 Thread via GitHub
jcwinters commented on PR #1379: URL: https://github.com/apache/commons-lang/pull/1379#issuecomment-2863478821 > A simpler solution would be to: > > * Change the type of `bitIndex` to `long`, so it can count up to `8 * Integer.MAX_VALUE` > * Refactor the expression that compute

Re: [PR] [LANG-1772] Restrict size of cache to prevent overflow errors [commons-lang]

2025-05-08 Thread via GitHub
garydgregory commented on PR #1379: URL: https://github.com/apache/commons-lang/pull/1379#issuecomment-2862752705 The test as is blows up GitHub builds so let's use something like `@EnabledIfSystemProperty(named = "test.large.heap", matches = "true")` -- This is an automated message f

Re: [PR] LANG-1772 restrict size of cache to prevent overflow errors [commons-lang]

2025-05-08 Thread via GitHub
ppkarwasz commented on PR #1379: URL: https://github.com/apache/commons-lang/pull/1379#issuecomment-2862166291 > Added a length restriction to `RandomStringutils`, limiting the cache to 60M entries. Because of rejections the bitIndex in the underling cache can overflow when right shifting.

[PR] LANG-1772 restrict size of cache to prevent overflow errors [commons-lang]

2025-05-07 Thread via GitHub
jcwinters opened a new pull request, #1379: URL: https://github.com/apache/commons-lang/pull/1379 Added a length restriction to `RandomStringutils`, limiting the cache to 60M entries. Because of rejections the bitIndex in the underling cache can overflow when right shifting. Also added a