Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -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
@@ -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