From: rtrimana Date: Mon, 10 Jun 2019 21:12:25 +0000 (-0700) Subject: Starting our own version of JPF with support for generics. X-Git-Url: http://plrg.eecs.uci.edu/git/?p=jpf-core.git;a=commitdiff_plain;h=078cd99d7624d1654e1846117d41967179af417b Starting our own version of JPF with support for generics. --- diff --git a/examples/ClassDemo.java b/examples/ClassDemo.java new file mode 100644 index 0000000..e0a5c4d --- /dev/null +++ b/examples/ClassDemo.java @@ -0,0 +1,14 @@ +import java.lang.*; +import java.lang.reflect.*; +import java.util.*; + +public class ClassDemo { + + public static void main(String[] args) throws Exception { + + // returns an array of TypeVariable object + TypeVariable[] tValue = List.class.getTypeParameters(); + //System.out.println(tValue[0].getName()); + System.out.println(tValue[0]); + } +} \ No newline at end of file diff --git a/examples/Example.groovy b/examples/Example.groovy new file mode 100644 index 0000000..7854785 --- /dev/null +++ b/examples/Example.groovy @@ -0,0 +1,28 @@ +class Example { + static void main(String[] args) { + //Example of a int datatype + int x = 5; + + //Example of a long datatype + //long y = 100L; + + //Example of a floating point datatype + //float a = 10.56f; + + //Example of a double datatype + //double b = 10.5e40; + + //Example of a BigInteger datatype + //BigInteger bi = 30g; + + //Example of a BigDecimal datatype + //BigDecimal bd = 3.5g; + + println(x); + //println(y); + //println(a); + //println(b); + //println(bi); + //println(bd); + } +} diff --git a/examples/Example.jpf b/examples/Example.jpf new file mode 100644 index 0000000..8101f18 --- /dev/null +++ b/examples/Example.jpf @@ -0,0 +1,3 @@ +target = Example +cg.enumerate_random = true +report.console.property_violation=error,trace diff --git a/examples/HelloWorld.groovy b/examples/HelloWorld.groovy new file mode 100644 index 0000000..050a216 --- /dev/null +++ b/examples/HelloWorld.groovy @@ -0,0 +1 @@ +print "Hello World!\n" diff --git a/examples/HelloWorld.java b/examples/HelloWorld.java new file mode 100644 index 0000000..946bf3b --- /dev/null +++ b/examples/HelloWorld.java @@ -0,0 +1,7 @@ +public class HelloWorld { + + public static void main(String[] args) { + + System.out.println("Hello World!"); + } +} \ No newline at end of file diff --git a/examples/Racer.java b/examples/Racer.java new file mode 100644 index 0000000..09c4002 --- /dev/null +++ b/examples/Racer.java @@ -0,0 +1,22 @@ +public class Racer implements Runnable { + int d = 42; + + public void run () { + doSomething(1001); + d = 0; // (1) + } + + public static void main (String[] args){ + Racer racer = new Racer(); + Thread t = new Thread(racer); + t.start(); + + doSomething(1000); + int c = 420 / racer.d; // (2) + System.out.println(c); + } + + static void doSomething (int n) { + try { Thread.sleep(n); } catch (InterruptedException ix) {} + } +} diff --git a/examples/Rand.groovy b/examples/Rand.groovy new file mode 100644 index 0000000..53f483f --- /dev/null +++ b/examples/Rand.groovy @@ -0,0 +1,10 @@ +int rand = Math.random()*10 + +if (rand < 5) { + //println "rand is less than 5: " + System.out.println(rand) +} else { + //println "rand is greater than or equal to 5: " + System.out.println(rand) +} + diff --git a/examples/Rand.java b/examples/Rand.java new file mode 100644 index 0000000..5d87943 --- /dev/null +++ b/examples/Rand.java @@ -0,0 +1,18 @@ +import java.util.Random; + +public class Rand { + public static void main (String[] args) { + Random random = new Random(42); // (1) + + int a = random.nextInt(2); // (2) + System.out.println("a=" + a); + + //... lots of code here + + int b = random.nextInt(3); // (3) + System.out.println(" b=" + b); + + int c = a/(b+a -2); // (4) + System.out.println(" c=" + c); + } +} \ No newline at end of file diff --git a/examples/Rand.jpf b/examples/Rand.jpf new file mode 100644 index 0000000..57cd211 --- /dev/null +++ b/examples/Rand.jpf @@ -0,0 +1,3 @@ +target = Rand +cg.enumerate_random = true +report.console.property_violation=error,trace diff --git a/examples/ReflectionTest.java b/examples/ReflectionTest.java new file mode 100644 index 0000000..4e59ba3 --- /dev/null +++ b/examples/ReflectionTest.java @@ -0,0 +1,14 @@ +import java.lang.reflect.*; +import java.util.Collection; + +public class ReflectionTest { + + public Collection c; + + public static void main(String[] args) throws NoSuchFieldException { + System.out.println(Collection.class.getTypeParameters()[0]); // E + Field field = ReflectionTest.class.getField("c"); + System.out.println(field.getGenericType()); // java.util.Collection + } + +} diff --git a/examples/TypeVariableImpl.java b/examples/TypeVariableImpl.java new file mode 100644 index 0000000..2176e24 --- /dev/null +++ b/examples/TypeVariableImpl.java @@ -0,0 +1,278 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.reflect.generics.reflectiveObjects; + +import java.lang.annotation.*; +import java.lang.reflect.AnnotatedType; +import java.lang.reflect.Array; +import java.lang.reflect.Constructor; +import java.lang.reflect.GenericDeclaration; +import java.lang.reflect.Member; +import java.lang.reflect.Method; +import java.lang.reflect.Type; +import java.lang.reflect.TypeVariable; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import sun.reflect.annotation.AnnotationSupport; +import sun.reflect.annotation.TypeAnnotationParser; +import sun.reflect.annotation.AnnotationType; +import sun.reflect.generics.factory.GenericsFactory; +import sun.reflect.generics.tree.FieldTypeSignature; +import sun.reflect.generics.visitor.Reifier; +import sun.reflect.misc.ReflectUtil; + +/** + * Implementation of java.lang.reflect.TypeVariable interface + * for core reflection. + */ +public class TypeVariableImpl + extends LazyReflectiveObjectGenerator implements TypeVariable { + D genericDeclaration; + private String name; + // upper bounds - evaluated lazily + private Type[] bounds; + + // The ASTs for the bounds. We are required to evaluate the bounds + // lazily, so we store these at least until we are first asked + // for the bounds. This also neatly solves the + // problem with F-bounds - you can't reify them before the formal + // is defined. + private FieldTypeSignature[] boundASTs; + + // constructor is private to enforce access through static factory + private TypeVariableImpl(D decl, String n, FieldTypeSignature[] bs, + GenericsFactory f) { + super(f); + genericDeclaration = decl; + name = n; + boundASTs = bs; + } + + // Accessors + + // accessor for ASTs for bounds. Must not be called after + // bounds have been evaluated, because we might throw the ASTs + // away (but that is not thread-safe, is it?) + private FieldTypeSignature[] getBoundASTs() { + // check that bounds were not evaluated yet + assert(bounds == null); + return boundASTs; + } + + /** + * Factory method. + * @param decl - the reflective object that declared the type variable + * that this method should create + * @param name - the name of the type variable to be returned + * @param bs - an array of ASTs representing the bounds for the type + * variable to be created + * @param f - a factory that can be used to manufacture reflective + * objects that represent the bounds of this type variable + * @return A type variable with name, bounds, declaration and factory + * specified + */ + public static + TypeVariableImpl make(T decl, String name, + FieldTypeSignature[] bs, + GenericsFactory f) { + + if (!((decl instanceof Class) || + (decl instanceof Method) || + (decl instanceof Constructor))) { + throw new AssertionError("Unexpected kind of GenericDeclaration" + + decl.getClass().toString()); + } + return new TypeVariableImpl(decl, name, bs, f); + } + + + /** + * Returns an array of Type objects representing the + * upper bound(s) of this type variable. Note that if no upper bound is + * explicitly declared, the upper bound is Object. + * + *

