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

8252722: More Swing plaf APIs that rely on default constructors #251

Closed
wants to merge 3 commits into from

Conversation

@prsadhuk
Copy link
Contributor

@prsadhuk prsadhuk commented Sep 18, 2020

Please review a fix for issue where it was seen that several classes in plaf package rely on default constructors as part of their public API.

It's to be noted that "A no-arg public constructor is generated by the compiler for a class if it does not declare an
explicit constructor. While convenient, this is inappropriate for many kinds of formal classes, both because the
constructor will have no javadoc and because the constructor may be unintended."

For the JDK, classes intended to be used outside of the JDK, public classes in exported packages, should not rely on
default constructors.

Proposed fix is to add explicit public no-arg constructors for public classes and protected no-arg constructor for
protected classes for javax.swing module


Progress

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

Issue

  • JDK-8252722: More Swing plaf APIs that rely on default constructors

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/251/head:pull/251
$ git checkout pull/251

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Sep 18, 2020

👋 Welcome back psadhukhan! 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 the rfr label Sep 18, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Sep 18, 2020

@prsadhuk The following label will be automatically applied to this pull request: swing.

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 (add|remove) "label" command.

@openjdk openjdk bot added the swing label Sep 18, 2020
@mlbridge
Copy link

@mlbridge mlbridge bot commented Sep 18, 2020

Webrevs

@prsadhuk
Copy link
Contributor Author

@prsadhuk prsadhuk commented Sep 18, 2020

@openjdk
Copy link

@openjdk openjdk bot commented Sep 18, 2020

@prsadhuk usage: /csr [needed|unneeded], requires that the issue the pull request refers to links to an approved CSR request.

@prsadhuk
Copy link
Contributor Author

@prsadhuk prsadhuk commented Sep 18, 2020

/csr

@prsadhuk
Copy link
Contributor Author

@prsadhuk prsadhuk commented Sep 18, 2020

@openjdk openjdk bot added the csr label Sep 18, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Sep 18, 2020

@prsadhuk this pull request will not be integrated until the CSR request JDK-8253358 for issue JDK-8252722 has been approved.

@prsadhuk
Copy link
Contributor Author

@prsadhuk prsadhuk commented Sep 24, 2020

Any reviewers?

prrace
prrace approved these changes Sep 24, 2020
@@ -733,6 +733,11 @@ public void actionPerformed(ActionEvent e){
* @see BasicComboPopup#createMouseListener
*/
protected class InvocationMouseHandler extends MouseAdapter {
/**
* Constructor for subclasses to call.
Copy link
Contributor

@prrace prrace Sep 24, 2020

Choose a reason for hiding this comment

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

IMO this wording is not right here. This class is concrete isn't it ? So any code in this package can create one - not just a subclass.

Copy link
Contributor Author

@prsadhuk prsadhuk Sep 24, 2020

Choose a reason for hiding this comment

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

it's outdated file you are reviewing..It's already changed yesterday.

Copy link
Contributor

@prrace prrace Sep 24, 2020

Choose a reason for hiding this comment

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

That is weird. I wrote that comment 2 days ago!

Copy link
Contributor

@prrace prrace Sep 24, 2020

Choose a reason for hiding this comment

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

I also wrote the comments about a->an at least a day ago .. and github also claims they were made just 34 minutes ago. Very strange.

@@ -646,6 +646,10 @@ public void setEastPane(JComponent c) {
// its functionality has been moved into Handler. If you need to add
// new functionality add it to the Handler, but make sure this
// class calls into the Handler.
/**
* Constructs a {@code InternalFramePropertyChangeListener}.
*/
Copy link
Contributor

@prrace prrace Sep 24, 2020

Choose a reason for hiding this comment

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

a -> an

/**
* Constructs a {@code InternalFrameLayout}.
*/
public InternalFrameLayout() {}
Copy link
Contributor

@prrace prrace Sep 24, 2020

Choose a reason for hiding this comment

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

a -> an

@openjdk openjdk bot removed the csr label Sep 24, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Sep 24, 2020

@prsadhuk 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 more details.

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

8252722: More Swing plaf APIs that rely on default constructors

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

  • 3495c19: 8250855: Address reliance on default constructors in the Java 2D APIs
  • a9d0440: 8250859: Address reliance on default constructors in the Accessibility APIs
  • 89c5e49: 8253500: [REDO] JDK-8253208 Move CDS related code to a separate class
  • bf442c5: 8253539: Remove unused JavaThread functions for set_last_Java_fp/pc
  • dd2c456: 8253583: java/util/StringJoiner tests failing on 32-bit VMs after JDK-8246697
  • b1e2f02: 8253524: C2: Refactor code that clones predicates during loop unswitching
  • c303fd5: 8253581: runtime/stringtable/StringTableCleaningTest.java fails on 32-bit platforms
  • f3ea0d3: 8252583: Clean up unused phi-to-copy degradation mechanism
  • 4440bda: 8219586: CodeHeap State Analytics processes dead nmethods
  • 154b8cf: 8253014: OopStorage bulk release logs entries multiple times
  • ... and 69 more: https://git.openjdk.java.net/jdk/compare/3ef2efb1f49ce1a27033a64a0b34870fd50880a5...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 label Sep 24, 2020
@prsadhuk
Copy link
Contributor Author

@prsadhuk prsadhuk commented Sep 24, 2020

/integrate

@openjdk openjdk bot closed this Sep 24, 2020
@openjdk openjdk bot added integrated and removed ready rfr labels Sep 24, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Sep 24, 2020

@prsadhuk Since your change was applied there have been 79 commits pushed to the master branch:

  • 3495c19: 8250855: Address reliance on default constructors in the Java 2D APIs
  • a9d0440: 8250859: Address reliance on default constructors in the Accessibility APIs
  • 89c5e49: 8253500: [REDO] JDK-8253208 Move CDS related code to a separate class
  • bf442c5: 8253539: Remove unused JavaThread functions for set_last_Java_fp/pc
  • dd2c456: 8253583: java/util/StringJoiner tests failing on 32-bit VMs after JDK-8246697
  • b1e2f02: 8253524: C2: Refactor code that clones predicates during loop unswitching
  • c303fd5: 8253581: runtime/stringtable/StringTableCleaningTest.java fails on 32-bit platforms
  • f3ea0d3: 8252583: Clean up unused phi-to-copy degradation mechanism
  • 4440bda: 8219586: CodeHeap State Analytics processes dead nmethods
  • 154b8cf: 8253014: OopStorage bulk release logs entries multiple times
  • ... and 69 more: https://git.openjdk.java.net/jdk/compare/3ef2efb1f49ce1a27033a64a0b34870fd50880a5...master

Your commit was automatically rebased without conflicts.

Pushed as commit 527a309.

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

@prsadhuk prsadhuk deleted the JDK-8252722 branch Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants