Tue, 03 Jun 2008 13:26:47 -0700
4075303: Use javap to enquire aboput a specific inner class
4348375: Javap is not internationalized
4459541: "javap -l" shows line numbers as signed short; they should be unsigned
4501660: change diagnostic of -help as 'print this help message and exit'
4776241: unused source file in javap...
4870651: javap should recognize generics, varargs, enum
4876942: javap invoked without args does not print help screen
4880663: javap could output whitespace between class name and opening brace
4975569: javap doesn't print new flag bits
6271787: javap dumps LocalVariableTypeTable attribute in hex, needs to print a table
6305779: javap: support annotations
6439940: Clean up javap implementation
6469569: wrong check of searchpath in JavapEnvironment
6474890: javap does not open .zip files in -classpath
6587786: Javap throws error : "ERROR:Could not find <classname>" for JRE classes
6622215: javap ignores certain relevant access flags
6622216: javap names some attributes incorrectly
6622232: javap gets whitespace confused
6622260: javap prints negative bytes incorrectly in hex
Reviewed-by: ksrini
1 #!/bin/sh
3 #
4 # Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
5 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 #
7 # This code is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License version 2 only, as
9 # published by the Free Software Foundation.
10 #
11 # This code is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # version 2 for more details (a copy is included in the LICENSE file that
15 # accompanied this code).
16 #
17 # You should have received a copy of the GNU General Public License version
18 # 2 along with this work; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 #
21 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 # CA 95054 USA or visit www.sun.com if you need additional information or
23 # have any questions.
24 #
27 # @test
28 # @bug 4461214 6227587
29 # @summary support-version and -fullversion
30 # @run shell versionOpt.sh
32 if [ "${TESTJAVA}" = "" ]
33 then
34 echo "TESTJAVA not set. Test cannot execute. Failed."
35 exit 1
36 fi
37 echo "TESTJAVA=${TESTJAVA}"
39 # set platform-dependent variables
40 OS=`uname -s`
41 case "$OS" in
42 SunOS | Linux )
43 NULL=/dev/null
44 PS=":"
45 FS="/"
46 ;;
47 Windows* )
48 NULL=NUL
49 PS=";"
50 FS="\\"
51 ;;
52 * )
53 echo "Unrecognized system!"
54 exit 1;
55 ;;
56 esac
58 # create reference files based on java values
59 "${TESTJAVA}${FS}bin${FS}java" ${TESTVMOPTS} -version 2>&1 | \
60 sed -e 's/java version "\([^"]*\)"/javac \1/' -e '2,$d' > version.ref.out
62 "${TESTJAVA}${FS}bin${FS}java" ${TESTVMOPTS} -fullversion 2>&1 | \
63 sed -e 's/java full version/javac full version/' -e '2,$d' > fullversion.ref.out
65 # run javac
66 "${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -version 2> version.out
67 cat version.out
68 diff -c version.ref.out version.out
69 version_result=$?
71 "${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -fullversion 2> fullversion.out
72 cat fullversion.out
73 diff -c fullversion.ref.out fullversion.out
74 fullversion_result=$?
76 if [ $version_result -eq 0 -a $fullversion_result -eq 0 ]
77 then
78 echo "Passed"
79 exit 0
80 else
81 echo "Failed"
82 exit 1
83 fi