[llvm-commits] CVS: llvm-java/test/Programs/SingleSource/UnitTests/AbstractCall.java Call.java FieldAccess.java InstanceOf.java InterfaceCall.java MultipleInterfaces.java
Alkis Evlogimenos
alkis at cs.uiuc.edu
Fri Dec 10 12:47:49 PST 2004
Changes in directory llvm-java/test/Programs/SingleSource/UnitTests:
AbstractCall.java updated: 1.2 -> 1.3
Call.java updated: 1.1 -> 1.2
FieldAccess.java updated: 1.4 -> 1.5
InstanceOf.java updated: 1.4 -> 1.5
InterfaceCall.java updated: 1.1 -> 1.2
MultipleInterfaces.java updated: 1.2 -> 1.3
---
Log message:
Use static innner class to simplify naming
---
Diffs of the changes: (+113 -113)
Index: llvm-java/test/Programs/SingleSource/UnitTests/AbstractCall.java
diff -u llvm-java/test/Programs/SingleSource/UnitTests/AbstractCall.java:1.2 llvm-java/test/Programs/SingleSource/UnitTests/AbstractCall.java:1.3
--- llvm-java/test/Programs/SingleSource/UnitTests/AbstractCall.java:1.2 Fri Dec 10 14:06:14 2004
+++ llvm-java/test/Programs/SingleSource/UnitTests/AbstractCall.java Fri Dec 10 14:47:38 2004
@@ -1,17 +1,17 @@
-abstract class AbstractCallAbstract {
- abstract int abstractMethod();
+public class AbstractCall
+{
+ private static abstract class Abstract {
+ abstract int abstractMethod();
- int concreteMethod() { return abstractMethod(); }
-}
+ int concreteMethod() { return abstractMethod(); }
+ }
-class AbstractCallConcrete extends AbstractCallAbstract {
- int abstractMethod() { return 5; }
-}
+ private static class Concrete extends Abstract {
+ int abstractMethod() { return 5; }
+ }
-public class AbstractCall
-{
public static void main(String[] args) {
- AbstractCallAbstract a = new AbstractCallConcrete();
+ Abstract a = new Concrete();
Test.print_int_ln(a.concreteMethod());
}
}
Index: llvm-java/test/Programs/SingleSource/UnitTests/Call.java
diff -u llvm-java/test/Programs/SingleSource/UnitTests/Call.java:1.1 llvm-java/test/Programs/SingleSource/UnitTests/Call.java:1.2
--- llvm-java/test/Programs/SingleSource/UnitTests/Call.java:1.1 Fri Dec 10 14:09:53 2004
+++ llvm-java/test/Programs/SingleSource/UnitTests/Call.java Fri Dec 10 14:47:38 2004
@@ -1,26 +1,26 @@
-interface CallInterface {
- public int i1();
-}
+public class Call
+{
+ interface Interface {
+ public int i1();
+ }
-abstract class CallAbstract {
- protected abstract int a1();
- public int c1() { return a1() * a2(); }
- protected abstract int a2();
-}
+ private static abstract class Abstract {
+ protected abstract int a1();
+ public int c1() { return a1() * a2(); }
+ protected abstract int a2();
+ }
-class CallConcrete extends CallAbstract implements CallInterface {
- private int i;
+ private static class Concrete extends Abstract implements Interface {
+ private int i;
- CallConcrete(int i) { this.i = i; }
- public int a1() { return i; }
- public int a2() { return i + i; }
- public int i1() { return c1(); }
-}
+ Concrete(int i) { this.i = i; }
+ public int a1() { return i; }
+ public int a2() { return i + i; }
+ public int i1() { return c1(); }
+ }
-public class Call
-{
public static void main(String[] args) {
- CallInterface i = new CallConcrete(10);
+ Interface i = new Concrete(10);
Test.print_int_ln(i.i1());
}
}
Index: llvm-java/test/Programs/SingleSource/UnitTests/FieldAccess.java
diff -u llvm-java/test/Programs/SingleSource/UnitTests/FieldAccess.java:1.4 llvm-java/test/Programs/SingleSource/UnitTests/FieldAccess.java:1.5
--- llvm-java/test/Programs/SingleSource/UnitTests/FieldAccess.java:1.4 Wed Dec 8 22:11:13 2004
+++ llvm-java/test/Programs/SingleSource/UnitTests/FieldAccess.java Fri Dec 10 14:47:38 2004
@@ -1,26 +1,26 @@
-class FieldAccessBase {
- int i;
- float f;
-}
-
-class FieldAccessDerived extends FieldAccessBase {
- int i;
- double d;
-}
-
public class FieldAccess
{
+ private static class Base {
+ int i;
+ float f;
+ }
+
+ private static class Derived extends Base {
+ int i;
+ double d;
+ }
+
public static void main(String[] args) {
- FieldAccessDerived b = new FieldAccessDerived();
+ Derived b = new Derived();
b.d = 4.0;
b.i = 3;
b.f = 2.0F;
- ((FieldAccessBase) b).i = 4;
- ((FieldAccessBase) b).f = 1.0F;
+ ((Base) b).i = 4;
+ ((Base) b).f = 1.0F;
- Test.print_int_ln(((FieldAccessBase)b).i);
+ Test.print_int_ln(((Base)b).i);
Test.print_int_ln(b.i);
- Test.print_float_ln(((FieldAccessBase)b).f);
+ Test.print_float_ln(((Base)b).f);
Test.print_float_ln(b.f);
Test.print_double_ln(b.d);
}
Index: llvm-java/test/Programs/SingleSource/UnitTests/InstanceOf.java
diff -u llvm-java/test/Programs/SingleSource/UnitTests/InstanceOf.java:1.4 llvm-java/test/Programs/SingleSource/UnitTests/InstanceOf.java:1.5
--- llvm-java/test/Programs/SingleSource/UnitTests/InstanceOf.java:1.4 Mon Dec 6 17:39:58 2004
+++ llvm-java/test/Programs/SingleSource/UnitTests/InstanceOf.java Fri Dec 10 14:47:38 2004
@@ -1,38 +1,38 @@
-class InstanceOfBase
+public class InstanceOf
{
- int foo() { return 0; }
- int bar() { return 0; }
-}
+ private static class Base
+ {
+ int foo() { return 0; }
+ int bar() { return 0; }
+ }
-interface InstanceOfInterface
-{
- public int baz();
-}
+ interface Interface
+ {
+ public int baz();
+ }
-class InstanceOfDerived extends InstanceOfBase implements InstanceOfInterface
-{
- int foo() { return 1; }
- public int baz() { return foo(); }
+ private static class Derived extends Base implements Interface
+ {
+ int foo() { return 1; }
+ public int baz() { return foo(); }
-}
+ }
-public class InstanceOf
-{
public static void main(String[] args) {
- InstanceOfBase aa = new InstanceOfBase();
- InstanceOfBase ab = new InstanceOfDerived();
- InstanceOfInterface bb = new InstanceOfDerived();
-
- Test.print_boolean_ln(aa instanceof InstanceOfBase);
- Test.print_boolean_ln(aa instanceof InstanceOfDerived);
- Test.print_boolean_ln(aa instanceof InstanceOfInterface);
-
- Test.print_boolean_ln(ab instanceof InstanceOfBase);
- Test.print_boolean_ln(ab instanceof InstanceOfDerived);
- Test.print_boolean_ln(ab instanceof InstanceOfInterface);
-
- Test.print_boolean_ln(bb instanceof InstanceOfBase);
- Test.print_boolean_ln(bb instanceof InstanceOfDerived);
- Test.print_boolean_ln(bb instanceof InstanceOfInterface);
+ Base aa = new Base();
+ Base ab = new Derived();
+ Interface bb = new Derived();
+
+ Test.print_boolean_ln(aa instanceof Base);
+ Test.print_boolean_ln(aa instanceof Derived);
+ Test.print_boolean_ln(aa instanceof Interface);
+
+ Test.print_boolean_ln(ab instanceof Base);
+ Test.print_boolean_ln(ab instanceof Derived);
+ Test.print_boolean_ln(ab instanceof Interface);
+
+ Test.print_boolean_ln(bb instanceof Base);
+ Test.print_boolean_ln(bb instanceof Derived);
+ Test.print_boolean_ln(bb instanceof Interface);
}
}
Index: llvm-java/test/Programs/SingleSource/UnitTests/InterfaceCall.java
diff -u llvm-java/test/Programs/SingleSource/UnitTests/InterfaceCall.java:1.1 llvm-java/test/Programs/SingleSource/UnitTests/InterfaceCall.java:1.2
--- llvm-java/test/Programs/SingleSource/UnitTests/InterfaceCall.java:1.1 Sun Dec 5 19:05:23 2004
+++ llvm-java/test/Programs/SingleSource/UnitTests/InterfaceCall.java Fri Dec 10 14:47:38 2004
@@ -1,27 +1,27 @@
-class InterfaceCallBase implements InterfaceCallInterface
+public class InterfaceCall
{
- public int foo() { return 1; }
- public int bar() { return 2; }
-}
+ private static class Base implements Interface
+ {
+ public int foo() { return 1; }
+ public int bar() { return 2; }
+ }
-class InterfaceCallDerived extends InterfaceCallBase
-{
- public int foo() { return 100; }
- public int bar() { return super.bar() + super.foo(); }
-}
+ private static class Derived extends Base
+ {
+ public int foo() { return 100; }
+ public int bar() { return super.bar() + super.foo(); }
+ }
-interface InterfaceCallInterface
-{
- public int bar();
-}
+ interface Interface
+ {
+ public int bar();
+ }
-public class InterfaceCall
-{
public static void main(String[] args) {
- InterfaceCallInterface i = new InterfaceCallBase();
+ Interface i = new Base();
Test.print_int_ln(i.bar());
- i = new InterfaceCallDerived();
+ i = new Derived();
Test.print_int_ln(i.bar());
}
}
Index: llvm-java/test/Programs/SingleSource/UnitTests/MultipleInterfaces.java
diff -u llvm-java/test/Programs/SingleSource/UnitTests/MultipleInterfaces.java:1.2 llvm-java/test/Programs/SingleSource/UnitTests/MultipleInterfaces.java:1.3
--- llvm-java/test/Programs/SingleSource/UnitTests/MultipleInterfaces.java:1.2 Wed Dec 8 22:19:56 2004
+++ llvm-java/test/Programs/SingleSource/UnitTests/MultipleInterfaces.java Fri Dec 10 14:47:38 2004
@@ -1,32 +1,32 @@
-interface MultipleInterfacesI1
+public class MultipleInterfaces
{
- public int i1();
-}
+ interface I1
+ {
+ public int i1();
+ }
-interface MultipleInterfacesI2
-{
- public int i2();
-}
+ interface I2
+ {
+ public int i2();
+ }
-interface MultipleInterfacesI3 extends MultipleInterfacesI1, MultipleInterfacesI2
-{
- public int i3();
-}
+ interface I3 extends I1, I2
+ {
+ public int i3();
+ }
-class MultipleInterfacesClass implements MultipleInterfacesI3
-{
- public int i1() { return 1; }
- public int i2() { return 2; }
- public int i3() { return 3; }
-}
+ class C1 implements I3
+ {
+ public int i1() { return 1; }
+ public int i2() { return 2; }
+ public int i3() { return 3; }
+ }
-public class MultipleInterfaces
-{
public static void main(String[] args) {
- MultipleInterfacesClass o = new MultipleInterfacesClass();
- MultipleInterfacesI1 i1 = o;
- MultipleInterfacesI2 i2 = o;
- MultipleInterfacesI3 i3 = o;
+ C1 o = new C1();
+ I1 i1 = o;
+ I2 i2 = o;
+ I3 i3 = o;
Test.print_int_ln(o.i1());
Test.print_int_ln(o.i2());
More information about the llvm-commits
mailing list