renamed all modules

This commit is contained in:
Andy Clement
2014-01-15 11:36:24 -08:00
parent 342420b2ed
commit ceef61cf98
1055 changed files with 301 additions and 259 deletions

View File

@@ -0,0 +1,4 @@
package abs;
public abstract class AbsImpl implements Intface {
}

View File

@@ -0,0 +1,7 @@
package abs;
public abstract class AbsImpl2 implements Intface {
public int method() {
return 2;
}
}

11
testdata/src/main/java/abs/Impl.java vendored Normal file
View File

@@ -0,0 +1,11 @@
package abs;
public class Impl extends AbsImpl {
public int method() {
return 1;
}
public static void run() {
System.out.println(new Impl().method());
}
}

8
testdata/src/main/java/abs/Impl2.java vendored Normal file
View File

@@ -0,0 +1,8 @@
package abs;
public class Impl2 extends AbsImpl2 {
public static void run() {
System.out.println(new Impl2().method());
}
}

View File

@@ -0,0 +1,5 @@
package abs;
interface Intface {
public int method();
}

View File

@@ -0,0 +1,19 @@
package accessors;
public class DefaultFields {
int defaultField = 1;
public int a() {
return defaultField;
}
public static void main(String[] args) {
DefaultFields top = new DefaultFields();
DefaultFieldsSub bot = new DefaultFieldsSub();
System.out.println(top.a());
System.out.println(bot.a());
// System.out.println(top.b());
System.out.println(bot.b());
}
}

View File

@@ -0,0 +1,10 @@
package accessors;
public class DefaultFieldsSub extends DefaultFields {
int defaultField = 2;
public int b() {
return defaultField;
}
}

View File

@@ -0,0 +1,21 @@
package accessors;
@SuppressWarnings("unused")
public class PrivateFields {
private static boolean b = false;
private static String someStaticString = "def";
private int i;
private String someString;
private long lng;
public PrivateFields() {
i = 23;
someString = "abc";
lng = 32768L;
}
}

View File

@@ -0,0 +1,34 @@
package accessors;
@SuppressWarnings("unused")
public class ProtectedFields {
protected static boolean b = false;
protected static String someStaticString = "def";
protected int i;
protected String someString;
protected long lng;
public ProtectedFields() {
i = 23;
someString = "abc";
lng = 32768L;
}
public static String run() {
new ProtectedFields().print();
return "success";
}
public void print() {
System.out.println(b);
System.out.println(someStaticString);
System.out.println(i);
System.out.println(someString);
System.out.println(lng);
}
}

View File

@@ -0,0 +1,9 @@
package annos;
@SimpleAnnotation
public class AnnotatedType {
public static void printit() {
System.out.println(AnnotatedType.class.getAnnotation(SimpleAnnotation.class));
}
}

View File

@@ -0,0 +1,9 @@
package annos;
@SimpleAnnotation
public class AnnotatedType2 {
public static void printit() {
System.out.println(">>" + AnnotatedType2.class.getAnnotation(SimpleAnnotation.class));
}
}

View File

@@ -0,0 +1,8 @@
package annos;
import java.lang.annotation.Documented;
@Documented
public @interface Foo2 {
}

26
testdata/src/main/java/annos/Play.java vendored Normal file
View File

@@ -0,0 +1,26 @@
package annos;
import java.lang.annotation.Documented;
import java.lang.reflect.Method;
public class Play {
public void run() throws Exception {
new Play().doit();
}
public static void main(String[] args) throws Exception {
new Play().doit();
}
public void doit() throws Exception {
Class<?> clazz = Documented.class;
System.out.println(clazz.getName());
Method m = clazz.getMethod("annotationType");
Documented d = Foo2.class.getAnnotation(Documented.class);
System.out.println(m);
System.out.println(d);
System.out.println(m.getDeclaringClass().getName());
}
}
// TODO $Proxy0 in the case I'm investigating is the impl of jlaDocumented.

24
testdata/src/main/java/annos/Play2.java vendored Normal file
View File

@@ -0,0 +1,24 @@
package annos;
import java.lang.annotation.Documented;
// TODO [important] need to promote these to public so that the executor can see them!
@Documented
@interface Foo {
}
public class Play2 {
public void run() {
new Play2().doit();
}
public static void main(String[] args) {
new Play2().doit();
}
public void doit() {
Documented d = Foo.class.getAnnotation(Documented.class);
System.out.println(d.annotationType());
}
}

View File

@@ -0,0 +1,9 @@
package annos;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface SimpleAnnotation {
String value() default "hello";
}

View File

