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

8216507: StyleablePropertyFactory: example in class javadoc does not compile #983

Closed

Conversation

karthikpandelu
Copy link
Member

@karthikpandelu karthikpandelu commented Dec 23, 2022

In the javadoc example of StyleablePropertyFactory class, wrong parameter was used while initializing StyleableProperty.

Assigned the CssMetadData object to SELECTED variable returned by createBooleanCssMetaData method called in anonymous inner-class class, which is then used while initializing StyleableProperty.

Added missing semicolon in the same example.


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

  • JDK-8216507: StyleablePropertyFactory: example in class javadoc does not compile

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 983

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/983.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 23, 2022

👋 Welcome back kpk! 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 Ready for review label Dec 23, 2022
@mlbridge
Copy link

mlbridge bot commented Dec 23, 2022

Webrevs

@karthikpandelu karthikpandelu changed the title 8216507: StyleablePropertyFactory: example in class javadoc does not compile Draft - 8216507: StyleablePropertyFactory: example in class javadoc does not compile Dec 23, 2022
@karthikpandelu karthikpandelu marked this pull request as draft December 23, 2022 16:48
@openjdk openjdk bot removed the rfr Ready for review label Dec 23, 2022
@@ -121,12 +121,14 @@ public final class MyButton extends Button {
* <pre><code>
public final class MyButton extends Button {

private static CssMetaData<JavadocFixStylableProperty, Boolean> SELECTED;
Copy link
Contributor

Choose a reason for hiding this comment

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

should it be

private static CssMetaData<MyButton, Boolean> SELECTED;

in order to compile?

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated this change

@@ -141,7 +143,7 @@ public final class MyButton extends Button {

// StyleableProperty implementation reduced to one line
private final {@literal StyleableProperty<Boolean>} selected =
new SimpleStyleableBooleanProperty(this, "selected", "my-selected");
new SimpleStyleableBooleanProperty(SELECTED, "selected", "my-selected");
Copy link
Contributor

Choose a reason for hiding this comment

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

as an exercise, could you actually put MyButton into a scene graph and style it with CSS?

Copy link
Member Author

Choose a reason for hiding this comment

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

I will check this and update here

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think it's worth doing this as a unit test?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it is good to add unit test to test the example code. Only thing I'm looking at is that if the example changes in future, we need to make sure that corresponding MyButton class is updated in unit test.
Since the example code might not change frequently, we can add unit test.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, let's add a unit test, unless StyleablePropertyFactoryTest covers the same scenario.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added unit test for the 3rd example in StyleablePropertyFactoryTest.
Unit test for 1st example is already covered as part of myBoolean property.
Since example 2 and 3 are similar except for the place where createBooleanCssMetaData method is called, added single test for this.
Please review the newly added unit test

@andy-goryachev-oracle
Copy link
Contributor

sorry, did not see this PR is still in a Draft stage... why did I get a notification then?

also, jcheck is failing.

@karthikpandelu karthikpandelu changed the title Draft - 8216507: StyleablePropertyFactory: example in class javadoc does not compile 8216507: StyleablePropertyFactory: example in class javadoc does not compile Dec 23, 2022
@karthikpandelu karthikpandelu marked this pull request as ready for review December 23, 2022 16:55
@openjdk openjdk bot added the rfr Ready for review label Dec 23, 2022
@karthikpandelu
Copy link
Member Author

It was in rfr stage. i just saw the build failure and converted it to draft before addressing the build error.
Fixed the build issue now and moved to rfr again. Sorry for the confusion.

Copy link
Collaborator

@aghaisas aghaisas left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@openjdk
Copy link

openjdk bot commented Jan 4, 2023

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

8216507: StyleablePropertyFactory: example in class javadoc does not compile

Reviewed-by: angorya, aghaisas

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

  • 012fa16: 8209017: CheckBoxTreeCell: graphic on TreeItem not always showing
  • a35c3bf: 8292922: [Linux] No more drag events when new Stage is created in drag handler
  • 48f6f5b: 8299272: Update copyright header for files modified in 2022
  • 5b96d34: 8296654: [macos] Crash when launching JavaFX app with JDK that targets SDK 13

Please see this link for an up-to-date comparison between the source branch of this pull request and 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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@andy-goryachev-oracle, @aghaisas) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Ready to be integrated label Jan 4, 2023
Copy link
Contributor

@andy-goryachev-oracle andy-goryachev-oracle left a comment

Choose a reason for hiding this comment

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

good work!

@karthikpandelu
Copy link
Member Author

/integrate

@openjdk openjdk bot added the sponsor Ready to sponsor label Jan 4, 2023
@openjdk
Copy link

openjdk bot commented Jan 4, 2023

@karthikpandelu
Your change (at version 8e1bbb4) is now ready to be sponsored by a Committer.

@andy-goryachev-oracle
Copy link
Contributor

/sponsor

@openjdk
Copy link

openjdk bot commented Jan 4, 2023

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

  • 012fa16: 8209017: CheckBoxTreeCell: graphic on TreeItem not always showing
  • a35c3bf: 8292922: [Linux] No more drag events when new Stage is created in drag handler
  • 48f6f5b: 8299272: Update copyright header for files modified in 2022
  • 5b96d34: 8296654: [macos] Crash when launching JavaFX app with JDK that targets SDK 13

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jan 4, 2023
@openjdk openjdk bot closed this Jan 4, 2023
@openjdk openjdk bot removed ready Ready to be integrated rfr Ready for review sponsor Ready to sponsor labels Jan 4, 2023
@openjdk
Copy link

openjdk bot commented Jan 4, 2023

@andy-goryachev-oracle @karthikpandelu Pushed as commit 94fb7ed.

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

@karthikpandelu karthikpandelu deleted the javadoc_issue_fix branch January 4, 2023 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
3 participants