8274605: Fix predicate guarantees on returned values in (Doc)SourcePositions

Reviewed-by: jlahoda, jjg
This commit is contained in:
Pavel Rappo 2021-10-01 16:15:48 +00:00
parent 3d7671b65e
commit 05d38604a2
2 changed files with 20 additions and 20 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2021, 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
@ -49,9 +49,9 @@ public interface DocSourcePositions extends SourcePositions {
* is for any sub-tree of this tree, the following must hold:
*
* <p>
* {@code tree.getStartPosition() <= subtree.getStartPosition()} or <br>
* {@code tree.getStartPosition() == NOPOS} or <br>
* {@code subtree.getStartPosition() == NOPOS}
* {@code getStartPosition(file, comment, tree) <= getStartPosition(file, comment, subtree)} or <br>
* {@code getStartPosition(file, comment, tree) == NOPOS} or <br>
* {@code getStartPosition(file, comment, subtree) == NOPOS}
* </p>
*
* @param file compilation unit in which to find tree
@ -73,17 +73,17 @@ public interface DocSourcePositions extends SourcePositions {
* that is for any sub-tree of this tree, the following must hold:
*
* <p>
* {@code tree.getEndPosition() >= subtree.getEndPosition()} or <br>
* {@code tree.getEndPosition() == NOPOS} or <br>
* {@code subtree.getEndPosition() == NOPOS}
* {@code getEndPosition(file, comment, tree) >= getEndPosition(file, comment, subtree)} or <br>
* {@code getEndPosition(file, comment, tree) == NOPOS} or <br>
* {@code getEndPosition(file, comment, subtree) == NOPOS}
* </p>
*
* In addition, the following must hold:
*
* <p>
* {@code tree.getStartPosition() <= tree.getEndPosition()} or <br>
* {@code tree.getStartPosition() == NOPOS} or <br>
* {@code tree.getEndPosition() == NOPOS}
* {@code getStartPosition(file, comment, tree) <= getEndPosition(file, comment, tree)} or <br>
* {@code getStartPosition(file, comment, tree) == NOPOS} or <br>
* {@code getEndPosition(file, comment, tree) == NOPOS}
* </p>
*
* @param file compilation unit in which to find tree

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2021, 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
@ -45,9 +45,9 @@ public interface SourcePositions {
* is for any sub-tree of this tree, the following must hold:
*
* <p>
* {@code tree.getStartPosition() <= subtree.getStartPosition()} or <br>
* {@code tree.getStartPosition() == NOPOS} or <br>
* {@code subtree.getStartPosition() == NOPOS}
* {@code getStartPosition(file, tree) <= getStartPosition(file, subtree)} or <br>
* {@code getStartPosition(file, tree) == NOPOS} or <br>
* {@code getStartPosition(file, subtree) == NOPOS}
* </p>
*
* @param file CompilationUnit in which to find tree
@ -64,17 +64,17 @@ public interface SourcePositions {
* that is for any sub-tree of this tree, the following must hold:
*
* <p>
* {@code tree.getEndPosition() >= subtree.getEndPosition()} or <br>
* {@code tree.getEndPosition() == NOPOS} or <br>
* {@code subtree.getEndPosition() == NOPOS}
* {@code getEndPosition(file, tree) >= getEndPosition(file, subtree)} or <br>
* {@code getEndPosition(file, tree) == NOPOS} or <br>
* {@code getEndPosition(file, subtree) == NOPOS}
* </p>
*
* In addition, the following must hold:
*
* <p>
* {@code tree.getStartPosition() <= tree.getEndPosition()} or <br>
* {@code tree.getStartPosition() == NOPOS} or <br>
* {@code tree.getEndPosition() == NOPOS}
* {@code getStartPosition(file, tree) <= getEndPosition(file, tree)} or <br>
* {@code getStartPosition(file, tree) == NOPOS} or <br>
* {@code getEndPosition(file, tree) == NOPOS}
* </p>
*
* @param file CompilationUnit in which to find tree