GithubHelp home page GithubHelp logo

Comments (7)

lukeu avatar lukeu commented on June 22, 2024

I'm currently hitting warnings with IsIterableContainingInOrder.contains

Should @SafeVarArgs be added to this and other methods also? I.e. should this fix be extended to annotate methods which might not have had overloads to begin with?

(Or might it be that these methods are not actually safe to annotate this way...?)

from javahamcrest.

kwin avatar kwin commented on June 22, 2024

Even with 2.0.0.0 I still do not see the annotation on org.hamcrest.Matchers.contains(...) therefore I still get the following warning
Type safety: A generic array of Matcher<? super something> is created for a varargs parameter

from javahamcrest.

ePaul avatar ePaul commented on June 22, 2024

I think this was closed preliminarily (unless it was meant as a "won't fix", but then a comment would be nice).

I propose all of the varargs methods in Matchers should get this annotation, as well as the static methods they are delegating to. (Unless there are some which actually write into the array, but I don't think that is happening here.)

(I don't understand how this changes the ABI ... the method still accepts an array of the upper bound type, right?)

from javahamcrest.

kwin avatar kwin commented on June 22, 2024

@sf105 Would you consider reopening this?

from javahamcrest.

sf105 avatar sf105 commented on June 22, 2024

Agreed. This have got too confused.

from javahamcrest.

arifogel avatar arifogel commented on June 22, 2024

What exactly will be done with this issue? It looks like the current source has the @SafeVarargs annotation:
https://github.com/hamcrest/JavaHamcrest/blob/master/hamcrest/src/main/java/org/hamcrest/Matchers.java#L886
Will there ever be another release with this change? (Release is out, but under different artifactId)
Isn't this issue technically resolved (but not by the original milestone)?

from javahamcrest.

tumbarumba avatar tumbarumba commented on June 22, 2024

Agree, closing this.

from javahamcrest.

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.