changeset 23:6dcad8685875 jdk6-b12

6755917: Changes for openjdk6 build 12 6627362: javac generates code that uses array.clone, which is not available on JavaCard Summary: Final b12 state (as defined by the source bundle) Reviewed-by: darcy
author ohair
date Fri, 30 Jan 2009 17:06:56 -0800
parents 97a9ca1d694f
children 4f446c0866a4
files src/share/classes/com/sun/tools/javac/code/Symtab.java src/share/classes/com/sun/tools/javac/comp/Lower.java src/share/classes/com/sun/tools/javac/comp/Resolve.java src/share/classes/com/sun/tools/javadoc/DocletInvoker.java test/tools/javac/5045412/Bar.java test/tools/javac/5045412/Foo.java test/tools/javac/5045412/out test/tools/javac/6176978/T6176978.java test/tools/javac/6176978/X.java test/tools/javac/6627362/T6627362.java test/tools/javac/6627362/x/E.java test/tools/javac/6627362/x/Object.java test/tools/javac/staticImport/6665223/T6665223.java test/tools/javac/staticImport/6665223/pkg/A.java test/tools/javac/staticImport/6665223/pkg/B.java test/tools/javac/synthesize/Boolean.java test/tools/javac/synthesize/Byte.java test/tools/javac/synthesize/Character.java test/tools/javac/synthesize/Cloneable.java test/tools/javac/synthesize/Double.java test/tools/javac/synthesize/Float.java test/tools/javac/synthesize/Integer.java test/tools/javac/synthesize/Long.java test/tools/javac/synthesize/Main.java test/tools/javac/synthesize/Number.java test/tools/javac/synthesize/Object.java test/tools/javac/synthesize/Serializable.java test/tools/javac/synthesize/Short.java test/tools/javac/synthesize/Test.java test/tools/javac/synthesize/Void.java
diffstat 30 files changed, 1188 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/javac/code/Symtab.java	Fri Jan 30 17:06:43 2009 -0800
+++ b/src/share/classes/com/sun/tools/javac/code/Symtab.java	Fri Jan 30 17:06:56 2009 -0800
@@ -75,6 +75,7 @@
 
     private final Name.Table names;
     private final ClassReader reader;
+    private final Target target;
 
     /** A symbol for the root package.
      */
@@ -144,6 +145,7 @@
     public final Type suppressWarningsType;
     public final Type inheritedType;
     public final Type proprietaryType;
+    public final Type systemType;
 
     /** The symbol representing the length field of an array.
      */
