changeset 9864:556ea5cd8a78

Merge
author jeff
date Tue, 22 Jul 2014 14:27:47 +0000
parents afca249f60fa 7e51ad50baf4
children cb1d3b7ce0ed
files src/solaris/native/sun/awt/awt_Plugin.c src/solaris/native/sun/awt/awt_Plugin.h
diffstat 21 files changed, 151 insertions(+), 312 deletions(-) [+]
line wrap: on
line diff
--- a/make/Tools.gmk	Mon Jul 21 21:46:56 2014 +0000
+++ b/make/Tools.gmk	Tue Jul 22 14:27:47 2014 +0000
@@ -80,6 +80,7 @@
     build.tools.generatecharacter.CharacterName
 
 TOOL_DTDBUILDER = $(JAVA) -Ddtd_home=$(JDK_TOPDIR)/make/data/dtdbuilder \
+    -Djava.awt.headless=true \
     -cp $(JDK_OUTPUTDIR)/btclasses build.tools.dtdbuilder.DTDBuilder
 
 TOOL_GENERATEBREAKITERATORDATA = $(JAVA) \
--- a/make/lib/Awt2dLibraries.gmk	Mon Jul 21 21:46:56 2014 +0000
+++ b/make/lib/Awt2dLibraries.gmk	Tue Jul 22 14:27:47 2014 +0000
@@ -318,7 +318,7 @@
 endif
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
-  LIBAWT_FILES += awt_LoadLibrary.c img_colors.c
+  LIBAWT_FILES += awt_LoadLibrary.c
   LIBAWT_CFLAGS += -F/System/Library/Frameworks/JavaVM.framework/Frameworks
 endif
 
@@ -611,7 +611,6 @@
         debug_mem.c \
         debug_trace.c \
         debug_util.c \
-        awt_Plugin.c \
         gnome_interface.c \
         gtk2_interface.c \
         swing_GTKEngine.c \
--- a/make/mapfiles/libawt/mapfile-mawt-vers	Mon Jul 21 21:46:56 2014 +0000
+++ b/make/mapfiles/libawt/mapfile-mawt-vers	Tue Jul 22 14:27:47 2014 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2001, 2014, 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
@@ -249,11 +249,6 @@
 		Java_sun_awt_motif_XsessionWMcommand;
 		Java_sun_awt_motif_XsessionWMcommand_New;
 
-		# Java Plugin
-		getAwtLockFunctions;
-		getAwtData;
-		getAwtDisplay;
-
 		# libfontmanager entry points
 		AWTIsHeadless;
 		AWTCountFonts;
--- a/make/mapfiles/libawt/mapfile-vers	Mon Jul 21 21:46:56 2014 +0000
+++ b/make/mapfiles/libawt/mapfile-vers	Tue Jul 22 14:27:47 2014 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2014, 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
@@ -174,13 +174,6 @@
 		Java_sun_awt_motif_XsessionWMcommand;
 		Java_sun_awt_motif_XsessionWMcommand_New;
 
-		# Java Plugin
-                # This is in awt_LoadLibrary.c and falls through to libmawt.
-                # Evidently plugin needs this for backward compatability.
-		getAwtLockFunctions;
-		getAwtData;
-		getAwtDisplay;
-
 		# libfontmanager entry points
 		AWTIsHeadless;
 		GrPrim_Sg2dGetCompInfo;
--- a/make/mapfiles/libawt/mapfile-vers-linux	Mon Jul 21 21:46:56 2014 +0000
+++ b/make/mapfiles/libawt/mapfile-vers-linux	Tue Jul 22 14:27:47 2014 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2002, 2014, 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
@@ -152,13 +152,6 @@
                 # Evidently CDE needs this for backward compatability.
 		Java_sun_awt_motif_XsessionWMcommand;
 
-		# Java Plugin
-                # This is in awt_LoadLibrary.c and falls through to libmawt.
-                # Evidently plugin needs this for backward compatability.
-		getAwtLockFunctions;
-		getAwtData;
-		getAwtDisplay;
-
 		# libfontmanager entry points
 		AWTIsHeadless;
 		GrPrim_Sg2dGetCompInfo;
@@ -283,11 +276,6 @@
 		# CDE private entry point
 		Java_sun_awt_motif_XsessionWMcommand;
 