For each upper bound B: + *

    + *
  • if B is a parameterized type or a type variable, it is created, + * (see {@link #ParameterizedType} for the details of the creation + * process for parameterized types). + *
  • Otherwise, B is resolved. + *
+ * + * @throws TypeNotPresentException if any of the + * bounds refers to a non-existent type declaration + * @throws MalformedParameterizedTypeException if any of the + * bounds refer to a parameterized type that cannot be instantiated + * for any reason + * @return an array of Types representing the upper bound(s) of this + * type variable + */ + public Type[] getBounds() { + // lazily initialize bounds if necessary + if (bounds == null) { + FieldTypeSignature[] fts = getBoundASTs(); // get AST + // allocate result array; note that + // keeping ts and bounds separate helps with threads + Type[] ts = new Type[fts.length]; + // iterate over bound trees, reifying each in turn + for ( int j = 0; j < fts.length; j++) { + Reifier r = getReifier(); + fts[j].accept(r); + ts[j] = r.getResult(); + } + // cache result + bounds = ts; + // could throw away bound ASTs here; thread safety? + } + return bounds.clone(); // return cached bounds + } + + /** + * Returns the GenericDeclaration object representing the + * generic declaration that declared this type variable. + * + * @return the generic declaration that declared this type variable. + * + * @since 1.5 + */ + public D getGenericDeclaration(){ + if (genericDeclaration instanceof Class) + ReflectUtil.checkPackageAccess((Class)genericDeclaration); + else if ((genericDeclaration instanceof Method) || + (genericDeclaration instanceof Constructor)) + ReflectUtil.conservativeCheckMemberAccess((Member)genericDeclaration); + else + throw new AssertionError("Unexpected kind of GenericDeclaration"); + return genericDeclaration; + } + + + /** + * Returns the name of this type variable, as it occurs in the source code. + * + * @return the name of this type variable, as it appears in the source code + */ + public String getName() { return name; } + + public String toString() {return getName();} + + @Override + public boolean equals(Object o) { + if (o instanceof TypeVariable && + o.getClass() == TypeVariableImpl.class) { + TypeVariable that = (TypeVariable) o; + + GenericDeclaration thatDecl = that.getGenericDeclaration(); + String thatName = that.getName(); + + return Objects.equals(genericDeclaration, thatDecl) && + Objects.equals(name, thatName); + + } else + return false; + } + + @Override + public int hashCode() { + return genericDeclaration.hashCode() ^ name.hashCode(); + } + + // Implementations of AnnotatedElement methods. + @SuppressWarnings("unchecked") + public T getAnnotation(Class annotationClass) { + Objects.requireNonNull(annotationClass); + // T is an Annotation type, the return value of get will be an annotation + return (T)mapAnnotations(getAnnotations()).get(annotationClass); + } + + public T getDeclaredAnnotation(Class annotationClass) { + Objects.requireNonNull(annotationClass); + return getAnnotation(annotationClass); + } + + @Override + public T[] getAnnotationsByType(Class annotationClass) { + Objects.requireNonNull(annotationClass); + return AnnotationSupport.getDirectlyAndIndirectlyPresent(mapAnnotations(getAnnotations()), annotationClass); + } + + @Override + public T[] getDeclaredAnnotationsByType(Class annotationClass) { + Objects.requireNonNull(annotationClass); + return getAnnotationsByType(annotationClass); + } + + public Annotation[] getAnnotations() { + int myIndex = typeVarIndex(); + if (myIndex < 0) + throw new AssertionError("Index must be non-negative."); + return TypeAnnotationParser.parseTypeVariableAnnotations(getGenericDeclaration(), myIndex); + } + + public Annotation[] getDeclaredAnnotations() { + return getAnnotations(); + } + + public AnnotatedType[] getAnnotatedBounds() { + return TypeAnnotationParser.parseAnnotatedBounds(getBounds(), + getGenericDeclaration(), + typeVarIndex()); + } + + private static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[0]; + + // Helpers for annotation methods + private int typeVarIndex() { + TypeVariable[] tVars = getGenericDeclaration().getTypeParameters(); + int i = -1; + for (TypeVariable v : tVars) { + i++; + if (equals(v)) + return i; + } + return -1; + } + + private static Map(); + for (Annotation a : annos) { + Class klass = a.annotationType(); + AnnotationType type = AnnotationType.getInstance(klass); + if (type.retention() == RetentionPolicy.RUNTIME) + if (result.put(klass, a) != null) + throw new AnnotationFormatError("Duplicate annotation for class: "+klass+": " + a); + } + return result; + } + + public static void main(String[] args) { + + TypeVariable typeVar = new TypeVariableImpl(null, null, null, null); + + } +} diff --git a/examples/groovy-2.4.8/META-INF/LICENSE b/examples/groovy-2.4.8/META-INF/LICENSE new file mode 100644 index 0000000..b301ada --- /dev/null +++ b/examples/groovy-2.4.8/META-INF/LICENSE @@ -0,0 +1,215 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +------------------------------------------------------------------------ + +ANTLR 2 License + +Antlr2 is released in the public domain. +See licenses/antlr2-license.txt for details. + +------------------------------------------------------------------------ + +ASM 4 License + +ASM 4 uses a 3-clause BSD license. For details, see licenses/asm-license.txt. diff --git a/examples/groovy-2.4.8/META-INF/MANIFEST.MF b/examples/groovy-2.4.8/META-INF/MANIFEST.MF new file mode 100644 index 0000000..0c2e9e6 --- /dev/null +++ b/examples/groovy-2.4.8/META-INF/MANIFEST.MF @@ -0,0 +1,102 @@ +Manifest-Version: 1.0 +Ant-Version: Apache Ant 1.9.3 +Originally-Created-By: 1.8.0_111-b14 (Oracle Corporation) +Export-Package: groovy.beans;version="2.4.8",groovy.grape;version="2.4 + .8",groovy.inspect;version="2.4.8",groovy.io;version="2.4.8",groovy.l + ang;version="2.4.8",groovy.security;version="2.4.8",groovy.time;versi + on="2.4.8",groovy.transform;version="2.4.8",groovy.transform.builder; + version="2.4.8",groovy.transform.stc;version="2.4.8",groovy.ui;versio + n="2.4.8",groovy.util;version="2.4.8",groovy.util.logging;version="2. + 4.8",groovy.xml;version="2.4.8",groovyjarjarantlr;version="2.4.8",gro + ovyjarjarantlr.ASdebug;version="2.4.8",groovyjarjarantlr.actions.cpp; + version="2.4.8",groovyjarjarantlr.actions.csharp;version="2.4.8",groo + vyjarjarantlr.actions.java;version="2.4.8",groovyjarjarantlr.actions. + python;version="2.4.8",groovyjarjarantlr.build;version="2.4.8",groovy + jarjarantlr.collections;version="2.4.8",groovyjarjarantlr.collections + .impl;version="2.4.8",groovyjarjarantlr.debug;version="2.4.8",groovyj + arjarantlr.debug.misc;version="2.4.8",groovyjarjarantlr.preprocessor; + version="2.4.8",groovyjarjarasm.asm;version="2.4.8",groovyjarjarasm.a + sm.commons;version="2.4.8",groovyjarjarasm.asm.signature;version="2.4 + .8",groovyjarjarasm.asm.tree;version="2.4.8",groovyjarjarasm.asm.util + ;version="2.4.8",groovyjarjarcommonscli;version="2.4.8",org.codehaus. + groovy;version="2.4.8",org.codehaus.groovy.antlr;version="2.4.8",org. + codehaus.groovy.antlr.java;version="2.4.8",org.codehaus.groovy.antlr. + parser;version="2.4.8",org.codehaus.groovy.antlr.treewalker;version=" + 2.4.8",org.codehaus.groovy.ast;version="2.4.8",org.codehaus.groovy.as + t.builder;version="2.4.8",org.codehaus.groovy.ast.expr;version="2.4.8 + ",org.codehaus.groovy.ast.stmt;version="2.4.8",org.codehaus.groovy.as + t.tools;version="2.4.8",org.codehaus.groovy.classgen;version="2.4.8", + org.codehaus.groovy.classgen.asm;version="2.4.8",org.codehaus.groovy. + classgen.asm.indy;version="2.4.8",org.codehaus.groovy.classgen.asm.sc + ;version="2.4.8",org.codehaus.groovy.control;version="2.4.8",org.code + haus.groovy.control.customizers;version="2.4.8",org.codehaus.groovy.c + ontrol.customizers.builder;version="2.4.8",org.codehaus.groovy.contro + l.io;version="2.4.8",org.codehaus.groovy.control.messages;version="2. + 4.8",org.codehaus.groovy.plugin;version="2.4.8",org.codehaus.groovy.r + eflection;version="2.4.8",org.codehaus.groovy.reflection.android;vers + ion="2.4.8",org.codehaus.groovy.reflection.stdclasses;version="2.4.8" + ,org.codehaus.groovy.reflection.v7;version="2.4.8",org.codehaus.groov + y.runtime;version="2.4.8",org.codehaus.groovy.runtime.callsite;versio + n="2.4.8",org.codehaus.groovy.runtime.dgmimpl;version="2.4.8",org.cod + ehaus.groovy.runtime.dgmimpl.arrays;version="2.4.8",org.codehaus.groo + vy.runtime.m12n;version="2.4.8",org.codehaus.groovy.runtime.memoize;v + ersion="2.4.8",org.codehaus.groovy.runtime.metaclass;version="2.4.8", + org.codehaus.groovy.runtime.powerassert;version="2.4.8",org.codehaus. + groovy.runtime.typehandling;version="2.4.8",org.codehaus.groovy.runti + me.wrappers;version="2.4.8",org.codehaus.groovy.syntax;version="2.4.8 + ",org.codehaus.groovy.tools;version="2.4.8",org.codehaus.groovy.tools + .ast;version="2.4.8",org.codehaus.groovy.tools.gse;version="2.4.8",or + g.codehaus.groovy.tools.javac;version="2.4.8",org.codehaus.groovy.too + ls.shell;version="2.4.8",org.codehaus.groovy.tools.shell.util;version + ="2.4.8",org.codehaus.groovy.tools.xml;version="2.4.8",org.codehaus.g + roovy.transform;version="2.4.8",org.codehaus.groovy.transform.sc;vers + ion="2.4.8",org.codehaus.groovy.transform.sc.transformers;version="2. + 4.8",org.codehaus.groovy.transform.stc;version="2.4.8",org.codehaus.g + roovy.transform.tailrec;version="2.4.8",org.codehaus.groovy.transform + .trait;version="2.4.8",org.codehaus.groovy.util;version="2.4.8",org.c + odehaus.groovy.vmplugin;version="2.4.8",org.codehaus.groovy.vmplugin. + v5;version="2.4.8",org.codehaus.groovy.vmplugin.v6;version="2.4.8",or + g.codehaus.groovy.vmplugin.v7;version="2.4.8",overview.html;version=" + 2.4.8",overviewj.html;version="2.4.8" +Bundle-SymbolicName: groovy +Bundle-Version: 2.4.8 +Bundle-Name: Groovy Runtime +Bundle-ManifestVersion: 2 +Import-Package: com.thoughtworks.xstream;resolution:=optional;version= + "[1.4,2)",com.thoughtworks.xstream.io;resolution:=optional;version="[ + 1.4,2)",com.thoughtworks.xstream.io.xml;resolution:=optional;version= + "[1.4,2)",javax.swing;resolution:=optional,javax.swing.border;resolut + ion:=optional,javax.swing.event;resolution:=optional,javax.swing.text + ;resolution:=optional,javax.swing.tree;resolution:=optional,javax.xml + .parsers;resolution:=optional,org.apache.ivy;resolution:=optional;ver + sion="[2.0,3)",org.apache.ivy.core.cache;resolution:=optional;version + ="[2.0,3)",org.apache.ivy.core.event;resolution:=optional;version="[2 + .0,3)",org.apache.ivy.core.event.download;resolution:=optional;versio + n="[2.0,3)",org.apache.ivy.core.event.resolve;resolution:=optional;ve + rsion="[2.0,3)",org.apache.ivy.core.module.descriptor;resolution:=opt + ional;version="[2.0,3)",org.apache.ivy.core.module.id;resolution:=opt + ional;version="[2.0,3)",org.apache.ivy.core.report;resolution:=option + al;version="[2.0,3)",org.apache.ivy.core.resolve;resolution:=optional + ;version="[2.0,3)",org.apache.ivy.core.settings;resolution:=optional; + version="[2.0,3)",org.apache.ivy.plugins.matcher;resolution:=optional + ;version="[2.0,3)",org.apache.ivy.plugins.resolver;resolution:=option + al;version="[2.0,3)",org.apache.ivy.util;resolution:=optional;version + ="[2.0,3)",org.fusesource.jansi;resolution:=optional;version="[1.11,2 + )",org.w3c.dom;resolution:=optional +Created-By: 1.8.0_111 (Oracle Corporation) +Tool: Bnd-2.1.0.20130426-122213 +Built-By: paulk +Extension-Name: groovy +Specification-Title: Groovy: a powerful, dynamic language for the JVM +Specification-Version: 2.4.8 +Specification-Vendor: The Apache Software Foundation +Implementation-Title: Groovy: a powerful, dynamic language for the JVM +Implementation-Version: 2.4.8 +Implementation-Vendor: The Apache Software Foundation +Bundle-Description: Groovy Runtime +Bundle-Vendor: The Apache Software Foundation +Bundle-ClassPath: . +Eclipse-BuddyPolicy: dependent +DynamicImport-Package: * +Main-class: groovy.ui.GroovyMain + diff --git a/examples/groovy-2.4.8/META-INF/NOTICE b/examples/groovy-2.4.8/META-INF/NOTICE new file mode 100644 index 0000000..ecb27f2 --- /dev/null +++ b/examples/groovy-2.4.8/META-INF/NOTICE @@ -0,0 +1,8 @@ +Apache Groovy +Copyright 2003-2017 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). + +This product includes/uses ANTLR (http://www.antlr2.org/) +developed by Terence Parr 1989-2006 \ No newline at end of file diff --git a/examples/groovy-2.4.8/META-INF/dgminfo b/examples/groovy-2.4.8/META-INF/dgminfo new file mode 100644 index 0000000..8e8e722 Binary files /dev/null and b/examples/groovy-2.4.8/META-INF/dgminfo differ diff --git a/examples/groovy-2.4.8/META-INF/groovy-release-info.properties b/examples/groovy-2.4.8/META-INF/groovy-release-info.properties new file mode 100644 index 0000000..535abda --- /dev/null +++ b/examples/groovy-2.4.8/META-INF/groovy-release-info.properties @@ -0,0 +1,23 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +ImplementationVersion=2.4.8 +BundleVersion=2.4.8 +BuildDate=10-Jan-2017 +BuildTime=06:56 PM \ No newline at end of file diff --git a/examples/groovy-2.4.8/META-INF/licenses/antlr2-license.txt b/examples/groovy-2.4.8/META-INF/licenses/antlr2-license.txt new file mode 100644 index 0000000..3ce8ed2 --- /dev/null +++ b/examples/groovy-2.4.8/META-INF/licenses/antlr2-license.txt @@ -0,0 +1,23 @@ +ANTLR 2 License + +We reserve no legal rights to the ANTLR--it is fully in the public domain. An individual or company may do +whatever they wish with source code distributed with ANTLR or the code generated by ANTLR, including the +incorporation of ANTLR, or its output, into commerical software. + +We encourage users to develop software with ANTLR. However, we do ask that credit is given to us for +developing ANTLR. By "credit", we mean that if you use ANTLR or incorporate any source code into one of your +programs (commercial product, research project, or otherwise) that you acknowledge this fact somewhere in +the documentation, research report, etc... If you like ANTLR and have developed a nice tool with the output, +please mention that you developed it using ANTLR. In addition, we ask that the headers remain intact in our +source code. As long as these guidelines are kept, we expect to continue enhancing this system and expect to +make other tools available as they are completed. + +In countries where the Public Domain status of the work may not be valid, the author grants a copyright +licence to the general public to deal in the work without restriction and permission to sublicence derivates +under the terms of any (OSI approved) Open Source licence. + +The Python parser generator code under antlr/actions/python/ is covered by the 3-clause BSD licence (this +part is included in the binary JAR files); the run-time part under lib/python/ is covered by the GNU GPL, +version 3 or later (this part is not included in the binary JAR files). See [1] for the full details. + +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=750643#80%22 diff --git a/examples/groovy-2.4.8/META-INF/licenses/asm-license.txt b/examples/groovy-2.4.8/META-INF/licenses/asm-license.txt new file mode 100644 index 0000000..ca6173e --- /dev/null +++ b/examples/groovy-2.4.8/META-INF/licenses/asm-license.txt @@ -0,0 +1,31 @@ +ASM 4 License + +Copyright (c) 2000-2011 INRIA, France Telecom +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. diff --git a/examples/groovy-2.4.8/META-INF/services/org.codehaus.groovy.source.Extensions b/examples/groovy-2.4.8/META-INF/services/org.codehaus.groovy.source.Extensions new file mode 100644 index 0000000..2e9df17 --- /dev/null +++ b/examples/groovy-2.4.8/META-INF/services/org.codehaus.groovy.source.Extensions @@ -0,0 +1,22 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Format: one extension on each line without the leading "*." +# Listed below are default groovy source file extensions. + +# NOTE: This implementation of supporting multiple file extensions is experimental and +# the exact implementation details may vary when modularization gets introduced in +# groovy 2.0. However, in terms of the behavior, this support will remain intact. +groovy \ No newline at end of file diff --git a/examples/groovy-2.4.8/META-INF/services/org.codehaus.groovy.transform.ASTTransformation b/examples/groovy-2.4.8/META-INF/services/org.codehaus.groovy.transform.ASTTransformation new file mode 100644 index 0000000..63a37f4 --- /dev/null +++ b/examples/groovy-2.4.8/META-INF/services/org.codehaus.groovy.transform.ASTTransformation @@ -0,0 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# global transformation to handle @Grab annotation +groovy.grape.GrabAnnotationTransformation + +#global transformation for AST Builder +org.codehaus.groovy.ast.builder.AstBuilderTransformation diff --git a/examples/groovy-2.4.8/groovy-2.4.8.jar b/examples/groovy-2.4.8/groovy-2.4.8.jar new file mode 100644 index 0000000..be156d8 Binary files /dev/null and b/examples/groovy-2.4.8/groovy-2.4.8.jar differ diff --git a/examples/groovy-2.4.8/groovy/grape/defaultGrapeConfig.xml b/examples/groovy-2.4.8/groovy/grape/defaultGrapeConfig.xml new file mode 100644 index 0000000..11161d3 --- /dev/null +++ b/examples/groovy-2.4.8/groovy/grape/defaultGrapeConfig.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + diff --git a/examples/groovy-2.4.8/groovy/inspect/package.html b/examples/groovy-2.4.8/groovy/inspect/package.html new file mode 100644 index 0000000..6d80c2b --- /dev/null +++ b/examples/groovy-2.4.8/groovy/inspect/package.html @@ -0,0 +1,28 @@ + + + + package groovy.inspect.* + + +

Classes for inspecting object properties through introspection.

+ + diff --git a/examples/groovy-2.4.8/groovy/io/package.html b/examples/groovy-2.4.8/groovy/io/package.html new file mode 100644 index 0000000..fef0d09 --- /dev/null +++ b/examples/groovy-2.4.8/groovy/io/package.html @@ -0,0 +1,28 @@ + + + + package groovy.io.* + + +

Classes for Groovier Input/Output.

+ + diff --git a/examples/groovy-2.4.8/groovy/lang/package.html b/examples/groovy-2.4.8/groovy/lang/package.html new file mode 100644 index 0000000..1ea84fc --- /dev/null +++ b/examples/groovy-2.4.8/groovy/lang/package.html @@ -0,0 +1,28 @@ + + + + package groovy.lang.* + + +

Core Groovy language classes for implementing data structures, closures, metadata and so forth.

+ + diff --git a/examples/groovy-2.4.8/groovy/security/package.html b/examples/groovy-2.4.8/groovy/security/package.html new file mode 100644 index 0000000..cb094ff --- /dev/null +++ b/examples/groovy-2.4.8/groovy/security/package.html @@ -0,0 +1,30 @@ + + + + package groovy.security.* + + +

+ Security-related classes +

+ + diff --git a/examples/groovy-2.4.8/groovy/time/package.html b/examples/groovy-2.4.8/groovy/time/package.html new file mode 100644 index 0000000..94fb458 --- /dev/null +++ b/examples/groovy-2.4.8/groovy/time/package.html @@ -0,0 +1,47 @@ + + + + package groovy.time.* + + +

+ Classes for easily manipulating Dates and times. While + java.util.Date has GDK methods for adding or subtracting days, + this is not so useful for different durations of time. + {@link groovy.time.TimeCategory TimeCategory} creates a simple internal DSL + for manipulating dates and times in a clean and precise fashion. +

+

Examples

+
+  use ( TimeCategory ) {
+  	// application on numbers:
+  	println 1.minute.from.now
+  	println 10.days.ago
+  
+  	// application on dates
+  	def someDate = new Date()
+  	println someDate - 3.months 
+  }
+ + @see groovy.time.TimeCategory + + diff --git a/examples/groovy-2.4.8/groovy/util/package.html b/examples/groovy-2.4.8/groovy/util/package.html new file mode 100644 index 0000000..e7a2c5a --- /dev/null +++ b/examples/groovy-2.4.8/groovy/util/package.html @@ -0,0 +1,28 @@ + + + + package groovy.util.* + + +

Various Groovy utilities for working with nodes, builders, logging, JUnit test cases, text expressions, Ant tasks or JMX MBeans.

+ + diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/antlr/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/antlr/package.html new file mode 100644 index 0000000..0ecf3f6 --- /dev/null +++ b/examples/groovy-2.4.8/org/codehaus/groovy/antlr/package.html @@ -0,0 +1,28 @@ + + + + package org.codehaus.groovy.antlr.* + + +

Parser related classes.

+ + diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/antlr/treewalker/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/antlr/treewalker/package.html new file mode 100644 index 0000000..9fca823 --- /dev/null +++ b/examples/groovy-2.4.8/org/codehaus/groovy/antlr/treewalker/package.html @@ -0,0 +1,28 @@ + + + + package org.codehaus.groovy.antlr.treewalker.* + + +

Classes for walking the AST.

+ + diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/ast/expr/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/ast/expr/package.html new file mode 100644 index 0000000..806854e --- /dev/null +++ b/examples/groovy-2.4.8/org/codehaus/groovy/ast/expr/package.html @@ -0,0 +1,28 @@ + + + + package org.codehaus.groovy.ast.expr.* + + +

AST nodes for Groovy expressions

+ + diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/ast/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/ast/package.html new file mode 100644 index 0000000..f8f132a --- /dev/null +++ b/examples/groovy-2.4.8/org/codehaus/groovy/ast/package.html @@ -0,0 +1,28 @@ + + + + package org.codehaus.groovy.ast.* + + +

Groovy AST nodes for the syntax of the language

+ + diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/ast/stmt/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/ast/stmt/package.html new file mode 100644 index 0000000..8226776 --- /dev/null +++ b/examples/groovy-2.4.8/org/codehaus/groovy/ast/stmt/package.html @@ -0,0 +1,28 @@ + + + + package org.codehaus.groovy.ast.stmt.* + + +

AST nodes for Groovy statements

+ + diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/classgen/asm/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/classgen/asm/package.html new file mode 100644 index 0000000..cd40f7e --- /dev/null +++ b/examples/groovy-2.4.8/org/codehaus/groovy/classgen/asm/package.html @@ -0,0 +1,29 @@ + + + + package org.codehaus.groovy.classgen.asm.* + + +

Helper classes for ASMClassGenerator. All classes in this package + are for internal usage only.

+ + diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/classgen/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/classgen/package.html new file mode 100644 index 0000000..a72224a --- /dev/null +++ b/examples/groovy-2.4.8/org/codehaus/groovy/classgen/package.html @@ -0,0 +1,28 @@ + + + + package org.codehaus.groovy.classgen.* + + +

Generates Java classes for Groovy classes using ASM.

+ + diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/control/io/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/control/io/package.html new file mode 100644 index 0000000..9f92588 --- /dev/null +++ b/examples/groovy-2.4.8/org/codehaus/groovy/control/io/package.html @@ -0,0 +1,28 @@ + + + + package org.codehaus.groovy.control.io.* + + +

Internal classes for Groovier Input/Output.

+ + diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/control/messages/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/control/messages/package.html new file mode 100644 index 0000000..412a4df --- /dev/null +++ b/examples/groovy-2.4.8/org/codehaus/groovy/control/messages/package.html @@ -0,0 +1,28 @@ + + + + package org.codehaus.groovy.control.messages.* + + +

Error message classes.

+ + diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/control/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/control/package.html new file mode 100644 index 0000000..4a9ec85 --- /dev/null +++ b/examples/groovy-2.4.8/org/codehaus/groovy/control/package.html @@ -0,0 +1,28 @@ + + + + package org.codehaus.groovy.control.* + + +

Compiler control classes.

+ + diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/package.html new file mode 100644 index 0000000..1ff6757 --- /dev/null +++ b/examples/groovy-2.4.8/org/codehaus/groovy/package.html @@ -0,0 +1,28 @@ + + + + package org.codehaus.groovy.* + + +

Groovy Language for the JVM

+ + diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/reflection/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/reflection/package.html new file mode 100644 index 0000000..a01a2dd --- /dev/null +++ b/examples/groovy-2.4.8/org/codehaus/groovy/reflection/package.html @@ -0,0 +1,28 @@ + + + + package org.codehaus.groovy.reflection.* + + +

Internal classes for assisting with reflection.

+ + diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/runtime/metaclass/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/runtime/metaclass/package.html new file mode 100644 index 0000000..f3e1fa3 --- /dev/null +++ b/examples/groovy-2.4.8/org/codehaus/groovy/runtime/metaclass/package.html @@ -0,0 +1,28 @@ + + + + package org.codehaus.groovy.runtime.metaclass.* + + +

Internal classes related to Groovy's metaclass implementation.

+ + diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/runtime/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/runtime/package.html new file mode 100644 index 0000000..c78595e --- /dev/null +++ b/examples/groovy-2.4.8/org/codehaus/groovy/runtime/package.html @@ -0,0 +1,28 @@ + + + + package org.codehaus.groovy.runtime.* + + +

Runtime classes for Groovy - whether the dynamic interpreter is being used, the compiler or the bytecode generator.

+ + diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/runtime/typehandling/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/runtime/typehandling/package.html new file mode 100644 index 0000000..fab5318 --- /dev/null +++ b/examples/groovy-2.4.8/org/codehaus/groovy/runtime/typehandling/package.html @@ -0,0 +1,30 @@ + + + + package org.codehaus.groovy.runtime.typehandling* + + +

Classes used to execute special actions based on the type. + This includes mathematical operations and wrapper classes. +

+ + diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/runtime/wrappers/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/runtime/wrappers/package.html new file mode 100644 index 0000000..652b123 --- /dev/null +++ b/examples/groovy-2.4.8/org/codehaus/groovy/runtime/wrappers/package.html @@ -0,0 +1,28 @@ + + + + package org.codehaus.groovy.runtime.wrappers.* + + +

Groovy wrapper classes for primitive types.

+ + diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/syntax/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/syntax/package.html new file mode 100644 index 0000000..299d984 --- /dev/null +++ b/examples/groovy-2.4.8/org/codehaus/groovy/syntax/package.html @@ -0,0 +1,28 @@ + + + + package org.codehaus.groovy.syntax.* + + +

Lexer, parser and trees.

+ + diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/tools/javac/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/tools/javac/package.html new file mode 100644 index 0000000..95b05a4 --- /dev/null +++ b/examples/groovy-2.4.8/org/codehaus/groovy/tools/javac/package.html @@ -0,0 +1,28 @@ + + + + package org.codehaus.groovy.tools.javac.* + + +

Classes related to the joint compiler.

+ + diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/tools/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/tools/package.html new file mode 100644 index 0000000..a45486b --- /dev/null +++ b/examples/groovy-2.4.8/org/codehaus/groovy/tools/package.html @@ -0,0 +1,30 @@ + + + + package org.codehaus.groovy.tools.* + + +

+ Compiler entry points and miscellaneous development tools. +

+ + diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/tools/xml/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/tools/xml/package.html new file mode 100644 index 0000000..a6fb0f8 --- /dev/null +++ b/examples/groovy-2.4.8/org/codehaus/groovy/tools/xml/package.html @@ -0,0 +1,28 @@ + + + + package org.codehaus.groovy.tools.xml.* + + +

XML utilities such as for converting XML into Groovy scripts.

+ + diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/vmplugin/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/vmplugin/package.html new file mode 100644 index 0000000..d7584ff --- /dev/null +++ b/examples/groovy-2.4.8/org/codehaus/groovy/vmplugin/package.html @@ -0,0 +1,28 @@ + + + +

+ JVM version specific classes. +

+ + + diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/vmplugin/v5/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/vmplugin/v5/package.html new file mode 100644 index 0000000..ae4d56a --- /dev/null +++ b/examples/groovy-2.4.8/org/codehaus/groovy/vmplugin/v5/package.html @@ -0,0 +1,28 @@ + + + +

+ Java 5 specific classes. +

+ + + diff --git a/examples/groovy-2.4.8/overview.html b/examples/groovy-2.4.8/overview.html new file mode 100644 index 0000000..9738194 --- /dev/null +++ b/examples/groovy-2.4.8/overview.html @@ -0,0 +1,41 @@ + + + + Groovy - An agile dynamic language for the Java Platform + + +

Groovy - An agile dynamic language for the Java Platform
(GroovyDoc for Groovy and Java classes)

+ + Groovy... +
    +
  • is an agile and dynamic language for the Java Virtual Machine
  • +
  • builds upon the strengths of Java but has additional power features inspired by languages like Python, Ruby and Smalltalk
  • +
  • makes modern programming features available to Java developers with almost-zero learning curve
  • +
  • supports Domain-Specific Languages and other compact syntax so your code becomes easy to read and maintain
  • +
  • makes writing shell and build scripts easy with its powerful processing primitives, OO abilities and an Ant DSL
  • +
  • increases developer productivity by reducing scaffolding code when developing web, GUI, database or console applications
  • +
  • simplifies testing by supporting unit testing and mocking out-of-the-box
  • +
  • seamlessly integrates with all existing Java objects and libraries
  • +
  • compiles straight to Java bytecode so you can use it anywhere you can use Java
  • +
+ + diff --git a/examples/groovy-2.4.8/overviewj.html b/examples/groovy-2.4.8/overviewj.html new file mode 100644 index 0000000..d526e8b --- /dev/null +++ b/examples/groovy-2.4.8/overviewj.html @@ -0,0 +1,41 @@ + + + + Groovy - An agile dynamic language for the Java Platform + + +

Groovy - An agile dynamic language for the Java Platform
(JavaDoc for Java classes)

+ + Groovy... +
    +
  • is an agile and dynamic language for the Java Virtual Machine
  • +
  • builds upon the strengths of Java but has additional power features inspired by languages like Python, Ruby and Smalltalk
  • +
  • makes modern programming features available to Java developers with almost-zero learning curve
  • +
  • supports Domain-Specific Languages and other compact syntax so your code becomes easy to read and maintain
  • +
  • makes writing shell and build scripts easy with its powerful processing primitives, OO abilities and an Ant DSL
  • +
  • increases developer productivity by reducing scaffolding code when developing web, GUI, database or console applications
  • +
  • simplifies testing by supporting unit testing and mocking out-of-the-box
  • +
  • seamlessly integrates with all existing Java objects and libraries
  • +
  • compiles straight to Java bytecode so you can use it anywhere you can use Java
  • +
+ + diff --git a/examples/test.groovy b/examples/test.groovy new file mode 100644 index 0000000..4041d34 --- /dev/null +++ b/examples/test.groovy @@ -0,0 +1,34 @@ +// This function runs when the SmartApp is installed +def installed() { + // This is a standard debug statement in Groovy + log.debug "Installed with settings: ${settings}" + initialize() +} + +// This function runs when the SmartApp has been updated +def updated() { + log.debug "Updated with settings: ${settings}" + // Notice that all event subscriptions are removed when a SmartApp is updated + unsubscribe() + initialize() +} + +// This function is where you initialize callbacks for event listeners +def initialize() { + // The subscribe function takes a input, a state, and a callback method + subscribe(contact, "contact.open", openHandler) + subscribe(contact, "contact.closed", closedHandler) +} + +// These are our callback methods +def openHandler(evt) { + log.debug "$evt.name: $evt.value" + // Turn the light on + light.on() +} + +def closedHandler(evt) { + log.debug "$evt.name: $evt.value" + // Turn the light off and lock the lock + light.off() +} diff --git a/examples/test.jpf b/examples/test.jpf new file mode 100644 index 0000000..0f65147 --- /dev/null +++ b/examples/test.jpf @@ -0,0 +1,3 @@ +target = test +cg.enumerate_random = true +report.console.property_violation=error,trace diff --git a/examples/teststatic.groovy b/examples/teststatic.groovy new file mode 100644 index 0000000..36213ea --- /dev/null +++ b/examples/teststatic.groovy @@ -0,0 +1,41 @@ +import groovy.transform.CompileStatic + +// This function runs when the SmartApp is installed +@CompileStatic +def installed() { + // This is a standard debug statement in Groovy + //log.debug "Installed with settings: ${settings}" + initialize() +} + +// This function runs when the SmartApp has been updated +@CompileStatic +def updated() { + //log.debug "Updated with settings: ${settings}" + // Notice that all event subscriptions are removed when a SmartApp is updated + //unsubscribe() + initialize() +} + +// This function is where you initialize callbacks for event listeners +@CompileStatic +def initialize() { + // The subscribe function takes a input, a state, and a callback method + //subscribe(contact, "contact.open", openHandler) + //subscribe(contact, "contact.closed", closedHandler) +} + +// These are our callback methods +@CompileStatic +def openHandler(evt) { + //log.debug "$evt.name: $evt.value" + // Turn the light on + //light.on() +} + +@CompileStatic +def closedHandler(evt) { + //log.debug "$evt.name: $evt.value" + // Turn the light off and lock the lock + //light.off() +} diff --git a/src/classes/java/lang/Class.java b/src/classes/java/lang/Class.java index 379b60a..6149ba6 100644 --- a/src/classes/java/lang/Class.java +++ b/src/classes/java/lang/Class.java @@ -21,19 +21,18 @@ import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.Serializable; import java.lang.annotation.Annotation; -import java.lang.reflect.AnnotatedElement; -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.GenericDeclaration; -import java.lang.reflect.Method; -import java.lang.reflect.Type; -import java.lang.reflect.TypeVariable; +import java.lang.reflect.*; import java.net.URL; import java.util.HashMap; import java.util.Map; import sun.reflect.ConstantPool; import sun.reflect.annotation.AnnotationType; +// TODO: DIRTY HACKS! +import sun.reflect.generics.factory.CoreReflectionFactory; +import sun.reflect.generics.factory.GenericsFactory; +import sun.reflect.generics.repository.ClassRepository; +import sun.reflect.generics.scope.ClassScope; /** * MJI model class for java.lang.Class library abstraction @@ -277,11 +276,64 @@ public final class Class implements Serializable, GenericDeclaration, Type, A native AnnotationType getAnnotationType(); + // TODO: DIRTY HACKS! + //public native TypeVariable>[] getTypeParameters(); + /* @Override public TypeVariable>[] getTypeParameters() { throw new UnsupportedOperationException(); } + // Generic info repository; lazily initialized + private volatile transient ClassRepository genericInfo; + + // Generic signature handling + //private native String getGenericSignature0(); + + // accessor for factory + private GenericsFactory getFactory() { + // create scope and factory + return CoreReflectionFactory.make(this, ClassScope.make(this)); + } + + // accessor for generic info repository; + // generic info is lazily initialized + private ClassRepository getGenericInfo() { + ClassRepository genericInfo = this.genericInfo; + if (genericInfo == null) { + //String signature = getGenericSignature0(); + //String signature = "Ljava/lang/Object;"; + String signature = null; + if (signature == null) { + genericInfo = ClassRepository.NONE; + } else { + genericInfo = ClassRepository.make(signature, getFactory()); + } + this.genericInfo = genericInfo; + } + return (genericInfo != ClassRepository.NONE) ? genericInfo : null; + } + + @Override + public TypeVariable>[] getTypeParameters() { + //throw new UnsupportedOperationException(); + ClassRepository info = getGenericInfo(); + if (info != null) + return (TypeVariable>[])info.getTypeParameters(); + else + return (TypeVariable>[])new TypeVariable[0]; + }*/ + @Override + public TypeVariable>[] getTypeParameters() { + //throw new UnsupportedOperationException(); + System.out.println("Calling getTypeParameters for: " + this.name); + TypeVariable[] typeVariables = (TypeVariable>[])new TypeVariable[1]; + //Object obj = new Object(); + //typeVariables[0] = (TypeVariable>) obj; + return typeVariables; + } + // TODO: DIRTY HACKS! + public Type getGenericSuperclass() { throw new UnsupportedOperationException(); } diff --git a/src/classes/java/lang/reflect/Method.java b/src/classes/java/lang/reflect/Method.java index 40b1888..073d874 100644 --- a/src/classes/java/lang/reflect/Method.java +++ b/src/classes/java/lang/reflect/Method.java @@ -43,6 +43,8 @@ public final class Method extends AccessibleObject implements Member { public native Class[] getParameterTypes(); public native Type[] getGenericParameterTypes(); public native Class[] getExceptionTypes(); + // TODO: DIRTY HACKS + public native Type getGenericReturnType(); @Override public native Class getDeclaringClass(); diff --git a/src/main/gov/nasa/jpf/vm/SystemClassLoaderInfo.java b/src/main/gov/nasa/jpf/vm/SystemClassLoaderInfo.java index ce2866a..3076681 100644 --- a/src/main/gov/nasa/jpf/vm/SystemClassLoaderInfo.java +++ b/src/main/gov/nasa/jpf/vm/SystemClassLoaderInfo.java @@ -184,6 +184,7 @@ public abstract class SystemClassLoaderInfo extends ClassLoaderInfo { @Override protected ClassInfo loadSystemClass (String typeName){ + System.out.println("Loading class: " + typeName); return new ClassInfo( typeName, this); } diff --git a/src/peers/gov/nasa/jpf/vm/JPF_java_lang_Class.java b/src/peers/gov/nasa/jpf/vm/JPF_java_lang_Class.java index c76ecb8..651e48b 100644 --- a/src/peers/gov/nasa/jpf/vm/JPF_java_lang_Class.java +++ b/src/peers/gov/nasa/jpf/vm/JPF_java_lang_Class.java @@ -26,6 +26,12 @@ import java.util.Set; import gov.nasa.jpf.Config; import gov.nasa.jpf.annotation.MJI; +// TODO: DIRTY HACKS! +import java.lang.reflect.TypeVariable; +import sun.reflect.generics.factory.CoreReflectionFactory; +import sun.reflect.generics.factory.GenericsFactory; +import sun.reflect.generics.repository.ClassRepository; +import sun.reflect.generics.scope.ClassScope; /** * MJI NativePeer class for java.lang.Class library abstraction @@ -35,6 +41,8 @@ public class JPF_java_lang_Class extends NativePeer { static final String FIELD_CLASSNAME = "java.lang.reflect.Field"; static final String METHOD_CLASSNAME = "java.lang.reflect.Method"; static final String CONSTRUCTOR_CLASSNAME = "java.lang.reflect.Constructor"; + // TODO: DIRTY HACKS! + static final String TYPEVARIABLE_CLASSNAME = "java.lang.reflect.TypeVariable"; public static boolean init (Config conf){ // we create Method and Constructor objects, so we better make sure these @@ -146,6 +154,48 @@ public class JPF_java_lang_Class extends NativePeer { return ci.getClassObjectRef(); } + // TODO: DIRTY HACKS! + /*int createTypeVariableObject (MJIEnv env, ClassInfo objectCi, MethodInfo mi) { + // NOTE - we rely on Constructor and Method peers being initialized + if (mi.isCtor()){ + return JPF_java_lang_reflect_Constructor.createConstructorObject(env, objectCi, mi); + } else { + return JPF_java_lang_reflect_Method.createMethodObject(env, objectCi, mi); + } + } + + // accessor for factory + private GenericsFactory getFactory() { + // create scope and factory + return CoreReflectionFactory.make(this, ClassScope.make(this)); + } + + @MJI + public int getTypeParameters_____3Ljava_lang_reflect_TypeVariable_2 (MJIEnv env, int objRef){ + ClassInfo tci = getInitializedClassInfo(env, TYPEVARIABLE_CLASSNAME); + if (tci == null) { + env.repeatInvocation(); + return MJIEnv.NULL; + } + // Get the object and the type parameters + ClassInfo ci = env.getReferredClassInfo(objRef); + String signature = ci.getType(); + ClassRepository genericInfo = ClassRepository.make(signature, getFactory()); + TypeVariable[] typeVariables = (TypeVariable[]) genericInfo.getTypeParameters(); + + int aref = env.newObjectArray("Ljava/lang/reflect/TypeVariable;", typeVariables.length); + + for(int i=0, j=0; i