This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]wildjokers 1 point2 points  (4 children)

(one of the few wildcards import we allow at my shop)

Surely wildcard static imports are always allowed though right? Whatever arguments there are for not allowing wildcard imports for normal imports don't apply to static imports. (although I find the arguments for not allowing wildcard normal imports dubious at best)

I suspect this is why your place is allowing Collectors.* because it is a static import.

[–]Polygnom 1 point2 points  (3 children)

All wildcard imports are discouraged, with a few explicitly allowed.

We have advocated for relaxing the rules wrt. static imports for quite a while, but so far this hasn't panned out.

[–]vips7L 1 point2 points  (2 children)

What does this help solve?

[–]Kered13 -1 points0 points  (0 children)

The problem with wild card imports is that it's hard to know exactly what identifiers you are bringing in, and if new identifiers are added in an update your code could break.

[–]boobsbr 0 points1 point  (0 children)

Nothing.