intellij-community
intellij-community copied to clipboard
Type Migration: introducing primitive functional interfaces
Hey!
We are a collaborative group of researchers from JetBrains Research and Oregon State University, and we are testing our data-driven plugin, which is based on the IntelliJ's Type Migration framework and adjusts it using custom structural-replace templates that express the adaptations required to perform the type changes.
I want to apply several type changes using it and open the PR, thus introducing primitive functional interfaces in order to prevent unnecessary boxing (like BooleanSupplier
instead of Supplier<Boolean>
, OptionalInt
instead of Optional<Integer>
, Predicate<T>
instead of Function<T, Boolean>
, etc.), since it can affect the performance of the code (Effective Java, Items 44, 61).
This patch is made automatically by the plugin, so it would help us a lot to evaluate the usefulness of our approach!
I've reverted commits that affect public methods' signatures (as @akozlova suggested, thanks!). Also, most of the proposed code changes are local, so I hope they do not even need running test suites. Anyway, I've run all tests for the affected packages on my local machine, it passed.