# HG changeset patch # User wetmore # Date 1217351905 25200 # Node ID 3322af753f62da35d9919354881035e6b1071f36 # Parent 40d3416d937ae292502f3adf0e2d8beff8918022# Parent 9edd1b9607e2b7ef849895f417a4a9d8a8239907 Merge diff -r 9edd1b9607e2 -r 3322af753f62 jdk/make/java/nio/Makefile --- a/jdk/make/java/nio/Makefile Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/make/java/nio/Makefile Tue Jul 29 10:18:25 2008 -0700 @@ -166,8 +166,8 @@ # Generate source files # -SPP = spp.sh -SPP_CMD = $(SH) $(SPP) +SPP_JARFILE = $(BUILDTOOLJARDIR)/spp.jar +SPP_CMD = $(BOOT_JAVA_CMD) -jar $(SPP_JARFILE) FILES_genout = $(FILES_gen:%.java=$(GENSRCDIR)/%.java) @@ -183,7 +183,7 @@ SCH_GEN=$(SNIO_GEN)/ch SCS_GEN=$(SNIO_GEN)/cs -sources: $(SPP) $(FILES_genout) +sources: $(SPP_JARFILE) $(FILES_genout) # # Generated buffer classes diff -r 9edd1b9607e2 -r 3322af753f62 jdk/make/java/nio/genCoder.sh --- a/jdk/make/java/nio/genCoder.sh Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/make/java/nio/genCoder.sh Tue Jul 29 10:18:25 2008 -0700 @@ -53,8 +53,8 @@ -Dcoding='decoding' \ -DOtherCoder='Encoder' \ -DreplTypeName='string' \ - -DdefaultRepl='"\\\\uFFFD"' \ - -DdefaultReplName='"\\\\uFFFD"<\/tt>' \ + -DdefaultRepl='"\\uFFFD"' \ + -DdefaultReplName='"\\uFFFD"<\/tt>' \ -DreplType='String' \ -DreplFQType='java.lang.String' \ -DreplLength='length()' \ @@ -84,7 +84,7 @@ -DOtherCoder='Decoder' \ -DreplTypeName='byte array' \ -DdefaultRepl='new byte[] { (byte)'"'"\\?"'"' }' \ - -DdefaultReplName='{<\/tt>\\\ (byte)'"'"\\?"'"'<\/tt>\\\ }<\/tt>' \ + -DdefaultReplName='{<\/tt>\ (byte)'"'"\\?"'"'<\/tt>\ }<\/tt>' \ -DreplType='byte[]' \ -DreplFQType='byte[]' \ -DreplLength='length' \ diff -r 9edd1b9607e2 -r 3322af753f62 jdk/make/java/nio/spp.sh --- a/jdk/make/java/nio/spp.sh Tue Jul 29 09:53:35 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,165 +0,0 @@ -#! /bin/sh - -# -# Copyright 2000-2001 Sun Microsystems, Inc. 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. Sun designates this -# particular file as subject to the "Classpath" exception as provided -# by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, -# CA 95054 USA or visit www.sun.com if you need additional information or -# have any questions. -# - -# SPP: A simple/sed-based/stream preprocessor -# Mark Reinhold / mr@sun.com -# -# Usage: spp [-be] [-Kkey] -Dvar=value ... out -# -# Source-file constructs -# -# Meaningful only at beginning of line, works with any number of keys: -# -# #if[key] Includes text between #if/#end if -Kkey specified, -# #else[key] otherwise changes text to blank lines; key test -# #end[key] may be negated by prefixing !, e.g., #if[!key] -# -# #begin If -be is specified then lines up to and including -# #end #begin, and from #end to EOF, are deleted -# -# #warn Changed into warning that file is generated -# -# // ## Changed into blank line -# -# Meaningful anywhere in line, works only for first two keys: -# -# {#if[key]?yes} Expands to yes if -Kkey specified -# {#if[key]?yes:no} Expands to yes if -Kkey, otherwise no -# {#if[!key]?yes} Expands to yes if -Kother -# {#if[!key]?yes:no} Expands to yes if -Kother, otherwise no -# $var$ Expands to value if -Dvar=value given -# -# yes, no must not contain whitespace -# -# If the environment variable SED is defined, uses that instead of sed -# If the environment variable NAWK is defined, uses that instead of awk -# - -SED=${SED:-sed} -NAWK=${NAWK:-awk} - -# Map a string of the form -Dvar=value into an appropriate sed command -# -subst() { - # The first two lines are to avoid the direct use of echo, - # which does not treat backslashes consistently across platforms - echo '' \ - | $SED -e "s.*$*" \ - | $SED -e 's-D\([a-zA-Z_][-a-zA-Z_]*\)=\(.*\)'"s\\\\\$\\1\\\\\$\2gg" \ - -e 's-D\([a-zA-Z_][-a-zA-Z_]*\)'"s\\\\\$\\1\\\\\$1gg" \ - -e 's/ //g' -} - -es= -be= -keys= -key1=_1_ -key2=_2_ -while [ $# -gt 0 ]; do - case "$1" in - -be) - be='-e 1,/^#begin$/d -e /^#end$/,$d' - ;; - -D*) - es="$es -e `subst $1`" - ;; - -K*) - nk=`echo $1 | $SED -e 's/-K//'` - if [ "x$keys" = x ]; then keys="$nk"; else keys="$keys $nk"; fi - if [ "x$key1" = x_1_ ]; then key1="$nk"; - elif [ "x$key2" = x_2_ ]; then key2="$nk"; fi - ;; - *) - echo "Usage: $0 [-be] [-Kkey] -Dvar=value ... out" - exit 1 - ;; - esac - shift -done - -text='[-a-zA-Z0-9&;,.<>/#() ]' - -$SED $es \ - -e 's// /g' \ - -e "s@^#warn .*@// -- This file was mechanically generated: Do not edit! -- //@" \ - -e 's-// ##.*$--' $be \ - -e "s/{#if\[$key1\]?\($text*\):\($text*\)}/\1/g" \ - -e "s/{#if\[!$key1\]?\($text*\):\($text*\)}/\2/g" \ - -e "s/{#if\[$key1\]?\($text*\)}/\1/g" \ - -e "s/{#if\[!$key1\]?\($text*\)}//g" \ - -e "s/{#if\[$key2\]?\($text*\):\($text*\)}/\1/g" \ - -e "s/{#if\[!$key2\]?\($text*\):\($text*\)}/\2/g" \ - -e "s/{#if\[$key2\]?\($text*\)}/\1/g" \ - -e "s/{#if\[!$key2\]?\($text*\)}//g" \ - -e "s/{#if\[[a-z]*\]?\($text*\):\($text*\)}/\2/g" \ - -e "s/{#if\[![a-z]*\]?\($text*\):\($text*\)}/\1/g" \ - -e "s/{#if\[[a-z]*\]?\($text*\)}//g" \ - -e "s/{#if\[![a-z]*\]?\($text*\)}/\1/g" \ -| $NAWK \ - 'function key(s) { - i = match(s, "[a-zA-Z][a-zA-Z]*\\]"); - if (i > 0) return substr(s, i, RLENGTH - 1); - return "XYZZY"; } - function neg(s) { return match(s, "!") > 0; } - BEGIN { - KEYS = "'"$keys"'" - n = split(KEYS, ks, " *"); - for (i = 1; i <= n; i++) keys[ks[i]] = 1; - top = 1; copy[top] = 1 } - /^#if\[!?[a-zA-Z][a-zA-Z]*\]/ \ - { k = key($0); - n = neg($0); - stack[++top] = k; - if ((k in keys) == !n) { - copy[top] = copy[top - 1]; - } else { - copy[top] = 0; - } - print ""; next } - /^#else\[!?[a-zA-Z][a-zA-Z]*\]/ \ - { k = key($0); - if (stack[top] == k) { - copy[top] = copy[top - 1] && !copy[top]; - } else { - printf "%d: Mismatched #else key\n", NR | "cat 1>&2"; - exit 11 - } - print ""; next } - /^#end\[!?[a-zA-Z][a-zA-Z]*\]/ \ - { k = key($0); - if (stack[top] == k) { - top--; - } else { - printf "%d: Mismatched #end key\n", NR | "cat 1>&2" - exit 11 - } - print ""; next } - /^#/ { - printf "%d: Malformed #directive\n", NR | "cat 1>&2" - exit 11 - } - { if (copy[top]) print; else print "" }' diff -r 9edd1b9607e2 -r 3322af753f62 jdk/make/tools/Makefile --- a/jdk/make/tools/Makefile Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/make/tools/Makefile Tue Jul 29 10:18:25 2008 -0700 @@ -51,6 +51,7 @@ jdwpgen \ makeclasslist \ strip_properties \ + spp \ CharsetMapping all build clean clobber:: diff -r 9edd1b9607e2 -r 3322af753f62 jdk/make/tools/spp/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/make/tools/spp/Makefile Tue Jul 29 10:18:25 2008 -0700 @@ -0,0 +1,45 @@ +# +# Copyright 2008 Sun Microsystems, Inc. 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. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# +# Makefile for build spp tool +# + +BUILDDIR = ../.. +PACKAGE = build.tools.spp +PRODUCT = tools +PROGRAM = spp +include $(BUILDDIR)/common/Defs.gmk + + +BUILDTOOL_SOURCE_ROOT = $(BUILDDIR)/tools/src +BUILDTOOL_MAIN = $(PKGDIR)/Spp.java + +# +# Build tool jar rules. +# +include $(BUILDDIR)/common/BuildToolJar.gmk + + diff -r 9edd1b9607e2 -r 3322af753f62 jdk/make/tools/src/build/tools/spp/Spp.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/make/tools/src/build/tools/spp/Spp.java Tue Jul 29 10:18:25 2008 -0700 @@ -0,0 +1,189 @@ +/* + * Copyright 2008 Sun Microsystems, Inc. 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. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package build.tools.spp; + +import java.util.*; +import java.util.regex.*; + +/* + * Spp: A simple regex-based stream preprocessor based on Mark Reinhold's + * sed-based spp.sh + * + * Usage: java build.tools.spp.Spp [-be] [-Kkey] -Dvar=value ... out + * + * Source-file constructs + * + * Meaningful only at beginning of line, works with any number of keys: + * + * #if[key] Includes text between #if/#end if -Kkey specified, + * #else[key] otherwise changes text to blank lines; key test + * #end[key] may be negated by prefixing !, e.g., #if[!key] + * + * #begin If -be is specified then lines up to and including + * #end #begin, and from #end to EOF, are deleted + * + * #warn Changed into warning that file is generated + * + * // ## Changed into blank line + * + * Meaningful anywhere in line + * + * {#if[key]?yes} Expands to yes if -Kkey specified + * {#if[key]?yes:no} Expands to yes if -Kkey, otherwise no + * {#if[!key]?yes} Expands to yes if -Kother + * {#if[!key]?yes:no} Expands to yes if -Kother, otherwise no + * $var$ Expands to value if -Dvar=value given + * + * yes, no must not contain whitespace + * + * @author Xueming Shen + */ + +public class Spp { + public static void main(String args[]) throws Exception { + Map vars = new HashMap(); + Set keys = new HashSet(); + boolean be = false; + + for (String arg:args) { + if (arg.startsWith("-D")) { + int i = arg.indexOf('='); + vars.put(arg.substring(2, i),arg.substring(i+1)); + } else if (arg.startsWith("-K")) { + keys.add(arg.substring(2)); + } else if ("-be".equals(arg)) { + be = true; + } else { + System.err.println("Usage: java build.tools.spp.Spp [-be] [-Kkey] -Dvar=value ... out"); + System.exit(-1); + } + } + + StringBuffer out = new StringBuffer(); + new Spp().spp(new Scanner(System.in), + out, "", + keys, vars, be, + false); + System.out.print(out.toString()); + } + + static final String LNSEP = System.getProperty("line.separator"); + static final String KEY = "([a-zA-Z0-9]+)"; + static final String VAR = "([a-zA-Z0-9_\\-]+)"; + static final String TEXT = "([a-zA-Z0-9&;,.<>/#() \\$]+)"; // $ -- hack embedded $var$ + + static final int GN_NOT = 1; + static final int GN_KEY = 2; + static final int GN_YES = 3; + static final int GN_NO = 5; + static final int GN_VAR = 6; + + Matcher ifkey = Pattern.compile("^#if\\[(!)?" + KEY + "\\]").matcher(""); + Matcher elsekey = Pattern.compile("^#else\\[(!)?" + KEY + "\\]").matcher(""); + Matcher endkey = Pattern.compile("^#end\\[(!)?" + KEY + "\\]").matcher(""); + Matcher vardef = Pattern.compile("\\{#if\\[(!)?" + KEY + "\\]\\?" + TEXT + "(:"+ TEXT + ")?\\}|\\$" + VAR + "\\$").matcher(""); + Matcher vardef2 = Pattern.compile("\\$" + VAR + "\\$").matcher(""); + + void append(StringBuffer buf, String ln, + Set keys, Map vars) { + vardef.reset(ln); + while (vardef.find()) { + String repl = ""; + if (vardef.group(GN_VAR) != null) + repl = vars.get(vardef.group(GN_VAR)); + else { + boolean test = keys.contains(vardef.group(GN_KEY)); + if (vardef.group(GN_NOT) != null) + test = !test; + repl = test?vardef.group(GN_YES):vardef.group(GN_NO); + if (repl == null) + repl = ""; + else { // embedded $var$ + while (vardef2.reset(repl).find()) { + repl = vardef2.replaceFirst(vars.get(vardef2.group(1))); + } + } + } + vardef.appendReplacement(buf, repl); + } + vardef.appendTail(buf); + } + + // return true if #end[key], #end or EOF reached + boolean spp(Scanner in, StringBuffer buf, String key, + Set keys, Map vars, + boolean be, boolean skip) { + while (in.hasNextLine()) { + String ln = in.nextLine(); + if (be) { + if (ln.startsWith("#begin")) { + buf.setLength(0); //clean up to this line + continue; + } + if (ln.equals("#end")) { + while (in.hasNextLine()) + in.nextLine(); + return true; //discard the rest to EOF + } + } + if (ifkey.reset(ln).find()) { + String k = ifkey.group(GN_KEY); + boolean test = keys.contains(k); + if (ifkey.group(GN_NOT) != null) + test = !test; + buf.append(LNSEP); + if (!spp(in, buf, k, keys, vars, be, skip || !test)) { + spp(in, buf, k, keys, vars, be, skip || test); + } + continue; + } + if (elsekey.reset(ln).find()) { + if (!key.equals(elsekey.group(GN_KEY))) { + throw new Error("Mis-matched #if-else-end at line <" + ln + ">"); + } + buf.append(LNSEP); + return false; + } + if (endkey.reset(ln).find()) { + if (!key.equals(endkey.group(GN_KEY))) { + throw new Error("Mis-matched #if-else-end at line <" + ln + ">"); + } + buf.append(LNSEP); + return true; + } + if (ln.startsWith("#warn")) { + ln = "// -- This file was mechanically generated: Do not edit! -- //"; + } else if (ln.trim().startsWith("// ##")) { + ln = ""; + } + if (!skip) { + append(buf, ln, keys, vars); + } + buf.append(LNSEP); + } + return true; + } +} diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/share/back/ThreadReferenceImpl.c --- a/jdk/src/share/back/ThreadReferenceImpl.c Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/share/back/ThreadReferenceImpl.c Tue Jul 29 10:18:25 2008 -0700 @@ -540,7 +540,6 @@ jvmtiError error = JVMTI_ERROR_NONE; jint count = 0; - jint depth; jvmtiMonitorStackDepthInfo *monitors=NULL; error = JVMTI_FUNC_PTR(gdata->jvmti,GetOwnedMonitorStackDepthInfo) diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/share/back/transport.c --- a/jdk/src/share/back/transport.c Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/share/back/transport.c Tue Jul 29 10:18:25 2008 -0700 @@ -473,7 +473,7 @@ /* * Record listener address in a system property */ - len = strlen(name) + strlen(retAddress) + 2; /* ':' and '\0' */ + len = (int)strlen(name) + (int)strlen(retAddress) + 2; /* ':' and '\0' */ prop_value = (char*)jvmtiAllocate(len); strcpy(prop_value, name); strcat(prop_value, ":"); diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/share/classes/java/nio/channels/spi/AbstractSelector.java --- a/jdk/src/share/classes/java/nio/channels/spi/AbstractSelector.java Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/share/classes/java/nio/channels/spi/AbstractSelector.java Tue Jul 29 10:18:25 2008 -0700 @@ -82,7 +82,7 @@ this.provider = provider; } - private final Set cancelledKeys = new HashSet(); + private final Set cancelledKeys = new HashSet(); void cancel(SelectionKey k) { // package-private synchronized (cancelledKeys) { diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/share/classes/java/nio/charset/Charset-X-Coder.java --- a/jdk/src/share/classes/java/nio/charset/Charset-X-Coder.java Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/share/classes/java/nio/charset/Charset-X-Coder.java Tue Jul 29 10:18:25 2008 -0700 @@ -303,7 +303,7 @@ #if[encoder] - private WeakReference cachedDecoder = null; + private WeakReference cachedDecoder = null; /** * Tells whether or not the given byte array is a legal replacement value @@ -322,13 +322,13 @@ * is a legal replacement value for this encoder */ public boolean isLegalReplacement(byte[] repl) { - WeakReference wr = cachedDecoder; + WeakReference wr = cachedDecoder; CharsetDecoder dec = null; - if ((wr == null) || ((dec = (CharsetDecoder)wr.get()) == null)) { + if ((wr == null) || ((dec = wr.get()) == null)) { dec = charset().newDecoder(); dec.onMalformedInput(CodingErrorAction.REPORT); dec.onUnmappableCharacter(CodingErrorAction.REPORT); - cachedDecoder = new WeakReference(dec); + cachedDecoder = new WeakReference(dec); } else { dec.reset(); } diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/share/classes/java/nio/charset/Charset.java --- a/jdk/src/share/classes/java/nio/charset/Charset.java Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/share/classes/java/nio/charset/Charset.java Tue Jul 29 10:18:25 2008 -0700 @@ -379,7 +379,7 @@ } // Thread-local gate to prevent recursive provider lookups - private static ThreadLocal gate = new ThreadLocal(); + private static ThreadLocal gate = new ThreadLocal(); private static Charset lookupViaProviders(final String charsetName) { @@ -539,9 +539,9 @@ // Fold charsets from the given iterator into the given map, ignoring // charsets whose names already have entries in the map. // - private static void put(Iterator i, Map m) { + private static void put(Iterator i, Map m) { while (i.hasNext()) { - Charset cs = (Charset)i.next(); + Charset cs = i.next(); if (!m.containsKey(cs.name())) m.put(cs.name(), cs); } @@ -623,7 +623,7 @@ private final String name; // tickles a bug in oldjavac private final String[] aliases; // tickles a bug in oldjavac - private Set aliasSet = null; + private Set aliasSet = null; /** * Initializes a new charset with the given canonical name and alias @@ -665,7 +665,7 @@ if (aliasSet != null) return aliasSet; int n = aliases.length; - HashSet hs = new HashSet(n); + HashSet hs = new HashSet(n); for (int i = 0; i < n; i++) hs.add(aliases[i]); aliasSet = Collections.unmodifiableSet(hs); diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/share/classes/java/nio/charset/CoderResult.java --- a/jdk/src/share/classes/java/nio/charset/CoderResult.java Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/share/classes/java/nio/charset/CoderResult.java Tue Jul 29 10:18:25 2008 -0700 @@ -194,7 +194,7 @@ private static abstract class Cache { - private Map cache = null; + private Map> cache = null; protected abstract CoderResult create(int len); @@ -202,16 +202,16 @@ if (len <= 0) throw new IllegalArgumentException("Non-positive length"); Integer k = new Integer(len); - WeakReference w; + WeakReference w; CoderResult e = null; if (cache == null) { - cache = new HashMap(); - } else if ((w = (WeakReference)cache.get(k)) != null) { - e = (CoderResult)w.get(); + cache = new HashMap>(); + } else if ((w = cache.get(k)) != null) { + e = w.get(); } if (e == null) { e = create(len); - cache.put(k, new WeakReference(e)); + cache.put(k, new WeakReference(e)); } return e; } diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalMonitoredVm.java --- a/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalMonitoredVm.java Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalMonitoredVm.java Tue Jul 29 10:18:25 2008 -0700 @@ -124,7 +124,7 @@ } int oldInterval = interval; - super.setInterval(interval); + super.setInterval(newInterval); if (task != null) { task.cancel(); diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/MonitoredHostProvider.java --- a/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/MonitoredHostProvider.java Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/MonitoredHostProvider.java Tue Jul 29 10:18:25 2008 -0700 @@ -130,7 +130,7 @@ } int oldInterval = interval; - super.setInterval(interval); + super.setInterval(newInterval); if (task != null) { task.cancel(); diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/share/classes/sun/nio/ch/SelectorImpl.java --- a/jdk/src/share/classes/sun/nio/ch/SelectorImpl.java Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/share/classes/sun/nio/ch/SelectorImpl.java Tue Jul 29 10:18:25 2008 -0700 @@ -42,19 +42,19 @@ { // The set of keys with data ready for an operation - protected Set selectedKeys; + protected Set selectedKeys; // The set of keys registered with this Selector - protected HashSet keys; + protected HashSet keys; // Public views of the key sets - private Set publicKeys; // Immutable - private Set publicSelectedKeys; // Removal allowed, but not addition + private Set publicKeys; // Immutable + private Set publicSelectedKeys; // Removal allowed, but not addition protected SelectorImpl(SelectorProvider sp) { super(sp); - keys = new HashSet(); - selectedKeys = new HashSet(); + keys = new HashSet(); + selectedKeys = new HashSet(); if (Util.atBugLevel("1.4")) { publicKeys = keys; publicSelectedKeys = selectedKeys; @@ -64,13 +64,13 @@ } } - public Set keys() { + public Set keys() { if (!isOpen() && !Util.atBugLevel("1.4")) throw new ClosedSelectorException(); return publicKeys; } - public Set selectedKeys() { + public Set selectedKeys() { if (!isOpen() && !Util.atBugLevel("1.4")) throw new ClosedSelectorException(); return publicSelectedKeys; diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/share/classes/sun/nio/ch/Util.java --- a/jdk/src/share/classes/sun/nio/ch/Util.java Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/share/classes/sun/nio/ch/Util.java Tue Jul 29 10:18:25 2008 -0700 @@ -51,9 +51,13 @@ // Per-thread soft cache of the last temporary direct buffer private static ThreadLocal>[] bufferPool; + @SuppressWarnings("unchecked") + static ThreadLocal>[] createThreadLocalBufferPool() { + return new ThreadLocal[TEMP_BUF_POOL_SIZE]; + } + static { - bufferPool = (ThreadLocal>[]) - new ThreadLocal[TEMP_BUF_POOL_SIZE]; + bufferPool = createThreadLocalBufferPool(); for (int i=0; i>(); } diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/share/demo/jvmti/hprof/hprof_io.c --- a/jdk/src/share/demo/jvmti/hprof/hprof_io.c Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/share/demo/jvmti/hprof/hprof_io.c Tue Jul 29 10:18:25 2008 -0700 @@ -1900,7 +1900,6 @@ dump_heap_segment_and_reset(jlong segment_size) { int fd; - char *last_chunk; jlong last_chunk_len; HPROF_ASSERT(gdata->heap_fd >= 0); diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/share/demo/jvmti/hprof/hprof_util.c --- a/jdk/src/share/demo/jvmti/hprof/hprof_util.c Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/share/demo/jvmti/hprof/hprof_util.c Tue Jul 29 10:18:25 2008 -0700 @@ -1174,7 +1174,7 @@ finfo = empty_finfo; finfo.cnum = cnum; - finfo.modifiers = getFieldModifiers(klass, idlist[i]); + finfo.modifiers = (unsigned short)getFieldModifiers(klass, idlist[i]); if ( ( finfo.modifiers & JVM_ACC_STATIC ) == 0 || !skip_static_field_names ) { char *field_name; diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/share/native/java/nio/Bits.c --- a/jdk/src/share/native/java/nio/Bits.c Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/share/native/java/nio/Bits.c Tue Jul 29 10:18:25 2008 -0700 @@ -116,7 +116,7 @@ jshort *srcShort, *dstShort, *endShort; jshort tmpShort; - dstShort = (jshort *)dstAddr; + dstShort = (jshort *)jlong_to_ptr(dstAddr); while (length > 0) { /* do not change this if-else statement, see WARNING above */ @@ -151,7 +151,7 @@ jshort *srcShort, *dstShort, *endShort; jshort tmpShort; - srcShort = (jshort *)srcAddr; + srcShort = (jshort *)jlong_to_ptr(srcAddr); while (length > 0) { /* do not change this if-else statement, see WARNING above */ @@ -186,7 +186,7 @@ jint *srcInt, *dstInt, *endInt; jint tmpInt; - dstInt = (jint *)dstAddr; + dstInt = (jint *)jlong_to_ptr(dstAddr); while (length > 0) { /* do not change this code, see WARNING above */ @@ -221,7 +221,7 @@ jint *srcInt, *dstInt, *endInt; jint tmpInt; - srcInt = (jint *)srcAddr; + srcInt = (jint *)jlong_to_ptr(srcAddr); while (length > 0) { /* do not change this code, see WARNING above */ @@ -256,7 +256,7 @@ jlong *srcLong, *dstLong, *endLong; jlong tmpLong; - dstLong = (jlong *)dstAddr; + dstLong = (jlong *)jlong_to_ptr(dstAddr); while (length > 0) { /* do not change this code, see WARNING above */ @@ -291,7 +291,7 @@ jlong *srcLong, *dstLong, *endLong; jlong tmpLong; - srcLong = (jlong *)srcAddr; + srcLong = (jlong *)jlong_to_ptr(srcAddr); while (length > 0) { /* do not change this code, see WARNING above */ diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/share/transport/shmem/shmemBack.c --- a/jdk/src/share/transport/shmem/shmemBack.c Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/share/transport/shmem/shmemBack.c Tue Jul 29 10:18:25 2008 -0700 @@ -96,7 +96,8 @@ */ if (err == JDWPTRANSPORT_ERROR_IO_ERROR) { char *join_str = ": "; - int msg_len = strlen(newmsg) + strlen(join_str) + strlen(buf) + 3; + int msg_len = (int)strlen(newmsg) + (int)strlen(join_str) + + (int)strlen(buf) + 3; msg = (*callbacks->alloc)(msg_len); if (msg != NULL) { strcpy(msg, newmsg); @@ -104,7 +105,7 @@ strcat(msg, buf); } } else { - msg = (*callbacks->alloc)(strlen(newmsg)+1); + msg = (*callbacks->alloc)((int)strlen(newmsg)+1); if (msg != NULL) { strcpy(msg, newmsg); } @@ -183,7 +184,7 @@ char *name2; rc = shmemBase_name(transport, &name); if (rc == SYS_OK) { - name2 = (callbacks->alloc)(strlen(name) + 1); + name2 = (callbacks->alloc)((int)strlen(name) + 1); if (name2 == NULL) { RETURN_ERROR(JDWPTRANSPORT_ERROR_OUT_OF_MEMORY, "out of memory"); } else { @@ -329,7 +330,7 @@ if (msg == NULL) { return JDWPTRANSPORT_ERROR_MSG_NOT_AVAILABLE; } - *msgP = (*callbacks->alloc)(strlen(msg)+1); + *msgP = (*callbacks->alloc)((int)strlen(msg)+1); if (*msgP == NULL) { return JDWPTRANSPORT_ERROR_OUT_OF_MEMORY; } diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/share/transport/shmem/shmemBase.c --- a/jdk/src/share/transport/shmem/shmemBase.c Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/share/transport/shmem/shmemBase.c Tue Jul 29 10:18:25 2008 -0700 @@ -167,7 +167,7 @@ msg = (char *)sysTlsGet(tlsIndex); if (msg == NULL) { - msg = (*callback->alloc)(strlen(newmsg)+1); + msg = (*callback->alloc)((int)strlen(newmsg)+1); if (msg != NULL) { strcpy(msg, newmsg); } diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/share/transport/socket/socketTransport.c --- a/jdk/src/share/transport/socket/socketTransport.c Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/share/transport/socket/socketTransport.c Tue Jul 29 10:18:25 2008 -0700 @@ -85,7 +85,8 @@ if (err == JDWPTRANSPORT_ERROR_IO_ERROR) { char *join_str = ": "; - int msg_len = strlen(newmsg) + strlen(join_str) + strlen(buf) + 3; + int msg_len = (int)strlen(newmsg) + (int)strlen(join_str) + + (int)strlen(buf) + 3; msg = (*callback->alloc)(msg_len); if (msg != NULL) { strcpy(msg, newmsg); @@ -93,7 +94,7 @@ strcat(msg, buf); } } else { - msg = (*callback->alloc)(strlen(newmsg)+1); + msg = (*callback->alloc)((int)strlen(newmsg)+1); if (msg != NULL) { strcpy(msg, newmsg); } @@ -153,7 +154,7 @@ } buf = b; buf += received; - n = dbgsysRecv(fd, buf, strlen(hello)-received, 0); + n = dbgsysRecv(fd, buf, (int)strlen(hello)-received, 0); if (n == 0) { setLastError(0, "handshake failed - connection prematurally closed"); return JDWPTRANSPORT_ERROR_IO_ERROR; @@ -179,14 +180,14 @@ } } - if (dbgsysSend(fd, hello, strlen(hello), 0) != (int)strlen(hello)) { + if (dbgsysSend(fd, hello, (int)strlen(hello), 0) != (int)strlen(hello)) { RETURN_IO_ERROR("send failed during handshake"); } return JDWPTRANSPORT_ERROR_NONE; } static jdwpTransportError -parseAddress(const char *address, struct sockaddr_in *sa, UINT32 defaultHost) { +parseAddress(const char *address, struct sockaddr_in *sa, uint32_t defaultHost) { char *colon; memset((void *)sa,0,sizeof(struct sockaddr_in)); @@ -202,9 +203,9 @@ char *buf; char *hostname; u_short port; - UINT32 addr; + uint32_t addr; - buf = (*callback->alloc)(strlen(address)+1); + buf = (*callback->alloc)((int)strlen(address)+1); if (buf == NULL) { RETURN_ERROR(JDWPTRANSPORT_ERROR_OUT_OF_MEMORY, "out of memory"); } @@ -306,7 +307,7 @@ (struct sockaddr *)&sa, &len); portNum = dbgsysNetworkToHostShort(sa.sin_port); sprintf(buf, "%d", portNum); - *actualAddress = (*callback->alloc)(strlen(buf) + 1); + *actualAddress = (*callback->alloc)((int)strlen(buf) + 1); if (*actualAddress == NULL) { RETURN_ERROR(JDWPTRANSPORT_ERROR_OUT_OF_MEMORY, "out of memory"); } else { @@ -679,7 +680,7 @@ if (msg == NULL) { return JDWPTRANSPORT_ERROR_MSG_NOT_AVAILABLE; } - *msgP = (*callback->alloc)(strlen(msg)+1); + *msgP = (*callback->alloc)((int)strlen(msg)+1); if (*msgP == NULL) { return JDWPTRANSPORT_ERROR_OUT_OF_MEMORY; } diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/share/transport/socket/sysSocket.h --- a/jdk/src/share/transport/socket/sysSocket.h Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/share/transport/socket/sysSocket.h Tue Jul 29 10:18:25 2008 -0700 @@ -29,14 +29,6 @@ #include "sys.h" #include "socket_md.h" -#ifdef _LP64 -typedef unsigned int UINT32; -typedef int INT32; -#else /* _LP64 */ -typedef unsigned long UINT32; -typedef long INT32; -#endif /* _LP64 */ - #define DBG_POLLIN 1 #define DBG_POLLOUT 2 @@ -44,7 +36,6 @@ #define DBG_ETIMEOUT -200 int dbgsysSocketClose(int fd); -INT32 dbgsysSocketAvailable(int fd, INT32 *pbytes); int dbgsysConnect(int fd, struct sockaddr *him, int len); int dbgsysFinishConnect(int fd, long timeout); int dbgsysAccept(int fd, struct sockaddr *him, int *len); @@ -52,18 +43,17 @@ int tolen); int dbgsysRecvFrom(int fd, char *buf, int nbytes, int flags, struct sockaddr *from, int *fromlen); -int dbgsysListen(int fd, INT32 count); +int dbgsysListen(int fd, int backlog); int dbgsysRecv(int fd, char *buf, int nBytes, int flags); int dbgsysSend(int fd, char *buf, int nBytes, int flags); -int dbgsysTimeout(int fd, INT32 timeout); struct hostent *dbgsysGetHostByName(char *hostname); int dbgsysSocket(int domain, int type, int protocol); int dbgsysBind(int fd, struct sockaddr *name, int namelen); int dbgsysSetSocketOption(int fd, jint cmd, jboolean on, jvalue value); -UINT32 dbgsysInetAddr(const char* cp); -UINT32 dbgsysHostToNetworkLong(UINT32 hostlong); +uint32_t dbgsysInetAddr(const char* cp); +uint32_t dbgsysHostToNetworkLong(uint32_t hostlong); unsigned short dbgsysHostToNetworkShort(unsigned short hostshort); -UINT32 dbgsysNetworkToHostLong(UINT32 netlong); +uint32_t dbgsysNetworkToHostLong(uint32_t netlong); unsigned short dbgsysNetworkToHostShort(unsigned short netshort); int dbgsysGetSocketName(int fd, struct sockaddr *him, int *len); int dbgsysConfigureBlocking(int fd, jboolean blocking); diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/solaris/classes/sun/nio/ch/DevPollSelectorImpl.java --- a/jdk/src/solaris/classes/sun/nio/ch/DevPollSelectorImpl.java Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/solaris/classes/sun/nio/ch/DevPollSelectorImpl.java Tue Jul 29 10:18:25 2008 -0700 @@ -50,7 +50,7 @@ private int totalChannels; // Maps from file descriptors to keys - private HashMap fdToKey; + private Map fdToKey; // True if this Selector has been closed private boolean closed = false; @@ -71,7 +71,7 @@ fd1 = fdes[1]; pollWrapper = new DevPollArrayWrapper(); pollWrapper.initInterrupt(fd0, fd1); - fdToKey = new HashMap(); + fdToKey = new HashMap(); totalChannels = 1; } @@ -110,8 +110,7 @@ int numKeysUpdated = 0; for (int i=0; i= 0); int fd = ski.channel.getFDVal(); - fdToKey.remove(new Integer(fd)); + fdToKey.remove(Integer.valueOf(fd)); pollWrapper.release(fd); totalChannels--; ski.setIndex(-1); diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/solaris/classes/sun/nio/ch/EPollSelectorImpl.java --- a/jdk/src/solaris/classes/sun/nio/ch/EPollSelectorImpl.java Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/solaris/classes/sun/nio/ch/EPollSelectorImpl.java Tue Jul 29 10:18:25 2008 -0700 @@ -48,7 +48,7 @@ EPollArrayWrapper pollWrapper; // Maps from file descriptors to keys - private HashMap fdToKey; + private Map fdToKey; // True if this Selector has been closed private boolean closed = false; @@ -69,7 +69,7 @@ fd1 = fdes[1]; pollWrapper = new EPollArrayWrapper(); pollWrapper.initInterrupt(fd0, fd1); - fdToKey = new HashMap(); + fdToKey = new HashMap(); } protected int doSelect(long timeout) @@ -107,8 +107,7 @@ int numKeysUpdated = 0; for (int i=0; i= 0); int fd = ski.channel.getFDVal(); - fdToKey.remove(new Integer(fd)); + fdToKey.remove(Integer.valueOf(fd)); pollWrapper.release(fd); ski.setIndex(-1); keys.remove(ski); diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/solaris/native/java/nio/MappedByteBuffer.c --- a/jdk/src/solaris/native/java/nio/MappedByteBuffer.c Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/solaris/native/java/nio/MappedByteBuffer.c Tue Jul 29 10:18:25 2008 -0700 @@ -43,7 +43,11 @@ int result = 0; int i = 0; void *a = (void *) jlong_to_ptr(address); - char * vec = (char *)malloc(numPages * sizeof(char)); +#ifdef __linux__ + unsigned char *vec = (unsigned char *)malloc(numPages * sizeof(char)); +#else + char *vec = (char *)malloc(numPages * sizeof(char)); +#endif if (vec == NULL) { JNU_ThrowOutOfMemoryError(env, NULL); diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/solaris/native/sun/nio/ch/DatagramChannelImpl.c --- a/jdk/src/solaris/native/sun/nio/ch/DatagramChannelImpl.c Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/solaris/native/sun/nio/ch/DatagramChannelImpl.c Tue Jul 29 10:18:25 2008 -0700 @@ -123,7 +123,7 @@ jint fd = fdval(env, fdo); void *buf = (void *)jlong_to_ptr(address); SOCKADDR sa; - int sa_len = SOCKADDR_LEN; + socklen_t sa_len = SOCKADDR_LEN; jboolean retry = JNI_FALSE; jint n = 0; jobject senderAddr; diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/solaris/native/sun/nio/ch/InheritedChannel.c --- a/jdk/src/solaris/native/sun/nio/ch/InheritedChannel.c Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/solaris/native/sun/nio/ch/InheritedChannel.c Tue Jul 29 10:18:25 2008 -0700 @@ -88,7 +88,8 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_InheritedChannel_soType0(JNIEnv *env, jclass cla, jint fd) { - int sotype, arglen=sizeof(sotype); + int sotype; + socklen_t arglen=sizeof(sotype); if (getsockopt(fd, SOL_SOCKET, SO_TYPE, (void *)&sotype, &arglen) == 0) { if (sotype == SOCK_STREAM) return sun_nio_ch_InheritedChannel_SOCK_STREAM; diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/solaris/native/sun/nio/ch/Net.c --- a/jdk/src/solaris/native/sun/nio/ch/Net.c Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/solaris/native/sun/nio/ch/Net.c Tue Jul 29 10:18:25 2008 -0700 @@ -138,7 +138,7 @@ Java_sun_nio_ch_Net_localPort(JNIEnv *env, jclass clazz, jobject fdo) { SOCKADDR sa; - int sa_len = SOCKADDR_LEN; + socklen_t sa_len = SOCKADDR_LEN; if (getsockname(fdval(env, fdo), (struct sockaddr *)&sa, &sa_len) < 0) { handleSocketError(env, errno); return -1; @@ -150,7 +150,7 @@ Java_sun_nio_ch_Net_localInetAddress(JNIEnv *env, jclass clazz, jobject fdo) { SOCKADDR sa; - int sa_len = SOCKADDR_LEN; + socklen_t sa_len = SOCKADDR_LEN; int port; if (getsockname(fdval(env, fdo), (struct sockaddr *)&sa, &sa_len) < 0) { handleSocketError(env, errno); diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/solaris/native/sun/nio/ch/ServerSocketChannelImpl.c --- a/jdk/src/solaris/native/sun/nio/ch/ServerSocketChannelImpl.c Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/solaris/native/sun/nio/ch/ServerSocketChannelImpl.c Tue Jul 29 10:18:25 2008 -0700 @@ -81,12 +81,12 @@ jint ssfd = (*env)->GetIntField(env, ssfdo, fd_fdID); jint newfd; struct sockaddr *sa; - int sa_len; + int alloc_len; jobject remote_ia = 0; jobject isa; jint remote_port; - NET_AllocSockaddr(&sa, &sa_len); + NET_AllocSockaddr(&sa, &alloc_len); /* * accept connection but ignore ECONNABORTED indicating that @@ -94,6 +94,7 @@ * accept() was called. */ for (;;) { + socklen_t sa_len = alloc_len; newfd = accept(ssfd, sa, &sa_len); if (newfd >= 0) { break; diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/solaris/native/sun/nio/ch/SocketChannelImpl.c --- a/jdk/src/solaris/native/sun/nio/ch/SocketChannelImpl.c Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/solaris/native/sun/nio/ch/SocketChannelImpl.c Tue Jul 29 10:18:25 2008 -0700 @@ -55,7 +55,7 @@ jboolean ready) { int error = 0; - int n = sizeof(int); + socklen_t n = sizeof(int); jint fd = fdval(env, fdo); int result = 0; struct pollfd poller; diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/solaris/transport/socket/socket_md.c --- a/jdk/src/solaris/transport/socket/socket_md.c Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/solaris/transport/socket/socket_md.c Tue Jul 29 10:18:25 2008 -0700 @@ -45,8 +45,8 @@ #include "sysSocket.h" int -dbgsysListen(int fd, INT32 count) { - return listen(fd, count); +dbgsysListen(int fd, int backlog) { + return listen(fd, backlog); } int @@ -131,13 +131,13 @@ return bind(fd, name, namelen); } -UINT32 +uint32_t dbgsysInetAddr(const char* cp) { - return (UINT32)inet_addr(cp); + return (uint32_t)inet_addr(cp); } -UINT32 -dbgsysHostToNetworkLong(UINT32 hostlong) { +uint32_t +dbgsysHostToNetworkLong(uint32_t hostlong) { return htonl(hostlong); } @@ -151,8 +151,8 @@ return getsockname(fd, name, namelen); } -UINT32 -dbgsysNetworkToHostLong(UINT32 netlong) { +uint32_t +dbgsysNetworkToHostLong(uint32_t netlong) { return ntohl(netlong); } @@ -163,10 +163,10 @@ if (cmd == TCP_NODELAY) { struct protoent *proto = getprotobyname("TCP"); int tcp_level = (proto == 0 ? IPPROTO_TCP: proto->p_proto); - INT32 onl = (INT32)on; + uint32_t onl = (uint32_t)on; if (setsockopt(fd, tcp_level, TCP_NODELAY, - (char *)&onl, sizeof(INT32)) < 0) { + (char *)&onl, sizeof(uint32_t)) < 0) { return SYS_ERR; } } else if (cmd == SO_LINGER) { diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/windows/classes/sun/nio/ch/PipeImpl.java --- a/jdk/src/windows/classes/sun/nio/ch/PipeImpl.java Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/windows/classes/sun/nio/ch/PipeImpl.java Tue Jul 29 10:18:25 2008 -0700 @@ -67,7 +67,7 @@ } private class Initializer - implements PrivilegedExceptionAction + implements PrivilegedExceptionAction { private final SelectorProvider sp; @@ -76,7 +76,7 @@ this.sp = sp; } - public Object run() throws IOException { + public Void run() throws IOException { ServerSocketChannel ssc = null; SocketChannel sc1 = null; SocketChannel sc2 = null; diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java --- a/jdk/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java Tue Jul 29 10:18:25 2008 -0700 @@ -72,7 +72,7 @@ private int threadsCount = 0; // A list of helper threads for select. - private final List threads = new ArrayList(); + private final List threads = new ArrayList(); //Pipe used as a wakeup object. private final Pipe wakeupPipe; @@ -82,6 +82,7 @@ // Maps file descriptors to their indices in pollArray private final static class FdMap extends HashMap { + static final long serialVersionUID = 0L; private MapEntry get(int desc) { return get(new Integer(desc)); } diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/windows/native/sun/nio/ch/WindowsSelectorImpl.c --- a/jdk/src/windows/native/sun/nio/ch/WindowsSelectorImpl.c Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/windows/native/sun/nio/ch/WindowsSelectorImpl.c Tue Jul 29 10:18:25 2008 -0700 @@ -37,6 +37,7 @@ #include "jni.h" #include "jni_util.h" #include "sun_nio_ch_WindowsSelectorImpl.h" +#include "sun_nio_ch_PollArrayWrapper.h" #include "winsock2.h" @@ -45,10 +46,6 @@ jshort events; } pollfd; -static int POLLIN = 1; -static int POLLCONN = 2; -static int POLLOUT = 4; - #define WAKEUP_SOCKET_BUF_SIZE 16 @@ -82,11 +79,13 @@ /* Set FD_SET structures required for select */ for (i = 0; i < numfds; i++) { - if (fds[i].events & POLLIN) { + if (fds[i].events & sun_nio_ch_PollArrayWrapper_POLLIN) { readfds.fd_array[read_count] = fds[i].fd; read_count++; } - if (fds[i].events & (POLLOUT | POLLCONN)) { + if (fds[i].events & (sun_nio_ch_PollArrayWrapper_POLLOUT | + sun_nio_ch_PollArrayWrapper_POLLCONN)) + { writefds.fd_array[write_count] = fds[i].fd; write_count++; } @@ -111,11 +110,13 @@ /* prepare select structures for the i-th socket */ errreadfds.fd_count = 0; errwritefds.fd_count = 0; - if (fds[i].events & POLLIN) { + if (fds[i].events & sun_nio_ch_PollArrayWrapper_POLLIN) { errreadfds.fd_array[0] = fds[i].fd; errreadfds.fd_count = 1; } - if (fds[i].events & (POLLOUT | POLLCONN)) { + if (fds[i].events & (sun_nio_ch_PollArrayWrapper_POLLOUT | + sun_nio_ch_PollArrayWrapper_POLLCONN)) + { errwritefds.fd_array[0] = fds[i].fd; errwritefds.fd_count = 1; } @@ -187,7 +188,8 @@ jint scoutFd) { /* Write one byte into the pipe */ - send(scoutFd, (char*)&POLLIN, 1, 0); + const char byte = 1; + send(scoutFd, &byte, 1, 0); } JNIEXPORT void JNICALL diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/windows/transport/socket/socket_md.c --- a/jdk/src/windows/transport/socket/socket_md.c Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/windows/transport/socket/socket_md.c Tue Jul 29 10:18:25 2008 -0700 @@ -120,8 +120,8 @@ * function pointer table, but our pointer should still be good. */ int -dbgsysListen(int fd, INT32 count) { - return listen(fd, (int)count); +dbgsysListen(int fd, int backlog) { + return listen(fd, backlog); } int @@ -172,7 +172,7 @@ int dbgsysAccept(int fd, struct sockaddr *name, int *namelen) { - return accept(fd, name, namelen); + return (int)accept(fd, name, namelen); } int @@ -209,7 +209,7 @@ int dbgsysSocket(int domain, int type, int protocol) { - int fd = socket(domain, type, protocol); + int fd = (int)socket(domain, type, protocol); if (fd != SOCKET_ERROR) { SetHandleInformation((HANDLE)(UINT_PTR)fd, HANDLE_FLAG_INHERIT, FALSE); } @@ -229,12 +229,6 @@ return closesocket(fd); } -INT32 -dbgsysSocketAvailable(int fd, INT32 *pbytes) { - u_long arg = (u_long)*pbytes; - return (INT32)ioctlsocket(fd, FIONREAD, &arg); -} - /* Additions to original follow */ int @@ -243,14 +237,14 @@ } -UINT32 +uint32_t dbgsysInetAddr(const char* cp) { - return (UINT32)inet_addr(cp); + return (uint32_t)inet_addr(cp); } -UINT32 -dbgsysHostToNetworkLong(UINT32 hostlong) { - return (UINT32)htonl((u_long)hostlong); +uint32_t +dbgsysHostToNetworkLong(uint32_t hostlong) { + return (uint32_t)htonl((u_long)hostlong); } unsigned short @@ -263,9 +257,9 @@ return getsockname(fd, name, namelen); } -UINT32 -dbgsysNetworkToHostLong(UINT32 netlong) { - return (UINT32)ntohl((u_long)netlong); +uint32_t +dbgsysNetworkToHostLong(uint32_t netlong) { + return (uint32_t)ntohl((u_long)netlong); } /* diff -r 9edd1b9607e2 -r 3322af753f62 jdk/src/windows/transport/socket/socket_md.h --- a/jdk/src/windows/transport/socket/socket_md.h Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/src/windows/transport/socket/socket_md.h Tue Jul 29 10:18:25 2008 -0700 @@ -25,3 +25,6 @@ /* Use its data structures and constants; don't make direct calls */ #include + +#define uint32_t UINT32 + diff -r 9edd1b9607e2 -r 3322af753f62 jdk/test/com/sun/jdi/MonitorFrameInfo.java --- a/jdk/test/com/sun/jdi/MonitorFrameInfo.java Tue Jul 29 09:53:35 2008 -0700 +++ b/jdk/test/com/sun/jdi/MonitorFrameInfo.java Tue Jul 29 10:18:25 2008 -0700 @@ -49,6 +49,7 @@ static void foo2() { Object l1 = new Object(); synchronized(l1) { + System.out.println("executing foo2 " + l1); foo3(); } } @@ -59,6 +60,7 @@ System.out.println("Howdy!"); Object l1 = new Object(); synchronized(l1) { + System.out.println("executing main" + l1); foo1(); } }