ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/loops/FinalLongTest.java
(Generate patch)

Comparing jsr166/src/test/loops/FinalLongTest.java (file contents):
Revision 1.2 by dl, Mon May 9 19:33:30 2005 UTC vs.
Revision 1.5 by jsr166, Fri Oct 22 05:18:31 2010 UTC

# Line 15 | Line 15 | public class FinalLongTest {
15      static Long n1 = new Long(22);
16      static Long n2 = new Long(23);
17      static Long n3 = new Long(23);
18 <    
18 >
19  
20      public static void main(String[] args) {
21          for (int i = 0; i < LEN; ++i)
# Line 32 | Line 32 | public class FinalLongTest {
32          }
33      }
34  
35 <    static long nextRandom(long seed) {
35 >    static long nextRandom(long seed) {
36          return (seed * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1);
37      }
38  
# Line 47 | Line 47 | public class FinalLongTest {
47              Long[] ns = nums;
48  
49              while (n-- > 0) {
50 <                //                int k = (int)(s & (LEN-1));
50 >                //                int k = (int) (s & (LEN-1));
51                  //                if (k < 0 || k >= LEN) k = 1;
52                  //                int l = (k+1) & (LEN-1);
53                  //                if (l < 0 || l >= LEN) l = 0;
54 <                //                int k = (s & 1) == 0? 0 : 1;
55 <                //                int l = (k == 0)? 1 : 0;
54 >                //                int k = (s & 1) == 0 ? 0 : 1;
55 >                //                int l = (k == 0) ? 1 : 0;
56                  if ((s & (LEN-1)) == 0) {
57                      n3 = n1;
58                      n0 = new Long(s);
# Line 78 | Line 78 | public class FinalLongTest {
78              int n = iters;
79              long s = initialSeed(this);
80              while (s != 0 && n > 0) {
81 <                long nexts; // = nums[(int)(s & (LEN-1))].longValue();
81 >                long nexts; // = nums[(int) (s & (LEN-1))].longValue();
82                  if ((s & (LEN-1)) == 0)
83                      nexts = n0.longValue();
84                  else
# Line 90 | Line 90 | public class FinalLongTest {
90                          nexts = n3.longValue();
91                  }
92  
93 <                if (nexts != s)
93 >                if (nexts != s)
94                      --n;
95                  else if (done)
96                      break;
# Line 98 | Line 98 | public class FinalLongTest {
98              }
99              done = true;
100              total += s;
101 <            if (s == 0)
101 >            if (s == 0)
102                  throw new Error("Saw uninitialized value");
103          }
104      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines