This is not possible.
You can bypass it, by formatting your code in that way:
URI uri = uriInfo
.getBaseUriBuilder()
.path(objectA)
.path(objectB)
.build();
In Oracle Java 8 you can write
public static void main(String... ignored) {
List<String> s = new ArrayList<>();
s.add("hello");
Predicate<? super String> predicate1 = (t) -> t.length() > 0;
Predicate<? super String> predicate2 = (t) -> t.length() < 8;
Predicate<? super String> predicate3 = null;
List<String> collect = s.stream()
.filter(predicate1) // 16
.filter(predicate2) // 17
.filter(predicate3) // 18
.collect(Collectors.toList());
}
and you get
Exception in thread "main" java.lang.NullPointerException
at java.util.Objects.requireNonNull(Objects.java:203)
at java.util.stream.ReferencePipeline.filter(ReferencePipeline.java:161)
at Example.main(Example.java:18)
For the Oracle JDK, this appears to be only in Java 8, not Java 7.