-		# Java Plugin
-		getAwtLockFunctions;
-		getAwtData;
-		getAwtDisplay;
-
 		# libfontmanager entry points
 		AWTIsHeadless;
 		AWTCountFonts;
--- a/make/mapfiles/libawt_xawt/mapfile-vers	Mon Jul 21 21:46:56 2014 +0000
+++ b/make/mapfiles/libawt_xawt/mapfile-vers	Tue Jul 22 14:27:47 2014 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2002, 2014, 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
@@ -449,12 +449,6 @@
         awt_Lock;
         awt_GetComponent;
 
-        # Java Plugin
-        # This is in awt_LoadLibrary.c and falls through to libmawt.
-        # Evidently plugin needs this for backward compatability.
-        getAwtLockFunctions;
-        getAwtData;
-        getAwtDisplay;
         #XAWT entry point for CDE
         Java_sun_awt_motif_XsessionWMcommand;
         Java_sun_awt_motif_XsessionWMcommand_New;
--- a/src/share/native/sun/awt/image/awt_parseImage.c	Mon Jul 21 21:46:56 2014 +0000
+++ b/src/share/native/sun/awt/image/awt_parseImage.c	Tue Jul 22 14:27:47 2014 +0000
@@ -508,6 +508,7 @@
     cmP->csType = (*env)->GetIntField(env, cmP->jcmodel, g_CMcsTypeID);
 
     cmP->cmType = getColorModelType(env, jcmodel);
+    JNU_CHECK_EXCEPTION_RETURN(env, -1);
 
     cmP->isDefaultCM = FALSE;
     cmP->isDefaultCompatCM = FALSE;
--- a/src/share/native/sun/awt/image/jpeg/imageioJPEG.c	Mon Jul 21 21:46:56 2014 +0000
+++ b/src/share/native/sun/awt/image/jpeg/imageioJPEG.c	Tue Jul 22 14:27:47 2014 +0000
@@ -56,6 +56,12 @@
 #undef MAX
 #define MAX(a,b)        ((a) > (b) ? (a) : (b))
 
+#ifdef __APPLE__
+/* use setjmp/longjmp versions that do not save/restore the signal mask */
+#define setjmp _setjmp
+#define longjmp _longjmp
+#endif
+
 /* Cached Java method ids */
 static jmethodID JPEGImageReader_readInputDataID;
 static jmethodID JPEGImageReader_skipInputBytesID;
--- a/src/share/native/sun/awt/image/jpeg/jpegdecoder.c	Mon Jul 21 21:46:56 2014 +0000
+++ b/src/share/native/sun/awt/image/jpeg/jpegdecoder.c	Tue Jul 22 14:27:47 2014 +0000
@@ -47,6 +47,12 @@
 #include <jpeglib.h>
 #include "jerror.h"
 
+#ifdef __APPLE__
+/* use setjmp/longjmp versions that do not save/restore the signal mask */
+#define setjmp _setjmp
+#define longjmp _longjmp
+#endif
+
 /* The method IDs we cache. Note that the last two belongs to the
  * java.io.InputStream class.
  */
--- a/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c	Mon Jul 21 21:46:56 2014 +0000
+++ b/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c	Tue Jul 22 14:27:47 2014 +0000
@@ -31,6 +31,12 @@
 
 #include <setjmp.h>
 
+#ifdef __APPLE__
+/* use setjmp/longjmp versions that do not save/restore the signal mask */
+#define setjmp _setjmp
+#define longjmp _longjmp
+#endif
+
 /* stream input handling */
 
 typedef struct
--- a/src/share/native/sun/awt/splashscreen/splashscreen_png.c	Mon Jul 21 21:46:56 2014 +0000
+++ b/src/share/native/sun/awt/splashscreen/splashscreen_png.c	Tue Jul 22 14:27:47 2014 +0000
@@ -71,7 +71,12 @@
         goto done;
     }
 
