< prev index next >

test/langtools/tools/javac/SuperInit/SuperInitGood.java

Print this page

  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 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  * @test
 25  * @bug 8194743
 26  * @summary Test valid placements of super()/this() in constructors
 27  * @enablePreview

 28  */
 29 
 30 import java.util.concurrent.atomic.AtomicReference;
 31 
 32 public class SuperInitGood {
 33 
 34     SuperInitGood(Object obj) {
 35     }
 36 
 37     SuperInitGood(int x) {
 38     }
 39 
 40     // Default constructor provided by compiler
 41     static class Test0 {
 42     }
 43 
 44     // No explicit calls to this()/super()
 45     static class Test1 {
 46         Test1() {
 47         }

  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 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  * @test
 25  * @bug 8194743
 26  * @summary Test valid placements of super()/this() in constructors
 27  * @enablePreview
 28  * @ignore fails at execution time because of Optional
 29  */
 30 
 31 import java.util.concurrent.atomic.AtomicReference;
 32 
 33 public class SuperInitGood {
 34 
 35     SuperInitGood(Object obj) {
 36     }
 37 
 38     SuperInitGood(int x) {
 39     }
 40 
 41     // Default constructor provided by compiler
 42     static class Test0 {
 43     }
 44 
 45     // No explicit calls to this()/super()
 46     static class Test1 {
 47         Test1() {
 48         }
< prev index next >