@@ -270,6 +272,55 @@
      */
     private Type enterClass(String s) {
 	return reader.enterClass(names.fromString(s)).type;
+    } 
+
+    public void synthesizeEmptyInterfaceIfMissing(final Type type) {
+        final Completer completer = type.tsym.completer;
+        if (completer != null) {
+            type.tsym.completer = new Completer() {
+                public void complete(Symbol sym) throws CompletionFailure {
+                    try {
+                        completer.complete(sym);
+                    } catch (CompletionFailure e) {
+                        sym.flags_field |= (PUBLIC | INTERFACE);
+                        ((ClassType) sym.type).supertype_field = objectType;
+                    }
+                }
+            };
+        }
+    }
+    
+    public void synthesizeBoxTypeIfMissing(final Type type) {
+        ClassSymbol sym = reader.enterClass(boxedName[type.tag]);
+        final Completer completer = sym.completer;
+        if (completer != null) {
+            sym.completer = new Completer() {
+                public void complete(Symbol sym) throws CompletionFailure {
+                    try {
+                        completer.complete(sym);
+                    } catch (CompletionFailure e) {
+                        sym.flags_field |= PUBLIC;
+                        ((ClassType) sym.type).supertype_field = objectType;
+                        Name n = target.boxWithConstructors() ? names.init : names.valueOf;
+                        MethodSymbol boxMethod =
+                            new MethodSymbol(PUBLIC | STATIC,
+                                n, 
+                                new MethodType(List.of(type), sym.type,
+                                    List.<Type>nil(), methodClass),
+                                sym);
+                        sym.members().enter(boxMethod);
+                        MethodSymbol unboxMethod =
+                            new MethodSymbol(PUBLIC,
+                                type.tsym.name.append(names.Value), // x.intValue()
+                                new MethodType(List.<Type>nil(), type,
+                                    List.<Type>nil(), methodClass),
+                                sym);
+                        sym.members().enter(unboxMethod);
+                    }
+                }
+            };
+        }
+        
     }
 
     /** Constructor; enters all predefined identifiers and operators
@@ -279,6 +330,7 @@
 	context.put(symtabKey, this);
 
 	names = Name.Table.instance(context);
+	target = Target.instance(context);
 
 	// Create the unknown type
 	unknownType = new Type(TypeTags.UNKNOWN, null);
@@ -373,7 +425,7 @@
 	collectionsType = enterClass("java.util.Collections");
 	comparableType = enterClass("java.lang.Comparable");
 	arraysType = enterClass("java.util.Arrays");
-	iterableType = Target.instance(context).hasIterable()
+	iterableType = target.hasIterable()
             ? enterClass("java.lang.Iterable")
             : enterClass("java.util.Collection");
 	iteratorType = enterClass("java.util.Iterator");
@@ -383,6 +435,12 @@
 	deprecatedType = enterClass("java.lang.Deprecated");
 	suppressWarningsType = enterClass("java.lang.SuppressWarnings");
 	inheritedType = enterClass("java.lang.annotation.Inherited");
+        systemType = enterClass("java.lang.System");
+        
+        synthesizeEmptyInterfaceIfMissing(cloneableType);
+        synthesizeEmptyInterfaceIfMissing(serializableType);
+        synthesizeBoxTypeIfMissing(doubleType);
+        synthesizeBoxTypeIfMissing(floatType);
 
         // Enter a synthetic class that is used to mark Sun
         // proprietary classes in ct.sym.  This class does not have a
--- a/src/share/classes/com/sun/tools/javac/comp/Lower.java	Fri Jan 30 17:06:43 2009 -0800
+++ b/src/share/classes/com/sun/tools/javac/comp/Lower.java	Fri Jan 30 17:06:56 2009 -0800
@@ -2108,16 +2108,64 @@
 	tree.sym.members().enter(valuesVar);
 
 	Symbol valuesSym = lookupMethod(tree.pos(), names.values,
-					tree.type, List.<Type>nil());
-	JCTypeCast valuesResult =
-	    make.TypeCast(valuesSym.type.getReturnType(),
-			  make.App(make.Select(make.Ident(valuesVar),
-					       syms.arrayCloneMethod)));
+					tree.type, List.<Type>nil());         
+        List<JCStatement> valuesBody;
+        if (useClone()) {
+            // return (T[]) $VALUES.clone();
+	    JCTypeCast valuesResult =
+		make.TypeCast(valuesSym.type.getReturnType(),
+			      make.App(make.Select(make.Ident(valuesVar),
+						   syms.arrayCloneMethod)));
+            valuesBody = List.<JCStatement>of(make.Return(valuesResult));
+        } else {
+            // template: T[] $result = new T[$values.length];
+            Name resultName = names.fromString(target.syntheticNameChar() + "result");
+            while (tree.sym.members().lookup(resultName).scope != null) // avoid name clash
+                resultName = names.fromString(resultName + "" + target.syntheticNameChar());
+            VarSymbol resultVar = new VarSymbol(FINAL|SYNTHETIC,
+                                                resultName,
+                                                arrayType,
+                                                valuesSym);
+            JCNewArray resultArray = make.NewArray(make.Type(types.erasure(tree.type)), 
+                                  List.of(make.Select(make.Ident(valuesVar), syms.lengthVar)), 
+                                  null);
+            resultArray.type = arrayType;
+            JCVariableDecl decl = make.VarDef(resultVar, resultArray);
+            
+            // template: System.arraycopy($VALUES, 0, $result, 0, $VALUES.length);
+            if (systemArraycopyMethod == null) {
+                systemArraycopyMethod =
+                    new MethodSymbol(PUBLIC | STATIC,
+                                     names.fromString("arraycopy"),
+                                     new MethodType(List.<Type>of(syms.objectType, 
+                                                            syms.intType, 
+                                                            syms.objectType, 
+                                                            syms.intType, 
+                                                            syms.intType), 
+                                                    syms.voidType,
+                                                    List.<Type>nil(), 
+                                                    syms.methodClass),
+                                     syms.systemType.tsym);
+            }
+            JCStatement copy =
+                make.Exec(make.App(make.Select(make.Ident(syms.systemType.tsym), 
+                                               systemArraycopyMethod),
+                          List.of(make.Ident(valuesVar), make.Literal(0),
+                                  make.Ident(resultVar), make.Literal(0),
+                                  make.Select(make.Ident(valuesVar), syms.lengthVar))));
+            
+            // template: return $result;
+            JCStatement ret = make.Return(make.Ident(resultVar));
+            valuesBody = List.<JCStatement>of(decl, copy, ret);
+        }
+
 	JCMethodDecl valuesDef =
-	    make.MethodDef((MethodSymbol)valuesSym,
-			   make.Block(0, List.<JCStatement>nil()
-				      .prepend(make.Return(valuesResult))));
+             make.MethodDef((MethodSymbol)valuesSym, make.Block(0, valuesBody));
+
 	enumDefs.append(valuesDef);
+        
+        if (debugLower)
+            System.err.println(tree.sym + ".valuesDef = " + valuesDef);
 
 	/** The template for the following code is:
 	 *
@@ -2154,6 +2202,17 @@
             addEnumCompatibleMembers(tree);
         }
     }
+        // where
+        private MethodSymbol systemArraycopyMethod;
+        private boolean useClone() {
+            try {
+                Scope.Entry e = syms.objectType.tsym.members().lookup(names.clone);
+                return (e.sym != null);
+            }
+            catch (CompletionFailure e) {
+                return false;
+            }
+        }
 
     /** Translate an enumeration constant and its initializer. */
     private void visitEnumConstantDef(JCVariableDecl var, int ordinal) {
--- a/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Fri Jan 30 17:06:43 2009 -0800
+++ b/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Fri Jan 30 17:06:56 2009 -0800
@@ -228,7 +228,7 @@
                 // another symbol which is a member of `site'
                 // (because, if it is overridden, `sym' is not strictly
                 // speaking a member of `site'.)
-                (sym.kind != MTH || sym.isConstructor() ||
+                (sym.kind != MTH || sym.isConstructor() || sym.isStatic() ||
                  ((MethodSymbol)sym).implementation(site.tsym, types, true) == sym);
         default: // this case includes erroneous combinations as well
             return isAccessible(env, site);
--- a/src/share/classes/com/sun/tools/javadoc/DocletInvoker.java	Fri Jan 30 17:06:43 2009 -0800
+++ b/src/share/classes/com/sun/tools/javadoc/DocletInvoker.java	Fri Jan 30 17:06:56 2009 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2004 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1998-2008 Sun Microsystems, Inc.  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
@@ -82,7 +82,9 @@
         cpString = appendPath(System.getProperty("java.class.path"), cpString);
         cpString = appendPath(docletPath, cpString);
         URL[] urls = pathToURLs(cpString);
-        appClassLoader = new URLClassLoader(urls);
+        appClassLoader =
+            new URLClassLoader(urls,
+                               getDelegationClassLoader(docletClassName));
 
         // attempt to find doclet
         Class dc = null;
@@ -95,9 +97,59 @@
         docletClass = dc;
     }
 
+    /*
+     * Returns the delegation class loader to use when creating
+     * appClassLoader (used to load the doclet).  The context class
+     * loader is the best choice, but legacy behavior was to use the
+     * default delegation class loader (aka system class loader).
+     *
+     * Here we favor using the context class loader.  To ensure
+     * compatibility with existing apps, we revert to legacy
+     * behavior if either or both of the following conditions hold:
+     *
+     * 1) the doclet is loadable from the system class loader but not
+     *    from the context class loader,
+     *
+     * 2) this.getClass() is loadable from the system class loader but not
+     *    from the context class loader.
+     */
+    private ClassLoader getDelegationClassLoader(String docletClassName) {
+        ClassLoader ctxCL = Thread.currentThread().getContextClassLoader();
+        ClassLoader sysCL = ClassLoader.getSystemClassLoader();
+        if (sysCL == null)
+            return ctxCL;
+        if (ctxCL == null)
+            return sysCL;
+
+        // Condition 1.
+        try {
+            sysCL.loadClass(docletClassName);
+            try {
+                ctxCL.loadClass(docletClassName);
+            } catch (ClassNotFoundException e) {
+                return sysCL;
+            }
+        } catch (ClassNotFoundException e) {
+        }
+
+        // Condition 2.
+        try {
+            if (getClass() == sysCL.loadClass(getClass().getName())) {
+                try {
+                    if (getClass() != ctxCL.loadClass(getClass().getName()))
+                        return sysCL;
+                } catch (ClassNotFoundException e) {
+                    return sysCL;
+                }
+            }
+        } catch (ClassNotFoundException e) {
+        }
+
+        return ctxCL;
+    }
+
     /**
-     * Generate documentation here.  Return true on success.
-     */
+     * Generate documentation here.  Return true on success.  */
     public boolean start(RootDoc root) {
         Object retVal;
         String methodName = "start";
@@ -228,6 +280,8 @@
 			       docletClassName, methodName);
                 throw new DocletInvokeException();
             }
+            ClassLoader savedCCL =
+                Thread.currentThread().getContextClassLoader();
             try {
                 Thread.currentThread().setContextClassLoader(appClassLoader);
                 return meth.invoke(null , params);
@@ -253,7 +307,9 @@
                     exc.getTargetException().printStackTrace();
                 }
                 throw new DocletInvokeException();
-            } 
+            } finally {
+                Thread.currentThread().setContextClassLoader(savedCCL);
+            }
     }
 
     /**
--- a/test/tools/javac/5045412/Bar.java	Fri Jan 30 17:06:43 2009 -0800
+++ b/test/tools/javac/5045412/Bar.java	Fri Jan 30 17:06:56 2009 -0800
@@ -1,13 +1,36 @@
-/**
- * @test  /nodynamiccopyright/
- * @bug 5045412
- * @compile/fail/ref=out -XDstdout -XDrawDiagnostics -Xlint:serial -XDfailcomplete=java.io.Serializable Bar.java 
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
  */
 
 /**
- * @test  /nodynamiccopyright/
- * @bug 5045412
- * @compile/fail/ref=out -XDstdout -XDrawDiagnostics -Xlint:serial -XDfailcomplete=java.io.Serializable Bar.java Foo.java
+ * @test
+ * @bug 5045412 6627366
+ * @compile -Xlint:serial -XDfailcomplete=java.io.Serializable Bar.java 
+ */
+
+/**
+ * @test
+ * @bug 5045412 6627366
+ * @compile -Xlint:serial -XDfailcomplete=java.io.Serializable Bar.java Foo.java
  */
 
 class Bar implements java.io.Serializable { }
