Merge jdk8-b32
authorlana
Mon, 26 Mar 2012 17:31:42 -0700
changeset 5221ddfe5562f61f
parent 5186 97cf70c92ee6
parent 5220 1238b2679374
child 5222 78cea258caab
Merge
test/java/io/File/isDirectory/Applet.html
test/sun/nio/cs/OLD/TestX11CS.java
     1.1 --- a/make/common/shared/Sanity.gmk	Thu Mar 22 12:41:26 2012 -0700
     1.2 +++ b/make/common/shared/Sanity.gmk	Mon Mar 26 17:31:42 2012 -0700
     1.3 @@ -348,7 +348,13 @@
     1.4  	    "        Try setting LANG to 'C'. \n" \
     1.5  	    "" >> $(WARNING_FILE) ; \
     1.6          fi
     1.7 +ifeq ($(PLATFORM), macosx)
     1.8 +	@if [ "$(LANG)" = "" ]; then \
     1.9 +	  $(ECHO) "ERROR: LANG must be set on Mac OS X. Recommended value is \"C\"" >> $(ERROR_FILE) ; \
    1.10 +	fi
    1.11  endif
    1.12 +endif
    1.13 +
    1.14  
    1.15  ######################################################
    1.16  # Check the Windows cygwin version
     2.1 --- a/make/docs/CORE_PKGS.gmk	Thu Mar 22 12:41:26 2012 -0700
     2.2 +++ b/make/docs/CORE_PKGS.gmk	Mon Mar 26 17:31:42 2012 -0700
     2.3 @@ -64,7 +64,7 @@
     2.4    javax.management.*  \
     2.5    javax.script  \
     2.6    javax.sql.*  \
     2.7 -  javax.tools  \
     2.8 +  javax.tools.*  \
     2.9    javax.xml.*  \
    2.10    org.w3c.*  \
    2.11    org.xml.sax
    2.12 @@ -218,6 +218,7 @@
    2.13    javax.swing.plaf.nimbus                        \
    2.14    javax.swing.plaf.synth                         \
    2.15    javax.tools                                    \
    2.16 +  javax.tools.annotation                         \
    2.17    javax.transaction                              \
    2.18    javax.transaction.xa                           \
    2.19    javax.xml.parsers                              \
     3.1 --- a/make/sun/security/ec/Makefile	Thu Mar 22 12:41:26 2012 -0700
     3.2 +++ b/make/sun/security/ec/Makefile	Mon Mar 26 17:31:42 2012 -0700
     3.3 @@ -159,7 +159,9 @@
     3.4        $(PKGDIR)/ECDSASignature.java \
     3.5        $(PKGDIR)/ECKeyPairGenerator.java
     3.6  
     3.7 -  JAVAHFLAGS += -Xbootclasspath/p:$(CLASSDESTDIR)
     3.8 +  JAVAHFLAGS = -bootclasspath \
     3.9 +      "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)"
    3.10 +
    3.11  
    3.12    #
    3.13    # C and C++ files
     4.1 --- a/make/sun/security/mscapi/Makefile	Thu Mar 22 12:41:26 2012 -0700
     4.2 +++ b/make/sun/security/mscapi/Makefile	Mon Mar 26 17:31:42 2012 -0700
     4.3 @@ -1,5 +1,5 @@
     4.4  #
     4.5 -# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
     4.6 +# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
     4.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4.8  #
     4.9  # This code is free software; you can redistribute it and/or modify it
    4.10 @@ -149,7 +149,8 @@
    4.11  # Rules
    4.12  #
    4.13  CLASSDESTDIR = $(TEMPDIR)/classes
    4.14 -JAVAHFLAGS += -Xbootclasspath/p:$(CLASSDESTDIR)
    4.15 +JAVAHFLAGS = -bootclasspath \
    4.16 +  "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)"
    4.17  
    4.18  include $(BUILDDIR)/common/Mapfile-vers.gmk
    4.19  
     5.1 --- a/make/sun/security/pkcs11/Makefile	Thu Mar 22 12:41:26 2012 -0700
     5.2 +++ b/make/sun/security/pkcs11/Makefile	Mon Mar 26 17:31:42 2012 -0700
     5.3 @@ -150,7 +150,8 @@
     5.4  # Rules
     5.5  #
     5.6  CLASSDESTDIR = $(TEMPDIR)/classes
     5.7 -JAVAHFLAGS = -bootclasspath "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)"
     5.8 +JAVAHFLAGS = -bootclasspath \
     5.9 +    "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)"
    5.10  
    5.11  include $(BUILDDIR)/common/Mapfile-vers.gmk
    5.12  
     6.1 --- a/src/macosx/classes/sun/lwawt/LWToolkit.java	Thu Mar 22 12:41:26 2012 -0700
     6.2 +++ b/src/macosx/classes/sun/lwawt/LWToolkit.java	Mon Mar 26 17:31:42 2012 -0700
     6.3 @@ -522,11 +522,6 @@
     6.4          postEvent(targetToAppContext(event.getSource()), event);
     6.5      }
     6.6  
     6.7 -    /*
     6.8 -     * Returns true if the application (one of its windows) owns keyboard focus.
     6.9 -     */
    6.10 -    public abstract boolean isApplicationActive();
    6.11 -
    6.12      // use peer's back buffer to implement non-opaque windows.
    6.13      @Override
    6.14      public boolean needUpdateWindow() {
     7.1 --- a/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Thu Mar 22 12:41:26 2012 -0700
     7.2 +++ b/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Mon Mar 26 17:31:42 2012 -0700
     7.3 @@ -1067,11 +1067,7 @@
     7.4              return false;
     7.5          }
     7.6  
     7.7 -        // Cross-app activation requests are not allowed.
     7.8 -        if (cause != CausedFocusEvent.Cause.MOUSE_EVENT &&
     7.9 -            !((LWToolkit)Toolkit.getDefaultToolkit()).isApplicationActive())
    7.10 -        {
    7.11 -            focusLog.fine("the app is inactive, so the request is rejected");
    7.12 +        if (platformWindow.rejectFocusRequest(cause)) {
    7.13              return false;
    7.14          }
    7.15  
     8.1 --- a/src/macosx/classes/sun/lwawt/PlatformWindow.java	Thu Mar 22 12:41:26 2012 -0700
     8.2 +++ b/src/macosx/classes/sun/lwawt/PlatformWindow.java	Mon Mar 26 17:31:42 2012 -0700
     8.3 @@ -27,6 +27,7 @@
     8.4  
     8.5  import java.awt.*;
     8.6  
     8.7 +import sun.awt.CausedFocusEvent;
     8.8  import sun.java2d.SurfaceData;
     8.9  
    8.10  // TODO Is it worth to generify this interface, like that:
    8.11 @@ -117,6 +118,8 @@
    8.12  
    8.13      public void updateFocusableWindowState();
    8.14  
    8.15 +    public boolean rejectFocusRequest(CausedFocusEvent.Cause cause);
    8.16 +
    8.17      public boolean requestWindowFocus();
    8.18  
    8.19      /*
     9.1 --- a/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java	Thu Mar 22 12:41:26 2012 -0700
     9.2 +++ b/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java	Mon Mar 26 17:31:42 2012 -0700
     9.3 @@ -38,6 +38,8 @@
     9.4  public class CEmbeddedFrame extends EmbeddedFrame {
     9.5  
     9.6      private CPlatformResponder responder;
     9.7 +    private boolean focused = true;
     9.8 +    private boolean parentWindowActive = true;
     9.9  
    9.10      public CEmbeddedFrame() {
    9.11          show();
    9.12 @@ -94,4 +96,31 @@
    9.13      public void handleInputEvent(String text) {
    9.14          new RuntimeException("Not implemented");
    9.15      }
    9.16 +
    9.17 +    public void handleFocusEvent(boolean focused) {
    9.18 +        this.focused = focused;
    9.19 +        updateOverlayWindowActiveState();
    9.20 +    }
    9.21 +
    9.22 +    public void handleWindowFocusEvent(boolean parentWindowActive) {
    9.23 +        this.parentWindowActive = parentWindowActive;
    9.24 +        updateOverlayWindowActiveState();
    9.25 +    }
    9.26 +
    9.27 +    public boolean isParentWindowActive() {
    9.28 +        return parentWindowActive;
    9.29 +    }
    9.30 +
    9.31 +    /*
    9.32 +     * May change appearance of contents of window, and generate a
    9.33 +     * WINDOW_ACTIVATED event.
    9.34 +     */
    9.35 +    private void updateOverlayWindowActiveState() {
    9.36 +        final boolean showAsFocused = parentWindowActive && focused;
    9.37 +        dispatchEvent(
    9.38 +            new FocusEvent(this, showAsFocused ?
    9.39 +                                 FocusEvent.FOCUS_GAINED :
    9.40 +                                 FocusEvent.FOCUS_LOST));
    9.41 +     }
    9.42 +
    9.43  }
    10.1 --- a/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java	Thu Mar 22 12:41:26 2012 -0700
    10.2 +++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java	Mon Mar 26 17:31:42 2012 -0700
    10.3 @@ -33,17 +33,23 @@
    10.4  
    10.5  import sun.awt.CGraphicsConfig;
    10.6  import sun.awt.CGraphicsDevice;
    10.7 +import sun.awt.CausedFocusEvent;
    10.8  
    10.9  import java.awt.*;
   10.10  import java.awt.BufferCapabilities.FlipContents;
   10.11  
   10.12 +import sun.util.logging.PlatformLogger;
   10.13 +
   10.14  /*
   10.15   * Provides a lightweight implementation of the EmbeddedFrame.
   10.16   */
   10.17  public class CPlatformEmbeddedFrame implements PlatformWindow {
   10.18  
   10.19 +    private static final PlatformLogger focusLogger = PlatformLogger.getLogger("sun.lwawt.macosx.focus.CPlatformEmbeddedFrame");
   10.20 +
   10.21      private CGLLayer windowLayer;
   10.22      private LWWindowPeer peer;
   10.23 +    private CEmbeddedFrame target;
   10.24  
   10.25      private volatile int screenX = 0;
   10.26      private volatile int screenY = 0;
   10.27 @@ -52,6 +58,7 @@
   10.28      public void initialize(Window target, final LWWindowPeer peer, PlatformWindow owner) {
   10.29          this.peer = peer;
   10.30          this.windowLayer = new CGLLayer(peer);
   10.31 +        this.target = (CEmbeddedFrame)target;
   10.32      }
   10.33  
   10.34      @Override
   10.35 @@ -149,6 +156,18 @@
   10.36      public void updateFocusableWindowState() {}
   10.37  
   10.38      @Override
   10.39 +    public boolean rejectFocusRequest(CausedFocusEvent.Cause cause) {
   10.40 +        // Cross-app activation requests are not allowed.
   10.41 +        if (cause != CausedFocusEvent.Cause.MOUSE_EVENT &&
   10.42 +            !target.isParentWindowActive())
   10.43 +        {
   10.44 +            focusLogger.fine("the embedder is inactive, so the request is rejected");
   10.45 +            return true;
   10.46 +        }
   10.47 +        return false;
   10.48 +    }
   10.49 +
   10.50 +    @Override
   10.51      public boolean requestWindowFocus() {
   10.52          return true;
   10.53      }
    11.1 --- a/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Thu Mar 22 12:41:26 2012 -0700
    11.2 +++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Mon Mar 26 17:31:42 2012 -0700
    11.3 @@ -65,6 +65,7 @@
    11.4  
    11.5      // Loger to report issues happened during execution but that do not affect functionality
    11.6      private static final PlatformLogger logger = PlatformLogger.getLogger("sun.lwawt.macosx.CPlatformWindow");
    11.7 +    private static final PlatformLogger focusLogger = PlatformLogger.getLogger("sun.lwawt.macosx.focus.CPlatformWindow");
    11.8  
    11.9      // for client properties
   11.10      public static final String WINDOW_BRUSH_METAL_LOOK = "apple.awt.brushMetalLook";
   11.11 @@ -112,6 +113,7 @@
   11.12      static final int MINIMIZABLE = 1 << 8;
   11.13  
   11.14      static final int RESIZABLE = 1 << 9; // both a style bit and prop bit
   11.15 +    static final int NONACTIVATING = 1 << 24;
   11.16  
   11.17      static final int _STYLE_PROP_BITMASK = DECORATED | TEXTURED | UNIFIED | UTILITY | HUD | SHEET | CLOSEABLE | MINIMIZABLE | RESIZABLE;
   11.18  
   11.19 @@ -127,9 +129,6 @@
   11.20  
   11.21      static final int _METHOD_PROP_BITMASK = RESIZABLE | HAS_SHADOW | ZOOMABLE | ALWAYS_ON_TOP | HIDES_ON_DEACTIVATE | DRAGGABLE_BACKGROUND | DOCUMENT_MODIFIED | FULLSCREENABLE;
   11.22  
   11.23 -    // not sure
   11.24 -    static final int POPUP = 1 << 14;
   11.25 -
   11.26      // corresponds to callback-based properties
   11.27      static final int SHOULD_BECOME_KEY = 1 << 12;
   11.28      static final int SHOULD_BECOME_MAIN = 1 << 13;
   11.29 @@ -264,10 +263,6 @@
   11.30          // defaults style bits
   11.31          int styleBits = DECORATED | HAS_SHADOW | CLOSEABLE | MINIMIZABLE | ZOOMABLE | RESIZABLE;
   11.32  
   11.33 -        if (target.getName() == "###overrideRedirect###") {
   11.34 -            styleBits = SET(styleBits, POPUP, true);
   11.35 -        }
   11.36 -
   11.37          if (isNativelyFocusableWindow()) {
   11.38              styleBits = SET(styleBits, SHOULD_BECOME_KEY, true);
   11.39              styleBits = SET(styleBits, SHOULD_BECOME_MAIN, true);
   11.40 @@ -275,6 +270,7 @@
   11.41  
   11.42          final boolean isFrame = (target instanceof Frame);
   11.43          final boolean isDialog = (target instanceof Dialog);
   11.44 +        final boolean isPopup = (target.getType() == Window.Type.POPUP);
   11.45          if (isDialog) {
   11.46              styleBits = SET(styleBits, MINIMIZABLE, false);
   11.47          }
   11.48 @@ -304,8 +300,10 @@
   11.49          }
   11.50  
   11.51          // If the target is a dialog, popup or tooltip we want it to ignore the brushed metal look.
   11.52 -        if (!isDialog && IS(styleBits, POPUP)) {
   11.53 +        if (isPopup) {
   11.54              styleBits = SET(styleBits, TEXTURED, true);
   11.55 +            // Popups in applets don't activate applet's process
   11.56 +            styleBits = SET(styleBits, NONACTIVATING, true);
   11.57          }
   11.58  
   11.59          if (target instanceof javax.swing.RootPaneContainer) {
   11.60 @@ -498,11 +496,18 @@
   11.61              // If it ain't blocked, or is being hidden, go regular way
   11.62              if (visible) {
   11.63                  CWrapper.NSWindow.makeFirstResponder(nsWindowPtr, contentView.getAWTView());
   11.64 +
   11.65 +                boolean isPopup = (target.getType() == Window.Type.POPUP);
   11.66 +                if (isPopup) {
   11.67 +                    // Popups in applets don't activate applet's process
   11.68 +                    CWrapper.NSWindow.orderFrontRegardless(nsWindowPtr);
   11.69 +                } else {
   11.70 +                    CWrapper.NSWindow.orderFront(nsWindowPtr);
   11.71 +                }
   11.72 +
   11.73                  boolean isKeyWindow = CWrapper.NSWindow.isKeyWindow(nsWindowPtr);
   11.74                  if (!isKeyWindow) {
   11.75 -                    CWrapper.NSWindow.makeKeyAndOrderFront(nsWindowPtr);
   11.76 -                } else {
   11.77 -                    CWrapper.NSWindow.orderFront(nsWindowPtr);
   11.78 +                    CWrapper.NSWindow.makeKeyWindow(nsWindowPtr);
   11.79                  }
   11.80              } else {
   11.81                  CWrapper.NSWindow.orderOut(nsWindowPtr);
   11.82 @@ -600,7 +605,20 @@
   11.83      }
   11.84  
   11.85      @Override
   11.86 +    public boolean rejectFocusRequest(CausedFocusEvent.Cause cause) {
   11.87 +        // Cross-app activation requests are not allowed.
   11.88 +        if (cause != CausedFocusEvent.Cause.MOUSE_EVENT &&
   11.89 +            !((LWCToolkit)Toolkit.getDefaultToolkit()).isApplicationActive())
   11.90 +        {
   11.91 +            focusLogger.fine("the app is inactive, so the request is rejected");
   11.92 +            return true;
   11.93 +        }
   11.94 +        return false;
   11.95 +    }
   11.96 +
   11.97 +    @Override
   11.98      public boolean requestWindowFocus() {
   11.99 +
  11.100          long ptr = getNSWindowPtr();
  11.101          if (CWrapper.NSWindow.canBecomeMainWindow(ptr)) {
  11.102              CWrapper.NSWindow.makeMainWindow(ptr);
  11.103 @@ -751,6 +769,11 @@
  11.104       * Callbacks from the AWTWindow and AWTView objc classes.
  11.105       *************************************************************/
  11.106      private void deliverWindowFocusEvent(boolean gained){
  11.107 +        // Fix for 7150349: ingore "gained" notifications when the app is inactive.
  11.108 +        if (gained && !((LWCToolkit)Toolkit.getDefaultToolkit()).isApplicationActive()) {
  11.109 +            focusLogger.fine("the app is inactive, so the notification is ignored");
  11.110 +            return;
  11.111 +        }
  11.112          peer.notifyActivation(gained);
  11.113      }
  11.114  
    12.1 --- a/src/macosx/classes/sun/lwawt/macosx/CWrapper.java	Thu Mar 22 12:41:26 2012 -0700
    12.2 +++ b/src/macosx/classes/sun/lwawt/macosx/CWrapper.java	Mon Mar 26 17:31:42 2012 -0700
    12.3 @@ -47,6 +47,7 @@
    12.4          public static native void setLevel(long window, int level);
    12.5  
    12.6          public static native void makeKeyAndOrderFront(long window);
    12.7 +        public static native void makeKeyWindow(long window);
    12.8          public static native void makeMainWindow(long window);
    12.9          public static native boolean canBecomeMainWindow(long window);
   12.10          public static native boolean isKeyWindow(long window);
    13.1 --- a/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Thu Mar 22 12:41:26 2012 -0700
    13.2 +++ b/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Mon Mar 26 17:31:42 2012 -0700
    13.3 @@ -686,7 +686,10 @@
    13.4          return sunAwtDisableCALayers.booleanValue();
    13.5      }
    13.6  
    13.7 -    @Override
    13.8 +
    13.9 +    /*
   13.10 +     * Returns true if the application (one of its windows) owns keyboard focus.
   13.11 +     */
   13.12      public native boolean isApplicationActive();
   13.13  
   13.14      /************************
    14.1 --- a/src/macosx/native/sun/awt/AWTView.m	Thu Mar 22 12:41:26 2012 -0700
    14.2 +++ b/src/macosx/native/sun/awt/AWTView.m	Mon Mar 26 17:31:42 2012 -0700
    14.3 @@ -812,7 +812,7 @@
    14.4      // Unicode value.
    14.5      NSUInteger utf8Length = [aString lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
    14.6  
    14.7 -    if ([self hasMarkedText] || !fProcessingKeystroke || (utf8Length > 2)) {
    14.8 +    if ([self hasMarkedText] || !fProcessingKeystroke || (utf8Length > 1)) {
    14.9          JNIEnv *env = [ThreadUtilities getJNIEnv];
   14.10  
   14.11          static JNF_MEMBER_CACHE(jm_selectPreviousGlyph, jc_CInputMethod, "selectPreviousGlyph", "()V");
    15.1 --- a/src/macosx/native/sun/awt/AWTWindow.m	Thu Mar 22 12:41:26 2012 -0700
    15.2 +++ b/src/macosx/native/sun/awt/AWTWindow.m	Mon Mar 26 17:31:42 2012 -0700
    15.3 @@ -102,11 +102,12 @@
    15.4          type |= NSBorderlessWindowMask;
    15.5      }
    15.6  
    15.7 -    if (IS(styleBits, TEXTURED))    type |= NSTexturedBackgroundWindowMask;
    15.8 -    if (IS(styleBits, UNIFIED))     type |= NSUnifiedTitleAndToolbarWindowMask;
    15.9 -    if (IS(styleBits, UTILITY))     type |= NSUtilityWindowMask;
   15.10 -    if (IS(styleBits, HUD))         type |= NSHUDWindowMask;
   15.11 -    if (IS(styleBits, SHEET))       type |= NSDocModalWindowMask;
   15.12 +    if (IS(styleBits, TEXTURED))      type |= NSTexturedBackgroundWindowMask;
   15.13 +    if (IS(styleBits, UNIFIED))       type |= NSUnifiedTitleAndToolbarWindowMask;
   15.14 +    if (IS(styleBits, UTILITY))       type |= NSUtilityWindowMask;
   15.15 +    if (IS(styleBits, HUD))           type |= NSHUDWindowMask;
   15.16 +    if (IS(styleBits, SHEET))         type |= NSDocModalWindowMask;
   15.17 +    if (IS(styleBits, NONACTIVATING)) type |= NSNonactivatingPanelMask;
   15.18  
   15.19      return type;
   15.20  }
    16.1 --- a/src/macosx/native/sun/awt/CWrapper.m	Thu Mar 22 12:41:26 2012 -0700
    16.2 +++ b/src/macosx/native/sun/awt/CWrapper.m	Mon Mar 26 17:31:42 2012 -0700
    16.3 @@ -76,6 +76,26 @@
    16.4  
    16.5  /*
    16.6   * Class:     sun_lwawt_macosx_CWrapper$NSWindow
    16.7 + * Method:    makeKeyWindow
    16.8 + * Signature: (J)V
    16.9 + */
   16.10 +JNIEXPORT void JNICALL
   16.11 +Java_sun_lwawt_macosx_CWrapper_00024NSWindow_makeKeyWindow
   16.12 +(JNIEnv *env, jclass cls, jlong windowPtr)
   16.13 +{
   16.14 +JNF_COCOA_ENTER(env);
   16.15 +
   16.16 +    NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
   16.17 +    [JNFRunLoop performOnMainThread:@selector(makeKeyWindow)
   16.18 +                                 on:window
   16.19 +                         withObject:nil
   16.20 +                      waitUntilDone:NO];
   16.21 +
   16.22 +JNF_COCOA_EXIT(env);
   16.23 +}
   16.24 +
   16.25 +/*
   16.26 + * Class:     sun_lwawt_macosx_CWrapper$NSWindow
   16.27   * Method:    makeMainWindow
   16.28   * Signature: (J)V
   16.29   */
    17.1 --- a/src/macosx/native/sun/awt/LWCToolkit.m	Thu Mar 22 12:41:26 2012 -0700
    17.2 +++ b/src/macosx/native/sun/awt/LWCToolkit.m	Mon Mar 26 17:31:42 2012 -0700
    17.3 @@ -401,18 +401,21 @@
    17.4  JNIEXPORT jboolean JNICALL Java_sun_lwawt_macosx_LWCToolkit_isApplicationActive
    17.5  (JNIEnv *env, jclass clazz)
    17.6  {
    17.7 -        __block jboolean active = JNI_FALSE;
    17.8 +    __block jboolean active = JNI_FALSE;
    17.9  
   17.10 -AWT_ASSERT_NOT_APPKIT_THREAD;
   17.11  JNF_COCOA_ENTER(env);
   17.12  
   17.13 +    if ([NSThread isMainThread]) {
   17.14 +        active = (jboolean)[NSRunningApplication currentApplication].active;
   17.15 +    } else {
   17.16          [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^() {
   17.17 -                active = (jboolean)[NSRunningApplication currentApplication].active;
   17.18 +            active = (jboolean)[NSRunningApplication currentApplication].active;
   17.19          }];
   17.20 +    }
   17.21  
   17.22  JNF_COCOA_EXIT(env);
   17.23  
   17.24 -        return active;
   17.25 +    return active;
   17.26  }
   17.27  
   17.28  
    18.1 --- a/src/macosx/native/sun/awt/OSVersion.m	Thu Mar 22 12:41:26 2012 -0700
    18.2 +++ b/src/macosx/native/sun/awt/OSVersion.m	Mon Mar 26 17:31:42 2012 -0700
    18.3 @@ -31,33 +31,31 @@
    18.4  #import <JavaRuntimeSupport/JavaRuntimeSupport.h>
    18.5  
    18.6  
    18.7 -// returns 10.7 for Lion, 10.6 for SnowLeopard etc.
    18.8 -double getOSXMajorVersion() {
    18.9 -    char *version = JRSCopyOSVersion();
   18.10 -
   18.11 -    if (version == NULL) return 0.0;
   18.12 -
   18.13 -    char temp[32];
   18.14 -    strlcpy(temp, version, sizeof(temp));
   18.15 -    free(version);
   18.16 -
   18.17 -    if (strlen(temp) < 3) {
   18.18 -        return 0.0;
   18.19 +// returns 107 for Lion, 106 for SnowLeopard etc.
   18.20 +int getOSXMajorVersion() {
   18.21 +    char *ver = JRSCopyOSVersion();
   18.22 +    if (ver == NULL) { 
   18.23 +        return 0;
   18.24      }
   18.25  
   18.26 -    if (temp[2] != '.')  { // Third char must be a '.'
   18.27 -        return 0.0;
   18.28 +    int len = strlen(ver);
   18.29 +    int v = 0;
   18.30 +    
   18.31 +    // Third char must be a '.'    
   18.32 +    if (len >= 3 && ver[2] == '.') {
   18.33 +        int i;
   18.34 +        
   18.35 +        v = (ver[0] - '0') * 10 + (ver[1] - '0');
   18.36 +        for (i = 3; i < len && isdigit(ver[i]); ++i) {
   18.37 +            v = v * 10 + (ver[i] - '0');
   18.38 +        }
   18.39      }
   18.40  
   18.41 -    char *ptr = strchr(temp+3, '.'); // remove the second . if one exists.
   18.42 -    if (ptr != NULL) {
   18.43 -        *ptr = 0;
   18.44 -    }
   18.45 -
   18.46 -    return atof(temp);
   18.47 +    free(ver);
   18.48 +    
   18.49 +    return v;
   18.50  }
   18.51  
   18.52 -
   18.53  BOOL isSnowLeopardOrLower() {
   18.54 -    return (getOSXMajorVersion() < 10.7);
   18.55 +    return (getOSXMajorVersion() < 107);
   18.56  }
    19.1 --- a/src/share/classes/com/sun/crypto/provider/DHKeyAgreement.java	Thu Mar 22 12:41:26 2012 -0700
    19.2 +++ b/src/share/classes/com/sun/crypto/provider/DHKeyAgreement.java	Mon Mar 26 17:31:42 2012 -0700
    19.3 @@ -1,5 +1,5 @@
    19.4  /*
    19.5 - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
    19.6 + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
    19.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    19.8   *
    19.9   * This code is free software; you can redistribute it and/or modify it
   19.10 @@ -33,6 +33,7 @@
   19.11  import java.security.Key;
   19.12  import java.security.NoSuchAlgorithmException;
   19.13  import java.security.SecureRandom;
   19.14 +import java.security.ProviderException;
   19.15  import java.security.spec.AlgorithmParameterSpec;
   19.16  import java.security.spec.InvalidKeySpecException;
   19.17  import javax.crypto.KeyAgreementSpi;
   19.18 @@ -234,31 +235,14 @@
   19.19      protected byte[] engineGenerateSecret()
   19.20          throws IllegalStateException
   19.21      {
   19.22 -        if (generateSecret == false) {
   19.23 -            throw new IllegalStateException
   19.24 -                ("Key agreement has not been completed yet");
   19.25 +        int expectedLen = (init_p.bitLength() + 7) >>> 3;
   19.26 +        byte[] result = new byte[expectedLen];
   19.27 +        try {
   19.28 +            engineGenerateSecret(result, 0);
   19.29 +        } catch (ShortBufferException sbe) {
   19.30 +            // should never happen since length are identical
   19.31          }
   19.32 -
   19.33 -        // Reset the key agreement here (in case anything goes wrong)
   19.34 -        generateSecret = false;
   19.35 -
   19.36 -        // get the modulus
   19.37 -        BigInteger modulus = init_p;
   19.38 -
   19.39 -        BigInteger tmpResult = y.modPow(x, modulus);
   19.40 -        byte[] secret = tmpResult.toByteArray();
   19.41 -
   19.42 -        /*
   19.43 -         * BigInteger.toByteArray will sometimes put a sign byte up front, but
   19.44 -         * we NEVER want one.
   19.45 -         */
   19.46 -        if ((tmpResult.bitLength() % 8) == 0) {
   19.47 -            byte retval[] = new byte[secret.length - 1];
   19.48 -            System.arraycopy(secret, 1, retval, 0, retval.length);
   19.49 -            return retval;
   19.50 -        } else {
   19.51 -            return secret;
   19.52 -        }
   19.53 +        return result;
   19.54      }
   19.55  
   19.56      /**
   19.57 @@ -301,39 +285,51 @@
   19.58          }
   19.59  
   19.60          BigInteger modulus = init_p;
   19.61 +        int expectedLen = (modulus.bitLength() + 7) >>> 3;
   19.62 +        if ((sharedSecret.length - offset) < expectedLen) {
   19.63 +            throw new ShortBufferException
   19.64 +                    ("Buffer too short for shared secret");
   19.65 +        }
   19.66 +
   19.67 +        // Reset the key agreement after checking for ShortBufferException
   19.68 +        // above, so user can recover w/o losing internal state
   19.69 +        generateSecret = false;
   19.70 +
   19.71 +        /*
   19.72 +         * NOTE: BigInteger.toByteArray() returns a byte array containing
   19.73 +         * the two's-complement representation of this BigInteger with
   19.74 +         * the most significant byte is in the zeroth element. This
   19.75 +         * contains the minimum number of bytes required to represent
   19.76 +         * this BigInteger, including at least one sign bit whose value
   19.77 +         * is always 0.
   19.78 +         *
   19.79 +         * Keys are always positive, and the above sign bit isn't
   19.80 +         * actually used when representing keys.  (i.e. key = new
   19.81 +         * BigInteger(1, byteArray))  To obtain an array containing
   19.82 +         * exactly expectedLen bytes of magnitude, we strip any extra
   19.83 +         * leading 0's, or pad with 0's in case of a "short" secret.
   19.84 +         */
   19.85          byte[] secret = this.y.modPow(this.x, modulus).toByteArray();
   19.86 -
   19.87 -        // BigInteger.toByteArray will sometimes put a sign byte up front,
   19.88 -        // but we NEVER want one.
   19.89 -        if ((secret.length << 3) != modulus.bitLength()) {
   19.90 -            if ((sharedSecret.length - offset) < (secret.length - 1)) {
   19.91 -                throw new ShortBufferException
   19.92 -                    ("Buffer too short for shared secret");
   19.93 +        if (secret.length == expectedLen) {
   19.94 +            System.arraycopy(secret, 0, sharedSecret, offset,
   19.95 +                             secret.length);
   19.96 +        } else {
   19.97 +            // Array too short, pad it w/ leading 0s
   19.98 +            if (secret.length < expectedLen) {
   19.99 +                System.arraycopy(secret, 0, sharedSecret,
  19.100 +                    offset + (expectedLen - secret.length),
  19.101 +                    secret.length);
  19.102 +            } else {
  19.103 +                // Array too long, check and trim off the excess
  19.104 +                if ((secret.length == (expectedLen+1)) && secret[0] == 0) {
  19.105 +                    // ignore the leading sign byte
  19.106 +                    System.arraycopy(secret, 1, sharedSecret, offset, expectedLen);
  19.107 +                } else {
  19.108 +                    throw new ProviderException("Generated secret is out-of-range");
  19.109 +                }
  19.110              }
  19.111 -            System.arraycopy(secret, 1, sharedSecret, offset,
  19.112 -                             secret.length - 1);
  19.113 -
  19.114 -            // Reset the key agreement here (not earlier!), so that people
  19.115 -            // can recover from ShortBufferException above without losing
  19.116 -            // internal state
  19.117 -            generateSecret = false;
  19.118 -
  19.119 -            return secret.length - 1;
  19.120 -
  19.121 -        } else {
  19.122 -            if ((sharedSecret.length - offset) < secret.length) {
  19.123 -                throw new ShortBufferException
  19.124 -                    ("Buffer too short to hold shared secret");
  19.125 -            }
  19.126 -            System.arraycopy(secret, 0, sharedSecret, offset, secret.length);
  19.127 -
  19.128 -            // Reset the key agreement here (not earlier!), so that people
  19.129 -            // can recover from ShortBufferException above without losing
  19.130 -            // internal state
  19.131 -            generateSecret = false;
  19.132 -
  19.133 -            return secret.length;
  19.134          }
  19.135 +        return expectedLen;
  19.136      }
  19.137  
  19.138      /**
    20.1 --- a/src/share/classes/java/lang/management/ManagementFactory.java	Thu Mar 22 12:41:26 2012 -0700
    20.2 +++ b/src/share/classes/java/lang/management/ManagementFactory.java	Mon Mar 26 17:31:42 2012 -0700
    20.3 @@ -1,5 +1,5 @@
    20.4  /*
    20.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
    20.6 + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
    20.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    20.8   *
    20.9   * This code is free software; you can redistribute it and/or modify it
   20.10 @@ -42,7 +42,7 @@
   20.11  import java.util.Collections;
   20.12  import java.util.List;
   20.13  import java.util.Set;
   20.14 -import java.util.TreeSet;
   20.15 +import java.util.HashSet;
   20.16  import java.security.AccessController;
   20.17  import java.security.Permission;
   20.18  import java.security.PrivilegedAction;
   20.19 @@ -787,7 +787,7 @@
   20.20             getPlatformManagementInterfaces()
   20.21      {
   20.22          Set<Class<? extends PlatformManagedObject>> result =
   20.23 -            new TreeSet<>();
   20.24 +            new HashSet<>();
   20.25          for (PlatformComponent component: PlatformComponent.values()) {
   20.26              result.add(component.getMXBeanInterface());
   20.27          }
    21.1 --- a/src/share/classes/java/net/InMemoryCookieStore.java	Thu Mar 22 12:41:26 2012 -0700
    21.2 +++ b/src/share/classes/java/net/InMemoryCookieStore.java	Mon Mar 26 17:31:42 2012 -0700
    21.3 @@ -207,6 +207,9 @@
    21.4      public boolean removeAll() {
    21.5          lock.lock();
    21.6          try {
    21.7 +            if (cookieJar.isEmpty()) {
    21.8 +                return false;
    21.9 +            }
   21.10              cookieJar.clear();
   21.11              domainIndex.clear();
   21.12              uriIndex.clear();
    22.1 --- a/src/share/classes/java/util/Currency.java	Thu Mar 22 12:41:26 2012 -0700
    22.2 +++ b/src/share/classes/java/util/Currency.java	Mon Mar 26 17:31:42 2012 -0700
    22.3 @@ -34,6 +34,8 @@
    22.4  import java.io.Serializable;
    22.5  import java.security.AccessController;
    22.6  import java.security.PrivilegedAction;
    22.7 +import java.util.concurrent.ConcurrentHashMap;
    22.8 +import java.util.concurrent.ConcurrentMap;
    22.9  import java.util.logging.Level;
   22.10  import java.util.regex.Pattern;
   22.11  import java.util.regex.Matcher;
   22.12 @@ -99,7 +101,7 @@
   22.13  
   22.14      // class data: instance map
   22.15  
   22.16 -    private static HashMap<String, Currency> instances = new HashMap<String, Currency>(7);
   22.17 +    private static ConcurrentMap<String, Currency> instances = new ConcurrentHashMap<>(7);
   22.18      private static HashSet<Currency> available;
   22.19  
   22.20  
   22.21 @@ -284,7 +286,6 @@
   22.22  
   22.23      private static Currency getInstance(String currencyCode, int defaultFractionDigits,
   22.24          int numericCode) {
   22.25 -        synchronized (instances) {
   22.26              // Try to look up the currency code in the instances table.
   22.27              // This does the null pointer check as a side effect.
   22.28              // Also, if there already is an entry, the currencyCode must be valid.
   22.29 @@ -322,10 +323,9 @@
   22.30                  }
   22.31              }
   22.32  
   22.33 -            instance = new Currency(currencyCode, defaultFractionDigits, numericCode);
   22.34 -            instances.put(currencyCode, instance);
   22.35 -            return instance;
   22.36 -        }
   22.37 +        instance = instances.putIfAbsent(currencyCode,
   22.38 +                   new Currency(currencyCode, defaultFractionDigits, numericCode));
   22.39 +        return (instance != null ? instance : instances.get(currencyCode));
   22.40      }
   22.41  
   22.42      /**
    23.1 --- a/src/share/classes/java/util/jar/Manifest.java	Thu Mar 22 12:41:26 2012 -0700
    23.2 +++ b/src/share/classes/java/util/jar/Manifest.java	Mon Mar 26 17:31:42 2012 -0700
    23.3 @@ -400,6 +400,8 @@
    23.4          public byte peek() throws IOException {
    23.5              if (pos == count)
    23.6                  fill();
    23.7 +            if (pos == count)
    23.8 +                return -1; // nothing left in buffer
    23.9              return buf[pos];
   23.10          }
   23.11  
    24.1 --- a/src/share/classes/javax/swing/DefaultListSelectionModel.java	Thu Mar 22 12:41:26 2012 -0700
    24.2 +++ b/src/share/classes/javax/swing/DefaultListSelectionModel.java	Mon Mar 26 17:31:42 2012 -0700
    24.3 @@ -252,6 +252,10 @@
    24.4  
    24.5      // Updates first and last change indices
    24.6      private void markAsDirty(int r) {
    24.7 +        if (r == -1) {
    24.8 +            return;
    24.9 +        }
   24.10 +
   24.11          firstAdjustedIndex = Math.min(firstAdjustedIndex, r);
   24.12          lastAdjustedIndex =  Math.max(lastAdjustedIndex, r);
   24.13      }
   24.14 @@ -358,16 +362,12 @@
   24.15      private void updateLeadAnchorIndices(int anchorIndex, int leadIndex) {
   24.16          if (leadAnchorNotificationEnabled) {
   24.17              if (this.anchorIndex != anchorIndex) {
   24.18 -                if (this.anchorIndex != -1) { // The unassigned state.
   24.19 -                    markAsDirty(this.anchorIndex);
   24.20 -                }
   24.21 +                markAsDirty(this.anchorIndex);
   24.22                  markAsDirty(anchorIndex);
   24.23              }
   24.24  
   24.25              if (this.leadIndex != leadIndex) {
   24.26 -                if (this.leadIndex != -1) { // The unassigned state.
   24.27 -                    markAsDirty(this.leadIndex);
   24.28 -                }
   24.29 +                markAsDirty(this.leadIndex);
   24.30                  markAsDirty(leadIndex);
   24.31              }
   24.32          }
    25.1 --- a/src/share/classes/sun/rmi/rmic/BatchEnvironment.java	Thu Mar 22 12:41:26 2012 -0700
    25.2 +++ b/src/share/classes/sun/rmi/rmic/BatchEnvironment.java	Mon Mar 26 17:31:42 2012 -0700
    25.3 @@ -160,7 +160,7 @@
    25.4      }
    25.5  
    25.6      /** list of generated source files created in this environment */
    25.7 -    private Vector generatedFiles = new Vector();
    25.8 +    private Vector<File> generatedFiles = new Vector<>();
    25.9  
   25.10      /**
   25.11       * Remember a generated source file generated so that it
   25.12 @@ -177,9 +177,9 @@
   25.13       */
   25.14      public void deleteGeneratedFiles() {
   25.15          synchronized(generatedFiles) {
   25.16 -            Enumeration enumeration = generatedFiles.elements();
   25.17 +            Enumeration<File> enumeration = generatedFiles.elements();
   25.18              while (enumeration.hasMoreElements()) {
   25.19 -                File file = (File) enumeration.nextElement();
   25.20 +                File file = enumeration.nextElement();
   25.21                  file.delete();
   25.22              }
   25.23              generatedFiles.removeAllElements();
    26.1 --- a/src/share/classes/sun/rmi/rmic/Main.java	Thu Mar 22 12:41:26 2012 -0700
    26.2 +++ b/src/share/classes/sun/rmi/rmic/Main.java	Mon Mar 26 17:31:42 2012 -0700
    26.3 @@ -73,14 +73,15 @@
    26.4      File destDir;
    26.5      int flags;
    26.6      long tm;
    26.7 -    Vector classes;
    26.8 +    Vector<String> classes;
    26.9      boolean nowrite;
   26.10      boolean nocompile;
   26.11      boolean keepGenerated;
   26.12      boolean status;
   26.13      String[] generatorArgs;
   26.14 -    Vector generators;
   26.15 -    Class environmentClass = BatchEnvironment.class;
   26.16 +    Vector<Generator> generators;
   26.17 +    Class<? extends BatchEnvironment> environmentClass =
   26.18 +        BatchEnvironment.class;
   26.19      boolean iiopGeneration = false;
   26.20  
   26.21      /**
   26.22 @@ -183,7 +184,7 @@
   26.23          destDir = null;
   26.24          flags = F_WARNINGS;
   26.25          tm = System.currentTimeMillis();
   26.26 -        classes = new Vector();
   26.27 +        classes = new Vector<>();
   26.28          nowrite = false;
   26.29          nocompile = false;
   26.30          keepGenerated = false;
   26.31 @@ -191,7 +192,7 @@
   26.32          if (generatorArgs == null) {
   26.33              return false;
   26.34          }
   26.35 -        generators = new Vector();
   26.36 +        generators = new Vector<>();
   26.37  
   26.38          // Pre-process command line for @file arguments
   26.39          try {
   26.40 @@ -411,7 +412,7 @@
   26.41  
   26.42          // Get the environment required by this generator...
   26.43  
   26.44 -        Class envClass = BatchEnvironment.class;
   26.45 +        Class<?> envClass = BatchEnvironment.class;
   26.46          String env = getString("generator.env." + arg);
   26.47          if (env != null) {
   26.48              try {
   26.49 @@ -423,7 +424,7 @@
   26.50  
   26.51                      // Yes, so switch to the new one...
   26.52  
   26.53 -                    environmentClass = envClass;
   26.54 +                    environmentClass = envClass.asSubclass(BatchEnvironment.class);
   26.55  
   26.56                  } else {
   26.57  
   26.58 @@ -495,8 +496,9 @@
   26.59          try {
   26.60              Class[] ctorArgTypes = {OutputStream.class,ClassPath.class,Main.class};
   26.61              Object[] ctorArgs = {out,classPath,this};
   26.62 -            Constructor constructor = environmentClass.getConstructor(ctorArgTypes);
   26.63 -            result = (BatchEnvironment) constructor.newInstance(ctorArgs);
   26.64 +            Constructor<? extends BatchEnvironment> constructor =
   26.65 +                environmentClass.getConstructor(ctorArgTypes);
   26.66 +            result =  constructor.newInstance(ctorArgs);
   26.67              result.reset();
   26.68          }
   26.69          catch (Exception e) {
   26.70 @@ -530,7 +532,7 @@
   26.71               */
   26.72              for (int i = classes.size()-1; i >= 0; i-- ) {
   26.73                  Identifier implClassName =
   26.74 -                    Identifier.lookup((String)classes.elementAt(i));
   26.75 +                    Identifier.lookup(classes.elementAt(i));
   26.76  
   26.77                  /*
   26.78                   * Fix bugid 4049354: support using '.' as an inner class
   26.79 @@ -558,7 +560,7 @@
   26.80                  try {
   26.81                      ClassDefinition def = decl.getClassDefinition(env);
   26.82                      for (int j = 0; j < generators.size(); j++) {
   26.83 -                        Generator gen = (Generator)generators.elementAt(j);
   26.84 +                        Generator gen = generators.elementAt(j);
   26.85                          gen.generate(env, def, destDir);
   26.86                      }
   26.87                  } catch (ClassNotFound ex) {
   26.88 @@ -673,7 +675,7 @@
   26.89  
   26.90          do {
   26.91              done = true;
   26.92 -            for (Enumeration e = env.getClasses() ; e.hasMoreElements() ; ) {
   26.93 +            for (Enumeration<?> e = env.getClasses() ; e.hasMoreElements() ; ) {
   26.94                  ClassDeclaration c = (ClassDeclaration)e.nextElement();
   26.95                  done = compileClass(c,buf,env);
   26.96              }
   26.97 @@ -682,7 +684,9 @@
   26.98  
   26.99      /*
  26.100       * Compile a single class.
  26.101 +     * Fallthrough is intentional
  26.102       */
  26.103 +    @SuppressWarnings("fallthrough")
  26.104      public boolean compileClass (ClassDeclaration c,
  26.105                                   ByteArrayOutputStream buf,
  26.106                                   BatchEnvironment env)
  26.107 @@ -879,6 +883,6 @@
  26.108          args[1] = (arg1 != null ? arg1.toString() : "null");
  26.109          args[2] = (arg2 != null ? arg2.toString() : "null");
  26.110  
  26.111 -        return java.text.MessageFormat.format(format, args);
  26.112 +        return java.text.MessageFormat.format(format, (Object[]) args);
  26.113      }
  26.114  }
    27.1 --- a/src/share/classes/sun/rmi/rmic/RMIGenerator.java	Thu Mar 22 12:41:26 2012 -0700
    27.2 +++ b/src/share/classes/sun/rmi/rmic/RMIGenerator.java	Mon Mar 26 17:31:42 2012 -0700
    27.3 @@ -61,7 +61,7 @@
    27.4   */
    27.5  public class RMIGenerator implements RMIConstants, Generator {
    27.6  
    27.7 -    private static final Hashtable versionOptions = new Hashtable();
    27.8 +    private static final Hashtable<String, Integer> versionOptions = new Hashtable<>();
    27.9      static {
   27.10          versionOptions.put("-v1.1", new Integer(STUB_VERSION_1_1));
   27.11          versionOptions.put("-vcompat", new Integer(STUB_VERSION_FAT));
   27.12 @@ -96,7 +96,7 @@
   27.13                          return false;
   27.14                      }
   27.15                      explicitVersion = arg;
   27.16 -                    version = ((Integer) versionOptions.get(arg)).intValue();
   27.17 +                    version = versionOptions.get(arg);
   27.18                      argv[i] = null;
   27.19                  }
   27.20              }
   27.21 @@ -519,7 +519,7 @@
   27.22           * follows a previous catch of it or of one of its superclasses.
   27.23           * The following method invocation takes care of these details.
   27.24           */
   27.25 -        Vector catchList = computeUniqueCatchList(exceptions);
   27.26 +        Vector<ClassDefinition> catchList = computeUniqueCatchList(exceptions);
   27.27  
   27.28          /*
   27.29           * If we need to catch any particular exceptions (i.e. this method
   27.30 @@ -615,10 +615,10 @@
   27.31           * UnexpectedException, and end the try block.
   27.32           */
   27.33          if (catchList.size() > 0) {
   27.34 -            for (Enumeration enumeration = catchList.elements();
   27.35 +            for (Enumeration<ClassDefinition> enumeration = catchList.elements();
   27.36                   enumeration.hasMoreElements();)
   27.37              {
   27.38 -                ClassDefinition def = (ClassDefinition) enumeration.nextElement();
   27.39 +                ClassDefinition def = enumeration.nextElement();
   27.40                  p.pOlnI("} catch (" + def.getName() + " e) {");
   27.41                  p.pln("throw e;");
   27.42              }
   27.43 @@ -650,8 +650,8 @@
   27.44       * of its superclasses is in the throws clause of the method, indicating
   27.45       * that no exceptions need to be caught.
   27.46       */
   27.47 -    private Vector computeUniqueCatchList(ClassDeclaration[] exceptions) {
   27.48 -        Vector uniqueList = new Vector();       // unique exceptions to catch
   27.49 +    private Vector<ClassDefinition> computeUniqueCatchList(ClassDeclaration[] exceptions) {
   27.50 +        Vector<ClassDefinition> uniqueList = new Vector<>();       // unique exceptions to catch
   27.51  
   27.52          uniqueList.addElement(defRuntimeException);
   27.53          uniqueList.addElement(defRemoteException);
   27.54 @@ -682,8 +682,7 @@
   27.55                   * exceptions that need to be caught:
   27.56                   */
   27.57                  for (int j = 0; j < uniqueList.size();) {
   27.58 -                    ClassDefinition def =
   27.59 -                        (ClassDefinition) uniqueList.elementAt(j);
   27.60 +                    ClassDefinition def = uniqueList.elementAt(j);
   27.61                      if (def.superClassOf(env, decl)) {
   27.62                          /*
   27.63                           * If a superclass of this exception is already on
    28.1 --- a/src/share/classes/sun/rmi/rmic/newrmic/Main.java	Thu Mar 22 12:41:26 2012 -0700
    28.2 +++ b/src/share/classes/sun/rmi/rmic/newrmic/Main.java	Mon Mar 26 17:31:42 2012 -0700
    28.3 @@ -455,7 +455,7 @@
    28.4          BatchEnvironment env;
    28.5          try {
    28.6              Constructor<? extends BatchEnvironment> cons =
    28.7 -                batch.envClass.getConstructor(new Class[] { RootDoc.class });
    28.8 +                batch.envClass.getConstructor(new Class<?>[] { RootDoc.class });
    28.9              env = cons.newInstance(rootDoc);
   28.10          } catch (NoSuchMethodException e) {
   28.11              throw new AssertionError(e);
    29.1 --- a/src/share/classes/sun/rmi/rmic/newrmic/Resources.java	Thu Mar 22 12:41:26 2012 -0700
    29.2 +++ b/src/share/classes/sun/rmi/rmic/newrmic/Resources.java	Mon Mar 26 17:31:42 2012 -0700
    29.3 @@ -69,7 +69,7 @@
    29.4              format = "missing resource key: key = \"" + key + "\", " +
    29.5                  "arguments = \"{0}\", \"{1}\", \"{2}\"";
    29.6          }
    29.7 -        return MessageFormat.format(format, args);
    29.8 +        return MessageFormat.format(format, (Object[]) args);
    29.9      }
   29.10  
   29.11      /**
    30.1 --- a/src/share/classes/sun/security/pkcs11/P11KeyAgreement.java	Thu Mar 22 12:41:26 2012 -0700
    30.2 +++ b/src/share/classes/sun/security/pkcs11/P11KeyAgreement.java	Mon Mar 26 17:31:42 2012 -0700
    30.3 @@ -1,5 +1,5 @@
    30.4  /*
    30.5 - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
    30.6 + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
    30.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    30.8   *
    30.9   * This code is free software; you can redistribute it and/or modify it
   30.10 @@ -198,8 +198,22 @@
   30.11              token.p11.C_GetAttributeValue(session.id(), keyID, attributes);
   30.12              byte[] secret = attributes[0].getByteArray();
   30.13              token.p11.C_DestroyObject(session.id(), keyID);
   30.14 -            // trim leading 0x00 bytes per JCE convention
   30.15 -            return P11Util.trimZeroes(secret);
   30.16 +            // Some vendors, e.g. NSS, trim off the leading 0x00 byte(s) from
   30.17 +            // the generated secret. Thus, we need to check the secret length
   30.18 +            // and trim/pad it so the returned value has the same length as
   30.19 +            // the modulus size
   30.20 +            if (secret.length == secretLen) {
   30.21 +                return secret;
   30.22 +            } else {
   30.23 +                if (secret.length > secretLen) {
   30.24 +                    // Shouldn't happen; but check just in case
   30.25 +                    throw new ProviderException("generated secret is out-of-range");
   30.26 +                }
   30.27 +                byte[] newSecret = new byte[secretLen];
   30.28 +                System.arraycopy(secret, 0, newSecret, secretLen - secret.length,
   30.29 +                    secret.length);
   30.30 +                return newSecret;
   30.31 +            }
   30.32          } catch (PKCS11Exception e) {
   30.33              throw new ProviderException("Could not derive key", e);
   30.34          } finally {
    31.1 --- a/src/solaris/native/java/util/TimeZone_md.c	Thu Mar 22 12:41:26 2012 -0700
    31.2 +++ b/src/solaris/native/java/util/TimeZone_md.c	Mon Mar 26 17:31:42 2012 -0700
    31.3 @@ -1,5 +1,5 @@
    31.4  /*
    31.5 - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
    31.6 + * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
    31.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    31.8   *
    31.9   * This code is free software; you can redistribute it and/or modify it
   31.10 @@ -96,9 +96,9 @@
   31.11  /*
   31.12   * Scans the specified directory and its subdirectories to find a
   31.13   * zoneinfo file which has the same content as /etc/localtime on Linux
   31.14 - * or /usr/share/lib/zoneinfo/localtime (most likely a symbolic link)
   31.15 - * on Solaris given in 'buf'. Returns a zone ID if found, otherwise,
   31.16 - * NULL is returned.
   31.17 + * or /usr/share/lib/zoneinfo/localtime on Solaris given in 'buf'.
   31.18 + * If file is symbolic link, then the contents it points to are in buf.
   31.19 + * Returns a zone ID if found, otherwise, NULL is returned.
   31.20   */
   31.21  static char *
   31.22  findZoneinfoFile(char *buf, size_t size, const char *dir)
   31.23 @@ -280,21 +280,27 @@
   31.24          tz = getZoneName(linkbuf);
   31.25          if (tz != NULL) {
   31.26              tz = strdup(tz);
   31.27 +            return tz;
   31.28          }
   31.29 -        return tz;
   31.30      }
   31.31  
   31.32      /*
   31.33       * If it's a regular file, we need to find out the same zoneinfo file
   31.34       * that has been copied as /etc/localtime.
   31.35 +     * If initial symbolic link resolution failed, we should treat target
   31.36 +     * file as a regular file.
   31.37       */
   31.38 +    if ((fd = open(DEFAULT_ZONEINFO_FILE, O_RDONLY)) == -1) {
   31.39 +        return NULL;
   31.40 +    }
   31.41 +    if (fstat(fd, &statbuf) == -1) {
   31.42 +        (void) close(fd);
   31.43 +        return NULL;
   31.44 +    }
   31.45      size = (size_t) statbuf.st_size;
   31.46      buf = (char *) malloc(size);
   31.47      if (buf == NULL) {
   31.48 -        return NULL;
   31.49 -    }
   31.50 -    if ((fd = open(DEFAULT_ZONEINFO_FILE, O_RDONLY)) == -1) {
   31.51 -        free((void *) buf);
   31.52 +        (void) close(fd);
   31.53          return NULL;
   31.54      }
   31.55  
    32.1 --- a/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	Thu Mar 22 12:41:26 2012 -0700
    32.2 +++ b/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	Mon Mar 26 17:31:42 2012 -0700
    32.3 @@ -541,6 +541,8 @@
    32.4          J2dRlsTraceLn1(J2D_TRACE_ERROR,
    32.5                         "X11SD_SetupSharedSegment shmget has failed: %s",
    32.6                         strerror(errno));
    32.7 +        free((void *)shminfo);
    32.8 +        XDestroyImage(img);
    32.9          return NULL;
   32.10      }
   32.11  
   32.12 @@ -550,6 +552,8 @@
   32.13          J2dRlsTraceLn1(J2D_TRACE_ERROR,
   32.14                         "X11SD_SetupSharedSegment shmat has failed: %s",
   32.15                         strerror(errno));
   32.16 +        free((void *)shminfo);
   32.17 +        XDestroyImage(img);
   32.18          return NULL;
   32.19      }
   32.20  
   32.21 @@ -570,6 +574,9 @@
   32.22          J2dRlsTraceLn1(J2D_TRACE_ERROR,
   32.23                         "X11SD_SetupSharedSegment XShmAttach has failed: %s",
   32.24                         strerror(errno));
   32.25 +        shmdt(shminfo->shmaddr);
   32.26 +        free((void *)shminfo);
   32.27 +        XDestroyImage(img);
   32.28          return NULL;
   32.29      }
   32.30  
   32.31 @@ -1345,13 +1352,10 @@
   32.32  #ifdef MITSHM
   32.33          if (image->obdata != NULL) {
   32.34              X11SD_DropSharedSegment((XShmSegmentInfo*)image->obdata);
   32.35 -        } else {
   32.36 -            free(image->data);
   32.37 +            image->obdata = NULL;
   32.38          }
   32.39 -#else
   32.40 -        free(image->data);
   32.41  #endif /* MITSHM */
   32.42 -        XFree(image);
   32.43 +        XDestroyImage(image);
   32.44      }
   32.45  }
   32.46  
    33.1 --- a/src/solaris/native/sun/nio/ch/DatagramDispatcher.c	Thu Mar 22 12:41:26 2012 -0700
    33.2 +++ b/src/solaris/native/sun/nio/ch/DatagramDispatcher.c	Mon Mar 26 17:31:42 2012 -0700
    33.3 @@ -36,6 +36,7 @@
    33.4  #include <sys/socket.h>
    33.5  
    33.6  #include "nio_util.h"
    33.7 +#include <limits.h>
    33.8  
    33.9  JNIEXPORT jint JNICALL
   33.10  Java_sun_nio_ch_DatagramDispatcher_read0(JNIEnv *env, jclass clazz,
   33.11 @@ -60,23 +61,14 @@
   33.12      ssize_t result = 0;
   33.13      struct iovec *iov = (struct iovec *)jlong_to_ptr(address);
   33.14      struct msghdr m;
   33.15 -    if (len > 16) {
   33.16 -        len = 16;
   33.17 +    if (len > IOV_MAX) {
   33.18 +        len = IOV_MAX;
   33.19      }
   33.20  
   33.21 -    m.msg_name = NULL;
   33.22 -    m.msg_namelen = 0;
   33.23 +    // initialize the message
   33.24 +    memset(&m, 0, sizeof(m));
   33.25      m.msg_iov = iov;
   33.26      m.msg_iovlen = len;
   33.27 -#ifdef __solaris__
   33.28 -    m.msg_accrights = NULL;
   33.29 -    m.msg_accrightslen = 0;
   33.30 -#endif
   33.31 -
   33.32 -#if defined(__linux__) || defined(_ALLBSD_SOURCE)
   33.33 -    m.msg_control = NULL;
   33.34 -    m.msg_controllen = 0;
   33.35 -#endif
   33.36  
   33.37      result = recvmsg(fd, &m, 0);
   33.38      if (result < 0 && errno == ECONNREFUSED) {
   33.39 @@ -108,23 +100,14 @@
   33.40      struct iovec *iov = (struct iovec *)jlong_to_ptr(address);
   33.41      struct msghdr m;
   33.42      ssize_t result = 0;
   33.43 -    if (len > 16) {
   33.44 -        len = 16;
   33.45 +    if (len > IOV_MAX) {
   33.46 +        len = IOV_MAX;
   33.47      }
   33.48  
   33.49 -    m.msg_name = NULL;
   33.50 -    m.msg_namelen = 0;
   33.51 +    // initialize the message
   33.52 +    memset(&m, 0, sizeof(m));
   33.53      m.msg_iov = iov;
   33.54      m.msg_iovlen = len;
   33.55 -#ifdef __solaris__
   33.56 -    m.msg_accrights = NULL;
   33.57 -    m.msg_accrightslen = 0;
   33.58 -#endif
   33.59 -
   33.60 -#if defined(__linux__) || defined(_ALLBSD_SOURCE)
   33.61 -    m.msg_control = NULL;
   33.62 -    m.msg_controllen = 0;
   33.63 -#endif
   33.64  
   33.65      result = sendmsg(fd, &m, 0);
   33.66      if (result < 0 && errno == ECONNREFUSED) {
    34.1 --- a/src/solaris/native/sun/nio/fs/GnomeFileTypeDetector.c	Thu Mar 22 12:41:26 2012 -0700
    34.2 +++ b/src/solaris/native/sun/nio/fs/GnomeFileTypeDetector.c	Mon Mar 26 17:31:42 2012 -0700
    34.3 @@ -30,9 +30,6 @@
    34.4  
    34.5  #include <stdlib.h>
    34.6  #include <dlfcn.h>
    34.7 -#ifndef __APPLE__
    34.8 -#include <link.h>
    34.9 -#endif
   34.10  
   34.11  #ifdef __solaris__
   34.12  #include <strings.h>
    35.1 --- a/src/solaris/native/sun/security/jgss/wrapper/NativeFunc.c	Thu Mar 22 12:41:26 2012 -0700
    35.2 +++ b/src/solaris/native/sun/security/jgss/wrapper/NativeFunc.c	Mon Mar 26 17:31:42 2012 -0700
    35.3 @@ -26,9 +26,6 @@
    35.4  #include <stdio.h>
    35.5  #include <stdlib.h>
    35.6  #include <dlfcn.h>
    35.7 -#ifndef __APPLE__
    35.8 -#include <link.h>
    35.9 -#endif
   35.10  #include "NativeFunc.h"
   35.11  
   35.12  /* standard GSS method names (ordering is from mapfile) */
    36.1 --- a/src/solaris/native/sun/security/pkcs11/j2secmod_md.c	Thu Mar 22 12:41:26 2012 -0700
    36.2 +++ b/src/solaris/native/sun/security/pkcs11/j2secmod_md.c	Mon Mar 26 17:31:42 2012 -0700
    36.3 @@ -28,9 +28,6 @@
    36.4  #include <string.h>
    36.5  
    36.6  #include <dlfcn.h>
    36.7 -#ifndef __APPLE__
    36.8 -#include <link.h>
    36.9 -#endif
   36.10  
   36.11  #include <jni_util.h>
   36.12  
    37.1 --- a/src/solaris/native/sun/security/pkcs11/wrapper/p11_md.c	Thu Mar 22 12:41:26 2012 -0700
    37.2 +++ b/src/solaris/native/sun/security/pkcs11/wrapper/p11_md.c	Mon Mar 26 17:31:42 2012 -0700
    37.3 @@ -64,9 +64,6 @@
    37.4  #include <assert.h>
    37.5  
    37.6  #include <dlfcn.h>
    37.7 -#ifndef __APPLE__
    37.8 -#include <link.h>
    37.9 -#endif
   37.10  
   37.11  #include <jni.h>
   37.12  
    38.1 --- a/src/solaris/native/sun/security/smartcardio/pcsc_md.c	Thu Mar 22 12:41:26 2012 -0700
    38.2 +++ b/src/solaris/native/sun/security/smartcardio/pcsc_md.c	Mon Mar 26 17:31:42 2012 -0700
    38.3 @@ -29,9 +29,6 @@
    38.4  #include <assert.h>
    38.5  
    38.6  #include <dlfcn.h>
    38.7 -#ifndef __APPLE__
    38.8 -#include <link.h>
    38.9 -#endif
   38.10  
   38.11  #include <winscard.h>
   38.12  
    39.1 --- a/src/solaris/npt/npt_md.h	Thu Mar 22 12:41:26 2012 -0700
    39.2 +++ b/src/solaris/npt/npt_md.h	Mon Mar 26 17:31:42 2012 -0700
    39.3 @@ -32,9 +32,6 @@
    39.4  #include <string.h>
    39.5  #include <errno.h>
    39.6  #include <dlfcn.h>
    39.7 -#ifndef __APPLE__
    39.8 -#include <link.h>
    39.9 -#endif
   39.10  #include <jvm_md.h>
   39.11  
   39.12  #define NPT_LIBNAME "npt"
    40.1 --- a/src/windows/native/sun/windows/awt_Component.cpp	Thu Mar 22 12:41:26 2012 -0700
    40.2 +++ b/src/windows/native/sun/windows/awt_Component.cpp	Mon Mar 26 17:31:42 2012 -0700
    40.3 @@ -302,6 +302,7 @@
    40.4          delete m_childList;
    40.5  
    40.6      DestroyDropTarget();
    40.7 +    ReleaseDragCapture(0);
    40.8  
    40.9      if (m_myControlID != 0) {
   40.10          AwtComponent* parent = GetParent();
    41.1 --- a/test/ProblemList.txt	Thu Mar 22 12:41:26 2012 -0700
    41.2 +++ b/test/ProblemList.txt	Mon Mar 26 17:31:42 2012 -0700
    41.3 @@ -212,7 +212,7 @@
    41.4  # 7076644
    41.5  java/io/File/Basic.java                                         windows-all
    41.6  
    41.7 -# Test needs AWT window server, does not work headless
    41.8 +# 7145435 - Test needs AWT window server, does not work headless
    41.9  java/io/Serializable/resolveClass/deserializeButton/run.sh      macosx-all
   41.10  
   41.11  ############################################################################
   41.12 @@ -225,9 +225,6 @@
   41.13  # 7052549
   41.14  java/nio/channels/FileChannel/ReleaseOnCloseDeadlock.java 	windows-all
   41.15  
   41.16 -# 6963118
   41.17 -java/nio/channels/Selector/Wakeup.java                          windows-all
   41.18 -
   41.19  # 7133499, 7133497
   41.20  java/nio/channels/AsyncCloseAndInterrupt.java                   macosx-all
   41.21  java/nio/channels/AsynchronousFileChannel/Lock.java             macosx-all
   41.22 @@ -259,9 +256,6 @@
   41.23  
   41.24  # jdk_security
   41.25  
   41.26 -# 7145024
   41.27 -sun/security/ssl/com/sun/net/ssl/internal/ssl/GenSSLConfigs/main.java	solaris-all
   41.28 -
   41.29  # 7147060
   41.30  com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java	generic-all
   41.31  
   41.32 @@ -305,9 +299,6 @@
   41.33  # 7079203 sun/security/tools/keytool/printssl.sh fails on solaris with timeout
   41.34  sun/security/tools/keytool/printssl.sh                          solaris-all
   41.35  
   41.36 -# 7081817
   41.37 -sun/security/provider/certpath/X509CertPath/IllegalCertiticates.java    generic-all
   41.38 -
   41.39  # 7041639, Solaris DSA keypair generation bug (Note: jdk_util also affected)
   41.40  java/security/KeyPairGenerator/SolarisShortDSA.java             solaris-all
   41.41  sun/security/tools/jarsigner/onlymanifest.sh                    solaris-all
    42.1 --- a/test/com/sun/crypto/provider/KeyAgreement/DHKeyAgreement2.java	Thu Mar 22 12:41:26 2012 -0700
    42.2 +++ b/test/com/sun/crypto/provider/KeyAgreement/DHKeyAgreement2.java	Mon Mar 26 17:31:42 2012 -0700
    42.3 @@ -1,5 +1,5 @@
    42.4  /*
    42.5 - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
    42.6 + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
    42.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    42.8   *
    42.9   * This code is free software; you can redistribute it and/or modify it
   42.10 @@ -23,7 +23,7 @@
   42.11  
   42.12  /*
   42.13   * @test
   42.14 - * @bug 0000000
   42.15 + * @bug 7146728
   42.16   * @summary DHKeyAgreement2
   42.17   * @author Jan Luehe
   42.18   */
   42.19 @@ -52,15 +52,12 @@
   42.20  
   42.21  public class DHKeyAgreement2 {
   42.22  
   42.23 +    private static final String SUNJCE = "SunJCE";
   42.24      private DHKeyAgreement2() {}
   42.25  
   42.26      public static void main(String argv[]) throws Exception {
   42.27              String mode = "USE_SKIP_DH_PARAMS";
   42.28  
   42.29 -            // Add JCE to the list of providers
   42.30 -            SunJCE jce = new SunJCE();
   42.31 -            Security.addProvider(jce);
   42.32 -
   42.33              DHKeyAgreement2 keyAgree = new DHKeyAgreement2();
   42.34  
   42.35              if (argv.length > 1) {
   42.36 @@ -86,7 +83,7 @@
   42.37              // Some central authority creates new DH parameters
   42.38              System.err.println("Creating Diffie-Hellman parameters ...");
   42.39              AlgorithmParameterGenerator paramGen
   42.40 -                = AlgorithmParameterGenerator.getInstance("DH");
   42.41 +                = AlgorithmParameterGenerator.getInstance("DH", SUNJCE);
   42.42              paramGen.init(512);
   42.43              AlgorithmParameters params = paramGen.generateParameters();
   42.44              dhSkipParamSpec = (DHParameterSpec)params.getParameterSpec
   42.45 @@ -103,7 +100,7 @@
   42.46           * above
   42.47           */
   42.48          System.err.println("ALICE: Generate DH keypair ...");
   42.49 -        KeyPairGenerator aliceKpairGen = KeyPairGenerator.getInstance("DH");
   42.50 +        KeyPairGenerator aliceKpairGen = KeyPairGenerator.getInstance("DH", SUNJCE);
   42.51          aliceKpairGen.initialize(dhSkipParamSpec);
   42.52          KeyPair aliceKpair = aliceKpairGen.generateKeyPair();
   42.53          System.out.println("Alice DH public key:\n" +
   42.54 @@ -112,14 +109,14 @@
   42.55                             aliceKpair.getPrivate().toString());
   42.56          DHParameterSpec dhParamSpec =
   42.57              ((DHPublicKey)aliceKpair.getPublic()).getParams();
   42.58 -        AlgorithmParameters algParams = AlgorithmParameters.getInstance("DH");
   42.59 +        AlgorithmParameters algParams = AlgorithmParameters.getInstance("DH", SUNJCE);
   42.60          algParams.init(dhParamSpec);
   42.61          System.out.println("Alice DH parameters:\n"
   42.62                             + algParams.toString());
   42.63  
   42.64          // Alice executes Phase1 of her version of the DH protocol
   42.65          System.err.println("ALICE: Execute PHASE1 ...");
   42.66 -        KeyAgreement aliceKeyAgree = KeyAgreement.getInstance("DH");
   42.67 +        KeyAgreement aliceKeyAgree = KeyAgreement.getInstance("DH", SUNJCE);
   42.68          aliceKeyAgree.init(aliceKpair.getPrivate());
   42.69  
   42.70          // Alice encodes her public key, and sends it over to Bob.
   42.71 @@ -130,7 +127,7 @@
   42.72           * in encoded format.
   42.73           * He instantiates a DH public key from the encoded key material.
   42.74           */
   42.75 -        KeyFactory bobKeyFac = KeyFactory.getInstance("DH");
   42.76 +        KeyFactory bobKeyFac = KeyFactory.getInstance("DH", SUNJCE);
   42.77          X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec
   42.78              (alicePubKeyEnc);
   42.79          PublicKey alicePubKey = bobKeyFac.generatePublic(x509KeySpec);
   42.80 @@ -144,7 +141,7 @@
   42.81  
   42.82          // Bob creates his own DH key pair
   42.83          System.err.println("BOB: Generate DH keypair ...");
   42.84 -        KeyPairGenerator bobKpairGen = KeyPairGenerator.getInstance("DH");
   42.85 +        KeyPairGenerator bobKpairGen = KeyPairGenerator.getInstance("DH", SUNJCE);
   42.86          bobKpairGen.initialize(dhParamSpec);
   42.87          KeyPair bobKpair = bobKpairGen.generateKeyPair();
   42.88          System.out.println("Bob DH public key:\n" +
   42.89 @@ -154,7 +151,7 @@
   42.90  
   42.91          // Bob executes Phase1 of his version of the DH protocol
   42.92          System.err.println("BOB: Execute PHASE1 ...");
   42.93 -        KeyAgreement bobKeyAgree = KeyAgreement.getInstance("DH");
   42.94 +        KeyAgreement bobKeyAgree = KeyAgreement.getInstance("DH", SUNJCE);
   42.95          bobKeyAgree.init(bobKpair.getPrivate());
   42.96  
   42.97          // Bob encodes his public key, and sends it over to Alice.
   42.98 @@ -166,7 +163,7 @@
   42.99           * Before she can do so, she has to instanticate a DH public key
  42.100           * from Bob's encoded key material.
  42.101           */
  42.102 -        KeyFactory aliceKeyFac = KeyFactory.getInstance("DH");
  42.103 +        KeyFactory aliceKeyFac = KeyFactory.getInstance("DH", SUNJCE);
  42.104          x509KeySpec = new X509EncodedKeySpec(bobPubKeyEnc);
  42.105          PublicKey bobPubKey = aliceKeyFac.generatePublic(x509KeySpec);
  42.106          System.err.println("ALICE: Execute PHASE2 ...");
  42.107 @@ -187,49 +184,32 @@
  42.108          byte[] aliceSharedSecret = aliceKeyAgree.generateSecret();
  42.109          int aliceLen = aliceSharedSecret.length;
  42.110  
  42.111 +        // check if alice's key agreement has been reset afterwards
  42.112 +        try {
  42.113 +            aliceKeyAgree.generateSecret();
  42.114 +            throw new Exception("Error: alice's KeyAgreement not reset");
  42.115 +        } catch (IllegalStateException e) {
  42.116 +            System.out.println("EXPECTED:  " + e.getMessage());
  42.117 +        }
  42.118 +
  42.119          byte[] bobSharedSecret = new byte[aliceLen];
  42.120          int bobLen;
  42.121          try {
  42.122              // provide output buffer that is too short
  42.123              bobLen = bobKeyAgree.generateSecret(bobSharedSecret, 1);
  42.124 -
  42.125 -            /*
  42.126 -             * Gatekeeper's note:
  42.127 -             * We should not be getting here, but every so often, we
  42.128 -             * get a failure, either a "ShortBufferException" or
  42.129 -             * "Key agreement has not been completed yet" in the
  42.130 -             * generateSecret(bobSharedSecret, 0) below.
  42.131 -             *
  42.132 -             * This will help to figure out why we're dropping through
  42.133 -             * and not failing.
  42.134 -             */
  42.135 -            System.out.println("NIGHTLY:  Should *NOT* be here!!!\n" +
  42.136 -                "aliceLen = " + aliceLen + "\n" +
  42.137 -                "Alice's shared secret");
  42.138 -
  42.139 -            try {
  42.140 -                HexDumpEncoder hd = new HexDumpEncoder();
  42.141 -
  42.142 -                hd.encodeBuffer(
  42.143 -                    new ByteArrayInputStream(aliceSharedSecret), System.out);
  42.144 -            } catch (IOException e) { }
  42.145 -
  42.146 -            System.out.println("bobLen = " + bobLen);
  42.147 -
  42.148 -            try {
  42.149 -                HexDumpEncoder hd = new HexDumpEncoder();
  42.150 -
  42.151 -                hd.encodeBuffer(
  42.152 -                    new ByteArrayInputStream(bobSharedSecret), System.out);
  42.153 -            } catch (IOException e) { }
  42.154 -
  42.155 -            throw new Exception("Shouldn't be succeeding.");
  42.156          } catch (ShortBufferException e) {
  42.157              System.out.println("EXPECTED:  " + e.getMessage());
  42.158          }
  42.159 +        // retry w/ output buffer of required size
  42.160 +        bobLen = bobKeyAgree.generateSecret(bobSharedSecret, 0);
  42.161  
  42.162 -        // provide output buffer of required size
  42.163 -        bobLen = bobKeyAgree.generateSecret(bobSharedSecret, 0);
  42.164 +        // check if bob's key agreement has been reset afterwards
  42.165 +        try {
  42.166 +            bobKeyAgree.generateSecret(bobSharedSecret, 0);
  42.167 +            throw new Exception("Error: bob's KeyAgreement not reset");
  42.168 +        } catch (IllegalStateException e) {
  42.169 +            System.out.println("EXPECTED:  " + e.getMessage());
  42.170 +        }
  42.171  
  42.172          System.out.println("Alice secret: " + toHexString(aliceSharedSecret));
  42.173          System.out.println("Bob secret: " + toHexString(bobSharedSecret));
    43.1 --- a/test/com/sun/jdi/EarlyReturnTest.java	Thu Mar 22 12:41:26 2012 -0700
    43.2 +++ b/test/com/sun/jdi/EarlyReturnTest.java	Mon Mar 26 17:31:42 2012 -0700
    43.3 @@ -292,7 +292,9 @@
    43.4      private String[] excludes = {
    43.5          "javax.*",
    43.6          "sun.*",
    43.7 -        "com.sun.*"};
    43.8 +        "com.sun.*",
    43.9 +        "com.oracle.*",
   43.10 +        "oracle.*"};
   43.11  
   43.12      static VirtualMachineManager vmm ;
   43.13      ClassType targetClass;
    44.1 --- a/test/com/sun/jdi/MethodEntryExitEvents.java	Thu Mar 22 12:41:26 2012 -0700
    44.2 +++ b/test/com/sun/jdi/MethodEntryExitEvents.java	Mon Mar 26 17:31:42 2012 -0700
    44.3 @@ -114,7 +114,8 @@
    44.4       *     http://java.sun.com/javase/technologies/core/toolsapis/jpda/
    44.5       */
    44.6      private String[] excludes = {"java.*", "javax.*", "sun.*",
    44.7 -                                 "com.sun.*"};
    44.8 +                                 "com.sun.*", "com.oracle.*",
    44.9 +                                 "oracle.*"};
   44.10  
   44.11      MethodEntryExitEvents (String args[]) {
   44.12          super(args);
    45.1 --- a/test/com/sun/jdi/MethodExitReturnValuesTest.java	Thu Mar 22 12:41:26 2012 -0700
    45.2 +++ b/test/com/sun/jdi/MethodExitReturnValuesTest.java	Mon Mar 26 17:31:42 2012 -0700
    45.3 @@ -218,7 +218,9 @@
    45.4      private String[] excludes = {
    45.5          "javax.*",
    45.6          "sun.*",
    45.7 -        "com.sun.*"};
    45.8 +        "com.sun.*",
    45.9 +        "com.oracle.*",
   45.10 +        "oracle.*"};
   45.11  
   45.12      static VirtualMachineManager vmm ;
   45.13      ClassType targetClass;
    46.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.2 +++ b/test/java/awt/Frame/WindowDragTest/WindowDragTest.java	Mon Mar 26 17:31:42 2012 -0700
    46.3 @@ -0,0 +1,107 @@
    46.4 +/*
    46.5 + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
    46.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    46.7 + *
    46.8 + * This code is free software; you can redistribute it and/or modify it
    46.9 + * under the terms of the GNU General Public License version 2 only, as
   46.10 + * published by the Free Software Foundation.
   46.11 + *
   46.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   46.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   46.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   46.15 + * version 2 for more details (a copy is included in the LICENSE file that
   46.16 + * accompanied this code).
   46.17 + *
   46.18 + * You should have received a copy of the GNU General Public License version
   46.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   46.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   46.21 + *
   46.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   46.23 + * or visit www.oracle.com if you need additional information or have any
   46.24 + * questions.
   46.25 + */
   46.26 +
   46.27 +/*
   46.28 +  @test
   46.29 +  @bug 7128738
   46.30 +  @summary dragged dialog freezes system on dispose
   46.31 +  @author Oleg Pekhovskiy: area=awt.toplevel
   46.32 +  @library ../../regtesthelpers
   46.33 +  @run main WindowDragTest
   46.34 +*/
   46.35 +
   46.36 +import java.awt.Frame;
   46.37 +import java.awt.event.InputEvent;
   46.38 +import java.awt.AWTException;
   46.39 +import test.java.awt.regtesthelpers.Util;
   46.40 +import java.awt.Robot;
   46.41 +import java.awt.Point;
   46.42 +import java.awt.Dimension;
   46.43 +import java.awt.event.MouseAdapter;
   46.44 +import java.awt.event.MouseEvent;
   46.45 +
   46.46 +public class WindowDragTest {
   46.47 +
   46.48 +    static boolean passed = false;
   46.49 +
   46.50 +    public static void main(String[] args) {
   46.51 +        try {
   46.52 +            Robot robot = new Robot();
   46.53 +            robot.setAutoDelay(1000);
   46.54 +
   46.55 +            Frame frame1 = new Frame();
   46.56 +            frame1.setBounds(50, 50, 300, 200);
   46.57 +            frame1.setVisible(true);
   46.58 +            frame1.toFront();
   46.59 +            frame1.addMouseListener(new MouseAdapter() {
   46.60 +                @Override
   46.61 +                public void mouseClicked(MouseEvent e) {
   46.62 +                    // Clicking frame1 succeeded - mouse is not captured
   46.63 +                    passed = true;
   46.64 +                }
   46.65 +            });
   46.66 +            robot.delay(1000);
   46.67 +
   46.68 +            Frame frame2 = new Frame();
   46.69 +            frame2.setBounds(100, 100, 300, 200);
   46.70 +            frame2.setVisible(true);
   46.71 +            frame2.toFront();
   46.72 +            robot.delay(1000);
   46.73 +
   46.74 +            Point p = frame2.getLocationOnScreen();
   46.75 +            Dimension d = frame2.getSize();
   46.76 +
   46.77 +            // Move cursor to frame2 title bar to drag
   46.78 +            robot.mouseMove(p.x + (int)(d.getWidth() / 2), p.y + (int)frame2.getInsets().top / 2);
   46.79 +            Util.waitForIdle(robot);
   46.80 +
   46.81 +            // Start window dragging
   46.82 +            robot.mousePress(InputEvent.BUTTON1_MASK);
   46.83 +            Util.waitForIdle(robot);
   46.84 +
   46.85 +            // Dispose window being dragged
   46.86 +            frame2.dispose();
   46.87 +            Util.waitForIdle(robot);
   46.88 +
   46.89 +            // Release mouse button to be able to get MOUSE_CLICKED event on Util.clickOnComp()
   46.90 +            robot.mouseRelease(InputEvent.BUTTON1_MASK);
   46.91 +            Util.waitForIdle(robot);
   46.92 +
   46.93 +            // Click frame1 to check whether mouse is not captured by frame2
   46.94 +            Util.clickOnComp(frame1, robot);
   46.95 +            Util.waitForIdle(robot);
   46.96 +
   46.97 +            frame1.dispose();
   46.98 +            if (passed) {
   46.99 +                System.out.println("Test passed.");
  46.100 +            }
  46.101 +            else {
  46.102 +                System.out.println("Test failed.");
  46.103 +                throw new RuntimeException("Test failed.");
  46.104 +            }
  46.105 +        }
  46.106 +        catch (AWTException e) {
  46.107 +            throw new RuntimeException("AWTException occurred - problem creating robot!");
  46.108 +        }
  46.109 +    }
  46.110 +}
    47.1 --- a/test/java/io/File/isDirectory/Applet.html	Thu Mar 22 12:41:26 2012 -0700
    47.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    47.3 @@ -1,2 +0,0 @@
    47.4 -<!---->
    47.5 -<applet code=Applet.class width=100 height=100></applet>
    48.1 --- a/test/java/io/Serializable/badSubstByReplace/BadSubstByReplace.java	Thu Mar 22 12:41:26 2012 -0700
    48.2 +++ b/test/java/io/Serializable/badSubstByReplace/BadSubstByReplace.java	Mon Mar 26 17:31:42 2012 -0700
    48.3 @@ -22,7 +22,6 @@
    48.4   */
    48.5  
    48.6  /* @test
    48.7 - * @clean A B Container ReplacerObjectOutputStream
    48.8   * @summary Verify that ClassCastException is thrown when deserializing
    48.9   *          an object and one of its object fields is  incompatibly replaced
   48.10   *          by either replaceObject/resolveObject.
    49.1 --- a/test/java/io/Serializable/replaceStringArray/ReplaceStringArray.java	Thu Mar 22 12:41:26 2012 -0700
    49.2 +++ b/test/java/io/Serializable/replaceStringArray/ReplaceStringArray.java	Mon Mar 26 17:31:42 2012 -0700
    49.3 @@ -22,7 +22,6 @@
    49.4   */
    49.5  
    49.6  /* @test
    49.7 - * @clean A SubstituteObjectOutputStream SubstituteObjectInputStream
    49.8   * @bug 4099013
    49.9   * @summary Enable substitution of String and Array by ObjectStreams.
   49.10   */
    50.1 --- a/test/java/io/Serializable/replaceWithNull/ReplaceWithNull.java	Thu Mar 22 12:41:26 2012 -0700
    50.2 +++ b/test/java/io/Serializable/replaceWithNull/ReplaceWithNull.java	Mon Mar 26 17:31:42 2012 -0700
    50.3 @@ -23,7 +23,6 @@
    50.4  
    50.5  /* @test
    50.6   * @bug 4065313
    50.7 - * @clean A ReplaceWithNull MyObjectOutputStream
    50.8   * @summary Ensure that it is okay to replace an object with null.
    50.9   */
   50.10  import java.io.*;
    51.1 --- a/test/java/io/Serializable/verifyDynamicObjHandleTable/VerifyDynamicObjHandleTable.java	Thu Mar 22 12:41:26 2012 -0700
    51.2 +++ b/test/java/io/Serializable/verifyDynamicObjHandleTable/VerifyDynamicObjHandleTable.java	Mon Mar 26 17:31:42 2012 -0700
    51.3 @@ -22,7 +22,6 @@
    51.4   */
    51.5  
    51.6  /* @test
    51.7 - * @clean A
    51.8   * @bug 4146453
    51.9   * @summary Test that regrow of object/handle table of ObjectOutputStream works.
   51.10   */
    52.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    52.2 +++ b/test/java/lang/management/ManagementFactory/GetPlatformManagementInterfaces.java	Mon Mar 26 17:31:42 2012 -0700
    52.3 @@ -0,0 +1,76 @@
    52.4 +/*
    52.5 + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
    52.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    52.7 + *
    52.8 + * This code is free software; you can redistribute it and/or modify it
    52.9 + * under the terms of the GNU General Public License version 2 only, as
   52.10 + * published by the Free Software Foundation.
   52.11 + *
   52.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   52.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   52.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   52.15 + * version 2 for more details (a copy is included in the LICENSE file that
   52.16 + * accompanied this code).
   52.17 + *
   52.18 + * You should have received a copy of the GNU General Public License version
   52.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   52.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   52.21 + *
   52.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   52.23 + * or visit www.oracle.com if you need additional information or have any
   52.24 + * questions.
   52.25 + */
   52.26 +
   52.27 +/*
   52.28 + * @test
   52.29 + * @bug     7074616
   52.30 + * @summary Basic unit test of the
   52.31 + *          ManagementFactory.getPlatformManagementInterfaces() method
   52.32 + * @author  Frederic Parain
   52.33 + *
   52.34 + * @run main GetPlatformManagementInterfaces
   52.35 + */
   52.36 +
   52.37 +import java.lang.management.*;
   52.38 +import java.io.IOException;
   52.39 +import java.util.*;
   52.40 +import javax.management.*;
   52.41 +
   52.42 +import static java.lang.management.ManagementFactory.*;
   52.43 +
   52.44 +public class GetPlatformManagementInterfaces {
   52.45 +
   52.46 +    private static enum ManagementInterfaces {
   52.47 +        CLASS_LOADING_MXBEAN(ClassLoadingMXBean.class),
   52.48 +        COMPILATION_MXBEAN(CompilationMXBean.class),
   52.49 +        MEMORY_MXBEAN(MemoryMXBean.class),
   52.50 +        OPERATING_SYSTEM_MXBEAN(OperatingSystemMXBean.class),
   52.51 +        RUNTIME_MXBEAN(RuntimeMXBean.class),
   52.52 +        THREAD_MXBEAN(ThreadMXBean.class),
   52.53 +        GARBAGE_COLLECTOR_MXBEAN(GarbageCollectorMXBean.class),
   52.54 +        MEMORY_MANAGER_MXBEAN(MemoryManagerMXBean.class),
   52.55 +        MEMORY_POOL_MXBEAN(MemoryPoolMXBean.class);
   52.56 +
   52.57 +        private final Class<? extends PlatformManagedObject> managementInterface;
   52.58 +        private ManagementInterfaces(Class<? extends PlatformManagedObject> minterface) {
   52.59 +            managementInterface = minterface;
   52.60 +        }
   52.61 +        public Class<? extends PlatformManagedObject> getManagementInterface() {
   52.62 +            return managementInterface;
   52.63 +        }
   52.64 +    };
   52.65 +
   52.66 +    public static void main(String[] args) {
   52.67 +        Set<Class<? extends PlatformManagedObject>> interfaces =
   52.68 +            ManagementFactory.getPlatformManagementInterfaces();
   52.69 +        for(Class<? extends PlatformManagedObject> pom : interfaces) {
   52.70 +            List<? extends PlatformManagedObject> list =
   52.71 +                ManagementFactory.getPlatformMXBeans(pom);
   52.72 +        }
   52.73 +        for(ManagementInterfaces mi : ManagementInterfaces.values()) {
   52.74 +            if(!interfaces.contains(mi.getManagementInterface())) {
   52.75 +                throw new RuntimeException(mi.getManagementInterface() + " not in ManagementInterfaces set");
   52.76 +            }
   52.77 +        }
   52.78 +    }
   52.79 +}
    53.1 --- a/test/java/net/CookieHandler/NullUriCookieTest.java	Thu Mar 22 12:41:26 2012 -0700
    53.2 +++ b/test/java/net/CookieHandler/NullUriCookieTest.java	Mon Mar 26 17:31:42 2012 -0700
    53.3 @@ -23,8 +23,9 @@
    53.4  
    53.5  /*
    53.6   * @test
    53.7 - * @bug 6953455
    53.8 + * @bug 6953455 7045655
    53.9   * @summary CookieStore.add() cannot handle null URI parameter
   53.10 + *     and An empty InMemoryCookieStore should not return true for removeAll
   53.11   */
   53.12  
   53.13  import java.net.CookieManager;
   53.14 @@ -44,6 +45,11 @@
   53.15      static void checkCookieNullUri() throws Exception {
   53.16          //get a cookie store implementation and add a cookie to the store with null URI
   53.17          CookieStore cookieStore = (new CookieManager()).getCookieStore();
   53.18 +        //Check if removeAll() retrurns false on an empty CookieStore
   53.19 +        if (cookieStore.removeAll()) {
   53.20 +            fail = true;
   53.21 +        }
   53.22 +        checkFail("removeAll on empty store should return false");
   53.23          HttpCookie cookie = new HttpCookie("MY_COOKIE", "MY_COOKIE_VALUE");
   53.24          cookie.setDomain("foo.com");
   53.25          cookieStore.add(null, cookie);
    54.1 --- a/test/java/net/Socks/SocksServer.java	Thu Mar 22 12:41:26 2012 -0700
    54.2 +++ b/test/java/net/Socks/SocksServer.java	Mon Mar 26 17:31:42 2012 -0700
    54.3 @@ -22,13 +22,14 @@
    54.4   */
    54.5  import java.net.*;
    54.6  import java.io.*;
    54.7 +import java.util.HashMap;
    54.8  
    54.9  public class SocksServer extends Thread {
   54.10      // Some useful SOCKS constant
   54.11  
   54.12 -    static final int PROTO_VERS4                = 4;
   54.13 +    static final int PROTO_VERS4        = 4;
   54.14      static final int PROTO_VERS         = 5;
   54.15 -    static final int DEFAULT_PORT               = 1080;
   54.16 +    static final int DEFAULT_PORT       = 1080;
   54.17  
   54.18      static final int NO_AUTH            = 0;
   54.19      static final int GSSAPI             = 1;
   54.20 @@ -36,28 +37,28 @@
   54.21      static final int NO_METHODS         = -1;
   54.22  
   54.23      static final int CONNECT            = 1;
   54.24 -    static final int BIND                       = 2;
   54.25 +    static final int BIND               = 2;
   54.26      static final int UDP_ASSOC          = 3;
   54.27  
   54.28 -    static final int IPV4                       = 1;
   54.29 -    static final int DOMAIN_NAME                = 3;
   54.30 -    static final int IPV6                       = 4;
   54.31 +    static final int IPV4               = 1;
   54.32 +    static final int DOMAIN_NAME        = 3;
   54.33 +    static final int IPV6               = 4;
   54.34  
   54.35      static final int REQUEST_OK         = 0;
   54.36      static final int GENERAL_FAILURE    = 1;
   54.37 -    static final int NOT_ALLOWED                = 2;
   54.38 +    static final int NOT_ALLOWED        = 2;
   54.39      static final int NET_UNREACHABLE    = 3;
   54.40      static final int HOST_UNREACHABLE   = 4;
   54.41 -    static final int CONN_REFUSED               = 5;
   54.42 -    static final int TTL_EXPIRED                = 6;
   54.43 +    static final int CONN_REFUSED       = 5;
   54.44 +    static final int TTL_EXPIRED        = 6;
   54.45      static final int CMD_NOT_SUPPORTED  = 7;
   54.46      static final int ADDR_TYPE_NOT_SUP  = 8;
   54.47  
   54.48      private int port;
   54.49      private ServerSocket server;
   54.50      private boolean useV4 = false;
   54.51 -    private java.util.Hashtable users = new java.util.Hashtable();
   54.52 -    private boolean done = false;
   54.53 +    private HashMap<String,String> users = new HashMap<>();
   54.54 +    private volatile boolean done = false;
   54.55      // Inner class to handle protocol with client
   54.56      // This is the bulk of the work (protocol handler)
   54.57      class ClientHandler extends Thread {
   54.58 @@ -136,7 +137,7 @@
   54.59              System.err.println("User: '" + uname);
   54.60              System.err.println("PSWD: '" + password);
   54.61              if (users.containsKey(uname)) {
   54.62 -                String p1 = (String) users.get(uname);
   54.63 +                String p1 = users.get(uname);
   54.64                  System.err.println("p1 = " + p1);
   54.65                  if (p1.equals(password)) {
   54.66                      out.write(PROTO_VERS);
   54.67 @@ -492,7 +493,12 @@
   54.68      public SocksServer(int port) throws IOException {
   54.69          this.port = port;
   54.70          server = new ServerSocket();
   54.71 -        server.bind(new InetSocketAddress(port));
   54.72 +        if (port == 0) {
   54.73 +            server.bind(null);
   54.74 +            this.port = server.getLocalPort();
   54.75 +        } else {
   54.76 +            server.bind(new InetSocketAddress(port));
   54.77 +        }
   54.78      }
   54.79  
   54.80      public SocksServer() throws IOException {
   54.81 @@ -503,8 +509,13 @@
   54.82          users.put(user, passwd);
   54.83      }
   54.84  
   54.85 -    public synchronized void terminate() {
   54.86 +    public int getPort() {
   54.87 +        return port;
   54.88 +    }
   54.89 +
   54.90 +    public void terminate() {
   54.91          done = true;
   54.92 +        try { server.close(); } catch (IOException unused) {}
   54.93      }
   54.94  
   54.95      public void run() {
    55.1 --- a/test/java/net/Socks/SocksV4Test.java	Thu Mar 22 12:41:26 2012 -0700
    55.2 +++ b/test/java/net/Socks/SocksV4Test.java	Mon Mar 26 17:31:42 2012 -0700
    55.3 @@ -26,23 +26,22 @@
    55.4   * @bug 4727547
    55.5   * @summary SocksSocketImpl throws NullPointerException
    55.6   * @build SocksServer
    55.7 + * @run main SocksV4Test
    55.8   */
    55.9  
   55.10  import java.net.*;
   55.11 -import java.io.*;
   55.12  
   55.13  public class SocksV4Test {
   55.14 -    public static void main(String[] args) throws IOException {
   55.15 -        // Create a SOCKS V4 proxy on port 8888
   55.16 -        SocksServer srvr = new SocksServer(8888, true);
   55.17 +    public static void main(String[] args) throws Exception {
   55.18 +        // Create a SOCKS V4 proxy
   55.19 +        SocksServer srvr = new SocksServer(0, true);
   55.20          srvr.start();
   55.21 -        System.setProperty("socksProxyHost", "localhost");
   55.22 -        System.setProperty("socksProxyPort", "8888");
   55.23 +        Proxy sp = new Proxy(Proxy.Type.SOCKS,
   55.24 +                             new InetSocketAddress("localhost", srvr.getPort()));
   55.25          // Let's create an unresolved address
   55.26          InetSocketAddress ad = new InetSocketAddress("doesnt.exist.name", 1234);
   55.27 -        Socket s = new Socket();
   55.28 -        try {
   55.29 -            s.connect(ad,10000);
   55.30 +        try (Socket s = new Socket(sp)) {
   55.31 +            s.connect(ad, 10000);
   55.32          } catch (UnknownHostException ex) {
   55.33              // OK, that's what we expected
   55.34          } catch (NullPointerException npe) {
   55.35 @@ -50,7 +49,6 @@
   55.36              throw new RuntimeException("Got a NUllPointerException");
   55.37          } finally {
   55.38              srvr.terminate();
   55.39 -            srvr.interrupt();
   55.40          }
   55.41      }
   55.42  }
    56.1 --- a/test/java/nio/file/Files/CustomOptions.java	Thu Mar 22 12:41:26 2012 -0700
    56.2 +++ b/test/java/nio/file/Files/CustomOptions.java	Mon Mar 26 17:31:42 2012 -0700
    56.3 @@ -28,6 +28,7 @@
    56.4   * @author  Brandon Passanisi
    56.5   * @library ..
    56.6   * @build   CustomOptions PassThroughFileSystem
    56.7 + * @run main CustomOptions
    56.8   */
    56.9  
   56.10  import java.io.IOException;
    57.1 --- a/test/java/text/Bidi/Bug6850113.java	Thu Mar 22 12:41:26 2012 -0700
    57.2 +++ b/test/java/text/Bidi/Bug6850113.java	Mon Mar 26 17:31:42 2012 -0700
    57.3 @@ -25,6 +25,7 @@
    57.4   * @bug 6850113
    57.5   * @summary Verify the return value of digit() for some digits.
    57.6   * @compile -XDignore.symbol.file=true Bug6850113.java
    57.7 + * @run main Bug6850113
    57.8   */
    57.9  
   57.10  import sun.text.normalizer.UCharacter;
    58.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    58.2 +++ b/test/java/util/jar/Manifest/CreateManifest.java	Mon Mar 26 17:31:42 2012 -0700
    58.3 @@ -0,0 +1,301 @@
    58.4 +/*
    58.5 + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
    58.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    58.7 + *
    58.8 + * This code is free software; you can redistribute it and/or modify it
    58.9 + * under the terms of the GNU General Public License version 2 only, as
   58.10 + * published by the Free Software Foundation.
   58.11 + *
   58.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   58.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   58.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   58.15 + * version 2 for more details (a copy is included in the LICENSE file that
   58.16 + * accompanied this code).
   58.17 + *
   58.18 + * You should have received a copy of the GNU General Public License version
   58.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   58.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   58.21 + *
   58.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   58.23 + * or visit www.oracle.com if you need additional information or have any
   58.24 + * questions.
   58.25 + */
   58.26 +
   58.27 +/*
   58.28 + * @test
   58.29 + * @bug 7148584
   58.30 + * @summary Jar tools fails to generate manifest correctly when boundary condition hit
   58.31 + * @compile -XDignore.symbol.file=true CreateManifest.java
   58.32 + * @run main CreateManifest
   58.33 + */
   58.34 +
   58.35 +import java.nio.file.Files;
   58.36 +import java.nio.file.Paths;
   58.37 +import java.util.jar.*;
   58.38 +
   58.39 +public class CreateManifest {
   58.40 +
   58.41 +public static void main(String arg[]) throws Exception {
   58.42 +
   58.43 +    String jarFileName = "test.jar";
   58.44 +    String ManifestName = "MANIFEST.MF";
   58.45 +
   58.46 +    // create the MANIFEST.MF file
   58.47 +    Files.write(Paths.get(ManifestName), FILE_CONTENTS.getBytes());
   58.48 +
   58.49 +    String [] args = new String [] { "cvfm", jarFileName, ManifestName};
   58.50 +    sun.tools.jar.Main jartool =
   58.51 +            new sun.tools.jar.Main(System.out, System.err, "jar");
   58.52 +    jartool.run(args);
   58.53 +
   58.54 +    try (JarFile jf = new JarFile(jarFileName)) {
   58.55 +        Manifest m = jf.getManifest();
   58.56 +        String result = m.getMainAttributes().getValue("Class-path");
   58.57 +        if (result == null)
   58.58 +            throw new RuntimeException("Failed to add Class-path attribute to manifest");
   58.59 +    } finally {
   58.60 +        Files.deleteIfExists(Paths.get(jarFileName));
   58.61 +        Files.deleteIfExists(Paths.get(ManifestName));
   58.62 +    }
   58.63 +
   58.64 +}
   58.65 +
   58.66 +private static final String FILE_CONTENTS =
   58.67 + "Class-path: \n" +
   58.68 + " /ade/dtsao_re/oracle/emcore//lib/em-core-testconsole-uimodel.jar \n" +
   58.69 + " /ade/dtsao_re/oracle/emcore//lib/em-core-testconsole-ui.jar \n" +
   58.70 + " /ade/dtsao_re/oracle/emcore//lib/em-core-bmp-model.jar \n" +
   58.71 + " /ade/dtsao_re/oracle/emcore//lib/em-core-bmp-ui.jar \n" +
   58.72 + " /ade/dtsao_re/oracle/emcore//lib/em-core-host-uimodel.jar \n" +
   58.73 + " /ade/dtsao_re/oracle/emcore//lib/em-core-host-ui.jar \n" +
   58.74 + " /ade/dtsao_re/oracle/emcore//lib/em-core-agent-patching-uimodel.jar \n" +
   58.75 + " /ade/dtsao_re/oracle/emcore//lib/em-core-agent-patching-ui.jar \n" +
   58.76 + " /ade/dtsao_re/oracle/emcore//lib/em-core-connector-uimodel.jar \n" +
   58.77 + " /ade/dtsao_re/oracle/emcore//lib/em-core-connector-ui.jar \n" +
   58.78 + " /ade/dtsao_re/oracle/emcore//lib/em-core-discovery-model.jar \n" +
   58.79 + " /ade/dtsao_re/oracle/emcore//lib/em-core-gccompliance-model.jar \n" +
   58.80 + " /ade/dtsao_re/oracle/emcore//lib/em-core-mos-uimodel.jar \n" +
   58.81 + " /ade/dtsao_re/oracle/emcore//lib/em-core-mos-ui.jar \n" +
   58.82 + " /ade/dtsao_re/oracle/emcore//lib/em-core-security-uimodel.jar \n" +
   58.83 + " /ade/dtsao_re/oracle/emcore//lib/em-core-security-ui.jar \n" +
   58.84 + " /ade/dtsao_re/oracle/emcore//lib/em-core-topology-uimodel.jar \n" +
   58.85 + " /ade/dtsao_re/oracle/emcore//lib/em-core-topology-ui.jar \n" +
   58.86 + " /ade/dtsao_re/oracle/emcore//lib/em-core-event-pojo.jar \n" +
   58.87 + " /ade/dtsao_re/oracle/emcore//lib/em-core-event-uimodel.jar \n" +
   58.88 + " /ade/dtsao_re/oracle/emcore//lib/em-core-event-ui.jar \n" +
   58.89 + " /ade/dtsao_re/oracle/emcore//lib/em-core-mext-uimodel.jar \n" +
   58.90 + " /ade/dtsao_re/oracle/emcore//lib/em-core-mext-ui.jar \n" +
   58.91 + " /ade/dtsao_re/oracle/emcore//lib/em-core-discovery-uimodel.jar \n" +
   58.92 + " /ade/dtsao_re/oracle/emcore//lib/em-core-discovery-ui.jar \n" +
   58.93 + " /ade/dtsao_re/oracle/emcore//lib/em-core-ecm-uimodel.jar \n" +
   58.94 + " /ade/dtsao_re/oracle/emcore//lib/em-core-ecm-ui.jar \n" +
   58.95 + " /ade/dtsao_re/oracle/emcore//lib/em-core-ecm-test.jar \n" +
   58.96 + " /ade/dtsao_re/oracle/emcore//lib/em-core-event-console-uimodel.jar \n" +
   58.97 + " /ade/dtsao_re/oracle/emcore//lib/em-core-event-console-ui.jar \n" +
   58.98 + " /ade/dtsao_re/oracle/emcore//lib/em-core-event-rules-uimodel.jar \n" +
   58.99 + " /ade/dtsao_re/oracle/emcore//lib/em-core-event-rules-ui.jar \n" +
  58.100 + " /ade/dtsao_re/oracle/emcore//lib/em-core-gccompliance-ui.jar \n" +
  58.101 + " /ade/dtsao_re/oracle/emcore//lib/em-core-ip-uimodel.jar \n" +
  58.102 + " /ade/dtsao_re/oracle/emcore//lib/em-core-ip-ui.jar \n" +
  58.103 + " /ade/dtsao_re/oracle/emcore//lib/em-core-probanalysis-uimodel.jar \n" +
  58.104 + " /ade/dtsao_re/oracle/emcore//lib/em-core-probanalysis-ui.jar \n" +
  58.105 + " /ade/dtsao_re/oracle/emcore//lib/em-core-swlib-ui.jar \n" +
  58.106 + " /ade/dtsao_re/oracle/emcore//lib/em-core-installmediacomponent-ui.jar \n" +
  58.107 + " /ade/dtsao_re/oracle/emcore//lib/em-core-uifwk-uimodel.jar \n" +
  58.108 + " /ade/dtsao_re/oracle/emcore//lib/em-core-uifwk-ui.jar \n" +
  58.109 + " /ade/dtsao_re/oracle/emcore//lib/em-core-discovery-model.jar \n" +
  58.110 + " /ade/dtsao_re/oracle/emcore//lib/em-core-gccompliance-model.jar \n" +
  58.111 + " /ade/dtsao_re/oracle/emcore//lib/em-core-bmp-test.jar \n" +
  58.112 + " /ade/dtsao_re/oracle/emcore//lib/em-core-host-test.jar \n" +
  58.113 + " /ade/dtsao_re/oracle/emcore//lib/em-core-agent-patching-test.jar \n" +
  58.114 + " /ade/dtsao_re/oracle/emcore//lib/em-core-connector-test.jar \n" +
  58.115 + " /ade/dtsao_re/oracle/emcore//lib/em-core-mos-test.jar \n" +
  58.116 + " /ade/dtsao_re/oracle/emcore//lib/em-core-event-test.jar \n" +
  58.117 + " /ade/dtsao_re/oracle/emcore//lib/em-core-discovery-test.jar \n" +
  58.118 + " /ade/dtsao_re/oracle/emcore//lib/em-core-gccompliance-test.jar \n" +
  58.119 + " /ade/dtsao_re/oracle/emcore//lib/em-core-ip-test.jar \n" +
  58.120 + " /ade/dtsao_re/oracle/emcore//lib/em-core-probanalysis-test.jar \n" +
  58.121 + " /ade/dtsao_re/oracle/emcore//lib/em-core-testconsole-test.jar \n" +
  58.122 + " /ade/dtsao_re/oracle/emcore//lib/em-core-uifwk-test.jar \n" +
  58.123 + " /ade/dtsao_re/oracle/emcore//lib/em-core-mext-test.jar \n" +
  58.124 + " /ade/dtsao_re/oracle/emcore//lib/em-core-security-test.jar \n" +
  58.125 + " /ade/dtsao_re/oracle/emcore//lib/em-core-agentpush-ui.jar \n" +
  58.126 + " /ade/dtsao_re/oracle/emcore//lib/em-core-agentpush-uimodel.jar \n" +
  58.127 + " /ade/dtsao_re/oracle/emcore//lib/em-core-agentpush-test.jar \n" +
  58.128 + " /ade/dtsao_re/oracle/emcore//lib/em-core-selfupdate-uimodel.jar \n" +
  58.129 + " /ade/dtsao_re/oracle/emcore//lib/em-core-selfupdate-ui.jar \n" +
  58.130 + " /ade/dtsao_re/oracle/emcore//lib/em-core-selfupdate-test.jar \n" +
  58.131 + " /ade/dtsao_re/oracle/emcore//lib/em-core-agentpush-model.jar \n" +
  58.132 + " /ade/dtsao_re/oracle/emcore//lib/em-core-groups-uimodel.jar \n" +
  58.133 + " /ade/dtsao_re/oracle/emcore//lib/em-core-groups-ui.jar \n" +
  58.134 + " /ade/dtsao_re/oracle/emcore//lib/em-core-groups-test.jar \n" +
  58.135 + " /ade/dtsao_re/oracle/emcore//lib/em-core-topology-test.jar \n" +
  58.136 + " /ade/dtsao_re/oracle/emcore//lib/em-core-jobs-ui.jar \n" +
  58.137 + " /ade/dtsao_re/oracle/emcore//lib/em-core-jobs-uimodel.jar \n" +
  58.138 + " /ade/dtsao_re/oracle/emcore//lib/em-core-jobs-test.jar \n" +
  58.139 + " /ade/dtsao_re/oracle/emcore//lib/em-core-templ-uimodel.jar \n" +
  58.140 + " /ade/dtsao_re/oracle/emcore//lib/em-core-templ-ui.jar \n" +
  58.141 + " /ade/dtsao_re/oracle/emcore//lib/em-core-templ-test.jar \n" +
  58.142 + " /ade/dtsao_re/oracle/emcore//lib/em-core-metricalertserrors-uimodel.jar \n" +
  58.143 + " /ade/dtsao_re/oracle/emcore//lib/em-core-metricalertserrors-ui.jar \n" +
  58.144 + " /ade/dtsao_re/oracle/emcore//lib/em-core-metricalertserrors-test.jar \n" +
  58.145 + " /ade/dtsao_re/oracle/emcore//lib/em-core-metrics-ui.jar \n" +
  58.146 + " /ade/dtsao_re/oracle/emcore//lib/em-core-metrics-uimodel.jar \n" +
  58.147 + " /ade/dtsao_re/oracle/emcore//lib/em-core-metrics-test.jar \n" +
  58.148 + " /ade/dtsao_re/oracle/emcore//lib/em-core-tc-ui.jar \n" +
  58.149 + " /ade/dtsao_re/oracle/emcore//lib/em-core-tc-uimodel.jar \n" +
  58.150 + " /ade/dtsao_re/oracle/emcore//lib/em-core-tc-test.jar \n" +
  58.151 + " /ade/dtsao_re/oracle/emcore//lib/em-core-agentmgmt-ui.jar \n" +
  58.152 + " /ade/dtsao_re/oracle/emcore//lib/em-core-agentmgmt-uimodel.jar \n" +
  58.153 + " /ade/dtsao_re/oracle/emcore//lib/em-core-agentmgmt-test.jar \n" +
  58.154 + " /ade/dtsao_re/oracle/emcore//lib/em-core-gcharvester-uimodel.jar \n" +
  58.155 + " /ade/dtsao_re/oracle/emcore//lib/em-core-gcharvester-ui.jar \n" +
  58.156 + " /ade/dtsao_re/oracle/emcore//lib/em-core-gcharvester-test.jar \n" +
  58.157 + " /ade/dtsao_re/oracle/emcore//lib/em-core-patching-uimodel.jar \n" +
  58.158 + " /ade/dtsao_re/oracle/emcore//lib/em-core-patching-ui.jar \n" +
  58.159 + " /ade/dtsao_re/oracle/emcore//lib/em-core-patching-test.jar \n" +
  58.160 + " /ade/dtsao_re/oracle/emcore//lib/em-core-ohinv-uimodel.jar \n" +
  58.161 + " /ade/dtsao_re/oracle/emcore//lib/em-core-ohinv-ui.jar \n" +
  58.162 + " /ade/dtsao_re/oracle/emcore//lib/em-core-ohinv-test.jar \n" +
  58.163 + " /ade/dtsao_re/oracle/emcore//lib/em-core-ohagent-pojo.jar \n" +
  58.164 + " /ade/dtsao_re/oracle/emcore//lib/em-core-ohcoherence-pojo.jar \n" +
  58.165 + " /ade/dtsao_re/oracle/emcore//lib/em-core-ohjrockit-pojo.jar \n" +
  58.166 + " /ade/dtsao_re/oracle/emcore//lib/em-core-extensibility-ui.jar \n" +
  58.167 + " /ade/dtsao_re/oracle/emcore//lib/em-core-mpcustom-ui.jar \n" +
  58.168 + " /ade/dtsao_re/oracle/emcore//lib/em-core-selfmonitor-ui.jar \n" +
  58.169 + " /ade/dtsao_re/oracle/emcore//lib/em-core-ocheck-uimodel.jar \n" +
  58.170 + " /ade/dtsao_re/oracle/emcore//lib/em-core-udmmig-uimodel.jar \n" +
  58.171 + " /ade/dtsao_re/oracle/emcore//lib/em-core-multioms-ui.jar \n" +
  58.172 + " /ade/dtsao_re/oracle/emcore//lib/em-core-postupgrade-ui.jar \n" +
  58.173 + " /ade/dtsao_re/oracle/emcore//lib/em-core-postupgrade-uimodel.jar \n" +
  58.174 + " /ade/dtsao_re/oracle/emcore//lib/em-core-postupgrade-test.jar \n" +
  58.175 + " /ade/dtsao_re/oracle/emcore//lib/em-core-ppc-pojo.jar \n" +
  58.176 + " /ade/dtsao_re/oracle/emcore//lib/em-core-ppc-model.jar \n" +
  58.177 + " /ade/dtsao_re/oracle/emcore//lib/em-core-ppc-uimodel.jar \n" +
  58.178 + " /ade/dtsao_re/oracle/emcore//lib/em-core-ppc-ui.jar \n" +
  58.179 + " /ade/dtsao_re/oracle/emcore//lib/em-core-ppc-test.jar \n" +
  58.180 + " /ade/dtsao_re/oracle/emcore//lib/em-core-mextjmx-uimodel.jar \n" +
  58.181 + " /ade/dtsao_re/oracle/emcore//lib/em-core-mextjmx-ui.jar \n" +
  58.182 + " /ade/dtsao_re/oracle/emcore//lib/em-core-mextjmx-test.jar \n" +
  58.183 + " /ade/dtsao_re/oracle/emcore//lib/em-core-ocheck-ui.jar \n" +
  58.184 + " /ade/dtsao_re/oracle/emcore//lib/em-core-services-uimodel.jar \n" +
  58.185 + " /ade/dtsao_re/oracle/emcore//lib/em-core-services-ui.jar \n" +
  58.186 + " /ade/dtsao_re/oracle/emcore//lib/em-core-services-test.jar \n" +
  58.187 + " /ade/dtsao_re/oracle/emcore//lib/em-core-eventmobile-ui.jar \n" +
  58.188 + " /ade/dtsao_re/oracle/emcore//lib/em-core-uifwkmobile-ui.jar \n" +
  58.189 + " /ade/dtsao_re/oracle/emcore//lib/em-core-logmgmt-uimodel.jar \n" +
  58.190 + " /ade/dtsao_re/oracle/emcore//lib/em-core-omsproperties-ui.jar \n" +
  58.191 + " /ade/dtsao_re/oracle/emcore//lib/em-core-ohel-pojo.jar \n" +
  58.192 + " /ade/dtsao_re/oracle/emcore//lib/em-core-agentupgrade-ui.jar \n" +
  58.193 + " /ade/dtsao_re/oracle/emcore//lib/em-core-lm-test.jar \n" +
  58.194 + " /ade/dtsao_re/oracle/emcore//lib/em-core-lm-ui.jar \n" +
  58.195 + " /ade/dtsao_re/oracle/emcore//lib/em-core-lm-model.jar \n" +
  58.196 + " /ade/dtsao_re/oracle/emcore//lib/em-samples-regiontest-ui.jar \n" +
  58.197 + " /ade/dtsao_re/oracle/emcore//lib/em-samples-uipatterns-test.jar \n" +
  58.198 + " /ade/dtsao_re/oracle/emcore//lib/em-samples-uipatterns-uimodel.jar \n" +
  58.199 + " /ade/dtsao_re/oracle/emcore//lib/em-samples-uipatterns-ui.jar \n" +
  58.200 + " /ade/dtsao_re/oracle/emcore//lib/em-samples-uielements-uimodel.jar \n" +
  58.201 + " /ade/dtsao_re/oracle/emcore//lib/em-samples-uielements-ui.jar \n" +
  58.202 + " /ade/dtsao_re/oracle/emcore//lib/em-samples-sandbox-uimodel.jar \n" +
  58.203 + " /ade/dtsao_re/oracle/emcore//lib/em-samples-sandbox-ui.jar \n" +
  58.204 + " /ade/dtsao_re/oracle/emcore//lib/em-samples-sdkcore-model.jar \n" +
  58.205 + " /ade/dtsao_re/oracle/emcore//lib/em-samples-sdkcore-uimodel.jar \n" +
  58.206 + " /ade/dtsao_re/oracle/emcore//lib/em-samples-sdkcore-ui.jar \n" +
  58.207 + " /ade/dtsao_re/oracle/emcore//lib/em-samples-core-model.jar \n" +
  58.208 + " /ade/dtsao_re/oracle/emcore//lib/em-samples-core-uimodel.jar \n" +
  58.209 + " /ade/dtsao_re/oracle/emcore//lib/em-samples-core-ui.jar \n" +
  58.210 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-adfext-bc-public-model.jar \n" +
  58.211 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-aslm-services-public-pojo.jar \n" +
  58.212 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-avail-public-model.jar \n" +
  58.213 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-charge-public-model.jar \n" +
  58.214 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-config-public-model.jar \n" +
  58.215 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-connect-public-model.jar \n" +
  58.216 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-db-public-model.jar \n" +
  58.217 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-discovery-public-entity.jar \n" +
  58.218 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-discovery-public-model.jar \n" +
  58.219 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-event-console-public-model.jar \n" +
  58.220 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-event-public-model.jar \n" +
  58.221 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-event-rules-public-model.jar \n" +
  58.222 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-extens-public-model.jar \n" +
  58.223 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-filebrowser-public-model.jar \n" +
  58.224 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-filebrowser-public-ui.jar \n" +
  58.225 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-gccompliance-public-model.jar \n" +
  58.226 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-gccompliance-uimodel.jar \n" +
  58.227 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-gccompliance-public-ui.jar \n" +
  58.228 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-ip-public-model.jar \n" +
  58.229 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-job-public-model.jar \n" +
  58.230 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-me-public-model.jar \n" +
  58.231 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-metric-public-model.jar \n" +
  58.232 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-ecm-public-pojo.jar \n" +
  58.233 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-ecm-public-model.jar \n" +
  58.234 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-ecm-public-ui.jar \n" +
  58.235 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-ecm-test.jar \n" +
  58.236 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-paf-public-model.jar \n" +
  58.237 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-security-public-model.jar \n" +
  58.238 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-swlib-public-pojo.jar \n" +
  58.239 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-swlib-public-ui.jar \n" +
  58.240 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-templ-public-model.jar \n" +
  58.241 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-uifwk-public-model.jar \n" +
  58.242 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-uifwk-public-pojo.jar \n" +
  58.243 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-uifwk-public-ui.jar \n" +
  58.244 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-bmp-public-model.jar \n" +
  58.245 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-bmp-public-ui.jar \n" +
  58.246 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-bmp-public-entity.jar \n" +
  58.247 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-agent-patching-public-model.jar \n" +
  58.248 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-agent-patching-public-pojo.jar \n" +
  58.249 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-mext-public-model.jar \n" +
  58.250 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-mext-public-ui.jar \n" +
  58.251 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-mext-test.jar \n" +
  58.252 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-testconsole-public-model.jar \n" +
  58.253 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-testconsole-public-ui.jar \n" +
  58.254 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-testconsole-test.jar \n" +
  58.255 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-mos-public-model.jar \n" +
  58.256 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-mos-public-ui.jar \n" +
  58.257 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-mos-test.jar \n" +
  58.258 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-topology-public-model.jar \n" +
  58.259 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-topology-public-ui.jar \n" +
  58.260 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-regions-uimodel.jar \n" +
  58.261 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-regions-public-ui.jar \n" +
  58.262 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-event-test.jar \n" +
  58.263 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-uifwk-test.jar \n" +
  58.264 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-adfext-test.jar \n" +
  58.265 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-agentpatching-test.jar \n" +
  58.266 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-avail-test.jar \n" +
  58.267 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-bmp-test.jar \n" +
  58.268 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-charge-test.jar \n" +
  58.269 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-config-test.jar \n" +
  58.270 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-connect-test.jar \n" +
  58.271 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-db-test.jar \n" +
  58.272 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-discovery-test.jar \n" +
  58.273 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-ecm-test.jar \n" +
  58.274 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-extens-test.jar \n" +
  58.275 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-gccompliance-test.jar \n" +
  58.276 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-ip-test.jar \n" +
  58.277 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-job-test.jar \n" +
  58.278 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-me-test.jar \n" +
  58.279 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-metric-test.jar \n" +
  58.280 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-paf-test.jar \n" +
  58.281 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-regions-test.jar \n" +
  58.282 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-security-test.jar \n" +
  58.283 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-swlib-test.jar \n" +
  58.284 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-templ-test.jar \n" +
  58.285 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-groups-public-pojo.jar \n" +
  58.286 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-groups-test.jar \n" +
  58.287 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-topology-test.jar \n" +
  58.288 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-resources-public-pojo.jar \n" +
  58.289 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-clonecomponents-public-pojo.jar \n" +
  58.290 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-clonecomponents-public-model.jar \n" +
  58.291 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-clonecomponents-public-ui.jar \n" +
  58.292 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-clonecomponents-test.jar \n" +
  58.293 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-patching-public-model.jar \n" +
  58.294 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-patching-test.jar \n" +
  58.295 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-ohinv-public-model.jar \n" +
  58.296 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-ohinv-test.jar \n" +
  58.297 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-ppc-public-pojo.jar \n" +
  58.298 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-ppc-public-ui.jar \n" +
  58.299 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-agentpush-public-model.jar \n" +
  58.300 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-uifwkmobile-public-ui.jar \n" +
  58.301 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-lm-public-model.jar \n" +
  58.302 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-lm-public-ui.jar \n" +
  58.303 + " /ade/dtsao_re/oracle/emcore//lib/em-sdkcore-lm-test.jar \n";
  58.304 +}
    59.1 --- a/test/javax/naming/spi/DirectoryManager/GetContDirCtx.java	Thu Mar 22 12:41:26 2012 -0700
    59.2 +++ b/test/javax/naming/spi/DirectoryManager/GetContDirCtx.java	Mon Mar 26 17:31:42 2012 -0700
    59.3 @@ -26,6 +26,7 @@
    59.4   * @bug 4241676
    59.5   * @summary getContinuationDirContext() should set CPE environment property.
    59.6   * @build DummyObjectFactory DummyContext
    59.7 + * @run main/othervm GetContDirCtx
    59.8   */
    59.9  
   59.10  import java.util.Hashtable;
    60.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    60.2 +++ b/test/javax/swing/JTable/7027139/bug7027139.java	Mon Mar 26 17:31:42 2012 -0700
    60.3 @@ -0,0 +1,66 @@
    60.4 +/*
    60.5 + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
    60.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    60.7 + *
    60.8 + * This code is free software; you can redistribute it and/or modify it
    60.9 + * under the terms of the GNU General Public License version 2 only, as
   60.10 + * published by the Free Software Foundation.
   60.11 + *
   60.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   60.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   60.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   60.15 + * version 2 for more details (a copy is included in the LICENSE file that
   60.16 + * accompanied this code).
   60.17 + *
   60.18 + * You should have received a copy of the GNU General Public License version
   60.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   60.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   60.21 + *
   60.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   60.23 + * or visit www.oracle.com if you need additional information or have any
   60.24 + * questions.
   60.25 + */
   60.26 +
   60.27 +/* @test
   60.28 +   @bug 7027139
   60.29 +   @summary getFirstIndex() does not return the first index that has changed
   60.30 +   @author Pavel Porvatov
   60.31 +*/
   60.32 +
   60.33 +import javax.swing.*;
   60.34 +import javax.swing.event.ListSelectionEvent;
   60.35 +import javax.swing.event.ListSelectionListener;
   60.36 +
   60.37 +public class bug7027139 {
   60.38 +    public static void main(String[] args) throws Exception {
   60.39 +        SwingUtilities.invokeAndWait(new Runnable() {
   60.40 +            public void run() {
   60.41 +                JTable orderTable = new JTable(new String[][]{
   60.42 +                        {"Item 1 1", "Item 1 2"},
   60.43 +                        {"Item 2 1", "Item 2 2"},
   60.44 +                        {"Item 3 1", "Item 3 2"},
   60.45 +                        {"Item 4 1", "Item 4 2"},
   60.46 +                },
   60.47 +                        new String[]{"Col 1", "Col 2"});
   60.48 +
   60.49 +                ListSelectionModel selectionModel = orderTable.getSelectionModel();
   60.50 +                selectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
   60.51 +                selectionModel.addListSelectionListener(new ListSelectionListener() {
   60.52 +                    public void valueChanged(ListSelectionEvent e) {
   60.53 +                        if (e.getValueIsAdjusting()) {
   60.54 +                            return;
   60.55 +                        }
   60.56 +
   60.57 +                        if (e.getFirstIndex() < 0) {
   60.58 +                            throw new RuntimeException("Test bug7027139 failed");
   60.59 +                        }
   60.60 +                    }
   60.61 +                });
   60.62 +
   60.63 +                orderTable.selectAll();
   60.64 +            }
   60.65 +        });
   60.66 +
   60.67 +        System.out.println("Test bug7027139 passed");
   60.68 +    }
   60.69 +}
    61.1 --- a/test/sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java	Thu Mar 22 12:41:26 2012 -0700
    61.2 +++ b/test/sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java	Mon Mar 26 17:31:42 2012 -0700
    61.3 @@ -1,5 +1,5 @@
    61.4  /*
    61.5 - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
    61.6 + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
    61.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    61.8   *
    61.9   * This code is free software; you can redistribute it and/or modify it
   61.10 @@ -27,6 +27,7 @@
   61.11   * @summary Basic unit test of HotspotClassLoadingMBean.getClassLoadingTime()
   61.12   * @author  Steve Bohne
   61.13   * @build ClassToLoad0
   61.14 + * @run main GetClassLoadingTime
   61.15   */
   61.16  
   61.17  /*
   61.18 @@ -71,10 +72,8 @@
   61.19          }
   61.20  
   61.21          long time2 = mbean.getClassLoadingTime();
   61.22 -        long count = mbean.getLoadedClassCount();
   61.23  
   61.24          if (trace) {
   61.25 -            System.out.println("(new count is " + count + ")");
   61.26              System.out.println("Class loading time2 (ms): " + time2);
   61.27          }
   61.28  
   61.29 @@ -93,8 +92,6 @@
   61.30  // so we can avoid delegation and spend lots of time loading the
   61.31  // same class over and over, to test the class loading timer.
   61.32  class KlassLoader extends ClassLoader {
   61.33 -  static String klassDir="";
   61.34 -  static int index=0;
   61.35  
   61.36    public KlassLoader() {
   61.37        super(null);
   61.38 @@ -102,14 +99,13 @@
   61.39  
   61.40    protected synchronized Class findClass(String name)
   61.41                          throws ClassNotFoundException {
   61.42 -        String cname = klassDir
   61.43 -            + (klassDir == "" ? "" : "/")
   61.44 -            +name.replace('.', '/')
   61.45 +        String cname =
   61.46 +            name.replace('.', '/')
   61.47              +".class";
   61.48  
   61.49          FileInputStream in;
   61.50          try {
   61.51 -                in=new FileInputStream(cname);
   61.52 +                in = new FileInputStream(new File(System.getProperty("test.classes", "."), cname));
   61.53                  if (in == null) {
   61.54                          throw new ClassNotFoundException("getResourceAsStream("
   61.55                                  +cname+")");
    62.1 --- a/test/sun/misc/Cleaner/exitOnThrow.sh	Thu Mar 22 12:41:26 2012 -0700
    62.2 +++ b/test/sun/misc/Cleaner/exitOnThrow.sh	Mon Mar 26 17:31:42 2012 -0700
    62.3 @@ -29,6 +29,7 @@
    62.4  # @summary Ensure that if a cleaner throws an exception then the VM exits
    62.5  #
    62.6  # @build ExitOnThrow
    62.7 +# @run shell exitOnThrow.sh
    62.8  
    62.9  # Command-line usage: sh exitOnThrow.sh /path/to/build
   62.10  
    63.1 --- a/test/sun/nio/cs/OLD/TestIBMDB.java	Thu Mar 22 12:41:26 2012 -0700
    63.2 +++ b/test/sun/nio/cs/OLD/TestIBMDB.java	Mon Mar 26 17:31:42 2012 -0700
    63.3 @@ -26,6 +26,7 @@
    63.4   * @bug 6843578
    63.5   * @summary Test IBM DB charsets
    63.6   * @build IBM930_OLD IBM933_OLD IBM935_OLD IBM937_OLD IBM939_OLD IBM942_OLD IBM943_OLD IBM948_OLD IBM949_OLD IBM950_OLD IBM970_OLD IBM942C_OLD IBM943C_OLD IBM949C_OLD IBM1381_OLD IBM1383_OLD EUC_CN_OLD EUC_KR_OLD GBK_OLD Johab_OLD MS932_OLD MS936_OLD MS949_OLD MS950_OLD
    63.7 + * @run main TestIBMDB
    63.8   */
    63.9  
   63.10  import java.nio.charset.*;
    64.1 --- a/test/sun/nio/cs/OLD/TestX11CS.java	Thu Mar 22 12:41:26 2012 -0700
    64.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    64.3 @@ -1,133 +0,0 @@
    64.4 -/*
    64.5 - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
    64.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    64.7 - *
    64.8 - * This code is free software; you can redistribute it and/or modify it
    64.9 - * under the terms of the GNU General Public License version 2 only, as
   64.10 - * published by the Free Software Foundation.
   64.11 - *
   64.12 - * This code is distributed in the hope that it will be useful, but WITHOUT
   64.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   64.14 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   64.15 - * version 2 for more details (a copy is included in the LICENSE file that
   64.16 - * accompanied this code).
   64.17 - *
   64.18 - * You should have received a copy of the GNU General Public License version
   64.19 - * 2 along with this work; if not, write to the Free Software Foundation,
   64.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   64.21 - *
   64.22 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   64.23 - * or visit www.oracle.com if you need additional information or have any
   64.24 - * questions.
   64.25 - */
   64.26 -
   64.27 -/*
   64.28 - * @test
   64.29 - * @bug 1234567
   64.30 - * @summary Test updated X11 charsets
   64.31 - * @build X11GB2312_OLD X11GBK_OLD X11KSC5601_OLD
   64.32 - */
   64.33 -
   64.34 -import java.nio.charset.*;
   64.35 -import java.nio.*;
   64.36 -import java.util.*;
   64.37 -
   64.38 -public class TestX11CS {
   64.39 -
   64.40 -    static char[] decode(byte[] bb, Charset cs)
   64.41 -        throws Exception {
   64.42 -        CharsetDecoder dec = cs.newDecoder();
   64.43 -        ByteBuffer bbf = ByteBuffer.wrap(bb);
   64.44 -        CharBuffer cbf = CharBuffer.allocate(bb.length);
   64.45 -        CoderResult cr = dec.decode(bbf, cbf, true);
   64.46 -        if (cr != CoderResult.UNDERFLOW) {
   64.47 -            System.out.println("DEC-----------------");
   64.48 -            int pos = bbf.position();
   64.49 -            System.out.printf("  cr=%s, bbf.pos=%d, bb[pos]=%x,%x,%x,%x%n",
   64.50 -                              cr.toString(), pos,
   64.51 -                              bb[pos++]&0xff, bb[pos++]&0xff,bb[pos++]&0xff, bb[pos++]&0xff);
   64.52 -            throw new RuntimeException("Decoding err: " + cs.name());
   64.53 -        }
   64.54 -        char[] cc = new char[cbf.position()];
   64.55 -        cbf.flip(); cbf.get(cc);
   64.56 -        return cc;
   64.57 -
   64.58 -    }
   64.59 -
   64.60 -    static byte[] encode(char[] cc, Charset cs)
   64.61 -        throws Exception {
   64.62 -        ByteBuffer bbf = ByteBuffer.allocate(cc.length * 4);
   64.63 -        CharBuffer cbf = CharBuffer.wrap(cc);
   64.64 -        CharsetEncoder enc = cs.newEncoder();
   64.65 -
   64.66 -        CoderResult cr = enc.encode(cbf, bbf, true);
   64.67 -        if (cr != CoderResult.UNDERFLOW) {
   64.68 -            System.out.println("ENC-----------------");
   64.69 -            int pos = cbf.position();
   64.70 -            System.out.printf("  cr=%s, cbf.pos=%d, cc[pos]=%x%n",
   64.71 -                              cr.toString(), pos, cc[pos]&0xffff);
   64.72 -            throw new RuntimeException("Encoding err: " + cs.name());
   64.73 -        }
   64.74 -        byte[] bb = new byte[bbf.position()];
   64.75 -        bbf.flip(); bbf.get(bb);
   64.76 -        return bb;
   64.77 -    }
   64.78 -
   64.79 -    static char[] getChars(Charset newCS, Charset oldCS) {
   64.80 -        CharsetEncoder enc = oldCS.newEncoder();
   64.81 -        CharsetEncoder encNew = newCS.newEncoder();
   64.82 -        char[] cc = new char[0x10000];
   64.83 -        int pos = 0;
   64.84 -        int i = 0;
   64.85 -        while (i < 0x10000) {
   64.86 -            if (enc.canEncode((char)i) != encNew.canEncode((char)i)) {
   64.87 -                System.out.printf("  Err i=%x%n", i);
   64.88 -                //throw new RuntimeException("canEncode() err!");
   64.89 -            }
   64.90 -            if (enc.canEncode((char)i)) {
   64.91 -                cc[pos++] = (char)i;
   64.92 -            }
   64.93 -            i++;
   64.94 -        }
   64.95 -        return Arrays.copyOf(cc, pos);
   64.96 -    }
   64.97 -
   64.98 -    static void compare(Charset newCS, Charset oldCS) throws Exception {
   64.99 -        System.out.printf("    Diff <%s> <%s>...%n", newCS.name(), oldCS.name());
  64.100 -        char[] cc = getChars(newCS, oldCS);
  64.101 -
  64.102 -        byte[] bb1 = encode(cc, newCS);
  64.103 -        byte[] bb2 = encode(cc, oldCS);
  64.104 -
  64.105 -        if (!Arrays.equals(bb1, bb2)) {
  64.106 -            System.out.printf("        encoding failed!%n");
  64.107 -        }
  64.108 -        char[] cc1 = decode(bb1, newCS);
  64.109 -        char[] cc2 = decode(bb1, oldCS);
  64.110 -        if (!Arrays.equals(cc1, cc2)) {
  64.111 -            for (int i = 0; i < cc1.length; i++) {
  64.112 -                if (cc1[i] != cc2[i]) {
  64.113 -                    System.out.printf("i=%d, cc1=%x cc2=%x,  bb=<%x%x>%n",
  64.114 -                                      i,
  64.115 -                                      cc1[i]&0xffff, cc2[i]&0xffff,
  64.116 -                                      bb1[i*2]&0xff, bb1[i*2+1]&0xff);
  64.117 -                }
  64.118 -
  64.119 -            }
  64.120 -
  64.121 -            System.out.printf("        decoding failed%n");
  64.122 -        }
  64.123 -    }
  64.124 -
  64.125 -    public static void main(String[] args) throws Exception {
  64.126 -        compare(new sun.awt.motif.X11GBK(),
  64.127 -                new X11GBK_OLD());
  64.128 -
  64.129 -        compare(new sun.awt.motif.X11GB2312(),
  64.130 -                new X11GB2312_OLD());
  64.131 -
  64.132 -        compare(new sun.awt.motif.X11KSC5601(),
  64.133 -                new X11KSC5601_OLD());
  64.134 -
  64.135 -    }
  64.136 -}
    65.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    65.2 +++ b/test/sun/security/krb5/auto/Basic.java	Mon Mar 26 17:31:42 2012 -0700
    65.3 @@ -0,0 +1,56 @@
    65.4 +/*
    65.5 + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
    65.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    65.7 + *
    65.8 + * This code is free software; you can redistribute it and/or modify it
    65.9 + * under the terms of the GNU General Public License version 2 only, as
   65.10 + * published by the Free Software Foundation.
   65.11 + *
   65.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   65.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   65.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   65.15 + * version 2 for more details (a copy is included in the LICENSE file that
   65.16 + * accompanied this code).
   65.17 + *
   65.18 + * You should have received a copy of the GNU General Public License version
   65.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   65.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   65.21 + *
   65.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   65.23 + * or visit www.oracle.com if you need additional information or have any
   65.24 + * questions.
   65.25 + */
   65.26 +
   65.27 +/*
   65.28 + * @test
   65.29 + * @bug 7152176
   65.30 + * @summary More krb5 tests
   65.31 + * @compile -XDignore.symbol.file Basic.java
   65.32 + * @run main/othervm Basic
   65.33 + */
   65.34 +
   65.35 +import sun.security.jgss.GSSUtil;
   65.36 +
   65.37 +// The basic krb5 test skeleton you can copy from
   65.38 +public class Basic {
   65.39 +
   65.40 +    public static void main(String[] args) throws Exception {
   65.41 +
   65.42 +        new OneKDC(null).writeJAASConf();
   65.43 +
   65.44 +        Context c, s;
   65.45 +        c = Context.fromJAAS("client");
   65.46 +        s = Context.fromJAAS("server");
   65.47 +
   65.48 +        c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_KRB5_MECH_OID);
   65.49 +        s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID);
   65.50 +
   65.51 +        Context.handshake(c, s);
   65.52 +
   65.53 +        Context.transmit("i say high --", c, s);
   65.54 +        Context.transmit("   you say low", s, c);
   65.55 +
   65.56 +        s.dispose();
   65.57 +        c.dispose();
   65.58 +    }
   65.59 +}
    66.1 --- a/test/sun/security/krb5/auto/Context.java	Thu Mar 22 12:41:26 2012 -0700
    66.2 +++ b/test/sun/security/krb5/auto/Context.java	Mon Mar 26 17:31:42 2012 -0700
    66.3 @@ -96,6 +96,15 @@
    66.4      }
    66.5  
    66.6      /**
    66.7 +     * No JAAS login at all, can be used to test JGSS without JAAS
    66.8 +     */
    66.9 +    public static Context fromThinAir() throws Exception {
   66.10 +        Context out = new Context();
   66.11 +        out.s = new Subject();
   66.12 +        return out;
   66.13 +    }
   66.14 +
   66.15 +    /**
   66.16       * Logins with a JAAS login config entry name
   66.17       */
   66.18      public static Context fromJAAS(final String name) throws Exception {
   66.19 @@ -111,8 +120,10 @@
   66.20              String user, char[] pass, boolean storeKey) throws Exception {
   66.21          return fromUserPass(null, user, pass, storeKey);
   66.22      }
   66.23 +
   66.24      /**
   66.25       * Logins with a username and a password, using Krb5LoginModule directly
   66.26 +     * @param s existing subject, test multiple princ & creds for single subj
   66.27       * @param storeKey true if key should be saved, used on acceptor side
   66.28       */
   66.29      public static Context fromUserPass(Subject s,
    67.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    67.2 +++ b/test/sun/security/krb5/auto/GSS.java	Mon Mar 26 17:31:42 2012 -0700
    67.3 @@ -0,0 +1,60 @@
    67.4 +/*
    67.5 + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
    67.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    67.7 + *
    67.8 + * This code is free software; you can redistribute it and/or modify it
    67.9 + * under the terms of the GNU General Public License version 2 only, as
   67.10 + * published by the Free Software Foundation.
   67.11 + *
   67.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   67.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   67.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   67.15 + * version 2 for more details (a copy is included in the LICENSE file that
   67.16 + * accompanied this code).
   67.17 + *
   67.18 + * You should have received a copy of the GNU General Public License version
   67.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   67.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   67.21 + *
   67.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   67.23 + * or visit www.oracle.com if you need additional information or have any
   67.24 + * questions.
   67.25 + */
   67.26 +
   67.27 +/*
   67.28 + * @test
   67.29 + * @bug 7152176
   67.30 + * @summary More krb5 tests
   67.31 + * @compile -XDignore.symbol.file GSS.java
   67.32 + * @run main/othervm GSS
   67.33 + */
   67.34 +
   67.35 +import sun.security.jgss.GSSUtil;
   67.36 +
   67.37 +// Testing JGSS without JAAS
   67.38 +public class GSS {
   67.39 +
   67.40 +    public static void main(String[] args) throws Exception {
   67.41 +
   67.42 +        new OneKDC(null).writeJAASConf();
   67.43 +
   67.44 +        Context c, s;
   67.45 +        c = Context.fromThinAir();
   67.46 +        s = Context.fromThinAir();
   67.47 +
   67.48 +        // This is the only setting needed for JGSS without JAAS. The default
   67.49 +        // JAAS config entries are already created by OneKDC.
   67.50 +        System.setProperty("javax.security.auth.useSubjectCredsOnly", "false");
   67.51 +
   67.52 +        c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_KRB5_MECH_OID);
   67.53 +        s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID);
   67.54 +
   67.55 +        Context.handshake(c, s);
   67.56 +
   67.57 +        Context.transmit("i say high --", c, s);
   67.58 +        Context.transmit("   you say low", s, c);
   67.59 +
   67.60 +        s.dispose();
   67.61 +        c.dispose();
   67.62 +    }
   67.63 +}
    68.1 --- a/test/sun/security/krb5/auto/KDC.java	Thu Mar 22 12:41:26 2012 -0700
    68.2 +++ b/test/sun/security/krb5/auto/KDC.java	Mon Mar 26 17:31:42 2012 -0700
    68.3 @@ -236,80 +236,82 @@
    68.4      }
    68.5  
    68.6      /**
    68.7 -     * Writes or appends KDC keys into a keytab. See doc for writeMultiKtab.
    68.8 +     * Writes or appends keys into a keytab.
    68.9 +     * <p>
   68.10 +     * Attention: This is the most basic one of a series of methods below on
   68.11 +     * keytab creation or modification. All these methods reference krb5.conf
   68.12 +     * settings. If you need to modify krb5.conf or switch to another krb5.conf
   68.13 +     * later, please call <code>Config.refresh()</code> again. For example:
   68.14 +     * <pre>
   68.15 +     * kdc.writeKtab("/etc/kdc/ktab", true);  // Config is initialized,
   68.16 +     * System.setProperty("java.security.krb5.conf", "/home/mykrb5.conf");
   68.17 +     * Config.refresh();
   68.18 +     * </pre>
   68.19 +     * Inside this method there are 2 places krb5.conf is used:
   68.20 +     * <ol>
   68.21 +     * <li> (Fatal) Generating keys: EncryptionKey.acquireSecretKeys
   68.22 +     * <li> (Has workaround) Creating PrincipalName
   68.23 +     * </ol>
   68.24 +     * @param tab the keytab file name
   68.25       * @param append true if append, otherwise, overwrite.
   68.26 +     * @param names the names to write into, write all if names is empty
   68.27       */
   68.28 -    private static void writeKtab0(String tab, boolean append, KDC... kdcs)
   68.29 +    public void writeKtab(String tab, boolean append, String... names)
   68.30              throws IOException, KrbException {
   68.31          KeyTab ktab = append ? KeyTab.getInstance(tab) : KeyTab.create(tab);
   68.32 -        for (KDC kdc: kdcs) {
   68.33 -            for (String name : kdc.passwords.keySet()) {
   68.34 -                char[] pass = kdc.passwords.get(name);
   68.35 -                int kvno = 0;
   68.36 -                if (Character.isDigit(pass[pass.length-1])) {
   68.37 -                    kvno = pass[pass.length-1] - '0';
   68.38 -                }
   68.39 -                ktab.addEntry(new PrincipalName(name,
   68.40 -                        name.indexOf('/') < 0 ?
   68.41 -                            PrincipalName.KRB_NT_UNKNOWN :
   68.42 -                            PrincipalName.KRB_NT_SRV_HST),
   68.43 -                            pass,
   68.44 -                            kvno,
   68.45 -                            true);
   68.46 +        Iterable<String> entries =
   68.47 +                (names.length != 0) ? Arrays.asList(names): passwords.keySet();
   68.48 +        for (String name : entries) {
   68.49 +            char[] pass = passwords.get(name);
   68.50 +            int kvno = 0;
   68.51 +            if (Character.isDigit(pass[pass.length-1])) {
   68.52 +                kvno = pass[pass.length-1] - '0';
   68.53              }
   68.54 +            ktab.addEntry(new PrincipalName(name,
   68.55 +                    name.indexOf('/') < 0 ?
   68.56 +                        PrincipalName.KRB_NT_UNKNOWN :
   68.57 +                        PrincipalName.KRB_NT_SRV_HST),
   68.58 +                        pass,
   68.59 +                        kvno,
   68.60 +                        true);
   68.61          }
   68.62          ktab.save();
   68.63      }
   68.64  
   68.65      /**
   68.66       * Writes all principals' keys from multiple KDCs into one keytab file.
   68.67 -     * Note that the keys for the krbtgt principals will not be written.
   68.68 -     * <p>
   68.69 -     * Attention: This method references krb5.conf settings. If you need to
   68.70 -     * setup krb5.conf later, please call <code>Config.refresh()</code> after
   68.71 -     * the new setting. For example:
   68.72 -     * <pre>
   68.73 -     * KDC.writeKtab("/etc/kdc/ktab", kdc);  // Config is initialized,
   68.74 -     * System.setProperty("java.security.krb5.conf", "/home/mykrb5.conf");
   68.75 -     * Config.refresh();
   68.76 -     * </pre>
   68.77 -     *
   68.78 -     * Inside this method there are 2 places krb5.conf is used:
   68.79 -     * <ol>
   68.80 -     * <li> (Fatal) Generating keys: EncryptionKey.acquireSecretKeys
   68.81 -     * <li> (Has workaround) Creating PrincipalName
   68.82 -     * </ol>
   68.83 -     * @param tab The keytab filename to write to.
   68.84       * @throws java.io.IOException for any file output error
   68.85       * @throws sun.security.krb5.KrbException for any realm and/or principal
   68.86       *         name error.
   68.87       */
   68.88      public static void writeMultiKtab(String tab, KDC... kdcs)
   68.89              throws IOException, KrbException {
   68.90 -        writeKtab0(tab, false, kdcs);
   68.91 +        KeyTab.create(tab).save();      // Empty the old keytab
   68.92 +        appendMultiKtab(tab, kdcs);
   68.93      }
   68.94  
   68.95      /**
   68.96       * Appends all principals' keys from multiple KDCs to one keytab file.
   68.97 -     * See writeMultiKtab for details.
   68.98       */
   68.99      public static void appendMultiKtab(String tab, KDC... kdcs)
  68.100              throws IOException, KrbException {
  68.101 -        writeKtab0(tab, true, kdcs);
  68.102 +        for (KDC kdc: kdcs) {
  68.103 +            kdc.writeKtab(tab, true);
  68.104 +        }
  68.105      }
  68.106  
  68.107      /**
  68.108       * Write a ktab for this KDC.
  68.109       */
  68.110      public void writeKtab(String tab) throws IOException, KrbException {
  68.111 -        KDC.writeMultiKtab(tab, this);
  68.112 +        writeKtab(tab, false);
  68.113      }
  68.114  
  68.115      /**
  68.116       * Appends keys in this KDC to a ktab.
  68.117       */
  68.118      public void appendKtab(String tab) throws IOException, KrbException {
  68.119 -        KDC.appendMultiKtab(tab, this);
  68.120 +        writeKtab(tab, true);
  68.121      }
  68.122  
  68.123      /**
    69.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    69.2 +++ b/test/sun/security/krb5/auto/TwoTab.java	Mon Mar 26 17:31:42 2012 -0700
    69.3 @@ -0,0 +1,99 @@
    69.4 +/*
    69.5 + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
    69.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    69.7 + *
    69.8 + * This code is free software; you can redistribute it and/or modify it
    69.9 + * under the terms of the GNU General Public License version 2 only, as
   69.10 + * published by the Free Software Foundation.
   69.11 + *
   69.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   69.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   69.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   69.15 + * version 2 for more details (a copy is included in the LICENSE file that
   69.16 + * accompanied this code).
   69.17 + *
   69.18 + * You should have received a copy of the GNU General Public License version
   69.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   69.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   69.21 + *
   69.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   69.23 + * or visit www.oracle.com if you need additional information or have any
   69.24 + * questions.
   69.25 + */
   69.26 +
   69.27 +/*
   69.28 + * @test
   69.29 + * @bug 7152176
   69.30 + * @summary More krb5 tests
   69.31 + * @compile -XDignore.symbol.file TwoTab.java
   69.32 + * @run main/othervm TwoTab
   69.33 + */
   69.34 +
   69.35 +import java.io.File;
   69.36 +import java.io.FileOutputStream;
   69.37 +import java.nio.file.Files;
   69.38 +import java.security.Security;
   69.39 +import sun.security.jgss.GSSUtil;
   69.40 +import sun.security.krb5.PrincipalName;
   69.41 +import sun.security.krb5.internal.ktab.KeyTab;
   69.42 +
   69.43 +// Two services using their own keytab.
   69.44 +public class TwoTab {
   69.45 +
   69.46 +    public static void main(String[] args) throws Exception {
   69.47 +
   69.48 +        KDC k = new OneKDC(null);
   69.49 +
   69.50 +        // Write JAAS conf, two service using different keytabs
   69.51 +        System.setProperty("java.security.auth.login.config", OneKDC.JAAS_CONF);
   69.52 +        File f = new File(OneKDC.JAAS_CONF);
   69.53 +        try (FileOutputStream fos = new FileOutputStream(f)) {
   69.54 +            fos.write((
   69.55 +                "server {\n" +
   69.56 +                "    com.sun.security.auth.module.Krb5LoginModule required\n" +
   69.57 +                "    principal=\"" + OneKDC.SERVER + "\"\n" +
   69.58 +                "    useKeyTab=true\n" +
   69.59 +                "    keyTab=server.keytab\n" +
   69.60 +                "    storeKey=true;\n};\n" +
   69.61 +                "server2 {\n" +
   69.62 +                "    com.sun.security.auth.module.Krb5LoginModule required\n" +
   69.63 +                "    principal=\"" + OneKDC.BACKEND + "\"\n" +
   69.64 +                "    useKeyTab=true\n" +
   69.65 +                "    keyTab=backend.keytab\n" +
   69.66 +                "    storeKey=true;\n};\n"
   69.67 +                ).getBytes());
   69.68 +        }
   69.69 +        f.deleteOnExit();
   69.70 +
   69.71 +        k.writeKtab("server.keytab", false, "server/host.rabbit.hole@RABBIT.HOLE");
   69.72 +        k.writeKtab("backend.keytab", false, "backend/host.rabbit.hole@RABBIT.HOLE");
   69.73 +
   69.74 +        Context c, s, s2;
   69.75 +        c = Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false);
   69.76 +        s = Context.fromJAAS("server");
   69.77 +        s2 = Context.fromJAAS("server2");
   69.78 +
   69.79 +        c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_KRB5_MECH_OID);
   69.80 +        s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID);
   69.81 +
   69.82 +        Context.handshake(c, s);
   69.83 +
   69.84 +        Context.transmit("i say high --", c, s);
   69.85 +        Context.transmit("   you say low", s, c);
   69.86 +
   69.87 +        s.dispose();
   69.88 +        c.dispose();
   69.89 +
   69.90 +        c = Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false);
   69.91 +        c.startAsClient(OneKDC.BACKEND, GSSUtil.GSS_KRB5_MECH_OID);
   69.92 +        s2.startAsServer(GSSUtil.GSS_KRB5_MECH_OID);
   69.93 +
   69.94 +        Context.handshake(c, s2);
   69.95 +
   69.96 +        Context.transmit("i say high --", c, s2);
   69.97 +        Context.transmit("   you say low", s2, c);
   69.98 +
   69.99 +        s2.dispose();
  69.100 +        c.dispose();
  69.101 +    }
  69.102 +}
    70.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    70.2 +++ b/test/sun/security/pkcs11/KeyAgreement/TestInterop.java	Mon Mar 26 17:31:42 2012 -0700
    70.3 @@ -0,0 +1,143 @@
    70.4 +/*
    70.5 + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
    70.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    70.7 + *
    70.8 + * This code is free software; you can redistribute it and/or modify it
    70.9 + * under the terms of the GNU General Public License version 2 only, as
   70.10 + * published by the Free Software Foundation.
   70.11 + *
   70.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   70.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   70.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   70.15 + * version 2 for more details (a copy is included in the LICENSE file that
   70.16 + * accompanied this code).
   70.17 + *
   70.18 + * You should have received a copy of the GNU General Public License version
   70.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   70.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   70.21 + *
   70.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   70.23 + * or visit www.oracle.com if you need additional information or have any
   70.24 + * questions.
   70.25 + */
   70.26 +
   70.27 +/**
   70.28 + * @test
   70.29 + * @bug 7146728
   70.30 + * @summary Interop test for DH with secret that has a leading 0x00 byte
   70.31 + * @library ..
   70.32 + */
   70.33 +import java.math.BigInteger;
   70.34 +import java.util.*;
   70.35 +
   70.36 +import java.security.*;
   70.37 +
   70.38 +import javax.crypto.*;
   70.39 +import javax.crypto.spec.*;
   70.40 +
   70.41 +public class TestInterop extends PKCS11Test {
   70.42 +
   70.43 +    private final static BigInteger p = new BigInteger
   70.44 +    ("171718397966129586011229151993178480901904202533705695869569760169920539"
   70.45 +    + "80807543778874708672297590042574075430109846864794139516459381007417046"
   70.46 +    + "27996080624930219892858374168155487210358743785481212360509485282294161"
   70.47 +    + "39585571568998066586304075565145536350296006867635076744949977849997684"
   70.48 +    + "222020336013226588207303");
   70.49 +
   70.50 +    private final static BigInteger g = new BigInteger("2");
   70.51 +
   70.52 +    private final static BigInteger ya = new BigInteger
   70.53 +    ("687709211571508809414670982463565909269384277848448625781941269577397703"
   70.54 +    + "73675199968849153119146758339814638228795348558483510369322822476757204"
   70.55 +    + "22158455966026517829008713407587339322132253724742557954802911059639161"
   70.56 +    + "24827916158465757962384625410294483756242900146397201260757102085985457"
   70.57 +    + "09397033481077351036224");
   70.58 +
   70.59 +    private final static BigInteger xa = new BigInteger
   70.60 +    ("104917367119952955556289227181599819745346393858545449202252025137706135"
   70.61 +    + "98100778613457655440586438263591136003106529323555991109623536177695714"
   70.62 +    + "66884181531401472902830508361532232717792847436112280721439936797741371"
   70.63 +    + "245140912614191507");
   70.64 +
   70.65 +    private final static BigInteger yb  = new BigInteger
   70.66 +    ("163887874871842952463100699681506173424091615364591742415764095471629919"
   70.67 +    + "08421025296419917755446931473037086355546823601999684501737493240373415"
   70.68 +    + "65608293667837249198973539289354492348897732633852665609611113031379864"
   70.69 +    + "58514616034107537409230452318065341748503347627733368519091332060477528"
   70.70 +    + "173423377887175351037810");
   70.71 +
   70.72 +    private final static BigInteger xb = new BigInteger
   70.73 +    ("127757517533485947079959908591028646859165238853082197617179368337276371"
   70.74 +    + "51601819447716934542027725311863797141734616730248519214531856941516613"
   70.75 +    + "30313414180008978013330410484011186019824874948204261839391153650949864"
   70.76 +    + "429505597086564709");
   70.77 +
   70.78 +    public void main(Provider prov) throws Exception {
   70.79 +        if (prov.getService("KeyAgreement", "DH") == null) {
   70.80 +            System.out.println("DH not supported, skipping");
   70.81 +            return;
   70.82 +        }
   70.83 +        try {
   70.84 +            System.out.println("testing generateSecret()");
   70.85 +
   70.86 +            DHPublicKeySpec publicSpec;
   70.87 +            DHPrivateKeySpec privateSpec;
   70.88 +            KeyFactory kf = KeyFactory.getInstance("DH");
   70.89 +            KeyAgreement ka = KeyAgreement.getInstance("DH", prov);
   70.90 +            KeyAgreement kbSunJCE = KeyAgreement.getInstance("DH", "SunJCE");
   70.91 +            DHPrivateKeySpec privSpecA = new DHPrivateKeySpec(xa, p, g);
   70.92 +            DHPublicKeySpec pubSpecA = new DHPublicKeySpec(ya, p, g);
   70.93 +            PrivateKey privA = kf.generatePrivate(privSpecA);
   70.94 +            PublicKey pubA = kf.generatePublic(pubSpecA);
   70.95 +
   70.96 +            DHPrivateKeySpec privSpecB = new DHPrivateKeySpec(xb, p, g);
   70.97 +            DHPublicKeySpec pubSpecB = new DHPublicKeySpec(yb, p, g);
   70.98 +            PrivateKey privB = kf.generatePrivate(privSpecB);
   70.99 +            PublicKey pubB = kf.generatePublic(pubSpecB);
  70.100 +
  70.101 +            ka.init(privA);
  70.102 +            ka.doPhase(pubB, true);
  70.103 +            byte[] n1 = ka.generateSecret();
  70.104 +
  70.105 +            kbSunJCE.init(privB);
  70.106 +            kbSunJCE.doPhase(pubA, true);
  70.107 +            byte[] n2 = kbSunJCE.generateSecret();
  70.108 +
  70.109 +            if (Arrays.equals(n1, n2) == false) {
  70.110 +                throw new Exception("values mismatch!");
  70.111 +            } else {
  70.112 +                System.out.println("values: same");
  70.113 +            }
  70.114 +
  70.115 +            System.out.println("testing generateSecret(byte[], int)");
  70.116 +            byte[] n3 = new byte[n1.length];
  70.117 +            ka.init(privB);
  70.118 +            ka.doPhase(pubA, true);
  70.119 +            int n3Len = ka.generateSecret(n3, 0);
  70.120 +            if (n3Len != n3.length) {
  70.121 +                throw new Exception("PKCS11 Length mismatch!");
  70.122 +            } else System.out.println("PKCS11 Length: ok");
  70.123 +            byte[] n4 = new byte[n2.length];
  70.124 +            kbSunJCE.init(privA);
  70.125 +            kbSunJCE.doPhase(pubB, true);
  70.126 +            int n4Len = kbSunJCE.generateSecret(n4, 0);
  70.127 +            if (n4Len != n4.length) {
  70.128 +                throw new Exception("SunJCE Length mismatch!");
  70.129 +            } else System.out.println("SunJCE Length: ok");
  70.130 +
  70.131 +            if (Arrays.equals(n3, n4) == false) {
  70.132 +                throw new Exception("values mismatch! ");
  70.133 +            } else {
  70.134 +                System.out.println("values: same");
  70.135 +            }
  70.136 +        } catch (Exception ex) {
  70.137 +            System.out.println("Unexpected ex: " + ex);
  70.138 +            ex.printStackTrace();
  70.139 +            throw ex;
  70.140 +        }
  70.141 +    }
  70.142 +
  70.143 +    public static void main(String[] args) throws Exception {
  70.144 +        main(new TestInterop());
  70.145 +    }
  70.146 +}
    71.1 --- a/test/sun/security/pkcs11/KeyAgreement/TestShort.java	Thu Mar 22 12:41:26 2012 -0700
    71.2 +++ b/test/sun/security/pkcs11/KeyAgreement/TestShort.java	Mon Mar 26 17:31:42 2012 -0700
    71.3 @@ -1,5 +1,5 @@
    71.4  /*
    71.5 - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
    71.6 + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
    71.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    71.8   *
    71.9   * This code is free software; you can redistribute it and/or modify it
   71.10 @@ -23,7 +23,7 @@
   71.11  
   71.12  /**
   71.13   * @test
   71.14 - * @bug 4942494
   71.15 + * @bug 4942494 7146728
   71.16   * @summary KAT test for DH (normal and with secret that has leading a 0x00 byte)
   71.17   * @author Andreas Sterbenz
   71.18   * @library ..
   71.19 @@ -66,7 +66,7 @@
   71.20      ("433011588852527167500079509018272713204454720683");
   71.21  
   71.22      private final static byte[] s2 = parse
   71.23 -    ("19:c7:f1:bb:2e:3d:93:fa:02:d2:e9:9f:75:32:b9:e6:7a:a0:4a:10:45:81:d4:2b:"
   71.24 +    ("00:19:c7:f1:bb:2e:3d:93:fa:02:d2:e9:9f:75:32:b9:e6:7a:a0:4a:10:45:81:d4:2b:"
   71.25      + "e2:77:4c:70:41:39:7c:19:fa:65:64:47:49:8a:ad:0a:fa:9d:e9:62:68:97:c5:52"
   71.26      + ":b1:37:03:d9:cd:aa:e1:bd:7e:71:0c:fc:15:a1:95");
   71.27  
   71.28 @@ -88,31 +88,36 @@
   71.29              System.out.println("DH not supported, skipping");
   71.30              return;
   71.31          }
   71.32 -        DHPublicKeySpec publicSpec;
   71.33 -        DHPrivateKeySpec privateSpec;
   71.34 -        KeyFactory kf = KeyFactory.getInstance("DH", provider);
   71.35 -        KeyAgreement ka = KeyAgreement.getInstance("DH", provider);
   71.36 -//      KeyAgreement ka = KeyAgreement.getInstance("DH");
   71.37 +        try {
   71.38 +            DHPublicKeySpec publicSpec;
   71.39 +            DHPrivateKeySpec privateSpec;
   71.40 +            KeyFactory kf = KeyFactory.getInstance("DH", provider);
   71.41 +            KeyAgreement ka = KeyAgreement.getInstance("DH", provider);
   71.42  
   71.43 -        PrivateKey pr1 = kf.generatePrivate(new DHPrivateKeySpec(x1, p, g));
   71.44 -        PublicKey pu2 = kf.generatePublic(new DHPublicKeySpec(y2, p, g));
   71.45 -        PublicKey pu3 = kf.generatePublic(new DHPublicKeySpec(y3, p, g));
   71.46 +            PrivateKey pr1 = kf.generatePrivate(new DHPrivateKeySpec(x1, p, g));
   71.47 +            PublicKey pu2 = kf.generatePublic(new DHPublicKeySpec(y2, p, g));
   71.48 +            PublicKey pu3 = kf.generatePublic(new DHPublicKeySpec(y3, p, g));
   71.49  
   71.50 -        ka.init(pr1);
   71.51 -        ka.doPhase(pu2, true);
   71.52 -        byte[] n2 = ka.generateSecret();
   71.53 -        if (Arrays.equals(s2, n2) == false) {
   71.54 -            throw new Exception("mismatch 2");
   71.55 +            ka.init(pr1);
   71.56 +            ka.doPhase(pu2, true);
   71.57 +            byte[] n2 = ka.generateSecret();
   71.58 +            if (Arrays.equals(s2, n2) == false) {
   71.59 +                throw new Exception("mismatch 2");
   71.60 +            }
   71.61 +            System.out.println("short ok");
   71.62 +
   71.63 +            ka.init(pr1);
   71.64 +            ka.doPhase(pu3, true);
   71.65 +            byte[] n3 = ka.generateSecret();
   71.66 +            if (Arrays.equals(s3, n3) == false) {
   71.67 +                throw new Exception("mismatch 3");
   71.68 +            }
   71.69 +            System.out.println("normal ok");
   71.70 +        } catch (Exception ex) {
   71.71 +            System.out.println("Unexpected Exception: " + ex);
   71.72 +            ex.printStackTrace();
   71.73 +            throw ex;
   71.74          }
   71.75 -        System.out.println("short ok");
   71.76 -
   71.77 -        ka.init(pr1);
   71.78 -        ka.doPhase(pu3, true);
   71.79 -        byte[] n3 = ka.generateSecret();
   71.80 -        if (Arrays.equals(s3, n3) == false) {
   71.81 -            throw new Exception("mismatch 3");
   71.82 -        }
   71.83 -        System.out.println("normal ok");
   71.84  
   71.85  /*
   71.86          KeyPairGenerator kpg = KeyPairGenerator.getInstance("DH", provider);
    72.1 --- a/test/sun/security/ssl/com/sun/net/ssl/SSLSecurity/ProviderTest.java	Thu Mar 22 12:41:26 2012 -0700
    72.2 +++ b/test/sun/security/ssl/com/sun/net/ssl/SSLSecurity/ProviderTest.java	Mon Mar 26 17:31:42 2012 -0700
    72.3 @@ -27,6 +27,7 @@
    72.4   * @compile JavaxSSLContextImpl.java ComSSLContextImpl.java
    72.5   *      JavaxTrustManagerFactoryImpl.java ComTrustManagerFactoryImpl.java
    72.6   *      JavaxKeyManagerFactoryImpl.java ComKeyManagerFactoryImpl.java
    72.7 + * @run main ProviderTest
    72.8   * @summary brokenness in the com.sun.net.ssl.SSLSecurity wrappers
    72.9   */
   72.10  
    73.1 --- a/test/sun/tools/jcmd/jcmd_Output1.awk	Thu Mar 22 12:41:26 2012 -0700
    73.2 +++ b/test/sun/tools/jcmd/jcmd_Output1.awk	Mon Mar 26 17:31:42 2012 -0700
    73.3 @@ -20,6 +20,11 @@
    73.4  	    current=1;
    73.5  	}
    73.6  
    73.7 +# or match an empty class name
    73.8 +/^[0-9]+ $/	{
    73.9 +	    current=1;
   73.10 +	}
   73.11 +
   73.12  	{ totallines++; matched+=current; current=0; print $0 }
   73.13  
   73.14  END	{
    74.1 --- a/test/sun/tools/jps/jps-l_Output1.awk	Thu Mar 22 12:41:26 2012 -0700
    74.2 +++ b/test/sun/tools/jps/jps-l_Output1.awk	Mon Mar 26 17:31:42 2012 -0700
    74.3 @@ -20,6 +20,11 @@
    74.4  	    matched++;
    74.5  	}
    74.6  
    74.7 +# or match an empty class name
    74.8 +/^[0-9]+ $/	{
    74.9 +	    matched++;
   74.10 +	}
   74.11 +
   74.12  	{ totallines++; print $0 }
   74.13  
   74.14  END	{
    75.1 --- a/test/sun/tools/jps/jps_Output1.awk	Thu Mar 22 12:41:26 2012 -0700
    75.2 +++ b/test/sun/tools/jps/jps_Output1.awk	Mon Mar 26 17:31:42 2012 -0700
    75.3 @@ -20,6 +20,11 @@
    75.4  	    matched++;
    75.5  	}
    75.6  
    75.7 +# or match an empty class name
    75.8 +/^[0-9]+ $/	{
    75.9 +	    matched++;
   75.10 +	}
   75.11 +
   75.12  	{ totallines++; print $0 }
   75.13  
   75.14  END	{
    76.1 --- a/test/sun/tools/jstat/jstatClassOutput1.sh	Thu Mar 22 12:41:26 2012 -0700
    76.2 +++ b/test/sun/tools/jstat/jstatClassOutput1.sh	Mon Mar 26 17:31:42 2012 -0700
    76.3 @@ -1,5 +1,5 @@
    76.4  #
    76.5 -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
    76.6 +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
    76.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    76.8  #
    76.9  # This code is free software; you can redistribute it and/or modify it
   76.10 @@ -33,4 +33,4 @@
   76.11  
   76.12  JSTAT="${TESTJAVA}/bin/jstat"
   76.13  
   76.14 -${JSTAT} -J-XX:+UsePerfData -class 0 2>&1 | awk -f ${TESTSRC}/classOutput1.awk
   76.15 +${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -class 0 2>&1 | awk -f ${TESTSRC}/classOutput1.awk
    77.1 --- a/test/sun/tools/jstat/jstatClassloadOutput1.sh	Thu Mar 22 12:41:26 2012 -0700
    77.2 +++ b/test/sun/tools/jstat/jstatClassloadOutput1.sh	Mon Mar 26 17:31:42 2012 -0700
    77.3 @@ -1,5 +1,5 @@
    77.4  #
    77.5 -# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
    77.6 +# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
    77.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    77.8  #
    77.9  # This code is free software; you can redistribute it and/or modify it
   77.10 @@ -33,4 +33,4 @@
   77.11  
   77.12  JSTAT="${TESTJAVA}/bin/jstat"
   77.13  
   77.14 -${JSTAT} -J-XX:+UsePerfData -classload -J-Djstat.showUnsupported=true 0 2>&1 | awk -f ${TESTSRC}/classloadOutput1.awk
   77.15 +${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -classload -J-Djstat.showUnsupported=true 0 2>&1 | awk -f ${TESTSRC}/classloadOutput1.awk
    78.1 --- a/test/sun/tools/jstat/jstatCompilerOutput1.sh	Thu Mar 22 12:41:26 2012 -0700
    78.2 +++ b/test/sun/tools/jstat/jstatCompilerOutput1.sh	Mon Mar 26 17:31:42 2012 -0700
    78.3 @@ -1,5 +1,5 @@
    78.4  #
    78.5 -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
    78.6 +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
    78.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    78.8  #
    78.9  # This code is free software; you can redistribute it and/or modify it
   78.10 @@ -33,4 +33,4 @@
   78.11  
   78.12  JSTAT="${TESTJAVA}/bin/jstat"
   78.13  
   78.14 -${JSTAT} -J-XX:+UsePerfData -compiler 0 2>&1 | awk -f ${TESTSRC}/compilerOutput1.awk
   78.15 +${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -compiler 0 2>&1 | awk -f ${TESTSRC}/compilerOutput1.awk
    79.1 --- a/test/sun/tools/jstat/jstatFileURITest1.sh	Thu Mar 22 12:41:26 2012 -0700
    79.2 +++ b/test/sun/tools/jstat/jstatFileURITest1.sh	Mon Mar 26 17:31:42 2012 -0700
    79.3 @@ -1,5 +1,5 @@
    79.4  #
    79.5 -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
    79.6 +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
    79.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    79.8  #
    79.9  # This code is free software; you can redistribute it and/or modify it
   79.10 @@ -40,12 +40,12 @@
   79.11      # characters into forward slash characters in an effort to convert
   79.12      # TESTSRC into a canonical form useable as URI path.
   79.13      cp ${TESTSRC}/hsperfdata_3433 .
   79.14 -    ${JSTAT} -J-XX:+UsePerfData -gcutil file:/`pwd`/hsperfdata_3433 2>&1 | awk -f ${TESTSRC}/fileURITest1.awk
   79.15 +    ${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcutil file:/`pwd`/hsperfdata_3433 2>&1 | awk -f ${TESTSRC}/fileURITest1.awk
   79.16      RC=$?
   79.17      rm -f hsperfdata_3433 2>&1 > /dev/null
   79.18      ;;
   79.19  *)
   79.20 -    ${JSTAT} -J-XX:+UsePerfData -gcutil file:${TESTSRC}/hsperfdata_3433 2>&1 | awk -f ${TESTSRC}/fileURITest1.awk
   79.21 +    ${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcutil file:${TESTSRC}/hsperfdata_3433 2>&1 | awk -f ${TESTSRC}/fileURITest1.awk
   79.22      RC=$?
   79.23      ;;
   79.24  esac
    80.1 --- a/test/sun/tools/jstat/jstatGcCapacityOutput1.sh	Thu Mar 22 12:41:26 2012 -0700
    80.2 +++ b/test/sun/tools/jstat/jstatGcCapacityOutput1.sh	Mon Mar 26 17:31:42 2012 -0700
    80.3 @@ -1,5 +1,5 @@
    80.4  #
    80.5 -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
    80.6 +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
    80.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    80.8  #
    80.9  # This code is free software; you can redistribute it and/or modify it
   80.10 @@ -33,4 +33,4 @@
   80.11  
   80.12  JSTAT="${TESTJAVA}/bin/jstat"
   80.13  
   80.14 -${JSTAT} -J-XX:+UsePerfData -gccapacity 0 2>&1 | awk -f ${TESTSRC}/gcCapacityOutput1.awk
   80.15 +${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gccapacity 0 2>&1 | awk -f ${TESTSRC}/gcCapacityOutput1.awk
    81.1 --- a/test/sun/tools/jstat/jstatGcCauseOutput1.sh	Thu Mar 22 12:41:26 2012 -0700
    81.2 +++ b/test/sun/tools/jstat/jstatGcCauseOutput1.sh	Mon Mar 26 17:31:42 2012 -0700
    81.3 @@ -1,5 +1,5 @@
    81.4  #
    81.5 -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
    81.6 +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
    81.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    81.8  #
    81.9  # This code is free software; you can redistribute it and/or modify it
   81.10 @@ -37,4 +37,4 @@
   81.11  # class machine, ergonomics will automatically use UseParallelGC.
   81.12  # The UseParallelGC collector does not currently update the gc cause counters.
   81.13  
   81.14 -${JSTAT} -J-XX:+UsePerfData -J-XX:+UseSerialGC -gccause 0 2>&1 | awk -f ${TESTSRC}/gcCauseOutput1.awk
   81.15 +${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -J-XX:+UseSerialGC -gccause 0 2>&1 | awk -f ${TESTSRC}/gcCauseOutput1.awk
    82.1 --- a/test/sun/tools/jstat/jstatGcNewCapacityOutput1.sh	Thu Mar 22 12:41:26 2012 -0700
    82.2 +++ b/test/sun/tools/jstat/jstatGcNewCapacityOutput1.sh	Mon Mar 26 17:31:42 2012 -0700
    82.3 @@ -1,5 +1,5 @@
    82.4  #
    82.5 -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
    82.6 +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
    82.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    82.8  #
    82.9  # This code is free software; you can redistribute it and/or modify it
   82.10 @@ -33,4 +33,4 @@
   82.11  
   82.12  JSTAT="${TESTJAVA}/bin/jstat"
   82.13  
   82.14 -${JSTAT} -J-XX:+UsePerfData -gcnewcapacity 0 2>&1 | awk -f ${TESTSRC}/gcNewCapacityOutput1.awk
   82.15 +${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcnewcapacity 0 2>&1 | awk -f ${TESTSRC}/gcNewCapacityOutput1.awk
    83.1 --- a/test/sun/tools/jstat/jstatGcNewOutput1.sh	Thu Mar 22 12:41:26 2012 -0700
    83.2 +++ b/test/sun/tools/jstat/jstatGcNewOutput1.sh	Mon Mar 26 17:31:42 2012 -0700
    83.3 @@ -1,5 +1,5 @@
    83.4  #
    83.5 -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
    83.6 +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
    83.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    83.8  #
    83.9  # This code is free software; you can redistribute it and/or modify it
   83.10 @@ -33,4 +33,4 @@
   83.11  
   83.12  JSTAT="${TESTJAVA}/bin/jstat"
   83.13  
   83.14 -${JSTAT} -J-XX:+UsePerfData -gcnew 0 2>&1 | awk -f ${TESTSRC}/gcNewOutput1.awk
   83.15 +${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcnew 0 2>&1 | awk -f ${TESTSRC}/gcNewOutput1.awk
    84.1 --- a/test/sun/tools/jstat/jstatGcOldCapacityOutput1.sh	Thu Mar 22 12:41:26 2012 -0700
    84.2 +++ b/test/sun/tools/jstat/jstatGcOldCapacityOutput1.sh	Mon Mar 26 17:31:42 2012 -0700
    84.3 @@ -1,5 +1,5 @@
    84.4  #
    84.5 -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
    84.6 +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
    84.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    84.8  #
    84.9  # This code is free software; you can redistribute it and/or modify it
   84.10 @@ -33,4 +33,4 @@
   84.11  
   84.12  JSTAT="${TESTJAVA}/bin/jstat"
   84.13  
   84.14 -${JSTAT} -J-XX:+UsePerfData -gcoldcapacity 0 2>&1 | awk -f ${TESTSRC}/gcOldCapacityOutput1.awk
   84.15 +${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcoldcapacity 0 2>&1 | awk -f ${TESTSRC}/gcOldCapacityOutput1.awk
    85.1 --- a/test/sun/tools/jstat/jstatGcOldOutput1.sh	Thu Mar 22 12:41:26 2012 -0700
    85.2 +++ b/test/sun/tools/jstat/jstatGcOldOutput1.sh	Mon Mar 26 17:31:42 2012 -0700
    85.3 @@ -1,5 +1,5 @@
    85.4  #
    85.5 -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
    85.6 +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
    85.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    85.8  #
    85.9  # This code is free software; you can redistribute it and/or modify it
   85.10 @@ -33,4 +33,4 @@
   85.11  
   85.12  JSTAT="${TESTJAVA}/bin/jstat"
   85.13  
   85.14 -${JSTAT} -J-XX:+UsePerfData -gcold 0 2>&1 | awk -f ${TESTSRC}/gcOldOutput1.awk
   85.15 +${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcold 0 2>&1 | awk -f ${TESTSRC}/gcOldOutput1.awk
    86.1 --- a/test/sun/tools/jstat/jstatGcOutput1.sh	Thu Mar 22 12:41:26 2012 -0700
    86.2 +++ b/test/sun/tools/jstat/jstatGcOutput1.sh	Mon Mar 26 17:31:42 2012 -0700
    86.3 @@ -1,5 +1,5 @@
    86.4  #
    86.5 -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
    86.6 +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
    86.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    86.8  #
    86.9  # This code is free software; you can redistribute it and/or modify it
   86.10 @@ -33,4 +33,4 @@
   86.11  
   86.12  JSTAT="${TESTJAVA}/bin/jstat"
   86.13  
   86.14 -${JSTAT} -J-XX:+UsePerfData -gc 0 2>&1 | awk -f ${TESTSRC}/gcOutput1.awk
   86.15 +${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gc 0 2>&1 | awk -f ${TESTSRC}/gcOutput1.awk
    87.1 --- a/test/sun/tools/jstat/jstatGcPermCapacityOutput1.sh	Thu Mar 22 12:41:26 2012 -0700
    87.2 +++ b/test/sun/tools/jstat/jstatGcPermCapacityOutput1.sh	Mon Mar 26 17:31:42 2012 -0700
    87.3 @@ -1,5 +1,5 @@
    87.4  #
    87.5 -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
    87.6 +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
    87.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    87.8  #
    87.9  # This code is free software; you can redistribute it and/or modify it
   87.10 @@ -33,4 +33,4 @@
   87.11  
   87.12  JSTAT="${TESTJAVA}/bin/jstat"
   87.13  
   87.14 -${JSTAT} -J-XX:+UsePerfData -gcpermcapacity 0 2>&1 | awk -f ${TESTSRC}/gcPermCapacityOutput1.awk
   87.15 +${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcpermcapacity 0 2>&1 | awk -f ${TESTSRC}/gcPermCapacityOutput1.awk
    88.1 --- a/test/sun/tools/jstat/jstatLineCounts1.sh	Thu Mar 22 12:41:26 2012 -0700
    88.2 +++ b/test/sun/tools/jstat/jstatLineCounts1.sh	Mon Mar 26 17:31:42 2012 -0700
    88.3 @@ -1,5 +1,5 @@
    88.4  #
    88.5 -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
    88.6 +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
    88.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    88.8  #
    88.9  # This code is free software; you can redistribute it and/or modify it
   88.10 @@ -33,4 +33,4 @@
   88.11  
   88.12  JSTAT="${TESTJAVA}/bin/jstat"
   88.13  
   88.14 -${JSTAT} -J-XX:+UsePerfData -gcutil 0 250 5 2>&1 | awk -f ${TESTSRC}/lineCounts1.awk
   88.15 +${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcutil 0 250 5 2>&1 | awk -f ${TESTSRC}/lineCounts1.awk
    89.1 --- a/test/sun/tools/jstat/jstatLineCounts2.sh	Thu Mar 22 12:41:26 2012 -0700
    89.2 +++ b/test/sun/tools/jstat/jstatLineCounts2.sh	Mon Mar 26 17:31:42 2012 -0700
    89.3 @@ -1,5 +1,5 @@
    89.4  #
    89.5 -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
    89.6 +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
    89.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    89.8  #
    89.9  # This code is free software; you can redistribute it and/or modify it
   89.10 @@ -33,4 +33,4 @@
   89.11  
   89.12  JSTAT="${TESTJAVA}/bin/jstat"
   89.13  
   89.14 -${JSTAT} -J-XX:+UsePerfData -gcutil 0 2>&1 | awk -f ${TESTSRC}/lineCounts2.awk
   89.15 +${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcutil 0 2>&1 | awk -f ${TESTSRC}/lineCounts2.awk
    90.1 --- a/test/sun/tools/jstat/jstatLineCounts3.sh	Thu Mar 22 12:41:26 2012 -0700
    90.2 +++ b/test/sun/tools/jstat/jstatLineCounts3.sh	Mon Mar 26 17:31:42 2012 -0700
    90.3 @@ -1,5 +1,5 @@
    90.4  #
    90.5 -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
    90.6 +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
    90.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    90.8  #
    90.9  # This code is free software; you can redistribute it and/or modify it
   90.10 @@ -33,4 +33,4 @@
   90.11  
   90.12  JSTAT="${TESTJAVA}/bin/jstat"
   90.13  
   90.14 -${JSTAT} -J-XX:+UsePerfData -gcutil -h 10 0 250 10 2>&1 | awk -f ${TESTSRC}/lineCounts3.awk
   90.15 +${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcutil -h 10 0 250 10 2>&1 | awk -f ${TESTSRC}/lineCounts3.awk
    91.1 --- a/test/sun/tools/jstat/jstatLineCounts4.sh	Thu Mar 22 12:41:26 2012 -0700
    91.2 +++ b/test/sun/tools/jstat/jstatLineCounts4.sh	Mon Mar 26 17:31:42 2012 -0700
    91.3 @@ -1,5 +1,5 @@
    91.4  #
    91.5 -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
    91.6 +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
    91.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    91.8  #
    91.9  # This code is free software; you can redistribute it and/or modify it
   91.10 @@ -33,4 +33,4 @@
   91.11  
   91.12  JSTAT="${TESTJAVA}/bin/jstat"
   91.13  
   91.14 -${JSTAT} -J-XX:+UsePerfData -gcutil -h 10 0 250 11 2>&1 | awk -f ${TESTSRC}/lineCounts4.awk
   91.15 +${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcutil -h 10 0 250 11 2>&1 | awk -f ${TESTSRC}/lineCounts4.awk
    92.1 --- a/test/sun/tools/jstat/jstatOptions1.sh	Thu Mar 22 12:41:26 2012 -0700
    92.2 +++ b/test/sun/tools/jstat/jstatOptions1.sh	Mon Mar 26 17:31:42 2012 -0700
    92.3 @@ -1,5 +1,5 @@
    92.4  #
    92.5 -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
    92.6 +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
    92.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    92.8  #
    92.9  # This code is free software; you can redistribute it and/or modify it
   92.10 @@ -33,8 +33,8 @@
   92.11  JSTAT="${TESTJAVA}/bin/jstat"
   92.12  
   92.13  rm -f jstat.out1 jstat.out2 2>/dev/null
   92.14 -${JSTAT} -J-XX:+UsePerfData -options > jstat.out1 2>&1
   92.15 -${JSTAT} -J-XX:+UsePerfData -options -J-Djstat.showUnsupported=true > jstat.out2 2>&1
   92.16 +${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -options > jstat.out1 2>&1
   92.17 +${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -options -J-Djstat.showUnsupported=true > jstat.out2 2>&1
   92.18  
   92.19  diff -w jstat.out1 ${TESTSRC}/options1.out
   92.20  diff -w jstat.out2 ${TESTSRC}/options2.out
    93.1 --- a/test/sun/tools/jstat/jstatPrintCompilationOutput1.sh	Thu Mar 22 12:41:26 2012 -0700
    93.2 +++ b/test/sun/tools/jstat/jstatPrintCompilationOutput1.sh	Mon Mar 26 17:31:42 2012 -0700
    93.3 @@ -1,5 +1,5 @@
    93.4  #
    93.5 -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
    93.6 +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
    93.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    93.8  #
    93.9  # This code is free software; you can redistribute it and/or modify it
   93.10 @@ -35,4 +35,4 @@
   93.11  
   93.12  # run with -Xcomp as jstat may complete too quickly to assure
   93.13  # that compilation occurs.
   93.14 -${JSTAT} -J-XX:+UsePerfData -J-Xcomp -printcompilation 0 2>&1 | awk -f ${TESTSRC}/printCompilationOutput1.awk
   93.15 +${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -J-Xcomp -printcompilation 0 2>&1 | awk -f ${TESTSRC}/printCompilationOutput1.awk
    94.1 --- a/test/sun/tools/jstat/jstatSnap1.sh	Thu Mar 22 12:41:26 2012 -0700
    94.2 +++ b/test/sun/tools/jstat/jstatSnap1.sh	Mon Mar 26 17:31:42 2012 -0700
    94.3 @@ -1,5 +1,5 @@
    94.4  #
    94.5 -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
    94.6 +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
    94.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    94.8  #
    94.9  # This code is free software; you can redistribute it and/or modify it
   94.10 @@ -33,4 +33,4 @@
   94.11  
   94.12  JSTAT="${TESTJAVA}/bin/jstat"
   94.13  
   94.14 -${JSTAT} -J-XX:+UsePerfData -snap 0 2>&1 | awk -f ${TESTSRC}/snap1.awk
   94.15 +${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -snap 0 2>&1 | awk -f ${TESTSRC}/snap1.awk
    95.1 --- a/test/sun/tools/jstat/jstatSnap2.sh	Thu Mar 22 12:41:26 2012 -0700
    95.2 +++ b/test/sun/tools/jstat/jstatSnap2.sh	Mon Mar 26 17:31:42 2012 -0700
    95.3 @@ -1,5 +1,5 @@
    95.4  #
    95.5 -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
    95.6 +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
    95.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    95.8  #
    95.9  # This code is free software; you can redistribute it and/or modify it
   95.10 @@ -33,4 +33,4 @@
   95.11  
   95.12  JSTAT="${TESTJAVA}/bin/jstat"
   95.13  
   95.14 -${JSTAT} -J-XX:+UsePerfData -J-Djstat.showUnsupported=true -snap 0 2>&1 | awk -f ${TESTSRC}/snap2.awk
   95.15 +${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -J-Djstat.showUnsupported=true -snap 0 2>&1 | awk -f ${TESTSRC}/snap2.awk
    96.1 --- a/test/sun/tools/jstat/jstatTimeStamp1.sh	Thu Mar 22 12:41:26 2012 -0700
    96.2 +++ b/test/sun/tools/jstat/jstatTimeStamp1.sh	Mon Mar 26 17:31:42 2012 -0700
    96.3 @@ -1,5 +1,5 @@
    96.4  #
    96.5 -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
    96.6 +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
    96.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    96.8  #
    96.9  # This code is free software; you can redistribute it and/or modify it
   96.10 @@ -33,4 +33,4 @@
   96.11  
   96.12  JSTAT="${TESTJAVA}/bin/jstat"
   96.13  
   96.14 -${JSTAT} -J-XX:+UsePerfData -gcutil -t 0 2>&1 | awk -f ${TESTSRC}/timeStamp1.awk
   96.15 +${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcutil -t 0 2>&1 | awk -f ${TESTSRC}/timeStamp1.awk
    97.1 --- a/test/sun/tools/jstatd/jpsOutput1.awk	Thu Mar 22 12:41:26 2012 -0700
    97.2 +++ b/test/sun/tools/jstatd/jpsOutput1.awk	Mon Mar 26 17:31:42 2012 -0700
    97.3 @@ -11,6 +11,10 @@
    97.4  	    matched++;
    97.5  	}
    97.6  
    97.7 +/^[0-9]+ $/	{
    97.8 +	    matched++;
    97.9 +	}
   97.10 +
   97.11  	{ totallines++; print $0 }
   97.12  
   97.13  END	{
    98.1 --- a/test/sun/tools/jstatd/jstatdDefaults.sh	Thu Mar 22 12:41:26 2012 -0700
    98.2 +++ b/test/sun/tools/jstatd/jstatdDefaults.sh	Mon Mar 26 17:31:42 2012 -0700
    98.3 @@ -1,5 +1,5 @@
    98.4  #
    98.5 -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
    98.6 +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
    98.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    98.8  #
    98.9  # This code is free software; you can redistribute it and/or modify it
   98.10 @@ -60,7 +60,7 @@
   98.11      exit 1
   98.12  fi
   98.13  
   98.14 -${JSTAT} -J-XX:+UsePerfData -gcutil ${JSTATD_PID}@${HOSTNAME} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
   98.15 +${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcutil ${JSTATD_PID}@${HOSTNAME} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
   98.16  RC=$?
   98.17  
   98.18  if [ ${RC} -ne 0 ]
    99.1 --- a/test/sun/tools/jstatd/jstatdExternalRegistry.sh	Thu Mar 22 12:41:26 2012 -0700
    99.2 +++ b/test/sun/tools/jstatd/jstatdExternalRegistry.sh	Mon Mar 26 17:31:42 2012 -0700
    99.3 @@ -1,5 +1,5 @@
    99.4  #
    99.5 -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
    99.6 +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
    99.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    99.8  #
    99.9  # This code is free software; you can redistribute it and/or modify it
   99.10 @@ -73,7 +73,7 @@
   99.11      exit 1
   99.12  fi
   99.13  
   99.14 -${JSTAT} -J-XX:+UsePerfData -gcutil ${JSTATD_PID}@${HOSTNAME}:${PORT} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
   99.15 +${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcutil ${JSTATD_PID}@${HOSTNAME}:${PORT} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
   99.16  RC=$?
   99.17  
   99.18  if [ ${RC} -ne 0 ]
   100.1 --- a/test/sun/tools/jstatd/jstatdPort.sh	Thu Mar 22 12:41:26 2012 -0700
   100.2 +++ b/test/sun/tools/jstatd/jstatdPort.sh	Mon Mar 26 17:31:42 2012 -0700
   100.3 @@ -1,5 +1,5 @@
   100.4  #
   100.5 -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
   100.6 +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
   100.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   100.8  #
   100.9  # This code is free software; you can redistribute it and/or modify it
  100.10 @@ -65,7 +65,7 @@
  100.11      exit 1
  100.12  fi
  100.13  
  100.14 -${JSTAT} -J-XX:+UsePerfData -gcutil ${JSTATD_PID}@${HOSTNAME}:${PORT} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
  100.15 +${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcutil ${JSTATD_PID}@${HOSTNAME}:${PORT} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
  100.16  RC=$?
  100.17  
  100.18  if [ ${RC} -ne 0 ]
   101.1 --- a/test/sun/tools/jstatd/jstatdServerName.sh	Thu Mar 22 12:41:26 2012 -0700
   101.2 +++ b/test/sun/tools/jstatd/jstatdServerName.sh	Mon Mar 26 17:31:42 2012 -0700
   101.3 @@ -1,5 +1,5 @@
   101.4  #
   101.5 -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
   101.6 +# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
   101.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   101.8  #
   101.9  # This code is free software; you can redistribute it and/or modify it
  101.10 @@ -86,8 +86,8 @@
  101.11      exit 1
  101.12  fi
  101.13  
  101.14 -echo "running: ${JSTAT} -J-XX:+UsePerfData -gcutil ${JSTATD_1_PID}@${HOSTNAME}:${PORT_1} 250 5"
  101.15 -${JSTAT} -J-XX:+UsePerfData -gcutil ${JSTATD_1_PID}@${HOSTNAME}:${PORT_1} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
  101.16 +echo "running: ${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcutil ${JSTATD_1_PID}@${HOSTNAME}:${PORT_1} 250 5"
  101.17 +${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcutil ${JSTATD_1_PID}@${HOSTNAME}:${PORT_1} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
  101.18  RC=$?
  101.19  
  101.20  if [ ${RC} -ne 0 ]
  101.21 @@ -95,8 +95,8 @@
  101.22      echo "jstat output differs from expected output"
  101.23  fi
  101.24  
  101.25 -echo "running: ${JSTAT} -J-XX:+UsePerfData -gcutil ${JSTATD_1_PID}@${HOSTNAME}:${PORT_2}/${SERVERNAME} 250 5"
  101.26 -${JSTAT} -J-XX:+UsePerfData -gcutil ${JSTATD_1_PID}@${HOSTNAME}:${PORT_2}/${SERVERNAME} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
  101.27 +echo "running: ${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcutil ${JSTATD_1_PID}@${HOSTNAME}:${PORT_2}/${SERVERNAME} 250 5"
  101.28 +${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcutil ${JSTATD_1_PID}@${HOSTNAME}:${PORT_2}/${SERVERNAME} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
  101.29  RC=$?
  101.30  
  101.31  if [ ${RC} -ne 0 ]