changeset 6130:060ab87975cb

Merge
author andrew
date Wed, 05 Jun 2013 14:16:17 +0100
parents f363150cc5f7 be5962b333a6
children 21bf0e775ea4
files
diffstat 34 files changed, 1416 insertions(+), 123 deletions(-) [+]
line wrap: on
line diff
--- a/make/sun/javazic/tzdata/VERSION	Mon May 06 12:57:42 2013 -0700
+++ b/make/sun/javazic/tzdata/VERSION	Wed Jun 05 14:16:17 2013 +0100
@@ -21,4 +21,4 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 #
-tzdata2013b
+tzdata2013c
--- a/make/sun/javazic/tzdata/antarctica	Mon May 06 12:57:42 2013 -0700
+++ b/make/sun/javazic/tzdata/antarctica	Wed Jun 05 14:16:17 2013 +0100
@@ -76,34 +76,6 @@
 Rule	ChileAQ	2012	max	-	Apr	Sun>=23	3:00u	0	-
 Rule	ChileAQ	2012	max	-	Sep	Sun>=2	4:00u	1:00	S
 
-# These rules are stolen from the `australasia' file.
-Rule	AusAQ	1917	only	-	Jan	 1	0:01	1:00	-
-Rule	AusAQ	1917	only	-	Mar	25	2:00	0	-
-Rule	AusAQ	1942	only	-	Jan	 1	2:00	1:00	-
-Rule	AusAQ	1942	only	-	Mar	29	2:00	0	-
-Rule	AusAQ	1942	only	-	Sep	27	2:00	1:00	-
-Rule	AusAQ	1943	1944	-	Mar	lastSun	2:00	0	-
-Rule	AusAQ	1943	only	-	Oct	 3	2:00	1:00	-
-Rule	ATAQ	1967	only	-	Oct	Sun>=1	2:00s	1:00	-
-Rule	ATAQ	1968	only	-	Mar	lastSun	2:00s	0	-
-Rule	ATAQ	1968	1985	-	Oct	lastSun	2:00s	1:00	-
-Rule	ATAQ	1969	1971	-	Mar	Sun>=8	2:00s	0	-
-Rule	ATAQ	1972	only	-	Feb	lastSun	2:00s	0	-
-Rule	ATAQ	1973	1981	-	Mar	Sun>=1	2:00s	0	-
-Rule	ATAQ	1982	1983	-	Mar	lastSun	2:00s	0	-
-Rule	ATAQ	1984	1986	-	Mar	Sun>=1	2:00s	0	-
-Rule	ATAQ	1986	only	-	Oct	Sun>=15	2:00s	1:00	-
-Rule	ATAQ	1987	1990	-	Mar	Sun>=15	2:00s	0	-
-Rule	ATAQ	1987	only	-	Oct	Sun>=22	2:00s	1:00	-
-Rule	ATAQ	1988	1990	-	Oct	lastSun	2:00s	1:00	-
-Rule	ATAQ	1991	1999	-	Oct	Sun>=1	2:00s	1:00	-
-Rule	ATAQ	1991	2005	-	Mar	lastSun	2:00s	0	-
-Rule	ATAQ	2000	only	-	Aug	lastSun	2:00s	1:00	-
-Rule	ATAQ	2001	max	-	Oct	Sun>=1	2:00s	1:00	-
-Rule	ATAQ	2006	only	-	Apr	Sun>=1	2:00s	0	-
-Rule	ATAQ	2007	only	-	Mar	lastSun	2:00s	0	-
-Rule	ATAQ	2008	max	-	Apr	Sun>=1	2:00s	0	-
-
 # Argentina - year-round bases
 # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05
 # Esperanza, San Martin Land, -6323-05659, since 1952-12-17
@@ -145,10 +117,7 @@
 # </a>
 
 # From Steffen Thorsen (2010-03-10):
-# We got these changes from the Australian Antarctic Division:
-# - Macquarie Island will stay on UTC+11 for winter and therefore not
-# switch back from daylight savings time when other parts of Australia do
-# on 4 April.
+# We got these changes from the Australian Antarctic Division: ...
 #
 # - Casey station reverted to its normal time of UTC+8 on 5 March 2010.
 # The change to UTC+11 is being considered as a regular summer thing but
@@ -159,9 +128,6 @@
 #
 # - Mawson station stays on UTC+5.
 #
-# In addition to the Rule changes for Casey/Davis, it means that Macquarie
-# will no longer be like Hobart and will have to have its own Zone created.
-#
 # Background:
 # <a href="http://www.timeanddate.com/news/time/antartica-time-changes-2010.html">
 # http://www.timeanddate.com/news/time/antartica-time-changes-2010.html
@@ -188,12 +154,6 @@
 			6:00	-	MAWT	2009 Oct 18 2:00
 						# Mawson Time
 			5:00	-	MAWT
-Zone Antarctica/Macquarie 0	-	zzz	1911
-			10:00	-	EST	1916 Oct 1 2:00
-			10:00	1:00	EST	1917 Feb
-			10:00	AusAQ	EST	1967
-			10:00	ATAQ	EST	2010 Apr 4 3:00
-			11:00	-	MIST	# Macquarie Island Time
 # References:
 # <a href="http://www.antdiv.gov.au/aad/exop/sfo/casey/casey_aws.html">
 # Casey Weather (1998-02-26)
--- a/make/sun/javazic/tzdata/asia	Mon May 06 12:57:42 2013 -0700
+++ b/make/sun/javazic/tzdata/asia	Wed Jun 05 14:16:17 2013 +0100
@@ -2314,11 +2314,20 @@
 # http://www.timeanddate.com/news/time/gaza-west-bank-dst-2012.html
 # </a>
 
-# From Arthur David Olson (2012-03-27):
-# The timeanddate article for 2012 says that "the end date has not yet been
-# announced" and that "Last year, both...paused daylight saving time during...
-# Ramadan. It is not yet known [for] 2012."
-# For now, assume both switch back on the last Friday in September. XXX
+# From Steffen Thorsen (2013-03-26):
+# The following news sources tells that Palestine will "start daylight saving
+# time from midnight on Friday, March 29, 2013" (translated).
+# [These are in Arabic and are for Gaza and for Ramallah, respectively.]
+# http://www.samanews.com/index.php?act=Show&id=154120
+# http://safa.ps/details/news/99844/%D8%B1%D8%A7%D9%85-%D8%A7%D9%84%D9%84%D9%87-%D8%A8%D8%AF%D8%A1-%D8%A7%D9%84%D8%AA%D9%88%D9%82%D9%8A%D8%AA-%D8%A7%D9%84%D8%B5%D9%8A%D9%81%D9%8A-29-%D8%A7%D9%84%D8%AC%D8%A7%D8%B1%D9%8A.html
+
+# From Paul Eggert (2013-04-15):
+# For future dates, guess the last Thursday in March at 24:00 through
+# the first Friday on or after September 21 at 01:00.  This is consistent with
+# the predictions in today's editions of the following URLs,
+# which are for Gaza and Hebron respectively:
+# http://www.timeanddate.com/worldclock/timezone.html?n=702
+# http://www.timeanddate.com/worldclock/timezone.html?n=2364
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule EgyptAsia	1957	only	-	May	10	0:00	1:00	S
@@ -2332,19 +2341,20 @@
 Rule Palestine	1999	2003	-	Oct	Fri>=15	0:00	0	-
 Rule Palestine	2004	only	-	Oct	 1	1:00	0	-
 Rule Palestine	2005	only	-	Oct	 4	2:00	0	-
-Rule Palestine	2006	2008	-	Apr	 1	0:00	1:00	S
+Rule Palestine	2006	2007	-	Apr	 1	0:00	1:00	S
 Rule Palestine	2006	only	-	Sep	22	0:00	0	-
 Rule Palestine	2007	only	-	Sep	Thu>=8	2:00	0	-
