Giter VIP home page Giter VIP logo

Comments (4)

ppalaga avatar ppalaga commented on July 27, 2024

I guess we need a null check here https://github.com/ec4j/editorconfig-maven-plugin/blob/master/editorconfig-maven-plugin/src/main/java/org/ec4j/maven/AbstractEditorconfigMojo.java#L313 and a test case. A PR is welcome :)

from editorconfig-maven-plugin.

mhagnumdw avatar mhagnumdw commented on July 27, 2024

I was thinking... What do you think of the "for" looks like this?

for (String exclude : excludes) {
    if (exclude == null || exclude.trim().length() == 0) {
        continue;
    }
    excls.add(exclude);
}

Maybe creating a StringUtils to check if a String is null or empty is a good one.

from editorconfig-maven-plugin.

ppalaga avatar ppalaga commented on July 27, 2024

Well, if you ask me, add() under if would be one line less.

for (String exclude : excludes) {
    if (exclude != null && exclude.trim().length() > 0) {
        excls.add(exclude);
    }
}

BTW, is the trim() necessary? AFAIK, Maven trims the values coming from pom.xml itself but I have no idea about list items passed on the command line.

Maybe creating a StringUtils to check if a String is null or empty is a good one.

I am not in favor of that. I find the expression better readable.

from editorconfig-maven-plugin.

ppalaga avatar ppalaga commented on July 27, 2024

Fixed in the just released version 0.0.11. Thanks again for the report.

from editorconfig-maven-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.