3

Consider the following Java method:

Paths.get(String first, String... more)

It is nice that you have access to the varargs when needed, however Netbeans 8, and earlier versions, insist that you will use at least one varargs element.

So assume you have the following:

String a = "";
String b = "";

Then you start typing Paths.g, you select the option, and it suddenly pops up with:

Paths.get(a, b), while in reality you wanted to type Paths.get(a).

Is there any way to tell Netbeans that when it encounters a varargs argument method, that I do not want to use the varargs in autocomplete?

skiwi
  • 66,971
  • 31
  • 131
  • 216

1 Answers1

0

No, in NetBeans 8.0.2 there is no such option. What it has nowadays is an option to ignore totally the arguments suggestion. You can go to Tools > Options > Editor > Code Completion, select the Java language and deselect 'Guess Filled Method Arguments' option.