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

8285306: Fix typos in java.desktop #8328

Closed
wants to merge 50 commits into from

Conversation

magicus
Copy link
Member

@magicus magicus commented Apr 21, 2022

I ran codespell on the src/java.desktop directory, and accepted those changes where it indeed discovered real typos.

I ignored typos in public methods and variables. Maybe they can be fixed later on without much fanfare, if they are in internal classes. Typos in exposed APIs are likely here to stay.

I will update copyright years using a script before pushing (otherwise like every second change would be a copyright update, making reviewing much harder).

The long term goal here is to make tooling support for running codespell. The trouble with automating this is of course all false positives. But before even trying to solve that issue, all true positives must be fixed. Hence this PR.


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

Issue

Reviewers

Contributors

  • Andrey Turbanov <aturbanov@openjdk.org>

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 8328

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 21, 2022

👋 Welcome back ihse! 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 changed the title 8285306 8285306: Fix typos in java.desktop Apr 21, 2022
@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 21, 2022
@openjdk
Copy link

openjdk bot commented Apr 21, 2022

@magicus 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 Apr 21, 2022
@mlbridge
Copy link

mlbridge bot commented Apr 21, 2022

@prrace
Copy link
Contributor

prrace commented Apr 27, 2022

 static class AquaHierarchyButtonListener implements HierarchyListener {
  •    // Everytime a hierarchy is change we need to check if the button if moved on or from
    
  •    // Every time a hierarchy is change we need to check if the button if moved on or from
    

change -> changed
if moved -> is moved

src/java.desktop/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java

  •        // it won't be invoced if focuse is moved to a html element
    
  •        // it won't be invoced if focus is moved to a html element
    

invoced -> invoked
"a html" -> "an html"

src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_MidiOut.c

  • // $$fb 2002-04-04: It is responsibility of the application developer to

"is the"

src/java.desktop/windows/native/libjsound/PLATFORM_API_WinOS_MidiOut.c

  • // $$fb 2002-04-04: It is responsibility of the application developer to

same as above

Regarding changes in gif + freetype
diff --git a/src/java.desktop/share/native/libawt/awt/image/gif/gifdecoder.c b/src/java.desktop/share/native/libawt/awt/image/gif/gifdecoder.c

diff --git a/src/java.desktop/share/native/libfontmanager/freetypeScaler.c b/src/java.desktop/share/native/libfontmanager/freetypeScaler.c

Please exclude ALL 3rd party libraries from this PR.

Copy link
Member

@aivanov-jdk aivanov-jdk left a comment

Choose a reason for hiding this comment

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

Nearly 500 files are too many. Smaller chunks would be easier to review.

Some of the native code files could come from upstream libraries.

magicus and others added 19 commits May 13, 2022 18:00
Co-authored-by: Alexey Ivanov <70774172+aivanov-jdk@users.noreply.github.com>
Co-authored-by: Alexey Ivanov <70774172+aivanov-jdk@users.noreply.github.com>
Co-authored-by: Alexey Ivanov <70774172+aivanov-jdk@users.noreply.github.com>
…ata.m

Co-authored-by: Alexey Ivanov <70774172+aivanov-jdk@users.noreply.github.com>
…aphicsConfig.m

Co-authored-by: Alexey Ivanov <70774172+aivanov-jdk@users.noreply.github.com>
…rtexCache.m

Co-authored-by: Alexey Ivanov <70774172+aivanov-jdk@users.noreply.github.com>
…rtexCache.m

Co-authored-by: Alexey Ivanov <70774172+aivanov-jdk@users.noreply.github.com>
Co-authored-by: Alexey Ivanov <70774172+aivanov-jdk@users.noreply.github.com>
….cpp

Co-authored-by: Alexey Ivanov <70774172+aivanov-jdk@users.noreply.github.com>
Co-authored-by: Alexey Ivanov <70774172+aivanov-jdk@users.noreply.github.com>
Co-authored-by: Alexey Ivanov <70774172+aivanov-jdk@users.noreply.github.com>
Co-authored-by: Alexey Ivanov <70774172+aivanov-jdk@users.noreply.github.com>
…eListener.java

Co-authored-by: Alexey Ivanov <70774172+aivanov-jdk@users.noreply.github.com>
Co-authored-by: Alexey Ivanov <70774172+aivanov-jdk@users.noreply.github.com>
Co-authored-by: Alexey Ivanov <70774172+aivanov-jdk@users.noreply.github.com>
Co-authored-by: Alexey Ivanov <70774172+aivanov-jdk@users.noreply.github.com>
Co-authored-by: Alexey Ivanov <70774172+aivanov-jdk@users.noreply.github.com>
Co-authored-by: Alexey Ivanov <70774172+aivanov-jdk@users.noreply.github.com>
@magicus
Copy link
Member Author

magicus commented Sep 6, 2022

/contributor add @turbanoff

@openjdk
Copy link

openjdk bot commented Sep 6, 2022

@magicus
Contributor Andrey Turbanov <aturbanov@openjdk.org> successfully added.

Copy link
Member

@aivanov-jdk aivanov-jdk left a comment

Choose a reason for hiding this comment

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

Is src/java.desktop/share/native/libawt/awt/image/gif/gifdecoder.c a third-party code?

Comment on lines 85 to 87
J2dTraceLn4(J2D_TRACE_VERBOSE, "MTLLayer.blitTexture: uninitialized (mtlc=%p, javaLayer=%p, buffer=%p, device=%p)", self.ctx, self.javaLayer, self.buffer, ctx.device);
J2dTraceLn4(J2D_TRACE_VERBOSE,
"MTLLayer.blitTexture: uninitialized (mtlc=%p, javaLayer=%p, buffer=%p, device=%p)", self.ctx,
self.javaLayer, self.buffer, ctx.device);
Copy link
Member

Choose a reason for hiding this comment

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

Is this an intended change? Or does it come from a merge?

May I suggest wrapping the line after the format string before self.ctx? It would make it easier to read.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is from the merge. The only difference wrt to current code is "devide" => "device". I can change wrapping if you request it, but I'd prefer to only fix typos.

Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer to only fix typos.

Let us keep only the typos.

@magicus
Copy link
Member Author

magicus commented Sep 13, 2022

Is src/java.desktop/share/native/libawt/awt/image/gif/gifdecoder.c a third-party code?

I don't think so. I find no comments in the source code, or any kind of indication on this being so. If you say it is, I can revert the changes in that file.

@magicus
Copy link
Member Author

magicus commented Sep 13, 2022

I see now that Phil cryptically said:

Regarding changes in gif + freetype
diff --git a/src/java.desktop/share/native/libawt/awt/image/gif/gifdecoder.c b/src/java.desktop/share/native/libawt/awt/image/gif/gifdecoder.c

diff --git a/src/java.desktop/share/native/libfontmanager/freetypeScaler.c b/src/java.desktop/share/native/libfontmanager/freetypeScaler.c

Please exclude ALL 3rd party libraries from this PR.

That might be interpreted as stating that gifdecoder.c is 3rd party source code (although that was by no means clear to me the first time I read it). I'll revert the changes in that file, and also src/java.desktop/share/native/libfontmanager/freetypeScaler.c.

@prrace
Copy link
Contributor

prrace commented Sep 13, 2022

I see now that Phil cryptically said:

Regarding changes in gif + freetype
diff --git a/src/java.desktop/share/native/libawt/awt/image/gif/gifdecoder.c b/src/java.desktop/share/native/libawt/awt/image/gif/gifdecoder.c

diff --git a/src/java.desktop/share/native/libfontmanager/freetypeScaler.c b/src/java.desktop/share/native/libfontmanager/freetypeScaler.c

Please exclude ALL 3rd party libraries from this PR.

That might be interpreted as stating that gifdecoder.c is 3rd party source code (although that was by no means clear to me the first time I read it). I'll revert the changes in that file, and also src/java.desktop/share/native/libfontmanager/freetypeScaler.c.

I don't know why I mentioned those two files like that but those particular two are JDK code so are fair game.

I did write
"Please exclude ALL 3rd party libraries from this PR."
and later :
"We need to revert the native code changes to "libfreetype".
and those points are correct.

You did fix the latter, but there are still some 3rd party files in there that are edited : glext.h, wsutils.h, multiVis.c

@magicus
Copy link
Member Author

magicus commented Sep 21, 2022

@prrace I have now reverted the changes to glext.h, wsutils.h and multiVis.c. Is this finally ready for merging?

(Going forward, I think we absolutely need to have some way to document in the code tree that certain files is 3rd party, like the UPSTREAM notation I previously suggested, or some variant thereof. This "tribal knowledge" about what is 3rd party is not beneficial to anyone, and only wastes both your and my time...)

@@ -65,7 +65,7 @@
*/
public abstract class MetalTheme {

// Contants identifying the various Fonts that are Theme can support
// Constants identifying the various Fonts that a Theme can support
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is possibly meant to say "constants that our theme can support"?

Copy link
Member

Choose a reason for hiding this comment

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

Please submit a new JBS issue for it if you can; if you can't, I can submit one on your behalf.

Possibly it meant to say “the theme”.

Copy link
Contributor

Choose a reason for hiding this comment

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

I unfortunately don't have a JBS (yet..), so if you could, that would be amazing.

Copy link
Member

Choose a reason for hiding this comment

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

I think the text is correct here: …that a Theme can support

MetalTheme is a superclass for classes which implement Themes. Thus the constants define fonts which a particular theme may use.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense.

@@ -1431,7 +1431,7 @@ public IllegalThreadException() {
private static final int MINIMAL_DELAY = 5;

/**
* Parameterless version of realsync which uses default timout (see DEFAUL_WAIT_TIME).
* Parameterless version of realsync which uses default timeout (see DEFAULT_WAIT_TIME).
Copy link
Contributor

@SWinxy SWinxy Sep 22, 2022

Choose a reason for hiding this comment

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

Suggested change
* Parameterless version of realsync which uses default timeout (see DEFAULT_WAIT_TIME).
* Parameterless version of realsync which uses the {@link #DEFAULT_WAIT_TIME default timeout}.

I mean this suggestion might not be warranted.

Copy link
Member

Choose a reason for hiding this comment

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

I'm for a clearer message:

Parameterless version of {@code realsSync} which uses the default timeout of {@link #DEFAULT_WAIT_TIME}.

Let us address this in a separate issue.

Copy link
Member

Choose a reason for hiding this comment

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

JDK-8294255: Add link to DEFAULT_WAIT_TIME in javadoc for SunToolKit.realsSync

Feel free to provide a patch.

@SWinxy
Copy link
Contributor

SWinxy commented Sep 22, 2022

Everything looks fine, and you can freely ignore my suggestions. They are just thoughts. And yeah we should probably earmark third party files to avoid "tribal knowledge".

@magicus
Copy link
Member Author

magicus commented Sep 22, 2022

/integrate

@openjdk
Copy link

openjdk bot commented Sep 22, 2022

@magicus This pull request has not yet been marked as ready for integration.

@magicus
Copy link
Member Author

magicus commented Oct 12, 2022

@prrace Do you think you can approve this now, so we can finally close it? (I promise I won't open huge PRs like this in the future; lesson well learnt.)

@openjdk
Copy link

openjdk bot commented Oct 18, 2022

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

8285306: Fix typos in java.desktop

Co-authored-by: Andrey Turbanov <aturbanov@openjdk.org>
Reviewed-by: aturbanov, prr

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

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 18, 2022
@magicus
Copy link
Member Author

magicus commented Oct 18, 2022

/integrate

@openjdk
Copy link

openjdk bot commented Oct 18, 2022

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

  • d1f7945: 6924219: (fc spec) FileChannel.write(ByteBuffer, position) behavior when file opened for append not specified
  • 5dbd495: 8295457: Make the signatures of write barrier methods consistent
  • 7b2e83b: 8295469: S390X: Optimized builds are broken
  • 63867c4: 8295433: EpsilonHeap doesn't need to override post_initialize()
  • e7375f9: 8295468: RISC-V: Minimal builds are broken
  • bd41428: 8293590: Some syntax checks performed by URL.openConnection() could be performed earlier, at URL construction
  • 78fed9d: 7175397: The divider color is not changed to green when dragging for Nimbus LaF.
  • 8c40b7d: 8292177: InitialSecurityProperty JFR event
  • e7a964b: 8295268: Optimized builds are broken due to incorrect assert_is_rfp shortcuts
  • 0b7d811: 8294730: Add @throws and @implNote clauses to BigInteger::isProblablePrime and BigInteger::nextProblablePrime
  • ... and 80 more: https://git.openjdk.org/jdk/compare/bdb4ed0fb136e9e5391cfa520048de6b7f83067d...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Oct 18, 2022

@magicus Pushed as commit 2a799e5.

💡 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
Development

Successfully merging this pull request may close these issues.

5 participants