diff --git a/.hgtags b/.hgtags index d73a2f186500b5b7b27235bf4c0f1958ae88d762..70d9485e8f6f00063b0345a87a27c0d22d3c62b5 100644 --- a/.hgtags +++ b/.hgtags @@ -151,3 +151,6 @@ ec17fbe5b8fbc52da070eec43b4711d9354b2ab8 jdk8-b25 c68342532e2e7deb3a25fc04ed3e4c142278f747 jdk8-b27 1e1d41daaded291ab3a370ca6a27f7325701978e jdk8-b28 c5b882dce0fe27e05dc64debc92b1fb9ebf880ec jdk8-b29 +cdbb33303ea344d5e9013e2dd642e7a6e7768db6 jdk8-b30 +27f0c08c427c65fcab6917edf646f59058e59524 jdk8-b31 +ddfe5562f61f54ed2121ac0c73b688b94f3e66b5 jdk8-b32 diff --git a/make/common/shared/Compiler-gcc.gmk b/make/common/shared/Compiler-gcc.gmk index 092ec16834610c83bbb3cb5a3ad0a887582b9edc..9dde0bae387b9f19db6d9547a60c23fa256b668e 100644 --- a/make/common/shared/Compiler-gcc.gmk +++ b/make/common/shared/Compiler-gcc.gmk @@ -67,7 +67,7 @@ ifeq ($(PLATFORM), linux) CXX = $(COMPILER_PATH)g++ endif # Option used to create a shared library - SHARED_LIBRARY_FLAG = -shared -mimpure-text + SHARED_LIBRARY_FLAG = -shared SUN_COMP_VER := $(shell $(CC) --verbose 2>&1 ) endif diff --git a/src/macosx/classes/sun/lwawt/LWToolkit.java b/src/macosx/classes/sun/lwawt/LWToolkit.java index b9f4641ba5a358dad89a4e59b21108a5d51e1b3d..f41a944b17c1370226f097b2d1e2ea6ba349da92 100644 --- a/src/macosx/classes/sun/lwawt/LWToolkit.java +++ b/src/macosx/classes/sun/lwawt/LWToolkit.java @@ -522,11 +522,6 @@ public abstract class LWToolkit extends SunToolkit implements Runnable { postEvent(targetToAppContext(event.getSource()), event); } - /* - * Returns true if the application (one of its windows) owns keyboard focus. - */ - public abstract boolean isApplicationActive(); - // use peer's back buffer to implement non-opaque windows. @Override public boolean needUpdateWindow() { diff --git a/src/macosx/classes/sun/lwawt/LWWindowPeer.java b/src/macosx/classes/sun/lwawt/LWWindowPeer.java index bfdd10cdd4ea9f1d2d570199824aacc7ab208b91..3b9ee106e758a3997ff9673a5ddb70b7cc1a41c4 100644 --- a/src/macosx/classes/sun/lwawt/LWWindowPeer.java +++ b/src/macosx/classes/sun/lwawt/LWWindowPeer.java @@ -1067,11 +1067,7 @@ public class LWWindowPeer return false; } - // Cross-app activation requests are not allowed. - if (cause != CausedFocusEvent.Cause.MOUSE_EVENT && - !((LWToolkit)Toolkit.getDefaultToolkit()).isApplicationActive()) - { - focusLog.fine("the app is inactive, so the request is rejected"); + if (platformWindow.rejectFocusRequest(cause)) { return false; } diff --git a/src/macosx/classes/sun/lwawt/PlatformWindow.java b/src/macosx/classes/sun/lwawt/PlatformWindow.java index aeee260b25cb6c4d2b98b08dffbf0ca6f466fa58..0d2a8083752da7809932182a4a2aaf588e757e31 100644 --- a/src/macosx/classes/sun/lwawt/PlatformWindow.java +++ b/src/macosx/classes/sun/lwawt/PlatformWindow.java @@ -27,6 +27,7 @@ package sun.lwawt; import java.awt.*; +import sun.awt.CausedFocusEvent; import sun.java2d.SurfaceData; // TODO Is it worth to generify this interface, like that: @@ -117,6 +118,8 @@ public interface PlatformWindow { public void updateFocusableWindowState(); + public boolean rejectFocusRequest(CausedFocusEvent.Cause cause); + public boolean requestWindowFocus(); /* diff --git a/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java b/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java index 147b12756101484775493a573c0434682651f094..7fd2a0f8f969738aec43422125f902835570da17 100644 --- a/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java +++ b/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java @@ -38,6 +38,8 @@ import java.awt.event.*; public class CEmbeddedFrame extends EmbeddedFrame { private CPlatformResponder responder; + private boolean focused = true; + private boolean parentWindowActive = true; public CEmbeddedFrame() { show(); @@ -94,4 +96,31 @@ public class CEmbeddedFrame extends EmbeddedFrame { public void handleInputEvent(String text) { new RuntimeException("Not implemented"); } + + public void handleFocusEvent(boolean focused) { + this.focused = focused; + updateOverlayWindowActiveState(); + } + + public void handleWindowFocusEvent(boolean parentWindowActive) { + this.parentWindowActive = parentWindowActive; + updateOverlayWindowActiveState(); + } + + public boolean isParentWindowActive() { + return parentWindowActive; + } + + /* + * May change appearance of contents of window, and generate a + * WINDOW_ACTIVATED event. + */ + private void updateOverlayWindowActiveState() { + final boolean showAsFocused = parentWindowActive && focused; + dispatchEvent( + new FocusEvent(this, showAsFocused ? + FocusEvent.FOCUS_GAINED : + FocusEvent.FOCUS_LOST)); + } + } diff --git a/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java b/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java index e4e93143f407a794f692ce6f8508dded938cd499..c355445ac83a6073283929114e305e2f0ea31d76 100644 --- a/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java +++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java @@ -33,17 +33,23 @@ import sun.java2d.SurfaceData; import sun.awt.CGraphicsConfig; import sun.awt.CGraphicsDevice; +import sun.awt.CausedFocusEvent; import java.awt.*; import java.awt.BufferCapabilities.FlipContents; +import sun.util.logging.PlatformLogger; + /* * Provides a lightweight implementation of the EmbeddedFrame. */ public class CPlatformEmbeddedFrame implements PlatformWindow { + private static final PlatformLogger focusLogger = PlatformLogger.getLogger("sun.lwawt.macosx.focus.CPlatformEmbeddedFrame"); + private CGLLayer windowLayer; private LWWindowPeer peer; + private CEmbeddedFrame target; private volatile int screenX = 0; private volatile int screenY = 0; @@ -52,6 +58,7 @@ public class CPlatformEmbeddedFrame implements PlatformWindow { public void initialize(Window target, final LWWindowPeer peer, PlatformWindow owner) { this.peer = peer; this.windowLayer = new CGLLayer(peer); + this.target = (CEmbeddedFrame)target; } @Override @@ -148,6 +155,18 @@ public class CPlatformEmbeddedFrame implements PlatformWindow { @Override public void updateFocusableWindowState() {} + @Override + public boolean rejectFocusRequest(CausedFocusEvent.Cause cause) { + // Cross-app activation requests are not allowed. + if (cause != CausedFocusEvent.Cause.MOUSE_EVENT && + !target.isParentWindowActive()) + { + focusLogger.fine("the embedder is inactive, so the request is rejected"); + return true; + } + return false; + } + @Override public boolean requestWindowFocus() { return true; diff --git a/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java b/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java index ae3fbd54fbf4d91bed1c527ba1cca71f25504755..7f8ee76539b6bf12469b0eec9edeb3add5281d13 100644 --- a/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java +++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java @@ -65,6 +65,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo // Loger to report issues happened during execution but that do not affect functionality private static final PlatformLogger logger = PlatformLogger.getLogger("sun.lwawt.macosx.CPlatformWindow"); + private static final PlatformLogger focusLogger = PlatformLogger.getLogger("sun.lwawt.macosx.focus.CPlatformWindow"); // for client properties public static final String WINDOW_BRUSH_METAL_LOOK = "apple.awt.brushMetalLook"; @@ -112,6 +113,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo static final int MINIMIZABLE = 1 << 8; static final int RESIZABLE = 1 << 9; // both a style bit and prop bit + static final int NONACTIVATING = 1 << 24; static final int _STYLE_PROP_BITMASK = DECORATED | TEXTURED | UNIFIED | UTILITY | HUD | SHEET | CLOSEABLE | MINIMIZABLE | RESIZABLE; @@ -127,9 +129,6 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo static final int _METHOD_PROP_BITMASK = RESIZABLE | HAS_SHADOW | ZOOMABLE | ALWAYS_ON_TOP | HIDES_ON_DEACTIVATE | DRAGGABLE_BACKGROUND | DOCUMENT_MODIFIED | FULLSCREENABLE; - // not sure - static final int POPUP = 1 << 14; - // corresponds to callback-based properties static final int SHOULD_BECOME_KEY = 1 << 12; static final int SHOULD_BECOME_MAIN = 1 << 13; @@ -264,10 +263,6 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo // defaults style bits int styleBits = DECORATED | HAS_SHADOW | CLOSEABLE | MINIMIZABLE | ZOOMABLE | RESIZABLE; - if (target.getName() == "###overrideRedirect###") { - styleBits = SET(styleBits, POPUP, true); - } - if (isNativelyFocusableWindow()) { styleBits = SET(styleBits, SHOULD_BECOME_KEY, true); styleBits = SET(styleBits, SHOULD_BECOME_MAIN, true); @@ -275,6 +270,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo final boolean isFrame = (target instanceof Frame); final boolean isDialog = (target instanceof Dialog); + final boolean isPopup = (target.getType() == Window.Type.POPUP); if (isDialog) { styleBits = SET(styleBits, MINIMIZABLE, false); } @@ -304,8 +300,10 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo } // If the target is a dialog, popup or tooltip we want it to ignore the brushed metal look. - if (!isDialog && IS(styleBits, POPUP)) { + if (isPopup) { styleBits = SET(styleBits, TEXTURED, true); + // Popups in applets don't activate applet's process + styleBits = SET(styleBits, NONACTIVATING, true); } if (target instanceof javax.swing.RootPaneContainer) { @@ -498,12 +496,19 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo // If it ain't blocked, or is being hidden, go regular way if (visible) { CWrapper.NSWindow.makeFirstResponder(nsWindowPtr, contentView.getAWTView()); - boolean isKeyWindow = CWrapper.NSWindow.isKeyWindow(nsWindowPtr); - if (!isKeyWindow) { - CWrapper.NSWindow.makeKeyAndOrderFront(nsWindowPtr); + + boolean isPopup = (target.getType() == Window.Type.POPUP); + if (isPopup) { + // Popups in applets don't activate applet's process + CWrapper.NSWindow.orderFrontRegardless(nsWindowPtr); } else { CWrapper.NSWindow.orderFront(nsWindowPtr); } + + boolean isKeyWindow = CWrapper.NSWindow.isKeyWindow(nsWindowPtr); + if (!isKeyWindow) { + CWrapper.NSWindow.makeKeyWindow(nsWindowPtr); + } } else { CWrapper.NSWindow.orderOut(nsWindowPtr); } @@ -599,8 +604,21 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo nativeSetNSWindowMinMax(nsWindowPtr, min.getWidth(), min.getHeight(), max.getWidth(), max.getHeight()); } + @Override + public boolean rejectFocusRequest(CausedFocusEvent.Cause cause) { + // Cross-app activation requests are not allowed. + if (cause != CausedFocusEvent.Cause.MOUSE_EVENT && + !((LWCToolkit)Toolkit.getDefaultToolkit()).isApplicationActive()) + { + focusLogger.fine("the app is inactive, so the request is rejected"); + return true; + } + return false; + } + @Override public boolean requestWindowFocus() { + long ptr = getNSWindowPtr(); if (CWrapper.NSWindow.canBecomeMainWindow(ptr)) { CWrapper.NSWindow.makeMainWindow(ptr); @@ -751,6 +769,11 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo * Callbacks from the AWTWindow and AWTView objc classes. *************************************************************/ private void deliverWindowFocusEvent(boolean gained){ + // Fix for 7150349: ingore "gained" notifications when the app is inactive. + if (gained && !((LWCToolkit)Toolkit.getDefaultToolkit()).isApplicationActive()) { + focusLogger.fine("the app is inactive, so the notification is ignored"); + return; + } peer.notifyActivation(gained); } diff --git a/src/macosx/classes/sun/lwawt/macosx/CWrapper.java b/src/macosx/classes/sun/lwawt/macosx/CWrapper.java index bc25f18b4dc75b53af64aa37aaeada1fc5ea08e2..385259e352e77a79a253b8309989b7c8c354aff0 100644 --- a/src/macosx/classes/sun/lwawt/macosx/CWrapper.java +++ b/src/macosx/classes/sun/lwawt/macosx/CWrapper.java @@ -47,6 +47,7 @@ public final class CWrapper { public static native void setLevel(long window, int level); public static native void makeKeyAndOrderFront(long window); + public static native void makeKeyWindow(long window); public static native void makeMainWindow(long window); public static native boolean canBecomeMainWindow(long window); public static native boolean isKeyWindow(long window); diff --git a/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java b/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java index 8365a509c439754f36c22129054b15a4e6b19054..fd4a15a3d6ff75191928a89144ce037e1a310ed8 100644 --- a/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java +++ b/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java @@ -686,7 +686,10 @@ public class LWCToolkit extends LWToolkit { return sunAwtDisableCALayers.booleanValue(); } - @Override + + /* + * Returns true if the application (one of its windows) owns keyboard focus. + */ public native boolean isApplicationActive(); /************************ diff --git a/src/macosx/native/sun/awt/AWTView.m b/src/macosx/native/sun/awt/AWTView.m index 5b61e2737149eeedb3c1e6899783a6122191c700..4555d2732ca15c032f479164e5ce8db72d3c24b5 100644 --- a/src/macosx/native/sun/awt/AWTView.m +++ b/src/macosx/native/sun/awt/AWTView.m @@ -812,7 +812,7 @@ JNF_CLASS_CACHE(jc_CInputMethod, "sun/lwawt/macosx/CInputMethod"); // Unicode value. NSUInteger utf8Length = [aString lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; - if ([self hasMarkedText] || !fProcessingKeystroke || (utf8Length > 2)) { + if ([self hasMarkedText] || !fProcessingKeystroke || (utf8Length > 1)) { JNIEnv *env = [ThreadUtilities getJNIEnv]; static JNF_MEMBER_CACHE(jm_selectPreviousGlyph, jc_CInputMethod, "selectPreviousGlyph", "()V"); diff --git a/src/macosx/native/sun/awt/AWTWindow.m b/src/macosx/native/sun/awt/AWTWindow.m index 5beb2eb1173a42c7d5bf5a9a65e80286fd57b11e..51b3c01601edee468e500d112de3c71a1de3503e 100644 --- a/src/macosx/native/sun/awt/AWTWindow.m +++ b/src/macosx/native/sun/awt/AWTWindow.m @@ -102,11 +102,12 @@ static JNF_CLASS_CACHE(jc_CPlatformWindow, "sun/lwawt/macosx/CPlatformWindow"); type |= NSBorderlessWindowMask; } - if (IS(styleBits, TEXTURED)) type |= NSTexturedBackgroundWindowMask; - if (IS(styleBits, UNIFIED)) type |= NSUnifiedTitleAndToolbarWindowMask; - if (IS(styleBits, UTILITY)) type |= NSUtilityWindowMask; - if (IS(styleBits, HUD)) type |= NSHUDWindowMask; - if (IS(styleBits, SHEET)) type |= NSDocModalWindowMask; + if (IS(styleBits, TEXTURED)) type |= NSTexturedBackgroundWindowMask; + if (IS(styleBits, UNIFIED)) type |= NSUnifiedTitleAndToolbarWindowMask; + if (IS(styleBits, UTILITY)) type |= NSUtilityWindowMask; + if (IS(styleBits, HUD)) type |= NSHUDWindowMask; + if (IS(styleBits, SHEET)) type |= NSDocModalWindowMask; + if (IS(styleBits, NONACTIVATING)) type |= NSNonactivatingPanelMask; return type; } diff --git a/src/macosx/native/sun/awt/CWrapper.m b/src/macosx/native/sun/awt/CWrapper.m index dd3c75d5544bae9a0493faceed45cd48680fa67f..139ea4bef71b83204d37814c5000f1303add04e1 100644 --- a/src/macosx/native/sun/awt/CWrapper.m +++ b/src/macosx/native/sun/awt/CWrapper.m @@ -74,6 +74,26 @@ JNF_COCOA_ENTER(env); JNF_COCOA_EXIT(env); } +/* + * Class: sun_lwawt_macosx_CWrapper$NSWindow + * Method: makeKeyWindow + * Signature: (J)V + */ +JNIEXPORT void JNICALL +Java_sun_lwawt_macosx_CWrapper_00024NSWindow_makeKeyWindow +(JNIEnv *env, jclass cls, jlong windowPtr) +{ +JNF_COCOA_ENTER(env); + + NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); + [JNFRunLoop performOnMainThread:@selector(makeKeyWindow) + on:window + withObject:nil + waitUntilDone:NO]; + +JNF_COCOA_EXIT(env); +} + /* * Class: sun_lwawt_macosx_CWrapper$NSWindow * Method: makeMainWindow diff --git a/src/macosx/native/sun/awt/LWCToolkit.m b/src/macosx/native/sun/awt/LWCToolkit.m index 96bea057c57bef0bdbfc63465e92fe731c835673..8a95cd38d3de78b72143d765a652731ab6af3306 100644 --- a/src/macosx/native/sun/awt/LWCToolkit.m +++ b/src/macosx/native/sun/awt/LWCToolkit.m @@ -401,18 +401,21 @@ JNIEXPORT jboolean JNICALL Java_sun_lwawt_macosx_LWCToolkit_isCapsLockOn JNIEXPORT jboolean JNICALL Java_sun_lwawt_macosx_LWCToolkit_isApplicationActive (JNIEnv *env, jclass clazz) { - __block jboolean active = JNI_FALSE; + __block jboolean active = JNI_FALSE; -AWT_ASSERT_NOT_APPKIT_THREAD; JNF_COCOA_ENTER(env); + if ([NSThread isMainThread]) { + active = (jboolean)[NSRunningApplication currentApplication].active; + } else { [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^() { - active = (jboolean)[NSRunningApplication currentApplication].active; + active = (jboolean)[NSRunningApplication currentApplication].active; }]; + } JNF_COCOA_EXIT(env); - return active; + return active; } diff --git a/src/macosx/native/sun/awt/OSVersion.m b/src/macosx/native/sun/awt/OSVersion.m index 10fe713194dad5e33c801b978a37b13f942d180e..e127bae6296cc9fa6f5fc289acaf3dec5a3b78f0 100644 --- a/src/macosx/native/sun/awt/OSVersion.m +++ b/src/macosx/native/sun/awt/OSVersion.m @@ -31,33 +31,31 @@ #import -// returns 10.7 for Lion, 10.6 for SnowLeopard etc. -double getOSXMajorVersion() { - char *version = JRSCopyOSVersion(); - - if (version == NULL) return 0.0; - - char temp[32]; - strlcpy(temp, version, sizeof(temp)); - free(version); - - if (strlen(temp) < 3) { - return 0.0; +// returns 107 for Lion, 106 for SnowLeopard etc. +int getOSXMajorVersion() { + char *ver = JRSCopyOSVersion(); + if (ver == NULL) { + return 0; } - if (temp[2] != '.') { // Third char must be a '.' - return 0.0; + int len = strlen(ver); + int v = 0; + + // Third char must be a '.' + if (len >= 3 && ver[2] == '.') { + int i; + + v = (ver[0] - '0') * 10 + (ver[1] - '0'); + for (i = 3; i < len && isdigit(ver[i]); ++i) { + v = v * 10 + (ver[i] - '0'); + } } - char *ptr = strchr(temp+3, '.'); // remove the second . if one exists. - if (ptr != NULL) { - *ptr = 0; - } - - return atof(temp); + free(ver); + + return v; } - BOOL isSnowLeopardOrLower() { - return (getOSXMajorVersion() < 10.7); + return (getOSXMajorVersion() < 107); } diff --git a/src/share/classes/java/util/CurrencyData.properties b/src/share/classes/java/util/CurrencyData.properties index 1e773e350db110e01a2ddfbec84c45619bc9f075..8cd883153435789deec7faa59a1ef8315acb1a2e 100644 --- a/src/share/classes/java/util/CurrencyData.properties +++ b/src/share/classes/java/util/CurrencyData.properties @@ -26,8 +26,7 @@ formatVersion=1 # Version of the currency code information in this class. -# It is a serial number that accompanies with each amendment, such as -# 'MAxxx.doc' +# It is a serial number that accompanies with each amendment. dataVersion=153 @@ -49,7 +48,7 @@ all=ADP020-AED784-AFA004-AFN971-ALL008-AMD051-ANG532-AOA973-ARS032-ATS040-AUD036 NIO558-NLG528-NOK578-NPR524-NZD554-OMR512-PAB590-PEN604-PGK598-PHP608-\ PKR586-PLN985-PTE620-PYG600-QAR634-ROL946-RON946-RSD941-RUB643-RUR810-RWF646-SAR682-\ SBD090-SCR690-SDD736-SDG938-SEK752-SGD702-SHP654-SIT705-SKK703-SLL694-SOS706-\ - SRD968-SRG740-STD678-SVC222-SYP760-SZL748-THB764-TJS972-TMM795-TMT934-TND788-TOP776-\ + SRD968-SRG740-SSP728-STD678-SVC222-SYP760-SZL748-THB764-TJS972-TMM795-TMT934-TND788-TOP776-\ TPE626-TRL792-TRY949-TTD780-TWD901-TZS834-UAH980-UGX800-USD840-USN997-USS998-\ UYU858-UZS860-VEB862-VEF937-VND704-VUV548-WST882-XAF950-XAG961-XAU959-XBA955-\ XBB956-XBC957-XBD958-XCD951-XDR960-XFO000-XFU000-XOF952-XPD964-XPF953-\ @@ -463,6 +462,8 @@ VC=XCD WS=WST # SAN MARINO SM=EUR +# SOUTH SUDAN +SS=SSP # SAO TOME AND PRINCIPE ST=STD # SAUDI ARABIA diff --git a/src/share/classes/java/util/LocaleISOData.java b/src/share/classes/java/util/LocaleISOData.java index 6330c34048b696ebb74e03e07cfa19b91a705f7f..170fef691938d0d968916f12a071f3723b7e65a0 100644 --- a/src/share/classes/java/util/LocaleISOData.java +++ b/src/share/classes/java/util/LocaleISOData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -433,6 +433,7 @@ class LocaleISOData { + "SN" + "SEN" // Senegal, Republic of + "SO" + "SOM" // Somalia, Somali Republic + "SR" + "SUR" // Suriname, Republic of + + "SS" + "SSD" // South Sudan + "ST" + "STP" // Sao Tome and Principe, Democratic Republic of + "SV" + "SLV" // El Salvador, Republic of + "SX" + "SXM" // Sint Maarten (Dutch part) diff --git a/src/share/classes/javax/swing/DefaultListSelectionModel.java b/src/share/classes/javax/swing/DefaultListSelectionModel.java index cec3131bad552e5eca23af19f0428bd955413592..57fb5d776dbc7845d951031ac060f081744b5507 100644 --- a/src/share/classes/javax/swing/DefaultListSelectionModel.java +++ b/src/share/classes/javax/swing/DefaultListSelectionModel.java @@ -252,6 +252,10 @@ public class DefaultListSelectionModel implements ListSelectionModel, Cloneable, // Updates first and last change indices private void markAsDirty(int r) { + if (r == -1) { + return; + } + firstAdjustedIndex = Math.min(firstAdjustedIndex, r); lastAdjustedIndex = Math.max(lastAdjustedIndex, r); } @@ -358,16 +362,12 @@ public class DefaultListSelectionModel implements ListSelectionModel, Cloneable, private void updateLeadAnchorIndices(int anchorIndex, int leadIndex) { if (leadAnchorNotificationEnabled) { if (this.anchorIndex != anchorIndex) { - if (this.anchorIndex != -1) { // The unassigned state. - markAsDirty(this.anchorIndex); - } + markAsDirty(this.anchorIndex); markAsDirty(anchorIndex); } if (this.leadIndex != leadIndex) { - if (this.leadIndex != -1) { // The unassigned state. - markAsDirty(this.leadIndex); - } + markAsDirty(this.leadIndex); markAsDirty(leadIndex); } } diff --git a/src/share/classes/sun/util/resources/CurrencyNames.properties b/src/share/classes/sun/util/resources/CurrencyNames.properties index 1339e056aef78129b13063fb21c9f9eb714326b4..b8e80a208f4403ac05d22c7cfcc31b59d352125e 100644 --- a/src/share/classes/sun/util/resources/CurrencyNames.properties +++ b/src/share/classes/sun/util/resources/CurrencyNames.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ # # COPYRIGHT AND PERMISSION NOTICE # -# Copyright (C) 1991-2011 Unicode, Inc. All rights reserved. +# Copyright (C) 1991-2012 Unicode, Inc. All rights reserved. # Distributed under the Terms of Use in http://www.unicode.org/copyright.html. # # Permission is hereby granted, free of charge, to any person obtaining @@ -226,6 +226,7 @@ SLL=SLL SOS=SOS SRD=SRD SRG=SRG +SSP=SSP STD=STD SVC=SVC SYP=SYP @@ -443,6 +444,7 @@ sll=Sierra Leonean Leone sos=Somali Shilling srd=Surinamese Dollar srg=Surinamese Guilder +ssp=South Sudanese Pound std=S\u00e3o Tom\u00e9 and Pr\u00edncipe Dobra svc=Salvadoran Col\u00f3n syp=Syrian Pound @@ -486,7 +488,9 @@ xof=CFA Franc BCEAO xpd=Palladium xpf=CFP Franc xpt=Platinum +xsu=Sucre xts=Testing Currency Code +xua=ADB Unit of Account xxx=Unknown Currency yer=Yemeni Rial yum=Yugoslavian New Dinar (1994-2002) diff --git a/src/share/classes/sun/util/resources/LocaleNames.properties b/src/share/classes/sun/util/resources/LocaleNames.properties index 0552c94e8912506aac8ecdc0b7add3fc41b1b7f6..9b3fdda25d38d9959e940183c8d4ade68c1a0ecf 100644 --- a/src/share/classes/sun/util/resources/LocaleNames.properties +++ b/src/share/classes/sun/util/resources/LocaleNames.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -1077,6 +1077,7 @@ SM=San Marino SN=Senegal SO=Somalia SR=Suriname +SS=South Sudan ST=Sao Tome And Principe SV=El Salvador SX=Sint Maarten (Dutch part) diff --git a/src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt b/src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt index 22e2cec9ffcccb5040b14dc1dbd2f0c93c50c6c1..e214792396fcbfb5341e632c8080f3c5642290cc 100644 --- a/src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt +++ b/src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt @@ -90,7 +90,7 @@ ifeq ($(OSNAME), linux) OBJECTS=$(SOURCES:%.c=%.o) # Library name and options needed to build it LIBRARY=lib$(LIBNAME).so - LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text + LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc # Libraries we are dependent on LIBRARIES=-lc # Building a shared library diff --git a/src/share/demo/jvmti/gctest/sample.makefile.txt b/src/share/demo/jvmti/gctest/sample.makefile.txt index b14ea70d9e8b192357286978bf3e24280428277a..99fa39907aeca8c5fde47c8638f836e4f7773d40 100644 --- a/src/share/demo/jvmti/gctest/sample.makefile.txt +++ b/src/share/demo/jvmti/gctest/sample.makefile.txt @@ -90,7 +90,7 @@ ifeq ($(OSNAME), linux) OBJECTS=$(SOURCES:%.c=%.o) # Library name and options needed to build it LIBRARY=lib$(LIBNAME).so - LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text + LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc # Libraries we are dependent on LIBRARIES=-lc # Building a shared library diff --git a/src/share/demo/jvmti/heapTracker/sample.makefile.txt b/src/share/demo/jvmti/heapTracker/sample.makefile.txt index 83e7d79595a9f22c922e111171bd40e90ca07028..a58f710169352cbfc827c6d2edbc761dc97f8c00 100644 --- a/src/share/demo/jvmti/heapTracker/sample.makefile.txt +++ b/src/share/demo/jvmti/heapTracker/sample.makefile.txt @@ -94,7 +94,7 @@ ifeq ($(OSNAME), linux) OBJECTS=$(SOURCES:%.c=%.o) # Library name and options needed to build it LIBRARY=lib$(LIBNAME).so - LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text + LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc # Libraries we are dependent on LIBRARIES=-L $(JDK)/jre/lib/$(LIBARCH) -ljava_crw_demo -lc # Building a shared library diff --git a/src/share/demo/jvmti/heapViewer/sample.makefile.txt b/src/share/demo/jvmti/heapViewer/sample.makefile.txt index a4e3d7171b7cba1bc6d8f026fc1bc14d18338fc1..9f7604668a2a6b57a207aed142e264b8bb4ac118 100644 --- a/src/share/demo/jvmti/heapViewer/sample.makefile.txt +++ b/src/share/demo/jvmti/heapViewer/sample.makefile.txt @@ -90,7 +90,7 @@ ifeq ($(OSNAME), linux) OBJECTS=$(SOURCES:%.c=%.o) # Library name and options needed to build it LIBRARY=lib$(LIBNAME).so - LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text + LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc # Libraries we are dependent on LIBRARIES=-lc # Building a shared library diff --git a/src/share/demo/jvmti/hprof/sample.makefile.txt b/src/share/demo/jvmti/hprof/sample.makefile.txt index 8028cd86f01e036cce8f8bd9506378bd6da768b6..8da8100a720f4bc344d2dca495d88d0a6d7d3fde 100644 --- a/src/share/demo/jvmti/hprof/sample.makefile.txt +++ b/src/share/demo/jvmti/hprof/sample.makefile.txt @@ -130,7 +130,7 @@ ifeq ($(OSNAME), linux) OBJECTS=$(SOURCES:%.c=%.o) # Library name and options needed to build it LIBRARY=lib$(LIBNAME).so - LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text + LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc # Libraries we are dependent on LIBRARIES= -ldl -lc # Building a shared library diff --git a/src/share/demo/jvmti/index.html b/src/share/demo/jvmti/index.html index 6ef96bb64b827f5576007038e3d6833b676899c3..b66ac8d9bfab8b5aaf62e7ebc18bc398c1c1a3ef 100644 --- a/src/share/demo/jvmti/index.html +++ b/src/share/demo/jvmti/index.html @@ -308,7 +308,7 @@ For X86:
For AMD64: @@ -316,7 +316,7 @@ For AMD64:
@@ -339,7 +339,7 @@ option.
  • -Library: Use -static-libgcc -mimpure-text. +Library: Use -static-libgcc.
    When building the shared library (-shared option), this option allows for maximum portability of the library between different diff --git a/src/share/demo/jvmti/java_crw_demo/sample.makefile.txt b/src/share/demo/jvmti/java_crw_demo/sample.makefile.txt index 51f0796358406d7282cc35c8d96d11a3f031fec7..a2ec685554e936507b53e488527e4c23eef24328 100644 --- a/src/share/demo/jvmti/java_crw_demo/sample.makefile.txt +++ b/src/share/demo/jvmti/java_crw_demo/sample.makefile.txt @@ -90,7 +90,7 @@ ifeq ($(OSNAME), linux) OBJECTS=$(SOURCES:%.c=%.o) # Library name and options needed to build it LIBRARY=lib$(LIBNAME).so - LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text + LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc # Libraries we are dependent on LIBRARIES=-lc # Building a shared library diff --git a/src/share/demo/jvmti/minst/sample.makefile.txt b/src/share/demo/jvmti/minst/sample.makefile.txt index be8910bbfe54f32de7b7ce052017c8958e6015ae..42da35be3abbda5d5060794a1508afeff15fa0a7 100644 --- a/src/share/demo/jvmti/minst/sample.makefile.txt +++ b/src/share/demo/jvmti/minst/sample.makefile.txt @@ -94,7 +94,7 @@ ifeq ($(OSNAME), linux) OBJECTS=$(SOURCES:%.c=%.o) # Library name and options needed to build it LIBRARY=lib$(LIBNAME).so - LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text + LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc # Libraries we are dependent on LIBRARIES=-L $(JDK)/jre/lib/$(LIBARCH) -ljava_crw_demo -lc # Building a shared library diff --git a/src/share/demo/jvmti/mtrace/sample.makefile.txt b/src/share/demo/jvmti/mtrace/sample.makefile.txt index c75a5e899df702a6f11de1ffc6eb3003ae9ea26c..b1032825e7b19fac672168098bbfe960b66894bd 100644 --- a/src/share/demo/jvmti/mtrace/sample.makefile.txt +++ b/src/share/demo/jvmti/mtrace/sample.makefile.txt @@ -94,7 +94,7 @@ ifeq ($(OSNAME), linux) OBJECTS=$(SOURCES:%.c=%.o) # Library name and options needed to build it LIBRARY=lib$(LIBNAME).so - LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text + LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc # Libraries we are dependent on LIBRARIES=-L $(JDK)/jre/lib/$(LIBARCH) -ljava_crw_demo -lc # Building a shared library diff --git a/src/share/demo/jvmti/versionCheck/sample.makefile.txt b/src/share/demo/jvmti/versionCheck/sample.makefile.txt index 3028a85bcd458e9fc51b627dde48daf18903b455..9b7abd4c014e6fc7337ece1205f79abc0dc1aa80 100644 --- a/src/share/demo/jvmti/versionCheck/sample.makefile.txt +++ b/src/share/demo/jvmti/versionCheck/sample.makefile.txt @@ -90,7 +90,7 @@ ifeq ($(OSNAME), linux) OBJECTS=$(SOURCES:%.c=%.o) # Library name and options needed to build it LIBRARY=lib$(LIBNAME).so - LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text + LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc # Libraries we are dependent on LIBRARIES=-lc # Building a shared library diff --git a/src/share/demo/jvmti/waiters/sample.makefile.txt b/src/share/demo/jvmti/waiters/sample.makefile.txt index 70d66bd822f181c885438ca0331d2653c2744f6c..68ac497e7a1f3ab9f87cd72db7bb331a5b6ff1cb 100644 --- a/src/share/demo/jvmti/waiters/sample.makefile.txt +++ b/src/share/demo/jvmti/waiters/sample.makefile.txt @@ -91,7 +91,7 @@ ifeq ($(OSNAME), linux) OBJECTS=$(SOURCES:%.cpp=%.o) # Library name and options needed to build it LIBRARY=lib$(LIBNAME).so - LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text + LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc # Libraries we are dependent on LIBRARIES= # Building a shared library diff --git a/src/solaris/native/sun/java2d/x11/X11SurfaceData.c b/src/solaris/native/sun/java2d/x11/X11SurfaceData.c index 330cf0ddf0ba12a5c1ba7c2f869fbf3888681139..5b8aeb4be205a5b6232b44781a7cdc69f7340856 100644 --- a/src/solaris/native/sun/java2d/x11/X11SurfaceData.c +++ b/src/solaris/native/sun/java2d/x11/X11SurfaceData.c @@ -541,6 +541,8 @@ XImage* X11SD_CreateSharedImage(X11SDOps *xsdo, J2dRlsTraceLn1(J2D_TRACE_ERROR, "X11SD_SetupSharedSegment shmget has failed: %s", strerror(errno)); + free((void *)shminfo); + XDestroyImage(img); return NULL; } @@ -550,6 +552,8 @@ XImage* X11SD_CreateSharedImage(X11SDOps *xsdo, J2dRlsTraceLn1(J2D_TRACE_ERROR, "X11SD_SetupSharedSegment shmat has failed: %s", strerror(errno)); + free((void *)shminfo); + XDestroyImage(img); return NULL; } @@ -570,6 +574,9 @@ XImage* X11SD_CreateSharedImage(X11SDOps *xsdo, J2dRlsTraceLn1(J2D_TRACE_ERROR, "X11SD_SetupSharedSegment XShmAttach has failed: %s", strerror(errno)); + shmdt(shminfo->shmaddr); + free((void *)shminfo); + XDestroyImage(img); return NULL; } @@ -1345,13 +1352,10 @@ void X11SD_DisposeXImage(XImage * image) { #ifdef MITSHM if (image->obdata != NULL) { X11SD_DropSharedSegment((XShmSegmentInfo*)image->obdata); - } else { - free(image->data); + image->obdata = NULL; } -#else - free(image->data); #endif /* MITSHM */ - XFree(image); + XDestroyImage(image); } } diff --git a/src/windows/native/sun/windows/awt_Component.cpp b/src/windows/native/sun/windows/awt_Component.cpp index 57d1733756e2e517c97289fc35da18c443a62690..b03ea0d0af06cd4615b4b5f17cab681ab21d8c83 100644 --- a/src/windows/native/sun/windows/awt_Component.cpp +++ b/src/windows/native/sun/windows/awt_Component.cpp @@ -302,6 +302,7 @@ void AwtComponent::Dispose() delete m_childList; DestroyDropTarget(); + ReleaseDragCapture(0); if (m_myControlID != 0) { AwtComponent* parent = GetParent(); diff --git a/test/java/awt/Frame/WindowDragTest/WindowDragTest.java b/test/java/awt/Frame/WindowDragTest/WindowDragTest.java new file mode 100644 index 0000000000000000000000000000000000000000..127a49e607d664c422afadf1ac5cf2f6db8756ab --- /dev/null +++ b/test/java/awt/Frame/WindowDragTest/WindowDragTest.java @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + @test + @bug 7128738 + @summary dragged dialog freezes system on dispose + @author Oleg Pekhovskiy: area=awt.toplevel + @library ../../regtesthelpers + @run main WindowDragTest +*/ + +import java.awt.Frame; +import java.awt.event.InputEvent; +import java.awt.AWTException; +import test.java.awt.regtesthelpers.Util; +import java.awt.Robot; +import java.awt.Point; +import java.awt.Dimension; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +public class WindowDragTest { + + static boolean passed = false; + + public static void main(String[] args) { + try { + Robot robot = new Robot(); + robot.setAutoDelay(1000); + + Frame frame1 = new Frame(); + frame1.setBounds(50, 50, 300, 200); + frame1.setVisible(true); + frame1.toFront(); + frame1.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + // Clicking frame1 succeeded - mouse is not captured + passed = true; + } + }); + robot.delay(1000); + + Frame frame2 = new Frame(); + frame2.setBounds(100, 100, 300, 200); + frame2.setVisible(true); + frame2.toFront(); + robot.delay(1000); + + Point p = frame2.getLocationOnScreen(); + Dimension d = frame2.getSize(); + + // Move cursor to frame2 title bar to drag + robot.mouseMove(p.x + (int)(d.getWidth() / 2), p.y + (int)frame2.getInsets().top / 2); + Util.waitForIdle(robot); + + // Start window dragging + robot.mousePress(InputEvent.BUTTON1_MASK); + Util.waitForIdle(robot); + + // Dispose window being dragged + frame2.dispose(); + Util.waitForIdle(robot); + + // Release mouse button to be able to get MOUSE_CLICKED event on Util.clickOnComp() + robot.mouseRelease(InputEvent.BUTTON1_MASK); + Util.waitForIdle(robot); + + // Click frame1 to check whether mouse is not captured by frame2 + Util.clickOnComp(frame1, robot); + Util.waitForIdle(robot); + + frame1.dispose(); + if (passed) { + System.out.println("Test passed."); + } + else { + System.out.println("Test failed."); + throw new RuntimeException("Test failed."); + } + } + catch (AWTException e) { + throw new RuntimeException("AWTException occurred - problem creating robot!"); + } + } +} diff --git a/test/java/util/Currency/tablea1.txt b/test/java/util/Currency/tablea1.txt index 240fcb844efd2ed95c14a1fffbf1f06d141f44c1..55ad66291c72bb4a01ac48a1d9bf27f9192bc535 100644 --- a/test/java/util/Currency/tablea1.txt +++ b/test/java/util/Currency/tablea1.txt @@ -1,6 +1,6 @@ # # -# Based on BSi's ISO4217 data - "TABLE A1.doc" + amendments up until MA153.doc +# Amendments up until ISO 4217 AMENDMENT NUMBER 153 # (As of 12 January 2012) # @@ -227,6 +227,7 @@ SI EUR 978 2 SB SBD 90 2 SO SOS 706 2 ZA ZAR 710 2 +SS SSP 728 2 ES EUR 978 2 LK LKR 144 2 SD SDG 938 2 diff --git a/test/java/util/Locale/LocaleTest.java b/test/java/util/Locale/LocaleTest.java index 4d269ee3ab4b40f9beb2babd3cc2638690dd315a..8c9c4f16199edaf7946ee911685a78386066ebb1 100644 --- a/test/java/util/Locale/LocaleTest.java +++ b/test/java/util/Locale/LocaleTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ * @bug 4052404 4052440 4084688 4092475 4101316 4105828 4107014 4107953 4110613 * 4118587 4118595 4122371 4126371 4126880 4135316 4135752 4139504 4139940 4143951 * 4147315 4147317 4147552 4335196 4778440 4940539 5010672 6475525 6544471 6627549 - * 6786276 7066203 + * 6786276 7066203 7085757 * @summary test Locales */ /* @@ -400,7 +400,7 @@ public class LocaleTest extends LocaleTestFmwk { } /** - * @bug 4106155 4118587 7066203 + * @bug 4106155 4118587 7066203 7085757 */ public void TestGetLangsAndCountries() { // It didn't seem right to just do an exhaustive test of everything here, so I check @@ -440,8 +440,8 @@ public class LocaleTest extends LocaleTestFmwk { String[] spotCheck2 = { "US", "CA", "GB", "FR", "DE", "IT", "JP", "KR", "CN", "TW", "TH" }; - if (test.length != 249) - errln("Expected getISOCountries to return 249 countries; it returned " + test.length); + if (test.length != 250) + errln("Expected getISOCountries to return 250 countries; it returned " + test.length); else { for (int i = 0; i < spotCheck2.length; i++) { int j; diff --git a/test/javax/swing/JTable/7027139/bug7027139.java b/test/javax/swing/JTable/7027139/bug7027139.java new file mode 100644 index 0000000000000000000000000000000000000000..1d2ce02823c76226e02e2b6a3ec8b84b7c26e36f --- /dev/null +++ b/test/javax/swing/JTable/7027139/bug7027139.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + @bug 7027139 + @summary getFirstIndex() does not return the first index that has changed + @author Pavel Porvatov +*/ + +import javax.swing.*; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; + +public class bug7027139 { + public static void main(String[] args) throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + JTable orderTable = new JTable(new String[][]{ + {"Item 1 1", "Item 1 2"}, + {"Item 2 1", "Item 2 2"}, + {"Item 3 1", "Item 3 2"}, + {"Item 4 1", "Item 4 2"}, + }, + new String[]{"Col 1", "Col 2"}); + + ListSelectionModel selectionModel = orderTable.getSelectionModel(); + selectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); + selectionModel.addListSelectionListener(new ListSelectionListener() { + public void valueChanged(ListSelectionEvent e) { + if (e.getValueIsAdjusting()) { + return; + } + + if (e.getFirstIndex() < 0) { + throw new RuntimeException("Test bug7027139 failed"); + } + } + }); + + orderTable.selectAll(); + } + }); + + System.out.println("Test bug7027139 passed"); + } +} diff --git a/test/sun/text/resources/LocaleData b/test/sun/text/resources/LocaleData index 039981c5629685323df5624d3e0a6c9b29a8038c..7473deac60ba11b408332a6beb0dea873c8151e8 100644 --- a/test/sun/text/resources/LocaleData +++ b/test/sun/text/resources/LocaleData @@ -7019,3 +7019,11 @@ FormatData/bg/DateTimePatterns/4=dd MMMM y, EEEE FormatData/bg/DateTimePatterns/5=dd MMMM y FormatData/bg/DateTimePatterns/6=dd.MM.yyyy FormatData/bg/DateTimePatterns/7=dd.MM.yy + +# bug 7085757 +CurrencyNames//SSP=SSP +CurrencyNames//ssp=South Sudanese Pound +CurrencyNames//xsu=Sucre +CurrencyNames//xua=ADB Unit of Account +LocaleNames//SS=South Sudan +LocaleNames/en/SS=South Sudan \ No newline at end of file diff --git a/test/sun/text/resources/LocaleDataTest.java b/test/sun/text/resources/LocaleDataTest.java index 4f78d161148371e1eb066eedcc51b544e319a6a2..b78d0d663092b0176679313944c4913900d7eac5 100644 --- a/test/sun/text/resources/LocaleDataTest.java +++ b/test/sun/text/resources/LocaleDataTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,7 +34,7 @@ * 6509039 6609737 6610748 6645271 6507067 6873931 6450945 6645268 6646611 * 6645405 6650730 6910489 6573250 6870908 6585666 6716626 6914413 6916787 * 6919624 6998391 7019267 7020960 7025837 7020583 7036905 7066203 7101495 - * 7003124 + * 7003124 7085757 * @summary Verify locale data * */