diff -r 88502b1cf76f -r 7799a51dbe30 src/jdk.compiler/share/classes/com/sun/source/tree/InstanceOfTree.java --- a/src/jdk.compiler/share/classes/com/sun/source/tree/InstanceOfTree.java Mon Sep 09 11:43:16 2019 -0400 +++ b/src/jdk.compiler/share/classes/com/sun/source/tree/InstanceOfTree.java Wed Nov 27 09:00:01 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,4 +51,33 @@ * @return the type */ Tree getType(); + + /** + * {@preview Associated with pattern matching for instanceof, a preview feature of + * the Java language. + * + * This method is associated with pattern matching for instanceof, a preview + * feature of the Java language. Preview features + * may be removed in a future release, or upgraded to permanent + * features of the Java language.} + * + * Returns the tested pattern, or null if this instanceof does not use + * a pattern. + * + *

For instanceof with a pattern, i.e. in the following form: + *

+     *   expression instanceof type variable name
+     * 
+ * returns the pattern. + * + *

For instanceof without a pattern, i.e. in the following form: + *

+     *   expression instanceof type
+     * 
+ * returns null. + * + * @return the tested pattern, or null if this instanceof does not use a pattern. + * @since 14 + */ + PatternTree getPattern(); }