Request for Review: Warnings cleanup in java.lang., java.util.* (original) (raw)

David Schlosnagle schlosna at gmail.com
Fri Dec 2 03:06:00 PST 2011


I didn't have a chance to sign-up or submit during the official warnings cleanup day, but I'm hoping that you'll still accept patches. I do not have a bug number for this change.

The webrev [1] below should resolve 208 warnings in the java.lang.* and java.util.** packages. I tried to stick to fixing warnings, but OCD kicked in while editing in NetBeans, so there are a few additional IDE warnings fixed as well for the modified files. For example, adding @Override on the relevant methods, removals of dead stores, conversion to Strings in switch, StringBuffer -> StringBuilder where localized (I realize lock elision in HotSpot and JRockit should make them practically equivalent, but NetBeans still complains and I assume there is still some unnecessary synchronization overhead). ConditionalSpecialCasing.java also has some slight refactoring to utilize the updated parameterized types.

Additionally, there was one change to java.util.regex.Pattern#subFlag() that I'd like someone to review more carefully as it was previously falling through the last case, but I believe the last case should have had a break; to properly handle other flags.

*** 3006,3015 **** --- 3014,3024 ---- case 'x': flags &= ~COMMENTS; break; case 'U': flags &= ~(UNICODE_CHARACTER_CLASS | UNICODE_CASE);

If you want any of the additional cleanup removed from the patch or other changes, please let me know.

[1]: http://dl.dropbox.com/u/23832908/openjdk/2011-12-01/index.html

Files modified:     java/lang/Boolean.java     java/lang/Byte.java     java/lang/Character.java     java/lang/Class.java     java/lang/ConditionalSpecialCasing.java     java/lang/Double.java     java/lang/Float.java     java/lang/Integer.java     java/lang/Long.java     java/lang/Short.java     java/lang/System.java     java/lang/ThreadLocal.java     java/lang/Void.java     java/util/IllegalFormatConversionException.java     java/util/Locale.java     java/util/regex/Matcher.java     java/util/regex/Pattern.java     java/util/regex/PatternSyntaxException.java     java/util/regex/UnicodeProp.java

Thanks, Dave



More information about the jdk8-dev mailing list