@@ -0,0 +1,11 @@
package annos;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface SimpleAnnotation2 {
String value() default "hello";
int number() default 42;
}

View File

@@ -0,0 +1,5 @@
package baddata;
public class One {
}

View File

@@ -0,0 +1,7 @@
package baddata;
// Changed implemented interfaces
@SuppressWarnings("serial")
public class OneA implements java.io.Serializable {
}

View File

@@ -0,0 +1,7 @@
package baddata;
// New field added
public class OneB {
public int i;
}

12
testdata/src/main/java/basic/Basic.java vendored Normal file
View File

@@ -0,0 +1,12 @@
package basic;
public class Basic {
public void foo() {
}
public int getValue() {
return 5;
}
}

View File

@@ -0,0 +1,8 @@
package basic;
public class Basic002 {
public int getValue() {
return 7;
}
}

View File

@@ -0,0 +1,8 @@
package basic;
public class Basic003 {
public int getValue() {
return 3;
}
}

View File

@@ -0,0 +1,8 @@
package basic;
public class Basic004 {
public int getValue() {
return 4;
}
}

View File

@@ -0,0 +1,12 @@
package basic;
public class BasicB {
public void foo() {
}
public int getValue() {
return 5;
}
}

View File

@@ -0,0 +1,12 @@
package basic;
public class BasicC {
public void foo() {
}
public int getValue() {
return 5;
}
}

View File

@@ -0,0 +1,9 @@
package basic;
public class Bottom extends Top {
public void run() {
new Bottom().method();
}
}

View File

@@ -0,0 +1,13 @@
package basic;
public class Bottom2 extends Top2 {
public void method() {
System.out.println("abc");
}
public void run() {
new Bottom2().method();
}
}

8
testdata/src/main/java/basic/Top.java vendored Normal file
View File

@@ -0,0 +1,8 @@
package basic;
public class Top {
public final void method() {
}
}

View File

@@ -0,0 +1,8 @@
package basic;
public class Top2 {
public void method() {
}
}

View File

@@ -0,0 +1,26 @@
package benchmarks;
public class MethodInvoking {
int i;
public String run() {
// warmup
for (int i = 0; i < 1000000; i++) {
m();
}
// measure
long l = System.currentTimeMillis();
for (int i = 0; i < 50000000; i++) {
m();
}
return Long.toString(System.currentTimeMillis() - l);
}
public void m() {
i = 4;
}
public static void main(String[] args) {
System.out.println(new MethodInvoking().run());
}
}

View File

@@ -0,0 +1,5 @@
package builder;
public class DispatcherTestOne {
}

View File

@@ -0,0 +1,8 @@
package builder;
public class DispatcherTestOne002 {
public String toString() {
return "abc";
}
}

View File

@@ -0,0 +1,8 @@
package builder;
public class DispatcherTestOne003 {
public String foo(int i) {
return Integer.toString(i);
}
}

19
testdata/src/main/java/catchers/A.java vendored Normal file
View File

@@ -0,0 +1,19 @@
package catchers;
@SuppressWarnings("unused")
public class A {
public int publicMethod() {
return 65;
}
private int privateMethod() {
return 2222;
}
void defaultMethod() {
}
protected int protectedMethod() {
return 23;
}
}

View File

@@ -0,0 +1,8 @@
package catchers;
public class B extends A {
public Object callProtectedMethod() {
return protectedMethod();
}
}

24
testdata/src/main/java/catchers/B2.java vendored Normal file
View File

@@ -0,0 +1,24 @@
package catchers;
public class B2 extends A {
public String toString() {
return "hey!";
}
public int publicMethod() {
return 66;
}
@SuppressWarnings("unused")
private int privateMethod() {
return 4444;
}
public Object callProtectedMethod() {
return protectedMethod();
}
protected int protectedMethod() {
return 32;
}
}

View File

@@ -0,0 +1,6 @@
package catchers;
public class Bottom extends Middle {
public void foo() {
}
}

View File

@@ -0,0 +1,11 @@
package catchers;
class Super {
public final int hashCode() {
return 12;
}
}
public class Finality extends Super {
// no catcher, inherited method is final
}

View File

@@ -0,0 +1,9 @@
package catchers;
// Top provides an implementation for would normally get a catcher
public abstract class Middle extends Top {
public int hashCode() {
return 12;
}
}

View File

@@ -0,0 +1,18 @@
package catchers;
public class Runner {
B b = new B();
public String runToString() {
return b.toString();
}
public Object runPublicMethod() {
return b.publicMethod();
}
public Object runProtectedMethod() {
return b.callProtectedMethod();
}
}

View File

