Changeset 309 for trunk/openjdk/jdk/src


Ignore:
Timestamp:
Feb 13, 2012, 10:07:12 PM (14 years ago)
Author:
dmik
Message:

trunk: Merged in openjdk6 b24 from branches/vendor/oracle.

Location:
trunk/openjdk
Files:
74 edited

Legend:

Unmodified
Added
Removed
  • trunk/openjdk

  • trunk/openjdk/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java

    r278 r309  
    11/*
    2  * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
  • trunk/openjdk/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java

    r278 r309  
    11/*
    2  * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
  • trunk/openjdk/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java

    r278 r309  
    11/*
    2  * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
  • trunk/openjdk/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java

    r278 r309  
    11/*
    2  * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
  • trunk/openjdk/jdk/src/share/classes/com/sun/net/ssl/HttpsURLConnection.java

    r278 r309  
    11/*
    2  * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    180180                "no SSLSocketFactory specified");
    181181        }
     182
     183        SecurityManager sm = System.getSecurityManager();
     184        if (sm != null) {
     185            sm.checkSetFactory();
     186        }
     187
    182188        sslSocketFactory = sf;
    183189    }
  • trunk/openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngine.java

    r278 r309  
    11/*
    2  * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    3030import java.lang.reflect.Method;
    3131import java.io.*;
     32import java.security.*;
    3233import java.util.*;
    3334
     
    4647    private static final boolean DEBUG = false;
    4748
     49    private AccessControlContext accCtxt;
     50
    4851    /* Scope where standard JavaScript objects and our
    4952     * extensions to it are stored. Note that these are not
     
    6467    static {
    6568        ContextFactory.initGlobal(new ContextFactory() {
     69            /**
     70             * Create new Context instance to be associated with the current thread.
     71             */
     72            @Override
    6673            protected Context makeContext() {
    6774                Context cx = super.makeContext();
     
    6976                cx.setWrapFactory(RhinoWrapFactory.getInstance());
    7077                return cx;
     78            }
     79
     80
     81            /**
     82             * Execute top call to script or function. When the runtime is about to
     83             * execute a script or function that will create the first stack frame
     84             * with scriptable code, it calls this method to perform the real call.
     85             * In this way execution of any script happens inside this function.
     86             */
     87            @Override
     88            protected Object doTopCall(final Callable callable,
     89                               final Context cx, final Scriptable scope,
     90                               final Scriptable thisObj, final Object[] args) {
     91                AccessControlContext accCtxt = null;
     92                Scriptable global = ScriptableObject.getTopLevelScope(scope);
     93                Scriptable globalProto = global.getPrototype();
     94                if (globalProto instanceof RhinoTopLevel) {
     95                    accCtxt = ((RhinoTopLevel)globalProto).getAccessContext();
     96                }
     97
     98                if (accCtxt != null) {
     99                    return AccessController.doPrivileged(new PrivilegedAction<Object>() {
     100                        public Object run() {
     101                            return superDoTopCall(callable, cx, scope, thisObj, args);
     102                        }
     103                    }, accCtxt);
     104                } else {
     105                    return superDoTopCall(callable, cx, scope, thisObj, args);
     106                }
     107            }
     108
     109            private  Object superDoTopCall(Callable callable,
     110                               Context cx, Scriptable scope,
     111                               Scriptable thisObj, Object[] args) {
     112                return super.doTopCall(callable, cx, scope, thisObj, args);
    71113            }
    72114
     
    87129     */
    88130    public RhinoScriptEngine() {
     131
     132        if (System.getSecurityManager() != null) {
     133            accCtxt = AccessController.getContext();
     134        }
    89135
    90136        Context cx = enterContext();
     
    315361    }
    316362
     363    AccessControlContext getAccessContext() {
     364        return accCtxt;
     365    }
     366
    317367    Object[] wrapArguments(Object[] args) {
    318368        if (args == null) {
  • trunk/openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoTopLevel.java

    r278 r309  
    11/*
    2  * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    4848
    4949    RhinoTopLevel(Context cx, RhinoScriptEngine engine) {
    50         super(cx);
     50        // second boolean parameter to super constructor tells whether
     51        // to seal standard JavaScript objects or not. If security manager
     52        // is present, we seal the standard objects.
     53        super(cx, System.getSecurityManager() != null);
    5154        this.engine = engine;
    5255
     
    165168    }
    166169
     170    AccessControlContext getAccessContext() {
     171        return engine.getAccessContext();
     172    }
     173
    167174    private RhinoScriptEngine engine;
    168175}
  • trunk/openjdk/jdk/src/share/classes/java/awt/AWTEvent.java

    r278 r309  
    11/*
    2  * Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
  • trunk/openjdk/jdk/src/share/classes/java/awt/AWTKeyStroke.java

    r278 r309  
    2626
    2727import java.awt.event.KeyEvent;
     28import sun.awt.AppContext;
    2829import java.awt.event.InputEvent;
    2930import java.util.Collections;
     
    6768    static final long serialVersionUID = -6430539691155161871L;
    6869
    69     private static Map cache;
    70     private static AWTKeyStroke cacheKey;
    71     private static Constructor ctor = getCtor(AWTKeyStroke.class);
    7270    private static Map modifierKeywords;
    7371    /**
     
    7775     */
    7876    private static VKCollection vks;
     77
     78    //A key for the collection of AWTKeyStrokes within AppContext.
     79    private static Object APP_CONTEXT_CACHE_KEY = new Object();
     80    //A key withing the cache
     81    private static AWTKeyStroke APP_CONTEXT_KEYSTROKE_KEY = new AWTKeyStroke();
     82
     83    /*
     84     * Reads keystroke class from AppContext and if null, puts there the
     85     * AWTKeyStroke class.
     86     * Must be called under locked AWTKeyStroke.class
     87     */
     88    private static Class getAWTKeyStrokeClass() {
     89        Class clazz = (Class)AppContext.getAppContext().get(AWTKeyStroke.class);
     90        if (clazz == null) {
     91            clazz = AWTKeyStroke.class;
     92            AppContext.getAppContext().put(AWTKeyStroke.class, AWTKeyStroke.class);
     93        }
     94        return clazz;
     95    }
    7996
    8097    private char keyChar = KeyEvent.CHAR_UNDEFINED;
     
    165182            throw new IllegalArgumentException("subclass cannot be null");
    166183        }
    167         if (AWTKeyStroke.ctor.getDeclaringClass().equals(subclass)) {
    168             // Already registered
    169             return;
     184        synchronized (AWTKeyStroke.class) {
     185            Class keyStrokeClass = (Class)AppContext.getAppContext().get(AWTKeyStroke.class);
     186            if (keyStrokeClass != null && keyStrokeClass.equals(subclass)){
     187                // Already registered
     188                return;
     189            }
    170190        }
    171191        if (!AWTKeyStroke.class.isAssignableFrom(subclass)) {
     
    198218
    199219        synchronized (AWTKeyStroke.class) {
    200             AWTKeyStroke.ctor = ctor;
    201             cache = null;
    202             cacheKey = null;
     220            AppContext.getAppContext().put(AWTKeyStroke.class, subclass);
     221            AppContext.getAppContext().remove(APP_CONTEXT_CACHE_KEY);
     222            AppContext.getAppContext().remove(APP_CONTEXT_KEYSTROKE_KEY);
    203223        }
    204224    }
     
    230250        (char keyChar, int keyCode, int modifiers, boolean onKeyRelease)
    231251    {
     252        Map cache = (Map)AppContext.getAppContext().get(APP_CONTEXT_CACHE_KEY);
     253        AWTKeyStroke cacheKey = (AWTKeyStroke)AppContext.getAppContext().get(APP_CONTEXT_KEYSTROKE_KEY);
     254
    232255        if (cache == null) {
    233256            cache = new HashMap();
     257            AppContext.getAppContext().put(APP_CONTEXT_CACHE_KEY, cache);
    234258        }
    235259
    236260        if (cacheKey == null) {
    237261            try {
    238                 cacheKey = (AWTKeyStroke)ctor.newInstance((Object[]) null);
     262                Class clazz = getAWTKeyStrokeClass();
     263                cacheKey = (AWTKeyStroke)getCtor(clazz).newInstance((Object[]) null);
     264                AppContext.getAppContext().put(APP_CONTEXT_KEYSTROKE_KEY, cacheKey);
    239265            } catch (InstantiationException e) {
    240266                assert(false);
     
    254280            stroke = cacheKey;
    255281            cache.put(stroke, stroke);
    256             cacheKey = null;
    257         }
    258 
     282            AppContext.getAppContext().remove(APP_CONTEXT_KEYSTROKE_KEY);
     283        }
    259284        return stroke;
    260285    }
     
    776801        synchronized (AWTKeyStroke.class) {
    777802            Class newClass = getClass();
    778             if (!newClass.equals(ctor.getDeclaringClass())) {
     803            Class awtKeyStrokeClass = getAWTKeyStrokeClass();
     804            if (!newClass.equals(awtKeyStrokeClass)) {
    779805                registerSubclass(newClass);
    780806            }
  • trunk/openjdk/jdk/src/share/classes/java/awt/Component.java

    r278 r309  
    11/*
    2  * Copyright (c) 1995, 2007, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
  • trunk/openjdk/jdk/src/share/classes/java/awt/EventDispatchThread.java

    r278 r309  
    11/*
    2  * Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
  • trunk/openjdk/jdk/src/share/classes/java/awt/EventQueue.java

    r278 r309  
    11/*
    2  * Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
  • trunk/openjdk/jdk/src/share/classes/java/awt/MenuComponent.java

    r278 r309  
    11/*
    2  * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
  • trunk/openjdk/jdk/src/share/classes/java/awt/TrayIcon.java

    r278 r309  
    11/*
    2  * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
  • trunk/openjdk/jdk/src/share/classes/java/io/InputStream.java

    r278 r309  
    11/*
    2  * Copyright (c) 1994, 2006, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    4545public abstract class InputStream implements Closeable {
    4646
    47     // SKIP_BUFFER_SIZE is used to determine the size of skipBuffer
    48     private static final int SKIP_BUFFER_SIZE = 2048;
    49     // skipBuffer is initialized in skip(long), if needed.
    50     private static byte[] skipBuffer;
     47    // MAX_SKIP_BUFFER_SIZE is used to determine the maximum buffer skip to
     48    // use when skipping.
     49    private static final int MAX_SKIP_BUFFER_SIZE = 2048;
    5150
    5251    /**
     
    213212        long remaining = n;
    214213        int nr;
    215         if (skipBuffer == null)
    216             skipBuffer = new byte[SKIP_BUFFER_SIZE];
    217 
    218         byte[] localSkipBuffer = skipBuffer;
    219214
    220215        if (n <= 0) {
     
    222217        }
    223218
     219        int size = (int)Math.min(MAX_SKIP_BUFFER_SIZE, remaining);
     220        byte[] skipBuffer = new byte[size];
    224221        while (remaining > 0) {
    225             nr = read(localSkipBuffer, 0,
    226                       (int) Math.min(SKIP_BUFFER_SIZE, remaining));
     222            nr = read(skipBuffer, 0, (int)Math.min(size, remaining));
    227223            if (nr < 0) {
    228224                break;
  • trunk/openjdk/jdk/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java

    r278 r309  
    11/*
    2  * Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
  • trunk/openjdk/jdk/src/share/classes/java/net/AbstractPlainSocketImpl.java

    r278 r309  
    11/*
    2  * Copyright (c) 1995, 2007, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
  • trunk/openjdk/jdk/src/share/classes/java/net/NetworkInterface.java

    r278 r309  
    531531            result += " (" + displayName + ")";
    532532        }
    533         result += " index: "+index+" addresses:\n";
    534         for (Enumeration e = getInetAddresses(); e.hasMoreElements(); ) {
    535             InetAddress addr = (InetAddress)e.nextElement();
    536             result += addr+";\n";
    537         }
    538533        return result;
    539534    }
     535
    540536    private static native void init();
    541 
    542537}
  • trunk/openjdk/jdk/src/share/classes/java/security/AccessControlContext.java

    r278 r309  
    11/*
    2  * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
  • trunk/openjdk/jdk/src/share/classes/java/security/SignedObject.java

    r278 r309  
    11/*
    2  * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    250250     */
    251251    private void readObject(java.io.ObjectInputStream s)
    252          throws java.io.IOException, ClassNotFoundException
    253     {
    254         s.defaultReadObject();
    255         content = content.clone();
    256         signature = signature.clone();
     252        throws java.io.IOException, ClassNotFoundException {
     253            java.io.ObjectInputStream.GetField fields = s.readFields();
     254            content = ((byte[])fields.get("content", null)).clone();
     255            signature = ((byte[])fields.get("signature", null)).clone();
     256            thealgorithm = (String)fields.get("thealgorithm", null);
    257257    }
    258258}
  • trunk/openjdk/jdk/src/share/classes/java/sql/Timestamp.java

    r278 r309  
    489489     */
    490490    public int compareTo(Timestamp ts) {
    491         int i = super.compareTo(ts);
     491        long thisTime = this.getTime();
     492        long anotherTime = ts.getTime();
     493        int i = (thisTime<anotherTime ? -1 :(thisTime==anotherTime?0 :1));
    492494        if (i == 0) {
    493495            if (nanos > ts.nanos) {
  • trunk/openjdk/jdk/src/share/classes/javax/net/ssl/HttpsURLConnection.java

    r278 r309  
    11/*
    2  * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    369369        }
    370370
     371        SecurityManager sm = System.getSecurityManager();
     372        if (sm != null) {
     373            sm.checkSetFactory();
     374        }
    371375        sslSocketFactory = sf;
    372376    }
  • trunk/openjdk/jdk/src/share/classes/javax/swing/ImageIcon.java

    r278 r309  
    3737import javax.accessibility.*;
    3838
     39import sun.awt.AppContext;
     40import java.lang.reflect.Field;
     41import java.security.*;
    3942
    4043/**
     
    7679    String description = null;
    7780
    78     protected final static Component component = new Component() {};
    79     protected final static MediaTracker tracker = new MediaTracker(component);
     81   // Fields for twisted backward compatibility only. DO NOT USE.
     82    protected final static Component component;
     83    protected final static MediaTracker tracker;
     84
     85    static {
     86        component = AccessController.doPrivileged(new PrivilegedAction<Component>() {
     87            public Component run() {
     88
     89                try {
     90                    final Component component = createNoPermsComponent();
     91
     92                    // 6482575 - clear the appContext field so as not to leak it
     93                    Field appContextField =
     94
     95                            Component.class.getDeclaredField("appContext");
     96                    appContextField.setAccessible(true);
     97                    appContextField.set(component, null);
     98
     99                    return component;
     100                } catch (Throwable e) {
     101                    // We don't care about component.
     102                    // So don't prevent class initialisation.
     103                    e.printStackTrace();
     104
     105                    return null;
     106                }
     107            }
     108        });
     109        tracker = new MediaTracker(component);
     110    }
     111
     112    private static Component createNoPermsComponent() {
     113        // 7020198 - set acc field to no permissions and no subject
     114        // Note, will have appContext set.
     115        return AccessController.doPrivileged(
     116                new PrivilegedAction<Component>() {
     117                    public Component run() {
     118                        return new Component() {
     119                        };
     120                    }
     121                },
     122                new AccessControlContext(new ProtectionDomain[]{
     123                        new ProtectionDomain(null, null)
     124                })
     125        );
     126    }
    80127
    81128    /**
     
    83130     */
    84131    private static int mediaTrackerID;
     132
     133    private final static Object TRACKER_KEY = new StringBuilder("TRACKER_KEY");
    85134
    86135    int width = -1;
     
    244293     */
    245294    protected void loadImage(Image image) {
    246         synchronized(tracker) {
     295        MediaTracker mTracker = getTracker();
     296        synchronized(mTracker) {
    247297            int id = getNextID();
    248298
    249             tracker.addImage(image, id);
     299            mTracker.addImage(image, id);
    250300            try {
    251                 tracker.waitForID(id, 0);
     301                mTracker.waitForID(id, 0);
    252302            } catch (InterruptedException e) {
    253303                System.out.println("INTERRUPTED while loading Image");
    254304            }
    255             loadStatus = tracker.statusID(id, false);
    256             tracker.removeImage(image, id);
     305            loadStatus = mTracker.statusID(id, false);
     306            mTracker.removeImage(image, id);
    257307
    258308            width = image.getWidth(imageObserver);
     
    265315     */
    266316    private int getNextID() {
    267         synchronized(tracker) {
     317        synchronized(getTracker()) {
    268318            return ++mediaTrackerID;
    269319        }
     320    }
     321
     322    /**
     323     * Returns the MediaTracker for the current AppContext, creating a new
     324     * MediaTracker if necessary.
     325     */
     326    private MediaTracker getTracker() {
     327        Object trackerObj;
     328        AppContext ac = AppContext.getAppContext();
     329        // Opt: Only synchronize if trackerObj comes back null?
     330        // If null, synchronize, re-check for null, and put new tracker
     331        synchronized (ac) {
     332            trackerObj = ac.get(TRACKER_KEY);
     333            if (trackerObj == null) {
     334                Component comp = new Component() {
     335                };
     336                trackerObj = new MediaTracker(comp);
     337                ac.put(TRACKER_KEY, trackerObj);
     338            }
     339        }
     340        return (MediaTracker) trackerObj;
    270341    }
    271342
  • trunk/openjdk/jdk/src/share/classes/javax/swing/Timer.java

    r278 r309  
    11/*
    2  * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
  • trunk/openjdk/jdk/src/share/classes/javax/swing/TransferHandler.java

    r278 r309  
    11/*
    2  * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
  • trunk/openjdk/jdk/src/share/classes/sun/awt/SunToolkit.java

    r278 r309  
    7171    /* Load debug settings for native code */
    7272    static {
    73         String nativeDebug = System.getProperty("sun.awt.nativedebug");
    74         if ("true".equalsIgnoreCase(nativeDebug)) {
     73        if (AccessController.doPrivileged(new GetBooleanAction("sun.awt.nativedebug"))) {
    7574            DebugSettings.init();
    7675        }
  • trunk/openjdk/jdk/src/share/classes/sun/font/FileFont.java

    r278 r309  
    11/*
    2  * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
  • trunk/openjdk/jdk/src/share/classes/sun/font/TrueTypeFont.java

    r278 r309  
    11/*
    2  * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
  • trunk/openjdk/jdk/src/share/classes/sun/font/Type1Font.java

    r278 r309  
    11/*
    2  * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
  • trunk/openjdk/jdk/src/share/classes/sun/java2d/pipe/DrawImage.java

    r278 r309  
    510510         */
    511511        int edges[] = new int[(dy2-dy1)*2+2];
     512        // It is important that edges[0]=edges[1]=0 when we call
     513        // Transform in case it must return early and we would
     514        // not want to render anything on an error condition.
    512515        helper.Transform(tmpmaskblit, srcData, tmpData,
    513516                         AlphaComposite.Src, null,
  • trunk/openjdk/jdk/src/share/classes/sun/misc/FloatingDecimal.java

    r278 r309  
    11/*
    2  * Copyright (c) 1996, 2004, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
  • trunk/openjdk/jdk/src/share/classes/sun/misc/SharedSecrets.java

    r278 r309  
    11/*
    2  * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
  • trunk/openjdk/jdk/src/share/classes/sun/net/ResourceManager.java

    r278 r309  
    4242    /* default maximum number of udp sockets per VM
    4343     * when a security manager is enabled.
    44      * The default is 1024 which is high enough to be useful
     44     * The default is 25 which is high enough to be useful
    4545     * but low enough to be well below the maximum number
    46      * of port numbers actually available on all OSes for
    47      * such sockets (5000 on some versions of windows)
     46     * of port numbers actually available on all OSes
     47     * when multiplied by the maximum feasible number of VM processes
     48     * that could practically be spawned.
    4849     */
    4950
    50     private static final int DEFAULT_MAX_SOCKETS = 1024;
     51    private static final int DEFAULT_MAX_SOCKETS = 25;
    5152    private static final int maxSockets;
    5253    private static final AtomicInteger numSockets;
  • trunk/openjdk/jdk/src/share/classes/sun/nio/ch/DatagramChannelImpl.java

    r278 r309  
    11/*
    2  * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
  • trunk/openjdk/jdk/src/share/classes/sun/nio/ch/Net.java

    r278 r309  
    11/*
    2  * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
  • trunk/openjdk/jdk/src/share/classes/sun/reflect/annotation/AnnotationInvocationHandler.java

    r278 r309  
    11/*
    2  * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    4141 */
    4242class AnnotationInvocationHandler implements InvocationHandler, Serializable {
     43    private static final long serialVersionUID = 6182022883658399397L;
    4344    private final Class type;
    4445    private final Map<String, Object> memberValues;
  • trunk/openjdk/jdk/src/share/classes/sun/reflect/annotation/AnnotationTypeMismatchExceptionProxy.java

    r278 r309  
    11/*
    2  * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    3535 */
    3636class AnnotationTypeMismatchExceptionProxy extends ExceptionProxy {
     37    private static final long serialVersionUID = 7844069490309503934L;
    3738    private Method member;
    3839    private String foundType;
  • trunk/openjdk/jdk/src/share/classes/sun/reflect/annotation/EnumConstantNotPresentExceptionProxy.java

    r278 r309  
    11/*
    2  * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    3434 */
    3535public class EnumConstantNotPresentExceptionProxy extends ExceptionProxy {
     36    private static final long serialVersionUID = -604662101303187330L;
    3637    Class<? extends Enum> enumType;
    3738    String constName;
  • trunk/openjdk/jdk/src/share/classes/sun/reflect/annotation/TypeNotPresentExceptionProxy.java

    r278 r309  
    11/*
    2  * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    3434 */
    3535public class TypeNotPresentExceptionProxy extends ExceptionProxy {
     36    private static final long serialVersionUID = 5565925172427947573L;
    3637    String typeName;
    3738    Throwable cause;
  • trunk/openjdk/jdk/src/share/classes/sun/rmi/registry/RegistryImpl.java

    r278 r309  
    11/*
    2  * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    3939import java.rmi.server.RMIClientSocketFactory;
    4040import java.rmi.server.RMIServerSocketFactory;
     41import java.security.AccessControlContext;
     42import java.security.AccessController;
     43import java.security.CodeSource;
     44import java.security.Policy;
    4145import java.security.PrivilegedActionException;
     46import java.security.PrivilegedExceptionAction;
     47import java.security.PermissionCollection;
     48import java.security.Permissions;
     49import java.security.ProtectionDomain;
    4250import java.text.MessageFormat;
     51import sun.rmi.server.LoaderHandler;
    4352import sun.rmi.server.UnicastServerRef;
    4453import sun.rmi.server.UnicastServerRef2;
     
    4655import sun.rmi.transport.ObjectTable;
    4756import sun.rmi.transport.Target;
     57import sun.security.action.GetPropertyAction;
    4858
    4959/**
     
    325335            ClassLoader cl = new URLClassLoader(urls);
    326336
     337            String codebaseProperty = null;
     338            String prop = java.security.AccessController.doPrivileged(
     339                new GetPropertyAction("java.rmi.server.codebase"));
     340                if (prop != null && prop.trim().length() > 0) {
     341                    codebaseProperty = prop;
     342                }
     343            URL[] codebaseURLs = null;
     344            if (codebaseProperty != null) {
     345                codebaseURLs = sun.misc.URLClassPath.pathToURLs(codebaseProperty);
     346            } else {
     347                codebaseURLs = new URL[0];
     348            }
     349
    327350            /*
    328351             * Fix bugid 4242317: Classes defined by this class loader should
     
    334357            Thread.currentThread().setContextClassLoader(cl);
    335358
    336             int regPort = Registry.REGISTRY_PORT;
    337             if (args.length >= 1) {
    338                 regPort = Integer.parseInt(args[0]);
    339             }
    340             registry = new RegistryImpl(regPort);
     359            final int regPort = (args.length >= 1) ? Integer.parseInt(args[0])
     360                                                   : Registry.REGISTRY_PORT;
     361            try {
     362                registry = AccessController.doPrivileged(
     363                    new PrivilegedExceptionAction<RegistryImpl>() {
     364                        public RegistryImpl run() throws RemoteException {
     365                            return new RegistryImpl(regPort);
     366                        }
     367                    }, getAccessControlContext(codebaseURLs));
     368            } catch (PrivilegedActionException ex) {
     369                throw (RemoteException) ex.getException();
     370            }
     371
    341372            // prevent registry from exiting
    342373            while (true) {
     
    358389        System.exit(1);
    359390    }
     391
     392    /**
     393     * Generates an AccessControlContext from several URLs.
     394     * The approach used here is taken from the similar method
     395     * getAccessControlContext() in the sun.applet.AppletPanel class.
     396     */
     397    private static AccessControlContext getAccessControlContext(URL[] urls) {
     398        // begin with permissions granted to all code in current policy
     399        PermissionCollection perms = AccessController.doPrivileged(
     400            new java.security.PrivilegedAction<PermissionCollection>() {
     401                public PermissionCollection run() {
     402                    CodeSource codesource = new CodeSource(null,
     403                        (java.security.cert.Certificate[]) null);
     404                    Policy p = java.security.Policy.getPolicy();
     405                    if (p != null) {
     406                        return p.getPermissions(codesource);
     407                    } else {
     408                        return new Permissions();
     409                    }
     410                }
     411            });
     412
     413        /*
     414         * Anyone can connect to the registry and the registry can connect
     415         * to and possibly download stubs from anywhere. Downloaded stubs and
     416         * related classes themselves are more tightly limited by RMI.
     417         */
     418        perms.add(new SocketPermission("*", "connect,accept"));
     419
     420        perms.add(new RuntimePermission("accessClassInPackage.sun.*"));
     421
     422        // add permissions required to load from codebase URL path
     423        LoaderHandler.addPermissionsForURLs(urls, perms, false);
     424
     425        /*
     426         * Create an AccessControlContext that consists of a single
     427         * protection domain with only the permissions calculated above.
     428         */
     429        ProtectionDomain pd = new ProtectionDomain(
     430            new CodeSource((urls.length > 0 ? urls[0] : null),
     431                (java.security.cert.Certificate[]) null),
     432            perms);
     433        return new AccessControlContext(new ProtectionDomain[] { pd });
     434    }
    360435}
  • trunk/openjdk/jdk/src/share/classes/sun/rmi/server/LoaderHandler.java

    r278 r309  
    11/*
    2  * Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    10291029     * it is not already implied by the collection.
    10301030     */
    1031     private static void addPermissionsForURLs(URL[] urls,
     1031    public static void addPermissionsForURLs(URL[] urls,
    10321032                                              PermissionCollection perms,
    10331033                                              boolean forLoader)
  • trunk/openjdk/jdk/src/share/classes/sun/rmi/server/UnicastServerRef.java

    r278 r309  
    11/*
    2  * Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    391391            try {
    392392                in = call.getInputStream();
     393                try {
     394                    Class<?> clazz = Class.forName("sun.rmi.transport.DGCImpl_Skel");
     395                    if (clazz.isAssignableFrom(skel.getClass())) {
     396                        ((MarshalInputStream)in).useCodebaseOnly();
     397                    }
     398                } catch (ClassNotFoundException ignore) { }
    393399                hash = in.readLong();
    394400            } catch (Exception readEx) {
  • trunk/openjdk/jdk/src/share/classes/sun/security/jgss/spi/GSSContextSpi.java

    r278 r309  
    2525
    2626/*
    27  * ===========================================================================
    28  *  IBM Confidential
    29  *  OCO Source Materials
    30  *  Licensed Materials - Property of IBM
    3127 *
    3228 *  (C) Copyright IBM Corp. 1999 All Rights Reserved.
    33  *
    34  *  The source code for this program is not published or otherwise divested of
    35  *  its trade secrets, irrespective of what has been deposited with the U.S.
    36  *  Copyright Office.
    37  *
    3829 *  Copyright 1997 The Open Group Research Institute.  All rights reserved.
    39  * ===========================================================================
    40  *
    4130 */
    42 
    4331package sun.security.jgss.spi;
    4432
  • trunk/openjdk/jdk/src/share/classes/sun/security/jgss/spnego/NegTokenInit.java

    r278 r309  
    11/*
    2  * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    6767    private Oid[] mechTypeList = null;
    6868
    69     private byte[] reqFlags = null;
     69    private BitArray reqFlags = null;
    7070    private byte[] mechToken = null;
    7171    private byte[] mechListMIC = null;
    7272
    73     NegTokenInit(byte[] mechTypes, byte[] flags,
     73    NegTokenInit(byte[] mechTypes, BitArray flags,
    7474                byte[] token, byte[] mechListMIC)
    7575    {
     
    102102            if (reqFlags != null) {
    103103                DerOutputStream flags = new DerOutputStream();
    104                 flags.putBitString(reqFlags);
     104                flags.putUnalignedBitString(reqFlags);
    105105                initToken.write(DerValue.createTag(DerValue.TAG_CONTEXT,
    106106                                                true, (byte) 0x01), flags);
     
    238238    }
    239239
    240     byte[] getReqFlags() {
     240    BitArray getReqFlags() {
    241241        return reqFlags;
    242242    }
  • trunk/openjdk/jdk/src/share/classes/sun/security/jgss/spnego/SpNegoContext.java

    r278 r309  
    11/*
    2  * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    5454    private int state = STATE_NEW;
    5555
    56     private static final int CHECKSUM_DELEG_FLAG    = 1;
    57     private static final int CHECKSUM_MUTUAL_FLAG   = 2;
    58     private static final int CHECKSUM_REPLAY_FLAG   = 4;
    59     private static final int CHECKSUM_SEQUENCE_FLAG = 8;
    60     private static final int CHECKSUM_CONF_FLAG     = 16;
    61     private static final int CHECKSUM_INTEG_FLAG    = 32;
    62 
    6356    /*
    6457     * Optional features that the application can set and their default
     
    701694     * get the context flags
    702695     */
    703     private byte[] getContextFlags() {
    704         int flags = 0;
    705 
    706         if (getCredDelegState())
    707             flags |= CHECKSUM_DELEG_FLAG;
    708         if (getMutualAuthState())
    709             flags |= CHECKSUM_MUTUAL_FLAG;
    710         if (getReplayDetState())
    711             flags |= CHECKSUM_REPLAY_FLAG;
    712         if (getSequenceDetState())
    713             flags |= CHECKSUM_SEQUENCE_FLAG;
    714         if (getIntegState())
    715             flags |= CHECKSUM_INTEG_FLAG;
    716         if (getConfState())
    717             flags |= CHECKSUM_CONF_FLAG;
    718 
    719         byte[] temp = new byte[1];
    720         temp[0] = (byte)(flags & 0xff);
    721         return temp;
     696    private BitArray getContextFlags() {
     697        BitArray out = new BitArray(7);
     698
     699        if (getCredDelegState()) out.set(0, true);
     700        if (getMutualAuthState()) out.set(1, true);
     701        if (getReplayDetState()) out.set(2, true);
     702        if (getSequenceDetState()) out.set(3, true);
     703        if (getConfState()) out.set(5, true);
     704        if (getIntegState()) out.set(6, true);
     705
     706        return out;
    722707    }
    723708
  • trunk/openjdk/jdk/src/share/classes/sun/security/krb5/internal/ccache/CCacheInputStream.java

    r278 r309  
    248248    }
    249249
    250     Ticket readData() throws IOException, RealmException, KrbApErrException, Asn1Exception {
     250    byte[] readData() throws IOException {
    251251        int length;
    252252        length = read(4);
    253         if (length > 0) {
     253        if (length == 0) {
     254            return null;
     255        } else {
    254256            byte[] bytes = new byte[length];
    255257            read(bytes, 0, length);
    256             Ticket ticket = new Ticket(bytes);
    257             return ticket;
    258         }
    259         else return null;
     258            return bytes;
     259        }
    260260    }
    261261
     
    326326        return flags;
    327327    }
     328
     329    /**
     330     * Reads the next cred in stream.
     331     * @return the next cred, null if ticket or second_ticket unparseable.
     332     *
     333     * Note: MIT krb5 1.8.1 might generate a config entry with server principal
     334     * X-CACHECONF:/krb5_ccache_conf_data/fast_avail/krbtgt/REALM@REALM. The
     335     * entry is used by KDC to inform the client that it support certain
     336     * features. Its ticket is not a valid krb5 ticket and thus this method
     337     * returns null.
     338     */
    328339    Credentials readCred(int version) throws IOException,RealmException, KrbApErrException, Asn1Exception {
    329340        PrincipalName cpname = readPrincipal(version);
     
    361372            auData = new AuthorizationData(auDataEntry);
    362373        }
    363         Ticket ticket = readData();
    364         if (DEBUG) {
    365             System.out.println(">>>DEBUG <CCacheInputStream>");
    366             if (ticket == null) {
    367                 System.out.println("///ticket is null");
    368             }
    369         }
    370         Ticket secTicket = readData();
    371         Credentials cred = new Credentials(cpname, spname, key, authtime, starttime,
    372                                            endtime, renewTill, skey, tFlags,
    373                                            addrs, auData, ticket, secTicket);
    374         return cred;
     374        byte[] ticketData = readData();
     375        byte[] ticketData2 = readData();
     376
     377        try {
     378            return new Credentials(cpname, spname, key, authtime, starttime,
     379                endtime, renewTill, skey, tFlags,
     380                addrs, auData,
     381                ticketData != null ? new Ticket(ticketData) : null,
     382                ticketData2 != null ? new Ticket(ticketData2) : null);
     383        } catch (Exception e) {     // If any of new Ticket(*) fails.
     384            return null;
     385        }
    375386    }
    376387}
  • trunk/openjdk/jdk/src/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java

    r278 r309  
    11/*
    2  * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    187187        credentialsList = new Vector<Credentials> ();
    188188        while (cis.available() > 0) {
    189             credentialsList.addElement(cis.readCred(version));
     189            Credentials cred = cis.readCred(version);
     190            if (cred != null) {
     191                credentialsList.addElement(cred);
     192            }
    190193        }
    191194        cis.close();
  • trunk/openjdk/jdk/src/share/classes/sun/security/provider/SeedGenerator.java

    r278 r309  
    11/*
    2  * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    136136    }
    137137
    138     void getSeedBytes(byte[] result) {
    139         for (int i = 0; i < result.length; i++) {
    140           result[i] = getSeedByte();
    141         }
    142     }
    143 
    144     abstract byte getSeedByte();
     138    abstract void getSeedBytes(byte[] result);
    145139
    146140    /**
     
    337331            }
    338332        }
     333
     334        @Override
     335        void getSeedBytes(byte[] result) {
     336            for (int i = 0; i < result.length; i++) {
     337                result[i] = getSeedByte();
     338            }
     339        }
    339340
    340341        byte getSeedByte() {
     
    424425
    425426        private String deviceName;
    426         private BufferedInputStream devRandom;
    427 
     427        private InputStream devRandom;
    428428
    429429        /**
     
    447447        private void init() throws IOException {
    448448            final URL device = new URL(deviceName);
    449             devRandom = java.security.AccessController.doPrivileged
    450                 (new java.security.PrivilegedAction<BufferedInputStream>() {
    451                         public BufferedInputStream run() {
    452                             try {
    453                                 return new BufferedInputStream(device.openStream());
    454                             } catch (IOException ioe) {
    455                                 return null;
     449            try {
     450                devRandom = java.security.AccessController.doPrivileged
     451                    (new java.security.PrivilegedExceptionAction<InputStream>() {
     452                        public InputStream run() throws IOException {
     453                            /*
     454                             * return a FileInputStream for file URLs and
     455                             * avoid buffering. The openStream() call wraps
     456                             * InputStream in a BufferedInputStream which
     457                             * can buffer up to 8K bytes. This read is a
     458                             * performance issue for entropy sources which
     459                             * can be slow to replenish.
     460                             */
     461                            if (device.getProtocol().equalsIgnoreCase("file")) {
     462                                File deviceFile = getDeviceFile(device);
     463                                return new FileInputStream(deviceFile);
     464                            } else {
     465                                return device.openStream();
    456466                            }
    457467                        }
    458468                    });
    459 
    460             if (devRandom == null) {
    461                 throw new IOException("failed to open " + device);
    462             }
    463         }
    464 
    465         byte getSeedByte() {
    466             byte b[] = new byte[1];
    467             int stat;
    468             try {
    469                 stat = devRandom.read(b, 0, b.length);
     469            } catch (Exception e) {
     470                throw new IOException("Failed to open " + deviceName, e.getCause());
     471            }
     472        }
     473
     474        /*
     475         * Use a URI to access this File. Previous code used a URL
     476         * which is less strict on syntax. If we encounter a
     477         * URISyntaxException we make best efforts for backwards
     478         * compatibility. e.g. space character in deviceName string.
     479         *
     480         * Method called within PrivilegedExceptionAction block.
     481         */
     482        private File getDeviceFile(URL device) throws IOException {
     483            try {
     484                URI deviceURI = device.toURI();
     485                if(deviceURI.isOpaque()) {
     486                    // File constructor does not accept opaque URI
     487                    URI localDir = new File(System.getProperty("user.dir")).toURI();
     488                    String uriPath = localDir.toString() +
     489                                         deviceURI.toString().substring(5);
     490                    return new File(URI.create(uriPath));
     491                } else {
     492                    return new File(deviceURI);
     493                }
     494            } catch (URISyntaxException use) {
     495                /*
     496                 * Make best effort to access this File.
     497                 * We can try using the URL path.
     498                 */
     499                return new File(device.getPath());
     500            }
     501        }
     502
     503        @Override
     504        void getSeedBytes(byte[] result) {
     505            int len = result.length;
     506            int read = 0;
     507            try {
     508                while (read < len) {
     509                    int count = devRandom.read(result, read, len - read);
     510                    // /dev/random blocks - should never have EOF
     511                    if (count < 0)
     512                        throw new InternalError("URLSeedGenerator " + deviceName +
     513                                        " reached end of file");
     514                    read += count;
     515                }
    470516            } catch (IOException ioe) {
    471517                throw new InternalError("URLSeedGenerator " + deviceName +
     
    473519                                        ioe.getMessage());
    474520            }
    475             if (stat == b.length) {
    476                 return b[0];
    477             } else if (stat == -1) {
    478                 throw new InternalError("URLSeedGenerator " + deviceName +
    479                                            " reached end of file");
    480             } else {
    481                 throw new InternalError("URLSeedGenerator " + deviceName +
    482                                            " failed read");
    483             }
    484         }
    485 
     521        }
    486522    }
    487523
  • trunk/openjdk/jdk/src/share/classes/sun/security/ssl/AppOutputStream.java

    r278 r309  
    11/*
    2  * Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 1996, 20111 Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    6161        // check if the Socket is invalid (error or closed)
    6262        c.checkWrite();
    63         //
    64         // Always flush at the end of each application level record.
    65         // This lets application synchronize read and write streams
    66         // however they like; if we buffered here, they couldn't.
    67         //
    68         // NOTE: *must* call c.writeRecord() even for len == 0
     63
     64        /*
     65         * By default, we counter chosen plaintext issues on CBC mode
     66         * ciphersuites in SSLv3/TLS1.0 by sending one byte of application
     67         * data in the first record of every payload, and the rest in
     68         * subsequent record(s). Note that the issues have been solved in
     69         * TLS 1.1 or later.
     70         *
     71         * It is not necessary to split the very first application record of
     72         * a freshly negotiated TLS session, as there is no previous
     73         * application data to guess.  To improve compatibility, we will not
     74         * split such records.
     75         *
     76         * This avoids issues in the outbound direction.  For a full fix,
     77         * the peer must have similar protections.
     78         */
     79        boolean isFirstRecordOfThePayload = true;
     80
     81        /*
     82         * Always flush at the end of each application level record.
     83         * This lets application synchronize read and write streams
     84         * however they like; if we buffered here, they couldn't.
     85         *
     86         * NOTE: *must* call c.writeRecord() even for len == 0
     87         */
     88
    6989        try {
    7090            do {
    71                 int howmuch = Math.min(len, r.availableDataBytes());
     91                int howmuch;
     92                if (isFirstRecordOfThePayload && c.needToSplitPayload()) {
     93                    howmuch = Math.min(0x01, r.availableDataBytes());
     94                } else {
     95                    howmuch = Math.min(len, r.availableDataBytes());
     96                }
     97
     98                if (isFirstRecordOfThePayload && howmuch != 0) {
     99                    isFirstRecordOfThePayload = false;
     100                }
    72101
    73102                if (howmuch > 0) {
  • trunk/openjdk/jdk/src/share/classes/sun/security/ssl/CipherBox.java

    r278 r309  
    11/*
    2  * Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    7777
    7878    /**
     79     * Is the cipher of CBC mode?
     80     */
     81     private final boolean isCBCMode;
     82
     83    /**
    7984     * NULL cipherbox. Identity operation, no encryption.
    8085     */
     
    8287        this.protocolVersion = ProtocolVersion.DEFAULT;
    8388        this.cipher = null;
     89        this.isCBCMode = false;
    8490    }
    8591
     
    97103            this.cipher = JsseJce.getCipher(bulkCipher.transformation);
    98104            int mode = encrypt ? Cipher.ENCRYPT_MODE : Cipher.DECRYPT_MODE;
     105            this.isCBCMode = bulkCipher.isCBCMode;
    99106            cipher.init(mode, key, iv);
    100107            // do not call getBlockSize until after init()
     
    487494        return newlen;
    488495    }
     496
     497    /*
     498     * Does the cipher use CBC mode?
     499     *
     500     * @return true if the cipher use CBC mode, false otherwise.
     501     */
     502    boolean isCBCMode() {
     503        return isCBCMode;
     504    }
    489505}
  • trunk/openjdk/jdk/src/share/classes/sun/security/ssl/CipherSuite.java

    r278 r309  
    11/*
    2  * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    341341        final boolean exportable;
    342342
     343        // Is the cipher algorithm of Cipher Block Chaining (CBC) mode?
     344        final boolean isCBCMode;
     345
    343346        BulkCipher(String transformation, int keySize,
    344347                int expandedKeySize, int ivSize, boolean allowed) {
    345348            this.transformation = transformation;
    346             this.algorithm = transformation.split("/")[0];
     349            String[] splits = transformation.split("/");
     350            this.algorithm = splits[0];
     351            this.isCBCMode =
     352                splits.length <= 1 ? false : "CBC".equalsIgnoreCase(splits[1]);
    347353            this.description = this.algorithm + "/" + (keySize << 3);
    348354            this.keySize = keySize;
     
    357363                int ivSize, boolean allowed) {
    358364            this.transformation = transformation;
    359             this.algorithm = transformation.split("/")[0];
     365            String[] splits = transformation.split("/");
     366            this.algorithm = splits[0];
     367            this.isCBCMode =
     368                splits.length <= 1 ? false : "CBC".equalsIgnoreCase(splits[1]);
    360369            this.description = this.algorithm + "/" + (keySize << 3);
    361370            this.keySize = keySize;
  • trunk/openjdk/jdk/src/share/classes/sun/security/ssl/EngineOutputRecord.java

    r278 r309  
    11/*
    2  * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    4747final class EngineOutputRecord extends OutputRecord {
    4848
     49    private SSLEngineImpl engine;
    4950    private EngineWriter writer;
    5051
     
    6364    EngineOutputRecord(byte type, SSLEngineImpl engine) {
    6465        super(type, recordSize(type));
     66        this.engine = engine;
    6567        writer = engine.writer;
    6668    }
     
    228230         * records, so this increases robustness.
    229231         */
    230         int length = Math.min(ea.getAppRemaining(), maxDataSize);
    231         if (length == 0) {
     232        if (ea.getAppRemaining() == 0) {
    232233            return;
    233234        }
    234235
     236        /*
     237         * By default, we counter chosen plaintext issues on CBC mode
     238         * ciphersuites in SSLv3/TLS1.0 by sending one byte of application
     239         * data in the first record of every payload, and the rest in
     240         * subsequent record(s). Note that the issues have been solved in
     241         * TLS 1.1 or later.
     242         *
     243         * It is not necessary to split the very first application record of
     244         * a freshly negotiated TLS session, as there is no previous
     245         * application data to guess.  To improve compatibility, we will not
     246         * split such records.
     247         *
     248         * Because of the compatibility, we'd better produce no more than
     249         * SSLSession.getPacketBufferSize() net data for each wrap. As we
     250         * need a one-byte record at first, the 2nd record size should be
     251         * equal to or less than Record.maxDataSizeMinusOneByteRecord.
     252         *
     253         * This avoids issues in the outbound direction.  For a full fix,
     254         * the peer must have similar protections.
     255         */
     256        int length;
     257        if (engine.needToSplitPayload(writeCipher, protocolVersion)) {
     258            write(ea, writeMAC, writeCipher, 0x01);
     259            ea.resetLim();      // reset application data buffer limit
     260            length = Math.min(ea.getAppRemaining(),
     261                        maxDataSizeMinusOneByteRecord);
     262        } else {
     263            length = Math.min(ea.getAppRemaining(), maxDataSize);
     264        }
     265
     266        // Don't bother to really write empty records.
     267        if (length > 0) {
     268            write(ea, writeMAC, writeCipher, length);
     269        }
     270
     271        return;
     272    }
     273
     274    void write(EngineArgs ea, MAC writeMAC, CipherBox writeCipher,
     275            int length) throws IOException {
    235276        /*
    236277         * Copy out existing buffer values.
  • trunk/openjdk/jdk/src/share/classes/sun/security/ssl/Record.java

    r278 r309  
    11/*
    2  * Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    6666                                    + trailerSize;      // MAC
    6767
     68    static final boolean enableCBCProtection =
     69            Debug.getBooleanProperty("jsse.enableCBCProtection", true);
     70
     71    /*
     72     * For CBC protection in SSL3/TLS1, we break some plaintext into two
     73     * packets.  Max application data size for the second packet.
     74     */
     75    static final int    maxDataSizeMinusOneByteRecord =
     76                                  maxDataSize       // max data size
     77                                - (                 // max one byte record size
     78                                      headerSize    // header
     79                                    + 1             // one byte data
     80                                    + maxPadding    // padding
     81                                    + trailerSize   // MAC
     82                                  );
     83
    6884    /*
    6985     * The maximum large record size.
  • trunk/openjdk/jdk/src/share/classes/sun/security/ssl/SSLEngineImpl.java

    r278 r309  
    11/*
    2  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    307307
    308308    /*
     309     * Is it the first application record to write?
     310     */
     311    private boolean isFirstAppOutputRecord = true;
     312
     313    /*
    309314     * Class and subclass dynamic debugging support
    310315     */
     
    596601                                ("Algorithm missing:  ").initCause(e);
    597602        }
     603
     604        // reset the flag of the first application record
     605        isFirstAppOutputRecord = true;
    598606    }
    599607
     
    12131221
    12141222        // eventually compress as well.
    1215         return writer.writeRecord(eor, ea, writeMAC, writeCipher);
     1223        HandshakeStatus hsStatus =
     1224                writer.writeRecord(eor, ea, writeMAC, writeCipher);
     1225
     1226        /*
     1227         * turn off the flag of the first application record if we really
     1228         * consumed at least byte.
     1229         */
     1230        if (isFirstAppOutputRecord && ea.deltaApp() > 0) {
     1231            isFirstAppOutputRecord = false;
     1232        }
     1233
     1234        return hsStatus;
     1235    }
     1236
     1237    /*
     1238     * Need to split the payload except the following cases:
     1239     *
     1240     * 1. protocol version is TLS 1.1 or later;
     1241     * 2. bulk cipher does not use CBC mode, including null bulk cipher suites.
     1242     * 3. the payload is the first application record of a freshly
     1243     *    negotiated TLS session.
     1244     * 4. the CBC protection is disabled;
     1245     *
     1246     * More details, please refer to
     1247     * EngineOutputRecord.write(EngineArgs, MAC, CipherBox).
     1248     */
     1249    boolean needToSplitPayload(CipherBox cipher, ProtocolVersion protocol) {
     1250        return (protocol.v <= ProtocolVersion.TLS10.v) &&
     1251                cipher.isCBCMode() && !isFirstAppOutputRecord &&
     1252                Record.enableCBCProtection;
    12161253    }
    12171254
  • trunk/openjdk/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java

    r278 r309  
    11/*
    2  * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    359359    private static final Debug debug = Debug.getInstance("ssl");
    360360
     361    /*
     362     * Is it the first application record to write?
     363     */
     364    private boolean isFirstAppOutputRecord = true;
     365
    361366    //
    362367    // CONSTRUCTORS AND INITIALIZATION CODE
     
    762767        r.encrypt(writeCipher);
    763768        r.write(sockOutput);
    764     }
    765 
     769
     770        // turn off the flag of the first application record
     771        if (isFirstAppOutputRecord &&
     772                r.contentType() == Record.ct_application_data) {
     773            isFirstAppOutputRecord = false;
     774        }
     775    }
     776 
     777    /*
     778     * Need to split the payload except the following cases:
     779     *
     780     * 1. protocol version is TLS 1.1 or later;
     781     * 2. bulk cipher does not use CBC mode, including null bulk cipher suites.
     782     * 3. the payload is the first application record of a freshly
     783     *    negotiated TLS session.
     784     * 4. the CBC protection is disabled;
     785     *
     786     * More details, please refer to AppOutputStream.write(byte[], int, int).
     787     */
     788    boolean needToSplitPayload() {
     789        writeLock.lock();
     790        try {
     791            return (protocolVersion.v <= ProtocolVersion.TLS10.v) &&
     792                    writeCipher.isCBCMode() && !isFirstAppOutputRecord &&
     793                    Record.enableCBCProtection;
     794        } finally {
     795            writeLock.unlock();
     796        }
     797    }
    766798
    767799    /*
     
    18301862                                ("Algorithm missing:  ").initCause(e);
    18311863        }
     1864
     1865        // reset the flag of the first application record
     1866        isFirstAppOutputRecord = true;
    18321867    }
    18331868
  • trunk/openjdk/jdk/src/share/classes/sun/security/validator/EndEntityChecker.java

    r278 r309  
    11/*
    2  * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
  • trunk/openjdk/jdk/src/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java

    r278 r309  
    11/*
    2  * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    2525package sun.swing.table;
    2626
     27import sun.swing.DefaultLookup;
     28
    2729import java.awt.Component;
    2830import java.awt.Color;
     
    3234import java.awt.Point;
    3335import java.awt.Rectangle;
     36import java.io.Serializable;
    3437import javax.swing.*;
    3538import javax.swing.plaf.UIResource;
    3639import javax.swing.border.Border;
    3740import javax.swing.table.*;
    38 import sun.swing.DefaultLookup;
    39 
    4041
    4142public class DefaultTableCellHeaderRenderer extends DefaultTableCellRenderer
     
    187188    }
    188189
    189     private class EmptyIcon implements Icon {
     190    private class EmptyIcon implements Icon, Serializable {
    190191        int width = 0;
    191192        int height = 0;
  • trunk/openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp

    r278 r309  
    11/*
    2  * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    10891089    if (suffix == 0)  continue;  // done with empty string
    10901090    chars.malloc(size3);
     1091    CHECK;
    10911092    byte* chp = chars.ptr;
    10921093    band saved_band = cp_Utf8_big_chars;
    10931094    cp_Utf8_big_chars.readData(suffix);
     1095    CHECK;
    10941096    for (int j = 0; j < suffix; j++) {
    10951097      unsigned short ch = cp_Utf8_big_chars.getInt();
     1098      CHECK;
    10961099      chp = store_Utf8_char(chp, ch);
    10971100    }
     
    11111114  int prevlen = 0;  // previous string length (in chars)
    11121115  tmallocs.add(bigbuf.ptr);  // free after this block
     1116  CHECK;
    11131117  cp_Utf8_prefix.rewind();
    11141118  for (i = 0; i < len; i++) {
    11151119    bytes& chars = allsuffixes[i];
    11161120    int prefix = (i < PREFIX_SKIP_2)? 0: cp_Utf8_prefix.getInt();
     1121    CHECK;
    11171122    int suffix = chars.len;
    11181123    byte* fillp;
  • trunk/openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/utils.cpp

    r278 r309  
    11/*
    2  * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    5353    msize = sizeof(int);  // see 0xbaadf00d below
    5454  #endif
    55   void* ptr = (msize > PSIZE_MAX) ? null : malloc(msize);
     55  void* ptr = (msize > PSIZE_MAX || msize <= 0) ? null : malloc(msize);
    5656  if (ptr != null) {
    5757    memset(ptr, 0, size);
  • trunk/openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/utils.h

    r278 r309  
    11/*
    2  * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    3434
    3535// overflow management
    36 #define OVERFLOW ((size_t)-1)
     36#define OVERFLOW ((uint)-1)
    3737#define PSIZE_MAX (OVERFLOW/2)  /* normal size limit */
    3838
  • trunk/openjdk/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c

    r278 r309  
    4141#include <assert.h>
    4242#include <string.h>
     43#include <limits.h>
    4344
    4445
     
    19221923
    19231924    // Allocate a 1-scanline buffer
     1925    if (cinfo->num_components <= 0 ||
     1926        cinfo->image_width > (UINT_MAX / (unsigned int)cinfo->num_components))
     1927    {
     1928        RELEASE_ARRAYS(env, data, src->next_input_byte);
     1929        JNU_ThrowByName(env, "javax/imageio/IIOException",
     1930                        "Invalid number of color components");
     1931        return data->abortFlag;
     1932    }
    19241933    scanLinePtr = (JSAMPROW)malloc(cinfo->image_width*cinfo->num_components);
    19251934    if (scanLinePtr == NULL) {
  • trunk/openjdk/jdk/src/share/native/sun/font/layout/SunLayoutEngine.cpp

    r278 r309  
    187187  jchar* chars = buffer;
    188188  if (len > 256) {
    189     chars = (jchar*)malloc(len * sizeof(jchar));
     189    size_t size = len * sizeof(jchar);
     190    if (size / sizeof(jchar) != len) {
     191      return;
     192    }
     193    chars = (jchar*)malloc(size);
    190194    if (chars == 0) {
    191195      return;
  • trunk/openjdk/jdk/src/share/native/sun/java2d/loops/TransformHelper.c

    r278 r309  
    11/*
    2  * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    7676
    7777/*
     78 * The dxydxy parameters of the inverse transform determine how
     79 * quickly we step through the source image.  For tiny scale
     80 * factors (on the order of 1E-16 or so) the stepping distances
     81 * are huge.  The image has been scaled so small that stepping
     82 * a single pixel in device space moves the sampling point by
     83 * billions (or more) pixels in the source image space.  These
     84 * huge stepping values can overflow the whole part of the longs
     85 * we use for the fixed point stepping equations and so we need
     86 * a more robust solution.  We could simply iterate over every
     87 * device pixel, use the inverse transform to transform it back
     88 * into the source image coordinate system and then test it for
     89 * being in range and sample pixel-by-pixel, but that is quite
     90 * a bit more expensive.  Fortunately, if the scale factors are
     91 * so tiny that we overflow our long values then the number of
     92 * pixels we are planning to visit should be very tiny.  The only
     93 * exception to that rule is if the scale factor along one
     94 * dimension is tiny (creating the huge stepping values), and
     95 * the scale factor along the other dimension is fairly regular
     96 * or an up-scale.  In that case we have a lot of pixels along
     97 * the direction of the larger axis to sample, but few along the
     98 * smaller axis.  Though, pessimally, with an added shear factor
     99 * such a linearly tiny image could have bounds that cover a large
     100 * number of pixels.  Such odd transformations should be very
     101 * rare and the absolute limit on calculations would involve a
     102 * single reverse transform of every pixel in the output image
     103 * which is not fast, but it should not cause an undue stall
     104 * of the rendering software.
     105 *
     106 * The specific test we will use is to calculate the inverse
     107 * transformed values of every corner of the destination bounds
     108 * (in order to be user-clip independent) and if we can
     109 * perform a fixed-point-long inverse transform of all of
     110 * those points without overflowing we will use the fast
     111 * fixed point algorithm.  Otherwise we will use the safe
     112 * per-pixel transform algorithm.
     113 * The 4 corners are 0,0, 0,dsth, dstw,0, dstw,dsth
     114 * Transformed they are:
     115 *     tx,               ty
     116 *     tx       +dxdy*H, ty       +dydy*H
     117 *     tx+dxdx*W,        ty+dydx*W
     118 *     tx+dxdx*W+dxdy*H, ty+dydx*W+dydy*H
     119 */
     120/* We reject coordinates not less than 1<<30 so that the distance between */
     121/* any 2 of them is less than 1<<31 which would overflow into the sign */
     122/* bit of a signed long value used to represent fixed point coordinates. */
     123#define TX_FIXED_UNSAFE(v)  (fabs(v) >= (1<<30))
     124static jboolean
     125checkOverflow(jint dxoff, jint dyoff,
     126              SurfaceDataBounds *pBounds,
     127              TransformInfo *pItxInfo,
     128              jdouble *retx, jdouble *rety)
     129{
     130    jdouble x, y;
     131
     132    x = dxoff+pBounds->x1+0.5; /* Center of pixel x1 */
     133    y = dyoff+pBounds->y1+0.5; /* Center of pixel y1 */
     134    Transform_transform(pItxInfo, &x, &y);
     135    *retx = x;
     136    *rety = y;
     137    if (TX_FIXED_UNSAFE(x) || TX_FIXED_UNSAFE(y)) {
     138        return JNI_TRUE;
     139    }
     140
     141    x = dxoff+pBounds->x2-0.5; /* Center of pixel x2-1 */
     142    y = dyoff+pBounds->y1+0.5; /* Center of pixel y1 */
     143    Transform_transform(pItxInfo, &x, &y);
     144    if (TX_FIXED_UNSAFE(x) || TX_FIXED_UNSAFE(y)) {
     145        return JNI_TRUE;
     146    }
     147
     148    x = dxoff+pBounds->x1+0.5; /* Center of pixel x1 */
     149    y = dyoff+pBounds->y2-0.5; /* Center of pixel y2-1 */
     150    Transform_transform(pItxInfo, &x, &y);
     151    if (TX_FIXED_UNSAFE(x) || TX_FIXED_UNSAFE(y)) {
     152        return JNI_TRUE;
     153    }
     154
     155    x = dxoff+pBounds->x2-0.5; /* Center of pixel x2-1 */
     156    y = dyoff+pBounds->y2-0.5; /* Center of pixel y2-1 */
     157    Transform_transform(pItxInfo, &x, &y);
     158    if (TX_FIXED_UNSAFE(x) || TX_FIXED_UNSAFE(y)) {
     159        return JNI_TRUE;
     160    }
     161
     162    return JNI_FALSE;
     163}
     164
     165/*
    78166 * Fill the edge buffer with pairs of coordinates representing the maximum
    79167 * left and right pixels of the destination surface that should be processed
     
    83171 * source coordinate that falls within the (0, 0, sw, sh) bounds of the
    84172 * source image should be processed.
    85  * pEdgeBuf points to an array of jints that holds MAXEDGES*2 values.
    86  * If more storage is needed, then this function allocates a new buffer.
    87  * In either case, a pointer to the buffer actually used to store the
    88  * results is returned.
    89  * The caller is responsible for freeing the buffer if the return value
    90  * is not the same as the original pEdgeBuf passed in.
     173 * pEdges points to an array of jints that holds 2 + numedges*2 values where
     174 * numedges should match (pBounds->y2 - pBounds->y1).
     175 * The first two jints in pEdges should be set to y1 and y2 and every pair
     176 * of jints after that represent the xmin,xmax of all pixels in range of
     177 * the transformed blit for the corresponding scanline.
    91178 */
    92 static jint *
    93 calculateEdges(jint *pEdgeBuf,
     179static void
     180calculateEdges(jint *pEdges,
    94181               SurfaceDataBounds *pBounds,
    95182               TransformInfo *pItxInfo,
     
    97184               juint sw, juint sh)
    98185{
    99     jint *pEdges;
    100186    jlong dxdxlong, dydxlong;
    101187    jlong dxdylong, dydylong;
     
    112198    dx2 = pBounds->x2;
    113199    dy2 = pBounds->y2;
    114     if ((dy2-dy1) > MAXEDGES) {
    115         pEdgeBuf = malloc(2 * (dy2-dy1) * sizeof (*pEdges));
    116     }
    117     pEdges = pEdgeBuf;
     200    *pEdges++ = dy1;
     201    *pEdges++ = dy2;
    118202
    119203    drowxlong = (dx2-dx1-1) * dxdxlong;
     
    156240        dy1++;
    157241    }
    158 
    159     return pEdgeBuf;
    160242}
     243
     244static void
     245Transform_SafeHelper(JNIEnv *env,
     246                     SurfaceDataOps *srcOps,
     247                     SurfaceDataOps *dstOps,
     248                     SurfaceDataRasInfo *pSrcInfo,
     249                     SurfaceDataRasInfo *pDstInfo,
     250                     NativePrimitive *pMaskBlitPrim,
     251                     CompositeInfo *pCompInfo,
     252                     TransformHelperFunc *pHelperFunc,
     253                     TransformInterpFunc *pInterpFunc,
     254                     RegionData *pClipInfo, TransformInfo *pItxInfo,
     255                     jint *pData, jint *pEdges,
     256                     jint dxoff, jint dyoff, jint sw, jint sh);
    161257
    162258/*
     
    188284    TransformHelperFunc *pHelperFunc;
    189285    TransformInterpFunc *pInterpFunc;
    190     jint edgebuf[MAXEDGES * 2];
     286    jdouble xorig, yorig;
     287    jlong numedges;
    191288    jint *pEdges;
    192     jdouble x, y;
    193     jlong xbase, ybase;
    194     jlong dxdxlong, dydxlong;
    195     jlong dxdylong, dydylong;
     289    jint edgebuf[2 + MAXEDGES * 2];
     290    union {
     291        jlong align;
     292        jint data[LINE_SIZE];
     293    } rgb;
    196294
    197295#ifdef MAKE_STUBS
     
    270368        != SD_SUCCESS)
    271369    {
     370        /* edgeArray should already contain zeros for min/maxy */
    272371        return;
    273372    }
     
    276375    {
    277376        SurfaceData_InvokeUnlock(env, srcOps, &srcInfo);
     377        /* edgeArray should already contain zeros for min/maxy */
    278378        return;
    279379    }
    280380    Region_IntersectBounds(&clipInfo, &dstInfo.bounds);
    281381
     382    numedges = (((jlong) dstInfo.bounds.y2) - ((jlong) dstInfo.bounds.y1));
     383    if (numedges <= 0) {
     384        pEdges = NULL;
     385    } else if (!JNU_IsNull(env, edgeArray)) {
     386        /*
     387         * Ideally Java should allocate an array large enough, but if
     388         * we ever have a miscommunication about the number of edge
     389         * lines, or if the Java array calculation should overflow to
     390         * a positive number and succeed in allocating an array that
     391         * is too small, we need to verify that it can still hold the
     392         * number of integers that we plan to store to be safe.
     393         */
     394        jsize edgesize = (*env)->GetArrayLength(env, edgeArray);
     395        /* (edgesize/2 - 1) should avoid any overflow or underflow. */
     396        pEdges = (((edgesize / 2) - 1) >= numedges)
     397            ? (*env)->GetPrimitiveArrayCritical(env, edgeArray, NULL)
     398            : NULL;
     399    } else if (numedges > MAXEDGES) {
     400        /* numedges variable (jlong) can be at most ((1<<32)-1) */
     401        /* memsize can overflow a jint, but not a jlong */
     402        jlong memsize = ((numedges * 2) + 2) * sizeof(*pEdges);
     403        pEdges = (memsize == ((size_t) memsize))
     404            ? malloc((size_t) memsize)
     405            : NULL;
     406    } else {
     407        pEdges = edgebuf;
     408    }
     409    if (pEdges == NULL) {
     410        if (numedges > 0) {
     411            JNU_ThrowInternalError(env, "Unable to allocate edge list");
     412        }
     413        SurfaceData_InvokeUnlock(env, dstOps, &dstInfo);
     414        SurfaceData_InvokeUnlock(env, srcOps, &srcInfo);
     415        /* edgeArray should already contain zeros for min/maxy */
     416        return;
     417    }
     418
    282419    Transform_GetInfo(env, itxform, &itxInfo);
    283     dxdxlong = DblToLong(itxInfo.dxdx);
    284     dydxlong = DblToLong(itxInfo.dydx);
    285     dxdylong = DblToLong(itxInfo.dxdy);
    286     dydylong = DblToLong(itxInfo.dydy);
    287     x = dxoff+dstInfo.bounds.x1+0.5; /* Center of pixel x1 */
    288     y = dyoff+dstInfo.bounds.y1+0.5; /* Center of pixel y1 */
    289     Transform_transform(&itxInfo, &x, &y);
    290     xbase = DblToLong(x);
    291     ybase = DblToLong(y);
    292 
    293     pEdges = calculateEdges(edgebuf, &dstInfo.bounds, &itxInfo,
    294                             xbase, ybase, sx2-sx1, sy2-sy1);
    295420
    296421    if (!Region_IsEmpty(&clipInfo)) {
    297422        srcOps->GetRasInfo(env, srcOps, &srcInfo);
    298423        dstOps->GetRasInfo(env, dstOps, &dstInfo);
    299         if (srcInfo.rasBase && dstInfo.rasBase) {
    300             union {
    301                 jlong align;
    302                 jint data[LINE_SIZE];
    303             } rgb;
     424        if (srcInfo.rasBase == NULL || dstInfo.rasBase == NULL) {
     425            pEdges[0] = pEdges[1] = 0;
     426        } else if (checkOverflow(dxoff, dyoff, &dstInfo.bounds,
     427                                 &itxInfo, &xorig, &yorig))
     428        {
     429            Transform_SafeHelper(env, srcOps, dstOps,
     430                                 &srcInfo, &dstInfo,
     431                                 pMaskBlitPrim, &compInfo,
     432                                 pHelperFunc, pInterpFunc,
     433                                 &clipInfo, &itxInfo, rgb.data, pEdges,
     434                                 dxoff, dyoff, sx2-sx1, sy2-sy1);
     435        } else {
    304436            SurfaceDataBounds span;
     437            jlong dxdxlong, dydxlong;
     438            jlong dxdylong, dydylong;
     439            jlong xbase, ybase;
     440
     441            dxdxlong = DblToLong(itxInfo.dxdx);
     442            dydxlong = DblToLong(itxInfo.dydx);
     443            dxdylong = DblToLong(itxInfo.dxdy);
     444            dydylong = DblToLong(itxInfo.dydy);
     445            xbase = DblToLong(xorig);
     446            ybase = DblToLong(yorig);
     447
     448            calculateEdges(pEdges, &dstInfo.bounds, &itxInfo,
     449                           xbase, ybase, sx2-sx1, sy2-sy1);
    305450
    306451            Region_StartIteration(env, &clipInfo);
     
    319464                    /* Note - process at most one scanline at a time. */
    320465
    321                     dx1 = pEdges[(dy1 - dstInfo.bounds.y1) * 2];
    322                     dx2 = pEdges[(dy1 - dstInfo.bounds.y1) * 2 + 1];
     466                    dx1 = pEdges[(dy1 - dstInfo.bounds.y1) * 2 + 2];
     467                    dx2 = pEdges[(dy1 - dstInfo.bounds.y1) * 2 + 3];
    323468                    if (dx1 < span.x1) dx1 = span.x1;
    324469                    if (dx2 > span.x2) dx2 = span.x2;
     
    377522        SurfaceData_InvokeRelease(env, dstOps, &dstInfo);
    378523        SurfaceData_InvokeRelease(env, srcOps, &srcInfo);
     524    } else {
     525        pEdges[0] = pEdges[1] = 0;
     526    }
     527    if (!JNU_IsNull(env, edgeArray)) {
     528        (*env)->ReleasePrimitiveArrayCritical(env, edgeArray, pEdges, 0);
     529    } else if (pEdges != edgebuf) {
     530        free(pEdges);
    379531    }
    380532    SurfaceData_InvokeUnlock(env, dstOps, &dstInfo);
    381533    SurfaceData_InvokeUnlock(env, srcOps, &srcInfo);
    382     if (!JNU_IsNull(env, edgeArray)) {
    383         (*env)->SetIntArrayRegion(env, edgeArray, 0, 1, &dstInfo.bounds.y1);
    384         (*env)->SetIntArrayRegion(env, edgeArray, 1, 1, &dstInfo.bounds.y2);
    385         (*env)->SetIntArrayRegion(env, edgeArray,
    386                                   2, (dstInfo.bounds.y2 - dstInfo.bounds.y1)*2,
    387                                   pEdges);
    388     }
    389     if (pEdges != edgebuf) {
    390         free(pEdges);
    391     }
     534}
     535
     536static void
     537Transform_SafeHelper(JNIEnv *env,
     538                     SurfaceDataOps *srcOps,
     539                     SurfaceDataOps *dstOps,
     540                     SurfaceDataRasInfo *pSrcInfo,
     541                     SurfaceDataRasInfo *pDstInfo,
     542                     NativePrimitive *pMaskBlitPrim,
     543                     CompositeInfo *pCompInfo,
     544                     TransformHelperFunc *pHelperFunc,
     545                     TransformInterpFunc *pInterpFunc,
     546                     RegionData *pClipInfo, TransformInfo *pItxInfo,
     547                     jint *pData, jint *pEdges,
     548                     jint dxoff, jint dyoff, jint sw, jint sh)
     549{
     550    SurfaceDataBounds span;
     551    jint dx1, dx2;
     552    jint dy1, dy2;
     553    jint i, iy;
     554
     555    dy1 = pDstInfo->bounds.y1;
     556    dy2 = pDstInfo->bounds.y2;
     557    dx1 = pDstInfo->bounds.x1;
     558    dx2 = pDstInfo->bounds.x2;
     559    pEdges[0] = dy1;
     560    pEdges[1] = dy2;
     561    for (iy = dy1; iy < dy2; iy++) {
     562        jint i = (iy - dy1) * 2;
     563        /* row spans are set to max,min until we find a pixel in range below */
     564        pEdges[i + 2] = dx2;
     565        pEdges[i + 3] = dx1;
     566    }
     567
     568    Region_StartIteration(env, pClipInfo);
     569    while (Region_NextIteration(pClipInfo, &span)) {
     570        dy1 = span.y1;
     571        dy2 = span.y2;
     572        while (dy1 < dy2) {
     573            dx1 = span.x1;
     574            dx2 = span.x2;
     575            i = (dy1 - pDstInfo->bounds.y1) * 2;
     576            while (dx1 < dx2) {
     577                jdouble x, y;
     578                jlong xlong, ylong;
     579
     580                x = dxoff + dx1 + 0.5;
     581                y = dyoff + dy1 + 0.5;
     582                Transform_transform(pItxInfo, &x, &y);
     583                xlong = DblToLong(x);
     584                ylong = DblToLong(y);
     585
     586                /* Process only pixels with centers in bounds
     587                 * Test double values to avoid overflow in conversion
     588                 * to long values and then also test the long values
     589                 * in case they rounded up and out of bounds during
     590                 * the conversion.
     591                 */
     592                if (x >= 0 && y >= 0 && x < sw && y < sh &&
     593                    WholeOfLong(xlong) < sw &&
     594                    WholeOfLong(ylong) < sh)
     595                {
     596                    void *pDst;
     597
     598                    if (pEdges[i + 2] > dx1) {
     599                        pEdges[i + 2] = dx1;
     600                    }
     601                    if (pEdges[i + 3] <= dx1) {
     602                        pEdges[i + 3] = dx1 + 1;
     603                    }
     604
     605                    /* Get IntArgbPre pixel data from source */
     606                    (*pHelperFunc)(pSrcInfo,
     607                                   pData, 1,
     608                                   xlong, 0,
     609                                   ylong, 0);
     610
     611                    /* Interpolate result pixels if needed */
     612                    if (pInterpFunc) {
     613                        (*pInterpFunc)(pData, 1,
     614                                       FractOfLong(xlong-LongOneHalf), 0,
     615                                       FractOfLong(ylong-LongOneHalf), 0);
     616                    }
     617
     618                    /* Store/Composite interpolated pixels into dest */
     619                    pDst = PtrCoord(pDstInfo->rasBase,
     620                                    dx1, pDstInfo->pixelStride,
     621                                    dy1, pDstInfo->scanStride);
     622                    (*pMaskBlitPrim->funcs.maskblit)(pDst, pData,
     623                                                     0, 0, 0,
     624                                                     1, 1,
     625                                                     pDstInfo, pSrcInfo,
     626                                                     pMaskBlitPrim,
     627                                                     pCompInfo);
     628                }
     629
     630                /* Increment to next input pixel */
     631                dx1++;
     632            }
     633
     634            /* Increment to next scanline */
     635            dy1++;
     636        }
     637    }
     638    Region_EndIteration(env, pClipInfo);
    392639}
    393640
  • trunk/openjdk/jdk/src/solaris/bin/java_md.c

    r278 r309  
    11/*
    2  * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
  • trunk/openjdk/jdk/src/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java

    r278 r309  
    2727import java.io.IOException;
    2828import java.io.FileDescriptor;
     29import sun.net.ResourceManager;
    2930
    3031/**
     
    109110        if (fd != null || fd1 != null) {
    110111            datagramSocketClose();
     112            ResourceManager.afterUdpClose();
    111113            fd = null;
    112114            fd1 = null;
  • trunk/openjdk/jdk/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java

    r278 r309  
    11/*
    2  * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    309309            int numKeysUpdated = 0;
    310310            numKeysUpdated += processFDSet(updateCount, readFds,
    311                                            PollArrayWrapper.POLLIN);
     311                                           PollArrayWrapper.POLLIN,
     312                                           false);
    312313            numKeysUpdated += processFDSet(updateCount, writeFds,
    313314                                           PollArrayWrapper.POLLCONN |
    314                                            PollArrayWrapper.POLLOUT);
     315                                           PollArrayWrapper.POLLOUT,
     316                                           false);
    315317            numKeysUpdated += processFDSet(updateCount, exceptFds,
    316318                                           PollArrayWrapper.POLLIN |
    317319                                           PollArrayWrapper.POLLCONN |
    318                                            PollArrayWrapper.POLLOUT);
     320                                           PollArrayWrapper.POLLOUT,
     321                                           true);
    319322            return numKeysUpdated;
    320323        }
     
    328331         * me.updateCount <= me.clearedCount <= updateCount
    329332         */
    330         private int processFDSet(long updateCount, int[] fds, int rOps) {
     333        private int processFDSet(long updateCount, int[] fds, int rOps,
     334                                 boolean isExceptFds) {
    331335            int numKeysUpdated = 0;
    332336            for (int i = 1; i <= fds[0]; i++) {
     
    344348                    continue;
    345349                SelectionKeyImpl sk = me.ski;
     350
     351                // The descriptor may be in the exceptfds set because there is
     352                // OOB data queued to the socket. If there is OOB data then it
     353                // is discarded and the key is not added to the selected set.
     354                if (isExceptFds &&
     355                    (sk.channel() instanceof SocketChannelImpl) &&
     356                    discardUrgentData(desc))
     357                {
     358                    continue;
     359                }
     360
    346361                if (selectedKeys.contains(sk)) { // Key in selected set
    347362                    if (me.clearedCount != updateCount) {
     
    450465    private native void resetWakeupSocket0(int wakeupSourceFd);
    451466
     467    private native boolean discardUrgentData(int fd);
     468
    452469    // We increment this counter on each call to updateSelectedKeys()
    453470    // each entry in  SubSelector.fdsMap has a memorized value of
  • trunk/openjdk/jdk/src/windows/classes/sun/security/provider/NativeSeedGenerator.java

    r278 r309  
    11/*
    2  * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    5454    private static native boolean nativeGenerateSeed(byte[] result);
    5555
     56    @Override
    5657    void getSeedBytes(byte[] result) {
    5758        // fill array as a side effect
     
    6364    }
    6465
    65     byte getSeedByte() {
    66         byte[] b = new byte[1];
    67         getSeedBytes(b);
    68         return b[0];
    69     }
    7066}
  • trunk/openjdk/jdk/src/windows/native/sun/nio/ch/WindowsSelectorImpl.c

    r278 r309  
    11/*
    2  * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
     2 * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    212212    }
    213213}
     214
     215JNIEXPORT jboolean JNICALL
     216Java_sun_nio_ch_WindowsSelectorImpl_discardUrgentData(JNIEnv* env, jobject this,
     217                                                      jint s)
     218{
     219    char data[8];
     220    jboolean discarded = JNI_FALSE;
     221    int n;
     222    do {
     223        n = recv(s, data, sizeof(data), MSG_OOB);
     224        if (n > 0) {
     225            discarded = JNI_TRUE;
     226        }
     227    } while (n > 0);
     228    return discarded;
     229}
     230
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Component.cpp

    r278 r309  
    54215421{
    54225422    sm_suppressFocusAndActivation = TRUE;
     5423
     5424    if (bEnable && IsTopLevel()) {
     5425        // we should not enable blocked toplevels
     5426        bEnable = !::IsWindow(AwtWindow::GetModalBlocker(GetHWnd()));
     5427    }
    54235428    ::EnableWindow(GetHWnd(), bEnable);
     5429
    54245430    sm_suppressFocusAndActivation = FALSE;
    54255431    CriticalSection::Lock l(GetLock());
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Dialog.cpp

    r278 r309  
    274274            HWND blocker = AwtWindow::GetModalBlocker(AwtComponent::GetTopLevelParentForWindow(hWnd));
    275275            HWND topMostBlocker = blocker;
     276            HWND prevForegroundWindow = ::GetForegroundWindow();
     277            if (::IsWindow(blocker)) {
     278                ::BringWindowToTop(hWnd);
     279            }
    276280            while (::IsWindow(blocker)) {
    277281                topMostBlocker = blocker;
     
    283287                // or the dialog is currently inactive
    284288                if ((::WindowFromPoint(mhs->pt) == hWnd) &&
    285                     (::GetForegroundWindow() == topMostBlocker))
     289                    (prevForegroundWindow == topMostBlocker))
    286290                {
    287291                    ::MessageBeep(MB_OK);
     
    293297                    ::SetForegroundWindow(topMostBlocker);
    294298                }
     299                return 1;
    295300            }
    296301        }
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_FileDialog.cpp

    r278 r309  
    246246
    247247        fileBuffer = new TCHAR[MAX_PATH+1];
     248        memset(fileBuffer, 0, (MAX_PATH+1) * sizeof(TCHAR));
    248249
    249250        file = (jstring)env->GetObjectField(target, AwtFileDialog::fileID);
    250251        if (file != NULL) {
    251252            LPCTSTR tmp = JNU_GetStringPlatformChars(env, file, NULL);
    252             _tcscpy(fileBuffer, tmp);
     253            _tcsncpy(fileBuffer, tmp, MAX_PATH-1); // the fileBuffer is double null terminated string
    253254            JNU_ReleaseStringPlatformChars(env, file, tmp);
    254255        } else {
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Window.cpp

    r278 r309  
    189189
    190190    ::RemoveProp(GetHWnd(), ModalBlockerProp);
    191     ::RemoveProp(GetHWnd(), ModalSaveWSEXProp);
    192191
    193192    if (m_grabbedWindow == this) {
     
    14711470        return;
    14721471    }
    1473     DWORD exStyle = ::GetWindowLong(window, GWL_EXSTYLE);
     1472
    14741473    if (::IsWindow(blocker)) {
    1475         // save WS_EX_NOACTIVATE and WS_EX_APPWINDOW styles
    1476         DWORD saveStyle = exStyle & (AWT_WS_EX_NOACTIVATE | WS_EX_APPWINDOW);
    1477         ::SetProp(window, ModalSaveWSEXProp, reinterpret_cast<HANDLE>(saveStyle));
    1478         ::SetWindowLong(window, GWL_EXSTYLE, (exStyle | AWT_WS_EX_NOACTIVATE) & ~WS_EX_APPWINDOW);
    14791474        ::SetProp(window, ModalBlockerProp, reinterpret_cast<HANDLE>(blocker));
     1475        ::EnableWindow(window, FALSE);
    14801476    } else {
    1481         // restore WS_EX_NOACTIVATE and WS_EX_APPWINDOW styles
    1482         DWORD saveStyle = reinterpret_cast<DWORD>(::GetProp(window, ModalSaveWSEXProp));
    1483         ::SetWindowLong(window, GWL_EXSTYLE,
    1484                         (exStyle & ~(AWT_WS_EX_NOACTIVATE | WS_EX_APPWINDOW)) | saveStyle);
    1485         ::RemoveProp(window, ModalSaveWSEXProp);
    14861477        ::RemoveProp(window, ModalBlockerProp);
     1478         AwtComponent *comp = AwtComponent::GetComponent(window);
     1479         // we don't expect to be called with non-java HWNDs
     1480         DASSERT(comp && comp->IsTopLevel());
     1481         // we should not unblock disabled toplevels
     1482         ::EnableWindow(window, comp->isEnabled());
    14871483    }
    14881484}
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Window.h

    r278 r309  
    3434// property name tagging windows disabled by modality
    3535static LPCTSTR ModalBlockerProp = TEXT("SunAwtModalBlockerProp");
    36 static LPCTSTR ModalSaveWSEXProp = TEXT("SunAwtModalSaveWSEXProp");
    3736static LPCTSTR ModalDialogPeerProp = TEXT("SunAwtModalDialogPeerProp");
    3837
Note: See TracChangeset for help on using the changeset viewer.