Giter Site home page Giter Site logo

Comments (3)

KengoTODA avatar KengoTODA commented on July 20, 2024

Maybe these links are related with this issue:

from findbugs.

bgourlie avatar bgourlie commented on July 20, 2024

Ahh, which bug tracker is the official one?

from findbugs.

amaembo avatar amaembo commented on July 20, 2024

@bgourlie this one is preferred now. I totally disagree as there are would be too much false positives. Simple case:

//input: List<int[]> data;
data.stream().map(arr -> IntStream.of(arr).max()).filter(OptionalInt::isPresent)
                     .map(OptionalInt::getAsInt).toArray();

Both isPresent and getAsInt are called, but at different stages of pipeline. How can this be tracked?

Another case:

public static int min(int[] data) {
    if(data == null || data.length == 0) return Integer.MAX_VALUE;
    return Arrays.stream(data).min().getAsInt();
}

Perfectly safe, but isPresent was not called. This is similar to complain about unchecked dereference of Map.get(): while you may catch some bugs, tons of false-positives would arise.

from findbugs.

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.