@@ -0,0 +1,44 @@
package catchers;
public class Runner2 {
X x = new X();
Y y = new Y();
Z z = new Z();
public int runPublicX() {
return x.publicMethod();
}
public int runPublicY() {
return y.publicMethod();
}
public int runPublicZ() {
return z.publicMethod();
}
public char runDefaultX() {
return x.defaultMethod();
}
public char runDefaultY() {
return y.defaultMethod();
}
public char runDefaultZ() {
return z.defaultMethod();
}
public long runProtectedX() {
return x.callProtectedMethod();
}
public long runProtectedY() {
return y.callProtectedMethod();
}
public long runProtectedZ() {
return z.callProtectedMethod();
}
}

View File

@@ -0,0 +1,10 @@
package catchers;
class AbstractClass {
public void setTelephone(String s) {
}
}
public class SimpleCatcher extends AbstractClass {
// should get a catcher for setTelephone
}

View File

@@ -0,0 +1,11 @@
package catchers;
// Top provides an implementation for would normally get a catcher
public abstract class Top {
public String toString() {
return "ABC";
}
// defines something that needs a catcher
public abstract void foo();
}

23
testdata/src/main/java/catchers/X.java vendored Normal file
View File

@@ -0,0 +1,23 @@
package catchers;
@SuppressWarnings("unused")
public class X {
public int publicMethod() {
return 1;
}
private void privateMethod() {
}
char defaultMethod() {
return 'a';
}
protected long protectedMethod() {
return 100;
}
public long callProtectedMethod() {
return protectedMethod();
}
}

View File

@@ -0,0 +1,5 @@
package catchers;
public class Y extends X {
}

16
testdata/src/main/java/catchers/Y2.java vendored Normal file
View File

@@ -0,0 +1,16 @@
package catchers;
public class Y2 extends X {
public int publicMethod() {
return 22;
}
char defaultMethod() {
return 'B';
}
protected long protectedMethod() {
return 200;
}
}

20
testdata/src/main/java/catchers/Z.java vendored Normal file
View File

@@ -0,0 +1,20 @@
package catchers;
@SuppressWarnings("unused")
public class Z extends Y {
public int publicMethod() {
return 3;
}
private void privateMethod() {
}
char defaultMethod() {
return 'c';
}
protected long protectedMethod() {
return 300;
}
}

Binary file not shown.

View File

@@ -0,0 +1,8 @@
//public class play {
// protected void p() {
// }
//}
//
//class x extends play {
// public void p() {}
//}

10
testdata/src/main/java/clinit/One.java vendored Normal file
View File

@@ -0,0 +1,10 @@
package clinit;
public class One {
public static int i = 5;
public static String run() {
return Integer.toString(i);
}
}

10
testdata/src/main/java/clinit/One2.java vendored Normal file
View File

@@ -0,0 +1,10 @@
package clinit;
public class One2 {
public static int i = 7;
public static String run() {
return Integer.toString(i);
}
}

View File

@@ -0,0 +1,10 @@
package clinit;
public class Three {
// i have no clinit
public static String run() {
return "1";
}
}

View File

@@ -0,0 +1,10 @@
package clinit;
public class Three2 {
// still no clinit
public static String run() {
return "1";
}
}

View File

@@ -0,0 +1,13 @@
package clinit;
public class Three3 {
static int i;
{
i = 4;
}
public static String run() {
return Integer.toString(i);
}
}

10
testdata/src/main/java/clinit/Two.java vendored Normal file
View File

@@ -0,0 +1,10 @@
package clinit;
public class Two {
public final static int i = 55;
public static String run() {
return Integer.toString(i);
}
}

10
testdata/src/main/java/clinit/Two2.java vendored Normal file
View File

@@ -0,0 +1,10 @@
package clinit;
public class Two2 {
public final static int i = 99;
public static String run() {
return Integer.toString(i);
}
}

View File

@@ -0,0 +1,7 @@
package codegen;
public class Simple {
public void method() {
}
}

View File

@@ -0,0 +1,11 @@
package com.demo;
public class Bar {
private int count = 0;
public int increment() {
return count = count + 2;
}
}

View File

@@ -0,0 +1,12 @@
package com.demo;
public class Foo {
public static void main(String[] args) {
Bar bar = new Bar();
System.out.println(bar.increment());
System.out.println(bar.increment());
System.out.println(bar.increment());
System.out.println(bar.increment());
System.out.println(bar.increment());
}
}

13
testdata/src/main/java/common/Anno.java vendored Normal file
View File

@@ -0,0 +1,13 @@
package common;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface Anno {
String id();
int someValue() default 37;
long longValue() default 2L;
}

View File

