Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UseStringIsEmptyRule complains when checking String[].length #1031

Closed
ilyakharlamov opened this issue Feb 19, 2019 · 27 comments
Closed

UseStringIsEmptyRule complains when checking String[].length #1031

ilyakharlamov opened this issue Feb 19, 2019 · 27 comments

Comments

@ilyakharlamov
Copy link

ilyakharlamov commented Feb 19, 2019

Steps to reproduce:

/*
 */
package com.mycompany.app;
/**
 * Hello world!
 * @since 1.0
 */
@SuppressWarnings("PMD.UseUtilityClass")
public final class App {
    /**
     * Ctor.
     */
    private App() { }

    /**
     * Main.
     * @param args Arguments
     */
    public static void main(final String... args) {
        if (args.length > 0) {
            System.out.println("args are not empty");
        }
    }
}

run mvn clean install -Pqulice

What's wrong:
PMD: src/main/java/com/mycompany/app/App.java[20-20]: Use String.isEmpty() when checking for empty string (UseStringIsEmptyRule)

We check an array of Strings but not a String.
There is no string length check at all in this code.
There is no such thing as String[].isEmpty() either.
We check String[].length but not String.length() here.

Expected result:
The rule should complain on String but should not complain on String[].

@0crat
Copy link
Collaborator

0crat commented Feb 19, 2019

@krzyk/z please, pay attention to this issue

@0crat
Copy link
Collaborator

0crat commented Feb 19, 2019

@ilyakharlamov/z this project will fix the problem faster if you donate a few dollars to it; just click here and pay via Stripe, it's very fast, convenient and appreciated; thanks a lot!

@krzyk
Copy link
Collaborator

krzyk commented Feb 20, 2019

@0crat in

@0crat 0crat added the scope label Feb 20, 2019
@0crat
Copy link
Collaborator

0crat commented Feb 20, 2019

@0crat in (here)

@krzyk Job #1031 is now in scope, role is DEV

@0crat
Copy link
Collaborator

0crat commented Feb 20, 2019

Bug was reported, see §29: +15 point(s) just awarded to @ilyakharlamov/z

@0crat
Copy link
Collaborator

0crat commented Feb 20, 2019

@krzyk/z everybody who has role DEV is banned at #1031; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)

@0crat
Copy link
Collaborator

0crat commented Feb 25, 2019

@krzyk/z everybody who has role DEV is banned at #1031; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)

@0crat
Copy link
Collaborator

0crat commented Mar 2, 2019

@krzyk/z everybody who has role DEV is banned at #1031; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)

@0crat
Copy link
Collaborator

0crat commented Mar 7, 2019

@krzyk/z everybody who has role DEV is banned at #1031; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)

@0crat
Copy link
Collaborator

0crat commented Mar 12, 2019

@krzyk/z everybody who has role DEV is banned at #1031; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)

@0crat
Copy link
Collaborator

0crat commented Mar 17, 2019

@krzyk/z everybody who has role DEV is banned at #1031; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)

@0crat
Copy link
Collaborator

0crat commented Mar 22, 2019

@krzyk/z everybody who has role DEV is banned at #1031; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)

@0crat
Copy link
Collaborator

0crat commented Mar 27, 2019

@krzyk/z everybody who has role DEV is banned at #1031; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)

@0crat
Copy link
Collaborator

0crat commented Apr 1, 2019

@krzyk/z everybody who has role DEV is banned at #1031; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)

@zCRUSADERz
Copy link
Contributor

@krzyk assign me, please.

@krzyk
Copy link
Collaborator

krzyk commented May 1, 2019

@0crat assign @zCRUSADERz

@0crat
Copy link
Collaborator

0crat commented May 1, 2019

@0crat assign @zCRUSADERz (here)

@krzyk The job #1031 assigned to @zCRUSADERz/z, here is why; the budget is 30 minutes, see §4; please, read §8 and §9; if the task is not clear, read this and this; @zCRUSADERz/z is not a member of this project yet, but they can request to join, as §1 explains; there will be no monetary reward for this job

@0crat
Copy link
Collaborator

0crat commented May 1, 2019

Manual assignment of issues is discouraged, see §19: -5 point(s) just awarded to @krzyk/z

@zCRUSADERz
Copy link
Contributor

@ilyakharlamov merged, please close

@zCRUSADERz
Copy link
Contributor

@0crat wait for closure

@0crat 0crat added the waiting label May 3, 2019
@0crat
Copy link
Collaborator

0crat commented May 3, 2019

@0crat wait for closure (here)

@zCRUSADERz The impediment for #1031 was registered successfully by @zCRUSADERz/z

@0crat
Copy link
Collaborator

0crat commented May 3, 2019

@0crat wait for closure (here)

@zCRUSADERz Job #1031 is not in the agenda of @zCRUSADERz/z, can't set impediment

@zCRUSADERz
Copy link
Contributor

@ilyakharlamov issue fixed, please close.

@ilyakharlamov
Copy link
Author

@zCRUSADERz Thanks, closed

@0crat
Copy link
Collaborator

0crat commented May 8, 2019

Job #1031 is not in the agenda of @zCRUSADERz/z, can't retrieve data and time of add

@0crat 0crat removed the scope label May 8, 2019
@0crat
Copy link
Collaborator

0crat commented May 8, 2019

The job #1031 is now out of scope

@0crat
Copy link
Collaborator

0crat commented May 8, 2019

Order was finished: +30 point(s) just awarded to @zCRUSADERz/z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants