-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge "Stubs required for javac to compile lambda code"
- Loading branch information
Showing
9 changed files
with
546 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* 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 | ||
* under the terms of the GNU General Public License version 2 only, as | ||
* published by the Free Software Foundation. Oracle designates this | ||
* particular file as subject to the "Classpath" exception as provided | ||
* by Oracle in the LICENSE file that accompanied this code. | ||
* | ||
* 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. | ||
*/ | ||
|
||
package java.lang.invoke; | ||
|
||
abstract | ||
public class CallSite { | ||
|
||
public MethodType type() { return null; } | ||
|
||
public abstract MethodHandle getTarget(); | ||
|
||
public abstract void setTarget(MethodHandle newTarget); | ||
|
||
public abstract MethodHandle dynamicInvoker(); | ||
|
||
} |
76 changes: 76 additions & 0 deletions
76
ojluni/src/lambda/java/java/lang/invoke/LambdaConversionException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
* Copyright (c) 2012, 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. Oracle designates this | ||
* particular file as subject to the "Classpath" exception as provided | ||
* by Oracle in the LICENSE file that accompanied this code. | ||
* | ||
* 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. | ||
*/ | ||
|
||
package java.lang.invoke; | ||
|
||
/** | ||
* LambdaConversionException | ||
*/ | ||
public class LambdaConversionException extends Exception { | ||
private static final long serialVersionUID = 292L + 8L; | ||
|
||
/** | ||
* Constructs a {@code LambdaConversionException}. | ||
*/ | ||
public LambdaConversionException() { | ||
} | ||
|
||
/** | ||
* Constructs a {@code LambdaConversionException} with a message. | ||
* @param message the detail message | ||
*/ | ||
public LambdaConversionException(String message) { | ||
super(message); | ||
} | ||
|
||
/** | ||
* Constructs a {@code LambdaConversionException} with a message and cause. | ||
* @param message the detail message | ||
* @param cause the cause | ||
*/ | ||
public LambdaConversionException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
|
||
/** | ||
* Constructs a {@code LambdaConversionException} with a cause. | ||
* @param cause the cause | ||
*/ | ||
public LambdaConversionException(Throwable cause) { | ||
super(cause); | ||
} | ||
|
||
/** | ||
* Constructs a {@code LambdaConversionException} with a message, | ||
* cause, and other settings. | ||
* @param message the detail message | ||
* @param cause the cause | ||
* @param enableSuppression whether or not suppressed exceptions are enabled | ||
* @param writableStackTrace whether or not the stack trace is writable | ||
*/ | ||
public LambdaConversionException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { | ||
super(message, cause, enableSuppression, writableStackTrace); | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
ojluni/src/lambda/java/java/lang/invoke/LambdaMetafactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright (c) 2012, 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. Oracle designates this | ||
* particular file as subject to the "Classpath" exception as provided | ||
* by Oracle in the LICENSE file that accompanied this code. | ||
* | ||
* 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. | ||
*/ | ||
|
||
package java.lang.invoke; | ||
|
||
public class LambdaMetafactory { | ||
|
||
public static final int FLAG_SERIALIZABLE = 1 << 0; | ||
|
||
public static final int FLAG_MARKERS = 1 << 1; | ||
|
||
public static final int FLAG_BRIDGES = 1 << 2; | ||
|
||
public static CallSite metafactory(MethodHandles.Lookup caller, | ||
String invokedName, | ||
MethodType invokedType, | ||
MethodType samMethodType, | ||
MethodHandle implMethod, | ||
MethodType instantiatedMethodType) | ||
throws LambdaConversionException { return null; } | ||
|
||
public static CallSite altMetafactory(MethodHandles.Lookup caller, | ||
String invokedName, | ||
MethodType invokedType, | ||
Object... args) | ||
throws LambdaConversionException { return null; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* 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 | ||
* under the terms of the GNU General Public License version 2 only, as | ||
* published by the Free Software Foundation. Oracle designates this | ||
* particular file as subject to the "Classpath" exception as provided | ||
* by Oracle in the LICENSE file that accompanied this code. | ||
* | ||
* 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. | ||
*/ | ||
|
||
package java.lang.invoke; | ||
|
||
public abstract class MethodHandle { | ||
|
||
public MethodType type() { return null; } | ||
|
||
public final Object invokeExact(Object... args) throws Throwable { return null; } | ||
|
||
public final Object invoke(Object... args) throws Throwable { return null; } | ||
|
||
public Object invokeWithArguments(Object... arguments) throws Throwable { return null; } | ||
|
||
public Object invokeWithArguments(java.util.List<?> arguments) throws Throwable { return null; } | ||
|
||
public MethodHandle asType(MethodType newType) { return null; } | ||
|
||
public MethodHandle asCollector(Class<?> arrayType, int arrayLength) { return null; } | ||
|
||
public MethodHandle asVarargsCollector(Class<?> arrayType) { return null; } | ||
|
||
public boolean isVarargsCollector() { return false; } | ||
|
||
public MethodHandle asFixedArity() { return null; } | ||
|
||
public MethodHandle bindTo(Object x) { return null; } | ||
|
||
} |
62 changes: 62 additions & 0 deletions
62
ojluni/src/lambda/java/java/lang/invoke/MethodHandleInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright (c) 2012, 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. Oracle designates this | ||
* particular file as subject to the "Classpath" exception as provided | ||
* by Oracle in the LICENSE file that accompanied this code. | ||
* | ||
* 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. | ||
*/ | ||
|
||
package java.lang.invoke; | ||
|
||
import java.lang.invoke.MethodHandles.Lookup; | ||
import java.lang.reflect.Member; | ||
|
||
public | ||
interface MethodHandleInfo { | ||
public static final int REF_getField = 0; | ||
public static final int REF_getStatic = 0; | ||
public static final int REF_putField = 0; | ||
public static final int REF_putStatic = 0; | ||
public static final int REF_invokeVirtual = 0; | ||
public static final int REF_invokeStatic = 0; | ||
public static final int REF_invokeSpecial = 0; | ||
public static final int REF_newInvokeSpecial = 0; | ||
public static final int REF_invokeInterface = 0; | ||
|
||
public int getReferenceKind(); | ||
|
||
public Class<?> getDeclaringClass(); | ||
|
||
public String getName(); | ||
|
||
public MethodType getMethodType(); | ||
|
||
public <T extends Member> T reflectAs(Class<T> expected, Lookup lookup); | ||
|
||
public int getModifiers(); | ||
|
||
public default boolean isVarArgs() { return false; } | ||
|
||
public static String referenceKindToString(int referenceKind) { return null; } | ||
|
||
public static String toString(int kind, Class<?> defc, String name, MethodType type) { | ||
return null; | ||
} | ||
} |
Oops, something went wrong.