mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-04 20:30:42 +07:00
The fix was done in the previous commit, the one that also fixed IDEA-383350. This commit only adds a test case for the bug described in IDEA-383357 GitOrigin-RevId: 6669cffaca5b10c43779093e9ef672a575e7a13f
23 lines
622 B
Java
23 lines
622 B
Java
// "Create field for parameter 'hobbies'" "false"
|
|
|
|
import java.util.Collections;
|
|
import java.util.LinkedHashSet;
|
|
|
|
class Person {
|
|
String name;
|
|
int age;
|
|
private final String[] hobbies;
|
|
|
|
Person(String name, int age, String... <caret>hobbies) {
|
|
this.name = name;
|
|
this.age = age;
|
|
LinkedHashSet hobbySet = new LinkedHashSet<>();
|
|
Collections.addAll(hobbySet, hobbies);
|
|
if (hobbies.length == 0) {
|
|
throw new IllegalArgumentException("Interesting person must have at least one hobby.");
|
|
}
|
|
this.hobbies = hobbySet.toArray(new String[hobbySet.size()]);
|
|
System.out.println(hobbies);
|
|
}
|
|
}
|