10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 /**
26 * @test
27 * @bug 6357214
28 * @summary Hotspot server compiler gets integer comparison wrong
29 *
30 * @run main/othervm/timeout=60 -DshowAll=ffo -DeventID=444 Test6357214
31 */
32
33 // The test hangs after few iterations before the fix. So it fails if timeout.
34 class MyResult {
35 public boolean next() {
36 return true;
37 }
38
39 public String getString(String in) {
40 if (in.equals("id"))
41 return "idFoo";
42 if (in.equals("contentKey"))
43 return "ckFoo";
44 return "Foo";
45 }
46
47 public int getInt(String in) {
48 if (in.equals("processingComplete"))
49 return 0;
50 return 1;
51 }
52
53 public byte[] getBytes(String in) {
54 byte[] arr = null;
55 if (in.equals("content")) {
56 arr = new byte[65536];
57 byte j = 32;
58 for (int i=0; i<65536; i++) {
59 arr[i] = j;
60 if (++j == 127)
61 j=32;
62 }
63 }
64 return arr;
65 }
66 }
67
68 public class Test6357214 {
69 public static volatile boolean bollocks = true;
70 public String create(String context) throws Exception {
71
72 //
73 // Extract HTTP parameters
74 //
75
76 boolean showAll = System.getProperty("showAll") != null;
77 String eventID = System.getProperty("eventID");
78 String eventContentKey = System.getProperty("cKey");
79 //
80 // Build ContentStaging query based on eventID or eventContentKey
81 //
82
83 String sql = "select id, processingComplete, contentKey, content "
84 + "from ContentStaging cs, ContentStagingKey csk "
85 + "where cs.eventContentKey = csk.eventContentKey ";
86
87 if (eventID != null) {
88 sql += "and id = " + eventID;
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 /**
26 * @test
27 * @bug 6357214
28 * @summary Hotspot server compiler gets integer comparison wrong
29 *
30 * @run main/othervm/timeout=60 -DshowAll=ffo -DeventID=444 compiler.c2.Test6357214
31 */
32
33 package compiler.c2;
34
35 // The test hangs after few iterations before the fix. So it fails if timeout.
36 public class Test6357214 {
37 static class MyResult {
38 public boolean next() {
39 return true;
40 }
41
42 public String getString(String in) {
43 if (in.equals("id"))
44 return "idFoo";
45 if (in.equals("contentKey"))
46 return "ckFoo";
47 return "Foo";
48 }
49
50 public int getInt(String in) {
51 if (in.equals("processingComplete"))
52 return 0;
53 return 1;
54 }
55
56 public byte[] getBytes(String in) {
57 byte[] arr = null;
58 if (in.equals("content")) {
59 arr = new byte[65536];
60 byte j = 32;
61 for (int i=0; i<65536; i++) {
62 arr[i] = j;
63 if (++j == 127)
64 j=32;
65 }
66 }
67 return arr;
68 }
69 }
70
71 public static volatile boolean bollocks = true;
72 public String create(String context) throws Exception {
73
74 //
75 // Extract HTTP parameters
76 //
77
78 boolean showAll = System.getProperty("showAll") != null;
79 String eventID = System.getProperty("eventID");
80 String eventContentKey = System.getProperty("cKey");
81 //
82 // Build ContentStaging query based on eventID or eventContentKey
83 //
84
85 String sql = "select id, processingComplete, contentKey, content "
86 + "from ContentStaging cs, ContentStagingKey csk "
87 + "where cs.eventContentKey = csk.eventContentKey ";
88
89 if (eventID != null) {
90 sql += "and id = " + eventID;
|