-Rule Palestine	2008	only	-	Aug	lastFri	0:00	0	-
-Rule Palestine	2009	only	-	Mar	lastFri	0:00	1:00	S
-Rule Palestine	2009	only	-	Sep	Fri>=1	2:00	0	-
-Rule Palestine	2010	only	-	Mar	lastSat	0:01	1:00	S
+Rule Palestine	2008	2009	-	Mar	lastFri	0:00	1:00	S
+Rule Palestine	2008	only	-	Sep	 1	0:00	0	-
+Rule Palestine	2009	only	-	Sep	Fri>=1	1:00	0	-
+Rule Palestine	2010	only	-	Mar	26	0:00	1:00	S
 Rule Palestine	2010	only	-	Aug	11	0:00	0	-
-
-# From Arthur David Olson (2011-09-20):
-# 2011 transitions per http://www.timeanddate.com as of 2011-09-20.
-# From Paul Eggert (2012-10-12):
-# 2012 transitions per http://www.timeanddate.com as of 2012-10-12.
+Rule Palestine	2011	only	-	Apr	 1	0:01	1:00	S
+Rule Palestine	2011	only	-	Aug	 1	0:00	0	-
+Rule Palestine	2011	only	-	Aug	30	0:00	1:00	S
+Rule Palestine	2011	only	-	Sep	30	0:00	0	-
+Rule Palestine	2012	max	-	Mar	lastThu	24:00	1:00	S
+Rule Palestine	2012	max	-	Sep	Fri>=21	1:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Gaza	2:17:52	-	LMT	1900 Oct
@@ -2352,26 +2362,20 @@
 			2:00 EgyptAsia	EE%sT	1967 Jun  5
 			2:00	Zion	I%sT	1996
 			2:00	Jordan	EE%sT	1999
-			2:00 Palestine	EE%sT	2011 Apr  2 12:01
-			2:00	1:00	EEST	2011 Aug  1
-			2:00	-	EET	2012 Mar 30
-			2:00	1:00	EEST	2012 Sep 21 1:00
-			2:00	-	EET
+			2:00 Palestine	EE%sT	2008 Aug 29 0:00
+			2:00	-	EET	2008 Sep
+			2:00 Palestine	EE%sT	2010
+			2:00	-	EET	2010 Mar 27 0:01
+			2:00 Palestine	EE%sT	2011 Aug  1
+			2:00	-	EET	2012
+			2:00 Palestine	EE%sT
 
 Zone	Asia/Hebron	2:20:23	-	LMT	1900 Oct
 			2:00	Zion	EET	1948 May 15
 			2:00 EgyptAsia	EE%sT	1967 Jun  5
 			2:00	Zion	I%sT	1996
 			2:00	Jordan	EE%sT	1999
-			2:00 Palestine	EE%sT	2008 Aug
-			2:00 	1:00	EEST	2008 Sep
-			2:00 Palestine	EE%sT	2011 Apr  1 12:01
-			2:00	1:00	EEST	2011 Aug  1
-			2:00	-	EET	2011 Aug 30
-			2:00	1:00	EEST	2011 Sep 30 3:00
-			2:00	-	EET	2012 Mar 30
-			2:00	1:00	EEST	2012 Sep 21 1:00
-			2:00	-	EET
+			2:00 Palestine	EE%sT
 
 # Paracel Is
 # no information
--- a/make/sun/javazic/tzdata/australasia	Mon May 06 12:57:42 2013 -0700
+++ b/make/sun/javazic/tzdata/australasia	Wed Jun 05 14:16:17 2013 +0100
@@ -241,9 +241,26 @@
 # no times are set
 #
 # Macquarie
-# permanent occupation (scientific station) since 1948;
-# sealing and penguin oil station operated 1888/1917
-# like Australia/Hobart
+# Permanent occupation (scientific station) 1911-1915 and since 25 March 1948;
+# sealing and penguin oil station operated Nov 1899 to Apr 1919.  See the
+# Tasmania Parks & Wildlife Service history of sealing at Macquarie Island
+# <http://www.parks.tas.gov.au/index.aspx?base=1828>
+# <http://www.parks.tas.gov.au/index.aspx?base=1831>.
+# Guess that it was like Australia/Hobart while inhabited before 2010.
+#
+# From Steffen Thorsen (2010-03-10):
+# We got these changes from the Australian Antarctic Division:
+# - Macquarie Island will stay on UTC+11 for winter and therefore not
+# switch back from daylight savings time when other parts of Australia do
+# on 4 April.
+Zone Antarctica/Macquarie 0	-	zzz	1899 Nov
+			10:00	-	EST	1916 Oct 1 2:00
+			10:00	1:00	EST	1917 Feb
+			10:00	Aus	EST	1919 Apr
+			0	-	zzz	1948 Mar 25
+			10:00	Aus	EST	1967
+			10:00	AT	EST	2010 Apr 4 3:00
+			11:00	-	MIST	# Macquarie I Standard Time
 
 # Christmas
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
--- a/make/sun/javazic/tzdata/southamerica	Mon May 06 12:57:42 2013 -0700
+++ b/make/sun/javazic/tzdata/southamerica	Wed Jun 05 14:16:17 2013 +0100
@@ -1589,16 +1589,16 @@
 # forward 60 minutes, in all the territory of the Paraguayan Republic.
 # ...
 Rule	Para	2010	max	-	Oct	Sun>=1	0:00	1:00	S
-Rule	Para	2010	max	-	Apr	Sun>=8	0:00	0	-
+Rule	Para	2010	2012	-	Apr	Sun>=8	0:00	0	-
 #
 # From Steffen Thorsen (2013-03-07):
 # Paraguay will end DST on 2013-03-24 00:00....
-# They do not tell if this will be a permanent change or just this year....
 # http://www.ande.gov.py/interna.php?id=1075
 #
-# From Paul Eggert (2013-03-07):
-# For now, assume it's just this year.
-Rule	Para	2013	only	-	Mar	24	0:00	0	-
+# From Carlos Raul Perasso (2013-03-15):
+# The change in Paraguay is now final.  Decree number 10780
+# http://www.presidencia.gov.py/uploads/pdf/presidencia-3b86ff4b691c79d4f5927ca964922ec74772ce857c02ca054a52a37b49afc7fb.pdf
+Rule	Para	2013	max	-	Mar	Sun>=22	0:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Asuncion	-3:50:40 -	LMT	1890
--- a/make/sun/javazic/tzdata/zone.tab	Mon May 06 12:57:42 2013 -0700
+++ b/make/sun/javazic/tzdata/zone.tab	Wed Jun 05 14:16:17 2013 +0100
@@ -65,7 +65,6 @@
 AQ	-7824+10654	Antarctica/Vostok	Vostok Station, Lake Vostok
 AQ	-6640+14001	Antarctica/DumontDUrville	Dumont-d'Urville Station, Terre Adelie
 AQ	-690022+0393524	Antarctica/Syowa	Syowa Station, E Ongul I
-AQ	-5430+15857	Antarctica/Macquarie	Macquarie Island Station, Macquarie Island
 AR	-3436-05827	America/Argentina/Buenos_Aires	Buenos Aires (BA, CF)
 AR	-3124-06411	America/Argentina/Cordoba	most locations (CB, CC, CN, ER, FM, MN, SE, SF)
 AR	-2447-06525	America/Argentina/Salta	(SA, LP, NQ, RN)
@@ -81,6 +80,7 @@
 AS	-1416-17042	Pacific/Pago_Pago
 AT	+4813+01620	Europe/Vienna
 AU	-3133+15905	Australia/Lord_Howe	Lord Howe Island
+AU	-5430+15857	Antarctica/Macquarie	Macquarie Island
 AU	-4253+14719	Australia/Hobart	Tasmania - most locations
 AU	-3956+14352	Australia/Currie	Tasmania - King Island
 AU	-3749+14458	Australia/Melbourne	Victoria
--- a/make/tools/src/build/tools/javazic/Rule.java	Mon May 06 12:57:42 2013 -0700
+++ b/make/tools/src/build/tools/javazic/Rule.java	Wed Jun 05 14:16:17 2013 +0100
@@ -119,7 +119,7 @@
                                                 r1.getDay(), r1.getTime().getTime());
                     long t2 = Time.getLocalTime(y, r2.getMonth(),
                                                 r2.getDay(), r2.getTime().getTime());
