From 15c44f54ccd7cc4502d12b79e6f91074e4e916bc Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Tue, 28 Nov 2017 00:59:37 +0100 Subject: JDK9 support for delombok (and thus, for running the tests under JDK9). --- src/stubs/com/sun/tools/javac/code/Symbol.java | 85 ++++++++++++++++++++++++++ src/stubs/com/sun/tools/javac/code/Symtab.java | 20 ++++++ 2 files changed, 105 insertions(+) create mode 100644 src/stubs/com/sun/tools/javac/code/Symbol.java create mode 100644 src/stubs/com/sun/tools/javac/code/Symtab.java (limited to 'src/stubs/com/sun/tools/javac/code') diff --git a/src/stubs/com/sun/tools/javac/code/Symbol.java b/src/stubs/com/sun/tools/javac/code/Symbol.java new file mode 100644 index 00000000..abe6c5eb --- /dev/null +++ b/src/stubs/com/sun/tools/javac/code/Symbol.java @@ -0,0 +1,85 @@ +/* + * These are stub versions of various bits of javac-internal API (for various different versions of javac). Lombok is compiled against these. + */ +package com.sun.tools.javac.code; + +import java.lang.annotation.Annotation; +import java.util.List; +import java.util.Set; + +import javax.lang.model.element.AnnotationValue; +import javax.lang.model.element.Element; +import javax.lang.model.element.ElementKind; +import javax.lang.model.element.ElementVisitor; +import javax.lang.model.element.ExecutableElement; +import javax.lang.model.element.Modifier; +import javax.lang.model.element.NestingKind; +import javax.lang.model.element.TypeElement; +import javax.lang.model.element.TypeParameterElement; +import javax.lang.model.element.VariableElement; +import javax.lang.model.type.TypeMirror; + +import com.sun.tools.javac.util.Name; + +public abstract class Symbol implements Element { + public Type type; + public Name name; + + public long flags() { return 0; } + public boolean isStatic() { return false; } + public boolean isConstructor() { return false; } + public boolean isLocal() { return false; } + public Name flatName() { return null; } + public Name getQualifiedName() { return null; } + public A[] getAnnotationsByType(Class annoType) { return null; } + @Override public List getAnnotationMirrors() { return null; } + @Override public TypeMirror asType() { return null; } + public A getAnnotation(Class annoType) { return null; } + @Override public Name getSimpleName() { return null; } + @Override public List getEnclosedElements() { return null; } + @Override public Element getEnclosingElement() { return null; } + + public static abstract class TypeSymbol extends Symbol {} + + public static class MethodSymbol extends Symbol implements ExecutableElement { + public MethodSymbol(long flags, Name name, Type type, Symbol owner) {} + @Override public ElementKind getKind() { return null; } + @Override public Set getModifiers() { return null; } + @Override public R accept(ElementVisitor v, P p) { return null; } + @Override public List getTypeParameters() { return null; } + @Override public TypeMirror getReturnType() { return null; } + @Override public List getParameters() { return null; } + @Override public boolean isVarArgs() { return false; } + @Override public List getThrownTypes() { return null; } + @Override public AnnotationValue getDefaultValue() { return null; } + public TypeMirror getReceiverType() { return null; } + public boolean isDefault() { return false; } + public List params() { return null; } + } + + public static class VarSymbol extends Symbol implements VariableElement { + public Type type; + @Override public ElementKind getKind() { return null; } + @Override public Set getModifiers() { return null; } + @Override public R accept(ElementVisitor v, P p) { return null; } + @Override public Object getConstantValue() { return null; } + } + + public static class ClassSymbol extends TypeSymbol implements TypeElement { + @Override public Name getQualifiedName() { return null; } + @Override public List getInterfaces() { return null; } + @Override public TypeMirror getSuperclass() { return null; } + @Override public ElementKind getKind() { return null; } + @Override public Set getModifiers() { return null; } + @Override public NestingKind getNestingKind() { return null; } + @Override public R accept(ElementVisitor v, P p) { return null; } + @Override public List getTypeParameters() { return null; } + } + + // JDK9 + public static class ModuleSymbol extends TypeSymbol { + @Override public ElementKind getKind() { return null; } + @Override public Set getModifiers() { return null; } + @Override public R accept(ElementVisitor v, P p) { return null; } + } +} diff --git a/src/stubs/com/sun/tools/javac/code/Symtab.java b/src/stubs/com/sun/tools/javac/code/Symtab.java new file mode 100644 index 00000000..2b524e4c --- /dev/null +++ b/src/stubs/com/sun/tools/javac/code/Symtab.java @@ -0,0 +1,20 @@ +/* + * These are stub versions of various bits of javac-internal API (for various different versions of javac). Lombok is compiled against these. + */ +package com.sun.tools.javac.code; + +import com.sun.tools.javac.code.Symbol.ClassSymbol; +import com.sun.tools.javac.code.Symbol.ModuleSymbol; +import com.sun.tools.javac.util.Context; + +public class Symtab { + // Shared by JDK6-9 + public ClassSymbol methodClass; + public Type iterableType; + public Type objectType; + public static Symtab instance(Context context) {return null;} + public Type unknownType; + + // JDK 9 + public ModuleSymbol unnamedModule; +} -- cgit