< prev index next >

langtools/test/tools/javap/4111861/T4111861.java

Print this page




  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 import java.io.*;
  25 
  26 /*
  27  * @test
  28  * @bug 4111861
  29  * @summary static final field contents are not displayed
  30  * @modules jdk.compiler
  31  */
  32 public class T4111861 {
  33     public static void main(String... args) throws Exception {
  34         new T4111861().run();
  35     }
  36 
  37     void run() throws Exception {
  38         File testSrc = new File(System.getProperty("test.src", "."));
  39         File a_java = new File(testSrc, "A.java");
  40         javac("-d", ".", a_java.getPath());
  41 
  42         String out = javap("-classpath", ".", "-constants", "A");
  43 
  44         String a = read(a_java);
  45 
  46         if (!filter(out).equals(filter(read(a_java)))) {
  47             System.out.println(out);
  48             throw new Exception("unexpected output");
  49         }
  50     }




  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 import java.io.*;
  25 
  26 /*
  27  * @test
  28  * @bug 4111861
  29  * @summary static final field contents are not displayed
  30  * @modules jdk.jdeps
  31  */
  32 public class T4111861 {
  33     public static void main(String... args) throws Exception {
  34         new T4111861().run();
  35     }
  36 
  37     void run() throws Exception {
  38         File testSrc = new File(System.getProperty("test.src", "."));
  39         File a_java = new File(testSrc, "A.java");
  40         javac("-d", ".", a_java.getPath());
  41 
  42         String out = javap("-classpath", ".", "-constants", "A");
  43 
  44         String a = read(a_java);
  45 
  46         if (!filter(out).equals(filter(read(a_java)))) {
  47             System.out.println(out);
  48             throw new Exception("unexpected output");
  49         }
  50     }


< prev index next >