-                    return (int)(t1 - t2);
+                    return (t1 > t2) ? 1 : (t1 < t2) ? -1 : 0;
                 }
                 public boolean equals(Object o) {
                     return this == o;
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Mon May 06 12:57:42 2013 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Wed Jun 05 14:16:17 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, 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
@@ -115,6 +115,8 @@
 
     static final int RESIZABLE = 1 << 9; // both a style bit and prop bit
     static final int NONACTIVATING = 1 << 24;
+    static final int IS_DIALOG = 1 << 25;
+    static final int IS_MODAL = 1 << 26;
 
     static final int _STYLE_PROP_BITMASK = DECORATED | TEXTURED | UNIFIED | UTILITY | HUD | SHEET | CLOSEABLE | MINIMIZABLE | RESIZABLE;
 
@@ -371,6 +373,13 @@
             }
         }
 
+        if (isDialog) {
+            styleBits = SET(styleBits, IS_DIALOG, true);
+            if (((Dialog) target).isModal()) {
+                styleBits = SET(styleBits, IS_MODAL, true);
+            }
+        }
+
         peer.setTextured(IS(TEXTURED, styleBits));
 
         return styleBits;
--- a/src/macosx/native/sun/awt/AWTWindow.m	Mon May 06 12:57:42 2013 -0700
+++ b/src/macosx/native/sun/awt/AWTWindow.m	Wed Jun 05 14:16:17 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, 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
@@ -581,8 +581,12 @@
 - (void) windowDidBecomeKey: (NSNotification *) notification {
 AWT_ASSERT_APPKIT_THREAD;
     [AWTToolkit eventCountPlusPlus];
-    [CMenuBar activate:self.javaMenuBar modallyDisabled:NO];
     AWTWindow *opposite = [AWTWindow lastKeyWindow];
+    if (!IS(self.styleBits, IS_DIALOG)) {
+        [CMenuBar activate:self.javaMenuBar modallyDisabled:NO];
+    } else if ((opposite != NULL) && IS(self.styleBits, IS_MODAL)) {
+        [CMenuBar activate:opposite->javaMenuBar modallyDisabled:YES];
+    }
     [AWTWindow setLastKeyWindow:nil];
 
     [self _deliverWindowFocusEvent:YES oppositeWindow: opposite];
--- a/src/macosx/native/sun/awt/CTextPipe.m	Mon May 06 12:57:42 2013 -0700
+++ b/src/macosx/native/sun/awt/CTextPipe.m	Wed Jun 05 14:16:17 2013 +0100
@@ -138,8 +138,11 @@
     // get our baseline transform and font
     CGContextRef cgRef = qsdo->cgRef;
     CGAffineTransform ctmText = CGContextGetTextMatrix(cgRef);
-    //CGFontRef cgFont = CGContextGetFont(cgRef);
 
+    /* Save and restore of graphics context is done before the iteration.  
+       This seems to work using our test case (see bug ID 7158350) so we are restoring it at
+       the end of the for loop.  If we find out that save/restore outside the loop
+       doesn't work on all cases then we will move the Save/Restore inside the loop.*/
     CGContextSaveGState(cgRef);
     CGAffineTransform invTx = CGAffineTransformInvert(strike->fTx);
 
@@ -206,13 +209,9 @@
         pt.x += advances[i].width;
         pt.y += advances[i].height;
 
-        // reset the font on the context after striking a unicode with CoreText
-        if (uniChar != 0)
-        {
-           // CGContextSetFont(cgRef, cgFont);
-            CGContextSaveGState(cgRef);
-        }
     }
+    // reset the font on the context after striking a unicode with CoreText
+    CGContextRestoreGState(cgRef);
 }
 
 // Using the Quartz Surface Data context, draw a hot-substituted character run
--- a/src/macosx/native/sun/osxapp/QueuingApplicationDelegate.m	Mon May 06 12:57:42 2013 -0700
+++ b/src/macosx/native/sun/osxapp/QueuingApplicationDelegate.m	Wed Jun 05 14:16:17 2013 +0100
@@ -110,8 +110,14 @@
 
 - (void)_handleOpenURLEvent:(NSAppleEventDescriptor *)openURLEvent withReplyEvent:(NSAppleEventDescriptor *)replyEvent
 {
+    // Make an explicit copy of the passed events as they may be invalidated by the time they're processed
+    NSAppleEventDescriptor *openURLEventCopy = [openURLEvent copy];
+    NSAppleEventDescriptor *replyEventCopy = [replyEvent copy];
+
     [self.queue addObject:[^(){
-        [self.realDelegate _handleOpenURLEvent:openURLEvent withReplyEvent:replyEvent];
+        [self.realDelegate _handleOpenURLEvent:openURLEventCopy withReplyEvent:replyEventCopy];
+        [openURLEventCopy release];
+        [replyEventCopy release];
     } copy]];
 }
 
--- a/src/share/classes/com/sun/beans/finder/AbstractFinder.java	Mon May 06 12:57:42 2013 -0700
+++ b/src/share/classes/com/sun/beans/finder/AbstractFinder.java	Wed Jun 05 14:16:17 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2013, 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
@@ -24,6 +24,9 @@
  */
 package com.sun.beans.finder;
 
+import java.lang.reflect.Member;
+import java.lang.reflect.Modifier;
+
 import java.util.HashMap;
 import java.util.Map;
 
@@ -37,7 +40,7 @@
  *
  * @author Sergey A. Malenkov
  */
-abstract class AbstractFinder<T> {
+abstract class AbstractFinder<T extends Member> {
     private final Class<?>[] args;
 
     /**
@@ -81,7 +84,9 @@
      * @return {@code true} if the method is valid,
      *         {@code false} otherwise
      */
-    protected abstract boolean isValid(T method);
+    protected boolean isValid(T method) {
+        return Modifier.isPublic(method.getModifiers());
+    }
 
     /**
      * Performs a search in the {@code methods} array.
@@ -120,6 +125,11 @@
                             boolean useNew = isAssignable(oldParams, newParams);
                             boolean useOld = isAssignable(newParams, oldParams);
 
+                            if (useOld && useNew) {
+                                // only if parameters are equal
+                                useNew = !newMethod.isSynthetic();
+                                useOld = !oldMethod.isSynthetic();
+                            }
                             if (useOld == useNew) {
                                 ambiguous = true;
                             } else if (useNew) {
@@ -160,6 +170,11 @@
                         boolean useNew = isAssignable(oldParams, newParams);
                         boolean useOld = isAssignable(newParams, oldParams);
 
+                        if (useOld && useNew) {
+                            // only if parameters are equal
+                            useNew = !newMethod.isSynthetic();
+                            useOld = !oldMethod.isSynthetic();
+                        }
                         if (useOld == useNew) {
                             if (oldParams == map.get(oldMethod)) {
                                 ambiguous = true;
--- a/src/share/classes/com/sun/beans/finder/ConstructorFinder.java	Mon May 06 12:57:42 2013 -0700
+++ b/src/share/classes/com/sun/beans/finder/ConstructorFinder.java	Wed Jun 05 14:16:17 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2013, 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
@@ -113,17 +113,4 @@
     protected boolean isVarArgs(Constructor<?> constructor) {
         return constructor.isVarArgs();
     }
-
-    /**
-     * Checks validness of the constructor.
-     * The valid constructor should be public.
-     *
-     * @param constructor  the object that represents constructor
-     * @return {@code true} if the constructor is valid,
-     *         {@code false} otherwise
-     */
-    @Override
-    protected boolean isValid(Constructor<?> constructor) {
-        return Modifier.isPublic(constructor.getModifiers());
-    }
 }
--- a/src/share/classes/com/sun/beans/finder/MethodFinder.java	Mon May 06 12:57:42 2013 -0700
+++ b/src/share/classes/com/sun/beans/finder/MethodFinder.java	Wed Jun 05 14:16:17 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2013, 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
@@ -233,6 +233,6 @@
      */
     @Override
     protected boolean isValid(Method method) {
-        return !method.isBridge() && Modifier.isPublic(method.getModifiers()) && method.getName().equals(this.name);
+        return super.isValid(method) && method.getName().equals(this.name);
     }
 }
--- a/src/share/classes/java/beans/XMLEncoder.java	Mon May 06 12:57:42 2013 -0700
+++ b/src/share/classes/java/beans/XMLEncoder.java	Wed Jun 05 14:16:17 2013 +0100
@@ -487,6 +487,12 @@
         }
         indentation--;
 
