langtools/test/tools/javac/6917288/GraphicalInstaller.java
author mcimadamore
Thu, 03 Feb 2011 09:38:19 +0000
changeset 8239 d2c934e951e2
parent 6029 89f2c9b62d31
permissions -rw-r--r--
7014715: javac returns different error code for certain failure(s) Summary: javac silently crashes when emitting certain kinds of resolution diagnostics Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6029
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
     1
/*
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
     2
 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
     4
 *
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
     7
 * published by the Free Software Foundation.
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
     8
 *
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    13
 * accompanied this code).
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    14
 *
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    18
 *
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    21
 * questions.
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    22
 */
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    23
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    24
/**
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    25
 * Complex example for the "access constructor tags" issue.
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    26
 * This test causes Lower to evaluate all classes defined in installNext
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    27
 * before they are lowered, thus preventing the use of Lower.classdefs
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    28
 * as a way of determining whether a class has been translated or not.
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    29
 */
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    30
class GraphicalInstaller  {
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    31
    private BackgroundInstaller backgroundInstaller;
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    32
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    33
    private void installNext() {
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    34
        final Integer x = 0;
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    35
        class X {
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    36
          Object o = new Object() { int y = x; };
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    37
        };
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    38
        new X();
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    39
        if (false) {
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    40
            new Runnable(){
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    41
                public void run() {
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    42
                }
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    43
            };
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    44
        }
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    45
    }
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    46
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    47
    private void installSuiteCommon() {
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    48
        backgroundInstaller = new BackgroundInstaller();
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    49
    }
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    50
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    51
    private static class BackgroundInstaller {
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    52
        private BackgroundInstaller() {
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    53
        }
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    54
    }
89f2c9b62d31 6917288: Unnamed nested class is not generated
jjg
parents:
diff changeset
    55
}