--- old/make/Setup.gmk 2014-04-08 15:39:40.000000000 -0700 +++ new/make/Setup.gmk 2014-04-08 15:39:39.000000000 -0700 @@ -27,7 +27,7 @@ # To build with all warnings enabled, do the following: # make JAVAC_WARNINGS="-Xlint:all -Xmaxwarns 10000" -JAVAC_WARNINGS := -Xlint:-unchecked,-deprecation,-overrides,auxiliaryclass,cast,classfile,dep-ann,divzero,empty,overloads,serial,static,try,varargs -Werror +JAVAC_WARNINGS := -Xlint:-unchecked,-deprecation,-overrides,auxiliaryclass,cast,classfile,dep-ann,divzero,empty,fallthrough,overloads,serial,static,try,varargs -Werror -Xmaxwarns 10000 -Xmaxerrs 10000 # Any java code executed during a JDK build to build other parts of the JDK must be # executed by the bootstrap JDK (probably with -Xbootclasspath/p: ) and for this --- old/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java 2014-04-08 15:39:40.000000000 -0700 +++ new/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java 2014-04-08 15:39:40.000000000 -0700 @@ -1683,6 +1683,7 @@ * adjustments that windows/metal do. This is because gtk doesn't * provide margins/insets for checkbox/radiobuttons. */ + @SuppressWarnings("fallthrough") private static class GnomeLayoutStyle extends DefaultLayoutStyle { private static GnomeLayoutStyle INSTANCE = new GnomeLayoutStyle(); --- old/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java 2014-04-08 15:39:41.000000000 -0700 +++ new/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java 2014-04-08 15:39:40.000000000 -0700 @@ -2409,6 +2409,7 @@ // Windows LayoutStyle. From: // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/ch14e.asp + @SuppressWarnings("fallthrough") private class WindowsLayoutStyle extends DefaultLayoutStyle { @Override public int getPreferredGap(JComponent component1, --- old/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTableHeaderUI.java 2014-04-08 15:39:41.000000000 -0700 +++ new/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTableHeaderUI.java 2014-04-08 15:39:41.000000000 -0700 @@ -182,7 +182,6 @@ if (sortOrder != null) { switch(sortOrder) { case ASCENDING: - /* falls through */ case DESCENDING: switch (state) { case NORMAL: @@ -197,6 +196,7 @@ default: /* do nothing */ } + break; default : /* do nothing */ } --- old/src/share/classes/com/sun/media/sound/SoftEnvelopeGenerator.java 2014-04-08 15:39:42.000000000 -0700 +++ new/src/share/classes/com/sun/media/sound/SoftEnvelopeGenerator.java 2014-04-08 15:39:41.000000000 -0700 @@ -118,6 +118,7 @@ return null; } + @SuppressWarnings("fallthrough") public void processControlLogic() { for (int i = 0; i < used_count; i++) { @@ -170,6 +171,7 @@ this.delay[i][0] / 1200.0) / control_time); if (stage_ix[i] < 0) stage_ix[i] = 0; + // Fallthrough okay? case EG_DELAY: if (stage_ix[i] == 0) { double attack = this.attack[i][0]; --- old/src/share/classes/java/awt/dnd/DragSourceContext.java 2014-04-08 15:39:42.000000000 -0700 +++ new/src/share/classes/java/awt/dnd/DragSourceContext.java 2014-04-08 15:39:42.000000000 -0700 @@ -472,7 +472,7 @@ * ENTER, OVER, * CHANGED */ - + @SuppressWarnings("fallthrough") protected synchronized void updateCurrentCursor(int sourceAct, int targetAct, int status) { // if the cursor has been previously set then don't do any defaults --- old/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java 2014-04-08 15:39:42.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java 2014-04-08 15:39:42.000000000 -0700 @@ -2338,6 +2338,7 @@ // From the JLF Design Guidelines: // http://www.oracle.com/technetwork/java/jlf-135985.html + @SuppressWarnings("fallthrough") private static class MetalLayoutStyle extends DefaultLayoutStyle { private static MetalLayoutStyle INSTANCE = new MetalLayoutStyle(); @@ -2474,4 +2475,4 @@ return 0; } } -} \ No newline at end of file +} --- old/src/share/classes/javax/swing/text/JTextComponent.java 2014-04-08 15:39:43.000000000 -0700 +++ new/src/share/classes/javax/swing/text/JTextComponent.java 2014-04-08 15:39:43.000000000 -0700 @@ -4490,6 +4490,7 @@ // composed(uncommitted) text is done here after all input // method listeners get called for stealing the events. // + @SuppressWarnings("fallthrough") protected void processInputMethodEvent(InputMethodEvent e) { // let listeners handle the events super.processInputMethodEvent(e); --- old/src/share/classes/javax/swing/text/html/StyleSheet.java 2014-04-08 15:39:43.000000000 -0700 +++ new/src/share/classes/javax/swing/text/html/StyleSheet.java 2014-04-08 15:39:43.000000000 -0700 @@ -2324,6 +2324,7 @@ * @param itemNum number to format * @param type type of ordered list */ + @SuppressWarnings("fallthrough") String formatItemNum(int itemNum, char type) { String numStyle = "1"; --- old/src/share/classes/javax/swing/text/html/parser/ContentModelState.java 2014-04-08 15:39:44.000000000 -0700 +++ new/src/share/classes/javax/swing/text/html/parser/ContentModelState.java 2014-04-08 15:39:44.000000000 -0700 @@ -92,12 +92,14 @@ * tokens required in the input stream. * @return true if the model can terminate without further input */ + @SuppressWarnings("fallthrough") public boolean terminate() { switch (model.type) { case '+': if ((value == 0) && !(model).empty()) { return false; } + // Fall through okay? case '*': case '?': return (next == null) || next.terminate(); --- old/src/share/classes/javax/swing/text/html/parser/Parser.java 2014-04-08 15:39:45.000000000 -0700 +++ new/src/share/classes/javax/swing/text/html/parser/Parser.java 2014-04-08 15:39:45.000000000 -0700 @@ -852,6 +852,7 @@ if (lower) { ch = 'a' + (ch - 'A'); } + break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': @@ -876,6 +877,7 @@ if (lower) { ch = 'a' + (ch - 'A'); } + break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': @@ -1214,6 +1216,7 @@ /** * Parse attribute value. [33] 331:1 */ + @SuppressWarnings("fallthrough") String parseAttributeValue(boolean lower) throws IOException { int delim = -1; @@ -1258,6 +1261,7 @@ case '\t': if (delim < 0) c = ' '; + // Fall through ? case ' ': ch = readCh(); if (delim < 0) { @@ -1559,6 +1563,7 @@ /** * Parse a start or end tag. */ + @SuppressWarnings("fallthrough") void parseTag() throws IOException { Element elem; boolean net = false; @@ -1602,6 +1607,7 @@ continue; case '>': ch = readCh(); + // Fall through okay? case -1: return; default: @@ -1626,6 +1632,7 @@ switch(ch) { case '>': ch = readCh(); + // Fall through okay? case -1: error("invalid.markup"); return; @@ -1657,6 +1664,7 @@ switch (ch = readCh()) { case '>': ch = readCh(); + // Fall through okay? case '<': // empty end tag. either or ': ch = readCh(); + // Fall through okay? case '<': break; @@ -1875,6 +1884,7 @@ switch (ch) { case '/': net = true; + // Fall through okay? case '>': ch = readCh(); if (ch == '>' && net) { --- old/src/share/classes/javax/swing/text/rtf/RTFGenerator.java 2014-04-08 15:39:46.000000000 -0700 +++ new/src/share/classes/javax/swing/text/rtf/RTFGenerator.java 2014-04-08 15:39:46.000000000 -0700 @@ -868,6 +868,7 @@ afterKeyword = false; } +@SuppressWarnings("fallthrough") public void writeCharacter(char ch) throws IOException { --- old/src/share/classes/javax/swing/text/rtf/RTFParser.java 2014-04-08 15:39:46.000000000 -0700 +++ new/src/share/classes/javax/swing/text/rtf/RTFParser.java 2014-04-08 15:39:46.000000000 -0700 @@ -148,6 +148,7 @@ handleText(s); } + @SuppressWarnings("fallthrough") public void write(char ch) throws IOException { --- old/src/share/classes/sun/awt/image/GifImageDecoder.java 2014-04-08 15:39:47.000000000 -0700 +++ new/src/share/classes/sun/awt/image/GifImageDecoder.java 2014-04-08 15:39:46.000000000 -0700 @@ -114,6 +114,7 @@ /** * produce an image from the stream. */ + @SuppressWarnings("fallthrough") public void produceImage() throws IOException, ImageFormatException { try { readHeader(); @@ -238,7 +239,7 @@ if (frameno == 0) { return; } - // NOBREAK + // Fall through case TERMINATOR: if (nloops == 0 || nloops-- >= 0) { --- old/src/share/classes/sun/awt/image/PixelConverter.java 2014-04-08 15:39:47.000000000 -0700 +++ new/src/share/classes/sun/awt/image/PixelConverter.java 2014-04-08 15:39:47.000000000 -0700 @@ -53,6 +53,7 @@ protected PixelConverter() {} + @SuppressWarnings("fallthrough") public int rgbToPixel(int rgb, ColorModel cm) { Object obj = cm.getDataElements(rgb, null); switch (cm.getTransferType()) { --- old/src/share/classes/sun/font/SunFontManager.java 2014-04-08 15:39:47.000000000 -0700 +++ new/src/share/classes/sun/font/SunFontManager.java 2014-04-08 15:39:47.000000000 -0700 @@ -1160,6 +1160,7 @@ case FONTFORMAT_NATIVE: NativeFont nf = new NativeFont(fileName, false); physicalFont = addToFontList(nf, fontRank); + break; default: } --- old/src/share/classes/sun/font/TrueTypeGlyphMapper.java 2014-04-08 15:39:48.000000000 -0700 +++ new/src/share/classes/sun/font/TrueTypeGlyphMapper.java 2014-04-08 15:39:48.000000000 -0700 @@ -109,6 +109,7 @@ cmap = CMap.theNullCmap; } + @SuppressWarnings("fallthrough") private final char remapJAChar(char unicode) { switch (unicode) { case REVERSE_SOLIDUS: @@ -120,9 +121,11 @@ if (remapJAWaveDash) { return JA_FULLWIDTH_TILDE_CHAR; } + // Fall through okay? default: return unicode; } } + @SuppressWarnings("fallthrough") private final int remapJAIntChar(int unicode) { switch (unicode) { case REVERSE_SOLIDUS: @@ -134,6 +137,7 @@ if (remapJAWaveDash) { return JA_FULLWIDTH_TILDE_CHAR; } + // Fall through okay? default: return unicode; } } --- old/src/share/classes/sun/tools/java/Environment.java 2014-04-08 15:39:48.000000000 -0700 +++ new/src/share/classes/sun/tools/java/Environment.java 2014-04-08 15:39:48.000000000 -0700 @@ -648,6 +648,7 @@ * Return true if an implicit cast from this type to * the given type is allowed. */ + @SuppressWarnings("fallthrough") public boolean implicitCast(Type from, Type to) throws ClassNotFound { if (from == to) return true; --- old/src/share/classes/sun/tools/java/Scanner.java 2014-04-08 15:39:49.000000000 -0700 +++ new/src/share/classes/sun/tools/java/Scanner.java 2014-04-08 15:39:49.000000000 -0700 @@ -511,6 +511,7 @@ * Scan a number. The first digit of the number should be the current * character. We may be scanning hex, decimal, or octal at this point */ + @SuppressWarnings("fallthrough") private void scanNumber() throws IOException { boolean seenNonOctal = false; boolean overflow = false; @@ -532,6 +533,7 @@ // We can't yet throw an error if reading an octal. We might // discover we're really reading a real. seenNonOctal = true; + // Fall through case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': seenDigit = true; @@ -668,6 +670,7 @@ * Scan a float. Should be called with the current character is either * the 'e', 'E' or '.' */ + @SuppressWarnings("fallthrough") private void scanReal() throws IOException { boolean seenExponent = false; boolean isSingleFloat = false; @@ -984,6 +987,7 @@ return xscan(); } + @SuppressWarnings("fallthrough") protected long xscan() throws IOException { final ScannerInputReader in = this.in; long retPos = pos; @@ -1006,6 +1010,7 @@ token = COMMENT; return retPos; } + // Fall through case ' ': case '\t': case '\f': --- old/src/share/classes/sun/tools/javac/Main.java 2014-04-08 15:39:50.000000000 -0700 +++ new/src/share/classes/sun/tools/javac/Main.java 2014-04-08 15:39:50.000000000 -0700 @@ -192,6 +192,7 @@ /** * Run the compiler */ + @SuppressWarnings("fallthrough") public synchronized boolean compile(String argv[]) { String sourcePathArg = null; String classPathArg = null; --- old/src/share/classes/sun/tools/jinfo/JInfo.java 2014-04-08 15:39:51.000000000 -0700 +++ new/src/share/classes/sun/tools/jinfo/JInfo.java 2014-04-08 15:39:50.000000000 -0700 @@ -41,6 +41,7 @@ */ public class JInfo { + @SuppressWarnings("fallthrough") public static void main(String[] args) throws Exception { if (args.length == 0) { usage(1); // no arguments @@ -118,6 +119,7 @@ case "-help": case "-h": usage(0); + // Fall through default: if (args.length == 1) { // no flags specified, we do -sysprops and -flags --- old/src/share/classes/sun/tools/tree/AssignOpExpression.java 2014-04-08 15:39:51.000000000 -0700 +++ new/src/share/classes/sun/tools/tree/AssignOpExpression.java 2014-04-08 15:39:51.000000000 -0700 @@ -53,7 +53,7 @@ * Select the type * */ - + @SuppressWarnings("fallthrough") final void selectType(Environment env, Context ctx, int tm) { Type rtype = null; // special conversion type for RHS switch(op) { --- old/src/share/classes/sun/tools/tree/NewInstanceExpression.java 2014-04-08 15:39:52.000000000 -0700 +++ new/src/share/classes/sun/tools/tree/NewInstanceExpression.java 2014-04-08 15:39:51.000000000 -0700 @@ -487,6 +487,7 @@ public void codeValue(Environment env, Context ctx, Assembler asm) { codeCommon(env, ctx, asm, true); } + @SuppressWarnings("fallthrough") private void codeCommon(Environment env, Context ctx, Assembler asm, boolean forValue) { asm.add(where, opc_new, field.getClassDeclaration()); --- old/src/solaris/classes/sun/awt/X11/XComponentPeer.java 2014-04-08 15:39:52.000000000 -0700 +++ new/src/solaris/classes/sun/awt/X11/XComponentPeer.java 2014-04-08 15:39:52.000000000 -0700 @@ -548,6 +548,7 @@ } } + @SuppressWarnings("fallthrough") public void handleEvent(java.awt.AWTEvent e) { if ((e instanceof InputEvent) && !((InputEvent)e).isConsumed() && target.isEnabled()) { if (e instanceof MouseEvent) { --- old/src/solaris/classes/sun/awt/X11/XWM.java 2014-04-08 15:39:52.000000000 -0700 +++ new/src/solaris/classes/sun/awt/X11/XWM.java 2014-04-08 15:39:52.000000000 -0700 @@ -1112,6 +1112,7 @@ * Therefore, a compound state is just ICONIFIED | anything else. * */ + @SuppressWarnings("fallthrough") boolean supportsExtendedState(int state) { switch (state) { case Frame.MAXIMIZED_VERT: @@ -1131,6 +1132,7 @@ return true; } } + /* FALLTROUGH */ default: return false; } --- old/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java 2014-04-08 15:39:53.000000000 -0700 +++ new/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java 2014-04-08 15:39:53.000000000 -0700 @@ -515,6 +515,7 @@ return getSurfaceType(gc, transparency, false); } + @SuppressWarnings("fallthrough") public static SurfaceType getSurfaceType(X11GraphicsConfig gc, int transparency, boolean pixmapSurface)