2020 Volume 37 Issue 2 Pages 2_59-2_75
In this paper, we propose a type system to detect non-terminating stream operations in Java programs using Stream API. Java Stream API makes it possible to write programs processing data collections in a declarative manner. Although Java Stream API has many stream operations and these operations are able to be applied to both finite and infinite streams, some operations on an infinite stream do not or may not terminate. Our proposed type system can detect these non-terminating operations. We prove the soundness of our type system and implement a type checker based on our type system with Checker Framework.