├── commons-compiler ├── .gitignore ├── src │ ├── test │ │ ├── resources │ │ │ └── foobar.zip │ │ └── java │ │ │ └── org │ │ │ └── codehaus │ │ │ └── commons │ │ │ └── compiler │ │ │ └── util │ │ │ └── tests │ │ │ └── package-info.java │ └── main │ │ └── java │ │ └── org │ │ └── codehaus │ │ └── commons │ │ ├── compiler │ │ ├── io │ │ │ ├── package-info.java │ │ │ └── InputStreams.java │ │ ├── lang │ │ │ └── package-info.java │ │ ├── util │ │ │ ├── iterator │ │ │ │ ├── package-info.java │ │ │ │ ├── UniterableElementException.java │ │ │ │ ├── EnumerationIterator.java │ │ │ │ └── TransformingIterator.java │ │ │ ├── package-info.java │ │ │ ├── reflect │ │ │ │ ├── package-info.java │ │ │ │ └── NoException.java │ │ │ ├── resource │ │ │ │ ├── package-info.java │ │ │ │ ├── LocatableResource.java │ │ │ │ ├── DirectoryResourceCreator.java │ │ │ │ ├── LazyMultiResourceFinder.java │ │ │ │ ├── StringResource.java │ │ │ │ └── FileResourceFinder.java │ │ │ ├── Predicate.java │ │ │ └── Producer.java │ │ ├── samples │ │ │ └── package-info.java │ │ ├── java8 │ │ │ └── java │ │ │ │ └── util │ │ │ │ ├── package-info.java │ │ │ │ ├── stream │ │ │ │ └── package-info.java │ │ │ │ ├── function │ │ │ │ ├── package-info.java │ │ │ │ └── Consumer.java │ │ │ │ └── Optional.java │ │ ├── java9 │ │ │ └── java │ │ │ │ └── lang │ │ │ │ └── module │ │ │ │ └── package-info.java │ │ ├── ErrorHandler.java │ │ ├── WarningHandler.java │ │ └── CompileException.java │ │ └── nullanalysis │ │ ├── Nullable.java │ │ └── NotNull.java ├── .settings │ ├── org.eclipse.m2e.core.prefs │ ├── org.eclipse.core.resources.prefs │ └── org.eclipse.jdt.ui.prefs ├── .checkstyle ├── .project ├── .classpath └── pom.xml ├── janino ├── build │ └── .gitignore ├── .hgignore ├── lib │ └── ant-1.7.1.jar ├── src │ ├── test │ │ ├── java │ │ │ ├── org.codehaus.commons.compiler.tests.properties │ │ │ ├── other_package2 │ │ │ │ ├── package-info.java │ │ │ │ └── ScopingRules.java │ │ │ └── org │ │ │ │ └── codehaus │ │ │ │ └── janino │ │ │ │ └── tests │ │ │ │ └── package-info.java │ │ └── resources │ │ │ └── a │ │ │ └── Test.java │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── services │ │ │ └── org.codehaus.commons.compiler.ICompilerFactory │ │ └── java │ │ └── org │ │ └── codehaus │ │ └── janino │ │ ├── TODO.txt │ │ ├── IType.java │ │ ├── ITypeVariableOrIClass.java │ │ ├── IParameterizedType.java │ │ ├── util │ │ ├── package-info.java │ │ ├── charstream │ │ │ ├── package-info.java │ │ │ └── UnexpectedCharacterException.java │ │ ├── signature │ │ │ └── package-info.java │ │ └── Annotatable.java │ │ ├── tools │ │ └── package-info.java │ │ ├── samples │ │ └── package-info.java │ │ ├── IWildcardType.java │ │ ├── UnicodeUnescapeException.java │ │ ├── ITypeVariable.java │ │ ├── package-info.java │ │ ├── JaninoOption.java │ │ └── Access.java ├── .settings │ ├── org.eclipse.m2e.core.prefs │ └── org.eclipse.core.resources.prefs ├── bin │ └── janinoc ├── .project ├── .checkstyle └── .classpath ├── commons-compiler-jdk ├── .gitignore ├── src │ ├── test │ │ └── java │ │ │ └── .keep │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── services │ │ │ └── org.codehaus.commons.compiler.ICompilerFactory │ │ └── java │ │ └── org │ │ └── codehaus │ │ └── commons │ │ └── compiler │ │ └── jdk │ │ ├── util │ │ └── package-info.java │ │ └── package-info.java ├── .settings │ ├── org.eclipse.m2e.core.prefs │ └── org.eclipse.core.resources.prefs ├── .checkstyle ├── .project ├── .classpath └── pom.xml ├── commons-compiler-tests ├── .gitignore ├── src │ ├── main │ │ └── java │ │ │ └── .keep │ └── test │ │ ├── resources │ │ ├── testBundles │ │ │ ├── MyBundle.properties │ │ │ ├── path │ │ │ │ └── to │ │ │ │ │ └── some_resource.txt │ │ │ └── test │ │ │ │ └── GetBundle.java │ │ ├── Bug 106 │ │ │ ├── b │ │ │ │ ├── C1.java │ │ │ │ └── C3.java │ │ │ └── a │ │ │ │ └── C2.java │ │ ├── issue53 │ │ │ ├── pkg1 │ │ │ │ └── Enum1.java │ │ │ └── pkg2 │ │ │ │ └── Enum1.java │ │ ├── testOverloadedStaticImports │ │ │ └── test │ │ │ │ ├── C1.java │ │ │ │ ├── SingleStaticImport.java │ │ │ │ ├── C2.java │ │ │ │ └── StaticImports.java │ │ ├── testCircularSingleTypeImports │ │ │ └── test │ │ │ │ ├── Func1.java │ │ │ │ └── Func2.java │ │ ├── testCircularStaticImports │ │ │ └── test │ │ │ │ ├── Func1.java │ │ │ │ └── Func2.java │ │ └── a │ │ │ └── TestLocalVarTable.java │ │ └── java │ │ ├── com │ │ └── company │ │ │ ├── User.java │ │ │ └── user │ │ │ └── Country.java │ │ ├── org │ │ └── codehaus │ │ │ └── commons │ │ │ └── compiler │ │ │ └── tests │ │ │ ├── issue212 │ │ │ └── base │ │ │ │ ├── IBase.java │ │ │ │ ├── DerivedClass.java │ │ │ │ └── BaseClass.java │ │ │ ├── bug63 │ │ │ ├── IPred.java │ │ │ ├── Pred.java │ │ │ └── package-info.java │ │ │ ├── issue32 │ │ │ └── package-info.java │ │ │ ├── annotation │ │ │ ├── package-info.java │ │ │ ├── RuntimeRetainedAnnotation4Enum.java │ │ │ ├── RuntimeRetainedAnnotation5.java │ │ │ ├── RuntimeRetainedAnnotation4.java │ │ │ ├── RuntimeRetainedAnnotation1.java │ │ │ └── RuntimeRetainedAnnotation2.java │ │ │ ├── bug172 │ │ │ ├── package-info.java │ │ │ └── First.java │ │ │ ├── bug180 │ │ │ ├── package-info.java │ │ │ └── UnaryDoubleFunction.java │ │ │ ├── package-info.java │ │ │ └── JlsWithDifferentJresTest.java │ │ ├── for_sandbox_tests │ │ ├── ClassWithFields.java │ │ ├── BaseOfBaseOfExternalClass.java │ │ ├── InterfaceOfExternalClass.java │ │ ├── InterfaceOfBaseOfExternalClass.java │ │ ├── package-info.java │ │ ├── OtherExternalClass.java │ │ ├── BaseOfExternalClass.java │ │ ├── ProtectedVariable.java │ │ └── ExternalClass.java │ │ ├── other_package │ │ ├── Base.java │ │ ├── package-info.java │ │ └── ScopingRules.java │ │ └── util │ │ └── package-info.java ├── .settings │ ├── org.eclipse.m2e.core.prefs │ └── org.eclipse.core.resources.prefs ├── .project ├── .checkstyle ├── .classpath └── pom.xml ├── README.md ├── janino-parent ├── dummy-keystore ├── .settings │ └── org.eclipse.core.resources.prefs ├── .project └── checkstyle-configuration │ └── java-header.txt ├── .gitignore └── LICENSE /commons-compiler/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | -------------------------------------------------------------------------------- /janino/build/.gitignore: -------------------------------------------------------------------------------- 1 | /eclipse/ 2 | -------------------------------------------------------------------------------- /commons-compiler-jdk/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | -------------------------------------------------------------------------------- /commons-compiler-jdk/src/test/java/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /commons-compiler-tests/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/main/java/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /janino/.hgignore: -------------------------------------------------------------------------------- 1 | syntax: glob 2 | 3 | eclipse-classes 4 | build/** 5 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/resources/testBundles/MyBundle.properties: -------------------------------------------------------------------------------- 1 | a=b 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Please visit the [project homepage](http://janino-compiler.github.io/janino/). 2 | -------------------------------------------------------------------------------- /janino/lib/ant-1.7.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/janino-compiler/janino/HEAD/janino/lib/ant-1.7.1.jar -------------------------------------------------------------------------------- /janino-parent/dummy-keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/janino-compiler/janino/HEAD/janino-parent/dummy-keystore -------------------------------------------------------------------------------- /janino/src/test/java/org.codehaus.commons.compiler.tests.properties: -------------------------------------------------------------------------------- 1 | test=org.codehaus.janino.tests.JaninoTests 2 | -------------------------------------------------------------------------------- /janino-parent/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/com/company/User.java: -------------------------------------------------------------------------------- 1 | package com.company; 2 | 3 | public class User { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/resources/testBundles/path/to/some_resource.txt: -------------------------------------------------------------------------------- 1 | This is the content of some resource... 2 | -------------------------------------------------------------------------------- /janino/src/main/resources/META-INF/services/org.codehaus.commons.compiler.ICompilerFactory: -------------------------------------------------------------------------------- 1 | org.codehaus.janino.CompilerFactory 2 | -------------------------------------------------------------------------------- /commons-compiler/src/test/resources/foobar.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/janino-compiler/janino/HEAD/commons-compiler/src/test/resources/foobar.zip -------------------------------------------------------------------------------- /janino/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/resources/Bug 106/b/C1.java: -------------------------------------------------------------------------------- 1 | 2 | package b; 3 | 4 | public 5 | class C1 { 6 | public static int A = 0; 7 | } 8 | -------------------------------------------------------------------------------- /commons-compiler-jdk/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /commons-compiler-jdk/src/main/resources/META-INF/services/org.codehaus.commons.compiler.ICompilerFactory: -------------------------------------------------------------------------------- 1 | org.codehaus.commons.compiler.jdk.CompilerFactory 2 | -------------------------------------------------------------------------------- /commons-compiler/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /commons-compiler-tests/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/resources/Bug 106/a/C2.java: -------------------------------------------------------------------------------- 1 | 2 | package a; 3 | 4 | public 5 | class C2 { 6 | private static int A = 0; 7 | public static int B = 0; 8 | } 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # ignore bin and build dirs 2 | **/bin/ 3 | **/build/ 4 | **/target 5 | 6 | # ignore .project since everyone's different! 7 | **/.project 8 | 9 | # ignore temp files 10 | *~ 11 | -------------------------------------------------------------------------------- /commons-compiler-jdk/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | encoding//src/main/resources=UTF-8 4 | encoding//src/test/java=UTF-8 5 | encoding/=UTF-8 6 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/org/codehaus/commons/compiler/tests/issue212/base/IBase.java: -------------------------------------------------------------------------------- 1 | 2 | package org.codehaus.commons.compiler.tests.issue212.base; 3 | 4 | public 5 | interface IBase { 6 | IBase path(); 7 | } 8 | -------------------------------------------------------------------------------- /commons-compiler/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | encoding//src/test/java=UTF-8 4 | encoding//src/test/resources=UTF-8 5 | encoding/=UTF-8 6 | -------------------------------------------------------------------------------- /commons-compiler-tests/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | encoding//src/test/java=UTF-8 4 | encoding//src/test/resources=UTF-8 5 | encoding/=UTF-8 6 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/com/company/user/Country.java: -------------------------------------------------------------------------------- 1 | 2 | package com.company.user; 3 | 4 | public 5 | class Country { 6 | public static int 7 | get() { 8 | return 99; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/resources/issue53/pkg1/Enum1.java: -------------------------------------------------------------------------------- 1 | 2 | package pkg1; 3 | 4 | public enum Enum1 { 5 | GET, 6 | PUT, 7 | POST, 8 | DELETE, 9 | PATCH, 10 | OPTIONS, 11 | HEAD, 12 | TRACE, 13 | CONNECT; 14 | } 15 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/resources/issue53/pkg2/Enum1.java: -------------------------------------------------------------------------------- 1 | 2 | package pkg2; 3 | 4 | public enum Enum1 { 5 | GET, 6 | PUT, 7 | POST, 8 | DELETE, 9 | PATCH, 10 | OPTIONS, 11 | HEAD, 12 | TRACE, 13 | CONNECT; 14 | } 15 | -------------------------------------------------------------------------------- /janino/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | encoding//src/main/resources=UTF-8 4 | encoding//src/test/java=UTF-8 5 | encoding//src/test/resources=UTF-8 6 | encoding/=UTF-8 7 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/resources/testOverloadedStaticImports/test/C1.java: -------------------------------------------------------------------------------- 1 | 2 | package test; 3 | 4 | public 5 | class C1 { 6 | 7 | public static String 8 | testOverload(int param) { 9 | return "Hello World (int): " + param; 10 | } 11 | } -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/resources/Bug 106/b/C3.java: -------------------------------------------------------------------------------- 1 | 2 | package b; 3 | 4 | import static a.C2.*; 5 | import static b.C1.*; 6 | 7 | public 8 | class C3 { 9 | public static void 10 | main(String[] args) { 11 | System.out.println(A + B); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/resources/testBundles/test/GetBundle.java: -------------------------------------------------------------------------------- 1 | 2 | package test; 3 | 4 | import java.util.ResourceBundle; 5 | 6 | public class GetBundle { 7 | 8 | public static ResourceBundle main() { 9 | return ResourceBundle.getBundle("MyBundle"); 10 | } 11 | } -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/resources/testCircularSingleTypeImports/test/Func1.java: -------------------------------------------------------------------------------- 1 | 2 | package test; 3 | 4 | import test.Func2; 5 | 6 | public 7 | class Func1 { 8 | public static boolean 9 | func1() throws Exception { 10 | return Func2.func2(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/resources/testCircularSingleTypeImports/test/Func2.java: -------------------------------------------------------------------------------- 1 | 2 | package test; 3 | 4 | import test.Func1; 5 | 6 | public 7 | class Func2 { 8 | public static boolean 9 | func2() throws Exception { 10 | return Func1.func1(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/resources/testCircularStaticImports/test/Func1.java: -------------------------------------------------------------------------------- 1 | 2 | package test; 3 | 4 | import static test.Func2.func2; 5 | 6 | public 7 | class Func1 { 8 | public static boolean 9 | func1() throws Exception { 10 | return true; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/resources/testCircularStaticImports/test/Func2.java: -------------------------------------------------------------------------------- 1 | 2 | package test; 3 | 4 | import static test.Func1.func1; 5 | 6 | public 7 | class Func2 { 8 | public static boolean 9 | func2() throws Exception { 10 | return true; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /janino/src/main/java/org/codehaus/janino/TODO.txt: -------------------------------------------------------------------------------- 1 | The raw, inofficial list of TODOs: 2 | 3 | * Implement '@SuppressWarnings'; supersede JANINO's old '-warn:...' feature 4 | * Implement ENUMs 5 | 6 | Recently implemented: 7 | * ASSERT (simplified, ASSERTions are ALWAYS enabled, as if '-ea' were set) 8 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/resources/testOverloadedStaticImports/test/SingleStaticImport.java: -------------------------------------------------------------------------------- 1 | 2 | package test; 3 | 4 | import static test.C2.testOverload; 5 | 6 | public 7 | class SingleStaticImport { 8 | 9 | public void 10 | execute() { 11 | System.out.println(testOverload((long) 2)); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/resources/testOverloadedStaticImports/test/C2.java: -------------------------------------------------------------------------------- 1 | 2 | package test; 3 | 4 | public 5 | class C2 { 6 | 7 | public static String 8 | testOverload(long param) { 9 | return "Hello World (long): " + param; 10 | } 11 | 12 | public static String 13 | testOverload(short param) { 14 | return "Hello World (short): " + param; 15 | } 16 | } -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/resources/testOverloadedStaticImports/test/StaticImports.java: -------------------------------------------------------------------------------- 1 | 2 | package test; 3 | 4 | import static test.C1.*; 5 | import static test.C2.*; 6 | 7 | public 8 | class StaticImports { 9 | 10 | public void 11 | execute() { 12 | System.out.println(testOverload((short) 1)); 13 | System.out.println(testOverload((long) 2)); 14 | System.out.println(testOverload((int) 3)); 15 | } 16 | } -------------------------------------------------------------------------------- /janino/src/test/resources/a/Test.java: -------------------------------------------------------------------------------- 1 | 2 | package a; 3 | // ISSUE: https://github.com/codehaus/janino/issues/4 4 | public 5 | class Test { 6 | public class Parent { 7 | void foo() { System.out.println("from parent"); } 8 | } 9 | 10 | public class Child extends Parent { 11 | void foo() { System.out.println("from child"); } 12 | 13 | void bar() { 14 | Child.super.foo(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /janino-parent/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | janino-parent 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.m2e.core.maven2Builder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.m2e.core.maven2Nature 16 | 17 | 18 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/for_sandbox_tests/ClassWithFields.java: -------------------------------------------------------------------------------- 1 | 2 | // SUPPRESS CHECKSTYLE .:9999 3 | 4 | package for_sandbox_tests; 5 | 6 | public 7 | class ClassWithFields { 8 | 9 | public static int publicField = 1; 10 | protected static int protectedField = 2; 11 | static int packageAccessField = 3; 12 | @SuppressWarnings("unused") private static int privateField = 4; 13 | } 14 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/org/codehaus/commons/compiler/tests/issue212/base/DerivedClass.java: -------------------------------------------------------------------------------- 1 | 2 | package org.codehaus.commons.compiler.tests.issue212.base; 3 | 4 | public 5 | class DerivedClass extends BaseClass { 6 | 7 | public 8 | DerivedClass() { super(7); } 9 | 10 | @Override public BaseClass 11 | path() { 12 | return new DerivedClass(); 13 | } 14 | 15 | @Override public String 16 | toString() { 17 | return super.toString() + " DerivedClass"; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /commons-compiler/.checkstyle: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /commons-compiler-jdk/.checkstyle: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/org/codehaus/commons/compiler/tests/issue212/base/BaseClass.java: -------------------------------------------------------------------------------- 1 | 2 | package org.codehaus.commons.compiler.tests.issue212.base; 3 | 4 | public abstract class BaseClass implements IBase { 5 | 6 | // To reproduce the problem, there must be two or more constructors, with zero or more parameters: 7 | 8 | // public BaseClass() {} 9 | public BaseClass(long l) {} 10 | public BaseClass(int i) {} 11 | 12 | @Override public abstract BaseClass 13 | path(); 14 | 15 | @Override public String 16 | toString() { 17 | return "BaseClass"; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /janino/bin/janinoc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This is JANINOC, the "Janino Java Compiler". 4 | # It is a drop-in replacement for the JDK's "JAVAC" tool. 5 | 6 | maven_repo="C:/Server/mavenrepo"; 7 | janino_version="3.0.16-SNAPSHOT"; 8 | 9 | janino_jar="$maven_repo/org/codehaus/janino/janino/$janino_version/janino-$janino_version.jar"; 10 | commons_compiler_jar="$maven_repo/org/codehaus/janino/commons-compiler/$janino_version/commons-compiler-$janino_version.jar"; 11 | 12 | main_class=org.codehaus.commons.compiler.samples.CompilerDemo; 13 | 14 | cp="$janino_jar;$commons_compiler_jar"; 15 | 16 | java="$JAVA_HOME/jre/bin/java"; 17 | 18 | "$java" -classpath "$cp" "$main_class" "$@"; 19 | -------------------------------------------------------------------------------- /janino/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | janino 4 | 5 | 6 | de.unkrig.checkstyle-configuration 7 | 8 | 9 | 10 | org.eclipse.jdt.core.javabuilder 11 | 12 | 13 | 14 | 15 | org.eclipse.m2e.core.maven2Builder 16 | 17 | 18 | 19 | 20 | 21 | org.eclipse.m2e.core.maven2Nature 22 | org.eclipse.jdt.core.javanature 23 | 24 | 25 | -------------------------------------------------------------------------------- /commons-compiler/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | commons-compiler 4 | 5 | 6 | de.unkrig.checkstyle-configuration 7 | 8 | 9 | 10 | org.eclipse.jdt.core.javabuilder 11 | 12 | 13 | 14 | 15 | org.eclipse.m2e.core.maven2Builder 16 | 17 | 18 | 19 | 20 | 21 | org.eclipse.m2e.core.maven2Nature 22 | org.eclipse.jdt.core.javanature 23 | 24 | 25 | -------------------------------------------------------------------------------- /commons-compiler-jdk/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | commons-compiler-jdk 4 | 5 | 6 | de.unkrig.checkstyle-configuration 7 | 8 | 9 | 10 | org.eclipse.jdt.core.javabuilder 11 | 12 | 13 | 14 | 15 | org.eclipse.m2e.core.maven2Builder 16 | 17 | 18 | 19 | 20 | 21 | org.eclipse.m2e.core.maven2Nature 22 | org.eclipse.jdt.core.javanature 23 | 24 | 25 | -------------------------------------------------------------------------------- /commons-compiler-tests/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | commons-compiler-tests 4 | 5 | 6 | de.unkrig.checkstyle-configuration 7 | 8 | 9 | 10 | org.eclipse.jdt.core.javabuilder 11 | 12 | 13 | 14 | 15 | org.eclipse.m2e.core.maven2Builder 16 | 17 | 18 | 19 | 20 | 21 | org.eclipse.m2e.core.maven2Nature 22 | org.eclipse.jdt.core.javanature 23 | 24 | 25 | -------------------------------------------------------------------------------- /janino/.checkstyle: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /commons-compiler-tests/.checkstyle: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /commons-compiler/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /commons-compiler-tests/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /commons-compiler-jdk/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /janino/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Janino - An embedded Java[TM] compiler 2 | 3 | Copyright (c) 2001-2016, Arno Unkrig 4 | Copyright (c) 2015-2016 TIBCO Software Inc. 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions 9 | are met: 10 | 11 | 1. Redistributions of source code must retain the above copyright 12 | notice, this list of conditions and the following disclaimer. 13 | 2. Redistributions in binary form must reproduce the above 14 | copyright notice, this list of conditions and the following 15 | disclaimer in the documentation and/or other materials 16 | provided with the distribution. 17 | 3. Neither the name of JANINO nor the names of its contributors 18 | may be used to endorse or promote products derived from this 19 | software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 29 | IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 30 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 31 | IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | -------------------------------------------------------------------------------- /commons-compiler-jdk/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 4.0.0 6 | 7 | 8 | org.codehaus.janino 9 | janino-parent 10 | ../janino-parent 11 | 3.1.13-SNAPSHOT 12 | 13 | 14 | commons-compiler-jdk 15 | 16 | commons-compiler-jdk 17 | 18 | 19 | org.codehaus.commons.compiler.jdk 20 | 21 | 22 | 23 | 24 | org.codehaus.janino 25 | commons-compiler 26 | ${project.parent.version} 27 | 28 | 29 | 30 | 31 | 32 | 33 | org.apache.felix 34 | maven-bundle-plugin 35 | 36 | 37 | org.codehaus.commons.compiler.jdk, org.codehaus.commons.io 38 | org.codehaus.janino.commons-compiler 39 | 40 | 41 | 42 | 43 | 44 | The "JDK" implementation of the "commons-compiler" API that uses the JDK's Java compiler (JAVAC) in "tools.jar". 45 | 46 | -------------------------------------------------------------------------------- /janino/src/test/java/other_package2/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2013 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /***/ 27 | package other_package2; // SUPPRESS CHECKSTYLE PackageName 28 | -------------------------------------------------------------------------------- /janino/src/main/java/org/codehaus/janino/IType.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2021 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.janino; 27 | 28 | public 29 | interface IType { 30 | } 31 | -------------------------------------------------------------------------------- /janino-parent/checkstyle-configuration/java-header.txt: -------------------------------------------------------------------------------- 1 | ^$ 2 | ^/\*$ 3 | ^ \* Janino - An embedded Java\[TM\] compiler$ 4 | ^ \*$ 5 | ^ \* Copyright \(c\) \d{4}(?:-\d{4}|(?:, \d{4})*) Arno Unkrig\. All rights reserved\.$ 6 | ^ \*$ 7 | ^ \* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the$ 8 | ^ \* following conditions are met:$ 9 | ^ \*$ 10 | ^ \* 1\. Redistributions of source code must retain the above copyright notice, this list of conditions and the$ 11 | ^ \* following disclaimer\.$ 12 | ^ \* 2\. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the$ 13 | ^ \* following disclaimer in the documentation and/or other materials provided with the distribution\.$ 14 | ^ \* 3\. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote$ 15 | ^ \* products derived from this software without specific prior written permission\.$ 16 | ^ \*$ 17 | ^ \* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,$ 18 | ^ \* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE$ 19 | ^ \* DISCLAIMED\. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,$ 20 | ^ \* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES \(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR$ 21 | ^ \* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION\) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,$ 22 | ^ \* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \(INCLUDING NEGLIGENCE OR OTHERWISE\) ARISING IN ANY WAY OUT OF THE USE$ 23 | ^ \* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\.$ 24 | ^ \*/$ 25 | ^$ 26 | -------------------------------------------------------------------------------- /janino/src/main/java/org/codehaus/janino/ITypeVariableOrIClass.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2021 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.janino; 27 | 28 | public 29 | interface ITypeVariableOrIClass extends IType { 30 | } 31 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/for_sandbox_tests/BaseOfBaseOfExternalClass.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package for_sandbox_tests; 27 | 28 | public 29 | class BaseOfBaseOfExternalClass { 30 | } 31 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/other_package/Base.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package other_package; 27 | 28 | public abstract 29 | class Base { 30 | public abstract void run(); 31 | } 32 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/for_sandbox_tests/InterfaceOfExternalClass.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package for_sandbox_tests; 27 | 28 | public 29 | interface InterfaceOfExternalClass { 30 | } 31 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/for_sandbox_tests/InterfaceOfBaseOfExternalClass.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package for_sandbox_tests; 27 | 28 | public 29 | interface InterfaceOfBaseOfExternalClass { 30 | } 31 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/for_sandbox_tests/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2013 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | @NotNullByDefault 27 | package for_sandbox_tests; 28 | 29 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 30 | -------------------------------------------------------------------------------- /janino/src/test/java/org/codehaus/janino/tests/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /***/ 27 | @NotNullByDefault 28 | package org.codehaus.janino.tests; 29 | 30 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 31 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/for_sandbox_tests/OtherExternalClass.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package for_sandbox_tests; 27 | 28 | public 29 | class OtherExternalClass { 30 | public static int m1() { return 7; } 31 | } 32 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/io/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2019 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /***/ 27 | @NotNullByDefault 28 | package org.codehaus.commons.compiler.io; 29 | 30 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 31 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/org/codehaus/commons/compiler/tests/bug63/IPred.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler.tests.bug63; 27 | public 28 | interface IPred { 29 | boolean filter() throws Exception; 30 | } 31 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/util/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2013 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /** 27 | * Utility classes for testing. 28 | */ 29 | @NotNullByDefault 30 | package util; 31 | 32 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 33 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/lang/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2019 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /***/ 27 | @NotNullByDefault 28 | package org.codehaus.commons.compiler.lang; 29 | 30 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 31 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/other_package/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2013 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /***/ 27 | @NotNullByDefault 28 | package other_package; // SUPPRESS CHECKSTYLE PackageName 29 | 30 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 31 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/for_sandbox_tests/BaseOfExternalClass.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package for_sandbox_tests; 27 | 28 | public 29 | class BaseOfExternalClass extends BaseOfBaseOfExternalClass implements InterfaceOfBaseOfExternalClass { 30 | } 31 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/for_sandbox_tests/ProtectedVariable.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package for_sandbox_tests; 27 | 28 | public 29 | class ProtectedVariable { 30 | protected int var = 1; 31 | protected static int svar = 2; 32 | } 33 | -------------------------------------------------------------------------------- /commons-compiler-jdk/src/main/java/org/codehaus/commons/compiler/jdk/util/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2013 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /***/ 27 | @NotNullByDefault 28 | package org.codehaus.commons.compiler.jdk.util; 29 | 30 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 31 | 32 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/org/codehaus/commons/compiler/tests/issue32/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2013 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | @NotNullByDefault 27 | package org.codehaus.commons.compiler.tests.issue32; 28 | 29 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 30 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/util/iterator/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2019 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /***/ 27 | @NotNullByDefault 28 | package org.codehaus.commons.compiler.util.iterator; 29 | 30 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 31 | -------------------------------------------------------------------------------- /commons-compiler/src/test/java/org/codehaus/commons/compiler/util/tests/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /***/ 27 | @NotNullByDefault 28 | package org.codehaus.commons.compiler.util.tests; 29 | 30 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 31 | -------------------------------------------------------------------------------- /janino/src/main/java/org/codehaus/janino/IParameterizedType.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2021 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.janino; 27 | 28 | public 29 | interface IParameterizedType extends IType { 30 | 31 | IType[] getActualTypeArguments(); 32 | IType getRawType(); 33 | } 34 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/org/codehaus/commons/compiler/tests/annotation/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2016 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /***/ 27 | @NotNullByDefault 28 | package org.codehaus.commons.compiler.tests.annotation; 29 | 30 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 31 | -------------------------------------------------------------------------------- /janino/src/main/java/org/codehaus/janino/util/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2013 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /** 27 | * Application-independent helper classes. 28 | */ 29 | @NotNullByDefault 30 | package org.codehaus.janino.util; 31 | 32 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 33 | -------------------------------------------------------------------------------- /janino/src/main/java/org/codehaus/janino/tools/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2013 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /** 27 | * Auxiliary command line tools related to JANINO. 28 | */ 29 | @NotNullByDefault 30 | package org.codehaus.janino.tools; 31 | 32 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 33 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/org/codehaus/commons/compiler/tests/bug63/Pred.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler.tests.bug63; 27 | public 28 | class Pred implements IPred { 29 | 30 | @Override public boolean 31 | filter() { return false; } 32 | } 33 | -------------------------------------------------------------------------------- /janino/src/main/java/org/codehaus/janino/samples/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2013 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /** 27 | * Sample applications for the Janino Java compiler. 28 | */ 29 | @NotNullByDefault 30 | package org.codehaus.janino.samples; 31 | 32 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 33 | -------------------------------------------------------------------------------- /janino/src/main/java/org/codehaus/janino/util/charstream/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2022 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /** 27 | * Application-independent helper classes. 28 | */ 29 | @NotNullByDefault 30 | package org.codehaus.janino.util.charstream; 31 | 32 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 33 | -------------------------------------------------------------------------------- /janino/src/main/java/org/codehaus/janino/util/signature/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2022 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /** 27 | * Application-independent helper classes. 28 | */ 29 | @NotNullByDefault 30 | package org.codehaus.janino.util.signature; 31 | 32 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 33 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/util/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2018 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /** 27 | * Utility functionality for this project. 28 | */ 29 | @NotNullByDefault 30 | package org.codehaus.commons.compiler.util; 31 | 32 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 33 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/org/codehaus/commons/compiler/tests/bug63/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2013 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /** 27 | * Helper classes for bug #63. 28 | */ 29 | @NotNullByDefault 30 | package org.codehaus.commons.compiler.tests.bug63; 31 | 32 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 33 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/samples/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2013 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /** 27 | * Sample applications for the Janino Java compiler. 28 | */ 29 | @NotNullByDefault 30 | package org.codehaus.commons.compiler.samples; 31 | 32 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 33 | -------------------------------------------------------------------------------- /janino/src/test/java/other_package2/ScopingRules.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package other_package2; 27 | 28 | public 29 | class ScopingRules { 30 | 31 | protected 32 | class ProtectedInner { 33 | public void publicMethod() {} 34 | } 35 | 36 | public static double publicStaticDouble = Math.PI; 37 | } 38 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/util/reflect/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2019 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /** 27 | * Utility functionality related to {@code java.util.reflect}. 28 | */ 29 | @NotNullByDefault 30 | package org.codehaus.commons.compiler.util.reflect; 31 | 32 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 33 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/other_package/ScopingRules.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package other_package; 27 | 28 | public 29 | class ScopingRules { 30 | 31 | protected 32 | class ProtectedInner { 33 | public void publicMethod() {} 34 | } 35 | 36 | public static double publicStaticDouble = Math.PI; 37 | } 38 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/org/codehaus/commons/compiler/tests/bug172/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2014 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /** 27 | * Declares a helper class for {@link ReportedBugsTest#testBug172()}. 28 | */ 29 | @NotNullByDefault 30 | package org.codehaus.commons.compiler.tests.bug172; 31 | 32 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 33 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/org/codehaus/commons/compiler/tests/bug180/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2014 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /** 27 | * Declares a helper class for {@link ReportedBugsTest#testBug172()}. 28 | */ 29 | @NotNullByDefault 30 | package org.codehaus.commons.compiler.tests.bug180; 31 | 32 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 33 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/org/codehaus/commons/compiler/tests/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2013 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /** 27 | * This package contains JUnit 4 test cases for {@code org.codehaus.commons.compiler}. 28 | */ 29 | @NotNullByDefault 30 | package org.codehaus.commons.compiler.tests; 31 | 32 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 33 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/java8/java/util/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2019 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /** 27 | * A set of (rudimentary) proxies for Java-8+ classes that also compile for Java 6 and 7. 28 | */ 29 | @NotNullByDefault 30 | package org.codehaus.commons.compiler.java8.java.util; 31 | 32 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 33 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/java8/java/util/stream/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2019 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /** 27 | * A set of (rudimentary) proxies for Java-8+ classes that also compile for Java 6 and 7. 28 | */ 29 | @NotNullByDefault 30 | package org.codehaus.commons.compiler.java8.java.util.stream; 31 | 32 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 33 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/java8/java/util/function/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2019 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /** 27 | * A set of (rudimentary) proxies for Java-8+ classes that also compile for Java 6 and 7. 28 | */ 29 | @NotNullByDefault 30 | package org.codehaus.commons.compiler.java8.java.util.function; 31 | 32 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 33 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/java9/java/lang/module/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2013 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /** 27 | * A set of (rudimentary) proxies for Java-9+ classes that also compile for Java 6-8. 28 | */ 29 | @NotNullByDefault 30 | package org.codehaus.commons.compiler.java9.java.lang.module; 31 | 32 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 33 | 34 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/org/codehaus/commons/compiler/tests/annotation/RuntimeRetainedAnnotation4Enum.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2016 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler.tests.annotation; 27 | 28 | /** 29 | * An enum for an annotation type with retention policy "Runtime". 30 | */ 31 | public 32 | enum RuntimeRetainedAnnotation4Enum { 33 | FIRST, 34 | SECOND, 35 | THIRD 36 | } 37 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/util/reflect/NoException.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2019 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler.util.reflect; 27 | 28 | /** 29 | * An exception that is never instantiated, and is useful for declaration of methods that throw a parameterized {@link 30 | * Throwable}. 31 | */ 32 | public final 33 | class NoException extends RuntimeException { private NoException() {} } 34 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/org/codehaus/commons/compiler/tests/bug180/UnaryDoubleFunction.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2014 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler.tests.bug180; 27 | 28 | /** 29 | * Interface needed for {@link ReportedBugsTest#testBug180()}. 30 | */ 31 | public 32 | interface UnaryDoubleFunction { 33 | 34 | /** 35 | * Purpose is ficticious. 36 | */ 37 | double evaluate(double x); 38 | } 39 | -------------------------------------------------------------------------------- /commons-compiler-jdk/src/main/java/org/codehaus/commons/compiler/jdk/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2013 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /** 27 | * An implementation of the {@code org.codehaus.commons.compiler} API that uses the "JAVAC" Java compiler that is 28 | * part of the "Java Development Kit" (JDK). 29 | */ 30 | @NotNullByDefault 31 | package org.codehaus.commons.compiler.jdk; 32 | 33 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 34 | 35 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/org/codehaus/commons/compiler/tests/bug172/First.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2014 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler.tests.bug172; 27 | 28 | import org.codehaus.commons.compiler.tests.ReportedBugsTest; 29 | 30 | /** 31 | * For {@link ReportedBugsTest#testBug172()}. 32 | */ 33 | public 34 | class First { 35 | 36 | /** 37 | * Purpose is fictitious. 38 | */ 39 | public int field1; 40 | } 41 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/util/iterator/UniterableElementException.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler.util.iterator; 27 | 28 | /** 29 | * Thrown by {@link MultiDimensionalIterator} to indicate that it has encountered an element that cannot be iterated. 30 | */ 31 | public 32 | class UniterableElementException extends RuntimeException { 33 | 34 | public UniterableElementException() {} 35 | } 36 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/util/resource/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2019 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /** 27 | * Classes related to loading "resources" ({@link org.codehaus.commons.compiler.util.resource.ResourceFinder}) and 28 | * creating resources ({@link org.codehaus.commons.compiler.util.resource.ResourceCreator}). 29 | */ 30 | @NotNullByDefault 31 | package org.codehaus.commons.compiler.util.resource; 32 | 33 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 34 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/util/Predicate.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2019 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler.util; 27 | 28 | import org.codehaus.commons.nullanalysis.Nullable; 29 | 30 | /** 31 | * @param 32 | * @see #evaluate(Object) 33 | */ 34 | public 35 | interface Predicate { 36 | 37 | /** 38 | * @return Whether the subject fulfils a particular condition 39 | */ 40 | boolean 41 | evaluate(@Nullable T subject); 42 | } 43 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/ErrorHandler.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler; 27 | 28 | import org.codehaus.commons.nullanalysis.Nullable; 29 | 30 | /** 31 | * Processes an error issued by the compiler. 32 | */ 33 | public 34 | interface ErrorHandler { 35 | 36 | /** 37 | * May or may not choose to throw a {@link CompileException}. 38 | */ 39 | void handleError(String message, @Nullable Location location) throws CompileException; 40 | } 41 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/resources/a/TestLocalVarTable.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * Copyright (c) 2015-2016 TIBCO Software Inc. All rights reserved. // CHECKSTYLE:OFF CHECKSTYLE:ON 7 | * 8 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 9 | * following conditions are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 12 | * following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 14 | * following disclaimer in the documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 16 | * products derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 19 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 23 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | package a; 28 | 29 | // Issue #5 : ClassFormatError: Invalid start_pc 65459 in LocalVariableTable in class file 30 | public 31 | class TestLocalVarTable { 32 | void foo() { 33 | double a = 1.0; 34 | if (false) 35 | { 36 | double b; 37 | b = 1.0; 38 | } 39 | } 40 | } 41 | 42 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/util/resource/LocatableResource.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2019 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler.util.resource; 27 | 28 | import java.io.IOException; 29 | import java.net.URL; 30 | 31 | /** 32 | * A {@link Resource} that can be addressed by a URL. 33 | */ 34 | public 35 | interface LocatableResource extends Resource { 36 | 37 | /** 38 | * @return A locator that addresses this resource's contents 39 | */ 40 | URL getLocation() throws IOException; 41 | } 42 | -------------------------------------------------------------------------------- /janino/src/main/java/org/codehaus/janino/IWildcardType.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2021 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.janino; 27 | 28 | import org.codehaus.commons.nullanalysis.Nullable; 29 | 30 | public 31 | interface IWildcardType extends IType { 32 | 33 | /** 34 | * @return The type of the {@code extends} clause, or {@code Object.class} 35 | */ 36 | IType getUpperBound(); 37 | 38 | /** 39 | * @return The type of the {@code super} clause, or {@code null} 40 | */ 41 | @Nullable IType getLowerBound(); 42 | } 43 | -------------------------------------------------------------------------------- /janino/src/main/java/org/codehaus/janino/UnicodeUnescapeException.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.janino; 27 | 28 | /** 29 | * Represents a problem that occurred while unescaping a unicode escape sequence through a {@link 30 | * UnicodeUnescapeReader}. 31 | */ 32 | public 33 | class UnicodeUnescapeException extends RuntimeException { 34 | 35 | public 36 | UnicodeUnescapeException(String message) { super(message); } 37 | 38 | public 39 | UnicodeUnescapeException(String message, Throwable cause) { super(message, cause); } 40 | } 41 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/org/codehaus/commons/compiler/tests/annotation/RuntimeRetainedAnnotation5.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2016 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler.tests.annotation; 27 | 28 | import static java.lang.annotation.ElementType.TYPE; 29 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 30 | 31 | import java.lang.annotation.Retention; 32 | import java.lang.annotation.Target; 33 | 34 | /** 35 | * An annotation type with retention policy "Runtime". 36 | */ 37 | @Target(TYPE) @Retention(RUNTIME) public 38 | @interface RuntimeRetainedAnnotation5 { 39 | Class[] value(); 40 | } 41 | -------------------------------------------------------------------------------- /commons-compiler/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 4.0.0 6 | 7 | 8 | org.codehaus.janino 9 | janino-parent 10 | 3.1.13-SNAPSHOT 11 | ../janino-parent 12 | 13 | 14 | commons-compiler 15 | 16 | commons-compiler 17 | 18 | 19 | org.codehaus.commons.compiler 20 | 21 | 22 | 23 | 24 | 25 | org.apache.felix 26 | maven-bundle-plugin 27 | 28 | 29 | 30 | org.codehaus.commons.compiler, 31 | org.codehaus.commons.compiler.io, 32 | org.codehaus.commons.compiler.java8.java.util, 33 | org.codehaus.commons.compiler.java8.java.util.function, 34 | org.codehaus.commons.compiler.java8.java.util.stream, 35 | org.codehaus.commons.compiler.java9.java.lang.module, 36 | org.codehaus.commons.compiler.lang, 37 | org.codehaus.commons.compiler.samples, 38 | org.codehaus.commons.compiler.util, 39 | org.codehaus.commons.compiler.util.iterator, 40 | org.codehaus.commons.compiler.util.reflect, 41 | org.codehaus.commons.compiler.util.resource 42 | 43 | 44 | 45 | 46 | 47 | 48 | The "commons-compiler" API, including the "IExpressionEvaluator", "IScriptEvaluator", "IClassBodyEvaluator" and "ISimpleCompiler" interfaces. 49 | 50 | 51 | junit 52 | junit 53 | test 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /janino/src/main/java/org/codehaus/janino/ITypeVariable.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2021 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.janino; 27 | 28 | import org.codehaus.commons.compiler.CompileException; 29 | 30 | /** 31 | * Type bounds can either be a class or interface type, or a type variable. Example: {@code MySet} 33 | */ 34 | public 35 | interface ITypeVariable extends ITypeVariableOrIClass { 36 | 37 | String getName(); 38 | 39 | /** 40 | * @return A zero-length array if this type variable has no bounds 41 | */ 42 | ITypeVariableOrIClass[] getBounds() throws CompileException; 43 | } 44 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/org/codehaus/commons/compiler/tests/annotation/RuntimeRetainedAnnotation4.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2016 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler.tests.annotation; 27 | 28 | import static java.lang.annotation.ElementType.FIELD; 29 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 30 | 31 | import java.lang.annotation.Retention; 32 | import java.lang.annotation.Target; 33 | 34 | /** 35 | * An annotation type with retention policy "Runtime". 36 | */ 37 | @Target(FIELD) 38 | @Retention(RUNTIME) 39 | public 40 | @interface RuntimeRetainedAnnotation4 { 41 | RuntimeRetainedAnnotation4Enum value(); 42 | } 43 | -------------------------------------------------------------------------------- /janino/src/main/java/org/codehaus/janino/util/charstream/UnexpectedCharacterException.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2021 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.janino.util.charstream; 27 | 28 | import java.io.IOException; 29 | 30 | /** 31 | * Indicates that {@link CharStream#read} did not find the character(s) it expected. 32 | */ 33 | public // SUPPRESS CHECKSTYLE CauseParameterInExceptionCheck 34 | class UnexpectedCharacterException extends IOException { 35 | 36 | private static final long serialVersionUID = 1L; 37 | 38 | public 39 | UnexpectedCharacterException() { 40 | } 41 | 42 | public 43 | UnexpectedCharacterException(String message) { 44 | super(message); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/nullanalysis/Nullable.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2016 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.nullanalysis; 27 | 28 | import java.lang.annotation.Documented; 29 | import java.lang.annotation.ElementType; 30 | import java.lang.annotation.Retention; 31 | import java.lang.annotation.RetentionPolicy; 32 | import java.lang.annotation.Target; 33 | 34 | /** 35 | * Designates that a field, return value, argument, or variable may be {@code null}. 36 | */ 37 | @Target({ 38 | ElementType.FIELD, 39 | ElementType.METHOD, 40 | ElementType.PARAMETER, 41 | ElementType.LOCAL_VARIABLE 42 | }) @Documented @Retention(RetentionPolicy.CLASS) public 43 | @interface Nullable {} 44 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/nullanalysis/NotNull.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2016 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.nullanalysis; 27 | 28 | import java.lang.annotation.Documented; 29 | import java.lang.annotation.ElementType; 30 | import java.lang.annotation.Retention; 31 | import java.lang.annotation.RetentionPolicy; 32 | import java.lang.annotation.Target; 33 | 34 | /** 35 | * Designates that a field, return value, argument, or variable is guaranteed to be non-null. 36 | */ 37 | @Target({ 38 | ElementType.FIELD, 39 | ElementType.METHOD, 40 | ElementType.PARAMETER, 41 | ElementType.LOCAL_VARIABLE 42 | }) @Documented @Retention(RetentionPolicy.CLASS) public 43 | @interface NotNull {} 44 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/for_sandbox_tests/ExternalClass.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package for_sandbox_tests; 27 | 28 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 29 | 30 | @NotNullByDefault(false) 31 | public 32 | class ExternalClass extends BaseOfExternalClass implements InterfaceOfExternalClass { 33 | public final OtherExternalClass x = new OtherExternalClass(); 34 | 35 | public static int m1() { return OtherExternalClass.m1(); } 36 | @SuppressWarnings("static-method") public OtherExternalClass m2() { return null; } 37 | public void m2(OtherExternalClass fc) {} 38 | } 39 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/org/codehaus/commons/compiler/tests/JlsWithDifferentJresTest.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2019 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler.tests; 27 | 28 | //import org.junit.runner.RunWith; 29 | //import org.junit.runners.Parameterized; 30 | 31 | //@RunWith(MultipleJresTestClassRunner.class) 32 | //@JavaHomes({ 33 | // "c:/Program Files/Java/jdk1.6.0_43", 34 | //// "c:/Program Files/Java/jdk1.7.0_17", 35 | //// "c:/Program Files/Java/jdk1.8.0_192", 36 | //// "c:/Program Files/Java/jdk-9.0.4", 37 | //// "c:/Program Files/Java/jdk-10.0.2", 38 | // "c:/Program Files/Java/jdk-11.0.1", 39 | //}) 40 | //@TestClass(value = JlsTest.class, runWith = Parameterized.class) 41 | public 42 | class JlsWithDifferentJresTest {} 43 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/java8/java/util/function/Consumer.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2018 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler.java8.java.util.function; 27 | 28 | import java.lang.reflect.Method; 29 | 30 | import org.codehaus.commons.compiler.util.reflect.Classes; 31 | 32 | /** 33 | * Facade for Java 8's {@code java.util.reflect.Consumer} interface. 34 | * 35 | * @param 36 | */ 37 | public 38 | interface Consumer { 39 | 40 | Class CLASS = Classes.load("java.util.function.Consumer"); // SUPPRESS CHECKSTYLE Javadoc 41 | 42 | // SUPPRESS CHECKSTYLE ConstantName|Javadoc:1 43 | Method METHOD_accept__T = Classes.getDeclaredMethod(Consumer.CLASS, "accept", Object.class); 44 | 45 | void accept(T t); // SUPPRESS CHECKSTYLE Javadoc|Alignment 46 | } 47 | -------------------------------------------------------------------------------- /commons-compiler-tests/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 4.0.0 6 | 7 | 8 | org.codehaus.janino 9 | janino-parent 10 | 3.1.13-SNAPSHOT 11 | ../janino-parent 12 | 13 | 14 | commons-compiler-tests 15 | 16 | commons-compiler-tests 17 | 18 | 19 | org.codehaus.commons.compiler.tests 20 | 21 | 22 | 23 | 24 | junit 25 | junit 26 | test 27 | 28 | 29 | org.codehaus.janino 30 | commons-compiler 31 | ${project.parent.version} 32 | test 33 | 34 | 35 | de.unkrig.jdisasm 36 | jdisasm 37 | 1.0.6 38 | test 39 | 40 | 41 | 42 | 43 | 44 | 45 | org.apache.maven.plugins 46 | maven-surefire-plugin 47 | 48 | 49 | 50 | 51 | 52 | 53 | ../janino/target/classes 54 | ../commons-compiler-jdk/target/classes 55 | 56 | 57 | 58 | 59 | 60 | jar 61 | Tests that use only the "commons-compiler" API and are thus applicable to ALL implementations. 62 | 63 | NOTICE: This module is not a test for "commons-compiler", but for a set of IMPLEMENTATIONS of "commons-compiler"! 64 | http://janino-compiler.github.io/janino/ 65 | 66 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/util/resource/DirectoryResourceCreator.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler.util.resource; 27 | 28 | import java.io.File; 29 | 30 | /** 31 | * Creates a resource in a given directory: 32 | *
33 |  *     destinationDirectory/resourceName
34 |  * 
35 | */ 36 | public 37 | class DirectoryResourceCreator extends FileResourceCreator { 38 | private final File destinationDirectory; 39 | 40 | public 41 | DirectoryResourceCreator(File destinationDirectory) { this.destinationDirectory = destinationDirectory; } 42 | 43 | @Override protected final File 44 | getFile(String resourceName) { 45 | return new File(this.destinationDirectory, resourceName.replace('/', File.separatorChar)); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/util/resource/LazyMultiResourceFinder.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler.util.resource; 27 | 28 | import java.util.Iterator; 29 | 30 | import org.codehaus.commons.compiler.util.iterator.IteratorCollection; 31 | 32 | /** 33 | * A {@link org.codehaus.commons.compiler.util.resource.ResourceFinder} that examines a set of {@link 34 | * org.codehaus.commons.compiler.util.resource.ResourceFinder}s lazily as it searches for resources. 35 | * 36 | * @see IteratorCollection 37 | */ 38 | public 39 | class LazyMultiResourceFinder extends MultiResourceFinder { 40 | 41 | /** 42 | * @param resourceFinders delegate {@link ResourceFinder}s 43 | */ 44 | public 45 | LazyMultiResourceFinder(Iterator resourceFinders) { 46 | super(new IteratorCollection<>(resourceFinders)); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/WarningHandler.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler; 27 | 28 | import org.codehaus.commons.nullanalysis.Nullable; 29 | 30 | /** 31 | * Processes a warning issued by the compiler. 32 | */ 33 | public 34 | interface WarningHandler { 35 | 36 | /** 37 | * May or may not choose to throw a {@link CompileException}. 38 | * 39 | * @param handle A string describing the category of the warning; used for filtering iff non-{@code 40 | * null} 41 | * @throws CompileException This {@link WarningHandler} wishes to terminate compilation, e.g. because "too many" 42 | * warnings have been reported 43 | */ 44 | void 45 | handleWarning(@Nullable String handle, String message, @Nullable Location location) 46 | throws CompileException; 47 | } 48 | -------------------------------------------------------------------------------- /janino/src/main/java/org/codehaus/janino/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2013 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /** 27 | * The core of the Janino Java compiler. 28 | *

29 | * The package comprises a scanner ({@link org.codehaus.janino.Scanner}, a parser ({@link 30 | * org.codehaus.janino.Parser}) and a class file library. The parser builds a syntax tree from the "Java.*" classes 31 | * that represents the parsed code. The {@link org.codehaus.janino.UnitCompiler#compileUnit(boolean, boolean, 32 | * boolean, org.codehaus.janino.UnitCompiler.ClassFileConsumer)} method compiles this syntax tree into a {@link 33 | * org.codehaus.janino.util.ClassFile} object, which can write JVM bytecode to an {@link java.io.OutputStream}. 34 | *

35 | *

36 | * This package implements the {@code org.codehaus.commons.compiler} API. 37 | *

38 | */ 39 | @NotNullByDefault 40 | package org.codehaus.janino; 41 | 42 | import org.codehaus.commons.nullanalysis.NotNullByDefault; 43 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/CompileException.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler; 27 | 28 | import org.codehaus.commons.nullanalysis.Nullable; 29 | 30 | /** 31 | * Representation of an error condition during compilation. 32 | */ 33 | public 34 | class CompileException extends LocatedException { 35 | 36 | /** 37 | * An infix {@code "NYI"} in the message string indicates that the compiler has a known limitation here. 38 | */ 39 | public 40 | CompileException(String message, @Nullable Location location) { 41 | super(message, location); 42 | } 43 | 44 | /** 45 | * An infix {@code "NYI"} in the message string indicates that the compiler has a known limitation here. 46 | */ 47 | public 48 | CompileException(String message, @Nullable Location location, Throwable cause) { 49 | super(message, location, cause); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/io/InputStreams.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2019 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler.io; 27 | 28 | import java.io.ByteArrayOutputStream; 29 | import java.io.IOException; 30 | import java.io.InputStream; 31 | import java.io.OutputStream; 32 | 33 | public final 34 | class InputStreams { 35 | 36 | private InputStreams() {} 37 | 38 | public static byte[] 39 | readAll(InputStream is) throws IOException { 40 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); 41 | InputStreams.copy(is, baos); 42 | return baos.toByteArray(); 43 | } 44 | 45 | public static void 46 | copy(InputStream is, OutputStream os) throws IOException { 47 | byte[] buffer = new byte[8192]; 48 | for (;;) { 49 | int n = is.read(buffer); 50 | if (n == -1) break; 51 | os.write(buffer, 0, n); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/org/codehaus/commons/compiler/tests/annotation/RuntimeRetainedAnnotation1.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2016 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler.tests.annotation; 27 | 28 | import static java.lang.annotation.ElementType.CONSTRUCTOR; 29 | import static java.lang.annotation.ElementType.FIELD; 30 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE; 31 | import static java.lang.annotation.ElementType.METHOD; 32 | import static java.lang.annotation.ElementType.PARAMETER; 33 | import static java.lang.annotation.ElementType.TYPE; 34 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 35 | 36 | import java.lang.annotation.Retention; 37 | import java.lang.annotation.Target; 38 | 39 | /** 40 | * A marker annotation type with retention policy "Runtime". 41 | */ 42 | @Target({ CONSTRUCTOR, FIELD, LOCAL_VARIABLE, METHOD, PARAMETER, TYPE }) 43 | @Retention(RUNTIME) 44 | public 45 | @interface RuntimeRetainedAnnotation1 { 46 | } 47 | -------------------------------------------------------------------------------- /commons-compiler-tests/src/test/java/org/codehaus/commons/compiler/tests/annotation/RuntimeRetainedAnnotation2.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2016 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler.tests.annotation; 27 | 28 | import static java.lang.annotation.ElementType.CONSTRUCTOR; 29 | import static java.lang.annotation.ElementType.FIELD; 30 | import static java.lang.annotation.ElementType.LOCAL_VARIABLE; 31 | import static java.lang.annotation.ElementType.METHOD; 32 | import static java.lang.annotation.ElementType.PARAMETER; 33 | import static java.lang.annotation.ElementType.TYPE; 34 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 35 | 36 | import java.lang.annotation.Retention; 37 | import java.lang.annotation.Target; 38 | 39 | /** 40 | * An annotation type with retention policy "Runtime". 41 | */ 42 | @Target({ CONSTRUCTOR, FIELD, LOCAL_VARIABLE, METHOD, PARAMETER, TYPE }) 43 | @Retention(RUNTIME) 44 | public 45 | @interface RuntimeRetainedAnnotation2 { 46 | String value(); 47 | } 48 | -------------------------------------------------------------------------------- /janino/src/main/java/org/codehaus/janino/JaninoOption.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2018 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.janino; 27 | 28 | /** 29 | * The compilation of {@link Compiler}, {@link JavaSourceIClassLoader}, {@link SimpleCompiler} and their subclasses 30 | * can be configured with these options. 31 | * 32 | * @see Compiler#options() 33 | * @see JavaSourceIClassLoader#options() 34 | * @see SimpleCompiler#options() 35 | */ 36 | public 37 | enum JaninoOption { 38 | 39 | /** 40 | * Contrary to the JLS, disallow access to {@code private} members of types enclosed by the the accessing code, or 41 | * enclosed by the accessing code, or enclosed by the same top-level type as the accessing code. 42 | */ 43 | PRIVATE_MEMBERS_OF_ENCLOSING_AND_ENCLOSED_TYPES_INACCESSIBLE, 44 | 45 | /** 46 | * Contrary to the JLS, allow any expression as a resource in a TRY-with-resources statement. 47 | */ 48 | EXPRESSIONS_IN_TRY_WITH_RESOURCES_ALLOWED, 49 | } 50 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/util/resource/StringResource.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2018 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler.util.resource; 27 | 28 | import java.io.ByteArrayInputStream; 29 | import java.io.InputStream; 30 | 31 | /** 32 | * A resource who's content is a {@link String}. 33 | */ 34 | public 35 | class StringResource implements Resource { 36 | 37 | private final String fileName; 38 | 39 | public 40 | StringResource(String fileName, String text) { 41 | this.fileName = fileName; 42 | this.data = text.getBytes(); 43 | } 44 | 45 | // Implement "Resource". 46 | @Override public final String getFileName() { return this.fileName; } 47 | @Override public final InputStream open() { return new ByteArrayInputStream(this.data); } 48 | @Override public final long lastModified() { return 0L; } 49 | 50 | @Override public final String toString() { return this.getFileName(); } 51 | 52 | private final byte[] data; 53 | } 54 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/util/resource/FileResourceFinder.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler.util.resource; 27 | 28 | import java.io.File; 29 | 30 | import org.codehaus.commons.nullanalysis.Nullable; 31 | 32 | /** 33 | * This class specializes the {@link org.codehaus.commons.compiler.util.resource.ResourceFinder} for finding resources 34 | * in {@link java.io.File}s. 35 | *

36 | * It finds {@link FileResource}s instead of simple {@link Resource}s. 37 | *

38 | */ 39 | public abstract 40 | class FileResourceFinder extends ListableResourceFinder { 41 | 42 | @Override @Nullable public final Resource 43 | findResource(String resourceName) { 44 | File file = this.findResourceAsFile(resourceName); 45 | if (file == null) return null; 46 | return new FileResource(file); 47 | } 48 | 49 | /** 50 | * Converts a given resource resource name into a {@link File}. 51 | */ 52 | @Nullable protected abstract File 53 | findResourceAsFile(String resourceName); 54 | } 55 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/java8/java/util/Optional.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2018 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler.java8.java.util; 27 | 28 | import java.lang.reflect.Method; 29 | 30 | import org.codehaus.commons.compiler.util.reflect.Classes; 31 | import org.codehaus.commons.compiler.util.reflect.Methods; 32 | import org.codehaus.commons.compiler.util.reflect.NoException; 33 | 34 | /** 35 | * Pre-Java-9-compatible facade for Java 9's {@code java.util.Optional} class. 36 | * 37 | * @param 38 | */ 39 | public 40 | class Optional { 41 | 42 | private static final Class CLASS = Classes.load("java.util.Optional"); 43 | 44 | // SUPPRESS CHECKSTYLE ConstantName:1 45 | private static final Method METHOD_get = Classes.getDeclaredMethod(Optional.CLASS, "get"); 46 | 47 | private final /*java.util.Optional*/ Object delegate; 48 | 49 | public 50 | Optional(/*java.util.Optional*/ Object delegate) { this.delegate = delegate; } 51 | 52 | public T 53 | get() { return Methods.invoke(Optional.METHOD_get, this.delegate); } 54 | } 55 | -------------------------------------------------------------------------------- /janino/src/main/java/org/codehaus/janino/Access.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.janino; 27 | 28 | /** 29 | * Return value for {@link IClass.IMember#getAccess}. 30 | */ 31 | public 32 | enum Access { 33 | 34 | /** 35 | * Representation of PRIVATE accessibility. 36 | */ 37 | PRIVATE, 38 | 39 | /** 40 | * Representation of PROTECTED accessibility. 41 | */ 42 | PROTECTED, 43 | 44 | /** 45 | * Representation of DEFAULT accessibility. 46 | */ 47 | DEFAULT, 48 | 49 | /** 50 | * Representation of PUBLIC accessibility. 51 | */ 52 | PUBLIC, 53 | 54 | ; 55 | 56 | /** 57 | * @return s, converted to {@link Access} 58 | */ 59 | public static Access 60 | fromString(String s) { 61 | if ("private".equals(s)) return PRIVATE; 62 | if ("protected".equals(s)) return PROTECTED; 63 | if ("public".equals(s)) return PUBLIC; 64 | throw new IllegalArgumentException(s); 65 | } 66 | 67 | @Override public String 68 | toString() { return this.name().toLowerCase(); } 69 | } 70 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/util/Producer.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler.util; 27 | 28 | import org.codehaus.commons.nullanalysis.Nullable; 29 | 30 | /** 31 | * An object that produces some {@link java.lang.Object} each time the {@link #produce()} method is invoked. This 32 | * behavior is similar to the {@link java.util.Iterator}, but is represented by one single {@link #produce()} method as 33 | * opposed to {@link java.util.Iterator}'s two methods {@link java.util.Iterator#hasNext()} and {@link 34 | * java.util.Iterator#next()}. This simplifies the implementation of certain complex iterations. 35 | * 36 | * @param The type of the products 37 | * @see org.codehaus.commons.compiler.util.iterator.DirectoryIterator 38 | * @see org.codehaus.commons.compiler.util.iterator.ProducerIterator 39 | */ 40 | public 41 | interface Producer { 42 | 43 | /** 44 | * Produces the next object. 45 | * 46 | * @return the next object or {@code null} to indicate that no more objects can be produced 47 | */ 48 | @Nullable T produce(); 49 | } 50 | -------------------------------------------------------------------------------- /janino/src/main/java/org/codehaus/janino/util/Annotatable.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2016 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.janino.util; 27 | 28 | import java.util.Map; 29 | 30 | /** 31 | * An object in a Java class file which can have annotations (classes, methods and fields). 32 | */ 33 | public 34 | interface Annotatable { 35 | 36 | /** 37 | * @return The annotations on this element; an empty array iff there are no annotations 38 | */ 39 | ClassFile.Annotation[] 40 | getAnnotations(boolean runtimeVisible); 41 | 42 | /** 43 | * Adds a "Runtime[In]visibleAnnotations" attribute to {@code this} object (if that annotation does not yet exist) 44 | * and adds an entry to it. 45 | * 46 | * @param elementValuePairs Maps "elemant_name_index" ({@link ClassFile.ConstantUtf8Info}) to "element_value", see 47 | * JVMS8 4.7.16 48 | */ 49 | void 50 | addAnnotationsAttributeEntry( 51 | boolean runtimeVisible, 52 | String fieldDescriptor, 53 | Map elementValuePairs 54 | ); 55 | } 56 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/util/iterator/EnumerationIterator.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler.util.iterator; 27 | 28 | import java.util.Enumeration; 29 | import java.util.Iterator; 30 | 31 | /** 32 | * An {@link java.util.Iterator} that iterates over the elements of an {@link java.util.Enumeration}. 33 | * 34 | * @param The element type of the enumeration and the iterator 35 | */ 36 | public 37 | class EnumerationIterator implements Iterator { 38 | 39 | private final Enumeration e; 40 | 41 | public EnumerationIterator(Enumeration e) { this.e = e; } 42 | 43 | @Override public boolean hasNext() { return this.e.hasMoreElements(); } 44 | @Override public T next() { return this.e.nextElement(); } 45 | 46 | /** 47 | * Since {@link Enumeration}s don't support element removal, this method always throws an {@link 48 | * UnsupportedOperationException}. 49 | * 50 | * @see Iterator#remove() 51 | */ 52 | @Override public void remove() { throw new UnsupportedOperationException("remove"); } 53 | } 54 | -------------------------------------------------------------------------------- /commons-compiler/src/main/java/org/codehaus/commons/compiler/util/iterator/TransformingIterator.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Janino - An embedded Java[TM] compiler 4 | * 5 | * Copyright (c) 2001-2010 Arno Unkrig. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 8 | * following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 11 | * following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | * following disclaimer in the documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote 15 | * products derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | package org.codehaus.commons.compiler.util.iterator; 27 | 28 | import java.util.Iterator; 29 | 30 | /** 31 | * An {@link java.util.Iterator} that transforms its elements on-the-fly. 32 | * 33 | * @param The element type of the delegate iterator 34 | * @param The element type of this iterator 35 | */ 36 | public abstract 37 | class TransformingIterator implements Iterator { 38 | 39 | private final Iterator delegate; 40 | 41 | public 42 | TransformingIterator(Iterator delegate) { this.delegate = delegate; } 43 | 44 | @Override public boolean 45 | hasNext() { return this.delegate.hasNext(); } 46 | 47 | @Override public final T2 48 | next() { return this.transform(this.delegate.next()); } 49 | 50 | @Override public void 51 | remove() { this.delegate.remove(); } 52 | 53 | /** 54 | * Derived classes must implement this method such that it does the desired transformation. 55 | */ 56 | protected abstract T2 transform(T1 o); 57 | } 58 | -------------------------------------------------------------------------------- /commons-compiler/.settings/org.eclipse.jdt.ui.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true 3 | sp_cleanup.add_default_serial_version_id=true 4 | sp_cleanup.add_generated_serial_version_id=false 5 | sp_cleanup.add_missing_annotations=true 6 | sp_cleanup.add_missing_deprecated_annotations=true 7 | sp_cleanup.add_missing_methods=false 8 | sp_cleanup.add_missing_nls_tags=false 9 | sp_cleanup.add_missing_override_annotations=true 10 | sp_cleanup.add_missing_override_annotations_interface_methods=true 11 | sp_cleanup.add_serial_version_id=false 12 | sp_cleanup.always_use_blocks=true 13 | sp_cleanup.always_use_parentheses_in_expressions=false 14 | sp_cleanup.always_use_this_for_non_static_field_access=true 15 | sp_cleanup.always_use_this_for_non_static_method_access=true 16 | sp_cleanup.convert_to_enhanced_for_loop=false 17 | sp_cleanup.correct_indentation=false 18 | sp_cleanup.format_source_code=false 19 | sp_cleanup.format_source_code_changes_only=false 20 | sp_cleanup.make_local_variable_final=false 21 | sp_cleanup.make_parameters_final=false 22 | sp_cleanup.make_private_fields_final=true 23 | sp_cleanup.make_type_abstract_if_missing_method=false 24 | sp_cleanup.make_variable_declarations_final=true 25 | sp_cleanup.never_use_blocks=false 26 | sp_cleanup.never_use_parentheses_in_expressions=true 27 | sp_cleanup.on_save_use_additional_actions=true 28 | sp_cleanup.organize_imports=true 29 | sp_cleanup.qualify_static_field_accesses_with_declaring_class=true 30 | sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true 31 | sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true 32 | sp_cleanup.qualify_static_member_accesses_with_declaring_class=true 33 | sp_cleanup.qualify_static_method_accesses_with_declaring_class=true 34 | sp_cleanup.remove_private_constructors=true 35 | sp_cleanup.remove_trailing_whitespaces=true 36 | sp_cleanup.remove_trailing_whitespaces_all=true 37 | sp_cleanup.remove_trailing_whitespaces_ignore_empty=false 38 | sp_cleanup.remove_unnecessary_casts=false 39 | sp_cleanup.remove_unnecessary_nls_tags=false 40 | sp_cleanup.remove_unused_imports=false 41 | sp_cleanup.remove_unused_local_variables=false 42 | sp_cleanup.remove_unused_private_fields=true 43 | sp_cleanup.remove_unused_private_members=false 44 | sp_cleanup.remove_unused_private_methods=true 45 | sp_cleanup.remove_unused_private_types=true 46 | sp_cleanup.sort_members=false 47 | sp_cleanup.sort_members_all=false 48 | sp_cleanup.use_blocks=false 49 | sp_cleanup.use_blocks_only_for_return_and_throw=false 50 | sp_cleanup.use_parentheses_in_expressions=false 51 | sp_cleanup.use_this_for_non_static_field_access=true 52 | sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=false 53 | sp_cleanup.use_this_for_non_static_method_access=true 54 | sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=false 55 | --------------------------------------------------------------------------------