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

8269698: Specification for methods of java.awt.im.InputContext should mention that they do nothing #5806

Closed
wants to merge 4 commits into from

Conversation

azvegint
Copy link
Member

@azvegint azvegint commented Oct 4, 2021

This fix simply describes that the java.awt.im.InputContext is a dummy implementation, which may not conform its spec.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8269698: Specification for methods of java.awt.im.InputContext should mention that they do nothing

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/5806/head:pull/5806
$ git checkout pull/5806

Update a local copy of the PR:
$ git checkout pull/5806
$ git pull https://git.openjdk.java.net/jdk pull/5806/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5806

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/5806.diff

@azvegint
Copy link
Member Author

azvegint commented Oct 4, 2021

/csr

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 4, 2021

👋 Welcome back azvegint! 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 Oct 4, 2021
@openjdk
Copy link

openjdk bot commented Oct 4, 2021

@azvegint has indicated that a compatibility and specification (CSR) request is needed for this pull request.
@azvegint please create a CSR request for issue JDK-8269698. This pull request cannot be integrated until the CSR request is approved.

@openjdk
Copy link

openjdk bot commented Oct 4, 2021

@azvegint The following labels will be automatically applied to this pull request:

  • client
  • i18n

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

@openjdk openjdk bot added client client-libs-dev@openjdk.org i18n i18n-dev@openjdk.org labels Oct 4, 2021
@mlbridge
Copy link

mlbridge bot commented Oct 4, 2021

Webrevs

@mrserb
Copy link
Member

mrserb commented Oct 4, 2021

If the problem is in the validation of the parameters maybe we can enforce it?

@azvegint
Copy link
Member Author

azvegint commented Oct 4, 2021

If the problem is in the validation of the parameters maybe we can enforce it?

It is one of possible solutions.
Also we have a following javadoc:

    /**
     * Constructs an InputContext.
     * This method is protected so clients cannot instantiate
     * InputContext directly. Input contexts are obtained by
     * calling {@link #getInstance}.
     */
    protected InputContext() {

So those validation of the parameters enforcements will be an almost dead code, only used by synthetic specification test.

Another solution is to make this class abstract.

@mrserb
Copy link
Member

mrserb commented Oct 4, 2021

Another solution is to make this class abstract.

It won't help, since they will subclass this class and call the parent methods, which they do a few times already for some other cases.

@mrserb
Copy link
Member

mrserb commented Oct 4, 2021

So those validation of the parameters enforcements will be an almost dead code, only used by synthetic specification test.

But is it worth it to update the spec in stone that these methods will return null/false/no-exceptions forever just because of one synthetic specification test?

@naotoj
Copy link
Member

naotoj commented Oct 4, 2021

I'd agree we add clarification to the spec, instead of adding parameter checks. Java input methods became less useful after JDK9, where it restricted system-wide Java IM installation (The extension mechanism was removed).

@mrserb
Copy link
Member

mrserb commented Oct 8, 2021

I am fine with any solution but think the check will be simpler and safer, and later we will be able to change the behavior of some of these methods if it will be needed.

@azvegint
Copy link
Member Author

azvegint commented Oct 9, 2021

I am fine with any solution but think the check will be simpler and safer, and later we will be able to change the behavior of some of these methods if it will be needed.

Makes sense. Testing is green with last code changes.
CSR label will be removed once we agreed on this.

@@ -144,6 +143,9 @@ public static InputContext getInstance() {
*/
public boolean selectInputMethod(Locale locale) {
// real implementation is in sun.awt.im.InputContext
if (locale == null) {
throw new NullPointerException();
Copy link
Member

Choose a reason for hiding this comment

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

Probably we can reuse the Objects.requireNonNull()?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure.

@azvegint
Copy link
Member Author

/csr unneeded

@openjdk openjdk bot removed the csr Pull request needs approved CSR before integration label Oct 14, 2021
@openjdk
Copy link

openjdk bot commented Oct 14, 2021

@azvegint determined that a CSR request is not needed for this pull request.

@openjdk
Copy link

openjdk bot commented Oct 14, 2021

@azvegint 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:

8269698: Specification for methods of java.awt.im.InputContext should mention that they do nothing

Reviewed-by: serb

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 143 new commits pushed to the master branch:

  • 333c469: 8275262: [BACKOUT] AArch64: Implement string_compare intrinsic in SVE
  • 8b1b6f9: 8269559: AArch64: Implement string_compare intrinsic in SVE
  • d9e03e4: 8275244: Suppress warnings on non-serializable array component types in jdk.management
  • 7dc2db4: 8274032: Remove jtreg tag manual=yesno for java/awt/print/PrinterJob/ImagePrinting/ImageTypes.java & show test UI
  • 1e0184d: 8275234: java/awt/GraphicsDevice/DisplayModes/CycleDMImage.java is entered twice in ProblemList
  • d15fbc2: 8275187: Suppress warnings on non-serializable array component types in java.sql.rowset
  • d8f6b6c: 8274718: runtime/cds/appcds/LambdaEagerInit.java fails with -XX:-CompactStrings
  • 451a296: 8275173: testlibrary_tests/ir_framework/tests/TestCheckedTests.java fails after JDK-8274911
  • 5ffb5d1: 8272992: Replace usages of Collections.sort with List.sort call in jdk.* modules
  • b8cb76a: 8273682: Upgrade Jline to 3.20.0
  • ... and 133 more: https://git.openjdk.java.net/jdk/compare/c05dc268acaf87236f30cf700ea3ac778e3b20e5...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 Oct 14, 2021
@azvegint
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Oct 15, 2021

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

  • 8e02064: 8049520: FileCredentialsCache loads cache once and is never refreshed
  • 172aed1: 8274338: com/sun/jdi/RedefineCrossEvent.java failed "assert(m != __null) failed: NULL mirror"
  • ced7909: 8275286: Check current thread when calling JRT methods that expect it
  • c0f3e1d: 8271071: accessibility of a table on macOS lacks cell navigation
  • 4cb7124: 8262912: ciReplay: replay does not simulate unresolved classes
  • 322b130: 8275106: Cleanup Iterator usages in java.desktop
  • c355704: 8041125: ColorConvertOp filter much slower in JDK 8 compared to JDK7
  • 9623d5b: 8275265: java/nio/channels tests needing large heap sizes fail on x86_32
  • 21df412: 8275240: Change nested classes in jdk.attach to static nested classes
  • a16f2d0: 8272908: Missing coverage for certain classes in com.sun.org.apache.xml.internal.security
  • ... and 148 more: https://git.openjdk.java.net/jdk/compare/c05dc268acaf87236f30cf700ea3ac778e3b20e5...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Oct 15, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Oct 15, 2021
@openjdk
Copy link

openjdk bot commented Oct 15, 2021

@azvegint Pushed as commit da8da3a.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client client-libs-dev@openjdk.org i18n i18n-dev@openjdk.org integrated Pull request has been integrated
3 participants