diff --git a/JCL/converterJclMin26/.classpath b/JCL/converterJclMin26/.classpath new file mode 100644 index 00000000000..50dd1403d80 --- /dev/null +++ b/JCL/converterJclMin26/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/JCL/converterJclMin26/.project b/JCL/converterJclMin26/.project new file mode 100644 index 00000000000..bd369d509ec --- /dev/null +++ b/JCL/converterJclMin26/.project @@ -0,0 +1,17 @@ + + + converterjclMin26 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/JCL/converterJclMin26/.settings/org.eclipse.core.resources.prefs b/JCL/converterJclMin26/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000000..99f26c0203a --- /dev/null +++ b/JCL/converterJclMin26/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/JCL/converterJclMin26/.settings/org.eclipse.jdt.core.prefs b/JCL/converterJclMin26/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..4cbcf1f0117 --- /dev/null +++ b/JCL/converterJclMin26/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=26 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=26 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=enabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=26 diff --git a/JCL/converterJclMin26/src/java/io/InputStream.java b/JCL/converterJclMin26/src/java/io/InputStream.java new file mode 100644 index 00000000000..36e7c43aa66 --- /dev/null +++ b/JCL/converterJclMin26/src/java/io/InputStream.java @@ -0,0 +1,5 @@ +package java.io; + +public class InputStream implements AutoCloseable { + public void close() {} +} diff --git a/JCL/converterJclMin26/src/java/io/PrintStream.java b/JCL/converterJclMin26/src/java/io/PrintStream.java new file mode 100644 index 00000000000..19059381a2f --- /dev/null +++ b/JCL/converterJclMin26/src/java/io/PrintStream.java @@ -0,0 +1,8 @@ +package java.io; + +public class PrintStream { + public void println(String x) { + } + public void println(int x) { + } +} diff --git a/JCL/converterJclMin26/src/java/io/Serializable.java b/JCL/converterJclMin26/src/java/io/Serializable.java new file mode 100644 index 00000000000..3629567396a --- /dev/null +++ b/JCL/converterJclMin26/src/java/io/Serializable.java @@ -0,0 +1,4 @@ +package java.io; + +public interface Serializable { +} diff --git a/JCL/converterJclMin26/src/java/lang/AssertionError.java b/JCL/converterJclMin26/src/java/lang/AssertionError.java new file mode 100644 index 00000000000..c2032d58df8 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/AssertionError.java @@ -0,0 +1,18 @@ +package java.lang; + +public class AssertionError extends Error { + + static final long serialVersionUID = 1L; + + public AssertionError(java.lang.String s) { + super(s); + } + + public AssertionError(java.lang.String s, java.lang.Throwable cause) { + super(s, cause); + } + + public AssertionError() { + } + +} diff --git a/JCL/converterJclMin26/src/java/lang/AutoCloseable.java b/JCL/converterJclMin26/src/java/lang/AutoCloseable.java new file mode 100644 index 00000000000..46c293d3be9 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/AutoCloseable.java @@ -0,0 +1,4 @@ +package java.lang; +public interface AutoCloseable { + void close() throws Exception; +} \ No newline at end of file diff --git a/JCL/converterJclMin26/src/java/lang/CharSequence.java b/JCL/converterJclMin26/src/java/lang/CharSequence.java new file mode 100644 index 00000000000..b03fc9e823b --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/CharSequence.java @@ -0,0 +1,5 @@ +package java.lang; + +public interface CharSequence { + int length(); +} diff --git a/JCL/converterJclMin26/src/java/lang/Class.java b/JCL/converterJclMin26/src/java/lang/Class.java new file mode 100644 index 00000000000..7d08bf1f389 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/Class.java @@ -0,0 +1,4 @@ +package java.lang; + +public class Class { +} diff --git a/JCL/converterJclMin26/src/java/lang/ClassNotFoundException.java b/JCL/converterJclMin26/src/java/lang/ClassNotFoundException.java new file mode 100644 index 00000000000..7765ed820ae --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/ClassNotFoundException.java @@ -0,0 +1,20 @@ +package java.lang; + +public class ClassNotFoundException extends ReflectiveOperationException { + + public ClassNotFoundException() { + super((Throwable)null); // Disallow initCause + } + + public ClassNotFoundException(String s) { + super(s, null); // Disallow initCause + } + + public ClassNotFoundException(String s, Throwable ex) { + super(s, ex); // Disallow initCause + } + + public Throwable getException() { + return getCause(); + } +} \ No newline at end of file diff --git a/JCL/converterJclMin26/src/java/lang/CloneNotSupportedException.java b/JCL/converterJclMin26/src/java/lang/CloneNotSupportedException.java new file mode 100644 index 00000000000..6f05a932fab --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/CloneNotSupportedException.java @@ -0,0 +1,4 @@ +package java.lang; + +public class CloneNotSupportedException extends Exception { +} diff --git a/JCL/converterJclMin26/src/java/lang/Comparable.java b/JCL/converterJclMin26/src/java/lang/Comparable.java new file mode 100644 index 00000000000..59fb9eddd47 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/Comparable.java @@ -0,0 +1,4 @@ +package java.lang; + +public interface Comparable { +} diff --git a/JCL/converterJclMin26/src/java/lang/Deprecated.java b/JCL/converterJclMin26/src/java/lang/Deprecated.java new file mode 100644 index 00000000000..5226e586c7e --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/Deprecated.java @@ -0,0 +1,6 @@ +package java.lang; +import java.lang.annotation.*; +@Documented +@Retention(RetentionPolicy.RUNTIME) +public @interface Deprecated { +} \ No newline at end of file diff --git a/JCL/converterJclMin26/src/java/lang/Double.java b/JCL/converterJclMin26/src/java/lang/Double.java new file mode 100644 index 00000000000..9fb37fdafb9 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/Double.java @@ -0,0 +1,4 @@ +package java.lang; +public final class Double extends Number{ +} + diff --git a/JCL/converterJclMin26/src/java/lang/Enum.java b/JCL/converterJclMin26/src/java/lang/Enum.java new file mode 100644 index 00000000000..f68f11eacec --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/Enum.java @@ -0,0 +1,18 @@ +package java.lang; + +public abstract class Enum> implements Comparable, java.io.Serializable { + private static final long serialVersionUID = 2L; + + protected Enum(String name, int ordinal) { + } + public final String name() { + return null; + } + public final int ordinal() { + return 0; + } + public static > T valueOf(Class enumClass, + String name) { + return null; + } +} diff --git a/JCL/converterJclMin26/src/java/lang/Error.java b/JCL/converterJclMin26/src/java/lang/Error.java new file mode 100644 index 00000000000..e1d484680e9 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/Error.java @@ -0,0 +1,13 @@ +package java.lang; + +public class Error extends Throwable { + + public Error(java.lang.String s) { + } + + public Error(java.lang.String s, java.lang.Throwable cause) { + } + + public Error() { + } +} diff --git a/JCL/converterJclMin26/src/java/lang/Exception.java b/JCL/converterJclMin26/src/java/lang/Exception.java new file mode 100644 index 00000000000..88b222a9c06 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/Exception.java @@ -0,0 +1,19 @@ +package java.lang; + +public class Exception extends Throwable { + public Exception() { + super(); + } + + public Exception(String message) { + super(message); + } + + public Exception(String message, Throwable cause) { + super(message, cause); + } + + public Exception(Throwable cause) { + super(cause); + } +} diff --git a/JCL/converterJclMin26/src/java/lang/Float.java b/JCL/converterJclMin26/src/java/lang/Float.java new file mode 100644 index 00000000000..648d9cca645 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/Float.java @@ -0,0 +1,4 @@ +package java.lang; +public final class Float extends Number{ +} + diff --git a/JCL/converterJclMin26/src/java/lang/IllegalAccessException.java b/JCL/converterJclMin26/src/java/lang/IllegalAccessException.java new file mode 100644 index 00000000000..0d13e1e0571 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/IllegalAccessException.java @@ -0,0 +1,5 @@ +package java.lang; + +public class IllegalAccessException extends RuntimeException { + +} diff --git a/JCL/converterJclMin26/src/java/lang/IllegalMonitorStateException.java b/JCL/converterJclMin26/src/java/lang/IllegalMonitorStateException.java new file mode 100644 index 00000000000..1f67418128c --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/IllegalMonitorStateException.java @@ -0,0 +1,4 @@ +package java.lang; + +public class IllegalMonitorStateException extends RuntimeException { +} diff --git a/JCL/converterJclMin26/src/java/lang/IncompatibleClassChangeError.java b/JCL/converterJclMin26/src/java/lang/IncompatibleClassChangeError.java new file mode 100644 index 00000000000..5eade81ee5d --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/IncompatibleClassChangeError.java @@ -0,0 +1,15 @@ + +package java.lang; +public +class IncompatibleClassChangeError extends LinkageError { + + static final long serialVersionUID = 1L; + + public IncompatibleClassChangeError () { + super(); + } + + public IncompatibleClassChangeError(String s) { + super(s); + } +} diff --git a/JCL/converterJclMin26/src/java/lang/Integer.java b/JCL/converterJclMin26/src/java/lang/Integer.java new file mode 100644 index 00000000000..dd8c51c9147 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/Integer.java @@ -0,0 +1,49 @@ +package java.lang; + +public class Integer extends Number implements Comparable { + private static final long serialVersionUID = 6462609062775655000L; + + public Integer(int i) { + } + public Integer(String s) { + } + public static final int MAX_VALUE= 2147483647; + public static final int MIN_VALUE= -2147483647; + + public static int parseInt(String s) { + return 0; + } + public static String toHexString(int i) { + return null; + } + public static String toString(int i) { + return null; + } + /* (non-Javadoc) + * @see java.lang.Number#doubleValue() + */ + public double doubleValue() { + return 0; + } + /* (non-Javadoc) + * @see java.lang.Number#floatValue() + */ + public float floatValue() { + return 0; + } + /* (non-Javadoc) + * @see java.lang.Number#intValue() + */ + public int intValue() { + return 0; + } + /* (non-Javadoc) + * @see java.lang.Number#longValue() + */ + public long longValue() { + return 0; + } + public int compareTo(Integer i) { + return 0; + } +} diff --git a/JCL/converterJclMin26/src/java/lang/InterruptedException.java b/JCL/converterJclMin26/src/java/lang/InterruptedException.java new file mode 100644 index 00000000000..93b236c4210 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/InterruptedException.java @@ -0,0 +1,4 @@ +package java.lang; + +public class InterruptedException extends Exception { +} diff --git a/JCL/converterJclMin26/src/java/lang/Iterable.java b/JCL/converterJclMin26/src/java/lang/Iterable.java new file mode 100644 index 00000000000..ab4b9d53f69 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/Iterable.java @@ -0,0 +1,10 @@ +package java.lang; + +import java.util.Iterator; +import java.util.function.Consumer; + +public interface Iterable { + Iterator iterator(); + default void forEach(Consumer action) { + } +} diff --git a/JCL/converterJclMin26/src/java/lang/LinkageError.java b/JCL/converterJclMin26/src/java/lang/LinkageError.java new file mode 100644 index 00000000000..4b67491c0c4 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/LinkageError.java @@ -0,0 +1,19 @@ +package java.lang; + +public +class LinkageError extends Error { + + static final long serialVersionUID = 1L; + + public LinkageError() { + super(); + } + + public LinkageError(String s) { + super(s); + } + + public LinkageError(String s, Throwable cause) { + super(s, cause); + } +} diff --git a/JCL/converterJclMin26/src/java/lang/Long.java b/JCL/converterJclMin26/src/java/lang/Long.java new file mode 100644 index 00000000000..888bafa2aca --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/Long.java @@ -0,0 +1,3 @@ +package java.lang; +public final class Long extends Number{ +} diff --git a/JCL/converterJclMin26/src/java/lang/NoClassDefFoundError.java b/JCL/converterJclMin26/src/java/lang/NoClassDefFoundError.java new file mode 100644 index 00000000000..068a148970b --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/NoClassDefFoundError.java @@ -0,0 +1,15 @@ +package java.lang; + +public +class NoClassDefFoundError extends LinkageError { + + static final long serialVersionUID = 1L; + + public NoClassDefFoundError() { + super(); + } + + public NoClassDefFoundError(String s) { + super(s); + } +} diff --git a/JCL/converterJclMin26/src/java/lang/NoSuchFieldError.java b/JCL/converterJclMin26/src/java/lang/NoSuchFieldError.java new file mode 100644 index 00000000000..a09455e1c2c --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/NoSuchFieldError.java @@ -0,0 +1,15 @@ +package java.lang; + +public +class NoSuchFieldError extends IncompatibleClassChangeError { + + static final long serialVersionUID = 1L; + + public NoSuchFieldError() { + super(); + } + + public NoSuchFieldError(String s) { + super(s); + } +} diff --git a/JCL/converterJclMin26/src/java/lang/NoSuchMethodException.java b/JCL/converterJclMin26/src/java/lang/NoSuchMethodException.java new file mode 100644 index 00000000000..3dd142bdd33 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/NoSuchMethodException.java @@ -0,0 +1,5 @@ +package java.lang; + +public class NoSuchMethodException extends RuntimeException { + +} diff --git a/JCL/converterJclMin26/src/java/lang/NullPointerException.java b/JCL/converterJclMin26/src/java/lang/NullPointerException.java new file mode 100644 index 00000000000..5e4ffa680d5 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/NullPointerException.java @@ -0,0 +1,11 @@ +package java.lang; +public +class NullPointerException extends RuntimeException { + public NullPointerException() { + super(); + } + + public NullPointerException(String s) { + super(s); + } +} \ No newline at end of file diff --git a/JCL/converterJclMin26/src/java/lang/Number.java b/JCL/converterJclMin26/src/java/lang/Number.java new file mode 100644 index 00000000000..0fd556f3513 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/Number.java @@ -0,0 +1,4 @@ +package java.lang; + +public abstract class Number implements java.io.Serializable { +} diff --git a/JCL/converterJclMin26/src/java/lang/Object.java b/JCL/converterJclMin26/src/java/lang/Object.java new file mode 100644 index 00000000000..71ddb4ff834 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/Object.java @@ -0,0 +1,34 @@ +package java.lang; + +public class Object { + +public Object() { +} +protected Object clone() throws CloneNotSupportedException { + return null; +} +public boolean equals (Object obj) { + return false; +} +protected void finalize () throws Throwable { +} +public final Class getClass() { + return null; +} +public int hashCode() { + return -1; +} +public final void notify() throws IllegalMonitorStateException { +} +public final void notifyAll() throws IllegalMonitorStateException { +} +public String toString () { + return null; +} +public final void wait () throws IllegalMonitorStateException, InterruptedException { +} +public final void wait (long millis) throws IllegalMonitorStateException, InterruptedException { +} +public final void wait (long millis, int nanos) throws IllegalMonitorStateException, InterruptedException { +} +} diff --git a/JCL/converterJclMin26/src/java/lang/Override.java b/JCL/converterJclMin26/src/java/lang/Override.java new file mode 100644 index 00000000000..b94fa6e860a --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/Override.java @@ -0,0 +1,7 @@ +package java.lang; + +import java.lang.annotation.*; +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.SOURCE) +public @interface Override { +} diff --git a/JCL/converterJclMin26/src/java/lang/Record.java b/JCL/converterJclMin26/src/java/lang/Record.java new file mode 100644 index 00000000000..c9913367b99 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/Record.java @@ -0,0 +1,9 @@ +package java.lang; +public abstract class Record { + @Override + public abstract boolean equals(Object obj); + @Override + public abstract int hashCode(); + @Override + public abstract String toString(); +} diff --git a/JCL/converterJclMin26/src/java/lang/ReflectiveOperationException.java b/JCL/converterJclMin26/src/java/lang/ReflectiveOperationException.java new file mode 100644 index 00000000000..0860c679050 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/ReflectiveOperationException.java @@ -0,0 +1,26 @@ + +package java.lang; + +public class ReflectiveOperationException extends Exception { + static final long serialVersionUID = 123456789L; + + public ReflectiveOperationException() { + super(); + } + + public ReflectiveOperationException(String message) { + super(message); + } + + public ReflectiveOperationException(String message, Throwable cause) { + super(message, cause); + } + + public ReflectiveOperationException(Throwable cause) { + super(cause); + } + + public java.lang.Throwable getCause() { + return getCause(); + } +} diff --git a/JCL/converterJclMin26/src/java/lang/RuntimeException.java b/JCL/converterJclMin26/src/java/lang/RuntimeException.java new file mode 100644 index 00000000000..448aeb0abfd --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/RuntimeException.java @@ -0,0 +1,10 @@ +package java.lang; + +public class RuntimeException extends Exception { + + public RuntimeException(java.lang.String s) { + } + + public RuntimeException() { + } +} diff --git a/JCL/converterJclMin26/src/java/lang/String.java b/JCL/converterJclMin26/src/java/lang/String.java new file mode 100644 index 00000000000..64f759b78be --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/String.java @@ -0,0 +1,8 @@ +package java.lang; + +public class String implements CharSequence { + public int length() { return 0; } + public int codePointAt(int index) { + return 0; + } +} diff --git a/JCL/converterJclMin26/src/java/lang/StringTemplate.java b/JCL/converterJclMin26/src/java/lang/StringTemplate.java new file mode 100644 index 00000000000..b3e4c8014cb --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/StringTemplate.java @@ -0,0 +1,30 @@ +package java.lang; + +import java.util.List; + +public interface StringTemplate { + List fragments(); + + List values(); + + default String interpolate() { + return null; + } + static String interpolate(List fragments, List values) { + return null; + } + default R + process(Processor processor) throws E { + return processor.process(this); + } + + Processor STR = null; + + Processor RAW = null; + + public interface Processor { + + R process(StringTemplate stringTemplate) throws E; + } + +} diff --git a/JCL/converterJclMin26/src/java/lang/System.java b/JCL/converterJclMin26/src/java/lang/System.java new file mode 100644 index 00000000000..bf56c93aa2d --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/System.java @@ -0,0 +1,20 @@ +package java.lang; + +import java.io.InputStream; +import java.io.PrintStream; + +public final class System { + private static native void registerNatives(); + static { + registerNatives(); + } + + private System() { + } + + public static final InputStream in = null; + + public static final PrintStream out = null; + + +} diff --git a/JCL/converterJclMin26/src/java/lang/Throwable.java b/JCL/converterJclMin26/src/java/lang/Throwable.java new file mode 100644 index 00000000000..7d4adf54dda --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/Throwable.java @@ -0,0 +1,16 @@ +package java.lang; + +public class Throwable { + + public Throwable(java.lang.String message) { + } + + public Throwable() { + } + + public Throwable(java.lang.String message, Throwable cause) { + } + + public Throwable(Throwable cause) { + } +} diff --git a/JCL/converterJclMin26/src/java/lang/annotation/Annotation.java b/JCL/converterJclMin26/src/java/lang/annotation/Annotation.java new file mode 100644 index 00000000000..530c272ea43 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/annotation/Annotation.java @@ -0,0 +1,4 @@ +package java.lang.annotation; +public interface Annotation { + +} diff --git a/JCL/converterJclMin26/src/java/lang/annotation/Documented.java b/JCL/converterJclMin26/src/java/lang/annotation/Documented.java new file mode 100644 index 00000000000..840d0f454e9 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/annotation/Documented.java @@ -0,0 +1,7 @@ +package java.lang.annotation; + +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.ANNOTATION_TYPE) +public @interface Documented { +} diff --git a/JCL/converterJclMin26/src/java/lang/annotation/ElementType.java b/JCL/converterJclMin26/src/java/lang/annotation/ElementType.java new file mode 100644 index 00000000000..7b5b59578e7 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/annotation/ElementType.java @@ -0,0 +1,48 @@ +package java.lang.annotation; + +public enum ElementType { + /** Class, interface (including annotation type), or enum declaration */ + TYPE, + + /** Field declaration (includes enum constants) */ + FIELD, + + /** Method declaration */ + METHOD, + + /** Formal parameter declaration */ + PARAMETER, + + /** Constructor declaration */ + CONSTRUCTOR, + + /** Local variable declaration */ + LOCAL_VARIABLE, + + /** Annotation type declaration */ + ANNOTATION_TYPE, + + /** Package declaration */ + PACKAGE, + + /** + * Type parameter declaration + * + * @since 1.8 + */ + TYPE_PARAMETER, + + /** + * Use of a type + * + * @since 1.8 + */ + TYPE_USE, + + /** + * Module declaration. + * + * @since 9 + */ + MODULE +} diff --git a/JCL/converterJclMin26/src/java/lang/annotation/Inherited.java b/JCL/converterJclMin26/src/java/lang/annotation/Inherited.java new file mode 100644 index 00000000000..ed69c0b04e4 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/annotation/Inherited.java @@ -0,0 +1,7 @@ +package java.lang.annotation; + +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.ANNOTATION_TYPE) +public @interface Inherited { +} \ No newline at end of file diff --git a/JCL/converterJclMin26/src/java/lang/annotation/Retention.java b/JCL/converterJclMin26/src/java/lang/annotation/Retention.java new file mode 100644 index 00000000000..3896b228f57 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/annotation/Retention.java @@ -0,0 +1,10 @@ +package java.lang.annotation; + +import java.lang.annotation.Retention; + +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.ANNOTATION_TYPE) +public @interface Retention { + RetentionPolicy value(); +} \ No newline at end of file diff --git a/JCL/converterJclMin26/src/java/lang/annotation/RetentionPolicy.java b/JCL/converterJclMin26/src/java/lang/annotation/RetentionPolicy.java new file mode 100644 index 00000000000..26349b19198 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/annotation/RetentionPolicy.java @@ -0,0 +1,6 @@ +package java.lang.annotation; +public enum RetentionPolicy { + CLASS, + SOURCE, + RUNTIME +} \ No newline at end of file diff --git a/JCL/converterJclMin26/src/java/lang/annotation/Target.java b/JCL/converterJclMin26/src/java/lang/annotation/Target.java new file mode 100644 index 00000000000..c7654f5a5c7 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/annotation/Target.java @@ -0,0 +1,10 @@ +package java.lang.annotation; + +import java.lang.annotation.Target; + +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.ANNOTATION_TYPE) +public @interface Target { + ElementType[] value(); +} \ No newline at end of file diff --git a/JCL/converterJclMin26/src/java/lang/invoke/LambdaMetafactory.java b/JCL/converterJclMin26/src/java/lang/invoke/LambdaMetafactory.java new file mode 100644 index 00000000000..b8d89314345 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/invoke/LambdaMetafactory.java @@ -0,0 +1,3 @@ +package java.lang.invoke; +public class LambdaMetafactory { +} \ No newline at end of file diff --git a/JCL/converterJclMin26/src/java/lang/invoke/MethodHandle.java b/JCL/converterJclMin26/src/java/lang/invoke/MethodHandle.java new file mode 100644 index 00000000000..1fd3a66d16b --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/invoke/MethodHandle.java @@ -0,0 +1,27 @@ +package java.lang.invoke; + +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +public abstract class MethodHandle { + @Target(METHOD) + @Retention(RUNTIME) + @interface PolymorphicSignature { + } + + @PolymorphicSignature + public final native Object invoke(Object... args) throws Throwable; + + @PolymorphicSignature + public final native Object invokeExact(Object... args) throws Throwable; + + public native Object invokeWithArguments(Object... arguments) + throws Throwable; + + public native boolean isVarargsCollector(); + + public native MethodHandle asType(MethodType newType); +} diff --git a/JCL/converterJclMin26/src/java/lang/invoke/MethodHandles.java b/JCL/converterJclMin26/src/java/lang/invoke/MethodHandles.java new file mode 100644 index 00000000000..f40dc8200bc --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/invoke/MethodHandles.java @@ -0,0 +1,21 @@ +package java.lang.invoke; + +public class MethodHandles { + public static final class Lookup { + public MethodHandle findVirtual(Class refc, String name, + MethodType type) throws NoSuchMethodException, + IllegalAccessException { + return null; + } + + public MethodHandle findStatic(Class refc, String name, + MethodType type) throws NoSuchMethodException, + IllegalAccessException { + return null; + } + } + + public static Lookup lookup() { + return null; + } +} diff --git a/JCL/converterJclMin26/src/java/lang/invoke/MethodType.java b/JCL/converterJclMin26/src/java/lang/invoke/MethodType.java new file mode 100644 index 00000000000..90a46dc8fea --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/invoke/MethodType.java @@ -0,0 +1,17 @@ +package java.lang.invoke; + + +public final class MethodType { + public static MethodType methodType(Class rtype, Class ptype0, + Class... ptypes) { + return null; + } + + public static MethodType methodType(Class rtype) { + return null; + } + + public static MethodType genericMethodType(int objectArgCount) { + return null; + } +} diff --git a/JCL/converterJclMin26/src/java/lang/invoke/StringConcatFactory.java b/JCL/converterJclMin26/src/java/lang/invoke/StringConcatFactory.java new file mode 100644 index 00000000000..9f643217071 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/invoke/StringConcatFactory.java @@ -0,0 +1,4 @@ +package java.lang.invoke; + +public final class StringConcatFactory { +} diff --git a/JCL/converterJclMin26/src/java/lang/invoke/TypeDescriptor.java b/JCL/converterJclMin26/src/java/lang/invoke/TypeDescriptor.java new file mode 100644 index 00000000000..f0fd8a7886f --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/invoke/TypeDescriptor.java @@ -0,0 +1,5 @@ +package java.lang.invoke; + +public interface TypeDescriptor { + String descriptorString(); +} diff --git a/JCL/converterJclMin26/src/java/lang/runtime/ObjectMethods.java b/JCL/converterJclMin26/src/java/lang/runtime/ObjectMethods.java new file mode 100644 index 00000000000..7587fef8f00 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/runtime/ObjectMethods.java @@ -0,0 +1,14 @@ +package java.lang.runtime; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.TypeDescriptor; + +public class ObjectMethods { + public static Object bootstrap(MethodHandles.Lookup lookup, String methodName, TypeDescriptor type, + Class recordClass, + String names, + MethodHandle... getters) throws Throwable { + return null; + } +} diff --git a/JCL/converterJclMin26/src/java/lang/runtime/SwitchBootstraps.java b/JCL/converterJclMin26/src/java/lang/runtime/SwitchBootstraps.java new file mode 100644 index 00000000000..d21b7bbf20d --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/runtime/SwitchBootstraps.java @@ -0,0 +1,5 @@ +package java.lang.runtime; + +public class SwitchBootstraps { +} + diff --git a/JCL/converterJclMin26/src/java/lang/runtime/TemplateRuntime.java b/JCL/converterJclMin26/src/java/lang/runtime/TemplateRuntime.java new file mode 100644 index 00000000000..0aca5c1e2e9 --- /dev/null +++ b/JCL/converterJclMin26/src/java/lang/runtime/TemplateRuntime.java @@ -0,0 +1,5 @@ +package java.lang.runtime; + +public final class TemplateRuntime { +} + diff --git a/JCL/converterJclMin26/src/java/util/Collection.java b/JCL/converterJclMin26/src/java/util/Collection.java new file mode 100644 index 00000000000..c6fb16779ce --- /dev/null +++ b/JCL/converterJclMin26/src/java/util/Collection.java @@ -0,0 +1,9 @@ +package java.util; + +public interface Collection extends Iterable { + public Iterator iterator(); + public int size(); + public T get(int index); + public boolean addAll(Collection c); + public T[] toArray(T[] o); +} diff --git a/JCL/converterJclMin26/src/java/util/Iterator.java b/JCL/converterJclMin26/src/java/util/Iterator.java new file mode 100644 index 00000000000..ae53f8408e0 --- /dev/null +++ b/JCL/converterJclMin26/src/java/util/Iterator.java @@ -0,0 +1,7 @@ +package java.util; + +public interface Iterator { + boolean hasNext(); + E next(); + void remove(); +} diff --git a/JCL/converterJclMin26/src/java/util/List.java b/JCL/converterJclMin26/src/java/util/List.java new file mode 100644 index 00000000000..4565ccb902f --- /dev/null +++ b/JCL/converterJclMin26/src/java/util/List.java @@ -0,0 +1,4 @@ +package java.util; + +public interface List extends Collection { +} diff --git a/JCL/converterJclMin26/src/java/util/Map.java b/JCL/converterJclMin26/src/java/util/Map.java new file mode 100644 index 00000000000..f47752cfdba --- /dev/null +++ b/JCL/converterJclMin26/src/java/util/Map.java @@ -0,0 +1,5 @@ +package java.util; + +public interface Map { + +} \ No newline at end of file diff --git a/JCL/converterJclMin26/src/java/util/Set.java b/JCL/converterJclMin26/src/java/util/Set.java new file mode 100644 index 00000000000..61df69c33ff --- /dev/null +++ b/JCL/converterJclMin26/src/java/util/Set.java @@ -0,0 +1,8 @@ +package java.util; + +public interface Set extends Collection { + static Set of() { return null; } + static Set of(E e1) { return null; } + static Set of(E e1, E e2) { return null; } + static Set of(E... elements) { return null; } +} diff --git a/JCL/converterJclMin26/src/java/util/function/Consumer.java b/JCL/converterJclMin26/src/java/util/function/Consumer.java new file mode 100644 index 00000000000..dd5b3f408cb --- /dev/null +++ b/JCL/converterJclMin26/src/java/util/function/Consumer.java @@ -0,0 +1,10 @@ +package java.util.function; + +public interface Consumer { + + void accept(T t); + + default Consumer andThen(Consumer after) { + return null; + } +} diff --git a/JCL/converterJclMin26/src/javax/lang/model/SourceVersion.java b/JCL/converterJclMin26/src/javax/lang/model/SourceVersion.java new file mode 100644 index 00000000000..801335500d1 --- /dev/null +++ b/JCL/converterJclMin26/src/javax/lang/model/SourceVersion.java @@ -0,0 +1,77 @@ +package javax.lang.model; + +public enum SourceVersion { + + RELEASE_0, + + RELEASE_1, + + RELEASE_2, + + RELEASE_3, + + RELEASE_4, + + RELEASE_5, + + RELEASE_6, + + RELEASE_7, + + RELEASE_8, + RELEASE_9, + + RELEASE_10, + + RELEASE_11, + + RELEASE_12, + + RELEASE_13, + RELEASE_14, + RELEASE_15, + RELEASE_16, + RELEASE_17, + RELEASE_18, + RELEASE_19, + RELEASE_20, + RELEASE_21, + RELEASE_22, + RELEASE_23, + RELEASE_24, + RELEASE_25; + + public static SourceVersion latest() { + return RELEASE_25; + } + + private static final SourceVersion latestSupported = getLatestSupported(); + + private static SourceVersion getLatestSupported() { + return RELEASE_25; + } + + public static SourceVersion latestSupported() { + return latestSupported; + } + + public static boolean isIdentifier(CharSequence name) { + return true; + } + + public static boolean isName(CharSequence name) { + return isName(name, latest()); + } + + public static boolean isName(CharSequence name, SourceVersion version) { + return true; + } + + public static boolean isKeyword(CharSequence s) { + return isKeyword(s, latest()); + } + + public static boolean isKeyword(CharSequence s, SourceVersion version) { + return true; + } +} diff --git a/JCL/converterJclMin26/src/module-info.java b/JCL/converterJclMin26/src/module-info.java new file mode 100644 index 00000000000..51a23b131bc --- /dev/null +++ b/JCL/converterJclMin26/src/module-info.java @@ -0,0 +1,7 @@ +module java.base { + exports java.lang; + exports java.lang.annotation; + exports java.lang.invoke; + exports java.io; + exports java.util; +} \ No newline at end of file diff --git a/JCL/jclMin26/.classpath b/JCL/jclMin26/.classpath new file mode 100644 index 00000000000..50dd1403d80 --- /dev/null +++ b/JCL/jclMin26/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/JCL/jclMin26/.project b/JCL/jclMin26/.project new file mode 100644 index 00000000000..5b20c726ff6 --- /dev/null +++ b/JCL/jclMin26/.project @@ -0,0 +1,17 @@ + + + jclMin26 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/JCL/jclMin26/.settings/org.eclipse.core.resources.prefs b/JCL/jclMin26/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000000..99f26c0203a --- /dev/null +++ b/JCL/jclMin26/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/JCL/jclMin26/.settings/org.eclipse.jdt.core.prefs b/JCL/jclMin26/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..831b79b476c --- /dev/null +++ b/JCL/jclMin26/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,121 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.builder.annotationPath.allLocations=disabled +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= +org.eclipse.jdt.core.compiler.annotation.notowning=org.eclipse.jdt.annotation.NotOwning +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullable.secondary= +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled +org.eclipse.jdt.core.compiler.annotation.owning=org.eclipse.jdt.annotation.Owning +org.eclipse.jdt.core.compiler.annotation.resourceanalysis=disabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=26 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=26 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.APILeak=warning +org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated=info +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompatibleOwningContract=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.insufficientResourceAnalysis=warning +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.suppressWarningsNotFullyAnalysed=info +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled +org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLambdaParameter=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=26 diff --git a/JCL/jclMin26/src/java/io/InputStream.java b/JCL/jclMin26/src/java/io/InputStream.java new file mode 100644 index 00000000000..ff133a644a7 --- /dev/null +++ b/JCL/jclMin26/src/java/io/InputStream.java @@ -0,0 +1,5 @@ +package java.io; + +public class InputStream implements AutoCloseable { + public void close() {} +} diff --git a/JCL/jclMin26/src/java/io/PrintStream.java b/JCL/jclMin26/src/java/io/PrintStream.java new file mode 100644 index 00000000000..9d55101e70e --- /dev/null +++ b/JCL/jclMin26/src/java/io/PrintStream.java @@ -0,0 +1,8 @@ +package java.io; + +public class PrintStream { + public void println(String x) { + } + public void println(int x) { + } +} diff --git a/JCL/jclMin26/src/java/io/Serializable.java b/JCL/jclMin26/src/java/io/Serializable.java new file mode 100644 index 00000000000..edd882d7d58 --- /dev/null +++ b/JCL/jclMin26/src/java/io/Serializable.java @@ -0,0 +1,4 @@ +package java.io; + +public interface Serializable { +} diff --git a/JCL/jclMin26/src/java/lang/AssertionError.java b/JCL/jclMin26/src/java/lang/AssertionError.java new file mode 100644 index 00000000000..c2032d58df8 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/AssertionError.java @@ -0,0 +1,18 @@ +package java.lang; + +public class AssertionError extends Error { + + static final long serialVersionUID = 1L; + + public AssertionError(java.lang.String s) { + super(s); + } + + public AssertionError(java.lang.String s, java.lang.Throwable cause) { + super(s, cause); + } + + public AssertionError() { + } + +} diff --git a/JCL/jclMin26/src/java/lang/AutoCloseable.java b/JCL/jclMin26/src/java/lang/AutoCloseable.java new file mode 100644 index 00000000000..46c293d3be9 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/AutoCloseable.java @@ -0,0 +1,4 @@ +package java.lang; +public interface AutoCloseable { + void close() throws Exception; +} \ No newline at end of file diff --git a/JCL/jclMin26/src/java/lang/CharSequence.java b/JCL/jclMin26/src/java/lang/CharSequence.java new file mode 100644 index 00000000000..b9a0d9e4176 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/CharSequence.java @@ -0,0 +1,5 @@ +package java.lang; + +public interface CharSequence { + int length(); +} diff --git a/JCL/jclMin26/src/java/lang/Class.java b/JCL/jclMin26/src/java/lang/Class.java new file mode 100644 index 00000000000..a7667b98347 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/Class.java @@ -0,0 +1,4 @@ +package java.lang; + +public class Class { +} diff --git a/JCL/jclMin26/src/java/lang/ClassNotFoundException.java b/JCL/jclMin26/src/java/lang/ClassNotFoundException.java new file mode 100644 index 00000000000..56cfb2bffe6 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/ClassNotFoundException.java @@ -0,0 +1,20 @@ +package java.lang; + +public class ClassNotFoundException extends ReflectiveOperationException { + + public ClassNotFoundException() { + super((Throwable)null); // Disallow initCause + } + + public ClassNotFoundException(String s) { + super(s, null); // Disallow initCause + } + + public ClassNotFoundException(String s, Throwable ex) { + super(s, ex); // Disallow initCause + } + + public Throwable getException() { + return getCause(); + } +} \ No newline at end of file diff --git a/JCL/jclMin26/src/java/lang/CloneNotSupportedException.java b/JCL/jclMin26/src/java/lang/CloneNotSupportedException.java new file mode 100644 index 00000000000..cb777dc7bac --- /dev/null +++ b/JCL/jclMin26/src/java/lang/CloneNotSupportedException.java @@ -0,0 +1,4 @@ +package java.lang; + +public class CloneNotSupportedException extends Exception { +} diff --git a/JCL/jclMin26/src/java/lang/Comparable.java b/JCL/jclMin26/src/java/lang/Comparable.java new file mode 100644 index 00000000000..fbc6c8bac34 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/Comparable.java @@ -0,0 +1,4 @@ +package java.lang; + +public interface Comparable { +} diff --git a/JCL/jclMin26/src/java/lang/Deprecated.java b/JCL/jclMin26/src/java/lang/Deprecated.java new file mode 100644 index 00000000000..6c73dedd0d1 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/Deprecated.java @@ -0,0 +1,6 @@ +package java.lang; +import java.lang.annotation.*; +@Documented +@Retention(RetentionPolicy.RUNTIME) +public @interface Deprecated { +} \ No newline at end of file diff --git a/JCL/jclMin26/src/java/lang/Double.java b/JCL/jclMin26/src/java/lang/Double.java new file mode 100644 index 00000000000..f76fd3a0f10 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/Double.java @@ -0,0 +1,4 @@ +package java.lang; +public final class Double extends Number{ +} + diff --git a/JCL/jclMin26/src/java/lang/Enum.java b/JCL/jclMin26/src/java/lang/Enum.java new file mode 100644 index 00000000000..a510103e609 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/Enum.java @@ -0,0 +1,18 @@ +package java.lang; + +public abstract class Enum> implements Comparable, java.io.Serializable { + private static final long serialVersionUID = 2L; + + protected Enum(String name, int ordinal) { + } + public final String name() { + return null; + } + public final int ordinal() { + return 0; + } + public static > T valueOf(Class enumClass, + String name) { + return null; + } +} diff --git a/JCL/jclMin26/src/java/lang/Error.java b/JCL/jclMin26/src/java/lang/Error.java new file mode 100644 index 00000000000..9a446d53249 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/Error.java @@ -0,0 +1,16 @@ +package java.lang; + +public class Error extends Throwable { + + public Error(java.lang.String s) { + // TODO Auto-generated constructor stub + } + + public Error(java.lang.String s, java.lang.Throwable cause) { + // TODO Auto-generated constructor stub + } + + public Error() { + // TODO Auto-generated constructor stub + } +} diff --git a/JCL/jclMin26/src/java/lang/Exception.java b/JCL/jclMin26/src/java/lang/Exception.java new file mode 100644 index 00000000000..0adef36baff --- /dev/null +++ b/JCL/jclMin26/src/java/lang/Exception.java @@ -0,0 +1,19 @@ +package java.lang; + +public class Exception extends Throwable { + public Exception() { + super(); + } + + public Exception(String message) { + super(message); + } + + public Exception(String message, Throwable cause) { + super(message, cause); + } + + public Exception(Throwable cause) { + super(cause); + } +} diff --git a/JCL/jclMin26/src/java/lang/Float.java b/JCL/jclMin26/src/java/lang/Float.java new file mode 100644 index 00000000000..8b315dd797b --- /dev/null +++ b/JCL/jclMin26/src/java/lang/Float.java @@ -0,0 +1,4 @@ +package java.lang; +public final class Float extends Number{ +} + diff --git a/JCL/jclMin26/src/java/lang/IllegalAccessException.java b/JCL/jclMin26/src/java/lang/IllegalAccessException.java new file mode 100644 index 00000000000..814649067f6 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/IllegalAccessException.java @@ -0,0 +1,5 @@ +package java.lang; + +public class IllegalAccessException extends RuntimeException { + +} diff --git a/JCL/jclMin26/src/java/lang/IllegalMonitorStateException.java b/JCL/jclMin26/src/java/lang/IllegalMonitorStateException.java new file mode 100644 index 00000000000..e173f133abe --- /dev/null +++ b/JCL/jclMin26/src/java/lang/IllegalMonitorStateException.java @@ -0,0 +1,4 @@ +package java.lang; + +public class IllegalMonitorStateException extends RuntimeException { +} diff --git a/JCL/jclMin26/src/java/lang/IncompatibleClassChangeError.java b/JCL/jclMin26/src/java/lang/IncompatibleClassChangeError.java new file mode 100644 index 00000000000..eaa29701a53 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/IncompatibleClassChangeError.java @@ -0,0 +1,15 @@ + +package java.lang; +public +class IncompatibleClassChangeError extends LinkageError { + + static final long serialVersionUID = 1L; + + public IncompatibleClassChangeError () { + super(); + } + + public IncompatibleClassChangeError(String s) { + super(s); + } +} diff --git a/JCL/jclMin26/src/java/lang/Integer.java b/JCL/jclMin26/src/java/lang/Integer.java new file mode 100644 index 00000000000..d9e444c1af7 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/Integer.java @@ -0,0 +1,59 @@ +/******************************************************************************* + * Copyright (c) 2000, 2004 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package java.lang; + +public class Integer extends Number implements Comparable { + private static final long serialVersionUID = 6462609062775655000L; + + public Integer(int i) { + } + public Integer(String s) { + } + public static final int MAX_VALUE= 2147483647; + public static final int MIN_VALUE= -2147483647; + + public static int parseInt(String s) { + return 0; + } + public static String toHexString(int i) { + return null; + } + public static String toString(int i) { + return null; + } + /* (non-Javadoc) + * @see java.lang.Number#doubleValue() + */ + public double doubleValue() { + return 0; + } + /* (non-Javadoc) + * @see java.lang.Number#floatValue() + */ + public float floatValue() { + return 0; + } + /* (non-Javadoc) + * @see java.lang.Number#intValue() + */ + public int intValue() { + return 0; + } + /* (non-Javadoc) + * @see java.lang.Number#longValue() + */ + public long longValue() { + return 0; + } + public int compareTo(Integer i) { + return 0; + } +} diff --git a/JCL/jclMin26/src/java/lang/InterruptedException.java b/JCL/jclMin26/src/java/lang/InterruptedException.java new file mode 100644 index 00000000000..e2e84ba0bc2 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/InterruptedException.java @@ -0,0 +1,4 @@ +package java.lang; + +public class InterruptedException extends Exception { +} diff --git a/JCL/jclMin26/src/java/lang/Iterable.java b/JCL/jclMin26/src/java/lang/Iterable.java new file mode 100644 index 00000000000..90f438b790e --- /dev/null +++ b/JCL/jclMin26/src/java/lang/Iterable.java @@ -0,0 +1,10 @@ +package java.lang; + +import java.util.Iterator; +import java.util.function.Consumer; + +public interface Iterable { + Iterator iterator(); + default void forEach(Consumer action) { + } +} diff --git a/JCL/jclMin26/src/java/lang/LinkageError.java b/JCL/jclMin26/src/java/lang/LinkageError.java new file mode 100644 index 00000000000..26dc1290549 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/LinkageError.java @@ -0,0 +1,19 @@ +package java.lang; + +public +class LinkageError extends Error { + + static final long serialVersionUID = 1L; + + public LinkageError() { + super(); + } + + public LinkageError(String s) { + super(s); + } + + public LinkageError(String s, Throwable cause) { + super(s, cause); + } +} diff --git a/JCL/jclMin26/src/java/lang/Long.java b/JCL/jclMin26/src/java/lang/Long.java new file mode 100644 index 00000000000..02dc04a7201 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/Long.java @@ -0,0 +1,3 @@ +package java.lang; +public final class Long extends Number{ +} diff --git a/JCL/jclMin26/src/java/lang/NoClassDefFoundError.java b/JCL/jclMin26/src/java/lang/NoClassDefFoundError.java new file mode 100644 index 00000000000..790f4e5b4ed --- /dev/null +++ b/JCL/jclMin26/src/java/lang/NoClassDefFoundError.java @@ -0,0 +1,15 @@ +package java.lang; + +public +class NoClassDefFoundError extends LinkageError { + + static final long serialVersionUID = 1L; + + public NoClassDefFoundError() { + super(); + } + + public NoClassDefFoundError(String s) { + super(s); + } +} diff --git a/JCL/jclMin26/src/java/lang/NoSuchFieldError.java b/JCL/jclMin26/src/java/lang/NoSuchFieldError.java new file mode 100644 index 00000000000..db00e4f6cab --- /dev/null +++ b/JCL/jclMin26/src/java/lang/NoSuchFieldError.java @@ -0,0 +1,15 @@ +package java.lang; + +public +class NoSuchFieldError extends IncompatibleClassChangeError { + + static final long serialVersionUID = 1L; + + public NoSuchFieldError() { + super(); + } + + public NoSuchFieldError(String s) { + super(s); + } +} diff --git a/JCL/jclMin26/src/java/lang/NoSuchMethodException.java b/JCL/jclMin26/src/java/lang/NoSuchMethodException.java new file mode 100644 index 00000000000..b8c5bce7a5b --- /dev/null +++ b/JCL/jclMin26/src/java/lang/NoSuchMethodException.java @@ -0,0 +1,5 @@ +package java.lang; + +public class NoSuchMethodException extends RuntimeException { + +} diff --git a/JCL/jclMin26/src/java/lang/NullPointerException.java b/JCL/jclMin26/src/java/lang/NullPointerException.java new file mode 100644 index 00000000000..3a3fd123a16 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/NullPointerException.java @@ -0,0 +1,11 @@ +package java.lang; +public +class NullPointerException extends RuntimeException { + public NullPointerException() { + super(); + } + + public NullPointerException(String s) { + super(s); + } +} \ No newline at end of file diff --git a/JCL/jclMin26/src/java/lang/Number.java b/JCL/jclMin26/src/java/lang/Number.java new file mode 100644 index 00000000000..4cd5761f3f5 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/Number.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 1994, 2021, 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; + +public abstract class Number implements java.io.Serializable { +} diff --git a/JCL/jclMin26/src/java/lang/Object.java b/JCL/jclMin26/src/java/lang/Object.java new file mode 100644 index 00000000000..eb50899e5ba --- /dev/null +++ b/JCL/jclMin26/src/java/lang/Object.java @@ -0,0 +1,34 @@ +package java.lang; + +public class Object { + +public Object() { +} +protected Object clone() throws CloneNotSupportedException { + return null; +} +public boolean equals (Object obj) { + return false; +} +protected void finalize () throws Throwable { +} +public final Class getClass() { + return null; +} +public int hashCode() { + return -1; +} +public final void notify() throws IllegalMonitorStateException { +} +public final void notifyAll() throws IllegalMonitorStateException { +} +public String toString () { + return null; +} +public final void wait () throws IllegalMonitorStateException, InterruptedException { +} +public final void wait (long millis) throws IllegalMonitorStateException, InterruptedException { +} +public final void wait (long millis, int nanos) throws IllegalMonitorStateException, InterruptedException { +} +} diff --git a/JCL/jclMin26/src/java/lang/Override.java b/JCL/jclMin26/src/java/lang/Override.java new file mode 100644 index 00000000000..d48b479254e --- /dev/null +++ b/JCL/jclMin26/src/java/lang/Override.java @@ -0,0 +1,7 @@ +package java.lang; + +import java.lang.annotation.*; +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.SOURCE) +public @interface Override { +} diff --git a/JCL/jclMin26/src/java/lang/Record.java b/JCL/jclMin26/src/java/lang/Record.java new file mode 100644 index 00000000000..dd070f198fb --- /dev/null +++ b/JCL/jclMin26/src/java/lang/Record.java @@ -0,0 +1,9 @@ +package java.lang; +public abstract class Record { + @Override + public abstract boolean equals(Object obj); + @Override + public abstract int hashCode(); + @Override + public abstract String toString(); +} diff --git a/JCL/jclMin26/src/java/lang/ReflectiveOperationException.java b/JCL/jclMin26/src/java/lang/ReflectiveOperationException.java new file mode 100644 index 00000000000..b2a2c66eb71 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/ReflectiveOperationException.java @@ -0,0 +1,26 @@ + +package java.lang; + +public class ReflectiveOperationException extends Exception { + static final long serialVersionUID = 123456789L; + + public ReflectiveOperationException() { + super(); + } + + public ReflectiveOperationException(String message) { + super(message); + } + + public ReflectiveOperationException(String message, Throwable cause) { + super(message, cause); + } + + public ReflectiveOperationException(Throwable cause) { + super(cause); + } + + public java.lang.Throwable getCause() { + return getCause(); + } +} diff --git a/JCL/jclMin26/src/java/lang/RuntimeException.java b/JCL/jclMin26/src/java/lang/RuntimeException.java new file mode 100644 index 00000000000..80dc1dbd34e --- /dev/null +++ b/JCL/jclMin26/src/java/lang/RuntimeException.java @@ -0,0 +1,12 @@ +package java.lang; + +public class RuntimeException extends Exception { + + public RuntimeException(java.lang.String s) { + // TODO Auto-generated constructor stub + } + + public RuntimeException() { + // TODO Auto-generated constructor stub + } +} diff --git a/JCL/jclMin26/src/java/lang/String.java b/JCL/jclMin26/src/java/lang/String.java new file mode 100644 index 00000000000..ba6bf08bf4f --- /dev/null +++ b/JCL/jclMin26/src/java/lang/String.java @@ -0,0 +1,8 @@ +package java.lang; + +public class String implements CharSequence { + public int length() { return 0; } + public int codePointAt(int index) { + return 0; + } +} diff --git a/JCL/jclMin26/src/java/lang/StringTemplate.java b/JCL/jclMin26/src/java/lang/StringTemplate.java new file mode 100644 index 00000000000..7f77c228dac --- /dev/null +++ b/JCL/jclMin26/src/java/lang/StringTemplate.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2023, 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; + +import java.util.List; + +public interface StringTemplate { + List fragments(); + + List values(); + + default String interpolate() { + return null; + } + static String interpolate(List fragments, List values) { + return null; + } + default R + process(Processor processor) throws E { + return processor.process(this); + } + + Processor STR = null; + + Processor RAW = null; + + public interface Processor { + + R process(StringTemplate stringTemplate) throws E; + } + +} diff --git a/JCL/jclMin26/src/java/lang/System.java b/JCL/jclMin26/src/java/lang/System.java new file mode 100644 index 00000000000..8aee8da6651 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/System.java @@ -0,0 +1,20 @@ +package java.lang; + +import java.io.InputStream; +import java.io.PrintStream; + +public final class System { + private static native void registerNatives(); + static { + registerNatives(); + } + + private System() { + } + + public static final InputStream in = null; + + public static final PrintStream out = null; + + +} diff --git a/JCL/jclMin26/src/java/lang/Throwable.java b/JCL/jclMin26/src/java/lang/Throwable.java new file mode 100644 index 00000000000..2488269bebc --- /dev/null +++ b/JCL/jclMin26/src/java/lang/Throwable.java @@ -0,0 +1,20 @@ +package java.lang; + +public class Throwable { + + public Throwable(java.lang.String message) { + // TODO Auto-generated constructor stub + } + + public Throwable() { + // TODO Auto-generated constructor stub + } + + public Throwable(java.lang.String message, Throwable cause) { + // TODO Auto-generated constructor stub + } + + public Throwable(Throwable cause) { + // TODO Auto-generated constructor stub + } +} diff --git a/JCL/jclMin26/src/java/lang/annotation/Annotation.java b/JCL/jclMin26/src/java/lang/annotation/Annotation.java new file mode 100644 index 00000000000..ba72aad15ec --- /dev/null +++ b/JCL/jclMin26/src/java/lang/annotation/Annotation.java @@ -0,0 +1,4 @@ +package java.lang.annotation; +public interface Annotation { + +} diff --git a/JCL/jclMin26/src/java/lang/annotation/Documented.java b/JCL/jclMin26/src/java/lang/annotation/Documented.java new file mode 100644 index 00000000000..4342263d2df --- /dev/null +++ b/JCL/jclMin26/src/java/lang/annotation/Documented.java @@ -0,0 +1,7 @@ +package java.lang.annotation; + +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.ANNOTATION_TYPE) +public @interface Documented { +} diff --git a/JCL/jclMin26/src/java/lang/annotation/ElementType.java b/JCL/jclMin26/src/java/lang/annotation/ElementType.java new file mode 100644 index 00000000000..450d459a1b2 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/annotation/ElementType.java @@ -0,0 +1,48 @@ +package java.lang.annotation; + +public enum ElementType { + /** Class, interface (including annotation type), or enum declaration */ + TYPE, + + /** Field declaration (includes enum constants) */ + FIELD, + + /** Method declaration */ + METHOD, + + /** Formal parameter declaration */ + PARAMETER, + + /** Constructor declaration */ + CONSTRUCTOR, + + /** Local variable declaration */ + LOCAL_VARIABLE, + + /** Annotation type declaration */ + ANNOTATION_TYPE, + + /** Package declaration */ + PACKAGE, + + /** + * Type parameter declaration + * + * @since 1.8 + */ + TYPE_PARAMETER, + + /** + * Use of a type + * + * @since 1.8 + */ + TYPE_USE, + + /** + * Module declaration. + * + * @since 9 + */ + MODULE +} diff --git a/JCL/jclMin26/src/java/lang/annotation/Inherited.java b/JCL/jclMin26/src/java/lang/annotation/Inherited.java new file mode 100644 index 00000000000..1db265bcd42 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/annotation/Inherited.java @@ -0,0 +1,7 @@ +package java.lang.annotation; + +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.ANNOTATION_TYPE) +public @interface Inherited { +} \ No newline at end of file diff --git a/JCL/jclMin26/src/java/lang/annotation/Retention.java b/JCL/jclMin26/src/java/lang/annotation/Retention.java new file mode 100644 index 00000000000..eba50628f62 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/annotation/Retention.java @@ -0,0 +1,10 @@ +package java.lang.annotation; + +import java.lang.annotation.Retention; + +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.ANNOTATION_TYPE) +public @interface Retention { + RetentionPolicy value(); +} \ No newline at end of file diff --git a/JCL/jclMin26/src/java/lang/annotation/RetentionPolicy.java b/JCL/jclMin26/src/java/lang/annotation/RetentionPolicy.java new file mode 100644 index 00000000000..b69fa7d6544 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/annotation/RetentionPolicy.java @@ -0,0 +1,6 @@ +package java.lang.annotation; +public enum RetentionPolicy { + CLASS, + SOURCE, + RUNTIME +} \ No newline at end of file diff --git a/JCL/jclMin26/src/java/lang/annotation/Target.java b/JCL/jclMin26/src/java/lang/annotation/Target.java new file mode 100644 index 00000000000..c961d6ddbde --- /dev/null +++ b/JCL/jclMin26/src/java/lang/annotation/Target.java @@ -0,0 +1,10 @@ +package java.lang.annotation; + +import java.lang.annotation.Target; + +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.ANNOTATION_TYPE) +public @interface Target { + ElementType[] value(); +} \ No newline at end of file diff --git a/JCL/jclMin26/src/java/lang/invoke/LambdaMetafactory.java b/JCL/jclMin26/src/java/lang/invoke/LambdaMetafactory.java new file mode 100644 index 00000000000..b8d89314345 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/invoke/LambdaMetafactory.java @@ -0,0 +1,3 @@ +package java.lang.invoke; +public class LambdaMetafactory { +} \ No newline at end of file diff --git a/JCL/jclMin26/src/java/lang/invoke/MethodHandle.java b/JCL/jclMin26/src/java/lang/invoke/MethodHandle.java new file mode 100644 index 00000000000..3bb7910d8ec --- /dev/null +++ b/JCL/jclMin26/src/java/lang/invoke/MethodHandle.java @@ -0,0 +1,38 @@ +package java.lang.invoke; +/******************************************************************************* + * Copyright (c) 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + + +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +public abstract class MethodHandle { + @Target(METHOD) + @Retention(RUNTIME) + @interface PolymorphicSignature { + } + + @PolymorphicSignature + public final native Object invoke(Object... args) throws Throwable; + + @PolymorphicSignature + public final native Object invokeExact(Object... args) throws Throwable; + + public native Object invokeWithArguments(Object... arguments) + throws Throwable; + + public native boolean isVarargsCollector(); + + public native MethodHandle asType(MethodType newType); +} \ No newline at end of file diff --git a/JCL/jclMin26/src/java/lang/invoke/MethodHandles.java b/JCL/jclMin26/src/java/lang/invoke/MethodHandles.java new file mode 100644 index 00000000000..33622371faf --- /dev/null +++ b/JCL/jclMin26/src/java/lang/invoke/MethodHandles.java @@ -0,0 +1,21 @@ +package java.lang.invoke; + +public class MethodHandles { + public static final class Lookup { + public MethodHandle findVirtual(Class refc, String name, + MethodType type) throws NoSuchMethodException, + IllegalAccessException { + return null; + } + + public MethodHandle findStatic(Class refc, String name, + MethodType type) throws NoSuchMethodException, + IllegalAccessException { + return null; + } + } + + public static Lookup lookup() { + return null; + } +} diff --git a/JCL/jclMin26/src/java/lang/invoke/MethodType.java b/JCL/jclMin26/src/java/lang/invoke/MethodType.java new file mode 100644 index 00000000000..802a3f2c806 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/invoke/MethodType.java @@ -0,0 +1,17 @@ +package java.lang.invoke; + + +public final class MethodType { + public static MethodType methodType(Class rtype, Class ptype0, + Class... ptypes) { + return null; + } + + public static MethodType methodType(Class rtype) { + return null; + } + + public static MethodType genericMethodType(int objectArgCount) { + return null; + } +} diff --git a/JCL/jclMin26/src/java/lang/invoke/StringConcatFactory.java b/JCL/jclMin26/src/java/lang/invoke/StringConcatFactory.java new file mode 100644 index 00000000000..e8b221dfc20 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/invoke/StringConcatFactory.java @@ -0,0 +1,4 @@ +package java.lang.invoke; + +public final class StringConcatFactory { +} diff --git a/JCL/jclMin26/src/java/lang/invoke/TypeDescriptor.java b/JCL/jclMin26/src/java/lang/invoke/TypeDescriptor.java new file mode 100644 index 00000000000..9e62bbc0059 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/invoke/TypeDescriptor.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2018, 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 interface TypeDescriptor { + String descriptorString(); +} diff --git a/JCL/jclMin26/src/java/lang/runtime/ObjectMethods.java b/JCL/jclMin26/src/java/lang/runtime/ObjectMethods.java new file mode 100644 index 00000000000..8ce8600e655 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/runtime/ObjectMethods.java @@ -0,0 +1,14 @@ +package java.lang.runtime; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.TypeDescriptor; + +public class ObjectMethods { + public static Object bootstrap(MethodHandles.Lookup lookup, String methodName, TypeDescriptor type, + Class recordClass, + String names, + MethodHandle... getters) throws Throwable { + return null; + } +} diff --git a/JCL/jclMin26/src/java/lang/runtime/SwitchBootstraps.java b/JCL/jclMin26/src/java/lang/runtime/SwitchBootstraps.java new file mode 100644 index 00000000000..fbea6a780b5 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/runtime/SwitchBootstraps.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2017, 2021, 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.runtime; + +public class SwitchBootstraps { +} + diff --git a/JCL/jclMin26/src/java/lang/runtime/TemplateRuntime.java b/JCL/jclMin26/src/java/lang/runtime/TemplateRuntime.java new file mode 100644 index 00000000000..e15e84372f9 --- /dev/null +++ b/JCL/jclMin26/src/java/lang/runtime/TemplateRuntime.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023, 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.runtime; + +public final class TemplateRuntime { +} + diff --git a/JCL/jclMin26/src/java/util/Collection.java b/JCL/jclMin26/src/java/util/Collection.java new file mode 100644 index 00000000000..a40b2d29a3f --- /dev/null +++ b/JCL/jclMin26/src/java/util/Collection.java @@ -0,0 +1,9 @@ +package java.util; + +public interface Collection extends Iterable { + public Iterator iterator(); + public int size(); + public T get(int index); + public boolean addAll(Collection c); + public T[] toArray(T[] o); +} diff --git a/JCL/jclMin26/src/java/util/Iterator.java b/JCL/jclMin26/src/java/util/Iterator.java new file mode 100644 index 00000000000..f90ee762c2f --- /dev/null +++ b/JCL/jclMin26/src/java/util/Iterator.java @@ -0,0 +1,7 @@ +package java.util; + +public interface Iterator { + boolean hasNext(); + E next(); + void remove(); +} diff --git a/JCL/jclMin26/src/java/util/List.java b/JCL/jclMin26/src/java/util/List.java new file mode 100644 index 00000000000..7d19bdfb1b8 --- /dev/null +++ b/JCL/jclMin26/src/java/util/List.java @@ -0,0 +1,4 @@ +package java.util; + +public interface List extends Collection { +} diff --git a/JCL/jclMin26/src/java/util/Map.java b/JCL/jclMin26/src/java/util/Map.java new file mode 100644 index 00000000000..574a7f816a5 --- /dev/null +++ b/JCL/jclMin26/src/java/util/Map.java @@ -0,0 +1,5 @@ +package java.util; + +public interface Map { + +} \ No newline at end of file diff --git a/JCL/jclMin26/src/java/util/Set.java b/JCL/jclMin26/src/java/util/Set.java new file mode 100644 index 00000000000..61df69c33ff --- /dev/null +++ b/JCL/jclMin26/src/java/util/Set.java @@ -0,0 +1,8 @@ +package java.util; + +public interface Set extends Collection { + static Set of() { return null; } + static Set of(E e1) { return null; } + static Set of(E e1, E e2) { return null; } + static Set of(E... elements) { return null; } +} diff --git a/JCL/jclMin26/src/java/util/function/Consumer.java b/JCL/jclMin26/src/java/util/function/Consumer.java new file mode 100644 index 00000000000..d511deef9bd --- /dev/null +++ b/JCL/jclMin26/src/java/util/function/Consumer.java @@ -0,0 +1,10 @@ +package java.util.function; + +public interface Consumer { + + void accept(T t); + + default Consumer andThen(Consumer after) { + return null; + } +} diff --git a/JCL/jclMin26/src/javax/lang/model/SourceVersion.java b/JCL/jclMin26/src/javax/lang/model/SourceVersion.java new file mode 100644 index 00000000000..da3314c8926 --- /dev/null +++ b/JCL/jclMin26/src/javax/lang/model/SourceVersion.java @@ -0,0 +1,71 @@ +package javax.lang.model; + +public enum SourceVersion { + + RELEASE_0, + + RELEASE_1, + + RELEASE_2, + + RELEASE_3, + + RELEASE_4, + + RELEASE_5, + + RELEASE_6, + + RELEASE_7, + + RELEASE_8, + RELEASE_9, + + RELEASE_10, + + RELEASE_11, + + RELEASE_12, + + RELEASE_13, + RELEASE_14, + RELEASE_15, + RELEASE_16, + RELEASE_17, + RELEASE_18, + RELEASE_19; + + public static SourceVersion latest() { + return RELEASE_19; + } + + private static final SourceVersion latestSupported = getLatestSupported(); + + private static SourceVersion getLatestSupported() { + return RELEASE_19; + } + + public static SourceVersion latestSupported() { + return latestSupported; + } + + public static boolean isIdentifier(CharSequence name) { + return true; + } + + public static boolean isName(CharSequence name) { + return isName(name, latest()); + } + + public static boolean isName(CharSequence name, SourceVersion version) { + return true; + } + + public static boolean isKeyword(CharSequence s) { + return isKeyword(s, latest()); + } + + public static boolean isKeyword(CharSequence s, SourceVersion version) { + return true; + } +} diff --git a/JCL/jclMin26/src/module-info.java b/JCL/jclMin26/src/module-info.java new file mode 100644 index 00000000000..8cb1a43166a --- /dev/null +++ b/JCL/jclMin26/src/module-info.java @@ -0,0 +1,7 @@ +module java.base { + exports java.lang; + exports java.lang.annotation; + exports java.lang.invoke; + exports java.io; + exports java.util; +} \ No newline at end of file diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java index 6d3c0f9a906..8a8c6adb1c0 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2024 IBM Corporation and others. + * Copyright (c) 2000, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -548,7 +548,7 @@ protected boolean commentParse() { if (this.lineStarted && this.textStart != -1 && this.textStart < textEndPosition) { pushText(this.textStart, textEndPosition); } - refreshInlineTagPosition(textEndPosition); + refreshInlineTagPosition((this.markdown && this.tagValue == TAG_SNIPPET_VALUE) ? textEndPosition - 2 : textEndPosition); setInlineTagStarted(false); } else if (this.lineStarted && this.textStart != -1 && this.textStart <= textEndPosition && (this.textStart < this.starPosition || this.starPosition == lastStarPosition || this.markdown)) { if (!(invalidInlineTagLineEnd > 0 && nextCharacter == '}' && this.markdown && this.index == this.javadocEnd)) @@ -1663,6 +1663,7 @@ protected boolean parseSnippet() throws InvalidInputException { int openBraces = 1; boolean parsingJava18Plus = this.scanner != null ? this.scanner.sourceLevel >= ClassFileConstants.JDK18 : false; boolean valid = true; + boolean markdownSnippetIsValid = false; if (!parsingJava18Plus) { throw Scanner.invalidInput(); } @@ -1855,6 +1856,36 @@ protected boolean parseSnippet() throws InvalidInputException { this.textStart = -1; } break; + case TokenNameCOMMENT_MARKDOWN: + if (this.markdown) { + String markdownTokenString = this.scanner.getCurrentTokenString(); + String[] elements = markdownTokenString.split("\\r?\\n", -1); //$NON-NLS-1$ + int elmentStart = this.scanner.getCurrentTokenStartPosition(); + int elementEnd = 0; + try { + for (int i = 0; i < elements.length; i++) { + if (elementEnd != 0 ) { + elmentStart = elementEnd + 1; // +1 because of new line + } + int pos = elements[i].indexOf("///"); //$NON-NLS-1$ + if (pos != -1) { + elmentStart = elmentStart + 3 + pos; + String element = elements[i].substring(3 + pos); + elementEnd = elmentStart + element.length(); + if (element.stripLeading().startsWith("}")) { //$NON-NLS-1$ + break; + } + } + pushText(elmentStart, elementEnd); + } + if (elements.length > 0) + markdownSnippetIsValid = true; + } catch (Exception e) { + markdownSnippetIsValid = false; + } + + } + break; case TokenNameCOMMENT_LINE: String tokenString = this.scanner.getCurrentTokenString(); boolean handleNow = handleCommentLineForCurrentLine(tokenString); @@ -1867,6 +1898,9 @@ protected boolean parseSnippet() throws InvalidInputException { this.nonRegionTagCount = 0; this.inlineTagCount = 0; } + if (this.markdown) { + markdownSnippetIsValid = true; + } Object innerTag = parseSnippetInlineTags(indexOfLastComment == -1 ? tokenString : tokenString.substring(indexOfLastComment+2), snippetTag, this.scanner); if (innerTag != null) { lvalid = true; @@ -1898,7 +1932,6 @@ protected boolean parseSnippet() throws InvalidInputException { addSnippetInnerTag(innerTag, snippetTag); this.snippetInlineTagStarted = true; } - //valid = valid & lvalid; break; default: if (!this.lineStarted || this.textStart == -1) { @@ -1936,7 +1969,11 @@ protected boolean parseSnippet() throws InvalidInputException { this.index = lastRBracePosition - 1; } if (snippetTag != null) { - this.setSnippetIsValid(snippetTag, retVal); + if (this.markdown) { + this.setSnippetIsValid(snippetTag, markdownSnippetIsValid); + } else { + this.setSnippetIsValid(snippetTag, retVal); + } } return retVal; } diff --git a/org.eclipse.jdt.core.tests.model/JCL/build.xml b/org.eclipse.jdt.core.tests.model/JCL/build.xml index ab4db8910a0..9b000837cbd 100644 --- a/org.eclipse.jdt.core.tests.model/JCL/build.xml +++ b/org.eclipse.jdt.core.tests.model/JCL/build.xml @@ -83,6 +83,10 @@ + + + + diff --git a/org.eclipse.jdt.core.tests.model/JCL/converterJclMin26.jar b/org.eclipse.jdt.core.tests.model/JCL/converterJclMin26.jar new file mode 100644 index 00000000000..03d5e34b0dc Binary files /dev/null and b/org.eclipse.jdt.core.tests.model/JCL/converterJclMin26.jar differ diff --git a/org.eclipse.jdt.core.tests.model/JCL/converterJclMin26src.zip b/org.eclipse.jdt.core.tests.model/JCL/converterJclMin26src.zip new file mode 100644 index 00000000000..25d780f788d Binary files /dev/null and b/org.eclipse.jdt.core.tests.model/JCL/converterJclMin26src.zip differ diff --git a/org.eclipse.jdt.core.tests.model/JCL/jclMin26.jar b/org.eclipse.jdt.core.tests.model/JCL/jclMin26.jar index 5da1f58e476..911e641ec26 100644 Binary files a/org.eclipse.jdt.core.tests.model/JCL/jclMin26.jar and b/org.eclipse.jdt.core.tests.model/JCL/jclMin26.jar differ diff --git a/org.eclipse.jdt.core.tests.model/JCL/jclMin26src.zip b/org.eclipse.jdt.core.tests.model/JCL/jclMin26src.zip index 19def4c801a..25d780f788d 100644 Binary files a/org.eclipse.jdt.core.tests.model/JCL/jclMin26src.zip and b/org.eclipse.jdt.core.tests.model/JCL/jclMin26src.zip differ diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterMarkdownSnippetTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterMarkdownSnippetTest.java new file mode 100644 index 00000000000..cc678c9f1b4 --- /dev/null +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterMarkdownSnippetTest.java @@ -0,0 +1,612 @@ +/******************************************************************************* + * Copyright (c) 2026 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.jdt.core.tests.dom; + +import java.io.File; +import java.io.IOException; +import java.lang.reflect.Method; +import java.text.NumberFormat; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import junit.framework.Test; +import junit.framework.TestSuite; +import org.eclipse.jdt.core.ICompilationUnit; +import org.eclipse.jdt.core.IJavaProject; +import org.eclipse.jdt.core.JavaCore; +import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.jdt.core.compiler.IProblem; +import org.eclipse.jdt.core.dom.AST; +import org.eclipse.jdt.core.dom.ASTNode; +import org.eclipse.jdt.core.dom.ASTParser; +import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jdt.core.dom.Javadoc; +import org.eclipse.jdt.core.dom.TagElement; +import org.eclipse.jdt.core.dom.TextElement; +import org.eclipse.jdt.internal.compiler.parser.JavadocTagConstants; +import org.eclipse.jdt.internal.compiler.parser.ScannerHelper; + +/** + * Class to test DOM/AST nodes built for markdown snippet tags. + * + * Most of tests are 'automatic'. It means that to add a new tests, you only need to + * create one or several CUs and put them in org.eclipse.jdt.core.model.tests/workspace/Converter/src/markdown/testXXX + * folder and add the corresponding test in this class: + *
+ * public void testXXX() throws JavaModelException {
+ * 	verifyComments("testXXX");
+ * }
+ * 
+ * + * Note that when a test fails, the easiest way to debug it is to open + * a runtime workbench, create a project 'Converter', delete the default 'src' source folder + * and replace it by a linked source to the 'src' folder of org.eclipse.jdt.core.model.tests/workspace/Converter/src + * in your workspace. + * + * Then open the CU on which the test fails in a ASTView and verify the offset/length + * of the offending node located at the positions displayed in the console when the test failed... + * + * Since 3.4, the failing test also provides the comparison between the source of the comment + * and the string get from the built DOM/AST nodes in the comment (see {@link ASTConverterJavadocFlattener}) + * but this may be not enough to see precisely the origin of the problem. + */ +@SuppressWarnings({"rawtypes", "unchecked"}) +public class ASTConverterMarkdownSnippetTest extends ConverterTestSetup { + + // Flag to know whether Converter directory should be copied from org.eclipse.jdt.core.tests.model project + static protected boolean COPY_DIR = true; + + // Test counters + protected static int[] TEST_COUNTERS = { 0, 0, 0, 0 }; + // Unicode tests + protected static boolean UNICODE = false; + // Unix tests + final boolean unix; + static final String UNIX_SUPPORT = System.getProperty("unix"); + // Doc Comment support + static final String DOC_COMMENT_SUPPORT = System.getProperty("doc.support"); + final String docCommentSupport; + + List comments = new ArrayList(); + // List of tags contained in each comment read from test source. + List allTags = new ArrayList(); + // tags inhibiting inline tags + static final String TAG_CODE = "code"; + static final String TAG_LITERAL = "literal"; + // Current compilation unit + protected ICompilationUnit sourceUnit; + // Test package binding + protected boolean resolveBinding = true; + protected boolean packageBinding = true; + // AST Level + /** @deprecated using deprecated code */ + protected int astLevel = AST.JLS23; + protected int savedLevel; + // Debug + protected String prefix = ""; + protected boolean debug = false; + protected StringBuilder problems; + protected String compilerOption = JavaCore.IGNORE; + protected List failures; + Map savedOptions = null; + + private static String SNIPPET_TAG = '@' + new String(JavadocTagConstants.TAG_SNIPPET); + + public ASTConverterMarkdownSnippetTest(String name, String support, String unix) { + super(name); + this.docCommentSupport = support; + this.unix = "true".equals(unix); + } + public ASTConverterMarkdownSnippetTest(String name) { + this(preHyphen(name), nameToSupport(name), + name.indexOf(" - Unix") != -1 ? "true" : "false"); + } + + private static String preHyphen(String name) { + int hyphenInd = name.indexOf(" - "); + String r = hyphenInd == -1 ? name : name.substring(0, hyphenInd); + return r; + } + private static String nameToSupport(String name) { + int ind1 = name.indexOf(" - Doc "); + int ind2 = name.lastIndexOf("abled"); + if( ind1 == -1 || ind2 == -1 ) + return name; + String s = name.substring(name.indexOf(" - Doc ") + 7, name.lastIndexOf("abled") + 5); + return s; + } + + /* (non-Javadoc) + * @see junit.framework.TestCase#getName() + */ + public String getName() { + String strUnix = this.unix ? " - Unix" : ""; + return super.getName()+" - Doc "+this.docCommentSupport+strUnix; + } + + public static Test suite() { + TestSuite suite = new Suite(ASTConverterMarkdownSnippetTest.class.getName()); + if (DOC_COMMENT_SUPPORT == null) { + buildSuite(suite, JavaCore.ENABLED); + buildSuite(suite, JavaCore.DISABLED); + } else { + String support = DOC_COMMENT_SUPPORT==null ? JavaCore.DISABLED : (DOC_COMMENT_SUPPORT.equals(JavaCore.DISABLED)?JavaCore.DISABLED:JavaCore.ENABLED); + buildSuite(suite, support); + } + return suite; + } + + public static void buildSuite(TestSuite suite, String support) { + Class c = ASTConverterMarkdownSnippetTest.class; + Method[] methods = c.getMethods(); + for (int i = 0, max = methods.length; i < max; i++) { + if (methods[i].getName().startsWith("test")) { //$NON-NLS-1$ + suite.addTest(new ASTConverterMarkdownSnippetTest(methods[i].getName(), support, UNIX_SUPPORT)); + } + } + // when unix support not specified, also run using unix format + if (UNIX_SUPPORT == null && JavaCore.ENABLED.equals(support)) { + for (int i = 0, max = methods.length; i < max; i++) { + if (methods[i].getName().startsWith("test")) { //$NON-NLS-1$ + suite.addTest(new ASTConverterMarkdownSnippetTest(methods[i].getName(), support, "true")); + } + } + } + } + + /* (non-Javadoc) + * @see org.eclipse.jdt.core.tests.model.AbstractJavaModelTests#copyDirectory(java.io.File, java.io.File) + */ + @Override + protected void copyDirectory(File sourceDir, File targetDir) throws IOException { + if (COPY_DIR) { + super.copyDirectory(sourceDir, targetDir); + } else { + targetDir.mkdirs(); + File sourceFile = new File(sourceDir, ".project"); + File targetFile = new File(targetDir, ".project"); + targetFile.createNewFile(); + copy(sourceFile, targetFile); + sourceFile = new File(sourceDir, ".classpath"); + targetFile = new File(targetDir, ".classpath"); + targetFile.createNewFile(); + copy(sourceFile, targetFile); + } + } + /* (non-Javadoc) + * @see junit.framework.TestCase#setUp() + */ + @Override + protected void setUp() throws Exception { + super.setUp(); + TEST_COUNTERS[0]++; + setCompliancesLevel(); + this.failures = new ArrayList(); + this.problems = new StringBuilder(); + this.workingCopies = null; + this.savedLevel = this.astLevel; + } + @Override + protected void tearDown() throws Exception { + int size = this.failures.size(); + String title = size+" positions/bindings were incorrect in "+getName(); + if (size == 0) { + TEST_COUNTERS[1]++; + } else if (this.problems.length() > 0) { + if (this.debug) { + System.out.println("Compilation warnings/errors occured:"); + System.out.println(this.problems.toString()); + } + TEST_COUNTERS[2]++; + } else { + TEST_COUNTERS[3]++; + System.out.println(title+":"); + for (int i=0; i 0); + super.tearDown(); + + // Restore saved ast level + this.astLevel = this.savedLevel; + } + + @Override + public void tearDownSuite() throws Exception { + // put default options on project + if (this.currentProject != null && this.savedOptions != null) { + this.currentProject.setOptions(this.savedOptions); + } + super.tearDownSuite(); + if (TEST_COUNTERS[0] != TEST_COUNTERS[1]) { + NumberFormat intFormat = NumberFormat.getInstance(); + intFormat.setMinimumIntegerDigits(3); + intFormat.setMaximumIntegerDigits(3); + System.out.println("====================================="); + System.out.println(intFormat.format(TEST_COUNTERS[0])+" tests have been executed:"); + System.out.println(" - "+intFormat.format(TEST_COUNTERS[1])+" tests have been actually executed."); + System.out.println(" - "+intFormat.format(TEST_COUNTERS[2])+" tests were skipped due to compilation errors."); + System.out.println(" - "+intFormat.format(TEST_COUNTERS[3])+" tests failed."); + } + } + @Override + public ASTNode runConversion(ICompilationUnit unit, boolean resolveBindings) { + return runConversion(AST.JLS23, unit, resolveBindings); + } + @Override + public ASTNode runConversion(char[] source, String unitName, IJavaProject project) { + ASTParser parser = ASTParser.newParser(this.astLevel); + parser.setSource(source); + parser.setUnitName(unitName); + parser.setProject(project); + parser.setResolveBindings(this.resolveBinding); + return parser.createAST(null); + } + + @Override + public ASTNode runConversion(char[] source, String unitName, IJavaProject project, Map options) { + if (project == null) { + ASTParser parser = ASTParser.newParser(this.astLevel); + parser.setSource(source); + parser.setUnitName(unitName); + parser.setCompilerOptions(options); + parser.setResolveBindings(this.resolveBinding); + return parser.createAST(null); + } + return runConversion(source, unitName, project); + } + /* + * Convert Javadoc source to match markdown.toString(). + * Store converted comments and their corresponding tags respectively + * in comments and allTags fields + */ + char[] getUnicodeSource(char[] source) { + int length = source.length; + int unicodeLength = length*6; + char[] unicodeSource = new char[unicodeLength]; + int u=0; + for (int i=0; i 15 || c1 < 0) + || ((c2 = ScannerHelper.getHexadecimalValue(source[i+2])) > 15 || c2 < 0) + || ((c3 = ScannerHelper.getHexadecimalValue(source[i+3])) > 15 || c3 < 0) + || ((c4 = ScannerHelper.getHexadecimalValue(source[i+4])) > 15 || c4 < 0)) { + throw new RuntimeException("Invalid unicode in source at "+i); + } + for (int j=0; j<4; j++) unicodeSource[u++] = source[++i]; + } else { + unicodeSource[u++] = '\\'; + unicodeSource[u++] = 'u'; + unicodeSource[u++] = '0'; + unicodeSource[u++] = '0'; + int val = source[i]/16; + unicodeSource[u++] = (char) (val<10 ? val+ 0x30 : val-10+0x61); + val = source[i]%16; + unicodeSource[u++] = (char) (val<10 ? val+ 0x30 : val-10+0x61); + } + } + // Return one well sized array + if (u != unicodeLength) { + char[] result = new char[u]; + System.arraycopy(unicodeSource, 0, result, 0, u); + return result; + } + return unicodeSource; + } + + /* + * Convert Javadoc source to match markdown.toString(). + * Store converted comments and their corresponding tags respectively + * in comments and allTags fields + */ + char[] getUnixSource(char[] source) { + int length = source.length; + int unixLength = length; + char[] unixSource = new char[unixLength]; + int u=0; + for (int i=0; i actual:<"+actual+'>'); + } + + + /* (non-Javadoc) + * @see junit.framework.TestCase#setUp() + */ + protected void verifyComments(String test) throws JavaModelException { + ICompilationUnit[] units = getCompilationUnits("Converter_26" , "src", "markdown."+test); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + for (int i=0; i0); + for (int i=0; i 0) { + this.problems.append(" - "+this.prefix+length+" problems:"); //$NON-NLS-1$ + for (int i = 0; i < problemsList.length; i++) { + this.problems.append(" + "); + this.problems.append(problemsList[i]); + this.problems.append("\n"); + } + } + } + unitComments = compilUnit.getCommentList(); + assumeNotNull(this.prefix+"Unexpected problems", unitComments); + + return compilUnit; + } + private TagElement getSnippetTag(Javadoc docComment) { + TagElement snippet = null; + if (docComment != null) { + for (Object tag : docComment.tags()) { + if (tag instanceof TagElement) { + TagElement tagElement = (TagElement) tag; + if (SNIPPET_TAG.equals(tagElement.getTagName())) { + return tagElement; + } + List fragments = tagElement.fragments(); + for (Object fragment : fragments) { + if (fragment instanceof TagElement) { + TagElement tagElem = (TagElement) fragment; + if (SNIPPET_TAG.equals(tagElem.getTagName())) { + return tagElem; + } + } + } + + } + } + } + return snippet; + } + + // empty body + public void testSnippetTagforMarkdown_01() throws JavaModelException { + String source = """ + /// {@snippet : + /// } + public class Markdown {} + """; + this.workingCopies = new ICompilationUnit[1]; + this.workingCopies[0] = getWorkingCopy("/Converter_26/src/markdown/Markdown.java", source, null); + CompilationUnit compilUnit = verifyComments(this.workingCopies[0]); + if (this.docCommentSupport.equals(JavaCore.ENABLED)) { + List unitComments = compilUnit.getCommentList(); + int size = unitComments.size(); + assertEquals("Wrong number of comments", 1, size); + Javadoc javadoc = (Javadoc) unitComments.get(0); + TagElement snippetTag = getSnippetTag(javadoc); + List frags = snippetTag.fragments(); + assertEquals("Fragments should be empty", 0, frags.size()); + } + } + + // Single element + public void testSnippetMarkdownTest_02() throws JavaModelException { + String source = """ + /// {@snippet: + /// int x = 2; + /// } + public class Markdown {} + """; + this.workingCopies = new ICompilationUnit[1]; + this.workingCopies[0] = getWorkingCopy("/Converter_26/src/markdown/Markdown.java", source, null); + if (this.docCommentSupport.equals(JavaCore.ENABLED)) { + CompilationUnit compilUnit = verifyComments(this.workingCopies[0]); + List unitComments = compilUnit.getCommentList(); + int size = unitComments.size(); + assertEquals("Wrong number of comments", 1, size); + Javadoc javadoc = (Javadoc) unitComments.get(0); + TagElement snippetTag = getSnippetTag(javadoc); + List frags = snippetTag.fragments(); + assertEquals("Fragments should be 1", 1, frags.size()); + assertEquals("Incorrect text content", " int x = 2;", frags.get(0).getText()); + } + } + + // Blank line inside the body + public void testSnippetMarkdownTest_03() throws JavaModelException { + String source = """ + /// {@snippet: + /// + /// int a = 1; + /// + /// int b = 2; + /// } + public class Markdown {} + """; + this.workingCopies = new ICompilationUnit[1]; + this.workingCopies[0] = getWorkingCopy("/Converter_26/src/markdown/Markdown.java", source, null); + if (this.docCommentSupport.equals(JavaCore.ENABLED)) { + CompilationUnit compilUnit = verifyComments(this.workingCopies[0]); + List unitComments = compilUnit.getCommentList(); + int size = unitComments.size(); + assertEquals("Wrong number of comments", 1, size); + Javadoc javadoc = (Javadoc) unitComments.get(0); + TagElement snippetTag = getSnippetTag(javadoc); + List frags = snippetTag.fragments(); + assertEquals("Fragments should be 4", 4, frags.size()); + assertEquals("Incorrect text content", "", frags.get(0).getText()); + assertEquals("Incorrect text content", " int a = 1;", frags.get(1).getText()); + assertEquals("Incorrect text content", "", frags.get(2).getText()); + assertEquals("Incorrect text content", " int b = 2;", frags.get(3).getText()); + } + } + + // {@code} tag inside the snippet + public void testSnippetMarkdownTest_04() throws JavaModelException { + String source = """ + /// {@snippet : + /// {@code int a = 0;} + /// } + """; + this.workingCopies = new ICompilationUnit[1]; + this.workingCopies[0] = getWorkingCopy("/Converter_26/src/markdown/Markdown.java", source, null); + if (this.docCommentSupport.equals(JavaCore.ENABLED)) { + CompilationUnit compilUnit = verifyComments(this.workingCopies[0]); + List unitComments = compilUnit.getCommentList(); + int size = unitComments.size(); + assertEquals("Wrong number of comments", 1, size); + Javadoc javadoc = (Javadoc) unitComments.get(0); + TagElement snippetTag = getSnippetTag(javadoc); + List frags = snippetTag.fragments(); + assertEquals("Fragments should be 1", 1, frags.size()); + assertEquals("Incorrect text content", " {@code int a = 0;}", frags.get(0).getText()); + } + } +} diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ConverterTestSetup.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ConverterTestSetup.java index df346273acd..27c98739434 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ConverterTestSetup.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ConverterTestSetup.java @@ -99,6 +99,7 @@ public void tearDownSuite() throws Exception { this.deleteProject("Converter_23"); //$NON-NLS-1$ this.deleteProject("Converter_24"); //$NON-NLS-1$ this.deleteProject("Converter_25"); //$NON-NLS-1$ + this.deleteProject("Converter_26"); //$NON-NLS-1$ PROJECT_SETUP = false; } else { TEST_SUITES.remove(getClass()); @@ -123,6 +124,7 @@ public void tearDownSuite() throws Exception { this.deleteProject("Converter_23"); //$NON-NLS-1$ this.deleteProject("Converter_24"); //$NON-NLS-1$ this.deleteProject("Converter_25"); //$NON-NLS-1$ + this.deleteProject("Converter_26"); //$NON-NLS-1$ PROJECT_SETUP = false; } } @@ -290,6 +292,7 @@ public void setUpSuite() throws Exception { setUpJavaProject("Converter_23", "23"); //$NON-NLS-1$ //$NON-NLS-2$ setUpJavaProject("Converter_24", "24"); //$NON-NLS-1$ //$NON-NLS-2$ setUpJavaProject("Converter_25", "25"); //$NON-NLS-1$ //$NON-NLS-2$ + setUpJavaProject("Converter_26", "26"); //$NON-NLS-1$ //$NON-NLS-2$ waitUntilIndexesReady(); // needed to find secondary types PROJECT_SETUP = true; } diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/RunConverterTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/RunConverterTests.java index 3bc73258e05..20251b4874f 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/RunConverterTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/RunConverterTests.java @@ -63,7 +63,8 @@ public static Class[] getAllTestClasses() { ASTConverterSuperAfterStatements.class, ASTConverterEitherOrMultiPatternTest.class, CompilationUnitResolverDiscoveryTest.class, - ASTConverterMarkdownTest.class + ASTConverterMarkdownTest.class, + ASTConverterMarkdownSnippetTest.class }; } public static Test suite() { diff --git a/org.eclipse.jdt.core.tests.model/workspace/Converter_26/.classpath b/org.eclipse.jdt.core.tests.model/workspace/Converter_26/.classpath new file mode 100644 index 00000000000..95b37bfb0a6 --- /dev/null +++ b/org.eclipse.jdt.core.tests.model/workspace/Converter_26/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/org.eclipse.jdt.core.tests.model/workspace/Converter_26/.project b/org.eclipse.jdt.core.tests.model/workspace/Converter_26/.project new file mode 100644 index 00000000000..690f552399b --- /dev/null +++ b/org.eclipse.jdt.core.tests.model/workspace/Converter_26/.project @@ -0,0 +1,17 @@ + + + Converter_25 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/org.eclipse.jdt.core.tests.model/workspace/Converter_26/src/X.java b/org.eclipse.jdt.core.tests.model/workspace/Converter_26/src/X.java new file mode 100644 index 00000000000..ade997b01dc --- /dev/null +++ b/org.eclipse.jdt.core.tests.model/workspace/Converter_26/src/X.java @@ -0,0 +1,4 @@ +public/// { + public/// { + } +} \ No newline at end of file