Re: Warning in Netbeans: what does it mean?

Owen Thomas <[email protected]> Mon, 1 Dec 2025 11:10:34 +1100
Newsgroups gmane.comp.java.ide.netbeans.user
Message-ID <CACtgfN=-Sfo2W+gVa=+Yb2ayq0w-FGuM9yyh8A15w9AWWVzZpw@mail.gmail.com>
On Mon, 1 Dec 2025 at 10:38, Owen Thomas <[email protected]> wrote:

> Thank you Alonso and Pete for your responses.
>
> This warning's short message was "Confusing primitive array passed to
> vararg method", and it was suppressed with the following:
>
> @SuppressWarnings({"ConfusingArrayVararg",
> "PrimitiveArrayArgumentToVariableArgMethod"})
>
> Thanks again.
>
>   Owen.
>

A single argument to a method with this signature would be a single byte
array - not a single byte. Providing a byte array could be a manifestation
of the mistaken apprehension by the developer that a single byte is indeed
a single argument - and this probably would lead to a problem that might
not be picked up until runtime.

Hence, upon reflection, I think the warning is a legitimate reason for
alerting the developer to the possibility of a mistake; and so I think all
is good with issuing the warning.