diff --git a/configure.ac b/configure.ac index 5c79f3cfd3..5adc5774c7 100644 --- a/configure.ac +++ b/configure.ac @@ -452,7 +452,7 @@ if test "x${COMPILE_JNI}" = xyes; then gethostbyname_r localtime_r \ strerror_r \ fcntl \ - statvfs \ + statvfs \ mmap munmap mincore msync madvise getpagesize sysconf \ lstat readlink \ inet_aton inet_addr inet_pton \ diff --git a/java/lang/Thread.java b/java/lang/Thread.java index bc2dbb5b70..cb903fabdd 100644 --- a/java/lang/Thread.java +++ b/java/lang/Thread.java @@ -159,7 +159,7 @@ public class Thread implements Runnable /** Thread local storage. Package accessible for use by * InheritableThreadLocal. */ - final ThreadLocalMap locals; + ThreadLocalMap locals; /** The uncaught exception handler. */ UncaughtExceptionHandler exceptionHandler; @@ -1073,7 +1073,10 @@ synchronized void die() */ static ThreadLocalMap getThreadLocals() { - return currentThread().locals; + Thread t = currentThread(); + if (t.locals == null) + t.locals = new ThreadLocalMap(); + return t.locals; } /** diff --git a/java/net/ResolverCache.java b/java/net/ResolverCache.java index d7e5ed407b..eb8782a6f5 100644 --- a/java/net/ResolverCache.java +++ b/java/net/ResolverCache.java @@ -70,6 +70,17 @@ */ class ResolverCache { + /** + * The cache itself. It is declared before the TTLs: computing them can + * load classes that resolve names, and the cache must exist by then. + */ + private static HashMap cache = new HashMap(); + + /** + * List of entries which may expire. + */ + private static LinkedList killqueue = new LinkedList(); + /** * The time in seconds for which successful lookups are cached. */ @@ -94,16 +105,6 @@ private static int getTTL(String propName, int defaultValue) return Integer.parseInt(propValue); } - /** - * The cache itself. - */ - private static HashMap cache = new HashMap(); - - /** - * List of entries which may expire. - */ - private static LinkedList killqueue = new LinkedList(); - /** * Return the hostname for the specified IP address. * diff --git a/lib/Makefile.am b/lib/Makefile.am index 68fed75648..1933a89900 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -98,6 +98,10 @@ resources: copy-vmresources.sh if ! test -d "$$dirname"; then @mkdir_p@ "$$dirname"; fi; \ cp $(top_srcdir)/resource/$$p $$p; \ done + @list=`cd $(top_srcdir)/resource && $(FIND) META-INF -name \*\.in -print`; for p in $$list; do \ + f=`echo $$p | sed -e 's/\.in$$//'`; \ + if test -f $(top_builddir)/resource/$$f; then cp $(top_builddir)/resource/$$f $$f; fi; \ + done @$(SHELL) ./copy-vmresources.sh @list=`cd $(top_srcdir) && $(FIND) gnu/javax/swing/plaf/gtk/icons -name *.png -type f -print`; for p in $$list; do \ dirname=`dirname $$p`; \