]> git.uio.no Git - ifi-stolz-refaktor.git/commitdiff
Example: adding grand example code
authorErlend Kristiansen <erlenkr@ifi.uio.no>
Wed, 23 Apr 2014 14:08:38 +0000 (16:08 +0200)
committerErlend Kristiansen <erlenkr@ifi.uio.no>
Wed, 23 Apr 2014 14:08:38 +0000 (16:08 +0200)
software/no.uio.ifi.refaktor.examples/examples/src/grandExample/A.java [new file with mode: 0644]
software/no.uio.ifi.refaktor.examples/examples/src/grandExample/B.java [new file with mode: 0644]
software/no.uio.ifi.refaktor.examples/examples/src/grandExample/Main.java [new file with mode: 0644]

diff --git a/software/no.uio.ifi.refaktor.examples/examples/src/grandExample/A.java b/software/no.uio.ifi.refaktor.examples/examples/src/grandExample/A.java
new file mode 100644 (file)
index 0000000..39a9c9b
--- /dev/null
@@ -0,0 +1,8 @@
+package grandExample;
+
+public class A {
+       public void foo() {
+       }
+       public void bar() {
+       }
+}
\ No newline at end of file
diff --git a/software/no.uio.ifi.refaktor.examples/examples/src/grandExample/B.java b/software/no.uio.ifi.refaktor.examples/examples/src/grandExample/B.java
new file mode 100644 (file)
index 0000000..1838cb1
--- /dev/null
@@ -0,0 +1,5 @@
+package grandExample;
+
+public class B {
+       A a;
+}
\ No newline at end of file
diff --git a/software/no.uio.ifi.refaktor.examples/examples/src/grandExample/Main.java b/software/no.uio.ifi.refaktor.examples/examples/src/grandExample/Main.java
new file mode 100644 (file)
index 0000000..719fcbb
--- /dev/null
@@ -0,0 +1,25 @@
+package grandExample;
+
+class C {
+       A a; B b; boolean bool;
+
+       void method(int val) {
+               if (bool) {
+                       a.foo();
+                       a = new A();
+                       a.bar();
+               }
+
+               a.foo();
+               a.bar();
+
+               switch (val) {
+               case 1:
+                       b.a.foo();
+                       b.a.bar();
+                       break;
+               default:
+                       a.foo();
+               }
+       }
+}
\ No newline at end of file