/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* @test
* @summary it is new version of old test which was under
* Test of serialization/deserialization of
* objects as arrays of arrays
*/
public class ArraysOfArrays {
"serialization/deserialization of objects as " +
"arrays of arrays \n");
try {
byte b[][] = {{ 0, 1}, {2,3}};
p.writeObject((Object)b);
short s[][] = {{ 0, 1, 2}, {3,4,5}};
p.writeObject((Object)s);
char c[][] = {{ 0, 1, 2, 3}, {4, 5, 6, 7}};
p.writeObject((Object)c);
int i[][] = {{ 0, 1, 2, 3, 4}, {5, 6, 7, 8, 9}};
p.writeObject((Object)i);
long l[][] = {{ 0, 1, 2, 3, 4, 5}, {6,7,8,9,10,11}};
p.writeObject((Object)l);
boolean z[][] = new boolean[2][2];
z[0][0] = true;
z[0][1] = false;
z[1] = z[0]; // Use first row same as second
p.writeObject((Object)z);
float f[][] = {{ 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f},
{ 1.1f, 2.1f, 3.1f, 4.1f, 5.1f, 6.1f}};
p.writeObject((Object)f);
double d[][] = {{ 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0d},
{ 1.1f, 2.1f, 3.1f, 4.1f, 5.1f, 6.1f, 7.1d}};
p.writeObject((Object)d);
p.flush();
/* Now read them back and verify
*/
byte b_u[][] = (byte [][]) (q.readObject());
throw new Error();
}
}
}
short s_u[][] = (short [][])(q.readObject());
throw new Error();
}
}
}
char c_u[][] = (char [][])(q.readObject());
throw new Error();
}
}
}
int i_u[][] = (int [][])(q.readObject());
throw new Error();
}
}
}
long l_u[][] = (long [][])(q.readObject());
throw new Error();
}
}
}
boolean z_u[][] = (boolean [][])(q.readObject());
throw new Error();
}
}
}
float f_u[][] = (float [][])(q.readObject());
throw new Error();
}
}
}
double d_u[][] = (double [][])(q.readObject());
throw new Error();
}
}
}
throw new Error();
}
}
}
} catch (Exception e) {
e.printStackTrace();
int ch;
try {
}
} catch (Exception f) {
throw new Error();
}
throw new Error();
} finally {
}
}
}