Author: pferraro
Date: 2008-09-23 21:37:12 -0400 (Tue, 23 Sep 2008)
New Revision: 1895
Modified:
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/HeapMemoryLoadServlet.java
Log:
Workaround for javac bug:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4941882
Modified:
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/HeapMemoryLoadServlet.java
===================================================================
---
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/HeapMemoryLoadServlet.java 2008-09-23
15:51:53 UTC (rev 1894)
+++
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/HeapMemoryLoadServlet.java 2008-09-24
01:37:12 UTC (rev 1895)
@@ -45,8 +45,17 @@
long free = Runtime.getRuntime().freeMemory();
@SuppressWarnings("unused")
- Object array = (free > Integer.MAX_VALUE) ? new byte[Integer.MAX_VALUE][(int)
free / Integer.MAX_VALUE] : new byte[(int) free];
+ Object array = null;
+ if (free > Integer.MAX_VALUE)
+ {
+ array = new byte[Integer.MAX_VALUE][(int) free / Integer.MAX_VALUE];
+ }
+ else
+ {
+ array = new byte[(int) free];
+ }
+
try
{
Thread.sleep(duration);