-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
8320343 : Generate GIF images for AbstractButton/5049549/bug5049549.java #17029
Conversation
👋 Welcome back rkannathpari! A progress list of the required criteria for merging this PR into |
@Renjithkannath The following label will be automatically applied to this pull request:
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. |
Webrevs
|
Icon RS = generateImage("DI"); | ||
Icon SE = generateImage("DS"); | ||
Icon PR = generateImage("RO"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Icon RS = generateImage("DI"); | |
Icon SE = generateImage("DS"); | |
Icon PR = generateImage("RO"); | |
Icon RS = generateImage("RS"); | |
Icon SE = generateImage("SE"); | |
Icon PR = generateImage("PR"); |
Fix copy-and-paste mistakes. Otherwise, the test fails because a wrong icon is displayed.
g.setColor(Color.WHITE); | ||
g.fillRect(0, 0, img.getWidth(), img.getHeight()); | ||
g.setColor(Color.RED); | ||
Font font = new Font("SANS_SERIF", Font.BOLD, 22); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Font font = new Font("SANS_SERIF", Font.BOLD, 22); | |
Font font = new Font(Font.SANS_SERIF, Font.BOLD, 22); |
"SANS_SERIF"
is wrong, you should use the constant SANS_SERIF
in the Font
class, and its value is "SansSerif"
,
g.setColor(Color.RED); | ||
Font font = new Font("SANS_SERIF", Font.BOLD, 22); | ||
g.setFont(font); | ||
g.drawString(str,5,25); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
g.drawString(str,5,25); | |
g.drawString(str, 5, 25); |
Spaces after commas.
KButton button; | ||
|
||
Icon DE = generateImage("DE"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you prefer local variables, I'd move the declaration of KButton
below the icons.
private static Icon generateImage(String str) { | ||
|
||
BufferedImage img = new BufferedImage(40, 30, | ||
BufferedImage.TYPE_INT_RGB); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private static Icon generateImage(String str) { | |
BufferedImage img = new BufferedImage(40, 30, | |
BufferedImage.TYPE_INT_RGB); | |
private static Icon generateImage(String str) { | |
BufferedImage img = new BufferedImage(40, 30, | |
BufferedImage.TYPE_INT_RGB); |
A blank line between a method declaration and its first statement doesn't make much sense, I'm for removing this blank line.
import java.awt.Color; | ||
import java.awt.Font; | ||
import java.awt.Graphics; | ||
import java.awt.image.BufferedImage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put java.awt
imports above javax.*
with an optional blank line between them.
|
||
public class bug5049549 { | ||
|
||
private static ImageIcon DE = new ImageIcon(bug5049549.class.getResource("DE1.gif")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private static ImageIcon DE = generateImage("DE");
Preserve the original code style? I have no strong preference between the two in this case.
private static Icon DE = generateImage("DE"); | ||
private static Icon DI = generateImage("DI"); | ||
private static Icon DS = generateImage("DS"); | ||
private static Icon RO = generateImage("RO"); | ||
private static Icon RS = generateImage("RS"); | ||
private static Icon SE = generateImage("SE"); | ||
private static Icon PR = generateImage("PR"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest marking all of them final
:
private static Icon DE = generateImage("DE"); | |
private static Icon DI = generateImage("DI"); | |
private static Icon DS = generateImage("DS"); | |
private static Icon RO = generateImage("RO"); | |
private static Icon RS = generateImage("RS"); | |
private static Icon SE = generateImage("SE"); | |
private static Icon PR = generateImage("PR"); | |
private static final Icon DE = generateImage("DE"); | |
private static final Icon DI = generateImage("DI"); | |
private static final Icon DS = generateImage("DS"); | |
private static final Icon RO = generateImage("RO"); | |
private static final Icon RS = generateImage("RS"); | |
private static final Icon SE = generateImage("SE"); | |
private static final Icon PR = generateImage("PR"); |
private static Icon RO = generateImage("RO"); | ||
private static Icon RS = generateImage("RS"); | ||
private static Icon SE = generateImage("SE"); | ||
private static Icon PR = generateImage("PR"); | ||
|
||
private static Blocker blocker = new Blocker(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add final
modifier to blocker
too.
/* @test | ||
@bug 5049549 7132413 | ||
@summary Tests that the proper icon is used for different states. | ||
@library ../../regtesthelpers | ||
@build Blocker | ||
@run main/manual bug5049549 | ||
*/ | ||
|
||
public class bug5049549 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you're moving it, I suggest formatting it according to conventions used in most tests:
/* @test | |
@bug 5049549 7132413 | |
@summary Tests that the proper icon is used for different states. | |
@library ../../regtesthelpers | |
@build Blocker | |
@run main/manual bug5049549 | |
*/ | |
public class bug5049549 { | |
/* | |
* @test | |
* @bug 5049549 7132413 | |
* @summary Tests that the proper icon is used for different states. | |
* @library ../../regtesthelpers | |
* @build Blocker | |
* @run main/manual bug5049549 | |
*/ | |
public class bug5049549 { |
That is with starting asterisk on each line, and align the last asterisk.
@Renjithkannath 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:
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 220 new commits pushed to the
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 (@aivanov-jdk) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
/integrate |
@Renjithkannath |
/integrate |
@Renjithkannath |
/sponsor |
Going to push as commit 9481d06.
Your commit was automatically rebased without conflicts. |
@aivanov-jdk @Renjithkannath Pushed as commit 9481d06. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Hi Reviewers,
Updated the test and it will generate required images on the fly so storing and loading image from repo could be avoided. Please review and let me know your suggestions.
Regards,
Renjith.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/17029/head:pull/17029
$ git checkout pull/17029
Update a local copy of the PR:
$ git checkout pull/17029
$ git pull https://git.openjdk.org/jdk.git pull/17029/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 17029
View PR using the GUI difftool:
$ git pr show -t 17029
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/17029.diff
Webrev
Link to Webrev Comment