+        Statement statement = getMissedStatement();
+        while (statement != null) {
+            outputStatement(statement, this, false);
+            statement = getMissedStatement();
+        }
+
         try {
             out.flush();
         }
@@ -503,6 +509,17 @@
         targetToStatementList.clear();
     }
 
+    Statement getMissedStatement() {
+        for (List<Statement> statements : this.targetToStatementList.values()) {
+            for (int i = 0; i < statements.size(); i++) {
+                if (Statement.class == statements.get(i).getClass()) {
+                    return statements.remove(i);
+                }
+            }
+        }
+        return null;
+    }
+
 
     /**
      * This method calls <code>flush</code>, writes the closing
@@ -597,7 +614,7 @@
                                                 "methodName") + " should not be null");
             }
 
-            if (target instanceof Field && methodName.equals("get")) {
+            if (isArgument && target instanceof Field && methodName.equals("get")) {
                 Field f = (Field)target;
                 writeln("<object class=" + quote(f.getDeclaringClass().getName()) +
                         " field=" + quote(f.getName()) + "/>");
--- a/src/share/classes/javax/swing/DefaultComboBoxModel.java	Mon May 06 12:57:42 2013 -0700
+++ b/src/share/classes/javax/swing/DefaultComboBoxModel.java	Wed Jun 05 14:16:17 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2013, 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
@@ -55,8 +55,7 @@
      * @param items  an array of Object objects
      */
     public DefaultComboBoxModel(final E items[]) {
-        objects = new Vector<E>();
-        objects.ensureCapacity( items.length );
+        objects = new Vector<E>(items.length);
 
         int i,c;
         for ( i=0,c=items.length;i<c;i++ )
--- a/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java	Mon May 06 12:57:42 2013 -0700
+++ b/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java	Wed Jun 05 14:16:17 2013 +0100
@@ -692,9 +692,9 @@
      */
     protected void installComponents() {
         arrowButton = createArrowButton();
-        comboBox.add( arrowButton );
 
         if (arrowButton != null)  {
+            comboBox.add(arrowButton);
             configureArrowButton();
         }
 
--- a/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java	Mon May 06 12:57:42 2013 -0700
+++ b/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java	Wed Jun 05 14:16:17 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -419,7 +419,7 @@
                     }
                 }
                 else {
-                    if (!(table.getParent().getParent() instanceof
+                    if (!(SwingUtilities.getUnwrappedParent(table).getParent() instanceof
                             JScrollPane)) {
                         return;
                     }
@@ -1431,7 +1431,7 @@
         }
 
         // install the scrollpane border
-        Container parent = table.getParent();  // should be viewport
+        Container parent = SwingUtilities.getUnwrappedParent(table);  // should be viewport
         if (parent != null) {
             parent = parent.getParent();  // should be the scrollpane
             if (parent != null && parent instanceof JScrollPane) {
--- a/src/share/classes/javax/swing/text/View.java	Mon May 06 12:57:42 2013 -0700
+++ b/src/share/classes/javax/swing/text/View.java	Wed Jun 05 14:16:17 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -1174,6 +1174,7 @@
         // formed by added elements (i.e. they will be updated
         // by initialization.
         index0 = Math.max(index0, 0);
+        index1 = Math.max((getViewCount() - 1), 0);
         for (int i = index0; i <= index1; i++) {
             if (! ((i >= hole0) && (i <= hole1))) {
                 v = getView(i);
--- a/src/share/classes/sun/java2d/loops/MaskFill.java	Mon May 06 12:57:42 2013 -0700
+++ b/src/share/classes/sun/java2d/loops/MaskFill.java	Wed Jun 05 14:16:17 2013 +0100
@@ -36,6 +36,7 @@
 import sun.java2d.loops.GraphicsPrimitive;
 import sun.java2d.SunGraphics2D;
 import sun.java2d.SurfaceData;
+import sun.java2d.pipe.Region;
 
 /**
  * MaskFill
@@ -194,10 +195,13 @@
             // REMIND: This is not pretty.  It would be nicer if we
             // passed a "FillData" object to the Pixel loops, instead
             // of a SunGraphics2D parameter...
+            Region clip = sg2d.clipRegion;
+            sg2d.clipRegion = null;
             int pixel = sg2d.pixel;
             sg2d.pixel = tmpData.pixelFor(sg2d.getColor());
             fillop.FillRect(sg2d, tmpData, 0, 0, w, h);
             sg2d.pixel = pixel;
+            sg2d.clipRegion = clip;
 
             maskop.MaskBlit(tmpData, sData, comp, null,
                             0, 0, x, y, w, h,
--- a/src/solaris/classes/sun/print/IPPPrintService.java	Mon May 06 12:57:42 2013 -0700
+++ b/src/solaris/classes/sun/print/IPPPrintService.java	Wed Jun 05 14:16:17 2013 +0100
@@ -1023,6 +1023,13 @@
 
             // this is already supported in UnixPrintJob
             catList.add(Destination.class);
+
+            // It is unfortunate that CUPS doesn't provide a way to query
+            // if printer supports collation but since most printers
+            // now supports collation and that most OS has a way
+            // of setting it, it is a safe assumption to just always
+            // include SheetCollate as supported attribute.
+            catList.add(SheetCollate.class);
         }
 
         // With the assumption that  Chromaticity is equivalent to
--- a/test/Makefile	Mon May 06 12:57:42 2013 -0700
+++ b/test/Makefile	Wed Jun 05 14:16:17 2013 +0100
@@ -513,6 +513,7 @@
           java/sql javax/sql \
           javax/smartcardio \
           javax/xml/soap \
+          javax/xml/jaxp \
           com/sun/xml \
           javax/xml/ws com/sun/internal/ws \
           com/sun/org/apache/xerces \
--- a/test/java/awt/print/PrinterJob/Collate2DPrintingTest.java	Mon May 06 12:57:42 2013 -0700
+++ b/test/java/awt/print/PrinterJob/Collate2DPrintingTest.java	Wed Jun 05 14:16:17 2013 +0100
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 6362683
+ * @bug 6362683 8012381
  * @summary Collation should work.
  * @run main/manual Collate2DPrintingTest
  */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/beans/XMLEncoder/Test6989223.java	Wed Jun 05 14:16:17 2013 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2013, 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 6989223
+ * @summary Tests Rectangle2D.Double encoding
+ * @author Sergey Malenkov
+ */
+
+import java.awt.geom.Rectangle2D;
+
+public class Test6989223 extends AbstractTest {
+    public static void main(String[] args) {
+        new Test6989223().test(true);
+    }
+
+    protected Object getObject() {
+        return new Bean(1, 2, 3, 4);
+    }
+
+    @Override
+    protected Object getAnotherObject() {
+        return new Bean(1, 2, 3, 5);
+    }
+
+    public static class Bean extends Rectangle2D.Double {
+        public Bean() {
+        }
+
+        public Bean(double x, double y, double w, double h) {
+            super(x, y, w, h);
+        }
+
+        @Override
+        public boolean equals(Object object) {
+            return super.equals(object); // to avoid recursion during validation
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/beans/XMLEncoder/Test7080156.java	Wed Jun 05 14:16:17 2013 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2013, 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 7080156 7094245
+ * @summary Tests beans with public arrays
+ * @author Sergey Malenkov
+ */
+
+public class Test7080156 extends AbstractTest {
+    public static void main(String[] args) {
+        new Test7080156().test(true);
+    }
+
+    protected Object getObject() {
+        Bean bean = new Bean();
+        bean.setArray("something");
+        return bean;
+    }
+
+    @Override
+    protected Object getAnotherObject() {
+        Bean bean = new Bean();
+        bean.setArray("some", "thing");
+        return bean;
+    }
+
+    public static class Bean {
+        public String[] array = {"default"};
+
+        public void setArray(String... array) {
+            this.array = array;
+        }
+
+        public String[] getArray() {
+            return this.array;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/beans/XMLEncoder/Test8013416.java	Wed Jun 05 14:16:17 2013 +0100
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2013, 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 8013416
+ * @summary Tests public synthetic methods
+ * @author Sergey Malenkov
+ */
+
+import java.beans.DefaultPersistenceDelegate;
+import java.beans.Encoder;
+import java.beans.Expression;
+import java.beans.Statement;
+import java.beans.XMLEncoder;
+import java.util.HashMap;
+import java.util.Map.Entry;
+import java.util.Set;
+
+public class Test8013416 extends AbstractTest {
+    public static void main(String[] args) {
+        new Test8013416().test(true);
+    }
+
+    protected Object getObject() {
+        Public<String, String> map = new Public<String, String>();
+        map.put(" pz1 ", " pz2 ");
+        map.put(" pz3 ", " pz4 ");
+        return map;
+    }
+
+    @Override
+    protected void initialize(XMLEncoder encoder) {
+        super.initialize(encoder);
+        encoder.setPersistenceDelegate(Public.class, new PublicPersistenceDelegate());
+    }
+
+    private static final class PublicPersistenceDelegate extends DefaultPersistenceDelegate {
+        @Override
+        protected Expression instantiate(Object oldInstance, Encoder out) {
+            return new Expression(oldInstance, oldInstance.getClass(), "new", null);
+        }
+
+        @Override
+        protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
+            super.initialize(type, oldInstance, newInstance, out);
+
+            Public<String, String> map = (Public) oldInstance;
+            for (Entry<String, String> entry : map.getAll()) {
+                String[] args = {entry.getKey(), entry.getValue()};
+                out.writeStatement(new Statement(oldInstance, "put", args));
+            }
+        }
+    }
+
+    public static final class Public<K, V> extends Private<K, V> {
+    }
+
+    private static class Private<K, V> {
+        private HashMap<K, V> map = new HashMap<K, V>();
+
+        public void put(K key, V value) {
+            this.map.put(key, value);
+        }
+
+        public Set<Entry<K, V>> getAll() {
+            return this.map.entrySet();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/beans/XMLEncoder/Test8013557.java	Wed Jun 05 14:16:17 2013 +0100
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2013, 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 8013557
+ * @summary Tests beans with public fields
+ * @author Sergey Malenkov
+ */
+
+public class Test8013557 extends AbstractTest {
+    public static void main(String[] args) {
+        new Test8013557().test(true);
+    }
+
+    protected Object getObject() {
+        return new Bean(new Value("something"));
+    }
+
+    @Override
+    protected Object getAnotherObject() {
+        return new Bean(new Value());
+    }
+
+    public static class Bean {
+        public Value value;
+
+        public Bean() {
+            this.value = new Value();
+        }
+
+        public Bean(Value value) {
+            this.value = value;
+        }
+
+        public void setValue(Value value) {
+            this.value = value;
+        }
+
+        public Value getValue() {
+            return this.value;
+        }
+    }
+
+    public static class Value {
+        private String string;
+
+        public Value() {
+            this.string = "default";
+        }
+
+        public Value(String value) {
+            this.string = value;
+        }
+
+        public void setString(String string) {
+            this.string = string;
+        }
+
+        public String getString() {
+            return this.string;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JComboBox/6337518/bug6337518.java	Wed Jun 05 14:16:17 2013 +0100
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2013, 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 6337518
+   @summary Null Arrow Button Throws Exception in BasicComboBoxUI
+   @author Anton Litvinov
+*/
+
+import javax.swing.*;
+import javax.swing.plaf.basic.*;
+
+public class bug6337518 extends BasicComboBoxUI {
+    @Override
+    protected JButton createArrowButton() {
+        return null;
+    }
+
+    public static void main(String[] args) throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                JComboBox comboBox = new JComboBox();
+                comboBox.setUI(new bug6337518());
+            }
+        });
+    }
+}
--- a/test/javax/swing/JTabbedPane/4624207/bug4624207.java	Mon May 06 12:57:42 2013 -0700
+++ b/test/javax/swing/JTabbedPane/4624207/bug4624207.java	Wed Jun 05 14:16:17 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, 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
@@ -37,6 +37,8 @@
 import java.awt.event.FocusEvent;
 import java.awt.event.FocusListener;
 import java.awt.event.KeyEvent;
+
+import sun.awt.OSInfo;
 import sun.awt.SunToolkit;
 
 public class bug4624207 implements ChangeListener, FocusListener {
@@ -99,7 +101,7 @@
 
         toolkit.realSync();
 
-        if ("Aqua".equals(UIManager.getLookAndFeel().getID())) {
+        if (OSInfo.getOSType() == OSInfo.OSType.MACOSX) {
             Util.hitKeys(robot, KeyEvent.VK_CONTROL, KeyEvent.VK_ALT, KeyEvent.VK_B);
         } else {
             Util.hitKeys(robot, KeyEvent.VK_ALT, KeyEvent.VK_B);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JTable/7068740/bug7068740.java	Wed Jun 05 14:16:17 2013 +0100
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2013, 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 7068740
+   @summary JTable wrapped in JLayer can't use PGUP/PGDOWN keys
+   @author Vladislav Karnaukhov
+   @run main bug7068740
+*/
+
+import sun.awt.SunToolkit;
+
+import javax.swing.*;
+import javax.swing.plaf.LayerUI;
+import javax.swing.plaf.metal.MetalLookAndFeel;
+import javax.swing.table.DefaultTableModel;
+import java.awt.*;
+import java.awt.event.KeyEvent;
+import java.lang.reflect.InvocationTargetException;
+
+public class bug7068740 extends JFrame {
+
+    private static Robot robot = null;
+    private static JTable table = null;
+    private static SunToolkit toolkit = null;
+
+    bug7068740() {
+        super();
+        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
+
+        DefaultTableModel model = new DefaultTableModel() {
+            @Override
+            public int getRowCount() {
+                return 20;
+            }
+
+            @Override
+            public int getColumnCount() {
+                return 2;
+            }
+
+            @Override
+            public Object getValueAt(int row, int column) {
+                return "(" + row + "," + column + ")";
+            }
+        };
+
+        table = new JTable(model);
+        LayerUI<JComponent> layerUI = new LayerUI<>();
+        JLayer<JComponent> layer = new JLayer<>(table, layerUI);
+        JScrollPane scrollPane = new JScrollPane(layer);
+        add(scrollPane);
+        pack();
+        setLocationRelativeTo(null);
+    }
+
+    private static void setUp() {
+        try {
+            if (robot == null) {
+                robot = new Robot();
+                robot.setAutoDelay(20);
+            }
+
+            if (toolkit == null) {
+                toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+            }
+
+            SwingUtilities.invokeAndWait(new Runnable() {
+                @Override
+                public void run() {
+                    bug7068740 test = new bug7068740();
+                    test.setVisible(true);
+                }
+            });
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+            throw new RuntimeException("Test failed");
+        } catch (InvocationTargetException e) {
+            e.printStackTrace();
+            throw new RuntimeException("Test failed");
+        } catch (AWTException e) {
+            e.printStackTrace();
+            throw new RuntimeException("Test failed");
+        }
+    }
+
+    private static void doTest() {
+        toolkit.realSync();
+        table.setRowSelectionInterval(0, 0);
+
+        robot.keyPress(KeyEvent.VK_PAGE_DOWN);
+        toolkit.realSync();
+        if (table.getSelectedRow() != 19) {
+            throw new RuntimeException("Test failed");
+        }
+
+        robot.keyPress(KeyEvent.VK_PAGE_UP);
+        toolkit.realSync();
+        if (table.getSelectedRow() != 0) {
+            throw new RuntimeException("Test failed");
+        }
+    }
+
+    public static void main(String[] args) {
+        try {
+            UIManager.setLookAndFeel(new MetalLookAndFeel());
+            setUp();
+            doTest();
+        } catch (UnsupportedLookAndFeelException e) {
+            e.printStackTrace();
+            throw new RuntimeException("Test failed");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/text/View/8014863/bug8014863.java	Wed Jun 05 14:16:17 2013 +0100
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 2007, 2013, 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 8014863
+ * @summary  Tests the calculation of the line breaks when a text is inserted
+ * @author Dmitry Markov
+ * @library ../../../regtesthelpers
+ * @build Util
+ * @run main bug8014863
+ */
+
+import sun.awt.SunToolkit;
+
+import javax.swing.*;
+import javax.swing.text.html.HTMLEditorKit;
+import java.awt.*;
+import java.awt.event.KeyEvent;
+
+public class bug8014863 {
+
+    private static JEditorPane editorPane;
+    private static Robot robot;
+    private static SunToolkit toolkit;
+
+    public static void main(String[] args) throws Exception {
+        toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        robot = new Robot();
+
+        createAndShowGUI();
+
+        toolkit.realSync();
+
+        Util.hitKeys(robot, KeyEvent.VK_HOME);
+        Util.hitKeys(robot, KeyEvent.VK_O);
+
+        toolkit.realSync();
+
+        if (3 != getNumberOfTextLines()) {
+            throw new RuntimeException("The number of texts lines does not meet the expectation");
+        }
+
+        Util.hitKeys(robot, KeyEvent.VK_N);
+
+        toolkit.realSync();
+
+        if (3 != getNumberOfTextLines()) {
+            throw new RuntimeException("The number of texts lines does not meet the expectation");
+        }
+
+        Util.hitKeys(robot, KeyEvent.VK_E);
+        Util.hitKeys(robot, KeyEvent.VK_SPACE);
+        Util.hitKeys(robot, KeyEvent.VK_T);
+        Util.hitKeys(robot, KeyEvent.VK_W);
+
+        toolkit.realSync();
+
+        if (3 != getNumberOfTextLines()) {
+            throw new RuntimeException("The number of texts lines does not meet the expectation");
+        }
+    }
+
+    private static int getNumberOfTextLines() throws Exception {
+        int numberOfLines = 0;
+        int caretPosition = getCaretPosition();
+        int current = 1;
+        int previous;
+
+        setCaretPosition(current);
+        do {
+            previous = current;
+            Util.hitKeys(robot, KeyEvent.VK_DOWN);
+            toolkit.realSync();
+            current = getCaretPosition();
+            numberOfLines++;
+        } while (current != previous);
+
+        setCaretPosition(caretPosition);
+        return numberOfLines;
+    }
+
+    private static int getCaretPosition() throws Exception {
+        final int[] result = new int[1];
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                result[0] = editorPane.getCaretPosition();
+            }
+        });
+        return result[0];
+    }
+
+    private static void setCaretPosition(final int position) throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                editorPane.setCaretPosition(position);
+            }
+        });
+    }
+
+    private static void createAndShowGUI() throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                try {
+                    UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
+                } catch (Exception ex) {
+                    throw new RuntimeException(ex);
+                }
+                JFrame frame = new JFrame();
+                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+
+                editorPane = new JEditorPane();
+                HTMLEditorKit editorKit = new HTMLEditorKit();
+                editorPane.setEditorKit(editorKit);
+                editorPane.setText("<p>qqqq <em>pp</em> qqqq <em>pp</em> " +
+                        "qqqq <em>pp</em> qqqq <em>pp</em> qqqq <em>pp</em> qqqq <em>pp" +
+                        "</em> qqqq <em>pp</em> qqqq <em>pp</em> qqqq <em>pp</em> qqqq</p>");
+                editorPane.setCaretPosition(1);
+
+                frame.add(editorPane);
+                frame.setSize(200, 200);
+                frame.setVisible(true);
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/jaxp/Encodings/CheckEncodingPropertiesFile.java	Wed Jun 05 14:16:17 2013 +0100
@@ -0,0 +1,421 @@
+/*
+ * Copyright (c) 2013, 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 8008738
+ * @summary checks that the mapping implemented by
+ *      com.sun.org.apache.xml.internal.serializer.Encodings
+ *      correctly identifies valid Charset names and
+ *      correctly maps them to their preferred mime names.
+ *      Also checks that the Encodings.properties resource file
+ *      is consistent.
+ * @compile -XDignore.symbol.file CheckEncodingPropertiesFile.java
+ * @run main CheckEncodingPropertiesFile
+ * @author Daniel Fuchs
+ */
+
+import com.sun.org.apache.xml.internal.serializer.EncodingInfo;
+import com.sun.org.apache.xml.internal.serializer.Encodings;
+import java.io.InputStreamReader;
+import java.lang.reflect.Method;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Properties;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+public class CheckEncodingPropertiesFile {
+
+    private static final String ENCODINGS_FILE = "com/sun/org/apache/xml/internal/serializer/Encodings.properties";
+
+    public static void main(String[] args) throws Exception {
+        Properties props = new Properties();
+        try (InputStreamReader is = new InputStreamReader(ClassLoader.getSystemResourceAsStream(ENCODINGS_FILE))) {
+            props.load(is);
+        }
+
+        //printAllCharsets();
+
+        test(props);
+    }
+
+
+    private static final class CheckCharsetMapping {
+
+        /**
+         * A map that maps Java or XML name to canonical charset names.
+         * key:    upper cased value of Java or XML name.
+         * value:  case-sensitive canonical name of charset.
+         */
+        private final Map<String, String> charsetMap = new HashMap<>();
+
+        private final Map<String, String> preferredMime = new HashMap<>();
+
+        /**
+         * Unresolved alias names.
+         * For a given set of names pointing to the same unresolved charset,
+         * this map will contain, for each alias in the set, a mapping
+         * with the alias.toUpperValue() as key and the set of known aliases
+         * as value.
+         */
+        private final Map<String, Collection<String>> unresolved = new HashMap<>();
+
+        public final static class ConflictingCharsetError extends Error {
+            ConflictingCharsetError(String a, String cs1, String cs2) {
+                super("Conflicting charset mapping for '"+a+"': '"+cs1+"' and '"+cs2+"'");
+            }
+        }
+
+        public final static class MissingValidCharsetNameError extends Error {
+            MissingValidCharsetNameError(String name, Collection<String> aliases) {
+                super(name+": Line "+aliases+" has no recognized charset alias");
+            }
+        }
+
+        public final static class ConflictingPreferredMimeNameError extends Error {
+            ConflictingPreferredMimeNameError(String a, String cs1, String cs2) {
+                super("Conflicting preferred mime name for '"+a+"': '"+cs1+"' and '"+cs2+"'");
+            }
+        }
+
+        /**
+         * For each alias in aliases, attempt to find the canonical
+         * charset name.
+         * All names in aliases are supposed to point to the same charset.
+         * Names in aliases can be java names or XML names, indifferently.
+         * @param aliases list of names (aliases) for a given charset.
+         * @return The canonical name of the charset, if found, null otherwise.
+         */
+        private String findCharsetNameFor(String[] aliases) {
+            String cs = null;
+            String res = null;
+            for (String a : aliases) {
+                final String k = a.toUpperCase();
+                String cachedCs = charsetMap.get(k);
+                if (cs == null) {
+                    cs = cachedCs;
+                }
+                if (cachedCs != null && cs != null
+                        && !Charset.forName(cachedCs).name().equals(Charset.forName(cs).name())) {
+                    throw new ConflictingCharsetError(a,cs,cachedCs);
+                }
+                try {
+                    final String rcs = Charset.forName(a).name();
+                    if (cs != null && !Charset.forName(cs).name().equals(rcs)) {
+                        throw new ConflictingCharsetError(a,cs,rcs);
+                    }
+                    if (res == null) {
+                        if (a.equals(aliases[0])) {
+                            res = a;
+                        } else {
+                            res = cs;
+                        }
+                    }
+                    cs = rcs;
+                    charsetMap.put(k, res == null ? cs : res);
+                } catch (Exception x) {
+                    continue;
+                }
+            }
+            return res == null ? cs : res;
+        }
+
+        /**
+         * Register a canonical charset name for a given set of aliases.
+         *
+         * @param charsetName the canonical charset name.
+         * @param aliases a list of aliases for the given charset.
+         */
+        private void registerCharsetNameFor(String charsetName, String[] aliases) {
+            if (charsetName == null) throw new NullPointerException();
+
+            for (String a : aliases) {
+                String k = a.toUpperCase();
+                String csv = charsetMap.get(k);
+                if (csv == null) {
+                    charsetMap.put(k, charsetName);
+                    csv = charsetName;
+                } else if (!csv.equals(charsetName)) {
+                    throw new ConflictingCharsetError(a,charsetName,csv);
+                }
+
+                final Collection<String> c = unresolved.get(k);
+                if (c != null) {
+                    for (String aa : c) {
+                        k = aa.toUpperCase();
+                        String csvv = charsetMap.get(k);
+                        if (csvv == null) charsetMap.put(k, csv);
+                        unresolved.remove(k);
+                    }
+                    throw new MissingValidCharsetNameError(charsetName,c);
+                }
+            }
+        }
+
+        /**
+         * Register a set of aliases as being unresolved.
+         * @param names    the list of names - this should be what is returned by
+         *                 nameSet.toArray(new String[nameSet.size()])
+         * @param nameSet  the set of unresolved aliases.
+         */
+        private void registerUnresolvedNamesFor(String[] names, Collection<String> nameSet) {
+            // This is not necessarily an error: it could happen that some
+            //    charsets are simply not supported on some OS/Arch
+            System.err.println("Warning: unresolved charset names: '"+ nameSet
+                    + "' This is not necessarily an error "
+                    + "- this charset may not be supported on this platform.");
+            for (String a : names) {
+                final String k = a.toUpperCase();
+                final Collection<String> c = unresolved.get(k);
+                if (c != null) {
+                    //System.out.println("Found: "+a+" -> "+c);
+                    //System.out.println("\t merging "+ c + " with " + nameSet);
+                    nameSet.addAll(c);
+                    for (String aa : c) {
+                        unresolved.put(aa.toUpperCase(), nameSet);
+                    }
+                }
+                unresolved.put(k, nameSet);
+            }
+        }
+
+
+        /**
+         * Add a new charset name mapping
+         * @param javaName the (supposedly) java name of the charset.
+         * @param xmlNames a list of corresponding XML names for that charset.
+         */
+        void addMapping(String javaName, Collection<String> xmlNames) {
+            final LinkedHashSet<String> aliasNames = new LinkedHashSet<>();
+            aliasNames.add(javaName);
+            aliasNames.addAll(xmlNames);
+            final String[] aliases = aliasNames.toArray(new String[aliasNames.size()]);
+            final String cs = findCharsetNameFor(aliases);
+            if (cs != null) {
+                registerCharsetNameFor(cs, aliases);
+                if (xmlNames.size() > 0) {
+                    String preferred = xmlNames.iterator().next();
+                    String cachedPreferred = preferredMime.get(cs.toUpperCase());
+                    if (cachedPreferred != null && !cachedPreferred.equals(preferred)) {
+                        throw new ConflictingPreferredMimeNameError(cs, cachedPreferred, preferred);
+                    }
+                    preferredMime.put(cs.toUpperCase(), preferred);
+                }
+            } else {
+                registerUnresolvedNamesFor(aliases, aliasNames);
+            }
+        }
+
+        /**
+         * Returns the canonical name of the charset for the given Java or XML
+         * alias name.
+         * @param alias the alias name
+         * @return the canonical charset name - or null if unknown.
+         */
+        public String getCharsetNameFor(String alias) {
+            return charsetMap.get(alias.toUpperCase());
+        }
+
+    }
+
+    public static void test(Properties props) throws Exception {
+
+        // First, build a mapping from the properties read from the resource
+        // file.
+        // We're going to check the consistency of the resource file
+        // while building this mapping, and throw errors if the file
+        // does not meet our assumptions.
+        //
+        Map<String, Collection<String>> lines = new HashMap<>();
+        final CheckCharsetMapping mapping = new CheckCharsetMapping();
+
+        for (String key : props.stringPropertyNames()) {
+            Collection<String> values = getValues(props.getProperty(key));
+            lines.put(key, values);
+            mapping.addMapping(key, values);
+        }
+
+        // Then build maps of EncodingInfos, and print along debugging
+        // information that should help understand the content of the
+        // resource file and the mapping it defines.
+        //
+        Map<String, EncodingInfo> javaInfos = new HashMap<>(); // Map indexed by java names
+        Map<String, EncodingInfo> xmlMap = new HashMap<>();    // Map indexed by XML names
+        Map<String, String> preferred =
+                new HashMap<>(mapping.preferredMime);          // Java Name -> Preferred Mime Name
+        List<EncodingInfo> all = new ArrayList<>();            // unused...
+        for (Entry<String, Collection<String>> e : lines.entrySet()) {
+            final String charsetName = mapping.getCharsetNameFor(e.getKey());
+            if (charsetName == null) {
+                System.out.println("!! No charset for: "+e.getKey()+ " "+ e.getValue());
+                continue;
+            }
+            Charset c = Charset.forName(charsetName);
+            EncodingInfo info;
+            final String k = e.getKey().toUpperCase();
+            final String kc = charsetName.toUpperCase();
+            StringBuilder sb = new StringBuilder();
+            for (String xml : e.getValue()) {
+                final String kx = xml.toUpperCase();
+                info = xmlMap.get(kx);
+                if (info == null) {
+                    info = new EncodingInfo(xml, charsetName);
+                    System.out.println("** XML: "+xml+" -> "+charsetName);
+                    xmlMap.put(kx, info);
+                    all.add(info);
+                }
+                if (!javaInfos.containsKey(k)) {
+                    javaInfos.put(k, info);
+                    if (!preferred.containsKey(k)) {
+                        preferred.put(k, xml);
+                    }
+                    sb.append("** Java: ").append(k).append(" -> ")
+                            .append(xml).append(" (charset: ")
+                            .append(charsetName).append(")\n");
+                }
+                if (!javaInfos.containsKey(kc)) {
+                    if (!preferred.containsKey(kc)) {
+                        preferred.put(kc, xml);
+                    }
+                    javaInfos.put(kc, info);
+                    sb.append("** Java: ").append(kc).append(" -> ")
+                            .append(xml).append(" (charset: ")
+                            .append(charsetName).append(")\n");
+                }
+                if (!javaInfos.containsKey(c.name().toUpperCase())) {
+                    if (!preferred.containsKey(c.name().toUpperCase())) {
+                        preferred.put(c.name().toUpperCase(), xml);
+                    }
+                    javaInfos.put(c.name().toUpperCase(), info);
+                    sb.append("** Java: ").append(c.name().toUpperCase()).append(" -> ")
+                            .append(xml).append(" (charset: ")
+                            .append(charsetName).append(")\n");
+                }
+            }
+            if (sb.length() == 0) {
+                System.out.println("Nothing new for "+charsetName+": "+e.getKey()+" -> "+e.getValue());
+            } else {
+                System.out.print(sb);
+            }
+
+        }
+
+        // Now we're going to verify that Encodings.java has done its job
+        // correctly. We're going to ask Encodings to convert java names to mime
+        // names and mime names to java names - and verify that the returned
+        // java names do map to recognized charsets.
+        //
+        // We're also going to verify that Encodings has recorded the preferred
+        // mime name correctly.
+
+        Method m = Encodings.class.getDeclaredMethod("getMimeEncoding", String.class);
+        m.setAccessible(true);
+
+        Set<String> xNames = new HashSet<>();
+        Set<String> jNames = new HashSet<>();
+        for (String name: xmlMap.keySet()) {
+            final String javaName = checkConvertMime2Java(name);
+            checkPreferredMime(m, javaName, preferred);
+            jNames.add(javaName);
+            xNames.add(name);
+        }
+
+
+        for (String javaName : lines.keySet()) {
+            final String javaCharsetName = mapping.getCharsetNameFor(javaName.toUpperCase());
+            if (javaCharsetName == null) continue;
+            if (!jNames.contains(javaName)) {
+                checkPreferredMime(m, javaName, preferred);
+                jNames.add(javaName);
+            }
+            for (String xml : lines.get(javaName)) {
+                if (xNames.contains(xml)) continue;
+                final String jName = checkConvertMime2Java(xml);
+                xNames.add(xml);
+                if (jNames.contains(jName)) continue;
+                checkPreferredMime(m, jName, preferred);
+            }
+        }
+    }
+
+    private static String checkConvertMime2Java(String xml) {
+        final String jName = Encodings.convertMime2JavaEncoding(xml);
+        final String jCharsetName;
+        try {
+            jCharsetName = Charset.forName(jName).name();
+        } catch (Exception x) {
+            throw new Error("Unrecognized charset returned by Encodings.convertMime2JavaEncoding(\""+xml+"\")", x);
+        }
+        System.out.println("Encodings.convertMime2JavaEncoding(\""+xml+"\") = \""+jName+"\" ("+jCharsetName+")");
+        return jName;
+    }
+
+    private static void checkPreferredMime(Method m, String javaName, Map<String,String> preferred)
+            throws Exception {
+        final String mime = (String) m.invoke(null, javaName);
+        final String expected = preferred.get(javaName.toUpperCase());
+        if (Arrays.deepEquals(new String[] {mime}, new String[] {expected})) {
+            System.out.println("Encodings.getMimeEncoding(\""+javaName+"\") = \""+mime+"\"");
+        } else {
+            throw new Error("Bad preferred mime type for: '"+javaName+"': expected '"+
+                expected+"' but got '"+mime+"'");
+        }
+    }
+
+    private static Collection<String> getValues(String val) {
+        int pos = val.indexOf(' ');
+        if (pos < 0) {
+            return Collections.singletonList(val);
+        }
+        //lastPrintable =
+        //    Integer.decode(val.substring(pos).trim()).intValue();
+        StringTokenizer st =
+            new StringTokenizer(val.substring(0, pos), ",");
+        final List<String> values = new ArrayList<>(st.countTokens());
+        while (st.hasMoreTokens()) {
+            values.add(st.nextToken());
+        }
+        return values;
+    }
+
+    // can be called in main() to help debugging.
+    // Prints out all available charsets and their recognized aliases
+    // as returned by the Charset API.
+    private static void printAllCharsets() {
+        Map<String, Charset> all = Charset.availableCharsets();
+        System.out.println("\n=========================================\n");
+        for (String can : all.keySet()) {
+            System.out.println(can + ": " + all.get(can).aliases());
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/jaxp/PrecisionDecimalDV/XPrecisionDecimalToString.java	Wed Jun 05 14:16:17 2013 +0100
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2013, 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.
+ */
+
+import java.lang.reflect.Method;
+
+/**
+ * @test
+ * @bug 8013900
+ * @summary More warning compiling jaxp.
+ *   This test only test one of the methods used to implement hashCode()
+ *   in com.sun.org.apache.xerces.internal.impl.dv.xs.PrecisionDecimalDV$XPrecisionDecimal.
+ *   Since that method is private the test unfortunately needs to use reflection
+ *   to invoke the method.
+ * @run main XPrecisionDecimalToString
+ * @author Daniel Fuchs
+ */
+public class XPrecisionDecimalToString {
+
+    private static final String className =
+            "com.sun.org.apache.xerces.internal.impl.dv.xs.PrecisionDecimalDV$XPrecisionDecimal";
+    private static final String methodName = "canonicalToStringForHashCode";
+    private static final Class<?>[] signature = { String.class, String.class, int.class, int.class };
+    private static Method method;
+
+    // Invokes XPrecisionDecimal.canonicalToStringForHashCode through reflection,
+    // because the method is private...
+    //
+    // Construct a canonical String representation of this number
+    // for the purpose of deriving a hashCode value compliant with
+    // equals.
+    // The toString representation will be:
+    // NaN for NaN, INF for +infinity, -INF for -infinity, 0 for zero,
+    // and [1-9]\.[0-9]*[1-9]?(E[1-9][0-9]*)? for other numbers.
+    private static String canonicalToStringForHashCode(String ivalue, String fvalue, int sign, int pvalue) {
+        try {
+            if (method == null) {
+                Class<?> type = Class.forName(className);
+                method = type.getDeclaredMethod(methodName, signature);
+                method.setAccessible(true);
+            }
+        } catch (Exception x) {
+            throw new Error("Impossible to find '"+className+"."+methodName+"': "+ x, x);
+        }
+        try {
+            return (String) method.invoke(null, new Object[] {ivalue, fvalue, sign, pvalue} );
+        } catch(Exception x) {
+            throw new Error("Failed to invoke "+className+"."+methodName+"(\""+
+                    ivalue+"\", \""+fvalue+"\", "+sign+", "+pvalue+"): " +x, x);
+        }
+    }
+
+    /**
+     * @param args the command line arguments
+     */
+    public static void main(String[] args) {
+        test("123","7890",-1,0,"-1.23789E2");
+        test("0","007890",-1,0,"-7.89E-3");
+        test("123","7890",1,0,"1.23789E2");
+        test("0","007890",1,0,"7.89E-3");
+        test("123","7890",1,10,"1.23789E12");
+        test("0","007890",1,33,"7.89E30");
+        test("INF","",1,0,"INF");
+        test("INF","",-1,0,"-INF");
+        test("NaN","",0,0,"NaN");
+        test("0","",1,0,"0");
+        test("00000","00000",1,10,"0");
+        test("00000","00000",-1,10,"0");
+        test("00000","000001",-1,-10,"-1E-16");
+    }
+
+    private static void test(String ival, String fval, int sign, int pvalue, String expected) {
+        final String canonical = canonicalToStringForHashCode(ival, fval, sign, pvalue);
+        System.out.println((sign == -1 ? "-" : "") + ival +
+                ("INF".equals(ival) || "NaN".equals(ival) ? ""
+                 : ( "." + fval + "E" + pvalue))
+                + " => "+ canonical);
+        if (!expected.equals(canonical)) {
+            throw new Error("expected: "+expected+" got: "+ canonical);
+        }
+    }
+
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/java2d/loops/RenderToCustomBufferTest.java	Wed Jun 05 14:16:17 2013 +0100
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2013, 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     8015606
+ * @summary Test verifies whether a text is rendered correctly to
+ *          a custom buffered image.
+ *
+ * @run     main RenderToCustomBufferTest
+ */
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.Transparency;
+import java.awt.color.ColorSpace;
+import java.awt.image.BufferedImage;
+import java.awt.image.ColorModel;
+import java.awt.image.ComponentColorModel;
+import java.awt.image.DataBuffer;
+import java.awt.image.WritableRaster;
+
+public class RenderToCustomBufferTest {
+     public static void main(String[] args) {
+        final BufferedImage dst_custom = createCustomBuffer();
+        final BufferedImage dst_dcm = new BufferedImage(width, height,
+                BufferedImage.TYPE_INT_RGB);
+
+        renderTo(dst_custom);
+        renderTo(dst_dcm);
+
+        check(dst_custom, dst_dcm);
+    }
+
+    private static void check(BufferedImage a, BufferedImage b) {
+        for (int y = 0; y < height; y++) {
+            for (int x = 0; x < width; x++) {
+                int pa = a.getRGB(x, y);
+                int pb = b.getRGB(x, y);
+
+                if (pa != pb) {
+                    String msg = String.format(
+                        "Point [%d, %d] has different colors: %08X and %08X",
+                        x, y, pa, pb);
+                    throw new RuntimeException("Test failed: " + msg);
+                }
+            }
+        }
+    }
+
+    private static BufferedImage createCustomBuffer() {
+        ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_sRGB);
+        ColorModel cm = new ComponentColorModel(cs, false, false,
+                Transparency.OPAQUE, DataBuffer.TYPE_FLOAT);
+        WritableRaster wr = cm.createCompatibleWritableRaster(width, height);
+
+        return new BufferedImage(cm, wr, false, null);
+    }
+
+    private static void renderTo(BufferedImage dst) {
+        System.out.println("The buffer: " + dst);
+        Graphics2D g = dst.createGraphics();
+
+        final int w = dst.getWidth();
+        final int h = dst.getHeight();
+
+        g.setColor(Color.blue);
+        g.fillRect(0, 0, w, h);
+
+        g.setColor(Color.red);
+        Font f = g.getFont();
+        g.setFont(f.deriveFont(48f));
+
+        g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
+               RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+
+        // NB: this clip ctriggers the problem
+        g.setClip(50, 50, 200, 100);
+
+        g.drawString("AA Text", 52, 90);
+
+        g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
+               RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
+
+        // NB: this clip ctriggers the problem
+        g.setClip(50, 100, 100, 100);
+        g.drawString("Text", 52, 148);
+
+        g.dispose();
+    }
+
+    private static final int width = 230;
+    private static final int height = 150;
+}