+#ifdef __APPLE__
+    /* use setjmp/longjmp versions that do not save/restore the signal mask */
+    if (_setjmp(png_set_longjmp_fn(png_ptr, _longjmp, sizeof(jmp_buf)))) {
+#else
     if (setjmp(png_jmpbuf(png_ptr))) {
+#endif
         goto done;
     }
 
--- a/src/solaris/native/sun/awt/awt.h	Mon Jul 21 21:46:56 2014 +0000
+++ b/src/solaris/native/sun/awt/awt.h	Tue Jul 22 14:27:47 2014 +0000
@@ -34,9 +34,9 @@
 #include "jni_util.h"
 #include "debug_util.h"
 
-#ifndef HEADLESS
+#if !defined(HEADLESS) && !defined(MACOSX)
 #include <X11/Intrinsic.h>
-#endif /* !HEADLESS */
+#endif /* !HEADLESS && !MACOSX */
 
 
 /* The JVM instance: defined in awt_MToolkit.c */
@@ -110,9 +110,9 @@
 #define AWT_NOTIFY()         AWT_NOTIFY_IMPL()
 #define AWT_NOTIFY_ALL()     AWT_NOTIFY_ALL_IMPL()
 
-#ifndef HEADLESS
+#if !defined(HEADLESS) && !defined(MACOSX)
 extern Display         *awt_display; /* awt_GraphicsEnv.c */
 extern Boolean          awt_ModLockIsShiftLock; /* XToolkit.c */
-#endif /* !HEADLESS */
+#endif /* !HEADLESS && !MACOSX */
 
 #endif /* ! _AWT_ */
--- a/src/solaris/native/sun/awt/awt_LoadLibrary.c	Mon Jul 21 21:46:56 2014 +0000
+++ b/src/solaris/native/sun/awt/awt_LoadLibrary.c	Tue Jul 22 14:27:47 2014 +0000
@@ -35,8 +35,6 @@
 #include <sys/param.h>
 #include <sys/utsname.h>
 
-#include "awt_Plugin.h"
-
 #ifdef AIX
 #include "porting_aix.h" /* For the 'dladdr' function. */
 #endif
@@ -236,55 +234,3 @@
 
     (*XsessionWMcommand)(env, jargv);
 }
