jdk/test/java/beans/XMLEncoder/Test8027066.java
author alitvinov
Fri, 25 Oct 2013 13:41:19 +0400
changeset 21273 802d3ddab4ec
permissions -rw-r--r--
8027066: XMLDecoder in java 7 cannot properly deserialize object arrays Reviewed-by: alexsch, malenkov Contributed-by: anton.nashatyrev@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
21273
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
     1
/*
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
     2
 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
     4
 *
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
     7
 * published by the Free Software Foundation.
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
     8
 *
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    13
 * accompanied this code).
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    14
 *
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    18
 *
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    21
 * questions.
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    22
 */
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    23
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    24
/*
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    25
 * @test
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    26
 * @bug 8027066
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    27
 * @summary Tests that the same array can be encoded twice
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    28
 * @author Anton Nashatyrev
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    29
 */
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    30
public class Test8027066 extends AbstractTest<String[][]> {
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    31
    public static void main(String[] args) {
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    32
        new Test8027066().test(true);
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    33
    }
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    34
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    35
    @Override
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    36
    protected String[][] getObject() {
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    37
        String[] strings = {"first", "second"};
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    38
        String[][] arrays = {strings, strings};
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    39
        return arrays;
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    40
    }
802d3ddab4ec 8027066: XMLDecoder in java 7 cannot properly deserialize object arrays
alitvinov
parents:
diff changeset
    41
}