--- old/make/CompileToolsJdk.gmk 2020-03-19 17:44:30.950570860 +0100 +++ new/make/CompileToolsJdk.gmk 2020-03-19 17:44:30.430570864 +0100 @@ -43,7 +43,7 @@ $(BUILDTOOLS_OUTPUTDIR)/interim_tzdb_classes \ # -$(eval $(call SetupJavaCompilation,BUILD_TOOLS_JDK, \ +$(eval $(call SetupJavaCompilation, BUILD_TOOLS_JDK, \ SETUP := GENERATE_OLDBYTECODE, \ SRC := $(BUILD_TOOLS_SRC_DIRS), \ EXCLUDES := \ @@ -53,7 +53,6 @@ build/tools/jigsaw \ build/tools/depend \ , \ - DISABLED_WARNINGS := unchecked rawtypes deprecation cast, \ BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes, \ ADD_JAVAC_FLAGS := \ --add-exports java.desktop/sun.awt=ALL-UNNAMED \ --- old/make/jdk/src/classes/build/tools/cldrconverter/Bundle.java 2020-03-19 17:44:32.334570850 +0100 +++ new/make/jdk/src/classes/build/tools/cldrconverter/Bundle.java 2020-03-19 17:44:31.810570854 +0100 @@ -183,6 +183,7 @@ * Generate a map that contains all the data that should be * visible for the bundle's locale */ + @SuppressWarnings("unchecked") Map getTargetMap() throws Exception { if (targetMap != null) { return targetMap; --- old/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java 2020-03-19 17:44:33.758570840 +0100 +++ new/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java 2020-03-19 17:44:33.246570843 +0100 @@ -418,6 +418,7 @@ // Parsers for data in "supplemental" directory // + @SuppressWarnings("unchecked") private static void parseSupplemental() throws Exception { // Parse SupplementalData file and store the information in the HashMap // Calendar information such as firstDay and minDay are stored in @@ -434,7 +435,7 @@ parentData.keySet().stream() .filter(key -> key.startsWith(PARENT_LOCALE_PREFIX)) .forEach(key -> { - parentLocalesMap.put(key, new TreeSet( + parentLocalesMap.put(key, new TreeSet( Arrays.asList(((String)parentData.get(key)).split(" ")))); }); @@ -481,6 +482,7 @@ }); } + @SuppressWarnings("rawtypes") private static void parseLDMLFile(File srcfile, AbstractLDMLHandler handler) throws Exception { info("..... Parsing " + srcfile.getName() + " ....."); SAXParserFactory pf = SAXParserFactory.newInstance(); @@ -574,7 +576,7 @@ * Translate the aliases into the real entries in the bundle map. */ static void handleAliases(Map bundleMap) { - Set bundleKeys = bundleMap.keySet(); + Set bundleKeys = bundleMap.keySet(); try { for (String key : aliases.keySet()) { String targetKey = aliases.get(key); @@ -1156,6 +1158,7 @@ StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); } + @SuppressWarnings("unchecked") private static Stream pluralRulesStream() { return handlerPlurals.getData().entrySet().stream() .filter(e -> !((Map)e.getValue()).isEmpty()) --- old/make/jdk/src/classes/build/tools/cldrconverter/PluralsParseHandler.java 2020-03-19 17:44:35.154570829 +0100 +++ new/make/jdk/src/classes/build/tools/cldrconverter/PluralsParseHandler.java 2020-03-19 17:44:34.622570833 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -76,6 +76,7 @@ } } + @SuppressWarnings({"unchecked", "rawtypes"}) @Override public void endElement(String uri, String localName, String qName) throws SAXException { assert qName.equals(currentContainer.getqName()) : "current=" + currentContainer.getqName() + ", param=" + qName; --- old/make/jdk/src/classes/build/tools/dtdbuilder/DTDBuilder.java 2020-03-19 17:44:36.642570818 +0100 +++ new/make/jdk/src/classes/build/tools/dtdbuilder/DTDBuilder.java 2020-03-19 17:44:36.086570822 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -139,7 +139,7 @@ } int i = namesVector.size(); namesVector.addElement(name); - namesHash.put(name, new Integer(i)); + namesHash.put(name, i); return (short) i; } --- old/make/jdk/src/classes/build/tools/dtdbuilder/DTDInputStream.java 2020-03-19 17:44:37.942570809 +0100 +++ new/make/jdk/src/classes/build/tools/dtdbuilder/DTDInputStream.java 2020-03-19 17:44:37.422570813 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -92,8 +92,8 @@ * Push an entire input stream */ void push(Reader in) throws IOException { - stack.push(new Integer(ln)); - stack.push(new Integer(ch)); + stack.push(Integer.valueOf(ln)); + stack.push(Integer.valueOf(ch)); stack.push(this.in); this.in = in; ch = in.read(); --- old/make/jdk/src/classes/build/tools/generatebreakiteratordata/GenerateBreakIteratorData.java 2020-03-19 17:44:39.378570798 +0100 +++ new/make/jdk/src/classes/build/tools/generatebreakiteratordata/GenerateBreakIteratorData.java 2020-03-19 17:44:38.846570802 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -87,12 +87,12 @@ ResourceBundle rules, info; info = (ResourceBundle) Class.forName( - localizedBundleName("sun.text.resources", "BreakIteratorInfo")).newInstance(); + localizedBundleName("sun.text.resources", "BreakIteratorInfo")).getDeclaredConstructor().newInstance(); classNames = info.getStringArray("BreakIteratorClasses"); rules = (ResourceBundle) Class.forName( - localizedBundleName("sun.text.resources", "BreakIteratorRules")).newInstance(); + localizedBundleName("sun.text.resources", "BreakIteratorRules")).getDeclaredConstructor().newInstance(); if (info.containsKey("CharacterData")) { generateDataFile(info.getString("CharacterData"), --- old/make/jdk/src/classes/build/tools/generatebreakiteratordata/RuleBasedBreakIteratorBuilder.java 2020-03-19 17:44:40.846570787 +0100 +++ new/make/jdk/src/classes/build/tools/generatebreakiteratordata/RuleBasedBreakIteratorBuilder.java 2020-03-19 17:44:40.330570791 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -290,7 +290,7 @@ } lastOpen = c; - parenStack.push(new Character((char)c)); + parenStack.push(Character.valueOf((char)c)); if (c == '<') { sawVarName = true; } @@ -902,11 +902,11 @@ // if we're adding rules to the backward state table, mark the initial state // as a looping state if (!forward) { - loopingStates.addElement(new Integer(1)); + loopingStates.addElement(Integer.valueOf(1)); } // put the current state on the decision point list before we start - decisionPointList.addElement(new Integer(currentState)); // we want currentState to + decisionPointList.addElement(Integer.valueOf(currentState)); // we want currentState to // be 1 here... currentState = tempStateTable.size() - 1; // but after that, we want it to be // 1 less than the state number of the next state @@ -978,7 +978,7 @@ // if the period is followed by an asterisk, then just set the current // state to loop back on itself if (p + 1 < rule.length() && rule.charAt(p + 1) == '*' && state[0] != 0) { - decisionPointList.addElement(new Integer(state[0])); + decisionPointList.addElement(Integer.valueOf(state[0])); pendingChars = ""; ++p; } @@ -1012,7 +1012,7 @@ // it to the end of the state table int newState = tempStateTable.size(); if (loopingStates.size() != 0) { - statesToBackfill.addElement(new Integer(newState)); + statesToBackfill.addElement(Integer.valueOf(newState)); } state = new short[numCategories + 1]; if (sawEarlyBreak) { @@ -1032,7 +1032,7 @@ lastState = currentState; do { ++currentState; - decisionPointList.addElement(new Integer(currentState)); + decisionPointList.addElement(Integer.valueOf(currentState)); } while (currentState + 1 < tempStateTable.size()); } } @@ -1058,7 +1058,7 @@ if (c == '*') { for (int i = lastState + 1; i < tempStateTable.size(); i++) { Vector temp = new Vector<>(); - temp.addElement(new Integer(i)); + temp.addElement(Integer.valueOf(i)); updateStateTable(temp, pendingChars, (short)(lastState + 1)); } } @@ -1121,7 +1121,7 @@ // add the current state to the decision point list (add it at the // BEGINNING so we can find it later) - decisionPointList.insertElementAt(new Integer(currentState), 0); + decisionPointList.insertElementAt(Integer.valueOf(currentState), 0); // finally, push a copy of the current decision point list onto the // stack (this keeps track of the active decision point list before @@ -1208,7 +1208,7 @@ for (int i = 0; i < tempState.length; i++) { if (tempState[i] > tempStateNum) { updateStateTable(exitPoints, - new Character((char)(i + 0x100)).toString(), + Character.valueOf((char)(i + 0x100)).toString(), tempState[i]); } } @@ -1330,7 +1330,7 @@ short[] newValues, Vector rowsBeingUpdated) { short[] oldValues = tempStateTable.elementAt(rowNum); - boolean isLoopingState = loopingStates.contains(new Integer(rowNum)); + boolean isLoopingState = loopingStates.contains(Integer.valueOf(rowNum)); // for each of the cells in the rows we're reconciling, do... for (int i = 0; i < oldValues.length; i++) { @@ -1343,7 +1343,7 @@ // if oldValues is a looping state and the state the current cell points to // is too, then we can just stomp over the current value of that cell (and // set the clear-looping-states flag if necessary) - else if (isLoopingState && loopingStates.contains(new Integer(oldValues[i]))) { + else if (isLoopingState && loopingStates.contains(Integer.valueOf(oldValues[i]))) { if (newValues[i] != 0) { if (oldValues[i] == 0) { clearLoopingStates = true; @@ -1401,29 +1401,29 @@ // if the decision point list contains either of the parent rows, // update it to include the new row as well - if ((decisionPointList.contains(new Integer(oldRowNum)) - || decisionPointList.contains(new Integer(newRowNum))) - && !decisionPointList.contains(new Integer(combinedRowNum)) + if ((decisionPointList.contains(Integer.valueOf(oldRowNum)) + || decisionPointList.contains(Integer.valueOf(newRowNum))) + && !decisionPointList.contains(Integer.valueOf(combinedRowNum)) ) { - decisionPointList.addElement(new Integer(combinedRowNum)); + decisionPointList.addElement(Integer.valueOf(combinedRowNum)); } // do the same thing with the list of rows being updated - if ((rowsBeingUpdated.contains(new Integer(oldRowNum)) - || rowsBeingUpdated.contains(new Integer(newRowNum))) - && !rowsBeingUpdated.contains(new Integer(combinedRowNum)) + if ((rowsBeingUpdated.contains(Integer.valueOf(oldRowNum)) + || rowsBeingUpdated.contains(Integer.valueOf(newRowNum))) + && !rowsBeingUpdated.contains(Integer.valueOf(combinedRowNum)) ) { - decisionPointList.addElement(new Integer(combinedRowNum)); + decisionPointList.addElement(Integer.valueOf(combinedRowNum)); } // now (groan) do the same thing for all the entries on the // decision point stack for (int k = 0; k < decisionPointStack.size(); k++) { Vector dpl = decisionPointStack.elementAt(k); - if ((dpl.contains(new Integer(oldRowNum)) - || dpl.contains(new Integer(newRowNum))) - && !dpl.contains(new Integer(combinedRowNum)) + if ((dpl.contains(Integer.valueOf(oldRowNum)) + || dpl.contains(Integer.valueOf(newRowNum))) + && !dpl.contains(Integer.valueOf(combinedRowNum)) ) { - dpl.addElement(new Integer(combinedRowNum)); + dpl.addElement(Integer.valueOf(combinedRowNum)); } } @@ -1536,10 +1536,10 @@ private void eliminateBackfillStates(int baseState) { // don't do anything unless this state is actually in the backfill list... - if (statesToBackfill.contains(new Integer(baseState))) { + if (statesToBackfill.contains(Integer.valueOf(baseState))) { // if it is, take it out - statesToBackfill.removeElement(new Integer(baseState)); + statesToBackfill.removeElement(Integer.valueOf(baseState)); // then go through and recursively call this function for every // state that the base state points to @@ -1608,7 +1608,7 @@ int[] rowNumMap = new int[tempStateTable.size()]; Stack rowsToFollow = new Stack<>(); - rowsToFollow.push(new Integer(1)); + rowsToFollow.push(Integer.valueOf(1)); rowNumMap[1] = 1; // determine which states are no longer reachable from the start state @@ -1622,7 +1622,7 @@ if (row[i] != 0) { if (rowNumMap[row[i]] == 0) { rowNumMap[row[i]] = row[i]; - rowsToFollow.push(new Integer(row[i])); + rowsToFollow.push(Integer.valueOf(row[i])); } } } --- old/make/jdk/src/classes/build/tools/generatecharacter/CharacterName.java 2020-03-19 17:44:42.386570776 +0100 +++ new/make/jdk/src/classes/build/tools/generatecharacter/CharacterName.java 2020-03-19 17:44:41.850570780 +0100 @@ -1,3 +1,28 @@ +/* + * Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + package build.tools.generatecharacter; import java.io.*; --- old/make/jdk/src/classes/build/tools/generatecharacter/CharacterScript.java 2020-03-19 17:44:43.722570766 +0100 +++ new/make/jdk/src/classes/build/tools/generatecharacter/CharacterScript.java 2020-03-19 17:44:43.218570770 +0100 @@ -1,3 +1,28 @@ +/* + * Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + package build.tools.generatecharacter; import java.util.regex.*; @@ -118,7 +143,7 @@ // Character.getType() != Character.UNASSIGNED // first (return UNKNOWN for unassigned) - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); list.add(scripts[0]); int[] last = scripts[0]; @@ -156,7 +181,7 @@ } for (i = 0; i < list.size(); i++) { - int[] a = (int[])list.get(i); + int[] a = list.get(i); String name = "UNKNOWN"; if (a[2] != -1) name = names[a[2]].toUpperCase(Locale.US); --- old/make/jdk/src/classes/build/tools/generatecharacter/PrintCharacterRanges.java 2020-03-19 17:44:45.158570756 +0100 +++ new/make/jdk/src/classes/build/tools/generatecharacter/PrintCharacterRanges.java 2020-03-19 17:44:44.618570760 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,16 +45,16 @@ int end() { return end; } } - private static List/**/ recoverBooleanRanges(String methodName) throws Exception { - List result = new ArrayList(); + private static List recoverBooleanRanges(String methodName) throws Exception { + List result = new ArrayList<>(); int currentRangeStart = -1; - Method method = Character.class.getDeclaredMethod(methodName, new Class[] { Character.TYPE }); + Method method = Character.class.getDeclaredMethod(methodName, new Class[] { Character.TYPE }); if (method == null) { throw new RuntimeException("No method \"" + methodName + "\"(C) found"); } for (int i = 0; i <= 255; i++) { - boolean methodRes = ((Boolean) method.invoke(null, new Object[] { new Character((char) i) })).booleanValue(); + boolean methodRes = ((Boolean) method.invoke(null, new Object[] { Character.valueOf((char) i) })).booleanValue(); if (methodRes) { if (currentRangeStart < 0) { currentRangeStart = i; @@ -91,17 +91,17 @@ return s.toString(); } - private static void printBooleanRanges(List/**/ ranges, String methodName) { + private static void printBooleanRanges(List ranges, String methodName) { System.out.print(methodName + ":"); - for (Iterator iter = ranges.iterator(); iter.hasNext();) { - BooleanRange range = (BooleanRange) iter.next(); + for (Iterator iter = ranges.iterator(); iter.hasNext();) { + BooleanRange range = iter.next(); System.out.print(" [ " + describe(range.begin()) + ", " + describe(range.end()) + " ]"); } System.out.println(""); } private static void recoverAndPrintBooleanRanges(String methodName) throws Exception { - List ranges = recoverBooleanRanges(methodName); + List ranges = recoverBooleanRanges(methodName); printBooleanRanges(ranges, methodName); } @@ -121,17 +121,17 @@ int offset() { return offset; } } - private static List/**/ recoverShiftRanges(String methodName) throws Exception { - List result = new ArrayList(); + private static List recoverShiftRanges(String methodName) throws Exception { + List result = new ArrayList<>(); int currentRangeStart = -1; int currentRangeOffset = -1; - Method method = Character.class.getDeclaredMethod(methodName, new Class[] { Character.TYPE }); + Method method = Character.class.getDeclaredMethod(methodName, new Class[] { Character.TYPE }); if (method == null) { throw new RuntimeException("No method \"" + methodName + "\"(C) found"); } for (int i = 0; i <= 255; i++) { - char methodRes = ((Character) method.invoke(null, new Object[] { new Character((char) i) })).charValue(); + char methodRes = ((Character) method.invoke(null, new Object[] { Character.valueOf((char) i) })).charValue(); if (methodRes != i) { int offset = methodRes - i; if (currentRangeStart < 0) { @@ -155,11 +155,11 @@ return result; } - private static void printShiftRanges(List/**/ ranges, String methodName) { + private static void printShiftRanges(List ranges, String methodName) { System.out.print(methodName + ":"); boolean isFirst = true; - for (Iterator iter = ranges.iterator(); iter.hasNext();) { - ShiftRange range = (ShiftRange) iter.next(); + for (Iterator iter = ranges.iterator(); iter.hasNext();) { + ShiftRange range = iter.next(); if (isFirst) { isFirst = false; } else { @@ -173,7 +173,7 @@ } private static void recoverAndPrintShiftRanges(String methodName) throws Exception { - List ranges = recoverShiftRanges(methodName); + List ranges = recoverShiftRanges(methodName); printShiftRanges(ranges, methodName); } --- old/make/jdk/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java 2020-03-19 17:44:46.578570745 +0100 +++ new/make/jdk/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java 2020-03-19 17:44:46.034570749 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -322,7 +322,7 @@ specialCaseNewCurrenciesDefaultFractionDigits[specialCaseCount] = getDefaultFractionDigits(newCurrency); specialCaseNewCurrenciesNumericCode[specialCaseCount] = getNumericCode(newCurrency); } - specialCaseMap.put(currencyInfo, new Integer(specialCaseCount)); + specialCaseMap.put(currencyInfo, Integer.valueOf(specialCaseCount)); return specialCaseCount++; } --- old/make/jdk/src/classes/build/tools/jdwpgen/Parse.java 2020-03-19 17:44:48.038570734 +0100 +++ new/make/jdk/src/classes/build/tools/jdwpgen/Parse.java 2020-03-19 17:44:47.526570738 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ import java.util.*; import java.io.*; +import java.lang.reflect.InvocationTargetException; class Parse { @@ -144,12 +145,18 @@ return null; } else { try { - Node node = (Node)proto.getClass().newInstance(); + Node node = (Node)proto.getClass().getDeclaredConstructor().newInstance(); node.set(kind, list, izer.lineno()); return node; } catch (InstantiationException exc) { error(exc.toString()); return null; + } catch (NoSuchMethodException exc) { + error(exc.toString()); + return null; + } catch (InvocationTargetException exc) { + error(exc.toString()); + return null; } catch (IllegalAccessException exc) { error(exc.toString()); return null; --- old/make/jdk/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java 2020-03-19 17:44:49.494570724 +0100 +++ new/make/jdk/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java 2020-03-19 17:44:48.958570727 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -67,13 +67,14 @@ } public Set getZoneIds() { - return new TreeSet(regionIds); + return new TreeSet(regionIds); } public Map getAliasMap() { return links; } + @SuppressWarnings("unchecked") public ZoneRules getZoneRules(String zoneId) { Object obj = zones.get(zoneId); if (obj == null) { --- old/make/jdk/src/classes/build/tools/x11wrappergen/WrapperGenerator.java 2020-03-19 17:44:50.994570712 +0100 +++ new/make/jdk/src/classes/build/tools/x11wrappergen/WrapperGenerator.java 2020-03-19 17:44:50.462570716 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,11 +47,11 @@ String defaultBaseClass = "XWrapperBase"; String compile_options = "-lX11"; - static Hashtable symbolTable = new Hashtable(); - static Hashtable sizeTable32bit = new Hashtable(); - static Hashtable sizeTable64bit = new Hashtable(); - static Hashtable knownSizes32 = new Hashtable(); - static Hashtable knownSizes64 = new Hashtable(); + static Hashtable symbolTable = new Hashtable<>(); + static Hashtable sizeTable32bit = new Hashtable<>(); + static Hashtable sizeTable64bit = new Hashtable<>(); + static Hashtable knownSizes32 = new Hashtable<>(); + static Hashtable knownSizes64 = new Hashtable<>(); static { /* knownSizes64.put("", Integer.valueOf()); @@ -391,7 +391,7 @@ alias = true; aliasName = attributes[4]; } else if (type == TYPE_ARRAY || type == TYPE_PTR || type == TYPE_STRUCT) { - referencedType = (BaseType)symbolTable.get(mod); + referencedType = symbolTable.get(mod); if (referencedType == null) { log.warning("Can't find type for name " + mod); } @@ -457,7 +457,7 @@ private static class StructType extends BaseType { - Vector members; + Vector members; String description; boolean packed; int size; @@ -472,7 +472,7 @@ */ public StructType(String _desc) { - members = new Vector(); + members = new Vector<>(); parseDescription(_desc); } public int getNumFields() @@ -495,7 +495,7 @@ return description; } - public Enumeration getMembers() + public Enumeration getMembers() { return members.elements(); } @@ -545,8 +545,8 @@ * Returns String containing Java code calculating size of the structure depending on the data model */ public String getSize() { - String s32 = (String) WrapperGenerator.sizeTable32bit.get(getName()); - String s64 = (String) WrapperGenerator.sizeTable64bit.get(getName()); + String s32 = WrapperGenerator.sizeTable32bit.get(getName()); + String s64 = WrapperGenerator.sizeTable64bit.get(getName()); if (s32 == null || s64 == null) { return (s32 == null)?(s64):(s32); } @@ -558,8 +558,8 @@ } public String getOffset(AtomicType atp) { String key = getName()+"."+(atp.isAlias() ? atp.getAliasName() : atp.getName()); - String s64 = (String) WrapperGenerator.sizeTable64bit.get(key); - String s32 = (String) WrapperGenerator.sizeTable32bit.get(key); + String s64 = WrapperGenerator.sizeTable64bit.get(key); + String s32 = WrapperGenerator.sizeTable32bit.get(key); if (s32 == null || s64 == null) { return (s32 == null)?(s64):(s32); } @@ -573,7 +573,7 @@ private static class FunctionType extends BaseType { - Vector args; + Vector args; String description; boolean packed; String returnType; @@ -582,7 +582,7 @@ public FunctionType(String _desc) { - args = new Vector(); + args = new Vector<>(); description = _desc; setName(_desc); } @@ -618,7 +618,7 @@ return description; } - public Collection getArguments() + public Collection getArguments() { return args; } @@ -653,28 +653,28 @@ public String getOffsets(StructType stp,AtomicType atp, boolean wide) { String key = stp.getName()+"."+atp.getName(); - return wide == true ? (String) sizeTable64bit.get(key) : (String) sizeTable32bit.get(key); + return wide == true ? sizeTable64bit.get(key) : sizeTable32bit.get(key); } public String getStructSize(StructType stp, boolean wide) { - return wide == true ? (String) sizeTable64bit.get(stp.getName()) : (String) sizeTable32bit.get(stp.getName()); + return wide == true ? sizeTable64bit.get(stp.getName()) : sizeTable32bit.get(stp.getName()); } public int getLongSize(boolean wide) { - return Integer.parseInt(wide == true ? (String)sizeTable64bit.get("long") : (String)sizeTable32bit.get("long")); + return Integer.parseInt(wide == true ? sizeTable64bit.get("long") : sizeTable32bit.get("long")); } public int getPtrSize(boolean wide) { - return Integer.parseInt(wide == true ? (String)sizeTable64bit.get("ptr") : (String)sizeTable32bit.get("ptr")); + return Integer.parseInt(wide == true ? sizeTable64bit.get("ptr") : sizeTable32bit.get("ptr")); } public int getBoolSize(boolean wide) { return getOrdinalSize("Bool", wide); } public int getOrdinalSize(String ordinal, boolean wide) { - return Integer.parseInt(wide == true ? (String)sizeTable64bit.get(ordinal) : (String)sizeTable32bit.get(ordinal)); + return Integer.parseInt(wide == true ? sizeTable64bit.get(ordinal) : sizeTable32bit.get(ordinal)); } public void writeToString(StructType stp, PrintWriter pw) { @@ -682,7 +682,7 @@ pw.println("\n\n\tString getName() {\n\t\treturn \"" + stp.getName()+ "\"; \n\t}"); pw.println("\n\n\tString getFieldsAsString() {\n\t\tStringBuilder ret = new StringBuilder(" + stp.getNumFields() * 40 + ");\n"); - for (Enumeration e = stp.getMembers() ; e.hasMoreElements() ;) { + for (Enumeration e = stp.getMembers() ; e.hasMoreElements() ;) { AtomicType tp = (AtomicType) e.nextElement(); type = tp.getType(); @@ -718,7 +718,7 @@ } else { prefix = "\t"; } - for (Enumeration e = stp.getMembers() ; e.hasMoreElements() ;) { + for (Enumeration e = stp.getMembers() ; e.hasMoreElements() ;) { AtomicType tp = (AtomicType) e.nextElement(); type = tp.getType(); @@ -753,7 +753,7 @@ int acc_size_32 = 0; int acc_size_64 = 0; String s_log = (generateLog?"log.finest(\"\");":""); - for (Enumeration e = stp.getMembers() ; e.hasMoreElements() ;) { + for (Enumeration e = stp.getMembers() ; e.hasMoreElements() ;) { AtomicType tp = (AtomicType) e.nextElement(); type = tp.getType(); @@ -946,7 +946,7 @@ pw.println("\tprivate static Unsafe unsafe = XlibWrapper.unsafe;"); pw.println("\tprivate boolean __executed = false;"); pw.println("\tprivate boolean __disposed = false;"); - Iterator iter = ft.getArguments().iterator(); + Iterator iter = ft.getArguments().iterator(); while (iter.hasNext()) { AtomicType at = (AtomicType)iter.next(); if (at.isIn()) { @@ -1110,8 +1110,8 @@ public void writeJavaWrapperClass(String outputDir) { try { - for (Enumeration e = symbolTable.elements() ; e.hasMoreElements() ;) { - BaseType tp = (BaseType) e.nextElement(); + for (Enumeration e = symbolTable.elements() ; e.hasMoreElements() ;) { + BaseType tp = e.nextElement(); if (tp instanceof StructType) { StructType st = (StructType) tp; writeWrapper(outputDir, st); @@ -1132,7 +1132,7 @@ int j=0; BaseType tp; StructType stp; - Enumeration eo; + Enumeration eo; try { @@ -1158,7 +1158,7 @@ pw.println("\n\nint main(){"); j=0; for ( eo = symbolTable.elements() ; eo.hasMoreElements() ;) { - tp = (BaseType) eo.nextElement(); + tp = eo.nextElement(); if (tp instanceof StructType) { stp = (StructType) tp; @@ -1181,14 +1181,14 @@ for (eo = symbolTable.elements() ; eo.hasMoreElements() ;) { - tp = (BaseType) eo.nextElement(); + tp = eo.nextElement(); if (tp instanceof StructType) { stp = (StructType) tp; if (stp.getIsInterface()) { continue; } - for (Enumeration e = stp.getMembers() ; e.hasMoreElements() ;) { + for (Enumeration e = stp.getMembers() ; e.hasMoreElements() ;) { AtomicType atp = (AtomicType) e.nextElement(); if (atp.isAlias()) continue; pw.println("printf(\""+ stp.getName() + "." + atp.getName() + "\t%d\\n\""+ @@ -1277,7 +1277,7 @@ } else if (line != null) { - BaseType bt = (BaseType) symbolTable.get(line); + BaseType bt = symbolTable.get(line); if (bt == null) { if (line.startsWith("!")) { FunctionType ft = new FunctionType(line);