@@ -0,0 +1,7 @@
package common;
import java.lang.annotation.*;
@Retention(RetentionPolicy.RUNTIME)
public @interface Marker {
}

14
testdata/src/main/java/ctors/A.java vendored Normal file
View File

@@ -0,0 +1,14 @@
package ctors;
public class A {
String string;
A(String s) {
this.string = s;
}
public String getString() {
return string;
}
}

7
testdata/src/main/java/ctors/B.java vendored Normal file
View File

@@ -0,0 +1,7 @@
package ctors;
public class B extends A {
B(int i) {
super(new Integer(i).toString());
}
}

7
testdata/src/main/java/ctors/B2.java vendored Normal file
View File

@@ -0,0 +1,7 @@
package ctors;
public class B2 extends A {
B2(int i) {
super("27");
}
}

View File

@@ -0,0 +1,13 @@
package ctors;
public class Callee {
Callee() {
}
public String toString() {
return "callee";
}
}

View File

@@ -0,0 +1,17 @@
package ctors;
public class Callee2 {
Callee2() {
}
Callee2(String theString) {
System.out.println(theString);
}
public String toString() {
return "callee";
}
}

View File

@@ -0,0 +1,13 @@
package ctors;
public class CalleeB extends CalleeSuperB {
CalleeB() {
}
public String toString() {
return "callee";
}
}

View File

@@ -0,0 +1,18 @@
package ctors;
public class CalleeB2 extends CalleeSuperB2 {
CalleeB2() {
}
CalleeB2(String theString) {
super(32768);
System.out.println(theString);
}
public String toString() {
return "callee";
}
}

View File

@@ -0,0 +1,13 @@
package ctors;
public class CalleeSuperB {
CalleeSuperB() {
}
public String toString() {
return "callee";
}
}

View File

@@ -0,0 +1,17 @@
package ctors;
public class CalleeSuperB2 {
CalleeSuperB2() {
}
CalleeSuperB2(int i) {
System.out.println("Super number was " + i);
}
public String toString() {
return "callee";
}
}

View File

@@ -0,0 +1,13 @@
package ctors;
public class Caller {
public Object runA() {
return new Callee();
}
public Object runB() {
// ... stubbed here ...
return null;
}
}

View File

@@ -0,0 +1,12 @@
package ctors;
public class Caller2 {
public Object runA() {
return new Callee();
}
public Object runB() {
return new Callee2("abcde");
}
}

View File

@@ -0,0 +1,13 @@
package ctors;
public class CallerB {
public Object runA() {
return new CalleeB();
}
public Object runB() {
// ... stubbed here ...
return null;
}
}

View File

@@ -0,0 +1,12 @@
package ctors;
public class CallerB2 {
public Object runA() {
return new CalleeB();
}
public Object runB() {
return new CalleeB2("abcde");
}
}

View File

@@ -0,0 +1,4 @@
package ctors;
public class Default {
}

View File

@@ -0,0 +1,16 @@
package ctors;
public class Finals {
public final int i = 324;
public static final String s = "abc";
public Finals() {
}
public String getValue() {
return i + " " + s;
}
}

View File

@@ -0,0 +1,16 @@
package ctors;
public class Finals2 {
public final int i = 324;
public static final String s = "def";
public Finals2() {
}
public String getValue() {
return i + " " + s;
}
}

23
testdata/src/main/java/ctors/JR.java vendored Normal file
View File

@@ -0,0 +1,23 @@
package ctors;
public class JR {
public JR(int i) {
}
public static String printMessage() {
return "hello";
}
public static JR getInstance() {
return new JR(42);
}
public Object getFieldReflectively() throws Exception {
return null;
}
public void setFieldReflectively(int value) throws Exception {
}
}

36
testdata/src/main/java/ctors/JR2.java vendored Normal file
View File

@@ -0,0 +1,36 @@
package ctors;
import java.lang.reflect.Field;
public class JR2 {
int field = 34;
public JR2(int i) {
}
public JR2() {
}
public static String printMessage() {
return "goodbye";
}
public static JR2 getInstance() {
return new JR2();
}
public Object getFieldReflectively() throws Exception {
Field f = this.getClass().getDeclaredField("field");
return f.get(this);
}
public void setFieldReflectively(int value) throws Exception {
Field f = this.getClass().getDeclaredField("field");
f.setAccessible(true);
f.set(this,value);
}
}

7
testdata/src/main/java/ctors/One.java vendored Normal file
View File

@@ -0,0 +1,7 @@
package ctors;
public class One {
public One() {
System.out.println("Hello Andy");
}
}

View File