--- a/test/tools/javac/5045412/Foo.java	Fri Jan 30 17:06:43 2009 -0800
+++ b/test/tools/javac/5045412/Foo.java	Fri Jan 30 17:06:56 2009 -0800
@@ -23,14 +23,14 @@
 
 /**
  * @test
- * @bug 5045412
+ * @bug 5045412 6627366
  * @compile -Xlint:serial -XDfailcomplete=java.io.Serializable Foo.java 
  */
 
 /**
  * @test
- * @bug 5045412
- * @compile/fail/ref=out -XDstdout -XDrawDiagnostics -Xlint:serial -XDfailcomplete=java.io.Serializable Foo.java Bar.java
+ * @bug 5045412 6627366
+ * @compile -Xlint:serial -XDfailcomplete=java.io.Serializable Foo.java Bar.java
  */
 
 class Foo { }
--- a/test/tools/javac/5045412/out	Fri Jan 30 17:06:43 2009 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-Bar.java:13:29: compiler.err.cant.resolve.location: (- compiler.misc.kindname.class), Serializable, , , (- compiler.misc.kindname.package), java.io
-1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/6176978/T6176978.java	Fri Jan 30 17:06:56 2009 -0800
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug 6176978
+ * @summary current Javadoc's invocation and extension (Doclet) mechanisms are problematic
+ * @build T6176978
+ * @run main T6176978
+ */
+
+import java.io.*;
+import java.net.*;
+
+public class T6176978 
+{
+    public static void main(String[] args) throws Exception {
+	// create and use a temp dir that will not be on jtreg's
+	// default class path
+	File tmpDir = new File("tmp");
+	tmpDir.mkdirs();
+
+	File testSrc = new File(System.getProperty("test.src", "."));
+	String[] javac_args = {
+	    "-d",
+	    "tmp",
+	    new File(testSrc, "X.java").getPath()
+	};
+
+	int rc = com.sun.tools.javac.Main.compile(javac_args);
+	if (rc != 0)
+	    throw new Error("javac exit code: " + rc);
+	
+	String[] jdoc_args = {
+	    "-doclet",
+	    "X",
+	    new File(testSrc, "T6176978.java").getPath()
+	};
+
+	rc = com.sun.tools.javadoc.Main.execute(jdoc_args);
+	if (rc == 0)
+	    throw new Error("javadoc unexpectedly succeeded");
+
+	
+
+	Thread currThread = Thread.currentThread();
+	ClassLoader saveClassLoader = currThread.getContextClassLoader();
+	URLClassLoader urlCL = new URLClassLoader(new URL[] { tmpDir.toURL() });
+	currThread.setContextClassLoader(urlCL);
+
+	try {
+	    rc = com.sun.tools.javadoc.Main.execute(jdoc_args);
+	    if (rc != 0)
+		throw new Error("javadoc exit: " + rc);
+	} 
+	finally {
+	    currThread.setContextClassLoader(saveClassLoader);
+	}
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/6176978/X.java	Fri Jan 30 17:06:56 2009 -0800
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+import com.sun.javadoc.*;
+
+public class X {
+    public static boolean start(RootDoc root) {
+	System.out.println("X.start");
+        return true;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/6627362/T6627362.java	Fri Jan 30 17:06:56 2009 -0800
@@ -0,0 +1,133 @@
+/*
+ * Copyright 2007 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug 6627362 
+ * @summary javac generates code that uses array.clone, 
+ *          which is not available on JavaCard
+ */
+
+import java.io.*;
+import java.lang.reflect.*;
+import java.net.*;
+import java.util.*;
+
+public class T6627362 {
+    static String testSrc = System.getProperty("test.src", ".");
+
+    public static void main(String... args) throws Exception {
+	new T6627362().run();
+    }
+
+    public void run() throws Exception {
+	testStandard();
+	testNoClone();
+	if (errors > 0)
+	    throw new Error(errors + " test cases failed");
+    }
+
+    void testStandard() throws Exception {
+	// compile and disassemble E.java, check for reference to Object.clone()
+	File x = new File(testSrc, "x");
+	String[] jcArgs = { "-d", ".", 
+			    new File(x, "E.java").getPath() };
+	compile(jcArgs);
+
+	String[] jpArgs = { "-classpath", ".", "-c", "E" };
+
+	StringWriter sw = new StringWriter();
+	javap(new PrintWriter(sw, true), jpArgs);
+	check(sw.toString(), "Method \"[LE;\".clone:()Ljava/lang/Object;");
+	callValues();
+    }
+
+    void testNoClone() throws Exception {
+	// compile and disassemble E.java, using modified Object.java,
+	// check for reference to System.arraycopy
+	File x = new File(testSrc, "x");
+	String[] jcArgs = { "-d", ".", 
+			    new File(x, "E.java").getPath(),
+			    new File(x, "Object.java").getPath()};
+	compile(jcArgs);
+
+	String[] jpArgs = { "-classpath", ".", "-c", "E" };
+
+	StringWriter sw = new StringWriter();
+	javap(new PrintWriter(sw, true), jpArgs);
+	check(sw.toString(), "//Method java/lang/System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V");
+	callValues();
+    }
+
+    void compile(String... args) {
+	int rc = com.sun.tools.javac.Main.compile(args);
+	if (rc != 0)
+	    throw new Error("javac failed: " + Arrays.asList(args) + ": " + rc);
+    }
+
+    void javap(PrintWriter out, String... args) throws Exception {
+	// for now, we have to exec javap
+	File javaHome = new File(System.getProperty("java.home"));
+	if (javaHome.getName().equals("jre"))
+	    javaHome = javaHome.getParentFile();
+	File javap = new File(new File(javaHome, "bin"), "javap");
+	String[] cmd = new String[args.length + 1];
+	cmd[0] = javap.getPath();
+	System.arraycopy(args, 0, cmd, 1, args.length);
+	Process p = new ProcessBuilder(cmd).redirectErrorStream(true).start();
+	p.getOutputStream().close();
+	BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
+       	String line;
+	while ((line = in.readLine()) != null)
+	    out.println(line);
+	int rc = p.waitFor();
+	if (rc != 0)
+	    throw new Error("javap failed: " + Arrays.asList(args) + ": " + rc);
+    }
+
+    void check(String s, String require) {
+	if (s.indexOf(require) == -1) {
+	    System.err.println("Can't find " + require);
+	    errors++;
+	}
+    }
+
+    void callValues() {
+	try {
+	    File dot = new File(System.getProperty("user.dir"));
+	    ClassLoader cl = new URLClassLoader(new URL[] { dot.toURL() });
+	    Class<?> e_class = cl.loadClass("E");
+	    Method m = e_class.getMethod("values", new Class[] { });
+	    //System.err.println(m);
+	    Object o = m.invoke(null, (Object[]) null);
+	    List<Object> v = Arrays.asList((Object[]) o);
+	    if (!v.toString().equals("[a, b, c]"))
+		throw new Error("unexpected result for E.values(): " + v);
+	} catch (Exception e) {
+	    throw new Error(e);
+	}
+    }
+
+    int errors;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/6627362/x/E.java	Fri Jan 30 17:06:56 2009 -0800
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2007 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+public enum E {
+    a, b, c
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/6627362/x/Object.java	Fri Jan 30 17:06:56 2009 -0800
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2007 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang;
+
+/*
+ * Object, without clone()
+ */
+public class Object {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/staticImport/6665223/T6665223.java	Fri Jan 30 17:06:56 2009 -0800
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug 6665223
+ * @summary Static import of inherited protected method causes compiler exception
+ * @author Maurizio Cimadamore
+ *
+ * @compile pkg/A.java
+ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/staticImport/6665223/pkg/A.java	Fri Jan 30 17:06:56 2009 -0800
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package pkg;
+
+import static pkg.B.b;
+
+class A {
+    public static void main(String[] args) {
+        b();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/staticImport/6665223/pkg/B.java	Fri Jan 30 17:06:56 2009 -0800
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package pkg;
+
+class B extends B2 {}
+
+abstract class B2 {
+    protected static void b() {}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/synthesize/Boolean.java	Fri Jan 30 17:06:56 2009 -0800
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2007 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang;
+
+public class Boolean
+{
+    public static Boolean valueOf(boolean v) {
+	return new Boolean(v);
+    }
+
+    public Boolean(boolean v) {
+	value = v;
+    }
+
+    public boolean booleanValue() {
+	return value;
+    }
+
+    private boolean value;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/synthesize/Byte.java	Fri Jan 30 17:06:56 2009 -0800
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2007 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang;
+
+public class Byte
+{
+    public static Byte valueOf(byte v) {
+	return new Byte(v);
+    }
+
+    public Byte(byte v) {
+	value = v;
+    }
+
+    public byte byteValue() {
+	return value;
+    }
+
+    private byte value;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/synthesize/Character.java	Fri Jan 30 17:06:56 2009 -0800
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2007 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang;
+
+public class Character
+{
+    public static Character valueOf(char v) {
+	return new Character(v);
+    }
+
+    public Character(char v) {
+	value = v;
+    }
+
+    public char characterValue() {
+	return value;
+    }
+
+    private char value;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/synthesize/Cloneable.java	Fri Jan 30 17:06:56 2009 -0800
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2007 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang;
+
+public interface Cloneable {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/synthesize/Double.java	Fri Jan 30 17:06:56 2009 -0800
@@ -0,0 +1,18 @@
+package java.lang;
+
+public class Double extends Number
+{
+    public static Double valueOf(double v) {
+	return new Double(v);
+    }
+
+    public Double(double v) {
+	value = v;
+    }
+
+    public double doubleValue() {
+	return value;
+    }
+
+    private double value;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/synthesize/Float.java	Fri Jan 30 17:06:56 2009 -0800
@@ -0,0 +1,18 @@
+package java.lang;
+
+public class Float extends Number
+{
+    public static Float valueOf(float v) {
+	return new Float(v);
+    }
+
+    public Float(float v) {
+	value = v;
+    }
+
+    public float floatValue() {
+	return value;
+    }
+
+    private float value;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/synthesize/Integer.java	Fri Jan 30 17:06:56 2009 -0800
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2007 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang;
+
+public class Integer extends Number
+{
+    public static Integer valueOf(int v) {
+	return new Integer(v);
+    }
+
+    public Integer(int v) {
+	value = v;
+    }
+
+    public int integerValue() {
+	return value;
+    }
+
+    private int value;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/synthesize/Long.java	Fri Jan 30 17:06:56 2009 -0800
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2007 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang;
+
+public class Long extends Number
+{
+    public static Long valueOf(long v) {
+	return new Long(v);
+    }
+
+    public Long(long v) {
+	value = v;
+    }
+
+    public long longValue() {
+	return value;
+    }
+
+    private long value;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/synthesize/Main.java	Fri Jan 30 17:06:56 2009 -0800
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2007 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug 6627364 6627366
+ * @summary Synthesize important classes if they are missing from the (boot)classpath
+ */
+
+import java.io.*;
+import java.util.*;
+
+public class Main
+{
+    File testSrc = new File(System.getProperty("test.src"));
+
+    public static void main(String[] args) throws Exception {
+	new Main().run();
+    }
+
+    public void run() throws Exception {
+
+	// compile with standard bootclasspath
+	compile(true, "Test.java");
+
+	// compile with various missing system classes
+
+	List<String> base_files = Arrays.asList(
+	    "Boolean.java",
+	    "Byte.java",
+	    "Character.java",
+	    "Integer.java",
+	    "Long.java",
+	    "Number.java",
+	    "Object.java",
+	    "Short.java",
+	    "Void.java"
+	);
+
+	List<String> extra_files = Arrays.asList(
+	    "Double.java",
+	    "Float.java",
+	    "Cloneable.java",
+	    "Serializable.java"
+	);
+
+	List<String> files = new ArrayList<String>();
+	files.addAll(base_files);
+	files.add("Test.java");
+	
+	compile(false, files);
+
+	for (String f: extra_files) {
+	    files = new ArrayList<String>();
+	    files.addAll(base_files);
+	    files.addAll(extra_files);
+	    files.remove(f);
+	    files.add("Test.java");
+	    compile(false, files);
+	}
+
+	if (errors > 0)
+	    throw new Exception(errors + " errors occurred");
+    }
+
+    void compile(boolean stdBootClassPath, String... files) {
+	compile(stdBootClassPath, Arrays.asList(files));
+    }
+
+    void compile(boolean stdBootClassPath, List<String> files) {
+	File empty = new File("empty");
+	empty.mkdirs();
+	
+	List<String> args = new ArrayList<String>();
+	args.add("-classpath");
+	args.add("empty");
+
+	if (!stdBootClassPath) {
+	    args.add("-bootclasspath");
+	    args.add("empty");
+	}
+	args.add("-d");
+	args.add(".");
+	for (String f: files)
+	    args.add(new File(testSrc, f).getPath());
+	    
+	System.out.println("Compile: " + args);
+	StringWriter out = new StringWriter();
+	int rc = com.sun.tools.javac.Main.compile(args.toArray(new String[args.size()]), 
+						  new PrintWriter(out));
+	System.out.println(out.toString());
+	System.out.println("result: " + rc);
+	System.out.println();
+
+	if (rc != 0)
+	    errors++;
+    }
+
+    private int errors;
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/synthesize/Number.java	Fri Jan 30 17:06:56 2009 -0800
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2007 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang;
+
+public class Number
+{
+    
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/synthesize/Object.java	Fri Jan 30 17:06:56 2009 -0800
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2007 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang;
+
+public class Object
+{
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/synthesize/Serializable.java	Fri Jan 30 17:06:56 2009 -0800
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2007 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.io;
+
+public interface Serializable {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/synthesize/Short.java	Fri Jan 30 17:06:56 2009 -0800
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2007 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang;
+
+public class Short extends Number
+{
+    public static Short valueOf(short v) {
+	return new Short(v);
+    }
+
+    public Short(short v) {
+	value = v;
+    }
+
+    public short shortValue() {
+	return value;
+    }
+
+    private short value;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/synthesize/Test.java	Fri Jan 30 17:06:56 2009 -0800
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2007 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+// This code (indirectly) requires the presence of
+// Cloneable and Serializable (supertypes for Java arrays)
+// Double and Float (for boxing/unboxing)
+public class Test
+{
+    Object f(boolean b, int[] array) {
+	return b ? array : 2;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/synthesize/Void.java	Fri Jan 30 17:06:56 2009 -0800
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2007 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang;
+
+public class Void
+{
+    
+}