You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Peter Verhas (Jira)" <ji...@apache.org> on 2019/08/30 14:54:00 UTC
[jira] [Comment Edited] (LANG-1480) ClassUtils.
getAbbreviatedName(String ,int) returns too long result
[ https://issues.apache.org/jira/browse/LANG-1480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16915664#comment-16915664 ]
Peter Verhas edited comment on LANG-1480 at 8/30/19 2:53 PM:
-------------------------------------------------------------
I updated the code to contain only the changes that are related to the issue.
The fact that the coverage in terms of percentage decreased is a good thing. Think about it. I replaced a 100% covered but a complex and unnecessarily long method with a shorter, but also 100% covered one. If nothing else changes and the coverage of the whole project is less than 100% then the overall coverage will decrease. E.g.: you have a 200 LOC project. Coverage is 50%. You replace a 20 LOC/100% covered method with a 10 LOC/100% covered one. The coverage will decrease to 47.36%.
was (Author: peter@verhas.com):
I updated the code to contain only the changes that are related to the issue.
The fact that the coverage in terms of percentage decreased is a good thing. Think about it. I replaced a 100% covered but a complex and unnecessarily long method with a shorter, but also 100% covered one. If nothing else changes and the coverage of the whole project is less than 100% then the overall coverage will decrease. E.g.: you have a 200 LOC project. Coverage is 50%. You replace a 20 LOC/100% covered method with a 10 LOC/100% covered one. The coverage will decrease to 45%.
> 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)