Why this matters
Arrays.asList(T... a).stream() boxes primitive types unnecessarily, while Arrays.stream(array) directly creates the appropriate primitive stream type, improving performance.
Arrays.stream() for Primitive ArraysEnsure that Arrays.stream(array) is used instead of Arrays.asList(T... a).stream() for primitive arrays.
Arrays.asList(T... a).stream() boxes primitive types unnecessarily, while Arrays.stream(array) directly creates the appropriate primitive stream type, improving performance.
Side-by-side examples engineers can pattern-match during review.
Arrays.asList("a1", "a2", "b1", "c2", "c1").stream()
.filter(...)
.forEach(...);
Arrays.asList(1, 2, 3, 4).stream() // Noncompliant
.filter(...)
.forEach(...);Arrays.asList("a1", "a2", "b1", "c2", "c1").stream()
.filter(...)
.forEach(...);
int[] intArray = new int[]{1, 2, 3, 4};
Arrays.stream(intArray)
.filter(...)
.forEach(...);From the same buckets as this rule.
All static JS/CSS/font/image files MUST use content-hashed filenames (e.g., app.9c1a7b.js) and be served with "Cache-Control: public, max-age=31536000, immutable". HTML and other non-fingerprinted documents MUST be served with "Cache-Control: no-cache" (or equivalent) to enable conditional revalidation.