-
-
-#define REFLECT_VOID_FUNCTION(name, arglist, paramlist)                 \
-typedef name##_type arglist;                                            \
-void name arglist                                                       \
-{                                                                       \
-    static name##_type *name##_ptr = NULL;                              \
-    if (name##_ptr == NULL && awtHandle == NULL) {                      \
-        return;                                                         \
-    }                                                                   \
-    name##_ptr = (name##_type *)                                        \
-        dlsym(awtHandle, #name);                                        \
-    if (name##_ptr == NULL) {                                           \
-        return;                                                         \
-    }                                                                   \
-    (*name##_ptr)paramlist;                                             \
-}
-
-#define REFLECT_FUNCTION(return_type, name, arglist, paramlist)         \
-typedef return_type name##_type arglist;                                \
-return_type name arglist                                                \
-{                                                                       \
-    static name##_type *name##_ptr = NULL;                              \
-    if (name##_ptr == NULL && awtHandle == NULL) {                      \
-        return NULL;                                                    \
-    }                                                                   \
-    name##_ptr = (name##_type *)                                        \
-        dlsym(awtHandle, #name);                                        \
-    if (name##_ptr == NULL) {                                           \
-        return NULL;                                                    \
-    }                                                                   \
-    return (*name##_ptr)paramlist;                                      \
-}
-
-
-/*
- * These entry point must remain in libawt.so ***for Java Plugin ONLY***
- * Reflect this call over to the correct libawt_<toolkit>.so.
- */
-
-REFLECT_VOID_FUNCTION(getAwtLockFunctions,
-                      (void (**AwtLock)(JNIEnv *), void (**AwtUnlock)(JNIEnv *),
-                       void (**AwtNoFlushUnlock)(JNIEnv *), void *reserved),
-                      (AwtLock, AwtUnlock, AwtNoFlushUnlock, reserved))
-
-REFLECT_VOID_FUNCTION(getAwtData,
-                      (int32_t *awt_depth, Colormap *awt_cmap, Visual **awt_visual,
-                       int32_t *awt_num_colors, void *pReserved),
-                      (awt_depth, awt_cmap, awt_visual,
-                       awt_num_colors, pReserved))
-
-REFLECT_FUNCTION(Display *, getAwtDisplay, (void), ())
--- a/src/solaris/native/sun/awt/awt_Plugin.c	Mon Jul 21 21:46:56 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,149 +0,0 @@
-/*
- * Copyright (c) 1999, 2001, 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.
- */
-
-#ifdef HEADLESS
-    #error This file should not be included in headless library
-#endif
-
-#include <jni.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <awt.h>
-#include <awt_p.h>
-
-/*
- * Fix 4221246: Provide utility function for Netscape to use to
- * get AWT display, depth, colormap, and number of colors.
- *
- */
-
-Display *getAwtDisplay(void)
-{
-  return awt_display;
-}
-
-void getExtAwtData(Display      *display,
-                   int32_t      screen,
-                   int32_t      *awt_depth,
-                   Colormap     *awt_cmap,
-                   Visual       **awt_visual,
-                   int32_t      *awt_num_colors,
-                   void         *pReserved)
-{
-  AwtGraphicsConfigDataPtr defaultConfig = NULL;
-
-#ifdef DEBUG
-  if (pReserved != NULL) {
-    jio_fprintf(stderr,
-                "getExtAwtData: warning: reserved pointer is not null\n");
-  }
-#endif
-
-  if (screen >= 0) {
-    defaultConfig = getDefaultConfig(screen);
-  }
-
-  if (defaultConfig) {
-    if (awt_depth != NULL) {
-      *awt_depth = defaultConfig->awt_depth;
-    }
-
-    if (awt_cmap != NULL) {
-      *awt_cmap = defaultConfig->awt_cmap;
-    }
-
-    if (awt_visual != NULL) {
-      *awt_visual = defaultConfig->awt_visInfo.visual;
-    }
-
-    if (awt_num_colors != NULL) {
-      *awt_num_colors = defaultConfig->awt_num_colors;
-    }
-  }
-}
-
-/*
- * getAwtData provided for compatibility with Solaris 1.2 Java Plug-in
- *
- */
-void getAwtData(int32_t          *awt_depth,
-                Colormap     *awt_cmap,
-                Visual       **awt_visual,
-                int32_t          *awt_num_colors,
-                void         *pReserved)
-{
-  Display *display = getAwtDisplay();
-
-  getExtAwtData(display,
-                DefaultScreen(display),
-                awt_depth,
-                awt_cmap,
-                awt_visual,
-                awt_num_colors,
-                pReserved);
-}
-
-/*
- * Fix 4221246: Provide utility funtion for Netscape to get
- * function pointers to AWT lock functions.
- *
- */
-
-static void awt_lock_wrapper(JNIEnv *env) {
-  AWT_LOCK();
-}
-
-static void awt_unlock_wrapper(JNIEnv *env) {
-  AWT_UNLOCK();
-}
-
-static void awt_noflush_unlock_wrapper(JNIEnv *env) {
-  AWT_NOFLUSH_UNLOCK();
-}
-
-void getAwtLockFunctions(void (**AwtLock)(JNIEnv *),
-                         void (**AwtUnlock)(JNIEnv *),
-                         void (**AwtNoFlushUnlock)(JNIEnv *),
-                         void *pReserved)
-{
-#ifdef DEBUG
-  if (pReserved != NULL) {
-    jio_fprintf(stderr,
-                "getAwtLockFunctions: warning: reserved pointer is not null\n");
-  }
-#endif
-
-  if (AwtLock != NULL) {
-    *AwtLock = awt_lock_wrapper;
-  }
-
-  if (AwtUnlock != NULL) {
-    *AwtUnlock = awt_unlock_wrapper;
-  }
-
-  if (AwtNoFlushUnlock != NULL) {
-    *AwtNoFlushUnlock = awt_noflush_unlock_wrapper;
-  }
-}
--- a/src/solaris/native/sun/awt/awt_Plugin.h	Mon Jul 21 21:46:56 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 1999, 2001, 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.
- */
-
-/*
- * Fix 4221246: Export functions for Netscape to use to get AWT info
- */
-
-#ifndef _AWT_PLUGIN_H_
-#define _AWT_PLUGIN_H_
-
-#include <jni.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-
-void getAwtLockFunctions(void (**AwtLock)(JNIEnv *),
-                         void (**AwtUnlock)(JNIEnv *),
-                         void (**AwtNoFlushUnlock)(JNIEnv *),
-                         void *);
-
-void getExtAwtData(Display *,
-                   int32_t,
-                   int32_t *,      /* awt_depth */
-                   Colormap *,     /* awt_cmap  */
-                   Visual **,      /* awt_visInfo.visual */
-                   int32_t *,      /* awt_num_colors */
-                   void *);
-
-void getAwtData(int32_t *, Colormap *, Visual **, int32_t *, void *);
-
-Display *getAwtDisplay(void);
-
-#endif /* _AWT_PLUGIN_H_ */
--- a/src/solaris/native/sun/awt/color.h	Mon Jul 21 21:46:56 2014 +0000
+++ b/src/solaris/native/sun/awt/color.h	Tue Jul 22 14:27:47 2014 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, 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
@@ -28,13 +28,13 @@
 #include "awt.h"
 #include "colordata.h"
 
-#ifndef HEADLESS
+#if !defined(HEADLESS) && !defined(MACOSX)
 typedef struct {
     unsigned int Depth;
     XPixmapFormatValues wsImageFormat;
     ImgColorData clrdata;
     ImgConvertFcn *convert[NUM_IMGCV];
 } awtImageData;
-#endif /* !HEADLESS */
+#endif /* !HEADLESS && !MACOSX */
 
 #endif           /* _COLOR_H_ */
--- a/src/solaris/native/sun/awt/img_util_md.h	Mon Jul 21 21:46:56 2014 +0000
+++ b/src/solaris/native/sun/awt/img_util_md.h	Tue Jul 22 14:27:47 2014 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, 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
@@ -25,7 +25,7 @@
 
 #include "color.h"
 
-#ifndef HEADLESS
+#if !defined(HEADLESS) && !defined(MACOSX)
 typedef struct {
     ImgConvertData cvdata;      /* The data needed by ImgConvertFcn's */
     struct Hsun_awt_image_ImageRepresentation *hJavaObject;     /* backptr */
@@ -68,7 +68,7 @@
 #define MaskScan(cvdata)                                        \
         ((((IRData *)cvdata)->maskim->bytes_per_line) >> 2)
 
-#endif /* !HEADLESS */
+#endif /* !HEADLESS && !MACOSX */
 
 #define MaskOffset(x)           ((x) >> 5)
 
--- a/src/solaris/native/sun/awt/utility/rect.h	Mon Jul 21 21:46:56 2014 +0000
+++ b/src/solaris/native/sun/awt/utility/rect.h	Tue Jul 22 14:27:47 2014 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2014 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
@@ -28,8 +28,18 @@
 #ifndef _AWT_RECT_H
 #define _AWT_RECT_H
 
+#ifndef MACOSX
 #include <X11/Xlib.h>
 typedef XRectangle RECT_T;
+#else
+// OSX still needs this for BitmapToYXBandedRectangles
+typedef struct {
+    int x;
+    int y;
+    int width;
+    int height;
+} RECT_T;
+#endif /* !MACOSX */
 
 #define RECT_EQ_X(r1,r2)        ((r1).x==(r2).x && (r1).width==(r2).width)
 
--- a/src/solaris/native/sun/java2d/x11/X11PMBlitLoops.c	Mon Jul 21 21:46:56 2014 +0000
+++ b/src/solaris/native/sun/java2d/x11/X11PMBlitLoops.c	Tue Jul 22 14:27:47 2014 +0000
@@ -241,9 +241,12 @@
                                       width, height, 1);
         if (xsdo->bitmask == 0) {
             AWT_UNLOCK();
-            JNU_ThrowOutOfMemoryError(env,
-                                      "Cannot create bitmask for "
-                                      "offscreen surface");
+            if (!(*env)->ExceptionCheck(env))
+            {
+                JNU_ThrowOutOfMemoryError(env,
+                                          "Cannot create bitmask for "
+                                          "offscreen surface");
+            }
             return;
         }
     }
@@ -253,7 +256,10 @@
                          1, XYBitmap, 0, NULL, width, height, 32, 0);
     if (image == NULL) {
         AWT_UNLOCK();
-        JNU_ThrowOutOfMemoryError(env, "Cannot allocate bitmask for mask");
+        if (!(*env)->ExceptionCheck(env))
+        {
+             JNU_ThrowOutOfMemoryError(env, "Cannot allocate bitmask for mask");
+        }
         return;
     }
     dstScan = image->bytes_per_line;
@@ -261,7 +267,10 @@
     if (image->data == NULL) {
         XFree(image);
         AWT_UNLOCK();
-        JNU_ThrowOutOfMemoryError(env, "Cannot allocate bitmask for mask");
+        if (!(*env)->ExceptionCheck(env))
+        {
+            JNU_ThrowOutOfMemoryError(env, "Cannot allocate bitmask for mask");
+        }
         return;
     }
     pDst = (unsigned char *)image->data;
--- a/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	Mon Jul 21 21:46:56 2014 +0000
+++ b/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	Tue Jul 22 14:27:47 2014 +0000
@@ -454,6 +454,7 @@
             AWT_LOCK();
             xsdo->drawable = X11SD_CreateSharedPixmap(xsdo);
             AWT_UNLOCK();
+            JNU_CHECK_EXCEPTION_RETURN(env, JNI_FALSE);
             if (xsdo->drawable) {
                 xsdo->shmPMData.usingShmPixmap = JNI_TRUE;
                 xsdo->shmPMData.shmPixmap = xsdo->drawable;
@@ -469,6 +470,7 @@
                                      xsdo->configData->awt_visInfo.screen),
                           width, height, depth);
         AWT_UNLOCK();
+        JNU_CHECK_EXCEPTION_RETURN(env, JNI_FALSE);
 #ifdef MITSHM
         xsdo->shmPMData.usingShmPixmap = JNI_FALSE;
         xsdo->shmPMData.pixmap = xsdo->drawable;
@@ -504,6 +506,7 @@
 
     if (xsdo->configData->awt_cmap == (Colormap)NULL) {
         awtJNI_CreateColorData(env, xsdo->configData, 1);
+        JNU_CHECK_EXCEPTION(env);
     }
     /* color_data will be initialized in awtJNI_CreateColorData for
        8-bit visuals */
@@ -805,7 +808,10 @@
          xsdo->cData->awt_icmLUT == NULL))
     {
         AWT_UNLOCK();
-        JNU_ThrowNullPointerException(env, "colormap lookup table");
+        if (!(*env)->ExceptionCheck(env))
+        {
+             JNU_ThrowNullPointerException(env, "colormap lookup table");
+        }
         return SD_FAILURE;
     }
     if ((lockflags & SD_LOCK_INVCOLOR) != 0 &&
@@ -816,7 +822,10 @@
          xsdo->cData->img_oda_blue == NULL))
     {
         AWT_UNLOCK();
-        JNU_ThrowNullPointerException(env, "inverse colormap lookup table");
+        if (!(*env)->ExceptionCheck(env))
+        {
+             JNU_ThrowNullPointerException(env, "inverse colormap lookup table");
+        }
         return SD_FAILURE;
     }
     if ((lockflags & SD_LOCK_INVGRAY) != 0 &&
@@ -824,7 +833,10 @@
          xsdo->cData->pGrayInverseLutData == NULL))
     {
         AWT_UNLOCK();
-        JNU_ThrowNullPointerException(env, "inverse gray lookup table");
+        if (!(*env)->ExceptionCheck(env))
+        {
+            JNU_ThrowNullPointerException(env, "inverse gray lookup table");
+        }
         return SD_FAILURE;
     }
     if (xsdo->dgaAvailable && (lockflags & (SD_LOCK_RD_WR))) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/jaxp/validation/8049514/FeaturePropagationTest.java	Tue Jul 22 14:27:47 2014 +0000
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2014, 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.
+ *
+ * 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.
+ */
+
+
+/**
+ * @test
+ * @bug 8049514
+ * @summary verifies that feature set on the factory is propagated properly
+ *          to the validator
+ * @run main/othervm FeaturePropagationTest
+ */
+
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStreamReader;
+import javax.xml.XMLConstants;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.*;
+
+/**
+ * JDK-8049514
+ *
+ * FEATURE_SECURE_PROCESSING can not be turned off on a validator through
+ * SchemaFactory
+ */
+public class FeaturePropagationTest {
+
+    static String xsd = "<?xml version='1.0'?>\n" + "<schema xmlns='http://www.w3.org/2001/XMLSchema'\n"
+            + "        xmlns:test='jaxp13_test'\n"
+            + "        targetNamespace='jaxp13_test'\n"
+            + "        elementFormDefault='qualified'>\n"
+            + "    <element name='test' type='string'/>\n"
+            + "</schema>\n";
+
+    public static void main(String[] args) throws Exception {
+        InputStreamReader reader = new InputStreamReader(new ByteArrayInputStream(xsd.getBytes()));
+        StreamSource xsdSource = new StreamSource(reader);
+
+        SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+        schemaFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false);
+        Schema schema = null;
+        schema = schemaFactory.newSchema(xsdSource);
+
+        Validator validator = schema.newValidator();
+
+        if (validator.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING)) {
+            throw new RuntimeException("Feature set on the factory is not inherited!");
+        }
+
+    }
+}