Re: RFR: 8267521: Post JEP 411 refactoring: maximum covering > 50K [v3]
On Fri, 21 May 2021 20:37:30 GMT, Weijun Wang wrote: >> The code change refactors classes that have a `SuppressWarnings("removal")` >> annotation that covers more than 50KB of code. The big annotation is often >> quite faraway from the actual deprecated API usage it is suppressing, and >> with the annotation covering too big a portion it's easy to call other >> deprecated methods without being noticed. >> >> The code change shows some common solutions to avoid such too wide >> annotations: >> >> 1. Extract calls into a method and add annotation on that method >> 2. Assign the return value of a deprecated method call to a new local >> variable and add annotation on the declaration, and then assign that value >> to the original l-value if not void. The local variable will be called `tmp` >> if later reassigned or `dummy` if it will be discarded. >> 3. Put declaration and assignment into a single statement if possible. >> 4. Rewrite code to achieve #3 above. >> >> I'll add a copyright year update commit before integration. > > Weijun Wang has updated the pull request incrementally with one additional > commit since the last revision: > > update FtpClient.java Marked as reviewed by prr (Reviewer). - PR: https://git.openjdk.java.net/jdk/pull/4138
Re: RFR: 8267587: Update java.util to use enhanced switch [v6]
On Thu, 27 May 2021 13:47:16 GMT, Daniel Fuchs wrote: >> Tagir F. Valeev has refreshed the contents of this pull request, and >> previous commits have been removed. The incremental views will show >> differences compared to the previous content of the PR. > > src/java.base/share/classes/java/util/concurrent/FutureTask.java line 495: > >> 493: * @return a string representation of this FutureTask >> 494: */ >> 495: public String toString() { > > Classes in java.util.concurrent are handled upstream. It would probably be > better to leave them out of this patch. Or synchronize with @DougLea to see > how to bring these changes in the upstream repo. I rolled back changes in java.util.concurrent. Also, rebased the branch due to conflicts in JapaneseImperialCalendar.java - PR: https://git.openjdk.java.net/jdk/pull/4161
Re: RFR: 8267587: Update java.util to use enhanced switch [v7]
> Inspired by PR#4088. Most of the changes are done automatically using > IntelliJ IDEA refactoring. Some manual adjustments are also performed, > including indentations, moving comments, extracting common cast out of switch > expression branches, etc. > > I also noticed that there are some switches having one branch only in > JapaneseImperialCalendar.java. Probably it would be better to replace them > with `if` statement? Tagir F. Valeev has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains ten commits: - Rollback changes in j.u.concurrent (including formatting) - Rollback changes in j.u.concurrent - JapaneseImperialCalendar: use switch expressions - Use yield in java.util.Calendar.Builder.build - More vertical alignment - Vertical alignment for single-line switch rules - Indent some lines to make GitHub diff happier - Unindent switch cases to simplify the review - 8267587: Update java.util to use enhanced switch - Changes: https://git.openjdk.java.net/jdk/pull/4161/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4161&range=06 Stats: 884 lines in 15 files changed: 108 ins; 328 del; 448 mod Patch: https://git.openjdk.java.net/jdk/pull/4161.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4161/head:pull/4161 PR: https://git.openjdk.java.net/jdk/pull/4161