6125N/A/*
6125N/A * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
6125N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6125N/A *
6125N/A * This code is free software; you can redistribute it and/or modify it
6125N/A * under the terms of the GNU General Public License version 2 only, as
6125N/A * published by the Free Software Foundation.
6125N/A *
6125N/A * This code is distributed in the hope that it will be useful, but WITHOUT
6125N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6125N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
6125N/A * version 2 for more details (a copy is included in the LICENSE file that
6125N/A * accompanied this code).
6125N/A *
6125N/A * You should have received a copy of the GNU General Public License version
6125N/A * 2 along with this work; if not, write to the Free Software Foundation,
6125N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
6125N/A *
6125N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
6125N/A * or visit www.oracle.com if you need additional information or have any
6125N/A * questions.
6125N/A */
6125N/A
6125N/A/*
6125N/A * @test
6125N/A * @bug 8013557
6125N/A * @summary Tests beans with public fields
6125N/A * @author Sergey Malenkov
6125N/A */
6125N/A
6125N/Apublic class Test8013557 extends AbstractTest {
6125N/A public static void main(String[] args) {
6125N/A new Test8013557().test(true);
6125N/A }
6125N/A
6125N/A protected Object getObject() {
6125N/A return new Bean(new Value("something"));
6125N/A }
6125N/A
6125N/A @Override
6125N/A protected Object getAnotherObject() {
6125N/A return new Bean(new Value());
6125N/A }
6125N/A
6125N/A public static class Bean {
6125N/A public Value value;
6125N/A
6125N/A public Bean() {
6125N/A this.value = new Value();
6125N/A }
6125N/A
6125N/A public Bean(Value value) {
6125N/A this.value = value;
6125N/A }
6125N/A
6125N/A public void setValue(Value value) {
6125N/A this.value = value;
6125N/A }
6125N/A
6125N/A public Value getValue() {
6125N/A return this.value;
6125N/A }
6125N/A }
6125N/A
6125N/A public static class Value {
6125N/A private String string;
6125N/A
6125N/A public Value() {
6125N/A this.string = "default";
6125N/A }
6125N/A
6125N/A public Value(String value) {
6125N/A this.string = value;
6125N/A }
6125N/A
6125N/A public void setString(String string) {
6125N/A this.string = string;
6125N/A }
6125N/A
6125N/A public String getString() {
6125N/A return this.string;
6125N/A }
6125N/A }
6125N/A}