@@ -0,0 +1,7 @@
package ctors;
public class One2 {
public One2() {
System.out.println("Hello World");
}
}

View File

@@ -0,0 +1,26 @@
package ctors;
public class Setter {
public int integer;
public String string;
public Setter setter;
Setter() {
integer = 1;
string = "one";
}
public String toString() {
return "instance of Setter";
}
public int getInteger() {
return integer;
}
public String getString() {
return string;
}
}

View File

@@ -0,0 +1,25 @@
package ctors;
public class Setter2 {
public int integer;
public String string;
Setter2() {
integer = 2;
string = "two";
}
public String toString() {
return "instance of Setter";
}
public int getInteger() {
return integer;
}
public String getString() {
return string;
}
}

View File

@@ -0,0 +1,24 @@
package ctors;
public class Setter3 {
public int integer;
public String string;
Setter3() {
integer = 3;
}
public String toString() {
return "instance of Setter";
}
public int getInteger() {
return integer;
}
public String getString() {
return string;
}
}

View File

@@ -0,0 +1,8 @@
package ctors;
public class SuperThree {
SuperThree() {
System.err.print("Hello from SuperThree.");
}
}

View File

@@ -0,0 +1,8 @@
package ctors;
public class SuperThree2 {
SuperThree2() {
System.err.print("Hello from SuperThree2.");
}
}

View File

@@ -0,0 +1,8 @@
package ctors;
public class Three extends SuperThree {
Three() {
System.err.println("Hello from Three.");
}
}

View File

@@ -0,0 +1,8 @@
package ctors;
public class Three2 extends SuperThree {
Three2() {
System.err.println("Hello from Three2.");
}
}

BIN
testdata/src/main/java/ctors/Two.class vendored Normal file

Binary file not shown.

6
testdata/src/main/java/ctors/Two.java vendored Normal file
View File

@@ -0,0 +1,6 @@
package ctors;
public class Two {
Two(String message) {
System.out.println(message);
}
}

View File

@@ -0,0 +1,6 @@
package ctors;
public class Two2 {
Two2(String message) {
System.out.println(message+message);
}
}

16
testdata/src/main/java/ctors/Utils.java vendored Normal file
View File

@@ -0,0 +1,16 @@
package ctors;
public class Utils {
public static String stack(int n) {
StringBuilder s = new StringBuilder();
StackTraceElement[] ste = Thread.currentThread().getStackTrace();
// Skip the currentThread() entry and this stack() entry
if (ste[1].toString().indexOf("stack(") == -1) {
throw new IllegalStateException("Assumed stack was entry 2");
}
s.append(ste[2]).append("\n");
return s.toString();
}
}

15
testdata/src/main/java/ctors/V.java vendored Normal file
View File

@@ -0,0 +1,15 @@
package ctors;
public class V {
int i = 1;
int j = 2;
public V() {
printMessage();
}
public static void printMessage() {
System.out.println("Hello");
}
}

15
testdata/src/main/java/ctors/V2.java vendored Normal file
View File

@@ -0,0 +1,15 @@
package ctors;
public class V2 {
int i = 1;
int j = 2;
public V2() {
printMessage();
}
public static void printMessage() {
System.out.println("Hello");
}
}

15
testdata/src/main/java/ctors/V3.java vendored Normal file
View File

@@ -0,0 +1,15 @@
package ctors;
public class V3 {
int i = 1;
int j = 4; // changed in this version
public V3() {
printMessage();
}
public static void printMessage() {
System.out.println("Goodbye");
}
}

8
testdata/src/main/java/ctors/XX.java vendored Normal file
View File

@@ -0,0 +1,8 @@
package ctors;
public class XX {
public XX() {
System.out.println(Utils.stack(2));
}
}

9
testdata/src/main/java/ctors/XX2.java vendored Normal file
View File

@@ -0,0 +1,9 @@
package ctors;
public class XX2 {
public XX2() {
System.err.println("sometext");
System.out.println(Utils.stack(2));
}
}

View File

@@ -0,0 +1,13 @@
package data;
public aspect AnAspect {
before(): execution(!static * AspectReceiver.*(..)) {
System.out.println("Foo");
}
pointcut boo(String foo,String bar): execution(* *(..)) && args(foo,bar);
before(String foo): boo(foo,*) {
}
}

5
testdata/src/main/java/data/Anno.java vendored Normal file
View File

@@ -0,0 +1,5 @@
package data;
public @interface Anno {
}

View File

@@ -0,0 +1,10 @@
package data;
@Anno
public class AnnotatedClazz {
@Anno
public void moo() {
}
}

Some files were not shown because too many files have changed in this diff Show More