Skip to content

6206189: Graphics2D.clip specifies incorrectly that a 'null' is a valid value for this method #2476

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

Closed
wants to merge 12 commits into from

Conversation

prsadhuk
Copy link
Contributor

@prsadhuk prsadhuk commented Feb 9, 2021

The API doc for Graphics2D.clip(shape s) claims that passing a null argument would actually clear the existing clipping area, which is incorrect.
This statement is applicable only to G2D.setClip() and not for the clip() method. G2D.clip() would throw a NullPointerException when it encounters a null argument.
Updated spec to rectify this.


Progress

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

Issue

  • JDK-6206189: Graphics2D.clip specifies incorrectly that a 'null' is a valid value for this method

Reviewers

Download

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

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 9, 2021

👋 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 Pull request is ready for review label Feb 9, 2021
@openjdk
Copy link

openjdk bot commented Feb 9, 2021

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

  • 2d
  • awt

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 2d client-libs-dev@openjdk.org awt client-libs-dev@openjdk.org labels Feb 9, 2021
@prsadhuk
Copy link
Contributor Author

prsadhuk commented Feb 9, 2021

/label remove awt

@openjdk openjdk bot removed the awt client-libs-dev@openjdk.org label Feb 9, 2021
@openjdk
Copy link

openjdk bot commented Feb 9, 2021

@prsadhuk
The awt label was successfully removed.

@mlbridge
Copy link

mlbridge bot commented Feb 9, 2021

@prsadhuk
Copy link
Contributor Author

prsadhuk commented Feb 9, 2021

/csr

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Feb 9, 2021
@openjdk
Copy link

openjdk bot commented Feb 9, 2021

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

@openjdk openjdk bot removed the rfr Pull request is ready for review label Feb 10, 2021
@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 10, 2021
Graphics2D g2d = (Graphics2D)bi.getGraphics();

g2d.setClip(0, 0, 100, 100);
Shape clip = g2d.getClip();
Copy link
Member

Choose a reason for hiding this comment

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

Looks like the clip variable is not used.
Also I've just noticed that the years are not updated in copyright headers of Graphics and Graphics2d.

@prsadhuk
Copy link
Contributor Author

@prrace Can you please have a look at the CSR JDK-8261426?

@prsadhuk
Copy link
Contributor Author

@mrserb @prrace @jayathirthrao @aivanov-jdk @azvegint Any more comments on this? If not, can this please be approved?

@prsadhuk
Copy link
Contributor Author

Thanks @aivanov-jdk . Would you mind adding yourself as a reviewer to the CSR?

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

openjdk bot commented Feb 19, 2021

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

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

6206189: Graphics2D.clip specifies incorrectly that a 'null' is a valid value for this method

Reviewed-by: aivanov, kizune, azvegint

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

  • 977a21a: 8261225: TieredStopAtLevel should have no effect if TieredCompilation is disabled
  • c53acc2: 8261542: X86 slice and unslice intrinsics for 256-bit byte/short vectors
  • 8b4fd77: 8262042: ProblemList javax/xml/jaxp/unittest/common/prettyprint/PrettyPrintTest.java on Windows
  • 7ffa148: 8247918: Clarify Reader.skip behavior for end of stream
  • 8a1c712: 8261728: SimpleDateFormat should link to DateTimeFormatter
  • 851b2e3: 6245663: (spec) File.renameTo(File) changes the file-system object, not the File instance
  • c4f17a3: 8257925: enable more support for nested inline tags
  • 433096a: 8261744: Implement CharsetDecoder ASCII and latin-1 fast-paths
  • efbaede: 8262018: Wrong format in SAP copyright header of OsVersionTest
  • 55463b0: 8261984: Shenandoah: Remove unused ShenandoahPushWorkerQueuesScope class
  • ... and 140 more: https://git.openjdk.java.net/jdk/compare/5183d8ae1eec86202eace2c4770f81edbc73cb68...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 Feb 19, 2021
@prsadhuk
Copy link
Contributor Author

/integrate

@openjdk openjdk bot closed this Feb 22, 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 Feb 22, 2021
@prsadhuk prsadhuk deleted the 6206189 branch February 22, 2021 04:46
@openjdk
Copy link

openjdk bot commented Feb 22, 2021

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

  • 2b55501: 8261949: fileStream::readln returns incorrect line string
  • 539c80b: 8261702: ClhsdbFindPC can fail due to PointerFinder incorrectly thinking an address is in a .so
  • 564011c: 8261290: Improve error message for NumberFormatException on null input
  • 18188c2: 8261692: Bugs in clhsdb history support
  • 0825bc5: 8261929: ClhsdbFindPC fails with java.lang.RuntimeException: 'In java stack' missing from stdout/stderr
  • c2509ea: 8261857: serviceability/sa/ClhsdbPrintAll.java failed with "Test ERROR java.lang.RuntimeException: 'cannot be cast to' found in stdout"
  • 2b00367: 8261350: Create implementation for NSAccessibilityCheckBox protocol peer
  • 5a25cea: 8261998: Remove unused shared entry support from utilities/hashtable
  • 4755958: 8262041: javax/xml/jaxp/unittest/common/prettyprint/PrettyPrintTest.java fails after JDK-8260858
  • b10376b: 8261938: ASN1Formatter.annotate should not return in the finally block
  • ... and 150 more: https://git.openjdk.java.net/jdk/compare/5183d8ae1eec86202eace2c4770f81edbc73cb68...master

Your commit was automatically rebased without conflicts.

Pushed as commit 0c21dd0.

💡 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
2d client-libs-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

7 participants