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

8303648: Add String.indexOf(String str, int beginIndex, int endIndex) #12903

Closed
wants to merge 3 commits into from

Conversation

rgiulietti
Copy link
Contributor

@rgiulietti rgiulietti commented Mar 7, 2023

As a followup of JDK-8302590, this issue covers the analogous case for a search of a string rather than a character.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change requires CSR request JDK-8303650 to be approved

Issues

  • JDK-8303648: Add String.indexOf(String str, int beginIndex, int endIndex)
  • JDK-8303650: Add String.indexOf(String str, int beginIndex, int endIndex) (CSR)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/12903/head:pull/12903
$ git checkout pull/12903

Update a local copy of the PR:
$ git checkout pull/12903
$ git pull https://git.openjdk.org/jdk.git pull/12903/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 12903

View PR using the GUI difftool:
$ git pr show -t 12903

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/12903.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 7, 2023

👋 Welcome back rgiulietti! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added rfr Pull request is ready for review csr Pull request needs approved CSR before integration labels Mar 7, 2023
@openjdk
Copy link

openjdk bot commented Mar 7, 2023

@rgiulietti The following label will be automatically applied to this pull request:

  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the core-libs core-libs-dev@openjdk.org label Mar 7, 2023
@mlbridge
Copy link

mlbridge bot commented Mar 7, 2023

Webrevs

* should be considered instead.
* On {@link String}s {@code s} and a non-empty {@code str}, for example,
* {@code s.indexOf(str, fromIndex, s.length())} would throw if
* {@code fromIndex} were larger than the string length, or were negative.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In passing, I think it's more common to put the apiNote after the method description and before the param/return.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in new commit

*/
public int indexOf(String str, int fromIndex) {
return indexOf(value, coder(), length(), str, fromIndex);
}

/**
* Returns the smallest index of an occurrence of the specified substring
* within the specified index range of {@code this} string.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be a bit more consistent with other methods to say "the index of the first occurrence". That will make it consistent with the proposed @return text too. Otherwise the proposed wording looks okay to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in new commit

Moved @APinote on indexOf(String,int) before @param/@return.
Rephrased first sentence of indexOf(String,int,int).
* {@code str} in the string.
* If stricter behavior is needed, {@link #indexOf(String, int, int)}
* should be considered instead.
* On {@link String}s {@code s} and a non-empty {@code str}, for example,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is both the normal font "s" and the code font "s" needed.
I reads ok as "On String s and a non-empty str,"...

@openjdk openjdk bot removed the csr Pull request needs approved CSR before integration label Mar 20, 2023
@openjdk
Copy link

openjdk bot commented Mar 20, 2023

@rgiulietti This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8303648: Add String.indexOf(String str, int beginIndex, int endIndex)

Reviewed-by: rriggs

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 209 new commits pushed to the master branch:

  • bc0ed73: 8304303: implement VirtualThread class notifyJvmti methods as C2 intrinsics
  • 2d0d057: 8304016: Add BitMap find_last suite of functions
  • 42723dc: 8304420: Regression ~11% with Javac-Generates on all platforms in b14
  • 19f2edd: 8304541: Modules THROW_MSG_ should return nullptr instead of JNI_FALSE
  • 622f239: 8304163: Move jdk.internal.module.ModuleInfoWriter to the test library
  • 4c8c993: 8304364: [AIX] Build erroneously determines build disk is non-local when using GNU-utils df on AIX
  • 4ed7350: 8304393: Provide method to iterate over regions of humongous object in G1
  • eb73fa8: 8301715: CDS should be disabled in exploded JDK
  • 80e9797: 8304433: cleanup sentence breaker code in DocTreeMaker
  • c396f1e: 8304443: bootcycle builds fail after JDK-8015831
  • ... and 199 more: https://git.openjdk.org/jdk/compare/1bb39a95eb42c7f68ba59ac2809717cd7b1df7bc...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 20, 2023
@rgiulietti
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Mar 21, 2023

Going to push as commit 4bf1fbb.
Since your change was applied there have been 214 commits pushed to the master branch:

  • c4df9b5: 8304537: Ant-based langtools build fails after JDK-8015831 Add lint check for calling overridable methods from a constructor
  • a6b72f5: 8304230: LShift ideal transform assertion
  • a72ba38: 8303948: HsErrFileUtils.checkHsErrFileContent() fails to check the last pattern.
  • bbca7c3: 8304542: Convert use of internal VM::classFileVersion to ClassFileFormatVersion
  • f593a6b: 8303018: Unicode Emoji Properties
  • bc0ed73: 8304303: implement VirtualThread class notifyJvmti methods as C2 intrinsics
  • 2d0d057: 8304016: Add BitMap find_last suite of functions
  • 42723dc: 8304420: Regression ~11% with Javac-Generates on all platforms in b14
  • 19f2edd: 8304541: Modules THROW_MSG_ should return nullptr instead of JNI_FALSE
  • 622f239: 8304163: Move jdk.internal.module.ModuleInfoWriter to the test library
  • ... and 204 more: https://git.openjdk.org/jdk/compare/1bb39a95eb42c7f68ba59ac2809717cd7b1df7bc...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Mar 21, 2023
@openjdk openjdk bot closed this Mar 21, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Mar 21, 2023
@openjdk
Copy link

openjdk bot commented Mar 21, 2023

@rgiulietti Pushed as commit 4bf1fbb.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@rgiulietti rgiulietti deleted the JDK-8303648 branch March 27, 2023 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated
3 participants