RFR: 6948: Add union to QuantityRange [v2]

Henrik Dafgård hdafgard at openjdk.java.net
Mon Nov 2 21:51:52 UTC 2020


On Sat, 31 Oct 2020 22:16:01 GMT, Jean-Philippe Bempel <github.com+4610701+jpbempel at openjdk.org> wrote:

>> Add tests for intersetion & union
>
> Jean-Philippe Bempel has updated the pull request incrementally with one additional commit since the last revision:
> 
>   add license header

core/org.openjdk.jmc.common/src/main/java/org/openjdk/jmc/common/unit/QuantityRange.java line 250:

> 248: 		if (intersection(a, b) == null) { // if disjoint, no union
> 249: 			return null;
> 250: 		}

Could we do this without potentially allocating a new QuantityRange object here? I.e. if the ranges intersect we'll allocate a new IRange just for a null check.

-------------

PR: https://git.openjdk.java.net/jmc/pull/150


More information about the jmc-dev mailing list