projects
/
IRC.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
having new variable 'inter' in-between "reorder/antialias" and "hybrid" in order...
[IRC.git]
/
Robust
/
src
/
Tests
/
Atomic4.java
diff --git
a/Robust/src/Tests/Atomic4.java
b/Robust/src/Tests/Atomic4.java
index 0f59381efe6d207d668572041be7bd822b756e76..3034dc33784c5ad57161af504d924b84eb5208f8 100644
(file)
--- a/
Robust/src/Tests/Atomic4.java
+++ b/
Robust/src/Tests/Atomic4.java
@@
-1,30
+1,34
@@
public class Atomic4 extends Thread {
public class Atomic4 extends Thread {
+ public People[] team;
public Atomic4() {
public Atomic4() {
- People[] team = new People[2];
}
}
- People[] team;
public static void main(String[] st) {
int mid = (128<<24)|(195<<16)|(175<<8)|70;
public static void main(String[] st) {
int mid = (128<<24)|(195<<16)|(175<<8)|70;
- int b
,c
;
+ int b
= 0,c = 0
;
Integer age;
Integer age;
- String name;
Atomic4 at4 = null;
Atomic4 at4 = null;
+
atomic {
at4 = global new Atomic4();
atomic {
at4 = global new Atomic4();
+ at4.team = global new People[2];
+ at4.team[0] = global new People();
+ at4.team[1] = global new People();
+ }
+ atomic {
age = global new Integer(35);
age = global new Integer(35);
- name = global new String("Harry Potter");
- at4.team[0] = global new People(name, age);
+ at4.team[0].age = age;
b = at4.team[0].getAge();
}
atomic {
age = global new Integer(70);
b = at4.team[0].getAge();
}
atomic {
age = global new Integer(70);
- name = global new String("Harry Potter");
- at4.team[1] = global new People(name,age);
+ at4.team[1].age = age;
c = at4.team[1].getAge();
}
System.printInt(b);
System.printString("\n");
c = at4.team[1].getAge();
}
System.printInt(b);
System.printString("\n");
+ System.printInt(c);
+ System.printString("\n");
System.printString("Starting\n");
at4.start(mid);
System.printString("Finished\n");
System.printString("Starting\n");
at4.start(mid);
System.printString("Finished\n");
@@
-34,19
+38,19
@@
public class Atomic4 extends Thread {
}
public int run() {
}
public int run() {
- String name;
- int a;
+ int ag;
boolean old = false;
atomic {
boolean old = false;
atomic {
- //FIXME a bug value of trans commit is not saved
- //a = root.value.intValue();
- a = team[1].getAge();
- name = team[1].getName();
- if(a > 65)
+ ag = team[1].getAge();
+ //ag = team[0].getAge();
+ if(ag > 65)
old = true;
}
if(old){
old = true;
}
if(old){
- System.printString(name + " gets Pension");
+ System.printString("Gets Pension");
+ System.printString("\n");
+ } else {
+ System.printString("Gets No Pension");
System.printString("\n");
}
}
System.printString("\n");
}
}
@@
-56,11
+60,22
@@
public class People {
String name;
Integer age;
String name;
Integer age;
+ public People() {
+ }
+
public People(String name, Integer age) {
this.name = name;
this.age = age;
}
public People(String name, Integer age) {
this.name = name;
this.age = age;
}
+ public void setName(String n) {
+ name = n;
+ }
+
+ public void setAge(Integer a) {
+ age = a;
+ }
+
public String getName() {
return name;
}
public String getName() {
return name;
}
@@
-72,6
+87,6
@@
public class People {
public boolean isSenior() {
if(this.getAge() > 65)
return true;
public boolean isSenior() {
if(this.getAge() > 65)
return true;
- return false;
;
+ return false;
}
}
}
}