[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-10-12 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=327379=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-327379
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 12/Oct/19 19:18
Start Date: 12/Oct/19 19:18
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on issue #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#issuecomment-541353891
 
 
   @verhas 
   In git master; please verify and close.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 327379)
Remaining Estimate: 15h 20m  (was: 15.5h)
Time Spent: 8h 40m  (was: 8.5h)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 8h 40m
>  Remaining Estimate: 15h 20m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-10-12 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=327378=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-327378
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 12/Oct/19 19:16
Start Date: 12/Oct/19 19:16
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446
 
 
   
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 327378)
Remaining Estimate: 15.5h  (was: 15h 40m)
Time Spent: 8.5h  (was: 8h 20m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 8.5h
>  Remaining Estimate: 15.5h
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-10-09 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=325743=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-325743
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 09/Oct/19 14:49
Start Date: 09/Oct/19 14:49
Worklog Time Spent: 10m 
  Work Description: verhas commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r333058664
 
 

 ##
 File path: src/main/java/org/apache/commons/lang3/ClassUtils.java
 ##
 @@ -433,48 +440,82 @@ public static String getAbbreviatedName(final Class 
cls, final int len) {
  * "java.lang.String" 5"j.l.String"
  * "java.lang.String"15"j.lang.String"
  * 
"java.lang.String"30"java.lang.String"
+ * 
"org.apache.commons.lang3.ClassUtils"18"o.a.c.l.ClassUtils"
  * 
- * @param className  the className to get the abbreviated name for, may be 
{@code null}
- * @param len  the desired length of the abbreviated name
- * @return the abbreviated name or an empty string
- * @throws IllegalArgumentException if len = 0
+ *
+ * @param className the className to get the abbreviated name for, may be 
{@code null}
+ * @param len   the desired length of the abbreviated name
+ * @return the abbreviated name or an empty string if the specified
+ * class name is {@code null} or empty string
+ * @throws IllegalArgumentException if {@code len <= 0}
  * @since 3.4
  */
 public static String getAbbreviatedName(final String className, final int 
len) {
-  if (len <= 0) {
-throw new IllegalArgumentException("len must be > 0");
-  }
-  if (className == null) {
-return StringUtils.EMPTY;
-  }
-
-  int availableSpace = len;
-  final int packageLevels = StringUtils.countMatches(className, '.');
-  final String[] output = new String[packageLevels + 1];
-  int endIndex = className.length() - 1;
-  for (int level = packageLevels; level >= 0; level--) {
-final int startIndex = className.lastIndexOf('.', endIndex);
-final String part = className.substring(startIndex + 1, endIndex + 1);
-availableSpace -= part.length();
-if (level > 0) {
-  // all elements except top level require an additional char space
-  availableSpace--;
+if (len <= 0) {
+throw new IllegalArgumentException("len must be > 0");
 }
-if (level == packageLevels) {
-  // ClassName is always complete
-  output[level] = part;
-} else {
-  if (availableSpace > 0) {
-output[level] = part;
-  } else {
-// if no space is left still the first char is used
-output[level] = part.substring(0, 1);
-  }
+if (className == null) {
+return StringUtils.EMPTY;
 }
-endIndex = startIndex - 1;
-  }
 
-  return StringUtils.join(output, '.');
+final char[] abbreviated = className.toCharArray();
+int target = 0;
+int source = 0;
+while (source < abbreviated.length) {
+// copy the next part
+int runAheadTarget = target;
+while (source < abbreviated.length && abbreviated[source] != '.') {
+abbreviated[runAheadTarget++] = abbreviated[source++];
+}
+
+++target;
+if (useFull(runAheadTarget, source, abbreviated.length, len)
+|| target > runAheadTarget) {
+target = runAheadTarget;
+}
+
+// copy the '.' unless it was the last part
+if (source < abbreviated.length) {
+abbreviated[target++] = abbreviated[source++];
+}
+}
+return new String(abbreviated, 0, target);
+}
+
+/**
+ * Decides if the part that was just copied to its destination
+ * location in the work array can be kept as it was copied or must be
+ * abbreviated. It must be kept when the part is the last one, which
+ * is the simple name of the class. In this case the {@code source}
+ * index, from where the characters are copied points one position
+ * after the last character, a.k.a. {@code source ==
+ * originalLength}
+ *
+ * If the part is not the last one then it can be kept
+ * unabridged if the number of the characters copied so far plus
+ * the character that are to be copied is less than or equal to the
+ * desired length.
+ *
+ * @param runAheadTarget the target index (where the characters were
+ *   copied to) pointing after the last character
+ *   copied when the current part was copied
+ * @param source the source index (where the 

[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-10-09 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=325741=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-325741
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 09/Oct/19 14:48
Start Date: 09/Oct/19 14:48
Worklog Time Spent: 10m 
  Work Description: verhas commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r325709633
 
 

 ##
 File path: src/main/java/org/apache/commons/lang3/ClassUtils.java
 ##
 @@ -433,48 +440,82 @@ public static String getAbbreviatedName(final Class 
cls, final int len) {
  * "java.lang.String" 5"j.l.String"
  * "java.lang.String"15"j.lang.String"
  * 
"java.lang.String"30"java.lang.String"
+ * 
"org.apache.commons.lang3.ClassUtils"18"o.a.c.l.ClassUtils"
  * 
- * @param className  the className to get the abbreviated name for, may be 
{@code null}
- * @param len  the desired length of the abbreviated name
- * @return the abbreviated name or an empty string
- * @throws IllegalArgumentException if len = 0
+ *
+ * @param className the className to get the abbreviated name for, may be 
{@code null}
+ * @param len   the desired length of the abbreviated name
+ * @return the abbreviated name or an empty string if the specified
 
 Review comment:
   It is not and it is described in detail in the above text. To be absolutely 
correct I added a half-sentence here as well.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 325741)
Remaining Estimate: 15h 50m  (was: 16h)
Time Spent: 8h 10m  (was: 8h)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 8h 10m
>  Remaining Estimate: 15h 50m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-10-09 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=325735=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-325735
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 09/Oct/19 14:42
Start Date: 09/Oct/19 14:42
Worklog Time Spent: 10m 
  Work Description: coveralls commented on issue #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#issuecomment-523879388
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/26208611/badge)](https://coveralls.io/builds/26208611)
   
   Coverage decreased (-0.007%) to 95.21% when pulling 
**2d0c0ac43c85a93720b0f7e9ceacad0d6422eb6a on verhas:LANG-1480** into 
**c42806cfa03979023e1a683edd0a221c51e6789c on apache:master**.
   
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 325735)
Remaining Estimate: 16h  (was: 16h 10m)
Time Spent: 8h  (was: 7h 50m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 8h
>  Remaining Estimate: 16h
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-10-08 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=325312=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-325312
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 08/Oct/19 20:24
Start Date: 08/Oct/19 20:24
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on issue #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#issuecomment-539688116
 
 
   @verhas 
   GitHub seems to think there conflicts here. May you rebase?
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 325312)
Remaining Estimate: 16h 10m  (was: 16h 20m)
Time Spent: 7h 50m  (was: 7h 40m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 7h 50m
>  Remaining Estimate: 16h 10m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-10-08 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=325131=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-325131
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 08/Oct/19 15:33
Start Date: 08/Oct/19 15:33
Worklog Time Spent: 10m 
  Work Description: verhas commented on issue #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#issuecomment-539570658
 
 
   I changed the test class and methods to be public.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 325131)
Remaining Estimate: 16h 20m  (was: 16.5h)
Time Spent: 7h 40m  (was: 7.5h)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 7h 40m
>  Remaining Estimate: 16h 20m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-10-06 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=324053=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-324053
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 06/Oct/19 14:47
Start Date: 06/Oct/19 14:47
Worklog Time Spent: 10m 
  Work Description: coveralls commented on issue #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#issuecomment-523879388
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/26139660/badge)](https://coveralls.io/builds/26139660)
   
   Coverage decreased (-0.005%) to 95.21% when pulling 
**63802bf3d5423a8abdc098549b472622a7a43772 on verhas:LANG-1480** into 
**24f66b175fdbc37c02ac234f1f3d7b2a5f13cc57 on apache:master**.
   
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 324053)
Remaining Estimate: 16.5h  (was: 16h 40m)
Time Spent: 7.5h  (was: 7h 20m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 7.5h
>  Remaining Estimate: 16.5h
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-26 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=319313=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-319313
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 27/Sep/19 01:48
Start Date: 27/Sep/19 01:48
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on issue #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#issuecomment-535749533
 
 
   > > > Please merge it instead of nitpicking.
   > > > That's not the best attitude IMO.
   > 
   > I said please. Btw: I opened a ticket 
https://issues.apache.org/jira/browse/LANG-1491 to fix this issue.
   
   It's rather simple IMO: this patch should be consistent with the current 
code base as it is now. IOW, tests are `public`.
   
   If someone wants to do the busy work of changing all of Commons Lang, more 
power to them, then the community can decide what to do, but this PR is not the 
place to do it.
   
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 319313)
Remaining Estimate: 16h 40m  (was: 16h 50m)
Time Spent: 7h 20m  (was: 7h 10m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 7h 20m
>  Remaining Estimate: 16h 40m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-26 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=319311=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-319311
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 27/Sep/19 01:45
Start Date: 27/Sep/19 01:45
Worklog Time Spent: 10m 
  Work Description: verhas commented on issue #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#issuecomment-535748891
 
 
   >>Please merge it instead of nitpicking.
   >That's not the best attitude IMO.
   
   I said please. Btw: I opened a ticket 
https://issues.apache.org/jira/browse/LANG-1491 to fix this issue.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 319311)
Remaining Estimate: 16h 50m  (was: 17h)
Time Spent: 7h 10m  (was: 7h)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 7h 10m
>  Remaining Estimate: 16h 50m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-26 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=319310=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-319310
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 27/Sep/19 01:44
Start Date: 27/Sep/19 01:44
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on issue #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#issuecomment-535747664
 
 
   > Please merge it instead of nitpicking.
   
   That's not the best attitude IMO. 
   
   If you want to follow JUnit 5 conventions, please provide a patch that is 
consistent over all classes and methods. Having a mix and public and package 
private will just be confusing to others who will not know which convention to 
follow.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 319310)
Remaining Estimate: 17h  (was: 17h 10m)
Time Spent: 7h  (was: 6h 50m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 7h
>  Remaining Estimate: 17h
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-26 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=319308=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-319308
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 27/Sep/19 01:40
Start Date: 27/Sep/19 01:40
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on issue #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#issuecomment-535747664
 
 
   > Please merge it instead of nitpicking.
   
   That's not the best attitude IMO.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 319308)
Remaining Estimate: 17h 10m  (was: 17h 20m)
Time Spent: 6h 50m  (was: 6h 40m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 6h 50m
>  Remaining Estimate: 17h 10m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-26 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=319303=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-319303
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 27/Sep/19 01:15
Start Date: 27/Sep/19 01:15
Worklog Time Spent: 10m 
  Work Description: verhas commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r328881438
 
 

 ##
 File path: src/test/java/org/apache/commons/lang3/ClassUtilsTest.java
 ##
 @@ -160,26 +162,59 @@ public void test_getAbbreviatedName_Class() {
 assertEquals("", ClassUtils.getAbbreviatedName((Class) null, 1));
 assertEquals("j.l.String", ClassUtils.getAbbreviatedName(String.class, 
1));
 assertEquals("j.l.String", ClassUtils.getAbbreviatedName(String.class, 
5));
+assertEquals("o.a.c.l.ClassUtils", 
ClassUtils.getAbbreviatedName(ClassUtils.class, 18));
 assertEquals("j.lang.String", 
ClassUtils.getAbbreviatedName(String.class, 13));
 assertEquals("j.lang.String", 
ClassUtils.getAbbreviatedName(String.class, 15));
 assertEquals("java.lang.String", 
ClassUtils.getAbbreviatedName(String.class, 20));
 }
 
+/**
+ * Test that in case the required length is larger than the name and thus 
there is no need for any shortening
+ * then the returned string object is the same as the one passed as 
argument. Note, however, that this is
+ * tested as an internal implementation detail, but it is not a guaranteed 
feature of the implementation.
+ */
 @Test
-public void test_getAbbreviatedName_Class_NegativeLen() {
+@DisplayName("When the length hint is longer than the actual length then 
the same String object is returned")
+void test_getAbbreviatedName_TooLongHint(){
+final String className = "java.lang.String";
+Assertions.assertSame(className, 
ClassUtils.getAbbreviatedName(className, className.length()+1));
+Assertions.assertSame(className, 
ClassUtils.getAbbreviatedName(className, className.length()));
+}
+
+@Test
+@DisplayName("When the desired length is negative then exception is 
thrown")
+void test_getAbbreviatedName_Class_NegativeLen() {
 assertThrows(IllegalArgumentException.class, () -> 
ClassUtils.getAbbreviatedName(String.class, -10));
 }
 
 @Test
-public void test_getAbbreviatedName_Class_ZeroLen() {
+@DisplayName("When the desired length is zero then exception is thrown")
+void test_getAbbreviatedName_Class_ZeroLen() {
 assertThrows(IllegalArgumentException.class, () -> 
ClassUtils.getAbbreviatedName(String.class, 0));
 }
 
 @Test
-public void test_getAbbreviatedName_String() {
 
 Review comment:
   Sorry, but wrong addressee. This is not me, who has changed the visibility, 
but JUnit 5.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 319303)
Remaining Estimate: 17h 20m  (was: 17.5h)
Time Spent: 6h 40m  (was: 6.5h)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 6h 40m
>  Remaining Estimate: 17h 20m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-26 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=319302=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-319302
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 27/Sep/19 01:08
Start Date: 27/Sep/19 01:08
Worklog Time Spent: 10m 
  Work Description: verhas commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r328881438
 
 

 ##
 File path: src/test/java/org/apache/commons/lang3/ClassUtilsTest.java
 ##
 @@ -160,26 +162,59 @@ public void test_getAbbreviatedName_Class() {
 assertEquals("", ClassUtils.getAbbreviatedName((Class) null, 1));
 assertEquals("j.l.String", ClassUtils.getAbbreviatedName(String.class, 
1));
 assertEquals("j.l.String", ClassUtils.getAbbreviatedName(String.class, 
5));
+assertEquals("o.a.c.l.ClassUtils", 
ClassUtils.getAbbreviatedName(ClassUtils.class, 18));
 assertEquals("j.lang.String", 
ClassUtils.getAbbreviatedName(String.class, 13));
 assertEquals("j.lang.String", 
ClassUtils.getAbbreviatedName(String.class, 15));
 assertEquals("java.lang.String", 
ClassUtils.getAbbreviatedName(String.class, 20));
 }
 
+/**
+ * Test that in case the required length is larger than the name and thus 
there is no need for any shortening
+ * then the returned string object is the same as the one passed as 
argument. Note, however, that this is
+ * tested as an internal implementation detail, but it is not a guaranteed 
feature of the implementation.
+ */
 @Test
-public void test_getAbbreviatedName_Class_NegativeLen() {
+@DisplayName("When the length hint is longer than the actual length then 
the same String object is returned")
+void test_getAbbreviatedName_TooLongHint(){
+final String className = "java.lang.String";
+Assertions.assertSame(className, 
ClassUtils.getAbbreviatedName(className, className.length()+1));
+Assertions.assertSame(className, 
ClassUtils.getAbbreviatedName(className, className.length()));
+}
+
+@Test
+@DisplayName("When the desired length is negative then exception is 
thrown")
+void test_getAbbreviatedName_Class_NegativeLen() {
 assertThrows(IllegalArgumentException.class, () -> 
ClassUtils.getAbbreviatedName(String.class, -10));
 }
 
 @Test
-public void test_getAbbreviatedName_Class_ZeroLen() {
+@DisplayName("When the desired length is zero then exception is thrown")
+void test_getAbbreviatedName_Class_ZeroLen() {
 assertThrows(IllegalArgumentException.class, () -> 
ClassUtils.getAbbreviatedName(String.class, 0));
 }
 
 @Test
-public void test_getAbbreviatedName_String() {
 
 Review comment:
   Sorry, but wrong addressee. This is not me, who has changed the visibility, 
but JUnit 5.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 319302)
Remaining Estimate: 17.5h  (was: 17h 40m)
Time Spent: 6.5h  (was: 6h 20m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 6.5h
>  Remaining Estimate: 17.5h
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-26 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=319300=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-319300
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 27/Sep/19 01:07
Start Date: 27/Sep/19 01:07
Worklog Time Spent: 10m 
  Work Description: verhas commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r328881421
 
 

 ##
 File path: src/test/java/org/apache/commons/lang3/ClassUtilsTest.java
 ##
 @@ -160,26 +162,59 @@ public void test_getAbbreviatedName_Class() {
 assertEquals("", ClassUtils.getAbbreviatedName((Class) null, 1));
 assertEquals("j.l.String", ClassUtils.getAbbreviatedName(String.class, 
1));
 assertEquals("j.l.String", ClassUtils.getAbbreviatedName(String.class, 
5));
+assertEquals("o.a.c.l.ClassUtils", 
ClassUtils.getAbbreviatedName(ClassUtils.class, 18));
 assertEquals("j.lang.String", 
ClassUtils.getAbbreviatedName(String.class, 13));
 assertEquals("j.lang.String", 
ClassUtils.getAbbreviatedName(String.class, 15));
 assertEquals("java.lang.String", 
ClassUtils.getAbbreviatedName(String.class, 20));
 }
 
+/**
+ * Test that in case the required length is larger than the name and thus 
there is no need for any shortening
+ * then the returned string object is the same as the one passed as 
argument. Note, however, that this is
+ * tested as an internal implementation detail, but it is not a guaranteed 
feature of the implementation.
+ */
 @Test
-public void test_getAbbreviatedName_Class_NegativeLen() {
+@DisplayName("When the length hint is longer than the actual length then 
the same String object is returned")
+void test_getAbbreviatedName_TooLongHint(){
+final String className = "java.lang.String";
+Assertions.assertSame(className, 
ClassUtils.getAbbreviatedName(className, className.length()+1));
+Assertions.assertSame(className, 
ClassUtils.getAbbreviatedName(className, className.length()));
+}
+
+@Test
+@DisplayName("When the desired length is negative then exception is 
thrown")
+void test_getAbbreviatedName_Class_NegativeLen() {
 assertThrows(IllegalArgumentException.class, () -> 
ClassUtils.getAbbreviatedName(String.class, -10));
 }
 
 @Test
-public void test_getAbbreviatedName_Class_ZeroLen() {
 
 Review comment:
   Sorry, but wrong addressee. This is not me, who has changed the visibility, 
but JUnit 5.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 319300)
Remaining Estimate: 17h 40m  (was: 17h 50m)
Time Spent: 6h 20m  (was: 6h 10m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 6h 20m
>  Remaining Estimate: 17h 40m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-26 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=319195=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-319195
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 26/Sep/19 20:14
Start Date: 26/Sep/19 20:14
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on issue #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#issuecomment-535668589
 
 
   Because all other tests are public. IOW, consistency. 
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 319195)
Remaining Estimate: 17h 50m  (was: 18h)
Time Spent: 6h 10m  (was: 6h)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 6h 10m
>  Remaining Estimate: 17h 50m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-26 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=319139=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-319139
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 26/Sep/19 18:54
Start Date: 26/Sep/19 18:54
Worklog Time Spent: 10m 
  Work Description: verhas commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r328774255
 
 

 ##
 File path: src/test/java/org/apache/commons/lang3/ClassUtilsTest.java
 ##
 @@ -160,26 +162,59 @@ public void test_getAbbreviatedName_Class() {
 assertEquals("", ClassUtils.getAbbreviatedName((Class) null, 1));
 assertEquals("j.l.String", ClassUtils.getAbbreviatedName(String.class, 
1));
 assertEquals("j.l.String", ClassUtils.getAbbreviatedName(String.class, 
5));
+assertEquals("o.a.c.l.ClassUtils", 
ClassUtils.getAbbreviatedName(ClassUtils.class, 18));
 assertEquals("j.lang.String", 
ClassUtils.getAbbreviatedName(String.class, 13));
 assertEquals("j.lang.String", 
ClassUtils.getAbbreviatedName(String.class, 15));
 assertEquals("java.lang.String", 
ClassUtils.getAbbreviatedName(String.class, 20));
 }
 
+/**
+ * Test that in case the required length is larger than the name and thus 
there is no need for any shortening
+ * then the returned string object is the same as the one passed as 
argument. Note, however, that this is
+ * tested as an internal implementation detail, but it is not a guaranteed 
feature of the implementation.
+ */
 @Test
-public void test_getAbbreviatedName_Class_NegativeLen() {
+@DisplayName("When the length hint is longer than the actual length then 
the same String object is returned")
+void test_getAbbreviatedName_TooLongHint(){
+final String className = "java.lang.String";
+Assertions.assertSame(className, 
ClassUtils.getAbbreviatedName(className, className.length()+1));
+Assertions.assertSame(className, 
ClassUtils.getAbbreviatedName(className, className.length()));
+}
+
+@Test
+@DisplayName("When the desired length is negative then exception is 
thrown")
+void test_getAbbreviatedName_Class_NegativeLen() {
 assertThrows(IllegalArgumentException.class, () -> 
ClassUtils.getAbbreviatedName(String.class, -10));
 }
 
 @Test
-public void test_getAbbreviatedName_Class_ZeroLen() {
+@DisplayName("When the desired length is zero then exception is thrown")
+void test_getAbbreviatedName_Class_ZeroLen() {
 assertThrows(IllegalArgumentException.class, () -> 
ClassUtils.getAbbreviatedName(String.class, 0));
 }
 
 @Test
-public void test_getAbbreviatedName_String() {
 
 Review comment:
   Why?
   
   Since the project uses JUnit 5 the required visibility is package private. 
Any access modifier is noise.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 319139)
Remaining Estimate: 18h  (was: 18h 10m)
Time Spent: 6h  (was: 5h 50m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 6h
>  Remaining Estimate: 18h
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-24 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=317512=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-317512
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 24/Sep/19 14:12
Start Date: 24/Sep/19 14:12
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r327637992
 
 

 ##
 File path: src/test/java/org/apache/commons/lang3/ClassUtilsTest.java
 ##
 @@ -47,7 +47,7 @@
  * Unit tests {@link org.apache.commons.lang3.ClassUtils}.
  */
 @SuppressWarnings("boxing") // JUnit4 does not support primitive equality 
testing apart from long
-public class ClassUtilsTest  {
+class ClassUtilsTest  {
 
 Review comment:
   @verhas ping.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 317512)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 5h 50m
>  Remaining Estimate: 18h 10m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-24 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=317510=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-317510
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 24/Sep/19 14:12
Start Date: 24/Sep/19 14:12
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r327638102
 
 

 ##
 File path: src/test/java/org/apache/commons/lang3/ClassUtilsTest.java
 ##
 @@ -160,26 +162,59 @@ public void test_getAbbreviatedName_Class() {
 assertEquals("", ClassUtils.getAbbreviatedName((Class) null, 1));
 assertEquals("j.l.String", ClassUtils.getAbbreviatedName(String.class, 
1));
 assertEquals("j.l.String", ClassUtils.getAbbreviatedName(String.class, 
5));
+assertEquals("o.a.c.l.ClassUtils", 
ClassUtils.getAbbreviatedName(ClassUtils.class, 18));
 assertEquals("j.lang.String", 
ClassUtils.getAbbreviatedName(String.class, 13));
 assertEquals("j.lang.String", 
ClassUtils.getAbbreviatedName(String.class, 15));
 assertEquals("java.lang.String", 
ClassUtils.getAbbreviatedName(String.class, 20));
 }
 
+/**
+ * Test that in case the required length is larger than the name and thus 
there is no need for any shortening
+ * then the returned string object is the same as the one passed as 
argument. Note, however, that this is
+ * tested as an internal implementation detail, but it is not a guaranteed 
feature of the implementation.
+ */
 @Test
-public void test_getAbbreviatedName_Class_NegativeLen() {
+@DisplayName("When the length hint is longer than the actual length then 
the same String object is returned")
+void test_getAbbreviatedName_TooLongHint(){
+final String className = "java.lang.String";
+Assertions.assertSame(className, 
ClassUtils.getAbbreviatedName(className, className.length()+1));
+Assertions.assertSame(className, 
ClassUtils.getAbbreviatedName(className, className.length()));
+}
+
+@Test
+@DisplayName("When the desired length is negative then exception is 
thrown")
+void test_getAbbreviatedName_Class_NegativeLen() {
 assertThrows(IllegalArgumentException.class, () -> 
ClassUtils.getAbbreviatedName(String.class, -10));
 }
 
 @Test
-public void test_getAbbreviatedName_Class_ZeroLen() {
 
 Review comment:
   Let's not change the visibility of test classes and methods please.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 317510)
Remaining Estimate: 18h 10m  (was: 18h 20m)
Time Spent: 5h 50m  (was: 5h 40m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 5h 50m
>  Remaining Estimate: 18h 10m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-24 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=317509=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-317509
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 24/Sep/19 14:12
Start Date: 24/Sep/19 14:12
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r327638057
 
 

 ##
 File path: src/test/java/org/apache/commons/lang3/ClassUtilsTest.java
 ##
 @@ -160,26 +162,59 @@ public void test_getAbbreviatedName_Class() {
 assertEquals("", ClassUtils.getAbbreviatedName((Class) null, 1));
 assertEquals("j.l.String", ClassUtils.getAbbreviatedName(String.class, 
1));
 assertEquals("j.l.String", ClassUtils.getAbbreviatedName(String.class, 
5));
+assertEquals("o.a.c.l.ClassUtils", 
ClassUtils.getAbbreviatedName(ClassUtils.class, 18));
 assertEquals("j.lang.String", 
ClassUtils.getAbbreviatedName(String.class, 13));
 assertEquals("j.lang.String", 
ClassUtils.getAbbreviatedName(String.class, 15));
 assertEquals("java.lang.String", 
ClassUtils.getAbbreviatedName(String.class, 20));
 }
 
+/**
+ * Test that in case the required length is larger than the name and thus 
there is no need for any shortening
+ * then the returned string object is the same as the one passed as 
argument. Note, however, that this is
+ * tested as an internal implementation detail, but it is not a guaranteed 
feature of the implementation.
+ */
 @Test
-public void test_getAbbreviatedName_Class_NegativeLen() {
 
 Review comment:
   Let's not change the visibility of test classes and methods please.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 317509)
Remaining Estimate: 18h 10m  (was: 18h 20m)
Time Spent: 5h 50m  (was: 5h 40m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 5h 50m
>  Remaining Estimate: 18h 10m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-23 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=316796=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-316796
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 23/Sep/19 16:33
Start Date: 23/Sep/19 16:33
Worklog Time Spent: 10m 
  Work Description: coveralls commented on issue #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#issuecomment-523879388
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/25873539/badge)](https://coveralls.io/builds/25873539)
   
   Coverage decreased (-0.005%) to 95.21% when pulling 
**45766614eccffc4b8949d8c4b1783495c5327a93 on verhas:LANG-1480** into 
**24f66b175fdbc37c02ac234f1f3d7b2a5f13cc57 on apache:master**.
   
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 316796)
Remaining Estimate: 18h 20m  (was: 18.5h)
Time Spent: 5h 40m  (was: 5.5h)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 5h 40m
>  Remaining Estimate: 18h 20m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-23 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=316658=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-316658
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 23/Sep/19 13:31
Start Date: 23/Sep/19 13:31
Worklog Time Spent: 10m 
  Work Description: verhas commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r327104320
 
 

 ##
 File path: src/main/java/org/apache/commons/lang3/ClassUtils.java
 ##
 @@ -433,48 +440,83 @@ public static String getAbbreviatedName(final Class 
cls, final int len) {
  * "java.lang.String" 5"j.l.String"
  * "java.lang.String"15"j.lang.String"
  * 
"java.lang.String"30"java.lang.String"
+ * 
"org.apache.commons.lang3.ClassUtils"18"o.a.c.l.ClassUtils"
  * 
- * @param className  the className to get the abbreviated name for, may be 
{@code null}
- * @param len  the desired length of the abbreviated name
- * @return the abbreviated name or an empty string
- * @throws IllegalArgumentException if len = 0
+ *
+ * @param className the className to get the abbreviated name for, may be 
{@code null}
+ * @param len   the desired length of the abbreviated name
+ * @return the abbreviated name or an empty string if the specified
+ * class name is {@code null} or empty string. The abbreviated name may be
+ * longer than the desired length if it cannot be abbreviated to the 
desired length.
+ * @throws IllegalArgumentException if {@code len <= 0}
  * @since 3.4
  */
 public static String getAbbreviatedName(final String className, final int 
len) {
-  if (len <= 0) {
-throw new IllegalArgumentException("len must be > 0");
-  }
-  if (className == null) {
-return StringUtils.EMPTY;
-  }
-
-  int availableSpace = len;
-  final int packageLevels = StringUtils.countMatches(className, '.');
-  final String[] output = new String[packageLevels + 1];
-  int endIndex = className.length() - 1;
-  for (int level = packageLevels; level >= 0; level--) {
-final int startIndex = className.lastIndexOf('.', endIndex);
-final String part = className.substring(startIndex + 1, endIndex + 1);
-availableSpace -= part.length();
-if (level > 0) {
-  // all elements except top level require an additional char space
-  availableSpace--;
+if (len <= 0) {
+throw new IllegalArgumentException("len must be > 0");
 }
-if (level == packageLevels) {
-  // ClassName is always complete
-  output[level] = part;
-} else {
-  if (availableSpace > 0) {
-output[level] = part;
-  } else {
-// if no space is left still the first char is used
-output[level] = part.substring(0, 1);
-  }
+if (className == null) {
+return StringUtils.EMPTY;
 }
 
 Review comment:
   There is no point to add a test. This is not a feature change. This is a 
performance optimization. I do not think the method should guarantee as an API 
contract that it will return the same String object in this case.
   
   In other cases I totally agree: if there is a change, which is functionality 
change then there should be a test also changed.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 316658)
Remaining Estimate: 18.5h  (was: 18h 40m)
Time Spent: 5.5h  (was: 5h 20m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 5.5h
>  Remaining Estimate: 18.5h
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that 

[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-23 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=316645=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-316645
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 23/Sep/19 13:09
Start Date: 23/Sep/19 13:09
Worklog Time Spent: 10m 
  Work Description: verhas commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r327104320
 
 

 ##
 File path: src/main/java/org/apache/commons/lang3/ClassUtils.java
 ##
 @@ -433,48 +440,83 @@ public static String getAbbreviatedName(final Class 
cls, final int len) {
  * "java.lang.String" 5"j.l.String"
  * "java.lang.String"15"j.lang.String"
  * 
"java.lang.String"30"java.lang.String"
+ * 
"org.apache.commons.lang3.ClassUtils"18"o.a.c.l.ClassUtils"
  * 
- * @param className  the className to get the abbreviated name for, may be 
{@code null}
- * @param len  the desired length of the abbreviated name
- * @return the abbreviated name or an empty string
- * @throws IllegalArgumentException if len = 0
+ *
+ * @param className the className to get the abbreviated name for, may be 
{@code null}
+ * @param len   the desired length of the abbreviated name
+ * @return the abbreviated name or an empty string if the specified
+ * class name is {@code null} or empty string. The abbreviated name may be
+ * longer than the desired length if it cannot be abbreviated to the 
desired length.
+ * @throws IllegalArgumentException if {@code len <= 0}
  * @since 3.4
  */
 public static String getAbbreviatedName(final String className, final int 
len) {
-  if (len <= 0) {
-throw new IllegalArgumentException("len must be > 0");
-  }
-  if (className == null) {
-return StringUtils.EMPTY;
-  }
-
-  int availableSpace = len;
-  final int packageLevels = StringUtils.countMatches(className, '.');
-  final String[] output = new String[packageLevels + 1];
-  int endIndex = className.length() - 1;
-  for (int level = packageLevels; level >= 0; level--) {
-final int startIndex = className.lastIndexOf('.', endIndex);
-final String part = className.substring(startIndex + 1, endIndex + 1);
-availableSpace -= part.length();
-if (level > 0) {
-  // all elements except top level require an additional char space
-  availableSpace--;
+if (len <= 0) {
+throw new IllegalArgumentException("len must be > 0");
 }
-if (level == packageLevels) {
-  // ClassName is always complete
-  output[level] = part;
-} else {
-  if (availableSpace > 0) {
-output[level] = part;
-  } else {
-// if no space is left still the first char is used
-output[level] = part.substring(0, 1);
-  }
+if (className == null) {
+return StringUtils.EMPTY;
 }
 
 Review comment:
   There is no point to add a test. This is not a feature change. This is a 
performance optimization. I do not think the method should guarantee as an API 
contract that it will return the same String object in this case.
   
   In other cases I totally agree: if there is a change, which is functionality 
change then there should be a test also changed.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 316645)
Remaining Estimate: 18h 40m  (was: 18h 50m)
Time Spent: 5h 20m  (was: 5h 10m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 5h 20m
>  Remaining Estimate: 18h 40m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this 

[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-19 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=315403=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-315403
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 20/Sep/19 01:28
Start Date: 20/Sep/19 01:28
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r326441799
 
 

 ##
 File path: src/test/java/org/apache/commons/lang3/ClassUtilsTest.java
 ##
 @@ -47,7 +47,7 @@
  * Unit tests {@link org.apache.commons.lang3.ClassUtils}.
  */
 @SuppressWarnings("boxing") // JUnit4 does not support primitive equality 
testing apart from long
-public class ClassUtilsTest  {
+class ClassUtilsTest  {
 
 Review comment:
   @verhas ping.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 315403)
Remaining Estimate: 18h 50m  (was: 19h)
Time Spent: 5h 10m  (was: 5h)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 5h 10m
>  Remaining Estimate: 18h 50m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-19 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=315404=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-315404
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 20/Sep/19 01:28
Start Date: 20/Sep/19 01:28
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r326441764
 
 

 ##
 File path: src/main/java/org/apache/commons/lang3/ClassUtils.java
 ##
 @@ -433,48 +440,83 @@ public static String getAbbreviatedName(final Class 
cls, final int len) {
  * "java.lang.String" 5"j.l.String"
  * "java.lang.String"15"j.lang.String"
  * 
"java.lang.String"30"java.lang.String"
+ * 
"org.apache.commons.lang3.ClassUtils"18"o.a.c.l.ClassUtils"
  * 
- * @param className  the className to get the abbreviated name for, may be 
{@code null}
- * @param len  the desired length of the abbreviated name
- * @return the abbreviated name or an empty string
- * @throws IllegalArgumentException if len = 0
+ *
+ * @param className the className to get the abbreviated name for, may be 
{@code null}
+ * @param len   the desired length of the abbreviated name
+ * @return the abbreviated name or an empty string if the specified
+ * class name is {@code null} or empty string. The abbreviated name may be
+ * longer than the desired length if it cannot be abbreviated to the 
desired length.
+ * @throws IllegalArgumentException if {@code len <= 0}
  * @since 3.4
  */
 public static String getAbbreviatedName(final String className, final int 
len) {
-  if (len <= 0) {
-throw new IllegalArgumentException("len must be > 0");
-  }
-  if (className == null) {
-return StringUtils.EMPTY;
-  }
-
-  int availableSpace = len;
-  final int packageLevels = StringUtils.countMatches(className, '.');
-  final String[] output = new String[packageLevels + 1];
-  int endIndex = className.length() - 1;
-  for (int level = packageLevels; level >= 0; level--) {
-final int startIndex = className.lastIndexOf('.', endIndex);
-final String part = className.substring(startIndex + 1, endIndex + 1);
-availableSpace -= part.length();
-if (level > 0) {
-  // all elements except top level require an additional char space
-  availableSpace--;
+if (len <= 0) {
+throw new IllegalArgumentException("len must be > 0");
 }
-if (level == packageLevels) {
-  // ClassName is always complete
-  output[level] = part;
-} else {
-  if (availableSpace > 0) {
-output[level] = part;
-  } else {
-// if no space is left still the first char is used
-output[level] = part.substring(0, 1);
-  }
+if (className == null) {
+return StringUtils.EMPTY;
 }
 
 Review comment:
   @verhas Then please go ahead and update the code and add a test.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 315404)
Remaining Estimate: 18h 50m  (was: 19h)
Time Spent: 5h 10m  (was: 5h)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 5h 10m
>  Remaining Estimate: 18h 50m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long 

[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-19 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=315405=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-315405
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 20/Sep/19 01:28
Start Date: 20/Sep/19 01:28
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r326441672
 
 

 ##
 File path: src/main/java/org/apache/commons/lang3/ClassUtils.java
 ##
 @@ -433,48 +440,83 @@ public static String getAbbreviatedName(final Class 
cls, final int len) {
  * "java.lang.String" 5"j.l.String"
  * "java.lang.String"15"j.lang.String"
  * 
"java.lang.String"30"java.lang.String"
+ * 
"org.apache.commons.lang3.ClassUtils"18"o.a.c.l.ClassUtils"
  * 
- * @param className  the className to get the abbreviated name for, may be 
{@code null}
- * @param len  the desired length of the abbreviated name
- * @return the abbreviated name or an empty string
- * @throws IllegalArgumentException if len = 0
+ *
+ * @param className the className to get the abbreviated name for, may be 
{@code null}
+ * @param len   the desired length of the abbreviated name
+ * @return the abbreviated name or an empty string if the specified
+ * class name is {@code null} or empty string. The abbreviated name may be
+ * longer than the desired length if it cannot be abbreviated to the 
desired length.
+ * @throws IllegalArgumentException if {@code len <= 0}
  * @since 3.4
  */
 public static String getAbbreviatedName(final String className, final int 
len) {
 
 Review comment:
   @verhas Then please go ahead and change it to `lengthHint`.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 315405)
Remaining Estimate: 18h 50m  (was: 19h)
Time Spent: 5h 10m  (was: 5h)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 5h 10m
>  Remaining Estimate: 18h 50m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-18 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=314558=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-314558
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 18/Sep/19 18:36
Start Date: 18/Sep/19 18:36
Worklog Time Spent: 10m 
  Work Description: verhas commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r325831427
 
 

 ##
 File path: src/main/java/org/apache/commons/lang3/ClassUtils.java
 ##
 @@ -433,48 +440,83 @@ public static String getAbbreviatedName(final Class 
cls, final int len) {
  * "java.lang.String" 5"j.l.String"
  * "java.lang.String"15"j.lang.String"
  * 
"java.lang.String"30"java.lang.String"
+ * 
"org.apache.commons.lang3.ClassUtils"18"o.a.c.l.ClassUtils"
  * 
- * @param className  the className to get the abbreviated name for, may be 
{@code null}
- * @param len  the desired length of the abbreviated name
- * @return the abbreviated name or an empty string
- * @throws IllegalArgumentException if len = 0
+ *
+ * @param className the className to get the abbreviated name for, may be 
{@code null}
+ * @param len   the desired length of the abbreviated name
+ * @return the abbreviated name or an empty string if the specified
+ * class name is {@code null} or empty string. The abbreviated name may be
+ * longer than the desired length if it cannot be abbreviated to the 
desired length.
+ * @throws IllegalArgumentException if {@code len <= 0}
  * @since 3.4
  */
 public static String getAbbreviatedName(final String className, final int 
len) {
-  if (len <= 0) {
-throw new IllegalArgumentException("len must be > 0");
-  }
-  if (className == null) {
-return StringUtils.EMPTY;
-  }
-
-  int availableSpace = len;
-  final int packageLevels = StringUtils.countMatches(className, '.');
-  final String[] output = new String[packageLevels + 1];
-  int endIndex = className.length() - 1;
-  for (int level = packageLevels; level >= 0; level--) {
-final int startIndex = className.lastIndexOf('.', endIndex);
-final String part = className.substring(startIndex + 1, endIndex + 1);
-availableSpace -= part.length();
-if (level > 0) {
-  // all elements except top level require an additional char space
-  availableSpace--;
+if (len <= 0) {
+throw new IllegalArgumentException("len must be > 0");
 }
-if (level == packageLevels) {
-  // ClassName is always complete
-  output[level] = part;
-} else {
-  if (availableSpace > 0) {
-output[level] = part;
-  } else {
-// if no space is left still the first char is used
-output[level] = part.substring(0, 1);
-  }
+if (className == null) {
+return StringUtils.EMPTY;
 }
 
 Review comment:
   Makes sense.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 314558)
Remaining Estimate: 19h  (was: 19h 10m)
Time Spent: 5h  (was: 4h 50m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 5h
>  Remaining Estimate: 19h
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message 

[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-18 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=314555=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-314555
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 18/Sep/19 18:32
Start Date: 18/Sep/19 18:32
Worklog Time Spent: 10m 
  Work Description: verhas commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r325830080
 
 

 ##
 File path: src/main/java/org/apache/commons/lang3/ClassUtils.java
 ##
 @@ -433,48 +440,83 @@ public static String getAbbreviatedName(final Class 
cls, final int len) {
  * "java.lang.String" 5"j.l.String"
  * "java.lang.String"15"j.lang.String"
  * 
"java.lang.String"30"java.lang.String"
+ * 
"org.apache.commons.lang3.ClassUtils"18"o.a.c.l.ClassUtils"
  * 
- * @param className  the className to get the abbreviated name for, may be 
{@code null}
- * @param len  the desired length of the abbreviated name
- * @return the abbreviated name or an empty string
- * @throws IllegalArgumentException if len = 0
+ *
+ * @param className the className to get the abbreviated name for, may be 
{@code null}
+ * @param len   the desired length of the abbreviated name
+ * @return the abbreviated name or an empty string if the specified
+ * class name is {@code null} or empty string. The abbreviated name may be
+ * longer than the desired length if it cannot be abbreviated to the 
desired length.
+ * @throws IllegalArgumentException if {@code len <= 0}
  * @since 3.4
  */
 public static String getAbbreviatedName(final String className, final int 
len) {
 
 Review comment:
   I can live with that. Makes sense.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 314555)
Remaining Estimate: 19h 10m  (was: 19h 20m)
Time Spent: 4h 50m  (was: 4h 40m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 4h 50m
>  Remaining Estimate: 19h 10m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-18 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=314495=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-314495
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 18/Sep/19 17:15
Start Date: 18/Sep/19 17:15
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r325792045
 
 

 ##
 File path: src/test/java/org/apache/commons/lang3/ClassUtilsTest.java
 ##
 @@ -47,7 +47,7 @@
  * Unit tests {@link org.apache.commons.lang3.ClassUtils}.
  */
 @SuppressWarnings("boxing") // JUnit4 does not support primitive equality 
testing apart from long
-public class ClassUtilsTest  {
+class ClassUtilsTest  {
 
 Review comment:
   Let's not change the visibility of test classes please.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 314495)
Remaining Estimate: 19.5h  (was: 19h 40m)
Time Spent: 4.5h  (was: 4h 20m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 4.5h
>  Remaining Estimate: 19.5h
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-18 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=314494=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-314494
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 18/Sep/19 17:15
Start Date: 18/Sep/19 17:15
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r325794173
 
 

 ##
 File path: src/main/java/org/apache/commons/lang3/ClassUtils.java
 ##
 @@ -433,48 +440,83 @@ public static String getAbbreviatedName(final Class 
cls, final int len) {
  * "java.lang.String" 5"j.l.String"
  * "java.lang.String"15"j.lang.String"
  * 
"java.lang.String"30"java.lang.String"
+ * 
"org.apache.commons.lang3.ClassUtils"18"o.a.c.l.ClassUtils"
  * 
- * @param className  the className to get the abbreviated name for, may be 
{@code null}
- * @param len  the desired length of the abbreviated name
- * @return the abbreviated name or an empty string
- * @throws IllegalArgumentException if len = 0
+ *
+ * @param className the className to get the abbreviated name for, may be 
{@code null}
+ * @param len   the desired length of the abbreviated name
+ * @return the abbreviated name or an empty string if the specified
+ * class name is {@code null} or empty string. The abbreviated name may be
+ * longer than the desired length if it cannot be abbreviated to the 
desired length.
+ * @throws IllegalArgumentException if {@code len <= 0}
  * @since 3.4
  */
 public static String getAbbreviatedName(final String className, final int 
len) {
-  if (len <= 0) {
-throw new IllegalArgumentException("len must be > 0");
-  }
-  if (className == null) {
-return StringUtils.EMPTY;
-  }
-
-  int availableSpace = len;
-  final int packageLevels = StringUtils.countMatches(className, '.');
-  final String[] output = new String[packageLevels + 1];
-  int endIndex = className.length() - 1;
-  for (int level = packageLevels; level >= 0; level--) {
-final int startIndex = className.lastIndexOf('.', endIndex);
-final String part = className.substring(startIndex + 1, endIndex + 1);
-availableSpace -= part.length();
-if (level > 0) {
-  // all elements except top level require an additional char space
-  availableSpace--;
+if (len <= 0) {
+throw new IllegalArgumentException("len must be > 0");
 }
-if (level == packageLevels) {
-  // ClassName is always complete
-  output[level] = part;
-} else {
-  if (availableSpace > 0) {
-output[level] = part;
-  } else {
-// if no space is left still the first char is used
-output[level] = part.substring(0, 1);
-  }
+if (className == null) {
+return StringUtils.EMPTY;
 }
 
 Review comment:
   I was expecting a short-circuit here when the length hint is greater or 
equal than the input string, then return the input string to avoid creating a 
new String.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 314494)
Remaining Estimate: 19h 40m  (was: 19h 50m)
Time Spent: 4h 20m  (was: 4h 10m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 4h 20m
>  Remaining Estimate: 19h 40m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> 

[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-18 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=314497=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-314497
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 18/Sep/19 17:15
Start Date: 18/Sep/19 17:15
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r325791889
 
 

 ##
 File path: src/main/java/org/apache/commons/lang3/ClassUtils.java
 ##
 @@ -433,48 +440,82 @@ public static String getAbbreviatedName(final Class 
cls, final int len) {
  * "java.lang.String" 5"j.l.String"
  * "java.lang.String"15"j.lang.String"
  * 
"java.lang.String"30"java.lang.String"
+ * 
"org.apache.commons.lang3.ClassUtils"18"o.a.c.l.ClassUtils"
  * 
- * @param className  the className to get the abbreviated name for, may be 
{@code null}
- * @param len  the desired length of the abbreviated name
- * @return the abbreviated name or an empty string
- * @throws IllegalArgumentException if len = 0
+ *
+ * @param className the className to get the abbreviated name for, may be 
{@code null}
+ * @param len   the desired length of the abbreviated name
+ * @return the abbreviated name or an empty string if the specified
+ * class name is {@code null} or empty string
+ * @throws IllegalArgumentException if {@code len <= 0}
  * @since 3.4
  */
 public static String getAbbreviatedName(final String className, final int 
len) {
-  if (len <= 0) {
-throw new IllegalArgumentException("len must be > 0");
-  }
-  if (className == null) {
-return StringUtils.EMPTY;
-  }
-
-  int availableSpace = len;
-  final int packageLevels = StringUtils.countMatches(className, '.');
-  final String[] output = new String[packageLevels + 1];
-  int endIndex = className.length() - 1;
-  for (int level = packageLevels; level >= 0; level--) {
-final int startIndex = className.lastIndexOf('.', endIndex);
-final String part = className.substring(startIndex + 1, endIndex + 1);
-availableSpace -= part.length();
-if (level > 0) {
-  // all elements except top level require an additional char space
-  availableSpace--;
+if (len <= 0) {
+throw new IllegalArgumentException("len must be > 0");
 }
-if (level == packageLevels) {
-  // ClassName is always complete
-  output[level] = part;
-} else {
-  if (availableSpace > 0) {
-output[level] = part;
-  } else {
-// if no space is left still the first char is used
-output[level] = part.substring(0, 1);
-  }
+if (className == null) {
+return StringUtils.EMPTY;
 }
-endIndex = startIndex - 1;
-  }
 
-  return StringUtils.join(output, '.');
+final char[] abbreviated = className.toCharArray();
+int target = 0;
+int source = 0;
+while (source < abbreviated.length) {
+// copy the next part
+int runAheadTarget = target;
+while (source < abbreviated.length && abbreviated[source] != '.') {
+abbreviated[runAheadTarget++] = abbreviated[source++];
+}
+
+++target;
+if (useFull(runAheadTarget, source, abbreviated.length, len)
+|| target > runAheadTarget) {
+target = runAheadTarget;
+}
+
+// copy the '.' unless it was the last part
+if (source < abbreviated.length) {
+abbreviated[target++] = abbreviated[source++];
+}
+}
+return new String(abbreviated, 0, target);
+}
+
+/**
+ * Decides if the part that was just copied to its destination
+ * location in the work array can be kept as it was copied or must be
+ * abbreviated. It must be kept when the part is the last one, which
+ * is the simple name of the class. In this case the {@code source}
+ * index, from where the characters are copied points one position
+ * after the last character, a.k.a. {@code source ==
+ * originalLength}
+ *
+ * If the part is not the last one then it can be kept
+ * unabridged if the number of the characters copied so far plus
+ * the character that are to be copied is less than or equal to the
+ * desired length.
+ *
+ * @param runAheadTarget the target index (where the characters were
+ *   copied to) pointing after the last character
+ *   copied when the current part was copied
+ * @param source the source index (where the 

[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-18 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=314496=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-314496
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 18/Sep/19 17:15
Start Date: 18/Sep/19 17:15
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r325794728
 
 

 ##
 File path: src/main/java/org/apache/commons/lang3/ClassUtils.java
 ##
 @@ -433,48 +440,83 @@ public static String getAbbreviatedName(final Class 
cls, final int len) {
  * "java.lang.String" 5"j.l.String"
  * "java.lang.String"15"j.lang.String"
  * 
"java.lang.String"30"java.lang.String"
+ * 
"org.apache.commons.lang3.ClassUtils"18"o.a.c.l.ClassUtils"
  * 
- * @param className  the className to get the abbreviated name for, may be 
{@code null}
- * @param len  the desired length of the abbreviated name
- * @return the abbreviated name or an empty string
- * @throws IllegalArgumentException if len = 0
+ *
+ * @param className the className to get the abbreviated name for, may be 
{@code null}
+ * @param len   the desired length of the abbreviated name
+ * @return the abbreviated name or an empty string if the specified
+ * class name is {@code null} or empty string. The abbreviated name may be
+ * longer than the desired length if it cannot be abbreviated to the 
desired length.
+ * @throws IllegalArgumentException if {@code len <= 0}
  * @since 3.4
  */
 public static String getAbbreviatedName(final String className, final int 
len) {
 
 Review comment:
   I am starting to wonder if `len` would be better named `lengthHint` to make 
it clearer that this length is not a guarantee in any shape or form of the 
length of the returned string.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 314496)
Remaining Estimate: 19h 20m  (was: 19.5h)
Time Spent: 4h 40m  (was: 4.5h)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 4h 40m
>  Remaining Estimate: 19h 20m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-18 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=314359=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-314359
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 18/Sep/19 14:46
Start Date: 18/Sep/19 14:46
Worklog Time Spent: 10m 
  Work Description: coveralls commented on issue #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#issuecomment-523879388
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/25785956/badge)](https://coveralls.io/builds/25785956)
   
   Coverage decreased (-0.01%) to 95.202% when pulling 
**58a852fafc2e02d1622c43d4ce4d25452854682c on verhas:LANG-1480** into 
**24f66b175fdbc37c02ac234f1f3d7b2a5f13cc57 on apache:master**.
   
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 314359)
Remaining Estimate: 19h 50m  (was: 20h)
Time Spent: 4h 10m  (was: 4h)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 4h 10m
>  Remaining Estimate: 19h 50m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-18 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=314350=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-314350
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 18/Sep/19 14:29
Start Date: 18/Sep/19 14:29
Worklog Time Spent: 10m 
  Work Description: verhas commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r325709633
 
 

 ##
 File path: src/main/java/org/apache/commons/lang3/ClassUtils.java
 ##
 @@ -433,48 +440,82 @@ public static String getAbbreviatedName(final Class 
cls, final int len) {
  * "java.lang.String" 5"j.l.String"
  * "java.lang.String"15"j.lang.String"
  * 
"java.lang.String"30"java.lang.String"
+ * 
"org.apache.commons.lang3.ClassUtils"18"o.a.c.l.ClassUtils"
  * 
- * @param className  the className to get the abbreviated name for, may be 
{@code null}
- * @param len  the desired length of the abbreviated name
- * @return the abbreviated name or an empty string
- * @throws IllegalArgumentException if len = 0
+ *
+ * @param className the className to get the abbreviated name for, may be 
{@code null}
+ * @param len   the desired length of the abbreviated name
+ * @return the abbreviated name or an empty string if the specified
 
 Review comment:
   It is not and it is described in details in the above text.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 314350)
Remaining Estimate: 20h  (was: 20h 10m)
Time Spent: 4h  (was: 3h 50m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 4h
>  Remaining Estimate: 20h
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-18 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=314347=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-314347
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 18/Sep/19 14:20
Start Date: 18/Sep/19 14:20
Worklog Time Spent: 10m 
  Work Description: verhas commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r325703983
 
 

 ##
 File path: src/main/java/org/apache/commons/lang3/ClassUtils.java
 ##
 @@ -433,48 +440,82 @@ public static String getAbbreviatedName(final Class 
cls, final int len) {
  * "java.lang.String" 5"j.l.String"
  * "java.lang.String"15"j.lang.String"
  * 
"java.lang.String"30"java.lang.String"
+ * 
"org.apache.commons.lang3.ClassUtils"18"o.a.c.l.ClassUtils"
  * 
- * @param className  the className to get the abbreviated name for, may be 
{@code null}
- * @param len  the desired length of the abbreviated name
- * @return the abbreviated name or an empty string
- * @throws IllegalArgumentException if len = 0
+ *
+ * @param className the className to get the abbreviated name for, may be 
{@code null}
+ * @param len   the desired length of the abbreviated name
+ * @return the abbreviated name or an empty string if the specified
+ * class name is {@code null} or empty string
+ * @throws IllegalArgumentException if {@code len <= 0}
  * @since 3.4
  */
 public static String getAbbreviatedName(final String className, final int 
len) {
-  if (len <= 0) {
-throw new IllegalArgumentException("len must be > 0");
-  }
-  if (className == null) {
-return StringUtils.EMPTY;
-  }
-
-  int availableSpace = len;
-  final int packageLevels = StringUtils.countMatches(className, '.');
-  final String[] output = new String[packageLevels + 1];
-  int endIndex = className.length() - 1;
-  for (int level = packageLevels; level >= 0; level--) {
-final int startIndex = className.lastIndexOf('.', endIndex);
-final String part = className.substring(startIndex + 1, endIndex + 1);
-availableSpace -= part.length();
-if (level > 0) {
-  // all elements except top level require an additional char space
-  availableSpace--;
+if (len <= 0) {
+throw new IllegalArgumentException("len must be > 0");
 }
-if (level == packageLevels) {
-  // ClassName is always complete
-  output[level] = part;
-} else {
-  if (availableSpace > 0) {
-output[level] = part;
-  } else {
-// if no space is left still the first char is used
-output[level] = part.substring(0, 1);
-  }
+if (className == null) {
+return StringUtils.EMPTY;
 }
-endIndex = startIndex - 1;
-  }
 
-  return StringUtils.join(output, '.');
+final char[] abbreviated = className.toCharArray();
+int target = 0;
+int source = 0;
+while (source < abbreviated.length) {
+// copy the next part
+int runAheadTarget = target;
+while (source < abbreviated.length && abbreviated[source] != '.') {
+abbreviated[runAheadTarget++] = abbreviated[source++];
+}
+
+++target;
+if (useFull(runAheadTarget, source, abbreviated.length, len)
+|| target > runAheadTarget) {
+target = runAheadTarget;
+}
+
+// copy the '.' unless it was the last part
+if (source < abbreviated.length) {
+abbreviated[target++] = abbreviated[source++];
+}
+}
+return new String(abbreviated, 0, target);
+}
+
+/**
+ * Decides if the part that was just copied to its destination
+ * location in the work array can be kept as it was copied or must be
+ * abbreviated. It must be kept when the part is the last one, which
+ * is the simple name of the class. In this case the {@code source}
+ * index, from where the characters are copied points one position
+ * after the last character, a.k.a. {@code source ==
+ * originalLength}
+ *
+ * If the part is not the last one then it can be kept
+ * unabridged if the number of the characters copied so far plus
+ * the character that are to be copied is less than or equal to the
+ * desired length.
+ *
+ * @param runAheadTarget the target index (where the characters were
+ *   copied to) pointing after the last character
+ *   copied when the current part was copied
+ * @param source the source index (where the 

[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-17 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=313723=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-313723
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 17/Sep/19 14:28
Start Date: 17/Sep/19 14:28
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r325199931
 
 

 ##
 File path: src/main/java/org/apache/commons/lang3/ClassUtils.java
 ##
 @@ -424,7 +424,14 @@ public static String getAbbreviatedName(final Class 
cls, final int len) {
  * significant loss of meaning.
  * The abbreviated class name will always include the complete package 
hierarchy.
  * If enough space is available, rightmost sub-packages will be displayed 
in full
- * length.
+ * length. The abbreviated package names will be shortened to a single 
character.
+ * Only package names are shortened, the class simple name remains 
untouched. (See examples.)
+ * The result will be longer than the desired length only if all the 
package names
+ * shortened to a single character plus the class simple name with the 
separating dots
+ * together are longer than the desired length. In other words, when the 
class name
+ * cannot be shortened to the desired length without significant loss of 
meaning.
+ * If the class name can be shortened without significant loss of 
meaning then
 
 Review comment:
   I do not think we should talk about "loss of meaning" as to me, abbreviating 
implies "loss of meaning" by design ;-) Just describe what it does. IMO a list 
would be better to describe the different use cases.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 313723)
Remaining Estimate: 20h 20m  (was: 20.5h)
Time Spent: 3h 40m  (was: 3.5h)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 3h 40m
>  Remaining Estimate: 20h 20m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-17 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=313721=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-313721
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 17/Sep/19 14:28
Start Date: 17/Sep/19 14:28
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r325199190
 
 

 ##
 File path: src/main/java/org/apache/commons/lang3/ClassUtils.java
 ##
 @@ -433,48 +440,82 @@ public static String getAbbreviatedName(final Class 
cls, final int len) {
  * "java.lang.String" 5"j.l.String"
  * "java.lang.String"15"j.lang.String"
  * 
"java.lang.String"30"java.lang.String"
+ * 
"org.apache.commons.lang3.ClassUtils"18"o.a.c.l.ClassUtils"
  * 
- * @param className  the className to get the abbreviated name for, may be 
{@code null}
- * @param len  the desired length of the abbreviated name
- * @return the abbreviated name or an empty string
- * @throws IllegalArgumentException if len = 0
+ *
+ * @param className the className to get the abbreviated name for, may be 
{@code null}
+ * @param len   the desired length of the abbreviated name
+ * @return the abbreviated name or an empty string if the specified
 
 Review comment:
   Please specify if the result string is always <= len.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 313721)
Remaining Estimate: 20h 20m  (was: 20.5h)
Time Spent: 3h 40m  (was: 3.5h)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 3h 40m
>  Remaining Estimate: 20h 20m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-09-17 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=313722=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-313722
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 17/Sep/19 14:28
Start Date: 17/Sep/19 14:28
Worklog Time Spent: 10m 
  Work Description: garydgregory commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r325200696
 
 

 ##
 File path: src/main/java/org/apache/commons/lang3/ClassUtils.java
 ##
 @@ -433,48 +440,82 @@ public static String getAbbreviatedName(final Class 
cls, final int len) {
  * "java.lang.String" 5"j.l.String"
  * "java.lang.String"15"j.lang.String"
  * 
"java.lang.String"30"java.lang.String"
+ * 
"org.apache.commons.lang3.ClassUtils"18"o.a.c.l.ClassUtils"
  * 
- * @param className  the className to get the abbreviated name for, may be 
{@code null}
- * @param len  the desired length of the abbreviated name
- * @return the abbreviated name or an empty string
- * @throws IllegalArgumentException if len = 0
+ *
+ * @param className the className to get the abbreviated name for, may be 
{@code null}
+ * @param len   the desired length of the abbreviated name
+ * @return the abbreviated name or an empty string if the specified
+ * class name is {@code null} or empty string
+ * @throws IllegalArgumentException if {@code len <= 0}
  * @since 3.4
  */
 public static String getAbbreviatedName(final String className, final int 
len) {
-  if (len <= 0) {
-throw new IllegalArgumentException("len must be > 0");
-  }
-  if (className == null) {
-return StringUtils.EMPTY;
-  }
-
-  int availableSpace = len;
-  final int packageLevels = StringUtils.countMatches(className, '.');
-  final String[] output = new String[packageLevels + 1];
-  int endIndex = className.length() - 1;
-  for (int level = packageLevels; level >= 0; level--) {
-final int startIndex = className.lastIndexOf('.', endIndex);
-final String part = className.substring(startIndex + 1, endIndex + 1);
-availableSpace -= part.length();
-if (level > 0) {
-  // all elements except top level require an additional char space
-  availableSpace--;
+if (len <= 0) {
+throw new IllegalArgumentException("len must be > 0");
 }
-if (level == packageLevels) {
-  // ClassName is always complete
-  output[level] = part;
-} else {
-  if (availableSpace > 0) {
-output[level] = part;
-  } else {
-// if no space is left still the first char is used
-output[level] = part.substring(0, 1);
-  }
+if (className == null) {
+return StringUtils.EMPTY;
 }
-endIndex = startIndex - 1;
-  }
 
-  return StringUtils.join(output, '.');
+final char[] abbreviated = className.toCharArray();
+int target = 0;
+int source = 0;
+while (source < abbreviated.length) {
+// copy the next part
+int runAheadTarget = target;
+while (source < abbreviated.length && abbreviated[source] != '.') {
+abbreviated[runAheadTarget++] = abbreviated[source++];
+}
+
+++target;
+if (useFull(runAheadTarget, source, abbreviated.length, len)
+|| target > runAheadTarget) {
+target = runAheadTarget;
+}
+
+// copy the '.' unless it was the last part
+if (source < abbreviated.length) {
+abbreviated[target++] = abbreviated[source++];
+}
+}
+return new String(abbreviated, 0, target);
+}
+
+/**
+ * Decides if the part that was just copied to its destination
+ * location in the work array can be kept as it was copied or must be
+ * abbreviated. It must be kept when the part is the last one, which
+ * is the simple name of the class. In this case the {@code source}
+ * index, from where the characters are copied points one position
+ * after the last character, a.k.a. {@code source ==
+ * originalLength}
+ *
+ * If the part is not the last one then it can be kept
+ * unabridged if the number of the characters copied so far plus
+ * the character that are to be copied is less than or equal to the
+ * desired length.
+ *
+ * @param runAheadTarget the target index (where the characters were
+ *   copied to) pointing after the last character
+ *   copied when the current part was copied
+ * @param source the source index (where the 

[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-08-26 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=301150=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-301150
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 26/Aug/19 10:13
Start Date: 26/Aug/19 10:13
Worklog Time Spent: 10m 
  Work Description: coveralls commented on issue #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#issuecomment-523879388
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/25342159/badge)](https://coveralls.io/builds/25342159)
   
   Coverage decreased (-0.007%) to 95.207% when pulling 
**0913d1e17ff7661b856b737a8f90f1aa23c92c75 on verhas:LANG-1480** into 
**24f66b175fdbc37c02ac234f1f3d7b2a5f13cc57 on apache:master**.
   
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 301150)
Remaining Estimate: 20.5h  (was: 20h 40m)
Time Spent: 3.5h  (was: 3h 20m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 3.5h
>  Remaining Estimate: 20.5h
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-08-26 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=301145=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-301145
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 26/Aug/19 10:07
Start Date: 26/Aug/19 10:07
Worklog Time Spent: 10m 
  Work Description: coveralls commented on issue #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#issuecomment-523879388
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/25342091/badge)](https://coveralls.io/builds/25342091)
   
   Coverage increased (+0.006%) to 95.22% when pulling 
**0913d1e17ff7661b856b737a8f90f1aa23c92c75 on verhas:LANG-1480** into 
**24f66b175fdbc37c02ac234f1f3d7b2a5f13cc57 on apache:master**.
   
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 301145)
Remaining Estimate: 20h 40m  (was: 20h 50m)
Time Spent: 3h 20m  (was: 3h 10m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 3h 20m
>  Remaining Estimate: 20h 40m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-08-26 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=301144=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-301144
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 26/Aug/19 10:05
Start Date: 26/Aug/19 10:05
Worklog Time Spent: 10m 
  Work Description: coveralls commented on issue #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#issuecomment-523879388
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/25342084/badge)](https://coveralls.io/builds/25342084)
   
   Coverage decreased (-0.0006%) to 95.214% when pulling 
**f09fbd75e3402bdd8a3e8b5cb545a20c7c80f96e on verhas:LANG-1480** into 
**24f66b175fdbc37c02ac234f1f3d7b2a5f13cc57 on apache:master**.
   
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 301144)
Remaining Estimate: 20h 50m  (was: 21h)
Time Spent: 3h 10m  (was: 3h)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 3h 10m
>  Remaining Estimate: 20h 50m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-08-26 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=301142=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-301142
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 26/Aug/19 10:03
Start Date: 26/Aug/19 10:03
Worklog Time Spent: 10m 
  Work Description: coveralls commented on issue #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#issuecomment-523879388
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/25342024/badge)](https://coveralls.io/builds/25342024)
   
   Coverage decreased (-0.0006%) to 95.214% when pulling 
**f09fbd75e3402bdd8a3e8b5cb545a20c7c80f96e on verhas:LANG-1480** into 
**24f66b175fdbc37c02ac234f1f3d7b2a5f13cc57 on apache:master**.
   
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 301142)
Remaining Estimate: 21h  (was: 21h 10m)
Time Spent: 3h  (was: 2h 50m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 3h
>  Remaining Estimate: 21h
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-08-26 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=301141=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-301141
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 26/Aug/19 10:01
Start Date: 26/Aug/19 10:01
Worklog Time Spent: 10m 
  Work Description: coveralls commented on issue #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#issuecomment-523879388
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/25341997/badge)](https://coveralls.io/builds/25341997)
   
   Coverage decreased (-0.0006%) to 95.214% when pulling 
**a0595c0288d6d9c38afcec0818dcac25428f6e10 on verhas:LANG-1480** into 
**24f66b175fdbc37c02ac234f1f3d7b2a5f13cc57 on apache:master**.
   
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 301141)
Remaining Estimate: 21h 10m  (was: 21h 20m)
Time Spent: 2h 50m  (was: 2h 40m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 2h 50m
>  Remaining Estimate: 21h 10m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-08-26 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=301134=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-301134
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 26/Aug/19 09:55
Start Date: 26/Aug/19 09:55
Worklog Time Spent: 10m 
  Work Description: coveralls commented on issue #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#issuecomment-523879388
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/25341925/badge)](https://coveralls.io/builds/25341925)
   
   Coverage decreased (-0.0006%) to 95.214% when pulling 
**55d41503f2c04df4359489926f12080ae05ebe0c on verhas:LANG-1480** into 
**24f66b175fdbc37c02ac234f1f3d7b2a5f13cc57 on apache:master**.
   
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 301134)
Remaining Estimate: 21h 20m  (was: 21.5h)
Time Spent: 2h 40m  (was: 2.5h)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 2h 40m
>  Remaining Estimate: 21h 20m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-08-26 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=301132=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-301132
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 26/Aug/19 09:54
Start Date: 26/Aug/19 09:54
Worklog Time Spent: 10m 
  Work Description: verhas commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r317534659
 
 

 ##
 File path: src/main/java/org/apache/commons/lang3/ClassUtils.java
 ##
 @@ -987,33 +1005,35 @@ public static boolean isAssignable(Class cls, final 
Class toClass, final b
 
 // Inner class
 // --
+
 /**
  * Is the specified class an inner class or static nested class.
  *
- * @param cls  the class to check, may be null
+ * @param cls the class to check, may be null
  * @return {@code true} if the class is an inner or static nested class,
- *  false if not or {@code null}
+ * false if not or {@code null}
  */
 public static boolean isInnerClass(final Class cls) {
 return cls != null && cls.getEnclosingClass() != null;
 }
 
 // Class loading
 // --
+
 /**
  * Returns the class represented by {@code className} using the
  * {@code classLoader}.  This implementation supports the syntaxes
  * "{@code java.util.Map.Entry[]}", "{@code java.util.Map$Entry[]}",
  * "{@code [Ljava.util.Map.Entry;}", and "{@code [Ljava.util.Map$Entry;}".
  *
- * @param classLoader  the class loader to use to load the class
- * @param className  the class name
+ * @param classLoader the class loader to use to load the class
+ * @param className   the class name
  * @param initialize  whether the class must be initialized
  * @return the class represented by {@code className} using the {@code 
classLoader}
  * @throws ClassNotFoundException if the class is not found
  */
 public static Class getClass(
-final ClassLoader classLoader, final String className, final 
boolean initialize) throws ClassNotFoundException {
+final ClassLoader classLoader, final String className, final boolean 
initialize) throws ClassNotFoundException {
 
 Review comment:
   I am doing it. Actually, these formattings are clumsy in the original code, 
and IntelliJ just reformatted automatically. I understand that it is no excuse 
for creating a messy PR. Sorry.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 301132)
Remaining Estimate: 21.5h  (was: 21h 40m)
Time Spent: 2.5h  (was: 2h 20m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 2.5h
>  Remaining Estimate: 21.5h
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-08-26 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=301130=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-301130
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 26/Aug/19 09:53
Start Date: 26/Aug/19 09:53
Worklog Time Spent: 10m 
  Work Description: coveralls commented on issue #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#issuecomment-523879388
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/25341848/badge)](https://coveralls.io/builds/25341848)
   
   Coverage decreased (-0.0006%) to 95.214% when pulling 
**b938f38eebc0457c5492f3956a9c07b1e385aaa6 on verhas:LANG-1480** into 
**24f66b175fdbc37c02ac234f1f3d7b2a5f13cc57 on apache:master**.
   
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 301130)
Remaining Estimate: 21h 40m  (was: 21h 50m)
Time Spent: 2h 20m  (was: 2h 10m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 2h 20m
>  Remaining Estimate: 21h 40m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-08-26 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=301128=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-301128
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 26/Aug/19 09:52
Start Date: 26/Aug/19 09:52
Worklog Time Spent: 10m 
  Work Description: coveralls commented on issue #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#issuecomment-523879388
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/25341848/badge)](https://coveralls.io/builds/25341848)
   
   Coverage decreased (-0.0006%) to 95.214% when pulling 
**b938f38eebc0457c5492f3956a9c07b1e385aaa6 on verhas:LANG-1480** into 
**24f66b175fdbc37c02ac234f1f3d7b2a5f13cc57 on apache:master**.
   
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 301128)
Remaining Estimate: 22h  (was: 22h 10m)
Time Spent: 2h  (was: 1h 50m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 2h
>  Remaining Estimate: 22h
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-08-26 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=301129=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-301129
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 26/Aug/19 09:52
Start Date: 26/Aug/19 09:52
Worklog Time Spent: 10m 
  Work Description: coveralls commented on issue #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#issuecomment-523879388
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/25341815/badge)](https://coveralls.io/builds/25341815)
   
   Coverage increased (+0.006%) to 95.22% when pulling 
**1c45c7d1118310e4f49b4ff30b19477884868078 on verhas:LANG-1480** into 
**24f66b175fdbc37c02ac234f1f3d7b2a5f13cc57 on apache:master**.
   
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 301129)
Remaining Estimate: 21h 50m  (was: 22h)
Time Spent: 2h 10m  (was: 2h)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 2h 10m
>  Remaining Estimate: 21h 50m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-08-26 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=301127=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-301127
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 26/Aug/19 09:51
Start Date: 26/Aug/19 09:51
Worklog Time Spent: 10m 
  Work Description: coveralls commented on issue #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#issuecomment-523879388
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/25341825/badge)](https://coveralls.io/builds/25341825)
   
   Coverage decreased (-0.0006%) to 95.214% when pulling 
**1c45c7d1118310e4f49b4ff30b19477884868078 on verhas:LANG-1480** into 
**24f66b175fdbc37c02ac234f1f3d7b2a5f13cc57 on apache:master**.
   
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 301127)
Remaining Estimate: 22h 10m  (was: 22h 20m)
Time Spent: 1h 50m  (was: 1h 40m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 1h 50m
>  Remaining Estimate: 22h 10m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-08-26 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=301125=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-301125
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 26/Aug/19 09:43
Start Date: 26/Aug/19 09:43
Worklog Time Spent: 10m 
  Work Description: kinow commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r317530498
 
 

 ##
 File path: src/main/java/org/apache/commons/lang3/ClassUtils.java
 ##
 @@ -987,33 +1005,35 @@ public static boolean isAssignable(Class cls, final 
Class toClass, final b
 
 // Inner class
 // --
+
 /**
  * Is the specified class an inner class or static nested class.
  *
- * @param cls  the class to check, may be null
+ * @param cls the class to check, may be null
  * @return {@code true} if the class is an inner or static nested class,
- *  false if not or {@code null}
+ * false if not or {@code null}
  */
 public static boolean isInnerClass(final Class cls) {
 return cls != null && cls.getEnclosingClass() != null;
 }
 
 // Class loading
 // --
+
 /**
  * Returns the class represented by {@code className} using the
  * {@code classLoader}.  This implementation supports the syntaxes
  * "{@code java.util.Map.Entry[]}", "{@code java.util.Map$Entry[]}",
  * "{@code [Ljava.util.Map.Entry;}", and "{@code [Ljava.util.Map$Entry;}".
  *
- * @param classLoader  the class loader to use to load the class
- * @param className  the class name
+ * @param classLoader the class loader to use to load the class
+ * @param className   the class name
  * @param initialize  whether the class must be initialized
  * @return the class represented by {@code className} using the {@code 
classLoader}
  * @throws ClassNotFoundException if the class is not found
  */
 public static Class getClass(
-final ClassLoader classLoader, final String className, final 
boolean initialize) throws ClassNotFoundException {
+final ClassLoader classLoader, final String className, final boolean 
initialize) throws ClassNotFoundException {
 
 Review comment:
   I think now the PR has a lot more changes that are not related to LANG-1480. 
Are you able to undo formatting changes, and leave only the changes for the 
issue, please?
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 301125)
Remaining Estimate: 22h 20m  (was: 22.5h)
Time Spent: 1h 40m  (was: 1.5h)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 1h 40m
>  Remaining Estimate: 22h 20m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-08-26 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=301114=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-301114
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 26/Aug/19 09:21
Start Date: 26/Aug/19 09:21
Worklog Time Spent: 10m 
  Work Description: verhas commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r317522502
 
 

 ##
 File path: src/main/java/org/apache/commons/lang3/ClassUtils.java
 ##
 @@ -16,19 +16,11 @@
  */
 package org.apache.commons.lang3;
 
+import org.apache.commons.lang3.mutable.MutableObject;
+
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.lang3.mutable.MutableObject;
+import java.util.*;
 
 Review comment:
   This was the default IntelliJ setting to use * after more than 4 imports 
from the same package.
   
   I see no reason why not to use '*' in imports these days with such advanced 
editors, but in case that is the project standard, I comply. Thanks.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 301114)
Remaining Estimate: 22.5h  (was: 22h 40m)
Time Spent: 1.5h  (was: 1h 20m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Assignee: Bruno P. Kinoshita
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 1.5h
>  Remaining Estimate: 22.5h
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-08-24 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=300785=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-300785
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 24/Aug/19 23:54
Start Date: 24/Aug/19 23:54
Worklog Time Spent: 10m 
  Work Description: kinow commented on issue #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#issuecomment-524588806
 
 
   I think you need to include tests for this change. See the bot comment about 
coverage decreasing. Can we do anything about that?
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 300785)
Remaining Estimate: 22h 50m  (was: 23h)
Time Spent: 1h 10m  (was: 1h)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 1h 10m
>  Remaining Estimate: 22h 50m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-08-24 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=300786=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-300786
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 24/Aug/19 23:54
Start Date: 24/Aug/19 23:54
Worklog Time Spent: 10m 
  Work Description: kinow commented on issue #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#issuecomment-524588806
 
 
   I think you need to include tests for this change. See the bot comment about 
coverage decreasing. Can we do anything about that? Or if you could confirm 
this is not related, please.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 300786)
Remaining Estimate: 22h 40m  (was: 22h 50m)
Time Spent: 1h 20m  (was: 1h 10m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 1h 20m
>  Remaining Estimate: 22h 40m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-08-24 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=300784=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-300784
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 24/Aug/19 23:53
Start Date: 24/Aug/19 23:53
Worklog Time Spent: 10m 
  Work Description: kinow commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r317377567
 
 

 ##
 File path: src/test/java/org/apache/commons/lang3/ClassUtilsTest.java
 ##
 @@ -178,8 +179,22 @@ public void test_getAbbreviatedName_Class_ZeroLen() {
 @Test
 public void test_getAbbreviatedName_String() {
 assertEquals("", ClassUtils.getAbbreviatedName((String) null, 1));
+assertEquals("", ClassUtils.getAbbreviatedName("", 1));
 assertEquals("WithoutPackage", 
ClassUtils.getAbbreviatedName("WithoutPackage", 1));
 assertEquals("j.l.String", 
ClassUtils.getAbbreviatedName("java.lang.String", 1));
+assertEquals("o.a.c.l.ClassUtils", 
ClassUtils.getAbbreviatedName("org.apache.commons.lang3.ClassUtils", 18));
+assertEquals("o.a.c.l.ClassUtils", 
ClassUtils.getAbbreviatedName("o.a.c.l.ClassUtils", 18));
+assertEquals("o..c.l.ClassUtils", 
ClassUtils.getAbbreviatedName("o..c.l.ClassUtils", 18));
+assertEquals(".", ClassUtils.getAbbreviatedName(".", 18));
+assertEquals(".", ClassUtils.getAbbreviatedName(".", 1));
+assertEquals("..", ClassUtils.getAbbreviatedName("..", 1));
+assertEquals("...", ClassUtils.getAbbreviatedName("...", 2));
+assertEquals("...", ClassUtils.getAbbreviatedName("...", 3));
+assertEquals("java.lang.String", 
ClassUtils.getAbbreviatedName("java.lang.String", Integer.MAX_VALUE));
+assertEquals("j.lang.String", 
ClassUtils.getAbbreviatedName("java.lang.String", "j.lang.String".length()));
+assertEquals("j.l.String", 
ClassUtils.getAbbreviatedName("java.lang.String", "j.lang.String".length() - 
1));
+assertEquals("j.l.String", 
ClassUtils.getAbbreviatedName("java.lang.String", "j.l.String".length()));
+assertEquals("j.l.String", 
ClassUtils.getAbbreviatedName("java.lang.String", "j.l.String".length() - 1));
 
 Review comment:
   I think you are not testing the bug you found? There is no test for a call 
to `getAbbreviatedName` with class name as a `String`, and length as the exact 
length of that `String`.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 300784)
Remaining Estimate: 23h  (was: 23h 10m)
Time Spent: 1h  (was: 50m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 1h
>  Remaining Estimate: 23h
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-08-24 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=300783=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-300783
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 24/Aug/19 23:49
Start Date: 24/Aug/19 23:49
Worklog Time Spent: 10m 
  Work Description: kinow commented on issue #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#issuecomment-524588806
 
 
   I think you need to include tests for this change. See the bot comment about 
coverage decreasing, and a comment I've added about the missing test for the 
bug you described here.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 300783)
Remaining Estimate: 23h 10m  (was: 23h 20m)
Time Spent: 50m  (was: 40m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 50m
>  Remaining Estimate: 23h 10m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-08-24 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=300780=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-300780
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 24/Aug/19 23:48
Start Date: 24/Aug/19 23:48
Worklog Time Spent: 10m 
  Work Description: kinow commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r317376951
 
 

 ##
 File path: src/main/java/org/apache/commons/lang3/ClassUtils.java
 ##
 @@ -16,19 +16,11 @@
  */
 package org.apache.commons.lang3;
 
+import org.apache.commons.lang3.mutable.MutableObject;
+
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.lang3.mutable.MutableObject;
+import java.util.*;
 
 Review comment:
   This won't pass checkstyle I think. You will need to replace the `*` by 
explicit imports.
   
   See Travis builds failing, this part is due to this change: 
   
   >[ERROR] src/main/java/org/apache/commons/lang3/ClassUtils.java:[23] 
(imports) AvoidStarImport: Using the '.*' form of import should be avoided - 
java.util.*.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 300780)
Remaining Estimate: 23.5h  (was: 23h 40m)
Time Spent: 0.5h  (was: 20m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 0.5h
>  Remaining Estimate: 23.5h
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-08-24 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=300781=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-300781
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 24/Aug/19 23:48
Start Date: 24/Aug/19 23:48
Worklog Time Spent: 10m 
  Work Description: kinow commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r317377567
 
 

 ##
 File path: src/test/java/org/apache/commons/lang3/ClassUtilsTest.java
 ##
 @@ -178,8 +179,22 @@ public void test_getAbbreviatedName_Class_ZeroLen() {
 @Test
 public void test_getAbbreviatedName_String() {
 assertEquals("", ClassUtils.getAbbreviatedName((String) null, 1));
+assertEquals("", ClassUtils.getAbbreviatedName("", 1));
 assertEquals("WithoutPackage", 
ClassUtils.getAbbreviatedName("WithoutPackage", 1));
 assertEquals("j.l.String", 
ClassUtils.getAbbreviatedName("java.lang.String", 1));
+assertEquals("o.a.c.l.ClassUtils", 
ClassUtils.getAbbreviatedName("org.apache.commons.lang3.ClassUtils", 18));
+assertEquals("o.a.c.l.ClassUtils", 
ClassUtils.getAbbreviatedName("o.a.c.l.ClassUtils", 18));
+assertEquals("o..c.l.ClassUtils", 
ClassUtils.getAbbreviatedName("o..c.l.ClassUtils", 18));
+assertEquals(".", ClassUtils.getAbbreviatedName(".", 18));
+assertEquals(".", ClassUtils.getAbbreviatedName(".", 1));
+assertEquals("..", ClassUtils.getAbbreviatedName("..", 1));
+assertEquals("...", ClassUtils.getAbbreviatedName("...", 2));
+assertEquals("...", ClassUtils.getAbbreviatedName("...", 3));
+assertEquals("java.lang.String", 
ClassUtils.getAbbreviatedName("java.lang.String", Integer.MAX_VALUE));
+assertEquals("j.lang.String", 
ClassUtils.getAbbreviatedName("java.lang.String", "j.lang.String".length()));
+assertEquals("j.l.String", 
ClassUtils.getAbbreviatedName("java.lang.String", "j.lang.String".length() - 
1));
+assertEquals("j.l.String", 
ClassUtils.getAbbreviatedName("java.lang.String", "j.l.String".length()));
+assertEquals("j.l.String", 
ClassUtils.getAbbreviatedName("java.lang.String", "j.l.String".length() - 1));
 
 Review comment:
   I think you are not testing the bug you found? There is no test for a call 
to `getAbbreviatedName` with class name as a `String`, and length as the exact 
length of that `String`.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 300781)
Remaining Estimate: 23.5h  (was: 23h 40m)
Time Spent: 0.5h  (was: 20m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 0.5h
>  Remaining Estimate: 23.5h
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-08-24 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=300782=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-300782
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 24/Aug/19 23:48
Start Date: 24/Aug/19 23:48
Worklog Time Spent: 10m 
  Work Description: kinow commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#discussion_r317377606
 
 

 ##
 File path: src/main/java/org/apache/commons/lang3/ClassUtils.java
 ##
 @@ -433,11 +432,13 @@ public static String getAbbreviatedName(final Class 
cls, final int len) {
  * "java.lang.String" 5"j.l.String"
  * "java.lang.String"15"j.lang.String"
  * 
"java.lang.String"30"java.lang.String"
+ * 
"org.apache.commons.lang3.ClassUtils"18"o.a.c.l.ClassUtils"
  * 
  * @param className  the className to get the abbreviated name for, may be 
{@code null}
  * @param len  the desired length of the abbreviated name
- * @return the abbreviated name or an empty string
- * @throws IllegalArgumentException if len = 0
+ * @return the abbreviated name or an empty string if the specified
+ * class name is {@code null} or empty string
+ * @throws IllegalArgumentException if {@code len <= 0}
 
 Review comment:
   Thanks for updating the docs!
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 300782)
Remaining Estimate: 23h 20m  (was: 23.5h)
Time Spent: 40m  (was: 0.5h)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 40m
>  Remaining Estimate: 23h 20m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-08-22 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=299385=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-299385
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 22/Aug/19 12:14
Start Date: 22/Aug/19 12:14
Worklog Time Spent: 10m 
  Work Description: coveralls commented on issue #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446#issuecomment-523879388
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/25285468/badge)](https://coveralls.io/builds/25285468)
   
   Coverage decreased (-0.0006%) to 95.335% when pulling 
**6a33956b3a48aa460c607171792397a16ab85338 on verhas:LANG-1480** into 
**2f38c4b5a871bfa77a2f05e9a5859879eb7301bd on apache:master**.
   
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 299385)
Remaining Estimate: 23h 40m  (was: 23h 50m)
Time Spent: 20m  (was: 10m)

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 20m
>  Remaining Estimate: 23h 40m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Work logged] (LANG-1480) ClassUtils. getAbbreviatedName(String ,int) returns too long result

2019-08-22 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1480?focusedWorklogId=299378=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-299378
 ]

ASF GitHub Bot logged work on LANG-1480:


Author: ASF GitHub Bot
Created on: 22/Aug/19 12:02
Start Date: 22/Aug/19 12:02
Worklog Time Spent: 10m 
  Work Description: verhas commented on pull request #446: LANG-1480 
getAbbreviatedName refactored to create appropriate length …
URL: https://github.com/apache/commons-lang/pull/446
 
 
   …short class names
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 299378)
Remaining Estimate: 23h 50m  (was: 24h)
Time Spent: 10m

> ClassUtils. getAbbreviatedName(String ,int) returns too long result
> ---
>
> Key: LANG-1480
> URL: https://issues.apache.org/jira/browse/LANG-1480
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.*
>Affects Versions: 3.9
> Environment: Environment independent.
>Reporter: Peter Verhas
>Priority: Major
>   Original Estimate: 24h
>  Time Spent: 10m
>  Remaining Estimate: 23h 50m
>
> In some cases, the algorithm decides incorrectly when to which package names 
> to abbreviate. For example, abbreviating
> {{org.apache.commons.lang3.ClassUtils}} to the length 18 will result 
> {{o.a.c.lang3.ClassUtils}} (22 characters) instead of {{o.a.c.l.ClassUtils}} 
> (18 characters as requested). The reason for this is that the algorithm 
> starts from the right and goes to the left abbreviating the packages and 
> starts to abbreviate the packages when it runs out of the available space.
> Instead, the algorithm should start from the left and abbreviate all packages 
> that would result in a too-long string without abbreviating the package name.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)